Sha256: f6931845bda10a2fd23ea406373b329d440407156a1fb877db5b48c5da6c4c8c
Contents?: true
Size: 1.17 KB
Versions: 5
Compression:
Stored size: 1.17 KB
Contents
module Liquid module Locomotive module Tags class InlineEditor < ::Liquid::Tag def render(context) if context.registers[:current_locomotive_account] && context.registers[:inline_editor] controller = context.registers[:controller] plugins = 'common/format,common/table,common/list,common/link,common/highlighteditables,common/block,common/undo,common/contenthandler,common/paste,common/commands,common/abbr,common/horizontalruler' %{ <meta content="true" name="inline-editor" /> #{controller.view_context.stylesheet_link_tag 'aloha/css/aloha.css'} #{controller.view_context.javascript_include_tag 'locomotive/aloha', :'data-aloha-plugins' => plugins} <script type="text/javascript"> Aloha.ready(function() \{ window.parent.application_view.set_page(#{context.registers[:page].to_presenter.as_json_for_html_view.to_json}); \}); </script> } else '' end end end ::Liquid::Template.register_tag('inline_editor', InlineEditor) end end end
Version data entries
5 entries across 5 versions & 1 rubygems