diff options
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') |