summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-03-28 19:59:35 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-03-28 19:59:35 +0000
commitbf58ad61e57adcb9ec83af83c030420f1a84973e (patch)
tree4b246410599d059b38cb907ab109198797e885fb /lib
parent70d765e906a50e672ab4534882db6f85abf7cc4c (diff)
downloadredmine-bf58ad61e57adcb9ec83af83c030420f1a84973e.tar.gz
redmine-bf58ad61e57adcb9ec83af83c030420f1a84973e.zip
Load scripts and css for wiki formatter toolbar when needed.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5239 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/wiki_formatting/textile/helper.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/redmine/wiki_formatting/textile/helper.rb b/lib/redmine/wiki_formatting/textile/helper.rb
index d6d779af9..639e15927 100644
--- a/lib/redmine/wiki_formatting/textile/helper.rb
+++ b/lib/redmine/wiki_formatting/textile/helper.rb
@@ -20,6 +20,7 @@ module Redmine
module Textile
module Helper
def wikitoolbar_for(field_id)
+ heads_for_wiki_formatter
# Is there a simple way to link to a public resource?
url = "#{Redmine::Utils.relative_url_root}/help/wiki_syntax.html"
@@ -35,11 +36,15 @@ module Redmine
end
def heads_for_wiki_formatter
- @@heads_for_wiki_formatter ||=
- javascript_include_tag('jstoolbar/jstoolbar') +
- javascript_include_tag('jstoolbar/textile') +
- javascript_include_tag("jstoolbar/lang/jstoolbar-#{current_language.to_s.downcase}") +
- stylesheet_link_tag('jstoolbar')
+ unless @heads_for_wiki_formatter_included
+ 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}") +
+ stylesheet_link_tag('jstoolbar')
+ end
+ @heads_for_wiki_formatter_included = true
+ end
end
end
end