Skip to content
This repository was archived by the owner on Feb 2, 2018. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions app/helpers/redmine_markdown_extra_formatter/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ module Helper
unloadable

def wikitoolbar_for(field_id)
url = Redmine::Utils.relative_url_root +
Engines::RailsExtensions::AssetHelpers.plugin_asset_path('redmine_markdown_extra_formatter', 'help', 'markdown_extra_syntax.html')
heads_for_wiki_formatter

# Only way we have to link to a public resource.(?)
#url = "#{Redmine::Utils.relative_url_root}/help/wiki_syntax.html"

url = Engines::RailsExtensions::AssetHelpers.plugin_asset_path('redmine_markdown_extra_formatter', 'help', 'markdown_extra_syntax.html')

help_link = l(:setting_text_formatting) + ': ' +
link_to(l(:label_help), url,
:onclick => "window.open(\"#{url}\", \"\", \"resizable=yes, location=no, width=300, height=640, menubar=no, status=no, scrollbars=yes\"); return false;")
Expand All @@ -21,8 +26,14 @@ def initial_page_content(page)
end

def heads_for_wiki_formatter
stylesheet_link_tag('jstoolbar') +
stylesheet_link_tag('markdown_extra', :plugin => 'redmine_markdown_extra_formatter')
unless @heads_for_wiki_formatter_included
content_for :header_tags do
stylesheet_link_tag('jstoolbar') +
stylesheet_link_tag('markdown_extra', :plugin => 'redmine_markdown_extra_formatter')
end
@heads_for_wiki_formatter_included = true
end
end

end
end