annotate .svn/pristine/14/141194219711b0b953dd51beb008d5ce7e421ba0.svn-base @ 1298:4f746d8966dd redmine_2.3_integration

Merge from redmine-2.3 branch to create new branch redmine-2.3-integration
author Chris Cannam
date Fri, 14 Jun 2013 09:28:30 +0100
parents 622f24f53b42
children
rev   line source
Chris@1295 1 /* ***** BEGIN LICENSE BLOCK *****
Chris@1295 2 * This file is part of DotClear.
Chris@1295 3 * Copyright (c) 2005 Nicolas Martin & Olivier Meunier and contributors. All
Chris@1295 4 * rights reserved.
Chris@1295 5 *
Chris@1295 6 * DotClear is free software; you can redistribute it and/or modify
Chris@1295 7 * it under the terms of the GNU General Public License as published by
Chris@1295 8 * the Free Software Foundation; either version 2 of the License, or
Chris@1295 9 * (at your option) any later version.
Chris@1295 10 *
Chris@1295 11 * DotClear is distributed in the hope that it will be useful,
Chris@1295 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@1295 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Chris@1295 14 * GNU General Public License for more details.
Chris@1295 15 *
Chris@1295 16 * You should have received a copy of the GNU General Public License
Chris@1295 17 * along with DotClear; if not, write to the Free Software
Chris@1295 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Chris@1295 19 *
Chris@1295 20 * ***** END LICENSE BLOCK *****
Chris@1295 21 */
Chris@1295 22
Chris@1295 23 /* Modified by JP LANG for textile formatting */
Chris@1295 24
Chris@1295 25 // strong
Chris@1295 26 jsToolBar.prototype.elements.strong = {
Chris@1295 27 type: 'button',
Chris@1295 28 title: 'Strong',
Chris@1295 29 fn: {
Chris@1295 30 wiki: function() { this.singleTag('*') }
Chris@1295 31 }
Chris@1295 32 }
Chris@1295 33
Chris@1295 34 // em
Chris@1295 35 jsToolBar.prototype.elements.em = {
Chris@1295 36 type: 'button',
Chris@1295 37 title: 'Italic',
Chris@1295 38 fn: {
Chris@1295 39 wiki: function() { this.singleTag("_") }
Chris@1295 40 }
Chris@1295 41 }
Chris@1295 42
Chris@1295 43 // ins
Chris@1295 44 jsToolBar.prototype.elements.ins = {
Chris@1295 45 type: 'button',
Chris@1295 46 title: 'Underline',
Chris@1295 47 fn: {
Chris@1295 48 wiki: function() { this.singleTag('+') }
Chris@1295 49 }
Chris@1295 50 }
Chris@1295 51
Chris@1295 52 // del
Chris@1295 53 jsToolBar.prototype.elements.del = {
Chris@1295 54 type: 'button',
Chris@1295 55 title: 'Deleted',
Chris@1295 56 fn: {
Chris@1295 57 wiki: function() { this.singleTag('-') }
Chris@1295 58 }
Chris@1295 59 }
Chris@1295 60
Chris@1295 61 // code
Chris@1295 62 jsToolBar.prototype.elements.code = {
Chris@1295 63 type: 'button',
Chris@1295 64 title: 'Code',
Chris@1295 65 fn: {
Chris@1295 66 wiki: function() { this.singleTag('@') }
Chris@1295 67 }
Chris@1295 68 }
Chris@1295 69
Chris@1295 70 // spacer
Chris@1295 71 jsToolBar.prototype.elements.space1 = {type: 'space'}
Chris@1295 72
Chris@1295 73 // headings
Chris@1295 74 jsToolBar.prototype.elements.h1 = {
Chris@1295 75 type: 'button',
Chris@1295 76 title: 'Heading 1',
Chris@1295 77 fn: {
Chris@1295 78 wiki: function() {
Chris@1295 79 this.encloseLineSelection('h1. ', '',function(str) {
Chris@1295 80 str = str.replace(/^h\d+\.\s+/, '')
Chris@1295 81 return str;
Chris@1295 82 });
Chris@1295 83 }
Chris@1295 84 }
Chris@1295 85 }
Chris@1295 86 jsToolBar.prototype.elements.h2 = {
Chris@1295 87 type: 'button',
Chris@1295 88 title: 'Heading 2',
Chris@1295 89 fn: {
Chris@1295 90 wiki: function() {
Chris@1295 91 this.encloseLineSelection('h2. ', '',function(str) {
Chris@1295 92 str = str.replace(/^h\d+\.\s+/, '')
Chris@1295 93 return str;
Chris@1295 94 });
Chris@1295 95 }
Chris@1295 96 }
Chris@1295 97 }
Chris@1295 98 jsToolBar.prototype.elements.h3 = {
Chris@1295 99 type: 'button',
Chris@1295 100 title: 'Heading 3',
Chris@1295 101 fn: {
Chris@1295 102 wiki: function() {
Chris@1295 103 this.encloseLineSelection('h3. ', '',function(str) {
Chris@1295 104 str = str.replace(/^h\d+\.\s+/, '')
Chris@1295 105 return str;
Chris@1295 106 });
Chris@1295 107 }
Chris@1295 108 }
Chris@1295 109 }
Chris@1295 110
Chris@1295 111 // spacer
Chris@1295 112 jsToolBar.prototype.elements.space2 = {type: 'space'}
Chris@1295 113
Chris@1295 114 // ul
Chris@1295 115 jsToolBar.prototype.elements.ul = {
Chris@1295 116 type: 'button',
Chris@1295 117 title: 'Unordered list',
Chris@1295 118 fn: {
Chris@1295 119 wiki: function() {
Chris@1295 120 this.encloseLineSelection('','',function(str) {
Chris@1295 121 str = str.replace(/\r/g,'');
Chris@1295 122 return str.replace(/(\n|^)[#-]?\s*/g,"$1* ");
Chris@1295 123 });
Chris@1295 124 }
Chris@1295 125 }
Chris@1295 126 }
Chris@1295 127
Chris@1295 128 // ol
Chris@1295 129 jsToolBar.prototype.elements.ol = {
Chris@1295 130 type: 'button',
Chris@1295 131 title: 'Ordered list',
Chris@1295 132 fn: {
Chris@1295 133 wiki: function() {
Chris@1295 134 this.encloseLineSelection('','',function(str) {
Chris@1295 135 str = str.replace(/\r/g,'');
Chris@1295 136 return str.replace(/(\n|^)[*-]?\s*/g,"$1# ");
Chris@1295 137 });
Chris@1295 138 }
Chris@1295 139 }
Chris@1295 140 }
Chris@1295 141
Chris@1295 142 // spacer
Chris@1295 143 jsToolBar.prototype.elements.space3 = {type: 'space'}
Chris@1295 144
Chris@1295 145 // bq
Chris@1295 146 jsToolBar.prototype.elements.bq = {
Chris@1295 147 type: 'button',
Chris@1295 148 title: 'Quote',
Chris@1295 149 fn: {
Chris@1295 150 wiki: function() {
Chris@1295 151 this.encloseLineSelection('','',function(str) {
Chris@1295 152 str = str.replace(/\r/g,'');
Chris@1295 153 return str.replace(/(\n|^) *([^\n]*)/g,"$1> $2");
Chris@1295 154 });
Chris@1295 155 }
Chris@1295 156 }
Chris@1295 157 }
Chris@1295 158
Chris@1295 159 // unbq
Chris@1295 160 jsToolBar.prototype.elements.unbq = {
Chris@1295 161 type: 'button',
Chris@1295 162 title: 'Unquote',
Chris@1295 163 fn: {
Chris@1295 164 wiki: function() {
Chris@1295 165 this.encloseLineSelection('','',function(str) {
Chris@1295 166 str = str.replace(/\r/g,'');
Chris@1295 167 return str.replace(/(\n|^) *[>]? *([^\n]*)/g,"$1$2");
Chris@1295 168 });
Chris@1295 169 }
Chris@1295 170 }
Chris@1295 171 }
Chris@1295 172
Chris@1295 173 // pre
Chris@1295 174 jsToolBar.prototype.elements.pre = {
Chris@1295 175 type: 'button',
Chris@1295 176 title: 'Preformatted text',
Chris@1295 177 fn: {
Chris@1295 178 wiki: function() { this.encloseLineSelection('<pre>\n', '\n</pre>') }
Chris@1295 179 }
Chris@1295 180 }
Chris@1295 181
Chris@1295 182 // spacer
Chris@1295 183 jsToolBar.prototype.elements.space4 = {type: 'space'}
Chris@1295 184
Chris@1295 185 // wiki page
Chris@1295 186 jsToolBar.prototype.elements.link = {
Chris@1295 187 type: 'button',
Chris@1295 188 title: 'Wiki link',
Chris@1295 189 fn: {
Chris@1295 190 wiki: function() { this.encloseSelection("[[", "]]") }
Chris@1295 191 }
Chris@1295 192 }
Chris@1295 193 // image
Chris@1295 194 jsToolBar.prototype.elements.img = {
Chris@1295 195 type: 'button',
Chris@1295 196 title: 'Image',
Chris@1295 197 fn: {
Chris@1295 198 wiki: function() { this.encloseSelection("!", "!") }
Chris@1295 199 }
Chris@1295 200 }
Chris@1295 201
Chris@1295 202 // spacer
Chris@1295 203 jsToolBar.prototype.elements.space5 = {type: 'space'}
Chris@1295 204 // help
Chris@1295 205 jsToolBar.prototype.elements.help = {
Chris@1295 206 type: 'button',
Chris@1295 207 title: 'Help',
Chris@1295 208 fn: {
Chris@1295 209 wiki: function() { window.open(this.help_link, '', 'resizable=yes, location=no, width=300, height=640, menubar=no, status=no, scrollbars=yes') }
Chris@1295 210 }
Chris@1295 211 }