IP : 3.19.61.131Hostname : server86.web-hosting.comKernel : Linux server86.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64Disable Function : None :) OS : Linux
PATH:
/
home/
servlmvm/
public_html/
assets/
../
wp-includes/
js/
quicktags.js/
/
/* * Quicktags * * This is the HTML editor in WordPress. It can be attached to any textarea and will * append a toolbar above it. This script is self-contained (does not require external libraries). * * Run quicktags(settings) to initialize it, where settings is an object containing up to 3 properties: * settings = { * id : 'my_id', the HTML ID of the textarea, required * buttons: '' Comma separated list of the names of the default buttons to show. Optional. * Current list of default button names: 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close'; * } * * The settings can also be a string quicktags_id. * * quicktags_id string The ID of the textarea that will be the editor canvas * buttons string Comma separated list of the default buttons names that will be shown in that instance. * * @output wp-includes/js/quicktags.js */
// New edit toolbar used with permission // by Alex King // http://www.alexking.org/
/* global adminpage, wpActiveEditor, quicktagsL10n, wpLink, prompt, edButtons */
window.edButtons = [];
/* jshint ignore:start */
/** * Back-compat * * Define all former global functions so plugins that hack quicktags.js directly don't cause fatal errors. */ window.edAddTag = function(){}; window.edCheckOpenTags = function(){}; window.edCloseAllTags = function(){}; window.edInsertImage = function(){}; window.edInsertLink = function(){}; window.edInsertTag = function(){}; window.edLink = function(){}; window.edQuickLink = function(){}; window.edRemoveTag = function(){}; window.edShowButton = function(){}; window.edShowLinks = function(){}; window.edSpell = function(){}; window.edToolbar = function(){};
/* jshint ignore:end */
(function(){ // Private stuff is prefixed with an underscore. var _domReady = function(func) { var t, i, DOMContentLoaded, _tryReady;
if ( typeof jQuery !== 'undefined' ) { jQuery( func ); } else { t = _domReady; t.funcs = [];
t.ready = function() { if ( ! t.isReady ) { t.isReady = true; for ( i = 0; i < t.funcs.length; i++ ) { t.funcs[i](); } } };
// Listen for click events. onclick = function(e) { e = e || window.event; var target = e.target || e.srcElement, visible = target.clientWidth || target.offsetWidth, i;
// Don't call the callback on pressing the accesskey when the button is not visible. if ( !visible ) { return; }
// As long as it has the class ed_button, execute the callback. if ( / ed_button /.test(' ' + target.className + ' ') ) { // We have to reassign canvas here. t.canvas = canvas = document.getElementById(id); i = target.id.replace(name + '_', '');
if ( typeof jQuery !== 'undefined' ) { jQuery( document ).triggerHandler( 'quicktags-init', [ ed ] ); } }
if ( id ) { _init( id ); } else { for ( id in t.instances ) { _init( id ); } }
t.buttonsInitDone = true; };
/** * Main API function for adding a button to Quicktags * * Adds qt.Button or qt.TagButton depending on the args. The first three args are always required. * To be able to add button(s) to Quicktags, your script should be enqueued as dependent * on "quicktags" and outputted in the footer. If you are echoing JS directly from PHP, * use add_action( 'admin_print_footer_scripts', 'output_my_js', 100 ) or add_action( 'wp_footer', 'output_my_js', 100 ) * * Minimum required to add a button that calls an external function: * QTags.addButton( 'my_id', 'my button', my_callback ); * function my_callback() { alert('yeah!'); } * * Minimum required to add a button that inserts a tag: * QTags.addButton( 'my_id', 'my button', '<span>', '</span>' ); * QTags.addButton( 'my_id2', 'my button', '<br />' ); * * @param string id Required. Button HTML ID * @param string display Required. Button's value="..." * @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. * @param string arg2 Optional. Ending tag like "</span>" * @param string access_key Deprecated Not used * @param string title Optional. Button's title="..." * @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. * @param string instance Optional. Limit the button to a specific instance of Quicktags, add to all instances if not present. * @param attr object Optional. Used to pass additional attributes. Currently supports `ariaLabel` and `ariaLabelClose` (for "close tag" state) * @return mixed null or the button object that is needed for back-compat. */ qt.addButton = function( id, display, arg1, arg2, access_key, title, priority, instance, attr ) { var btn;
if ( this.attr.ariaLabelClose ) { element.setAttribute( 'aria-label', this.attr.ariaLabelClose ); } } }; qt.TagButton.prototype.closeTag = function( element, ed ) { var i = this.isOpen(ed);
if ( i !== false ) { ed.openTags.splice( i, 1 ); }
element.value = this.display;
if ( this.attr.ariaLabel ) { element.setAttribute( 'aria-label', this.attr.ariaLabel ); } }; // Whether a tag is open or not. Returns false if not open, or current open depth of the tag. qt.TagButton.prototype.isOpen = function (ed) { var t = this, i = 0, ret = false; if ( ed.openTags ) { while ( ret === false && i < ed.openTags.length ) { ret = ed.openTags[i] === t.id ? i : false; i ++; } } else { ret = false; } return ret; }; qt.TagButton.prototype.callback = function(element, canvas, ed) { var t = this, startPos, endPos, cursorPos, scrollTop, v = canvas.value, l, r, i, sel, endTag = v ? t.tagEnd : '', event;
/** * Initialize new instance of the Quicktags editor */ window.quicktags = function(settings) { return new window.QTags(settings); };
/** * Inserts content at the caret in the active editor (textarea) * * Added for back compatibility * @see QTags.insertContent() */ window.edInsertContent = function(bah, txt) { return window.QTags.insertContent(txt); };
/** * Adds a button to all instances of the editor * * Added for back compatibility, use QTags.addButton() as it gives more flexibility like type of button, button placement, etc. * @see QTags.addButton() */ window.edButton = function(id, display, tagStart, tagEnd, access) { return window.QTags.addButton( id, display, tagStart, tagEnd, access, '', -1 ); };