@@ -444,9 +444,14 module ApplicationHelper | |||||
444 |
|
444 | |||
445 | def wikitoolbar_for(field_id) |
|
445 | def wikitoolbar_for(field_id) | |
446 | return '' unless Setting.text_formatting == 'textile' |
|
446 | return '' unless Setting.text_formatting == 'textile' | |
|
447 | ||||
|
448 | help_link = l(:setting_text_formatting) + ': ' + | |||
|
449 | link_to(l(:label_help), compute_public_path('wiki_syntax', 'help', 'html'), | |||
|
450 | :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;") | |||
|
451 | ||||
447 | javascript_include_tag('jstoolbar/jstoolbar') + |
|
452 | javascript_include_tag('jstoolbar/jstoolbar') + | |
448 | javascript_include_tag("jstoolbar/lang/jstoolbar-#{current_language}") + |
|
453 | javascript_include_tag("jstoolbar/lang/jstoolbar-#{current_language}") + | |
449 | javascript_tag("var toolbar = new jsToolBar($('#{field_id}')); toolbar.draw();") |
|
454 | javascript_tag("var toolbar = new jsToolBar($('#{field_id}')); toolbar.setHelpLink('#{help_link}'); toolbar.draw();") | |
450 | end |
|
455 | end | |
451 |
|
456 | |||
452 | def content_for(name, content = nil, &block) |
|
457 | def content_for(name, content = nil, &block) |
@@ -3,11 +3,7 | |||||
3 | <% form_for :content, @content, :url => {:action => 'edit', :page => @page.title}, :html => {:id => 'wiki_form'} do |f| %> |
|
3 | <% form_for :content, @content, :url => {:action => 'edit', :page => @page.title}, :html => {:id => 'wiki_form'} do |f| %> | |
4 | <%= f.hidden_field :version %> |
|
4 | <%= f.hidden_field :version %> | |
5 | <%= error_messages_for 'content' %> |
|
5 | <%= error_messages_for 'content' %> | |
6 | <div class="contextual"> |
|
6 | ||
7 | <%= l(:setting_text_formatting) %>: |
|
|||
8 | <%= link_to l(:label_help), compute_public_path('wiki_syntax', 'help', 'html'), |
|
|||
9 | :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;" %> |
|
|||
10 | </div> |
|
|||
11 | <p><%= f.text_area :text, :cols => 100, :rows => 25, :class => 'wiki-edit', :accesskey => accesskey(:edit) %></p> |
|
7 | <p><%= f.text_area :text, :cols => 100, :rows => 25, :class => 'wiki-edit', :accesskey => accesskey(:edit) %></p> | |
12 | <p><label><%= l(:field_comments) %></label><br /><%= f.text_field :comments, :size => 120 %></p> |
|
8 | <p><label><%= l(:field_comments) %></label><br /><%= f.text_field :comments, :size => 120 %></p> | |
13 | <p><%= submit_tag l(:button_save) %> |
|
9 | <p><%= submit_tag l(:button_save) %> |
@@ -4,10 +4,10 | |||||
4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
|
4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
5 | <meta http-equiv="Content-Style-Type" content="text/css" /> |
|
5 | <meta http-equiv="Content-Style-Type" content="text/css" /> | |
6 | <title>Wiki formatting</title> |
|
6 | <title>Wiki formatting</title> | |
7 | <link rel="stylesheet" href="html.css" type="text/css" /> |
|
|||
8 | <style type="text/css"> |
|
7 | <style type="text/css"> | |
9 | h1 { font-family: Verdana, sans-serif; font-size: 14px; text-align: center; color: #444; } |
|
8 | h1 { font-family: Verdana, sans-serif; font-size: 14px; text-align: center; color: #444; } | |
10 |
|
|
9 | body { font-family: Verdana, sans-serif; font-size: 12px; color: #444; } | |
|
10 | table th { padding-top: 1em; } | |||
11 | table td { vertical-align: top; background-color: #f5f5f5; height: 2em; vertical-align: middle;} |
|
11 | table td { vertical-align: top; background-color: #f5f5f5; height: 2em; vertical-align: middle;} | |
12 | table td code { font-size: 1.2em; } |
|
12 | table td code { font-size: 1.2em; } | |
13 | table td h1 { font-size: 1.8em; text-align: left; } |
|
13 | table td h1 { font-size: 1.8em; text-align: left; } | |
@@ -46,6 +46,9 table td h3 { font-size: 1.2em; text-align: left; } | |||||
46 |
|
46 | |||
47 | <tr><th colspan="3">Links</th></tr> |
|
47 | <tr><th colspan="3">Links</th></tr> | |
48 | <tr><th></th><td>http://foo.bar</td><td><a href="#">http://foo.bar</a></td></tr> |
|
48 | <tr><th></th><td>http://foo.bar</td><td><a href="#">http://foo.bar</a></td></tr> | |
|
49 | <tr><th></th><td>"Foo":http://foo.bar</td><td><a href="#">Foo</a></td></tr> | |||
|
50 | ||||
|
51 | <tr><th colspan="3">Redmine links</th></tr> | |||
49 | <tr><th><img src="../../images/jstoolbar/bt_link.png" style="border: 1px solid #bbb;" alt="Link to a Wiki page" /></th><td>[[Wiki page]]</td><td><a href="#">Wiki page</a></td></tr> |
|
52 | <tr><th><img src="../../images/jstoolbar/bt_link.png" style="border: 1px solid #bbb;" alt="Link to a Wiki page" /></th><td>[[Wiki page]]</td><td><a href="#">Wiki page</a></td></tr> | |
50 | <tr><th></th><td>Issue #12</td><td>Issue <a href="#">#12</a></td></tr> |
|
53 | <tr><th></th><td>Issue #12</td><td>Issue <a href="#">#12</a></td></tr> | |
51 | <tr><th></th><td>Revision r43</td><td>Revision <a href="#">r43</a></td></tr> |
|
54 | <tr><th></th><td>Revision r43</td><td>Revision <a href="#">r43</a></td></tr> | |
@@ -55,5 +58,7 table td h3 { font-size: 1.2em; text-align: left; } | |||||
55 | <tr><th></th><td>!<em>attached_image</em>!</td><td></td></tr> |
|
58 | <tr><th></th><td>!<em>attached_image</em>!</td><td></td></tr> | |
56 | </table> |
|
59 | </table> | |
57 |
|
60 | |||
|
61 | <p><a href="http://www.redmine.org/wiki/redmine/RedmineWikiFormatting" onclick="window.open('http://www.redmine.org/wiki/redmine/RedmineWikiFormatting', '', ''); return false;">More Information</a></p> | |||
|
62 | ||||
58 | </body> |
|
63 | </body> | |
59 | </html> |
|
64 | </html> |
@@ -151,6 +151,7 jsToolBar.prototype = { | |||||
151 | base_url: '', |
|
151 | base_url: '', | |
152 | mode: 'wiki', |
|
152 | mode: 'wiki', | |
153 | elements: {}, |
|
153 | elements: {}, | |
|
154 | help_link: '', | |||
154 |
|
155 | |||
155 | getMode: function() { |
|
156 | getMode: function() { | |
156 | return this.mode; |
|
157 | return this.mode; | |
@@ -165,6 +166,10 jsToolBar.prototype = { | |||||
165 | this.draw(mode); |
|
166 | this.draw(mode); | |
166 | }, |
|
167 | }, | |
167 |
|
168 | |||
|
169 | setHelpLink: function(link) { | |||
|
170 | this.help_link = link; | |||
|
171 | }, | |||
|
172 | ||||
168 | button: function(toolName) { |
|
173 | button: function(toolName) { | |
169 | var tool = this.elements[toolName]; |
|
174 | var tool = this.elements[toolName]; | |
170 | if (typeof tool.fn[this.mode] != 'function') return null; |
|
175 | if (typeof tool.fn[this.mode] != 'function') return null; | |
@@ -202,6 +207,12 jsToolBar.prototype = { | |||||
202 | } |
|
207 | } | |
203 | this.toolNodes = {}; // vide les raccourcis DOM/**/ |
|
208 | this.toolNodes = {}; // vide les raccourcis DOM/**/ | |
204 |
|
209 | |||
|
210 | var h = document.createElement('div'); | |||
|
211 | h.className = 'help' | |||
|
212 | h.innerHTML = this.help_link; | |||
|
213 | '<a href="/help/wiki_syntax.html" onclick="window.open(\'/help/wiki_syntax.html\', \'\', \'resizable=yes, location=no, width=300, height=640, menubar=no, status=no, scrollbars=yes\'); return false;">Aide</a>'; | |||
|
214 | this.toolbar.appendChild(h); | |||
|
215 | ||||
205 | // Draw toolbar elements |
|
216 | // Draw toolbar elements | |
206 | var b, tool, newTool; |
|
217 | var b, tool, newTool; | |
207 |
|
218 |
@@ -44,6 +44,8 | |||||
44 | margin-right: 4px; |
|
44 | margin-right: 4px; | |
45 | } |
|
45 | } | |
46 |
|
46 | |||
|
47 | .jstElements .help { float: right; margin-right: 1em; padding-top: 8px; font-size: 0.9em; } | |||
|
48 | ||||
47 | /* Buttons |
|
49 | /* Buttons | |
48 | -------------------------------------------------------- */ |
|
50 | -------------------------------------------------------- */ | |
49 | .jstb_strong { |
|
51 | .jstb_strong { |
General Comments 0
You need to be logged in to leave comments.
Login now