]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-includes/js/quicktags.js
WordPress 4.2.5
[autoinstalls/wordpress.git] / wp-includes / js / quicktags.js
1 /* global adminpage, wpActiveEditor, quicktagsL10n, wpLink, prompt */
2 /*
3  * Quicktags
4  *
5  * This is the HTML editor in WordPress. It can be attached to any textarea and will
6  * append a toolbar above it. This script is self-contained (does not require external libraries).
7  *
8  * Run quicktags(settings) to initialize it, where settings is an object containing up to 3 properties:
9  * settings = {
10  *   id : 'my_id',          the HTML ID of the textarea, required
11  *   buttons: ''            Comma separated list of the names of the default buttons to show. Optional.
12  *                          Current list of default button names: 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close';
13  * }
14  *
15  * The settings can also be a string quicktags_id.
16  *
17  * quicktags_id string The ID of the textarea that will be the editor canvas
18  * buttons string Comma separated list of the default buttons names that will be shown in that instance.
19  */
20
21 // new edit toolbar used with permission
22 // by Alex King
23 // http://www.alexking.org/
24
25 var QTags, edCanvas,
26         edButtons = [];
27
28 /* jshint ignore:start */
29
30 /**
31  * Back-compat
32  *
33  * Define all former global functions so plugins that hack quicktags.js directly don't cause fatal errors.
34  */
35 var edAddTag = function(){},
36 edCheckOpenTags = function(){},
37 edCloseAllTags = function(){},
38 edInsertImage = function(){},
39 edInsertLink = function(){},
40 edInsertTag = function(){},
41 edLink = function(){},
42 edQuickLink = function(){},
43 edRemoveTag = function(){},
44 edShowButton = function(){},
45 edShowLinks = function(){},
46 edSpell = function(){},
47 edToolbar = function(){};
48
49 /**
50  * Initialize new instance of the Quicktags editor
51  */
52 function quicktags(settings) {
53         return new QTags(settings);
54 }
55
56 /**
57  * Inserts content at the caret in the active editor (textarea)
58  *
59  * Added for back compatibility
60  * @see QTags.insertContent()
61  */
62 function edInsertContent(bah, txt) {
63         return QTags.insertContent(txt);
64 }
65
66 /**
67  * Adds a button to all instances of the editor
68  *
69  * Added for back compatibility, use QTags.addButton() as it gives more flexibility like type of button, button placement, etc.
70  * @see QTags.addButton()
71  */
72 function edButton(id, display, tagStart, tagEnd, access) {
73         return QTags.addButton( id, display, tagStart, tagEnd, access, '', -1 );
74 }
75
76 /* jshint ignore:end */
77
78 (function(){
79         // private stuff is prefixed with an underscore
80         var _domReady = function(func) {
81                 var t, i, DOMContentLoaded, _tryReady;
82
83                 if ( typeof jQuery !== 'undefined' ) {
84                         jQuery(document).ready(func);
85                 } else {
86                         t = _domReady;
87                         t.funcs = [];
88
89                         t.ready = function() {
90                                 if ( ! t.isReady ) {
91                                         t.isReady = true;
92                                         for ( i = 0; i < t.funcs.length; i++ ) {
93                                                 t.funcs[i]();
94                                         }
95                                 }
96                         };
97
98                         if ( t.isReady ) {
99                                 func();
100                         } else {
101                                 t.funcs.push(func);
102                         }
103
104                         if ( ! t.eventAttached ) {
105                                 if ( document.addEventListener ) {
106                                         DOMContentLoaded = function(){document.removeEventListener('DOMContentLoaded', DOMContentLoaded, false);t.ready();};
107                                         document.addEventListener('DOMContentLoaded', DOMContentLoaded, false);
108                                         window.addEventListener('load', t.ready, false);
109                                 } else if ( document.attachEvent ) {
110                                         DOMContentLoaded = function(){if (document.readyState === 'complete'){ document.detachEvent('onreadystatechange', DOMContentLoaded);t.ready();}};
111                                         document.attachEvent('onreadystatechange', DOMContentLoaded);
112                                         window.attachEvent('onload', t.ready);
113
114                                         _tryReady = function() {
115                                                 try {
116                                                         document.documentElement.doScroll('left');
117                                                 } catch(e) {
118                                                         setTimeout(_tryReady, 50);
119                                                         return;
120                                                 }
121
122                                                 t.ready();
123                                         };
124                                         _tryReady();
125                                 }
126
127                                 t.eventAttached = true;
128                         }
129                 }
130         },
131
132         _datetime = (function() {
133                 var now = new Date(), zeroise;
134
135                 zeroise = function(number) {
136                         var str = number.toString();
137
138                         if ( str.length < 2 ) {
139                                 str = '0' + str;
140                         }
141
142                         return str;
143                 };
144
145                 return now.getUTCFullYear() + '-' +
146                         zeroise( now.getUTCMonth() + 1 ) + '-' +
147                         zeroise( now.getUTCDate() ) + 'T' +
148                         zeroise( now.getUTCHours() ) + ':' +
149                         zeroise( now.getUTCMinutes() ) + ':' +
150                         zeroise( now.getUTCSeconds() ) +
151                         '+00:00';
152         })(),
153         qt;
154
155         qt = QTags = function(settings) {
156                 if ( typeof(settings) === 'string' ) {
157                         settings = {id: settings};
158                 } else if ( typeof(settings) !== 'object' ) {
159                         return false;
160                 }
161
162                 var t = this,
163                         id = settings.id,
164                         canvas = document.getElementById(id),
165                         name = 'qt_' + id,
166                         tb, onclick, toolbar_id;
167
168                 if ( !id || !canvas ) {
169                         return false;
170                 }
171
172                 t.name = name;
173                 t.id = id;
174                 t.canvas = canvas;
175                 t.settings = settings;
176
177                 if ( id === 'content' && typeof(adminpage) === 'string' && ( adminpage === 'post-new-php' || adminpage === 'post-php' ) ) {
178                         // back compat hack :-(
179                         edCanvas = canvas;
180                         toolbar_id = 'ed_toolbar';
181                 } else {
182                         toolbar_id = name + '_toolbar';
183                 }
184
185                 tb = document.createElement('div');
186                 tb.id = toolbar_id;
187                 tb.className = 'quicktags-toolbar';
188                 tb.onclick = function() {
189                         window.wpActiveEditor = id;
190                 };
191
192                 canvas.parentNode.insertBefore(tb, canvas);
193                 t.toolbar = tb;
194
195                 // listen for click events
196                 onclick = function(e) {
197                         e = e || window.event;
198                         var target = e.target || e.srcElement, visible = target.clientWidth || target.offsetWidth, i;
199
200                         // don't call the callback on pressing the accesskey when the button is not visible
201                         if ( !visible ) {
202                                 return;
203                         }
204
205                         // as long as it has the class ed_button, execute the callback
206                         if ( / ed_button /.test(' ' + target.className + ' ') ) {
207                                 // we have to reassign canvas here
208                                 t.canvas = canvas = document.getElementById(id);
209                                 i = target.id.replace(name + '_', '');
210
211                                 if ( t.theButtons[i] ) {
212                                         t.theButtons[i].callback.call(t.theButtons[i], target, canvas, t);
213                                 }
214                         }
215                 };
216
217                 if ( tb.addEventListener ) {
218                         tb.addEventListener('click', onclick, false);
219                 } else if ( tb.attachEvent ) {
220                         tb.attachEvent('onclick', onclick);
221                 }
222
223                 t.getButton = function(id) {
224                         return t.theButtons[id];
225                 };
226
227                 t.getButtonElement = function(id) {
228                         return document.getElementById(name + '_' + id);
229                 };
230
231                 qt.instances[id] = t;
232
233                 if ( ! qt.instances['0'] ) {
234                         qt.instances['0'] = qt.instances[id];
235                         _domReady( function(){ qt._buttonsInit(); } );
236                 }
237         };
238
239         qt.instances = {};
240
241         qt.getInstance = function(id) {
242                 return qt.instances[id];
243         };
244
245         qt._buttonsInit = function() {
246                 var t = this, canvas, name, settings, theButtons, html, inst, ed, id, i, use,
247                         defaults = ',strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,';
248
249                 for ( inst in t.instances ) {
250                         if ( '0' === inst ) {
251                                 continue;
252                         }
253
254                         ed = t.instances[inst];
255                         canvas = ed.canvas;
256                         name = ed.name;
257                         settings = ed.settings;
258                         html = '';
259                         theButtons = {};
260                         use = '';
261
262                         // set buttons
263                         if ( settings.buttons ) {
264                                 use = ','+settings.buttons+',';
265                         }
266
267                         for ( i in edButtons ) {
268                                 if ( !edButtons[i] ) {
269                                         continue;
270                                 }
271
272                                 id = edButtons[i].id;
273                                 if ( use && defaults.indexOf( ',' + id + ',' ) !== -1 && use.indexOf( ',' + id + ',' ) === -1 ) {
274                                         continue;
275                                 }
276
277                                 if ( !edButtons[i].instance || edButtons[i].instance === inst ) {
278                                         theButtons[id] = edButtons[i];
279
280                                         if ( edButtons[i].html ) {
281                                                 html += edButtons[i].html(name + '_');
282                                         }
283                                 }
284                         }
285
286                         if ( use && use.indexOf(',fullscreen,') !== -1 ) {
287                                 theButtons.fullscreen = new qt.FullscreenButton();
288                                 html += theButtons.fullscreen.html(name + '_');
289                         }
290
291                         if ( use && use.indexOf(',dfw,') !== -1 ) {
292                                 theButtons.dfw = new qt.DFWButton();
293                                 html += theButtons.dfw.html( name + '_' );
294                         }
295
296                         if ( 'rtl' === document.getElementsByTagName('html')[0].dir ) {
297                                 theButtons.textdirection = new qt.TextDirectionButton();
298                                 html += theButtons.textdirection.html(name + '_');
299                         }
300
301                         ed.toolbar.innerHTML = html;
302                         ed.theButtons = theButtons;
303
304                         if ( typeof jQuery !== 'undefined' ) {
305                                 jQuery( document ).triggerHandler( 'quicktags-init', [ ed ] );
306                         }
307                 }
308                 t.buttonsInitDone = true;
309         };
310
311         /**
312          * Main API function for adding a button to Quicktags
313          *
314          * Adds qt.Button or qt.TagButton depending on the args. The first three args are always required.
315          * To be able to add button(s) to Quicktags, your script should be enqueued as dependent
316          * on "quicktags" and outputted in the footer. If you are echoing JS directly from PHP,
317          * use add_action( 'admin_print_footer_scripts', 'output_my_js', 100 ) or add_action( 'wp_footer', 'output_my_js', 100 )
318          *
319          * Minimum required to add a button that calls an external function:
320          *     QTags.addButton( 'my_id', 'my button', my_callback );
321          *     function my_callback() { alert('yeah!'); }
322          *
323          * Minimum required to add a button that inserts a tag:
324          *     QTags.addButton( 'my_id', 'my button', '<span>', '</span>' );
325          *     QTags.addButton( 'my_id2', 'my button', '<br />' );
326          *
327          * @param string id Required. Button HTML ID
328          * @param string display Required. Button's value="..."
329          * @param string|function arg1 Required. Either a starting tag to be inserted like "<span>" or a callback that is executed when the button is clicked.
330          * @param string arg2 Optional. Ending tag like "</span>"
331          * @param string access_key Deprecated Not used
332          * @param string title Optional. Button's title="..."
333          * @param int priority Optional. Number representing the desired position of the button in the toolbar. 1 - 9 = first, 11 - 19 = second, 21 - 29 = third, etc.
334          * @param string instance Optional. Limit the button to a specific instance of Quicktags, add to all instances if not present.
335          * @return mixed null or the button object that is needed for back-compat.
336          */
337         qt.addButton = function( id, display, arg1, arg2, access_key, title, priority, instance ) {
338                 var btn;
339
340                 if ( !id || !display ) {
341                         return;
342                 }
343
344                 priority = priority || 0;
345                 arg2 = arg2 || '';
346
347                 if ( typeof(arg1) === 'function' ) {
348                         btn = new qt.Button(id, display, access_key, title, instance);
349                         btn.callback = arg1;
350                 } else if ( typeof(arg1) === 'string' ) {
351                         btn = new qt.TagButton(id, display, arg1, arg2, access_key, title, instance);
352                 } else {
353                         return;
354                 }
355
356                 if ( priority === -1 ) { // back-compat
357                         return btn;
358                 }
359
360                 if ( priority > 0 ) {
361                         while ( typeof(edButtons[priority]) !== 'undefined' ) {
362                                 priority++;
363                         }
364
365                         edButtons[priority] = btn;
366                 } else {
367                         edButtons[edButtons.length] = btn;
368                 }
369
370                 if ( this.buttonsInitDone ) {
371                         this._buttonsInit(); // add the button HTML to all instances toolbars if addButton() was called too late
372                 }
373         };
374
375         qt.insertContent = function(content) {
376                 var sel, startPos, endPos, scrollTop, text, canvas = document.getElementById(wpActiveEditor);
377
378                 if ( !canvas ) {
379                         return false;
380                 }
381
382                 if ( document.selection ) { //IE
383                         canvas.focus();
384                         sel = document.selection.createRange();
385                         sel.text = content;
386                         canvas.focus();
387                 } else if ( canvas.selectionStart || canvas.selectionStart === 0 ) { // FF, WebKit, Opera
388                         text = canvas.value;
389                         startPos = canvas.selectionStart;
390                         endPos = canvas.selectionEnd;
391                         scrollTop = canvas.scrollTop;
392
393                         canvas.value = text.substring(0, startPos) + content + text.substring(endPos, text.length);
394
395                         canvas.selectionStart = startPos + content.length;
396                         canvas.selectionEnd = startPos + content.length;
397                         canvas.scrollTop = scrollTop;
398                         canvas.focus();
399                 } else {
400                         canvas.value += content;
401                         canvas.focus();
402                 }
403                 return true;
404         };
405
406         // a plain, dumb button
407         qt.Button = function(id, display, access, title, instance) {
408                 var t = this;
409                 t.id = id;
410                 t.display = display;
411                 t.access = '';
412                 t.title = title || '';
413                 t.instance = instance || '';
414         };
415         qt.Button.prototype.html = function(idPrefix) {
416                 var title = this.title ? ' title="' + this.title + '"' : '',
417                         active, on, wp,
418                         dfw = ( wp = window.wp ) && wp.editor && wp.editor.dfw;
419
420                 if ( this.id === 'fullscreen' ) {
421                         return '<button type="button" id="' + idPrefix + this.id + '" class="ed_button qt-dfw qt-fullscreen"' + title + '></button>';
422                 } else if ( this.id === 'dfw' ) {
423                         active = dfw && dfw.isActive() ? '' : ' disabled="disabled"';
424                         on = dfw && dfw.isOn() ? ' active' : '';
425
426                         return '<button type="button" id="' + idPrefix + this.id + '" class="ed_button qt-dfw' + on + '"' + title + active + '></button>';
427                 }
428
429                 return '<input type="button" id="' + idPrefix + this.id + '" class="ed_button button button-small"' + title + ' value="' + this.display + '" />';
430         };
431         qt.Button.prototype.callback = function(){};
432
433         // a button that inserts HTML tag
434         qt.TagButton = function(id, display, tagStart, tagEnd, access, title, instance) {
435                 var t = this;
436                 qt.Button.call(t, id, display, access, title, instance);
437                 t.tagStart = tagStart;
438                 t.tagEnd = tagEnd;
439         };
440         qt.TagButton.prototype = new qt.Button();
441         qt.TagButton.prototype.openTag = function(e, ed) {
442                 var t = this;
443
444                 if ( ! ed.openTags ) {
445                         ed.openTags = [];
446                 }
447                 if ( t.tagEnd ) {
448                         ed.openTags.push(t.id);
449                         e.value = '/' + e.value;
450                 }
451         };
452         qt.TagButton.prototype.closeTag = function(e, ed) {
453                 var t = this, i = t.isOpen(ed);
454
455                 if ( i !== false ) {
456                         ed.openTags.splice(i, 1);
457                 }
458
459                 e.value = t.display;
460         };
461         // whether a tag is open or not. Returns false if not open, or current open depth of the tag
462         qt.TagButton.prototype.isOpen = function (ed) {
463                 var t = this, i = 0, ret = false;
464                 if ( ed.openTags ) {
465                         while ( ret === false && i < ed.openTags.length ) {
466                                 ret = ed.openTags[i] === t.id ? i : false;
467                                 i ++;
468                         }
469                 } else {
470                         ret = false;
471                 }
472                 return ret;
473         };
474         qt.TagButton.prototype.callback = function(element, canvas, ed) {
475                 var t = this, startPos, endPos, cursorPos, scrollTop, v = canvas.value, l, r, i, sel, endTag = v ? t.tagEnd : '';
476
477                 if ( document.selection ) { // IE
478                         canvas.focus();
479                         sel = document.selection.createRange();
480                         if ( sel.text.length > 0 ) {
481                                 if ( !t.tagEnd ) {
482                                         sel.text = sel.text + t.tagStart;
483                                 } else {
484                                         sel.text = t.tagStart + sel.text + endTag;
485                                 }
486                         } else {
487                                 if ( !t.tagEnd ) {
488                                         sel.text = t.tagStart;
489                                 } else if ( t.isOpen(ed) === false ) {
490                                         sel.text = t.tagStart;
491                                         t.openTag(element, ed);
492                                 } else {
493                                         sel.text = endTag;
494                                         t.closeTag(element, ed);
495                                 }
496                         }
497                         canvas.focus();
498                 } else if ( canvas.selectionStart || canvas.selectionStart === 0 ) { // FF, WebKit, Opera
499                         startPos = canvas.selectionStart;
500                         endPos = canvas.selectionEnd;
501                         cursorPos = endPos;
502                         scrollTop = canvas.scrollTop;
503                         l = v.substring(0, startPos); // left of the selection
504                         r = v.substring(endPos, v.length); // right of the selection
505                         i = v.substring(startPos, endPos); // inside the selection
506                         if ( startPos !== endPos ) {
507                                 if ( !t.tagEnd ) {
508                                         canvas.value = l + i + t.tagStart + r; // insert self closing tags after the selection
509                                         cursorPos += t.tagStart.length;
510                                 } else {
511                                         canvas.value = l + t.tagStart + i + endTag + r;
512                                         cursorPos += t.tagStart.length + endTag.length;
513                                 }
514                         } else {
515                                 if ( !t.tagEnd ) {
516                                         canvas.value = l + t.tagStart + r;
517                                         cursorPos = startPos + t.tagStart.length;
518                                 } else if ( t.isOpen(ed) === false ) {
519                                         canvas.value = l + t.tagStart + r;
520                                         t.openTag(element, ed);
521                                         cursorPos = startPos + t.tagStart.length;
522                                 } else {
523                                         canvas.value = l + endTag + r;
524                                         cursorPos = startPos + endTag.length;
525                                         t.closeTag(element, ed);
526                                 }
527                         }
528
529                         canvas.selectionStart = cursorPos;
530                         canvas.selectionEnd = cursorPos;
531                         canvas.scrollTop = scrollTop;
532                         canvas.focus();
533                 } else { // other browsers?
534                         if ( !endTag ) {
535                                 canvas.value += t.tagStart;
536                         } else if ( t.isOpen(ed) !== false ) {
537                                 canvas.value += t.tagStart;
538                                 t.openTag(element, ed);
539                         } else {
540                                 canvas.value += endTag;
541                                 t.closeTag(element, ed);
542                         }
543                         canvas.focus();
544                 }
545         };
546
547         // removed
548         qt.SpellButton = function() {};
549
550         // the close tags button
551         qt.CloseButton = function() {
552                 qt.Button.call(this, 'close', quicktagsL10n.closeTags, '', quicktagsL10n.closeAllOpenTags);
553         };
554
555         qt.CloseButton.prototype = new qt.Button();
556
557         qt._close = function(e, c, ed) {
558                 var button, element, tbo = ed.openTags;
559
560                 if ( tbo ) {
561                         while ( tbo.length > 0 ) {
562                                 button = ed.getButton(tbo[tbo.length - 1]);
563                                 element = document.getElementById(ed.name + '_' + button.id);
564
565                                 if ( e ) {
566                                         button.callback.call(button, element, c, ed);
567                                 } else {
568                                         button.closeTag(element, ed);
569                                 }
570                         }
571                 }
572         };
573
574         qt.CloseButton.prototype.callback = qt._close;
575
576         qt.closeAllTags = function(editor_id) {
577                 var ed = this.getInstance(editor_id);
578                 qt._close('', ed.canvas, ed);
579         };
580
581         // the link button
582         qt.LinkButton = function() {
583                 qt.TagButton.call(this, 'link', 'link', '', '</a>');
584         };
585         qt.LinkButton.prototype = new qt.TagButton();
586         qt.LinkButton.prototype.callback = function(e, c, ed, defaultValue) {
587                 var URL, t = this;
588
589                 if ( typeof wpLink !== 'undefined' ) {
590                         wpLink.open( ed.id );
591                         return;
592                 }
593
594                 if ( ! defaultValue ) {
595                         defaultValue = 'http://';
596                 }
597
598                 if ( t.isOpen(ed) === false ) {
599                         URL = prompt(quicktagsL10n.enterURL, defaultValue);
600                         if ( URL ) {
601                                 t.tagStart = '<a href="' + URL + '">';
602                                 qt.TagButton.prototype.callback.call(t, e, c, ed);
603                         }
604                 } else {
605                         qt.TagButton.prototype.callback.call(t, e, c, ed);
606                 }
607         };
608
609         // the img button
610         qt.ImgButton = function() {
611                 qt.TagButton.call(this, 'img', 'img', '', '');
612         };
613         qt.ImgButton.prototype = new qt.TagButton();
614         qt.ImgButton.prototype.callback = function(e, c, ed, defaultValue) {
615                 if ( ! defaultValue ) {
616                         defaultValue = 'http://';
617                 }
618                 var src = prompt(quicktagsL10n.enterImageURL, defaultValue), alt;
619                 if ( src ) {
620                         alt = prompt(quicktagsL10n.enterImageDescription, '');
621                         this.tagStart = '<img src="' + src + '" alt="' + alt + '" />';
622                         qt.TagButton.prototype.callback.call(this, e, c, ed);
623                 }
624         };
625
626         qt.FullscreenButton = function() {
627                 qt.Button.call(this, 'fullscreen', quicktagsL10n.fullscreen, 'f', quicktagsL10n.toggleFullscreen);
628         };
629         qt.FullscreenButton.prototype = new qt.Button();
630         qt.FullscreenButton.prototype.callback = function(e, c) {
631                 if ( ! c.id || typeof wp === 'undefined' || ! wp.editor || ! wp.editor.fullscreen ) {
632                         return;
633                 }
634
635                 wp.editor.fullscreen.on();
636         };
637
638         qt.DFWButton = function() {
639                 qt.Button.call( this, 'dfw', '', 'f', quicktagsL10n.dfw );
640         };
641         qt.DFWButton.prototype = new qt.Button();
642         qt.DFWButton.prototype.callback = function() {
643                 var wp;
644
645                 if ( ! ( wp = window.wp ) || ! wp.editor || ! wp.editor.dfw ) {
646                         return;
647                 }
648
649                 window.wp.editor.dfw.toggle();
650         };
651
652         qt.TextDirectionButton = function() {
653                 qt.Button.call(this, 'textdirection', quicktagsL10n.textdirection, '', quicktagsL10n.toggleTextdirection);
654         };
655         qt.TextDirectionButton.prototype = new qt.Button();
656         qt.TextDirectionButton.prototype.callback = function(e, c) {
657                 var isRTL = ( 'rtl' === document.getElementsByTagName('html')[0].dir ),
658                         currentDirection = c.style.direction;
659
660                 if ( ! currentDirection ) {
661                         currentDirection = ( isRTL ) ? 'rtl' : 'ltr';
662                 }
663
664                 c.style.direction = ( 'rtl' === currentDirection ) ? 'ltr' : 'rtl';
665                 c.focus();
666         };
667
668         // ensure backward compatibility
669         edButtons[10] = new qt.TagButton('strong','b','<strong>','</strong>');
670         edButtons[20] = new qt.TagButton('em','i','<em>','</em>'),
671         edButtons[30] = new qt.LinkButton(), // special case
672         edButtons[40] = new qt.TagButton('block','b-quote','\n\n<blockquote>','</blockquote>\n\n'),
673         edButtons[50] = new qt.TagButton('del','del','<del datetime="' + _datetime + '">','</del>'),
674         edButtons[60] = new qt.TagButton('ins','ins','<ins datetime="' + _datetime + '">','</ins>'),
675         edButtons[70] = new qt.ImgButton(), // special case
676         edButtons[80] = new qt.TagButton('ul','ul','<ul>\n','</ul>\n\n'),
677         edButtons[90] = new qt.TagButton('ol','ol','<ol>\n','</ol>\n\n'),
678         edButtons[100] = new qt.TagButton('li','li','\t<li>','</li>\n'),
679         edButtons[110] = new qt.TagButton('code','code','<code>','</code>'),
680         edButtons[120] = new qt.TagButton('more','more','<!--more-->\n\n',''),
681         edButtons[140] = new qt.CloseButton();
682
683 })();