diff options
35 files changed, 160 insertions, 2 deletions
diff --git a/lib/redcloth.rb b/lib/redcloth.rb index fb6a053c6..344fd6c78 100644 --- a/lib/redcloth.rb +++ b/lib/redcloth.rb @@ -299,6 +299,8 @@ class RedCloth < String hard_break text unless @lite_mode refs text + # need to do this before text is split by #blocks + block_textile_quotes text blocks text end inline text @@ -576,6 +578,29 @@ class RedCloth < String lines.join( "\n" ) end end + + QUOTES_RE = /(^>+([^\n]*?)\n?)+/m + QUOTES_CONTENT_RE = /^([> ]+)(.*)$/m + + def block_textile_quotes( text ) + text.gsub!( QUOTES_RE ) do |match| + lines = match.split( /\n/ ) + quotes = '' + indent = 0 + lines.each do |line| + line =~ QUOTES_CONTENT_RE + bq,content = $1, $2 + l = bq.count('>') + if l != indent + quotes << ("\n\n" + (l>indent ? '<blockquote>' * (l-indent) : '</blockquote>' * (indent-l)) + "\n\n") + indent = l + end + quotes << (content + "\n") + end + quotes << ("\n" + '</blockquote>' * indent + "\n\n") + quotes + end + end CODE_RE = /(\W) @ diff --git a/lib/redmine/wiki_formatting.rb b/lib/redmine/wiki_formatting.rb index 3c1eac020..7197af2c3 100644 --- a/lib/redmine/wiki_formatting.rb +++ b/lib/redmine/wiki_formatting.rb @@ -45,7 +45,7 @@ module Redmine # Patch for RedCloth. Fixed in RedCloth r128 but _why hasn't released it yet. # <a href="http://code.whytheluckystiff.net/redcloth/changeset/128">http://code.whytheluckystiff.net/redcloth/changeset/128</a> def hard_break( text ) - text.gsub!( /(.)\n(?!\n|\Z| *([#*=]+(\s|$)|[{|]))/, "\\1<br />\n" ) if hard_breaks + text.gsub!( /(.)\n(?!\n|\Z|>| *(>? *[#*=]+(\s|$)|[{|]))/, "\\1<br />\n" ) if hard_breaks end # Patch to add code highlighting support to RedCloth diff --git a/public/images/jstoolbar/bt_bq.png b/public/images/jstoolbar/bt_bq.png Binary files differnew file mode 100644 index 000000000..c3af4e07f --- /dev/null +++ b/public/images/jstoolbar/bt_bq.png diff --git a/public/images/jstoolbar/bt_bq_remove.png b/public/images/jstoolbar/bt_bq_remove.png Binary files differnew file mode 100644 index 000000000..05d5ff7c7 --- /dev/null +++ b/public/images/jstoolbar/bt_bq_remove.png diff --git a/public/javascripts/jstoolbar/jstoolbar.js b/public/javascripts/jstoolbar/jstoolbar.js index be982d4b9..64c460217 100644 --- a/public/javascripts/jstoolbar/jstoolbar.js +++ b/public/javascripts/jstoolbar/jstoolbar.js @@ -498,6 +498,37 @@ jsToolBar.prototype.elements.ol = { } } +// spacer +jsToolBar.prototype.elements.space3 = {type: 'space'} + +// bq +jsToolBar.prototype.elements.bq = { + type: 'button', + title: 'Quote', + fn: { + wiki: function() { + this.encloseLineSelection('','',function(str) { + str = str.replace(/\r/g,''); + return str.replace(/(\n|^) *([^\n]*)/g,"$1> $2"); + }); + } + } +} + +// unbq +jsToolBar.prototype.elements.unbq = { + type: 'button', + title: 'Unquote', + fn: { + wiki: function() { + this.encloseLineSelection('','',function(str) { + str = str.replace(/\r/g,''); + return str.replace(/(\n|^) *[>]? *([^\n]*)/g,"$1$2"); + }); + } + } +} + // pre jsToolBar.prototype.elements.pre = { type: 'button', @@ -508,7 +539,7 @@ jsToolBar.prototype.elements.pre = { } // spacer -jsToolBar.prototype.elements.space3 = {type: 'space'} +jsToolBar.prototype.elements.space4 = {type: 'space'} // wiki page jsToolBar.prototype.elements.link = { diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-bg.js b/public/javascripts/jstoolbar/lang/jstoolbar-bg.js index cd36a4b55..2d68498f9 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-bg.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-bg.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Heading 2'; jsToolBar.strings['Heading 3'] = 'Heading 3'; jsToolBar.strings['Unordered list'] = 'Unordered list'; jsToolBar.strings['Ordered list'] = 'Ordered list'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Preformatted text'; jsToolBar.strings['Wiki link'] = 'Link to a Wiki page'; jsToolBar.strings['Image'] = 'Image'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-cs.js b/public/javascripts/jstoolbar/lang/jstoolbar-cs.js index 8a59a8162..f2c0dbff5 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-cs.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-cs.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Záhlaví 2'; jsToolBar.strings['Heading 3'] = 'Záhlaví 3'; jsToolBar.strings['Unordered list'] = 'Seznam'; jsToolBar.strings['Ordered list'] = 'Uspořádaný seznam'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Předformátovaný text'; jsToolBar.strings['Wiki link'] = 'Vložit odkaz na Wiki stránku'; jsToolBar.strings['Image'] = 'Vložit obrázek'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-da.js b/public/javascripts/jstoolbar/lang/jstoolbar-da.js index 9996acaf3..6ccc8ead2 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-da.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-da.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Overskrift 2'; jsToolBar.strings['Heading 3'] = 'Overskrift 3'; jsToolBar.strings['Unordered list'] = 'Unummereret list'; jsToolBar.strings['Ordered list'] = 'Nummereret list'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Preformatteret tekst'; jsToolBar.strings['Wiki link'] = 'Link til en Wiki side'; jsToolBar.strings['Image'] = 'Billede'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-de.js b/public/javascripts/jstoolbar/lang/jstoolbar-de.js index e2ba3fc1c..ce686860f 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-de.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-de.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Überschrift 2. Ordnung'; jsToolBar.strings['Heading 3'] = 'Überschrift 3. Ordnung'; jsToolBar.strings['Unordered list'] = 'Aufzählungsliste'; jsToolBar.strings['Ordered list'] = 'Nummerierte Liste'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Präformatierter Text'; jsToolBar.strings['Wiki link'] = 'Verweis (Link) zu einer Wiki-Seite'; jsToolBar.strings['Image'] = 'Grafik'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-en.js b/public/javascripts/jstoolbar/lang/jstoolbar-en.js index cd36a4b55..2d68498f9 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-en.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-en.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Heading 2'; jsToolBar.strings['Heading 3'] = 'Heading 3'; jsToolBar.strings['Unordered list'] = 'Unordered list'; jsToolBar.strings['Ordered list'] = 'Ordered list'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Preformatted text'; jsToolBar.strings['Wiki link'] = 'Link to a Wiki page'; jsToolBar.strings['Image'] = 'Image'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-es.js b/public/javascripts/jstoolbar/lang/jstoolbar-es.js index cd36a4b55..2d68498f9 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-es.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-es.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Heading 2'; jsToolBar.strings['Heading 3'] = 'Heading 3'; jsToolBar.strings['Unordered list'] = 'Unordered list'; jsToolBar.strings['Ordered list'] = 'Ordered list'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Preformatted text'; jsToolBar.strings['Wiki link'] = 'Link to a Wiki page'; jsToolBar.strings['Image'] = 'Image'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-fi.js b/public/javascripts/jstoolbar/lang/jstoolbar-fi.js index 357d25951..c2229b281 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-fi.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-fi.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Otsikko 2'; jsToolBar.strings['Heading 3'] = 'Otsikko 3'; jsToolBar.strings['Unordered list'] = 'Järjestämätön lista'; jsToolBar.strings['Ordered list'] = 'Järjestetty lista'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Ennaltamuotoiltu teksti'; jsToolBar.strings['Wiki link'] = 'Linkki Wiki sivulle'; jsToolBar.strings['Image'] = 'Kuva'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-fr.js b/public/javascripts/jstoolbar/lang/jstoolbar-fr.js index 3cbc67863..c52a783bc 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-fr.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-fr.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Titre niveau 2'; jsToolBar.strings['Heading 3'] = 'Titre niveau 3'; jsToolBar.strings['Unordered list'] = 'Liste à puces'; jsToolBar.strings['Ordered list'] = 'Liste numérotée'; +jsToolBar.strings['Quote'] = 'Citer'; +jsToolBar.strings['Unquote'] = 'Supprimer citation'; jsToolBar.strings['Preformatted text'] = 'Texte préformaté'; jsToolBar.strings['Wiki link'] = 'Lien vers une page Wiki'; jsToolBar.strings['Image'] = 'Image'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-he.js b/public/javascripts/jstoolbar/lang/jstoolbar-he.js index cd36a4b55..2d68498f9 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-he.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-he.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Heading 2'; jsToolBar.strings['Heading 3'] = 'Heading 3'; jsToolBar.strings['Unordered list'] = 'Unordered list'; jsToolBar.strings['Ordered list'] = 'Ordered list'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Preformatted text'; jsToolBar.strings['Wiki link'] = 'Link to a Wiki page'; jsToolBar.strings['Image'] = 'Image'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-hu.js b/public/javascripts/jstoolbar/lang/jstoolbar-hu.js index e586a123b..c31ba00c0 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-hu.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-hu.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Fejléc 2'; jsToolBar.strings['Heading 3'] = 'Fejléc 3'; jsToolBar.strings['Unordered list'] = 'Felsorolás'; jsToolBar.strings['Ordered list'] = 'Számozott lista'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Előreformázott szöveg'; jsToolBar.strings['Wiki link'] = 'Link egy Wiki oldalra'; jsToolBar.strings['Image'] = 'Kép'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-it.js b/public/javascripts/jstoolbar/lang/jstoolbar-it.js index cd36a4b55..2d68498f9 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-it.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-it.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Heading 2'; jsToolBar.strings['Heading 3'] = 'Heading 3'; jsToolBar.strings['Unordered list'] = 'Unordered list'; jsToolBar.strings['Ordered list'] = 'Ordered list'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Preformatted text'; jsToolBar.strings['Wiki link'] = 'Link to a Wiki page'; jsToolBar.strings['Image'] = 'Image'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-ja.js b/public/javascripts/jstoolbar/lang/jstoolbar-ja.js index fc4d987de..c9413dac2 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-ja.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-ja.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = '見出し 2'; jsToolBar.strings['Heading 3'] = '見出し 3'; jsToolBar.strings['Unordered list'] = '順不同リスト'; jsToolBar.strings['Ordered list'] = '番号つきリスト'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = '整形済みテキスト'; jsToolBar.strings['Wiki link'] = 'Wiki ページへのリンク'; jsToolBar.strings['Image'] = '画像'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-ko.js b/public/javascripts/jstoolbar/lang/jstoolbar-ko.js index cd36a4b55..2d68498f9 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-ko.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-ko.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Heading 2'; jsToolBar.strings['Heading 3'] = 'Heading 3'; jsToolBar.strings['Unordered list'] = 'Unordered list'; jsToolBar.strings['Ordered list'] = 'Ordered list'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Preformatted text'; jsToolBar.strings['Wiki link'] = 'Link to a Wiki page'; jsToolBar.strings['Image'] = 'Image'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-lt.js b/public/javascripts/jstoolbar/lang/jstoolbar-lt.js index f0a7c5d90..8af364c8d 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-lt.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-lt.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Heading 2'; jsToolBar.strings['Heading 3'] = 'Heading 3'; jsToolBar.strings['Unordered list'] = 'Nenumeruotas sąrašas'; jsToolBar.strings['Ordered list'] = 'Numeruotas sąrašas'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Preformatuotas tekstas'; jsToolBar.strings['Wiki link'] = 'Nuoroda į Wiki puslapį'; jsToolBar.strings['Image'] = 'Paveikslas'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-nl.js b/public/javascripts/jstoolbar/lang/jstoolbar-nl.js index cd36a4b55..2d68498f9 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-nl.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-nl.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Heading 2'; jsToolBar.strings['Heading 3'] = 'Heading 3'; jsToolBar.strings['Unordered list'] = 'Unordered list'; jsToolBar.strings['Ordered list'] = 'Ordered list'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Preformatted text'; jsToolBar.strings['Wiki link'] = 'Link to a Wiki page'; jsToolBar.strings['Image'] = 'Image'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-no.js b/public/javascripts/jstoolbar/lang/jstoolbar-no.js index cf6e19ff9..2fb098a9d 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-no.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-no.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Overskrift 2'; jsToolBar.strings['Heading 3'] = 'Overskrift 3'; jsToolBar.strings['Unordered list'] = 'Punktliste'; jsToolBar.strings['Ordered list'] = 'Nummerert liste'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Preformatert tekst'; jsToolBar.strings['Wiki link'] = 'Lenke til Wiki-side'; jsToolBar.strings['Image'] = 'Bilde'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-pl.js b/public/javascripts/jstoolbar/lang/jstoolbar-pl.js index cd36a4b55..2d68498f9 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-pl.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-pl.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Heading 2'; jsToolBar.strings['Heading 3'] = 'Heading 3'; jsToolBar.strings['Unordered list'] = 'Unordered list'; jsToolBar.strings['Ordered list'] = 'Ordered list'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Preformatted text'; jsToolBar.strings['Wiki link'] = 'Link to a Wiki page'; jsToolBar.strings['Image'] = 'Image'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-pt-br.js b/public/javascripts/jstoolbar/lang/jstoolbar-pt-br.js index 8fc58ba67..5035524ab 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-pt-br.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-pt-br.js @@ -11,6 +11,8 @@ jsToolBar.strings['Heading 2'] = 'Cabeçalho 2'; jsToolBar.strings['Heading 3'] = 'Cabeçalho 3'; jsToolBar.strings['Unordered list'] = 'Lista não ordenada'; jsToolBar.strings['Ordered list'] = 'Lista ordenada'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Texto pré-formatado'; jsToolBar.strings['Wiki link'] = 'Link para uma página Wiki'; jsToolBar.strings['Image'] = 'Imagem'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-pt.js b/public/javascripts/jstoolbar/lang/jstoolbar-pt.js index cd36a4b55..2d68498f9 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-pt.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-pt.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Heading 2'; jsToolBar.strings['Heading 3'] = 'Heading 3'; jsToolBar.strings['Unordered list'] = 'Unordered list'; jsToolBar.strings['Ordered list'] = 'Ordered list'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Preformatted text'; jsToolBar.strings['Wiki link'] = 'Link to a Wiki page'; jsToolBar.strings['Image'] = 'Image'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-ro.js b/public/javascripts/jstoolbar/lang/jstoolbar-ro.js index cd36a4b55..2d68498f9 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-ro.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-ro.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Heading 2'; jsToolBar.strings['Heading 3'] = 'Heading 3'; jsToolBar.strings['Unordered list'] = 'Unordered list'; jsToolBar.strings['Ordered list'] = 'Ordered list'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Preformatted text'; jsToolBar.strings['Wiki link'] = 'Link to a Wiki page'; jsToolBar.strings['Image'] = 'Image'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-ru.js b/public/javascripts/jstoolbar/lang/jstoolbar-ru.js index 6370a3e2d..a6d8c4fad 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-ru.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-ru.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Заголовок 2'; jsToolBar.strings['Heading 3'] = 'Заголовок 3'; jsToolBar.strings['Unordered list'] = 'Маркированный список'; jsToolBar.strings['Ordered list'] = 'Нумерованный список'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Заранее форматированный текст'; jsToolBar.strings['Wiki link'] = 'Ссылка на страницу в Wiki'; jsToolBar.strings['Image'] = 'Вставка изображения'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-sr.js b/public/javascripts/jstoolbar/lang/jstoolbar-sr.js index cd36a4b55..2d68498f9 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-sr.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-sr.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Heading 2'; jsToolBar.strings['Heading 3'] = 'Heading 3'; jsToolBar.strings['Unordered list'] = 'Unordered list'; jsToolBar.strings['Ordered list'] = 'Ordered list'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Preformatted text'; jsToolBar.strings['Wiki link'] = 'Link to a Wiki page'; jsToolBar.strings['Image'] = 'Image'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-sv.js b/public/javascripts/jstoolbar/lang/jstoolbar-sv.js index cd36a4b55..2d68498f9 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-sv.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-sv.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Heading 2'; jsToolBar.strings['Heading 3'] = 'Heading 3'; jsToolBar.strings['Unordered list'] = 'Unordered list'; jsToolBar.strings['Ordered list'] = 'Ordered list'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Preformatted text'; jsToolBar.strings['Wiki link'] = 'Link to a Wiki page'; jsToolBar.strings['Image'] = 'Image'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-th.js b/public/javascripts/jstoolbar/lang/jstoolbar-th.js index 2e2f2b88e..d87164226 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-th.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-th.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'หัวข้อ 2'; jsToolBar.strings['Heading 3'] = 'หัวข้อ 3'; jsToolBar.strings['Unordered list'] = 'รายการ'; jsToolBar.strings['Ordered list'] = 'ลำดับเลข'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'รูปแบบข้อความคงที่'; jsToolBar.strings['Wiki link'] = 'เชื่อมโยงไปหน้า Wiki อื่น'; jsToolBar.strings['Image'] = 'รูปภาพ'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-uk.js b/public/javascripts/jstoolbar/lang/jstoolbar-uk.js index cd36a4b55..2d68498f9 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-uk.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-uk.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Heading 2'; jsToolBar.strings['Heading 3'] = 'Heading 3'; jsToolBar.strings['Unordered list'] = 'Unordered list'; jsToolBar.strings['Ordered list'] = 'Ordered list'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Preformatted text'; jsToolBar.strings['Wiki link'] = 'Link to a Wiki page'; jsToolBar.strings['Image'] = 'Image'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-zh-tw.js b/public/javascripts/jstoolbar/lang/jstoolbar-zh-tw.js index 1e46e2470..a87ad3442 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-zh-tw.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-zh-tw.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = '標題 2'; jsToolBar.strings['Heading 3'] = '標題 3'; jsToolBar.strings['Unordered list'] = '項目清單'; jsToolBar.strings['Ordered list'] = '編號清單'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = '格式化文字'; jsToolBar.strings['Wiki link'] = '連結至 Wiki 頁面'; jsToolBar.strings['Image'] = '圖片'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-zh.js b/public/javascripts/jstoolbar/lang/jstoolbar-zh.js index cd36a4b55..2d68498f9 100644 --- a/public/javascripts/jstoolbar/lang/jstoolbar-zh.js +++ b/public/javascripts/jstoolbar/lang/jstoolbar-zh.js @@ -9,6 +9,8 @@ jsToolBar.strings['Heading 2'] = 'Heading 2'; jsToolBar.strings['Heading 3'] = 'Heading 3'; jsToolBar.strings['Unordered list'] = 'Unordered list'; jsToolBar.strings['Ordered list'] = 'Ordered list'; +jsToolBar.strings['Quote'] = 'Quote'; +jsToolBar.strings['Unquote'] = 'Remove Quote'; jsToolBar.strings['Preformatted text'] = 'Preformatted text'; jsToolBar.strings['Wiki link'] = 'Link to a Wiki page'; jsToolBar.strings['Image'] = 'Image'; diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 4ae1c70f1..f51d1841c 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -153,6 +153,8 @@ input, select {vertical-align: middle; margin-top: 1px; margin-bottom: 1px;} fieldset {border: 1px solid #e4e4e4; margin:0;} legend {color: #484848;} hr { width: 100%; height: 1px; background: #ccc; border: 0;} +blockquote { font-style: italic; border-left: 3px solid #e0e0e0; padding-left: 0.6em; margin-left: 2.4em;} +blockquote blockquote { margin-left: 0;} textarea.wiki-edit { width: 99%; } li p {margin-top: 0;} div.issue {background:#ffffdd; padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7;} diff --git a/public/stylesheets/jstoolbar.css b/public/stylesheets/jstoolbar.css index c4ab55711..4e9d44b6c 100644 --- a/public/stylesheets/jstoolbar.css +++ b/public/stylesheets/jstoolbar.css @@ -84,6 +84,12 @@ .jstb_ol { background-image: url(../images/jstoolbar/bt_ol.png); } +.jstb_bq { + background-image: url(../images/jstoolbar/bt_bq.png); +} +.jstb_unbq { + background-image: url(../images/jstoolbar/bt_bq_remove.png); +} .jstb_pre { background-image: url(../images/jstoolbar/bt_pre.png); } diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index ffee28b00..f8bf4a602 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -178,6 +178,46 @@ class ApplicationHelperTest < HelperTestCase assert_equal '<p>Dashes: ---</p>', textilizable('Dashes: ---') end + def test_blockquote + # orig raw text + raw = <<-RAW +John said: +> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sed libero. +> Nullam commodo metus accumsan nulla. Curabitur lobortis dui id dolor. +> * Donec odio lorem, +> * sagittis ac, +> * malesuada in, +> * adipiscing eu, dolor. +> +> >Nulla varius pulvinar diam. Proin id arcu id lorem scelerisque condimentum. Proin vehicula turpis vitae lacus. +> Proin a tellus. Nam vel neque. + +He's right. +RAW + + # expected html + expected = <<-EXPECTED +<p>John said:</p> +<blockquote> +Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas sed libero. +Nullam commodo metus accumsan nulla. Curabitur lobortis dui id dolor. +<ul> + <li>Donec odio lorem,</li> + <li>sagittis ac,</li> + <li>malesuada in,</li> + <li>adipiscing eu, dolor.</li> +</ul> +<blockquote> +<p>Nulla varius pulvinar diam. Proin id arcu id lorem scelerisque condimentum. Proin vehicula turpis vitae lacus.</p> +</blockquote> +<p>Proin a tellus. Nam vel neque.</p> +</blockquote> +<p>He's right.</p> +EXPECTED + + assert_equal expected.gsub(%r{\s+}, ''), textilizable(raw).gsub(%r{\s+}, '') + end + def test_macro_hello_world text = "{{hello_world}}" assert textilizable(text).match(/Hello world!/) |