]> source.dussan.org Git - redmine.git/commitdiff
add markdown wiki syntax help to tool bar (#16373)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 20 Apr 2015 12:14:04 +0000 (12:14 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 20 Apr 2015 12:14:04 +0000 (12:14 +0000)
Contributed by Go MAEDA.

git-svn-id: http://svn.redmine.org/redmine/trunk@14191 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/wiki_formatting/markdown/helper.rb
public/javascripts/jstoolbar/markdown.js

index a4234fe85065a187ed59e9c16661eda05d37948d..ee4b30ff3102abebe111125a19020c96368ac7f9 100644 (file)
@@ -21,7 +21,8 @@ module Redmine
       module Helper
         def wikitoolbar_for(field_id)
           heads_for_wiki_formatter
-          javascript_tag("var wikiToolbar = new jsToolBar(document.getElementById('#{field_id}')); wikiToolbar.draw();")
+          url = "#{Redmine::Utils.relative_url_root}/help/#{current_language.to_s.downcase}/wiki_syntax_markdown.html"
+          javascript_tag("var wikiToolbar = new jsToolBar(document.getElementById('#{field_id}')); wikiToolbar.setHelpLink('#{escape_javascript url}'); wikiToolbar.draw();")
         end
 
         def initial_page_content(page)
index 8a9935a9a58faaa522f59539f86ecad9a43d4dbf..f2258aff72245ed690111877c348c1abc1c53a02 100644 (file)
@@ -192,3 +192,11 @@ jsToolBar.prototype.elements.img = {
 
 // spacer
 jsToolBar.prototype.elements.space5 = {type: 'space'}
+// help
+jsToolBar.prototype.elements.help = {
+       type: 'button',
+       title: 'Help',
+       fn: {
+               wiki: function() { window.open(this.help_link, '', 'resizable=yes, location=no, width=300, height=640, menubar=no, status=no, scrollbars=yes') }
+       }
+}