diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2018-09-26 07:27:30 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2018-09-26 07:27:30 +0000 |
commit | b9fa262165601a3b348d22ca1d8da53bda99e55b (patch) | |
tree | 21bd632e051addfee01ab7a568b01f5b6428051a /lib/redmine/wiki_formatting/textile | |
parent | c171797673f549e434dd6b94f7262fd31a77b533 (diff) | |
download | redmine-b9fa262165601a3b348d22ca1d8da53bda99e55b.tar.gz redmine-b9fa262165601a3b348d22ca1d8da53bda99e55b.zip |
Adds preview option to the wiki toolbar (#27758).
Patch by Marius BALTEANU.
git-svn-id: http://svn.redmine.org/redmine/trunk@17521 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/wiki_formatting/textile')
-rw-r--r-- | lib/redmine/wiki_formatting/textile/helper.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/redmine/wiki_formatting/textile/helper.rb b/lib/redmine/wiki_formatting/textile/helper.rb index 92c7c880f..6e8ba9812 100644 --- a/lib/redmine/wiki_formatting/textile/helper.rb +++ b/lib/redmine/wiki_formatting/textile/helper.rb @@ -19,11 +19,11 @@ module Redmine module WikiFormatting module Textile module Helper - def wikitoolbar_for(field_id) + def wikitoolbar_for(field_id, preview_url = preview_text_path) heads_for_wiki_formatter # Is there a simple way to link to a public resource? url = "#{Redmine::Utils.relative_url_root}/help/#{current_language.to_s.downcase}/wiki_syntax_textile.html" - javascript_tag("var wikiToolbar = new jsToolBar(document.getElementById('#{field_id}')); wikiToolbar.setHelpLink('#{escape_javascript url}'); wikiToolbar.draw();") + javascript_tag("var wikiToolbar = new jsToolBar(document.getElementById('#{field_id}')); wikiToolbar.setHelpLink('#{escape_javascript url}'); wikiToolbar.setPreviewUrl('#{preview_url}'); wikiToolbar.draw();") end def initial_page_content(page) @@ -33,7 +33,8 @@ module Redmine def heads_for_wiki_formatter unless @heads_for_wiki_formatter_included content_for :header_tags do - javascript_include_tag('jstoolbar/jstoolbar-textile.min') + + javascript_include_tag('jstoolbar/jstoolbar') + + javascript_include_tag('jstoolbar/textile') + javascript_include_tag("jstoolbar/lang/jstoolbar-#{current_language.to_s.downcase}") + javascript_tag("var wikiImageMimeTypes = #{Redmine::MimeType.by_type('image').to_json};") + stylesheet_link_tag('jstoolbar') |