Commit 8c57b95c authored by Jean-Philippe Lang's avatar Jean-Philippe Lang Committed by Eric Davis

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
parent d16db344
......@@ -11,7 +11,6 @@
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= heads_for_wiki_formatter %>
<!--[if IE 6]>
<style type="text/css">
* html body{ width: expression( document.documentElement.clientWidth < 900 ? '900px' : '100%' ); }
......
......@@ -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"
......@@ -36,11 +37,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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment