id int32 0 58k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
48,100 | alexindigo/batcher | lib/run_function.js | runSync | function runSync(context, func, callback)
{
var result
, requiresContext = isArrowFunction(func)
;
try
{
if (requiresContext)
{
result = func.call(null, context);
}
else
{
result = func.call(context);
}
}
catch (ex)
{
// pass error as error-first callback
... | javascript | function runSync(context, func, callback)
{
var result
, requiresContext = isArrowFunction(func)
;
try
{
if (requiresContext)
{
result = func.call(null, context);
}
else
{
result = func.call(context);
}
}
catch (ex)
{
// pass error as error-first callback
... | [
"function",
"runSync",
"(",
"context",
",",
"func",
",",
"callback",
")",
"{",
"var",
"result",
",",
"requiresContext",
"=",
"isArrowFunction",
"(",
"func",
")",
";",
"try",
"{",
"if",
"(",
"requiresContext",
")",
"{",
"result",
"=",
"func",
".",
"call",... | Wraps synchronous function with common interface
@param {object} context - context to invoke within
@param {function} func - function to execute
@param {Function} callback - invoke after function is finished executing
@returns {void} | [
"Wraps",
"synchronous",
"function",
"with",
"common",
"interface"
] | 73d9c8c994f915688db0627ea3b4854ead771138 | https://github.com/alexindigo/batcher/blob/73d9c8c994f915688db0627ea3b4854ead771138/lib/run_function.js#L55-L81 |
48,101 | alexindigo/batcher | lib/run_function.js | runAsync | function runAsync(context, func, callback)
{
var result
, requiresContext = isArrowFunction(func)
;
if (requiresContext)
{
result = func.call(null, context, callback);
}
else
{
result = func.call(context, callback);
}
return result;
} | javascript | function runAsync(context, func, callback)
{
var result
, requiresContext = isArrowFunction(func)
;
if (requiresContext)
{
result = func.call(null, context, callback);
}
else
{
result = func.call(context, callback);
}
return result;
} | [
"function",
"runAsync",
"(",
"context",
",",
"func",
",",
"callback",
")",
"{",
"var",
"result",
",",
"requiresContext",
"=",
"isArrowFunction",
"(",
"func",
")",
";",
"if",
"(",
"requiresContext",
")",
"{",
"result",
"=",
"func",
".",
"call",
"(",
"null... | Wraps asynchronous function with common interface
@param {object} context - context to invoke within
@param {function} func - function to execute
@param {Function} callback - invoke after function is finished executing
@returns {void} | [
"Wraps",
"asynchronous",
"function",
"with",
"common",
"interface"
] | 73d9c8c994f915688db0627ea3b4854ead771138 | https://github.com/alexindigo/batcher/blob/73d9c8c994f915688db0627ea3b4854ead771138/lib/run_function.js#L91-L107 |
48,102 | alexindigo/batcher | lib/run_function.js | async | function async(func)
{
function wrapper()
{
var context = this;
var args = arguments;
process.nextTick(function()
{
func.apply(context, args);
});
}
return wrapper;
} | javascript | function async(func)
{
function wrapper()
{
var context = this;
var args = arguments;
process.nextTick(function()
{
func.apply(context, args);
});
}
return wrapper;
} | [
"function",
"async",
"(",
"func",
")",
"{",
"function",
"wrapper",
"(",
")",
"{",
"var",
"context",
"=",
"this",
";",
"var",
"args",
"=",
"arguments",
";",
"process",
".",
"nextTick",
"(",
"function",
"(",
")",
"{",
"func",
".",
"apply",
"(",
"contex... | Makes sure provided function invoked in real async way
@param {function} func - function to invoke wrap
@returns {function} - async-supplemented callback function | [
"Makes",
"sure",
"provided",
"function",
"invoked",
"in",
"real",
"async",
"way"
] | 73d9c8c994f915688db0627ea3b4854ead771138 | https://github.com/alexindigo/batcher/blob/73d9c8c994f915688db0627ea3b4854ead771138/lib/run_function.js#L115-L128 |
48,103 | noflo/noflo-seriously | vendor/seriously.js | traceSources | function traceSources(node, original) {
var i,
source,
sources;
if (!(node instanceof EffectNode) && !(node instanceof TransformNode)) {
return false;
}
sources = node.sources;
for (i in sources) {
if (sources.hasOwnProperty(i)) {
source = sources[i];
if (source === original... | javascript | function traceSources(node, original) {
var i,
source,
sources;
if (!(node instanceof EffectNode) && !(node instanceof TransformNode)) {
return false;
}
sources = node.sources;
for (i in sources) {
if (sources.hasOwnProperty(i)) {
source = sources[i];
if (source === original... | [
"function",
"traceSources",
"(",
"node",
",",
"original",
")",
"{",
"var",
"i",
",",
"source",
",",
"sources",
";",
"if",
"(",
"!",
"(",
"node",
"instanceof",
"EffectNode",
")",
"&&",
"!",
"(",
"node",
"instanceof",
"TransformNode",
")",
")",
"{",
"ret... | trace back all sources to make sure we're not making a cyclical connection | [
"trace",
"back",
"all",
"sources",
"to",
"make",
"sure",
"we",
"re",
"not",
"making",
"a",
"cyclical",
"connection"
] | 51ce8ab5237a144bb433c8118db2371886135ff1 | https://github.com/noflo/noflo-seriously/blob/51ce8ab5237a144bb433c8118db2371886135ff1/vendor/seriously.js#L1178-L1200 |
48,104 | noflo/noflo-seriously | vendor/seriously.js | makePolygonsArray | function makePolygonsArray(poly) {
if (!poly || !poly.length || !Array.isArray(poly)) {
return [];
}
if (!Array.isArray(poly[0])) {
return [poly];
}
if (Array.isArray(poly[0]) && !isNaN(poly[0][0])) {
return [poly];
}
return poly;
} | javascript | function makePolygonsArray(poly) {
if (!poly || !poly.length || !Array.isArray(poly)) {
return [];
}
if (!Array.isArray(poly[0])) {
return [poly];
}
if (Array.isArray(poly[0]) && !isNaN(poly[0][0])) {
return [poly];
}
return poly;
} | [
"function",
"makePolygonsArray",
"(",
"poly",
")",
"{",
"if",
"(",
"!",
"poly",
"||",
"!",
"poly",
".",
"length",
"||",
"!",
"Array",
".",
"isArray",
"(",
"poly",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",
"if",
"(",
"!",
"Array",
".",
"isArray... | detect whether it's multiple polygons or what | [
"detect",
"whether",
"it",
"s",
"multiple",
"polygons",
"or",
"what"
] | 51ce8ab5237a144bb433c8118db2371886135ff1 | https://github.com/noflo/noflo-seriously/blob/51ce8ab5237a144bb433c8118db2371886135ff1/vendor/seriously.js#L1918-L1932 |
48,105 | mikesamuel/module-keys | lib/relpath.js | longestCommonPathPrefix | function longestCommonPathPrefix(stra, strb) {
const minlen = min(stra.length, strb.length);
let common = 0;
let lastSep = -1;
for (; common < minlen; ++common) {
const chr = stra[common];
if (chr !== strb[common]) {
break;
}
if (chr === sep) {
lastSep = common;
}
}
if (commo... | javascript | function longestCommonPathPrefix(stra, strb) {
const minlen = min(stra.length, strb.length);
let common = 0;
let lastSep = -1;
for (; common < minlen; ++common) {
const chr = stra[common];
if (chr !== strb[common]) {
break;
}
if (chr === sep) {
lastSep = common;
}
}
if (commo... | [
"function",
"longestCommonPathPrefix",
"(",
"stra",
",",
"strb",
")",
"{",
"const",
"minlen",
"=",
"min",
"(",
"stra",
".",
"length",
",",
"strb",
".",
"length",
")",
";",
"let",
"common",
"=",
"0",
";",
"let",
"lastSep",
"=",
"-",
"1",
";",
"for",
... | Longest common prefix that ends on a path element boundary. Each input is assumed to end with an implicit path separator. | [
"Longest",
"common",
"prefix",
"that",
"ends",
"on",
"a",
"path",
"element",
"boundary",
".",
"Each",
"input",
"is",
"assumed",
"to",
"end",
"with",
"an",
"implicit",
"path",
"separator",
"."
] | 39100b07d143af3f77a0bec519a92634d5173dd6 | https://github.com/mikesamuel/module-keys/blob/39100b07d143af3f77a0bec519a92634d5173dd6/lib/relpath.js#L94-L114 |
48,106 | mikesamuel/module-keys | lib/relpath.js | relpath | function relpath(basePath, absPath) {
let base = dedot(basePath);
let abs = dedot(absPath);
// Find the longest common prefix that ends with a separator.
const commonPrefix = longestCommonPathPrefix(base, abs);
// Remove the common path elements.
base = apply(substring, base, [ commonPrefix ]);
abs = appl... | javascript | function relpath(basePath, absPath) {
let base = dedot(basePath);
let abs = dedot(absPath);
// Find the longest common prefix that ends with a separator.
const commonPrefix = longestCommonPathPrefix(base, abs);
// Remove the common path elements.
base = apply(substring, base, [ commonPrefix ]);
abs = appl... | [
"function",
"relpath",
"(",
"basePath",
",",
"absPath",
")",
"{",
"let",
"base",
"=",
"dedot",
"(",
"basePath",
")",
";",
"let",
"abs",
"=",
"dedot",
"(",
"absPath",
")",
";",
"// Find the longest common prefix that ends with a separator.",
"const",
"commonPrefix"... | A path to absFile relative to base.
This is a string transform so is independent of the
symlink and hardlink structure of the file-system.
@param {string} base an absolute path
@param {string} absPath an absolute path
@return {string} a relative path that starts with '.'
such that {@code path.join(base, output) === ab... | [
"A",
"path",
"to",
"absFile",
"relative",
"to",
"base",
".",
"This",
"is",
"a",
"string",
"transform",
"so",
"is",
"independent",
"of",
"the",
"symlink",
"and",
"hardlink",
"structure",
"of",
"the",
"file",
"-",
"system",
"."
] | 39100b07d143af3f77a0bec519a92634d5173dd6 | https://github.com/mikesamuel/module-keys/blob/39100b07d143af3f77a0bec519a92634d5173dd6/lib/relpath.js#L127-L148 |
48,107 | nicktindall/cyclon.p2p-rtc-client | lib/SocketFactory.js | createOptionsForServerSpec | function createOptionsForServerSpec(serverSpec) {
var options = {
forceNew: true, // Make a new connection each time
reconnection: false // Don't try and reconnect automatically
};
// If the server spec contains a socketResource setting we use
// that otherwise leave t... | javascript | function createOptionsForServerSpec(serverSpec) {
var options = {
forceNew: true, // Make a new connection each time
reconnection: false // Don't try and reconnect automatically
};
// If the server spec contains a socketResource setting we use
// that otherwise leave t... | [
"function",
"createOptionsForServerSpec",
"(",
"serverSpec",
")",
"{",
"var",
"options",
"=",
"{",
"forceNew",
":",
"true",
",",
"// Make a new connection each time",
"reconnection",
":",
"false",
"// Don't try and reconnect automatically",
"}",
";",
"// If the server spec ... | Create the socket.io options for the specified server | [
"Create",
"the",
"socket",
".",
"io",
"options",
"for",
"the",
"specified",
"server"
] | eb586ce288a6ad7e1b221280825037e855b03904 | https://github.com/nicktindall/cyclon.p2p-rtc-client/blob/eb586ce288a6ad7e1b221280825037e855b03904/lib/SocketFactory.js#L20-L32 |
48,108 | reelyactive/chickadee | lib/chickadee.js | Chickadee | function Chickadee(options) {
var self = this;
options = options || {};
self.associations = options.associationManager ||
new associationManager(options);
self.routes = {
"/associations": require('./routes/associations'),
"/contextat": require('./routes/contextat'),
"/context... | javascript | function Chickadee(options) {
var self = this;
options = options || {};
self.associations = options.associationManager ||
new associationManager(options);
self.routes = {
"/associations": require('./routes/associations'),
"/contextat": require('./routes/contextat'),
"/context... | [
"function",
"Chickadee",
"(",
"options",
")",
"{",
"var",
"self",
"=",
"this",
";",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"self",
".",
"associations",
"=",
"options",
".",
"associationManager",
"||",
"new",
"associationManager",
"(",
"options",
"... | Chickadee Class
Hyperlocal context associations store and API.
@param {Object} options The options as a JSON object.
@constructor | [
"Chickadee",
"Class",
"Hyperlocal",
"context",
"associations",
"store",
"and",
"API",
"."
] | 1f65c2d369694d93796aae63318fa76326275120 | https://github.com/reelyactive/chickadee/blob/1f65c2d369694d93796aae63318fa76326275120/lib/chickadee.js#L20-L35 |
48,109 | reelyactive/chickadee | lib/chickadee.js | convertOptionsParamsToIds | function convertOptionsParamsToIds(req, instance, options, callback) {
var err;
if(options.id) {
var isValidID = reelib.identifier.isValid(options.id);
if(!isValidID) {
err = 'Invalid id';
}
options.ids = [options.id];
delete options.id;
callback(err);
}
else if(options.directory)... | javascript | function convertOptionsParamsToIds(req, instance, options, callback) {
var err;
if(options.id) {
var isValidID = reelib.identifier.isValid(options.id);
if(!isValidID) {
err = 'Invalid id';
}
options.ids = [options.id];
delete options.id;
callback(err);
}
else if(options.directory)... | [
"function",
"convertOptionsParamsToIds",
"(",
"req",
",",
"instance",
",",
"options",
",",
"callback",
")",
"{",
"var",
"err",
";",
"if",
"(",
"options",
".",
"id",
")",
"{",
"var",
"isValidID",
"=",
"reelib",
".",
"identifier",
".",
"isValid",
"(",
"opt... | Convert the id, directory or tags within options to ids.
@param {Object} req The request which originated this function call.
@param {Chickadee} instance The given chickadee instance.
@param {Object} options The given options.
@param {callback} callback Function to call on completion. | [
"Convert",
"the",
"id",
"directory",
"or",
"tags",
"within",
"options",
"to",
"ids",
"."
] | 1f65c2d369694d93796aae63318fa76326275120 | https://github.com/reelyactive/chickadee/blob/1f65c2d369694d93796aae63318fa76326275120/lib/chickadee.js#L274-L302 |
48,110 | zbjornson/gcloud-trace | src/trace.js | hex | function hex(n) {
return crypto.randomBytes(Math.ceil(n / 2)).toString('hex').slice(0, n);
} | javascript | function hex(n) {
return crypto.randomBytes(Math.ceil(n / 2)).toString('hex').slice(0, n);
} | [
"function",
"hex",
"(",
"n",
")",
"{",
"return",
"crypto",
".",
"randomBytes",
"(",
"Math",
".",
"ceil",
"(",
"n",
"/",
"2",
")",
")",
".",
"toString",
"(",
"'hex'",
")",
".",
"slice",
"(",
"0",
",",
"n",
")",
";",
"}"
] | Generates a random hex string of the provided length. | [
"Generates",
"a",
"random",
"hex",
"string",
"of",
"the",
"provided",
"length",
"."
] | aa1224316d4f675a59552ae4eb50a9bd69200ba4 | https://github.com/zbjornson/gcloud-trace/blob/aa1224316d4f675a59552ae4eb50a9bd69200ba4/src/trace.js#L62-L64 |
48,111 | gallactic/gallactickeys | lib/gallactickeys.js | exportKs | function exportKs (password, privateKey, salt, iv, type, option = {}) {
if (!password || !privateKey || !type) {
throw new Error('Missing parameter! Make sure password, privateKey and type provided')
}
if (!crypto.isPrivateKey(privateKey)) {
throw new Error('given Private Key is not a valid Private Key s... | javascript | function exportKs (password, privateKey, salt, iv, type, option = {}) {
if (!password || !privateKey || !type) {
throw new Error('Missing parameter! Make sure password, privateKey and type provided')
}
if (!crypto.isPrivateKey(privateKey)) {
throw new Error('given Private Key is not a valid Private Key s... | [
"function",
"exportKs",
"(",
"password",
",",
"privateKey",
",",
"salt",
",",
"iv",
",",
"type",
",",
"option",
"=",
"{",
"}",
")",
"{",
"if",
"(",
"!",
"password",
"||",
"!",
"privateKey",
"||",
"!",
"type",
")",
"{",
"throw",
"new",
"Error",
"(",... | PRIVATE METHODS
helper function to export keystore | [
"PRIVATE",
"METHODS",
"helper",
"function",
"to",
"export",
"keystore"
] | 51a61ca29583e17b5f3325a3d73f1d7e09e4b758 | https://github.com/gallactic/gallactickeys/blob/51a61ca29583e17b5f3325a3d73f1d7e09e4b758/lib/gallactickeys.js#L148-L164 |
48,112 | gallactic/gallactickeys | lib/gallactickeys.js | verifyAndDecrypt | function verifyAndDecrypt(derivedKey, iv, ciphertext, algo, mac) {
if (typeof algo !== 'string') {
throw new Error('Cipher method is invalid. Unable to proceed')
}
var key;
if (crypto.createMac(derivedKey, ciphertext) !== mac) {
throw new Error('message authentication code mismatch');
}
key = deriv... | javascript | function verifyAndDecrypt(derivedKey, iv, ciphertext, algo, mac) {
if (typeof algo !== 'string') {
throw new Error('Cipher method is invalid. Unable to proceed')
}
var key;
if (crypto.createMac(derivedKey, ciphertext) !== mac) {
throw new Error('message authentication code mismatch');
}
key = deriv... | [
"function",
"verifyAndDecrypt",
"(",
"derivedKey",
",",
"iv",
",",
"ciphertext",
",",
"algo",
",",
"mac",
")",
"{",
"if",
"(",
"typeof",
"algo",
"!==",
"'string'",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Cipher method is invalid. Unable to proceed'",
")",
"}... | verify that message authentication codes match, then decrypt | [
"verify",
"that",
"message",
"authentication",
"codes",
"match",
"then",
"decrypt"
] | 51a61ca29583e17b5f3325a3d73f1d7e09e4b758 | https://github.com/gallactic/gallactickeys/blob/51a61ca29583e17b5f3325a3d73f1d7e09e4b758/lib/gallactickeys.js#L167-L179 |
48,113 | oliversalzburg/absync | gulpfile.js | buildJs | function buildJs() {
// Construct a stream for the JS sources of our plugin, don't read file contents when compiling TypeScript.
var sourceStream = gulp.src( config.Sources.Scripts, {
cwd : config.WorkingDirectory,
read : true
} );
return sourceStream
.pipe( jscs() )
.pipe( jscs.reporter() )
.pipe( jsVa... | javascript | function buildJs() {
// Construct a stream for the JS sources of our plugin, don't read file contents when compiling TypeScript.
var sourceStream = gulp.src( config.Sources.Scripts, {
cwd : config.WorkingDirectory,
read : true
} );
return sourceStream
.pipe( jscs() )
.pipe( jscs.reporter() )
.pipe( jsVa... | [
"function",
"buildJs",
"(",
")",
"{",
"// Construct a stream for the JS sources of our plugin, don't read file contents when compiling TypeScript.",
"var",
"sourceStream",
"=",
"gulp",
".",
"src",
"(",
"config",
".",
"Sources",
".",
"Scripts",
",",
"{",
"cwd",
":",
"confi... | Core JS resource builder. | [
"Core",
"JS",
"resource",
"builder",
"."
] | 13807648d513c77008951446cfa1b334a2ab2ccf | https://github.com/oliversalzburg/absync/blob/13807648d513c77008951446cfa1b334a2ab2ccf/gulpfile.js#L37-L82 |
48,114 | pdehaan/fetch-subreddit | index.js | _fetchSubreddit | function _fetchSubreddit(subreddit) {
const reducer = (prev, {data: {url}}) => prev.push(url) && prev;
const jsonUri = `https://www.reddit.com/r/${subreddit}/.json`;
return fetch(jsonUri)
.then((res) => res.json())
.then((res) => res.data.children.reduce(reducer, []))
.then((urls) => ({subreddit, urls... | javascript | function _fetchSubreddit(subreddit) {
const reducer = (prev, {data: {url}}) => prev.push(url) && prev;
const jsonUri = `https://www.reddit.com/r/${subreddit}/.json`;
return fetch(jsonUri)
.then((res) => res.json())
.then((res) => res.data.children.reduce(reducer, []))
.then((urls) => ({subreddit, urls... | [
"function",
"_fetchSubreddit",
"(",
"subreddit",
")",
"{",
"const",
"reducer",
"=",
"(",
"prev",
",",
"{",
"data",
":",
"{",
"url",
"}",
"}",
")",
"=>",
"prev",
".",
"push",
"(",
"url",
")",
"&&",
"prev",
";",
"const",
"jsonUri",
"=",
"`",
"${",
... | Internal method to fetch the JSON feed and extract the URLs.
@private
@param {String} subreddit Subreddit name to fetch JSON feed for.
@return {Object} An object containing the subreddit name as a key, and links as a nested array. | [
"Internal",
"method",
"to",
"fetch",
"the",
"JSON",
"feed",
"and",
"extract",
"the",
"URLs",
"."
] | 1a34d5b4bc7015f5a1c3f0d3403b7c88d67e8b74 | https://github.com/pdehaan/fetch-subreddit/blob/1a34d5b4bc7015f5a1c3f0d3403b7c88d67e8b74/index.js#L31-L38 |
48,115 | pdehaan/fetch-subreddit | index.js | _fetchRandomSubreddit | function _fetchRandomSubreddit(count=1, subreddit='random', fetchOpts={}) {
const _fetchSubredditUrl = (subreddit, fetchOpts) => {
return fetch(`https://www.reddit.com/r/${subreddit}`, fetchOpts)
.then(({url}) => {
return {
json: `${url}.json`,
name: getSubredditName(url),
... | javascript | function _fetchRandomSubreddit(count=1, subreddit='random', fetchOpts={}) {
const _fetchSubredditUrl = (subreddit, fetchOpts) => {
return fetch(`https://www.reddit.com/r/${subreddit}`, fetchOpts)
.then(({url}) => {
return {
json: `${url}.json`,
name: getSubredditName(url),
... | [
"function",
"_fetchRandomSubreddit",
"(",
"count",
"=",
"1",
",",
"subreddit",
"=",
"'random'",
",",
"fetchOpts",
"=",
"{",
"}",
")",
"{",
"const",
"_fetchSubredditUrl",
"=",
"(",
"subreddit",
",",
"fetchOpts",
")",
"=>",
"{",
"return",
"fetch",
"(",
"`",
... | Proxy method that creates an array of subreddit promises to fetch.
@private
@param {Number} count The number of random subreddits to fetch. Default: 1
@param {String} subreddit Random subreddit generator. Either "random' or "randnsfw" (depending on if yuo want NSFW results). Default: "random" (safe for work)
@pa... | [
"Proxy",
"method",
"that",
"creates",
"an",
"array",
"of",
"subreddit",
"promises",
"to",
"fetch",
"."
] | 1a34d5b4bc7015f5a1c3f0d3403b7c88d67e8b74 | https://github.com/pdehaan/fetch-subreddit/blob/1a34d5b4bc7015f5a1c3f0d3403b7c88d67e8b74/index.js#L87-L102 |
48,116 | pdehaan/fetch-subreddit | index.js | getSubredditName | function getSubredditName(url) {
try {
// This will throw a `TypeError: Cannot read property 'Symbol(Symbol.iterator)' of null` if the RegExp fails.
const [input, name] = new RegExp('^https?://(?:www.)?reddit.com/r/(.*?)/?$').exec(url);
return name;
} catch (err) {
return null;
}
} | javascript | function getSubredditName(url) {
try {
// This will throw a `TypeError: Cannot read property 'Symbol(Symbol.iterator)' of null` if the RegExp fails.
const [input, name] = new RegExp('^https?://(?:www.)?reddit.com/r/(.*?)/?$').exec(url);
return name;
} catch (err) {
return null;
}
} | [
"function",
"getSubredditName",
"(",
"url",
")",
"{",
"try",
"{",
"// This will throw a `TypeError: Cannot read property 'Symbol(Symbol.iterator)' of null` if the RegExp fails.",
"const",
"[",
"input",
",",
"name",
"]",
"=",
"new",
"RegExp",
"(",
"'^https?://(?:www.)?reddit.com... | Extracts a subreddit name from a URL using sketchy RegExp.
@param {String} url A fully qualified URL.
@return {String} The name of a subreddit. For example: "knitting" | [
"Extracts",
"a",
"subreddit",
"name",
"from",
"a",
"URL",
"using",
"sketchy",
"RegExp",
"."
] | 1a34d5b4bc7015f5a1c3f0d3403b7c88d67e8b74 | https://github.com/pdehaan/fetch-subreddit/blob/1a34d5b4bc7015f5a1c3f0d3403b7c88d67e8b74/index.js#L110-L118 |
48,117 | sadiqhabib/tinymce-dist | tinymce.full.js | relativePosition | function relativePosition(rect, targetRect, rel) {
var x, y, w, h, targetW, targetH;
x = targetRect.x;
y = targetRect.y;
w = rect.w;
h = rect.h;
targetW = targetRect.w;
targetH = targetRect.h;
rel = (rel || '').split('');
if (rel[0] === 'b') {
y += target... | javascript | function relativePosition(rect, targetRect, rel) {
var x, y, w, h, targetW, targetH;
x = targetRect.x;
y = targetRect.y;
w = rect.w;
h = rect.h;
targetW = targetRect.w;
targetH = targetRect.h;
rel = (rel || '').split('');
if (rel[0] === 'b') {
y += target... | [
"function",
"relativePosition",
"(",
"rect",
",",
"targetRect",
",",
"rel",
")",
"{",
"var",
"x",
",",
"y",
",",
"w",
",",
"h",
",",
"targetW",
",",
"targetH",
";",
"x",
"=",
"targetRect",
".",
"x",
";",
"y",
"=",
"targetRect",
".",
"y",
";",
"w"... | Returns the rect positioned based on the relative position name
to the target rect.
@method relativePosition
@param {Rect} rect Source rect to modify into a new rect.
@param {Rect} targetRect Rect to move relative to based on the rel option.
@param {String} rel Relative position. For example: tr-bl. | [
"Returns",
"the",
"rect",
"positioned",
"based",
"on",
"the",
"relative",
"position",
"name",
"to",
"the",
"target",
"rect",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L119-L164 |
48,118 | sadiqhabib/tinymce-dist | tinymce.full.js | inflate | function inflate(rect, w, h) {
return create(rect.x - w, rect.y - h, rect.w + w * 2, rect.h + h * 2);
} | javascript | function inflate(rect, w, h) {
return create(rect.x - w, rect.y - h, rect.w + w * 2, rect.h + h * 2);
} | [
"function",
"inflate",
"(",
"rect",
",",
"w",
",",
"h",
")",
"{",
"return",
"create",
"(",
"rect",
".",
"x",
"-",
"w",
",",
"rect",
".",
"y",
"-",
"h",
",",
"rect",
".",
"w",
"+",
"w",
"*",
"2",
",",
"rect",
".",
"h",
"+",
"h",
"*",
"2",
... | Inflates the rect in all directions.
@method inflate
@param {Rect} rect Rect to expand.
@param {Number} w Relative width to expand by.
@param {Number} h Relative height to expand by.
@return {Rect} New expanded rect. | [
"Inflates",
"the",
"rect",
"in",
"all",
"directions",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L199-L201 |
48,119 | sadiqhabib/tinymce-dist | tinymce.full.js | intersect | function intersect(rect, cropRect) {
var x1, y1, x2, y2;
x1 = max(rect.x, cropRect.x);
y1 = max(rect.y, cropRect.y);
x2 = min(rect.x + rect.w, cropRect.x + cropRect.w);
y2 = min(rect.y + rect.h, cropRect.y + cropRect.h);
if (x2 - x1 < 0 || y2 - y1 < 0) {
return null;
... | javascript | function intersect(rect, cropRect) {
var x1, y1, x2, y2;
x1 = max(rect.x, cropRect.x);
y1 = max(rect.y, cropRect.y);
x2 = min(rect.x + rect.w, cropRect.x + cropRect.w);
y2 = min(rect.y + rect.h, cropRect.y + cropRect.h);
if (x2 - x1 < 0 || y2 - y1 < 0) {
return null;
... | [
"function",
"intersect",
"(",
"rect",
",",
"cropRect",
")",
"{",
"var",
"x1",
",",
"y1",
",",
"x2",
",",
"y2",
";",
"x1",
"=",
"max",
"(",
"rect",
".",
"x",
",",
"cropRect",
".",
"x",
")",
";",
"y1",
"=",
"max",
"(",
"rect",
".",
"y",
",",
... | Returns the intersection of the specified rectangles.
@method intersect
@param {Rect} rect The first rectangle to compare.
@param {Rect} cropRect The second rectangle to compare.
@return {Rect} The intersection of the two rectangles or null if they don't intersect. | [
"Returns",
"the",
"intersection",
"of",
"the",
"specified",
"rectangles",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L211-L224 |
48,120 | sadiqhabib/tinymce-dist | tinymce.full.js | clamp | function clamp(rect, clampRect, fixedSize) {
var underflowX1, underflowY1, overflowX2, overflowY2,
x1, y1, x2, y2, cx2, cy2;
x1 = rect.x;
y1 = rect.y;
x2 = rect.x + rect.w;
y2 = rect.y + rect.h;
cx2 = clampRect.x + clampRect.w;
cy2 = clampRect.y + clampRect.h;
u... | javascript | function clamp(rect, clampRect, fixedSize) {
var underflowX1, underflowY1, overflowX2, overflowY2,
x1, y1, x2, y2, cx2, cy2;
x1 = rect.x;
y1 = rect.y;
x2 = rect.x + rect.w;
y2 = rect.y + rect.h;
cx2 = clampRect.x + clampRect.w;
cy2 = clampRect.y + clampRect.h;
u... | [
"function",
"clamp",
"(",
"rect",
",",
"clampRect",
",",
"fixedSize",
")",
"{",
"var",
"underflowX1",
",",
"underflowY1",
",",
"overflowX2",
",",
"overflowY2",
",",
"x1",
",",
"y1",
",",
"x2",
",",
"y2",
",",
"cx2",
",",
"cy2",
";",
"x1",
"=",
"rect"... | Returns a rect clamped within the specified clamp rect. This forces the
rect to be inside the clamp rect.
@method clamp
@param {Rect} rect Rectangle to force within clamp rect.
@param {Rect} clampRect Rectable to force within.
@param {Boolean} fixedSize True/false if size should be fixed.
@return {Rect} Clamped rect. | [
"Returns",
"a",
"rect",
"clamped",
"within",
"the",
"specified",
"clamp",
"rect",
".",
"This",
"forces",
"the",
"rect",
"to",
"be",
"inside",
"the",
"clamp",
"rect",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L236-L266 |
48,121 | sadiqhabib/tinymce-dist | tinymce.full.js | fromClientRect | function fromClientRect(clientRect) {
return create(clientRect.left, clientRect.top, clientRect.width, clientRect.height);
} | javascript | function fromClientRect(clientRect) {
return create(clientRect.left, clientRect.top, clientRect.width, clientRect.height);
} | [
"function",
"fromClientRect",
"(",
"clientRect",
")",
"{",
"return",
"create",
"(",
"clientRect",
".",
"left",
",",
"clientRect",
".",
"top",
",",
"clientRect",
".",
"width",
",",
"clientRect",
".",
"height",
")",
";",
"}"
] | Creates a new rectangle object form a clientRects object.
@method fromClientRect
@param {ClientRect} clientRect DOM ClientRect object.
@return {Rect} New rectangle object. | [
"Creates",
"a",
"new",
"rectangle",
"object",
"form",
"a",
"clientRects",
"object",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L289-L291 |
48,122 | sadiqhabib/tinymce-dist | tinymce.full.js | function (callback, element) {
if (requestAnimationFramePromise) {
requestAnimationFramePromise.then(callback);
return;
}
requestAnimationFramePromise = new Promise(function (resolve) {
if (!element) {
element = document.body;
}
req... | javascript | function (callback, element) {
if (requestAnimationFramePromise) {
requestAnimationFramePromise.then(callback);
return;
}
requestAnimationFramePromise = new Promise(function (resolve) {
if (!element) {
element = document.body;
}
req... | [
"function",
"(",
"callback",
",",
"element",
")",
"{",
"if",
"(",
"requestAnimationFramePromise",
")",
"{",
"requestAnimationFramePromise",
".",
"then",
"(",
"callback",
")",
";",
"return",
";",
"}",
"requestAnimationFramePromise",
"=",
"new",
"Promise",
"(",
"f... | Requests an animation frame and fallbacks to a timeout on older browsers.
@method requestAnimationFrame
@param {function} callback Callback to execute when a new frame is available.
@param {DOMElement} element Optional element to scope it to. | [
"Requests",
"an",
"animation",
"frame",
"and",
"fallbacks",
"to",
"a",
"timeout",
"on",
"older",
"browsers",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L602-L615 | |
48,123 | sadiqhabib/tinymce-dist | tinymce.full.js | function (editor, callback, time) {
var timer;
timer = wrappedSetInterval(function () {
if (!editor.removed) {
callback();
} else {
clearInterval(timer);
}
}, time);
return timer;
} | javascript | function (editor, callback, time) {
var timer;
timer = wrappedSetInterval(function () {
if (!editor.removed) {
callback();
} else {
clearInterval(timer);
}
}, time);
return timer;
} | [
"function",
"(",
"editor",
",",
"callback",
",",
"time",
")",
"{",
"var",
"timer",
";",
"timer",
"=",
"wrappedSetInterval",
"(",
"function",
"(",
")",
"{",
"if",
"(",
"!",
"editor",
".",
"removed",
")",
"{",
"callback",
"(",
")",
";",
"}",
"else",
... | Sets an interval timer it's similar to setInterval except that it checks if the editor instance is
still alive when the callback gets executed.
@method setEditorInterval
@param {function} callback Callback to execute when interval time runs out.
@param {Number} time Optional time to wait before the callback is execute... | [
"Sets",
"an",
"interval",
"timer",
"it",
"s",
"similar",
"to",
"setInterval",
"except",
"that",
"it",
"checks",
"if",
"the",
"editor",
"instance",
"is",
"still",
"alive",
"when",
"the",
"callback",
"gets",
"executed",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L664-L676 | |
48,124 | sadiqhabib/tinymce-dist | tinymce.full.js | addEvent | function addEvent(target, name, callback, capture) {
if (target.addEventListener) {
target.addEventListener(name, callback, capture || false);
} else if (target.attachEvent) {
target.attachEvent('on' + name, callback);
}
} | javascript | function addEvent(target, name, callback, capture) {
if (target.addEventListener) {
target.addEventListener(name, callback, capture || false);
} else if (target.attachEvent) {
target.attachEvent('on' + name, callback);
}
} | [
"function",
"addEvent",
"(",
"target",
",",
"name",
",",
"callback",
",",
"capture",
")",
"{",
"if",
"(",
"target",
".",
"addEventListener",
")",
"{",
"target",
".",
"addEventListener",
"(",
"name",
",",
"callback",
",",
"capture",
"||",
"false",
")",
";... | Binds a native event to a callback on the speified target. | [
"Binds",
"a",
"native",
"event",
"to",
"a",
"callback",
"on",
"the",
"speified",
"target",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L935-L941 |
48,125 | sadiqhabib/tinymce-dist | tinymce.full.js | removeEvent | function removeEvent(target, name, callback, capture) {
if (target.removeEventListener) {
target.removeEventListener(name, callback, capture || false);
} else if (target.detachEvent) {
target.detachEvent('on' + name, callback);
}
} | javascript | function removeEvent(target, name, callback, capture) {
if (target.removeEventListener) {
target.removeEventListener(name, callback, capture || false);
} else if (target.detachEvent) {
target.detachEvent('on' + name, callback);
}
} | [
"function",
"removeEvent",
"(",
"target",
",",
"name",
",",
"callback",
",",
"capture",
")",
"{",
"if",
"(",
"target",
".",
"removeEventListener",
")",
"{",
"target",
".",
"removeEventListener",
"(",
"name",
",",
"callback",
",",
"capture",
"||",
"false",
... | Unbinds a native event callback on the specified target. | [
"Unbinds",
"a",
"native",
"event",
"callback",
"on",
"the",
"specified",
"target",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L946-L952 |
48,126 | sadiqhabib/tinymce-dist | tinymce.full.js | getTargetFromShadowDom | function getTargetFromShadowDom(event, defaultTarget) {
var path, target = defaultTarget;
// When target element is inside Shadow DOM we need to take first element from path
// otherwise we'll get Shadow Root parent, not actual target element
// Normalize target for WebComponents v0 implementa... | javascript | function getTargetFromShadowDom(event, defaultTarget) {
var path, target = defaultTarget;
// When target element is inside Shadow DOM we need to take first element from path
// otherwise we'll get Shadow Root parent, not actual target element
// Normalize target for WebComponents v0 implementa... | [
"function",
"getTargetFromShadowDom",
"(",
"event",
",",
"defaultTarget",
")",
"{",
"var",
"path",
",",
"target",
"=",
"defaultTarget",
";",
"// When target element is inside Shadow DOM we need to take first element from path",
"// otherwise we'll get Shadow Root parent, not actual t... | Gets the event target based on shadow dom properties like path and deepPath. | [
"Gets",
"the",
"event",
"target",
"based",
"on",
"shadow",
"dom",
"properties",
"like",
"path",
"and",
"deepPath",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L957-L978 |
48,127 | sadiqhabib/tinymce-dist | tinymce.full.js | fix | function fix(originalEvent, data) {
var name, event = data || {}, undef;
// Dummy function that gets replaced on the delegation state functions
function returnFalse() {
return false;
}
// Dummy function that gets replaced on the delegation state functions
function returnTru... | javascript | function fix(originalEvent, data) {
var name, event = data || {}, undef;
// Dummy function that gets replaced on the delegation state functions
function returnFalse() {
return false;
}
// Dummy function that gets replaced on the delegation state functions
function returnTru... | [
"function",
"fix",
"(",
"originalEvent",
",",
"data",
")",
"{",
"var",
"name",
",",
"event",
"=",
"data",
"||",
"{",
"}",
",",
"undef",
";",
"// Dummy function that gets replaced on the delegation state functions",
"function",
"returnFalse",
"(",
")",
"{",
"return... | Normalizes a native event object or just adds the event specific methods on a custom event. | [
"Normalizes",
"a",
"native",
"event",
"object",
"or",
"just",
"adds",
"the",
"event",
"specific",
"methods",
"on",
"a",
"custom",
"event",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L983-L1074 |
48,128 | sadiqhabib/tinymce-dist | tinymce.full.js | is | function is(obj, type) {
if (!type) {
return obj !== undefined;
}
if (type == 'array' && Arr.isArray(obj)) {
return true;
}
return typeof obj == type;
} | javascript | function is(obj, type) {
if (!type) {
return obj !== undefined;
}
if (type == 'array' && Arr.isArray(obj)) {
return true;
}
return typeof obj == type;
} | [
"function",
"is",
"(",
"obj",
",",
"type",
")",
"{",
"if",
"(",
"!",
"type",
")",
"{",
"return",
"obj",
"!==",
"undefined",
";",
"}",
"if",
"(",
"type",
"==",
"'array'",
"&&",
"Arr",
".",
"isArray",
"(",
"obj",
")",
")",
"{",
"return",
"true",
... | Checks if a object is of a specific type for example an array.
@method is
@param {Object} obj Object to check type of.
@param {string} type Optional type to check for.
@return {Boolean} true/false if the object is of the specified type. | [
"Checks",
"if",
"a",
"object",
"is",
"of",
"a",
"specific",
"type",
"for",
"example",
"an",
"array",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L3767-L3777 |
48,129 | sadiqhabib/tinymce-dist | tinymce.full.js | create | function create(s, p, root) {
var self = this, sp, ns, cn, scn, c, de = 0;
// Parse : <prefix> <class>:<super class>
s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);
cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name
// Create namespace for new class
ns = self.createNS(s[3].replace... | javascript | function create(s, p, root) {
var self = this, sp, ns, cn, scn, c, de = 0;
// Parse : <prefix> <class>:<super class>
s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);
cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name
// Create namespace for new class
ns = self.createNS(s[3].replace... | [
"function",
"create",
"(",
"s",
",",
"p",
",",
"root",
")",
"{",
"var",
"self",
"=",
"this",
",",
"sp",
",",
"ns",
",",
"cn",
",",
"scn",
",",
"c",
",",
"de",
"=",
"0",
";",
"// Parse : <prefix> <class>:<super class>",
"s",
"=",
"/",
"^((static) )?([... | Creates a class, subclass or static singleton.
More details on this method can be found in the Wiki.
@method create
@param {String} s Class name, inheritance and prefix.
@param {Object} p Collection of methods to add to the class.
@param {Object} root Optional root object defaults to the global window object.
@example... | [
"Creates",
"a",
"class",
"subclass",
"or",
"static",
"singleton",
".",
"More",
"details",
"on",
"this",
"method",
"can",
"be",
"found",
"in",
"the",
"Wiki",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L3866-L3950 |
48,130 | sadiqhabib/tinymce-dist | tinymce.full.js | walk | function walk(o, f, n, s) {
s = s || this;
if (o) {
if (n) {
o = o[n];
}
Arr.each(o, function (o, i) {
if (f.call(s, o, i, n) === false) {
return false;
}
walk(o, f, n, s);
});
}
} | javascript | function walk(o, f, n, s) {
s = s || this;
if (o) {
if (n) {
o = o[n];
}
Arr.each(o, function (o, i) {
if (f.call(s, o, i, n) === false) {
return false;
}
walk(o, f, n, s);
});
}
} | [
"function",
"walk",
"(",
"o",
",",
"f",
",",
"n",
",",
"s",
")",
"{",
"s",
"=",
"s",
"||",
"this",
";",
"if",
"(",
"o",
")",
"{",
"if",
"(",
"n",
")",
"{",
"o",
"=",
"o",
"[",
"n",
"]",
";",
"}",
"Arr",
".",
"each",
"(",
"o",
",",
"... | Executed the specified function for each item in a object tree.
@method walk
@param {Object} o Object tree to walk though.
@param {function} f Function to call for each item.
@param {String} n Optional name of collection inside the objects to walk for example childNodes.
@param {String} s Optional scope to execute the... | [
"Executed",
"the",
"specified",
"function",
"for",
"each",
"item",
"in",
"a",
"object",
"tree",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L3980-L3996 |
48,131 | sadiqhabib/tinymce-dist | tinymce.full.js | createNS | function createNS(n, o) {
var i, v;
o = o || window;
n = n.split('.');
for (i = 0; i < n.length; i++) {
v = n[i];
if (!o[v]) {
o[v] = {};
}
o = o[v];
}
return o;
} | javascript | function createNS(n, o) {
var i, v;
o = o || window;
n = n.split('.');
for (i = 0; i < n.length; i++) {
v = n[i];
if (!o[v]) {
o[v] = {};
}
o = o[v];
}
return o;
} | [
"function",
"createNS",
"(",
"n",
",",
"o",
")",
"{",
"var",
"i",
",",
"v",
";",
"o",
"=",
"o",
"||",
"window",
";",
"n",
"=",
"n",
".",
"split",
"(",
"'.'",
")",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"n",
".",
"length",
";",
"... | Creates a namespace on a specific object.
@method createNS
@param {String} n Namespace to create for example a.b.c.d.
@param {Object} o Optional object to add namespace to, defaults to window.
@return {Object} New namespace object the last item in path.
@example
// Create some namespace
tinymce.createNS('tinymce.somep... | [
"Creates",
"a",
"namespace",
"on",
"a",
"specific",
"object",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L4016-L4033 |
48,132 | sadiqhabib/tinymce-dist | tinymce.full.js | resolve | function resolve(n, o) {
var i, l;
o = o || window;
n = n.split('.');
for (i = 0, l = n.length; i < l; i++) {
o = o[n[i]];
if (!o) {
break;
}
}
return o;
} | javascript | function resolve(n, o) {
var i, l;
o = o || window;
n = n.split('.');
for (i = 0, l = n.length; i < l; i++) {
o = o[n[i]];
if (!o) {
break;
}
}
return o;
} | [
"function",
"resolve",
"(",
"n",
",",
"o",
")",
"{",
"var",
"i",
",",
"l",
";",
"o",
"=",
"o",
"||",
"window",
";",
"n",
"=",
"n",
".",
"split",
"(",
"'.'",
")",
";",
"for",
"(",
"i",
"=",
"0",
",",
"l",
"=",
"n",
".",
"length",
";",
"i... | Resolves a string and returns the object from a specific structure.
@method resolve
@param {String} n Path to resolve for example a.b.c.d.
@param {Object} o Optional object to search though, defaults to window.
@return {Object} Last object in path or null if it couldn't be resolved.
@example
// Resolve a path into an ... | [
"Resolves",
"a",
"string",
"and",
"returns",
"the",
"object",
"from",
"a",
"specific",
"structure",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L4046-L4061 |
48,133 | sadiqhabib/tinymce-dist | tinymce.full.js | function (selector, context) {
var self = this, match, node;
if (!selector) {
return self;
}
if (selector.nodeType) {
self.context = self[0] = selector;
self.length = 1;
return self;
}
if (context && context.nodeType) {
... | javascript | function (selector, context) {
var self = this, match, node;
if (!selector) {
return self;
}
if (selector.nodeType) {
self.context = self[0] = selector;
self.length = 1;
return self;
}
if (context && context.nodeType) {
... | [
"function",
"(",
"selector",
",",
"context",
")",
"{",
"var",
"self",
"=",
"this",
",",
"match",
",",
"node",
";",
"if",
"(",
"!",
"selector",
")",
"{",
"return",
"self",
";",
"}",
"if",
"(",
"selector",
".",
"nodeType",
")",
"{",
"self",
".",
"c... | Constructs a new DomQuery instance with the specified selector or context.
@constructor
@method init
@param {String/Array/DomQuery} selector Optional CSS selector/Array or array like object or HTML string.
@param {Document/Element} context Optional context to search in. | [
"Constructs",
"a",
"new",
"DomQuery",
"instance",
"with",
"the",
"specified",
"selector",
"or",
"context",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L4442-L4505 | |
48,134 | sadiqhabib/tinymce-dist | tinymce.full.js | function (items, sort) {
var self = this, nodes, i;
if (isString(items)) {
return self.add(DomQuery(items));
}
if (sort !== false) {
nodes = DomQuery.unique(self.toArray().concat(DomQuery.makeArray(items)));
self.length = nodes.length;
for (i = 0... | javascript | function (items, sort) {
var self = this, nodes, i;
if (isString(items)) {
return self.add(DomQuery(items));
}
if (sort !== false) {
nodes = DomQuery.unique(self.toArray().concat(DomQuery.makeArray(items)));
self.length = nodes.length;
for (i = 0... | [
"function",
"(",
"items",
",",
"sort",
")",
"{",
"var",
"self",
"=",
"this",
",",
"nodes",
",",
"i",
";",
"if",
"(",
"isString",
"(",
"items",
")",
")",
"{",
"return",
"self",
".",
"add",
"(",
"DomQuery",
"(",
"items",
")",
")",
";",
"}",
"if",... | Adds new nodes to the set.
@method add
@param {Array/tinymce.core.dom.DomQuery} items Array of all nodes to add to set.
@param {Boolean} sort Optional sort flag that enables sorting of elements.
@return {tinymce.dom.DomQuery} New instance with nodes added. | [
"Adds",
"new",
"nodes",
"to",
"the",
"set",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L4525-L4543 | |
48,135 | sadiqhabib/tinymce-dist | tinymce.full.js | function () {
var self = this, node, i = this.length;
while (i--) {
node = self[i];
Event.clean(node);
if (node.parentNode) {
node.parentNode.removeChild(node);
}
}
return this;
} | javascript | function () {
var self = this, node, i = this.length;
while (i--) {
node = self[i];
Event.clean(node);
if (node.parentNode) {
node.parentNode.removeChild(node);
}
}
return this;
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
",",
"node",
",",
"i",
"=",
"this",
".",
"length",
";",
"while",
"(",
"i",
"--",
")",
"{",
"node",
"=",
"self",
"[",
"i",
"]",
";",
"Event",
".",
"clean",
"(",
"node",
")",
";",
"if",
"... | Removes all nodes in set from the document.
@method remove
@return {tinymce.dom.DomQuery} Current set with the removed nodes. | [
"Removes",
"all",
"nodes",
"in",
"set",
"from",
"the",
"document",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L4735-L4748 | |
48,136 | sadiqhabib/tinymce-dist | tinymce.full.js | function () {
var self = this, node, i = this.length;
while (i--) {
node = self[i];
while (node.firstChild) {
node.removeChild(node.firstChild);
}
}
return this;
} | javascript | function () {
var self = this, node, i = this.length;
while (i--) {
node = self[i];
while (node.firstChild) {
node.removeChild(node.firstChild);
}
}
return this;
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
",",
"node",
",",
"i",
"=",
"this",
".",
"length",
";",
"while",
"(",
"i",
"--",
")",
"{",
"node",
"=",
"self",
"[",
"i",
"]",
";",
"while",
"(",
"node",
".",
"firstChild",
")",
"{",
"nod... | Empties all elements in set.
@method empty
@return {tinymce.dom.DomQuery} Current set with the empty nodes. | [
"Empties",
"all",
"elements",
"in",
"set",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L4756-L4767 | |
48,137 | sadiqhabib/tinymce-dist | tinymce.full.js | function (value) {
var self = this, i;
if (isDefined(value)) {
i = self.length;
try {
while (i--) {
self[i].innerHTML = value;
}
} catch (ex) {
// Workaround for "Unknown runtime error" when DIV is added to P on IE
... | javascript | function (value) {
var self = this, i;
if (isDefined(value)) {
i = self.length;
try {
while (i--) {
self[i].innerHTML = value;
}
} catch (ex) {
// Workaround for "Unknown runtime error" when DIV is added to P on IE
... | [
"function",
"(",
"value",
")",
"{",
"var",
"self",
"=",
"this",
",",
"i",
";",
"if",
"(",
"isDefined",
"(",
"value",
")",
")",
"{",
"i",
"=",
"self",
".",
"length",
";",
"try",
"{",
"while",
"(",
"i",
"--",
")",
"{",
"self",
"[",
"i",
"]",
... | Sets or gets the HTML of the current set or first set node.
@method html
@param {String} value Optional innerHTML value to set on each element.
@return {tinymce.dom.DomQuery/String} Current set or the innerHTML of the first element. | [
"Sets",
"or",
"gets",
"the",
"HTML",
"of",
"the",
"current",
"set",
"or",
"first",
"set",
"node",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L4776-L4795 | |
48,138 | sadiqhabib/tinymce-dist | tinymce.full.js | function (value) {
var self = this, i;
if (isDefined(value)) {
i = self.length;
while (i--) {
if ("innerText" in self[i]) {
self[i].innerText = value;
} else {
self[0].textContent = value;
}
}
retur... | javascript | function (value) {
var self = this, i;
if (isDefined(value)) {
i = self.length;
while (i--) {
if ("innerText" in self[i]) {
self[i].innerText = value;
} else {
self[0].textContent = value;
}
}
retur... | [
"function",
"(",
"value",
")",
"{",
"var",
"self",
"=",
"this",
",",
"i",
";",
"if",
"(",
"isDefined",
"(",
"value",
")",
")",
"{",
"i",
"=",
"self",
".",
"length",
";",
"while",
"(",
"i",
"--",
")",
"{",
"if",
"(",
"\"innerText\"",
"in",
"self... | Sets or gets the text of the current set or first set node.
@method text
@param {String} value Optional innerText value to set on each element.
@return {tinymce.dom.DomQuery/String} Current set or the innerText of the first element. | [
"Sets",
"or",
"gets",
"the",
"text",
"of",
"the",
"current",
"set",
"or",
"first",
"set",
"node",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L4804-L4821 | |
48,139 | sadiqhabib/tinymce-dist | tinymce.full.js | function () {
var self = this;
if (self[0] && self[0].parentNode) {
return domManipulate(self, arguments, function (node) {
this.parentNode.insertBefore(node, this);
});
}
return self;
} | javascript | function () {
var self = this;
if (self[0] && self[0].parentNode) {
return domManipulate(self, arguments, function (node) {
this.parentNode.insertBefore(node, this);
});
}
return self;
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"self",
"[",
"0",
"]",
"&&",
"self",
"[",
"0",
"]",
".",
"parentNode",
")",
"{",
"return",
"domManipulate",
"(",
"self",
",",
"arguments",
",",
"function",
"(",
"node",
")",
"... | Adds the specified elements before current set nodes.
@method before
@param {String/Element/Array/tinymce.dom.DomQuery} content Content to add before to each element in set.
@return {tinymce.dom.DomQuery} Current set. | [
"Adds",
"the",
"specified",
"elements",
"before",
"current",
"set",
"nodes",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L4862-L4872 | |
48,140 | sadiqhabib/tinymce-dist | tinymce.full.js | function () {
var self = this;
if (self[0] && self[0].parentNode) {
return domManipulate(self, arguments, function (node) {
this.parentNode.insertBefore(node, this.nextSibling);
}, true);
}
return self;
} | javascript | function () {
var self = this;
if (self[0] && self[0].parentNode) {
return domManipulate(self, arguments, function (node) {
this.parentNode.insertBefore(node, this.nextSibling);
}, true);
}
return self;
} | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"self",
"[",
"0",
"]",
"&&",
"self",
"[",
"0",
"]",
".",
"parentNode",
")",
"{",
"return",
"domManipulate",
"(",
"self",
",",
"arguments",
",",
"function",
"(",
"node",
")",
"... | Adds the specified elements after current set nodes.
@method after
@param {String/Element/Array/tinymce.dom.DomQuery} content Content to add after to each element in set.
@return {tinymce.dom.DomQuery} Current set. | [
"Adds",
"the",
"specified",
"elements",
"after",
"current",
"set",
"nodes",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L4881-L4891 | |
48,141 | sadiqhabib/tinymce-dist | tinymce.full.js | function (className, state) {
var self = this;
// Functions are not supported
if (typeof className != 'string') {
return self;
}
if (className.indexOf(' ') !== -1) {
each(className.split(' '), function () {
self.toggleClass(this, state);
... | javascript | function (className, state) {
var self = this;
// Functions are not supported
if (typeof className != 'string') {
return self;
}
if (className.indexOf(' ') !== -1) {
each(className.split(' '), function () {
self.toggleClass(this, state);
... | [
"function",
"(",
"className",
",",
"state",
")",
"{",
"var",
"self",
"=",
"this",
";",
"// Functions are not supported",
"if",
"(",
"typeof",
"className",
"!=",
"'string'",
")",
"{",
"return",
"self",
";",
"}",
"if",
"(",
"className",
".",
"indexOf",
"(",
... | Toggles the specified class name on the current set elements.
@method toggleClass
@param {String} className Class name to add/remove.
@param {Boolean} state Optional state to toggle on/off.
@return {tinymce.dom.DomQuery} Current set. | [
"Toggles",
"the",
"specified",
"class",
"name",
"on",
"the",
"current",
"set",
"elements",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L5026-L5056 | |
48,142 | sadiqhabib/tinymce-dist | tinymce.full.js | function (name) {
return this.each(function () {
if (typeof name == 'object') {
Event.fire(this, name.type, name);
} else {
Event.fire(this, name);
}
});
} | javascript | function (name) {
return this.each(function () {
if (typeof name == 'object') {
Event.fire(this, name.type, name);
} else {
Event.fire(this, name);
}
});
} | [
"function",
"(",
"name",
")",
"{",
"return",
"this",
".",
"each",
"(",
"function",
"(",
")",
"{",
"if",
"(",
"typeof",
"name",
"==",
"'object'",
")",
"{",
"Event",
".",
"fire",
"(",
"this",
",",
"name",
".",
"type",
",",
"name",
")",
";",
"}",
... | Triggers the specified event by name or event object.
@method trigger
@param {String/Object} name Name of the event to trigger or event object.
@return {tinymce.dom.DomQuery} Current set. | [
"Triggers",
"the",
"specified",
"event",
"by",
"name",
"or",
"event",
"object",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L5116-L5124 | |
48,143 | sadiqhabib/tinymce-dist | tinymce.full.js | function (selector) {
var i, l, ret = [];
for (i = 0, l = this.length; i < l; i++) {
DomQuery.find(selector, this[i], ret);
}
return DomQuery(ret);
} | javascript | function (selector) {
var i, l, ret = [];
for (i = 0, l = this.length; i < l; i++) {
DomQuery.find(selector, this[i], ret);
}
return DomQuery(ret);
} | [
"function",
"(",
"selector",
")",
"{",
"var",
"i",
",",
"l",
",",
"ret",
"=",
"[",
"]",
";",
"for",
"(",
"i",
"=",
"0",
",",
"l",
"=",
"this",
".",
"length",
";",
"i",
"<",
"l",
";",
"i",
"++",
")",
"{",
"DomQuery",
".",
"find",
"(",
"sel... | Finds elements by the specified selector for each element in set.
@method find
@param {String} selector Selector to find elements by.
@return {tinymce.dom.DomQuery} Set with matches elements. | [
"Finds",
"elements",
"by",
"the",
"specified",
"selector",
"for",
"each",
"element",
"in",
"set",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L5196-L5204 | |
48,144 | sadiqhabib/tinymce-dist | tinymce.full.js | function (selector) {
if (typeof selector == 'function') {
return DomQuery(grep(this.toArray(), function (item, i) {
return selector(i, item);
}));
}
return DomQuery(DomQuery.filter(selector, this.toArray()));
} | javascript | function (selector) {
if (typeof selector == 'function') {
return DomQuery(grep(this.toArray(), function (item, i) {
return selector(i, item);
}));
}
return DomQuery(DomQuery.filter(selector, this.toArray()));
} | [
"function",
"(",
"selector",
")",
"{",
"if",
"(",
"typeof",
"selector",
"==",
"'function'",
")",
"{",
"return",
"DomQuery",
"(",
"grep",
"(",
"this",
".",
"toArray",
"(",
")",
",",
"function",
"(",
"item",
",",
"i",
")",
"{",
"return",
"selector",
"(... | Filters the current set with the specified selector.
@method filter
@param {String/function} selector Selector to filter elements by.
@return {tinymce.dom.DomQuery} Set with filtered elements. | [
"Filters",
"the",
"current",
"set",
"with",
"the",
"specified",
"selector",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L5213-L5221 | |
48,145 | sadiqhabib/tinymce-dist | tinymce.full.js | function (selector) {
var result = [];
if (selector instanceof DomQuery) {
selector = selector[0];
}
this.each(function (i, node) {
while (node) {
if (typeof selector == 'string' && DomQuery(node).is(selector)) {
result.push(node);
... | javascript | function (selector) {
var result = [];
if (selector instanceof DomQuery) {
selector = selector[0];
}
this.each(function (i, node) {
while (node) {
if (typeof selector == 'string' && DomQuery(node).is(selector)) {
result.push(node);
... | [
"function",
"(",
"selector",
")",
"{",
"var",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"selector",
"instanceof",
"DomQuery",
")",
"{",
"selector",
"=",
"selector",
"[",
"0",
"]",
";",
"}",
"this",
".",
"each",
"(",
"function",
"(",
"i",
",",
"node"... | Gets the current node or any parent matching the specified selector.
@method closest
@param {String/Element/tinymce.dom.DomQuery} selector Selector or element to find.
@return {tinymce.dom.DomQuery} Set with closest elements. | [
"Gets",
"the",
"current",
"node",
"or",
"any",
"parent",
"matching",
"the",
"specified",
"selector",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L5230-L5252 | |
48,146 | sadiqhabib/tinymce-dist | tinymce.full.js | function (node) {
return Tools.toArray((node.nodeName === "iframe" ? node.contentDocument || node.contentWindow.document : node).childNodes);
} | javascript | function (node) {
return Tools.toArray((node.nodeName === "iframe" ? node.contentDocument || node.contentWindow.document : node).childNodes);
} | [
"function",
"(",
"node",
")",
"{",
"return",
"Tools",
".",
"toArray",
"(",
"(",
"node",
".",
"nodeName",
"===",
"\"iframe\"",
"?",
"node",
".",
"contentDocument",
"||",
"node",
".",
"contentWindow",
".",
"document",
":",
"node",
")",
".",
"childNodes",
"... | Returns all child nodes matching the optional selector.
@method contents
@param {Element/tinymce.dom.DomQuery} node Node to get the contents of.
@return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements. | [
"Returns",
"all",
"child",
"nodes",
"matching",
"the",
"optional",
"selector",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L5539-L5541 | |
48,147 | sadiqhabib/tinymce-dist | tinymce.full.js | nativeDecode | function nativeDecode(text) {
var elm;
elm = document.createElement("div");
elm.innerHTML = text;
return elm.textContent || elm.innerText || text;
} | javascript | function nativeDecode(text) {
var elm;
elm = document.createElement("div");
elm.innerHTML = text;
return elm.textContent || elm.innerText || text;
} | [
"function",
"nativeDecode",
"(",
"text",
")",
"{",
"var",
"elm",
";",
"elm",
"=",
"document",
".",
"createElement",
"(",
"\"div\"",
")",
";",
"elm",
".",
"innerHTML",
"=",
"text",
";",
"return",
"elm",
".",
"textContent",
"||",
"elm",
".",
"innerText",
... | Decodes text by using the browser | [
"Decodes",
"text",
"by",
"using",
"the",
"browser"
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L6339-L6346 |
48,148 | sadiqhabib/tinymce-dist | tinymce.full.js | function (text, attr) {
return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function (chr) {
// Multi byte sequence convert it to a single entity
if (chr.length > 1) {
return '&#' + (((chr.charCodeAt(0) - 0xD800) * 0x400) + (chr.charCodeAt(1) - 0xDC00) + 0x10000) + ';'... | javascript | function (text, attr) {
return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function (chr) {
// Multi byte sequence convert it to a single entity
if (chr.length > 1) {
return '&#' + (((chr.charCodeAt(0) - 0xD800) * 0x400) + (chr.charCodeAt(1) - 0xDC00) + 0x10000) + ';'... | [
"function",
"(",
"text",
",",
"attr",
")",
"{",
"return",
"text",
".",
"replace",
"(",
"attr",
"?",
"attrsCharsRegExp",
":",
"textCharsRegExp",
",",
"function",
"(",
"chr",
")",
"{",
"// Multi byte sequence convert it to a single entity",
"if",
"(",
"chr",
".",
... | Encodes the specified string using numeric entities. The core entities will be
encoded as named ones but all non lower ascii characters will be encoded into numeric entities.
@method encodeNumeric
@param {String} text Text to encode.
@param {Boolean} attr Optional flag to specify if the text is attribute contents.
@re... | [
"Encodes",
"the",
"specified",
"string",
"using",
"numeric",
"entities",
".",
"The",
"core",
"entities",
"will",
"be",
"encoded",
"as",
"named",
"ones",
"but",
"all",
"non",
"lower",
"ascii",
"characters",
"will",
"be",
"encoded",
"into",
"numeric",
"entities"... | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L6439-L6448 | |
48,149 | sadiqhabib/tinymce-dist | tinymce.full.js | function (text) {
return text.replace(entityRegExp, function (all, numeric) {
if (numeric) {
if (numeric.charAt(0).toLowerCase() === 'x') {
numeric = parseInt(numeric.substr(1), 16);
} else {
numeric = parseInt(numeric, 10);
}
... | javascript | function (text) {
return text.replace(entityRegExp, function (all, numeric) {
if (numeric) {
if (numeric.charAt(0).toLowerCase() === 'x') {
numeric = parseInt(numeric.substr(1), 16);
} else {
numeric = parseInt(numeric, 10);
}
... | [
"function",
"(",
"text",
")",
"{",
"return",
"text",
".",
"replace",
"(",
"entityRegExp",
",",
"function",
"(",
"all",
",",
"numeric",
")",
"{",
"if",
"(",
"numeric",
")",
"{",
"if",
"(",
"numeric",
".",
"charAt",
"(",
"0",
")",
".",
"toLowerCase",
... | Decodes the specified string, this will replace entities with raw UTF characters.
@method decode
@param {String} text Text to entity decode.
@return {String} Entity decoded string. | [
"Decodes",
"the",
"specified",
"string",
"this",
"will",
"replace",
"entities",
"with",
"raw",
"UTF",
"characters",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L6523-L6544 | |
48,150 | sadiqhabib/tinymce-dist | tinymce.full.js | wait | function wait(testCallback, waitCallback) {
if (!testCallback()) {
// Wait for timeout
if ((new Date().getTime()) - startTime < maxLoadTime) {
Delay.setTimeout(waitCallback);
} else {
failed();
}
}
} | javascript | function wait(testCallback, waitCallback) {
if (!testCallback()) {
// Wait for timeout
if ((new Date().getTime()) - startTime < maxLoadTime) {
Delay.setTimeout(waitCallback);
} else {
failed();
}
}
} | [
"function",
"wait",
"(",
"testCallback",
",",
"waitCallback",
")",
"{",
"if",
"(",
"!",
"testCallback",
"(",
")",
")",
"{",
"// Wait for timeout",
"if",
"(",
"(",
"new",
"Date",
"(",
")",
".",
"getTime",
"(",
")",
")",
"-",
"startTime",
"<",
"maxLoadTi... | Calls the waitCallback until the test returns true or the timeout occurs | [
"Calls",
"the",
"waitCallback",
"until",
"the",
"test",
"returns",
"true",
"or",
"the",
"timeout",
"occurs"
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L7418-L7427 |
48,151 | sadiqhabib/tinymce-dist | tinymce.full.js | waitForGeckoLinkLoaded | function waitForGeckoLinkLoaded() {
wait(function () {
try {
// Accessing the cssRules will throw an exception until the CSS file is loaded
var cssRules = style.sheet.cssRules;
passed();
return !!cssRules;
} catch (ex) {
... | javascript | function waitForGeckoLinkLoaded() {
wait(function () {
try {
// Accessing the cssRules will throw an exception until the CSS file is loaded
var cssRules = style.sheet.cssRules;
passed();
return !!cssRules;
} catch (ex) {
... | [
"function",
"waitForGeckoLinkLoaded",
"(",
")",
"{",
"wait",
"(",
"function",
"(",
")",
"{",
"try",
"{",
"// Accessing the cssRules will throw an exception until the CSS file is loaded",
"var",
"cssRules",
"=",
"style",
".",
"sheet",
".",
"cssRules",
";",
"passed",
"(... | Workaround for older Geckos that doesn't have any onload event for StyleSheets | [
"Workaround",
"for",
"older",
"Geckos",
"that",
"doesn",
"t",
"have",
"any",
"onload",
"event",
"for",
"StyleSheets"
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L7447-L7458 |
48,152 | sadiqhabib/tinymce-dist | tinymce.full.js | DOMUtils | function DOMUtils(doc, settings) {
var self = this, blockElementsMap;
self.doc = doc;
self.win = window;
self.files = {};
self.counter = 0;
self.stdMode = !isIE || doc.documentMode >= 8;
self.boxModel = !isIE || doc.compatMode == "CSS1Compat" || self.stdMode;
self.styleS... | javascript | function DOMUtils(doc, settings) {
var self = this, blockElementsMap;
self.doc = doc;
self.win = window;
self.files = {};
self.counter = 0;
self.stdMode = !isIE || doc.documentMode >= 8;
self.boxModel = !isIE || doc.compatMode == "CSS1Compat" || self.stdMode;
self.styleS... | [
"function",
"DOMUtils",
"(",
"doc",
",",
"settings",
")",
"{",
"var",
"self",
"=",
"this",
",",
"blockElementsMap",
";",
"self",
".",
"doc",
"=",
"doc",
";",
"self",
".",
"win",
"=",
"window",
";",
"self",
".",
"files",
"=",
"{",
"}",
";",
"self",
... | Constructs a new DOMUtils instance. Consult the Wiki for more details on settings etc for this class.
@constructor
@method DOMUtils
@param {Document} doc Document reference to bind the utility class to.
@param {settings} settings Optional settings collection. | [
"Constructs",
"a",
"new",
"DOMUtils",
"instance",
".",
"Consult",
"the",
"Wiki",
"for",
"more",
"details",
"on",
"settings",
"etc",
"for",
"this",
"class",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L7668-L7720 |
48,153 | sadiqhabib/tinymce-dist | tinymce.full.js | function (win) {
var doc, rootElm;
win = !win ? this.win : win;
doc = win.document;
rootElm = this.boxModel ? doc.documentElement : doc.body;
// Returns viewport size excluding scrollbars
return {
x: win.pageXOffset || rootElm.scrollLeft,
y: win.page... | javascript | function (win) {
var doc, rootElm;
win = !win ? this.win : win;
doc = win.document;
rootElm = this.boxModel ? doc.documentElement : doc.body;
// Returns viewport size excluding scrollbars
return {
x: win.pageXOffset || rootElm.scrollLeft,
y: win.page... | [
"function",
"(",
"win",
")",
"{",
"var",
"doc",
",",
"rootElm",
";",
"win",
"=",
"!",
"win",
"?",
"this",
".",
"win",
":",
"win",
";",
"doc",
"=",
"win",
".",
"document",
";",
"rootElm",
"=",
"this",
".",
"boxModel",
"?",
"doc",
".",
"documentEle... | Returns the viewport of the window.
@method getViewPort
@param {Window} win Optional window to get viewport of.
@return {Object} Viewport object with fields x, y, w and h. | [
"Returns",
"the",
"viewport",
"of",
"the",
"window",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L7798-L7812 | |
48,154 | sadiqhabib/tinymce-dist | tinymce.full.js | function (elm) {
var self = this, pos, size;
elm = self.get(elm);
pos = self.getPos(elm);
size = self.getSize(elm);
return {
x: pos.x, y: pos.y,
w: size.w, h: size.h
};
} | javascript | function (elm) {
var self = this, pos, size;
elm = self.get(elm);
pos = self.getPos(elm);
size = self.getSize(elm);
return {
x: pos.x, y: pos.y,
w: size.w, h: size.h
};
} | [
"function",
"(",
"elm",
")",
"{",
"var",
"self",
"=",
"this",
",",
"pos",
",",
"size",
";",
"elm",
"=",
"self",
".",
"get",
"(",
"elm",
")",
";",
"pos",
"=",
"self",
".",
"getPos",
"(",
"elm",
")",
";",
"size",
"=",
"self",
".",
"getSize",
"(... | Returns the rectangle for a specific element.
@method getRect
@param {Element/String} elm Element object or element ID to get rectangle from.
@return {object} Rectangle for specified element object with x, y, w, h fields. | [
"Returns",
"the",
"rectangle",
"for",
"a",
"specific",
"element",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L7821-L7832 | |
48,155 | sadiqhabib/tinymce-dist | tinymce.full.js | function (elm) {
var self = this, w, h;
elm = self.get(elm);
w = self.getStyle(elm, 'width');
h = self.getStyle(elm, 'height');
// Non pixel value, then force offset/clientWidth
if (w.indexOf('px') === -1) {
w = 0;
}
// Non pixel value, then f... | javascript | function (elm) {
var self = this, w, h;
elm = self.get(elm);
w = self.getStyle(elm, 'width');
h = self.getStyle(elm, 'height');
// Non pixel value, then force offset/clientWidth
if (w.indexOf('px') === -1) {
w = 0;
}
// Non pixel value, then f... | [
"function",
"(",
"elm",
")",
"{",
"var",
"self",
"=",
"this",
",",
"w",
",",
"h",
";",
"elm",
"=",
"self",
".",
"get",
"(",
"elm",
")",
";",
"w",
"=",
"self",
".",
"getStyle",
"(",
"elm",
",",
"'width'",
")",
";",
"h",
"=",
"self",
".",
"ge... | Returns the size dimensions of the specified element.
@method getSize
@param {Element/String} elm Element object or element ID to get rectangle from.
@return {object} Rectangle for specified element object with w, h fields. | [
"Returns",
"the",
"size",
"dimensions",
"of",
"the",
"specified",
"element",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L7841-L7862 | |
48,156 | sadiqhabib/tinymce-dist | tinymce.full.js | function (node, selector, root, collect) {
var self = this, selectorVal, result = [];
node = self.get(node);
collect = collect === undefined;
// Default root on inline mode
root = root || (self.getRoot().nodeName != 'BODY' ? self.getRoot().parentNode : null);
// Wrap n... | javascript | function (node, selector, root, collect) {
var self = this, selectorVal, result = [];
node = self.get(node);
collect = collect === undefined;
// Default root on inline mode
root = root || (self.getRoot().nodeName != 'BODY' ? self.getRoot().parentNode : null);
// Wrap n... | [
"function",
"(",
"node",
",",
"selector",
",",
"root",
",",
"collect",
")",
"{",
"var",
"self",
"=",
"this",
",",
"selectorVal",
",",
"result",
"=",
"[",
"]",
";",
"node",
"=",
"self",
".",
"get",
"(",
"node",
")",
";",
"collect",
"=",
"collect",
... | Returns a node list of all parents matching the specified selector function or pattern.
If the function then returns true indicating that it has found what it was looking for and that node will be collected.
@method getParents
@param {Node/String} node DOM node to search parents on or ID string.
@param {function} sele... | [
"Returns",
"a",
"node",
"list",
"of",
"all",
"parents",
"matching",
"the",
"specified",
"selector",
"function",
"or",
"pattern",
".",
"If",
"the",
"function",
"then",
"returns",
"true",
"indicating",
"that",
"it",
"has",
"found",
"what",
"it",
"was",
"lookin... | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L7890-L7931 | |
48,157 | sadiqhabib/tinymce-dist | tinymce.full.js | function (elm) {
var name;
if (elm && this.doc && typeof elm == 'string') {
name = elm;
elm = this.doc.getElementById(elm);
// IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the trick
if (elm && elm.i... | javascript | function (elm) {
var name;
if (elm && this.doc && typeof elm == 'string') {
name = elm;
elm = this.doc.getElementById(elm);
// IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the trick
if (elm && elm.i... | [
"function",
"(",
"elm",
")",
"{",
"var",
"name",
";",
"if",
"(",
"elm",
"&&",
"this",
".",
"doc",
"&&",
"typeof",
"elm",
"==",
"'string'",
")",
"{",
"name",
"=",
"elm",
";",
"elm",
"=",
"this",
".",
"doc",
".",
"getElementById",
"(",
"elm",
")",
... | Returns the specified element by ID or the input element if it isn't a string.
@method get
@param {String/Element} n Element id to look for or element to just pass though.
@return {Element} Element matching the specified id or null if it wasn't found. | [
"Returns",
"the",
"specified",
"element",
"by",
"ID",
"or",
"the",
"input",
"element",
"if",
"it",
"isn",
"t",
"a",
"string",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L7940-L7954 | |
48,158 | sadiqhabib/tinymce-dist | tinymce.full.js | function (name, attrs, html) {
return this.add(this.doc.createElement(name), name, attrs, html, 1);
} | javascript | function (name, attrs, html) {
return this.add(this.doc.createElement(name), name, attrs, html, 1);
} | [
"function",
"(",
"name",
",",
"attrs",
",",
"html",
")",
"{",
"return",
"this",
".",
"add",
"(",
"this",
".",
"doc",
".",
"createElement",
"(",
"name",
")",
",",
"name",
",",
"attrs",
",",
"html",
",",
"1",
")",
";",
"}"
] | Creates a new element.
@method create
@param {String} name Name of new element.
@param {Object} attrs Optional object name/value collection with element attributes.
@param {String} html Optional HTML string to set as inner HTML of the element.
@return {Element} HTML DOM node element that got created.
@example
// Adds ... | [
"Creates",
"a",
"new",
"element",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8099-L8101 | |
48,159 | sadiqhabib/tinymce-dist | tinymce.full.js | function (name, attrs, html) {
var outHtml = '', key;
outHtml += '<' + name;
for (key in attrs) {
if (attrs.hasOwnProperty(key) && attrs[key] !== null && typeof attrs[key] != 'undefined') {
outHtml += ' ' + key + '="' + this.encode(attrs[key]) + '"';
}
}... | javascript | function (name, attrs, html) {
var outHtml = '', key;
outHtml += '<' + name;
for (key in attrs) {
if (attrs.hasOwnProperty(key) && attrs[key] !== null && typeof attrs[key] != 'undefined') {
outHtml += ' ' + key + '="' + this.encode(attrs[key]) + '"';
}
}... | [
"function",
"(",
"name",
",",
"attrs",
",",
"html",
")",
"{",
"var",
"outHtml",
"=",
"''",
",",
"key",
";",
"outHtml",
"+=",
"'<'",
"+",
"name",
";",
"for",
"(",
"key",
"in",
"attrs",
")",
"{",
"if",
"(",
"attrs",
".",
"hasOwnProperty",
"(",
"key... | Creates HTML string for element. The element will be closed unless an empty inner HTML string is passed in.
@method createHTML
@param {String} name Name of new element.
@param {Object} attrs Optional object name/value collection with element attributes.
@param {String} html Optional HTML string to set as inner HTML of... | [
"Creates",
"HTML",
"string",
"for",
"element",
".",
"The",
"element",
"will",
"be",
"closed",
"unless",
"an",
"empty",
"inner",
"HTML",
"string",
"is",
"passed",
"in",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8115-L8132 | |
48,160 | sadiqhabib/tinymce-dist | tinymce.full.js | function (elm, name, value) {
elm = this.$$(elm).css(name, value);
if (this.settings.update_styles) {
updateInternalStyleAttr(this, elm);
}
} | javascript | function (elm, name, value) {
elm = this.$$(elm).css(name, value);
if (this.settings.update_styles) {
updateInternalStyleAttr(this, elm);
}
} | [
"function",
"(",
"elm",
",",
"name",
",",
"value",
")",
"{",
"elm",
"=",
"this",
".",
"$$",
"(",
"elm",
")",
".",
"css",
"(",
"name",
",",
"value",
")",
";",
"if",
"(",
"this",
".",
"settings",
".",
"update_styles",
")",
"{",
"updateInternalStyleAt... | Sets the CSS style value on a HTML element. The name can be a camelcase string
or the CSS style name like background-color.
@method setStyle
@param {String/Element/Array} elm HTML element/Array of elements to set CSS style value on.
@param {String} name Name of the style value to set.
@param {String} value Value to se... | [
"Sets",
"the",
"CSS",
"style",
"value",
"on",
"a",
"HTML",
"element",
".",
"The",
"name",
"can",
"be",
"a",
"camelcase",
"string",
"or",
"the",
"CSS",
"style",
"name",
"like",
"background",
"-",
"color",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8211-L8217 | |
48,161 | sadiqhabib/tinymce-dist | tinymce.full.js | function (e) {
return this.run(e, function (e) {
var i, attrs = e.attributes;
for (i = attrs.length - 1; i >= 0; i--) {
e.removeAttributeNode(attrs.item(i));
}
});
} | javascript | function (e) {
return this.run(e, function (e) {
var i, attrs = e.attributes;
for (i = attrs.length - 1; i >= 0; i--) {
e.removeAttributeNode(attrs.item(i));
}
});
} | [
"function",
"(",
"e",
")",
"{",
"return",
"this",
".",
"run",
"(",
"e",
",",
"function",
"(",
"e",
")",
"{",
"var",
"i",
",",
"attrs",
"=",
"e",
".",
"attributes",
";",
"for",
"(",
"i",
"=",
"attrs",
".",
"length",
"-",
"1",
";",
"i",
">=",
... | Removes all attributes from an element or elements.
@method removeAllAttribs
@param {Element/String/Array} e DOM element, element id string or array of elements/ids to remove attributes from. | [
"Removes",
"all",
"attributes",
"from",
"an",
"element",
"or",
"elements",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8274-L8281 | |
48,162 | sadiqhabib/tinymce-dist | tinymce.full.js | function (elm, name, value) {
var self = this, originalValue, hook, settings = self.settings;
if (value === '') {
value = null;
}
elm = self.$$(elm);
originalValue = elm.attr(name);
if (!elm.length) {
return;
}
hook = self.attrHooks... | javascript | function (elm, name, value) {
var self = this, originalValue, hook, settings = self.settings;
if (value === '') {
value = null;
}
elm = self.$$(elm);
originalValue = elm.attr(name);
if (!elm.length) {
return;
}
hook = self.attrHooks... | [
"function",
"(",
"elm",
",",
"name",
",",
"value",
")",
"{",
"var",
"self",
"=",
"this",
",",
"originalValue",
",",
"hook",
",",
"settings",
"=",
"self",
".",
"settings",
";",
"if",
"(",
"value",
"===",
"''",
")",
"{",
"value",
"=",
"null",
";",
... | Sets the specified attribute of an element or elements.
@method setAttrib
@param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set attribute on.
@param {String} name Name of attribute to set.
@param {String} value Value to set on the attribute - if this value is falsy like null,... | [
"Sets",
"the",
"specified",
"attribute",
"of",
"an",
"element",
"or",
"elements",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8298-L8326 | |
48,163 | sadiqhabib/tinymce-dist | tinymce.full.js | function (elm, attrs) {
var self = this;
self.$$(elm).each(function (i, node) {
each(attrs, function (value, name) {
self.setAttrib(node, name, value);
});
});
} | javascript | function (elm, attrs) {
var self = this;
self.$$(elm).each(function (i, node) {
each(attrs, function (value, name) {
self.setAttrib(node, name, value);
});
});
} | [
"function",
"(",
"elm",
",",
"attrs",
")",
"{",
"var",
"self",
"=",
"this",
";",
"self",
".",
"$$",
"(",
"elm",
")",
".",
"each",
"(",
"function",
"(",
"i",
",",
"node",
")",
"{",
"each",
"(",
"attrs",
",",
"function",
"(",
"value",
",",
"name"... | Sets two or more specified attributes of an element or elements.
@method setAttribs
@param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set attributes on.
@param {Object} attrs Name/Value collection of attribute items to add to the element(s).
@example
// Sets class and title a... | [
"Sets",
"two",
"or",
"more",
"specified",
"attributes",
"of",
"an",
"element",
"or",
"elements",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8341-L8349 | |
48,164 | sadiqhabib/tinymce-dist | tinymce.full.js | function (elm, name, defaultVal) {
var self = this, hook, value;
elm = self.$$(elm);
if (elm.length) {
hook = self.attrHooks[name];
if (hook && hook.get) {
value = hook.get(elm, name);
} else {
value = elm.attr(name);
}
}... | javascript | function (elm, name, defaultVal) {
var self = this, hook, value;
elm = self.$$(elm);
if (elm.length) {
hook = self.attrHooks[name];
if (hook && hook.get) {
value = hook.get(elm, name);
} else {
value = elm.attr(name);
}
}... | [
"function",
"(",
"elm",
",",
"name",
",",
"defaultVal",
")",
"{",
"var",
"self",
"=",
"this",
",",
"hook",
",",
"value",
";",
"elm",
"=",
"self",
".",
"$$",
"(",
"elm",
")",
";",
"if",
"(",
"elm",
".",
"length",
")",
"{",
"hook",
"=",
"self",
... | Returns the specified attribute by name.
@method getAttrib
@param {String/Element} elm Element string id or DOM element to get attribute from.
@param {String} name Name of attribute to get.
@param {String} defaultVal Optional default value to return if the attribute didn't exist.
@return {String} Attribute value strin... | [
"Returns",
"the",
"specified",
"attribute",
"by",
"name",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8360-L8380 | |
48,165 | sadiqhabib/tinymce-dist | tinymce.full.js | function (cssText) {
var self = this, doc = self.doc, head, styleElm;
// Prevent inline from loading the same styles twice
if (self !== DOMUtils.DOM && doc === document) {
var addedStyles = DOMUtils.DOM.addedStyles;
addedStyles = addedStyles || [];
if (addedStyles... | javascript | function (cssText) {
var self = this, doc = self.doc, head, styleElm;
// Prevent inline from loading the same styles twice
if (self !== DOMUtils.DOM && doc === document) {
var addedStyles = DOMUtils.DOM.addedStyles;
addedStyles = addedStyles || [];
if (addedStyles... | [
"function",
"(",
"cssText",
")",
"{",
"var",
"self",
"=",
"this",
",",
"doc",
"=",
"self",
".",
"doc",
",",
"head",
",",
"styleElm",
";",
"// Prevent inline from loading the same styles twice",
"if",
"(",
"self",
"!==",
"DOMUtils",
".",
"DOM",
"&&",
"doc",
... | Adds a style element at the top of the document with the specified cssText content.
@method addStyle
@param {String} cssText CSS Text style to add to top of head of document. | [
"Adds",
"a",
"style",
"element",
"at",
"the",
"top",
"of",
"the",
"document",
"with",
"the",
"specified",
"cssText",
"content",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8460-L8497 | |
48,166 | sadiqhabib/tinymce-dist | tinymce.full.js | function (elm, html) {
elm = this.$$(elm);
if (isIE) {
elm.each(function (i, target) {
if (target.canHaveHTML === false) {
return;
}
// Remove all child nodes, IE keeps empty text nodes in DOM
while (target.firstChild) {
... | javascript | function (elm, html) {
elm = this.$$(elm);
if (isIE) {
elm.each(function (i, target) {
if (target.canHaveHTML === false) {
return;
}
// Remove all child nodes, IE keeps empty text nodes in DOM
while (target.firstChild) {
... | [
"function",
"(",
"elm",
",",
"html",
")",
"{",
"elm",
"=",
"this",
".",
"$$",
"(",
"elm",
")",
";",
"if",
"(",
"isIE",
")",
"{",
"elm",
".",
"each",
"(",
"function",
"(",
"i",
",",
"target",
")",
"{",
"if",
"(",
"target",
".",
"canHaveHTML",
... | Sets the specified HTML content inside the element or elements. The HTML will first be processed. This means
URLs will get converted, hex color values fixed etc. Check processHTML for details.
@method setHTML
@param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set HTML inside o... | [
"Sets",
"the",
"specified",
"HTML",
"content",
"inside",
"the",
"element",
"or",
"elements",
".",
"The",
"HTML",
"will",
"first",
"be",
"processed",
".",
"This",
"means",
"URLs",
"will",
"get",
"converted",
"hex",
"color",
"values",
"fixed",
"etc",
".",
"C... | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8686-L8715 | |
48,167 | sadiqhabib/tinymce-dist | tinymce.full.js | function (elm) {
elm = this.get(elm);
// Older FF doesn't have outerHTML 3.6 is still used by some orgaizations
return elm.nodeType == 1 && "outerHTML" in elm ? elm.outerHTML : $('<div></div>').append($(elm).clone()).html();
} | javascript | function (elm) {
elm = this.get(elm);
// Older FF doesn't have outerHTML 3.6 is still used by some orgaizations
return elm.nodeType == 1 && "outerHTML" in elm ? elm.outerHTML : $('<div></div>').append($(elm).clone()).html();
} | [
"function",
"(",
"elm",
")",
"{",
"elm",
"=",
"this",
".",
"get",
"(",
"elm",
")",
";",
"// Older FF doesn't have outerHTML 3.6 is still used by some orgaizations",
"return",
"elm",
".",
"nodeType",
"==",
"1",
"&&",
"\"outerHTML\"",
"in",
"elm",
"?",
"elm",
".",... | Returns the outer HTML of an element.
@method getOuterHTML
@param {String/Element} elm Element ID or element object to get outer HTML from.
@return {String} Outer HTML string.
@example
tinymce.DOM.getOuterHTML(editorElement);
tinymce.activeEditor.getOuterHTML(tinymce.activeEditor.getBody()); | [
"Returns",
"the",
"outer",
"HTML",
"of",
"an",
"element",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8727-L8732 | |
48,168 | sadiqhabib/tinymce-dist | tinymce.full.js | function (elm, html) {
var self = this;
self.$$(elm).each(function () {
try {
// Older FF doesn't have outerHTML 3.6 is still used by some organizations
if ("outerHTML" in this) {
this.outerHTML = html;
return;
}
} catc... | javascript | function (elm, html) {
var self = this;
self.$$(elm).each(function () {
try {
// Older FF doesn't have outerHTML 3.6 is still used by some organizations
if ("outerHTML" in this) {
this.outerHTML = html;
return;
}
} catc... | [
"function",
"(",
"elm",
",",
"html",
")",
"{",
"var",
"self",
"=",
"this",
";",
"self",
".",
"$$",
"(",
"elm",
")",
".",
"each",
"(",
"function",
"(",
")",
"{",
"try",
"{",
"// Older FF doesn't have outerHTML 3.6 is still used by some organizations",
"if",
"... | Sets the specified outer HTML on an element or elements.
@method setOuterHTML
@param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set outer HTML on.
@param {Object} html HTML code to set as outer value for the element.
@example
// Sets the outer HTML of all paragraphs in the ac... | [
"Sets",
"the",
"specified",
"outer",
"HTML",
"on",
"an",
"element",
"or",
"elements",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8747-L8764 | |
48,169 | sadiqhabib/tinymce-dist | tinymce.full.js | function (node, referenceNode) {
referenceNode = this.get(referenceNode);
return this.run(node, function (node) {
var parent, nextSibling;
parent = referenceNode.parentNode;
nextSibling = referenceNode.nextSibling;
if (nextSibling) {
parent.insertBe... | javascript | function (node, referenceNode) {
referenceNode = this.get(referenceNode);
return this.run(node, function (node) {
var parent, nextSibling;
parent = referenceNode.parentNode;
nextSibling = referenceNode.nextSibling;
if (nextSibling) {
parent.insertBe... | [
"function",
"(",
"node",
",",
"referenceNode",
")",
"{",
"referenceNode",
"=",
"this",
".",
"get",
"(",
"referenceNode",
")",
";",
"return",
"this",
".",
"run",
"(",
"node",
",",
"function",
"(",
"node",
")",
"{",
"var",
"parent",
",",
"nextSibling",
"... | Inserts an element after the reference element.
@method insertAfter
@param {Element} node Element to insert after the reference.
@param {Element/String/Array} referenceNode Reference element, element id or array of elements to insert after.
@return {Element/Array} Element that got added or an array with elements. | [
"Inserts",
"an",
"element",
"after",
"the",
"reference",
"element",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8792-L8809 | |
48,170 | sadiqhabib/tinymce-dist | tinymce.full.js | function (elm, name) {
var self = this, newElm;
if (elm.nodeName != name.toUpperCase()) {
// Rename block element
newElm = self.create(name);
// Copy attribs to new block
each(self.getAttribs(elm), function (attrNode) {
self.setAttrib(newElm, attrNod... | javascript | function (elm, name) {
var self = this, newElm;
if (elm.nodeName != name.toUpperCase()) {
// Rename block element
newElm = self.create(name);
// Copy attribs to new block
each(self.getAttribs(elm), function (attrNode) {
self.setAttrib(newElm, attrNod... | [
"function",
"(",
"elm",
",",
"name",
")",
"{",
"var",
"self",
"=",
"this",
",",
"newElm",
";",
"if",
"(",
"elm",
".",
"nodeName",
"!=",
"name",
".",
"toUpperCase",
"(",
")",
")",
"{",
"// Rename block element",
"newElm",
"=",
"self",
".",
"create",
"... | Renames the specified element and keeps its attributes and children.
@method rename
@param {Element} elm Element to rename.
@param {String} name Name of the new element.
@return {Element} New element or the old element if it needed renaming. | [
"Renames",
"the",
"specified",
"element",
"and",
"keeps",
"its",
"attributes",
"and",
"children",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8847-L8864 | |
48,171 | sadiqhabib/tinymce-dist | tinymce.full.js | function (a, b) {
var ps = a, pe;
while (ps) {
pe = b;
while (pe && ps != pe) {
pe = pe.parentNode;
}
if (ps == pe) {
break;
}
ps = ps.parentNode;
}
if (!ps && a.ownerDocument) {
return a.o... | javascript | function (a, b) {
var ps = a, pe;
while (ps) {
pe = b;
while (pe && ps != pe) {
pe = pe.parentNode;
}
if (ps == pe) {
break;
}
ps = ps.parentNode;
}
if (!ps && a.ownerDocument) {
return a.o... | [
"function",
"(",
"a",
",",
"b",
")",
"{",
"var",
"ps",
"=",
"a",
",",
"pe",
";",
"while",
"(",
"ps",
")",
"{",
"pe",
"=",
"b",
";",
"while",
"(",
"pe",
"&&",
"ps",
"!=",
"pe",
")",
"{",
"pe",
"=",
"pe",
".",
"parentNode",
";",
"}",
"if",
... | Find the common ancestor of two elements. This is a shorter method than using the DOM Range logic.
@method findCommonAncestor
@param {Element} a Element to find common ancestor of.
@param {Element} b Element to find common ancestor of.
@return {Element} Common ancestor element of the two input elements. | [
"Find",
"the",
"common",
"ancestor",
"of",
"two",
"elements",
".",
"This",
"is",
"a",
"shorter",
"method",
"than",
"using",
"the",
"DOM",
"Range",
"logic",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8874-L8896 | |
48,172 | sadiqhabib/tinymce-dist | tinymce.full.js | function (elm) {
var attrs;
elm = this.get(elm);
if (!elm) {
return [];
}
if (isIE) {
attrs = [];
// Object will throw exception in IE
if (elm.nodeName == 'OBJECT') {
return elm.attributes;
}
// IE doesn... | javascript | function (elm) {
var attrs;
elm = this.get(elm);
if (!elm) {
return [];
}
if (isIE) {
attrs = [];
// Object will throw exception in IE
if (elm.nodeName == 'OBJECT') {
return elm.attributes;
}
// IE doesn... | [
"function",
"(",
"elm",
")",
"{",
"var",
"attrs",
";",
"elm",
"=",
"this",
".",
"get",
"(",
"elm",
")",
";",
"if",
"(",
"!",
"elm",
")",
"{",
"return",
"[",
"]",
";",
"}",
"if",
"(",
"isIE",
")",
"{",
"attrs",
"=",
"[",
"]",
";",
"// Object... | Returns a NodeList with attributes for the element.
@method getAttribs
@param {HTMLElement/string} elm Element node or string id to get attributes from.
@return {NodeList} NodeList with attributes. | [
"Returns",
"a",
"NodeList",
"with",
"attributes",
"for",
"the",
"element",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L8956-L8988 | |
48,173 | sadiqhabib/tinymce-dist | tinymce.full.js | function (target, name, func, scope) {
var self = this;
if (Tools.isArray(target)) {
var i = target.length;
while (i--) {
target[i] = self.bind(target[i], name, func, scope);
}
return target;
}
// Collect all window/document events ... | javascript | function (target, name, func, scope) {
var self = this;
if (Tools.isArray(target)) {
var i = target.length;
while (i--) {
target[i] = self.bind(target[i], name, func, scope);
}
return target;
}
// Collect all window/document events ... | [
"function",
"(",
"target",
",",
"name",
",",
"func",
",",
"scope",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"Tools",
".",
"isArray",
"(",
"target",
")",
")",
"{",
"var",
"i",
"=",
"target",
".",
"length",
";",
"while",
"(",
"i",
"-... | Adds an event handler to the specified object.
@method bind
@param {Element/Document/Window/Array} target Target element to bind events to.
handler to or an array of elements/ids/documents.
@param {String} name Name of event handler to add, for example: click.
@param {function} func Function to execute when the event ... | [
"Adds",
"an",
"event",
"handler",
"to",
"the",
"specified",
"object",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L9205-L9224 | |
48,174 | sadiqhabib/tinymce-dist | tinymce.full.js | function (target, name, func) {
var self = this, i;
if (Tools.isArray(target)) {
i = target.length;
while (i--) {
target[i] = self.unbind(target[i], name, func);
}
return target;
}
// Remove any bound events matching the input
... | javascript | function (target, name, func) {
var self = this, i;
if (Tools.isArray(target)) {
i = target.length;
while (i--) {
target[i] = self.unbind(target[i], name, func);
}
return target;
}
// Remove any bound events matching the input
... | [
"function",
"(",
"target",
",",
"name",
",",
"func",
")",
"{",
"var",
"self",
"=",
"this",
",",
"i",
";",
"if",
"(",
"Tools",
".",
"isArray",
"(",
"target",
")",
")",
"{",
"i",
"=",
"target",
".",
"length",
";",
"while",
"(",
"i",
"--",
")",
... | Removes the specified event handler by name and function from an element or collection of elements.
@method unbind
@param {Element/Document/Window/Array} target Target element to unbind events on.
@param {String} name Event handler name, for example: "click"
@param {function} func Function to remove.
@return {bool/Arr... | [
"Removes",
"the",
"specified",
"event",
"handler",
"by",
"name",
"and",
"function",
"from",
"an",
"element",
"or",
"collection",
"of",
"elements",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L9236-L9263 | |
48,175 | sadiqhabib/tinymce-dist | tinymce.full.js | function () {
var self = this;
// Unbind all events bound to window/document by editor instance
if (self.boundEvents) {
var i = self.boundEvents.length;
while (i--) {
var item = self.boundEvents[i];
this.events.unbind(item[0], item[1], item[2]);
... | javascript | function () {
var self = this;
// Unbind all events bound to window/document by editor instance
if (self.boundEvents) {
var i = self.boundEvents.length;
while (i--) {
var item = self.boundEvents[i];
this.events.unbind(item[0], item[1], item[2]);
... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"// Unbind all events bound to window/document by editor instance",
"if",
"(",
"self",
".",
"boundEvents",
")",
"{",
"var",
"i",
"=",
"self",
".",
"boundEvents",
".",
"length",
";",
"while",
"(",
"i",... | Destroys all internal references to the DOM to solve IE leak issues.
@method destroy | [
"Destroys",
"all",
"internal",
"references",
"to",
"the",
"DOM",
"to",
"solve",
"IE",
"leak",
"issues",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L9316-L9338 | |
48,176 | sadiqhabib/tinymce-dist | tinymce.full.js | loadScript | function loadScript(url, success, failure) {
var dom = DOM, elm, id;
// Execute callback when script is loaded
function done() {
dom.remove(id);
if (elm) {
elm.onreadystatechange = elm.onload = elm = null;
}
success();
}
fun... | javascript | function loadScript(url, success, failure) {
var dom = DOM, elm, id;
// Execute callback when script is loaded
function done() {
dom.remove(id);
if (elm) {
elm.onreadystatechange = elm.onload = elm = null;
}
success();
}
fun... | [
"function",
"loadScript",
"(",
"url",
",",
"success",
",",
"failure",
")",
"{",
"var",
"dom",
"=",
"DOM",
",",
"elm",
",",
"id",
";",
"// Execute callback when script is loaded",
"function",
"done",
"(",
")",
"{",
"dom",
".",
"remove",
"(",
"id",
")",
";... | Loads a specific script directly without adding it to the load queue.
@method load
@param {String} url Absolute URL to script to add.
@param {function} callback Optional success callback function when the script loaded successfully.
@param {function} callback Optional failure callback function when the script failed t... | [
"Loads",
"a",
"specific",
"script",
"directly",
"without",
"adding",
"it",
"to",
"the",
"load",
"queue",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L9476-L9532 |
48,177 | sadiqhabib/tinymce-dist | tinymce.full.js | function (name, languages) {
var language = AddOnManager.language;
if (language && AddOnManager.languageLoad !== false) {
if (languages) {
languages = ',' + languages + ',';
// Load short form sv.js or long form sv_SE.js
if (languages.indexOf(',' + languag... | javascript | function (name, languages) {
var language = AddOnManager.language;
if (language && AddOnManager.languageLoad !== false) {
if (languages) {
languages = ',' + languages + ',';
// Load short form sv.js or long form sv_SE.js
if (languages.indexOf(',' + languag... | [
"function",
"(",
"name",
",",
"languages",
")",
"{",
"var",
"language",
"=",
"AddOnManager",
".",
"language",
";",
"if",
"(",
"language",
"&&",
"AddOnManager",
".",
"languageLoad",
"!==",
"false",
")",
"{",
"if",
"(",
"languages",
")",
"{",
"languages",
... | Loads a language pack for the specified add-on.
@method requireLangPack
@param {String} name Short name of the add-on.
@param {String} languages Optional comma or space separated list of languages to check if it matches the name. | [
"Loads",
"a",
"language",
"pack",
"for",
"the",
"specified",
"add",
"-",
"on",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L9773-L9790 | |
48,178 | sadiqhabib/tinymce-dist | tinymce.full.js | function (id, addOn, dependencies) {
this.items.push(addOn);
this.lookup[id] = { instance: addOn, dependencies: dependencies };
return addOn;
} | javascript | function (id, addOn, dependencies) {
this.items.push(addOn);
this.lookup[id] = { instance: addOn, dependencies: dependencies };
return addOn;
} | [
"function",
"(",
"id",
",",
"addOn",
",",
"dependencies",
")",
"{",
"this",
".",
"items",
".",
"push",
"(",
"addOn",
")",
";",
"this",
".",
"lookup",
"[",
"id",
"]",
"=",
"{",
"instance",
":",
"addOn",
",",
"dependencies",
":",
"dependencies",
"}",
... | Adds a instance of the add-on by it's short name.
@method add
@param {String} id Short name/id for the add-on.
@param {tinymce.Theme/tinymce.Plugin} addOn Theme or plugin to add.
@return {tinymce.Theme/tinymce.Plugin} The same theme or plugin instance that got passed in.
@example
// Create a simple plugin
tinymce.crea... | [
"Adds",
"a",
"instance",
"of",
"the",
"add",
"-",
"on",
"by",
"it",
"s",
"short",
"name",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L9818-L9823 | |
48,179 | sadiqhabib/tinymce-dist | tinymce.full.js | function (name, addOnUrl, success, scope, failure) {
var self = this, url = addOnUrl;
function loadDependencies() {
var dependencies = self.dependencies(name);
each(dependencies, function (dep) {
var newUrl = self.createUrl(addOnUrl, dep);
self.load(newUrl.... | javascript | function (name, addOnUrl, success, scope, failure) {
var self = this, url = addOnUrl;
function loadDependencies() {
var dependencies = self.dependencies(name);
each(dependencies, function (dep) {
var newUrl = self.createUrl(addOnUrl, dep);
self.load(newUrl.... | [
"function",
"(",
"name",
",",
"addOnUrl",
",",
"success",
",",
"scope",
",",
"failure",
")",
"{",
"var",
"self",
"=",
"this",
",",
"url",
"=",
"addOnUrl",
";",
"function",
"loadDependencies",
"(",
")",
"{",
"var",
"dependencies",
"=",
"self",
".",
"dep... | Loads an add-on from a specific url.
@method load
@param {String} name Short name of the add-on that gets loaded.
@param {String} addOnUrl URL to the add-on that will get loaded.
@param {function} success Optional success callback to execute when an add-on is loaded.
@param {Object} scope Optional scope to execute the... | [
"Loads",
"an",
"add",
"-",
"on",
"from",
"a",
"specific",
"url",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L9874-L9914 | |
48,180 | sadiqhabib/tinymce-dist | tinymce.full.js | findClosestIeRange | function findClosestIeRange(clientX, clientY, doc) {
var element, rng, rects;
element = doc.elementFromPoint(clientX, clientY);
rng = doc.body.createTextRange();
if (!element || element.tagName == 'HTML') {
element = doc.body;
}
rng.moveToElementText(element);
rects ... | javascript | function findClosestIeRange(clientX, clientY, doc) {
var element, rng, rects;
element = doc.elementFromPoint(clientX, clientY);
rng = doc.body.createTextRange();
if (!element || element.tagName == 'HTML') {
element = doc.body;
}
rng.moveToElementText(element);
rects ... | [
"function",
"findClosestIeRange",
"(",
"clientX",
",",
"clientY",
",",
"doc",
")",
"{",
"var",
"element",
",",
"rng",
",",
"rects",
";",
"element",
"=",
"doc",
".",
"elementFromPoint",
"(",
"clientX",
",",
"clientY",
")",
";",
"rng",
"=",
"doc",
".",
"... | Finds the closest selection rect tries to get the range from that. | [
"Finds",
"the",
"closest",
"selection",
"rect",
"tries",
"to",
"get",
"the",
"range",
"from",
"that",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L10913-L10947 |
48,181 | sadiqhabib/tinymce-dist | tinymce.full.js | Node | function Node(name, type) {
this.name = name;
this.type = type;
if (type === 1) {
this.attributes = [];
this.attributes.map = {};
}
} | javascript | function Node(name, type) {
this.name = name;
this.type = type;
if (type === 1) {
this.attributes = [];
this.attributes.map = {};
}
} | [
"function",
"Node",
"(",
"name",
",",
"type",
")",
"{",
"this",
".",
"name",
"=",
"name",
";",
"this",
".",
"type",
"=",
"type",
";",
"if",
"(",
"type",
"===",
"1",
")",
"{",
"this",
".",
"attributes",
"=",
"[",
"]",
";",
"this",
".",
"attribut... | Constructs a new Node instance.
@constructor
@method Node
@param {String} name Name of the node type.
@param {Number} type Numeric type representing the node. | [
"Constructs",
"a",
"new",
"Node",
"instance",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L11088-L11096 |
48,182 | sadiqhabib/tinymce-dist | tinymce.full.js | function (node, refNode, before) {
var parent;
if (node.parent) {
node.remove();
}
parent = refNode.parent || this;
if (before) {
if (refNode === parent.firstChild) {
parent.firstChild = node;
} else {
refNode.prev.next = n... | javascript | function (node, refNode, before) {
var parent;
if (node.parent) {
node.remove();
}
parent = refNode.parent || this;
if (before) {
if (refNode === parent.firstChild) {
parent.firstChild = node;
} else {
refNode.prev.next = n... | [
"function",
"(",
"node",
",",
"refNode",
",",
"before",
")",
"{",
"var",
"parent",
";",
"if",
"(",
"node",
".",
"parent",
")",
"{",
"node",
".",
"remove",
"(",
")",
";",
"}",
"parent",
"=",
"refNode",
".",
"parent",
"||",
"this",
";",
"if",
"(",
... | Inserts a node at a specific position as a child of the current node.
@example
parentNode.insert(newChildNode, oldChildNode);
@method insert
@param {tinymce.html.Node} node Node to insert as a child of the current node.
@param {tinymce.html.Node} refNode Reference node to set node before/after.
@param {Boolean} befor... | [
"Inserts",
"a",
"node",
"at",
"a",
"specific",
"position",
"as",
"a",
"child",
"of",
"the",
"current",
"node",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L11344-L11378 | |
48,183 | sadiqhabib/tinymce-dist | tinymce.full.js | addCustomElements | function addCustomElements(customElements) {
var customElementRegExp = /^(~)?(.+)$/;
if (customElements) {
// Flush cached items since we are altering the default maps
mapCache.text_block_elements = mapCache.block_elements = null;
each(split(customElements, ','), function... | javascript | function addCustomElements(customElements) {
var customElementRegExp = /^(~)?(.+)$/;
if (customElements) {
// Flush cached items since we are altering the default maps
mapCache.text_block_elements = mapCache.block_elements = null;
each(split(customElements, ','), function... | [
"function",
"addCustomElements",
"(",
"customElements",
")",
"{",
"var",
"customElementRegExp",
"=",
"/",
"^(~)?(.+)$",
"/",
";",
"if",
"(",
"customElements",
")",
"{",
"// Flush cached items since we are altering the default maps",
"mapCache",
".",
"text_block_elements",
... | Adds custom non HTML elements to the schema | [
"Adds",
"custom",
"non",
"HTML",
"elements",
"to",
"the",
"schema"
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L12107-L12149 |
48,184 | sadiqhabib/tinymce-dist | tinymce.full.js | findEndTag | function findEndTag(schema, html, startIndex) {
var count = 1, index, matches, tokenRegExp, shortEndedElements;
shortEndedElements = schema.getShortEndedElements();
tokenRegExp = /<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g;
tokenRegExp.lastIn... | javascript | function findEndTag(schema, html, startIndex) {
var count = 1, index, matches, tokenRegExp, shortEndedElements;
shortEndedElements = schema.getShortEndedElements();
tokenRegExp = /<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g;
tokenRegExp.lastIn... | [
"function",
"findEndTag",
"(",
"schema",
",",
"html",
",",
"startIndex",
")",
"{",
"var",
"count",
"=",
"1",
",",
"index",
",",
"matches",
",",
"tokenRegExp",
",",
"shortEndedElements",
";",
"shortEndedElements",
"=",
"schema",
".",
"getShortEndedElements",
"(... | Returns the index of the end tag for a specific start tag. This can be
used to skip all children of a parent element from being processed.
@private
@method findEndTag
@param {tinymce.html.Schema} schema Schema instance to use to match short ended elements.
@param {String} html HTML string to find the end tag in.
@para... | [
"Returns",
"the",
"index",
"of",
"the",
"end",
"tag",
"for",
"a",
"specific",
"start",
"tag",
".",
"This",
"can",
"be",
"used",
"to",
"skip",
"all",
"children",
"of",
"a",
"parent",
"element",
"from",
"being",
"processed",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L12631-L12657 |
48,185 | sadiqhabib/tinymce-dist | tinymce.full.js | getBrClientRect | function getBrClientRect(brNode) {
var doc = brNode.ownerDocument,
rng = createRange(doc),
nbsp = doc.createTextNode('\u00a0'),
parentNode = brNode.parentNode,
clientRect;
parentNode.insertBefore(nbsp, brNode);
rng.setStart(nbsp, 0);
rng.setEnd(nb... | javascript | function getBrClientRect(brNode) {
var doc = brNode.ownerDocument,
rng = createRange(doc),
nbsp = doc.createTextNode('\u00a0'),
parentNode = brNode.parentNode,
clientRect;
parentNode.insertBefore(nbsp, brNode);
rng.setStart(nbsp, 0);
rng.setEnd(nb... | [
"function",
"getBrClientRect",
"(",
"brNode",
")",
"{",
"var",
"doc",
"=",
"brNode",
".",
"ownerDocument",
",",
"rng",
"=",
"createRange",
"(",
"doc",
")",
",",
"nbsp",
"=",
"doc",
".",
"createTextNode",
"(",
"'\\u00a0'",
")",
",",
"parentNode",
"=",
"br... | Hack for older WebKit versions that doesn't support getBoundingClientRect on BR elements | [
"Hack",
"for",
"older",
"WebKit",
"versions",
"that",
"doesn",
"t",
"support",
"getBoundingClientRect",
"on",
"BR",
"elements"
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L15952-L15966 |
48,186 | sadiqhabib/tinymce-dist | tinymce.full.js | CaretPosition | function CaretPosition(container, offset, clientRects) {
function isAtStart() {
if (isText(container)) {
return offset === 0;
}
return offset === 0;
}
function isAtEnd() {
if (isText(container)) {
return offset >= container.data.length;
}
... | javascript | function CaretPosition(container, offset, clientRects) {
function isAtStart() {
if (isText(container)) {
return offset === 0;
}
return offset === 0;
}
function isAtEnd() {
if (isText(container)) {
return offset >= container.data.length;
}
... | [
"function",
"CaretPosition",
"(",
"container",
",",
"offset",
",",
"clientRects",
")",
"{",
"function",
"isAtStart",
"(",
")",
"{",
"if",
"(",
"isText",
"(",
"container",
")",
")",
"{",
"return",
"offset",
"===",
"0",
";",
"}",
"return",
"offset",
"===",... | Represents a location within the document by a container and an offset.
@constructor
@param {Node} container Container node.
@param {Number} offset Offset within that container node.
@param {Array} clientRects Optional client rects array for the position. | [
"Represents",
"a",
"location",
"within",
"the",
"document",
"by",
"a",
"container",
"and",
"an",
"offset",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L16097-L16221 |
48,187 | sadiqhabib/tinymce-dist | tinymce.full.js | Selection | function Selection(dom, win, serializer, editor) {
var self = this;
self.dom = dom;
self.win = win;
self.serializer = serializer;
self.editor = editor;
self.bookmarkManager = new BookmarkManager(self);
self.controlSelection = new ControlSelection(self, editor);
// No W3... | javascript | function Selection(dom, win, serializer, editor) {
var self = this;
self.dom = dom;
self.win = win;
self.serializer = serializer;
self.editor = editor;
self.bookmarkManager = new BookmarkManager(self);
self.controlSelection = new ControlSelection(self, editor);
// No W3... | [
"function",
"Selection",
"(",
"dom",
",",
"win",
",",
"serializer",
",",
"editor",
")",
"{",
"var",
"self",
"=",
"this",
";",
"self",
".",
"dom",
"=",
"dom",
";",
"self",
".",
"win",
"=",
"win",
";",
"self",
".",
"serializer",
"=",
"serializer",
";... | Constructs a new selection instance.
@constructor
@method Selection
@param {tinymce.dom.DOMUtils} dom DOMUtils object reference.
@param {Window} win Window to bind the selection object to.
@param {tinymce.Editor} editor Editor instance of the selection.
@param {tinymce.dom.Serializer} serializer DOM serialization clas... | [
"Constructs",
"a",
"new",
"selection",
"instance",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L17565-L17579 |
48,188 | sadiqhabib/tinymce-dist | tinymce.full.js | function (node, offset) {
var self = this, rng = self.dom.createRng();
if (!node) {
self._moveEndPoint(rng, self.editor.getBody(), true);
self.setRng(rng);
} else {
rng.setStart(node, offset);
rng.setEnd(node, offset);
self.setRng(rng);
... | javascript | function (node, offset) {
var self = this, rng = self.dom.createRng();
if (!node) {
self._moveEndPoint(rng, self.editor.getBody(), true);
self.setRng(rng);
} else {
rng.setStart(node, offset);
rng.setEnd(node, offset);
self.setRng(rng);
... | [
"function",
"(",
"node",
",",
"offset",
")",
"{",
"var",
"self",
"=",
"this",
",",
"rng",
"=",
"self",
".",
"dom",
".",
"createRng",
"(",
")",
";",
"if",
"(",
"!",
"node",
")",
"{",
"self",
".",
"_moveEndPoint",
"(",
"rng",
",",
"self",
".",
"e... | Move the selection cursor range to the specified node and offset.
If there is no node specified it will move it to the first suitable location within the body.
@method setCursorLocation
@param {Node} node Optional node to put the cursor in.
@param {Number} offset Optional offset from the start of the node to put the c... | [
"Move",
"the",
"selection",
"cursor",
"range",
"to",
"the",
"specified",
"node",
"and",
"offset",
".",
"If",
"there",
"is",
"no",
"node",
"specified",
"it",
"will",
"move",
"it",
"to",
"the",
"first",
"suitable",
"location",
"within",
"the",
"body",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L17590-L17602 | |
48,189 | sadiqhabib/tinymce-dist | tinymce.full.js | function (node, content) {
var self = this, dom = self.dom, rng = dom.createRng(), idx;
// Clear stored range set by FocusManager
self.lastFocusBookmark = null;
if (node) {
if (!content && self.controlSelection.controlSelect(node)) {
return;
}
... | javascript | function (node, content) {
var self = this, dom = self.dom, rng = dom.createRng(), idx;
// Clear stored range set by FocusManager
self.lastFocusBookmark = null;
if (node) {
if (!content && self.controlSelection.controlSelect(node)) {
return;
}
... | [
"function",
"(",
"node",
",",
"content",
")",
"{",
"var",
"self",
"=",
"this",
",",
"dom",
"=",
"self",
".",
"dom",
",",
"rng",
"=",
"dom",
".",
"createRng",
"(",
")",
",",
"idx",
";",
"// Clear stored range set by FocusManager",
"self",
".",
"lastFocusB... | Selects the specified element. This will place the start and end of the selection range around the element.
@method select
@param {Element} node HTML DOM element to select.
@param {Boolean} content Optional bool state if the contents should be selected or not on non IE browser.
@return {Element} Selected element the s... | [
"Selects",
"the",
"specified",
"element",
".",
"This",
"will",
"place",
"the",
"start",
"and",
"end",
"of",
"the",
"selection",
"range",
"around",
"the",
"element",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L17911-L17936 | |
48,190 | sadiqhabib/tinymce-dist | tinymce.full.js | function (toStart) {
var self = this, rng = self.getRng(), node;
// Control range on IE
if (rng.item) {
node = rng.item(0);
rng = self.win.document.body.createTextRange();
rng.moveToElementText(node);
}
rng.collapse(!!toStart);
self.setRng(... | javascript | function (toStart) {
var self = this, rng = self.getRng(), node;
// Control range on IE
if (rng.item) {
node = rng.item(0);
rng = self.win.document.body.createTextRange();
rng.moveToElementText(node);
}
rng.collapse(!!toStart);
self.setRng(... | [
"function",
"(",
"toStart",
")",
"{",
"var",
"self",
"=",
"this",
",",
"rng",
"=",
"self",
".",
"getRng",
"(",
")",
",",
"node",
";",
"// Control range on IE",
"if",
"(",
"rng",
".",
"item",
")",
"{",
"node",
"=",
"rng",
".",
"item",
"(",
"0",
")... | Collapse the selection to start or end of range.
@method collapse
@param {Boolean} toStart Optional boolean state if to collapse to end or not. Defaults to false. | [
"Collapse",
"the",
"selection",
"to",
"start",
"or",
"end",
"of",
"range",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L17965-L17977 | |
48,191 | sadiqhabib/tinymce-dist | tinymce.full.js | function (w3c) {
var self = this, selection, rng, elm, doc, ieRng, evt;
function tryCompareBoundaryPoints(how, sourceRange, destinationRange) {
try {
return sourceRange.compareBoundaryPoints(how, destinationRange);
} catch (ex) {
// Gecko throws wrong documen... | javascript | function (w3c) {
var self = this, selection, rng, elm, doc, ieRng, evt;
function tryCompareBoundaryPoints(how, sourceRange, destinationRange) {
try {
return sourceRange.compareBoundaryPoints(how, destinationRange);
} catch (ex) {
// Gecko throws wrong documen... | [
"function",
"(",
"w3c",
")",
"{",
"var",
"self",
"=",
"this",
",",
"selection",
",",
"rng",
",",
"elm",
",",
"doc",
",",
"ieRng",
",",
"evt",
";",
"function",
"tryCompareBoundaryPoints",
"(",
"how",
",",
"sourceRange",
",",
"destinationRange",
")",
"{",
... | Returns the browsers internal range object.
@method getRng
@param {Boolean} w3c Forces a compatible W3C range on IE.
@return {Range} Internal browser range object.
@see http://www.quirksmode.org/dom/range_intro.html
@see http://www.dotvoid.com/2001/03/using-the-range-object-in-mozilla/ | [
"Returns",
"the",
"browsers",
"internal",
"range",
"object",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L18000-L18110 | |
48,192 | sadiqhabib/tinymce-dist | tinymce.full.js | function () {
var self = this, rng = self.getRng(), elm;
var startContainer, endContainer, startOffset, endOffset, root = self.dom.getRoot();
function skipEmptyTextNodes(node, forwards) {
var orig = node;
while (node && node.nodeType === 3 && node.length === 0) {
... | javascript | function () {
var self = this, rng = self.getRng(), elm;
var startContainer, endContainer, startOffset, endOffset, root = self.dom.getRoot();
function skipEmptyTextNodes(node, forwards) {
var orig = node;
while (node && node.nodeType === 3 && node.length === 0) {
... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
",",
"rng",
"=",
"self",
".",
"getRng",
"(",
")",
",",
"elm",
";",
"var",
"startContainer",
",",
"endContainer",
",",
"startOffset",
",",
"endOffset",
",",
"root",
"=",
"self",
".",
"dom",
".",
... | Returns the currently selected element or the common ancestor element for both start and end of the selection.
@method getNode
@return {Element} Currently selected element or common ancestor element.
@example
// Alerts the currently selected elements node name
alert(tinymce.activeEditor.selection.getNode().nodeName); | [
"Returns",
"the",
"currently",
"selected",
"element",
"or",
"the",
"common",
"ancestor",
"element",
"for",
"both",
"start",
"and",
"end",
"of",
"the",
"selection",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L18230-L18307 | |
48,193 | sadiqhabib/tinymce-dist | tinymce.full.js | getAttribs | function getAttribs(node) {
var attribs = {};
each(dom.getAttribs(node), function (attr) {
var name = attr.nodeName.toLowerCase();
// Don't compare internal attributes or style
if (name.indexOf('_') !== 0 && name !== 'style' && name.indexOf('data-') !== 0) {
... | javascript | function getAttribs(node) {
var attribs = {};
each(dom.getAttribs(node), function (attr) {
var name = attr.nodeName.toLowerCase();
// Don't compare internal attributes or style
if (name.indexOf('_') !== 0 && name !== 'style' && name.indexOf('data-') !== 0) {
... | [
"function",
"getAttribs",
"(",
"node",
")",
"{",
"var",
"attribs",
"=",
"{",
"}",
";",
"each",
"(",
"dom",
".",
"getAttribs",
"(",
"node",
")",
",",
"function",
"(",
"attr",
")",
"{",
"var",
"name",
"=",
"attr",
".",
"nodeName",
".",
"toLowerCase",
... | Returns all the nodes attributes excluding internal ones, styles and classes.
@private
@param {Node} node Node to get attributes from.
@return {Object} Name/value object with attributes and attribute values. | [
"Returns",
"all",
"the",
"nodes",
"attributes",
"excluding",
"internal",
"ones",
"styles",
"and",
"classes",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L18609-L18622 |
48,194 | sadiqhabib/tinymce-dist | tinymce.full.js | compareObjects | function compareObjects(obj1, obj2) {
var value, name;
for (name in obj1) {
// Obj1 has item obj2 doesn't have
if (obj1.hasOwnProperty(name)) {
value = obj2[name];
// Obj2 doesn't have obj1 item
if (typeof value == "undefined") {
... | javascript | function compareObjects(obj1, obj2) {
var value, name;
for (name in obj1) {
// Obj1 has item obj2 doesn't have
if (obj1.hasOwnProperty(name)) {
value = obj2[name];
// Obj2 doesn't have obj1 item
if (typeof value == "undefined") {
... | [
"function",
"compareObjects",
"(",
"obj1",
",",
"obj2",
")",
"{",
"var",
"value",
",",
"name",
";",
"for",
"(",
"name",
"in",
"obj1",
")",
"{",
"// Obj1 has item obj2 doesn't have",
"if",
"(",
"obj1",
".",
"hasOwnProperty",
"(",
"name",
")",
")",
"{",
"v... | Compares two objects checks if it's key + value exists in the other one.
@private
@param {Object} obj1 First object to compare.
@param {Object} obj2 Second object to compare.
@return {boolean} True/false if the objects matches or not. | [
"Compares",
"two",
"objects",
"checks",
"if",
"it",
"s",
"key",
"+",
"value",
"exists",
"in",
"the",
"other",
"one",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L18632-L18664 |
48,195 | sadiqhabib/tinymce-dist | tinymce.full.js | process | function process(node) {
var children, i, l, lastContentEditable, hasContentEditableState;
// Node has a contentEditable value
if (node.nodeType === 1 && getContentEditable(node)) {
lastContentEditable = contentEditable;
contentEditable = getContentEditable(node) =... | javascript | function process(node) {
var children, i, l, lastContentEditable, hasContentEditableState;
// Node has a contentEditable value
if (node.nodeType === 1 && getContentEditable(node)) {
lastContentEditable = contentEditable;
contentEditable = getContentEditable(node) =... | [
"function",
"process",
"(",
"node",
")",
"{",
"var",
"children",
",",
"i",
",",
"l",
",",
"lastContentEditable",
",",
"hasContentEditableState",
";",
"// Node has a contentEditable value",
"if",
"(",
"node",
".",
"nodeType",
"===",
"1",
"&&",
"getContentEditable",... | Merges the styles for each node | [
"Merges",
"the",
"styles",
"for",
"each",
"node"
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L19936-L19970 |
48,196 | sadiqhabib/tinymce-dist | tinymce.full.js | match | function match(name, vars, node) {
var startNode;
function matchParents(node) {
var root = dom.getRoot();
if (node === root) {
return false;
}
// Find first node with similar format settings
node = dom.getParent(node, function (node) {
... | javascript | function match(name, vars, node) {
var startNode;
function matchParents(node) {
var root = dom.getRoot();
if (node === root) {
return false;
}
// Find first node with similar format settings
node = dom.getParent(node, function (node) {
... | [
"function",
"match",
"(",
"name",
",",
"vars",
",",
"node",
")",
"{",
"var",
"startNode",
";",
"function",
"matchParents",
"(",
"node",
")",
"{",
"var",
"root",
"=",
"dom",
".",
"getRoot",
"(",
")",
";",
"if",
"(",
"node",
"===",
"root",
")",
"{",
... | Matches the current selection or specified node against the specified format name.
@method match
@param {String} name Name of format to match.
@param {Object} vars Optional list of variables to replace before checking it.
@param {Node} node Optional node to check.
@return {boolean} true/false if the specified selectio... | [
"Matches",
"the",
"current",
"selection",
"or",
"specified",
"node",
"against",
"the",
"specified",
"format",
"name",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L20291-L20334 |
48,197 | sadiqhabib/tinymce-dist | tinymce.full.js | formatChanged | function formatChanged(formats, callback, similar) {
var currentFormats;
// Setup format node change logic
if (!formatChangeData) {
formatChangeData = {};
currentFormats = {};
ed.on('NodeChange', function (e) {
var parents = getParents(e.element), matc... | javascript | function formatChanged(formats, callback, similar) {
var currentFormats;
// Setup format node change logic
if (!formatChangeData) {
formatChangeData = {};
currentFormats = {};
ed.on('NodeChange', function (e) {
var parents = getParents(e.element), matc... | [
"function",
"formatChanged",
"(",
"formats",
",",
"callback",
",",
"similar",
")",
"{",
"var",
"currentFormats",
";",
"// Setup format node change logic",
"if",
"(",
"!",
"formatChangeData",
")",
"{",
"formatChangeData",
"=",
"{",
"}",
";",
"currentFormats",
"=",
... | Executes the specified callback when the current selection matches the formats or not.
@method formatChanged
@param {String} formats Comma separated list of formats to check for.
@param {function} callback Callback with state and args when the format is changed/toggled on/off.
@param {Boolean} similar True/false state... | [
"Executes",
"the",
"specified",
"callback",
"when",
"the",
"current",
"selection",
"matches",
"the",
"formats",
"or",
"not",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L20408-L20471 |
48,198 | sadiqhabib/tinymce-dist | tinymce.full.js | replaceVars | function replaceVars(value, vars) {
if (typeof value != "string") {
value = value(vars);
} else if (vars) {
value = value.replace(/%(\w+)/g, function (str, name) {
return vars[name] || str;
});
}
return value;
} | javascript | function replaceVars(value, vars) {
if (typeof value != "string") {
value = value(vars);
} else if (vars) {
value = value.replace(/%(\w+)/g, function (str, name) {
return vars[name] || str;
});
}
return value;
} | [
"function",
"replaceVars",
"(",
"value",
",",
"vars",
")",
"{",
"if",
"(",
"typeof",
"value",
"!=",
"\"string\"",
")",
"{",
"value",
"=",
"value",
"(",
"vars",
")",
";",
"}",
"else",
"if",
"(",
"vars",
")",
"{",
"value",
"=",
"value",
".",
"replace... | Replaces variables in the value. The variable format is %var.
@private
@param {String} value Value to replace variables in.
@param {Object} vars Name/value array with variables to replace.
@return {String} New value with replaced variables. | [
"Replaces",
"variables",
"in",
"the",
"value",
".",
"The",
"variable",
"format",
"is",
"%var",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L20640-L20650 |
48,199 | sadiqhabib/tinymce-dist | tinymce.full.js | removeFormat | function removeFormat(format, vars, node, compareNode) {
var i, attrs, stylesModified;
// Check if node matches format
if (!matchName(node, format) && !isColorFormatAndAnchor(node, format)) {
return FALSE;
}
// Should we compare with format attribs and styles
... | javascript | function removeFormat(format, vars, node, compareNode) {
var i, attrs, stylesModified;
// Check if node matches format
if (!matchName(node, format) && !isColorFormatAndAnchor(node, format)) {
return FALSE;
}
// Should we compare with format attribs and styles
... | [
"function",
"removeFormat",
"(",
"format",
",",
"vars",
",",
"node",
",",
"compareNode",
")",
"{",
"var",
"i",
",",
"attrs",
",",
"stylesModified",
";",
"// Check if node matches format",
"if",
"(",
"!",
"matchName",
"(",
"node",
",",
"format",
")",
"&&",
... | Removes the specified format for the specified node. It will also remove the node if it doesn't have
any attributes if the format specifies it to do so.
@private
@param {Object} format Format object with items to remove from node.
@param {Object} vars Name/value object with variables to apply to format.
@param {Node} ... | [
"Removes",
"the",
"specified",
"format",
"for",
"the",
"specified",
"node",
".",
"It",
"will",
"also",
"remove",
"the",
"node",
"if",
"it",
"doesn",
"t",
"have",
"any",
"attributes",
"if",
"the",
"format",
"specifies",
"it",
"to",
"do",
"so",
"."
] | 3acf1e4fe83a541988fdca20f2aaf4e6dce72512 | https://github.com/sadiqhabib/tinymce-dist/blob/3acf1e4fe83a541988fdca20f2aaf4e6dce72512/tinymce.full.js#L21042-L21146 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.