Revision 1190
Added by Jean-Philippe Lang over 17 years ago
trunk/app/helpers/application_helper.rb | ||
---|---|---|
444 | 444 |
|
445 | 445 |
def wikitoolbar_for(field_id) |
446 | 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 | 452 |
javascript_include_tag('jstoolbar/jstoolbar') + |
448 | 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 | 455 |
end |
451 | 456 |
|
452 | 457 |
def content_for(name, content = nil, &block) |
trunk/app/views/wiki/edit.rhtml | ||
---|---|---|
3 | 3 |
<% form_for :content, @content, :url => {:action => 'edit', :page => @page.title}, :html => {:id => 'wiki_form'} do |f| %> |
4 | 4 |
<%= f.hidden_field :version %> |
5 | 5 |
<%= error_messages_for 'content' %> |
6 |
<div class="contextual"> |
|
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> |
|
6 |
|
|
11 | 7 |
<p><%= f.text_area :text, :cols => 100, :rows => 25, :class => 'wiki-edit', :accesskey => accesskey(:edit) %></p> |
12 | 8 |
<p><label><%= l(:field_comments) %></label><br /><%= f.text_field :comments, :size => 120 %></p> |
13 | 9 |
<p><%= submit_tag l(:button_save) %> |
trunk/public/help/wiki_syntax.html | ||
---|---|---|
4 | 4 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
5 | 5 |
<meta http-equiv="Content-Style-Type" content="text/css" /> |
6 | 6 |
<title>Wiki formatting</title> |
7 |
<link rel="stylesheet" href="html.css" type="text/css" /> |
|
8 | 7 |
<style type="text/css"> |
9 | 8 |
h1 { font-family: Verdana, sans-serif; font-size: 14px; text-align: center; color: #444; } |
10 |
table { font-family: Verdana, sans-serif; font-size: 12px; color: #444; } |
|
9 |
body { font-family: Verdana, sans-serif; font-size: 12px; color: #444; } |
|
10 |
table th { padding-top: 1em; } |
|
11 | 11 |
table td { vertical-align: top; background-color: #f5f5f5; height: 2em; vertical-align: middle;} |
12 | 12 |
table td code { font-size: 1.2em; } |
13 | 13 |
table td h1 { font-size: 1.8em; text-align: left; } |
... | ... | |
46 | 46 |
|
47 | 47 |
<tr><th colspan="3">Links</th></tr> |
48 | 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 | 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 | 53 |
<tr><th></th><td>Issue #12</td><td>Issue <a href="#">#12</a></td></tr> |
51 | 54 |
<tr><th></th><td>Revision r43</td><td>Revision <a href="#">r43</a></td></tr> |
... | ... | |
55 | 58 |
<tr><th></th><td>!<em>attached_image</em>!</td><td></td></tr> |
56 | 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 | 63 |
</body> |
59 | 64 |
</html> |
trunk/public/javascripts/jstoolbar/jstoolbar.js | ||
---|---|---|
151 | 151 |
base_url: '', |
152 | 152 |
mode: 'wiki', |
153 | 153 |
elements: {}, |
154 |
help_link: '', |
|
154 | 155 |
|
155 | 156 |
getMode: function() { |
156 | 157 |
return this.mode; |
... | ... | |
165 | 166 |
this.draw(mode); |
166 | 167 |
}, |
167 | 168 |
|
169 |
setHelpLink: function(link) { |
|
170 |
this.help_link = link; |
|
171 |
}, |
|
172 |
|
|
168 | 173 |
button: function(toolName) { |
169 | 174 |
var tool = this.elements[toolName]; |
170 | 175 |
if (typeof tool.fn[this.mode] != 'function') return null; |
... | ... | |
201 | 206 |
this.toolbar.removeChild(this.toolbar.firstChild) |
202 | 207 |
} |
203 | 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 | 216 |
// Draw toolbar elements |
206 | 217 |
var b, tool, newTool; |
207 | 218 |
|
trunk/public/stylesheets/jstoolbar.css | ||
---|---|---|
44 | 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 | 49 |
/* Buttons |
48 | 50 |
-------------------------------------------------------- */ |
49 | 51 |
.jstb_strong { |
Also available in: Unified diff
Display wiki syntax quick ref link within the jstoolbar (closes #629, #767).
Added named links syntax on quick ref (closes #766, #778).