annotate .svn/pristine/14/141194219711b0b953dd51beb008d5ce7e421ba0.svn-base @ 1519:afce8026aaeb redmine-2.4-integration

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