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 (keyboard) {
var self = this, focusCtrl, keyboardNav, items;
if (keyboard) {
keyboardNav = self.keyboardNav || self.parents().eq(-1)[0].keyboardNav;
if (keyboardNav) {
keyboardNav.focusFirst(self);
return;
}
}
items = self... | javascript | function (keyboard) {
var self = this, focusCtrl, keyboardNav, items;
if (keyboard) {
keyboardNav = self.keyboardNav || self.parents().eq(-1)[0].keyboardNav;
if (keyboardNav) {
keyboardNav.focusFirst(self);
return;
}
}
items = self... | [
"function",
"(",
"keyboard",
")",
"{",
"var",
"self",
"=",
"this",
",",
"focusCtrl",
",",
"keyboardNav",
",",
"items",
";",
"if",
"(",
"keyboard",
")",
"{",
"keyboardNav",
"=",
"self",
".",
"keyboardNav",
"||",
"self",
".",
"parents",
"(",
")",
".",
... | Focuses the current container instance. This will look
for the first control in the container and focus that.
@method focus
@param {Boolean} keyboard Optional true/false if the focus was a keyboard focus or not.
@return {tinymce.ui.Collection} Current instance. | [
"Focuses",
"the",
"current",
"container",
"instance",
".",
"This",
"will",
"look",
"for",
"the",
"first",
"control",
"in",
"the",
"container",
"and",
"focus",
"that",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L28870-L28905 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (oldItem, newItem) {
var ctrlElm, items = this.items(), i = items.length;
// Replace the item in collection
while (i--) {
if (items[i] === oldItem) {
items[i] = newItem;
break;
}
}
if (i >= 0) {
// Remove new item f... | javascript | function (oldItem, newItem) {
var ctrlElm, items = this.items(), i = items.length;
// Replace the item in collection
while (i--) {
if (items[i] === oldItem) {
items[i] = newItem;
break;
}
}
if (i >= 0) {
// Remove new item f... | [
"function",
"(",
"oldItem",
",",
"newItem",
")",
"{",
"var",
"ctrlElm",
",",
"items",
"=",
"this",
".",
"items",
"(",
")",
",",
"i",
"=",
"items",
".",
"length",
";",
"// Replace the item in collection",
"while",
"(",
"i",
"--",
")",
"{",
"if",
"(",
... | Replaces the specified child control with a new control.
@method replace
@param {tinymce.ui.Control} oldItem Old item to be replaced.
@param {tinymce.ui.Control} newItem New item to be inserted. | [
"Replaces",
"the",
"specified",
"child",
"control",
"with",
"a",
"new",
"control",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L28914-L28941 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (items) {
var self = this, settings, ctrlItems = [];
// Non array structure, then force it into an array
if (!Tools.isArray(items)) {
items = [items];
}
// Add default type to each child control
Tools.each(items, function (item) {
if (item) ... | javascript | function (items) {
var self = this, settings, ctrlItems = [];
// Non array structure, then force it into an array
if (!Tools.isArray(items)) {
items = [items];
}
// Add default type to each child control
Tools.each(items, function (item) {
if (item) ... | [
"function",
"(",
"items",
")",
"{",
"var",
"self",
"=",
"this",
",",
"settings",
",",
"ctrlItems",
"=",
"[",
"]",
";",
"// Non array structure, then force it into an array",
"if",
"(",
"!",
"Tools",
".",
"isArray",
"(",
"items",
")",
")",
"{",
"items",
"="... | Creates the specified items. If any of the items is plain JSON style objects
it will convert these into real tinymce.ui.Control instances.
@method create
@param {Array} items Array of items to convert into control instances.
@return {Array} Array with control instances. | [
"Creates",
"the",
"specified",
"items",
".",
"If",
"any",
"of",
"the",
"items",
"is",
"plain",
"JSON",
"style",
"objects",
"it",
"will",
"convert",
"these",
"into",
"real",
"tinymce",
".",
"ui",
".",
"Control",
"instances",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L28951-L28981 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function () {
var self = this;
// Render any new items
self.items().each(function (ctrl, index) {
var containerElm;
ctrl.parent(self);
if (!ctrl.state.get('rendered')) {
containerElm = self.getEl('body');
// Insert or append the item
... | javascript | function () {
var self = this;
// Render any new items
self.items().each(function (ctrl, index) {
var containerElm;
ctrl.parent(self);
if (!ctrl.state.get('rendered')) {
containerElm = self.getEl('body');
// Insert or append the item
... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"// Render any new items",
"self",
".",
"items",
"(",
")",
".",
"each",
"(",
"function",
"(",
"ctrl",
",",
"index",
")",
"{",
"var",
"containerElm",
";",
"ctrl",
".",
"parent",
"(",
"self",
... | Renders new control instances.
@private | [
"Renders",
"new",
"control",
"instances",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L28988-L29016 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (items) {
var self = this;
self.items().set(self.create(items).concat(self.items().toArray()));
return self.renderNew();
} | javascript | function (items) {
var self = this;
self.items().set(self.create(items).concat(self.items().toArray()));
return self.renderNew();
} | [
"function",
"(",
"items",
")",
"{",
"var",
"self",
"=",
"this",
";",
"self",
".",
"items",
"(",
")",
".",
"set",
"(",
"self",
".",
"create",
"(",
"items",
")",
".",
"concat",
"(",
"self",
".",
"items",
"(",
")",
".",
"toArray",
"(",
")",
")",
... | Prepends new instances to the current container.
@method prepend
@param {Array/tinymce.ui.Collection} items Array if controls to prepend.
@return {tinymce.ui.Container} Current container instance. | [
"Prepends",
"new",
"instances",
"to",
"the",
"current",
"container",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L29036-L29042 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (items, index, before) {
var self = this, curItems, beforeItems, afterItems;
items = self.create(items);
curItems = self.items();
if (!before && index < curItems.length - 1) {
index += 1;
}
if (index >= 0 && index < curItems.length) {
befor... | javascript | function (items, index, before) {
var self = this, curItems, beforeItems, afterItems;
items = self.create(items);
curItems = self.items();
if (!before && index < curItems.length - 1) {
index += 1;
}
if (index >= 0 && index < curItems.length) {
befor... | [
"function",
"(",
"items",
",",
"index",
",",
"before",
")",
"{",
"var",
"self",
"=",
"this",
",",
"curItems",
",",
"beforeItems",
",",
"afterItems",
";",
"items",
"=",
"self",
".",
"create",
"(",
"items",
")",
";",
"curItems",
"=",
"self",
".",
"item... | Inserts an control at a specific index.
@method insert
@param {Array/tinymce.ui.Collection} items Array if controls to insert.
@param {Number} index Index to insert controls at.
@param {Boolean} [before=false] Inserts controls before the index. | [
"Inserts",
"an",
"control",
"at",
"a",
"specific",
"index",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L29052-L29069 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (data) {
var self = this;
for (var name in data) {
self.find('#' + name).value(data[name]);
}
return self;
} | javascript | function (data) {
var self = this;
for (var name in data) {
self.find('#' + name).value(data[name]);
}
return self;
} | [
"function",
"(",
"data",
")",
"{",
"var",
"self",
"=",
"this",
";",
"for",
"(",
"var",
"name",
"in",
"data",
")",
"{",
"self",
".",
"find",
"(",
"'#'",
"+",
"name",
")",
".",
"value",
"(",
"data",
"[",
"name",
"]",
")",
";",
"}",
"return",
"s... | Populates the form fields from the specified JSON data object.
Control items in the form that matches the data will have it's value set.
@method fromJSON
@param {Object} data JSON data object to set control values by.
@return {tinymce.ui.Container} Current form instance. | [
"Populates",
"the",
"form",
"fields",
"from",
"the",
"specified",
"JSON",
"data",
"object",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L29080-L29088 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function () {
var self = this, data = {};
self.find('*').each(function (ctrl) {
var name = ctrl.name(), value = ctrl.value();
if (name && typeof value != "undefined") {
data[name] = value;
}
});
return data;
} | javascript | function () {
var self = this, data = {};
self.find('*').each(function (ctrl) {
var name = ctrl.name(), value = ctrl.value();
if (name && typeof value != "undefined") {
data[name] = value;
}
});
return data;
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
",",
"data",
"=",
"{",
"}",
";",
"self",
".",
"find",
"(",
"'*'",
")",
".",
"each",
"(",
"function",
"(",
"ctrl",
")",
"{",
"var",
"name",
"=",
"ctrl",
".",
"name",
"(",
")",
",",
"value"... | Serializes the form into a JSON object by getting all items
that has a name and a value.
@method toJSON
@return {Object} JSON object with form data. | [
"Serializes",
"the",
"form",
"into",
"a",
"JSON",
"object",
"by",
"getting",
"all",
"items",
"that",
"has",
"a",
"name",
"and",
"a",
"value",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L29097-L29109 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function () {
var i;
ReflowQueue.remove(this);
if (this.visible()) {
Control.repaintControls = [];
Control.repaintControls.map = {};
this.recalc();
i = Control.repaintControls.length;
while (i--) {
Control.repaintControls[i].repai... | javascript | function () {
var i;
ReflowQueue.remove(this);
if (this.visible()) {
Control.repaintControls = [];
Control.repaintControls.map = {};
this.recalc();
i = Control.repaintControls.length;
while (i--) {
Control.repaintControls[i].repai... | [
"function",
"(",
")",
"{",
"var",
"i",
";",
"ReflowQueue",
".",
"remove",
"(",
"this",
")",
";",
"if",
"(",
"this",
".",
"visible",
"(",
")",
")",
"{",
"Control",
".",
"repaintControls",
"=",
"[",
"]",
";",
"Control",
".",
"repaintControls",
".",
"... | Reflows the current container and it's children and possible 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
@retu... | [
"Reflows",
"the",
"current",
"container",
"and",
"it",
"s",
"children",
"and",
"possible",
"parents",
".",
"This",
"should",
"be",
"used",
"after",
"you",
"for",
"example",
"append",
"children",
"to",
"the",
"current",
"control",
"so",
"that",
"the",
"layout... | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L29215-L29240 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (elm, rel) {
if (typeof rel != 'string') {
rel = this.testMoveRel(elm, rel);
}
var pos = calculateRelativePosition(this, elm, rel);
return this.moveTo(pos.x, pos.y);
} | javascript | function (elm, rel) {
if (typeof rel != 'string') {
rel = this.testMoveRel(elm, rel);
}
var pos = calculateRelativePosition(this, elm, rel);
return this.moveTo(pos.x, pos.y);
} | [
"function",
"(",
"elm",
",",
"rel",
")",
"{",
"if",
"(",
"typeof",
"rel",
"!=",
"'string'",
")",
"{",
"rel",
"=",
"this",
".",
"testMoveRel",
"(",
"elm",
",",
"rel",
")",
";",
"}",
"var",
"pos",
"=",
"calculateRelativePosition",
"(",
"this",
",",
"... | Move relative to the specified element.
@method moveRel
@param {Element} elm Element to move relative to.
@param {String} rel Relative mode. For example: br-tl.
@return {tinymce.ui.Control} Current control instance. | [
"Move",
"relative",
"to",
"the",
"specified",
"element",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L29741-L29748 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (dx, dy) {
var self = this, rect = self.layoutRect();
self.moveTo(rect.x + dx, rect.y + dy);
return self;
} | javascript | function (dx, dy) {
var self = this, rect = self.layoutRect();
self.moveTo(rect.x + dx, rect.y + dy);
return self;
} | [
"function",
"(",
"dx",
",",
"dy",
")",
"{",
"var",
"self",
"=",
"this",
",",
"rect",
"=",
"self",
".",
"layoutRect",
"(",
")",
";",
"self",
".",
"moveTo",
"(",
"rect",
".",
"x",
"+",
"dx",
",",
"rect",
".",
"y",
"+",
"dy",
")",
";",
"return",... | Move by a relative x, y values.
@method moveBy
@param {Number} dx Relative x position.
@param {Number} dy Relative y position.
@return {tinymce.ui.Control} Current control instance. | [
"Move",
"by",
"a",
"relative",
"x",
"y",
"values",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L29758-L29764 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (x, y) {
var self = this;
// TODO: Move this to some global class
function constrain(value, max, size) {
if (value < 0) {
return 0;
}
if (value + size > max) {
value = max - size;
return value < 0 ? 0 : value;
... | javascript | function (x, y) {
var self = this;
// TODO: Move this to some global class
function constrain(value, max, size) {
if (value < 0) {
return 0;
}
if (value + size > max) {
value = max - size;
return value < 0 ? 0 : value;
... | [
"function",
"(",
"x",
",",
"y",
")",
"{",
"var",
"self",
"=",
"this",
";",
"// TODO: Move this to some global class",
"function",
"constrain",
"(",
"value",
",",
"max",
",",
"size",
")",
"{",
"if",
"(",
"value",
"<",
"0",
")",
"{",
"return",
"0",
";",
... | Move to absolute position.
@method moveTo
@param {Number} x Absolute x position.
@param {Number} y Absolute y position.
@return {tinymce.ui.Control} Current control instance. | [
"Move",
"to",
"absolute",
"position",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L29774-L29809 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | repositionPanel | function repositionPanel(panel) {
var scrollY = DomUtils.getViewPort().y;
function toggleFixedChildPanels(fixed, deltaY) {
var parent;
for (var i = 0; i < visiblePanels.length; i++) {
if (visiblePanels[i] != panel) {
parent = visiblePanels[i].parent();
wh... | javascript | function repositionPanel(panel) {
var scrollY = DomUtils.getViewPort().y;
function toggleFixedChildPanels(fixed, deltaY) {
var parent;
for (var i = 0; i < visiblePanels.length; i++) {
if (visiblePanels[i] != panel) {
parent = visiblePanels[i].parent();
wh... | [
"function",
"repositionPanel",
"(",
"panel",
")",
"{",
"var",
"scrollY",
"=",
"DomUtils",
".",
"getViewPort",
"(",
")",
".",
"y",
";",
"function",
"toggleFixedChildPanels",
"(",
"fixed",
",",
"deltaY",
")",
"{",
"var",
"parent",
";",
"for",
"(",
"var",
"... | Repositions the panel to the top of page if the panel is outside of the visual viewport. It will
also reposition all child panels of the current panel. | [
"Repositions",
"the",
"panel",
"to",
"the",
"top",
"of",
"page",
"if",
"the",
"panel",
"is",
"outside",
"of",
"the",
"visual",
"viewport",
".",
"It",
"will",
"also",
"reposition",
"all",
"child",
"panels",
"of",
"the",
"current",
"panel",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L30005-L30039 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | function () {
var self = this, i, state = self._super();
i = visiblePanels.length;
while (i--) {
if (visiblePanels[i] === self) {
break;
}
}
if (i === -1) {
visiblePanels.push(self);
}
return state;
} | javascript | function () {
var self = this, i, state = self._super();
i = visiblePanels.length;
while (i--) {
if (visiblePanels[i] === self) {
break;
}
}
if (i === -1) {
visiblePanels.push(self);
}
return state;
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
",",
"i",
",",
"state",
"=",
"self",
".",
"_super",
"(",
")",
";",
"i",
"=",
"visiblePanels",
".",
"length",
";",
"while",
"(",
"i",
"--",
")",
"{",
"if",
"(",
"visiblePanels",
"[",
"i",
"]... | Shows the current float panel.
@method show
@return {tinymce.ui.FloatPanel} Current floatpanel instance. | [
"Shows",
"the",
"current",
"float",
"panel",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L30184-L30199 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function () {
var self = this;
if (!self.fire('close').isDefaultPrevented()) {
self.remove();
addRemove(false, self);
}
return self;
} | javascript | function () {
var self = this;
if (!self.fire('close').isDefaultPrevented()) {
self.remove();
addRemove(false, self);
}
return self;
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"!",
"self",
".",
"fire",
"(",
"'close'",
")",
".",
"isDefaultPrevented",
"(",
")",
")",
"{",
"self",
".",
"remove",
"(",
")",
";",
"addRemove",
"(",
"false",
",",
"self",
")"... | Closes the float panel. This will remove the float panel from page and fire the close event.
@method close | [
"Closes",
"the",
"float",
"panel",
".",
"This",
"will",
"remove",
"the",
"float",
"panel",
"from",
"page",
"and",
"fire",
"the",
"close",
"event",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L30229-L30238 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (state) {
var self = this, documentElement = document.documentElement, slowRendering, prefix = self.classPrefix, layoutRect;
if (state != self._fullscreen) {
$(window).on('resize', function () {
var time;
if (self._fullscreen) {
// Time the layo... | javascript | function (state) {
var self = this, documentElement = document.documentElement, slowRendering, prefix = self.classPrefix, layoutRect;
if (state != self._fullscreen) {
$(window).on('resize', function () {
var time;
if (self._fullscreen) {
// Time the layo... | [
"function",
"(",
"state",
")",
"{",
"var",
"self",
"=",
"this",
",",
"documentElement",
"=",
"document",
".",
"documentElement",
",",
"slowRendering",
",",
"prefix",
"=",
"self",
".",
"classPrefix",
",",
"layoutRect",
";",
"if",
"(",
"state",
"!=",
"self",... | Switches the window fullscreen mode.
@method fullscreen
@param {Boolean} state True/false state.
@return {tinymce.ui.Window} Current window instance. | [
"Switches",
"the",
"window",
"fullscreen",
"mode",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L30631-L30687 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (settings) {
var buttons, callback = settings.callback || function () { };
function createButton(text, status, primary) {
return {
type: "button",
text: text,
subtype: primary ? 'primary' : '',
onClick: function (e) {
... | javascript | function (settings) {
var buttons, callback = settings.callback || function () { };
function createButton(text, status, primary) {
return {
type: "button",
text: text,
subtype: primary ? 'primary' : '',
onClick: function (e) {
... | [
"function",
"(",
"settings",
")",
"{",
"var",
"buttons",
",",
"callback",
"=",
"settings",
".",
"callback",
"||",
"function",
"(",
")",
"{",
"}",
";",
"function",
"createButton",
"(",
"text",
",",
"status",
",",
"primary",
")",
"{",
"return",
"{",
"typ... | Constructs a new message box and renders it to the body element.
@static
@method msgBox
@param {Object} settings Name/value object with settings. | [
"Constructs",
"a",
"new",
"message",
"box",
"and",
"renders",
"it",
"to",
"the",
"body",
"element",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L30884-L30953 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (settings, callback) {
if (typeof settings == "string") {
settings = { text: settings };
}
settings.callback = callback;
return MessageBox.msgBox(settings);
} | javascript | function (settings, callback) {
if (typeof settings == "string") {
settings = { text: settings };
}
settings.callback = callback;
return MessageBox.msgBox(settings);
} | [
"function",
"(",
"settings",
",",
"callback",
")",
"{",
"if",
"(",
"typeof",
"settings",
"==",
"\"string\"",
")",
"{",
"settings",
"=",
"{",
"text",
":",
"settings",
"}",
";",
"}",
"settings",
".",
"callback",
"=",
"callback",
";",
"return",
"MessageBox"... | Creates a new alert dialog.
@method alert
@param {Object} settings Settings for the alert dialog.
@param {function} [callback] Callback to execute when the user makes a choice. | [
"Creates",
"a",
"new",
"alert",
"dialog",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L30962-L30969 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (settings, callback) {
if (typeof settings == "string") {
settings = { text: settings };
}
settings.callback = callback;
settings.buttons = MessageBox.OK_CANCEL;
return MessageBox.msgBox(settings);
} | javascript | function (settings, callback) {
if (typeof settings == "string") {
settings = { text: settings };
}
settings.callback = callback;
settings.buttons = MessageBox.OK_CANCEL;
return MessageBox.msgBox(settings);
} | [
"function",
"(",
"settings",
",",
"callback",
")",
"{",
"if",
"(",
"typeof",
"settings",
"==",
"\"string\"",
")",
"{",
"settings",
"=",
"{",
"text",
":",
"settings",
"}",
";",
"}",
"settings",
".",
"callback",
"=",
"callback",
";",
"settings",
".",
"bu... | Creates a new confirm dialog.
@method confirm
@param {Object} settings Settings for the confirm dialog.
@param {function} [callback] Callback to execute when the user makes a choice. | [
"Creates",
"a",
"new",
"confirm",
"dialog",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L30978-L30987 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | findDuplicateMessage | function findDuplicateMessage(notificationArray, newNotification) {
if (!isPlainTextNotification(newNotification)) {
return null;
}
var filteredNotifications = Tools.grep(notificationArray, function (notification) {
return isSameNotification(newNotification, notification);
... | javascript | function findDuplicateMessage(notificationArray, newNotification) {
if (!isPlainTextNotification(newNotification)) {
return null;
}
var filteredNotifications = Tools.grep(notificationArray, function (notification) {
return isSameNotification(newNotification, notification);
... | [
"function",
"findDuplicateMessage",
"(",
"notificationArray",
",",
"newNotification",
")",
"{",
"if",
"(",
"!",
"isPlainTextNotification",
"(",
"newNotification",
")",
")",
"{",
"return",
"null",
";",
"}",
"var",
"filteredNotifications",
"=",
"Tools",
".",
"grep",... | Finds any existing notification with the same properties as the new one.
Returns either the found notification or null.
@param {Notification[]} notificationArray - Array of current notifications
@param {type: string, } newNotification - New notification object
@returns {?Notification} | [
"Finds",
"any",
"existing",
"notification",
"with",
"the",
"same",
"properties",
"as",
"the",
"new",
"one",
".",
"Returns",
"either",
"the",
"found",
"notification",
"or",
"null",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L31937-L31947 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | isSameNotification | function isSameNotification(a, b) {
return a.type === b.settings.type && a.text === b.settings.text;
} | javascript | function isSameNotification(a, b) {
return a.type === b.settings.type && a.text === b.settings.text;
} | [
"function",
"isSameNotification",
"(",
"a",
",",
"b",
")",
"{",
"return",
"a",
".",
"type",
"===",
"b",
".",
"settings",
".",
"type",
"&&",
"a",
".",
"text",
"===",
"b",
".",
"settings",
".",
"text",
";",
"}"
] | Checks if the passed in args object has the same
type and text properties as the sent in notification.
@param {type: string, text: string} a - New notification args object
@param {Notification} b - Old notification
@returns {boolean} | [
"Checks",
"if",
"the",
"passed",
"in",
"args",
"object",
"has",
"the",
"same",
"type",
"and",
"text",
"properties",
"as",
"the",
"sent",
"in",
"notification",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L31957-L31959 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | getEventTarget | function getEventTarget(editor, eventName) {
if (eventName == 'selectionchange') {
return editor.getDoc();
}
// Need to bind mousedown/mouseup etc to document not body in iframe mode
// Since the user might click on the HTML element not the BODY
if (!editor.inline && /^mouse|touch... | javascript | function getEventTarget(editor, eventName) {
if (eventName == 'selectionchange') {
return editor.getDoc();
}
// Need to bind mousedown/mouseup etc to document not body in iframe mode
// Since the user might click on the HTML element not the BODY
if (!editor.inline && /^mouse|touch... | [
"function",
"getEventTarget",
"(",
"editor",
",",
"eventName",
")",
"{",
"if",
"(",
"eventName",
"==",
"'selectionchange'",
")",
"{",
"return",
"editor",
".",
"getDoc",
"(",
")",
";",
"}",
"// Need to bind mousedown/mouseup etc to document not body in iframe mode",
"/... | Returns the event target so for the specified event. Some events fire
only on document, some fire on documentElement etc. This also handles the
custom event root setting where it returns that element instead of the body.
@private
@param {tinymce.Editor} editor Editor instance to get event target from.
@param {String} ... | [
"Returns",
"the",
"event",
"target",
"so",
"for",
"the",
"specified",
"event",
".",
"Some",
"events",
"fire",
"only",
"on",
"document",
"some",
"fire",
"on",
"documentElement",
"etc",
".",
"This",
"also",
"handles",
"the",
"custom",
"event",
"root",
"setting... | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L32013-L32034 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | bindEventDelegate | function bindEventDelegate(editor, eventName) {
var eventRootElm = getEventTarget(editor, eventName), delegate;
function isListening(editor) {
return !editor.hidden && !editor.readonly;
}
if (!editor.delegates) {
editor.delegates = {};
}
if (editor.delegates[eventN... | javascript | function bindEventDelegate(editor, eventName) {
var eventRootElm = getEventTarget(editor, eventName), delegate;
function isListening(editor) {
return !editor.hidden && !editor.readonly;
}
if (!editor.delegates) {
editor.delegates = {};
}
if (editor.delegates[eventN... | [
"function",
"bindEventDelegate",
"(",
"editor",
",",
"eventName",
")",
"{",
"var",
"eventRootElm",
"=",
"getEventTarget",
"(",
"editor",
",",
"eventName",
")",
",",
"delegate",
";",
"function",
"isListening",
"(",
"editor",
")",
"{",
"return",
"!",
"editor",
... | Binds a event delegate for the specified name this delegate will fire
the event to the editor dispatcher.
@private
@param {tinymce.Editor} editor Editor instance to get event target from.
@param {String} eventName Name of the event for example "click". | [
"Binds",
"a",
"event",
"delegate",
"for",
"the",
"specified",
"name",
"this",
"delegate",
"will",
"fire",
"the",
"event",
"to",
"the",
"editor",
"dispatcher",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L32044-L32107 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | function () {
var self = this, name;
if (self.delegates) {
for (name in self.delegates) {
self.dom.unbind(getEventTarget(self, name), name, self.delegates[name]);
}
delete self.delegates;
}
if (!self.inline) {
self.getBody().onload =... | javascript | function () {
var self = this, name;
if (self.delegates) {
for (name in self.delegates) {
self.dom.unbind(getEventTarget(self, name), name, self.delegates[name]);
}
delete self.delegates;
}
if (!self.inline) {
self.getBody().onload =... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
",",
"name",
";",
"if",
"(",
"self",
".",
"delegates",
")",
"{",
"for",
"(",
"name",
"in",
"self",
".",
"delegates",
")",
"{",
"self",
".",
"dom",
".",
"unbind",
"(",
"getEventTarget",
"(",
"... | Unbinds all native event handlers that means delegates, custom events bound using the Events API etc.
@private | [
"Unbinds",
"all",
"native",
"event",
"handlers",
"that",
"means",
"delegates",
"custom",
"events",
"bound",
"using",
"the",
"Events",
"API",
"etc",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L32158-L32177 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | createNewBlock | function createNewBlock(name) {
var node = container, block, clonedNode, caretNode, textInlineElements = schema.getTextInlineElements();
if (name || parentBlockName == "TABLE") {
block = dom.create(name || newBlockName);
setForcedBlockAttrs(block);
} else {
... | javascript | function createNewBlock(name) {
var node = container, block, clonedNode, caretNode, textInlineElements = schema.getTextInlineElements();
if (name || parentBlockName == "TABLE") {
block = dom.create(name || newBlockName);
setForcedBlockAttrs(block);
} else {
... | [
"function",
"createNewBlock",
"(",
"name",
")",
"{",
"var",
"node",
"=",
"container",
",",
"block",
",",
"clonedNode",
",",
"caretNode",
",",
"textInlineElements",
"=",
"schema",
".",
"getTextInlineElements",
"(",
")",
";",
"if",
"(",
"name",
"||",
"parentBl... | Creates a new block element by cloning the current one or creating a new one if the name is specified This function will also copy any text formatting from the parent block and add it to the new one | [
"Creates",
"a",
"new",
"block",
"element",
"by",
"cloning",
"the",
"current",
"one",
"or",
"creating",
"a",
"new",
"one",
"if",
"the",
"name",
"is",
"specified",
"This",
"function",
"will",
"also",
"copy",
"any",
"text",
"formatting",
"from",
"the",
"paren... | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L32783-L32824 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | wrapSelfAndSiblingsInDefaultBlock | function wrapSelfAndSiblingsInDefaultBlock(container, offset) {
var newBlock, parentBlock, startNode, node, next, rootBlockName, blockName = newBlockName || 'P';
// Not in a block element or in a table cell or caption
parentBlock = dom.getParent(container, dom.isBlock);
if (!par... | javascript | function wrapSelfAndSiblingsInDefaultBlock(container, offset) {
var newBlock, parentBlock, startNode, node, next, rootBlockName, blockName = newBlockName || 'P';
// Not in a block element or in a table cell or caption
parentBlock = dom.getParent(container, dom.isBlock);
if (!par... | [
"function",
"wrapSelfAndSiblingsInDefaultBlock",
"(",
"container",
",",
"offset",
")",
"{",
"var",
"newBlock",
",",
"parentBlock",
",",
"startNode",
",",
"node",
",",
"next",
",",
"rootBlockName",
",",
"blockName",
"=",
"newBlockName",
"||",
"'P'",
";",
"// Not ... | Wraps any text nodes or inline elements in the specified forced root block name | [
"Wraps",
"any",
"text",
"nodes",
"or",
"inline",
"elements",
"in",
"the",
"specified",
"forced",
"root",
"block",
"name"
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L32887-L32942 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | trimLeadingLineBreaks | function trimLeadingLineBreaks(node) {
do {
if (node.nodeType === 3) {
node.nodeValue = node.nodeValue.replace(/^[\r\n]+/, '');
}
node = node.firstChild;
} while (node);
} | javascript | function trimLeadingLineBreaks(node) {
do {
if (node.nodeType === 3) {
node.nodeValue = node.nodeValue.replace(/^[\r\n]+/, '');
}
node = node.firstChild;
} while (node);
} | [
"function",
"trimLeadingLineBreaks",
"(",
"node",
")",
"{",
"do",
"{",
"if",
"(",
"node",
".",
"nodeType",
"===",
"3",
")",
"{",
"node",
".",
"nodeValue",
"=",
"node",
".",
"nodeValue",
".",
"replace",
"(",
"/",
"^[\\r\\n]+",
"/",
",",
"''",
")",
";"... | Trims any linebreaks at the beginning of node user for example when pressing enter in a PRE element | [
"Trims",
"any",
"linebreaks",
"at",
"the",
"beginning",
"of",
"node",
"user",
"for",
"example",
"when",
"pressing",
"enter",
"in",
"a",
"PRE",
"element"
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L33034-L33042 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | addBrToBlockIfNeeded | function addBrToBlockIfNeeded(block) {
var lastChild;
// IE will render the blocks correctly other browsers needs a BR
if (!isIE) {
block.normalize(); // Remove empty text nodes that got left behind by the extract
// Check if the block is empty or contains a float... | javascript | function addBrToBlockIfNeeded(block) {
var lastChild;
// IE will render the blocks correctly other browsers needs a BR
if (!isIE) {
block.normalize(); // Remove empty text nodes that got left behind by the extract
// Check if the block is empty or contains a float... | [
"function",
"addBrToBlockIfNeeded",
"(",
"block",
")",
"{",
"var",
"lastChild",
";",
"// IE will render the blocks correctly other browsers needs a BR",
"if",
"(",
"!",
"isIE",
")",
"{",
"block",
".",
"normalize",
"(",
")",
";",
"// Remove empty text nodes that got left b... | Adds a BR at the end of blocks that only contains an IMG or INPUT since these might be floated and then they won't expand the block | [
"Adds",
"a",
"BR",
"at",
"the",
"end",
"of",
"blocks",
"that",
"only",
"contains",
"an",
"IMG",
"or",
"INPUT",
"since",
"these",
"might",
"be",
"floated",
"and",
"then",
"they",
"won",
"t",
"expand",
"the",
"block"
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L33062-L33075 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | insertClipboardContents | function insertClipboardContents(content, internal) {
if (editor.queryCommandSupported('mceInsertClipboardContent')) {
editor.execCommand('mceInsertClipboardContent', false, { content: content, internal: internal });
} else {
editor.execCommand('mceInsertContent', false, content);
... | javascript | function insertClipboardContents(content, internal) {
if (editor.queryCommandSupported('mceInsertClipboardContent')) {
editor.execCommand('mceInsertClipboardContent', false, { content: content, internal: internal });
} else {
editor.execCommand('mceInsertContent', false, content);
... | [
"function",
"insertClipboardContents",
"(",
"content",
",",
"internal",
")",
"{",
"if",
"(",
"editor",
".",
"queryCommandSupported",
"(",
"'mceInsertClipboardContent'",
")",
")",
"{",
"editor",
".",
"execCommand",
"(",
"'mceInsertClipboardContent'",
",",
"false",
",... | Inserts contents using the paste clipboard command if it's available if it isn't it will fallback
to the core command.
@private
@param {String} content Content to insert at selection.
@param {Boolean} internal State if the paste is to be considered internal or external. | [
"Inserts",
"contents",
"using",
"the",
"paste",
"clipboard",
"command",
"if",
"it",
"s",
"available",
"if",
"it",
"isn",
"t",
"it",
"will",
"fallback",
"to",
"the",
"core",
"command",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L33604-L33610 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | handleLastBlockCharacterDelete | function handleLastBlockCharacterDelete(isForward, rng) {
var path, blockElm, newBlockElm, clonedBlockElm, sibling,
container, offset, br, currentFormatNodes;
function cloneTextBlockWithFormats(blockElm, node) {
currentFormatNodes = $(node).parents().filter(function (idx, no... | javascript | function handleLastBlockCharacterDelete(isForward, rng) {
var path, blockElm, newBlockElm, clonedBlockElm, sibling,
container, offset, br, currentFormatNodes;
function cloneTextBlockWithFormats(blockElm, node) {
currentFormatNodes = $(node).parents().filter(function (idx, no... | [
"function",
"handleLastBlockCharacterDelete",
"(",
"isForward",
",",
"rng",
")",
"{",
"var",
"path",
",",
"blockElm",
",",
"newBlockElm",
",",
"clonedBlockElm",
",",
"sibling",
",",
"container",
",",
"offset",
",",
"br",
",",
"currentFormatNodes",
";",
"function... | This retains the formatting if the last character is to be deleted.
Backspace on this: <p><b><i>a|</i></b></p> would become <p>|</p> in WebKit.
With this patch: <p><b><i>|<br></i></b></p> | [
"This",
"retains",
"the",
"formatting",
"if",
"the",
"last",
"character",
"is",
"to",
"be",
"deleted",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L33902-L33999 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | emptyEditorWhenDeleting | function emptyEditorWhenDeleting() {
function serializeRng(rng) {
var body = dom.create("body");
var contents = rng.cloneContents();
body.appendChild(contents);
return selection.serializer.serialize(body, { format: 'html' });
}
function allContentsSelecte... | javascript | function emptyEditorWhenDeleting() {
function serializeRng(rng) {
var body = dom.create("body");
var contents = rng.cloneContents();
body.appendChild(contents);
return selection.serializer.serialize(body, { format: 'html' });
}
function allContentsSelecte... | [
"function",
"emptyEditorWhenDeleting",
"(",
")",
"{",
"function",
"serializeRng",
"(",
"rng",
")",
"{",
"var",
"body",
"=",
"dom",
".",
"create",
"(",
"\"body\"",
")",
";",
"var",
"contents",
"=",
"rng",
".",
"cloneContents",
"(",
")",
";",
"body",
".",
... | Makes sure that the editor body becomes empty when backspace or delete is pressed in empty editors.
For example:
<p><b>|</b></p>
Or:
<h1>|</h1>
Or:
[<h1></h1>] | [
"Makes",
"sure",
"that",
"the",
"editor",
"body",
"becomes",
"empty",
"when",
"backspace",
"or",
"delete",
"is",
"pressed",
"in",
"empty",
"editors",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L34250-L34309 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | inputMethodFocus | function inputMethodFocus() {
if (!editor.settings.content_editable) {
// Case 1 IME doesn't initialize if you focus the document
// Disabled since it was interferring with the cE=false logic
// Also coultn't reproduce the issue on Safari 9
/*dom.bind(editor.getDoc(), 'fo... | javascript | function inputMethodFocus() {
if (!editor.settings.content_editable) {
// Case 1 IME doesn't initialize if you focus the document
// Disabled since it was interferring with the cE=false logic
// Also coultn't reproduce the issue on Safari 9
/*dom.bind(editor.getDoc(), 'fo... | [
"function",
"inputMethodFocus",
"(",
")",
"{",
"if",
"(",
"!",
"editor",
".",
"settings",
".",
"content_editable",
")",
"{",
"// Case 1 IME doesn't initialize if you focus the document",
"// Disabled since it was interferring with the cE=false logic",
"// Also coultn't reproduce th... | WebKit has a weird issue where it some times fails to properly convert keypresses to input method keystrokes.
The IME on Mac doesn't initialize when it doesn't fire a proper focus event.
This seems to happen when the user manages to click the documentElement element then the window doesn't get proper focus until
you e... | [
"WebKit",
"has",
"a",
"weird",
"issue",
"where",
"it",
"some",
"times",
"fails",
"to",
"properly",
"convert",
"keypresses",
"to",
"input",
"method",
"keystrokes",
".",
"The",
"IME",
"on",
"Mac",
"doesn",
"t",
"initialize",
"when",
"it",
"doesn",
"t",
"fire... | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L34331-L34362 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | focusBody | function focusBody() {
// Fix for a focus bug in FF 3.x where the body element
// wouldn't get proper focus if the user clicked on the HTML element
if (!window.Range.prototype.getClientRects) { // Detect getClientRects got introduced in FF 4
editor.on('mousedown', function (e) {
... | javascript | function focusBody() {
// Fix for a focus bug in FF 3.x where the body element
// wouldn't get proper focus if the user clicked on the HTML element
if (!window.Range.prototype.getClientRects) { // Detect getClientRects got introduced in FF 4
editor.on('mousedown', function (e) {
... | [
"function",
"focusBody",
"(",
")",
"{",
"// Fix for a focus bug in FF 3.x where the body element",
"// wouldn't get proper focus if the user clicked on the HTML element",
"if",
"(",
"!",
"window",
".",
"Range",
".",
"prototype",
".",
"getClientRects",
")",
"{",
"// Detect getCl... | Firefox 3.x has an issue where the body element won't get proper focus if you click out
side it's rectangle. | [
"Firefox",
"3",
".",
"x",
"has",
"an",
"issue",
"where",
"the",
"body",
"element",
"won",
"t",
"get",
"proper",
"focus",
"if",
"you",
"click",
"out",
"side",
"it",
"s",
"rectangle",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L34404-L34422 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | selectControlElements | function selectControlElements() {
editor.on('click', function (e) {
var target = e.target;
// Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250
// WebKit can't even do simple things like selecting an image
// Needs to be the setBaseAndExtend or it will fa... | javascript | function selectControlElements() {
editor.on('click', function (e) {
var target = e.target;
// Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250
// WebKit can't even do simple things like selecting an image
// Needs to be the setBaseAndExtend or it will fa... | [
"function",
"selectControlElements",
"(",
")",
"{",
"editor",
".",
"on",
"(",
"'click'",
",",
"function",
"(",
"e",
")",
"{",
"var",
"target",
"=",
"e",
".",
"target",
";",
"// Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250",
"// WebKit can't even do... | WebKit has a bug where it isn't possible to select image, hr or anchor elements
by clicking on them so we need to fake that. | [
"WebKit",
"has",
"a",
"bug",
"where",
"it",
"isn",
"t",
"possible",
"to",
"select",
"image",
"hr",
"or",
"anchor",
"elements",
"by",
"clicking",
"on",
"them",
"so",
"we",
"need",
"to",
"fake",
"that",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L34428-L34446 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | removeStylesWhenDeletingAcrossBlockElements | function removeStylesWhenDeletingAcrossBlockElements() {
function getAttributeApplyFunction() {
var template = dom.getAttribs(selection.getStart().cloneNode(false));
return function () {
var target = selection.getStart();
if (target !== editor.getBody()) {
... | javascript | function removeStylesWhenDeletingAcrossBlockElements() {
function getAttributeApplyFunction() {
var template = dom.getAttribs(selection.getStart().cloneNode(false));
return function () {
var target = selection.getStart();
if (target !== editor.getBody()) {
... | [
"function",
"removeStylesWhenDeletingAcrossBlockElements",
"(",
")",
"{",
"function",
"getAttributeApplyFunction",
"(",
")",
"{",
"var",
"template",
"=",
"dom",
".",
"getAttribs",
"(",
"selection",
".",
"getStart",
"(",
")",
".",
"cloneNode",
"(",
"false",
")",
... | Fixes a Gecko bug where the style attribute gets added to the wrong element when deleting between two block elements.
Fixes do backspace/delete on this:
<p>bla[ck</p><p style="color:red">r]ed</p>
Would become:
<p>bla|ed</p>
Instead of:
<p style="color:red">bla|ed</p> | [
"Fixes",
"a",
"Gecko",
"bug",
"where",
"the",
"style",
"attribute",
"gets",
"added",
"to",
"the",
"wrong",
"element",
"when",
"deleting",
"between",
"two",
"block",
"elements",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L34460-L34505 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | disableBackspaceIntoATable | function disableBackspaceIntoATable() {
editor.on('keydown', function (e) {
if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {
var previousSibling = selection.getNode().previousSibling;
... | javascript | function disableBackspaceIntoATable() {
editor.on('keydown', function (e) {
if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) {
var previousSibling = selection.getNode().previousSibling;
... | [
"function",
"disableBackspaceIntoATable",
"(",
")",
"{",
"editor",
".",
"on",
"(",
"'keydown'",
",",
"function",
"(",
"e",
")",
"{",
"if",
"(",
"!",
"isDefaultPrevented",
"(",
"e",
")",
"&&",
"e",
".",
"keyCode",
"===",
"BACKSPACE",
")",
"{",
"if",
"("... | Backspacing into a table behaves differently depending upon browser type.
Therefore, disable Backspace when cursor immediately follows a table. | [
"Backspacing",
"into",
"a",
"table",
"behaves",
"differently",
"depending",
"upon",
"browser",
"type",
".",
"Therefore",
"disable",
"Backspace",
"when",
"cursor",
"immediately",
"follows",
"a",
"table",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L34518-L34530 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | setGeckoEditingOptions | function setGeckoEditingOptions() {
function setOpts() {
refreshContentEditable();
setEditorCommandState("StyleWithCSS", false);
setEditorCommandState("enableInlineTableEditing", false);
if (!settings.object_resizing) {
setEditorCommandState("enableObjectRes... | javascript | function setGeckoEditingOptions() {
function setOpts() {
refreshContentEditable();
setEditorCommandState("StyleWithCSS", false);
setEditorCommandState("enableInlineTableEditing", false);
if (!settings.object_resizing) {
setEditorCommandState("enableObjectRes... | [
"function",
"setGeckoEditingOptions",
"(",
")",
"{",
"function",
"setOpts",
"(",
")",
"{",
"refreshContentEditable",
"(",
")",
";",
"setEditorCommandState",
"(",
"\"StyleWithCSS\"",
",",
"false",
")",
";",
"setEditorCommandState",
"(",
"\"enableInlineTableEditing\"",
... | Sets various Gecko editing options on mouse down and before a execCommand to disable inline table editing that is broken etc. | [
"Sets",
"various",
"Gecko",
"editing",
"options",
"on",
"mouse",
"down",
"and",
"before",
"a",
"execCommand",
"to",
"disable",
"inline",
"table",
"editing",
"that",
"is",
"broken",
"etc",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L34660-L34675 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | addBrAfterLastLinks | function addBrAfterLastLinks() {
function fixLinks() {
each(dom.select('a'), function (node) {
var parentNode = node.parentNode, root = dom.getRoot();
if (parentNode.lastChild === node) {
while (parentNode && !dom.isBlock(parentNode)) {
if (parent... | javascript | function addBrAfterLastLinks() {
function fixLinks() {
each(dom.select('a'), function (node) {
var parentNode = node.parentNode, root = dom.getRoot();
if (parentNode.lastChild === node) {
while (parentNode && !dom.isBlock(parentNode)) {
if (parent... | [
"function",
"addBrAfterLastLinks",
"(",
")",
"{",
"function",
"fixLinks",
"(",
")",
"{",
"each",
"(",
"dom",
".",
"select",
"(",
"'a'",
")",
",",
"function",
"(",
"node",
")",
"{",
"var",
"parentNode",
"=",
"node",
".",
"parentNode",
",",
"root",
"=",
... | Fixes a gecko link bug, when a link is placed at the end of block elements there is
no way to move the caret behind the link. This fix adds a bogus br element after the link.
For example this:
<p><b><a href="#">x</a></b></p>
Becomes this:
<p><b><a href="#">x</a></b><br></p> | [
"Fixes",
"a",
"gecko",
"link",
"bug",
"when",
"a",
"link",
"is",
"placed",
"at",
"the",
"end",
"of",
"block",
"elements",
"there",
"is",
"no",
"way",
"to",
"move",
"the",
"caret",
"behind",
"the",
"link",
".",
"This",
"fix",
"adds",
"a",
"bogus",
"br... | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L34687-L34711 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | keepNoScriptContents | function keepNoScriptContents() {
if (getDocumentMode() < 9) {
parser.addNodeFilter('noscript', function (nodes) {
var i = nodes.length, node, textNode;
while (i--) {
node = nodes[i];
textNode = node.firstChild;
if (textNode) {
... | javascript | function keepNoScriptContents() {
if (getDocumentMode() < 9) {
parser.addNodeFilter('noscript', function (nodes) {
var i = nodes.length, node, textNode;
while (i--) {
node = nodes[i];
textNode = node.firstChild;
if (textNode) {
... | [
"function",
"keepNoScriptContents",
"(",
")",
"{",
"if",
"(",
"getDocumentMode",
"(",
")",
"<",
"9",
")",
"{",
"parser",
".",
"addNodeFilter",
"(",
"'noscript'",
",",
"function",
"(",
"nodes",
")",
"{",
"var",
"i",
"=",
"nodes",
".",
"length",
",",
"no... | Old IE versions can't retain contents within noscript elements so this logic will store the contents
as a attribute and the insert that value as it's raw text when the DOM is serialized. | [
"Old",
"IE",
"versions",
"can",
"t",
"retain",
"contents",
"within",
"noscript",
"elements",
"so",
"this",
"logic",
"will",
"store",
"the",
"contents",
"as",
"a",
"attribute",
"and",
"the",
"insert",
"that",
"value",
"as",
"it",
"s",
"raw",
"text",
"when",... | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L34767-L34805 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | rngFromPoint | function rngFromPoint(x, y) {
var rng = body.createTextRange();
try {
rng.moveToPoint(x, y);
} catch (ex) {
// IE sometimes throws and exception, so lets just ignore it
rng = null;
}
return rng;
} | javascript | function rngFromPoint(x, y) {
var rng = body.createTextRange();
try {
rng.moveToPoint(x, y);
} catch (ex) {
// IE sometimes throws and exception, so lets just ignore it
rng = null;
}
return rng;
} | [
"function",
"rngFromPoint",
"(",
"x",
",",
"y",
")",
"{",
"var",
"rng",
"=",
"body",
".",
"createTextRange",
"(",
")",
";",
"try",
"{",
"rng",
".",
"moveToPoint",
"(",
"x",
",",
"y",
")",
";",
"}",
"catch",
"(",
"ex",
")",
"{",
"// IE sometimes thr... | Return range from point or null if it failed | [
"Return",
"range",
"from",
"point",
"or",
"null",
"if",
"it",
"failed"
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L34814-L34825 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | selectionChange | function selectionChange(e) {
var pointRng;
// Check if the button is down or not
if (e.button) {
// Create range from mouse position
pointRng = rngFromPoint(e.x, e.y);
if (pointRng) {
// Check if pointRange is before/after selection then... | javascript | function selectionChange(e) {
var pointRng;
// Check if the button is down or not
if (e.button) {
// Create range from mouse position
pointRng = rngFromPoint(e.x, e.y);
if (pointRng) {
// Check if pointRange is before/after selection then... | [
"function",
"selectionChange",
"(",
"e",
")",
"{",
"var",
"pointRng",
";",
"// Check if the button is down or not",
"if",
"(",
"e",
".",
"button",
")",
"{",
"// Create range from mouse position",
"pointRng",
"=",
"rngFromPoint",
"(",
"e",
".",
"x",
",",
"e",
"."... | Fires while the selection is changing | [
"Fires",
"while",
"the",
"selection",
"is",
"changing"
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L34828-L34849 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | restoreFocusOnKeyDown | function restoreFocusOnKeyDown() {
if (!editor.inline) {
editor.on('keydown', function () {
if (document.activeElement == document.body) {
editor.getWin().focus();
}
});
}
} | javascript | function restoreFocusOnKeyDown() {
if (!editor.inline) {
editor.on('keydown', function () {
if (document.activeElement == document.body) {
editor.getWin().focus();
}
});
}
} | [
"function",
"restoreFocusOnKeyDown",
"(",
")",
"{",
"if",
"(",
"!",
"editor",
".",
"inline",
")",
"{",
"editor",
".",
"on",
"(",
"'keydown'",
",",
"function",
"(",
")",
"{",
"if",
"(",
"document",
".",
"activeElement",
"==",
"document",
".",
"body",
")... | iOS has a bug where it's impossible to type if the document has a touchstart event
bound and the user touches the document while having the on screen keyboard visible.
The touch event moves the focus to the parent document while having the caret inside the iframe
this fix moves the focus back into the iframe document. | [
"iOS",
"has",
"a",
"bug",
"where",
"it",
"s",
"impossible",
"to",
"type",
"if",
"the",
"document",
"has",
"a",
"touchstart",
"event",
"bound",
"and",
"the",
"user",
"touches",
"the",
"document",
"while",
"having",
"the",
"on",
"screen",
"keyboard",
"visibl... | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L34929-L34937 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | blockCmdArrowNavigation | function blockCmdArrowNavigation() {
if (Env.mac) {
editor.on('keydown', function (e) {
if (VK.metaKeyPressed(e) && !e.shiftKey && (e.keyCode == 37 || e.keyCode == 39)) {
e.preventDefault();
editor.selection.getSel().modify('move', e.keyCode == 37 ? 'backward' :... | javascript | function blockCmdArrowNavigation() {
if (Env.mac) {
editor.on('keydown', function (e) {
if (VK.metaKeyPressed(e) && !e.shiftKey && (e.keyCode == 37 || e.keyCode == 39)) {
e.preventDefault();
editor.selection.getSel().modify('move', e.keyCode == 37 ? 'backward' :... | [
"function",
"blockCmdArrowNavigation",
"(",
")",
"{",
"if",
"(",
"Env",
".",
"mac",
")",
"{",
"editor",
".",
"on",
"(",
"'keydown'",
",",
"function",
"(",
"e",
")",
"{",
"if",
"(",
"VK",
".",
"metaKeyPressed",
"(",
"e",
")",
"&&",
"!",
"e",
".",
... | Firefox on Mac OS will move the browser back to the previous page if you press CMD+Left arrow.
You might then loose all your work so we need to block that behavior and replace it with our own. | [
"Firefox",
"on",
"Mac",
"OS",
"will",
"move",
"the",
"browser",
"back",
"to",
"the",
"previous",
"page",
"if",
"you",
"press",
"CMD",
"+",
"Left",
"arrow",
".",
"You",
"might",
"then",
"loose",
"all",
"your",
"work",
"so",
"we",
"need",
"to",
"block",
... | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L34977-L34986 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | replaceString | function replaceString(content, search, replace) {
var index = 0;
do {
index = content.indexOf(search, index);
if (index !== -1) {
content = content.substring(0, index) + replace + content.substr(index + search.length);
index += replace.length - search.lengt... | javascript | function replaceString(content, search, replace) {
var index = 0;
do {
index = content.indexOf(search, index);
if (index !== -1) {
content = content.substring(0, index) + replace + content.substr(index + search.length);
index += replace.length - search.lengt... | [
"function",
"replaceString",
"(",
"content",
",",
"search",
",",
"replace",
")",
"{",
"var",
"index",
"=",
"0",
";",
"do",
"{",
"index",
"=",
"content",
".",
"indexOf",
"(",
"search",
",",
"index",
")",
";",
"if",
"(",
"index",
"!==",
"-",
"1",
")"... | Replaces strings without regexps to avoid FF regexp to big issue | [
"Replaces",
"strings",
"without",
"regexps",
"to",
"avoid",
"FF",
"regexp",
"to",
"big",
"issue"
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L36153-L36166 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | function (selection) {
var rng = selection.getSel().getRangeAt(0);
var startContainer = rng.startContainer;
return startContainer.nodeType === 3 ? startContainer.parentNode : startContainer;
} | javascript | function (selection) {
var rng = selection.getSel().getRangeAt(0);
var startContainer = rng.startContainer;
return startContainer.nodeType === 3 ? startContainer.parentNode : startContainer;
} | [
"function",
"(",
"selection",
")",
"{",
"var",
"rng",
"=",
"selection",
".",
"getSel",
"(",
")",
".",
"getRangeAt",
"(",
"0",
")",
";",
"var",
"startContainer",
"=",
"rng",
".",
"startContainer",
";",
"return",
"startContainer",
".",
"nodeType",
"===",
"... | Returns the raw element instead of the fake cE=false element | [
"Returns",
"the",
"raw",
"element",
"instead",
"of",
"the",
"fake",
"cE",
"=",
"false",
"element"
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L37199-L37203 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (targetNode, caretNode) {
var targetBlock = editor.dom.getParent(targetNode, editor.dom.isBlock);
var caretBlock = editor.dom.getParent(caretNode, editor.dom.isBlock);
return targetBlock && !isInSameBlock(targetBlock, caretBlock) && hasNormalCaretPosition(targetBlock);
} | javascript | function (targetNode, caretNode) {
var targetBlock = editor.dom.getParent(targetNode, editor.dom.isBlock);
var caretBlock = editor.dom.getParent(caretNode, editor.dom.isBlock);
return targetBlock && !isInSameBlock(targetBlock, caretBlock) && hasNormalCaretPosition(targetBlock);
} | [
"function",
"(",
"targetNode",
",",
"caretNode",
")",
"{",
"var",
"targetBlock",
"=",
"editor",
".",
"dom",
".",
"getParent",
"(",
"targetNode",
",",
"editor",
".",
"dom",
".",
"isBlock",
")",
";",
"var",
"caretBlock",
"=",
"editor",
".",
"dom",
".",
"... | Checks if the target node is in a block and if that block has a caret position better than the suggested caretNode this is to prevent the caret from being sucked in towards a cE=false block if they are adjacent on the vertical axis | [
"Checks",
"if",
"the",
"target",
"node",
"is",
"in",
"a",
"block",
"and",
"if",
"that",
"block",
"has",
"a",
"caret",
"position",
"better",
"than",
"the",
"suggested",
"caretNode",
"this",
"is",
"to",
"prevent",
"the",
"caret",
"from",
"being",
"sucked",
... | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L37939-L37944 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | Editor | function Editor(id, settings, editorManager) {
var self = this, documentBaseUrl, baseUri, defaultSettings;
documentBaseUrl = self.documentBaseUrl = editorManager.documentBaseURL;
baseUri = editorManager.baseURI;
defaultSettings = editorManager.defaultSettings;
/**
* Name/value col... | javascript | function Editor(id, settings, editorManager) {
var self = this, documentBaseUrl, baseUri, defaultSettings;
documentBaseUrl = self.documentBaseUrl = editorManager.documentBaseURL;
baseUri = editorManager.baseURI;
defaultSettings = editorManager.defaultSettings;
/**
* Name/value col... | [
"function",
"Editor",
"(",
"id",
",",
"settings",
",",
"editorManager",
")",
"{",
"var",
"self",
"=",
"this",
",",
"documentBaseUrl",
",",
"baseUri",
",",
"defaultSettings",
";",
"documentBaseUrl",
"=",
"self",
".",
"documentBaseUrl",
"=",
"editorManager",
"."... | Include documentation for all the events.
@include ../../../../../tools/docs/tinymce.Editor.js
Constructs a editor instance by id.
@constructor
@method Editor
@param {String} id Unique id for the editor.
@param {Object} settings Settings for the editor.
@param {tinymce.EditorManager} editorManager EditorManager ins... | [
"Include",
"documentation",
"for",
"all",
"the",
"events",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L38475-L38651 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | function (name) {
var self = this, callback = self.settings[name], scope;
if (!callback) {
return;
}
// Look through lookup
if (self.callbackLookup && (scope = self.callbackLookup[name])) {
callback = scope.func;
scope = scope.scope;
}
... | javascript | function (name) {
var self = this, callback = self.settings[name], scope;
if (!callback) {
return;
}
// Look through lookup
if (self.callbackLookup && (scope = self.callbackLookup[name])) {
callback = scope.func;
scope = scope.scope;
}
... | [
"function",
"(",
"name",
")",
"{",
"var",
"self",
"=",
"this",
",",
"callback",
"=",
"self",
".",
"settings",
"[",
"name",
"]",
",",
"scope",
";",
"if",
"(",
"!",
"callback",
")",
"{",
"return",
";",
"}",
"// Look through lookup",
"if",
"(",
"self",
... | Executes a legacy callback. This method is useful to call old 2.x option callbacks.
There new event model is a better way to add callback so this method might be removed in the future.
@method execCallback
@param {String} name Name of the callback to execute.
@return {Object} Return value passed from callback function... | [
"Executes",
"a",
"legacy",
"callback",
".",
"This",
"method",
"is",
"useful",
"to",
"call",
"old",
"2",
".",
"x",
"option",
"callbacks",
".",
"There",
"new",
"event",
"model",
"is",
"a",
"better",
"way",
"to",
"add",
"callback",
"so",
"this",
"method",
... | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L39532-L39554 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (name, defaultVal, type) {
var value = name in this.settings ? this.settings[name] : defaultVal, output;
if (type === 'hash') {
output = {};
if (typeof value === 'string') {
each(value.indexOf('=') > 0 ? value.split(/[;,](?![^=;,]*(?:[;,]|$))/) : value.split(',... | javascript | function (name, defaultVal, type) {
var value = name in this.settings ? this.settings[name] : defaultVal, output;
if (type === 'hash') {
output = {};
if (typeof value === 'string') {
each(value.indexOf('=') > 0 ? value.split(/[;,](?![^=;,]*(?:[;,]|$))/) : value.split(',... | [
"function",
"(",
"name",
",",
"defaultVal",
",",
"type",
")",
"{",
"var",
"value",
"=",
"name",
"in",
"this",
".",
"settings",
"?",
"this",
".",
"settings",
"[",
"name",
"]",
":",
"defaultVal",
",",
"output",
";",
"if",
"(",
"type",
"===",
"'hash'",
... | Returns a configuration parameter by name.
@method getParam
@param {String} name Configruation parameter to retrieve.
@param {String} defaultVal Optional default value to return.
@param {String} type Optional type parameter.
@return {String} Configuration parameter value or default value.
@example
// Returns a specifi... | [
"Returns",
"a",
"configuration",
"parameter",
"by",
"name",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L39607-L39631 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (name, settings) {
var self = this;
if (settings.cmd) {
settings.onclick = function () {
self.execCommand(settings.cmd);
};
}
if (!settings.text && !settings.icon) {
settings.icon = name;
}
self.buttons = self.buttons ... | javascript | function (name, settings) {
var self = this;
if (settings.cmd) {
settings.onclick = function () {
self.execCommand(settings.cmd);
};
}
if (!settings.text && !settings.icon) {
settings.icon = name;
}
self.buttons = self.buttons ... | [
"function",
"(",
"name",
",",
"settings",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"settings",
".",
"cmd",
")",
"{",
"settings",
".",
"onclick",
"=",
"function",
"(",
")",
"{",
"self",
".",
"execCommand",
"(",
"settings",
".",
"cmd",
"... | Adds a button that later gets created by the theme in the editors toolbars.
@method addButton
@param {String} name Button name to add.
@param {Object} settings Settings object with title, cmd etc.
@example
// Adds a custom button to the editor that inserts contents when clicked
tinymce.init({
...
toolbar: 'example'
... | [
"Adds",
"a",
"button",
"that",
"later",
"gets",
"created",
"by",
"the",
"theme",
"in",
"the",
"editors",
"toolbars",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L39668-L39684 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (name, settings) {
var self = this;
if (settings.cmd) {
settings.onclick = function () {
self.execCommand(settings.cmd);
};
}
self.menuItems = self.menuItems || {};
self.menuItems[name] = settings;
} | javascript | function (name, settings) {
var self = this;
if (settings.cmd) {
settings.onclick = function () {
self.execCommand(settings.cmd);
};
}
self.menuItems = self.menuItems || {};
self.menuItems[name] = settings;
} | [
"function",
"(",
"name",
",",
"settings",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"settings",
".",
"cmd",
")",
"{",
"settings",
".",
"onclick",
"=",
"function",
"(",
")",
"{",
"self",
".",
"execCommand",
"(",
"settings",
".",
"cmd",
"... | Adds a menu item to be used in the menus of the theme. There might be multiple instances
of this menu item for example it might be used in the main menus of the theme but also in
the context menu so make sure that it's self contained and supports multiple instances.
@method addMenuItem
@param {String} name Menu item n... | [
"Adds",
"a",
"menu",
"item",
"to",
"be",
"used",
"in",
"the",
"menus",
"of",
"the",
"theme",
".",
"There",
"might",
"be",
"multiple",
"instances",
"of",
"this",
"menu",
"item",
"for",
"example",
"it",
"might",
"be",
"used",
"in",
"the",
"main",
"menus"... | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L39736-L39747 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (predicate, items) {
var self = this, selector;
self.contextToolbars = self.contextToolbars || [];
// Convert selector to predicate
if (typeof predicate == "string") {
selector = predicate;
predicate = function (elm) {
return self.dom.is(elm, se... | javascript | function (predicate, items) {
var self = this, selector;
self.contextToolbars = self.contextToolbars || [];
// Convert selector to predicate
if (typeof predicate == "string") {
selector = predicate;
predicate = function (elm) {
return self.dom.is(elm, se... | [
"function",
"(",
"predicate",
",",
"items",
")",
"{",
"var",
"self",
"=",
"this",
",",
"selector",
";",
"self",
".",
"contextToolbars",
"=",
"self",
".",
"contextToolbars",
"||",
"[",
"]",
";",
"// Convert selector to predicate",
"if",
"(",
"typeof",
"predic... | Adds a contextual toolbar to be rendered when the selector matches.
@method addContextToolbar
@param {function/string} predicate Predicate that needs to return true if provided strings get converted into CSS predicates.
@param {String/Array} items String or array with items to add to the context toolbar. | [
"Adds",
"a",
"contextual",
"toolbar",
"to",
"be",
"rendered",
"when",
"the",
"selector",
"matches",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L39756-L39774 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (pattern, desc, cmdFunc, scope) {
this.shortcuts.add(pattern, desc, cmdFunc, scope);
} | javascript | function (pattern, desc, cmdFunc, scope) {
this.shortcuts.add(pattern, desc, cmdFunc, scope);
} | [
"function",
"(",
"pattern",
",",
"desc",
",",
"cmdFunc",
",",
"scope",
")",
"{",
"this",
".",
"shortcuts",
".",
"add",
"(",
"pattern",
",",
"desc",
",",
"cmdFunc",
",",
"scope",
")",
";",
"}"
] | Adds a keyboard shortcut for some command or function.
@method addShortcut
@param {String} pattern Shortcut pattern. Like for example: ctrl+alt+o.
@param {String} desc Text description for the command.
@param {String/Function} cmdFunc Command name string or function to execute when the key is pressed.
@param {Object} ... | [
"Adds",
"a",
"keyboard",
"shortcut",
"for",
"some",
"command",
"or",
"function",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L39857-L39859 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (cmd, ui, value, args) {
return this.editorCommands.execCommand(cmd, ui, value, args);
} | javascript | function (cmd, ui, value, args) {
return this.editorCommands.execCommand(cmd, ui, value, args);
} | [
"function",
"(",
"cmd",
",",
"ui",
",",
"value",
",",
"args",
")",
"{",
"return",
"this",
".",
"editorCommands",
".",
"execCommand",
"(",
"cmd",
",",
"ui",
",",
"value",
",",
"args",
")",
";",
"}"
] | Executes a command on the current instance. These commands can be TinyMCE internal commands prefixed with "mce" or
they can be build in browser commands such as "Bold". A compleate list of browser commands is available on MSDN or Mozilla.org.
This function will dispatch the execCommand function on each plugin, theme or... | [
"Executes",
"a",
"command",
"on",
"the",
"current",
"instance",
".",
"These",
"commands",
"can",
"be",
"TinyMCE",
"internal",
"commands",
"prefixed",
"with",
"mce",
"or",
"they",
"can",
"be",
"build",
"in",
"browser",
"commands",
"such",
"as",
"Bold",
".",
... | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L39873-L39875 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (args) {
var self = this, elm = self.getElement(), html;
if (elm) {
args = args || {};
args.load = true;
html = self.setContent(elm.value !== undefined ? elm.value : elm.innerHTML, args);
args.element = elm;
if (!args.no_events) {
... | javascript | function (args) {
var self = this, elm = self.getElement(), html;
if (elm) {
args = args || {};
args.load = true;
html = self.setContent(elm.value !== undefined ? elm.value : elm.innerHTML, args);
args.element = elm;
if (!args.no_events) {
... | [
"function",
"(",
"args",
")",
"{",
"var",
"self",
"=",
"this",
",",
"elm",
"=",
"self",
".",
"getElement",
"(",
")",
",",
"html",
";",
"if",
"(",
"elm",
")",
"{",
"args",
"=",
"args",
"||",
"{",
"}",
";",
"args",
".",
"load",
"=",
"true",
";"... | Loads contents from the textarea or div element that got converted into an editor instance.
This method will move the contents from that textarea or div into the editor by using setContent
so all events etc that method has will get dispatched as well.
@method load
@param {Object} args Optional content object, this get... | [
"Loads",
"contents",
"from",
"the",
"textarea",
"or",
"div",
"element",
"that",
"got",
"converted",
"into",
"an",
"editor",
"instance",
".",
"This",
"method",
"will",
"move",
"the",
"contents",
"from",
"that",
"textarea",
"or",
"div",
"into",
"the",
"editor"... | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L40008-L40026 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (args) {
var self = this, elm = self.getElement(), html, form;
if (!elm || !self.initialized) {
return;
}
args = args || {};
args.save = true;
args.element = elm;
html = args.content = self.getContent(args);
if (!args.no_events) {
... | javascript | function (args) {
var self = this, elm = self.getElement(), html, form;
if (!elm || !self.initialized) {
return;
}
args = args || {};
args.save = true;
args.element = elm;
html = args.content = self.getContent(args);
if (!args.no_events) {
... | [
"function",
"(",
"args",
")",
"{",
"var",
"self",
"=",
"this",
",",
"elm",
"=",
"self",
".",
"getElement",
"(",
")",
",",
"html",
",",
"form",
";",
"if",
"(",
"!",
"elm",
"||",
"!",
"self",
".",
"initialized",
")",
"{",
"return",
";",
"}",
"arg... | Saves the contents from a editor out to the textarea or div element that got converted into an editor instance.
This method will move the HTML contents from the editor into that textarea or div by getContent
so all events etc that method has will get dispatched as well.
@method save
@param {Object} args Optional conte... | [
"Saves",
"the",
"contents",
"from",
"a",
"editor",
"out",
"to",
"the",
"textarea",
"or",
"div",
"element",
"that",
"got",
"converted",
"into",
"an",
"editor",
"instance",
".",
"This",
"method",
"will",
"move",
"the",
"HTML",
"contents",
"from",
"the",
"edi... | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L40037-L40087 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (content, args) {
var self = this, body = self.getBody(), forcedRootBlockName, padd;
// Setup args object
args = args || {};
args.format = args.format || 'html';
args.set = true;
args.content = content;
// Do preprocessing
if (!args.no_events) {... | javascript | function (content, args) {
var self = this, body = self.getBody(), forcedRootBlockName, padd;
// Setup args object
args = args || {};
args.format = args.format || 'html';
args.set = true;
args.content = content;
// Do preprocessing
if (!args.no_events) {... | [
"function",
"(",
"content",
",",
"args",
")",
"{",
"var",
"self",
"=",
"this",
",",
"body",
"=",
"self",
".",
"getBody",
"(",
")",
",",
"forcedRootBlockName",
",",
"padd",
";",
"// Setup args object",
"args",
"=",
"args",
"||",
"{",
"}",
";",
"args",
... | Sets the specified content to the editor instance, this will cleanup the content before it gets set using
the different cleanup rules options.
@method setContent
@param {String} content Content to set to editor, normally HTML contents but can be other formats as well.
@param {Object} args Optional content object, this... | [
"Sets",
"the",
"specified",
"content",
"to",
"the",
"editor",
"instance",
"this",
"will",
"cleanup",
"the",
"content",
"before",
"it",
"gets",
"set",
"using",
"the",
"different",
"cleanup",
"rules",
"options",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L40110-L40181 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (content, args) {
if (args) {
content = extend({ content: content }, args);
}
this.execCommand('mceInsertContent', false, content);
} | javascript | function (content, args) {
if (args) {
content = extend({ content: content }, args);
}
this.execCommand('mceInsertContent', false, content);
} | [
"function",
"(",
"content",
",",
"args",
")",
"{",
"if",
"(",
"args",
")",
"{",
"content",
"=",
"extend",
"(",
"{",
"content",
":",
"content",
"}",
",",
"args",
")",
";",
"}",
"this",
".",
"execCommand",
"(",
"'mceInsertContent'",
",",
"false",
",",
... | Inserts content at caret position.
@method insertContent
@param {String} content Content to insert.
@param {Object} args Optional args to pass to insert call. | [
"Inserts",
"content",
"at",
"caret",
"position",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L40245-L40251 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function () {
var self = this, elm;
if (!self.contentWindow) {
elm = self.iframeElement;
if (elm) {
self.contentWindow = elm.contentWindow;
}
}
return self.contentWindow;
} | javascript | function () {
var self = this, elm;
if (!self.contentWindow) {
elm = self.iframeElement;
if (elm) {
self.contentWindow = elm.contentWindow;
}
}
return self.contentWindow;
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
",",
"elm",
";",
"if",
"(",
"!",
"self",
".",
"contentWindow",
")",
"{",
"elm",
"=",
"self",
".",
"iframeElement",
";",
"if",
"(",
"elm",
")",
"{",
"self",
".",
"contentWindow",
"=",
"elm",
"... | Returns the iframes window object.
@method getWin
@return {Window} Iframe DOM window object. | [
"Returns",
"the",
"iframes",
"window",
"object",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L40354-L40366 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (url, name, elm) {
var self = this, settings = self.settings;
// Use callback instead
if (settings.urlconverter_callback) {
return self.execCallback('urlconverter_callback', url, elm, true, name);
}
// Don't convert link href since thats the CSS files that ge... | javascript | function (url, name, elm) {
var self = this, settings = self.settings;
// Use callback instead
if (settings.urlconverter_callback) {
return self.execCallback('urlconverter_callback', url, elm, true, name);
}
// Don't convert link href since thats the CSS files that ge... | [
"function",
"(",
"url",
",",
"name",
",",
"elm",
")",
"{",
"var",
"self",
"=",
"this",
",",
"settings",
"=",
"self",
".",
"settings",
";",
"// Use callback instead",
"if",
"(",
"settings",
".",
"urlconverter_callback",
")",
"{",
"return",
"self",
".",
"e... | URL converter function this gets executed each time a user adds an img, a or
any other element that has a URL in it. This will be called both by the DOM and HTML
manipulation functions.
@method convertURL
@param {string} url URL to convert.
@param {string} name Attribute name src, href etc.
@param {string/HTMLElement}... | [
"URL",
"converter",
"function",
"this",
"gets",
"executed",
"each",
"time",
"a",
"user",
"adds",
"an",
"img",
"a",
"or",
"any",
"other",
"element",
"that",
"has",
"a",
"URL",
"in",
"it",
".",
"This",
"will",
"be",
"called",
"both",
"by",
"the",
"DOM",
... | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L40411-L40433 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (elm) {
var self = this, settings = self.settings, dom = self.dom, cls;
elm = elm || self.getBody();
if (self.hasVisual === undefined) {
self.hasVisual = settings.visual;
}
each(dom.select('table,a', elm), function (elm) {
var value;
swi... | javascript | function (elm) {
var self = this, settings = self.settings, dom = self.dom, cls;
elm = elm || self.getBody();
if (self.hasVisual === undefined) {
self.hasVisual = settings.visual;
}
each(dom.select('table,a', elm), function (elm) {
var value;
swi... | [
"function",
"(",
"elm",
")",
"{",
"var",
"self",
"=",
"this",
",",
"settings",
"=",
"self",
".",
"settings",
",",
"dom",
"=",
"self",
".",
"dom",
",",
"cls",
";",
"elm",
"=",
"elm",
"||",
"self",
".",
"getBody",
"(",
")",
";",
"if",
"(",
"self"... | Adds visual aid for tables, anchors etc so they can be more easily edited inside the editor.
@method addVisual
@param {Element} elm Optional root element to loop though to find tables etc that needs the visual aid. | [
"Adds",
"visual",
"aid",
"for",
"tables",
"anchors",
"etc",
"so",
"they",
"can",
"be",
"more",
"easily",
"edited",
"inside",
"the",
"editor",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L40441-L40483 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function () {
var self = this;
if (!self.removed) {
self.save();
self.removed = 1;
self.unbindAllNativeEvents();
// Remove any hidden input
if (self.hasHiddenInput) {
DOM.remove(self.getElement().nextSibling);
}
if (!se... | javascript | function () {
var self = this;
if (!self.removed) {
self.save();
self.removed = 1;
self.unbindAllNativeEvents();
// Remove any hidden input
if (self.hasHiddenInput) {
DOM.remove(self.getElement().nextSibling);
}
if (!se... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"!",
"self",
".",
"removed",
")",
"{",
"self",
".",
"save",
"(",
")",
";",
"self",
".",
"removed",
"=",
"1",
";",
"self",
".",
"unbindAllNativeEvents",
"(",
")",
";",
"// Remo... | Removes the editor from the dom and tinymce collection.
@method remove | [
"Removes",
"the",
"editor",
"from",
"the",
"dom",
"and",
"tinymce",
"collection",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L40490-L40522 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (automatic) {
var self = this, form;
// One time is enough
if (self.destroyed) {
return;
}
// If user manually calls destroy and not remove
// Users seems to have logic that calls destroy instead of remove
if (!automatic && !self.removed) {
... | javascript | function (automatic) {
var self = this, form;
// One time is enough
if (self.destroyed) {
return;
}
// If user manually calls destroy and not remove
// Users seems to have logic that calls destroy instead of remove
if (!automatic && !self.removed) {
... | [
"function",
"(",
"automatic",
")",
"{",
"var",
"self",
"=",
"this",
",",
"form",
";",
"// One time is enough",
"if",
"(",
"self",
".",
"destroyed",
")",
"{",
"return",
";",
"}",
"// If user manually calls destroy and not remove",
"// Users seems to have logic that cal... | Destroys the editor instance by removing all events, element references or other resources
that could leak memory. This method will be called automatically when the page is unloaded
but you can also call it directly if you know what you are doing.
@method destroy
@param {Boolean} automatic Optional state if the destro... | [
"Destroys",
"the",
"editor",
"instance",
"by",
"removing",
"all",
"events",
"element",
"references",
"or",
"other",
"resources",
"that",
"could",
"leak",
"memory",
".",
"This",
"method",
"will",
"be",
"called",
"automatically",
"when",
"the",
"page",
"is",
"un... | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L40532-L40579 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (newCode) {
if (newCode) {
code = newCode;
this.rtl = this.data[newCode] ? this.data[newCode]._dir === 'rtl' : false;
}
} | javascript | function (newCode) {
if (newCode) {
code = newCode;
this.rtl = this.data[newCode] ? this.data[newCode]._dir === 'rtl' : false;
}
} | [
"function",
"(",
"newCode",
")",
"{",
"if",
"(",
"newCode",
")",
"{",
"code",
"=",
"newCode",
";",
"this",
".",
"rtl",
"=",
"this",
".",
"data",
"[",
"newCode",
"]",
"?",
"this",
".",
"data",
"[",
"newCode",
"]",
".",
"_dir",
"===",
"'rtl'",
":",... | Sets the current language code.
@method setCode
@param {String} newCode Current language code. | [
"Sets",
"the",
"current",
"language",
"code",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L40638-L40643 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (code, items) {
var langData = data[code];
if (!langData) {
data[code] = langData = {};
}
for (var name in items) {
langData[name] = items[name];
}
this.setCode(code);
} | javascript | function (code, items) {
var langData = data[code];
if (!langData) {
data[code] = langData = {};
}
for (var name in items) {
langData[name] = items[name];
}
this.setCode(code);
} | [
"function",
"(",
"code",
",",
"items",
")",
"{",
"var",
"langData",
"=",
"data",
"[",
"code",
"]",
";",
"if",
"(",
"!",
"langData",
")",
"{",
"data",
"[",
"code",
"]",
"=",
"langData",
"=",
"{",
"}",
";",
"}",
"for",
"(",
"var",
"name",
"in",
... | Adds translations for a specific language code.
@method add
@param {String} code Language code like sv_SE.
@param {Array} items Name/value array with English en_US to sv_SE. | [
"Adds",
"translations",
"for",
"a",
"specific",
"language",
"code",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L40670-L40682 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (text) {
var langData = data[code] || {};
/**
* number - string
* null, undefined and empty string - empty string
* array - comma-delimited string
* object - in [object Object]
* function - in [object Function]
*
* @param obj
... | javascript | function (text) {
var langData = data[code] || {};
/**
* number - string
* null, undefined and empty string - empty string
* array - comma-delimited string
* object - in [object Object]
* function - in [object Function]
*
* @param obj
... | [
"function",
"(",
"text",
")",
"{",
"var",
"langData",
"=",
"data",
"[",
"code",
"]",
"||",
"{",
"}",
";",
"/**\n * number - string\n * null, undefined and empty string - empty string\n * array - comma-delimited string\n * object - in [object Object]\n ... | Translates the specified text.
It has a few formats:
I18n.translate("Text");
I18n.translate(["Text {0}/{1}", 0, 1]);
I18n.translate({raw: "Raw string"});
@method translate
@param {String/Object/Array} text Text to translate.
@return {String} String that got translated. | [
"Translates",
"the",
"specified",
"text",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L40696-L40743 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (defaultSettings) {
var baseUrl, suffix;
baseUrl = defaultSettings.base_url;
if (baseUrl) {
this.baseURL = new URI(this.documentBaseURL).toAbsolute(baseUrl.replace(/\/+$/, ''));
this.baseURI = new URI(this.baseURL);
}
suffix = defaultSettings.suffix... | javascript | function (defaultSettings) {
var baseUrl, suffix;
baseUrl = defaultSettings.base_url;
if (baseUrl) {
this.baseURL = new URI(this.documentBaseURL).toAbsolute(baseUrl.replace(/\/+$/, ''));
this.baseURI = new URI(this.baseURL);
}
suffix = defaultSettings.suffix... | [
"function",
"(",
"defaultSettings",
")",
"{",
"var",
"baseUrl",
",",
"suffix",
";",
"baseUrl",
"=",
"defaultSettings",
".",
"base_url",
";",
"if",
"(",
"baseUrl",
")",
"{",
"this",
".",
"baseURL",
"=",
"new",
"URI",
"(",
"this",
".",
"documentBaseURL",
"... | Overrides the default settings for editor instances.
@method overrideDefaults
@param {Object} defaultSettings Defaults settings object. | [
"Overrides",
"the",
"default",
"settings",
"for",
"editor",
"instances",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L41383-L41403 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (editor) {
var self = this, editors = self.editors;
// Add named and index editor instance
editors[editor.id] = editor;
editors.push(editor);
toggleGlobalEvents(editors, true);
// Doesn't call setActive method since we don't want
// to fire a bunch of ... | javascript | function (editor) {
var self = this, editors = self.editors;
// Add named and index editor instance
editors[editor.id] = editor;
editors.push(editor);
toggleGlobalEvents(editors, true);
// Doesn't call setActive method since we don't want
// to fire a bunch of ... | [
"function",
"(",
"editor",
")",
"{",
"var",
"self",
"=",
"this",
",",
"editors",
"=",
"self",
".",
"editors",
";",
"// Add named and index editor instance",
"editors",
"[",
"editor",
".",
"id",
"]",
"=",
"editor",
";",
"editors",
".",
"push",
"(",
"editor"... | Adds an editor instance to the editor collection. This will also set it as the active editor.
@method add
@param {tinymce.Editor} editor Editor instance to add to the collection.
@return {tinymce.Editor} The same instance that got passed in. | [
"Adds",
"an",
"editor",
"instance",
"to",
"the",
"editor",
"collection",
".",
"This",
"will",
"also",
"set",
"it",
"as",
"the",
"active",
"editor",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L41642-L41666 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (selector) {
var self = this, i, editors = self.editors, editor;
// Remove all editors
if (!selector) {
for (i = editors.length - 1; i >= 0; i--) {
self.remove(editors[i]);
}
return;
}
// Remove editors by selector
if ... | javascript | function (selector) {
var self = this, i, editors = self.editors, editor;
// Remove all editors
if (!selector) {
for (i = editors.length - 1; i >= 0; i--) {
self.remove(editors[i]);
}
return;
}
// Remove editors by selector
if ... | [
"function",
"(",
"selector",
")",
"{",
"var",
"self",
"=",
"this",
",",
"i",
",",
"editors",
"=",
"self",
".",
"editors",
",",
"editor",
";",
"// Remove all editors",
"if",
"(",
"!",
"selector",
")",
"{",
"for",
"(",
"i",
"=",
"editors",
".",
"length... | Removes a editor or editors form page.
@example
// Remove all editors bound to divs
tinymce.remove('div');
// Remove all editors bound to textareas
tinymce.remove('textarea');
// Remove all editors
tinymce.remove();
// Remove specific instance by id
tinymce.remove('#id');
@method remove
@param {tinymce.Editor/Stri... | [
"Removes",
"a",
"editor",
"or",
"editors",
"form",
"page",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L41700-L41748 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (cmd, ui, value) {
var self = this, editor = self.get(value);
// Manager commands
switch (cmd) {
case "mceAddEditor":
if (!self.get(value)) {
new Editor(value, self.settings, self).render();
}
return true;
case "mc... | javascript | function (cmd, ui, value) {
var self = this, editor = self.get(value);
// Manager commands
switch (cmd) {
case "mceAddEditor":
if (!self.get(value)) {
new Editor(value, self.settings, self).render();
}
return true;
case "mc... | [
"function",
"(",
"cmd",
",",
"ui",
",",
"value",
")",
"{",
"var",
"self",
"=",
"this",
",",
"editor",
"=",
"self",
".",
"get",
"(",
"value",
")",
";",
"// Manager commands",
"switch",
"(",
"cmd",
")",
"{",
"case",
"\"mceAddEditor\"",
":",
"if",
"(",
... | Executes a specific command on the currently active editor.
@method execCommand
@param {String} cmd Command to perform for example Bold.
@param {Boolean} ui Optional boolean state if a UI should be presented for the command or not.
@param {String} value Optional value parameter like for example an URL to a link.
@retu... | [
"Executes",
"a",
"specific",
"command",
"on",
"the",
"currently",
"active",
"editor",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L41759-L41799 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | load | function load() {
var key, data, value, pos = 0;
items = {};
// localStorage can be disabled on WebKit/Gecko so make a dummy storage
if (!hasOldIEDataSupport) {
return;
}
function next(end) {
var value, nextPos;
nextPos = end !== undefined ? pos + end : da... | javascript | function load() {
var key, data, value, pos = 0;
items = {};
// localStorage can be disabled on WebKit/Gecko so make a dummy storage
if (!hasOldIEDataSupport) {
return;
}
function next(end) {
var value, nextPos;
nextPos = end !== undefined ? pos + end : da... | [
"function",
"load",
"(",
")",
"{",
"var",
"key",
",",
"data",
",",
"value",
",",
"pos",
"=",
"0",
";",
"items",
"=",
"{",
"}",
";",
"// localStorage can be disabled on WebKit/Gecko so make a dummy storage",
"if",
"(",
"!",
"hasOldIEDataSupport",
")",
"{",
"ret... | Loads the userData string and parses it into the items structure. | [
"Loads",
"the",
"userData",
"string",
"and",
"parses",
"it",
"into",
"the",
"items",
"structure",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L42323-L42372 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | save | function save() {
var value, data = '';
// localStorage can be disabled on WebKit/Gecko so make a dummy storage
if (!hasOldIEDataSupport) {
return;
}
for (var key in items) {
value = items[key];
data += (data ? ',' : '') + key.length.toString(32) + ',' + key + ','... | javascript | function save() {
var value, data = '';
// localStorage can be disabled on WebKit/Gecko so make a dummy storage
if (!hasOldIEDataSupport) {
return;
}
for (var key in items) {
value = items[key];
data += (data ? ',' : '') + key.length.toString(32) + ',' + key + ','... | [
"function",
"save",
"(",
")",
"{",
"var",
"value",
",",
"data",
"=",
"''",
";",
"// localStorage can be disabled on WebKit/Gecko so make a dummy storage",
"if",
"(",
"!",
"hasOldIEDataSupport",
")",
"{",
"return",
";",
"}",
"for",
"(",
"var",
"key",
"in",
"items... | Saves the items structure into a the userData format. | [
"Saves",
"the",
"items",
"structure",
"into",
"a",
"the",
"userData",
"format",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L42377-L42399 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | function (items) {
var self = this, settings = self.settings, firstClass, lastClass, firstItem, lastItem;
firstClass = settings.firstControlClass;
lastClass = settings.lastControlClass;
items.each(function (item) {
item.classes.remove(firstClass).remove(lastClass).add(setting... | javascript | function (items) {
var self = this, settings = self.settings, firstClass, lastClass, firstItem, lastItem;
firstClass = settings.firstControlClass;
lastClass = settings.lastControlClass;
items.each(function (item) {
item.classes.remove(firstClass).remove(lastClass).add(setting... | [
"function",
"(",
"items",
")",
"{",
"var",
"self",
"=",
"this",
",",
"settings",
"=",
"self",
".",
"settings",
",",
"firstClass",
",",
"lastClass",
",",
"firstItem",
",",
"lastItem",
";",
"firstClass",
"=",
"settings",
".",
"firstControlClass",
";",
"lastC... | Applies layout classes to the container.
@private | [
"Applies",
"layout",
"classes",
"to",
"the",
"container",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L42869-L42894 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (container) {
var self = this, html = '';
self.applyClasses(container.items());
container.items().each(function (item) {
html += item.renderHtml();
});
return html;
} | javascript | function (container) {
var self = this, html = '';
self.applyClasses(container.items());
container.items().each(function (item) {
html += item.renderHtml();
});
return html;
} | [
"function",
"(",
"container",
")",
"{",
"var",
"self",
"=",
"this",
",",
"html",
"=",
"''",
";",
"self",
".",
"applyClasses",
"(",
"container",
".",
"items",
"(",
")",
")",
";",
"container",
".",
"items",
"(",
")",
".",
"each",
"(",
"function",
"("... | Renders the specified container and any layout specific HTML.
@method renderHtml
@param {tinymce.ui.Container} container Container to render HTML for. | [
"Renders",
"the",
"specified",
"container",
"and",
"any",
"layout",
"specific",
"HTML",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L42902-L42912 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (settings) {
var self = this, size;
self._super(settings);
settings = self.settings;
size = self.settings.size;
self.on('click mousedown', function (e) {
e.preventDefault();
});
self.on('touchstart', function (e) {
self.fire('click... | javascript | function (settings) {
var self = this, size;
self._super(settings);
settings = self.settings;
size = self.settings.size;
self.on('click mousedown', function (e) {
e.preventDefault();
});
self.on('touchstart', function (e) {
self.fire('click... | [
"function",
"(",
"settings",
")",
"{",
"var",
"self",
"=",
"this",
",",
"size",
";",
"self",
".",
"_super",
"(",
"settings",
")",
";",
"settings",
"=",
"self",
".",
"settings",
";",
"size",
"=",
"self",
".",
"settings",
".",
"size",
";",
"self",
".... | Constructs a new button instance with the specified settings.
@constructor
@param {Object} settings Name/value object with settings.
@setting {String} size Size of the button small|medium|large.
@setting {String} image Image to use for icon.
@setting {String} icon Icon to use for button. | [
"Constructs",
"a",
"new",
"button",
"instance",
"with",
"the",
"specified",
"settings",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L43052-L43080 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function () {
var btnElm = this.getEl().firstChild,
btnStyle;
if (btnElm) {
btnStyle = btnElm.style;
btnStyle.width = btnStyle.height = "100%";
}
this._super();
} | javascript | function () {
var btnElm = this.getEl().firstChild,
btnStyle;
if (btnElm) {
btnStyle = btnElm.style;
btnStyle.width = btnStyle.height = "100%";
}
this._super();
} | [
"function",
"(",
")",
"{",
"var",
"btnElm",
"=",
"this",
".",
"getEl",
"(",
")",
".",
"firstChild",
",",
"btnStyle",
";",
"if",
"(",
"btnElm",
")",
"{",
"btnStyle",
"=",
"btnElm",
".",
"style",
";",
"btnStyle",
".",
"width",
"=",
"btnStyle",
".",
"... | Repaints the button for example after it's been resizes by a layout engine.
@method repaint | [
"Repaints",
"the",
"button",
"for",
"example",
"after",
"it",
"s",
"been",
"resizes",
"by",
"a",
"layout",
"engine",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L43104-L43114 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (settings) {
var self = this;
self._super(settings);
self.on('click mousedown', function (e) {
e.preventDefault();
});
self.on('click', function (e) {
e.preventDefault();
if (!self.disabled()) {
self.checked(!self.checked());... | javascript | function (settings) {
var self = this;
self._super(settings);
self.on('click mousedown', function (e) {
e.preventDefault();
});
self.on('click', function (e) {
e.preventDefault();
if (!self.disabled()) {
self.checked(!self.checked());... | [
"function",
"(",
"settings",
")",
"{",
"var",
"self",
"=",
"this",
";",
"self",
".",
"_super",
"(",
"settings",
")",
";",
"self",
".",
"on",
"(",
"'click mousedown'",
",",
"function",
"(",
"e",
")",
"{",
"e",
".",
"preventDefault",
"(",
")",
";",
"... | Constructs a new Checkbox instance with the specified settings.
@constructor
@param {Object} settings Name/value object with settings.
@setting {Boolean} checked True if the checkbox should be checked by default. | [
"Constructs",
"a",
"new",
"Checkbox",
"instance",
"with",
"the",
"specified",
"settings",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L43322-L43340 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function () {
var self = this, settings = self.settings;
self.active(true);
if (!self.panel) {
var panelSettings = settings.panel;
// Wrap panel in grid layout if type if specified
// This makes it possible to add forms or other containers directly in the panel o... | javascript | function () {
var self = this, settings = self.settings;
self.active(true);
if (!self.panel) {
var panelSettings = settings.panel;
// Wrap panel in grid layout if type if specified
// This makes it possible to add forms or other containers directly in the panel o... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
",",
"settings",
"=",
"self",
".",
"settings",
";",
"self",
".",
"active",
"(",
"true",
")",
";",
"if",
"(",
"!",
"self",
".",
"panel",
")",
"{",
"var",
"panelSettings",
"=",
"settings",
".",
... | Shows the panel for the button.
@method showPanel | [
"Shows",
"the",
"panel",
"for",
"the",
"button",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L44020-L44057 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function () {
var self = this, items = self.items();
if (!self.settings.formItemDefaults) {
self.settings.formItemDefaults = {
layout: 'flex',
autoResize: "overflow",
defaults: { flex: 1 }
};
}
// Wrap any labeled items in FormIte... | javascript | function () {
var self = this, items = self.items();
if (!self.settings.formItemDefaults) {
self.settings.formItemDefaults = {
layout: 'flex',
autoResize: "overflow",
defaults: { flex: 1 }
};
}
// Wrap any labeled items in FormIte... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
",",
"items",
"=",
"self",
".",
"items",
"(",
")",
";",
"if",
"(",
"!",
"self",
".",
"settings",
".",
"formItemDefaults",
")",
"{",
"self",
".",
"settings",
".",
"formItemDefaults",
"=",
"{",
"... | This method gets invoked before the control is rendered.
@method preRender | [
"This",
"method",
"gets",
"invoked",
"before",
"the",
"control",
"is",
"rendered",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L44779-L44817 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (html, callback) {
var self = this, body = this.getEl().contentWindow.document.body;
// Wait for iframe to initialize IE 10 takes time
if (!body) {
Delay.setTimeout(function () {
self.html(html);
});
} else {
body.innerHTML = html;
... | javascript | function (html, callback) {
var self = this, body = this.getEl().contentWindow.document.body;
// Wait for iframe to initialize IE 10 takes time
if (!body) {
Delay.setTimeout(function () {
self.html(html);
});
} else {
body.innerHTML = html;
... | [
"function",
"(",
"html",
",",
"callback",
")",
"{",
"var",
"self",
"=",
"this",
",",
"body",
"=",
"this",
".",
"getEl",
"(",
")",
".",
"contentWindow",
".",
"document",
".",
"body",
";",
"// Wait for iframe to initialize IE 10 takes time",
"if",
"(",
"!",
... | Inner HTML for the iframe.
@method html
@param {String} html HTML string to set as HTML inside the iframe.
@param {function} callback Optional callback to execute when the iframe body is filled with contents.
@return {tinymce.ui.Iframe} Current iframe control. | [
"Inner",
"HTML",
"for",
"the",
"iframe",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L46877-L46894 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (toggle) {
var self = this, menu;
if (self.menu && self.menu.visible() && toggle !== false) {
return self.hideMenu();
}
if (!self.menu) {
menu = self.state.get('menu') || [];
// Is menu array then auto constuct menu control
if (menu.len... | javascript | function (toggle) {
var self = this, menu;
if (self.menu && self.menu.visible() && toggle !== false) {
return self.hideMenu();
}
if (!self.menu) {
menu = self.state.get('menu') || [];
// Is menu array then auto constuct menu control
if (menu.len... | [
"function",
"(",
"toggle",
")",
"{",
"var",
"self",
"=",
"this",
",",
"menu",
";",
"if",
"(",
"self",
".",
"menu",
"&&",
"self",
".",
"menu",
".",
"visible",
"(",
")",
"&&",
"toggle",
"!==",
"false",
")",
"{",
"return",
"self",
".",
"hideMenu",
"... | Shows the menu for the button.
@method showMenu | [
"Shows",
"the",
"menu",
"for",
"the",
"button",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L47314-L47368 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function () {
var self = this;
if (self.menu) {
self.menu.items().each(function (item) {
if (item.hideMenu) {
item.hideMenu();
}
});
self.menu.hide();
}
} | javascript | function () {
var self = this;
if (self.menu) {
self.menu.items().each(function (item) {
if (item.hideMenu) {
item.hideMenu();
}
});
self.menu.hide();
}
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"self",
".",
"menu",
")",
"{",
"self",
".",
"menu",
".",
"items",
"(",
")",
".",
"each",
"(",
"function",
"(",
"item",
")",
"{",
"if",
"(",
"item",
".",
"hideMenu",
")",
"... | Hides the menu for the button.
@method hideMenu | [
"Hides",
"the",
"menu",
"for",
"the",
"button",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L47375-L47387 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function () {
var self = this, settings = self.settings, menu, parent = self.parent();
parent.items().each(function (ctrl) {
if (ctrl !== self) {
ctrl.hideMenu();
}
});
if (settings.menu) {
menu = self.menu;
if (!menu) {
... | javascript | function () {
var self = this, settings = self.settings, menu, parent = self.parent();
parent.items().each(function (ctrl) {
if (ctrl !== self) {
ctrl.hideMenu();
}
});
if (settings.menu) {
menu = self.menu;
if (!menu) {
... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
",",
"settings",
"=",
"self",
".",
"settings",
",",
"menu",
",",
"parent",
"=",
"self",
".",
"parent",
"(",
")",
";",
"parent",
".",
"items",
"(",
")",
".",
"each",
"(",
"function",
"(",
"ctr... | Shows the menu for the menu item.
@method showMenu | [
"Shows",
"the",
"menu",
"for",
"the",
"menu",
"item",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L47619-L47693 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function () {
var self = this;
if (self.menu) {
self.menu.items().each(function (item) {
if (item.hideMenu) {
item.hideMenu();
}
});
self.menu.hide();
self.aria('expanded', false);
}
return self;
} | javascript | function () {
var self = this;
if (self.menu) {
self.menu.items().each(function (item) {
if (item.hideMenu) {
item.hideMenu();
}
});
self.menu.hide();
self.aria('expanded', false);
}
return self;
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"self",
".",
"menu",
")",
"{",
"self",
".",
"menu",
".",
"items",
"(",
")",
".",
"each",
"(",
"function",
"(",
"item",
")",
"{",
"if",
"(",
"item",
".",
"hideMenu",
")",
"... | Hides the menu for the menu item.
@method hideMenu | [
"Hides",
"the",
"menu",
"for",
"the",
"menu",
"item",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L47700-L47715 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function () {
var self = this, time, factory;
function hideThrobber() {
if (self.throbber) {
self.throbber.hide();
self.throbber = null;
}
}
factory = self.settings.itemsFactory;
if (!factory) {
return;
}
if... | javascript | function () {
var self = this, time, factory;
function hideThrobber() {
if (self.throbber) {
self.throbber.hide();
self.throbber = null;
}
}
factory = self.settings.itemsFactory;
if (!factory) {
return;
}
if... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
",",
"time",
",",
"factory",
";",
"function",
"hideThrobber",
"(",
")",
"{",
"if",
"(",
"self",
".",
"throbber",
")",
"{",
"self",
".",
"throbber",
".",
"hide",
"(",
")",
";",
"self",
".",
"t... | Loads new items from the factory items function.
@method load | [
"Loads",
"new",
"items",
"from",
"the",
"factory",
"items",
"function",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L48078-L48132 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function () {
var self = this;
self.items().each(function (ctrl) {
var settings = ctrl.settings;
if (settings.icon || settings.image || settings.selectable) {
self._hasIcons = true;
return false;
}
});
if (self.settings.itemsFactor... | javascript | function () {
var self = this;
self.items().each(function (ctrl) {
var settings = ctrl.settings;
if (settings.icon || settings.image || settings.selectable) {
self._hasIcons = true;
return false;
}
});
if (self.settings.itemsFactor... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"self",
".",
"items",
"(",
")",
".",
"each",
"(",
"function",
"(",
"ctrl",
")",
"{",
"var",
"settings",
"=",
"ctrl",
".",
"settings",
";",
"if",
"(",
"settings",
".",
"icon",
"||",
"sett... | Invoked before the menu is rendered.
@method preRender | [
"Invoked",
"before",
"the",
"menu",
"is",
"rendered",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L48152-L48173 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (idx) {
var activeTabElm;
if (this.activeTabId) {
activeTabElm = this.getEl(this.activeTabId);
$(activeTabElm).removeClass(this.classPrefix + 'active');
activeTabElm.setAttribute('aria-selected', "false");
}
this.activeTabId = 't' + idx;
... | javascript | function (idx) {
var activeTabElm;
if (this.activeTabId) {
activeTabElm = this.getEl(this.activeTabId);
$(activeTabElm).removeClass(this.classPrefix + 'active');
activeTabElm.setAttribute('aria-selected', "false");
}
this.activeTabId = 't' + idx;
... | [
"function",
"(",
"idx",
")",
"{",
"var",
"activeTabElm",
";",
"if",
"(",
"this",
".",
"activeTabId",
")",
"{",
"activeTabElm",
"=",
"this",
".",
"getEl",
"(",
"this",
".",
"activeTabId",
")",
";",
"$",
"(",
"activeTabElm",
")",
".",
"removeClass",
"(",... | Activates the specified tab by index.
@method activateTab
@param {Number} idx Index of the tab to activate. | [
"Activates",
"the",
"specified",
"tab",
"by",
"index",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L49079-L49102 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (editor, size) {
var toolbars = [], settings = editor.settings;
var addToolbar = function (items) {
if (items) {
toolbars.push(createToolbar(editor, items, size));
return true;
}
};
// Convert toolbar array to multiple options
if (Tools.isArra... | javascript | function (editor, size) {
var toolbars = [], settings = editor.settings;
var addToolbar = function (items) {
if (items) {
toolbars.push(createToolbar(editor, items, size));
return true;
}
};
// Convert toolbar array to multiple options
if (Tools.isArra... | [
"function",
"(",
"editor",
",",
"size",
")",
"{",
"var",
"toolbars",
"=",
"[",
"]",
",",
"settings",
"=",
"editor",
".",
"settings",
";",
"var",
"addToolbar",
"=",
"function",
"(",
"items",
")",
"{",
"if",
"(",
"items",
")",
"{",
"toolbars",
".",
"... | Creates the toolbars from config and returns a toolbar array.
@param {String} size Optional toolbar item size.
@return {Array} Array with toolbars. | [
"Creates",
"the",
"toolbars",
"from",
"config",
"and",
"returns",
"a",
"toolbar",
"array",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L50142-L50188 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (rng) {
var bookmark = {};
var setupEndPoint = function (start) {
var offsetNode, container, offset;
container = rng[start ? 'startContainer' : 'endContainer'];
offset = rng[start ? 'startOffset' : 'endOffset'];
if (container.nodeType === 1) {
offsetNode... | javascript | function (rng) {
var bookmark = {};
var setupEndPoint = function (start) {
var offsetNode, container, offset;
container = rng[start ? 'startContainer' : 'endContainer'];
offset = rng[start ? 'startOffset' : 'endOffset'];
if (container.nodeType === 1) {
offsetNode... | [
"function",
"(",
"rng",
")",
"{",
"var",
"bookmark",
"=",
"{",
"}",
";",
"var",
"setupEndPoint",
"=",
"function",
"(",
"start",
")",
"{",
"var",
"offsetNode",
",",
"container",
",",
"offset",
";",
"container",
"=",
"rng",
"[",
"start",
"?",
"'startCont... | Returns a range bookmark. This will convert indexed bookmarks into temporary span elements with
index 0 so that they can be restored properly after the DOM has been modified. Text bookmarks will not have spans
added to them since they can be restored after a dom operation.
So this: <p><b>|</b><b>|</b></p>
becomes: <p>... | [
"Returns",
"a",
"range",
"bookmark",
".",
"This",
"will",
"convert",
"indexed",
"bookmarks",
"into",
"temporary",
"span",
"elements",
"with",
"index",
"0",
"so",
"that",
"they",
"can",
"be",
"restored",
"properly",
"after",
"the",
"DOM",
"has",
"been",
"modi... | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L52414-L52453 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | genReplacer | function genReplacer(nodeName) {
var makeReplacementNode;
if (typeof nodeName != 'function') {
var stencilNode = nodeName.nodeType ? nodeName : doc.createElement(nodeName);
makeReplacementNode = function (fill, matchIndex) {
var clone = stencilNode.cloneNode(false);
... | javascript | function genReplacer(nodeName) {
var makeReplacementNode;
if (typeof nodeName != 'function') {
var stencilNode = nodeName.nodeType ? nodeName : doc.createElement(nodeName);
makeReplacementNode = function (fill, matchIndex) {
var clone = stencilNode.cloneNode(false);
... | [
"function",
"genReplacer",
"(",
"nodeName",
")",
"{",
"var",
"makeReplacementNode",
";",
"if",
"(",
"typeof",
"nodeName",
"!=",
"'function'",
")",
"{",
"var",
"stencilNode",
"=",
"nodeName",
".",
"nodeType",
"?",
"nodeName",
":",
"doc",
".",
"createElement",
... | Generates the actual replaceFn which splits up text nodes
and inserts the replacement element. | [
"Generates",
"the",
"actual",
"replaceFn",
"which",
"splits",
"up",
"text",
"nodes",
"and",
"inserts",
"the",
"replacement",
"element",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L57398-L57474 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | function(xs, f) {
for (var i = 0, len = xs.length; i < len; i++) {
var x = xs[i];
f(x, i, xs);
}
} | javascript | function(xs, f) {
for (var i = 0, len = xs.length; i < len; i++) {
var x = xs[i];
f(x, i, xs);
}
} | [
"function",
"(",
"xs",
",",
"f",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"xs",
".",
"length",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"{",
"var",
"x",
"=",
"xs",
"[",
"i",
"]",
";",
"f",
"(",
"x",
",",
"i",
","... | Unwound implementing other functions in terms of each. The code size is roughly the same, and it should allow for better optimisation. | [
"Unwound",
"implementing",
"other",
"functions",
"in",
"terms",
"of",
"each",
".",
"The",
"code",
"size",
"is",
"roughly",
"the",
"same",
"and",
"it",
"should",
"allow",
"for",
"better",
"optimisation",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L59208-L59213 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | function (scope, predicate) {
var result = [];
var dom = scope.dom();
var children = Arr.map(dom.childNodes, Element.fromDom);
Arr.each(children, function (x) {
if (predicate(x)) {
result = result.concat([ x ]);
}
result = result.concat(filterDescendants(x, pre... | javascript | function (scope, predicate) {
var result = [];
var dom = scope.dom();
var children = Arr.map(dom.childNodes, Element.fromDom);
Arr.each(children, function (x) {
if (predicate(x)) {
result = result.concat([ x ]);
}
result = result.concat(filterDescendants(x, pre... | [
"function",
"(",
"scope",
",",
"predicate",
")",
"{",
"var",
"result",
"=",
"[",
"]",
";",
"var",
"dom",
"=",
"scope",
".",
"dom",
"(",
")",
";",
"var",
"children",
"=",
"Arr",
".",
"map",
"(",
"dom",
".",
"childNodes",
",",
"Element",
".",
"from... | inlined sugars PredicateFilter.descendants for file size | [
"inlined",
"sugars",
"PredicateFilter",
".",
"descendants",
"for",
"file",
"size"
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L59643-L59655 | train | |
sadiqhabib/tinymce-dist | tinymce.full.js | fixTableCaretPos | function fixTableCaretPos() {
editor.on('KeyDown SetContent VisualAid', function () {
var last;
// Skip empty text nodes from the end
for (last = editor.getBody().lastChild; last; last = last.previousSibling) {
if (last.nodeType == 3) {
if (last.nodeValue... | javascript | function fixTableCaretPos() {
editor.on('KeyDown SetContent VisualAid', function () {
var last;
// Skip empty text nodes from the end
for (last = editor.getBody().lastChild; last; last = last.previousSibling) {
if (last.nodeType == 3) {
if (last.nodeValue... | [
"function",
"fixTableCaretPos",
"(",
")",
"{",
"editor",
".",
"on",
"(",
"'KeyDown SetContent VisualAid'",
",",
"function",
"(",
")",
"{",
"var",
"last",
";",
"// Skip empty text nodes from the end",
"for",
"(",
"last",
"=",
"editor",
".",
"getBody",
"(",
")",
... | Fixes an issue on Gecko where it's impossible to place the caret behind a table This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled | [
"Fixes",
"an",
"issue",
"on",
"Gecko",
"where",
"it",
"s",
"impossible",
"to",
"place",
"the",
"caret",
"behind",
"a",
"table",
"This",
"fix",
"will",
"force",
"a",
"paragraph",
"element",
"after",
"the",
"table",
"but",
"only",
"when",
"the",
"forced_root... | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L64545-L64583 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | fixTableCellSelection | function fixTableCellSelection() {
function tableCellSelected(ed, rng, n, currentCell) {
// The decision of when a table cell is selected is somewhat involved. The fact that this code is
// required is actually a pointer to the root cause of this bug. A cell is selected when the start
... | javascript | function fixTableCellSelection() {
function tableCellSelected(ed, rng, n, currentCell) {
// The decision of when a table cell is selected is somewhat involved. The fact that this code is
// required is actually a pointer to the root cause of this bug. A cell is selected when the start
... | [
"function",
"fixTableCellSelection",
"(",
")",
"{",
"function",
"tableCellSelected",
"(",
"ed",
",",
"rng",
",",
"n",
",",
"currentCell",
")",
"{",
"// The decision of when a table cell is selected is somewhat involved. The fact that this code is",
"// required is actually a poi... | this nasty hack is here to work around some WebKit selection bugs. | [
"this",
"nasty",
"hack",
"is",
"here",
"to",
"work",
"around",
"some",
"WebKit",
"selection",
"bugs",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L64586-L64645 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | deleteTable | function deleteTable() {
function placeCaretInCell(cell) {
editor.selection.select(cell, true);
editor.selection.collapse(true);
}
function clearCell(cell) {
editor.$(cell).empty();
Utils.paddCell(cell);
}
editor.on('keydown', function (e... | javascript | function deleteTable() {
function placeCaretInCell(cell) {
editor.selection.select(cell, true);
editor.selection.collapse(true);
}
function clearCell(cell) {
editor.$(cell).empty();
Utils.paddCell(cell);
}
editor.on('keydown', function (e... | [
"function",
"deleteTable",
"(",
")",
"{",
"function",
"placeCaretInCell",
"(",
"cell",
")",
"{",
"editor",
".",
"selection",
".",
"select",
"(",
"cell",
",",
"true",
")",
";",
"editor",
".",
"selection",
".",
"collapse",
"(",
"true",
")",
";",
"}",
"fu... | Delete table if all cells are selected. | [
"Delete",
"table",
"if",
"all",
"cells",
"are",
"selected",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L64650-L64697 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | styleTDTH | function styleTDTH(elm, name, value) {
if (elm.tagName === "TD" || elm.tagName === "TH") {
dom.setStyle(elm, name, value);
} else {
if (elm.children) {
for (var i = 0; i < elm.children.length; i++) {
styleTDTH(elm.children[i], name, v... | javascript | function styleTDTH(elm, name, value) {
if (elm.tagName === "TD" || elm.tagName === "TH") {
dom.setStyle(elm, name, value);
} else {
if (elm.children) {
for (var i = 0; i < elm.children.length; i++) {
styleTDTH(elm.children[i], name, v... | [
"function",
"styleTDTH",
"(",
"elm",
",",
"name",
",",
"value",
")",
"{",
"if",
"(",
"elm",
".",
"tagName",
"===",
"\"TD\"",
"||",
"elm",
".",
"tagName",
"===",
"\"TH\"",
")",
"{",
"dom",
".",
"setStyle",
"(",
"elm",
",",
"name",
",",
"value",
")",... | Explore the layers of the table till we find the first layer of tds or ths | [
"Explore",
"the",
"layers",
"of",
"the",
"table",
"till",
"we",
"find",
"the",
"first",
"layer",
"of",
"tds",
"or",
"ths"
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L65261-L65271 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | getTopEdge | function getTopEdge(index, row) {
return {
index: index,
y: editor.dom.getPos(row).y
};
} | javascript | function getTopEdge(index, row) {
return {
index: index,
y: editor.dom.getPos(row).y
};
} | [
"function",
"getTopEdge",
"(",
"index",
",",
"row",
")",
"{",
"return",
"{",
"index",
":",
"index",
",",
"y",
":",
"editor",
".",
"dom",
".",
"getPos",
"(",
"row",
")",
".",
"y",
"}",
";",
"}"
] | Get the absolute position's top edge. | [
"Get",
"the",
"absolute",
"position",
"s",
"top",
"edge",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L65987-L65992 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | getBottomEdge | function getBottomEdge(index, row) {
return {
index: index,
y: editor.dom.getPos(row).y + row.offsetHeight
};
} | javascript | function getBottomEdge(index, row) {
return {
index: index,
y: editor.dom.getPos(row).y + row.offsetHeight
};
} | [
"function",
"getBottomEdge",
"(",
"index",
",",
"row",
")",
"{",
"return",
"{",
"index",
":",
"index",
",",
"y",
":",
"editor",
".",
"dom",
".",
"getPos",
"(",
"row",
")",
".",
"y",
"+",
"row",
".",
"offsetHeight",
"}",
";",
"}"
] | Get the absolute position's bottom edge. | [
"Get",
"the",
"absolute",
"position",
"s",
"bottom",
"edge",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L65995-L66000 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | getLeftEdge | function getLeftEdge(index, cell) {
return {
index: index,
x: editor.dom.getPos(cell).x
};
} | javascript | function getLeftEdge(index, cell) {
return {
index: index,
x: editor.dom.getPos(cell).x
};
} | [
"function",
"getLeftEdge",
"(",
"index",
",",
"cell",
")",
"{",
"return",
"{",
"index",
":",
"index",
",",
"x",
":",
"editor",
".",
"dom",
".",
"getPos",
"(",
"cell",
")",
".",
"x",
"}",
";",
"}"
] | Get the absolute position's left edge. | [
"Get",
"the",
"absolute",
"position",
"s",
"left",
"edge",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L66003-L66008 | train |
sadiqhabib/tinymce-dist | tinymce.full.js | getRightEdge | function getRightEdge(index, cell) {
return {
index: index,
x: editor.dom.getPos(cell).x + cell.offsetWidth
};
} | javascript | function getRightEdge(index, cell) {
return {
index: index,
x: editor.dom.getPos(cell).x + cell.offsetWidth
};
} | [
"function",
"getRightEdge",
"(",
"index",
",",
"cell",
")",
"{",
"return",
"{",
"index",
":",
"index",
",",
"x",
":",
"editor",
".",
"dom",
".",
"getPos",
"(",
"cell",
")",
".",
"x",
"+",
"cell",
".",
"offsetWidth",
"}",
";",
"}"
] | Get the absolute position's right edge. | [
"Get",
"the",
"absolute",
"position",
"s",
"right",
"edge",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L66011-L66016 | train |
Subsets and Splits
SQL Console for semeru/code-text-javascript
Retrieves 20,000 non-null code samples labeled as JavaScript, providing a basic overview of the dataset.