diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-12-10 13:34:07 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2020-12-10 13:34:07 +0000 |
commit | e6b7534345f98d8a3f86a40df37727b0c1050e52 (patch) | |
tree | 1088580d43405a8c52ffd5b9c4d60bf8dbde1510 /lib | |
parent | 6caaba93ba3c45fe40b3d7c14ec021885a2aaafb (diff) | |
download | redmine-e6b7534345f98d8a3f86a40df37727b0c1050e52.tar.gz redmine-e6b7534345f98d8a3f86a40df37727b0c1050e52.zip |
shorten long line of lib/redmine/wiki_formatting/textile/helper.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@20610 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/wiki_formatting/textile/helper.rb | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/redmine/wiki_formatting/textile/helper.rb b/lib/redmine/wiki_formatting/textile/helper.rb index 6e6009f09..7d121a41b 100644 --- a/lib/redmine/wiki_formatting/textile/helper.rb +++ b/lib/redmine/wiki_formatting/textile/helper.rb @@ -25,7 +25,11 @@ module Redmine 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.setPreviewUrl('#{escape_javascript preview_url}'); wikiToolbar.draw();") + javascript_tag( + "var wikiToolbar = new jsToolBar(document.getElementById('#{field_id}')); " \ + "wikiToolbar.setHelpLink('#{escape_javascript url}'); " \ + "wikiToolbar.setPreviewUrl('#{escape_javascript preview_url}'); wikiToolbar.draw();" + ) end def initial_page_content(page) @@ -35,12 +39,19 @@ module Redmine def heads_for_wiki_formatter unless @heads_for_wiki_formatter_included toolbar_language_options = User.current && User.current.pref.toolbar_language_options + lang = + if toolbar_language_options.nil? + UserPreference::DEFAULT_TOOLBAR_LANGUAGE_OPTIONS + else + toolbar_language_options.split(',') + end content_for :header_tags do 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};" + - "var userHlLanguages = #{(toolbar_language_options.nil? ? UserPreference::DEFAULT_TOOLBAR_LANGUAGE_OPTIONS : toolbar_language_options.split(',')).to_json};") + + javascript_tag( + "var wikiImageMimeTypes = #{Redmine::MimeType.by_type('image').to_json};" \ + "var userHlLanguages = #{lang.to_json};") + stylesheet_link_tag('jstoolbar') end @heads_for_wiki_formatter_included = true |