]> source.dussan.org Git - redmine.git/commitdiff
Do not use compute_public_path.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 4 Jan 2009 12:50:45 +0000 (12:50 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 4 Jan 2009 12:50:45 +0000 (12:50 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2228 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/wiki_formatting/textile/helper.rb

index af021f990eea1f32ee75ab9a9fed5751c7e9295b..22fa35783652fc8cd30284050df7e7c4ff244b81 100644 (file)
@@ -20,9 +20,13 @@ module Redmine
     module Textile
       module Helper
         def wikitoolbar_for(field_id)
+          # Is there a simple way to link to a public resource?
+          prefix = (ActionController::Base.respond_to?(:relative_url_root) ? ActionController::Base.relative_url_root : ActionController::AbstractRequest.relative_url_root)
+          url = "#{prefix}/help/wiki_syntax.html"
+          
           help_link = l(:setting_text_formatting) + ': ' +
-            link_to(l(:label_help), compute_public_path('wiki_syntax', 'help', 'html'),
-                    :onclick => "window.open(\"#{ compute_public_path('wiki_syntax', 'help', 'html') }\", \"\", \"resizable=yes, location=no, width=300, height=640, menubar=no, status=no, scrollbars=yes\"); return false;")
+            link_to(l(:label_help), url,
+                    :onclick => "window.open(\"#{ url }\", \"\", \"resizable=yes, location=no, width=300, height=640, menubar=no, status=no, scrollbars=yes\"); return false;")
       
           javascript_include_tag('jstoolbar/jstoolbar') +
             javascript_include_tag('jstoolbar/textile') +