diff --git a/app/views/wiki/edit.rhtml b/app/views/wiki/edit.rhtml index 9de00772..9caf9650 100644 --- a/app/views/wiki/edit.rhtml +++ b/app/views/wiki/edit.rhtml @@ -6,7 +6,12 @@ <% form_for :content, @content, :url => {:action => 'edit', :page => @page.title}, :html => {:id => 'wiki_form'} do |f| %> <%= error_messages_for 'content' %> -

<%= f.text_area :text, :cols => 100, :rows => 25, :style => "width:99%;" %>

+
+<%= l(:setting_text_formatting) %>: +<%= link_to l(:label_help), {:controller => 'help', :ctrl => 'wiki', :page => 'syntax' }, + :onclick => "window.open('#{ url_for :controller => 'help', :ctrl => 'wiki', :page => 'syntax' }', '', 'resizable=yes, location=no, width=300, height=500, menubar=no, status=no, scrollbars=yes'); return false;" %> +
+

<%= f.text_area :text, :cols => 100, :rows => 25, :style => "width:99.5%;" %>


<%= f.text_field :comment, :size => 120 %>

<%= submit_tag l(:button_save) %> <%= link_to_remote l(:label_preview), diff --git a/config/help.yml b/config/help.yml index eb1c38c4..e67019d4 100644 --- a/config/help.yml +++ b/config/help.yml @@ -73,4 +73,6 @@ pages: account: index: ch03.html lost_password: ch03s03.html - register: ch03s04.html \ No newline at end of file + register: ch03s04.html + wiki: + syntax: wiki_syntax.html \ No newline at end of file diff --git a/public/images/jstoolbar/bt_heading.png b/public/images/jstoolbar/bt_heading.png new file mode 100644 index 00000000..a143f23a Binary files /dev/null and b/public/images/jstoolbar/bt_heading.png differ diff --git a/public/javascripts/jstoolbar.js b/public/javascripts/jstoolbar.js index cf945461..a381c3c2 100644 --- a/public/javascripts/jstoolbar.js +++ b/public/javascripts/jstoolbar.js @@ -346,13 +346,13 @@ jsToolBar.prototype.elements.del = { } // quote -//jsToolBar.prototype.elements.quote = { -// type: 'button', -// title: 'Inline quote', -// fn: { -// wiki: function() { this.singleTag('{{','}}') } -// } -//} +jsToolBar.prototype.elements.quote = { + type: 'button', + title: 'Inline quote', + fn: { + wiki: function() { this.singleTag('??') } + } +} // code jsToolBar.prototype.elements.code = { @@ -364,7 +364,21 @@ jsToolBar.prototype.elements.code = { } // spacer -//jsToolBar.prototype.elements.space1 = {type: 'space'} +jsToolBar.prototype.elements.space1 = {type: 'space'} + +// heading +jsToolBar.prototype.elements.heading = { + type: 'button', + title: 'Heading', + fn: { + wiki: function() { + this.encloseSelection('','',function(str) { + str = str.replace(/\r/g,''); + return 'h2. '+str.replace(/\n/g,"\n* "); + }); + } + } +} // br //jsToolBar.prototype.elements.br = { @@ -410,6 +424,7 @@ jsToolBar.prototype.elements.ol = { jsToolBar.prototype.elements.space3 = {type: 'space'} // link +/* jsToolBar.prototype.elements.link = { type: 'button', title: 'Link', @@ -438,3 +453,12 @@ jsToolBar.prototype.elements.link.fn.wiki = function() { this.encloseSelection(stag,etag); } }; +*/ +// link or wiki page +jsToolBar.prototype.elements.link = { + type: 'button', + title: 'Link', + fn: { + wiki: function() { this.encloseSelection("[[", "]]") } + } +} diff --git a/public/manual/en/wiki_syntax.html b/public/manual/en/wiki_syntax.html new file mode 100644 index 00000000..a71a39db --- /dev/null +++ b/public/manual/en/wiki_syntax.html @@ -0,0 +1,32 @@ + + + +Wiki formatting + + + + + + + + + + + + + + + + + + + + + +

Font Styles

*Strong*Strong
_Italic_Italic
+Underline+Underline
-Deleted-Deleted
??Quote??Quote
@Code@Code

Lists

* Item 1
* Item 2
  • Item 1
  • Item 2
# Item 1
# Item 2
  1. Item 1
  2. Item 2

Titles

h2. Title 2

Title 2

Links

[[Wiki page]]Wiki page
Issue #12Issue #12
Revision r43Revision r43
+ + + \ No newline at end of file diff --git a/public/manual/fr/wiki_syntax.html b/public/manual/fr/wiki_syntax.html new file mode 100644 index 00000000..05f80a52 --- /dev/null +++ b/public/manual/fr/wiki_syntax.html @@ -0,0 +1,32 @@ + + + +Formatage Wiki + + + + + + + + + + + + + + + + + + + + + +

Mise en forme

*Gras*Gras
_Italique_Italique
+Souligné+Souligné
-Rayé-Rayé
??Citation??Citation
@Code@Code

Listes

* Item 1
* Item 2
  • Item 1
  • Item 2
# Item 1
# Item 2
  1. Item 1
  2. Item 2

Titres

h2. Titre 2

Titre 2

Liens

[[Page wiki]]Page wiki
Demande #12Demande #12
Révision r43Révision r43
+ + + \ No newline at end of file diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 138cf97d..f00bb9c7 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -599,4 +599,8 @@ div.wiki table, div.wiki td { padding: 4px; } +div.wiki code { + font-size: 1.2em; +} + #preview .preview { background: #fafbfc url(../images/draft.png); } diff --git a/public/stylesheets/jstoolbar.css b/public/stylesheets/jstoolbar.css index 8094b47b..cf51c48c 100644 --- a/public/stylesheets/jstoolbar.css +++ b/public/stylesheets/jstoolbar.css @@ -67,6 +67,9 @@ .jstb_br { background-image: url(../images/jstoolbar/bt_br.png); } +.jstb_heading { + background-image: url(../images/jstoolbar/bt_heading.png); +} .jstb_ul { background-image: url(../images/jstoolbar/bt_ul.png); }