annotate .svn/pristine/dc/dc0b4be494ea301b961f3a7c8e25f53fd78f87cd.svn-base @ 1327:287f201c2802 redmine-2.2-integration

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