repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
partition
stringclasses
1 value
sadiqhabib/tinymce-dist
tinymce.full.js
function (elm, name, value) { elm = this.$$(elm).css(name, value); if (this.settings.update_styles) { updateInternalStyleAttr(this, elm); } }
javascript
function (elm, name, value) { elm = this.$$(elm).css(name, value); if (this.settings.update_styles) { updateInternalStyleAttr(this, elm); } }
[ "function", "(", "elm", ",", "name", ",", "value", ")", "{", "elm", "=", "this", ".", "$$", "(", "elm", ")", ".", "css", "(", "name", ",", "value", ")", ";", "if", "(", "this", ".", "settings", ".", "update_styles", ")", "{", "updateInternalStyleAt...
Sets the CSS style value on a HTML element. The name can be a camelcase string or the CSS style name like background-color. @method setStyle @param {String/Element/Array} elm HTML element/Array of elements to set CSS style value on. @param {String} name Name of the style value to set. @param {String} value Value to se...
[ "Sets", "the", "CSS", "style", "value", "on", "a", "HTML", "element", ".", "The", "name", "can", "be", "a", "camelcase", "string", "or", "the", "CSS", "style", "name", "like", "background", "-", "color", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8211-L8217
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (e) { return this.run(e, function (e) { var i, attrs = e.attributes; for (i = attrs.length - 1; i >= 0; i--) { e.removeAttributeNode(attrs.item(i)); } }); }
javascript
function (e) { return this.run(e, function (e) { var i, attrs = e.attributes; for (i = attrs.length - 1; i >= 0; i--) { e.removeAttributeNode(attrs.item(i)); } }); }
[ "function", "(", "e", ")", "{", "return", "this", ".", "run", "(", "e", ",", "function", "(", "e", ")", "{", "var", "i", ",", "attrs", "=", "e", ".", "attributes", ";", "for", "(", "i", "=", "attrs", ".", "length", "-", "1", ";", "i", ">=", ...
Removes all attributes from an element or elements. @method removeAllAttribs @param {Element/String/Array} e DOM element, element id string or array of elements/ids to remove attributes from.
[ "Removes", "all", "attributes", "from", "an", "element", "or", "elements", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8274-L8281
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (elm, name, value) { var self = this, originalValue, hook, settings = self.settings; if (value === '') { value = null; } elm = self.$$(elm); originalValue = elm.attr(name); if (!elm.length) { return; } hook = self.attrHooks...
javascript
function (elm, name, value) { var self = this, originalValue, hook, settings = self.settings; if (value === '') { value = null; } elm = self.$$(elm); originalValue = elm.attr(name); if (!elm.length) { return; } hook = self.attrHooks...
[ "function", "(", "elm", ",", "name", ",", "value", ")", "{", "var", "self", "=", "this", ",", "originalValue", ",", "hook", ",", "settings", "=", "self", ".", "settings", ";", "if", "(", "value", "===", "''", ")", "{", "value", "=", "null", ";", ...
Sets the specified attribute of an element or elements. @method setAttrib @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set attribute on. @param {String} name Name of attribute to set. @param {String} value Value to set on the attribute - if this value is falsy like null,...
[ "Sets", "the", "specified", "attribute", "of", "an", "element", "or", "elements", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8298-L8326
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (elm, attrs) { var self = this; self.$$(elm).each(function (i, node) { each(attrs, function (value, name) { self.setAttrib(node, name, value); }); }); }
javascript
function (elm, attrs) { var self = this; self.$$(elm).each(function (i, node) { each(attrs, function (value, name) { self.setAttrib(node, name, value); }); }); }
[ "function", "(", "elm", ",", "attrs", ")", "{", "var", "self", "=", "this", ";", "self", ".", "$$", "(", "elm", ")", ".", "each", "(", "function", "(", "i", ",", "node", ")", "{", "each", "(", "attrs", ",", "function", "(", "value", ",", "name"...
Sets two or more specified attributes of an element or elements. @method setAttribs @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set attributes on. @param {Object} attrs Name/Value collection of attribute items to add to the element(s). @example // Sets class and title a...
[ "Sets", "two", "or", "more", "specified", "attributes", "of", "an", "element", "or", "elements", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8341-L8349
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (elm, name, defaultVal) { var self = this, hook, value; elm = self.$$(elm); if (elm.length) { hook = self.attrHooks[name]; if (hook && hook.get) { value = hook.get(elm, name); } else { value = elm.attr(name); } }...
javascript
function (elm, name, defaultVal) { var self = this, hook, value; elm = self.$$(elm); if (elm.length) { hook = self.attrHooks[name]; if (hook && hook.get) { value = hook.get(elm, name); } else { value = elm.attr(name); } }...
[ "function", "(", "elm", ",", "name", ",", "defaultVal", ")", "{", "var", "self", "=", "this", ",", "hook", ",", "value", ";", "elm", "=", "self", ".", "$$", "(", "elm", ")", ";", "if", "(", "elm", ".", "length", ")", "{", "hook", "=", "self", ...
Returns the specified attribute by name. @method getAttrib @param {String/Element} elm Element string id or DOM element to get attribute from. @param {String} name Name of attribute to get. @param {String} defaultVal Optional default value to return if the attribute didn't exist. @return {String} Attribute value strin...
[ "Returns", "the", "specified", "attribute", "by", "name", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8360-L8380
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (cssText) { var self = this, doc = self.doc, head, styleElm; // Prevent inline from loading the same styles twice if (self !== DOMUtils.DOM && doc === document) { var addedStyles = DOMUtils.DOM.addedStyles; addedStyles = addedStyles || []; if (addedStyles...
javascript
function (cssText) { var self = this, doc = self.doc, head, styleElm; // Prevent inline from loading the same styles twice if (self !== DOMUtils.DOM && doc === document) { var addedStyles = DOMUtils.DOM.addedStyles; addedStyles = addedStyles || []; if (addedStyles...
[ "function", "(", "cssText", ")", "{", "var", "self", "=", "this", ",", "doc", "=", "self", ".", "doc", ",", "head", ",", "styleElm", ";", "// Prevent inline from loading the same styles twice", "if", "(", "self", "!==", "DOMUtils", ".", "DOM", "&&", "doc", ...
Adds a style element at the top of the document with the specified cssText content. @method addStyle @param {String} cssText CSS Text style to add to top of head of document.
[ "Adds", "a", "style", "element", "at", "the", "top", "of", "the", "document", "with", "the", "specified", "cssText", "content", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8460-L8497
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (elm, html) { elm = this.$$(elm); if (isIE) { elm.each(function (i, target) { if (target.canHaveHTML === false) { return; } // Remove all child nodes, IE keeps empty text nodes in DOM while (target.firstChild) { ...
javascript
function (elm, html) { elm = this.$$(elm); if (isIE) { elm.each(function (i, target) { if (target.canHaveHTML === false) { return; } // Remove all child nodes, IE keeps empty text nodes in DOM while (target.firstChild) { ...
[ "function", "(", "elm", ",", "html", ")", "{", "elm", "=", "this", ".", "$$", "(", "elm", ")", ";", "if", "(", "isIE", ")", "{", "elm", ".", "each", "(", "function", "(", "i", ",", "target", ")", "{", "if", "(", "target", ".", "canHaveHTML", ...
Sets the specified HTML content inside the element or elements. The HTML will first be processed. This means URLs will get converted, hex color values fixed etc. Check processHTML for details. @method setHTML @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set HTML inside o...
[ "Sets", "the", "specified", "HTML", "content", "inside", "the", "element", "or", "elements", ".", "The", "HTML", "will", "first", "be", "processed", ".", "This", "means", "URLs", "will", "get", "converted", "hex", "color", "values", "fixed", "etc", ".", "C...
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8686-L8715
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (elm) { elm = this.get(elm); // Older FF doesn't have outerHTML 3.6 is still used by some orgaizations return elm.nodeType == 1 && "outerHTML" in elm ? elm.outerHTML : $('<div></div>').append($(elm).clone()).html(); }
javascript
function (elm) { elm = this.get(elm); // Older FF doesn't have outerHTML 3.6 is still used by some orgaizations return elm.nodeType == 1 && "outerHTML" in elm ? elm.outerHTML : $('<div></div>').append($(elm).clone()).html(); }
[ "function", "(", "elm", ")", "{", "elm", "=", "this", ".", "get", "(", "elm", ")", ";", "// Older FF doesn't have outerHTML 3.6 is still used by some orgaizations", "return", "elm", ".", "nodeType", "==", "1", "&&", "\"outerHTML\"", "in", "elm", "?", "elm", ".",...
Returns the outer HTML of an element. @method getOuterHTML @param {String/Element} elm Element ID or element object to get outer HTML from. @return {String} Outer HTML string. @example tinymce.DOM.getOuterHTML(editorElement); tinymce.activeEditor.getOuterHTML(tinymce.activeEditor.getBody());
[ "Returns", "the", "outer", "HTML", "of", "an", "element", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8727-L8732
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (elm, html) { var self = this; self.$$(elm).each(function () { try { // Older FF doesn't have outerHTML 3.6 is still used by some organizations if ("outerHTML" in this) { this.outerHTML = html; return; } } catc...
javascript
function (elm, html) { var self = this; self.$$(elm).each(function () { try { // Older FF doesn't have outerHTML 3.6 is still used by some organizations if ("outerHTML" in this) { this.outerHTML = html; return; } } catc...
[ "function", "(", "elm", ",", "html", ")", "{", "var", "self", "=", "this", ";", "self", ".", "$$", "(", "elm", ")", ".", "each", "(", "function", "(", ")", "{", "try", "{", "// Older FF doesn't have outerHTML 3.6 is still used by some organizations", "if", "...
Sets the specified outer HTML on an element or elements. @method setOuterHTML @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set outer HTML on. @param {Object} html HTML code to set as outer value for the element. @example // Sets the outer HTML of all paragraphs in the ac...
[ "Sets", "the", "specified", "outer", "HTML", "on", "an", "element", "or", "elements", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8747-L8764
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (node, referenceNode) { referenceNode = this.get(referenceNode); return this.run(node, function (node) { var parent, nextSibling; parent = referenceNode.parentNode; nextSibling = referenceNode.nextSibling; if (nextSibling) { parent.insertBe...
javascript
function (node, referenceNode) { referenceNode = this.get(referenceNode); return this.run(node, function (node) { var parent, nextSibling; parent = referenceNode.parentNode; nextSibling = referenceNode.nextSibling; if (nextSibling) { parent.insertBe...
[ "function", "(", "node", ",", "referenceNode", ")", "{", "referenceNode", "=", "this", ".", "get", "(", "referenceNode", ")", ";", "return", "this", ".", "run", "(", "node", ",", "function", "(", "node", ")", "{", "var", "parent", ",", "nextSibling", "...
Inserts an element after the reference element. @method insertAfter @param {Element} node Element to insert after the reference. @param {Element/String/Array} referenceNode Reference element, element id or array of elements to insert after. @return {Element/Array} Element that got added or an array with elements.
[ "Inserts", "an", "element", "after", "the", "reference", "element", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8792-L8809
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (elm, name) { var self = this, newElm; if (elm.nodeName != name.toUpperCase()) { // Rename block element newElm = self.create(name); // Copy attribs to new block each(self.getAttribs(elm), function (attrNode) { self.setAttrib(newElm, attrNod...
javascript
function (elm, name) { var self = this, newElm; if (elm.nodeName != name.toUpperCase()) { // Rename block element newElm = self.create(name); // Copy attribs to new block each(self.getAttribs(elm), function (attrNode) { self.setAttrib(newElm, attrNod...
[ "function", "(", "elm", ",", "name", ")", "{", "var", "self", "=", "this", ",", "newElm", ";", "if", "(", "elm", ".", "nodeName", "!=", "name", ".", "toUpperCase", "(", ")", ")", "{", "// Rename block element", "newElm", "=", "self", ".", "create", "...
Renames the specified element and keeps its attributes and children. @method rename @param {Element} elm Element to rename. @param {String} name Name of the new element. @return {Element} New element or the old element if it needed renaming.
[ "Renames", "the", "specified", "element", "and", "keeps", "its", "attributes", "and", "children", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8847-L8864
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (a, b) { var ps = a, pe; while (ps) { pe = b; while (pe && ps != pe) { pe = pe.parentNode; } if (ps == pe) { break; } ps = ps.parentNode; } if (!ps && a.ownerDocument) { return a.o...
javascript
function (a, b) { var ps = a, pe; while (ps) { pe = b; while (pe && ps != pe) { pe = pe.parentNode; } if (ps == pe) { break; } ps = ps.parentNode; } if (!ps && a.ownerDocument) { return a.o...
[ "function", "(", "a", ",", "b", ")", "{", "var", "ps", "=", "a", ",", "pe", ";", "while", "(", "ps", ")", "{", "pe", "=", "b", ";", "while", "(", "pe", "&&", "ps", "!=", "pe", ")", "{", "pe", "=", "pe", ".", "parentNode", ";", "}", "if", ...
Find the common ancestor of two elements. This is a shorter method than using the DOM Range logic. @method findCommonAncestor @param {Element} a Element to find common ancestor of. @param {Element} b Element to find common ancestor of. @return {Element} Common ancestor element of the two input elements.
[ "Find", "the", "common", "ancestor", "of", "two", "elements", ".", "This", "is", "a", "shorter", "method", "than", "using", "the", "DOM", "Range", "logic", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8874-L8896
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (elm) { var attrs; elm = this.get(elm); if (!elm) { return []; } if (isIE) { attrs = []; // Object will throw exception in IE if (elm.nodeName == 'OBJECT') { return elm.attributes; } // IE doesn...
javascript
function (elm) { var attrs; elm = this.get(elm); if (!elm) { return []; } if (isIE) { attrs = []; // Object will throw exception in IE if (elm.nodeName == 'OBJECT') { return elm.attributes; } // IE doesn...
[ "function", "(", "elm", ")", "{", "var", "attrs", ";", "elm", "=", "this", ".", "get", "(", "elm", ")", ";", "if", "(", "!", "elm", ")", "{", "return", "[", "]", ";", "}", "if", "(", "isIE", ")", "{", "attrs", "=", "[", "]", ";", "// Object...
Returns a NodeList with attributes for the element. @method getAttribs @param {HTMLElement/string} elm Element node or string id to get attributes from. @return {NodeList} NodeList with attributes.
[ "Returns", "a", "NodeList", "with", "attributes", "for", "the", "element", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8956-L8988
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (target, name, func, scope) { var self = this; if (Tools.isArray(target)) { var i = target.length; while (i--) { target[i] = self.bind(target[i], name, func, scope); } return target; } // Collect all window/document events ...
javascript
function (target, name, func, scope) { var self = this; if (Tools.isArray(target)) { var i = target.length; while (i--) { target[i] = self.bind(target[i], name, func, scope); } return target; } // Collect all window/document events ...
[ "function", "(", "target", ",", "name", ",", "func", ",", "scope", ")", "{", "var", "self", "=", "this", ";", "if", "(", "Tools", ".", "isArray", "(", "target", ")", ")", "{", "var", "i", "=", "target", ".", "length", ";", "while", "(", "i", "-...
Adds an event handler to the specified object. @method bind @param {Element/Document/Window/Array} target Target element to bind events to. handler to or an array of elements/ids/documents. @param {String} name Name of event handler to add, for example: click. @param {function} func Function to execute when the event ...
[ "Adds", "an", "event", "handler", "to", "the", "specified", "object", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L9205-L9224
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (target, name, func) { var self = this, i; if (Tools.isArray(target)) { i = target.length; while (i--) { target[i] = self.unbind(target[i], name, func); } return target; } // Remove any bound events matching the input ...
javascript
function (target, name, func) { var self = this, i; if (Tools.isArray(target)) { i = target.length; while (i--) { target[i] = self.unbind(target[i], name, func); } return target; } // Remove any bound events matching the input ...
[ "function", "(", "target", ",", "name", ",", "func", ")", "{", "var", "self", "=", "this", ",", "i", ";", "if", "(", "Tools", ".", "isArray", "(", "target", ")", ")", "{", "i", "=", "target", ".", "length", ";", "while", "(", "i", "--", ")", ...
Removes the specified event handler by name and function from an element or collection of elements. @method unbind @param {Element/Document/Window/Array} target Target element to unbind events on. @param {String} name Event handler name, for example: "click" @param {function} func Function to remove. @return {bool/Arr...
[ "Removes", "the", "specified", "event", "handler", "by", "name", "and", "function", "from", "an", "element", "or", "collection", "of", "elements", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L9236-L9263
train
sadiqhabib/tinymce-dist
tinymce.full.js
function () { var self = this; // Unbind all events bound to window/document by editor instance if (self.boundEvents) { var i = self.boundEvents.length; while (i--) { var item = self.boundEvents[i]; this.events.unbind(item[0], item[1], item[2]); ...
javascript
function () { var self = this; // Unbind all events bound to window/document by editor instance if (self.boundEvents) { var i = self.boundEvents.length; while (i--) { var item = self.boundEvents[i]; this.events.unbind(item[0], item[1], item[2]); ...
[ "function", "(", ")", "{", "var", "self", "=", "this", ";", "// Unbind all events bound to window/document by editor instance", "if", "(", "self", ".", "boundEvents", ")", "{", "var", "i", "=", "self", ".", "boundEvents", ".", "length", ";", "while", "(", "i",...
Destroys all internal references to the DOM to solve IE leak issues. @method destroy
[ "Destroys", "all", "internal", "references", "to", "the", "DOM", "to", "solve", "IE", "leak", "issues", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L9316-L9338
train
sadiqhabib/tinymce-dist
tinymce.full.js
loadScript
function loadScript(url, success, failure) { var dom = DOM, elm, id; // Execute callback when script is loaded function done() { dom.remove(id); if (elm) { elm.onreadystatechange = elm.onload = elm = null; } success(); } fun...
javascript
function loadScript(url, success, failure) { var dom = DOM, elm, id; // Execute callback when script is loaded function done() { dom.remove(id); if (elm) { elm.onreadystatechange = elm.onload = elm = null; } success(); } fun...
[ "function", "loadScript", "(", "url", ",", "success", ",", "failure", ")", "{", "var", "dom", "=", "DOM", ",", "elm", ",", "id", ";", "// Execute callback when script is loaded", "function", "done", "(", ")", "{", "dom", ".", "remove", "(", "id", ")", ";...
Loads a specific script directly without adding it to the load queue. @method load @param {String} url Absolute URL to script to add. @param {function} callback Optional success callback function when the script loaded successfully. @param {function} callback Optional failure callback function when the script failed t...
[ "Loads", "a", "specific", "script", "directly", "without", "adding", "it", "to", "the", "load", "queue", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L9476-L9532
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (name, languages) { var language = AddOnManager.language; if (language && AddOnManager.languageLoad !== false) { if (languages) { languages = ',' + languages + ','; // Load short form sv.js or long form sv_SE.js if (languages.indexOf(',' + languag...
javascript
function (name, languages) { var language = AddOnManager.language; if (language && AddOnManager.languageLoad !== false) { if (languages) { languages = ',' + languages + ','; // Load short form sv.js or long form sv_SE.js if (languages.indexOf(',' + languag...
[ "function", "(", "name", ",", "languages", ")", "{", "var", "language", "=", "AddOnManager", ".", "language", ";", "if", "(", "language", "&&", "AddOnManager", ".", "languageLoad", "!==", "false", ")", "{", "if", "(", "languages", ")", "{", "languages", ...
Loads a language pack for the specified add-on. @method requireLangPack @param {String} name Short name of the add-on. @param {String} languages Optional comma or space separated list of languages to check if it matches the name.
[ "Loads", "a", "language", "pack", "for", "the", "specified", "add", "-", "on", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L9773-L9790
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (id, addOn, dependencies) { this.items.push(addOn); this.lookup[id] = { instance: addOn, dependencies: dependencies }; return addOn; }
javascript
function (id, addOn, dependencies) { this.items.push(addOn); this.lookup[id] = { instance: addOn, dependencies: dependencies }; return addOn; }
[ "function", "(", "id", ",", "addOn", ",", "dependencies", ")", "{", "this", ".", "items", ".", "push", "(", "addOn", ")", ";", "this", ".", "lookup", "[", "id", "]", "=", "{", "instance", ":", "addOn", ",", "dependencies", ":", "dependencies", "}", ...
Adds a instance of the add-on by it's short name. @method add @param {String} id Short name/id for the add-on. @param {tinymce.Theme/tinymce.Plugin} addOn Theme or plugin to add. @return {tinymce.Theme/tinymce.Plugin} The same theme or plugin instance that got passed in. @example // Create a simple plugin tinymce.crea...
[ "Adds", "a", "instance", "of", "the", "add", "-", "on", "by", "it", "s", "short", "name", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L9818-L9823
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (name, addOnUrl, success, scope, failure) { var self = this, url = addOnUrl; function loadDependencies() { var dependencies = self.dependencies(name); each(dependencies, function (dep) { var newUrl = self.createUrl(addOnUrl, dep); self.load(newUrl....
javascript
function (name, addOnUrl, success, scope, failure) { var self = this, url = addOnUrl; function loadDependencies() { var dependencies = self.dependencies(name); each(dependencies, function (dep) { var newUrl = self.createUrl(addOnUrl, dep); self.load(newUrl....
[ "function", "(", "name", ",", "addOnUrl", ",", "success", ",", "scope", ",", "failure", ")", "{", "var", "self", "=", "this", ",", "url", "=", "addOnUrl", ";", "function", "loadDependencies", "(", ")", "{", "var", "dependencies", "=", "self", ".", "dep...
Loads an add-on from a specific url. @method load @param {String} name Short name of the add-on that gets loaded. @param {String} addOnUrl URL to the add-on that will get loaded. @param {function} success Optional success callback to execute when an add-on is loaded. @param {Object} scope Optional scope to execute the...
[ "Loads", "an", "add", "-", "on", "from", "a", "specific", "url", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L9874-L9914
train
sadiqhabib/tinymce-dist
tinymce.full.js
findClosestIeRange
function findClosestIeRange(clientX, clientY, doc) { var element, rng, rects; element = doc.elementFromPoint(clientX, clientY); rng = doc.body.createTextRange(); if (!element || element.tagName == 'HTML') { element = doc.body; } rng.moveToElementText(element); rects ...
javascript
function findClosestIeRange(clientX, clientY, doc) { var element, rng, rects; element = doc.elementFromPoint(clientX, clientY); rng = doc.body.createTextRange(); if (!element || element.tagName == 'HTML') { element = doc.body; } rng.moveToElementText(element); rects ...
[ "function", "findClosestIeRange", "(", "clientX", ",", "clientY", ",", "doc", ")", "{", "var", "element", ",", "rng", ",", "rects", ";", "element", "=", "doc", ".", "elementFromPoint", "(", "clientX", ",", "clientY", ")", ";", "rng", "=", "doc", ".", "...
Finds the closest selection rect tries to get the range from that.
[ "Finds", "the", "closest", "selection", "rect", "tries", "to", "get", "the", "range", "from", "that", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L10913-L10947
train
sadiqhabib/tinymce-dist
tinymce.full.js
Node
function Node(name, type) { this.name = name; this.type = type; if (type === 1) { this.attributes = []; this.attributes.map = {}; } }
javascript
function Node(name, type) { this.name = name; this.type = type; if (type === 1) { this.attributes = []; this.attributes.map = {}; } }
[ "function", "Node", "(", "name", ",", "type", ")", "{", "this", ".", "name", "=", "name", ";", "this", ".", "type", "=", "type", ";", "if", "(", "type", "===", "1", ")", "{", "this", ".", "attributes", "=", "[", "]", ";", "this", ".", "attribut...
Constructs a new Node instance. @constructor @method Node @param {String} name Name of the node type. @param {Number} type Numeric type representing the node.
[ "Constructs", "a", "new", "Node", "instance", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L11088-L11096
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (node, refNode, before) { var parent; if (node.parent) { node.remove(); } parent = refNode.parent || this; if (before) { if (refNode === parent.firstChild) { parent.firstChild = node; } else { refNode.prev.next = n...
javascript
function (node, refNode, before) { var parent; if (node.parent) { node.remove(); } parent = refNode.parent || this; if (before) { if (refNode === parent.firstChild) { parent.firstChild = node; } else { refNode.prev.next = n...
[ "function", "(", "node", ",", "refNode", ",", "before", ")", "{", "var", "parent", ";", "if", "(", "node", ".", "parent", ")", "{", "node", ".", "remove", "(", ")", ";", "}", "parent", "=", "refNode", ".", "parent", "||", "this", ";", "if", "(", ...
Inserts a node at a specific position as a child of the current node. @example parentNode.insert(newChildNode, oldChildNode); @method insert @param {tinymce.html.Node} node Node to insert as a child of the current node. @param {tinymce.html.Node} refNode Reference node to set node before/after. @param {Boolean} befor...
[ "Inserts", "a", "node", "at", "a", "specific", "position", "as", "a", "child", "of", "the", "current", "node", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L11344-L11378
train
sadiqhabib/tinymce-dist
tinymce.full.js
addCustomElements
function addCustomElements(customElements) { var customElementRegExp = /^(~)?(.+)$/; if (customElements) { // Flush cached items since we are altering the default maps mapCache.text_block_elements = mapCache.block_elements = null; each(split(customElements, ','), function...
javascript
function addCustomElements(customElements) { var customElementRegExp = /^(~)?(.+)$/; if (customElements) { // Flush cached items since we are altering the default maps mapCache.text_block_elements = mapCache.block_elements = null; each(split(customElements, ','), function...
[ "function", "addCustomElements", "(", "customElements", ")", "{", "var", "customElementRegExp", "=", "/", "^(~)?(.+)$", "/", ";", "if", "(", "customElements", ")", "{", "// Flush cached items since we are altering the default maps", "mapCache", ".", "text_block_elements", ...
Adds custom non HTML elements to the schema
[ "Adds", "custom", "non", "HTML", "elements", "to", "the", "schema" ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L12107-L12149
train
sadiqhabib/tinymce-dist
tinymce.full.js
findEndTag
function findEndTag(schema, html, startIndex) { var count = 1, index, matches, tokenRegExp, shortEndedElements; shortEndedElements = schema.getShortEndedElements(); tokenRegExp = /<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g; tokenRegExp.lastIn...
javascript
function findEndTag(schema, html, startIndex) { var count = 1, index, matches, tokenRegExp, shortEndedElements; shortEndedElements = schema.getShortEndedElements(); tokenRegExp = /<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g; tokenRegExp.lastIn...
[ "function", "findEndTag", "(", "schema", ",", "html", ",", "startIndex", ")", "{", "var", "count", "=", "1", ",", "index", ",", "matches", ",", "tokenRegExp", ",", "shortEndedElements", ";", "shortEndedElements", "=", "schema", ".", "getShortEndedElements", "(...
Returns the index of the end tag for a specific start tag. This can be used to skip all children of a parent element from being processed. @private @method findEndTag @param {tinymce.html.Schema} schema Schema instance to use to match short ended elements. @param {String} html HTML string to find the end tag in. @para...
[ "Returns", "the", "index", "of", "the", "end", "tag", "for", "a", "specific", "start", "tag", ".", "This", "can", "be", "used", "to", "skip", "all", "children", "of", "a", "parent", "element", "from", "being", "processed", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L12631-L12657
train
sadiqhabib/tinymce-dist
tinymce.full.js
getBrClientRect
function getBrClientRect(brNode) { var doc = brNode.ownerDocument, rng = createRange(doc), nbsp = doc.createTextNode('\u00a0'), parentNode = brNode.parentNode, clientRect; parentNode.insertBefore(nbsp, brNode); rng.setStart(nbsp, 0); rng.setEnd(nb...
javascript
function getBrClientRect(brNode) { var doc = brNode.ownerDocument, rng = createRange(doc), nbsp = doc.createTextNode('\u00a0'), parentNode = brNode.parentNode, clientRect; parentNode.insertBefore(nbsp, brNode); rng.setStart(nbsp, 0); rng.setEnd(nb...
[ "function", "getBrClientRect", "(", "brNode", ")", "{", "var", "doc", "=", "brNode", ".", "ownerDocument", ",", "rng", "=", "createRange", "(", "doc", ")", ",", "nbsp", "=", "doc", ".", "createTextNode", "(", "'\\u00a0'", ")", ",", "parentNode", "=", "br...
Hack for older WebKit versions that doesn't support getBoundingClientRect on BR elements
[ "Hack", "for", "older", "WebKit", "versions", "that", "doesn", "t", "support", "getBoundingClientRect", "on", "BR", "elements" ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L15952-L15966
train
sadiqhabib/tinymce-dist
tinymce.full.js
CaretPosition
function CaretPosition(container, offset, clientRects) { function isAtStart() { if (isText(container)) { return offset === 0; } return offset === 0; } function isAtEnd() { if (isText(container)) { return offset >= container.data.length; } ...
javascript
function CaretPosition(container, offset, clientRects) { function isAtStart() { if (isText(container)) { return offset === 0; } return offset === 0; } function isAtEnd() { if (isText(container)) { return offset >= container.data.length; } ...
[ "function", "CaretPosition", "(", "container", ",", "offset", ",", "clientRects", ")", "{", "function", "isAtStart", "(", ")", "{", "if", "(", "isText", "(", "container", ")", ")", "{", "return", "offset", "===", "0", ";", "}", "return", "offset", "===",...
Represents a location within the document by a container and an offset. @constructor @param {Node} container Container node. @param {Number} offset Offset within that container node. @param {Array} clientRects Optional client rects array for the position.
[ "Represents", "a", "location", "within", "the", "document", "by", "a", "container", "and", "an", "offset", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L16097-L16221
train
sadiqhabib/tinymce-dist
tinymce.full.js
Selection
function Selection(dom, win, serializer, editor) { var self = this; self.dom = dom; self.win = win; self.serializer = serializer; self.editor = editor; self.bookmarkManager = new BookmarkManager(self); self.controlSelection = new ControlSelection(self, editor); // No W3...
javascript
function Selection(dom, win, serializer, editor) { var self = this; self.dom = dom; self.win = win; self.serializer = serializer; self.editor = editor; self.bookmarkManager = new BookmarkManager(self); self.controlSelection = new ControlSelection(self, editor); // No W3...
[ "function", "Selection", "(", "dom", ",", "win", ",", "serializer", ",", "editor", ")", "{", "var", "self", "=", "this", ";", "self", ".", "dom", "=", "dom", ";", "self", ".", "win", "=", "win", ";", "self", ".", "serializer", "=", "serializer", ";...
Constructs a new selection instance. @constructor @method Selection @param {tinymce.dom.DOMUtils} dom DOMUtils object reference. @param {Window} win Window to bind the selection object to. @param {tinymce.Editor} editor Editor instance of the selection. @param {tinymce.dom.Serializer} serializer DOM serialization clas...
[ "Constructs", "a", "new", "selection", "instance", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L17565-L17579
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (node, offset) { var self = this, rng = self.dom.createRng(); if (!node) { self._moveEndPoint(rng, self.editor.getBody(), true); self.setRng(rng); } else { rng.setStart(node, offset); rng.setEnd(node, offset); self.setRng(rng); ...
javascript
function (node, offset) { var self = this, rng = self.dom.createRng(); if (!node) { self._moveEndPoint(rng, self.editor.getBody(), true); self.setRng(rng); } else { rng.setStart(node, offset); rng.setEnd(node, offset); self.setRng(rng); ...
[ "function", "(", "node", ",", "offset", ")", "{", "var", "self", "=", "this", ",", "rng", "=", "self", ".", "dom", ".", "createRng", "(", ")", ";", "if", "(", "!", "node", ")", "{", "self", ".", "_moveEndPoint", "(", "rng", ",", "self", ".", "e...
Move the selection cursor range to the specified node and offset. If there is no node specified it will move it to the first suitable location within the body. @method setCursorLocation @param {Node} node Optional node to put the cursor in. @param {Number} offset Optional offset from the start of the node to put the c...
[ "Move", "the", "selection", "cursor", "range", "to", "the", "specified", "node", "and", "offset", ".", "If", "there", "is", "no", "node", "specified", "it", "will", "move", "it", "to", "the", "first", "suitable", "location", "within", "the", "body", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L17590-L17602
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (node, content) { var self = this, dom = self.dom, rng = dom.createRng(), idx; // Clear stored range set by FocusManager self.lastFocusBookmark = null; if (node) { if (!content && self.controlSelection.controlSelect(node)) { return; } ...
javascript
function (node, content) { var self = this, dom = self.dom, rng = dom.createRng(), idx; // Clear stored range set by FocusManager self.lastFocusBookmark = null; if (node) { if (!content && self.controlSelection.controlSelect(node)) { return; } ...
[ "function", "(", "node", ",", "content", ")", "{", "var", "self", "=", "this", ",", "dom", "=", "self", ".", "dom", ",", "rng", "=", "dom", ".", "createRng", "(", ")", ",", "idx", ";", "// Clear stored range set by FocusManager", "self", ".", "lastFocusB...
Selects the specified element. This will place the start and end of the selection range around the element. @method select @param {Element} node HTML DOM element to select. @param {Boolean} content Optional bool state if the contents should be selected or not on non IE browser. @return {Element} Selected element the s...
[ "Selects", "the", "specified", "element", ".", "This", "will", "place", "the", "start", "and", "end", "of", "the", "selection", "range", "around", "the", "element", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L17911-L17936
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (toStart) { var self = this, rng = self.getRng(), node; // Control range on IE if (rng.item) { node = rng.item(0); rng = self.win.document.body.createTextRange(); rng.moveToElementText(node); } rng.collapse(!!toStart); self.setRng(...
javascript
function (toStart) { var self = this, rng = self.getRng(), node; // Control range on IE if (rng.item) { node = rng.item(0); rng = self.win.document.body.createTextRange(); rng.moveToElementText(node); } rng.collapse(!!toStart); self.setRng(...
[ "function", "(", "toStart", ")", "{", "var", "self", "=", "this", ",", "rng", "=", "self", ".", "getRng", "(", ")", ",", "node", ";", "// Control range on IE", "if", "(", "rng", ".", "item", ")", "{", "node", "=", "rng", ".", "item", "(", "0", ")...
Collapse the selection to start or end of range. @method collapse @param {Boolean} toStart Optional boolean state if to collapse to end or not. Defaults to false.
[ "Collapse", "the", "selection", "to", "start", "or", "end", "of", "range", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L17965-L17977
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (w3c) { var self = this, selection, rng, elm, doc, ieRng, evt; function tryCompareBoundaryPoints(how, sourceRange, destinationRange) { try { return sourceRange.compareBoundaryPoints(how, destinationRange); } catch (ex) { // Gecko throws wrong documen...
javascript
function (w3c) { var self = this, selection, rng, elm, doc, ieRng, evt; function tryCompareBoundaryPoints(how, sourceRange, destinationRange) { try { return sourceRange.compareBoundaryPoints(how, destinationRange); } catch (ex) { // Gecko throws wrong documen...
[ "function", "(", "w3c", ")", "{", "var", "self", "=", "this", ",", "selection", ",", "rng", ",", "elm", ",", "doc", ",", "ieRng", ",", "evt", ";", "function", "tryCompareBoundaryPoints", "(", "how", ",", "sourceRange", ",", "destinationRange", ")", "{", ...
Returns the browsers internal range object. @method getRng @param {Boolean} w3c Forces a compatible W3C range on IE. @return {Range} Internal browser range object. @see http://www.quirksmode.org/dom/range_intro.html @see http://www.dotvoid.com/2001/03/using-the-range-object-in-mozilla/
[ "Returns", "the", "browsers", "internal", "range", "object", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L18000-L18110
train
sadiqhabib/tinymce-dist
tinymce.full.js
function () { var self = this, rng = self.getRng(), elm; var startContainer, endContainer, startOffset, endOffset, root = self.dom.getRoot(); function skipEmptyTextNodes(node, forwards) { var orig = node; while (node && node.nodeType === 3 && node.length === 0) { ...
javascript
function () { var self = this, rng = self.getRng(), elm; var startContainer, endContainer, startOffset, endOffset, root = self.dom.getRoot(); function skipEmptyTextNodes(node, forwards) { var orig = node; while (node && node.nodeType === 3 && node.length === 0) { ...
[ "function", "(", ")", "{", "var", "self", "=", "this", ",", "rng", "=", "self", ".", "getRng", "(", ")", ",", "elm", ";", "var", "startContainer", ",", "endContainer", ",", "startOffset", ",", "endOffset", ",", "root", "=", "self", ".", "dom", ".", ...
Returns the currently selected element or the common ancestor element for both start and end of the selection. @method getNode @return {Element} Currently selected element or common ancestor element. @example // Alerts the currently selected elements node name alert(tinymce.activeEditor.selection.getNode().nodeName);
[ "Returns", "the", "currently", "selected", "element", "or", "the", "common", "ancestor", "element", "for", "both", "start", "and", "end", "of", "the", "selection", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L18230-L18307
train
sadiqhabib/tinymce-dist
tinymce.full.js
getAttribs
function getAttribs(node) { var attribs = {}; each(dom.getAttribs(node), function (attr) { var name = attr.nodeName.toLowerCase(); // Don't compare internal attributes or style if (name.indexOf('_') !== 0 && name !== 'style' && name.indexOf('data-') !== 0) { ...
javascript
function getAttribs(node) { var attribs = {}; each(dom.getAttribs(node), function (attr) { var name = attr.nodeName.toLowerCase(); // Don't compare internal attributes or style if (name.indexOf('_') !== 0 && name !== 'style' && name.indexOf('data-') !== 0) { ...
[ "function", "getAttribs", "(", "node", ")", "{", "var", "attribs", "=", "{", "}", ";", "each", "(", "dom", ".", "getAttribs", "(", "node", ")", ",", "function", "(", "attr", ")", "{", "var", "name", "=", "attr", ".", "nodeName", ".", "toLowerCase", ...
Returns all the nodes attributes excluding internal ones, styles and classes. @private @param {Node} node Node to get attributes from. @return {Object} Name/value object with attributes and attribute values.
[ "Returns", "all", "the", "nodes", "attributes", "excluding", "internal", "ones", "styles", "and", "classes", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L18609-L18622
train
sadiqhabib/tinymce-dist
tinymce.full.js
compareObjects
function compareObjects(obj1, obj2) { var value, name; for (name in obj1) { // Obj1 has item obj2 doesn't have if (obj1.hasOwnProperty(name)) { value = obj2[name]; // Obj2 doesn't have obj1 item if (typeof value == "undefined") { ...
javascript
function compareObjects(obj1, obj2) { var value, name; for (name in obj1) { // Obj1 has item obj2 doesn't have if (obj1.hasOwnProperty(name)) { value = obj2[name]; // Obj2 doesn't have obj1 item if (typeof value == "undefined") { ...
[ "function", "compareObjects", "(", "obj1", ",", "obj2", ")", "{", "var", "value", ",", "name", ";", "for", "(", "name", "in", "obj1", ")", "{", "// Obj1 has item obj2 doesn't have", "if", "(", "obj1", ".", "hasOwnProperty", "(", "name", ")", ")", "{", "v...
Compares two objects checks if it's key + value exists in the other one. @private @param {Object} obj1 First object to compare. @param {Object} obj2 Second object to compare. @return {boolean} True/false if the objects matches or not.
[ "Compares", "two", "objects", "checks", "if", "it", "s", "key", "+", "value", "exists", "in", "the", "other", "one", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L18632-L18664
train
sadiqhabib/tinymce-dist
tinymce.full.js
process
function process(node) { var children, i, l, lastContentEditable, hasContentEditableState; // Node has a contentEditable value if (node.nodeType === 1 && getContentEditable(node)) { lastContentEditable = contentEditable; contentEditable = getContentEditable(node) =...
javascript
function process(node) { var children, i, l, lastContentEditable, hasContentEditableState; // Node has a contentEditable value if (node.nodeType === 1 && getContentEditable(node)) { lastContentEditable = contentEditable; contentEditable = getContentEditable(node) =...
[ "function", "process", "(", "node", ")", "{", "var", "children", ",", "i", ",", "l", ",", "lastContentEditable", ",", "hasContentEditableState", ";", "// Node has a contentEditable value", "if", "(", "node", ".", "nodeType", "===", "1", "&&", "getContentEditable",...
Merges the styles for each node
[ "Merges", "the", "styles", "for", "each", "node" ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L19936-L19970
train
sadiqhabib/tinymce-dist
tinymce.full.js
match
function match(name, vars, node) { var startNode; function matchParents(node) { var root = dom.getRoot(); if (node === root) { return false; } // Find first node with similar format settings node = dom.getParent(node, function (node) { ...
javascript
function match(name, vars, node) { var startNode; function matchParents(node) { var root = dom.getRoot(); if (node === root) { return false; } // Find first node with similar format settings node = dom.getParent(node, function (node) { ...
[ "function", "match", "(", "name", ",", "vars", ",", "node", ")", "{", "var", "startNode", ";", "function", "matchParents", "(", "node", ")", "{", "var", "root", "=", "dom", ".", "getRoot", "(", ")", ";", "if", "(", "node", "===", "root", ")", "{", ...
Matches the current selection or specified node against the specified format name. @method match @param {String} name Name of format to match. @param {Object} vars Optional list of variables to replace before checking it. @param {Node} node Optional node to check. @return {boolean} true/false if the specified selectio...
[ "Matches", "the", "current", "selection", "or", "specified", "node", "against", "the", "specified", "format", "name", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L20291-L20334
train
sadiqhabib/tinymce-dist
tinymce.full.js
formatChanged
function formatChanged(formats, callback, similar) { var currentFormats; // Setup format node change logic if (!formatChangeData) { formatChangeData = {}; currentFormats = {}; ed.on('NodeChange', function (e) { var parents = getParents(e.element), matc...
javascript
function formatChanged(formats, callback, similar) { var currentFormats; // Setup format node change logic if (!formatChangeData) { formatChangeData = {}; currentFormats = {}; ed.on('NodeChange', function (e) { var parents = getParents(e.element), matc...
[ "function", "formatChanged", "(", "formats", ",", "callback", ",", "similar", ")", "{", "var", "currentFormats", ";", "// Setup format node change logic", "if", "(", "!", "formatChangeData", ")", "{", "formatChangeData", "=", "{", "}", ";", "currentFormats", "=", ...
Executes the specified callback when the current selection matches the formats or not. @method formatChanged @param {String} formats Comma separated list of formats to check for. @param {function} callback Callback with state and args when the format is changed/toggled on/off. @param {Boolean} similar True/false state...
[ "Executes", "the", "specified", "callback", "when", "the", "current", "selection", "matches", "the", "formats", "or", "not", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L20408-L20471
train
sadiqhabib/tinymce-dist
tinymce.full.js
replaceVars
function replaceVars(value, vars) { if (typeof value != "string") { value = value(vars); } else if (vars) { value = value.replace(/%(\w+)/g, function (str, name) { return vars[name] || str; }); } return value; }
javascript
function replaceVars(value, vars) { if (typeof value != "string") { value = value(vars); } else if (vars) { value = value.replace(/%(\w+)/g, function (str, name) { return vars[name] || str; }); } return value; }
[ "function", "replaceVars", "(", "value", ",", "vars", ")", "{", "if", "(", "typeof", "value", "!=", "\"string\"", ")", "{", "value", "=", "value", "(", "vars", ")", ";", "}", "else", "if", "(", "vars", ")", "{", "value", "=", "value", ".", "replace...
Replaces variables in the value. The variable format is %var. @private @param {String} value Value to replace variables in. @param {Object} vars Name/value array with variables to replace. @return {String} New value with replaced variables.
[ "Replaces", "variables", "in", "the", "value", ".", "The", "variable", "format", "is", "%var", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L20640-L20650
train
sadiqhabib/tinymce-dist
tinymce.full.js
removeFormat
function removeFormat(format, vars, node, compareNode) { var i, attrs, stylesModified; // Check if node matches format if (!matchName(node, format) && !isColorFormatAndAnchor(node, format)) { return FALSE; } // Should we compare with format attribs and styles ...
javascript
function removeFormat(format, vars, node, compareNode) { var i, attrs, stylesModified; // Check if node matches format if (!matchName(node, format) && !isColorFormatAndAnchor(node, format)) { return FALSE; } // Should we compare with format attribs and styles ...
[ "function", "removeFormat", "(", "format", ",", "vars", ",", "node", ",", "compareNode", ")", "{", "var", "i", ",", "attrs", ",", "stylesModified", ";", "// Check if node matches format", "if", "(", "!", "matchName", "(", "node", ",", "format", ")", "&&", ...
Removes the specified format for the specified node. It will also remove the node if it doesn't have any attributes if the format specifies it to do so. @private @param {Object} format Format object with items to remove from node. @param {Object} vars Name/value object with variables to apply to format. @param {Node} ...
[ "Removes", "the", "specified", "format", "for", "the", "specified", "node", ".", "It", "will", "also", "remove", "the", "node", "if", "it", "doesn", "t", "have", "any", "attributes", "if", "the", "format", "specifies", "it", "to", "do", "so", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L21042-L21146
train
sadiqhabib/tinymce-dist
tinymce.full.js
createCaretContainer
function createCaretContainer(fill) { var caretContainer = dom.create('span', { id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : '' }); if (fill) { caretContainer.appendChild(ed.getDoc().createTextNode(INVISIBLE_CHAR)); } return caretContai...
javascript
function createCaretContainer(fill) { var caretContainer = dom.create('span', { id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : '' }); if (fill) { caretContainer.appendChild(ed.getDoc().createTextNode(INVISIBLE_CHAR)); } return caretContai...
[ "function", "createCaretContainer", "(", "fill", ")", "{", "var", "caretContainer", "=", "dom", ".", "create", "(", "'span'", ",", "{", "id", ":", "caretContainerId", ",", "'data-mce-bogus'", ":", "true", ",", "style", ":", "debug", "?", "'color:red'", ":", ...
Creates a caret container bogus element
[ "Creates", "a", "caret", "container", "bogus", "element" ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L21325-L21333
train
sadiqhabib/tinymce-dist
tinymce.full.js
getParentCaretContainer
function getParentCaretContainer(node) { while (node) { if (node.id === caretContainerId) { return node; } node = node.parentNode; } }
javascript
function getParentCaretContainer(node) { while (node) { if (node.id === caretContainerId) { return node; } node = node.parentNode; } }
[ "function", "getParentCaretContainer", "(", "node", ")", "{", "while", "(", "node", ")", "{", "if", "(", "node", ".", "id", "===", "caretContainerId", ")", "{", "return", "node", ";", "}", "node", "=", "node", ".", "parentNode", ";", "}", "}" ]
Returns any parent caret container element
[ "Returns", "any", "parent", "caret", "container", "element" ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L21353-L21361
train
sadiqhabib/tinymce-dist
tinymce.full.js
findFirstTextNode
function findFirstTextNode(node) { var walker; if (node) { walker = new TreeWalker(node, node); for (node = walker.current(); node; node = walker.next()) { if (node.nodeType === 3) { return node; } } } ...
javascript
function findFirstTextNode(node) { var walker; if (node) { walker = new TreeWalker(node, node); for (node = walker.current(); node; node = walker.next()) { if (node.nodeType === 3) { return node; } } } ...
[ "function", "findFirstTextNode", "(", "node", ")", "{", "var", "walker", ";", "if", "(", "node", ")", "{", "walker", "=", "new", "TreeWalker", "(", "node", ",", "node", ")", ";", "for", "(", "node", "=", "walker", ".", "current", "(", ")", ";", "no...
Finds the first text node in the specified node
[ "Finds", "the", "first", "text", "node", "in", "the", "specified", "node" ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L21364-L21376
train
sadiqhabib/tinymce-dist
tinymce.full.js
applyCaretFormat
function applyCaretFormat() { var rng, caretContainer, textNode, offset, bookmark, container, text; rng = selection.getRng(true); offset = rng.startOffset; container = rng.startContainer; text = container.nodeValue; caretContainer = getParentCaretContainer(s...
javascript
function applyCaretFormat() { var rng, caretContainer, textNode, offset, bookmark, container, text; rng = selection.getRng(true); offset = rng.startOffset; container = rng.startContainer; text = container.nodeValue; caretContainer = getParentCaretContainer(s...
[ "function", "applyCaretFormat", "(", ")", "{", "var", "rng", ",", "caretContainer", ",", "textNode", ",", "offset", ",", "bookmark", ",", "container", ",", "text", ";", "rng", "=", "selection", ".", "getRng", "(", "true", ")", ";", "offset", "=", "rng", ...
Applies formatting to the caret position
[ "Applies", "formatting", "to", "the", "caret", "position" ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L21424-L21472
train
sadiqhabib/tinymce-dist
tinymce.full.js
moveStart
function moveStart(rng) { var container = rng.startContainer, offset = rng.startOffset, isAtEndOfText, walker, node, nodes, tmpNode; if (rng.startContainer == rng.endContainer) { if (isInlineBlock(rng.startContainer.childNodes[rng.startOffset])) { return; ...
javascript
function moveStart(rng) { var container = rng.startContainer, offset = rng.startOffset, isAtEndOfText, walker, node, nodes, tmpNode; if (rng.startContainer == rng.endContainer) { if (isInlineBlock(rng.startContainer.childNodes[rng.startOffset])) { return; ...
[ "function", "moveStart", "(", "rng", ")", "{", "var", "container", "=", "rng", ".", "startContainer", ",", "offset", "=", "rng", ".", "startOffset", ",", "isAtEndOfText", ",", "walker", ",", "node", ",", "nodes", ",", "tmpNode", ";", "if", "(", "rng", ...
Moves the start to the first suitable text node.
[ "Moves", "the", "start", "to", "the", "first", "suitable", "text", "node", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L21627-L21673
train
sadiqhabib/tinymce-dist
tinymce.full.js
function () { var level; if (index < data.length - 1) { level = data[++index]; Levels.applyToEditor(editor, level, false); setDirty(true); editor.fire('redo', { level: level }); } return level; }
javascript
function () { var level; if (index < data.length - 1) { level = data[++index]; Levels.applyToEditor(editor, level, false); setDirty(true); editor.fire('redo', { level: level }); } return level; }
[ "function", "(", ")", "{", "var", "level", ";", "if", "(", "index", "<", "data", ".", "length", "-", "1", ")", "{", "level", "=", "data", "[", "++", "index", "]", ";", "Levels", ".", "applyToEditor", "(", "editor", ",", "level", ",", "false", ")"...
Redoes the last action. @method redo @return {Object} Redo level or null if no redo was performed.
[ "Redoes", "the", "last", "action", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L22297-L22308
train
sadiqhabib/tinymce-dist
tinymce.full.js
function () { data = []; index = 0; self.typing = false; self.data = data; editor.fire('ClearUndos'); }
javascript
function () { data = []; index = 0; self.typing = false; self.data = data; editor.fire('ClearUndos'); }
[ "function", "(", ")", "{", "data", "=", "[", "]", ";", "index", "=", "0", ";", "self", ".", "typing", "=", "false", ";", "self", ".", "data", "=", "data", ";", "editor", ".", "fire", "(", "'ClearUndos'", ")", ";", "}" ]
Removes all undo levels. @method clear
[ "Removes", "all", "undo", "levels", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L22315-L22321
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (callback1, callback2) { var lastLevel, bookmark; if (self.transact(callback1)) { bookmark = data[index].bookmark; lastLevel = data[index - 1]; Levels.applyToEditor(editor, lastLevel, true); if (self.transact(callback2)) { data...
javascript
function (callback1, callback2) { var lastLevel, bookmark; if (self.transact(callback1)) { bookmark = data[index].bookmark; lastLevel = data[index - 1]; Levels.applyToEditor(editor, lastLevel, true); if (self.transact(callback2)) { data...
[ "function", "(", "callback1", ",", "callback2", ")", "{", "var", "lastLevel", ",", "bookmark", ";", "if", "(", "self", ".", "transact", "(", "callback1", ")", ")", "{", "bookmark", "=", "data", "[", "index", "]", ".", "bookmark", ";", "lastLevel", "=",...
Adds an extra "hidden" undo level by first applying the first mutation and store that to the undo stack then roll back that change and do the second mutation on top of the stack. This will produce an extra undo level that the user doesn't see until they undo. @method extra @param {function} callback1 Function that doe...
[ "Adds", "an", "extra", "hidden", "undo", "level", "by", "first", "applying", "the", "first", "mutation", "and", "store", "that", "to", "the", "undo", "stack", "then", "roll", "back", "that", "change", "and", "do", "the", "second", "mutation", "on", "top", ...
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L22377-L22389
train
sadiqhabib/tinymce-dist
tinymce.full.js
execCommand
function execCommand(command, ui, value, args) { var func, customCommand, state = 0; if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(command) && (!args || !args.skip_focus)) { editor.focus(); } args = editor.fire('BeforeExecCommand', { command: co...
javascript
function execCommand(command, ui, value, args) { var func, customCommand, state = 0; if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(command) && (!args || !args.skip_focus)) { editor.focus(); } args = editor.fire('BeforeExecCommand', { command: co...
[ "function", "execCommand", "(", "command", ",", "ui", ",", "value", ",", "args", ")", "{", "var", "func", ",", "customCommand", ",", "state", "=", "0", ";", "if", "(", "!", "/", "^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$", "/", ".", "tes...
Executes the specified command. @method execCommand @param {String} command Command to execute. @param {Boolean} ui Optional user interface state. @param {Object} value Optional value for command. @param {Object} args Optional extra arguments to the execCommand. @return {Boolean} true/false if the command was found or...
[ "Executes", "the", "specified", "command", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L23593-L23644
train
sadiqhabib/tinymce-dist
tinymce.full.js
queryCommandState
function queryCommandState(command) { var func; // Is hidden then return undefined if (editor.quirks.isHidden()) { return; } command = command.toLowerCase(); if ((func = commands.state[command])) { return func(command); } // Browser ...
javascript
function queryCommandState(command) { var func; // Is hidden then return undefined if (editor.quirks.isHidden()) { return; } command = command.toLowerCase(); if ((func = commands.state[command])) { return func(command); } // Browser ...
[ "function", "queryCommandState", "(", "command", ")", "{", "var", "func", ";", "// Is hidden then return undefined", "if", "(", "editor", ".", "quirks", ".", "isHidden", "(", ")", ")", "{", "return", ";", "}", "command", "=", "command", ".", "toLowerCase", "...
Queries the current state for a command for example if the current selection is "bold". @method queryCommandState @param {String} command Command to check the state of. @return {Boolean/Number} true/false if the selected contents is bold or not, -1 if it's not found.
[ "Queries", "the", "current", "state", "for", "a", "command", "for", "example", "if", "the", "current", "selection", "is", "bold", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L23653-L23674
train
sadiqhabib/tinymce-dist
tinymce.full.js
function () { if (selection.isCollapsed()) { var elm = editor.dom.getParent(editor.selection.getStart(), 'a'); if (elm) { editor.dom.remove(elm, true); } return; } formatter.remove("link"); }
javascript
function () { if (selection.isCollapsed()) { var elm = editor.dom.getParent(editor.selection.getStart(), 'a'); if (elm) { editor.dom.remove(elm, true); } return; } formatter.remove("link"); }
[ "function", "(", ")", "{", "if", "(", "selection", ".", "isCollapsed", "(", ")", ")", "{", "var", "elm", "=", "editor", ".", "dom", ".", "getParent", "(", "editor", ".", "selection", ".", "getStart", "(", ")", ",", "'a'", ")", ";", "if", "(", "el...
Override unlink command
[ "Override", "unlink", "command" ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L23857-L23868
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (command) { var align = command.substring(7); if (align == 'full') { align = 'justify'; } // Remove all other alignments first each('left,center,right,justify'.split(','), function (name) { if (align != name) { formatter....
javascript
function (command) { var align = command.substring(7); if (align == 'full') { align = 'justify'; } // Remove all other alignments first each('left,center,right,justify'.split(','), function (name) { if (align != name) { formatter....
[ "function", "(", "command", ")", "{", "var", "align", "=", "command", ".", "substring", "(", "7", ")", ";", "if", "(", "align", "==", "'full'", ")", "{", "align", "=", "'justify'", ";", "}", "// Remove all other alignments first", "each", "(", "'left,cente...
Override justify commands to use the text formatter engine
[ "Override", "justify", "commands", "to", "use", "the", "text", "formatter", "engine" ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L23871-L23888
train
sadiqhabib/tinymce-dist
tinymce.full.js
hasRightSideContent
function hasRightSideContent() { var walker = new TreeWalker(container, parentBlock), node; var nonEmptyElementsMap = editor.schema.getNonEmptyElements(); while ((node = walker.next())) { if (nonEmptyElementsMap[node.nodeName.toLowerCase()] || node.length > 0) { ...
javascript
function hasRightSideContent() { var walker = new TreeWalker(container, parentBlock), node; var nonEmptyElementsMap = editor.schema.getNonEmptyElements(); while ((node = walker.next())) { if (nonEmptyElementsMap[node.nodeName.toLowerCase()] || node.length > 0) { ...
[ "function", "hasRightSideContent", "(", ")", "{", "var", "walker", "=", "new", "TreeWalker", "(", "container", ",", "parentBlock", ")", ",", "node", ";", "var", "nonEmptyElementsMap", "=", "editor", ".", "schema", ".", "getNonEmptyElements", "(", ")", ";", "...
Walks the parent block to the right and look for BR elements
[ "Walks", "the", "parent", "block", "to", "the", "right", "and", "look", "for", "BR", "elements" ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L24166-L24175
train
sadiqhabib/tinymce-dist
tinymce.full.js
URI
function URI(url, settings) { var self = this, baseUri, baseUrl; url = trim(url); settings = self.settings = settings || {}; baseUri = settings.base_uri; // Strange app protocol that isn't http/https or local anchor // For example: mailto,skype,tel etc. if (/^([\w\-]+):([^\/]...
javascript
function URI(url, settings) { var self = this, baseUri, baseUrl; url = trim(url); settings = self.settings = settings || {}; baseUri = settings.base_uri; // Strange app protocol that isn't http/https or local anchor // For example: mailto,skype,tel etc. if (/^([\w\-]+):([^\/]...
[ "function", "URI", "(", "url", ",", "settings", ")", "{", "var", "self", "=", "this", ",", "baseUri", ",", "baseUrl", ";", "url", "=", "trim", "(", "url", ")", ";", "settings", "=", "self", ".", "settings", "=", "settings", "||", "{", "}", ";", "...
Constructs a new URI instance. @constructor @method URI @param {String} url URI string to parse. @param {Object} settings Optional settings object.
[ "Constructs", "a", "new", "URI", "instance", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L24337-L24412
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (path) { var self = this; path = /^(.*?)\/?(\w+)?$/.exec(path); // Update path parts self.path = path[0]; self.directory = path[1]; self.file = path[2]; // Rebuild source self.source = ''; self.getURI(); }
javascript
function (path) { var self = this; path = /^(.*?)\/?(\w+)?$/.exec(path); // Update path parts self.path = path[0]; self.directory = path[1]; self.file = path[2]; // Rebuild source self.source = ''; self.getURI(); }
[ "function", "(", "path", ")", "{", "var", "self", "=", "this", ";", "path", "=", "/", "^(.*?)\\/?(\\w+)?$", "/", ".", "exec", "(", "path", ")", ";", "// Update path parts", "self", ".", "path", "=", "path", "[", "0", "]", ";", "self", ".", "directory...
Sets the internal path part of the URI. @method setPath @param {string} path Path string to set.
[ "Sets", "the", "internal", "path", "part", "of", "the", "URI", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L24421-L24434
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (uri) { var self = this, output; if (uri === "./") { return uri; } uri = new URI(uri, { base_uri: self }); // Not on same domain/port or protocol if ((uri.host != 'mce_host' && self.host != uri.host && uri.host) || self.port != uri.port || ...
javascript
function (uri) { var self = this, output; if (uri === "./") { return uri; } uri = new URI(uri, { base_uri: self }); // Not on same domain/port or protocol if ((uri.host != 'mce_host' && self.host != uri.host && uri.host) || self.port != uri.port || ...
[ "function", "(", "uri", ")", "{", "var", "self", "=", "this", ",", "output", ";", "if", "(", "uri", "===", "\"./\"", ")", "{", "return", "uri", ";", "}", "uri", "=", "new", "URI", "(", "uri", ",", "{", "base_uri", ":", "self", "}", ")", ";", ...
Converts the specified URI into a relative URI based on the current URI instance location. @method toRelative @param {String} uri URI to convert into a relative path/URI. @return {String} Relative URI from the point specified in the current URI instance. @example // Converts an absolute URL to an relative URL url will...
[ "Converts", "the", "specified", "URI", "into", "a", "relative", "URI", "based", "on", "the", "current", "URI", "instance", "location", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L24446-L24481
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (uri, noHost) { uri = new URI(uri, { base_uri: this }); return uri.getURI(noHost && this.isSameOrigin(uri)); }
javascript
function (uri, noHost) { uri = new URI(uri, { base_uri: this }); return uri.getURI(noHost && this.isSameOrigin(uri)); }
[ "function", "(", "uri", ",", "noHost", ")", "{", "uri", "=", "new", "URI", "(", "uri", ",", "{", "base_uri", ":", "this", "}", ")", ";", "return", "uri", ".", "getURI", "(", "noHost", "&&", "this", ".", "isSameOrigin", "(", "uri", ")", ")", ";", ...
Converts the specified URI into a absolute URI based on the current URI instance location. @method toAbsolute @param {String} uri URI to convert into a relative path/URI. @param {Boolean} noHost No host and protocol prefix. @return {String} Absolute URI from the point specified in the current URI instance. @example //...
[ "Converts", "the", "specified", "URI", "into", "a", "absolute", "URI", "based", "on", "the", "current", "URI", "instance", "location", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L24494-L24498
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (noProtoHost) { var s, self = this; // Rebuild source if (!self.source || noProtoHost) { s = ''; if (!noProtoHost) { if (self.protocol) { s += self.protocol + '://'; } else { s += '//'; } ...
javascript
function (noProtoHost) { var s, self = this; // Rebuild source if (!self.source || noProtoHost) { s = ''; if (!noProtoHost) { if (self.protocol) { s += self.protocol + '://'; } else { s += '//'; } ...
[ "function", "(", "noProtoHost", ")", "{", "var", "s", ",", "self", "=", "this", ";", "// Rebuild source", "if", "(", "!", "self", ".", "source", "||", "noProtoHost", ")", "{", "s", "=", "''", ";", "if", "(", "!", "noProtoHost", ")", "{", "if", "(",...
Returns the full URI of the internal structure. @method getURI @param {Boolean} noProtoHost Optional no host and protocol part. Defaults to false.
[ "Returns", "the", "full", "URI", "of", "the", "internal", "structure", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L24650-L24693
train
sadiqhabib/tinymce-dist
tinymce.full.js
fire
function fire(name, args) { var handlers, i, l, callback; name = name.toLowerCase(); args = args || {}; args.type = name; // Setup target is there isn't one if (!args.target) { args.target = scope; } // Add event delegation methods if they are...
javascript
function fire(name, args) { var handlers, i, l, callback; name = name.toLowerCase(); args = args || {}; args.type = name; // Setup target is there isn't one if (!args.target) { args.target = scope; } // Add event delegation methods if they are...
[ "function", "fire", "(", "name", ",", "args", ")", "{", "var", "handlers", ",", "i", ",", "l", ",", "callback", ";", "name", "=", "name", ".", "toLowerCase", "(", ")", ";", "args", "=", "args", "||", "{", "}", ";", "args", ".", "type", "=", "na...
Fires the specified event by name. @method fire @param {String} name Name of the event to fire. @param {Object?} args Event arguments. @return {Object} Event args instance passed in. @example instance.fire('event', {...});
[ "Fires", "the", "specified", "event", "by", "name", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L24968-L25032
train
sadiqhabib/tinymce-dist
tinymce.full.js
on
function on(name, callback, prepend, extra) { var handlers, names, i; if (callback === false) { callback = returnFalse; } if (callback) { callback = { func: callback }; if (extra) { Tools.extend(callback, extra); ...
javascript
function on(name, callback, prepend, extra) { var handlers, names, i; if (callback === false) { callback = returnFalse; } if (callback) { callback = { func: callback }; if (extra) { Tools.extend(callback, extra); ...
[ "function", "on", "(", "name", ",", "callback", ",", "prepend", ",", "extra", ")", "{", "var", "handlers", ",", "names", ",", "i", ";", "if", "(", "callback", "===", "false", ")", "{", "callback", "=", "returnFalse", ";", "}", "if", "(", "callback", ...
Binds an event listener to a specific event by name. @method on @param {String} name Event name or space separated list of events to bind. @param {callback} callback Callback to be executed when the event occurs. @param {Boolean} first Optional flag if the event should be prepended. Use this with care. @return {Object...
[ "Binds", "an", "event", "listener", "to", "a", "specific", "event", "by", "name", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L25047-L25082
train
sadiqhabib/tinymce-dist
tinymce.full.js
off
function off(name, callback) { var i, handlers, bindingName, names, hi; if (name) { names = name.toLowerCase().split(' '); i = names.length; while (i--) { name = names[i]; handlers = bindings[name]; // Unbind all handlers if...
javascript
function off(name, callback) { var i, handlers, bindingName, names, hi; if (name) { names = name.toLowerCase().split(' '); i = names.length; while (i--) { name = names[i]; handlers = bindings[name]; // Unbind all handlers if...
[ "function", "off", "(", "name", ",", "callback", ")", "{", "var", "i", ",", "handlers", ",", "bindingName", ",", "names", ",", "hi", ";", "if", "(", "name", ")", "{", "names", "=", "name", ".", "toLowerCase", "(", ")", ".", "split", "(", "' '", "...
Unbinds an event listener to a specific event by name. @method off @param {String?} name Name of the event to unbind. @param {callback?} callback Callback to unbind. @return {Object} Current class instance. @example // Unbind specific callback instance.off('event', handler); // Unbind all listeners by name instance.o...
[ "Unbinds", "an", "event", "listener", "to", "a", "specific", "event", "by", "name", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L25101-L25151
train
sadiqhabib/tinymce-dist
tinymce.full.js
once
function once(name, callback, prepend) { return on(name, callback, prepend, { once: true }); }
javascript
function once(name, callback, prepend) { return on(name, callback, prepend, { once: true }); }
[ "function", "once", "(", "name", ",", "callback", ",", "prepend", ")", "{", "return", "on", "(", "name", ",", "callback", ",", "prepend", ",", "{", "once", ":", "true", "}", ")", ";", "}" ]
Binds an event listener to a specific event by name and automatically unbind the event once the callback fires. @method once @param {String} name Event name or space separated list of events to bind. @param {callback} callback Callback to be executed when the event occurs. @param {Boolean} first Optional flag if the e...
[ "Binds", "an", "event", "listener", "to", "a", "specific", "event", "by", "name", "and", "automatically", "unbind", "the", "event", "once", "the", "callback", "fires", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L25167-L25169
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (data) { var name, value; data = data || {}; for (name in data) { value = data[name]; if (value instanceof Binding) { data[name] = value.create(this, name); } } this.data = data; }
javascript
function (data) { var name, value; data = data || {}; for (name in data) { value = data[name]; if (value instanceof Binding) { data[name] = value.create(this, name); } } this.data = data; }
[ "function", "(", "data", ")", "{", "var", "name", ",", "value", ";", "data", "=", "data", "||", "{", "}", ";", "for", "(", "name", "in", "data", ")", "{", "value", "=", "data", "[", "name", "]", ";", "if", "(", "value", "instanceof", "Binding", ...
Constructs a new observable object instance. @constructor @param {Object} data Initial data for the object.
[ "Constructs", "a", "new", "observable", "object", "instance", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L25522-L25536
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (name, value) { var key, args, oldValue = this.data[name]; if (value instanceof Binding) { value = value.create(this, name); } if (typeof name === "object") { for (key in name) { this.set(key, name[key]); } return this; ...
javascript
function (name, value) { var key, args, oldValue = this.data[name]; if (value instanceof Binding) { value = value.create(this, name); } if (typeof name === "object") { for (key in name) { this.set(key, name[key]); } return this; ...
[ "function", "(", "name", ",", "value", ")", "{", "var", "key", ",", "args", ",", "oldValue", "=", "this", ".", "data", "[", "name", "]", ";", "if", "(", "value", "instanceof", "Binding", ")", "{", "value", "=", "value", ".", "create", "(", "this", ...
Sets a property on the value this will call observers if the value is a change from the current value. @method set @param {String/object} name Name of the property to set or a object of items to set. @param {Object} value Value to set for the property. @return {tinymce.data.ObservableObject} Observable object instance...
[ "Sets", "a", "property", "on", "the", "value", "this", "will", "call", "observers", "if", "the", "value", "is", "a", "change", "from", "the", "current", "value", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L25547-L25577
train
sadiqhabib/tinymce-dist
tinymce.full.js
unique
function unique(array) { var uniqueItems = [], i = array.length, item; while (i--) { item = array[i]; if (!item.__checked) { uniqueItems.push(item); item.__checked = 1; } } i = uniqueItems.length; while (i--) { delete uniqueItems[i].__...
javascript
function unique(array) { var uniqueItems = [], i = array.length, item; while (i--) { item = array[i]; if (!item.__checked) { uniqueItems.push(item); item.__checked = 1; } } i = uniqueItems.length; while (i--) { delete uniqueItems[i].__...
[ "function", "unique", "(", "array", ")", "{", "var", "uniqueItems", "=", "[", "]", ",", "i", "=", "array", ".", "length", ",", "item", ";", "while", "(", "i", "--", ")", "{", "item", "=", "array", "[", "i", "]", ";", "if", "(", "!", "item", "...
Produces an array with a unique set of objects. It will not compare the values but the references of the objects. @private @method unqiue @param {Array} array Array to make into an array with unique items. @return {Array} Array with unique items.
[ "Produces", "an", "array", "with", "a", "unique", "set", "of", "objects", ".", "It", "will", "not", "compare", "the", "values", "but", "the", "references", "of", "the", "objects", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L25681-L25699
train
sadiqhabib/tinymce-dist
tinymce.full.js
parseChunks
function parseChunks(selector, selectors) { var parts = [], extra, matches, i; do { chunker.exec(""); matches = chunker.exec(selector); if (matches) { selector = matches[3]; parts.push(matches[1]); if (matches[2]) { ...
javascript
function parseChunks(selector, selectors) { var parts = [], extra, matches, i; do { chunker.exec(""); matches = chunker.exec(selector); if (matches) { selector = matches[3]; parts.push(matches[1]); if (matches[2]) { ...
[ "function", "parseChunks", "(", "selector", ",", "selectors", ")", "{", "var", "parts", "=", "[", "]", ",", "extra", ",", "matches", ",", "i", ";", "do", "{", "chunker", ".", "exec", "(", "\"\"", ")", ";", "matches", "=", "chunker", ".", "exec", "(...
Parser logic based on Sizzle by John Resig
[ "Parser", "logic", "based", "on", "Sizzle", "by", "John", "Resig" ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L25827-L25859
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (container) { var matches = [], i, l, selectors = this._selectors; function collect(items, selector, index) { var i, l, fi, fl, item, filters = selector[index]; for (i = 0, l = items.length; i < l; i++) { item = items[i]; // Run each filter against...
javascript
function (container) { var matches = [], i, l, selectors = this._selectors; function collect(items, selector, index) { var i, l, fi, fl, item, filters = selector[index]; for (i = 0, l = items.length; i < l; i++) { item = items[i]; // Run each filter against...
[ "function", "(", "container", ")", "{", "var", "matches", "=", "[", "]", ",", "i", ",", "l", ",", "selectors", "=", "this", ".", "_selectors", ";", "function", "collect", "(", "items", ",", "selector", ",", "index", ")", "{", "var", "i", ",", "l", ...
Returns a tinymce.ui.Collection with matches of the specified selector inside the specified container. @method find @param {tinymce.ui.Control} container Container to look for items in. @return {tinymce.ui.Collection} Collection with matched elements.
[ "Returns", "a", "tinymce", ".", "ui", ".", "Collection", "with", "matches", "of", "the", "specified", "selector", "inside", "the", "specified", "container", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L25935-L25992
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (items) { var self = this; // Force single item into array if (!Tools.isArray(items)) { if (items instanceof Collection) { self.add(items.toArray()); } else { push.call(self, items); } } else { push.apply(self, ite...
javascript
function (items) { var self = this; // Force single item into array if (!Tools.isArray(items)) { if (items instanceof Collection) { self.add(items.toArray()); } else { push.call(self, items); } } else { push.apply(self, ite...
[ "function", "(", "items", ")", "{", "var", "self", "=", "this", ";", "// Force single item into array", "if", "(", "!", "Tools", ".", "isArray", "(", "items", ")", ")", "{", "if", "(", "items", "instanceof", "Collection", ")", "{", "self", ".", "add", ...
Adds new items to the control collection. @method add @param {Array} items Array if items to add to collection. @return {tinymce.ui.Collection} Current collection instance.
[ "Adds", "new", "items", "to", "the", "control", "collection", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L26059-L26074
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (items) { var self = this, len = self.length, i; self.length = 0; self.add(items); // Remove old entries for (i = self.length; i < len; i++) { delete self[i]; } return self; }
javascript
function (items) { var self = this, len = self.length, i; self.length = 0; self.add(items); // Remove old entries for (i = self.length; i < len; i++) { delete self[i]; } return self; }
[ "function", "(", "items", ")", "{", "var", "self", "=", "this", ",", "len", "=", "self", ".", "length", ",", "i", ";", "self", ".", "length", "=", "0", ";", "self", ".", "add", "(", "items", ")", ";", "// Remove old entries", "for", "(", "i", "="...
Sets the contents of the collection. This will remove any existing items and replace them with the ones specified in the input array. @method set @param {Array} items Array with items to set into the Collection. @return {tinymce.ui.Collection} Collection instance.
[ "Sets", "the", "contents", "of", "the", "collection", ".", "This", "will", "remove", "any", "existing", "items", "and", "replace", "them", "with", "the", "ones", "specified", "in", "the", "input", "array", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L26084-L26096
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (selector) { var self = this, i, l, matches = [], item, match; // Compile string into selector expression if (typeof selector === "string") { selector = new Selector(selector); match = function (item) { return selector.match(item); }; ...
javascript
function (selector) { var self = this, i, l, matches = [], item, match; // Compile string into selector expression if (typeof selector === "string") { selector = new Selector(selector); match = function (item) { return selector.match(item); }; ...
[ "function", "(", "selector", ")", "{", "var", "self", "=", "this", ",", "i", ",", "l", ",", "matches", "=", "[", "]", ",", "item", ",", "match", ";", "// Compile string into selector expression", "if", "(", "typeof", "selector", "===", "\"string\"", ")", ...
Filters the collection item based on the specified selector expression or selector function. @method filter @param {String} selector Selector expression to filter items by. @return {tinymce.ui.Collection} Collection containing the filtered items.
[ "Filters", "the", "collection", "item", "based", "on", "the", "specified", "selector", "expression", "or", "selector", "function", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L26105-L26129
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (ctrl) { var self = this, i = self.length; while (i--) { if (self[i] === ctrl) { break; } } return i; }
javascript
function (ctrl) { var self = this, i = self.length; while (i--) { if (self[i] === ctrl) { break; } } return i; }
[ "function", "(", "ctrl", ")", "{", "var", "self", "=", "this", ",", "i", "=", "self", ".", "length", ";", "while", "(", "i", "--", ")", "{", "if", "(", "self", "[", "i", "]", "===", "ctrl", ")", "{", "break", ";", "}", "}", "return", "i", "...
Finds the index of the specified control or return -1 if it isn't in the collection. @method indexOf @param {Control} ctrl Control instance to look for. @return {Number} Index of the specified control or -1.
[ "Finds", "the", "index", "of", "the", "specified", "control", "or", "return", "-", "1", "if", "it", "isn", "t", "in", "the", "collection", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L26184-L26194
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (name) { var self = this, args = Tools.toArray(arguments).slice(1); self.each(function (item) { if (item[name]) { item[name].apply(item, args); } }); return self; }
javascript
function (name) { var self = this, args = Tools.toArray(arguments).slice(1); self.each(function (item) { if (item[name]) { item[name].apply(item, args); } }); return self; }
[ "function", "(", "name", ")", "{", "var", "self", "=", "this", ",", "args", "=", "Tools", ".", "toArray", "(", "arguments", ")", ".", "slice", "(", "1", ")", ";", "self", ".", "each", "(", "function", "(", "item", ")", "{", "if", "(", "item", "...
Executes the specific function name with optional arguments an all items in collection if it exists. @example collection.exec("myMethod", arg1, arg2, arg3); @method exec @param {String} name Name of the function to execute. @param {Object} ... Multiple arguments to pass to each function. @return {tinymce.ui.Collection...
[ "Executes", "the", "specific", "function", "name", "with", "optional", "arguments", "an", "all", "items", "in", "collection", "if", "it", "exists", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L26254-L26264
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (value) { var len, radix = 10; if (!value) { return; } if (typeof value === "number") { value = value || 0; return { top: value, left: value, bottom: value, right: value }; } ...
javascript
function (value) { var len, radix = 10; if (!value) { return; } if (typeof value === "number") { value = value || 0; return { top: value, left: value, bottom: value, right: value }; } ...
[ "function", "(", "value", ")", "{", "var", "len", ",", "radix", "=", "10", ";", "if", "(", "!", "value", ")", "{", "return", ";", "}", "if", "(", "typeof", "value", "===", "\"number\"", ")", "{", "value", "=", "value", "||", "0", ";", "return", ...
Parses the specified box value. A box value contains 1-4 properties in clockwise order. @method parseBox @param {String/Number} value Box value "0 1 2 3" or "0" etc. @return {Object} Object with top/right/bottom/left properties. @private
[ "Parses", "the", "specified", "box", "value", ".", "A", "box", "value", "contains", "1", "-", "4", "properties", "in", "clockwise", "order", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L26609-L26645
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (cls) { if (cls && !this.contains(cls)) { this.cls._map[cls] = true; this.cls.push(cls); this._change(); } return this; }
javascript
function (cls) { if (cls && !this.contains(cls)) { this.cls._map[cls] = true; this.cls.push(cls); this._change(); } return this; }
[ "function", "(", "cls", ")", "{", "if", "(", "cls", "&&", "!", "this", ".", "contains", "(", "cls", ")", ")", "{", "this", ".", "cls", ".", "_map", "[", "cls", "]", "=", "true", ";", "this", ".", "cls", ".", "push", "(", "cls", ")", ";", "t...
Adds a new class to the class list. @method add @param {String} cls Class to be added. @return {tinymce.ui.ClassList} Current class list instance.
[ "Adds", "a", "new", "class", "to", "the", "class", "list", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L26729-L26737
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (cls) { if (this.contains(cls)) { for (var i = 0; i < this.cls.length; i++) { if (this.cls[i] === cls) { break; } } this.cls.splice(i, 1); delete this.cls._map[cls]; this._change(); } return this; ...
javascript
function (cls) { if (this.contains(cls)) { for (var i = 0; i < this.cls.length; i++) { if (this.cls[i] === cls) { break; } } this.cls.splice(i, 1); delete this.cls._map[cls]; this._change(); } return this; ...
[ "function", "(", "cls", ")", "{", "if", "(", "this", ".", "contains", "(", "cls", ")", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "this", ".", "cls", ".", "length", ";", "i", "++", ")", "{", "if", "(", "this", ".", "cls", ...
Removes the specified class from the class list. @method remove @param {String} cls Class to be removed. @return {tinymce.ui.ClassList} Current class list instance.
[ "Removes", "the", "specified", "class", "from", "the", "class", "list", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L26746-L26760
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (cls, state) { var curState = this.contains(cls); if (curState !== state) { if (curState) { this.remove(cls); } else { this.add(cls); } this._change(); } return this; }
javascript
function (cls, state) { var curState = this.contains(cls); if (curState !== state) { if (curState) { this.remove(cls); } else { this.add(cls); } this._change(); } return this; }
[ "function", "(", "cls", ",", "state", ")", "{", "var", "curState", "=", "this", ".", "contains", "(", "cls", ")", ";", "if", "(", "curState", "!==", "state", ")", "{", "if", "(", "curState", ")", "{", "this", ".", "remove", "(", "cls", ")", ";", ...
Toggles a class in the class list. @method toggle @param {String} cls Class to be added/removed. @param {Boolean} state Optional state if it should be added/removed. @return {tinymce.ui.ClassList} Current class list instance.
[ "Toggles", "a", "class", "in", "the", "class", "list", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L26770-L26784
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (elm) { var ctrl, lookup = this.getRoot().controlIdLookup; while (elm && lookup) { ctrl = lookup[elm.id]; if (ctrl) { break; } elm = elm.parentNode; } return ctrl; }
javascript
function (elm) { var ctrl, lookup = this.getRoot().controlIdLookup; while (elm && lookup) { ctrl = lookup[elm.id]; if (ctrl) { break; } elm = elm.parentNode; } return ctrl; }
[ "function", "(", "elm", ")", "{", "var", "ctrl", ",", "lookup", "=", "this", ".", "getRoot", "(", ")", ".", "controlIdLookup", ";", "while", "(", "elm", "&&", "lookup", ")", "{", "ctrl", "=", "lookup", "[", "elm", ".", "id", "]", ";", "if", "(", ...
Returns a control instance for the current DOM element. @method getParentCtrl @param {Element} elm HTML dom element to get parent control from. @return {tinymce.ui.Control} Control instance or undefined.
[ "Returns", "a", "control", "instance", "for", "the", "current", "DOM", "element", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L27089-L27102
train
sadiqhabib/tinymce-dist
tinymce.full.js
function () { var self = this; self.parent()._lastRect = null; DomUtils.css(self.getEl(), { width: '', height: '' }); self._layoutRect = self._lastRepaintRect = self._lastLayoutRect = null; self.initLayoutRect(); }
javascript
function () { var self = this; self.parent()._lastRect = null; DomUtils.css(self.getEl(), { width: '', height: '' }); self._layoutRect = self._lastRepaintRect = self._lastLayoutRect = null; self.initLayoutRect(); }
[ "function", "(", ")", "{", "var", "self", "=", "this", ";", "self", ".", "parent", "(", ")", ".", "_lastRect", "=", "null", ";", "DomUtils", ".", "css", "(", "self", ".", "getEl", "(", ")", ",", "{", "width", ":", "''", ",", "height", ":", "''"...
Updates the controls layout rect by re-measuing it.
[ "Updates", "the", "controls", "layout", "rect", "by", "re", "-", "measuing", "it", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L27357-L27366
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (name, callback) { var self = this; function resolveCallbackName(name) { var callback, scope; if (typeof name != 'string') { return name; } return function (e) { if (!callback) { self.parentsAndSelf().each(function...
javascript
function (name, callback) { var self = this; function resolveCallbackName(name) { var callback, scope; if (typeof name != 'string') { return name; } return function (e) { if (!callback) { self.parentsAndSelf().each(function...
[ "function", "(", "name", ",", "callback", ")", "{", "var", "self", "=", "this", ";", "function", "resolveCallbackName", "(", "name", ")", "{", "var", "callback", ",", "scope", ";", "if", "(", "typeof", "name", "!=", "'string'", ")", "{", "return", "nam...
Binds a callback to the specified event. This event can both be native browser events like "click" or custom ones like PostRender. The callback function will be passed a DOM event like object that enables yout do stop propagation. @method on @param {String} name Name of the event to bind. For example "click". @param ...
[ "Binds", "a", "callback", "to", "the", "specified", "event", ".", "This", "event", "can", "both", "be", "native", "browser", "events", "like", "click", "or", "custom", "ones", "like", "PostRender", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L27379-L27414
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (selector) { var self = this, ctrl, parents = new Collection(); // Add each parent to collection for (ctrl = self.parent(); ctrl; ctrl = ctrl.parent()) { parents.add(ctrl); } // Filter away everything that doesn't match the selector if (selector) { ...
javascript
function (selector) { var self = this, ctrl, parents = new Collection(); // Add each parent to collection for (ctrl = self.parent(); ctrl; ctrl = ctrl.parent()) { parents.add(ctrl); } // Filter away everything that doesn't match the selector if (selector) { ...
[ "function", "(", "selector", ")", "{", "var", "self", "=", "this", ",", "ctrl", ",", "parents", "=", "new", "Collection", "(", ")", ";", "// Add each parent to collection", "for", "(", "ctrl", "=", "self", ".", "parent", "(", ")", ";", "ctrl", ";", "ct...
Returns a control collection with all parent controls. @method parents @param {String} selector Optional selector expression to find parents. @return {tinymce.ui.Collection} Collection with all parent controls.
[ "Returns", "a", "control", "collection", "with", "all", "parent", "controls", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L27482-L27496
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (suffix) { var id = suffix ? this._id + '-' + suffix : this._id; if (!this._elmCache[id]) { this._elmCache[id] = $('#' + id)[0]; } return this._elmCache[id]; }
javascript
function (suffix) { var id = suffix ? this._id + '-' + suffix : this._id; if (!this._elmCache[id]) { this._elmCache[id] = $('#' + id)[0]; } return this._elmCache[id]; }
[ "function", "(", "suffix", ")", "{", "var", "id", "=", "suffix", "?", "this", ".", "_id", "+", "'-'", "+", "suffix", ":", "this", ".", "_id", ";", "if", "(", "!", "this", ".", "_elmCache", "[", "id", "]", ")", "{", "this", ".", "_elmCache", "["...
Returns the control DOM element or sub element. @method getEl @param {String} [suffix] Suffix to get element by. @return {Element} HTML DOM element for the current control or it's children.
[ "Returns", "the", "control", "DOM", "element", "or", "sub", "element", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L27552-L27560
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (name, value) { var self = this, elm = self.getEl(self.ariaTarget); if (typeof value === "undefined") { return self._aria[name]; } self._aria[name] = value; if (self.state.get('rendered')) { elm.setAttribute(name == 'role' ? name : 'aria-' + name, ...
javascript
function (name, value) { var self = this, elm = self.getEl(self.ariaTarget); if (typeof value === "undefined") { return self._aria[name]; } self._aria[name] = value; if (self.state.get('rendered')) { elm.setAttribute(name == 'role' ? name : 'aria-' + name, ...
[ "function", "(", "name", ",", "value", ")", "{", "var", "self", "=", "this", ",", "elm", "=", "self", ".", "getEl", "(", "self", ".", "ariaTarget", ")", ";", "if", "(", "typeof", "value", "===", "\"undefined\"", ")", "{", "return", "self", ".", "_a...
Sets the specified aria property. @method aria @param {String} name Name of the aria property to set. @param {String} value Value of the aria property. @return {tinymce.ui.Control} Current control instance.
[ "Sets", "the", "specified", "aria", "property", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L27618-L27632
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (text, translate) { if (translate !== false) { text = this.translate(text); } return (text || '').replace(/[&<>"]/g, function (match) { return '&#' + match.charCodeAt(0) + ';'; }); }
javascript
function (text, translate) { if (translate !== false) { text = this.translate(text); } return (text || '').replace(/[&<>"]/g, function (match) { return '&#' + match.charCodeAt(0) + ';'; }); }
[ "function", "(", "text", ",", "translate", ")", "{", "if", "(", "translate", "!==", "false", ")", "{", "text", "=", "this", ".", "translate", "(", "text", ")", ";", "}", "return", "(", "text", "||", "''", ")", ".", "replace", "(", "/", "[&<>\"]", ...
Encodes the specified string with HTML entities. It will also translate the string to different languages. @method encode @param {String/Object/Array} text Text to entity encode. @param {Boolean} [translate=true] False if the contents shouldn't be translated. @return {String} Encoded and possible traslated string.
[ "Encodes", "the", "specified", "string", "with", "HTML", "entities", ".", "It", "will", "also", "translate", "the", "string", "to", "different", "languages", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L27643-L27651
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (items) { var self = this, parent = self.parent(); if (parent) { parent.insert(items, parent.items().indexOf(self), true); } return self; }
javascript
function (items) { var self = this, parent = self.parent(); if (parent) { parent.insert(items, parent.items().indexOf(self), true); } return self; }
[ "function", "(", "items", ")", "{", "var", "self", "=", "this", ",", "parent", "=", "self", ".", "parent", "(", ")", ";", "if", "(", "parent", ")", "{", "parent", ".", "insert", "(", "items", ",", "parent", ".", "items", "(", ")", ".", "indexOf",...
Adds items before the current control. @method before @param {Array/tinymce.ui.Collection} items Array of items to prepend before this control. @return {tinymce.ui.Control} Current control instance.
[ "Adds", "items", "before", "the", "current", "control", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L27671-L27679
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (align) { function getOffset(elm, rootElm) { var x, y, parent = elm; x = y = 0; while (parent && parent != rootElm && parent.nodeType) { x += parent.offsetLeft || 0; y += parent.offsetTop || 0; parent = parent.offsetParent; } ...
javascript
function (align) { function getOffset(elm, rootElm) { var x, y, parent = elm; x = y = 0; while (parent && parent != rootElm && parent.nodeType) { x += parent.offsetLeft || 0; y += parent.offsetTop || 0; parent = parent.offsetParent; } ...
[ "function", "(", "align", ")", "{", "function", "getOffset", "(", "elm", ",", "rootElm", ")", "{", "var", "x", ",", "y", ",", "parent", "=", "elm", ";", "x", "=", "y", "=", "0", ";", "while", "(", "parent", "&&", "parent", "!=", "rootElm", "&&", ...
Scrolls the current control into view. @method scrollIntoView @param {String} align Alignment in view top|center|bottom. @return {tinymce.ui.Control} Current control instance.
[ "Scrolls", "the", "current", "control", "into", "view", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L27888-L27925
train
sadiqhabib/tinymce-dist
tinymce.full.js
function () { ReflowQueue.remove(this); var parent = this.parent(); if (parent._layout && !parent._layout.isNative()) { parent.reflow(); } return this; }
javascript
function () { ReflowQueue.remove(this); var parent = this.parent(); if (parent._layout && !parent._layout.isNative()) { parent.reflow(); } return this; }
[ "function", "(", ")", "{", "ReflowQueue", ".", "remove", "(", "this", ")", ";", "var", "parent", "=", "this", ".", "parent", "(", ")", ";", "if", "(", "parent", ".", "_layout", "&&", "!", "parent", ".", "_layout", ".", "isNative", "(", ")", ")", ...
Reflows the current control and it's parents. This should be used after you for example append children to the current control so that the layout managers know that they need to reposition everything. @example container.append({type: 'button', text: 'My button'}).reflow(); @method reflow @return {tinymce.ui.Control} ...
[ "Reflows", "the", "current", "control", "and", "it", "s", "parents", ".", "This", "should", "be", "used", "after", "you", "for", "example", "append", "children", "to", "the", "current", "control", "so", "that", "the", "layout", "managers", "know", "that", ...
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L27964-L27973
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (type, settings) { var ControlType; // If string is specified then use it as the type if (typeof type == 'string') { settings = settings || {}; settings.type = type; } else { settings = type; type = settings.type; } // Fi...
javascript
function (type, settings) { var ControlType; // If string is specified then use it as the type if (typeof type == 'string') { settings = settings || {}; settings.type = type; } else { settings = type; type = settings.type; } // Fi...
[ "function", "(", "type", ",", "settings", ")", "{", "var", "ControlType", ";", "// If string is specified then use it as the type", "if", "(", "typeof", "type", "==", "'string'", ")", "{", "settings", "=", "settings", "||", "{", "}", ";", "settings", ".", "typ...
Creates a new control instance based on the settings provided. The instance created will be based on the specified type property it can also create whole structures of components out of the specified JSON object. @example tinymce.ui.Factory.create({ type: 'button', text: 'Hello world!' }); @method create @param {Obje...
[ "Creates", "a", "new", "control", "instance", "based", "on", "the", "settings", "provided", ".", "The", "instance", "created", "will", "be", "based", "on", "the", "specified", "type", "property", "it", "can", "also", "create", "whole", "structures", "of", "c...
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L28288-L28316
train
sadiqhabib/tinymce-dist
tinymce.full.js
getRole
function getRole(elm) { elm = elm || focusedElement; if (isElement(elm)) { return elm.getAttribute('role'); } return null; }
javascript
function getRole(elm) { elm = elm || focusedElement; if (isElement(elm)) { return elm.getAttribute('role'); } return null; }
[ "function", "getRole", "(", "elm", ")", "{", "elm", "=", "elm", "||", "focusedElement", ";", "if", "(", "isElement", "(", "elm", ")", ")", "{", "return", "elm", ".", "getAttribute", "(", "'role'", ")", ";", "}", "return", "null", ";", "}" ]
Returns the currently focused elements wai aria role of the currently focused element or specified element. @private @param {Element} elm Optional element to get role from. @return {String} Role of specified element.
[ "Returns", "the", "currently", "focused", "elements", "wai", "aria", "role", "of", "the", "currently", "focused", "element", "or", "specified", "element", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L28372-L28380
train
sadiqhabib/tinymce-dist
tinymce.full.js
getParentRole
function getParentRole(elm) { var role, parent = elm || focusedElement; while ((parent = parent.parentNode)) { if ((role = getRole(parent))) { return role; } } }
javascript
function getParentRole(elm) { var role, parent = elm || focusedElement; while ((parent = parent.parentNode)) { if ((role = getRole(parent))) { return role; } } }
[ "function", "getParentRole", "(", "elm", ")", "{", "var", "role", ",", "parent", "=", "elm", "||", "focusedElement", ";", "while", "(", "(", "parent", "=", "parent", ".", "parentNode", ")", ")", "{", "if", "(", "(", "role", "=", "getRole", "(", "pare...
Returns the wai role of the parent element of the currently focused element or specified element. @private @param {Element} elm Optional element to get parent role from. @return {String} Role of the first parent that has a role.
[ "Returns", "the", "wai", "role", "of", "the", "parent", "element", "of", "the", "currently", "focused", "element", "or", "specified", "element", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L28390-L28398
train
sadiqhabib/tinymce-dist
tinymce.full.js
getFocusElements
function getFocusElements(elm) { var elements = []; function collect(elm) { if (elm.nodeType != 1 || elm.style.display == 'none' || elm.disabled) { return; } if (canFocus(elm)) { elements.push(elm); } for (var i = 0; i < elm.ch...
javascript
function getFocusElements(elm) { var elements = []; function collect(elm) { if (elm.nodeType != 1 || elm.style.display == 'none' || elm.disabled) { return; } if (canFocus(elm)) { elements.push(elm); } for (var i = 0; i < elm.ch...
[ "function", "getFocusElements", "(", "elm", ")", "{", "var", "elements", "=", "[", "]", ";", "function", "collect", "(", "elm", ")", "{", "if", "(", "elm", ".", "nodeType", "!=", "1", "||", "elm", ".", "style", ".", "display", "==", "'none'", "||", ...
Returns an array of focusable visible elements within the specified container element. @private @param {Element} elm DOM element to find focusable elements within. @return {Array} Array of focusable elements.
[ "Returns", "an", "array", "of", "focusable", "visible", "elements", "within", "the", "specified", "container", "element", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L28456-L28476
train
sadiqhabib/tinymce-dist
tinymce.full.js
getNavigationRoot
function getNavigationRoot(targetControl) { var navigationRoot, controls; targetControl = targetControl || focusedControl; controls = targetControl.parents().toArray(); controls.unshift(targetControl); for (var i = 0; i < controls.length; i++) { navigationRoot = contr...
javascript
function getNavigationRoot(targetControl) { var navigationRoot, controls; targetControl = targetControl || focusedControl; controls = targetControl.parents().toArray(); controls.unshift(targetControl); for (var i = 0; i < controls.length; i++) { navigationRoot = contr...
[ "function", "getNavigationRoot", "(", "targetControl", ")", "{", "var", "navigationRoot", ",", "controls", ";", "targetControl", "=", "targetControl", "||", "focusedControl", ";", "controls", "=", "targetControl", ".", "parents", "(", ")", ".", "toArray", "(", "...
Returns the navigation root control for the specified control. The navigation root is the control that the keyboard navigation gets scoped to for example a menubar or toolbar group. It will look for parents of the specified target control or the currently focused control if this option is omitted. @private @param {tin...
[ "Returns", "the", "navigation", "root", "control", "for", "the", "specified", "control", ".", "The", "navigation", "root", "is", "the", "control", "that", "the", "keyboard", "navigation", "gets", "scoped", "to", "for", "example", "a", "menubar", "or", "toolbar...
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L28487-L28503
train
sadiqhabib/tinymce-dist
tinymce.full.js
focusFirst
function focusFirst(targetControl) { var navigationRoot = getNavigationRoot(targetControl); var focusElements = getFocusElements(navigationRoot.getEl()); if (navigationRoot.settings.ariaRemember && "lastAriaIndex" in navigationRoot) { moveFocusToIndex(navigationRoot.lastAriaIndex, foc...
javascript
function focusFirst(targetControl) { var navigationRoot = getNavigationRoot(targetControl); var focusElements = getFocusElements(navigationRoot.getEl()); if (navigationRoot.settings.ariaRemember && "lastAriaIndex" in navigationRoot) { moveFocusToIndex(navigationRoot.lastAriaIndex, foc...
[ "function", "focusFirst", "(", "targetControl", ")", "{", "var", "navigationRoot", "=", "getNavigationRoot", "(", "targetControl", ")", ";", "var", "focusElements", "=", "getFocusElements", "(", "navigationRoot", ".", "getEl", "(", ")", ")", ";", "if", "(", "n...
Focuses the first item in the specified targetControl element or the last aria index if the navigation root has the ariaRemember option enabled. @private @param {tinymce.ui.Control} targetControl Target control to focus the first item in.
[ "Focuses", "the", "first", "item", "in", "the", "specified", "targetControl", "element", "or", "the", "last", "aria", "index", "if", "the", "navigation", "root", "has", "the", "ariaRemember", "option", "enabled", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L28512-L28521
train
sadiqhabib/tinymce-dist
tinymce.full.js
moveFocusToIndex
function moveFocusToIndex(idx, elements) { if (idx < 0) { idx = elements.length - 1; } else if (idx >= elements.length) { idx = 0; } if (elements[idx]) { elements[idx].focus(); } return idx; }
javascript
function moveFocusToIndex(idx, elements) { if (idx < 0) { idx = elements.length - 1; } else if (idx >= elements.length) { idx = 0; } if (elements[idx]) { elements[idx].focus(); } return idx; }
[ "function", "moveFocusToIndex", "(", "idx", ",", "elements", ")", "{", "if", "(", "idx", "<", "0", ")", "{", "idx", "=", "elements", ".", "length", "-", "1", ";", "}", "else", "if", "(", "idx", ">=", "elements", ".", "length", ")", "{", "idx", "=...
Moves the focus to the specified index within the elements list. This will scope the index to the size of the element list if it changed. @private @param {Number} idx Specified index to move to. @param {Array} elements Array with dom elements to move focus within. @return {Number} Input index or a changed index if it ...
[ "Moves", "the", "focus", "to", "the", "specified", "index", "within", "the", "elements", "list", ".", "This", "will", "scope", "the", "index", "to", "the", "size", "of", "the", "element", "list", "if", "it", "changed", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L28532-L28544
train
sadiqhabib/tinymce-dist
tinymce.full.js
moveFocus
function moveFocus(dir, elements) { var idx = -1, navigationRoot = getNavigationRoot(); elements = elements || getFocusElements(navigationRoot.getEl()); for (var i = 0; i < elements.length; i++) { if (elements[i] === focusedElement) { idx = i; } } ...
javascript
function moveFocus(dir, elements) { var idx = -1, navigationRoot = getNavigationRoot(); elements = elements || getFocusElements(navigationRoot.getEl()); for (var i = 0; i < elements.length; i++) { if (elements[i] === focusedElement) { idx = i; } } ...
[ "function", "moveFocus", "(", "dir", ",", "elements", ")", "{", "var", "idx", "=", "-", "1", ",", "navigationRoot", "=", "getNavigationRoot", "(", ")", ";", "elements", "=", "elements", "||", "getFocusElements", "(", "navigationRoot", ".", "getEl", "(", ")...
Moves the focus forwards or backwards. @private @param {Number} dir Direction to move in positive means forward, negative means backwards. @param {Array} elements Optional array of elements to move within defaults to the current navigation roots elements.
[ "Moves", "the", "focus", "forwards", "or", "backwards", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L28553-L28566
train
sadiqhabib/tinymce-dist
tinymce.full.js
left
function left() { var parentRole = getParentRole(); if (parentRole == "tablist") { moveFocus(-1, getFocusElements(focusedElement.parentNode)); } else if (focusedControl.parent().submenu) { cancel(); } else { moveFocus(-1); } }
javascript
function left() { var parentRole = getParentRole(); if (parentRole == "tablist") { moveFocus(-1, getFocusElements(focusedElement.parentNode)); } else if (focusedControl.parent().submenu) { cancel(); } else { moveFocus(-1); } }
[ "function", "left", "(", ")", "{", "var", "parentRole", "=", "getParentRole", "(", ")", ";", "if", "(", "parentRole", "==", "\"tablist\"", ")", "{", "moveFocus", "(", "-", "1", ",", "getFocusElements", "(", "focusedElement", ".", "parentNode", ")", ")", ...
Moves the focus to the left this is called by the left key. @private
[ "Moves", "the", "focus", "to", "the", "left", "this", "is", "called", "by", "the", "left", "key", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L28573-L28583
train
sadiqhabib/tinymce-dist
tinymce.full.js
right
function right() { var role = getRole(), parentRole = getParentRole(); if (parentRole == "tablist") { moveFocus(1, getFocusElements(focusedElement.parentNode)); } else if (role == "menuitem" && parentRole == "menu" && getAriaProp('haspopup')) { enter(); } else { ...
javascript
function right() { var role = getRole(), parentRole = getParentRole(); if (parentRole == "tablist") { moveFocus(1, getFocusElements(focusedElement.parentNode)); } else if (role == "menuitem" && parentRole == "menu" && getAriaProp('haspopup')) { enter(); } else { ...
[ "function", "right", "(", ")", "{", "var", "role", "=", "getRole", "(", ")", ",", "parentRole", "=", "getParentRole", "(", ")", ";", "if", "(", "parentRole", "==", "\"tablist\"", ")", "{", "moveFocus", "(", "1", ",", "getFocusElements", "(", "focusedElem...
Moves the focus to the right this is called by the right key. @private
[ "Moves", "the", "focus", "to", "the", "right", "this", "is", "called", "by", "the", "right", "key", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L28590-L28600
train
sadiqhabib/tinymce-dist
tinymce.full.js
down
function down() { var role = getRole(), parentRole = getParentRole(); if (role == "menuitem" && parentRole == "menubar") { enter(); } else if (role == "button" && getAriaProp('haspopup')) { enter({ key: 'down' }); } else { moveFocus(1); } }
javascript
function down() { var role = getRole(), parentRole = getParentRole(); if (role == "menuitem" && parentRole == "menubar") { enter(); } else if (role == "button" && getAriaProp('haspopup')) { enter({ key: 'down' }); } else { moveFocus(1); } }
[ "function", "down", "(", ")", "{", "var", "role", "=", "getRole", "(", ")", ",", "parentRole", "=", "getParentRole", "(", ")", ";", "if", "(", "role", "==", "\"menuitem\"", "&&", "parentRole", "==", "\"menubar\"", ")", "{", "enter", "(", ")", ";", "}...
Moves the focus to the up this is called by the down key. @private
[ "Moves", "the", "focus", "to", "the", "up", "this", "is", "called", "by", "the", "down", "key", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L28616-L28626
train
sadiqhabib/tinymce-dist
tinymce.full.js
tab
function tab(e) { var parentRole = getParentRole(); if (parentRole == "tablist") { var elm = getFocusElements(focusedControl.getEl('body'))[0]; if (elm) { elm.focus(); } } else { moveFocus(e.shiftKey ? -1 : 1); } }
javascript
function tab(e) { var parentRole = getParentRole(); if (parentRole == "tablist") { var elm = getFocusElements(focusedControl.getEl('body'))[0]; if (elm) { elm.focus(); } } else { moveFocus(e.shiftKey ? -1 : 1); } }
[ "function", "tab", "(", "e", ")", "{", "var", "parentRole", "=", "getParentRole", "(", ")", ";", "if", "(", "parentRole", "==", "\"tablist\"", ")", "{", "var", "elm", "=", "getFocusElements", "(", "focusedControl", ".", "getEl", "(", "'body'", ")", ")", ...
Moves the focus to the next item or previous item depending on shift key. @private @param {DOMEvent} e DOM event object.
[ "Moves", "the", "focus", "to", "the", "next", "item", "or", "previous", "item", "depending", "on", "shift", "key", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L28634-L28646
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (selector) { selector = selectorCache[selector] = selectorCache[selector] || new Selector(selector); return selector.find(this); }
javascript
function (selector) { selector = selectorCache[selector] = selectorCache[selector] || new Selector(selector); return selector.find(this); }
[ "function", "(", "selector", ")", "{", "selector", "=", "selectorCache", "[", "selector", "]", "=", "selectorCache", "[", "selector", "]", "||", "new", "Selector", "(", "selector", ")", ";", "return", "selector", ".", "find", "(", "this", ")", ";", "}" ]
Find child controls by selector. @method find @param {String} selector Selector CSS pattern to find children by. @return {tinymce.ui.Collection} Control collection with child controls.
[ "Find", "child", "controls", "by", "selector", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L28840-L28844
train
sadiqhabib/tinymce-dist
tinymce.full.js
function (items) { var self = this; self.items().add(self.create(items)).parent(self); return self; }
javascript
function (items) { var self = this; self.items().add(self.create(items)).parent(self); return self; }
[ "function", "(", "items", ")", "{", "var", "self", "=", "this", ";", "self", ".", "items", "(", ")", ".", "add", "(", "self", ".", "create", "(", "items", ")", ")", ".", "parent", "(", "self", ")", ";", "return", "self", ";", "}" ]
Adds one or many items to the current container. This will create instances of the object representations if needed. @method add @param {Array/Object/tinymce.ui.Control} items Array or item that will be added to the container. @return {tinymce.ui.Collection} Current collection control.
[ "Adds", "one", "or", "many", "items", "to", "the", "current", "container", ".", "This", "will", "create", "instances", "of", "the", "object", "representations", "if", "needed", "." ]
3acf1e4fe83a541988fdca20f2aaf4e6dce72512
https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L28854-L28860
train