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'
%{
#{controller.view_context.stylesheet_link_tag 'aloha/css/aloha.css'}
#{controller.view_context.javascript_include_tag 'locomotive/aloha', :'data-aloha-plugins' => plugins}
}
else
''
end
end
end
::Liquid::Template.register_tag('inline_editor', InlineEditor)
end
end
end