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
|
---|---|---|---|---|---|---|---|---|---|---|---|
49,400 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(SuperC, protos, recurring, statics, name) {
var C = this._createclass(SuperC, SuperC.prototype, name);
gui.Object.extend(C, statics);
gui.Object.extend(C.$recurring, recurring);
gui.Object.each(C.$recurring, function(key, val) {
var desc = Object.getOwnPropertyDescriptor(C, key);
if (!desc || desc.writable) {
C[key] = val;
}
});
gui.Property.extendall(protos, C.prototype);
C = this._classname(C, name);
return C;
} | javascript | function(SuperC, protos, recurring, statics, name) {
var C = this._createclass(SuperC, SuperC.prototype, name);
gui.Object.extend(C, statics);
gui.Object.extend(C.$recurring, recurring);
gui.Object.each(C.$recurring, function(key, val) {
var desc = Object.getOwnPropertyDescriptor(C, key);
if (!desc || desc.writable) {
C[key] = val;
}
});
gui.Property.extendall(protos, C.prototype);
C = this._classname(C, name);
return C;
} | [
"function",
"(",
"SuperC",
",",
"protos",
",",
"recurring",
",",
"statics",
",",
"name",
")",
"{",
"var",
"C",
"=",
"this",
".",
"_createclass",
"(",
"SuperC",
",",
"SuperC",
".",
"prototype",
",",
"name",
")",
";",
"gui",
".",
"Object",
".",
"extend",
"(",
"C",
",",
"statics",
")",
";",
"gui",
".",
"Object",
".",
"extend",
"(",
"C",
".",
"$recurring",
",",
"recurring",
")",
";",
"gui",
".",
"Object",
".",
"each",
"(",
"C",
".",
"$recurring",
",",
"function",
"(",
"key",
",",
"val",
")",
"{",
"var",
"desc",
"=",
"Object",
".",
"getOwnPropertyDescriptor",
"(",
"C",
",",
"key",
")",
";",
"if",
"(",
"!",
"desc",
"||",
"desc",
".",
"writable",
")",
"{",
"C",
"[",
"key",
"]",
"=",
"val",
";",
"}",
"}",
")",
";",
"gui",
".",
"Property",
".",
"extendall",
"(",
"protos",
",",
"C",
".",
"prototype",
")",
";",
"C",
"=",
"this",
".",
"_classname",
"(",
"C",
",",
"name",
")",
";",
"return",
"C",
";",
"}"
] | Create subclass constructor.
@param {object} SuperC super constructor
@param {object} protos Prototype extensions
@param {object} recurring Constructor and subconstructor extensions
@param {object} statics Constructor extensions
@param {String} generated display name (for development)
@returns {function} Constructor | [
"Create",
"subclass",
"constructor",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L1846-L1859 |
|
49,401 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(C, SuperC) {
C.$super = null; // what's this?
C.$subclasses = [];
C.$superclass = SuperC || null;
C.$recurring = SuperC ?
gui.Object.copy(SuperC.$recurring) : Object.create(null);
if (SuperC) {
SuperC.$subclasses.push(C);
}
return C;
} | javascript | function(C, SuperC) {
C.$super = null; // what's this?
C.$subclasses = [];
C.$superclass = SuperC || null;
C.$recurring = SuperC ?
gui.Object.copy(SuperC.$recurring) : Object.create(null);
if (SuperC) {
SuperC.$subclasses.push(C);
}
return C;
} | [
"function",
"(",
"C",
",",
"SuperC",
")",
"{",
"C",
".",
"$super",
"=",
"null",
";",
"// what's this?",
"C",
".",
"$subclasses",
"=",
"[",
"]",
";",
"C",
".",
"$superclass",
"=",
"SuperC",
"||",
"null",
";",
"C",
".",
"$recurring",
"=",
"SuperC",
"?",
"gui",
".",
"Object",
".",
"copy",
"(",
"SuperC",
".",
"$recurring",
")",
":",
"Object",
".",
"create",
"(",
"null",
")",
";",
"if",
"(",
"SuperC",
")",
"{",
"SuperC",
".",
"$subclasses",
".",
"push",
"(",
"C",
")",
";",
"}",
"return",
"C",
";",
"}"
] | Setup framework internal propeties.
@param {function} C
@param @optional {function} superclass
@param @optional {Map<String,object>} recurring
@returns {function} | [
"Setup",
"framework",
"internal",
"propeties",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L1868-L1878 |
|
49,402 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(proto, recurring, statics) {
Array.forEach(arguments, function(mixins, i) {
if (mixins) {
gui.Object.each(mixins, function(name, value) {
if (i === 0) {
// TODO: something more elaborate (like defineProperty)
this.prototype[name] = value;
} else { // TODO: only at index 1 right?
gui.Class.descendantsAndSelf(this, function(C) {
C.$recurring[name] = value;
C[name] = value;
});
}
}, this);
}
}, this);
return this;
} | javascript | function(proto, recurring, statics) {
Array.forEach(arguments, function(mixins, i) {
if (mixins) {
gui.Object.each(mixins, function(name, value) {
if (i === 0) {
// TODO: something more elaborate (like defineProperty)
this.prototype[name] = value;
} else { // TODO: only at index 1 right?
gui.Class.descendantsAndSelf(this, function(C) {
C.$recurring[name] = value;
C[name] = value;
});
}
}, this);
}
}, this);
return this;
} | [
"function",
"(",
"proto",
",",
"recurring",
",",
"statics",
")",
"{",
"Array",
".",
"forEach",
"(",
"arguments",
",",
"function",
"(",
"mixins",
",",
"i",
")",
"{",
"if",
"(",
"mixins",
")",
"{",
"gui",
".",
"Object",
".",
"each",
"(",
"mixins",
",",
"function",
"(",
"name",
",",
"value",
")",
"{",
"if",
"(",
"i",
"===",
"0",
")",
"{",
"// TODO: something more elaborate (like defineProperty)",
"this",
".",
"prototype",
"[",
"name",
"]",
"=",
"value",
";",
"}",
"else",
"{",
"// TODO: only at index 1 right?",
"gui",
".",
"Class",
".",
"descendantsAndSelf",
"(",
"this",
",",
"function",
"(",
"C",
")",
"{",
"C",
".",
"$recurring",
"[",
"name",
"]",
"=",
"value",
";",
"C",
"[",
"name",
"]",
"=",
"value",
";",
"}",
")",
";",
"}",
"}",
",",
"this",
")",
";",
"}",
"}",
",",
"this",
")",
";",
"return",
"this",
";",
"}"
] | Mixin something.
@param {object} proto
@param {object} recurring
@param {object} statics
@returns {function} | [
"Mixin",
"something",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L1979-L1996 |
|
49,403 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(C, action, thisp) {
var results = [];
action = action || gui.Combo.identity;
C.$subclasses.forEach(function(sub) {
results.push(action.call(thisp, sub));
}, thisp);
return results;
} | javascript | function(C, action, thisp) {
var results = [];
action = action || gui.Combo.identity;
C.$subclasses.forEach(function(sub) {
results.push(action.call(thisp, sub));
}, thisp);
return results;
} | [
"function",
"(",
"C",
",",
"action",
",",
"thisp",
")",
"{",
"var",
"results",
"=",
"[",
"]",
";",
"action",
"=",
"action",
"||",
"gui",
".",
"Combo",
".",
"identity",
";",
"C",
".",
"$subclasses",
".",
"forEach",
"(",
"function",
"(",
"sub",
")",
"{",
"results",
".",
"push",
"(",
"action",
".",
"call",
"(",
"thisp",
",",
"sub",
")",
")",
";",
"}",
",",
"thisp",
")",
";",
"return",
"results",
";",
"}"
] | Return superclass. If action is provided, return an array of the results
of executing the action for each subclass with the subclass as argument.
@param {function} C constructor
@param @optional {function} action
@param @optional {object} thisp
@returns {Array<gui.Class|object>} | [
"Return",
"superclass",
".",
"If",
"action",
"is",
"provided",
"return",
"an",
"array",
"of",
"the",
"results",
"of",
"executing",
"the",
"action",
"for",
"each",
"subclass",
"with",
"the",
"subclass",
"as",
"argument",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L2029-L2036 |
|
49,404 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(C, action, thisp, results) {
results = results || [];
action = action || gui.Combo.identity;
C.$subclasses.forEach(function(sub) {
results.push(action.call(thisp, sub));
gui.Class.descendants(sub, action, thisp, results);
}, thisp);
return results;
} | javascript | function(C, action, thisp, results) {
results = results || [];
action = action || gui.Combo.identity;
C.$subclasses.forEach(function(sub) {
results.push(action.call(thisp, sub));
gui.Class.descendants(sub, action, thisp, results);
}, thisp);
return results;
} | [
"function",
"(",
"C",
",",
"action",
",",
"thisp",
",",
"results",
")",
"{",
"results",
"=",
"results",
"||",
"[",
"]",
";",
"action",
"=",
"action",
"||",
"gui",
".",
"Combo",
".",
"identity",
";",
"C",
".",
"$subclasses",
".",
"forEach",
"(",
"function",
"(",
"sub",
")",
"{",
"results",
".",
"push",
"(",
"action",
".",
"call",
"(",
"thisp",
",",
"sub",
")",
")",
";",
"gui",
".",
"Class",
".",
"descendants",
"(",
"sub",
",",
"action",
",",
"thisp",
",",
"results",
")",
";",
"}",
",",
"thisp",
")",
";",
"return",
"results",
";",
"}"
] | Apply action recursively to all derived subclasses of given class.
Returns an array of accumulated results. If no action is provided,
returns array of descendant sublasses.
@param {function} C constructor
@param @optional {function} action
@param @optional {object} thisp
@param @internal {Array<gui.Class|object>} results
@returns {Array<gui.Class|object>} | [
"Apply",
"action",
"recursively",
"to",
"all",
"derived",
"subclasses",
"of",
"given",
"class",
".",
"Returns",
"an",
"array",
"of",
"accumulated",
"results",
".",
"If",
"no",
"action",
"is",
"provided",
"returns",
"array",
"of",
"descendant",
"sublasses",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L2048-L2056 |
|
49,405 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(C, action, thisp) {
var results = [];
action = action || gui.Combo.identity;
results.push(action.call(thisp, C));
return this.descendants(C, action, thisp, results);
} | javascript | function(C, action, thisp) {
var results = [];
action = action || gui.Combo.identity;
results.push(action.call(thisp, C));
return this.descendants(C, action, thisp, results);
} | [
"function",
"(",
"C",
",",
"action",
",",
"thisp",
")",
"{",
"var",
"results",
"=",
"[",
"]",
";",
"action",
"=",
"action",
"||",
"gui",
".",
"Combo",
".",
"identity",
";",
"results",
".",
"push",
"(",
"action",
".",
"call",
"(",
"thisp",
",",
"C",
")",
")",
";",
"return",
"this",
".",
"descendants",
"(",
"C",
",",
"action",
",",
"thisp",
",",
"results",
")",
";",
"}"
] | Return descendant classes and class itself. If action is provided, return
array of the results of executing the action for each descendant class
and class itself with the class as argument.
@param {function} C constructor
@param @optional {function} action
@param @optional {object} thisp
@returns {Array<gui.Class|object>} | [
"Return",
"descendant",
"classes",
"and",
"class",
"itself",
".",
"If",
"action",
"is",
"provided",
"return",
"array",
"of",
"the",
"results",
"of",
"executing",
"the",
"action",
"for",
"each",
"descendant",
"class",
"and",
"class",
"itself",
"with",
"the",
"class",
"as",
"argument",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L2067-L2072 |
|
49,406 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(C, action, thisp) {
if (C && C.$superclass) {
action = action || gui.Combo.identity;
return action.call(thisp, C.$superclass);
}
return null;
} | javascript | function(C, action, thisp) {
if (C && C.$superclass) {
action = action || gui.Combo.identity;
return action.call(thisp, C.$superclass);
}
return null;
} | [
"function",
"(",
"C",
",",
"action",
",",
"thisp",
")",
"{",
"if",
"(",
"C",
"&&",
"C",
".",
"$superclass",
")",
"{",
"action",
"=",
"action",
"||",
"gui",
".",
"Combo",
".",
"identity",
";",
"return",
"action",
".",
"call",
"(",
"thisp",
",",
"C",
".",
"$superclass",
")",
";",
"}",
"return",
"null",
";",
"}"
] | Return superclass. If action is provided, return the result
of executing the action with the superclass as argument.
@param {function} C constructor
@param @optional {function} action
@param @optional {object} thisp
@returns {gui.Class|object} | [
"Return",
"superclass",
".",
"If",
"action",
"is",
"provided",
"return",
"the",
"result",
"of",
"executing",
"the",
"action",
"with",
"the",
"superclass",
"as",
"argument",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L2082-L2088 |
|
49,407 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(C, action, thisp) {
var results = this.ancestorsAndSelf(C).concat(this.descendants(C));
if (action) {
results = results.map(function(C) {
return action.call(thisp, C);
});
}
return results;
} | javascript | function(C, action, thisp) {
var results = this.ancestorsAndSelf(C).concat(this.descendants(C));
if (action) {
results = results.map(function(C) {
return action.call(thisp, C);
});
}
return results;
} | [
"function",
"(",
"C",
",",
"action",
",",
"thisp",
")",
"{",
"var",
"results",
"=",
"this",
".",
"ancestorsAndSelf",
"(",
"C",
")",
".",
"concat",
"(",
"this",
".",
"descendants",
"(",
"C",
")",
")",
";",
"if",
"(",
"action",
")",
"{",
"results",
"=",
"results",
".",
"map",
"(",
"function",
"(",
"C",
")",
"{",
"return",
"action",
".",
"call",
"(",
"thisp",
",",
"C",
")",
";",
"}",
")",
";",
"}",
"return",
"results",
";",
"}"
] | Return ancestor classes, descendant classes and class itself. If action is
provided, return array of the results of executing the action for each
related class and class itself with the class as argument.
@param {constructor} C
@param @optional {function} action Takes the class as argument
@param @optional {object} thisp
@returns {Array<<gui.Class|object>>} | [
"Return",
"ancestor",
"classes",
"descendant",
"classes",
"and",
"class",
"itself",
".",
"If",
"action",
"is",
"provided",
"return",
"array",
"of",
"the",
"results",
"of",
"executing",
"the",
"action",
"for",
"each",
"related",
"class",
"and",
"class",
"itself",
"with",
"the",
"class",
"as",
"argument",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L2134-L2142 |
|
49,408 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(proto, key, desc) {
var val = desc.value;
if (gui.Type.isObject(val)) {
if (val.getter || val.setter) {
if (this._isactive(val)) {
desc = this._activeaccessor(proto, key, val);
}
}
}
return desc;
} | javascript | function(proto, key, desc) {
var val = desc.value;
if (gui.Type.isObject(val)) {
if (val.getter || val.setter) {
if (this._isactive(val)) {
desc = this._activeaccessor(proto, key, val);
}
}
}
return desc;
} | [
"function",
"(",
"proto",
",",
"key",
",",
"desc",
")",
"{",
"var",
"val",
"=",
"desc",
".",
"value",
";",
"if",
"(",
"gui",
".",
"Type",
".",
"isObject",
"(",
"val",
")",
")",
"{",
"if",
"(",
"val",
".",
"getter",
"||",
"val",
".",
"setter",
")",
"{",
"if",
"(",
"this",
".",
"_isactive",
"(",
"val",
")",
")",
"{",
"desc",
"=",
"this",
".",
"_activeaccessor",
"(",
"proto",
",",
"key",
",",
"val",
")",
";",
"}",
"}",
"}",
"return",
"desc",
";",
"}"
] | Copy single property to function prototype.
@param {object} proto
@param {String} key
@param {object} desc
@returns {object} | [
"Copy",
"single",
"property",
"to",
"function",
"prototype",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L2318-L2328 |
|
49,409 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(proto, key, def) {
var desc;
["getter", "setter"].forEach(function(name, set) {
while (proto && proto[key] && !gui.Type.isDefined(def[name])) {
proto = Object.getPrototypeOf(proto);
desc = Object.getOwnPropertyDescriptor(proto, key);
if (desc) {
def[name] = desc[set ? "set" : "get"];
}
}
});
return {
enumerable: true,
configurable: true,
get: def.getter || this._NOGETTER,
set: def.setter || this._NOSETTER
};
} | javascript | function(proto, key, def) {
var desc;
["getter", "setter"].forEach(function(name, set) {
while (proto && proto[key] && !gui.Type.isDefined(def[name])) {
proto = Object.getPrototypeOf(proto);
desc = Object.getOwnPropertyDescriptor(proto, key);
if (desc) {
def[name] = desc[set ? "set" : "get"];
}
}
});
return {
enumerable: true,
configurable: true,
get: def.getter || this._NOGETTER,
set: def.setter || this._NOSETTER
};
} | [
"function",
"(",
"proto",
",",
"key",
",",
"def",
")",
"{",
"var",
"desc",
";",
"[",
"\"getter\"",
",",
"\"setter\"",
"]",
".",
"forEach",
"(",
"function",
"(",
"name",
",",
"set",
")",
"{",
"while",
"(",
"proto",
"&&",
"proto",
"[",
"key",
"]",
"&&",
"!",
"gui",
".",
"Type",
".",
"isDefined",
"(",
"def",
"[",
"name",
"]",
")",
")",
"{",
"proto",
"=",
"Object",
".",
"getPrototypeOf",
"(",
"proto",
")",
";",
"desc",
"=",
"Object",
".",
"getOwnPropertyDescriptor",
"(",
"proto",
",",
"key",
")",
";",
"if",
"(",
"desc",
")",
"{",
"def",
"[",
"name",
"]",
"=",
"desc",
"[",
"set",
"?",
"\"set\"",
":",
"\"get\"",
"]",
";",
"}",
"}",
"}",
")",
";",
"return",
"{",
"enumerable",
":",
"true",
",",
"configurable",
":",
"true",
",",
"get",
":",
"def",
".",
"getter",
"||",
"this",
".",
"_NOGETTER",
",",
"set",
":",
"def",
".",
"setter",
"||",
"this",
".",
"_NOSETTER",
"}",
";",
"}"
] | Compute property descriptor for getter-setter
type definition and assign it to the prototype.
@param {object} proto
@param {String} key
@param {object} def
@returns {defect} | [
"Compute",
"property",
"descriptor",
"for",
"getter",
"-",
"setter",
"type",
"definition",
"and",
"assign",
"it",
"to",
"the",
"prototype",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L2356-L2373 |
|
49,410 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(interfais, object) {
var is = true;
var expected = interfais.toString();
var type = gui.Type.of(object);
switch (type) {
case "null":
case "string":
case "number":
case "boolean":
case "undefined":
throw new Error("Expected " + expected + ", got " + type + ": " + object);
default:
try {
var missing = null,
t = null;
is = Object.keys(interfais).every(function(name) {
missing = name;
t = gui.Type.of(interfais[name]);
return gui.Type.of(object[name]) === t;
});
if (!is) {
throw new Error("Expected " + expected + ". A required " + type + " \"" + missing + "\" is missing");
}
} catch (exception) {
throw new Error("Expected " + expected);
}
break;
}
return is;
} | javascript | function(interfais, object) {
var is = true;
var expected = interfais.toString();
var type = gui.Type.of(object);
switch (type) {
case "null":
case "string":
case "number":
case "boolean":
case "undefined":
throw new Error("Expected " + expected + ", got " + type + ": " + object);
default:
try {
var missing = null,
t = null;
is = Object.keys(interfais).every(function(name) {
missing = name;
t = gui.Type.of(interfais[name]);
return gui.Type.of(object[name]) === t;
});
if (!is) {
throw new Error("Expected " + expected + ". A required " + type + " \"" + missing + "\" is missing");
}
} catch (exception) {
throw new Error("Expected " + expected);
}
break;
}
return is;
} | [
"function",
"(",
"interfais",
",",
"object",
")",
"{",
"var",
"is",
"=",
"true",
";",
"var",
"expected",
"=",
"interfais",
".",
"toString",
"(",
")",
";",
"var",
"type",
"=",
"gui",
".",
"Type",
".",
"of",
"(",
"object",
")",
";",
"switch",
"(",
"type",
")",
"{",
"case",
"\"null\"",
":",
"case",
"\"string\"",
":",
"case",
"\"number\"",
":",
"case",
"\"boolean\"",
":",
"case",
"\"undefined\"",
":",
"throw",
"new",
"Error",
"(",
"\"Expected \"",
"+",
"expected",
"+",
"\", got \"",
"+",
"type",
"+",
"\": \"",
"+",
"object",
")",
";",
"default",
":",
"try",
"{",
"var",
"missing",
"=",
"null",
",",
"t",
"=",
"null",
";",
"is",
"=",
"Object",
".",
"keys",
"(",
"interfais",
")",
".",
"every",
"(",
"function",
"(",
"name",
")",
"{",
"missing",
"=",
"name",
";",
"t",
"=",
"gui",
".",
"Type",
".",
"of",
"(",
"interfais",
"[",
"name",
"]",
")",
";",
"return",
"gui",
".",
"Type",
".",
"of",
"(",
"object",
"[",
"name",
"]",
")",
"===",
"t",
";",
"}",
")",
";",
"if",
"(",
"!",
"is",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Expected \"",
"+",
"expected",
"+",
"\". A required \"",
"+",
"type",
"+",
"\" \\\"\"",
"+",
"missing",
"+",
"\"\\\" is missing\"",
")",
";",
"}",
"}",
"catch",
"(",
"exception",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Expected \"",
"+",
"expected",
")",
";",
"}",
"break",
";",
"}",
"return",
"is",
";",
"}"
] | Check object interface. Throw exception on fail.
@param {object} interfais
@param {object} osbject
@returns {boolean} | [
"Check",
"object",
"interface",
".",
"Throw",
"exception",
"on",
"fail",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L2408-L2437 |
|
49,411 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(decoration) {
return function(base) {
return function() {
var result = base.apply(this, arguments);
decoration.apply(this, arguments);
return result;
};
};
} | javascript | function(decoration) {
return function(base) {
return function() {
var result = base.apply(this, arguments);
decoration.apply(this, arguments);
return result;
};
};
} | [
"function",
"(",
"decoration",
")",
"{",
"return",
"function",
"(",
"base",
")",
"{",
"return",
"function",
"(",
")",
"{",
"var",
"result",
"=",
"base",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"decoration",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"return",
"result",
";",
"}",
";",
"}",
";",
"}"
] | Decorate function after.
@param {function} decoration
@returns {function} | [
"Decorate",
"function",
"after",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L2468-L2476 |
|
49,412 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(decoration) {
var slice = [].slice;
return function(base) {
return function() {
var argv, callback, result, that = this;
argv = 1 <= arguments.length ? slice.call(arguments, 0) : [];
result = void 0;
callback = function() {
return (result = base.apply(that, argv));
};
decoration.apply(this, [callback].concat(argv));
return result;
};
};
} | javascript | function(decoration) {
var slice = [].slice;
return function(base) {
return function() {
var argv, callback, result, that = this;
argv = 1 <= arguments.length ? slice.call(arguments, 0) : [];
result = void 0;
callback = function() {
return (result = base.apply(that, argv));
};
decoration.apply(this, [callback].concat(argv));
return result;
};
};
} | [
"function",
"(",
"decoration",
")",
"{",
"var",
"slice",
"=",
"[",
"]",
".",
"slice",
";",
"return",
"function",
"(",
"base",
")",
"{",
"return",
"function",
"(",
")",
"{",
"var",
"argv",
",",
"callback",
",",
"result",
",",
"that",
"=",
"this",
";",
"argv",
"=",
"1",
"<=",
"arguments",
".",
"length",
"?",
"slice",
".",
"call",
"(",
"arguments",
",",
"0",
")",
":",
"[",
"]",
";",
"result",
"=",
"void",
"0",
";",
"callback",
"=",
"function",
"(",
")",
"{",
"return",
"(",
"result",
"=",
"base",
".",
"apply",
"(",
"that",
",",
"argv",
")",
")",
";",
"}",
";",
"decoration",
".",
"apply",
"(",
"this",
",",
"[",
"callback",
"]",
".",
"concat",
"(",
"argv",
")",
")",
";",
"return",
"result",
";",
"}",
";",
"}",
";",
"}"
] | Decorate function around.
@param {function} decoration
@returns {function} | [
"Decorate",
"function",
"around",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L2483-L2497 |
|
49,413 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(condition) {
return function(base, otherwise) {
return function() {
if (condition.apply(this, arguments)) {
return base.apply(this, arguments);
} else if (otherwise) {
return otherwise.apply(this, arguments);
}
};
};
} | javascript | function(condition) {
return function(base, otherwise) {
return function() {
if (condition.apply(this, arguments)) {
return base.apply(this, arguments);
} else if (otherwise) {
return otherwise.apply(this, arguments);
}
};
};
} | [
"function",
"(",
"condition",
")",
"{",
"return",
"function",
"(",
"base",
",",
"otherwise",
")",
"{",
"return",
"function",
"(",
")",
"{",
"if",
"(",
"condition",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
")",
"{",
"return",
"base",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"}",
"else",
"if",
"(",
"otherwise",
")",
"{",
"return",
"otherwise",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"}",
"}",
";",
"}",
";",
"}"
] | Decorate function provided with support for an otherwise operation.
@param {function} condition | [
"Decorate",
"function",
"provided",
"with",
"support",
"for",
"an",
"otherwise",
"operation",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L2503-L2513 |
|
49,414 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(client) {
this.client = client;
if(gui.hasModule('[email protected]')) {
if(client instanceof gui.Spirit) {
this.spirit = client || null;
this.context = window; // otherwise web worker scenario, maybe deprecate
}
}
this.onconstruct();
} | javascript | function(client) {
this.client = client;
if(gui.hasModule('[email protected]')) {
if(client instanceof gui.Spirit) {
this.spirit = client || null;
this.context = window; // otherwise web worker scenario, maybe deprecate
}
}
this.onconstruct();
} | [
"function",
"(",
"client",
")",
"{",
"this",
".",
"client",
"=",
"client",
";",
"if",
"(",
"gui",
".",
"hasModule",
"(",
"'[email protected]'",
")",
")",
"{",
"if",
"(",
"client",
"instanceof",
"gui",
".",
"Spirit",
")",
"{",
"this",
".",
"spirit",
"=",
"client",
"||",
"null",
";",
"this",
".",
"context",
"=",
"window",
";",
"// otherwise web worker scenario, maybe deprecate",
"}",
"}",
"this",
".",
"onconstruct",
"(",
")",
";",
"}"
] | Secret constructor. Called before `onconstruct`.
@type {gui.Spirit|gui.Plugin|edb.Object|edb.Array} | [
"Secret",
"constructor",
".",
"Called",
"before",
"onconstruct",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L2605-L2614 |
|
49,415 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function() {
gui.Plugin.prototype.ondestruct.call(this);
gui.Object.each(this._trackedtypes, function(type, list) {
list.slice().forEach(function(checks) {
this._cleanup(type, checks);
}, this);
}, this);
} | javascript | function() {
gui.Plugin.prototype.ondestruct.call(this);
gui.Object.each(this._trackedtypes, function(type, list) {
list.slice().forEach(function(checks) {
this._cleanup(type, checks);
}, this);
}, this);
} | [
"function",
"(",
")",
"{",
"gui",
".",
"Plugin",
".",
"prototype",
".",
"ondestruct",
".",
"call",
"(",
"this",
")",
";",
"gui",
".",
"Object",
".",
"each",
"(",
"this",
".",
"_trackedtypes",
",",
"function",
"(",
"type",
",",
"list",
")",
"{",
"list",
".",
"slice",
"(",
")",
".",
"forEach",
"(",
"function",
"(",
"checks",
")",
"{",
"this",
".",
"_cleanup",
"(",
"type",
",",
"checks",
")",
";",
"}",
",",
"this",
")",
";",
"}",
",",
"this",
")",
";",
"}"
] | Cleanup on destruction. | [
"Cleanup",
"on",
"destruction",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L2706-L2713 |
|
49,416 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(on /*...rest */ ) {
var rest = gui.Array.from(arguments).slice(1);
if (on) {
return this.add.apply(this, rest);
} else {
return this.remove.apply(this, rest);
}
} | javascript | function(on /*...rest */ ) {
var rest = gui.Array.from(arguments).slice(1);
if (on) {
return this.add.apply(this, rest);
} else {
return this.remove.apply(this, rest);
}
} | [
"function",
"(",
"on",
"/*...rest */",
")",
"{",
"var",
"rest",
"=",
"gui",
".",
"Array",
".",
"from",
"(",
"arguments",
")",
".",
"slice",
"(",
"1",
")",
";",
"if",
"(",
"on",
")",
"{",
"return",
"this",
".",
"add",
".",
"apply",
"(",
"this",
",",
"rest",
")",
";",
"}",
"else",
"{",
"return",
"this",
".",
"remove",
".",
"apply",
"(",
"this",
",",
"rest",
")",
";",
"}",
"}"
] | Invokes `add` or `remove` according to first argument given.
The remaining arguments are applied to the method we invoke.
@param {boolean} on
@returns {gui.Tracker} | [
"Invokes",
"add",
"or",
"remove",
"according",
"to",
"first",
"argument",
"given",
".",
"The",
"remaining",
"arguments",
"are",
"applied",
"to",
"the",
"method",
"we",
"invoke",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L2730-L2737 |
|
49,417 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type, checks) {
var result = false;
var list = this._trackedtypes[type];
if (!list) {
list = this._trackedtypes[type] = [];
result = true;
} else {
result = !this._haschecks(list, checks);
}
if (result && checks) {
list.push(checks);
}
return result;
} | javascript | function(type, checks) {
var result = false;
var list = this._trackedtypes[type];
if (!list) {
list = this._trackedtypes[type] = [];
result = true;
} else {
result = !this._haschecks(list, checks);
}
if (result && checks) {
list.push(checks);
}
return result;
} | [
"function",
"(",
"type",
",",
"checks",
")",
"{",
"var",
"result",
"=",
"false",
";",
"var",
"list",
"=",
"this",
".",
"_trackedtypes",
"[",
"type",
"]",
";",
"if",
"(",
"!",
"list",
")",
"{",
"list",
"=",
"this",
".",
"_trackedtypes",
"[",
"type",
"]",
"=",
"[",
"]",
";",
"result",
"=",
"true",
";",
"}",
"else",
"{",
"result",
"=",
"!",
"this",
".",
"_haschecks",
"(",
"list",
",",
"checks",
")",
";",
"}",
"if",
"(",
"result",
"&&",
"checks",
")",
"{",
"list",
".",
"push",
"(",
"checks",
")",
";",
"}",
"return",
"result",
";",
"}"
] | Can add type of given checks?
@param {String} type
@param {Array<object>} checks
@returns {boolean} | [
"Can",
"add",
"type",
"of",
"given",
"checks?"
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L2793-L2806 |
|
49,418 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type, checks) {
var result = false;
var list = this._trackedtypes[type];
if (list) {
var index = this._checksindex(list, checks);
if (index > -1) {
result = true;
// TODO: this seems to not run when checks is none (undefined)!
if (gui.Array.remove(list, index) === 0) {
delete this._trackedtypes[type];
}
}
}
return result;
} | javascript | function(type, checks) {
var result = false;
var list = this._trackedtypes[type];
if (list) {
var index = this._checksindex(list, checks);
if (index > -1) {
result = true;
// TODO: this seems to not run when checks is none (undefined)!
if (gui.Array.remove(list, index) === 0) {
delete this._trackedtypes[type];
}
}
}
return result;
} | [
"function",
"(",
"type",
",",
"checks",
")",
"{",
"var",
"result",
"=",
"false",
";",
"var",
"list",
"=",
"this",
".",
"_trackedtypes",
"[",
"type",
"]",
";",
"if",
"(",
"list",
")",
"{",
"var",
"index",
"=",
"this",
".",
"_checksindex",
"(",
"list",
",",
"checks",
")",
";",
"if",
"(",
"index",
">",
"-",
"1",
")",
"{",
"result",
"=",
"true",
";",
"// TODO: this seems to not run when checks is none (undefined)!",
"if",
"(",
"gui",
".",
"Array",
".",
"remove",
"(",
"list",
",",
"index",
")",
"===",
"0",
")",
"{",
"delete",
"this",
".",
"_trackedtypes",
"[",
"type",
"]",
";",
"}",
"}",
"}",
"return",
"result",
";",
"}"
] | Can remove type of given checks? If so, do it now.
@param {String} type
@param {Array<object>} checks
@returns {boolean} | [
"Can",
"remove",
"type",
"of",
"given",
"checks?",
"If",
"so",
"do",
"it",
"now",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L2814-L2828 |
|
49,419 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type, checks) {
var result = false;
var list = this._trackedtypes[type];
if (list) {
result = !checks || this._haschecks(list, checks);
}
return result;
} | javascript | function(type, checks) {
var result = false;
var list = this._trackedtypes[type];
if (list) {
result = !checks || this._haschecks(list, checks);
}
return result;
} | [
"function",
"(",
"type",
",",
"checks",
")",
"{",
"var",
"result",
"=",
"false",
";",
"var",
"list",
"=",
"this",
".",
"_trackedtypes",
"[",
"type",
"]",
";",
"if",
"(",
"list",
")",
"{",
"result",
"=",
"!",
"checks",
"||",
"this",
".",
"_haschecks",
"(",
"list",
",",
"checks",
")",
";",
"}",
"return",
"result",
";",
"}"
] | Has list for type AND given checks?
@param {String} type
@param {Array<object>} checks | [
"Has",
"list",
"for",
"type",
"AND",
"given",
"checks?"
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L2835-L2842 |
|
49,420 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(list, checks) {
var result = !checks || false;
if (!result) {
list.every(function(a) {
if (a.every(function(b, i) {
return b === checks[i];
})) {
result = true;
}
return !result;
});
}
return result;
} | javascript | function(list, checks) {
var result = !checks || false;
if (!result) {
list.every(function(a) {
if (a.every(function(b, i) {
return b === checks[i];
})) {
result = true;
}
return !result;
});
}
return result;
} | [
"function",
"(",
"list",
",",
"checks",
")",
"{",
"var",
"result",
"=",
"!",
"checks",
"||",
"false",
";",
"if",
"(",
"!",
"result",
")",
"{",
"list",
".",
"every",
"(",
"function",
"(",
"a",
")",
"{",
"if",
"(",
"a",
".",
"every",
"(",
"function",
"(",
"b",
",",
"i",
")",
"{",
"return",
"b",
"===",
"checks",
"[",
"i",
"]",
";",
"}",
")",
")",
"{",
"result",
"=",
"true",
";",
"}",
"return",
"!",
"result",
";",
"}",
")",
";",
"}",
"return",
"result",
";",
"}"
] | Has checks indexed?
@param {Array<Array<object>>} list
@param {Array<object>} checks
@returns {boolean} | [
"Has",
"checks",
"indexed?"
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L2850-L2863 |
|
49,421 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(list, checks) {
var result = -1;
list.every(function(a, index) {
if (a.every(function(b, i) {
return b === checks[i];
})) {
result = index;
}
return result === -1;
});
return result;
} | javascript | function(list, checks) {
var result = -1;
list.every(function(a, index) {
if (a.every(function(b, i) {
return b === checks[i];
})) {
result = index;
}
return result === -1;
});
return result;
} | [
"function",
"(",
"list",
",",
"checks",
")",
"{",
"var",
"result",
"=",
"-",
"1",
";",
"list",
".",
"every",
"(",
"function",
"(",
"a",
",",
"index",
")",
"{",
"if",
"(",
"a",
".",
"every",
"(",
"function",
"(",
"b",
",",
"i",
")",
"{",
"return",
"b",
"===",
"checks",
"[",
"i",
"]",
";",
"}",
")",
")",
"{",
"result",
"=",
"index",
";",
"}",
"return",
"result",
"===",
"-",
"1",
";",
"}",
")",
";",
"return",
"result",
";",
"}"
] | Get index of checks.
@param {Array<Array<object>>} list
@param {Array<object>} checks
@returns {number} | [
"Get",
"index",
"of",
"checks",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L2879-L2890 |
|
49,422 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(a, key) {
var prefix = "spiritual-action:";
return prefix + (function() {
a.target = null;
a.data = (function(d) {
if (gui.Type.isComplex(d)) {
if (gui.Type.isFunction(d.stringify)) {
d = d.stringify();
} else {
try {
JSON.stringify(d);
} catch (jsonexception) {
d = null;
}
}
}
return d;
}(a.data));
a.instanceid = key || null;
return JSON.stringify(a);
}());
} | javascript | function(a, key) {
var prefix = "spiritual-action:";
return prefix + (function() {
a.target = null;
a.data = (function(d) {
if (gui.Type.isComplex(d)) {
if (gui.Type.isFunction(d.stringify)) {
d = d.stringify();
} else {
try {
JSON.stringify(d);
} catch (jsonexception) {
d = null;
}
}
}
return d;
}(a.data));
a.instanceid = key || null;
return JSON.stringify(a);
}());
} | [
"function",
"(",
"a",
",",
"key",
")",
"{",
"var",
"prefix",
"=",
"\"spiritual-action:\"",
";",
"return",
"prefix",
"+",
"(",
"function",
"(",
")",
"{",
"a",
".",
"target",
"=",
"null",
";",
"a",
".",
"data",
"=",
"(",
"function",
"(",
"d",
")",
"{",
"if",
"(",
"gui",
".",
"Type",
".",
"isComplex",
"(",
"d",
")",
")",
"{",
"if",
"(",
"gui",
".",
"Type",
".",
"isFunction",
"(",
"d",
".",
"stringify",
")",
")",
"{",
"d",
"=",
"d",
".",
"stringify",
"(",
")",
";",
"}",
"else",
"{",
"try",
"{",
"JSON",
".",
"stringify",
"(",
"d",
")",
";",
"}",
"catch",
"(",
"jsonexception",
")",
"{",
"d",
"=",
"null",
";",
"}",
"}",
"}",
"return",
"d",
";",
"}",
"(",
"a",
".",
"data",
")",
")",
";",
"a",
".",
"instanceid",
"=",
"key",
"||",
"null",
";",
"return",
"JSON",
".",
"stringify",
"(",
"a",
")",
";",
"}",
"(",
")",
")",
";",
"}"
] | Encode action to be posted xdomain.
@param {gui.Action} a
@param @optional {String} key Associates dispatching document
to the hosting iframespirit (ascending action scenario)
@returns {String} | [
"Encode",
"action",
"to",
"be",
"posted",
"xdomain",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L3132-L3153 |
|
49,423 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(b) {
var prefix = "spiritual-broadcast:";
return prefix + (function() {
b.target = null;
b.data = (function(d) {
if (gui.Type.isComplex(d)) {
if (gui.Type.isFunction(d.stringify)) {
d = d.stringify();
} else {
try {
JSON.stringify(d); // @TODO: think mcfly - how come not d = JSON.stringify????
} catch (jsonexception) {
d = null;
}
}
}
return d;
}(b.data));
return JSON.stringify(b);
}());
} | javascript | function(b) {
var prefix = "spiritual-broadcast:";
return prefix + (function() {
b.target = null;
b.data = (function(d) {
if (gui.Type.isComplex(d)) {
if (gui.Type.isFunction(d.stringify)) {
d = d.stringify();
} else {
try {
JSON.stringify(d); // @TODO: think mcfly - how come not d = JSON.stringify????
} catch (jsonexception) {
d = null;
}
}
}
return d;
}(b.data));
return JSON.stringify(b);
}());
} | [
"function",
"(",
"b",
")",
"{",
"var",
"prefix",
"=",
"\"spiritual-broadcast:\"",
";",
"return",
"prefix",
"+",
"(",
"function",
"(",
")",
"{",
"b",
".",
"target",
"=",
"null",
";",
"b",
".",
"data",
"=",
"(",
"function",
"(",
"d",
")",
"{",
"if",
"(",
"gui",
".",
"Type",
".",
"isComplex",
"(",
"d",
")",
")",
"{",
"if",
"(",
"gui",
".",
"Type",
".",
"isFunction",
"(",
"d",
".",
"stringify",
")",
")",
"{",
"d",
"=",
"d",
".",
"stringify",
"(",
")",
";",
"}",
"else",
"{",
"try",
"{",
"JSON",
".",
"stringify",
"(",
"d",
")",
";",
"// @TODO: think mcfly - how come not d = JSON.stringify????",
"}",
"catch",
"(",
"jsonexception",
")",
"{",
"d",
"=",
"null",
";",
"}",
"}",
"}",
"return",
"d",
";",
"}",
"(",
"b",
".",
"data",
")",
")",
";",
"return",
"JSON",
".",
"stringify",
"(",
"b",
")",
";",
"}",
"(",
")",
")",
";",
"}"
] | Encode broadcast to be posted xdomain.
@param {gui.Broacast} b
@returns {String} | [
"Encode",
"broadcast",
"to",
"be",
"posted",
"xdomain",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L3498-L3518 |
|
49,424 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(msg) {
var prefix = "spiritual-broadcast:";
if (msg.startsWith(prefix)) {
return JSON.parse(msg.split(prefix)[1]);
}
} | javascript | function(msg) {
var prefix = "spiritual-broadcast:";
if (msg.startsWith(prefix)) {
return JSON.parse(msg.split(prefix)[1]);
}
} | [
"function",
"(",
"msg",
")",
"{",
"var",
"prefix",
"=",
"\"spiritual-broadcast:\"",
";",
"if",
"(",
"msg",
".",
"startsWith",
"(",
"prefix",
")",
")",
"{",
"return",
"JSON",
".",
"parse",
"(",
"msg",
".",
"split",
"(",
"prefix",
")",
"[",
"1",
"]",
")",
";",
"}",
"}"
] | Decode broadcast posted from xdomain and return a broadcast-like object.
@param {String} msg
@returns {object} | [
"Decode",
"broadcast",
"posted",
"from",
"xdomain",
"and",
"return",
"a",
"broadcast",
"-",
"like",
"object",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L3525-L3530 |
|
49,425 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(b) {
var map = b.global ? this._globals : this._locals[gui.$contextid];
if (gui.hasModule('[email protected]')) {
if(!gui.spiritualized) {
if(b.type !== gui.BROADCAST_WILL_SPIRITUALIZE) {
// TODO: cache broadcast until spiritualized?
}
}
}
if (this.$target) {
if (!b.global) {
b.target = this.$target;
}
this.$target = null;
}
if (b instanceof gui.Broadcast === false) {
b = new gui.Broadcast(b);
}
if (map) {
var handlers = map[b.type];
if (handlers) {
handlers.slice().forEach(function(handler) {
handler.onbroadcast(b);
});
}
}
if (b.global) {
this._propagate(b);
}
return b;
} | javascript | function(b) {
var map = b.global ? this._globals : this._locals[gui.$contextid];
if (gui.hasModule('[email protected]')) {
if(!gui.spiritualized) {
if(b.type !== gui.BROADCAST_WILL_SPIRITUALIZE) {
// TODO: cache broadcast until spiritualized?
}
}
}
if (this.$target) {
if (!b.global) {
b.target = this.$target;
}
this.$target = null;
}
if (b instanceof gui.Broadcast === false) {
b = new gui.Broadcast(b);
}
if (map) {
var handlers = map[b.type];
if (handlers) {
handlers.slice().forEach(function(handler) {
handler.onbroadcast(b);
});
}
}
if (b.global) {
this._propagate(b);
}
return b;
} | [
"function",
"(",
"b",
")",
"{",
"var",
"map",
"=",
"b",
".",
"global",
"?",
"this",
".",
"_globals",
":",
"this",
".",
"_locals",
"[",
"gui",
".",
"$contextid",
"]",
";",
"if",
"(",
"gui",
".",
"hasModule",
"(",
"'[email protected]'",
")",
")",
"{",
"if",
"(",
"!",
"gui",
".",
"spiritualized",
")",
"{",
"if",
"(",
"b",
".",
"type",
"!==",
"gui",
".",
"BROADCAST_WILL_SPIRITUALIZE",
")",
"{",
"// TODO: cache broadcast until spiritualized?",
"}",
"}",
"}",
"if",
"(",
"this",
".",
"$target",
")",
"{",
"if",
"(",
"!",
"b",
".",
"global",
")",
"{",
"b",
".",
"target",
"=",
"this",
".",
"$target",
";",
"}",
"this",
".",
"$target",
"=",
"null",
";",
"}",
"if",
"(",
"b",
"instanceof",
"gui",
".",
"Broadcast",
"===",
"false",
")",
"{",
"b",
"=",
"new",
"gui",
".",
"Broadcast",
"(",
"b",
")",
";",
"}",
"if",
"(",
"map",
")",
"{",
"var",
"handlers",
"=",
"map",
"[",
"b",
".",
"type",
"]",
";",
"if",
"(",
"handlers",
")",
"{",
"handlers",
".",
"slice",
"(",
")",
".",
"forEach",
"(",
"function",
"(",
"handler",
")",
"{",
"handler",
".",
"onbroadcast",
"(",
"b",
")",
";",
"}",
")",
";",
"}",
"}",
"if",
"(",
"b",
".",
"global",
")",
"{",
"this",
".",
"_propagate",
"(",
"b",
")",
";",
"}",
"return",
"b",
";",
"}"
] | Dispatch broadcast.
@param {gui.Broadcast|Map<String,object>} b | [
"Dispatch",
"broadcast",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L3624-L3654 |
|
49,426 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(b) {
var postmessage = (function stamp() {
b.$contextids.push(gui.$contextid);
return gui.Broadcast.stringify(b);
}());
this._propagateDown(postmessage);
this._propagateUp(postmessage, b.type);
} | javascript | function(b) {
var postmessage = (function stamp() {
b.$contextids.push(gui.$contextid);
return gui.Broadcast.stringify(b);
}());
this._propagateDown(postmessage);
this._propagateUp(postmessage, b.type);
} | [
"function",
"(",
"b",
")",
"{",
"var",
"postmessage",
"=",
"(",
"function",
"stamp",
"(",
")",
"{",
"b",
".",
"$contextids",
".",
"push",
"(",
"gui",
".",
"$contextid",
")",
";",
"return",
"gui",
".",
"Broadcast",
".",
"stringify",
"(",
"b",
")",
";",
"}",
"(",
")",
")",
";",
"this",
".",
"_propagateDown",
"(",
"postmessage",
")",
";",
"this",
".",
"_propagateUp",
"(",
"postmessage",
",",
"b",
".",
"type",
")",
";",
"}"
] | Propagate broadcast xframe.
1. Propagate descending
2. Propagate ascending
TODO: Don't post to universal domain "*"
@param {gui.Broadcast} b | [
"Propagate",
"broadcast",
"xframe",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L3664-L3671 |
|
49,427 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type, time, sig) {
var map = this._tempname;
var types = map.types;
var tick = new gui.Tick(type);
time = time || 0;
if (!types[type]) { // !!!!!!!!!!!!!!!!!!!!!!!
types[type] = true;
var that = this,
id = null;
if (!time) {
id = setImmediate(function() {
delete types[type];
that._doit(tick);
});
} else {
id = setTimeout(function() {
delete types[type];
that._doit(tick);
}, time);
}
}
return tick;
} | javascript | function(type, time, sig) {
var map = this._tempname;
var types = map.types;
var tick = new gui.Tick(type);
time = time || 0;
if (!types[type]) { // !!!!!!!!!!!!!!!!!!!!!!!
types[type] = true;
var that = this,
id = null;
if (!time) {
id = setImmediate(function() {
delete types[type];
that._doit(tick);
});
} else {
id = setTimeout(function() {
delete types[type];
that._doit(tick);
}, time);
}
}
return tick;
} | [
"function",
"(",
"type",
",",
"time",
",",
"sig",
")",
"{",
"var",
"map",
"=",
"this",
".",
"_tempname",
";",
"var",
"types",
"=",
"map",
".",
"types",
";",
"var",
"tick",
"=",
"new",
"gui",
".",
"Tick",
"(",
"type",
")",
";",
"time",
"=",
"time",
"||",
"0",
";",
"if",
"(",
"!",
"types",
"[",
"type",
"]",
")",
"{",
"// !!!!!!!!!!!!!!!!!!!!!!!",
"types",
"[",
"type",
"]",
"=",
"true",
";",
"var",
"that",
"=",
"this",
",",
"id",
"=",
"null",
";",
"if",
"(",
"!",
"time",
")",
"{",
"id",
"=",
"setImmediate",
"(",
"function",
"(",
")",
"{",
"delete",
"types",
"[",
"type",
"]",
";",
"that",
".",
"_doit",
"(",
"tick",
")",
";",
"}",
")",
";",
"}",
"else",
"{",
"id",
"=",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"delete",
"types",
"[",
"type",
"]",
";",
"that",
".",
"_doit",
"(",
"tick",
")",
";",
"}",
",",
"time",
")",
";",
"}",
"}",
"return",
"tick",
";",
"}"
] | Dispatch tick sooner or later.
@param {String} type
@param @optional {number} time
@param @optional {String} sig | [
"Dispatch",
"tick",
"sooner",
"or",
"later",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L3962-L3984 |
|
49,428 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(spirit) {
var prefixes = [],
plugins = spirit.life.plugins;
gui.Object.each(plugins, function(prefix, instantiated) {
if (instantiated) {
if (prefix !== "life") {
prefixes.push(prefix);
}
} else {
Object.defineProperty(spirit, prefix, {
enumerable: true,
configurable: true,
get: function() {},
set: function() {}
});
}
});
plugins = prefixes.map(function(key) {
return spirit[key];
}, this);
if (!gui.unloading) {
this.$nukeplugins(plugins, false);
gui.Tick.next(function() { // TODO: organize this at some point...
this.$nukeplugins(plugins, true);
this.$nukeelement(spirit);
this.$nukeallofit(spirit);
}, this);
}
} | javascript | function(spirit) {
var prefixes = [],
plugins = spirit.life.plugins;
gui.Object.each(plugins, function(prefix, instantiated) {
if (instantiated) {
if (prefix !== "life") {
prefixes.push(prefix);
}
} else {
Object.defineProperty(spirit, prefix, {
enumerable: true,
configurable: true,
get: function() {},
set: function() {}
});
}
});
plugins = prefixes.map(function(key) {
return spirit[key];
}, this);
if (!gui.unloading) {
this.$nukeplugins(plugins, false);
gui.Tick.next(function() { // TODO: organize this at some point...
this.$nukeplugins(plugins, true);
this.$nukeelement(spirit);
this.$nukeallofit(spirit);
}, this);
}
} | [
"function",
"(",
"spirit",
")",
"{",
"var",
"prefixes",
"=",
"[",
"]",
",",
"plugins",
"=",
"spirit",
".",
"life",
".",
"plugins",
";",
"gui",
".",
"Object",
".",
"each",
"(",
"plugins",
",",
"function",
"(",
"prefix",
",",
"instantiated",
")",
"{",
"if",
"(",
"instantiated",
")",
"{",
"if",
"(",
"prefix",
"!==",
"\"life\"",
")",
"{",
"prefixes",
".",
"push",
"(",
"prefix",
")",
";",
"}",
"}",
"else",
"{",
"Object",
".",
"defineProperty",
"(",
"spirit",
",",
"prefix",
",",
"{",
"enumerable",
":",
"true",
",",
"configurable",
":",
"true",
",",
"get",
":",
"function",
"(",
")",
"{",
"}",
",",
"set",
":",
"function",
"(",
")",
"{",
"}",
"}",
")",
";",
"}",
"}",
")",
";",
"plugins",
"=",
"prefixes",
".",
"map",
"(",
"function",
"(",
"key",
")",
"{",
"return",
"spirit",
"[",
"key",
"]",
";",
"}",
",",
"this",
")",
";",
"if",
"(",
"!",
"gui",
".",
"unloading",
")",
"{",
"this",
".",
"$nukeplugins",
"(",
"plugins",
",",
"false",
")",
";",
"gui",
".",
"Tick",
".",
"next",
"(",
"function",
"(",
")",
"{",
"// TODO: organize this at some point...",
"this",
".",
"$nukeplugins",
"(",
"plugins",
",",
"true",
")",
";",
"this",
".",
"$nukeelement",
"(",
"spirit",
")",
";",
"this",
".",
"$nukeallofit",
"(",
"spirit",
")",
";",
"}",
",",
"this",
")",
";",
"}",
"}"
] | Nuke that spirit.
- Nuke lazy plugins so that we don't accidentally instantiate them
- Destruct remaining plugins, saving the {gui.Life} plugin for last
- Replace all properties with an accessor to throw an exception
@param {gui.Spirit} spirit | [
"Nuke",
"that",
"spirit",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L4072-L4100 |
|
49,429 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(plugins, nuke) {
if (nuke) {
plugins.forEach(function(plugin) {
this.$nukeallofit(plugin);
}, this);
} else {
plugins.map(function(plugin) {
plugin.ondestruct();
return plugin;
}).forEach(function(plugin) {
plugin.$ondestruct();
});
}
} | javascript | function(plugins, nuke) {
if (nuke) {
plugins.forEach(function(plugin) {
this.$nukeallofit(plugin);
}, this);
} else {
plugins.map(function(plugin) {
plugin.ondestruct();
return plugin;
}).forEach(function(plugin) {
plugin.$ondestruct();
});
}
} | [
"function",
"(",
"plugins",
",",
"nuke",
")",
"{",
"if",
"(",
"nuke",
")",
"{",
"plugins",
".",
"forEach",
"(",
"function",
"(",
"plugin",
")",
"{",
"this",
".",
"$nukeallofit",
"(",
"plugin",
")",
";",
"}",
",",
"this",
")",
";",
"}",
"else",
"{",
"plugins",
".",
"map",
"(",
"function",
"(",
"plugin",
")",
"{",
"plugin",
".",
"ondestruct",
"(",
")",
";",
"return",
"plugin",
";",
"}",
")",
".",
"forEach",
"(",
"function",
"(",
"plugin",
")",
"{",
"plugin",
".",
"$ondestruct",
"(",
")",
";",
"}",
")",
";",
"}",
"}"
] | Nuke plugins in three steps to minimize access violations.
@param {gui.Spirit} spirit
@param {Array<String>} prefixes
@param {boolean} nuke | [
"Nuke",
"plugins",
"in",
"three",
"steps",
"to",
"minimize",
"access",
"violations",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L4108-L4121 |
|
49,430 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(thing) {
var nativeprops = Object.prototype;
if (!gui.unloading && !thing.$destructed) {
thing.$destructed = true;
for (var prop in thing) {
if (thing.hasOwnProperty(prop) || gui.debug) {
if (nativeprops[prop] === undefined) {
if (prop !== '$destructed') {
var desc = Object.getOwnPropertyDescriptor(thing, prop);
if (!desc || desc.configurable) {
if (gui.debug) {
this._definePropertyItentified(thing, prop);
} else {
Object.defineProperty(thing, prop, this.DENIED);
}
}
}
}
}
}
}
} | javascript | function(thing) {
var nativeprops = Object.prototype;
if (!gui.unloading && !thing.$destructed) {
thing.$destructed = true;
for (var prop in thing) {
if (thing.hasOwnProperty(prop) || gui.debug) {
if (nativeprops[prop] === undefined) {
if (prop !== '$destructed') {
var desc = Object.getOwnPropertyDescriptor(thing, prop);
if (!desc || desc.configurable) {
if (gui.debug) {
this._definePropertyItentified(thing, prop);
} else {
Object.defineProperty(thing, prop, this.DENIED);
}
}
}
}
}
}
}
} | [
"function",
"(",
"thing",
")",
"{",
"var",
"nativeprops",
"=",
"Object",
".",
"prototype",
";",
"if",
"(",
"!",
"gui",
".",
"unloading",
"&&",
"!",
"thing",
".",
"$destructed",
")",
"{",
"thing",
".",
"$destructed",
"=",
"true",
";",
"for",
"(",
"var",
"prop",
"in",
"thing",
")",
"{",
"if",
"(",
"thing",
".",
"hasOwnProperty",
"(",
"prop",
")",
"||",
"gui",
".",
"debug",
")",
"{",
"if",
"(",
"nativeprops",
"[",
"prop",
"]",
"===",
"undefined",
")",
"{",
"if",
"(",
"prop",
"!==",
"'$destructed'",
")",
"{",
"var",
"desc",
"=",
"Object",
".",
"getOwnPropertyDescriptor",
"(",
"thing",
",",
"prop",
")",
";",
"if",
"(",
"!",
"desc",
"||",
"desc",
".",
"configurable",
")",
"{",
"if",
"(",
"gui",
".",
"debug",
")",
"{",
"this",
".",
"_definePropertyItentified",
"(",
"thing",
",",
"prop",
")",
";",
"}",
"else",
"{",
"Object",
".",
"defineProperty",
"(",
"thing",
",",
"prop",
",",
"this",
".",
"DENIED",
")",
";",
"}",
"}",
"}",
"}",
"}",
"}",
"}",
"}"
] | Replace own properties with an accessor to throw an exception.
In 'gui.debug' mode we replace all props, not just own props,
so that we may fail fast on attempt to handle destructed spirit.
@TODO: keep track of non-enumerables and nuke those as well :/
@param {object} thing | [
"Replace",
"own",
"properties",
"with",
"an",
"accessor",
"to",
"throw",
"an",
"exception",
".",
"In",
"gui",
".",
"debug",
"mode",
"we",
"replace",
"all",
"props",
"not",
"just",
"own",
"props",
"so",
"that",
"we",
"may",
"fail",
"fast",
"on",
"attempt",
"to",
"handle",
"destructed",
"spirit",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L4141-L4162 |
|
49,431 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(message) {
var stack, e = new Error(
gui.GreatSpirit.DENIAL + (message ? ": " + message : "")
);
if (!gui.Client.isExplorer && (stack = e.stack)) {
if (gui.Client.isWebKit) {
stack = stack.replace(/^[^\(]+?[\n$]/gm, "").
replace(/^\s+at\s+/gm, "").
replace(/^Object.<anonymous>\s*\(/gm, "{anonymous}()@").
split("\n");
} else {
stack = stack.split("\n");
}
stack.shift();
stack.shift(); // @TODO: shift one more now?
console.warn(e.message + "\n" + stack);
} else {
console.warn(e.message);
}
} | javascript | function(message) {
var stack, e = new Error(
gui.GreatSpirit.DENIAL + (message ? ": " + message : "")
);
if (!gui.Client.isExplorer && (stack = e.stack)) {
if (gui.Client.isWebKit) {
stack = stack.replace(/^[^\(]+?[\n$]/gm, "").
replace(/^\s+at\s+/gm, "").
replace(/^Object.<anonymous>\s*\(/gm, "{anonymous}()@").
split("\n");
} else {
stack = stack.split("\n");
}
stack.shift();
stack.shift(); // @TODO: shift one more now?
console.warn(e.message + "\n" + stack);
} else {
console.warn(e.message);
}
} | [
"function",
"(",
"message",
")",
"{",
"var",
"stack",
",",
"e",
"=",
"new",
"Error",
"(",
"gui",
".",
"GreatSpirit",
".",
"DENIAL",
"+",
"(",
"message",
"?",
"\": \"",
"+",
"message",
":",
"\"\"",
")",
")",
";",
"if",
"(",
"!",
"gui",
".",
"Client",
".",
"isExplorer",
"&&",
"(",
"stack",
"=",
"e",
".",
"stack",
")",
")",
"{",
"if",
"(",
"gui",
".",
"Client",
".",
"isWebKit",
")",
"{",
"stack",
"=",
"stack",
".",
"replace",
"(",
"/",
"^[^\\(]+?[\\n$]",
"/",
"gm",
",",
"\"\"",
")",
".",
"replace",
"(",
"/",
"^\\s+at\\s+",
"/",
"gm",
",",
"\"\"",
")",
".",
"replace",
"(",
"/",
"^Object.<anonymous>\\s*\\(",
"/",
"gm",
",",
"\"{anonymous}()@\"",
")",
".",
"split",
"(",
"\"\\n\"",
")",
";",
"}",
"else",
"{",
"stack",
"=",
"stack",
".",
"split",
"(",
"\"\\n\"",
")",
";",
"}",
"stack",
".",
"shift",
"(",
")",
";",
"stack",
".",
"shift",
"(",
")",
";",
"// @TODO: shift one more now?",
"console",
".",
"warn",
"(",
"e",
".",
"message",
"+",
"\"\\n\"",
"+",
"stack",
")",
";",
"}",
"else",
"{",
"console",
".",
"warn",
"(",
"e",
".",
"message",
")",
";",
"}",
"}"
] | Obscure mechanism to include the whole stacktrace in the error message
because some kind of Selenium WebDriver can't print stack traces...
@see https://gist.github.com/jay3sh/1158940
@param @optional {String} message | [
"Obscure",
"mechanism",
"to",
"include",
"the",
"whole",
"stacktrace",
"in",
"the",
"error",
"message",
"because",
"some",
"kind",
"of",
"Selenium",
"WebDriver",
"can",
"t",
"print",
"stack",
"traces",
"..."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L4185-L4204 |
|
49,432 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(thing, prop) {
Object.defineProperty(thing, prop, {
enumerable: true,
configurable: true,
get: function() {
gui.GreatSpirit.DENY(thing);
},
set: function() {
gui.GreatSpirit.DENY(thing);
}
});
} | javascript | function(thing, prop) {
Object.defineProperty(thing, prop, {
enumerable: true,
configurable: true,
get: function() {
gui.GreatSpirit.DENY(thing);
},
set: function() {
gui.GreatSpirit.DENY(thing);
}
});
} | [
"function",
"(",
"thing",
",",
"prop",
")",
"{",
"Object",
".",
"defineProperty",
"(",
"thing",
",",
"prop",
",",
"{",
"enumerable",
":",
"true",
",",
"configurable",
":",
"true",
",",
"get",
":",
"function",
"(",
")",
"{",
"gui",
".",
"GreatSpirit",
".",
"DENY",
"(",
"thing",
")",
";",
"}",
",",
"set",
":",
"function",
"(",
")",
"{",
"gui",
".",
"GreatSpirit",
".",
"DENY",
"(",
"thing",
")",
";",
"}",
"}",
")",
";",
"}"
] | In debug mode, throw a more qualified "attempt to handle destructed spirit"
@param {object} thing
@param {String} prop | [
"In",
"debug",
"mode",
"throw",
"a",
"more",
"qualified",
"attempt",
"to",
"handle",
"destructed",
"spirit"
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L4220-L4231 |
|
49,433 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function() {
var spirit, spirits = this._spirits.slice();
if (window.gui) { // hotfix IE window unloaded scenario...
while ((spirit = spirits.shift())) {
this.$nuke(spirit);
}
this._spirits = [];
}
} | javascript | function() {
var spirit, spirits = this._spirits.slice();
if (window.gui) { // hotfix IE window unloaded scenario...
while ((spirit = spirits.shift())) {
this.$nuke(spirit);
}
this._spirits = [];
}
} | [
"function",
"(",
")",
"{",
"var",
"spirit",
",",
"spirits",
"=",
"this",
".",
"_spirits",
".",
"slice",
"(",
")",
";",
"if",
"(",
"window",
".",
"gui",
")",
"{",
"// hotfix IE window unloaded scenario...",
"while",
"(",
"(",
"spirit",
"=",
"spirits",
".",
"shift",
"(",
")",
")",
")",
"{",
"this",
".",
"$nuke",
"(",
"spirit",
")",
";",
"}",
"this",
".",
"_spirits",
"=",
"[",
"]",
";",
"}",
"}"
] | Nuke spirits now. | [
"Nuke",
"spirits",
"now",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L4236-L4244 |
|
49,434 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function() {
var that = this,
add = function(target, events, capture) {
events.split(' ').forEach(function(type) {
target.addEventListener(type, that, capture);
});
};
add(document, 'DOMContentLoaded');
add(document, 'click mousedown mouseup', true);
add(window, 'load hashchange');
if (!gui.hosted) {
add(window, 'resize orientationchange');
}
if (!(window.chrome && chrome.app && chrome.runtime)) {
add(window, 'unload');
}
/*
if (document.readyState === "complete") { // TODO: IE cornercase?
if (!this._loaded) {
this._ondom();
this._onload();
}
}
*/
} | javascript | function() {
var that = this,
add = function(target, events, capture) {
events.split(' ').forEach(function(type) {
target.addEventListener(type, that, capture);
});
};
add(document, 'DOMContentLoaded');
add(document, 'click mousedown mouseup', true);
add(window, 'load hashchange');
if (!gui.hosted) {
add(window, 'resize orientationchange');
}
if (!(window.chrome && chrome.app && chrome.runtime)) {
add(window, 'unload');
}
/*
if (document.readyState === "complete") { // TODO: IE cornercase?
if (!this._loaded) {
this._ondom();
this._onload();
}
}
*/
} | [
"function",
"(",
")",
"{",
"var",
"that",
"=",
"this",
",",
"add",
"=",
"function",
"(",
"target",
",",
"events",
",",
"capture",
")",
"{",
"events",
".",
"split",
"(",
"' '",
")",
".",
"forEach",
"(",
"function",
"(",
"type",
")",
"{",
"target",
".",
"addEventListener",
"(",
"type",
",",
"that",
",",
"capture",
")",
";",
"}",
")",
";",
"}",
";",
"add",
"(",
"document",
",",
"'DOMContentLoaded'",
")",
";",
"add",
"(",
"document",
",",
"'click mousedown mouseup'",
",",
"true",
")",
";",
"add",
"(",
"window",
",",
"'load hashchange'",
")",
";",
"if",
"(",
"!",
"gui",
".",
"hosted",
")",
"{",
"add",
"(",
"window",
",",
"'resize orientationchange'",
")",
";",
"}",
"if",
"(",
"!",
"(",
"window",
".",
"chrome",
"&&",
"chrome",
".",
"app",
"&&",
"chrome",
".",
"runtime",
")",
")",
"{",
"add",
"(",
"window",
",",
"'unload'",
")",
";",
"}",
"/*\n\t\t\tif (document.readyState === \"complete\") { // TODO: IE cornercase?\n\t\t\t\tif (!this._loaded) {\n\t\t\t\t\tthis._ondom();\n\t\t\t\t\tthis._onload();\n\t\t\t\t}\n\t\t\t}\n\t\t\t*/",
"}"
] | Setup loads of event listeners. | [
"Setup",
"loads",
"of",
"event",
"listeners",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L4288-L4313 |
|
49,435 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function() {
this._loaded = true;
dobrodcast(gui.BROADCAST_TOLOAD, gui.BROADCAST_ONLOAD);
doaction(gui.ACTION_DOC_ONLOAD, location.href);
} | javascript | function() {
this._loaded = true;
dobrodcast(gui.BROADCAST_TOLOAD, gui.BROADCAST_ONLOAD);
doaction(gui.ACTION_DOC_ONLOAD, location.href);
} | [
"function",
"(",
")",
"{",
"this",
".",
"_loaded",
"=",
"true",
";",
"dobrodcast",
"(",
"gui",
".",
"BROADCAST_TOLOAD",
",",
"gui",
".",
"BROADCAST_ONLOAD",
")",
";",
"doaction",
"(",
"gui",
".",
"ACTION_DOC_ONLOAD",
",",
"location",
".",
"href",
")",
";",
"}"
] | Dispatch `load` event to hosting document. | [
"Dispatch",
"load",
"event",
"to",
"hosting",
"document",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L4399-L4403 |
|
49,436 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function() {
if (!gui.hosted) {
clearTimeout(this._timeout);
this._timeout = setTimeout(function() {
gui.broadcastGlobal(gui.BROADCAST_RESIZE_END);
}, gui.TIMEOUT_RESIZE_END);
}
} | javascript | function() {
if (!gui.hosted) {
clearTimeout(this._timeout);
this._timeout = setTimeout(function() {
gui.broadcastGlobal(gui.BROADCAST_RESIZE_END);
}, gui.TIMEOUT_RESIZE_END);
}
} | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"gui",
".",
"hosted",
")",
"{",
"clearTimeout",
"(",
"this",
".",
"_timeout",
")",
";",
"this",
".",
"_timeout",
"=",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"gui",
".",
"broadcastGlobal",
"(",
"gui",
".",
"BROADCAST_RESIZE_END",
")",
";",
"}",
",",
"gui",
".",
"TIMEOUT_RESIZE_END",
")",
";",
"}",
"}"
] | Intensive resize procedures should subscribe
to the resize-end message as broadcasted here. | [
"Intensive",
"resize",
"procedures",
"should",
"subscribe",
"to",
"the",
"resize",
"-",
"end",
"message",
"as",
"broadcasted",
"here",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L4440-L4447 |
|
49,437 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(spaces) {
var prop, def, metas = document.querySelectorAll('meta[name]');
Array.forEach(metas, function(meta) {
prop = meta.getAttribute('name');
spaces.forEach(function(ns) {
if (prop.startsWith(ns + '.')) {
def = gui.Object.lookup(prop);
if (gui.Type.isDefined(def)) {
gui.Object.assert(prop,
gui.Type.cast(meta.getAttribute('content'))
);
} else {
console.error('No definition for "' + prop + '"');
}
}
});
});
} | javascript | function(spaces) {
var prop, def, metas = document.querySelectorAll('meta[name]');
Array.forEach(metas, function(meta) {
prop = meta.getAttribute('name');
spaces.forEach(function(ns) {
if (prop.startsWith(ns + '.')) {
def = gui.Object.lookup(prop);
if (gui.Type.isDefined(def)) {
gui.Object.assert(prop,
gui.Type.cast(meta.getAttribute('content'))
);
} else {
console.error('No definition for "' + prop + '"');
}
}
});
});
} | [
"function",
"(",
"spaces",
")",
"{",
"var",
"prop",
",",
"def",
",",
"metas",
"=",
"document",
".",
"querySelectorAll",
"(",
"'meta[name]'",
")",
";",
"Array",
".",
"forEach",
"(",
"metas",
",",
"function",
"(",
"meta",
")",
"{",
"prop",
"=",
"meta",
".",
"getAttribute",
"(",
"'name'",
")",
";",
"spaces",
".",
"forEach",
"(",
"function",
"(",
"ns",
")",
"{",
"if",
"(",
"prop",
".",
"startsWith",
"(",
"ns",
"+",
"'.'",
")",
")",
"{",
"def",
"=",
"gui",
".",
"Object",
".",
"lookup",
"(",
"prop",
")",
";",
"if",
"(",
"gui",
".",
"Type",
".",
"isDefined",
"(",
"def",
")",
")",
"{",
"gui",
".",
"Object",
".",
"assert",
"(",
"prop",
",",
"gui",
".",
"Type",
".",
"cast",
"(",
"meta",
".",
"getAttribute",
"(",
"'content'",
")",
")",
")",
";",
"}",
"else",
"{",
"console",
".",
"error",
"(",
"'No definition for \"'",
"+",
"prop",
"+",
"'\"'",
")",
";",
"}",
"}",
"}",
")",
";",
"}",
")",
";",
"}"
] | Resolve metatags that appear to
configure stuff in namespaces.
@param {Array<string>} spaces | [
"Resolve",
"metatags",
"that",
"appear",
"to",
"configure",
"stuff",
"in",
"namespaces",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L4465-L4482 |
|
49,438 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(callback, thisp) {
this._callback = callback ? callback : null;
this._pointer = thisp ? thisp : null;
if (this._now) {
this.now();
}
} | javascript | function(callback, thisp) {
this._callback = callback ? callback : null;
this._pointer = thisp ? thisp : null;
if (this._now) {
this.now();
}
} | [
"function",
"(",
"callback",
",",
"thisp",
")",
"{",
"this",
".",
"_callback",
"=",
"callback",
"?",
"callback",
":",
"null",
";",
"this",
".",
"_pointer",
"=",
"thisp",
"?",
"thisp",
":",
"null",
";",
"if",
"(",
"this",
".",
"_now",
")",
"{",
"this",
".",
"now",
"(",
")",
";",
"}",
"}"
] | Setup callback with optional this-pointer.
@param {function} callback
@param @optional {object} pointer | [
"Setup",
"callback",
"with",
"optional",
"this",
"-",
"pointer",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L4894-L4900 |
|
49,439 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function() {
var c = this._callback;
var p = this._pointer;
if (c) {
this.then(null, null);
c.apply(p, arguments);
} else {
this._now = true;
}
} | javascript | function() {
var c = this._callback;
var p = this._pointer;
if (c) {
this.then(null, null);
c.apply(p, arguments);
} else {
this._now = true;
}
} | [
"function",
"(",
")",
"{",
"var",
"c",
"=",
"this",
".",
"_callback",
";",
"var",
"p",
"=",
"this",
".",
"_pointer",
";",
"if",
"(",
"c",
")",
"{",
"this",
".",
"then",
"(",
"null",
",",
"null",
")",
";",
"c",
".",
"apply",
"(",
"p",
",",
"arguments",
")",
";",
"}",
"else",
"{",
"this",
".",
"_now",
"=",
"true",
";",
"}",
"}"
] | Callback with optional this-pointer.
@returns {object} | [
"Callback",
"with",
"optional",
"this",
"-",
"pointer",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L4906-L4915 |
|
49,440 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(markup, targetdoc) {
return this.parseToNodes(markup, targetdoc).filter(function(node) {
return node.nodeType === Node.ELEMENT_NODE;
});
} | javascript | function(markup, targetdoc) {
return this.parseToNodes(markup, targetdoc).filter(function(node) {
return node.nodeType === Node.ELEMENT_NODE;
});
} | [
"function",
"(",
"markup",
",",
"targetdoc",
")",
"{",
"return",
"this",
".",
"parseToNodes",
"(",
"markup",
",",
"targetdoc",
")",
".",
"filter",
"(",
"function",
"(",
"node",
")",
"{",
"return",
"node",
".",
"nodeType",
"===",
"Node",
".",
"ELEMENT_NODE",
";",
"}",
")",
";",
"}"
] | Parse to array of one or more elements.
@param {String} markup
@param @optional {Document} targetdoc
@returns {Array<Element>} | [
"Parse",
"to",
"array",
"of",
"one",
"or",
"more",
"elements",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L4972-L4976 |
|
49,441 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(markup, targetdoc) {
var elm, doc = this._document ||
(this._document = document.implementation.createHTMLDocument(""));
return gui.Guide.suspend(function() {
doc.body.innerHTML = this._unsanitize(markup);
elm = doc.querySelector("." + this._classname) || doc.body;
return Array.map(elm.childNodes, function(node) {
return (targetdoc || document).importNode(node, true);
});
}, this);
} | javascript | function(markup, targetdoc) {
var elm, doc = this._document ||
(this._document = document.implementation.createHTMLDocument(""));
return gui.Guide.suspend(function() {
doc.body.innerHTML = this._unsanitize(markup);
elm = doc.querySelector("." + this._classname) || doc.body;
return Array.map(elm.childNodes, function(node) {
return (targetdoc || document).importNode(node, true);
});
}, this);
} | [
"function",
"(",
"markup",
",",
"targetdoc",
")",
"{",
"var",
"elm",
",",
"doc",
"=",
"this",
".",
"_document",
"||",
"(",
"this",
".",
"_document",
"=",
"document",
".",
"implementation",
".",
"createHTMLDocument",
"(",
"\"\"",
")",
")",
";",
"return",
"gui",
".",
"Guide",
".",
"suspend",
"(",
"function",
"(",
")",
"{",
"doc",
".",
"body",
".",
"innerHTML",
"=",
"this",
".",
"_unsanitize",
"(",
"markup",
")",
";",
"elm",
"=",
"doc",
".",
"querySelector",
"(",
"\".\"",
"+",
"this",
".",
"_classname",
")",
"||",
"doc",
".",
"body",
";",
"return",
"Array",
".",
"map",
"(",
"elm",
".",
"childNodes",
",",
"function",
"(",
"node",
")",
"{",
"return",
"(",
"targetdoc",
"||",
"document",
")",
".",
"importNode",
"(",
"node",
",",
"true",
")",
";",
"}",
")",
";",
"}",
",",
"this",
")",
";",
"}"
] | Parse to array of one or more nodes.
@param {String} markup
@param @optional {Document} targetdoc
@returns {Array<Node>} | [
"Parse",
"to",
"array",
"of",
"one",
"or",
"more",
"nodes",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L4994-L5004 |
|
49,442 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(markup) {
markup = markup || "";
return gui.Guide.suspend(function() {
var doc = document.implementation.createHTMLDocument("");
if (markup.toLowerCase().contains("<!doctype")) {
try {
doc.documentElement.innerHTML = markup;
} catch (ie9exception) {
doc = new ActiveXObject("htmlfile");
doc.open();
doc.write(markup);
doc.close();
}
} else {
doc.body.innerHTML = markup;
}
return doc;
});
} | javascript | function(markup) {
markup = markup || "";
return gui.Guide.suspend(function() {
var doc = document.implementation.createHTMLDocument("");
if (markup.toLowerCase().contains("<!doctype")) {
try {
doc.documentElement.innerHTML = markup;
} catch (ie9exception) {
doc = new ActiveXObject("htmlfile");
doc.open();
doc.write(markup);
doc.close();
}
} else {
doc.body.innerHTML = markup;
}
return doc;
});
} | [
"function",
"(",
"markup",
")",
"{",
"markup",
"=",
"markup",
"||",
"\"\"",
";",
"return",
"gui",
".",
"Guide",
".",
"suspend",
"(",
"function",
"(",
")",
"{",
"var",
"doc",
"=",
"document",
".",
"implementation",
".",
"createHTMLDocument",
"(",
"\"\"",
")",
";",
"if",
"(",
"markup",
".",
"toLowerCase",
"(",
")",
".",
"contains",
"(",
"\"<!doctype\"",
")",
")",
"{",
"try",
"{",
"doc",
".",
"documentElement",
".",
"innerHTML",
"=",
"markup",
";",
"}",
"catch",
"(",
"ie9exception",
")",
"{",
"doc",
"=",
"new",
"ActiveXObject",
"(",
"\"htmlfile\"",
")",
";",
"doc",
".",
"open",
"(",
")",
";",
"doc",
".",
"write",
"(",
"markup",
")",
";",
"doc",
".",
"close",
"(",
")",
";",
"}",
"}",
"else",
"{",
"doc",
".",
"body",
".",
"innerHTML",
"=",
"markup",
";",
"}",
"return",
"doc",
";",
"}",
")",
";",
"}"
] | Parse to document. Bear in mind that the
document.defaultView of this thing is null.
@TODO: Use DOMParser for text/html supporters
@param {String} markup
@returns {HTMLDocument} | [
"Parse",
"to",
"document",
".",
"Bear",
"in",
"mind",
"that",
"the",
"document",
".",
"defaultView",
"of",
"this",
"thing",
"is",
"null",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L5013-L5031 |
|
49,443 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(markup) {
var match, fix;
markup = markup.trim().replace(this._comments, "");
if ((match = markup.match(this._firsttag))) {
if ((fix = this._unsanestructures[match[1]])) {
markup = fix.
replace("${class}", this._classname).
replace("${markup}", markup);
}
}
return markup;
} | javascript | function(markup) {
var match, fix;
markup = markup.trim().replace(this._comments, "");
if ((match = markup.match(this._firsttag))) {
if ((fix = this._unsanestructures[match[1]])) {
markup = fix.
replace("${class}", this._classname).
replace("${markup}", markup);
}
}
return markup;
} | [
"function",
"(",
"markup",
")",
"{",
"var",
"match",
",",
"fix",
";",
"markup",
"=",
"markup",
".",
"trim",
"(",
")",
".",
"replace",
"(",
"this",
".",
"_comments",
",",
"\"\"",
")",
";",
"if",
"(",
"(",
"match",
"=",
"markup",
".",
"match",
"(",
"this",
".",
"_firsttag",
")",
")",
")",
"{",
"if",
"(",
"(",
"fix",
"=",
"this",
".",
"_unsanestructures",
"[",
"match",
"[",
"1",
"]",
"]",
")",
")",
"{",
"markup",
"=",
"fix",
".",
"replace",
"(",
"\"${class}\"",
",",
"this",
".",
"_classname",
")",
".",
"replace",
"(",
"\"${markup}\"",
",",
"markup",
")",
";",
"}",
"}",
"return",
"markup",
";",
"}"
] | Some elements must be created in obscure markup
structures in order to be rendered correctly.
@param {String} markup
@returns {String} | [
"Some",
"elements",
"must",
"be",
"created",
"in",
"obscure",
"markup",
"structures",
"in",
"order",
"to",
"be",
"rendered",
"correctly",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L5067-L5078 |
|
49,444 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(start, handler) {
this.direction = gui.Crawler.ASCENDING;
var supports = gui.hasModule('[email protected]');
var isspirit = supports && start instanceof gui.Spirit;
var win, elm = isspirit ? start.element : start;
do {
if (elm.nodeType === Node.DOCUMENT_NODE) {
if (this.global) {
win = elm.defaultView;
if (win.gui.hosted) { // win.parent !== win
/*
* @TODO: iframed document might have navigated elsewhere, stamp this in localstorage
* @TODO: sit down and wonder if localstorage is even available in sandboxed iframes...
*/
if (win.gui.xhost) {
elm = null;
if (gui.Type.isFunction(handler.transcend)) {
handler.transcend(win.parent, win.gui.xhost, win.gui.$contextid);
}
} else {
elm = win.frameElement;
}
} else {
elm = null;
}
} else {
elm = null;
}
}
if (elm) {
var directive = this._handleElement(elm, handler);
switch (directive) {
case gui.Crawler.STOP:
elm = null;
break;
default:
elm = elm.parentNode;
break;
}
}
} while (elm);
} | javascript | function(start, handler) {
this.direction = gui.Crawler.ASCENDING;
var supports = gui.hasModule('[email protected]');
var isspirit = supports && start instanceof gui.Spirit;
var win, elm = isspirit ? start.element : start;
do {
if (elm.nodeType === Node.DOCUMENT_NODE) {
if (this.global) {
win = elm.defaultView;
if (win.gui.hosted) { // win.parent !== win
/*
* @TODO: iframed document might have navigated elsewhere, stamp this in localstorage
* @TODO: sit down and wonder if localstorage is even available in sandboxed iframes...
*/
if (win.gui.xhost) {
elm = null;
if (gui.Type.isFunction(handler.transcend)) {
handler.transcend(win.parent, win.gui.xhost, win.gui.$contextid);
}
} else {
elm = win.frameElement;
}
} else {
elm = null;
}
} else {
elm = null;
}
}
if (elm) {
var directive = this._handleElement(elm, handler);
switch (directive) {
case gui.Crawler.STOP:
elm = null;
break;
default:
elm = elm.parentNode;
break;
}
}
} while (elm);
} | [
"function",
"(",
"start",
",",
"handler",
")",
"{",
"this",
".",
"direction",
"=",
"gui",
".",
"Crawler",
".",
"ASCENDING",
";",
"var",
"supports",
"=",
"gui",
".",
"hasModule",
"(",
"'[email protected]'",
")",
";",
"var",
"isspirit",
"=",
"supports",
"&&",
"start",
"instanceof",
"gui",
".",
"Spirit",
";",
"var",
"win",
",",
"elm",
"=",
"isspirit",
"?",
"start",
".",
"element",
":",
"start",
";",
"do",
"{",
"if",
"(",
"elm",
".",
"nodeType",
"===",
"Node",
".",
"DOCUMENT_NODE",
")",
"{",
"if",
"(",
"this",
".",
"global",
")",
"{",
"win",
"=",
"elm",
".",
"defaultView",
";",
"if",
"(",
"win",
".",
"gui",
".",
"hosted",
")",
"{",
"// win.parent !== win",
"/*\n\t\t\t\t\t\t * @TODO: iframed document might have navigated elsewhere, stamp this in localstorage\n\t\t\t\t\t\t * @TODO: sit down and wonder if localstorage is even available in sandboxed iframes...\n\t\t\t\t\t\t */",
"if",
"(",
"win",
".",
"gui",
".",
"xhost",
")",
"{",
"elm",
"=",
"null",
";",
"if",
"(",
"gui",
".",
"Type",
".",
"isFunction",
"(",
"handler",
".",
"transcend",
")",
")",
"{",
"handler",
".",
"transcend",
"(",
"win",
".",
"parent",
",",
"win",
".",
"gui",
".",
"xhost",
",",
"win",
".",
"gui",
".",
"$contextid",
")",
";",
"}",
"}",
"else",
"{",
"elm",
"=",
"win",
".",
"frameElement",
";",
"}",
"}",
"else",
"{",
"elm",
"=",
"null",
";",
"}",
"}",
"else",
"{",
"elm",
"=",
"null",
";",
"}",
"}",
"if",
"(",
"elm",
")",
"{",
"var",
"directive",
"=",
"this",
".",
"_handleElement",
"(",
"elm",
",",
"handler",
")",
";",
"switch",
"(",
"directive",
")",
"{",
"case",
"gui",
".",
"Crawler",
".",
"STOP",
":",
"elm",
"=",
"null",
";",
"break",
";",
"default",
":",
"elm",
"=",
"elm",
".",
"parentNode",
";",
"break",
";",
"}",
"}",
"}",
"while",
"(",
"elm",
")",
";",
"}"
] | Crawl DOM ascending.
@param {Element|gui.Spirit} start
@param {object} handler | [
"Crawl",
"DOM",
"ascending",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L5224-L5265 |
|
49,445 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(start, handler, arg) {
this.direction = gui.Crawler.DESCENDING;
var elm = start instanceof gui.Spirit ? start.element : start;
if (elm.nodeType === Node.DOCUMENT_NODE) {
elm = elm.documentElement;
}
this._descend(elm, handler, arg, true);
} | javascript | function(start, handler, arg) {
this.direction = gui.Crawler.DESCENDING;
var elm = start instanceof gui.Spirit ? start.element : start;
if (elm.nodeType === Node.DOCUMENT_NODE) {
elm = elm.documentElement;
}
this._descend(elm, handler, arg, true);
} | [
"function",
"(",
"start",
",",
"handler",
",",
"arg",
")",
"{",
"this",
".",
"direction",
"=",
"gui",
".",
"Crawler",
".",
"DESCENDING",
";",
"var",
"elm",
"=",
"start",
"instanceof",
"gui",
".",
"Spirit",
"?",
"start",
".",
"element",
":",
"start",
";",
"if",
"(",
"elm",
".",
"nodeType",
"===",
"Node",
".",
"DOCUMENT_NODE",
")",
"{",
"elm",
"=",
"elm",
".",
"documentElement",
";",
"}",
"this",
".",
"_descend",
"(",
"elm",
",",
"handler",
",",
"arg",
",",
"true",
")",
";",
"}"
] | Crawl DOM descending.
@param {object} start Spirit or Element
@param {object} handler
@param @optional {object} arg @TODO: is this even supported? | [
"Crawl",
"DOM",
"descending",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L5284-L5291 |
|
49,446 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(start, handler, arg) {
this.global = true;
this.descend(start, handler, arg);
this.global = false;
} | javascript | function(start, handler, arg) {
this.global = true;
this.descend(start, handler, arg);
this.global = false;
} | [
"function",
"(",
"start",
",",
"handler",
",",
"arg",
")",
"{",
"this",
".",
"global",
"=",
"true",
";",
"this",
".",
"descend",
"(",
"start",
",",
"handler",
",",
"arg",
")",
";",
"this",
".",
"global",
"=",
"false",
";",
"}"
] | Crawl DOM descending, transcend into iframes.
@param {object} start Spirit or Element
@param {object} handler
@param @optional {object} arg @TODO: is this even supported? | [
"Crawl",
"DOM",
"descending",
"transcend",
"into",
"iframes",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L5299-L5303 |
|
49,447 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(element, handler, arg) {
var hasspirit = gui.hasModule('[email protected]');
var directive = gui.Crawler.CONTINUE;
var spirit = hasspirit ? element.spirit : null;
if (spirit) {
directive = spirit.oncrawler(this);
}
if (!directive) {
if (handler) {
if (gui.Type.isFunction(handler.handleElement)) {
directive = handler.handleElement(element, arg);
}
if (directive !== gui.Crawler.STOP) {
if (spirit && gui.Type.isFunction(handler.handleSpirit)) {
directive = this._handleSpirit(spirit, handler);
}
}
}
}
if (!directive) {
directive = gui.Crawler.CONTINUE;
}
return directive;
} | javascript | function(element, handler, arg) {
var hasspirit = gui.hasModule('[email protected]');
var directive = gui.Crawler.CONTINUE;
var spirit = hasspirit ? element.spirit : null;
if (spirit) {
directive = spirit.oncrawler(this);
}
if (!directive) {
if (handler) {
if (gui.Type.isFunction(handler.handleElement)) {
directive = handler.handleElement(element, arg);
}
if (directive !== gui.Crawler.STOP) {
if (spirit && gui.Type.isFunction(handler.handleSpirit)) {
directive = this._handleSpirit(spirit, handler);
}
}
}
}
if (!directive) {
directive = gui.Crawler.CONTINUE;
}
return directive;
} | [
"function",
"(",
"element",
",",
"handler",
",",
"arg",
")",
"{",
"var",
"hasspirit",
"=",
"gui",
".",
"hasModule",
"(",
"'[email protected]'",
")",
";",
"var",
"directive",
"=",
"gui",
".",
"Crawler",
".",
"CONTINUE",
";",
"var",
"spirit",
"=",
"hasspirit",
"?",
"element",
".",
"spirit",
":",
"null",
";",
"if",
"(",
"spirit",
")",
"{",
"directive",
"=",
"spirit",
".",
"oncrawler",
"(",
"this",
")",
";",
"}",
"if",
"(",
"!",
"directive",
")",
"{",
"if",
"(",
"handler",
")",
"{",
"if",
"(",
"gui",
".",
"Type",
".",
"isFunction",
"(",
"handler",
".",
"handleElement",
")",
")",
"{",
"directive",
"=",
"handler",
".",
"handleElement",
"(",
"element",
",",
"arg",
")",
";",
"}",
"if",
"(",
"directive",
"!==",
"gui",
".",
"Crawler",
".",
"STOP",
")",
"{",
"if",
"(",
"spirit",
"&&",
"gui",
".",
"Type",
".",
"isFunction",
"(",
"handler",
".",
"handleSpirit",
")",
")",
"{",
"directive",
"=",
"this",
".",
"_handleSpirit",
"(",
"spirit",
",",
"handler",
")",
";",
"}",
"}",
"}",
"}",
"if",
"(",
"!",
"directive",
")",
"{",
"directive",
"=",
"gui",
".",
"Crawler",
".",
"CONTINUE",
";",
"}",
"return",
"directive",
";",
"}"
] | Handle element. Invoked by both ascending and descending crawler.
@param {Element} element
@param {object} handler
@returns {number} directive | [
"Handle",
"element",
".",
"Invoked",
"by",
"both",
"ascending",
"and",
"descending",
"crawler",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L5354-L5377 |
|
49,448 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(text) {
var result = text;
try {
switch (this._headers.Accept) {
case "application/json":
result = JSON.parse(text);
break;
case "text/xml":
result = new DOMParser().parseFromString(text, "text/xml");
break;
}
} catch (exception) {
if (gui.debug) {
console.error(
this._headers.Accept + " dysfunction at " + this._url
);
}
}
return result;
} | javascript | function(text) {
var result = text;
try {
switch (this._headers.Accept) {
case "application/json":
result = JSON.parse(text);
break;
case "text/xml":
result = new DOMParser().parseFromString(text, "text/xml");
break;
}
} catch (exception) {
if (gui.debug) {
console.error(
this._headers.Accept + " dysfunction at " + this._url
);
}
}
return result;
} | [
"function",
"(",
"text",
")",
"{",
"var",
"result",
"=",
"text",
";",
"try",
"{",
"switch",
"(",
"this",
".",
"_headers",
".",
"Accept",
")",
"{",
"case",
"\"application/json\"",
":",
"result",
"=",
"JSON",
".",
"parse",
"(",
"text",
")",
";",
"break",
";",
"case",
"\"text/xml\"",
":",
"result",
"=",
"new",
"DOMParser",
"(",
")",
".",
"parseFromString",
"(",
"text",
",",
"\"text/xml\"",
")",
";",
"break",
";",
"}",
"}",
"catch",
"(",
"exception",
")",
"{",
"if",
"(",
"gui",
".",
"debug",
")",
"{",
"console",
".",
"error",
"(",
"this",
".",
"_headers",
".",
"Accept",
"+",
"\" dysfunction at \"",
"+",
"this",
".",
"_url",
")",
";",
"}",
"}",
"return",
"result",
";",
"}"
] | Parse response to expected type.
@param {String} text
@returns {object} | [
"Parse",
"response",
"to",
"expected",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L5581-L5600 |
|
49,449 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | supports | function supports(feature) {
var root = document.documentElement;
var fixt = feature[0].toUpperCase() + feature.substring(1);
return !["", "Webkit", "Moz", "O", "ms"].every(function(prefix) {
return root.style[prefix ? prefix + fixt : feature] === undefined;
});
} | javascript | function supports(feature) {
var root = document.documentElement;
var fixt = feature[0].toUpperCase() + feature.substring(1);
return !["", "Webkit", "Moz", "O", "ms"].every(function(prefix) {
return root.style[prefix ? prefix + fixt : feature] === undefined;
});
} | [
"function",
"supports",
"(",
"feature",
")",
"{",
"var",
"root",
"=",
"document",
".",
"documentElement",
";",
"var",
"fixt",
"=",
"feature",
"[",
"0",
"]",
".",
"toUpperCase",
"(",
")",
"+",
"feature",
".",
"substring",
"(",
"1",
")",
";",
"return",
"!",
"[",
"\"\"",
",",
"\"Webkit\"",
",",
"\"Moz\"",
",",
"\"O\"",
",",
"\"ms\"",
"]",
".",
"every",
"(",
"function",
"(",
"prefix",
")",
"{",
"return",
"root",
".",
"style",
"[",
"prefix",
"?",
"prefix",
"+",
"fixt",
":",
"feature",
"]",
"===",
"undefined",
";",
"}",
")",
";",
"}"
] | Supports CSS feature?
@param {String} feature
@returns {boolean} | [
"Supports",
"CSS",
"feature?"
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L5639-L5645 |
49,450 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(elm) {
var res = null;
if (elm.nodeType === Node.ELEMENT_NODE) {
var doc = elm.ownerDocument;
var win = doc.defaultView;
if (win.gui) {
if (win.gui.attributes.every(function(fix) {
res = this._evaluateinline(elm, win, fix);
return res === null;
}, this)) {
if (gui.hasChannels()) {
win.gui._channels.every(function(def) {
var select = def[0];
var spirit = def[1];
if (gui.CSSPlugin.matches(elm, select)) {
res = spirit;
}
return res === null;
}, this);
}
}
}
}
return res;
} | javascript | function(elm) {
var res = null;
if (elm.nodeType === Node.ELEMENT_NODE) {
var doc = elm.ownerDocument;
var win = doc.defaultView;
if (win.gui) {
if (win.gui.attributes.every(function(fix) {
res = this._evaluateinline(elm, win, fix);
return res === null;
}, this)) {
if (gui.hasChannels()) {
win.gui._channels.every(function(def) {
var select = def[0];
var spirit = def[1];
if (gui.CSSPlugin.matches(elm, select)) {
res = spirit;
}
return res === null;
}, this);
}
}
}
}
return res;
} | [
"function",
"(",
"elm",
")",
"{",
"var",
"res",
"=",
"null",
";",
"if",
"(",
"elm",
".",
"nodeType",
"===",
"Node",
".",
"ELEMENT_NODE",
")",
"{",
"var",
"doc",
"=",
"elm",
".",
"ownerDocument",
";",
"var",
"win",
"=",
"doc",
".",
"defaultView",
";",
"if",
"(",
"win",
".",
"gui",
")",
"{",
"if",
"(",
"win",
".",
"gui",
".",
"attributes",
".",
"every",
"(",
"function",
"(",
"fix",
")",
"{",
"res",
"=",
"this",
".",
"_evaluateinline",
"(",
"elm",
",",
"win",
",",
"fix",
")",
";",
"return",
"res",
"===",
"null",
";",
"}",
",",
"this",
")",
")",
"{",
"if",
"(",
"gui",
".",
"hasChannels",
"(",
")",
")",
"{",
"win",
".",
"gui",
".",
"_channels",
".",
"every",
"(",
"function",
"(",
"def",
")",
"{",
"var",
"select",
"=",
"def",
"[",
"0",
"]",
";",
"var",
"spirit",
"=",
"def",
"[",
"1",
"]",
";",
"if",
"(",
"gui",
".",
"CSSPlugin",
".",
"matches",
"(",
"elm",
",",
"select",
")",
")",
"{",
"res",
"=",
"spirit",
";",
"}",
"return",
"res",
"===",
"null",
";",
"}",
",",
"this",
")",
";",
"}",
"}",
"}",
"}",
"return",
"res",
";",
"}"
] | Get Spirit constructor for element.
1. Test for element `gui` attribute(s)
2. Test if element matches selectors
@param {Element} element
@returns {function} Spirit constructor | [
"Get",
"Spirit",
"constructor",
"for",
"element",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L6178-L6202 |
|
49,451 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(spirit) {
var all = this._spirits;
var key = spirit.$instanceid;
delete all.inside[key];
delete all.outside[key];
this._stoptracking(spirit);
} | javascript | function(spirit) {
var all = this._spirits;
var key = spirit.$instanceid;
delete all.inside[key];
delete all.outside[key];
this._stoptracking(spirit);
} | [
"function",
"(",
"spirit",
")",
"{",
"var",
"all",
"=",
"this",
".",
"_spirits",
";",
"var",
"key",
"=",
"spirit",
".",
"$instanceid",
";",
"delete",
"all",
".",
"inside",
"[",
"key",
"]",
";",
"delete",
"all",
".",
"outside",
"[",
"key",
"]",
";",
"this",
".",
"_stoptracking",
"(",
"spirit",
")",
";",
"}"
] | Stop tracking the spirit.
@param {gui.Spirit} spirit | [
"Stop",
"tracking",
"the",
"spirit",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L6220-L6226 |
|
49,452 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function() {
this.spiritualized = true;
var list = this._readycallbacks;
if (list) {
while (list.length) {
list.shift()();
}
this._readycallbacks = null;
}
} | javascript | function() {
this.spiritualized = true;
var list = this._readycallbacks;
if (list) {
while (list.length) {
list.shift()();
}
this._readycallbacks = null;
}
} | [
"function",
"(",
")",
"{",
"this",
".",
"spiritualized",
"=",
"true",
";",
"var",
"list",
"=",
"this",
".",
"_readycallbacks",
";",
"if",
"(",
"list",
")",
"{",
"while",
"(",
"list",
".",
"length",
")",
"{",
"list",
".",
"shift",
"(",
")",
"(",
")",
";",
"}",
"this",
".",
"_readycallbacks",
"=",
"null",
";",
"}",
"}"
] | Initial spirits are ready.
Run accumulated callbacks. | [
"Initial",
"spirits",
"are",
"ready",
".",
"Run",
"accumulated",
"callbacks",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L6397-L6406 |
|
49,453 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(action) {
var list = this._trackedtypes[action.type];
if (list) {
list.forEach(function(checks) {
var handler = checks[0];
var matches = checks[1] === action.global;
var hacking = handler === this.spirit && this.$handleownaction;
if (matches && (handler !== action.target || hacking)) {
handler.onaction(action);
}
}, this);
}
} | javascript | function(action) {
var list = this._trackedtypes[action.type];
if (list) {
list.forEach(function(checks) {
var handler = checks[0];
var matches = checks[1] === action.global;
var hacking = handler === this.spirit && this.$handleownaction;
if (matches && (handler !== action.target || hacking)) {
handler.onaction(action);
}
}, this);
}
} | [
"function",
"(",
"action",
")",
"{",
"var",
"list",
"=",
"this",
".",
"_trackedtypes",
"[",
"action",
".",
"type",
"]",
";",
"if",
"(",
"list",
")",
"{",
"list",
".",
"forEach",
"(",
"function",
"(",
"checks",
")",
"{",
"var",
"handler",
"=",
"checks",
"[",
"0",
"]",
";",
"var",
"matches",
"=",
"checks",
"[",
"1",
"]",
"===",
"action",
".",
"global",
";",
"var",
"hacking",
"=",
"handler",
"===",
"this",
".",
"spirit",
"&&",
"this",
".",
"$handleownaction",
";",
"if",
"(",
"matches",
"&&",
"(",
"handler",
"!==",
"action",
".",
"target",
"||",
"hacking",
")",
")",
"{",
"handler",
".",
"onaction",
"(",
"action",
")",
";",
"}",
"}",
",",
"this",
")",
";",
"}",
"}"
] | Handle action. If it matches listeners, the action will be
delegated to the spirit. Called by crawler in `gui.Action`.
@see {gui.Action#dispatch}
@param {gui.Action} action | [
"Handle",
"action",
".",
"If",
"it",
"matches",
"listeners",
"the",
"action",
"will",
"be",
"delegated",
"to",
"the",
"spirit",
".",
"Called",
"by",
"crawler",
"in",
"gui",
".",
"Action",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L6672-L6684 |
|
49,454 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(action, time, thisp) {
return gui.Tick.time(action, time, thisp || this.spirit);
} | javascript | function(action, time, thisp) {
return gui.Tick.time(action, time, thisp || this.spirit);
} | [
"function",
"(",
"action",
",",
"time",
",",
"thisp",
")",
"{",
"return",
"gui",
".",
"Tick",
".",
"time",
"(",
"action",
",",
"time",
",",
"thisp",
"||",
"this",
".",
"spirit",
")",
";",
"}"
] | Schedule timeout.
@param {function} action
@param {number} time
@param @optional {object|function} thisp
@returns {number} | [
"Schedule",
"timeout",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L6936-L6938 |
|
49,455 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type, handler, one) {
var sig = this.spirit.$contextid;
if (one) {
if (this._global) {
gui.Tick.oneGlobal(type, handler);
} else {
gui.Tick.one(type, handler, sig);
}
} else {
if (this._global) {
gui.Tick.addGlobal(type, handler);
} else {
gui.Tick.add(type, handler, sig);
}
}
} | javascript | function(type, handler, one) {
var sig = this.spirit.$contextid;
if (one) {
if (this._global) {
gui.Tick.oneGlobal(type, handler);
} else {
gui.Tick.one(type, handler, sig);
}
} else {
if (this._global) {
gui.Tick.addGlobal(type, handler);
} else {
gui.Tick.add(type, handler, sig);
}
}
} | [
"function",
"(",
"type",
",",
"handler",
",",
"one",
")",
"{",
"var",
"sig",
"=",
"this",
".",
"spirit",
".",
"$contextid",
";",
"if",
"(",
"one",
")",
"{",
"if",
"(",
"this",
".",
"_global",
")",
"{",
"gui",
".",
"Tick",
".",
"oneGlobal",
"(",
"type",
",",
"handler",
")",
";",
"}",
"else",
"{",
"gui",
".",
"Tick",
".",
"one",
"(",
"type",
",",
"handler",
",",
"sig",
")",
";",
"}",
"}",
"else",
"{",
"if",
"(",
"this",
".",
"_global",
")",
"{",
"gui",
".",
"Tick",
".",
"addGlobal",
"(",
"type",
",",
"handler",
")",
";",
"}",
"else",
"{",
"gui",
".",
"Tick",
".",
"add",
"(",
"type",
",",
"handler",
",",
"sig",
")",
";",
"}",
"}",
"}"
] | Add handler.
@param {String} type
@param {object|function} handler
@param {boolean} one | [
"Add",
"handler",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L6990-L7005 |
|
49,456 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type, handler) {
var sig = this.spirit.$contextid;
if (this._global) {
gui.Tick.removeGlobal(type, handler);
} else {
gui.Tick.remove(type, handler, sig);
}
} | javascript | function(type, handler) {
var sig = this.spirit.$contextid;
if (this._global) {
gui.Tick.removeGlobal(type, handler);
} else {
gui.Tick.remove(type, handler, sig);
}
} | [
"function",
"(",
"type",
",",
"handler",
")",
"{",
"var",
"sig",
"=",
"this",
".",
"spirit",
".",
"$contextid",
";",
"if",
"(",
"this",
".",
"_global",
")",
"{",
"gui",
".",
"Tick",
".",
"removeGlobal",
"(",
"type",
",",
"handler",
")",
";",
"}",
"else",
"{",
"gui",
".",
"Tick",
".",
"remove",
"(",
"type",
",",
"handler",
",",
"sig",
")",
";",
"}",
"}"
] | Remove handler.
@param {String} type
@param {object|function} handler | [
"Remove",
"handler",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L7012-L7019 |
|
49,457 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type, checks) {
var handler = checks[0];
var bglobal = checks[1];
if (this._remove(type, [handler])) {
if (bglobal) {
gui.Tick.removeGlobal(type, handler);
} else {
gui.Tick.remove(type, handler, this.$contextid);
}
}
} | javascript | function(type, checks) {
var handler = checks[0];
var bglobal = checks[1];
if (this._remove(type, [handler])) {
if (bglobal) {
gui.Tick.removeGlobal(type, handler);
} else {
gui.Tick.remove(type, handler, this.$contextid);
}
}
} | [
"function",
"(",
"type",
",",
"checks",
")",
"{",
"var",
"handler",
"=",
"checks",
"[",
"0",
"]",
";",
"var",
"bglobal",
"=",
"checks",
"[",
"1",
"]",
";",
"if",
"(",
"this",
".",
"_remove",
"(",
"type",
",",
"[",
"handler",
"]",
")",
")",
"{",
"if",
"(",
"bglobal",
")",
"{",
"gui",
".",
"Tick",
".",
"removeGlobal",
"(",
"type",
",",
"handler",
")",
";",
"}",
"else",
"{",
"gui",
".",
"Tick",
".",
"remove",
"(",
"type",
",",
"handler",
",",
"this",
".",
"$contextid",
")",
";",
"}",
"}",
"}"
] | Remove delegated handlers.
@overwrites {gui.Tracker#_cleanup}
@param {String} type
@param {Array<object>} checks | [
"Remove",
"delegated",
"handlers",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L7042-L7052 |
|
49,458 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(arg, handler) {
handler = handler ? handler : this.spirit;
gui.Array.make(arg).forEach(function(type) {
if (this._addchecks(type, [handler])) {
if (!this._handlers[type]) {
this._handlers[type] = [];
}
this._handlers[type].push(handler);
}
}, this);
return this.spirit;
} | javascript | function(arg, handler) {
handler = handler ? handler : this.spirit;
gui.Array.make(arg).forEach(function(type) {
if (this._addchecks(type, [handler])) {
if (!this._handlers[type]) {
this._handlers[type] = [];
}
this._handlers[type].push(handler);
}
}, this);
return this.spirit;
} | [
"function",
"(",
"arg",
",",
"handler",
")",
"{",
"handler",
"=",
"handler",
"?",
"handler",
":",
"this",
".",
"spirit",
";",
"gui",
".",
"Array",
".",
"make",
"(",
"arg",
")",
".",
"forEach",
"(",
"function",
"(",
"type",
")",
"{",
"if",
"(",
"this",
".",
"_addchecks",
"(",
"type",
",",
"[",
"handler",
"]",
")",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_handlers",
"[",
"type",
"]",
")",
"{",
"this",
".",
"_handlers",
"[",
"type",
"]",
"=",
"[",
"]",
";",
"}",
"this",
".",
"_handlers",
"[",
"type",
"]",
".",
"push",
"(",
"handler",
")",
";",
"}",
"}",
",",
"this",
")",
";",
"return",
"this",
".",
"spirit",
";",
"}"
] | Add one or more action handlers.
@param {object} arg
@param @optional {object} handler implements LifeListener
interface, defaults to this.spirit
@returns {gui.Spirit} | [
"Add",
"one",
"or",
"more",
"action",
"handlers",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L7219-L7230 |
|
49,459 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(arg, handler) {
handler = handler ? handler : this.spirit;
gui.Array.make(arg).forEach(function(type) {
if (this._removechecks(type, [handler])) {
if (this._handlers[type]) { // weirdo Gecko condition...
var index = this._handlers[type].indexOf(type);
gui.Array.remove(this._handlers[type], index);
if (this._handlers[type].length === 0) {
delete this._handlers[type];
}
}
}
}, this);
return this.spirit;
} | javascript | function(arg, handler) {
handler = handler ? handler : this.spirit;
gui.Array.make(arg).forEach(function(type) {
if (this._removechecks(type, [handler])) {
if (this._handlers[type]) { // weirdo Gecko condition...
var index = this._handlers[type].indexOf(type);
gui.Array.remove(this._handlers[type], index);
if (this._handlers[type].length === 0) {
delete this._handlers[type];
}
}
}
}, this);
return this.spirit;
} | [
"function",
"(",
"arg",
",",
"handler",
")",
"{",
"handler",
"=",
"handler",
"?",
"handler",
":",
"this",
".",
"spirit",
";",
"gui",
".",
"Array",
".",
"make",
"(",
"arg",
")",
".",
"forEach",
"(",
"function",
"(",
"type",
")",
"{",
"if",
"(",
"this",
".",
"_removechecks",
"(",
"type",
",",
"[",
"handler",
"]",
")",
")",
"{",
"if",
"(",
"this",
".",
"_handlers",
"[",
"type",
"]",
")",
"{",
"// weirdo Gecko condition...",
"var",
"index",
"=",
"this",
".",
"_handlers",
"[",
"type",
"]",
".",
"indexOf",
"(",
"type",
")",
";",
"gui",
".",
"Array",
".",
"remove",
"(",
"this",
".",
"_handlers",
"[",
"type",
"]",
",",
"index",
")",
";",
"if",
"(",
"this",
".",
"_handlers",
"[",
"type",
"]",
".",
"length",
"===",
"0",
")",
"{",
"delete",
"this",
".",
"_handlers",
"[",
"type",
"]",
";",
"}",
"}",
"}",
"}",
",",
"this",
")",
";",
"return",
"this",
".",
"spirit",
";",
"}"
] | Remove one or more action handlers.
@param {object} arg
@param @optional {object} handler implements LifeListener
interface, defaults to spirit
@returns {gui.Spirit} | [
"Remove",
"one",
"or",
"more",
"action",
"handlers",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L7239-L7253 |
|
49,460 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(value) {
if ([
['%5B', '%5D'],
['%7B', '%7D']
].some(function isencoded(tokens) {
return value.startsWith(tokens[0]) && value.endsWith(tokens[1]);
})) {
try {
value = JSON.parse(decodeURIComponent(value));
} catch (exception) {
value = null;
console.error(this + ': Bad JSON: ' + exception.message);
}
}
return value;
} | javascript | function(value) {
if ([
['%5B', '%5D'],
['%7B', '%7D']
].some(function isencoded(tokens) {
return value.startsWith(tokens[0]) && value.endsWith(tokens[1]);
})) {
try {
value = JSON.parse(decodeURIComponent(value));
} catch (exception) {
value = null;
console.error(this + ': Bad JSON: ' + exception.message);
}
}
return value;
} | [
"function",
"(",
"value",
")",
"{",
"if",
"(",
"[",
"[",
"'%5B'",
",",
"'%5D'",
"]",
",",
"[",
"'%7B'",
",",
"'%7D'",
"]",
"]",
".",
"some",
"(",
"function",
"isencoded",
"(",
"tokens",
")",
"{",
"return",
"value",
".",
"startsWith",
"(",
"tokens",
"[",
"0",
"]",
")",
"&&",
"value",
".",
"endsWith",
"(",
"tokens",
"[",
"1",
"]",
")",
";",
"}",
")",
")",
"{",
"try",
"{",
"value",
"=",
"JSON",
".",
"parse",
"(",
"decodeURIComponent",
"(",
"value",
")",
")",
";",
"}",
"catch",
"(",
"exception",
")",
"{",
"value",
"=",
"null",
";",
"console",
".",
"error",
"(",
"this",
"+",
"': Bad JSON: '",
"+",
"exception",
".",
"message",
")",
";",
"}",
"}",
"return",
"value",
";",
"}"
] | JSONArray or JSONObject scrambled with encodeURIComponent?
If so, let's decode and parse this into an array or object.
@param {string} value
@returns {Array|Object>} | [
"JSONArray",
"or",
"JSONObject",
"scrambled",
"with",
"encodeURIComponent?",
"If",
"so",
"let",
"s",
"decode",
"and",
"parse",
"this",
"into",
"an",
"array",
"or",
"object",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L7448-L7463 |
|
49,461 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(name, value) {
var list, att, handler, trigger;
var triggers = !gui.attributes.every(function(prefix) {
if ((trigger = name.startsWith(prefix))) {
this.spirit.config.configureone(name, value);
}
return !trigger;
}, this);
if (!triggers && (list = this._trackedtypes[name])) {
att = new gui.Att(name, value);
list.forEach(function(checks) {
handler = checks[0];
handler.onatt(att);
}, this);
}
} | javascript | function(name, value) {
var list, att, handler, trigger;
var triggers = !gui.attributes.every(function(prefix) {
if ((trigger = name.startsWith(prefix))) {
this.spirit.config.configureone(name, value);
}
return !trigger;
}, this);
if (!triggers && (list = this._trackedtypes[name])) {
att = new gui.Att(name, value);
list.forEach(function(checks) {
handler = checks[0];
handler.onatt(att);
}, this);
}
} | [
"function",
"(",
"name",
",",
"value",
")",
"{",
"var",
"list",
",",
"att",
",",
"handler",
",",
"trigger",
";",
"var",
"triggers",
"=",
"!",
"gui",
".",
"attributes",
".",
"every",
"(",
"function",
"(",
"prefix",
")",
"{",
"if",
"(",
"(",
"trigger",
"=",
"name",
".",
"startsWith",
"(",
"prefix",
")",
")",
")",
"{",
"this",
".",
"spirit",
".",
"config",
".",
"configureone",
"(",
"name",
",",
"value",
")",
";",
"}",
"return",
"!",
"trigger",
";",
"}",
",",
"this",
")",
";",
"if",
"(",
"!",
"triggers",
"&&",
"(",
"list",
"=",
"this",
".",
"_trackedtypes",
"[",
"name",
"]",
")",
")",
"{",
"att",
"=",
"new",
"gui",
".",
"Att",
"(",
"name",
",",
"value",
")",
";",
"list",
".",
"forEach",
"(",
"function",
"(",
"checks",
")",
"{",
"handler",
"=",
"checks",
"[",
"0",
"]",
";",
"handler",
".",
"onatt",
"(",
"att",
")",
";",
"}",
",",
"this",
")",
";",
"}",
"}"
] | Trigger potential handlers for attribute update.
@param {String} name
@param {String} value | [
"Trigger",
"potential",
"handlers",
"for",
"attribute",
"update",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L7676-L7691 |
|
49,462 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(elm) {
var map = Object.create(null);
this.all(elm).forEach(function(att) {
map[att.name] = gui.Type.cast(att.value);
});
return map;
} | javascript | function(elm) {
var map = Object.create(null);
this.all(elm).forEach(function(att) {
map[att.name] = gui.Type.cast(att.value);
});
return map;
} | [
"function",
"(",
"elm",
")",
"{",
"var",
"map",
"=",
"Object",
".",
"create",
"(",
"null",
")",
";",
"this",
".",
"all",
"(",
"elm",
")",
".",
"forEach",
"(",
"function",
"(",
"att",
")",
"{",
"map",
"[",
"att",
".",
"name",
"]",
"=",
"gui",
".",
"Type",
".",
"cast",
"(",
"att",
".",
"value",
")",
";",
"}",
")",
";",
"return",
"map",
";",
"}"
] | Get all attributes as hashmap type object.
Values are converted to an inferred type.
@param {Element} elm
@returns {Map<String,String>} | [
"Get",
"all",
"attributes",
"as",
"hashmap",
"type",
"object",
".",
"Values",
"are",
"converted",
"to",
"an",
"inferred",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L7826-L7832 |
|
49,463 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(element, name) {
if (this._supports) {
return element.classList.contains(name);
} else {
var classnames = element.className.split(" ");
return classnames.indexOf(name) > -1;
}
} | javascript | function(element, name) {
if (this._supports) {
return element.classList.contains(name);
} else {
var classnames = element.className.split(" ");
return classnames.indexOf(name) > -1;
}
} | [
"function",
"(",
"element",
",",
"name",
")",
"{",
"if",
"(",
"this",
".",
"_supports",
")",
"{",
"return",
"element",
".",
"classList",
".",
"contains",
"(",
"name",
")",
";",
"}",
"else",
"{",
"var",
"classnames",
"=",
"element",
".",
"className",
".",
"split",
"(",
"\" \"",
")",
";",
"return",
"classnames",
".",
"indexOf",
"(",
"name",
")",
">",
"-",
"1",
";",
"}",
"}"
] | classList.contains
@param {Element} element
@param {String} name
@returns {boolean} | [
"classList",
".",
"contains"
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L8227-L8234 |
|
49,464 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(thing, prop) {
var element = thing instanceof gui.Spirit ? thing.element : thing;
var doc = element.ownerDocument,
win = doc.defaultView;
prop = this._standardcase(this.jsproperty(prop));
return win.getComputedStyle(element, null).getPropertyValue(prop);
} | javascript | function(thing, prop) {
var element = thing instanceof gui.Spirit ? thing.element : thing;
var doc = element.ownerDocument,
win = doc.defaultView;
prop = this._standardcase(this.jsproperty(prop));
return win.getComputedStyle(element, null).getPropertyValue(prop);
} | [
"function",
"(",
"thing",
",",
"prop",
")",
"{",
"var",
"element",
"=",
"thing",
"instanceof",
"gui",
".",
"Spirit",
"?",
"thing",
".",
"element",
":",
"thing",
";",
"var",
"doc",
"=",
"element",
".",
"ownerDocument",
",",
"win",
"=",
"doc",
".",
"defaultView",
";",
"prop",
"=",
"this",
".",
"_standardcase",
"(",
"this",
".",
"jsproperty",
"(",
"prop",
")",
")",
";",
"return",
"win",
".",
"getComputedStyle",
"(",
"element",
",",
"null",
")",
".",
"getPropertyValue",
"(",
"prop",
")",
";",
"}"
] | Compute runtime style.
@param {object} thing Spirit or element.
@param {String} prop
@returns {String} | [
"Compute",
"runtime",
"style",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L8290-L8296 |
|
49,465 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(prop) {
var vendors = this._vendors,
fixt = prop;
var element = document.documentElement;
prop = String(prop);
if (prop.startsWith("-beta-")) {
vendors.every(function(vendor) {
var test = this._camelcase(prop.replace("-beta-", vendor));
if (element.style[test] !== undefined) {
fixt = test;
return false;
}
return true;
}, this);
} else {
fixt = this._camelcase(fixt);
}
return fixt;
} | javascript | function(prop) {
var vendors = this._vendors,
fixt = prop;
var element = document.documentElement;
prop = String(prop);
if (prop.startsWith("-beta-")) {
vendors.every(function(vendor) {
var test = this._camelcase(prop.replace("-beta-", vendor));
if (element.style[test] !== undefined) {
fixt = test;
return false;
}
return true;
}, this);
} else {
fixt = this._camelcase(fixt);
}
return fixt;
} | [
"function",
"(",
"prop",
")",
"{",
"var",
"vendors",
"=",
"this",
".",
"_vendors",
",",
"fixt",
"=",
"prop",
";",
"var",
"element",
"=",
"document",
".",
"documentElement",
";",
"prop",
"=",
"String",
"(",
"prop",
")",
";",
"if",
"(",
"prop",
".",
"startsWith",
"(",
"\"-beta-\"",
")",
")",
"{",
"vendors",
".",
"every",
"(",
"function",
"(",
"vendor",
")",
"{",
"var",
"test",
"=",
"this",
".",
"_camelcase",
"(",
"prop",
".",
"replace",
"(",
"\"-beta-\"",
",",
"vendor",
")",
")",
";",
"if",
"(",
"element",
".",
"style",
"[",
"test",
"]",
"!==",
"undefined",
")",
"{",
"fixt",
"=",
"test",
";",
"return",
"false",
";",
"}",
"return",
"true",
";",
"}",
",",
"this",
")",
";",
"}",
"else",
"{",
"fixt",
"=",
"this",
".",
"_camelcase",
"(",
"fixt",
")",
";",
"}",
"return",
"fixt",
";",
"}"
] | Normalize declaration property for use in element.style scenario.
@param {String} prop
@returns {String} | [
"Normalize",
"declaration",
"property",
"for",
"use",
"in",
"element",
".",
"style",
"scenario",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L8313-L8331 |
|
49,466 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(value) {
var vendors = this._vendors;
var element = document.documentElement;
value = String(value);
if (value && value.contains("-beta-")) {
var parts = [];
value.split(", ").forEach(function(part) {
if ((part = part.trim()).startsWith("-beta-")) {
vendors.every(function(vendor) {
var test = this._camelcase(part.replace("-beta-", vendor));
if (element.style[test] !== undefined) {
parts.push(part.replace("-beta-", vendor));
return false;
}
return true;
}, this);
} else {
parts.push(part);
}
}, this);
value = parts.join(",");
}
return value;
} | javascript | function(value) {
var vendors = this._vendors;
var element = document.documentElement;
value = String(value);
if (value && value.contains("-beta-")) {
var parts = [];
value.split(", ").forEach(function(part) {
if ((part = part.trim()).startsWith("-beta-")) {
vendors.every(function(vendor) {
var test = this._camelcase(part.replace("-beta-", vendor));
if (element.style[test] !== undefined) {
parts.push(part.replace("-beta-", vendor));
return false;
}
return true;
}, this);
} else {
parts.push(part);
}
}, this);
value = parts.join(",");
}
return value;
} | [
"function",
"(",
"value",
")",
"{",
"var",
"vendors",
"=",
"this",
".",
"_vendors",
";",
"var",
"element",
"=",
"document",
".",
"documentElement",
";",
"value",
"=",
"String",
"(",
"value",
")",
";",
"if",
"(",
"value",
"&&",
"value",
".",
"contains",
"(",
"\"-beta-\"",
")",
")",
"{",
"var",
"parts",
"=",
"[",
"]",
";",
"value",
".",
"split",
"(",
"\", \"",
")",
".",
"forEach",
"(",
"function",
"(",
"part",
")",
"{",
"if",
"(",
"(",
"part",
"=",
"part",
".",
"trim",
"(",
")",
")",
".",
"startsWith",
"(",
"\"-beta-\"",
")",
")",
"{",
"vendors",
".",
"every",
"(",
"function",
"(",
"vendor",
")",
"{",
"var",
"test",
"=",
"this",
".",
"_camelcase",
"(",
"part",
".",
"replace",
"(",
"\"-beta-\"",
",",
"vendor",
")",
")",
";",
"if",
"(",
"element",
".",
"style",
"[",
"test",
"]",
"!==",
"undefined",
")",
"{",
"parts",
".",
"push",
"(",
"part",
".",
"replace",
"(",
"\"-beta-\"",
",",
"vendor",
")",
")",
";",
"return",
"false",
";",
"}",
"return",
"true",
";",
"}",
",",
"this",
")",
";",
"}",
"else",
"{",
"parts",
".",
"push",
"(",
"part",
")",
";",
"}",
"}",
",",
"this",
")",
";",
"value",
"=",
"parts",
".",
"join",
"(",
"\",\"",
")",
";",
"}",
"return",
"value",
";",
"}"
] | Normalize declaration value for use in element.style scenario.
@param {String} value
@returns {String} | [
"Normalize",
"declaration",
"value",
"for",
"use",
"in",
"element",
".",
"style",
"scenario",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L8338-L8361 |
|
49,467 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(string) {
return string.replace(/[A-Z]/g, function(all, letter) {
return "-" + string.charAt(letter).toLowerCase();
});
} | javascript | function(string) {
return string.replace(/[A-Z]/g, function(all, letter) {
return "-" + string.charAt(letter).toLowerCase();
});
} | [
"function",
"(",
"string",
")",
"{",
"return",
"string",
".",
"replace",
"(",
"/",
"[A-Z]",
"/",
"g",
",",
"function",
"(",
"all",
",",
"letter",
")",
"{",
"return",
"\"-\"",
"+",
"string",
".",
"charAt",
"(",
"letter",
")",
".",
"toLowerCase",
"(",
")",
";",
"}",
")",
";",
"}"
] | standard-css-notate CamelCased string.
@param {String} string
@returns {String} | [
"standard",
"-",
"css",
"-",
"notate",
"CamelCased",
"string",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L8413-L8417 |
|
49,468 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(element) {
var result = 0;
var parent = element.parentNode;
if (parent) {
var node = parent.firstElementChild;
while (node) {
if (node === element) {
break;
} else {
node = node.nextElementSibling;
result++;
}
}
}
return result;
} | javascript | function(element) {
var result = 0;
var parent = element.parentNode;
if (parent) {
var node = parent.firstElementChild;
while (node) {
if (node === element) {
break;
} else {
node = node.nextElementSibling;
result++;
}
}
}
return result;
} | [
"function",
"(",
"element",
")",
"{",
"var",
"result",
"=",
"0",
";",
"var",
"parent",
"=",
"element",
".",
"parentNode",
";",
"if",
"(",
"parent",
")",
"{",
"var",
"node",
"=",
"parent",
".",
"firstElementChild",
";",
"while",
"(",
"node",
")",
"{",
"if",
"(",
"node",
"===",
"element",
")",
"{",
"break",
";",
"}",
"else",
"{",
"node",
"=",
"node",
".",
"nextElementSibling",
";",
"result",
"++",
";",
"}",
"}",
"}",
"return",
"result",
";",
"}"
] | Get ordinal position of element within container.
@param {Element} element
@returns {number} | [
"Get",
"ordinal",
"position",
"of",
"element",
"within",
"container",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L8770-L8785 |
|
49,469 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(node1, node2) {
node1 = node1 instanceof gui.Spirit ? node1.element : node1;
node2 = node2 instanceof gui.Spirit ? node2.element : node2;
return node1.compareDocumentPosition(node2);
} | javascript | function(node1, node2) {
node1 = node1 instanceof gui.Spirit ? node1.element : node1;
node2 = node2 instanceof gui.Spirit ? node2.element : node2;
return node1.compareDocumentPosition(node2);
} | [
"function",
"(",
"node1",
",",
"node2",
")",
"{",
"node1",
"=",
"node1",
"instanceof",
"gui",
".",
"Spirit",
"?",
"node1",
".",
"element",
":",
"node1",
";",
"node2",
"=",
"node2",
"instanceof",
"gui",
".",
"Spirit",
"?",
"node2",
".",
"element",
":",
"node2",
";",
"return",
"node1",
".",
"compareDocumentPosition",
"(",
"node2",
")",
";",
"}"
] | Compare document position of two nodes.
@see http://mdn.io/compareDocumentPosition
@param {Node|gui.Spirit} node1
@param {Node|gui.Spirit} node2
@returns {number} | [
"Compare",
"document",
"position",
"of",
"two",
"nodes",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L8794-L8798 |
|
49,470 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(node, othernode) {
var check = Node.DOCUMENT_POSITION_CONTAINS + Node.DOCUMENT_POSITION_PRECEDING;
return this.compare(othernode, node) === check;
} | javascript | function(node, othernode) {
var check = Node.DOCUMENT_POSITION_CONTAINS + Node.DOCUMENT_POSITION_PRECEDING;
return this.compare(othernode, node) === check;
} | [
"function",
"(",
"node",
",",
"othernode",
")",
"{",
"var",
"check",
"=",
"Node",
".",
"DOCUMENT_POSITION_CONTAINS",
"+",
"Node",
".",
"DOCUMENT_POSITION_PRECEDING",
";",
"return",
"this",
".",
"compare",
"(",
"othernode",
",",
"node",
")",
"===",
"check",
";",
"}"
] | Node contains other node?
@param {Node|gui.Spirit} node
@param {Node|gui.Spirit} othernode
@returns {boolean} | [
"Node",
"contains",
"other",
"node?"
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L8806-L8809 |
|
49,471 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(node) {
node = node instanceof gui.Spirit ? node.element : node;
return this.contains(node.ownerDocument, node);
} | javascript | function(node) {
node = node instanceof gui.Spirit ? node.element : node;
return this.contains(node.ownerDocument, node);
} | [
"function",
"(",
"node",
")",
"{",
"node",
"=",
"node",
"instanceof",
"gui",
".",
"Spirit",
"?",
"node",
".",
"element",
":",
"node",
";",
"return",
"this",
".",
"contains",
"(",
"node",
".",
"ownerDocument",
",",
"node",
")",
";",
"}"
] | Is node positioned in page DOM?
@param {Element|gui.Spirit} node
@returns {boolean} | [
"Is",
"node",
"positioned",
"in",
"page",
"DOM?"
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L8836-L8839 |
|
49,472 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(nodes) {
var node, groups = [];
function containedby(target, others) {
return others.some(function(other) {
return gui.DOMPlugin.contains(other, target);
});
}
while ((node = nodes.pop())) {
if (!containedby(node, nodes)) {
groups.push(node);
}
}
return groups;
} | javascript | function(nodes) {
var node, groups = [];
function containedby(target, others) {
return others.some(function(other) {
return gui.DOMPlugin.contains(other, target);
});
}
while ((node = nodes.pop())) {
if (!containedby(node, nodes)) {
groups.push(node);
}
}
return groups;
} | [
"function",
"(",
"nodes",
")",
"{",
"var",
"node",
",",
"groups",
"=",
"[",
"]",
";",
"function",
"containedby",
"(",
"target",
",",
"others",
")",
"{",
"return",
"others",
".",
"some",
"(",
"function",
"(",
"other",
")",
"{",
"return",
"gui",
".",
"DOMPlugin",
".",
"contains",
"(",
"other",
",",
"target",
")",
";",
"}",
")",
";",
"}",
"while",
"(",
"(",
"node",
"=",
"nodes",
".",
"pop",
"(",
")",
")",
")",
"{",
"if",
"(",
"!",
"containedby",
"(",
"node",
",",
"nodes",
")",
")",
"{",
"groups",
".",
"push",
"(",
"node",
")",
";",
"}",
"}",
"return",
"groups",
";",
"}"
] | Remove from list all nodes that are contained by others.
@param {Array<Element|gui.Spirit>} nodes
@returns {Array<Element|gui.Spirit>} | [
"Remove",
"from",
"list",
"all",
"nodes",
"that",
"are",
"contained",
"by",
"others",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L8846-L8860 |
|
49,473 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(node, selector, type) {
var result = null;
return this._qualify(node, selector)(function(node, selector) {
if (type) {
result = this.qall(node, selector, type)[0] || null;
} else {
try {
result = node.querySelector(selector);
} catch (exception) {
console.error("Dysfunctional selector: " + selector);
throw exception;
}
}
return result;
});
} | javascript | function(node, selector, type) {
var result = null;
return this._qualify(node, selector)(function(node, selector) {
if (type) {
result = this.qall(node, selector, type)[0] || null;
} else {
try {
result = node.querySelector(selector);
} catch (exception) {
console.error("Dysfunctional selector: " + selector);
throw exception;
}
}
return result;
});
} | [
"function",
"(",
"node",
",",
"selector",
",",
"type",
")",
"{",
"var",
"result",
"=",
"null",
";",
"return",
"this",
".",
"_qualify",
"(",
"node",
",",
"selector",
")",
"(",
"function",
"(",
"node",
",",
"selector",
")",
"{",
"if",
"(",
"type",
")",
"{",
"result",
"=",
"this",
".",
"qall",
"(",
"node",
",",
"selector",
",",
"type",
")",
"[",
"0",
"]",
"||",
"null",
";",
"}",
"else",
"{",
"try",
"{",
"result",
"=",
"node",
".",
"querySelector",
"(",
"selector",
")",
";",
"}",
"catch",
"(",
"exception",
")",
"{",
"console",
".",
"error",
"(",
"\"Dysfunctional selector: \"",
"+",
"selector",
")",
";",
"throw",
"exception",
";",
"}",
"}",
"return",
"result",
";",
"}",
")",
";",
"}"
] | Get first element that matches a selector.
Optional type argument filters to spirit of type.
@param {Node} node
@param {String} selector
@param @optional {function} type
@returns {Element|gui.Spirit} | [
"Get",
"first",
"element",
"that",
"matches",
"a",
"selector",
".",
"Optional",
"type",
"argument",
"filters",
"to",
"spirit",
"of",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L8870-L8885 |
|
49,474 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type) {
var result = null,
spirit = null,
el = this.spirit.element;
if (type) {
while ((el = el.nextElementSibling) !== null) {
spirit = el.spirit;
if (spirit !== null && spirit instanceof type) {
result = spirit;
break;
}
}
} else {
result = el.nextElementSibling;
}
return result;
} | javascript | function(type) {
var result = null,
spirit = null,
el = this.spirit.element;
if (type) {
while ((el = el.nextElementSibling) !== null) {
spirit = el.spirit;
if (spirit !== null && spirit instanceof type) {
result = spirit;
break;
}
}
} else {
result = el.nextElementSibling;
}
return result;
} | [
"function",
"(",
"type",
")",
"{",
"var",
"result",
"=",
"null",
",",
"spirit",
"=",
"null",
",",
"el",
"=",
"this",
".",
"spirit",
".",
"element",
";",
"if",
"(",
"type",
")",
"{",
"while",
"(",
"(",
"el",
"=",
"el",
".",
"nextElementSibling",
")",
"!==",
"null",
")",
"{",
"spirit",
"=",
"el",
".",
"spirit",
";",
"if",
"(",
"spirit",
"!==",
"null",
"&&",
"spirit",
"instanceof",
"type",
")",
"{",
"result",
"=",
"spirit",
";",
"break",
";",
"}",
"}",
"}",
"else",
"{",
"result",
"=",
"el",
".",
"nextElementSibling",
";",
"}",
"return",
"result",
";",
"}"
] | Next element or next spirit of given type.
@param @optional {function} type Spirit constructor
@returns {Element|gui.Spirit} | [
"Next",
"element",
"or",
"next",
"spirit",
"of",
"given",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9067-L9083 |
|
49,475 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type) {
var result = null,
spirit = null,
el = this.spirit.element;
if (type) {
while ((el = el.previousElementSibling) !== null) {
spirit = el.spirit;
if (spirit !== null && spirit instanceof type) {
result = spirit;
break;
}
}
} else {
result = el.previousElementSibling;
}
return result;
} | javascript | function(type) {
var result = null,
spirit = null,
el = this.spirit.element;
if (type) {
while ((el = el.previousElementSibling) !== null) {
spirit = el.spirit;
if (spirit !== null && spirit instanceof type) {
result = spirit;
break;
}
}
} else {
result = el.previousElementSibling;
}
return result;
} | [
"function",
"(",
"type",
")",
"{",
"var",
"result",
"=",
"null",
",",
"spirit",
"=",
"null",
",",
"el",
"=",
"this",
".",
"spirit",
".",
"element",
";",
"if",
"(",
"type",
")",
"{",
"while",
"(",
"(",
"el",
"=",
"el",
".",
"previousElementSibling",
")",
"!==",
"null",
")",
"{",
"spirit",
"=",
"el",
".",
"spirit",
";",
"if",
"(",
"spirit",
"!==",
"null",
"&&",
"spirit",
"instanceof",
"type",
")",
"{",
"result",
"=",
"spirit",
";",
"break",
";",
"}",
"}",
"}",
"else",
"{",
"result",
"=",
"el",
".",
"previousElementSibling",
";",
"}",
"return",
"result",
";",
"}"
] | Previous element or previous spirit of given type.
@param @optional {function} type Spirit constructor
@returns {Element|gui.Spirit} | [
"Previous",
"element",
"or",
"previous",
"spirit",
"of",
"given",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9090-L9106 |
|
49,476 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type) {
var result = null,
spirit = null,
el = this.spirit.element.lastElementChild;
if (type) {
while (result === null && el !== null) {
spirit = el.spirit;
if (spirit !== null && spirit instanceof type) {
result = spirit;
}
el = el.previoustElementSibling;
}
} else {
result = el;
}
return result;
} | javascript | function(type) {
var result = null,
spirit = null,
el = this.spirit.element.lastElementChild;
if (type) {
while (result === null && el !== null) {
spirit = el.spirit;
if (spirit !== null && spirit instanceof type) {
result = spirit;
}
el = el.previoustElementSibling;
}
} else {
result = el;
}
return result;
} | [
"function",
"(",
"type",
")",
"{",
"var",
"result",
"=",
"null",
",",
"spirit",
"=",
"null",
",",
"el",
"=",
"this",
".",
"spirit",
".",
"element",
".",
"lastElementChild",
";",
"if",
"(",
"type",
")",
"{",
"while",
"(",
"result",
"===",
"null",
"&&",
"el",
"!==",
"null",
")",
"{",
"spirit",
"=",
"el",
".",
"spirit",
";",
"if",
"(",
"spirit",
"!==",
"null",
"&&",
"spirit",
"instanceof",
"type",
")",
"{",
"result",
"=",
"spirit",
";",
"}",
"el",
"=",
"el",
".",
"previoustElementSibling",
";",
"}",
"}",
"else",
"{",
"result",
"=",
"el",
";",
"}",
"return",
"result",
";",
"}"
] | Last element or last spirit of type.
@param @optional {function} type Spirit constructor
@returns {Element|gui.Spirit} | [
"Last",
"element",
"or",
"last",
"spirit",
"of",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9136-L9152 |
|
49,477 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type) {
var result = this.spirit.element.parentNode;
if (type) {
var spirit = result.spirit;
if (spirit && spirit instanceof type) {
result = spirit;
} else {
result = null;
}
}
return result;
} | javascript | function(type) {
var result = this.spirit.element.parentNode;
if (type) {
var spirit = result.spirit;
if (spirit && spirit instanceof type) {
result = spirit;
} else {
result = null;
}
}
return result;
} | [
"function",
"(",
"type",
")",
"{",
"var",
"result",
"=",
"this",
".",
"spirit",
".",
"element",
".",
"parentNode",
";",
"if",
"(",
"type",
")",
"{",
"var",
"spirit",
"=",
"result",
".",
"spirit",
";",
"if",
"(",
"spirit",
"&&",
"spirit",
"instanceof",
"type",
")",
"{",
"result",
"=",
"spirit",
";",
"}",
"else",
"{",
"result",
"=",
"null",
";",
"}",
"}",
"return",
"result",
";",
"}"
] | Parent parent or parent spirit of type.
@param @optional {function} type Spirit constructor
@returns {Element|gui.Spirit} | [
"Parent",
"parent",
"or",
"parent",
"spirit",
"of",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9159-L9170 |
|
49,478 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type) {
var result = this.spirit.element.firstElementChild;
if (type) {
result = this.children(type)[0] || null;
}
return result;
} | javascript | function(type) {
var result = this.spirit.element.firstElementChild;
if (type) {
result = this.children(type)[0] || null;
}
return result;
} | [
"function",
"(",
"type",
")",
"{",
"var",
"result",
"=",
"this",
".",
"spirit",
".",
"element",
".",
"firstElementChild",
";",
"if",
"(",
"type",
")",
"{",
"result",
"=",
"this",
".",
"children",
"(",
"type",
")",
"[",
"0",
"]",
"||",
"null",
";",
"}",
"return",
"result",
";",
"}"
] | Child element or child spirit of type.
@param @optional {function} type Spirit constructor
@returns {Element|gui.Spirit} | [
"Child",
"element",
"or",
"child",
"spirit",
"of",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9177-L9183 |
|
49,479 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type) {
var result = [];
var crawler = new gui.Crawler();
if (type) {
crawler.ascend(this.element, {
handleSpirit: function(spirit) {
if (spirit instanceof type) {
result.push(spirit);
}
}
});
} else {
crawler.ascend(this.element, {
handleElement: function(el) {
result.push(el);
}
});
}
return result;
} | javascript | function(type) {
var result = [];
var crawler = new gui.Crawler();
if (type) {
crawler.ascend(this.element, {
handleSpirit: function(spirit) {
if (spirit instanceof type) {
result.push(spirit);
}
}
});
} else {
crawler.ascend(this.element, {
handleElement: function(el) {
result.push(el);
}
});
}
return result;
} | [
"function",
"(",
"type",
")",
"{",
"var",
"result",
"=",
"[",
"]",
";",
"var",
"crawler",
"=",
"new",
"gui",
".",
"Crawler",
"(",
")",
";",
"if",
"(",
"type",
")",
"{",
"crawler",
".",
"ascend",
"(",
"this",
".",
"element",
",",
"{",
"handleSpirit",
":",
"function",
"(",
"spirit",
")",
"{",
"if",
"(",
"spirit",
"instanceof",
"type",
")",
"{",
"result",
".",
"push",
"(",
"spirit",
")",
";",
"}",
"}",
"}",
")",
";",
"}",
"else",
"{",
"crawler",
".",
"ascend",
"(",
"this",
".",
"element",
",",
"{",
"handleElement",
":",
"function",
"(",
"el",
")",
"{",
"result",
".",
"push",
"(",
"el",
")",
";",
"}",
"}",
")",
";",
"}",
"return",
"result",
";",
"}"
] | First ancestor elements or ancestor spirits of type.
@param @optional {function} type Spirit constructor
@returns {Array<Element|gui.Spirit>} | [
"First",
"ancestor",
"elements",
"or",
"ancestor",
"spirits",
"of",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9229-L9248 |
|
49,480 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type) {
var result = [];
var me = this.spirit.element;
new gui.Crawler().descend(me, {
handleElement: function(element) {
if (!type && element !== me) {
result.push(element);
}
},
handleSpirit: function(spirit) {
if (type && spirit instanceof type) {
if (spirit.element !== me) {
result.push(spirit);
}
}
}
});
return result;
} | javascript | function(type) {
var result = [];
var me = this.spirit.element;
new gui.Crawler().descend(me, {
handleElement: function(element) {
if (!type && element !== me) {
result.push(element);
}
},
handleSpirit: function(spirit) {
if (type && spirit instanceof type) {
if (spirit.element !== me) {
result.push(spirit);
}
}
}
});
return result;
} | [
"function",
"(",
"type",
")",
"{",
"var",
"result",
"=",
"[",
"]",
";",
"var",
"me",
"=",
"this",
".",
"spirit",
".",
"element",
";",
"new",
"gui",
".",
"Crawler",
"(",
")",
".",
"descend",
"(",
"me",
",",
"{",
"handleElement",
":",
"function",
"(",
"element",
")",
"{",
"if",
"(",
"!",
"type",
"&&",
"element",
"!==",
"me",
")",
"{",
"result",
".",
"push",
"(",
"element",
")",
";",
"}",
"}",
",",
"handleSpirit",
":",
"function",
"(",
"spirit",
")",
"{",
"if",
"(",
"type",
"&&",
"spirit",
"instanceof",
"type",
")",
"{",
"if",
"(",
"spirit",
".",
"element",
"!==",
"me",
")",
"{",
"result",
".",
"push",
"(",
"spirit",
")",
";",
"}",
"}",
"}",
"}",
")",
";",
"return",
"result",
";",
"}"
] | All descendant elements or all descendant spirits of type.
@param @optional {function} type Spirit constructor
@returns {Array<Element|gui.Spirit>} | [
"All",
"descendant",
"elements",
"or",
"all",
"descendant",
"spirits",
"of",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9278-L9296 |
|
49,481 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type) {
var result = [],
spirit, el = this.spirit.element;
while ((el = el.nextElementSibling)) {
if (type && (spirit = el.spirit)) {
if (spirit instanceof type) {
result.push(spirit);
}
} else {
result.push(el);
}
}
return result;
} | javascript | function(type) {
var result = [],
spirit, el = this.spirit.element;
while ((el = el.nextElementSibling)) {
if (type && (spirit = el.spirit)) {
if (spirit instanceof type) {
result.push(spirit);
}
} else {
result.push(el);
}
}
return result;
} | [
"function",
"(",
"type",
")",
"{",
"var",
"result",
"=",
"[",
"]",
",",
"spirit",
",",
"el",
"=",
"this",
".",
"spirit",
".",
"element",
";",
"while",
"(",
"(",
"el",
"=",
"el",
".",
"nextElementSibling",
")",
")",
"{",
"if",
"(",
"type",
"&&",
"(",
"spirit",
"=",
"el",
".",
"spirit",
")",
")",
"{",
"if",
"(",
"spirit",
"instanceof",
"type",
")",
"{",
"result",
".",
"push",
"(",
"spirit",
")",
";",
"}",
"}",
"else",
"{",
"result",
".",
"push",
"(",
"el",
")",
";",
"}",
"}",
"return",
"result",
";",
"}"
] | Get following sibling elements or spirits of type.
@param @optional {function} type
@returns {Array<element|gui.Spirit>} | [
"Get",
"following",
"sibling",
"elements",
"or",
"spirits",
"of",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9303-L9316 |
|
49,482 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type) {
var result = [],
spirit, el = this.spirit.element;
while ((el = el.previousElementSibling)) {
if (type && (spirit = el.spirit)) {
if (spirit instanceof type) {
result.push(spirit);
}
} else {
result.push(el);
}
}
return result;
} | javascript | function(type) {
var result = [],
spirit, el = this.spirit.element;
while ((el = el.previousElementSibling)) {
if (type && (spirit = el.spirit)) {
if (spirit instanceof type) {
result.push(spirit);
}
} else {
result.push(el);
}
}
return result;
} | [
"function",
"(",
"type",
")",
"{",
"var",
"result",
"=",
"[",
"]",
",",
"spirit",
",",
"el",
"=",
"this",
".",
"spirit",
".",
"element",
";",
"while",
"(",
"(",
"el",
"=",
"el",
".",
"previousElementSibling",
")",
")",
"{",
"if",
"(",
"type",
"&&",
"(",
"spirit",
"=",
"el",
".",
"spirit",
")",
")",
"{",
"if",
"(",
"spirit",
"instanceof",
"type",
")",
"{",
"result",
".",
"push",
"(",
"spirit",
")",
";",
"}",
"}",
"else",
"{",
"result",
".",
"push",
"(",
"el",
")",
";",
"}",
"}",
"return",
"result",
";",
"}"
] | Get preceding sibling elements or spirits of type.
@param @optional {function} type
@returns {Array<element|gui.Spirit>} | [
"Get",
"preceding",
"sibling",
"elements",
"or",
"spirits",
"of",
"type",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9323-L9336 |
|
49,483 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(things) {
var els = things,
element = this.spirit.element;
els.forEach(function(el) {
element.appendChild(el);
maybespiritualize(el);
});
} | javascript | function(things) {
var els = things,
element = this.spirit.element;
els.forEach(function(el) {
element.appendChild(el);
maybespiritualize(el);
});
} | [
"function",
"(",
"things",
")",
"{",
"var",
"els",
"=",
"things",
",",
"element",
"=",
"this",
".",
"spirit",
".",
"element",
";",
"els",
".",
"forEach",
"(",
"function",
"(",
"el",
")",
"{",
"element",
".",
"appendChild",
"(",
"el",
")",
";",
"maybespiritualize",
"(",
"el",
")",
";",
"}",
")",
";",
"}"
] | Append spirit OR element OR array of either.
@param {object} things Complicated argument
@returns {object} Returns the argument | [
"Append",
"spirit",
"OR",
"element",
"OR",
"array",
"of",
"either",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9438-L9445 |
|
49,484 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(things) {
var els = things,
element = this.spirit.element,
first = element.firstChild;
els.reverse().forEach(function(el) {
element.insertBefore(el, first);
maybespiritualize(el);
});
} | javascript | function(things) {
var els = things,
element = this.spirit.element,
first = element.firstChild;
els.reverse().forEach(function(el) {
element.insertBefore(el, first);
maybespiritualize(el);
});
} | [
"function",
"(",
"things",
")",
"{",
"var",
"els",
"=",
"things",
",",
"element",
"=",
"this",
".",
"spirit",
".",
"element",
",",
"first",
"=",
"element",
".",
"firstChild",
";",
"els",
".",
"reverse",
"(",
")",
".",
"forEach",
"(",
"function",
"(",
"el",
")",
"{",
"element",
".",
"insertBefore",
"(",
"el",
",",
"first",
")",
";",
"maybespiritualize",
"(",
"el",
")",
";",
"}",
")",
";",
"}"
] | Prepend spirit OR element OR array of either.
@param {object} things Complicated argument
@returns {object} Returns the argument | [
"Prepend",
"spirit",
"OR",
"element",
"OR",
"array",
"of",
"either",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9452-L9460 |
|
49,485 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(things) {
var els = things,
target = this.spirit.element,
parent = target.parentNode;
els.reverse().forEach(function(el) {
parent.insertBefore(el, target);
maybespiritualize(el);
});
} | javascript | function(things) {
var els = things,
target = this.spirit.element,
parent = target.parentNode;
els.reverse().forEach(function(el) {
parent.insertBefore(el, target);
maybespiritualize(el);
});
} | [
"function",
"(",
"things",
")",
"{",
"var",
"els",
"=",
"things",
",",
"target",
"=",
"this",
".",
"spirit",
".",
"element",
",",
"parent",
"=",
"target",
".",
"parentNode",
";",
"els",
".",
"reverse",
"(",
")",
".",
"forEach",
"(",
"function",
"(",
"el",
")",
"{",
"parent",
".",
"insertBefore",
"(",
"el",
",",
"target",
")",
";",
"maybespiritualize",
"(",
"el",
")",
";",
"}",
")",
";",
"}"
] | Insert spirit OR element OR array of either before this spirit.
@param {object} things Complicated argument
@returns {object} Returns the argument | [
"Insert",
"spirit",
"OR",
"element",
"OR",
"array",
"of",
"either",
"before",
"this",
"spirit",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9467-L9475 |
|
49,486 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(type, checks) {
var target = checks[0];
var handler = checks[1];
var capture = checks[2];
this.remove(type, target, handler, capture);
} | javascript | function(type, checks) {
var target = checks[0];
var handler = checks[1];
var capture = checks[2];
this.remove(type, target, handler, capture);
} | [
"function",
"(",
"type",
",",
"checks",
")",
"{",
"var",
"target",
"=",
"checks",
"[",
"0",
"]",
";",
"var",
"handler",
"=",
"checks",
"[",
"1",
"]",
";",
"var",
"capture",
"=",
"checks",
"[",
"2",
"]",
";",
"this",
".",
"remove",
"(",
"type",
",",
"target",
",",
"handler",
",",
"capture",
")",
";",
"}"
] | Remove event listeners.
@overwrites {gui.Tracker#_cleanup}
@param {String} type
@param {Array<object>} checks | [
"Remove",
"event",
"listeners",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9683-L9688 |
|
49,487 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(arg) {
return gui.TrackerPlugin.prototype._breakdown.call(this, arg).map(function(type) {
return type === 'transitionend' ? this._transitionend() : type;
}, this);
} | javascript | function(arg) {
return gui.TrackerPlugin.prototype._breakdown.call(this, arg).map(function(type) {
return type === 'transitionend' ? this._transitionend() : type;
}, this);
} | [
"function",
"(",
"arg",
")",
"{",
"return",
"gui",
".",
"TrackerPlugin",
".",
"prototype",
".",
"_breakdown",
".",
"call",
"(",
"this",
",",
"arg",
")",
".",
"map",
"(",
"function",
"(",
"type",
")",
"{",
"return",
"type",
"===",
"'transitionend'",
"?",
"this",
".",
"_transitionend",
"(",
")",
":",
"type",
";",
"}",
",",
"this",
")",
";",
"}"
] | Manhandle 'transitionend' event. Seems only Safari is left now...
@param {Array<String>|String} arg
@returns {Array<String>} | [
"Manhandle",
"transitionend",
"event",
".",
"Seems",
"only",
"Safari",
"is",
"left",
"now",
"..."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9695-L9699 |
|
49,488 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function() {
if (true || gui.Client.has3D) {
this.spirit.css.set("-beta-transform", "");
} else {
this.spirit.css.left = "";
this.spirit.css.top = "";
}
} | javascript | function() {
if (true || gui.Client.has3D) {
this.spirit.css.set("-beta-transform", "");
} else {
this.spirit.css.left = "";
this.spirit.css.top = "";
}
} | [
"function",
"(",
")",
"{",
"if",
"(",
"true",
"||",
"gui",
".",
"Client",
".",
"has3D",
")",
"{",
"this",
".",
"spirit",
".",
"css",
".",
"set",
"(",
"\"-beta-transform\"",
",",
"\"\"",
")",
";",
"}",
"else",
"{",
"this",
".",
"spirit",
".",
"css",
".",
"left",
"=",
"\"\"",
";",
"this",
".",
"spirit",
".",
"css",
".",
"top",
"=",
"\"\"",
";",
"}",
"}"
] | Reset transformations. | [
"Reset",
"transformations",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9815-L9822 |
|
49,489 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function() {
var pos = this._pos;
var set = [pos.x, pos.y, pos.z].map(Math.round);
if (true || gui.Client.has3D) {
this.spirit.css.set("-beta-transform",
"translate3d(" + set.join("px,") + "px)"
);
} else {
this.spirit.css.left = set [0];
this.spirit.css.top = set [1];
}
} | javascript | function() {
var pos = this._pos;
var set = [pos.x, pos.y, pos.z].map(Math.round);
if (true || gui.Client.has3D) {
this.spirit.css.set("-beta-transform",
"translate3d(" + set.join("px,") + "px)"
);
} else {
this.spirit.css.left = set [0];
this.spirit.css.top = set [1];
}
} | [
"function",
"(",
")",
"{",
"var",
"pos",
"=",
"this",
".",
"_pos",
";",
"var",
"set",
"=",
"[",
"pos",
".",
"x",
",",
"pos",
".",
"y",
",",
"pos",
".",
"z",
"]",
".",
"map",
"(",
"Math",
".",
"round",
")",
";",
"if",
"(",
"true",
"||",
"gui",
".",
"Client",
".",
"has3D",
")",
"{",
"this",
".",
"spirit",
".",
"css",
".",
"set",
"(",
"\"-beta-transform\"",
",",
"\"translate3d(\"",
"+",
"set",
".",
"join",
"(",
"\"px,\"",
")",
"+",
"\"px)\"",
")",
";",
"}",
"else",
"{",
"this",
".",
"spirit",
".",
"css",
".",
"left",
"=",
"set",
"[",
"0",
"]",
";",
"this",
".",
"spirit",
".",
"css",
".",
"top",
"=",
"set",
"[",
"1",
"]",
";",
"}",
"}"
] | Go ahead. | [
"Go",
"ahead",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L9836-L9847 |
|
49,490 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(elm, doc, win, sig) { // TODO: get rid of all these!
this.element = elm;
this.document = doc;
this.window = win;
this.$contextid = sig;
gui.Spirit.$construct(this);
} | javascript | function(elm, doc, win, sig) { // TODO: get rid of all these!
this.element = elm;
this.document = doc;
this.window = win;
this.$contextid = sig;
gui.Spirit.$construct(this);
} | [
"function",
"(",
"elm",
",",
"doc",
",",
"win",
",",
"sig",
")",
"{",
"// TODO: get rid of all these!",
"this",
".",
"element",
"=",
"elm",
";",
"this",
".",
"document",
"=",
"doc",
";",
"this",
".",
"window",
"=",
"win",
";",
"this",
".",
"$contextid",
"=",
"sig",
";",
"gui",
".",
"Spirit",
".",
"$construct",
"(",
"this",
")",
";",
"}"
] | Secret constructor invoked before `onconstruct`.
@param {Element} elm
@param {Document} doc
@param {Window} win
@param {String} sig | [
"Secret",
"constructor",
"invoked",
"before",
"onconstruct",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10022-L10028 |
|
49,491 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function() {
var Plugin, plugins = this.constructor.$plugins;
this.life = new gui.LifePlugin(this);
this.config = new gui.ConfigPlugin(this);
Object.keys(plugins).filter(function(prefix) {
return prefix !== "life" && prefix !== "config";
}).sort().forEach(function(prefix) {
Plugin = plugins[prefix];
if ((this.life.plugins[prefix] = !Plugin.lazy)) {
gui.Plugin.$assign(this, prefix, new Plugin(this));
} else {
gui.Plugin.$prepare(this, prefix, Plugin);
}
}, this);
} | javascript | function() {
var Plugin, plugins = this.constructor.$plugins;
this.life = new gui.LifePlugin(this);
this.config = new gui.ConfigPlugin(this);
Object.keys(plugins).filter(function(prefix) {
return prefix !== "life" && prefix !== "config";
}).sort().forEach(function(prefix) {
Plugin = plugins[prefix];
if ((this.life.plugins[prefix] = !Plugin.lazy)) {
gui.Plugin.$assign(this, prefix, new Plugin(this));
} else {
gui.Plugin.$prepare(this, prefix, Plugin);
}
}, this);
} | [
"function",
"(",
")",
"{",
"var",
"Plugin",
",",
"plugins",
"=",
"this",
".",
"constructor",
".",
"$plugins",
";",
"this",
".",
"life",
"=",
"new",
"gui",
".",
"LifePlugin",
"(",
"this",
")",
";",
"this",
".",
"config",
"=",
"new",
"gui",
".",
"ConfigPlugin",
"(",
"this",
")",
";",
"Object",
".",
"keys",
"(",
"plugins",
")",
".",
"filter",
"(",
"function",
"(",
"prefix",
")",
"{",
"return",
"prefix",
"!==",
"\"life\"",
"&&",
"prefix",
"!==",
"\"config\"",
";",
"}",
")",
".",
"sort",
"(",
")",
".",
"forEach",
"(",
"function",
"(",
"prefix",
")",
"{",
"Plugin",
"=",
"plugins",
"[",
"prefix",
"]",
";",
"if",
"(",
"(",
"this",
".",
"life",
".",
"plugins",
"[",
"prefix",
"]",
"=",
"!",
"Plugin",
".",
"lazy",
")",
")",
"{",
"gui",
".",
"Plugin",
".",
"$assign",
"(",
"this",
",",
"prefix",
",",
"new",
"Plugin",
"(",
"this",
")",
")",
";",
"}",
"else",
"{",
"gui",
".",
"Plugin",
".",
"$prepare",
"(",
"this",
",",
"prefix",
",",
"Plugin",
")",
";",
"}",
"}",
",",
"this",
")",
";",
"}"
] | Plug in the plugins. Lazy plugins will be newed up when needed.
- {gui.LifePlugin} first
- {gui.ConfigPlugin} second
- bonus plugins galore
@TODO: To preserve order, refactor plugins stack from object to array | [
"Plug",
"in",
"the",
"plugins",
".",
"Lazy",
"plugins",
"will",
"be",
"newed",
"up",
"when",
"needed",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10044-L10058 |
|
49,492 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(constructing) {
if (gui.debug) {
var val, elm = this.element;
var fix = gui.attributes[0]; // by default using `gui`
if (constructing) {
if (gui.attributes.every(function(f) {
return !elm.hasAttribute(f);
})) {
val = "[" + this.constructor.$classname + "]";
elm.setAttribute(fix, val);
}
} else {
val = elm.getAttribute(fix);
if (val && val.startsWith("[")) {
elm.removeAttribute(fix);
}
}
}
} | javascript | function(constructing) {
if (gui.debug) {
var val, elm = this.element;
var fix = gui.attributes[0]; // by default using `gui`
if (constructing) {
if (gui.attributes.every(function(f) {
return !elm.hasAttribute(f);
})) {
val = "[" + this.constructor.$classname + "]";
elm.setAttribute(fix, val);
}
} else {
val = elm.getAttribute(fix);
if (val && val.startsWith("[")) {
elm.removeAttribute(fix);
}
}
}
} | [
"function",
"(",
"constructing",
")",
"{",
"if",
"(",
"gui",
".",
"debug",
")",
"{",
"var",
"val",
",",
"elm",
"=",
"this",
".",
"element",
";",
"var",
"fix",
"=",
"gui",
".",
"attributes",
"[",
"0",
"]",
";",
"// by default using `gui`",
"if",
"(",
"constructing",
")",
"{",
"if",
"(",
"gui",
".",
"attributes",
".",
"every",
"(",
"function",
"(",
"f",
")",
"{",
"return",
"!",
"elm",
".",
"hasAttribute",
"(",
"f",
")",
";",
"}",
")",
")",
"{",
"val",
"=",
"\"[\"",
"+",
"this",
".",
"constructor",
".",
"$classname",
"+",
"\"]\"",
";",
"elm",
".",
"setAttribute",
"(",
"fix",
",",
"val",
")",
";",
"}",
"}",
"else",
"{",
"val",
"=",
"elm",
".",
"getAttribute",
"(",
"fix",
")",
";",
"if",
"(",
"val",
"&&",
"val",
".",
"startsWith",
"(",
"\"[\"",
")",
")",
"{",
"elm",
".",
"removeAttribute",
"(",
"fix",
")",
";",
"}",
"}",
"}",
"}"
] | In debug mode, stamp the spirit constructor name onto the spirit element.
Square brackets indicate that the `gui` attribute was added by this method.
@param {boolean} constructing | [
"In",
"debug",
"mode",
"stamp",
"the",
"spirit",
"constructor",
"name",
"onto",
"the",
"spirit",
"element",
".",
"Square",
"brackets",
"indicate",
"that",
"the",
"gui",
"attribute",
"was",
"added",
"by",
"this",
"method",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10065-L10083 |
|
49,493 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function() {
var C = gui.Class.extend.apply(this, arguments);
C.$plugins = gui.Object.copy(this.$plugins);
return C;
/*
* Mutating plugins deprecated!
*
var args = [],
def, br = gui.Class.breakdown(arguments);
["name", "protos", "recurring", "statics"].forEach(function(key) {
if ((def = br[key])) {
args.push(def);
}
}, this);
var C = gui.Class.extend.apply(this, args);
C.$plugins = gui.Object.copy(this.$plugins);
var b = gui.Class.breakdown(arguments);
gui.Object.each(C.$plugins, function(prefix, plugin) {
var def = b.protos[prefix];
switch (gui.Type.of(def)) {
case "object":
var mutant = plugin.extend(def);
C.plugin(prefix, mutant, true);
break;
case "undefined":
break;
default:
throw new TypeError(
C + ": Bad definition for " + prefix + ': ' + def
);
}
}, this);
return C;
*/
} | javascript | function() {
var C = gui.Class.extend.apply(this, arguments);
C.$plugins = gui.Object.copy(this.$plugins);
return C;
/*
* Mutating plugins deprecated!
*
var args = [],
def, br = gui.Class.breakdown(arguments);
["name", "protos", "recurring", "statics"].forEach(function(key) {
if ((def = br[key])) {
args.push(def);
}
}, this);
var C = gui.Class.extend.apply(this, args);
C.$plugins = gui.Object.copy(this.$plugins);
var b = gui.Class.breakdown(arguments);
gui.Object.each(C.$plugins, function(prefix, plugin) {
var def = b.protos[prefix];
switch (gui.Type.of(def)) {
case "object":
var mutant = plugin.extend(def);
C.plugin(prefix, mutant, true);
break;
case "undefined":
break;
default:
throw new TypeError(
C + ": Bad definition for " + prefix + ': ' + def
);
}
}, this);
return C;
*/
} | [
"function",
"(",
")",
"{",
"var",
"C",
"=",
"gui",
".",
"Class",
".",
"extend",
".",
"apply",
"(",
"this",
",",
"arguments",
")",
";",
"C",
".",
"$plugins",
"=",
"gui",
".",
"Object",
".",
"copy",
"(",
"this",
".",
"$plugins",
")",
";",
"return",
"C",
";",
"/*\n\t\t * Mutating plugins deprecated!\n\t\t *\n\t\tvar args = [],\n\t\t\tdef, br = gui.Class.breakdown(arguments);\n\t\t[\"name\", \"protos\", \"recurring\", \"statics\"].forEach(function(key) {\n\t\t\tif ((def = br[key])) {\n\t\t\t\targs.push(def);\n\t\t\t}\n\t\t}, this);\n\t\tvar C = gui.Class.extend.apply(this, args);\n\t\tC.$plugins = gui.Object.copy(this.$plugins);\n\t\tvar b = gui.Class.breakdown(arguments);\n\t\tgui.Object.each(C.$plugins, function(prefix, plugin) {\n\t\t\tvar def = b.protos[prefix];\n\t\t\tswitch (gui.Type.of(def)) {\n\t\t\t\tcase \"object\":\n\t\t\t\t\tvar mutant = plugin.extend(def);\n\t\t\t\t\tC.plugin(prefix, mutant, true);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"undefined\":\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new TypeError(\n\t\t\t\t\t\tC + \": Bad definition for \" + prefix + ': ' + def\n\t\t\t\t\t);\n\t\t\t}\n\t\t}, this);\n\t\treturn C;\n\t\t*/",
"}"
] | Extend with plugins.
@TODO: move all this to {gui.Class}
@TODO: validate that user isn't declaring non-primitives on the prototype
@param {object} extension
@param {object} recurring
@param {object} statics
@returns {gui.Spirit} | [
"Extend",
"with",
"plugins",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10122-L10156 |
|
49,494 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(spirit) {
spirit.config.configureall();
spirit.life.configured = true;
spirit.onconfigure();
spirit.life.dispatch(gui.LIFE_CONFIGURE);
} | javascript | function(spirit) {
spirit.config.configureall();
spirit.life.configured = true;
spirit.onconfigure();
spirit.life.dispatch(gui.LIFE_CONFIGURE);
} | [
"function",
"(",
"spirit",
")",
"{",
"spirit",
".",
"config",
".",
"configureall",
"(",
")",
";",
"spirit",
".",
"life",
".",
"configured",
"=",
"true",
";",
"spirit",
".",
"onconfigure",
"(",
")",
";",
"spirit",
".",
"life",
".",
"dispatch",
"(",
"gui",
".",
"LIFE_CONFIGURE",
")",
";",
"}"
] | Spirit configure.
@param {gui.Spirit} spirit | [
"Spirit",
"configure",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10212-L10217 |
|
49,495 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(spirit) {
spirit.window.gui.inside(spirit);
spirit.life.entered = true;
spirit.onenter();
spirit.life.dispatch(gui.LIFE_ENTER);
} | javascript | function(spirit) {
spirit.window.gui.inside(spirit);
spirit.life.entered = true;
spirit.onenter();
spirit.life.dispatch(gui.LIFE_ENTER);
} | [
"function",
"(",
"spirit",
")",
"{",
"spirit",
".",
"window",
".",
"gui",
".",
"inside",
"(",
"spirit",
")",
";",
"spirit",
".",
"life",
".",
"entered",
"=",
"true",
";",
"spirit",
".",
"onenter",
"(",
")",
";",
"spirit",
".",
"life",
".",
"dispatch",
"(",
"gui",
".",
"LIFE_ENTER",
")",
";",
"}"
] | Spirit enter.
@param {gui.Spirit} spirit | [
"Spirit",
"enter",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10223-L10228 |
|
49,496 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(spirit) {
spirit.window.gui.inside(spirit);
spirit.life.attached = true;
spirit.onattach();
spirit.life.dispatch(gui.LIFE_ATTACH);
} | javascript | function(spirit) {
spirit.window.gui.inside(spirit);
spirit.life.attached = true;
spirit.onattach();
spirit.life.dispatch(gui.LIFE_ATTACH);
} | [
"function",
"(",
"spirit",
")",
"{",
"spirit",
".",
"window",
".",
"gui",
".",
"inside",
"(",
"spirit",
")",
";",
"spirit",
".",
"life",
".",
"attached",
"=",
"true",
";",
"spirit",
".",
"onattach",
"(",
")",
";",
"spirit",
".",
"life",
".",
"dispatch",
"(",
"gui",
".",
"LIFE_ATTACH",
")",
";",
"}"
] | Spirit attach.
@param {gui.Spirit} spirit | [
"Spirit",
"attach",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10234-L10239 |
|
49,497 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(spirit) {
spirit.life.ready = true;
spirit.onready();
spirit.life.dispatch(gui.LIFE_READY);
} | javascript | function(spirit) {
spirit.life.ready = true;
spirit.onready();
spirit.life.dispatch(gui.LIFE_READY);
} | [
"function",
"(",
"spirit",
")",
"{",
"spirit",
".",
"life",
".",
"ready",
"=",
"true",
";",
"spirit",
".",
"onready",
"(",
")",
";",
"spirit",
".",
"life",
".",
"dispatch",
"(",
"gui",
".",
"LIFE_READY",
")",
";",
"}"
] | Spirit ready.
@param {gui.Spirit} spirit | [
"Spirit",
"ready",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10245-L10249 |
|
49,498 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(spirit) {
spirit.window.gui.outside(spirit);
spirit.life.detached = true;
spirit.life.visible = false;
spirit.life.dispatch(gui.LIFE_DETACH);
spirit.life.dispatch(gui.LIFE_INVISIBLE);
spirit.ondetach();
} | javascript | function(spirit) {
spirit.window.gui.outside(spirit);
spirit.life.detached = true;
spirit.life.visible = false;
spirit.life.dispatch(gui.LIFE_DETACH);
spirit.life.dispatch(gui.LIFE_INVISIBLE);
spirit.ondetach();
} | [
"function",
"(",
"spirit",
")",
"{",
"spirit",
".",
"window",
".",
"gui",
".",
"outside",
"(",
"spirit",
")",
";",
"spirit",
".",
"life",
".",
"detached",
"=",
"true",
";",
"spirit",
".",
"life",
".",
"visible",
"=",
"false",
";",
"spirit",
".",
"life",
".",
"dispatch",
"(",
"gui",
".",
"LIFE_DETACH",
")",
";",
"spirit",
".",
"life",
".",
"dispatch",
"(",
"gui",
".",
"LIFE_INVISIBLE",
")",
";",
"spirit",
".",
"ondetach",
"(",
")",
";",
"}"
] | Spirit detach.
@param {gui.Spirit} spirit | [
"Spirit",
"detach",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10255-L10262 |
|
49,499 | wunderbyte/grunt-spiritual-dox | src/js/libs/spiritual-gui.js | function(spirit) {
spirit.life.exited = true;
spirit.life.dispatch(gui.LIFE_EXIT);
spirit.onexit();
} | javascript | function(spirit) {
spirit.life.exited = true;
spirit.life.dispatch(gui.LIFE_EXIT);
spirit.onexit();
} | [
"function",
"(",
"spirit",
")",
"{",
"spirit",
".",
"life",
".",
"exited",
"=",
"true",
";",
"spirit",
".",
"life",
".",
"dispatch",
"(",
"gui",
".",
"LIFE_EXIT",
")",
";",
"spirit",
".",
"onexit",
"(",
")",
";",
"}"
] | Spirit exit.
@param {gui.Spirit} spirit | [
"Spirit",
"exit",
"."
] | 5afcfe31ddbf7d654166aa15b938553b61de5811 | https://github.com/wunderbyte/grunt-spiritual-dox/blob/5afcfe31ddbf7d654166aa15b938553b61de5811/src/js/libs/spiritual-gui.js#L10268-L10272 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.