From bdc63881ba6fdbdf5d2e64e432f6735aaee5e3c6 Mon Sep 17 00:00:00 2001 From: Yuki Sonoda (Yugui) Date: Sun, 12 Oct 2008 11:55:26 +0900 Subject: [PATCH] extract textile formatting as a plugin --- app/helpers/textile_helper.rb | 18 - lib/redcloth3.rb | 1164 -------------------- lib/redmine.rb | 4 - lib/redmine/wiki_formatting/textile_formatter.rb | 181 --- public/help/wiki_syntax.html | 66 -- public/images/jstoolbar/bt_bq.png | Bin 503 -> 0 bytes public/images/jstoolbar/bt_bq_remove.png | Bin 501 -> 0 bytes public/images/jstoolbar/bt_code.png | Bin 1045 -> 0 bytes public/images/jstoolbar/bt_del.png | Bin 368 -> 0 bytes public/images/jstoolbar/bt_em.png | Bin 312 -> 0 bytes public/images/jstoolbar/bt_h1.png | Bin 362 -> 0 bytes public/images/jstoolbar/bt_h2.png | Bin 371 -> 0 bytes public/images/jstoolbar/bt_h3.png | Bin 376 -> 0 bytes public/images/jstoolbar/bt_img.png | Bin 1142 -> 0 bytes public/images/jstoolbar/bt_ins.png | Bin 1055 -> 0 bytes public/images/jstoolbar/bt_link.png | Bin 408 -> 0 bytes public/images/jstoolbar/bt_ol.png | Bin 363 -> 0 bytes public/images/jstoolbar/bt_pre.png | Bin 1040 -> 0 bytes public/images/jstoolbar/bt_strong.png | Bin 360 -> 0 bytes public/images/jstoolbar/bt_ul.png | Bin 365 -> 0 bytes public/javascripts/jstoolbar.js | 380 +++++++ public/javascripts/jstoolbar/jstoolbar.js | 380 ------- public/javascripts/jstoolbar/lang/jstoolbar-bg.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-ca.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-cs.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-da.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-de.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-en.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-es.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-fi.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-fr.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-he.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-hu.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-it.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-ja.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-ko.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-lt.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-nl.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-no.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-pl.js | 17 - .../javascripts/jstoolbar/lang/jstoolbar-pt-br.js | 18 - public/javascripts/jstoolbar/lang/jstoolbar-pt.js | 17 - public/javascripts/jstoolbar/lang/jstoolbar-ro.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-ru.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-sr.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-sv.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-th.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-tr.js | 14 - public/javascripts/jstoolbar/lang/jstoolbar-uk.js | 16 - .../javascripts/jstoolbar/lang/jstoolbar-zh-tw.js | 16 - public/javascripts/jstoolbar/lang/jstoolbar-zh.js | 16 - public/javascripts/jstoolbar/textile.js | 200 ---- public/stylesheets/jstoolbar.css | 48 - vendor/plugins/redmine_textile_formatter/README | 14 + .../helpers/redmine_textile_formatter/helper.rb | 25 + .../assets/help/wiki_syntax.html | 66 ++ .../assets/images/jstoolbar/bt_bq.png | Bin 0 -> 503 bytes .../assets/images/jstoolbar/bt_bq_remove.png | Bin 0 -> 501 bytes .../assets/images/jstoolbar/bt_code.png | Bin 0 -> 1045 bytes .../assets/images/jstoolbar/bt_del.png | Bin 0 -> 368 bytes .../assets/images/jstoolbar/bt_em.png | Bin 0 -> 312 bytes .../assets/images/jstoolbar/bt_h1.png | Bin 0 -> 362 bytes .../assets/images/jstoolbar/bt_h2.png | Bin 0 -> 371 bytes .../assets/images/jstoolbar/bt_h3.png | Bin 0 -> 376 bytes .../assets/images/jstoolbar/bt_img.png | Bin 0 -> 1142 bytes .../assets/images/jstoolbar/bt_ins.png | Bin 0 -> 1055 bytes .../assets/images/jstoolbar/bt_link.png | Bin 0 -> 408 bytes .../assets/images/jstoolbar/bt_ol.png | Bin 0 -> 363 bytes .../assets/images/jstoolbar/bt_pre.png | Bin 0 -> 1040 bytes .../assets/images/jstoolbar/bt_strong.png | Bin 0 -> 360 bytes .../assets/images/jstoolbar/bt_ul.png | Bin 0 -> 365 bytes .../assets/javascripts/lang/jstoolbar-bg.js | 16 + .../assets/javascripts/lang/jstoolbar-ca.js | 16 + .../assets/javascripts/lang/jstoolbar-cs.js | 16 + .../assets/javascripts/lang/jstoolbar-da.js | 16 + .../assets/javascripts/lang/jstoolbar-de.js | 16 + .../assets/javascripts/lang/jstoolbar-en.js | 16 + .../assets/javascripts/lang/jstoolbar-es.js | 16 + .../assets/javascripts/lang/jstoolbar-fi.js | 16 + .../assets/javascripts/lang/jstoolbar-fr.js | 16 + .../assets/javascripts/lang/jstoolbar-he.js | 16 + .../assets/javascripts/lang/jstoolbar-hu.js | 16 + .../assets/javascripts/lang/jstoolbar-it.js | 16 + .../assets/javascripts/lang/jstoolbar-ja.js | 16 + .../assets/javascripts/lang/jstoolbar-ko.js | 16 + .../assets/javascripts/lang/jstoolbar-lt.js | 16 + .../assets/javascripts/lang/jstoolbar-nl.js | 16 + .../assets/javascripts/lang/jstoolbar-no.js | 16 + .../assets/javascripts/lang/jstoolbar-pl.js | 17 + .../assets/javascripts/lang/jstoolbar-pt-br.js | 18 + .../assets/javascripts/lang/jstoolbar-pt.js | 17 + .../assets/javascripts/lang/jstoolbar-ro.js | 16 + .../assets/javascripts/lang/jstoolbar-ru.js | 16 + .../assets/javascripts/lang/jstoolbar-sr.js | 16 + .../assets/javascripts/lang/jstoolbar-sv.js | 16 + .../assets/javascripts/lang/jstoolbar-th.js | 16 + .../assets/javascripts/lang/jstoolbar-tr.js | 14 + .../assets/javascripts/lang/jstoolbar-uk.js | 16 + .../assets/javascripts/lang/jstoolbar-zh-tw.js | 16 + .../assets/javascripts/lang/jstoolbar-zh.js | 16 + .../assets/javascripts/textile.js | 200 ++++ .../assets/stylesheets/textile.css | 47 + vendor/plugins/redmine_textile_formatter/init.rb | 13 + .../redmine_textile_formatter/lib/redcloth3.rb | 1164 ++++++++++++++++++++ .../redmine_textile_formatter/wiki_formatter.rb | 179 +++ 105 files changed, 2554 insertions(+), 2527 deletions(-) delete mode 100644 app/helpers/textile_helper.rb delete mode 100644 lib/redcloth3.rb delete mode 100644 lib/redmine/wiki_formatting/textile_formatter.rb delete mode 100644 public/help/wiki_syntax.html delete mode 100644 public/images/jstoolbar/bt_bq.png delete mode 100644 public/images/jstoolbar/bt_bq_remove.png delete mode 100644 public/images/jstoolbar/bt_code.png delete mode 100644 public/images/jstoolbar/bt_del.png delete mode 100644 public/images/jstoolbar/bt_em.png delete mode 100644 public/images/jstoolbar/bt_h1.png delete mode 100644 public/images/jstoolbar/bt_h2.png delete mode 100644 public/images/jstoolbar/bt_h3.png delete mode 100644 public/images/jstoolbar/bt_img.png delete mode 100644 public/images/jstoolbar/bt_ins.png delete mode 100644 public/images/jstoolbar/bt_link.png delete mode 100644 public/images/jstoolbar/bt_ol.png delete mode 100644 public/images/jstoolbar/bt_pre.png delete mode 100644 public/images/jstoolbar/bt_strong.png delete mode 100644 public/images/jstoolbar/bt_ul.png create mode 100644 public/javascripts/jstoolbar.js delete mode 100644 public/javascripts/jstoolbar/jstoolbar.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-bg.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-ca.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-cs.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-da.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-de.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-en.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-es.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-fi.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-fr.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-he.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-hu.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-it.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-ja.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-ko.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-lt.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-nl.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-no.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-pl.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-pt-br.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-pt.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-ro.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-ru.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-sr.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-sv.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-th.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-tr.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-uk.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-zh-tw.js delete mode 100644 public/javascripts/jstoolbar/lang/jstoolbar-zh.js delete mode 100644 public/javascripts/jstoolbar/textile.js create mode 100644 vendor/plugins/redmine_textile_formatter/README create mode 100644 vendor/plugins/redmine_textile_formatter/app/helpers/redmine_textile_formatter/helper.rb create mode 100644 vendor/plugins/redmine_textile_formatter/assets/help/wiki_syntax.html create mode 100644 vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_bq.png create mode 100644 vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_bq_remove.png create mode 100644 vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_code.png create mode 100644 vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_del.png create mode 100644 vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_em.png create mode 100644 vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_h1.png create mode 100644 vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_h2.png create mode 100644 vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_h3.png create mode 100644 vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_img.png create mode 100644 vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_ins.png create mode 100644 vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_link.png create mode 100644 vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_ol.png create mode 100644 vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_pre.png create mode 100644 vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_strong.png create mode 100644 vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_ul.png create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-bg.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-ca.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-cs.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-da.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-de.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-en.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-es.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-fi.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-fr.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-he.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-hu.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-it.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-ja.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-ko.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-lt.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-nl.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-no.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-pl.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-pt-br.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-pt.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-ro.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-ru.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-sr.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-sv.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-th.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-tr.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-uk.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-zh-tw.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-zh.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/javascripts/textile.js create mode 100644 vendor/plugins/redmine_textile_formatter/assets/stylesheets/textile.css create mode 100644 vendor/plugins/redmine_textile_formatter/init.rb create mode 100644 vendor/plugins/redmine_textile_formatter/lib/redcloth3.rb create mode 100644 vendor/plugins/redmine_textile_formatter/lib/redmine_textile_formatter/wiki_formatter.rb diff --git a/app/helpers/textile_helper.rb b/app/helpers/textile_helper.rb deleted file mode 100644 index 147d4b2..0000000 --- a/app/helpers/textile_helper.rb +++ /dev/null @@ -1,18 +0,0 @@ -module TextileHelper - def wikitoolbar_for(field_id) - help_link = l(:setting_text_formatting) + ': ' + - link_to(l(:label_help), compute_public_path('wiki_syntax', 'help', 'html'), - :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;") - - javascript_include_tag('jstoolbar/jstoolbar') + - javascript_include_tag('jstoolbar/textile') + - javascript_include_tag("jstoolbar/lang/jstoolbar-#{current_language}") + - javascript_tag("var toolbar = new jsToolBar($('#{field_id}')); toolbar.setHelpLink('#{help_link}'); toolbar.draw();") - end - - def initial_page_content(page) - "h1. #{@page.pretty_title}" - end - - def heads_for_wiki_formatter; '' end -end diff --git a/lib/redcloth3.rb b/lib/redcloth3.rb deleted file mode 100644 index cbca2bf..0000000 --- a/lib/redcloth3.rb +++ /dev/null @@ -1,1164 +0,0 @@ -# vim:ts=4:sw=4: -# = RedCloth - Textile and Markdown Hybrid for Ruby -# -# Homepage:: http://whytheluckystiff.net/ruby/redcloth/ -# Author:: why the lucky stiff (http://whytheluckystiff.net/) -# Copyright:: (cc) 2004 why the lucky stiff (and his puppet organizations.) -# License:: BSD -# -# (see http://hobix.com/textile/ for a Textile Reference.) -# -# Based on (and also inspired by) both: -# -# PyTextile: http://diveintomark.org/projects/textile/textile.py.txt -# Textism for PHP: http://www.textism.com/tools/textile/ -# -# - -# = RedCloth -# -# RedCloth is a Ruby library for converting Textile and/or Markdown -# into HTML. You can use either format, intermingled or separately. -# You can also extend RedCloth to honor your own custom text stylings. -# -# RedCloth users are encouraged to use Textile if they are generating -# HTML and to use Markdown if others will be viewing the plain text. -# -# == What is Textile? -# -# Textile is a simple formatting style for text -# documents, loosely based on some HTML conventions. -# -# == Sample Textile Text -# -# h2. This is a title -# -# h3. This is a subhead -# -# This is a bit of paragraph. -# -# bq. This is a blockquote. -# -# = Writing Textile -# -# A Textile document consists of paragraphs. Paragraphs -# can be specially formatted by adding a small instruction -# to the beginning of the paragraph. -# -# h[n]. Header of size [n]. -# bq. Blockquote. -# # Numeric list. -# * Bulleted list. -# -# == Quick Phrase Modifiers -# -# Quick phrase modifiers are also included, to allow formatting -# of small portions of text within a paragraph. -# -# \_emphasis\_ -# \_\_italicized\_\_ -# \*strong\* -# \*\*bold\*\* -# ??citation?? -# -deleted text- -# +inserted text+ -# ^superscript^ -# ~subscript~ -# @code@ -# %(classname)span% -# -# ==notextile== (leave text alone) -# -# == Links -# -# To make a hypertext link, put the link text in "quotation -# marks" followed immediately by a colon and the URL of the link. -# -# Optional: text in (parentheses) following the link text, -# but before the closing quotation mark, will become a Title -# attribute for the link, visible as a tool tip when a cursor is above it. -# -# Example: -# -# "This is a link (This is a title) ":http://www.textism.com -# -# Will become: -# -# This is a link -# -# == Images -# -# To insert an image, put the URL for the image inside exclamation marks. -# -# Optional: text that immediately follows the URL in (parentheses) will -# be used as the Alt text for the image. Images on the web should always -# have descriptive Alt text for the benefit of readers using non-graphical -# browsers. -# -# Optional: place a colon followed by a URL immediately after the -# closing ! to make the image into a link. -# -# Example: -# -# !http://www.textism.com/common/textist.gif(Textist)! -# -# Will become: -# -# Textist -# -# With a link: -# -# !/common/textist.gif(Textist)!:http://textism.com -# -# Will become: -# -# Textist -# -# == Defining Acronyms -# -# HTML allows authors to define acronyms via the tag. The definition appears as a -# tool tip when a cursor hovers over the acronym. A crucial aid to clear writing, -# this should be used at least once for each acronym in documents where they appear. -# -# To quickly define an acronym in Textile, place the full text in (parentheses) -# immediately following the acronym. -# -# Example: -# -# ACLU(American Civil Liberties Union) -# -# Will become: -# -# ACLU -# -# == Adding Tables -# -# In Textile, simple tables can be added by seperating each column by -# a pipe. -# -# |a|simple|table|row| -# |And|Another|table|row| -# -# Attributes are defined by style definitions in parentheses. -# -# table(border:1px solid black). -# (background:#ddd;color:red). |{}| | | | -# -# == Using RedCloth -# -# RedCloth is simply an extension of the String class, which can handle -# Textile formatting. Use it like a String and output HTML with its -# RedCloth#to_html method. -# -# doc = RedCloth.new " -# -# h2. Test document -# -# Just a simple test." -# -# puts doc.to_html -# -# By default, RedCloth uses both Textile and Markdown formatting, with -# Textile formatting taking precedence. If you want to turn off Markdown -# formatting, to boost speed and limit the processor: -# -# class RedCloth::Textile.new( str ) - -class RedCloth3 < String - - VERSION = '3.0.4' - DEFAULT_RULES = [:textile, :markdown] - - # - # Two accessor for setting security restrictions. - # - # This is a nice thing if you're using RedCloth for - # formatting in public places (e.g. Wikis) where you - # don't want users to abuse HTML for bad things. - # - # If +:filter_html+ is set, HTML which wasn't - # created by the Textile processor will be escaped. - # - # If +:filter_styles+ is set, it will also disable - # the style markup specifier. ('{color: red}') - # - attr_accessor :filter_html, :filter_styles - - # - # Accessor for toggling hard breaks. - # - # If +:hard_breaks+ is set, single newlines will - # be converted to HTML break tags. This is the - # default behavior for traditional RedCloth. - # - attr_accessor :hard_breaks - - # Accessor for toggling lite mode. - # - # In lite mode, block-level rules are ignored. This means - # that tables, paragraphs, lists, and such aren't available. - # Only the inline markup for bold, italics, entities and so on. - # - # r = RedCloth.new( "And then? She *fell*!", [:lite_mode] ) - # r.to_html - # #=> "And then? She fell!" - # - attr_accessor :lite_mode - - # - # Accessor for toggling span caps. - # - # Textile places `span' tags around capitalized - # words by default, but this wreaks havoc on Wikis. - # If +:no_span_caps+ is set, this will be - # suppressed. - # - attr_accessor :no_span_caps - - # - # Establishes the markup predence. Available rules include: - # - # == Textile Rules - # - # The following textile rules can be set individually. Or add the complete - # set of rules with the single :textile rule, which supplies the rule set in - # the following precedence: - # - # refs_textile:: Textile references (i.e. [hobix]http://hobix.com/) - # block_textile_table:: Textile table block structures - # block_textile_lists:: Textile list structures - # block_textile_prefix:: Textile blocks with prefixes (i.e. bq., h2., etc.) - # inline_textile_image:: Textile inline images - # inline_textile_link:: Textile inline links - # inline_textile_span:: Textile inline spans - # glyphs_textile:: Textile entities (such as em-dashes and smart quotes) - # - # == Markdown - # - # refs_markdown:: Markdown references (for example: [hobix]: http://hobix.com/) - # block_markdown_setext:: Markdown setext headers - # block_markdown_atx:: Markdown atx headers - # block_markdown_rule:: Markdown horizontal rules - # block_markdown_bq:: Markdown blockquotes - # block_markdown_lists:: Markdown lists - # inline_markdown_link:: Markdown links - attr_accessor :rules - - # Returns a new RedCloth object, based on _string_ and - # enforcing all the included _restrictions_. - # - # r = RedCloth.new( "h1. A bold man", [:filter_html] ) - # r.to_html - # #=>"

A <b>bold</b> man

" - # - def initialize( string, restrictions = [] ) - restrictions.each { |r| method( "#{ r }=" ).call( true ) } - super( string ) - end - - # - # Generates HTML from the Textile contents. - # - # r = RedCloth.new( "And then? She *fell*!" ) - # r.to_html( true ) - # #=>"And then? She fell!" - # - def to_html( *rules ) - rules = DEFAULT_RULES if rules.empty? - # make our working copy - text = self.dup - - @urlrefs = {} - @shelf = [] - textile_rules = [:refs_textile, :block_textile_table, :block_textile_lists, - :block_textile_prefix, :inline_textile_image, :inline_textile_link, - :inline_textile_code, :inline_textile_span] - markdown_rules = [:refs_markdown, :block_markdown_setext, :block_markdown_atx, :block_markdown_rule, - :block_markdown_bq, :block_markdown_lists, - :inline_markdown_reflink, :inline_markdown_link] - @rules = rules.collect do |rule| - case rule - when :markdown - markdown_rules - when :textile - textile_rules - else - rule - end - end.flatten - - # standard clean up - incoming_entities text - clean_white_space text - - # start processor - @pre_list = [] - rip_offtags text - no_textile text - escape_html_tags text - 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 - smooth_offtags text - - retrieve text - - text.gsub!( /<\/?notextile>/, '' ) - text.gsub!( /x%x%/, '&' ) - clean_html text if filter_html - text.strip! - text - - end - - ####### - private - ####### - # - # Mapping of 8-bit ASCII codes to HTML numerical entity equivalents. - # (from PyTextile) - # - TEXTILE_TAGS = - - [[128, 8364], [129, 0], [130, 8218], [131, 402], [132, 8222], [133, 8230], - [134, 8224], [135, 8225], [136, 710], [137, 8240], [138, 352], [139, 8249], - [140, 338], [141, 0], [142, 0], [143, 0], [144, 0], [145, 8216], [146, 8217], - [147, 8220], [148, 8221], [149, 8226], [150, 8211], [151, 8212], [152, 732], - [153, 8482], [154, 353], [155, 8250], [156, 339], [157, 0], [158, 0], [159, 376]]. - - collect! do |a, b| - [a.chr, ( b.zero? and "" or "&#{ b };" )] - end - - # - # Regular expressions to convert to HTML. - # - A_HLGN = /(?:(?:<>|<|>|\=|[()]+)+)/ - A_VLGN = /[\-^~]/ - C_CLAS = '(?:\([^)]+\))' - C_LNGE = '(?:\[[^\]]+\])' - C_STYL = '(?:\{[^}]+\})' - S_CSPN = '(?:\\\\\d+)' - S_RSPN = '(?:/\d+)' - A = "(?:#{A_HLGN}?#{A_VLGN}?|#{A_VLGN}?#{A_HLGN}?)" - S = "(?:#{S_CSPN}?#{S_RSPN}|#{S_RSPN}?#{S_CSPN}?)" - C = "(?:#{C_CLAS}?#{C_STYL}?#{C_LNGE}?|#{C_STYL}?#{C_LNGE}?#{C_CLAS}?|#{C_LNGE}?#{C_STYL}?#{C_CLAS}?)" - # PUNCT = Regexp::quote( '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~' ) - PUNCT = Regexp::quote( '!"#$%&\'*+,-./:;=?@\\^_`|~' ) - PUNCT_NOQ = Regexp::quote( '!"#$&\',./:;=?@\\`|' ) - PUNCT_Q = Regexp::quote( '*-_+^~%' ) - HYPERLINK = '(\S+?)([^\w\s/;=\?]*?)(?=\s|<|$)' - - # Text markup tags, don't conflict with block tags - SIMPLE_HTML_TAGS = [ - 'tt', 'b', 'i', 'big', 'small', 'em', 'strong', 'dfn', 'code', - 'samp', 'kbd', 'var', 'cite', 'abbr', 'acronym', 'a', 'img', 'br', - 'br', 'map', 'q', 'sub', 'sup', 'span', 'bdo' - ] - - QTAGS = [ - ['**', 'b', :limit], - ['*', 'strong', :limit], - ['??', 'cite', :limit], - ['-', 'del', :limit], - ['__', 'i', :limit], - ['_', 'em', :limit], - ['%', 'span', :limit], - ['+', 'ins', :limit], - ['^', 'sup', :limit], - ['~', 'sub', :limit] - ] - QTAGS.collect! do |rc, ht, rtype| - rcq = Regexp::quote rc - re = - case rtype - when :limit - /(^|[>\s\(]) - (#{rcq}) - (#{C}) - (?::(\S+?))? - ([^\s\-].*?[^\s\-]|\w) - #{rcq} - (?=[[:punct:]]|\s|\)|$)/x - else - /(#{rcq}) - (#{C}) - (?::(\S+))? - ([^\s\-].*?[^\s\-]|\w) - #{rcq}/xm - end - [rc, ht, re, rtype] - end - - # Elements to handle - GLYPHS = [ - # [ /([^\s\[{(>])?\'([dmst]\b|ll\b|ve\b|\s|:|$)/, '\1’\2' ], # single closing - # [ /([^\s\[{(>#{PUNCT_Q}][#{PUNCT_Q}]*)\'/, '\1’' ], # single closing - # [ /\'(?=[#{PUNCT_Q}]*(s\b|[\s#{PUNCT_NOQ}]))/, '’' ], # single closing - # [ /\'/, '‘' ], # single opening - [ //, '>' ], # greater-than - # [ /([^\s\[{(])?"(\s|:|$)/, '\1”\2' ], # double closing - # [ /([^\s\[{(>#{PUNCT_Q}][#{PUNCT_Q}]*)"/, '\1”' ], # double closing - # [ /"(?=[#{PUNCT_Q}]*[\s#{PUNCT_NOQ}])/, '”' ], # double closing - # [ /"/, '“' ], # double opening - [ /\b( )?\.{3}/, '\1…' ], # ellipsis - [ /\b([A-Z][A-Z0-9]{2,})\b(?:[(]([^)]*)[)])/, '\1' ], # 3+ uppercase acronym - [ /(^|[^"][>\s])([A-Z][A-Z0-9 ]+[A-Z0-9])([^\2\3', :no_span_caps ], # 3+ uppercase caps - [ /(\.\s)?\s?--\s?/, '\1—' ], # em dash - [ /\s->\s/, ' → ' ], # right arrow - [ /\s-\s/, ' – ' ], # en dash - [ /(\d+) ?x ?(\d+)/, '\1×\2' ], # dimension sign - [ /\b ?[(\[]TM[\])]/i, '™' ], # trademark - [ /\b ?[(\[]R[\])]/i, '®' ], # registered - [ /\b ?[(\[]C[\])]/i, '©' ] # copyright - ] - - H_ALGN_VALS = { - '<' => 'left', - '=' => 'center', - '>' => 'right', - '<>' => 'justify' - } - - V_ALGN_VALS = { - '^' => 'top', - '-' => 'middle', - '~' => 'bottom' - } - - # - # Flexible HTML escaping - # - def htmlesc( str, mode ) - str.gsub!( '&', '&' ) - str.gsub!( '"', '"' ) if mode != :NoQuotes - str.gsub!( "'", ''' ) if mode == :Quotes - str.gsub!( '<', '<') - str.gsub!( '>', '>') - end - - # Search and replace for Textile glyphs (quotes, dashes, other symbols) - def pgl( text ) - GLYPHS.each do |re, resub, tog| - next if tog and method( tog ).call - text.gsub! re, resub - end - end - - # Parses Textile attribute lists and builds an HTML attribute string - def pba( text_in, element = "" ) - - return '' unless text_in - - style = [] - text = text_in.dup - if element == 'td' - colspan = $1 if text =~ /\\(\d+)/ - rowspan = $1 if text =~ /\/(\d+)/ - style << "vertical-align:#{ v_align( $& ) };" if text =~ A_VLGN - end - - style << "#{ $1 };" if not filter_styles and - text.sub!( /\{([^}]*)\}/, '' ) - - lang = $1 if - text.sub!( /\[([^)]+?)\]/, '' ) - - cls = $1 if - text.sub!( /\(([^()]+?)\)/, '' ) - - style << "padding-left:#{ $1.length }em;" if - text.sub!( /([(]+)/, '' ) - - style << "padding-right:#{ $1.length }em;" if text.sub!( /([)]+)/, '' ) - - style << "text-align:#{ h_align( $& ) };" if text =~ A_HLGN - - cls, id = $1, $2 if cls =~ /^(.*?)#(.*)$/ - - atts = '' - atts << " style=\"#{ style.join }\"" unless style.empty? - atts << " class=\"#{ cls }\"" unless cls.to_s.empty? - atts << " lang=\"#{ lang }\"" if lang - atts << " id=\"#{ id }\"" if id - atts << " colspan=\"#{ colspan }\"" if colspan - atts << " rowspan=\"#{ rowspan }\"" if rowspan - - atts - end - - TABLE_RE = /^(?:table(_?#{S}#{A}#{C})\. ?\n)?^(#{A}#{C}\.? ?\|.*?\|)(\n\n|\Z)/m - - # Parses a Textile table block, building HTML from the result. - def block_textile_table( text ) - text.gsub!( TABLE_RE ) do |matches| - - tatts, fullrow = $~[1..2] - tatts = pba( tatts, 'table' ) - tatts = shelve( tatts ) if tatts - rows = [] - - fullrow.each_line do |row| - ratts, row = pba( $1, 'tr' ), $2 if row =~ /^(#{A}#{C}\. )(.*)/m - cells = [] - row.split( /(\|)(?![^\[\|]*\]\])/ )[1..-2].each do |cell| - next if cell == '|' - ctyp = 'd' - ctyp = 'h' if cell =~ /^_/ - - catts = '' - catts, cell = pba( $1, 'td' ), $2 if cell =~ /^(_?#{S}#{A}#{C}\. ?)(.*)/ - - catts = shelve( catts ) if catts - cells << "\t\t\t#{ cell }" - end - ratts = shelve( ratts ) if ratts - rows << "\t\t\n#{ cells.join( "\n" ) }\n\t\t" - end - "\t\n#{ rows.join( "\n" ) }\n\t\n\n" - end - end - - LISTS_RE = /^([#*]+?#{C} .*?)$(?![^#*])/m - LISTS_CONTENT_RE = /^([#*]+)(#{A}#{C}) (.*)$/m - - # Parses Textile lists and generates HTML - def block_textile_lists( text ) - text.gsub!( LISTS_RE ) do |match| - lines = match.split( /\n/ ) - last_line = -1 - depth = [] - lines.each_with_index do |line, line_id| - if line =~ LISTS_CONTENT_RE - tl,atts,content = $~[1..3] - if depth.last - if depth.last.length > tl.length - (depth.length - 1).downto(0) do |i| - break if depth[i].length == tl.length - lines[line_id - 1] << "\n\t\n\t" - depth.pop - end - end - if depth.last and depth.last.length == tl.length - lines[line_id - 1] << '' - end - end - unless depth.last == tl - depth << tl - atts = pba( atts ) - atts = shelve( atts ) if atts - lines[line_id] = "\t<#{ lT(tl) }l#{ atts }>\n\t
  • #{ content }" - else - lines[line_id] = "\t\t
  • #{ content }" - end - last_line = line_id - - else - last_line = line_id - end - if line_id - last_line > 1 or line_id == lines.length - 1 - depth.delete_if do |v| - lines[last_line] << "
  • \n\t" - end - end - end - 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 ? '
    ' * (l-indent) : '
    ' * (indent-l)) + "\n\n") - indent = l - end - quotes << (content + "\n") - end - quotes << ("\n" + '' * indent + "\n\n") - quotes - end - end - - CODE_RE = /(\W) - @ - (?:\|(\w+?)\|)? - (.+?) - @ - (?=\W)/x - - def inline_textile_code( text ) - text.gsub!( CODE_RE ) do |m| - before,lang,code,after = $~[1..4] - lang = " lang=\"#{ lang }\"" if lang - rip_offtags( "#{ before }#{ code }#{ after }" ) - end - end - - def lT( text ) - text =~ /\#$/ ? 'o' : 'u' - end - - def hard_break( text ) - text.gsub!( /(.)\n(?!\Z| *([#*=]+(\s|$)|[{|]))/, "\\1
    " ) if hard_breaks - end - - BLOCKS_GROUP_RE = /\n{2,}(?! )/m - - def blocks( text, deep_code = false ) - text.replace( text.split( BLOCKS_GROUP_RE ).collect do |blk| - plain = blk !~ /\A[#*> ]/ - - # skip blocks that are complex HTML - if blk =~ /^<\/?(\w+).*>/ and not SIMPLE_HTML_TAGS.include? $1 - blk - else - # search for indentation levels - blk.strip! - if blk.empty? - blk - else - code_blk = nil - blk.gsub!( /((?:\n(?:\n^ +[^\n]*)+)+)/m ) do |iblk| - flush_left iblk - blocks iblk, plain - iblk.gsub( /^(\S)/, "\t\\1" ) - if plain - code_blk = iblk; "" - else - iblk - end - end - - block_applied = 0 - @rules.each do |rule_name| - block_applied += 1 if ( rule_name.to_s.match /^block_/ and method( rule_name ).call( blk ) ) - end - if block_applied.zero? - if deep_code - blk = "\t
    #{ blk }
    " - else - blk = "\t

    #{ blk }

    " - end - end - # hard_break blk - blk + "\n#{ code_blk }" - end - end - - end.join( "\n\n" ) ) - end - - def textile_bq( tag, atts, cite, content ) - cite, cite_title = check_refs( cite ) - cite = " cite=\"#{ cite }\"" if cite - atts = shelve( atts ) if atts - "\t\n\t\t#{ content }

    \n\t" - end - - def textile_p( tag, atts, cite, content ) - atts = shelve( atts ) if atts - "\t<#{ tag }#{ atts }>#{ content }" - end - - alias textile_h1 textile_p - alias textile_h2 textile_p - alias textile_h3 textile_p - alias textile_h4 textile_p - alias textile_h5 textile_p - alias textile_h6 textile_p - - def textile_fn_( tag, num, atts, cite, content ) - atts << " id=\"fn#{ num }\"" - content = "#{ num } #{ content }" - atts = shelve( atts ) if atts - "\t#{ content }

    " - end - - BLOCK_RE = /^(([a-z]+)(\d*))(#{A}#{C})\.(?::(\S+))? (.*)$/m - - def block_textile_prefix( text ) - if text =~ BLOCK_RE - tag,tagpre,num,atts,cite,content = $~[1..6] - atts = pba( atts ) - - # pass to prefix handler - if respond_to? "textile_#{ tag }", true - text.gsub!( $&, method( "textile_#{ tag }" ).call( tag, atts, cite, content ) ) - elsif respond_to? "textile_#{ tagpre }_", true - text.gsub!( $&, method( "textile_#{ tagpre }_" ).call( tagpre, num, atts, cite, content ) ) - end - end - end - - SETEXT_RE = /\A(.+?)\n([=-])[=-]* *$/m - def block_markdown_setext( text ) - if text =~ SETEXT_RE - tag = if $2 == "="; "h1"; else; "h2"; end - blk, cont = "<#{ tag }>#{ $1 }", $' - blocks cont - text.replace( blk + cont ) - end - end - - ATX_RE = /\A(\#{1,6}) # $1 = string of #'s - [ ]* - (.+?) # $2 = Header text - [ ]* - \#* # optional closing #'s (not counted) - $/x - def block_markdown_atx( text ) - if text =~ ATX_RE - tag = "h#{ $1.length }" - blk, cont = "<#{ tag }>#{ $2 }\n\n", $' - blocks cont - text.replace( blk + cont ) - end - end - - MARKDOWN_BQ_RE = /\A(^ *> ?.+$(.+\n)*\n*)+/m - - def block_markdown_bq( text ) - text.gsub!( MARKDOWN_BQ_RE ) do |blk| - blk.gsub!( /^ *> ?/, '' ) - flush_left blk - blocks blk - blk.gsub!( /^(\S)/, "\t\\1" ) - "
    \n#{ blk }\n
    \n\n" - end - end - - MARKDOWN_RULE_RE = /^(#{ - ['*', '-', '_'].collect { |ch| ' ?(' + Regexp::quote( ch ) + ' ?){3,}' }.join( '|' ) - })$/ - - def block_markdown_rule( text ) - text.gsub!( MARKDOWN_RULE_RE ) do |blk| - "
    " - end - end - - # XXX TODO XXX - def block_markdown_lists( text ) - end - - def inline_textile_span( text ) - QTAGS.each do |qtag_rc, ht, qtag_re, rtype| - text.gsub!( qtag_re ) do |m| - - case rtype - when :limit - sta,qtag,atts,cite,content = $~[1..5] - else - qtag,atts,cite,content = $~[1..4] - sta = '' - end - atts = pba( atts ) - atts << " cite=\"#{ cite }\"" if cite - atts = shelve( atts ) if atts - - "#{ sta }<#{ ht }#{ atts }>#{ content }" - - end - end - end - - LINK_RE = / - ([\s\[{(]|[#{PUNCT}])? # $pre - " # start - (#{C}) # $atts - ([^"\n]+?) # $text - \s? - (?:\(([^)]+?)\)(?="))? # $title - ": - ([\w\/]\S+?) # $url - (\/)? # $slash - ([^\w\=\/;\(\)]*?) # $post - (?=<|\s|$) - /x -#" - def inline_textile_link( text ) - text.gsub!( LINK_RE ) do |m| - pre,atts,text,title,url,slash,post = $~[1..7] - - url, url_title = check_refs( url ) - title ||= url_title - - # Idea below : an URL with unbalanced parethesis and - # ending by ')' is put into external parenthesis - if ( url[-1]==?) and ((url.count("(") - url.count(")")) < 0 ) ) - url=url[0..-2] # discard closing parenth from url - post = ")"+post # add closing parenth to post - end - atts = pba( atts ) - atts = " href=\"#{ url }#{ slash }\"#{ atts }" - atts << " title=\"#{ title }\"" if title - atts = shelve( atts ) if atts - - external = (url =~ /^https?:\/\//) ? ' class="external"' : '' - - "#{ pre }#{ text }#{ post }" - end - end - - MARKDOWN_REFLINK_RE = / - \[([^\[\]]+)\] # $text - [ ]? # opt. space - (?:\n[ ]*)? # one optional newline followed by spaces - \[(.*?)\] # $id - /x - - def inline_markdown_reflink( text ) - text.gsub!( MARKDOWN_REFLINK_RE ) do |m| - text, id = $~[1..2] - - if id.empty? - url, title = check_refs( text ) - else - url, title = check_refs( id ) - end - - atts = " href=\"#{ url }\"" - atts << " title=\"#{ title }\"" if title - atts = shelve( atts ) - - "#{ text }" - end - end - - MARKDOWN_LINK_RE = / - \[([^\[\]]+)\] # $text - \( # open paren - [ \t]* # opt space - ? # $href - [ \t]* # opt space - (?: # whole title - (['"]) # $quote - (.*?) # $title - \3 # matching quote - )? # title is optional - \) - /x - - def inline_markdown_link( text ) - text.gsub!( MARKDOWN_LINK_RE ) do |m| - text, url, quote, title = $~[1..4] - - atts = " href=\"#{ url }\"" - atts << " title=\"#{ title }\"" if title - atts = shelve( atts ) - - "#{ text }" - end - end - - TEXTILE_REFS_RE = /(^ *)\[([^\[\n]+?)\](#{HYPERLINK})(?=\s|$)/ - MARKDOWN_REFS_RE = /(^ *)\[([^\n]+?)\]:\s+?(?:\s+"((?:[^"]|\\")+)")?(?=\s|$)/m - - def refs( text ) - @rules.each do |rule_name| - method( rule_name ).call( text ) if rule_name.to_s.match /^refs_/ - end - end - - def refs_textile( text ) - text.gsub!( TEXTILE_REFS_RE ) do |m| - flag, url = $~[2..3] - @urlrefs[flag.downcase] = [url, nil] - nil - end - end - - def refs_markdown( text ) - text.gsub!( MARKDOWN_REFS_RE ) do |m| - flag, url = $~[2..3] - title = $~[6] - @urlrefs[flag.downcase] = [url, title] - nil - end - end - - def check_refs( text ) - ret = @urlrefs[text.downcase] if text - ret || [text, nil] - end - - IMAGE_RE = / - (

    |.|^) # start of line? - \! # opening - (\<|\=|\>)? # optional alignment atts - (#{C}) # optional style,class atts - (?:\. )? # optional dot-space - ([^\s(!]+?) # presume this is the src - \s? # optional space - (?:\(((?:[^\(\)]|\([^\)]+\))+?)\))? # optional title - \! # closing - (?::#{ HYPERLINK })? # optional href - /x - - def inline_textile_image( text ) - text.gsub!( IMAGE_RE ) do |m| - stln,algn,atts,url,title,href,href_a1,href_a2 = $~[1..8] - atts = pba( atts ) - atts = " src=\"#{ url }\"#{ atts }" - atts << " title=\"#{ title }\"" if title - atts << " alt=\"#{ title }\"" - # size = @getimagesize($url); - # if($size) $atts.= " $size[3]"; - - href, alt_title = check_refs( href ) if href - url, url_title = check_refs( url ) - - out = '' - out << "" if href - out << "" - out << "#{ href_a1 }#{ href_a2 }" if href - - if algn - algn = h_align( algn ) - if stln == "

    " - out = "

    #{ out }" - else - out = "#{ stln }

    #{ out }
    " - end - else - out = stln + out - end - - out - end - end - - def shelve( val ) - @shelf << val - " :redsh##{ @shelf.length }:" - end - - def retrieve( text ) - @shelf.each_with_index do |r, i| - text.gsub!( " :redsh##{ i + 1 }:", r ) - end - end - - def incoming_entities( text ) - ## turn any incoming ampersands into a dummy character for now. - ## This uses a negative lookahead for alphanumerics followed by a semicolon, - ## implying an incoming html entity, to be skipped - - text.gsub!( /&(?![#a-z0-9]+;)/i, "x%x%" ) - end - - def no_textile( text ) - text.gsub!( /(^|\s)==([^=]+.*?)==(\s|$)?/, - '\1\2\3' ) - text.gsub!( /^ *==([^=]+.*?)==/m, - '\1\2\3' ) - end - - def clean_white_space( text ) - # normalize line breaks - text.gsub!( /\r\n/, "\n" ) - text.gsub!( /\r/, "\n" ) - text.gsub!( /\t/, ' ' ) - text.gsub!( /^ +$/, '' ) - text.gsub!( /\n{3,}/, "\n\n" ) - text.gsub!( /"$/, "\" " ) - - # if entire document is indented, flush - # to the left side - flush_left text - end - - def flush_left( text ) - indt = 0 - if text =~ /^ / - while text !~ /^ {#{indt}}\S/ - indt += 1 - end unless text.empty? - if indt.nonzero? - text.gsub!( /^ {#{indt}}/, '' ) - end - end - end - - def footnote_ref( text ) - text.gsub!( /\b\[([0-9]+?)\](\s)?/, - '\1\2' ) - end - - OFFTAGS = /(code|pre|kbd|notextile)/ - OFFTAG_MATCH = /(?:(<\/#{ OFFTAGS }>)|(<#{ OFFTAGS }[^>]*>))(.*?)(?=<\/?#{ OFFTAGS }|\Z)/mi - OFFTAG_OPEN = /<#{ OFFTAGS }/ - OFFTAG_CLOSE = /<\/?#{ OFFTAGS }/ - HASTAG_MATCH = /(<\/?\w[^\n]*?>)/m - ALLTAG_MATCH = /(<\/?\w[^\n]*?>)|.*?(?=<\/?\w[^\n]*?>|$)/m - - def glyphs_textile( text, level = 0 ) - if text !~ HASTAG_MATCH - pgl text - footnote_ref text - else - codepre = 0 - text.gsub!( ALLTAG_MATCH ) do |line| - ## matches are off if we're between ,
     etc.
    -                if $1
    -                    if line =~ OFFTAG_OPEN
    -                        codepre += 1
    -                    elsif line =~ OFFTAG_CLOSE
    -                        codepre -= 1
    -                        codepre = 0 if codepre < 0
    -                    end 
    -                elsif codepre.zero?
    -                    glyphs_textile( line, level + 1 )
    -                else
    -                    htmlesc( line, :NoQuotes )
    -                end
    -                # p [level, codepre, line]
    -
    -                line
    -            end
    -        end
    -    end
    -
    -    def rip_offtags( text )
    -        if text =~ /<.*>/
    -            ## strip and encode 
     content
    -            codepre, used_offtags = 0, {}
    -            text.gsub!( OFFTAG_MATCH ) do |line|
    -                if $3
    -                    offtag, aftertag = $4, $5
    -                    codepre += 1
    -                    used_offtags[offtag] = true
    -                    if codepre - used_offtags.length > 0
    -                        htmlesc( line, :NoQuotes )
    -                        @pre_list.last << line
    -                        line = ""
    -                    else
    -                        htmlesc( aftertag, :NoQuotes ) if aftertag
    -                        line = ""
    -                        @pre_list << "#{ $3 }#{ aftertag }"
    -                    end
    -                elsif $1 and codepre > 0
    -                    if codepre - used_offtags.length > 0
    -                        htmlesc( line, :NoQuotes )
    -                        @pre_list.last << line
    -                        line = ""
    -                    end
    -                    codepre -= 1 unless codepre.zero?
    -                    used_offtags = {} if codepre.zero?
    -                end 
    -                line
    -            end
    -        end
    -        text
    -    end
    -
    -    def smooth_offtags( text )
    -        unless @pre_list.empty?
    -            ## replace 
     content
    -            text.gsub!( // ) { @pre_list[$1.to_i] }
    -        end
    -    end
    -
    -    def inline( text ) 
    -        [/^inline_/, /^glyphs_/].each do |meth_re|
    -            @rules.each do |rule_name|
    -                method( rule_name ).call( text ) if rule_name.to_s.match( meth_re )
    -            end
    -        end
    -    end
    -
    -    def h_align( text ) 
    -        H_ALGN_VALS[text]
    -    end
    -
    -    def v_align( text ) 
    -        V_ALGN_VALS[text]
    -    end
    -
    -    def textile_popup_help( name, windowW, windowH )
    -        ' ' + name + '
    ' - end - - # HTML cleansing stuff - BASIC_TAGS = { - 'a' => ['href', 'title'], - 'img' => ['src', 'alt', 'title'], - 'br' => [], - 'i' => nil, - 'u' => nil, - 'b' => nil, - 'pre' => nil, - 'kbd' => nil, - 'code' => ['lang'], - 'cite' => nil, - 'strong' => nil, - 'em' => nil, - 'ins' => nil, - 'sup' => nil, - 'sub' => nil, - 'del' => nil, - 'table' => nil, - 'tr' => nil, - 'td' => ['colspan', 'rowspan'], - 'th' => nil, - 'ol' => nil, - 'ul' => nil, - 'li' => nil, - 'p' => nil, - 'h1' => nil, - 'h2' => nil, - 'h3' => nil, - 'h4' => nil, - 'h5' => nil, - 'h6' => nil, - 'blockquote' => ['cite'] - } - - def clean_html( text, tags = BASIC_TAGS ) - text.gsub!( /]*)>/ ) do - raw = $~ - tag = raw[2].downcase - if tags.has_key? tag - pcs = [tag] - tags[tag].each do |prop| - ['"', "'", ''].each do |q| - q2 = ( q != '' ? q : '\s' ) - if raw[3] =~ /#{prop}\s*=\s*#{q}([^#{q2}]+)#{q}/i - attrv = $1 - next if prop == 'src' and attrv =~ %r{^(?!http)\w+:} - pcs << "#{prop}=\"#{$1.gsub('"', '\\"')}\"" - break - end - end - end if tags[tag] - "<#{raw[1]}#{pcs.join " "}>" - else - " " - end - end - end - - ALLOWED_TAGS = %w(redpre pre code notextile) - - def escape_html_tags(text) - text.gsub!(%r{<(\/?([!\w]+)[^<>\n]*)(>?)}) {|m| ALLOWED_TAGS.include?($2) ? "<#{$1}#{$3}" : "<#{$1}#{'>' unless $3.blank?}" } - end -end - diff --git a/lib/redmine.rb b/lib/redmine.rb index da49861..ee3c3c8 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -150,7 +150,3 @@ Redmine::Activity.map do |activity| activity.register :wiki_edits, :class_name => 'WikiContent::Version', :default => false activity.register :messages, :default => false end - -Redmine::WikiFormatting.map do |format| - format.register :textile, Redmine::WikiFormatting::TextileFormatter, TextileHelper -end diff --git a/lib/redmine/wiki_formatting/textile_formatter.rb b/lib/redmine/wiki_formatting/textile_formatter.rb deleted file mode 100644 index 7a8f49f..0000000 --- a/lib/redmine/wiki_formatting/textile_formatter.rb +++ /dev/null @@ -1,181 +0,0 @@ -# redMine - project management software -# Copyright (C) 2006-2007 Jean-Philippe Lang -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -require 'redcloth3' -require 'coderay' - -module Redmine - module WikiFormatting - class TextileFormatter < RedCloth3 - - # auto_link rule after textile rules so that it doesn't break !image_url! tags - RULES = [:textile, :block_markdown_rule, :inline_auto_link, :inline_auto_mailto, :inline_toc, :inline_macros] - - def initialize(*args) - super - self.hard_breaks=true - self.no_span_caps=true - end - - def to_html(*rules, &block) - @toc = [] - @macros_runner = block - super(*RULES).to_s - end - - private - - # Patch for RedCloth. Fixed in RedCloth r128 but _why hasn't released it yet. - # http://code.whytheluckystiff.net/redcloth/changeset/128 - def hard_break( text ) - text.gsub!( /(.)\n(?!\n|\Z|>| *(>? *[#*=]+(\s|$)|[{|]))/, "\\1
    \n" ) if hard_breaks - end - - # Patch to add code highlighting support to RedCloth - def smooth_offtags( text ) - unless @pre_list.empty? - ## replace
     content
    -          text.gsub!(//) do
    -            content = @pre_list[$1.to_i]
    -            if content.match(/\s?(.+)/m)
    -              content = "" + 
    -                CodeRay.scan($2, $1.downcase).html(:escape => false, :line_numbers => :inline)
    -            end
    -            content
    -          end
    -        end
    -      end
    -      
    -      # Patch to add 'table of content' support to RedCloth
    -      def textile_p_withtoc(tag, atts, cite, content)
    -        # removes wiki links from the item
    -        toc_item = content.gsub(/(\[\[|\]\])/, '')
    -        # removes styles
    -        # eg. %{color:red}Triggers% => Triggers
    -        toc_item.gsub! %r[%\{[^\}]*\}([^%]+)%], '\\1'
    -        
    -        # replaces non word caracters by dashes
    -        anchor = toc_item.gsub(%r{[^\w\s\-]}, '').gsub(%r{\s+(\-+\s*)?}, '-')
    -
    -        unless anchor.blank?
    -          if tag =~ /^h(\d)$/
    -            @toc << [$1.to_i, anchor, toc_item]
    -          end
    -          atts << " id=\"#{anchor}\""
    -          content = content + ""
    -        end
    -        textile_p(tag, atts, cite, content)
    -      end
    -
    -      alias :textile_h1 :textile_p_withtoc
    -      alias :textile_h2 :textile_p_withtoc
    -      alias :textile_h3 :textile_p_withtoc
    -      
    -      def inline_toc(text)
    -        text.gsub!(/

    \{\{([<>]?)toc\}\}<\/p>/i) do - div_class = 'toc' - div_class << ' right' if $1 == '>' - div_class << ' left' if $1 == '<' - out = "

      " - @toc.each do |heading| - level, anchor, toc_item = heading - out << "
    • #{toc_item}
    • \n" - end - out << '
    ' - out - end - end - - MACROS_RE = / - (!)? # escaping - ( - \{\{ # opening tag - ([\w]+) # macro name - (\(([^\}]*)\))? # optional arguments - \}\} # closing tag - ) - /x unless const_defined?(:MACROS_RE) - - def inline_macros(text) - text.gsub!(MACROS_RE) do - esc, all, macro = $1, $2, $3.downcase - args = ($5 || '').split(',').each(&:strip) - if esc.nil? - begin - @macros_runner.call(macro, args) - rescue => e - "
    Error executing the #{macro} macro (#{e})
    " - end || all - else - all - end - end - end - - AUTO_LINK_RE = %r{ - ( # leading text - <\w+.*?>| # leading HTML tag, or - [^=<>!:'"/]| # leading punctuation, or - ^ # beginning of line - ) - ( - (?:https?://)| # protocol spec, or - (?:ftp://)| - (?:www\.) # www.* - ) - ( - (\S+?) # url - (\/)? # slash - ) - ([^\w\=\/;\(\)]*?) # post - (?=<|\s|$) - }x unless const_defined?(:AUTO_LINK_RE) - - # Turns all urls into clickable links (code from Rails). - def inline_auto_link(text) - text.gsub!(AUTO_LINK_RE) do - all, leading, proto, url, post = $&, $1, $2, $3, $6 - if leading =~ /=]?/ - # don't replace URL's that are already linked - # and URL's prefixed with ! !> !< != (textile images) - all - else - # Idea below : an URL with unbalanced parethesis and - # ending by ')' is put into external parenthesis - if ( url[-1]==?) and ((url.count("(") - url.count(")")) < 0 ) ) - url=url[0..-2] # discard closing parenth from url - post = ")"+post # add closing parenth to post - end - %(#{leading}#{proto + url}#{post}) - end - end - end - - # Turns all email addresses into clickable links (code from Rails). - def inline_auto_mailto(text) - text.gsub!(/([\w\.!#\$%\-+.]+@[A-Za-z0-9\-]+(\.[A-Za-z0-9\-]+)+)/) do - mail = $1 - if text.match(/]*>(.*)(#{Regexp.escape(mail)})(.*)<\/a>/) - mail - else - %{} - end - end - end - end - end -end diff --git a/public/help/wiki_syntax.html b/public/help/wiki_syntax.html deleted file mode 100644 index 6886f34..0000000 --- a/public/help/wiki_syntax.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - -Wiki formatting - - - - -

    Wiki Syntax Quick Reference

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Font Styles
    Strong*Strong*Strong
    Italic_Italic_Italic
    Underline+Underline+Underline
    Deleted-Deleted-Deleted
    ??Quote??Quote
    Inline Code@Inline Code@Inline Code
    Preformatted text<pre>
     lines
     of code
    </pre>
    -
    - lines
    - of code
    -
    -
    Lists
    Unordered list* Item 1
    * Item 2
    • Item 1
    • Item 2
    Ordered list# Item 1
    # Item 2
    1. Item 1
    2. Item 2
    Headings
    Heading 1h1. Title 1

    Title 1

    Heading 2h2. Title 2

    Title 2

    Heading 3h3. Title 3

    Title 3

    Links
    http://foo.barhttp://foo.bar
    "Foo":http://foo.barFoo
    Redmine links
    Link to a Wiki page[[Wiki page]]Wiki page
    Issue #12Issue #12
    Revision r43Revision r43
    commit:f30e13e43f30e13e4
    source:some/filesource:some/file
    Inline images
    Image!image_url!
    !attached_image!
    - -

    More Information

    - - - diff --git a/public/images/jstoolbar/bt_bq.png b/public/images/jstoolbar/bt_bq.png deleted file mode 100644 index c3af4e07f65847c109006a911359565dd88f7a12..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 503 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!Zi#C|iE~kEVo7FxoWhEpegoTCq`T0FPJ)NDMZEbDM&CLxB4YjqkRaI5x<>jTMq(ntU1qB6p zczCK-zqGTnv#_u*GBVQ9(NR)TYTocVf8pc1&%P%nCdS0XgoT9#1_t{0_;`4DG;Mr7 zZO_||%`eK9KEC(t`;=X88`eL6@bX7+aImkhualFLjg5_&nVErs!R&n>3JMCcv$NCE z(!#^TgMxxeOG}H3i}UmI)6>(Fl9FO$V_!@p zljrH;7*cU7IYEIbA}VtBtsA#)M!&GMcodMtb3|=f+9$4OVgii1xw34rwxYGn&dLJe zp`pI9&cd$UJ!@o|_cSe%y{W;-5;PJOS+@4BLl<6e(pbstU&(Z0G|-o|NsA6TU(o$nCR*0 zX=rFDD=W*&%1TH`2n!4I^YeRpdOABh+uGWio0}UN8ft56tE#HX%gakiNr{Sz3JMDH z@bHwZcxh*6XJKJsWMrhHqobsx^x)->qGgY3*S<+9s?WMgAvW@ct!U@(2phk}BF?Ck8cw6yT> z@Svce($do6;^O@L{Pgtnq@<+S*w~1O2zPgPM@Pp~?MEws-eD{W@(X5gcy=QV$jSF~ zaSW-rm7Ji!77-COGvfA*TQgtZvVIVd#B$`A+OkhvY0nhaP20vc;mXC(iy*<1(dTdVI-qJn0eR_YqLx4wwi^y&+H?=ge iFtai~zeRsqIT*8o|0J?9FfcO&_=LFrXJEK@?_N(& zPjPYaxpU{Tv$I=TT9T8K_wL>M{{8!)prEyD*DhVU^w_auQ>ILL{`~p(@85w&je^k- z7#<YcE$Lv+Psoh|jLcK2s?DxEp{ b-iq=5ZpIyE$5sGyBLjn{tDnm{r-UW|=&*Ik diff --git a/public/images/jstoolbar/bt_del.png b/public/images/jstoolbar/bt_del.png deleted file mode 100644 index 36a912b65151f3bdad6e6ac7bf82a850bcf5e002..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 368 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!eu-;DiE~kEVo7Fxo2BR0pdd@Sqpu?a!^VE@KZ&eBzF&Y(i0gj_hP7+gT3T8L z1qDr+GG*z~r9C}8)z#JCzkgR$RNT6CtAvDvp`oFZlarU1*WSH*i;Ih+qN0GhTUuI@ zlar4fJ9h2bwR`vOojZ4K&YU^nR^M}ga*QQGe!&b5&u*jvIkBEDjv*Dd=Jwv^Yf#{E zHfLYaz`+#v@4tI%%YnGBD%qFPd>QLDomeyf1k-xP32o;&yU!_G1Ph4YStHaLbL#Ay zeL`x*A|cY6?XyewE=&zgu5Jka8!5`|;c+x=|3{`CCZ@fS0iCTtix@mz{an^LB{Ts5 Di@1HC diff --git a/public/images/jstoolbar/bt_em.png b/public/images/jstoolbar/bt_em.png deleted file mode 100644 index caa808236c6afd3284c222e34c3554616130d36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 312 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!eu-;DiE~kEVo7Fxog1K&|X0p1!W^HyDLP^!cQn z<}?6>I14-?iy0WWg+Q3`(%rg0KtYytM_)$E)e-c@Ne6s+b5ZC_<3{$2|Nls3V zii!#f3OaZ0oS~tiqN3v7y?dRUoT{s<@7=rS<>fVJ&YYf}p5o%-ty{NdXJ;?@ey0y; z0%J*#UoeBivm0qZj;*JQV@SoVx&5Ae3<^9<+H1Y<{{5eB`#3O9K#gT${#)h{uW4eR x&Q6(_IGOoNd%<(3f_VboK1ZfVHc0*RkL?p<`1HWbbUM%=22WQ%mvv4FO#u8CWHrMq>1fPyUPj=qiz3>*8o|0J>k`Q8COA+G-!80O5GQ(awM zTwJ_$>(;ev*CrXdy6$FaIgj( z`J=jI>eS!ynKSyNPCuA?xYmbZhGFYYr>`qic127(Fnit<_AN~MN}}v4!Ck^P*msmo z^lMz~e1PpIyP43(Z*RH2G99zZ&$;k=ihtbkQ_SYk6LlqkwlH|Q`njxgN@xNAm|c7- diff --git a/public/images/jstoolbar/bt_h2.png b/public/images/jstoolbar/bt_h2.png deleted file mode 100644 index 1e88cb936d295fffc18d41ff2dfafd98473bd91a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 371 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!eu-;DiE~kEVo7Fxo2BR0pdd@Sqpu?a!^VE@KZ&eBzDIyhi0gj_hBAG{-o59$j^qN(WGo5t3ubV5b|VeQN%M4Z45_%a_PjS=g8~oBg`kNK zqaEz-{a?n#?Vlii_Q}$jOI+%GW*c9KjTGJXUCj9Y(b|MV{k)})mz#9B4LwGvma~cnEpjtRDPBpGxzf|`u!J}Ib@lqatV6H0&QgQboFyt I=akR{0BB=^ZvX%Q diff --git a/public/images/jstoolbar/bt_h3.png b/public/images/jstoolbar/bt_h3.png deleted file mode 100644 index 646bad11d9d38bfafe8581ae47d75da433a74835..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 376 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!eu-;DiE~kEVo7Fxo+ zEiIovf9~bwwRGuHCnu-9d-vWino|ulnXx3uFPOpM*^M+HC)Lx%F{I+w+VkFg4GKIg z7lJnYnHnUz^S>*ruT5jDkDC5w%>(k+U5rZFS0%mdpU`t)vS&`kLEjxe9z2WJ@Xjt{ zSo))3Zucf*`E(;;8$XWKk9M787fCwxdYXIa3SOO*t;)G|l`MI>-OMkhZHbctTFBt( L>gTe~DWM4f1k{A2 diff --git a/public/images/jstoolbar/bt_img.png b/public/images/jstoolbar/bt_img.png deleted file mode 100644 index ddded465c9bd9e10697f8789e5df1f0fe413e06b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1142 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!eu-;DiE~kEVo7Fxo?0v(btiIVPik{pF~y$24;o;pAc8CY=)p}AQFgb zVTkHsNN&+gp2CnkMId>KVe%Y?Y#>?+MCXc^G88X8R=o6m@zU?bYo8ad{a(EFfAtin z>N#H3YXz#e9;@DZu4Rr_%bcK=rP(c84O_MbO<9{gWv}IwV?Z=z&N0iS=Yp1=Ygu}( zXYIMDwbzojUQ6D4uXyjh>T~DL-Me@1IS{=6{vHIrzyJRIKLf-6Q7{?;v=4y?^Y?;s zp>au&Uoh#mF%-_*+XvKM@9E+gQgJKy{Ar;k1D@8072RU4?yDXw@Q@8;Q`++3AOG^s z*<5v}>(4!NuxD6&;X*&#i&X1}F~1!h%AP;G;5skg!nRB4V%7dm6ZZ1euUBbp*4aC6 zyU?lUcW2z0ar)s5uM>|8&N|J}v)IBI?4@|lL2R|E(z&Bg@;97I&is@5;~OvYEydrC T@24LDI)%a0)z4*}Q$iB}Fpym5 diff --git a/public/images/jstoolbar/bt_ins.png b/public/images/jstoolbar/bt_ins.png deleted file mode 100644 index 92c8dff698f319d0801cf6480fe41f3665e8489c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1055 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!eu-;DiE~kEVo7FxogTe~DWM4f D=q`5E diff --git a/public/images/jstoolbar/bt_link.png b/public/images/jstoolbar/bt_link.png deleted file mode 100644 index 8d67e3d905c3556ed49ab61f59eda1015dc16195..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 408 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!eu-;DiE~kEVo7Fxo?0v(btiIVPik{pF~z5-y^^$#PvS|!@Ya=&Ye4V z?AWojYu83aMI|REXJ=>6nKS46_wQ4tOerod?&<0I|NsBerAyCUyVlau;^gEM6ckil zUG3%NwRi8{=g*(NfB*iC>!p=IGZ{;Q{DK)Ap4~_Ta=JZT978H@`JVUWJEFkDazH}3 zr&CfP=l}ng8&raRJ#b!mbyELg%^IfTT}j`xW40@t|8lS9w(J*u1O1x^nB5ARzwf>* z7ttO3i+x*7qVC=Up=%uEkAITddTBuyv%^N=EWV8r(|tQpC7PTd$+V#o7rKZ9q+`eF3(!*?@r^4kCo`r0XmDp)78&qol`;+0JUSATmS$7 diff --git a/public/images/jstoolbar/bt_ol.png b/public/images/jstoolbar/bt_ol.png deleted file mode 100644 index 0cce2fae0c25f75d64f0fad5d2e319f6e32869af..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 363 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!eu-;DiE~kEVo7Fxo2BR0pdd@Sqpu?a!^VE@KZ&eBeqex4i0gj_hT^5qr)+)y z{Qdv6Yu9ROYAPx!N=Qfu2ncX+Z~#@ctbJa+_W9nud!wSFf`Wp)yu6&8oGdLZ4Gj%@ zwmzS;_x;ji?~ffjR$N@1ot>SWoXjb>?=estV@Z%-FoVOh8)-mJsHcl#NX4zzUT?kz z1p#MkC5=T5@&Y^lJ6_!&E%auc{$GY(mlTDf2Jt(ZPh+}DO$9H6b2QzLIU}90`P}>C xnpfF-BJ15cJ0?GCHSk)xEb{fzu(o$kn0J{lE&Z2X&T1 z9he6c;wTR6hzvLtxm4KumCp9?+AFB|(0{3=Yq3qyahJo-U3d6}Ptb zIr23)a4@%TI`F?fr~K=qn;uTg!WswU4TGDmMi?_?&DkRL#Ef5HtIeIA2erb@C!}0a q&Od!a>~=_Th>XzBhU+)a&yO$q!f<2FGq)q4fb?|rb6Mw<&;$UBwp*V7 diff --git a/public/images/jstoolbar/bt_strong.png b/public/images/jstoolbar/bt_strong.png deleted file mode 100644 index 33e6daaddcdea6573c964d21f26e8947b70061b0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 360 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!eu-;DiE~kEVo7FxoZU0vXy zuQ=v(={I**I1j`AGXIig)9;1&%w({g#=AwK`sM*KsqRn-pP4OXr7kQ5)30ZJTYWv~ vE!QVIi`8y?ov)XO>{Iv1nR}e!|2KwSDW)^5G68Hrn;1M@{an^LB{Ts5Kzn&$ diff --git a/public/images/jstoolbar/bt_ul.png b/public/images/jstoolbar/bt_ul.png deleted file mode 100644 index df9ecc0cfd80167a3b3ca46f0d9c7c73797c4c57..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 365 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!eu-;DiE~kEVo7FxonZ#981GS;^N}$?Cj*^co)_tpi8S96504)Ujjd4xT*O8pAl9H3HO19GkCiCxvXAide'; + this.toolbar.appendChild(h); + + // Draw toolbar elements + var b, tool, newTool; + + for (var i in this.elements) { + b = this.elements[i]; + + var disabled = + b.type == undefined || b.type == '' + || (b.disabled != undefined && b.disabled) + || (b.context != undefined && b.context != null && b.context != this.context); + + if (!disabled && typeof this[b.type] == 'function') { + tool = this[b.type](i); + if (tool) newTool = tool.draw(); + if (newTool) { + this.toolNodes[i] = newTool; //mémorise l'accès DOM pour usage éventuel ultérieur + this.toolbar.appendChild(newTool); + } + } + } + }, + + singleTag: function(stag,etag) { + stag = stag || null; + etag = etag || stag; + + if (!stag || !etag) { return; } + + this.encloseSelection(stag,etag); + }, + + encloseLineSelection: function(prefix, suffix, fn) { + this.textarea.focus(); + + prefix = prefix || ''; + suffix = suffix || ''; + + var start, end, sel, scrollPos, subst, res; + + if (typeof(document["selection"]) != "undefined") { + sel = document.selection.createRange().text; + } else if (typeof(this.textarea["setSelectionRange"]) != "undefined") { + start = this.textarea.selectionStart; + end = this.textarea.selectionEnd; + scrollPos = this.textarea.scrollTop; + // go to the start of the line + start = this.textarea.value.substring(0, start).replace(/[^\r\n]*$/g,'').length; + // go to the end of the line + end = this.textarea.value.length - this.textarea.value.substring(end, this.textarea.value.length).replace(/^[^\r\n]*/, '').length; + sel = this.textarea.value.substring(start, end); + } + + if (sel.match(/ $/)) { // exclude ending space char, if any + sel = sel.substring(0, sel.length - 1); + suffix = suffix + " "; + } + + if (typeof(fn) == 'function') { + res = (sel) ? fn.call(this,sel) : fn(''); + } else { + res = (sel) ? sel : ''; + } + + subst = prefix + res + suffix; + + if (typeof(document["selection"]) != "undefined") { + document.selection.createRange().text = subst; + var range = this.textarea.createTextRange(); + range.collapse(false); + range.move('character', -suffix.length); + range.select(); + } else if (typeof(this.textarea["setSelectionRange"]) != "undefined") { + this.textarea.value = this.textarea.value.substring(0, start) + subst + + this.textarea.value.substring(end); + if (sel) { + this.textarea.setSelectionRange(start + subst.length, start + subst.length); + } else { + this.textarea.setSelectionRange(start + prefix.length, start + prefix.length); + } + this.textarea.scrollTop = scrollPos; + } + }, + + encloseSelection: function(prefix, suffix, fn) { + this.textarea.focus(); + + prefix = prefix || ''; + suffix = suffix || ''; + + var start, end, sel, scrollPos, subst, res; + + if (typeof(document["selection"]) != "undefined") { + sel = document.selection.createRange().text; + } else if (typeof(this.textarea["setSelectionRange"]) != "undefined") { + start = this.textarea.selectionStart; + end = this.textarea.selectionEnd; + scrollPos = this.textarea.scrollTop; + sel = this.textarea.value.substring(start, end); + } + + if (sel.match(/ $/)) { // exclude ending space char, if any + sel = sel.substring(0, sel.length - 1); + suffix = suffix + " "; + } + + if (typeof(fn) == 'function') { + res = (sel) ? fn.call(this,sel) : fn(''); + } else { + res = (sel) ? sel : ''; + } + + subst = prefix + res + suffix; + + if (typeof(document["selection"]) != "undefined") { + document.selection.createRange().text = subst; + var range = this.textarea.createTextRange(); + range.collapse(false); + range.move('character', -suffix.length); + range.select(); +// this.textarea.caretPos -= suffix.length; + } else if (typeof(this.textarea["setSelectionRange"]) != "undefined") { + this.textarea.value = this.textarea.value.substring(0, start) + subst + + this.textarea.value.substring(end); + if (sel) { + this.textarea.setSelectionRange(start + subst.length, start + subst.length); + } else { + this.textarea.setSelectionRange(start + prefix.length, start + prefix.length); + } + this.textarea.scrollTop = scrollPos; + } + }, + + stripBaseURL: function(url) { + if (this.base_url != '') { + var pos = url.indexOf(this.base_url); + if (pos == 0) { + url = url.substr(this.base_url.length); + } + } + + return url; + } +}; + +/** Resizer +-------------------------------------------------------- */ +jsToolBar.prototype.resizeSetStartH = function() { + this.dragStartH = this.textarea.offsetHeight + 0; +}; +jsToolBar.prototype.resizeDragStart = function(event) { + var This = this; + this.dragStartY = event.clientY; + this.resizeSetStartH(); + document.addEventListener('mousemove', this.dragMoveHdlr=function(event){This.resizeDragMove(event);}, false); + document.addEventListener('mouseup', this.dragStopHdlr=function(event){This.resizeDragStop(event);}, false); +}; + +jsToolBar.prototype.resizeDragMove = function(event) { + this.textarea.style.height = (this.dragStartH+event.clientY-this.dragStartY)+'px'; +}; + +jsToolBar.prototype.resizeDragStop = function(event) { + document.removeEventListener('mousemove', this.dragMoveHdlr, false); + document.removeEventListener('mouseup', this.dragStopHdlr, false); +}; diff --git a/public/javascripts/jstoolbar/jstoolbar.js b/public/javascripts/jstoolbar/jstoolbar.js deleted file mode 100644 index 66669ce..0000000 --- a/public/javascripts/jstoolbar/jstoolbar.js +++ /dev/null @@ -1,380 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * This file is part of DotClear. - * Copyright (c) 2005 Nicolas Martin & Olivier Meunier and contributors. All - * rights reserved. - * - * DotClear is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * DotClear is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with DotClear; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * ***** END LICENSE BLOCK ***** -*/ - -/* Modified by JP LANG for textile formatting */ - -function jsToolBar(textarea) { - if (!document.createElement) { return; } - - if (!textarea) { return; } - - if ((typeof(document["selection"]) == "undefined") - && (typeof(textarea["setSelectionRange"]) == "undefined")) { - return; - } - - this.textarea = textarea; - - this.editor = document.createElement('div'); - this.editor.className = 'jstEditor'; - - this.textarea.parentNode.insertBefore(this.editor,this.textarea); - this.editor.appendChild(this.textarea); - - this.toolbar = document.createElement("div"); - this.toolbar.className = 'jstElements'; - this.editor.parentNode.insertBefore(this.toolbar,this.editor); - - // Dragable resizing (only for gecko) - if (this.editor.addEventListener) - { - this.handle = document.createElement('div'); - this.handle.className = 'jstHandle'; - var dragStart = this.resizeDragStart; - var This = this; - this.handle.addEventListener('mousedown',function(event) { dragStart.call(This,event); },false); - // fix memory leak in Firefox (bug #241518) - window.addEventListener('unload',function() { - var del = This.handle.parentNode.removeChild(This.handle); - delete(This.handle); - },false); - - this.editor.parentNode.insertBefore(this.handle,this.editor.nextSibling); - } - - this.context = null; - this.toolNodes = {}; // lorsque la toolbar est dessinée , cet objet est garni - // de raccourcis vers les éléments DOM correspondants aux outils. -} - -function jsButton(title, fn, scope, className) { - if(typeof jsToolBar.strings == 'undefined') { - this.title = title || null; - } else { - this.title = jsToolBar.strings[title] || title || null; - } - this.fn = fn || function(){}; - this.scope = scope || null; - this.className = className || null; -} -jsButton.prototype.draw = function() { - if (!this.scope) return null; - - var button = document.createElement('button'); - button.setAttribute('type','button'); - button.tabIndex = 200; - if (this.className) button.className = this.className; - button.title = this.title; - var span = document.createElement('span'); - span.appendChild(document.createTextNode(this.title)); - button.appendChild(span); - - if (this.icon != undefined) { - button.style.backgroundImage = 'url('+this.icon+')'; - } - if (typeof(this.fn) == 'function') { - var This = this; - button.onclick = function() { try { This.fn.apply(This.scope, arguments) } catch (e) {} return false; }; - } - return button; -} - -function jsSpace(id) { - this.id = id || null; - this.width = null; -} -jsSpace.prototype.draw = function() { - var span = document.createElement('span'); - if (this.id) span.id = this.id; - span.appendChild(document.createTextNode(String.fromCharCode(160))); - span.className = 'jstSpacer'; - if (this.width) span.style.marginRight = this.width+'px'; - - return span; -} - -function jsCombo(title, options, scope, fn, className) { - this.title = title || null; - this.options = options || null; - this.scope = scope || null; - this.fn = fn || function(){}; - this.className = className || null; -} -jsCombo.prototype.draw = function() { - if (!this.scope || !this.options) return null; - - var select = document.createElement('select'); - if (this.className) select.className = className; - select.title = this.title; - - for (var o in this.options) { - //var opt = this.options[o]; - var option = document.createElement('option'); - option.value = o; - option.appendChild(document.createTextNode(this.options[o])); - select.appendChild(option); - } - - var This = this; - select.onchange = function() { - try { - This.fn.call(This.scope, this.value); - } catch (e) { alert(e); } - - return false; - } - - return select; -} - - -jsToolBar.prototype = { - base_url: '', - mode: 'wiki', - elements: {}, - help_link: '', - - getMode: function() { - return this.mode; - }, - - setMode: function(mode) { - this.mode = mode || 'wiki'; - }, - - switchMode: function(mode) { - mode = mode || 'wiki'; - this.draw(mode); - }, - - setHelpLink: function(link) { - this.help_link = link; - }, - - button: function(toolName) { - var tool = this.elements[toolName]; - if (typeof tool.fn[this.mode] != 'function') return null; - var b = new jsButton(tool.title, tool.fn[this.mode], this, 'jstb_'+toolName); - if (tool.icon != undefined) b.icon = tool.icon; - return b; - }, - space: function(toolName) { - var tool = new jsSpace(toolName) - if (this.elements[toolName].width !== undefined) - tool.width = this.elements[toolName].width; - return tool; - }, - combo: function(toolName) { - var tool = this.elements[toolName]; - var length = tool[this.mode].list.length; - - if (typeof tool[this.mode].fn != 'function' || length == 0) { - return null; - } else { - var options = {}; - for (var i=0; i < length; i++) { - var opt = tool[this.mode].list[i]; - options[opt] = tool.options[opt]; - } - return new jsCombo(tool.title, options, this, tool[this.mode].fn); - } - }, - draw: function(mode) { - this.setMode(mode); - - // Empty toolbar - while (this.toolbar.hasChildNodes()) { - this.toolbar.removeChild(this.toolbar.firstChild) - } - this.toolNodes = {}; // vide les raccourcis DOM/**/ - - var h = document.createElement('div'); - h.className = 'help' - h.innerHTML = this.help_link; - 'Aide'; - this.toolbar.appendChild(h); - - // Draw toolbar elements - var b, tool, newTool; - - for (var i in this.elements) { - b = this.elements[i]; - - var disabled = - b.type == undefined || b.type == '' - || (b.disabled != undefined && b.disabled) - || (b.context != undefined && b.context != null && b.context != this.context); - - if (!disabled && typeof this[b.type] == 'function') { - tool = this[b.type](i); - if (tool) newTool = tool.draw(); - if (newTool) { - this.toolNodes[i] = newTool; //mémorise l'accès DOM pour usage éventuel ultérieur - this.toolbar.appendChild(newTool); - } - } - } - }, - - singleTag: function(stag,etag) { - stag = stag || null; - etag = etag || stag; - - if (!stag || !etag) { return; } - - this.encloseSelection(stag,etag); - }, - - encloseLineSelection: function(prefix, suffix, fn) { - this.textarea.focus(); - - prefix = prefix || ''; - suffix = suffix || ''; - - var start, end, sel, scrollPos, subst, res; - - if (typeof(document["selection"]) != "undefined") { - sel = document.selection.createRange().text; - } else if (typeof(this.textarea["setSelectionRange"]) != "undefined") { - start = this.textarea.selectionStart; - end = this.textarea.selectionEnd; - scrollPos = this.textarea.scrollTop; - // go to the start of the line - start = this.textarea.value.substring(0, start).replace(/[^\r\n]*$/g,'').length; - // go to the end of the line - end = this.textarea.value.length - this.textarea.value.substring(end, this.textarea.value.length).replace(/^[^\r\n]*/, '').length; - sel = this.textarea.value.substring(start, end); - } - - if (sel.match(/ $/)) { // exclude ending space char, if any - sel = sel.substring(0, sel.length - 1); - suffix = suffix + " "; - } - - if (typeof(fn) == 'function') { - res = (sel) ? fn.call(this,sel) : fn(''); - } else { - res = (sel) ? sel : ''; - } - - subst = prefix + res + suffix; - - if (typeof(document["selection"]) != "undefined") { - document.selection.createRange().text = subst; - var range = this.textarea.createTextRange(); - range.collapse(false); - range.move('character', -suffix.length); - range.select(); - } else if (typeof(this.textarea["setSelectionRange"]) != "undefined") { - this.textarea.value = this.textarea.value.substring(0, start) + subst + - this.textarea.value.substring(end); - if (sel) { - this.textarea.setSelectionRange(start + subst.length, start + subst.length); - } else { - this.textarea.setSelectionRange(start + prefix.length, start + prefix.length); - } - this.textarea.scrollTop = scrollPos; - } - }, - - encloseSelection: function(prefix, suffix, fn) { - this.textarea.focus(); - - prefix = prefix || ''; - suffix = suffix || ''; - - var start, end, sel, scrollPos, subst, res; - - if (typeof(document["selection"]) != "undefined") { - sel = document.selection.createRange().text; - } else if (typeof(this.textarea["setSelectionRange"]) != "undefined") { - start = this.textarea.selectionStart; - end = this.textarea.selectionEnd; - scrollPos = this.textarea.scrollTop; - sel = this.textarea.value.substring(start, end); - } - - if (sel.match(/ $/)) { // exclude ending space char, if any - sel = sel.substring(0, sel.length - 1); - suffix = suffix + " "; - } - - if (typeof(fn) == 'function') { - res = (sel) ? fn.call(this,sel) : fn(''); - } else { - res = (sel) ? sel : ''; - } - - subst = prefix + res + suffix; - - if (typeof(document["selection"]) != "undefined") { - document.selection.createRange().text = subst; - var range = this.textarea.createTextRange(); - range.collapse(false); - range.move('character', -suffix.length); - range.select(); -// this.textarea.caretPos -= suffix.length; - } else if (typeof(this.textarea["setSelectionRange"]) != "undefined") { - this.textarea.value = this.textarea.value.substring(0, start) + subst + - this.textarea.value.substring(end); - if (sel) { - this.textarea.setSelectionRange(start + subst.length, start + subst.length); - } else { - this.textarea.setSelectionRange(start + prefix.length, start + prefix.length); - } - this.textarea.scrollTop = scrollPos; - } - }, - - stripBaseURL: function(url) { - if (this.base_url != '') { - var pos = url.indexOf(this.base_url); - if (pos == 0) { - url = url.substr(this.base_url.length); - } - } - - return url; - } -}; - -/** Resizer --------------------------------------------------------- */ -jsToolBar.prototype.resizeSetStartH = function() { - this.dragStartH = this.textarea.offsetHeight + 0; -}; -jsToolBar.prototype.resizeDragStart = function(event) { - var This = this; - this.dragStartY = event.clientY; - this.resizeSetStartH(); - document.addEventListener('mousemove', this.dragMoveHdlr=function(event){This.resizeDragMove(event);}, false); - document.addEventListener('mouseup', this.dragStopHdlr=function(event){This.resizeDragStop(event);}, false); -}; - -jsToolBar.prototype.resizeDragMove = function(event) { - this.textarea.style.height = (this.dragStartH+event.clientY-this.dragStartY)+'px'; -}; - -jsToolBar.prototype.resizeDragStop = function(event) { - document.removeEventListener('mousemove', this.dragMoveHdlr, false); - document.removeEventListener('mouseup', this.dragStopHdlr, false); -}; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-bg.js b/public/javascripts/jstoolbar/lang/jstoolbar-bg.js deleted file mode 100644 index 2d68498..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-bg.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Strong'; -jsToolBar.strings['Italic'] = 'Italic'; -jsToolBar.strings['Underline'] = 'Underline'; -jsToolBar.strings['Deleted'] = 'Deleted'; -jsToolBar.strings['Code'] = 'Inline Code'; -jsToolBar.strings['Heading 1'] = 'Heading 1'; -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-ca.js b/public/javascripts/jstoolbar/lang/jstoolbar-ca.js deleted file mode 100644 index 3d652a4..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-ca.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Negreta'; -jsToolBar.strings['Italic'] = 'Cursiva'; -jsToolBar.strings['Underline'] = 'Subratllat'; -jsToolBar.strings['Deleted'] = 'Barrat'; -jsToolBar.strings['Code'] = 'Codi en línia'; -jsToolBar.strings['Heading 1'] = 'Encapçalament 1'; -jsToolBar.strings['Heading 2'] = 'Encapçalament 2'; -jsToolBar.strings['Heading 3'] = 'Encapçalament 3'; -jsToolBar.strings['Unordered list'] = 'Llista sense ordre'; -jsToolBar.strings['Ordered list'] = 'Llista ordenada'; -jsToolBar.strings['Quote'] = 'Cometes'; -jsToolBar.strings['Unquote'] = 'Sense cometes'; -jsToolBar.strings['Preformatted text'] = 'Text formatat'; -jsToolBar.strings['Wiki link'] = 'Enllaça a una pàgina Wiki'; -jsToolBar.strings['Image'] = 'Imatge'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-cs.js b/public/javascripts/jstoolbar/lang/jstoolbar-cs.js deleted file mode 100644 index f2c0dbf..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-cs.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Tučné'; -jsToolBar.strings['Italic'] = 'Kurzíva'; -jsToolBar.strings['Underline'] = 'Podtržené'; -jsToolBar.strings['Deleted'] = 'Přeškrtnuté '; -jsToolBar.strings['Code'] = 'Zobrazení kódu'; -jsToolBar.strings['Heading 1'] = 'Záhlaví 1'; -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 deleted file mode 100644 index 6ccc8ea..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-da.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Fed'; -jsToolBar.strings['Italic'] = 'Kursiv'; -jsToolBar.strings['Underline'] = 'Underskrevet'; -jsToolBar.strings['Deleted'] = 'Slettet'; -jsToolBar.strings['Code'] = 'Inline Kode'; -jsToolBar.strings['Heading 1'] = 'Overskrift 1'; -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 deleted file mode 100644 index ce68686..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-de.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Fett'; -jsToolBar.strings['Italic'] = 'Kursiv'; -jsToolBar.strings['Underline'] = 'Unterstrichen'; -jsToolBar.strings['Deleted'] = 'Durchgestrichen'; -jsToolBar.strings['Code'] = 'Quelltext'; -jsToolBar.strings['Heading 1'] = 'Überschrift 1. Ordnung'; -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 deleted file mode 100644 index 2d68498..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-en.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Strong'; -jsToolBar.strings['Italic'] = 'Italic'; -jsToolBar.strings['Underline'] = 'Underline'; -jsToolBar.strings['Deleted'] = 'Deleted'; -jsToolBar.strings['Code'] = 'Inline Code'; -jsToolBar.strings['Heading 1'] = 'Heading 1'; -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 deleted file mode 100644 index 2d68498..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-es.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Strong'; -jsToolBar.strings['Italic'] = 'Italic'; -jsToolBar.strings['Underline'] = 'Underline'; -jsToolBar.strings['Deleted'] = 'Deleted'; -jsToolBar.strings['Code'] = 'Inline Code'; -jsToolBar.strings['Heading 1'] = 'Heading 1'; -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 deleted file mode 100644 index c2229b2..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-fi.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Lihavoitu'; -jsToolBar.strings['Italic'] = 'Kursivoitu'; -jsToolBar.strings['Underline'] = 'Alleviivattu'; -jsToolBar.strings['Deleted'] = 'Yliviivattu'; -jsToolBar.strings['Code'] = 'Koodi näkymä'; -jsToolBar.strings['Heading 1'] = 'Otsikko 1'; -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 deleted file mode 100644 index c52a783..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-fr.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Gras'; -jsToolBar.strings['Italic'] = 'Italique'; -jsToolBar.strings['Underline'] = 'Souligné'; -jsToolBar.strings['Deleted'] = 'Rayé'; -jsToolBar.strings['Code'] = 'Code en ligne'; -jsToolBar.strings['Heading 1'] = 'Titre niveau 1'; -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 deleted file mode 100644 index 2d68498..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-he.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Strong'; -jsToolBar.strings['Italic'] = 'Italic'; -jsToolBar.strings['Underline'] = 'Underline'; -jsToolBar.strings['Deleted'] = 'Deleted'; -jsToolBar.strings['Code'] = 'Inline Code'; -jsToolBar.strings['Heading 1'] = 'Heading 1'; -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 deleted file mode 100644 index c31ba00..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-hu.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Félkövér'; -jsToolBar.strings['Italic'] = 'Dőlt'; -jsToolBar.strings['Underline'] = 'Aláhúzott'; -jsToolBar.strings['Deleted'] = 'Törölt'; -jsToolBar.strings['Code'] = 'Kód sorok'; -jsToolBar.strings['Heading 1'] = 'Fejléc 1'; -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 deleted file mode 100644 index 2d68498..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-it.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Strong'; -jsToolBar.strings['Italic'] = 'Italic'; -jsToolBar.strings['Underline'] = 'Underline'; -jsToolBar.strings['Deleted'] = 'Deleted'; -jsToolBar.strings['Code'] = 'Inline Code'; -jsToolBar.strings['Heading 1'] = 'Heading 1'; -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 deleted file mode 100644 index c9413da..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-ja.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = '強調'; -jsToolBar.strings['Italic'] = '斜体'; -jsToolBar.strings['Underline'] = '下線'; -jsToolBar.strings['Deleted'] = '取り消し線'; -jsToolBar.strings['Code'] = 'コード'; -jsToolBar.strings['Heading 1'] = '見出し 1'; -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 deleted file mode 100644 index 2d68498..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-ko.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Strong'; -jsToolBar.strings['Italic'] = 'Italic'; -jsToolBar.strings['Underline'] = 'Underline'; -jsToolBar.strings['Deleted'] = 'Deleted'; -jsToolBar.strings['Code'] = 'Inline Code'; -jsToolBar.strings['Heading 1'] = 'Heading 1'; -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 deleted file mode 100644 index 8af364c..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-lt.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Pastorinti'; -jsToolBar.strings['Italic'] = 'Italic'; -jsToolBar.strings['Underline'] = 'Pabraukti'; -jsToolBar.strings['Deleted'] = 'Užbraukti'; -jsToolBar.strings['Code'] = 'Kodas'; -jsToolBar.strings['Heading 1'] = 'Heading 1'; -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 deleted file mode 100644 index 2d68498..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-nl.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Strong'; -jsToolBar.strings['Italic'] = 'Italic'; -jsToolBar.strings['Underline'] = 'Underline'; -jsToolBar.strings['Deleted'] = 'Deleted'; -jsToolBar.strings['Code'] = 'Inline Code'; -jsToolBar.strings['Heading 1'] = 'Heading 1'; -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 deleted file mode 100644 index 7995973..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-no.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Fet'; -jsToolBar.strings['Italic'] = 'Kursiv'; -jsToolBar.strings['Underline'] = 'Understreking'; -jsToolBar.strings['Deleted'] = 'Slettet'; -jsToolBar.strings['Code'] = 'Kode'; -jsToolBar.strings['Heading 1'] = 'Overskrift 1'; -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'] = 'Sitat'; -jsToolBar.strings['Unquote'] = 'Avslutt sitat'; -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 deleted file mode 100644 index 0e7a38c..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-pl.js +++ /dev/null @@ -1,17 +0,0 @@ -// Keep this line in order to avoid problems with Windows Notepad UTF-8 EF-BB-BF idea... -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Pogrubienie'; -jsToolBar.strings['Italic'] = 'Kursywa'; -jsToolBar.strings['Underline'] = 'Podkreślenie'; -jsToolBar.strings['Deleted'] = 'Usunięte'; -jsToolBar.strings['Code'] = 'Wstawka kodu'; -jsToolBar.strings['Heading 1'] = 'Nagłowek 1'; -jsToolBar.strings['Heading 2'] = 'Nagłówek 2'; -jsToolBar.strings['Heading 3'] = 'Nagłówek 3'; -jsToolBar.strings['Unordered list'] = 'Nieposortowana lista'; -jsToolBar.strings['Ordered list'] = 'Posortowana lista'; -jsToolBar.strings['Quote'] = 'Cytat'; -jsToolBar.strings['Unquote'] = 'Usuń cytat'; -jsToolBar.strings['Preformatted text'] = 'Sformatowany tekst'; -jsToolBar.strings['Wiki link'] = 'Odnośnik do strony Wiki'; -jsToolBar.strings['Image'] = 'Obraz'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-pt-br.js b/public/javascripts/jstoolbar/lang/jstoolbar-pt-br.js deleted file mode 100644 index 5035524..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-pt-br.js +++ /dev/null @@ -1,18 +0,0 @@ -// Translated by: Alexandre da Silva - -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Negrito'; -jsToolBar.strings['Italic'] = 'Itálico'; -jsToolBar.strings['Underline'] = 'Sublinhado'; -jsToolBar.strings['Deleted'] = 'Excluído'; -jsToolBar.strings['Code'] = 'Código Inline'; -jsToolBar.strings['Heading 1'] = 'Cabeçalho 1'; -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 deleted file mode 100644 index 137d795..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-pt.js +++ /dev/null @@ -1,17 +0,0 @@ -// Translated by: Pedro Araújo -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Negrito'; -jsToolBar.strings['Italic'] = 'Itálico'; -jsToolBar.strings['Underline'] = 'Sublinhado'; -jsToolBar.strings['Deleted'] = 'Apagado'; -jsToolBar.strings['Code'] = 'Código Inline'; -jsToolBar.strings['Heading 1'] = 'Cabeçalho 1'; -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'] = 'Citação'; -jsToolBar.strings['Unquote'] = 'Remover citação'; -jsToolBar.strings['Preformatted text'] = 'Texto pré-formatado'; -jsToolBar.strings['Wiki link'] = 'Link para uma página da Wiki'; -jsToolBar.strings['Image'] = 'Imagem'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-ro.js b/public/javascripts/jstoolbar/lang/jstoolbar-ro.js deleted file mode 100644 index 2d68498..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-ro.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Strong'; -jsToolBar.strings['Italic'] = 'Italic'; -jsToolBar.strings['Underline'] = 'Underline'; -jsToolBar.strings['Deleted'] = 'Deleted'; -jsToolBar.strings['Code'] = 'Inline Code'; -jsToolBar.strings['Heading 1'] = 'Heading 1'; -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 deleted file mode 100644 index a6d8c4f..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-ru.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Жирный'; -jsToolBar.strings['Italic'] = 'Курсив'; -jsToolBar.strings['Underline'] = 'Подчеркнутый'; -jsToolBar.strings['Deleted'] = 'Зачеркнутый'; -jsToolBar.strings['Code'] = 'Вставка кода'; -jsToolBar.strings['Heading 1'] = 'Заголовок 1'; -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 deleted file mode 100644 index 2d68498..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-sr.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Strong'; -jsToolBar.strings['Italic'] = 'Italic'; -jsToolBar.strings['Underline'] = 'Underline'; -jsToolBar.strings['Deleted'] = 'Deleted'; -jsToolBar.strings['Code'] = 'Inline Code'; -jsToolBar.strings['Heading 1'] = 'Heading 1'; -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 deleted file mode 100644 index 2d68498..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-sv.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Strong'; -jsToolBar.strings['Italic'] = 'Italic'; -jsToolBar.strings['Underline'] = 'Underline'; -jsToolBar.strings['Deleted'] = 'Deleted'; -jsToolBar.strings['Code'] = 'Inline Code'; -jsToolBar.strings['Heading 1'] = 'Heading 1'; -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 deleted file mode 100644 index d871642..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-th.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'หนา'; -jsToolBar.strings['Italic'] = 'เอียง'; -jsToolBar.strings['Underline'] = 'ขีดเส้นใต้'; -jsToolBar.strings['Deleted'] = 'ขีดฆ่า'; -jsToolBar.strings['Code'] = 'โค๊ดโปรแกรม'; -jsToolBar.strings['Heading 1'] = 'หัวข้อ 1'; -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-tr.js b/public/javascripts/jstoolbar/lang/jstoolbar-tr.js deleted file mode 100644 index 31705d7..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-tr.js +++ /dev/null @@ -1,14 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Kalın'; -jsToolBar.strings['Italic'] = 'İtalik'; -jsToolBar.strings['Underline'] = 'Altı çizgili'; -jsToolBar.strings['Deleted'] = 'Silinmiş'; -jsToolBar.strings['Code'] = 'Satır içi kod'; -jsToolBar.strings['Heading 1'] = 'Başlık 1'; -jsToolBar.strings['Heading 2'] = 'Başlık 2'; -jsToolBar.strings['Heading 3'] = 'Başlık 3'; -jsToolBar.strings['Unordered list'] = 'Sırasız liste'; -jsToolBar.strings['Ordered list'] = 'Sıralı liste'; -jsToolBar.strings['Preformatted text'] = 'Preformatted text'; -jsToolBar.strings['Wiki link'] = 'Wiki sayfasına bağlantı'; -jsToolBar.strings['Image'] = 'Resim'; diff --git a/public/javascripts/jstoolbar/lang/jstoolbar-uk.js b/public/javascripts/jstoolbar/lang/jstoolbar-uk.js deleted file mode 100644 index 2d68498..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-uk.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = 'Strong'; -jsToolBar.strings['Italic'] = 'Italic'; -jsToolBar.strings['Underline'] = 'Underline'; -jsToolBar.strings['Deleted'] = 'Deleted'; -jsToolBar.strings['Code'] = 'Inline Code'; -jsToolBar.strings['Heading 1'] = 'Heading 1'; -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 deleted file mode 100644 index 86599c5..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-zh-tw.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = '粗體'; -jsToolBar.strings['Italic'] = '斜體'; -jsToolBar.strings['Underline'] = '底線'; -jsToolBar.strings['Deleted'] = '刪除線'; -jsToolBar.strings['Code'] = '程式碼'; -jsToolBar.strings['Heading 1'] = '標題 1'; -jsToolBar.strings['Heading 2'] = '標題 2'; -jsToolBar.strings['Heading 3'] = '標題 3'; -jsToolBar.strings['Unordered list'] = '項目清單'; -jsToolBar.strings['Ordered list'] = '編號清單'; -jsToolBar.strings['Quote'] = '引文'; -jsToolBar.strings['Unquote'] = '取消引文'; -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 deleted file mode 100644 index a9b6ba2..0000000 --- a/public/javascripts/jstoolbar/lang/jstoolbar-zh.js +++ /dev/null @@ -1,16 +0,0 @@ -jsToolBar.strings = {}; -jsToolBar.strings['Strong'] = '粗体'; -jsToolBar.strings['Italic'] = '斜体'; -jsToolBar.strings['Underline'] = '下划线'; -jsToolBar.strings['Deleted'] = '删除线'; -jsToolBar.strings['Code'] = '程序代码'; -jsToolBar.strings['Heading 1'] = '标题 1'; -jsToolBar.strings['Heading 2'] = '标题 2'; -jsToolBar.strings['Heading 3'] = '标题 3'; -jsToolBar.strings['Unordered list'] = '无序列表'; -jsToolBar.strings['Ordered list'] = '排序列表'; -jsToolBar.strings['Quote'] = '引用'; -jsToolBar.strings['Unquote'] = '删除引用'; -jsToolBar.strings['Preformatted text'] = '格式化文本'; -jsToolBar.strings['Wiki link'] = '连接到 Wiki 页面'; -jsToolBar.strings['Image'] = '图片'; diff --git a/public/javascripts/jstoolbar/textile.js b/public/javascripts/jstoolbar/textile.js deleted file mode 100644 index 6ac6821..0000000 --- a/public/javascripts/jstoolbar/textile.js +++ /dev/null @@ -1,200 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * This file is part of DotClear. - * Copyright (c) 2005 Nicolas Martin & Olivier Meunier and contributors. All - * rights reserved. - * - * DotClear is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * DotClear is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with DotClear; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * ***** END LICENSE BLOCK ***** -*/ - -// Elements definition ------------------------------------ - -// strong -jsToolBar.prototype.elements.strong = { - type: 'button', - title: 'Strong', - fn: { - wiki: function() { this.singleTag('*') } - } -} - -// em -jsToolBar.prototype.elements.em = { - type: 'button', - title: 'Italic', - fn: { - wiki: function() { this.singleTag("_") } - } -} - -// ins -jsToolBar.prototype.elements.ins = { - type: 'button', - title: 'Underline', - fn: { - wiki: function() { this.singleTag('+') } - } -} - -// del -jsToolBar.prototype.elements.del = { - type: 'button', - title: 'Deleted', - fn: { - wiki: function() { this.singleTag('-') } - } -} - -// code -jsToolBar.prototype.elements.code = { - type: 'button', - title: 'Code', - fn: { - wiki: function() { this.singleTag('@') } - } -} - -// spacer -jsToolBar.prototype.elements.space1 = {type: 'space'} - -// headings -jsToolBar.prototype.elements.h1 = { - type: 'button', - title: 'Heading 1', - fn: { - wiki: function() { - this.encloseLineSelection('h1. ', '',function(str) { - str = str.replace(/^h\d+\.\s+/, '') - return str; - }); - } - } -} -jsToolBar.prototype.elements.h2 = { - type: 'button', - title: 'Heading 2', - fn: { - wiki: function() { - this.encloseLineSelection('h2. ', '',function(str) { - str = str.replace(/^h\d+\.\s+/, '') - return str; - }); - } - } -} -jsToolBar.prototype.elements.h3 = { - type: 'button', - title: 'Heading 3', - fn: { - wiki: function() { - this.encloseLineSelection('h3. ', '',function(str) { - str = str.replace(/^h\d+\.\s+/, '') - return str; - }); - } - } -} - -// spacer -jsToolBar.prototype.elements.space2 = {type: 'space'} - -// ul -jsToolBar.prototype.elements.ul = { - type: 'button', - title: 'Unordered list', - fn: { - wiki: function() { - this.encloseLineSelection('','',function(str) { - str = str.replace(/\r/g,''); - return str.replace(/(\n|^)[#-]?\s*/g,"$1* "); - }); - } - } -} - -// ol -jsToolBar.prototype.elements.ol = { - type: 'button', - title: 'Ordered list', - fn: { - wiki: function() { - this.encloseLineSelection('','',function(str) { - str = str.replace(/\r/g,''); - return str.replace(/(\n|^)[*-]?\s*/g,"$1# "); - }); - } - } -} - -// 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', - title: 'Preformatted text', - fn: { - wiki: function() { this.encloseLineSelection('
    \n', '\n
    ') } - } -} - -// spacer -jsToolBar.prototype.elements.space4 = {type: 'space'} - -// wiki page -jsToolBar.prototype.elements.link = { - type: 'button', - title: 'Wiki link', - fn: { - wiki: function() { this.encloseSelection("[[", "]]") } - } -} -// image -jsToolBar.prototype.elements.img = { - type: 'button', - title: 'Image', - fn: { - wiki: function() { this.encloseSelection("!", "!") } - } -} diff --git a/public/stylesheets/jstoolbar.css b/public/stylesheets/jstoolbar.css index 9514e3e..ae9606b 100644 --- a/public/stylesheets/jstoolbar.css +++ b/public/stylesheets/jstoolbar.css @@ -45,51 +45,3 @@ } .jstElements .help { float: right; margin-right: 1em; padding-top: 8px; font-size: 0.9em; } - -/* Buttons --------------------------------------------------------- */ -.jstb_strong { - background-image: url(../images/jstoolbar/bt_strong.png); -} -.jstb_em { - background-image: url(../images/jstoolbar/bt_em.png); -} -.jstb_ins { - background-image: url(../images/jstoolbar/bt_ins.png); -} -.jstb_del { - background-image: url(../images/jstoolbar/bt_del.png); -} -.jstb_code { - background-image: url(../images/jstoolbar/bt_code.png); -} -.jstb_h1 { - background-image: url(../images/jstoolbar/bt_h1.png); -} -.jstb_h2 { - background-image: url(../images/jstoolbar/bt_h2.png); -} -.jstb_h3 { - background-image: url(../images/jstoolbar/bt_h3.png); -} -.jstb_ul { - background-image: url(../images/jstoolbar/bt_ul.png); -} -.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); -} -.jstb_link { - background-image: url(../images/jstoolbar/bt_link.png); -} -.jstb_img { - background-image: url(../images/jstoolbar/bt_img.png); -} diff --git a/vendor/plugins/redmine_textile_formatter/README b/vendor/plugins/redmine_textile_formatter/README new file mode 100644 index 0000000..05c1d51 --- /dev/null +++ b/vendor/plugins/redmine_textile_formatter/README @@ -0,0 +1,14 @@ +== Textile formatter plugin + +This plugin provides textile as a wiki format to Redmine. + +=== Plugin installation + +1. Copy the plugin directory into the vendor/plugins directory + +2. Migrate plugin: + rake db:migrate_plugins + +3. Start Redmine + +Installed plugins are listed on 'Admin -> Information' screen. diff --git a/vendor/plugins/redmine_textile_formatter/app/helpers/redmine_textile_formatter/helper.rb b/vendor/plugins/redmine_textile_formatter/app/helpers/redmine_textile_formatter/helper.rb new file mode 100644 index 0000000..20ef8ad --- /dev/null +++ b/vendor/plugins/redmine_textile_formatter/app/helpers/redmine_textile_formatter/helper.rb @@ -0,0 +1,25 @@ +module RedmineTextileFormatter + module Helper + unloadable + + def wikitoolbar_for(field_id) + file = Engines::RailsExtensions::AssetHelpers.plugin_asset_path('redmine_textile_formatter', 'help', 'textile_syntax.html') + help_link = l(:setting_text_formatting) + ': ' + + link_to(l(:label_help), file, + :onclick => "window.open(\"#{file}\", \"\", \"resizable=yes, location=no, width=300, height=640, menubar=no, status=no, scrollbars=yes\"); return false;") + + javascript_include_tag('jstoolbar') + + javascript_include_tag('textile', :plugin => 'redmine_textile_formatter') + + javascript_include_tag("lang/jstoolbar-#{current_language}", :plugin => 'redmine_textile_formatter') + + javascript_tag("var toolbar = new jsToolBar($('#{field_id}')); toolbar.setHelpLink('#{help_link}'); toolbar.draw();") + end + + def initial_page_content(page) + "h1. #{@page.pretty_title}" + end + + def heads_for_wiki_formatter + stylesheet_link_tag('textile', :plugin => 'redmine_textile_formatter') + end + end +end diff --git a/vendor/plugins/redmine_textile_formatter/assets/help/wiki_syntax.html b/vendor/plugins/redmine_textile_formatter/assets/help/wiki_syntax.html new file mode 100644 index 0000000..6886f34 --- /dev/null +++ b/vendor/plugins/redmine_textile_formatter/assets/help/wiki_syntax.html @@ -0,0 +1,66 @@ + + + + + +Wiki formatting + + + + +

    Wiki Syntax Quick Reference

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Font Styles
    Strong*Strong*Strong
    Italic_Italic_Italic
    Underline+Underline+Underline
    Deleted-Deleted-Deleted
    ??Quote??Quote
    Inline Code@Inline Code@Inline Code
    Preformatted text<pre>
     lines
     of code
    </pre>
    +
    + lines
    + of code
    +
    +
    Lists
    Unordered list* Item 1
    * Item 2
    • Item 1
    • Item 2
    Ordered list# Item 1
    # Item 2
    1. Item 1
    2. Item 2
    Headings
    Heading 1h1. Title 1

    Title 1

    Heading 2h2. Title 2

    Title 2

    Heading 3h3. Title 3

    Title 3

    Links
    http://foo.barhttp://foo.bar
    "Foo":http://foo.barFoo
    Redmine links
    Link to a Wiki page[[Wiki page]]Wiki page
    Issue #12Issue #12
    Revision r43Revision r43
    commit:f30e13e43f30e13e4
    source:some/filesource:some/file
    Inline images
    Image!image_url!
    !attached_image!
    + +

    More Information

    + + + diff --git a/vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_bq.png b/vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_bq.png new file mode 100644 index 0000000000000000000000000000000000000000..c3af4e07f65847c109006a911359565dd88f7a12 GIT binary patch literal 503 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!Zi#C|iE~kEVo7FxoWhEpegoTCq`T0FPJ)NDMZEbDM&CLxB4YjqkRaI5x<>jTMq(ntU1qB6p zczCK-zqGTnv#_u*GBVQ9(NR)TYTocVf8pc1&%P%nCdS0XgoT9#1_t{0_;`4DG;Mr7 zZO_||%`eK9KEC(t`;=X88`eL6@bX7+aImkhualFLjg5_&nVErs!R&n>3JMCcv$NCE z(!#^TgMxxeOG}H3i}UmI)6>(Fl9FO$V_!@p zljrH;7*cU7IYEIbA}VtBtsA#)M!&GMcodMtb3|=f+9$4OVgii1xw34rwxYGn&dLJe zp`pI9&cd$UJ!@o|_cSe%y{W;-5;PJOS+@4BLl<6e(pbstU&(Z0G|-o|NsA6TU(o$nCR*0 zX=rFDD=W*&%1TH`2n!4I^YeRpdOABh+uGWio0}UN8ft56tE#HX%gakiNr{Sz3JMDH z@bHwZcxh*6XJKJsWMrhHqobsx^x)->qGgY3*S<+9s?WMgAvW@ct!U@(2phk}BF?Ck8cw6yT> z@Svce($do6;^O@L{Pgtnq@<+S*w~1O2zPgPM@Pp~?MEws-eD{W@(X5gcy=QV$jSF~ zaSW-rm7Ji!77-COGvfA*TQgtZvVIVd#B$`A+OkhvY0nhaP20vc;mXC(iy*<1(dTdVI-qJn0eR_YqLx4wwi^y&+H?=ge iFtai~zeRsqIT*8o|0J?9FfcO&_=LFrXJEK@?_N(& zPjPYaxpU{Tv$I=TT9T8K_wL>M{{8!)prEyD*DhVU^w_auQ>ILL{`~p(@85w&je^k- z7#<YcE$Lv+Psoh|jLcK2s?DxEp{ b-iq=5ZpIyE$5sGyBLjn{tDnm{r-UW|=&*Ik literal 0 HcmV?d00001 diff --git a/vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_del.png b/vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_del.png new file mode 100644 index 0000000000000000000000000000000000000000..36a912b65151f3bdad6e6ac7bf82a850bcf5e002 GIT binary patch literal 368 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!eu-;DiE~kEVo7Fxo2BR0pdd@Sqpu?a!^VE@KZ&eBzF&Y(i0gj_hP7+gT3T8L z1qDr+GG*z~r9C}8)z#JCzkgR$RNT6CtAvDvp`oFZlarU1*WSH*i;Ih+qN0GhTUuI@ zlar4fJ9h2bwR`vOojZ4K&YU^nR^M}ga*QQGe!&b5&u*jvIkBEDjv*Dd=Jwv^Yf#{E zHfLYaz`+#v@4tI%%YnGBD%qFPd>QLDomeyf1k-xP32o;&yU!_G1Ph4YStHaLbL#Ay zeL`x*A|cY6?XyewE=&zgu5Jka8!5`|;c+x=|3{`CCZ@fS0iCTtix@mz{an^LB{Ts5 Di@1HC literal 0 HcmV?d00001 diff --git a/vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_em.png b/vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_em.png new file mode 100644 index 0000000000000000000000000000000000000000..caa808236c6afd3284c222e34c3554616130d36c GIT binary patch literal 312 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!eu-;DiE~kEVo7Fxog1K&|X0p1!W^HyDLP^!cQn z<}?6>I14-?iy0WWg+Q3`(%rg0KtYytM_)$E)e-c@Ne6s+b5ZC_<3{$2|Nls3V zii!#f3OaZ0oS~tiqN3v7y?dRUoT{s<@7=rS<>fVJ&YYf}p5o%-ty{NdXJ;?@ey0y; z0%J*#UoeBivm0qZj;*JQV@SoVx&5Ae3<^9<+H1Y<{{5eB`#3O9K#gT${#)h{uW4eR x&Q6(_IGOoNd%<(3f_VboK1ZfVHc0*RkL?p<`1HWbbUM%=22WQ%mvv4FO#u8CWHrMq>1fPyUPj=qiz3>*8o|0J>k`Q8COA+G-!80O5GQ(awM zTwJ_$>(;ev*CrXdy6$FaIgj( z`J=jI>eS!ynKSyNPCuA?xYmbZhGFYYr>`qic127(Fnit<_AN~MN}}v4!Ck^P*msmo z^lMz~e1PpIyP43(Z*RH2G99zZ&$;k=ihtbkQ_SYk6LlqkwlH|Q`njxgN@xNAm|c7- literal 0 HcmV?d00001 diff --git a/vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_h2.png b/vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_h2.png new file mode 100644 index 0000000000000000000000000000000000000000..1e88cb936d295fffc18d41ff2dfafd98473bd91a GIT binary patch literal 371 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!eu-;DiE~kEVo7Fxo2BR0pdd@Sqpu?a!^VE@KZ&eBzDIyhi0gj_hBAG{-o59$j^qN(WGo5t3ubV5b|VeQN%M4Z45_%a_PjS=g8~oBg`kNK zqaEz-{a?n#?Vlii_Q}$jOI+%GW*c9KjTGJXUCj9Y(b|MV{k)})mz#9B4LwGvma~cnEpjtRDPBpGxzf|`u!J}Ib@lqatV6H0&QgQboFyt I=akR{0BB=^ZvX%Q literal 0 HcmV?d00001 diff --git a/vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_h3.png b/vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_h3.png new file mode 100644 index 0000000000000000000000000000000000000000..646bad11d9d38bfafe8581ae47d75da433a74835 GIT binary patch literal 376 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!eu-;DiE~kEVo7Fxo+ zEiIovf9~bwwRGuHCnu-9d-vWino|ulnXx3uFPOpM*^M+HC)Lx%F{I+w+VkFg4GKIg z7lJnYnHnUz^S>*ruT5jDkDC5w%>(k+U5rZFS0%mdpU`t)vS&`kLEjxe9z2WJ@Xjt{ zSo))3Zucf*`E(;;8$XWKk9M787fCwxdYXIa3SOO*t;)G|l`MI>-OMkhZHbctTFBt( L>gTe~DWM4f1k{A2 literal 0 HcmV?d00001 diff --git a/vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_img.png b/vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_img.png new file mode 100644 index 0000000000000000000000000000000000000000..ddded465c9bd9e10697f8789e5df1f0fe413e06b GIT binary patch literal 1142 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!eu-;DiE~kEVo7Fxo?0v(btiIVPik{pF~y$24;o;pAc8CY=)p}AQFgb zVTkHsNN&+gp2CnkMId>KVe%Y?Y#>?+MCXc^G88X8R=o6m@zU?bYo8ad{a(EFfAtin z>N#H3YXz#e9;@DZu4Rr_%bcK=rP(c84O_MbO<9{gWv}IwV?Z=z&N0iS=Yp1=Ygu}( zXYIMDwbzojUQ6D4uXyjh>T~DL-Me@1IS{=6{vHIrzyJRIKLf-6Q7{?;v=4y?^Y?;s zp>au&Uoh#mF%-_*+XvKM@9E+gQgJKy{Ar;k1D@8072RU4?yDXw@Q@8;Q`++3AOG^s z*<5v}>(4!NuxD6&;X*&#i&X1}F~1!h%AP;G;5skg!nRB4V%7dm6ZZ1euUBbp*4aC6 zyU?lUcW2z0ar)s5uM>|8&N|J}v)IBI?4@|lL2R|E(z&Bg@;97I&is@5;~OvYEydrC T@24LDI)%a0)z4*}Q$iB}Fpym5 literal 0 HcmV?d00001 diff --git a/vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_ins.png b/vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_ins.png new file mode 100644 index 0000000000000000000000000000000000000000..92c8dff698f319d0801cf6480fe41f3665e8489c GIT binary patch literal 1055 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!eu-;DiE~kEVo7FxogTe~DWM4f D=q`5E literal 0 HcmV?d00001 diff --git a/vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_link.png b/vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_link.png new file mode 100644 index 0000000000000000000000000000000000000000..8d67e3d905c3556ed49ab61f59eda1015dc16195 GIT binary patch literal 408 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!eu-;DiE~kEVo7Fxo?0v(btiIVPik{pF~z5-y^^$#PvS|!@Ya=&Ye4V z?AWojYu83aMI|REXJ=>6nKS46_wQ4tOerod?&<0I|NsBerAyCUyVlau;^gEM6ckil zUG3%NwRi8{=g*(NfB*iC>!p=IGZ{;Q{DK)Ap4~_Ta=JZT978H@`JVUWJEFkDazH}3 zr&CfP=l}ng8&raRJ#b!mbyELg%^IfTT}j`xW40@t|8lS9w(J*u1O1x^nB5ARzwf>* z7ttO3i+x*7qVC=Up=%uEkAITddTBuyv%^N=EWV8r(|tQpC7PTd$+V#o7rKZ9q+`eF3(!*?@r^4kCo`r0XmDp)78&qol`;+0JUSATmS$7 literal 0 HcmV?d00001 diff --git a/vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_ol.png b/vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_ol.png new file mode 100644 index 0000000000000000000000000000000000000000..0cce2fae0c25f75d64f0fad5d2e319f6e32869af GIT binary patch literal 363 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!eu-;DiE~kEVo7Fxo2BR0pdd@Sqpu?a!^VE@KZ&eBeqex4i0gj_hT^5qr)+)y z{Qdv6Yu9ROYAPx!N=Qfu2ncX+Z~#@ctbJa+_W9nud!wSFf`Wp)yu6&8oGdLZ4Gj%@ zwmzS;_x;ji?~ffjR$N@1ot>SWoXjb>?=estV@Z%-FoVOh8)-mJsHcl#NX4zzUT?kz z1p#MkC5=T5@&Y^lJ6_!&E%auc{$GY(mlTDf2Jt(ZPh+}DO$9H6b2QzLIU}90`P}>C xnpfF-BJ15cJ0?GCHSk)xEb{fzu(o$kn0J{lE&Z2X&T1 z9he6c;wTR6hzvLtxm4KumCp9?+AFB|(0{3=Yq3qyahJo-U3d6}Ptb zIr23)a4@%TI`F?fr~K=qn;uTg!WswU4TGDmMi?_?&DkRL#Ef5HtIeIA2erb@C!}0a q&Od!a>~=_Th>XzBhU+)a&yO$q!f<2FGq)q4fb?|rb6Mw<&;$UBwp*V7 literal 0 HcmV?d00001 diff --git a/vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_strong.png b/vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_strong.png new file mode 100644 index 0000000000000000000000000000000000000000..33e6daaddcdea6573c964d21f26e8947b70061b0 GIT binary patch literal 360 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!eu-;DiE~kEVo7FxoZU0vXy zuQ=v(={I**I1j`AGXIig)9;1&%w({g#=AwK`sM*KsqRn-pP4OXr7kQ5)30ZJTYWv~ vE!QVIi`8y?ov)XO>{Iv1nR}e!|2KwSDW)^5G68Hrn;1M@{an^LB{Ts5Kzn&$ literal 0 HcmV?d00001 diff --git a/vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_ul.png b/vendor/plugins/redmine_textile_formatter/assets/images/jstoolbar/bt_ul.png new file mode 100644 index 0000000000000000000000000000000000000000..df9ecc0cfd80167a3b3ca46f0d9c7c73797c4c57 GIT binary patch literal 365 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!eu-;DiE~kEVo7FxonZ#981GS;^N}$?Cj*^co)_tpi8S96504)Ujjd4xT*O8pAl9H3HO19GkCiCxvX + +jsToolBar.strings = {}; +jsToolBar.strings['Strong'] = 'Negrito'; +jsToolBar.strings['Italic'] = 'Itálico'; +jsToolBar.strings['Underline'] = 'Sublinhado'; +jsToolBar.strings['Deleted'] = 'Excluído'; +jsToolBar.strings['Code'] = 'Código Inline'; +jsToolBar.strings['Heading 1'] = 'Cabeçalho 1'; +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/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-pt.js b/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-pt.js new file mode 100644 index 0000000..137d795 --- /dev/null +++ b/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-pt.js @@ -0,0 +1,17 @@ +// Translated by: Pedro Araújo +jsToolBar.strings = {}; +jsToolBar.strings['Strong'] = 'Negrito'; +jsToolBar.strings['Italic'] = 'Itálico'; +jsToolBar.strings['Underline'] = 'Sublinhado'; +jsToolBar.strings['Deleted'] = 'Apagado'; +jsToolBar.strings['Code'] = 'Código Inline'; +jsToolBar.strings['Heading 1'] = 'Cabeçalho 1'; +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'] = 'Citação'; +jsToolBar.strings['Unquote'] = 'Remover citação'; +jsToolBar.strings['Preformatted text'] = 'Texto pré-formatado'; +jsToolBar.strings['Wiki link'] = 'Link para uma página da Wiki'; +jsToolBar.strings['Image'] = 'Imagem'; diff --git a/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-ro.js b/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-ro.js new file mode 100644 index 0000000..2d68498 --- /dev/null +++ b/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-ro.js @@ -0,0 +1,16 @@ +jsToolBar.strings = {}; +jsToolBar.strings['Strong'] = 'Strong'; +jsToolBar.strings['Italic'] = 'Italic'; +jsToolBar.strings['Underline'] = 'Underline'; +jsToolBar.strings['Deleted'] = 'Deleted'; +jsToolBar.strings['Code'] = 'Inline Code'; +jsToolBar.strings['Heading 1'] = 'Heading 1'; +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/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-ru.js b/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-ru.js new file mode 100644 index 0000000..a6d8c4f --- /dev/null +++ b/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-ru.js @@ -0,0 +1,16 @@ +jsToolBar.strings = {}; +jsToolBar.strings['Strong'] = 'Жирный'; +jsToolBar.strings['Italic'] = 'Курсив'; +jsToolBar.strings['Underline'] = 'Подчеркнутый'; +jsToolBar.strings['Deleted'] = 'Зачеркнутый'; +jsToolBar.strings['Code'] = 'Вставка кода'; +jsToolBar.strings['Heading 1'] = 'Заголовок 1'; +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/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-sr.js b/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-sr.js new file mode 100644 index 0000000..2d68498 --- /dev/null +++ b/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-sr.js @@ -0,0 +1,16 @@ +jsToolBar.strings = {}; +jsToolBar.strings['Strong'] = 'Strong'; +jsToolBar.strings['Italic'] = 'Italic'; +jsToolBar.strings['Underline'] = 'Underline'; +jsToolBar.strings['Deleted'] = 'Deleted'; +jsToolBar.strings['Code'] = 'Inline Code'; +jsToolBar.strings['Heading 1'] = 'Heading 1'; +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/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-sv.js b/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-sv.js new file mode 100644 index 0000000..2d68498 --- /dev/null +++ b/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-sv.js @@ -0,0 +1,16 @@ +jsToolBar.strings = {}; +jsToolBar.strings['Strong'] = 'Strong'; +jsToolBar.strings['Italic'] = 'Italic'; +jsToolBar.strings['Underline'] = 'Underline'; +jsToolBar.strings['Deleted'] = 'Deleted'; +jsToolBar.strings['Code'] = 'Inline Code'; +jsToolBar.strings['Heading 1'] = 'Heading 1'; +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/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-th.js b/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-th.js new file mode 100644 index 0000000..d871642 --- /dev/null +++ b/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-th.js @@ -0,0 +1,16 @@ +jsToolBar.strings = {}; +jsToolBar.strings['Strong'] = 'หนา'; +jsToolBar.strings['Italic'] = 'เอียง'; +jsToolBar.strings['Underline'] = 'ขีดเส้นใต้'; +jsToolBar.strings['Deleted'] = 'ขีดฆ่า'; +jsToolBar.strings['Code'] = 'โค๊ดโปรแกรม'; +jsToolBar.strings['Heading 1'] = 'หัวข้อ 1'; +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/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-tr.js b/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-tr.js new file mode 100644 index 0000000..31705d7 --- /dev/null +++ b/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-tr.js @@ -0,0 +1,14 @@ +jsToolBar.strings = {}; +jsToolBar.strings['Strong'] = 'Kalın'; +jsToolBar.strings['Italic'] = 'İtalik'; +jsToolBar.strings['Underline'] = 'Altı çizgili'; +jsToolBar.strings['Deleted'] = 'Silinmiş'; +jsToolBar.strings['Code'] = 'Satır içi kod'; +jsToolBar.strings['Heading 1'] = 'Başlık 1'; +jsToolBar.strings['Heading 2'] = 'Başlık 2'; +jsToolBar.strings['Heading 3'] = 'Başlık 3'; +jsToolBar.strings['Unordered list'] = 'Sırasız liste'; +jsToolBar.strings['Ordered list'] = 'Sıralı liste'; +jsToolBar.strings['Preformatted text'] = 'Preformatted text'; +jsToolBar.strings['Wiki link'] = 'Wiki sayfasına bağlantı'; +jsToolBar.strings['Image'] = 'Resim'; diff --git a/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-uk.js b/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-uk.js new file mode 100644 index 0000000..2d68498 --- /dev/null +++ b/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-uk.js @@ -0,0 +1,16 @@ +jsToolBar.strings = {}; +jsToolBar.strings['Strong'] = 'Strong'; +jsToolBar.strings['Italic'] = 'Italic'; +jsToolBar.strings['Underline'] = 'Underline'; +jsToolBar.strings['Deleted'] = 'Deleted'; +jsToolBar.strings['Code'] = 'Inline Code'; +jsToolBar.strings['Heading 1'] = 'Heading 1'; +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/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-zh-tw.js b/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-zh-tw.js new file mode 100644 index 0000000..86599c5 --- /dev/null +++ b/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-zh-tw.js @@ -0,0 +1,16 @@ +jsToolBar.strings = {}; +jsToolBar.strings['Strong'] = '粗體'; +jsToolBar.strings['Italic'] = '斜體'; +jsToolBar.strings['Underline'] = '底線'; +jsToolBar.strings['Deleted'] = '刪除線'; +jsToolBar.strings['Code'] = '程式碼'; +jsToolBar.strings['Heading 1'] = '標題 1'; +jsToolBar.strings['Heading 2'] = '標題 2'; +jsToolBar.strings['Heading 3'] = '標題 3'; +jsToolBar.strings['Unordered list'] = '項目清單'; +jsToolBar.strings['Ordered list'] = '編號清單'; +jsToolBar.strings['Quote'] = '引文'; +jsToolBar.strings['Unquote'] = '取消引文'; +jsToolBar.strings['Preformatted text'] = '已格式文字'; +jsToolBar.strings['Wiki link'] = '連結至 Wiki 頁面'; +jsToolBar.strings['Image'] = '圖片'; diff --git a/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-zh.js b/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-zh.js new file mode 100644 index 0000000..a9b6ba2 --- /dev/null +++ b/vendor/plugins/redmine_textile_formatter/assets/javascripts/lang/jstoolbar-zh.js @@ -0,0 +1,16 @@ +jsToolBar.strings = {}; +jsToolBar.strings['Strong'] = '粗体'; +jsToolBar.strings['Italic'] = '斜体'; +jsToolBar.strings['Underline'] = '下划线'; +jsToolBar.strings['Deleted'] = '删除线'; +jsToolBar.strings['Code'] = '程序代码'; +jsToolBar.strings['Heading 1'] = '标题 1'; +jsToolBar.strings['Heading 2'] = '标题 2'; +jsToolBar.strings['Heading 3'] = '标题 3'; +jsToolBar.strings['Unordered list'] = '无序列表'; +jsToolBar.strings['Ordered list'] = '排序列表'; +jsToolBar.strings['Quote'] = '引用'; +jsToolBar.strings['Unquote'] = '删除引用'; +jsToolBar.strings['Preformatted text'] = '格式化文本'; +jsToolBar.strings['Wiki link'] = '连接到 Wiki 页面'; +jsToolBar.strings['Image'] = '图片'; diff --git a/vendor/plugins/redmine_textile_formatter/assets/javascripts/textile.js b/vendor/plugins/redmine_textile_formatter/assets/javascripts/textile.js new file mode 100644 index 0000000..6ac6821 --- /dev/null +++ b/vendor/plugins/redmine_textile_formatter/assets/javascripts/textile.js @@ -0,0 +1,200 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * This file is part of DotClear. + * Copyright (c) 2005 Nicolas Martin & Olivier Meunier and contributors. All + * rights reserved. + * + * DotClear is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * DotClear is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with DotClear; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * ***** END LICENSE BLOCK ***** +*/ + +// Elements definition ------------------------------------ + +// strong +jsToolBar.prototype.elements.strong = { + type: 'button', + title: 'Strong', + fn: { + wiki: function() { this.singleTag('*') } + } +} + +// em +jsToolBar.prototype.elements.em = { + type: 'button', + title: 'Italic', + fn: { + wiki: function() { this.singleTag("_") } + } +} + +// ins +jsToolBar.prototype.elements.ins = { + type: 'button', + title: 'Underline', + fn: { + wiki: function() { this.singleTag('+') } + } +} + +// del +jsToolBar.prototype.elements.del = { + type: 'button', + title: 'Deleted', + fn: { + wiki: function() { this.singleTag('-') } + } +} + +// code +jsToolBar.prototype.elements.code = { + type: 'button', + title: 'Code', + fn: { + wiki: function() { this.singleTag('@') } + } +} + +// spacer +jsToolBar.prototype.elements.space1 = {type: 'space'} + +// headings +jsToolBar.prototype.elements.h1 = { + type: 'button', + title: 'Heading 1', + fn: { + wiki: function() { + this.encloseLineSelection('h1. ', '',function(str) { + str = str.replace(/^h\d+\.\s+/, '') + return str; + }); + } + } +} +jsToolBar.prototype.elements.h2 = { + type: 'button', + title: 'Heading 2', + fn: { + wiki: function() { + this.encloseLineSelection('h2. ', '',function(str) { + str = str.replace(/^h\d+\.\s+/, '') + return str; + }); + } + } +} +jsToolBar.prototype.elements.h3 = { + type: 'button', + title: 'Heading 3', + fn: { + wiki: function() { + this.encloseLineSelection('h3. ', '',function(str) { + str = str.replace(/^h\d+\.\s+/, '') + return str; + }); + } + } +} + +// spacer +jsToolBar.prototype.elements.space2 = {type: 'space'} + +// ul +jsToolBar.prototype.elements.ul = { + type: 'button', + title: 'Unordered list', + fn: { + wiki: function() { + this.encloseLineSelection('','',function(str) { + str = str.replace(/\r/g,''); + return str.replace(/(\n|^)[#-]?\s*/g,"$1* "); + }); + } + } +} + +// ol +jsToolBar.prototype.elements.ol = { + type: 'button', + title: 'Ordered list', + fn: { + wiki: function() { + this.encloseLineSelection('','',function(str) { + str = str.replace(/\r/g,''); + return str.replace(/(\n|^)[*-]?\s*/g,"$1# "); + }); + } + } +} + +// 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', + title: 'Preformatted text', + fn: { + wiki: function() { this.encloseLineSelection('
    \n', '\n
    ') } + } +} + +// spacer +jsToolBar.prototype.elements.space4 = {type: 'space'} + +// wiki page +jsToolBar.prototype.elements.link = { + type: 'button', + title: 'Wiki link', + fn: { + wiki: function() { this.encloseSelection("[[", "]]") } + } +} +// image +jsToolBar.prototype.elements.img = { + type: 'button', + title: 'Image', + fn: { + wiki: function() { this.encloseSelection("!", "!") } + } +} diff --git a/vendor/plugins/redmine_textile_formatter/assets/stylesheets/textile.css b/vendor/plugins/redmine_textile_formatter/assets/stylesheets/textile.css new file mode 100644 index 0000000..1c6a774 --- /dev/null +++ b/vendor/plugins/redmine_textile_formatter/assets/stylesheets/textile.css @@ -0,0 +1,47 @@ +/* Buttons +-------------------------------------------------------- */ +.jstb_strong { + background-image: url(../images/jstoolbar/bt_strong.png); +} +.jstb_em { + background-image: url(../images/jstoolbar/bt_em.png); +} +.jstb_ins { + background-image: url(../images/jstoolbar/bt_ins.png); +} +.jstb_del { + background-image: url(../images/jstoolbar/bt_del.png); +} +.jstb_code { + background-image: url(../images/jstoolbar/bt_code.png); +} +.jstb_h1 { + background-image: url(../images/jstoolbar/bt_h1.png); +} +.jstb_h2 { + background-image: url(../images/jstoolbar/bt_h2.png); +} +.jstb_h3 { + background-image: url(../images/jstoolbar/bt_h3.png); +} +.jstb_ul { + background-image: url(../images/jstoolbar/bt_ul.png); +} +.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); +} +.jstb_link { + background-image: url(../images/jstoolbar/bt_link.png); +} +.jstb_img { + background-image: url(../images/jstoolbar/bt_img.png); +} diff --git a/vendor/plugins/redmine_textile_formatter/init.rb b/vendor/plugins/redmine_textile_formatter/init.rb new file mode 100644 index 0000000..4bdff5a --- /dev/null +++ b/vendor/plugins/redmine_textile_formatter/init.rb @@ -0,0 +1,13 @@ +# Redmine textile formatter plugin +require 'redmine' + +RAILS_DEFAULT_LOGGER.info 'Starting textile formatter for RedMine' + +Redmine::Plugin.register :redmine_textile_formatter do + name 'Textile formatter' + author 'extracted from RedMine' + description 'This provides textile as a wiki format' + version '0.0.1' + + wiki_format_provider 'textile', RedmineTextileFormatter::WikiFormatter, RedmineTextileFormatter::Helper +end diff --git a/vendor/plugins/redmine_textile_formatter/lib/redcloth3.rb b/vendor/plugins/redmine_textile_formatter/lib/redcloth3.rb new file mode 100644 index 0000000..cbca2bf --- /dev/null +++ b/vendor/plugins/redmine_textile_formatter/lib/redcloth3.rb @@ -0,0 +1,1164 @@ +# vim:ts=4:sw=4: +# = RedCloth - Textile and Markdown Hybrid for Ruby +# +# Homepage:: http://whytheluckystiff.net/ruby/redcloth/ +# Author:: why the lucky stiff (http://whytheluckystiff.net/) +# Copyright:: (cc) 2004 why the lucky stiff (and his puppet organizations.) +# License:: BSD +# +# (see http://hobix.com/textile/ for a Textile Reference.) +# +# Based on (and also inspired by) both: +# +# PyTextile: http://diveintomark.org/projects/textile/textile.py.txt +# Textism for PHP: http://www.textism.com/tools/textile/ +# +# + +# = RedCloth +# +# RedCloth is a Ruby library for converting Textile and/or Markdown +# into HTML. You can use either format, intermingled or separately. +# You can also extend RedCloth to honor your own custom text stylings. +# +# RedCloth users are encouraged to use Textile if they are generating +# HTML and to use Markdown if others will be viewing the plain text. +# +# == What is Textile? +# +# Textile is a simple formatting style for text +# documents, loosely based on some HTML conventions. +# +# == Sample Textile Text +# +# h2. This is a title +# +# h3. This is a subhead +# +# This is a bit of paragraph. +# +# bq. This is a blockquote. +# +# = Writing Textile +# +# A Textile document consists of paragraphs. Paragraphs +# can be specially formatted by adding a small instruction +# to the beginning of the paragraph. +# +# h[n]. Header of size [n]. +# bq. Blockquote. +# # Numeric list. +# * Bulleted list. +# +# == Quick Phrase Modifiers +# +# Quick phrase modifiers are also included, to allow formatting +# of small portions of text within a paragraph. +# +# \_emphasis\_ +# \_\_italicized\_\_ +# \*strong\* +# \*\*bold\*\* +# ??citation?? +# -deleted text- +# +inserted text+ +# ^superscript^ +# ~subscript~ +# @code@ +# %(classname)span% +# +# ==notextile== (leave text alone) +# +# == Links +# +# To make a hypertext link, put the link text in "quotation +# marks" followed immediately by a colon and the URL of the link. +# +# Optional: text in (parentheses) following the link text, +# but before the closing quotation mark, will become a Title +# attribute for the link, visible as a tool tip when a cursor is above it. +# +# Example: +# +# "This is a link (This is a title) ":http://www.textism.com +# +# Will become: +# +# This is a link +# +# == Images +# +# To insert an image, put the URL for the image inside exclamation marks. +# +# Optional: text that immediately follows the URL in (parentheses) will +# be used as the Alt text for the image. Images on the web should always +# have descriptive Alt text for the benefit of readers using non-graphical +# browsers. +# +# Optional: place a colon followed by a URL immediately after the +# closing ! to make the image into a link. +# +# Example: +# +# !http://www.textism.com/common/textist.gif(Textist)! +# +# Will become: +# +# Textist +# +# With a link: +# +# !/common/textist.gif(Textist)!:http://textism.com +# +# Will become: +# +# Textist +# +# == Defining Acronyms +# +# HTML allows authors to define acronyms via the tag. The definition appears as a +# tool tip when a cursor hovers over the acronym. A crucial aid to clear writing, +# this should be used at least once for each acronym in documents where they appear. +# +# To quickly define an acronym in Textile, place the full text in (parentheses) +# immediately following the acronym. +# +# Example: +# +# ACLU(American Civil Liberties Union) +# +# Will become: +# +# ACLU +# +# == Adding Tables +# +# In Textile, simple tables can be added by seperating each column by +# a pipe. +# +# |a|simple|table|row| +# |And|Another|table|row| +# +# Attributes are defined by style definitions in parentheses. +# +# table(border:1px solid black). +# (background:#ddd;color:red). |{}| | | | +# +# == Using RedCloth +# +# RedCloth is simply an extension of the String class, which can handle +# Textile formatting. Use it like a String and output HTML with its +# RedCloth#to_html method. +# +# doc = RedCloth.new " +# +# h2. Test document +# +# Just a simple test." +# +# puts doc.to_html +# +# By default, RedCloth uses both Textile and Markdown formatting, with +# Textile formatting taking precedence. If you want to turn off Markdown +# formatting, to boost speed and limit the processor: +# +# class RedCloth::Textile.new( str ) + +class RedCloth3 < String + + VERSION = '3.0.4' + DEFAULT_RULES = [:textile, :markdown] + + # + # Two accessor for setting security restrictions. + # + # This is a nice thing if you're using RedCloth for + # formatting in public places (e.g. Wikis) where you + # don't want users to abuse HTML for bad things. + # + # If +:filter_html+ is set, HTML which wasn't + # created by the Textile processor will be escaped. + # + # If +:filter_styles+ is set, it will also disable + # the style markup specifier. ('{color: red}') + # + attr_accessor :filter_html, :filter_styles + + # + # Accessor for toggling hard breaks. + # + # If +:hard_breaks+ is set, single newlines will + # be converted to HTML break tags. This is the + # default behavior for traditional RedCloth. + # + attr_accessor :hard_breaks + + # Accessor for toggling lite mode. + # + # In lite mode, block-level rules are ignored. This means + # that tables, paragraphs, lists, and such aren't available. + # Only the inline markup for bold, italics, entities and so on. + # + # r = RedCloth.new( "And then? She *fell*!", [:lite_mode] ) + # r.to_html + # #=> "And then? She fell!" + # + attr_accessor :lite_mode + + # + # Accessor for toggling span caps. + # + # Textile places `span' tags around capitalized + # words by default, but this wreaks havoc on Wikis. + # If +:no_span_caps+ is set, this will be + # suppressed. + # + attr_accessor :no_span_caps + + # + # Establishes the markup predence. Available rules include: + # + # == Textile Rules + # + # The following textile rules can be set individually. Or add the complete + # set of rules with the single :textile rule, which supplies the rule set in + # the following precedence: + # + # refs_textile:: Textile references (i.e. [hobix]http://hobix.com/) + # block_textile_table:: Textile table block structures + # block_textile_lists:: Textile list structures + # block_textile_prefix:: Textile blocks with prefixes (i.e. bq., h2., etc.) + # inline_textile_image:: Textile inline images + # inline_textile_link:: Textile inline links + # inline_textile_span:: Textile inline spans + # glyphs_textile:: Textile entities (such as em-dashes and smart quotes) + # + # == Markdown + # + # refs_markdown:: Markdown references (for example: [hobix]: http://hobix.com/) + # block_markdown_setext:: Markdown setext headers + # block_markdown_atx:: Markdown atx headers + # block_markdown_rule:: Markdown horizontal rules + # block_markdown_bq:: Markdown blockquotes + # block_markdown_lists:: Markdown lists + # inline_markdown_link:: Markdown links + attr_accessor :rules + + # Returns a new RedCloth object, based on _string_ and + # enforcing all the included _restrictions_. + # + # r = RedCloth.new( "h1. A bold man", [:filter_html] ) + # r.to_html + # #=>"

    A <b>bold</b> man

    " + # + def initialize( string, restrictions = [] ) + restrictions.each { |r| method( "#{ r }=" ).call( true ) } + super( string ) + end + + # + # Generates HTML from the Textile contents. + # + # r = RedCloth.new( "And then? She *fell*!" ) + # r.to_html( true ) + # #=>"And then? She fell!" + # + def to_html( *rules ) + rules = DEFAULT_RULES if rules.empty? + # make our working copy + text = self.dup + + @urlrefs = {} + @shelf = [] + textile_rules = [:refs_textile, :block_textile_table, :block_textile_lists, + :block_textile_prefix, :inline_textile_image, :inline_textile_link, + :inline_textile_code, :inline_textile_span] + markdown_rules = [:refs_markdown, :block_markdown_setext, :block_markdown_atx, :block_markdown_rule, + :block_markdown_bq, :block_markdown_lists, + :inline_markdown_reflink, :inline_markdown_link] + @rules = rules.collect do |rule| + case rule + when :markdown + markdown_rules + when :textile + textile_rules + else + rule + end + end.flatten + + # standard clean up + incoming_entities text + clean_white_space text + + # start processor + @pre_list = [] + rip_offtags text + no_textile text + escape_html_tags text + 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 + smooth_offtags text + + retrieve text + + text.gsub!( /<\/?notextile>/, '' ) + text.gsub!( /x%x%/, '&' ) + clean_html text if filter_html + text.strip! + text + + end + + ####### + private + ####### + # + # Mapping of 8-bit ASCII codes to HTML numerical entity equivalents. + # (from PyTextile) + # + TEXTILE_TAGS = + + [[128, 8364], [129, 0], [130, 8218], [131, 402], [132, 8222], [133, 8230], + [134, 8224], [135, 8225], [136, 710], [137, 8240], [138, 352], [139, 8249], + [140, 338], [141, 0], [142, 0], [143, 0], [144, 0], [145, 8216], [146, 8217], + [147, 8220], [148, 8221], [149, 8226], [150, 8211], [151, 8212], [152, 732], + [153, 8482], [154, 353], [155, 8250], [156, 339], [157, 0], [158, 0], [159, 376]]. + + collect! do |a, b| + [a.chr, ( b.zero? and "" or "&#{ b };" )] + end + + # + # Regular expressions to convert to HTML. + # + A_HLGN = /(?:(?:<>|<|>|\=|[()]+)+)/ + A_VLGN = /[\-^~]/ + C_CLAS = '(?:\([^)]+\))' + C_LNGE = '(?:\[[^\]]+\])' + C_STYL = '(?:\{[^}]+\})' + S_CSPN = '(?:\\\\\d+)' + S_RSPN = '(?:/\d+)' + A = "(?:#{A_HLGN}?#{A_VLGN}?|#{A_VLGN}?#{A_HLGN}?)" + S = "(?:#{S_CSPN}?#{S_RSPN}|#{S_RSPN}?#{S_CSPN}?)" + C = "(?:#{C_CLAS}?#{C_STYL}?#{C_LNGE}?|#{C_STYL}?#{C_LNGE}?#{C_CLAS}?|#{C_LNGE}?#{C_STYL}?#{C_CLAS}?)" + # PUNCT = Regexp::quote( '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~' ) + PUNCT = Regexp::quote( '!"#$%&\'*+,-./:;=?@\\^_`|~' ) + PUNCT_NOQ = Regexp::quote( '!"#$&\',./:;=?@\\`|' ) + PUNCT_Q = Regexp::quote( '*-_+^~%' ) + HYPERLINK = '(\S+?)([^\w\s/;=\?]*?)(?=\s|<|$)' + + # Text markup tags, don't conflict with block tags + SIMPLE_HTML_TAGS = [ + 'tt', 'b', 'i', 'big', 'small', 'em', 'strong', 'dfn', 'code', + 'samp', 'kbd', 'var', 'cite', 'abbr', 'acronym', 'a', 'img', 'br', + 'br', 'map', 'q', 'sub', 'sup', 'span', 'bdo' + ] + + QTAGS = [ + ['**', 'b', :limit], + ['*', 'strong', :limit], + ['??', 'cite', :limit], + ['-', 'del', :limit], + ['__', 'i', :limit], + ['_', 'em', :limit], + ['%', 'span', :limit], + ['+', 'ins', :limit], + ['^', 'sup', :limit], + ['~', 'sub', :limit] + ] + QTAGS.collect! do |rc, ht, rtype| + rcq = Regexp::quote rc + re = + case rtype + when :limit + /(^|[>\s\(]) + (#{rcq}) + (#{C}) + (?::(\S+?))? + ([^\s\-].*?[^\s\-]|\w) + #{rcq} + (?=[[:punct:]]|\s|\)|$)/x + else + /(#{rcq}) + (#{C}) + (?::(\S+))? + ([^\s\-].*?[^\s\-]|\w) + #{rcq}/xm + end + [rc, ht, re, rtype] + end + + # Elements to handle + GLYPHS = [ + # [ /([^\s\[{(>])?\'([dmst]\b|ll\b|ve\b|\s|:|$)/, '\1’\2' ], # single closing + # [ /([^\s\[{(>#{PUNCT_Q}][#{PUNCT_Q}]*)\'/, '\1’' ], # single closing + # [ /\'(?=[#{PUNCT_Q}]*(s\b|[\s#{PUNCT_NOQ}]))/, '’' ], # single closing + # [ /\'/, '‘' ], # single opening + [ //, '>' ], # greater-than + # [ /([^\s\[{(])?"(\s|:|$)/, '\1”\2' ], # double closing + # [ /([^\s\[{(>#{PUNCT_Q}][#{PUNCT_Q}]*)"/, '\1”' ], # double closing + # [ /"(?=[#{PUNCT_Q}]*[\s#{PUNCT_NOQ}])/, '”' ], # double closing + # [ /"/, '“' ], # double opening + [ /\b( )?\.{3}/, '\1…' ], # ellipsis + [ /\b([A-Z][A-Z0-9]{2,})\b(?:[(]([^)]*)[)])/, '\1' ], # 3+ uppercase acronym + [ /(^|[^"][>\s])([A-Z][A-Z0-9 ]+[A-Z0-9])([^\2\3', :no_span_caps ], # 3+ uppercase caps + [ /(\.\s)?\s?--\s?/, '\1—' ], # em dash + [ /\s->\s/, ' → ' ], # right arrow + [ /\s-\s/, ' – ' ], # en dash + [ /(\d+) ?x ?(\d+)/, '\1×\2' ], # dimension sign + [ /\b ?[(\[]TM[\])]/i, '™' ], # trademark + [ /\b ?[(\[]R[\])]/i, '®' ], # registered + [ /\b ?[(\[]C[\])]/i, '©' ] # copyright + ] + + H_ALGN_VALS = { + '<' => 'left', + '=' => 'center', + '>' => 'right', + '<>' => 'justify' + } + + V_ALGN_VALS = { + '^' => 'top', + '-' => 'middle', + '~' => 'bottom' + } + + # + # Flexible HTML escaping + # + def htmlesc( str, mode ) + str.gsub!( '&', '&' ) + str.gsub!( '"', '"' ) if mode != :NoQuotes + str.gsub!( "'", ''' ) if mode == :Quotes + str.gsub!( '<', '<') + str.gsub!( '>', '>') + end + + # Search and replace for Textile glyphs (quotes, dashes, other symbols) + def pgl( text ) + GLYPHS.each do |re, resub, tog| + next if tog and method( tog ).call + text.gsub! re, resub + end + end + + # Parses Textile attribute lists and builds an HTML attribute string + def pba( text_in, element = "" ) + + return '' unless text_in + + style = [] + text = text_in.dup + if element == 'td' + colspan = $1 if text =~ /\\(\d+)/ + rowspan = $1 if text =~ /\/(\d+)/ + style << "vertical-align:#{ v_align( $& ) };" if text =~ A_VLGN + end + + style << "#{ $1 };" if not filter_styles and + text.sub!( /\{([^}]*)\}/, '' ) + + lang = $1 if + text.sub!( /\[([^)]+?)\]/, '' ) + + cls = $1 if + text.sub!( /\(([^()]+?)\)/, '' ) + + style << "padding-left:#{ $1.length }em;" if + text.sub!( /([(]+)/, '' ) + + style << "padding-right:#{ $1.length }em;" if text.sub!( /([)]+)/, '' ) + + style << "text-align:#{ h_align( $& ) };" if text =~ A_HLGN + + cls, id = $1, $2 if cls =~ /^(.*?)#(.*)$/ + + atts = '' + atts << " style=\"#{ style.join }\"" unless style.empty? + atts << " class=\"#{ cls }\"" unless cls.to_s.empty? + atts << " lang=\"#{ lang }\"" if lang + atts << " id=\"#{ id }\"" if id + atts << " colspan=\"#{ colspan }\"" if colspan + atts << " rowspan=\"#{ rowspan }\"" if rowspan + + atts + end + + TABLE_RE = /^(?:table(_?#{S}#{A}#{C})\. ?\n)?^(#{A}#{C}\.? ?\|.*?\|)(\n\n|\Z)/m + + # Parses a Textile table block, building HTML from the result. + def block_textile_table( text ) + text.gsub!( TABLE_RE ) do |matches| + + tatts, fullrow = $~[1..2] + tatts = pba( tatts, 'table' ) + tatts = shelve( tatts ) if tatts + rows = [] + + fullrow.each_line do |row| + ratts, row = pba( $1, 'tr' ), $2 if row =~ /^(#{A}#{C}\. )(.*)/m + cells = [] + row.split( /(\|)(?![^\[\|]*\]\])/ )[1..-2].each do |cell| + next if cell == '|' + ctyp = 'd' + ctyp = 'h' if cell =~ /^_/ + + catts = '' + catts, cell = pba( $1, 'td' ), $2 if cell =~ /^(_?#{S}#{A}#{C}\. ?)(.*)/ + + catts = shelve( catts ) if catts + cells << "\t\t\t#{ cell }" + end + ratts = shelve( ratts ) if ratts + rows << "\t\t\n#{ cells.join( "\n" ) }\n\t\t" + end + "\t\n#{ rows.join( "\n" ) }\n\t\n\n" + end + end + + LISTS_RE = /^([#*]+?#{C} .*?)$(?![^#*])/m + LISTS_CONTENT_RE = /^([#*]+)(#{A}#{C}) (.*)$/m + + # Parses Textile lists and generates HTML + def block_textile_lists( text ) + text.gsub!( LISTS_RE ) do |match| + lines = match.split( /\n/ ) + last_line = -1 + depth = [] + lines.each_with_index do |line, line_id| + if line =~ LISTS_CONTENT_RE + tl,atts,content = $~[1..3] + if depth.last + if depth.last.length > tl.length + (depth.length - 1).downto(0) do |i| + break if depth[i].length == tl.length + lines[line_id - 1] << "\n\t\n\t" + depth.pop + end + end + if depth.last and depth.last.length == tl.length + lines[line_id - 1] << '' + end + end + unless depth.last == tl + depth << tl + atts = pba( atts ) + atts = shelve( atts ) if atts + lines[line_id] = "\t<#{ lT(tl) }l#{ atts }>\n\t
  • #{ content }" + else + lines[line_id] = "\t\t
  • #{ content }" + end + last_line = line_id + + else + last_line = line_id + end + if line_id - last_line > 1 or line_id == lines.length - 1 + depth.delete_if do |v| + lines[last_line] << "
  • \n\t" + end + end + end + 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 ? '
    ' * (l-indent) : '
    ' * (indent-l)) + "\n\n") + indent = l + end + quotes << (content + "\n") + end + quotes << ("\n" + '' * indent + "\n\n") + quotes + end + end + + CODE_RE = /(\W) + @ + (?:\|(\w+?)\|)? + (.+?) + @ + (?=\W)/x + + def inline_textile_code( text ) + text.gsub!( CODE_RE ) do |m| + before,lang,code,after = $~[1..4] + lang = " lang=\"#{ lang }\"" if lang + rip_offtags( "#{ before }#{ code }
    #{ after }" ) + end + end + + def lT( text ) + text =~ /\#$/ ? 'o' : 'u' + end + + def hard_break( text ) + text.gsub!( /(.)\n(?!\Z| *([#*=]+(\s|$)|[{|]))/, "\\1
    " ) if hard_breaks + end + + BLOCKS_GROUP_RE = /\n{2,}(?! )/m + + def blocks( text, deep_code = false ) + text.replace( text.split( BLOCKS_GROUP_RE ).collect do |blk| + plain = blk !~ /\A[#*> ]/ + + # skip blocks that are complex HTML + if blk =~ /^<\/?(\w+).*>/ and not SIMPLE_HTML_TAGS.include? $1 + blk + else + # search for indentation levels + blk.strip! + if blk.empty? + blk + else + code_blk = nil + blk.gsub!( /((?:\n(?:\n^ +[^\n]*)+)+)/m ) do |iblk| + flush_left iblk + blocks iblk, plain + iblk.gsub( /^(\S)/, "\t\\1" ) + if plain + code_blk = iblk; "" + else + iblk + end + end + + block_applied = 0 + @rules.each do |rule_name| + block_applied += 1 if ( rule_name.to_s.match /^block_/ and method( rule_name ).call( blk ) ) + end + if block_applied.zero? + if deep_code + blk = "\t
    #{ blk }
    " + else + blk = "\t

    #{ blk }

    " + end + end + # hard_break blk + blk + "\n#{ code_blk }" + end + end + + end.join( "\n\n" ) ) + end + + def textile_bq( tag, atts, cite, content ) + cite, cite_title = check_refs( cite ) + cite = " cite=\"#{ cite }\"" if cite + atts = shelve( atts ) if atts + "\t\n\t\t#{ content }

    \n\t" + end + + def textile_p( tag, atts, cite, content ) + atts = shelve( atts ) if atts + "\t<#{ tag }#{ atts }>#{ content }" + end + + alias textile_h1 textile_p + alias textile_h2 textile_p + alias textile_h3 textile_p + alias textile_h4 textile_p + alias textile_h5 textile_p + alias textile_h6 textile_p + + def textile_fn_( tag, num, atts, cite, content ) + atts << " id=\"fn#{ num }\"" + content = "#{ num } #{ content }" + atts = shelve( atts ) if atts + "\t#{ content }

    " + end + + BLOCK_RE = /^(([a-z]+)(\d*))(#{A}#{C})\.(?::(\S+))? (.*)$/m + + def block_textile_prefix( text ) + if text =~ BLOCK_RE + tag,tagpre,num,atts,cite,content = $~[1..6] + atts = pba( atts ) + + # pass to prefix handler + if respond_to? "textile_#{ tag }", true + text.gsub!( $&, method( "textile_#{ tag }" ).call( tag, atts, cite, content ) ) + elsif respond_to? "textile_#{ tagpre }_", true + text.gsub!( $&, method( "textile_#{ tagpre }_" ).call( tagpre, num, atts, cite, content ) ) + end + end + end + + SETEXT_RE = /\A(.+?)\n([=-])[=-]* *$/m + def block_markdown_setext( text ) + if text =~ SETEXT_RE + tag = if $2 == "="; "h1"; else; "h2"; end + blk, cont = "<#{ tag }>#{ $1 }", $' + blocks cont + text.replace( blk + cont ) + end + end + + ATX_RE = /\A(\#{1,6}) # $1 = string of #'s + [ ]* + (.+?) # $2 = Header text + [ ]* + \#* # optional closing #'s (not counted) + $/x + def block_markdown_atx( text ) + if text =~ ATX_RE + tag = "h#{ $1.length }" + blk, cont = "<#{ tag }>#{ $2 }\n\n", $' + blocks cont + text.replace( blk + cont ) + end + end + + MARKDOWN_BQ_RE = /\A(^ *> ?.+$(.+\n)*\n*)+/m + + def block_markdown_bq( text ) + text.gsub!( MARKDOWN_BQ_RE ) do |blk| + blk.gsub!( /^ *> ?/, '' ) + flush_left blk + blocks blk + blk.gsub!( /^(\S)/, "\t\\1" ) + "
    \n#{ blk }\n
    \n\n" + end + end + + MARKDOWN_RULE_RE = /^(#{ + ['*', '-', '_'].collect { |ch| ' ?(' + Regexp::quote( ch ) + ' ?){3,}' }.join( '|' ) + })$/ + + def block_markdown_rule( text ) + text.gsub!( MARKDOWN_RULE_RE ) do |blk| + "
    " + end + end + + # XXX TODO XXX + def block_markdown_lists( text ) + end + + def inline_textile_span( text ) + QTAGS.each do |qtag_rc, ht, qtag_re, rtype| + text.gsub!( qtag_re ) do |m| + + case rtype + when :limit + sta,qtag,atts,cite,content = $~[1..5] + else + qtag,atts,cite,content = $~[1..4] + sta = '' + end + atts = pba( atts ) + atts << " cite=\"#{ cite }\"" if cite + atts = shelve( atts ) if atts + + "#{ sta }<#{ ht }#{ atts }>#{ content }" + + end + end + end + + LINK_RE = / + ([\s\[{(]|[#{PUNCT}])? # $pre + " # start + (#{C}) # $atts + ([^"\n]+?) # $text + \s? + (?:\(([^)]+?)\)(?="))? # $title + ": + ([\w\/]\S+?) # $url + (\/)? # $slash + ([^\w\=\/;\(\)]*?) # $post + (?=<|\s|$) + /x +#" + def inline_textile_link( text ) + text.gsub!( LINK_RE ) do |m| + pre,atts,text,title,url,slash,post = $~[1..7] + + url, url_title = check_refs( url ) + title ||= url_title + + # Idea below : an URL with unbalanced parethesis and + # ending by ')' is put into external parenthesis + if ( url[-1]==?) and ((url.count("(") - url.count(")")) < 0 ) ) + url=url[0..-2] # discard closing parenth from url + post = ")"+post # add closing parenth to post + end + atts = pba( atts ) + atts = " href=\"#{ url }#{ slash }\"#{ atts }" + atts << " title=\"#{ title }\"" if title + atts = shelve( atts ) if atts + + external = (url =~ /^https?:\/\//) ? ' class="external"' : '' + + "#{ pre }#{ text }#{ post }" + end + end + + MARKDOWN_REFLINK_RE = / + \[([^\[\]]+)\] # $text + [ ]? # opt. space + (?:\n[ ]*)? # one optional newline followed by spaces + \[(.*?)\] # $id + /x + + def inline_markdown_reflink( text ) + text.gsub!( MARKDOWN_REFLINK_RE ) do |m| + text, id = $~[1..2] + + if id.empty? + url, title = check_refs( text ) + else + url, title = check_refs( id ) + end + + atts = " href=\"#{ url }\"" + atts << " title=\"#{ title }\"" if title + atts = shelve( atts ) + + "#{ text }" + end + end + + MARKDOWN_LINK_RE = / + \[([^\[\]]+)\] # $text + \( # open paren + [ \t]* # opt space + ? # $href + [ \t]* # opt space + (?: # whole title + (['"]) # $quote + (.*?) # $title + \3 # matching quote + )? # title is optional + \) + /x + + def inline_markdown_link( text ) + text.gsub!( MARKDOWN_LINK_RE ) do |m| + text, url, quote, title = $~[1..4] + + atts = " href=\"#{ url }\"" + atts << " title=\"#{ title }\"" if title + atts = shelve( atts ) + + "#{ text }" + end + end + + TEXTILE_REFS_RE = /(^ *)\[([^\[\n]+?)\](#{HYPERLINK})(?=\s|$)/ + MARKDOWN_REFS_RE = /(^ *)\[([^\n]+?)\]:\s+?(?:\s+"((?:[^"]|\\")+)")?(?=\s|$)/m + + def refs( text ) + @rules.each do |rule_name| + method( rule_name ).call( text ) if rule_name.to_s.match /^refs_/ + end + end + + def refs_textile( text ) + text.gsub!( TEXTILE_REFS_RE ) do |m| + flag, url = $~[2..3] + @urlrefs[flag.downcase] = [url, nil] + nil + end + end + + def refs_markdown( text ) + text.gsub!( MARKDOWN_REFS_RE ) do |m| + flag, url = $~[2..3] + title = $~[6] + @urlrefs[flag.downcase] = [url, title] + nil + end + end + + def check_refs( text ) + ret = @urlrefs[text.downcase] if text + ret || [text, nil] + end + + IMAGE_RE = / + (

    |.|^) # start of line? + \! # opening + (\<|\=|\>)? # optional alignment atts + (#{C}) # optional style,class atts + (?:\. )? # optional dot-space + ([^\s(!]+?) # presume this is the src + \s? # optional space + (?:\(((?:[^\(\)]|\([^\)]+\))+?)\))? # optional title + \! # closing + (?::#{ HYPERLINK })? # optional href + /x + + def inline_textile_image( text ) + text.gsub!( IMAGE_RE ) do |m| + stln,algn,atts,url,title,href,href_a1,href_a2 = $~[1..8] + atts = pba( atts ) + atts = " src=\"#{ url }\"#{ atts }" + atts << " title=\"#{ title }\"" if title + atts << " alt=\"#{ title }\"" + # size = @getimagesize($url); + # if($size) $atts.= " $size[3]"; + + href, alt_title = check_refs( href ) if href + url, url_title = check_refs( url ) + + out = '' + out << "" if href + out << "" + out << "#{ href_a1 }#{ href_a2 }" if href + + if algn + algn = h_align( algn ) + if stln == "

    " + out = "

    #{ out }" + else + out = "#{ stln }

    #{ out }
    " + end + else + out = stln + out + end + + out + end + end + + def shelve( val ) + @shelf << val + " :redsh##{ @shelf.length }:" + end + + def retrieve( text ) + @shelf.each_with_index do |r, i| + text.gsub!( " :redsh##{ i + 1 }:", r ) + end + end + + def incoming_entities( text ) + ## turn any incoming ampersands into a dummy character for now. + ## This uses a negative lookahead for alphanumerics followed by a semicolon, + ## implying an incoming html entity, to be skipped + + text.gsub!( /&(?![#a-z0-9]+;)/i, "x%x%" ) + end + + def no_textile( text ) + text.gsub!( /(^|\s)==([^=]+.*?)==(\s|$)?/, + '\1\2\3' ) + text.gsub!( /^ *==([^=]+.*?)==/m, + '\1\2\3' ) + end + + def clean_white_space( text ) + # normalize line breaks + text.gsub!( /\r\n/, "\n" ) + text.gsub!( /\r/, "\n" ) + text.gsub!( /\t/, ' ' ) + text.gsub!( /^ +$/, '' ) + text.gsub!( /\n{3,}/, "\n\n" ) + text.gsub!( /"$/, "\" " ) + + # if entire document is indented, flush + # to the left side + flush_left text + end + + def flush_left( text ) + indt = 0 + if text =~ /^ / + while text !~ /^ {#{indt}}\S/ + indt += 1 + end unless text.empty? + if indt.nonzero? + text.gsub!( /^ {#{indt}}/, '' ) + end + end + end + + def footnote_ref( text ) + text.gsub!( /\b\[([0-9]+?)\](\s)?/, + '\1\2' ) + end + + OFFTAGS = /(code|pre|kbd|notextile)/ + OFFTAG_MATCH = /(?:(<\/#{ OFFTAGS }>)|(<#{ OFFTAGS }[^>]*>))(.*?)(?=<\/?#{ OFFTAGS }|\Z)/mi + OFFTAG_OPEN = /<#{ OFFTAGS }/ + OFFTAG_CLOSE = /<\/?#{ OFFTAGS }/ + HASTAG_MATCH = /(<\/?\w[^\n]*?>)/m + ALLTAG_MATCH = /(<\/?\w[^\n]*?>)|.*?(?=<\/?\w[^\n]*?>|$)/m + + def glyphs_textile( text, level = 0 ) + if text !~ HASTAG_MATCH + pgl text + footnote_ref text + else + codepre = 0 + text.gsub!( ALLTAG_MATCH ) do |line| + ## matches are off if we're between ,
     etc.
    +                if $1
    +                    if line =~ OFFTAG_OPEN
    +                        codepre += 1
    +                    elsif line =~ OFFTAG_CLOSE
    +                        codepre -= 1
    +                        codepre = 0 if codepre < 0
    +                    end 
    +                elsif codepre.zero?
    +                    glyphs_textile( line, level + 1 )
    +                else
    +                    htmlesc( line, :NoQuotes )
    +                end
    +                # p [level, codepre, line]
    +
    +                line
    +            end
    +        end
    +    end
    +
    +    def rip_offtags( text )
    +        if text =~ /<.*>/
    +            ## strip and encode 
     content
    +            codepre, used_offtags = 0, {}
    +            text.gsub!( OFFTAG_MATCH ) do |line|
    +                if $3
    +                    offtag, aftertag = $4, $5
    +                    codepre += 1
    +                    used_offtags[offtag] = true
    +                    if codepre - used_offtags.length > 0
    +                        htmlesc( line, :NoQuotes )
    +                        @pre_list.last << line
    +                        line = ""
    +                    else
    +                        htmlesc( aftertag, :NoQuotes ) if aftertag
    +                        line = ""
    +                        @pre_list << "#{ $3 }#{ aftertag }"
    +                    end
    +                elsif $1 and codepre > 0
    +                    if codepre - used_offtags.length > 0
    +                        htmlesc( line, :NoQuotes )
    +                        @pre_list.last << line
    +                        line = ""
    +                    end
    +                    codepre -= 1 unless codepre.zero?
    +                    used_offtags = {} if codepre.zero?
    +                end 
    +                line
    +            end
    +        end
    +        text
    +    end
    +
    +    def smooth_offtags( text )
    +        unless @pre_list.empty?
    +            ## replace 
     content
    +            text.gsub!( // ) { @pre_list[$1.to_i] }
    +        end
    +    end
    +
    +    def inline( text ) 
    +        [/^inline_/, /^glyphs_/].each do |meth_re|
    +            @rules.each do |rule_name|
    +                method( rule_name ).call( text ) if rule_name.to_s.match( meth_re )
    +            end
    +        end
    +    end
    +
    +    def h_align( text ) 
    +        H_ALGN_VALS[text]
    +    end
    +
    +    def v_align( text ) 
    +        V_ALGN_VALS[text]
    +    end
    +
    +    def textile_popup_help( name, windowW, windowH )
    +        ' ' + name + '
    ' + end + + # HTML cleansing stuff + BASIC_TAGS = { + 'a' => ['href', 'title'], + 'img' => ['src', 'alt', 'title'], + 'br' => [], + 'i' => nil, + 'u' => nil, + 'b' => nil, + 'pre' => nil, + 'kbd' => nil, + 'code' => ['lang'], + 'cite' => nil, + 'strong' => nil, + 'em' => nil, + 'ins' => nil, + 'sup' => nil, + 'sub' => nil, + 'del' => nil, + 'table' => nil, + 'tr' => nil, + 'td' => ['colspan', 'rowspan'], + 'th' => nil, + 'ol' => nil, + 'ul' => nil, + 'li' => nil, + 'p' => nil, + 'h1' => nil, + 'h2' => nil, + 'h3' => nil, + 'h4' => nil, + 'h5' => nil, + 'h6' => nil, + 'blockquote' => ['cite'] + } + + def clean_html( text, tags = BASIC_TAGS ) + text.gsub!( /]*)>/ ) do + raw = $~ + tag = raw[2].downcase + if tags.has_key? tag + pcs = [tag] + tags[tag].each do |prop| + ['"', "'", ''].each do |q| + q2 = ( q != '' ? q : '\s' ) + if raw[3] =~ /#{prop}\s*=\s*#{q}([^#{q2}]+)#{q}/i + attrv = $1 + next if prop == 'src' and attrv =~ %r{^(?!http)\w+:} + pcs << "#{prop}=\"#{$1.gsub('"', '\\"')}\"" + break + end + end + end if tags[tag] + "<#{raw[1]}#{pcs.join " "}>" + else + " " + end + end + end + + ALLOWED_TAGS = %w(redpre pre code notextile) + + def escape_html_tags(text) + text.gsub!(%r{<(\/?([!\w]+)[^<>\n]*)(>?)}) {|m| ALLOWED_TAGS.include?($2) ? "<#{$1}#{$3}" : "<#{$1}#{'>' unless $3.blank?}" } + end +end + diff --git a/vendor/plugins/redmine_textile_formatter/lib/redmine_textile_formatter/wiki_formatter.rb b/vendor/plugins/redmine_textile_formatter/lib/redmine_textile_formatter/wiki_formatter.rb new file mode 100644 index 0000000..9f8c4ed --- /dev/null +++ b/vendor/plugins/redmine_textile_formatter/lib/redmine_textile_formatter/wiki_formatter.rb @@ -0,0 +1,179 @@ +# redMine - project management software +# Copyright (C) 2006-2007 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +require 'redcloth3' +require 'coderay' + +module RedmineTextileFormatter + class WikiFormatter < RedCloth3 + + # auto_link rule after textile rules so that it doesn't break !image_url! tags + RULES = [:textile, :block_markdown_rule, :inline_auto_link, :inline_auto_mailto, :inline_toc, :inline_macros] + + def initialize(*args) + super + self.hard_breaks=true + self.no_span_caps=true + end + + def to_html(*rules, &block) + @toc = [] + @macros_runner = block + super(*RULES).to_s + end + + private + + # Patch for RedCloth. Fixed in RedCloth r128 but _why hasn't released it yet. + # http://code.whytheluckystiff.net/redcloth/changeset/128 + def hard_break( text ) + text.gsub!( /(.)\n(?!\n|\Z|>| *(>? *[#*=]+(\s|$)|[{|]))/, "\\1
    \n" ) if hard_breaks + end + + # Patch to add code highlighting support to RedCloth + def smooth_offtags( text ) + unless @pre_list.empty? + ## replace
     content
    +        text.gsub!(//) do
    +          content = @pre_list[$1.to_i]
    +          if content.match(/\s?(.+)/m)
    +            content = "" + 
    +              CodeRay.scan($2, $1.downcase).html(:escape => false, :line_numbers => :inline)
    +          end
    +          content
    +        end
    +      end
    +    end
    +
    +    # Patch to add 'table of content' support to RedCloth
    +    def textile_p_withtoc(tag, atts, cite, content)
    +      # removes wiki links from the item
    +      toc_item = content.gsub(/(\[\[|\]\])/, '')
    +      # removes styles
    +      # eg. %{color:red}Triggers% => Triggers
    +      toc_item.gsub! %r[%\{[^\}]*\}([^%]+)%], '\\1'
    +
    +      # replaces non word caracters by dashes
    +      anchor = toc_item.gsub(%r{[^\w\s\-]}, '').gsub(%r{\s+(\-+\s*)?}, '-')
    +
    +      unless anchor.blank?
    +        if tag =~ /^h(\d)$/
    +          @toc << [$1.to_i, anchor, toc_item]
    +        end
    +        atts << " id=\"#{anchor}\""
    +        content = content + ""
    +      end
    +      textile_p(tag, atts, cite, content)
    +    end
    +
    +    alias :textile_h1 :textile_p_withtoc
    +    alias :textile_h2 :textile_p_withtoc
    +    alias :textile_h3 :textile_p_withtoc
    +
    +    def inline_toc(text)
    +      text.gsub!(/

    \{\{([<>]?)toc\}\}<\/p>/i) do + div_class = 'toc' + div_class << ' right' if $1 == '>' + div_class << ' left' if $1 == '<' + out = "

      " + @toc.each do |heading| + level, anchor, toc_item = heading + out << "
    • #{toc_item}
    • \n" + end + out << '
    ' + out + end + end + + MACROS_RE = / + (!)? # escaping + ( + \{\{ # opening tag + ([\w]+) # macro name + (\(([^\}]*)\))? # optional arguments + \}\} # closing tag + ) + /x unless const_defined?(:MACROS_RE) + + def inline_macros(text) + text.gsub!(MACROS_RE) do + esc, all, macro = $1, $2, $3.downcase + args = ($5 || '').split(',').each(&:strip) + if esc.nil? + begin + @macros_runner.call(macro, args) + rescue => e + "
    Error executing the #{macro} macro (#{e})
    " + end || all + else + all + end + end + end + + AUTO_LINK_RE = %r{ + ( # leading text + <\w+.*?>| # leading HTML tag, or + [^=<>!:'"/]| # leading punctuation, or + ^ # beginning of line + ) + ( + (?:https?://)| # protocol spec, or + (?:ftp://)| + (?:www\.) # www.* + ) + ( + (\S+?) # url + (\/)? # slash + ) + ([^\w\=\/;\(\)]*?) # post + (?=<|\s|$) + }x unless const_defined?(:AUTO_LINK_RE) + + # Turns all urls into clickable links (code from Rails). + def inline_auto_link(text) + text.gsub!(AUTO_LINK_RE) do + all, leading, proto, url, post = $&, $1, $2, $3, $6 + if leading =~ /=]?/ + # don't replace URL's that are already linked + # and URL's prefixed with ! !> !< != (textile images) + all + else + # Idea below : an URL with unbalanced parethesis and + # ending by ')' is put into external parenthesis + if ( url[-1]==?) and ((url.count("(") - url.count(")")) < 0 ) ) + url=url[0..-2] # discard closing parenth from url + post = ")"+post # add closing parenth to post + end + %(#{leading}#{proto + url}#{post}) + end + end + end + + # Turns all email addresses into clickable links (code from Rails). + def inline_auto_mailto(text) + text.gsub!(/([\w\.!#\$%\-+.]+@[A-Za-z0-9\-]+(\.[A-Za-z0-9\-]+)+)/) do + mail = $1 + if text.match(/]*>(.*)(#{Regexp.escape(mail)})(.*)<\/a>/) + mail + else + %{} + end + end + end + end +end -- 1.6.0.1