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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
47,400 | saggiyogesh/nodeportal | public/ckeditor/_source/core/htmlparser.js | function( html )
{
var parts,
tagName,
nextIndex = 0,
cdata; // The collected data inside a CDATA section.
while ( ( parts = this._.htmlPartsRegex.exec( html ) ) )
{
var tagIndex = parts.index;
if ( tagIndex > nextIndex )
{
var text = html.substring( nextIndex, tagIn... | javascript | function( html )
{
var parts,
tagName,
nextIndex = 0,
cdata; // The collected data inside a CDATA section.
while ( ( parts = this._.htmlPartsRegex.exec( html ) ) )
{
var tagIndex = parts.index;
if ( tagIndex > nextIndex )
{
var text = html.substring( nextIndex, tagIn... | [
"function",
"(",
"html",
")",
"{",
"var",
"parts",
",",
"tagName",
",",
"nextIndex",
"=",
"0",
",",
"cdata",
";",
"// The collected data inside a CDATA section.\r",
"while",
"(",
"(",
"parts",
"=",
"this",
".",
"_",
".",
"htmlPartsRegex",
".",
"exec",
"(",
... | Parses text, looking for HTML tokens, like tag openers or closers,
or comments. This function fires the onTagOpen, onTagClose, onText
and onComment function during its execution.
@param {String} html The HTML to be parsed.
@example
var parser = new CKEDITOR.htmlParser();
// The onTagOpen, onTagClose, onText and onComme... | [
"Parses",
"text",
"looking",
"for",
"HTML",
"tokens",
"like",
"tag",
"openers",
"or",
"closers",
"or",
"comments",
".",
"This",
"function",
"fires",
"the",
"onTagOpen",
"onTagClose",
"onText",
"and",
"onComment",
"function",
"during",
"its",
"execution",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/htmlparser.js#L120-L222 | |
47,401 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/selection/plugin.js | function()
{
var cache = this._.cache;
if ( cache.startElement !== undefined )
return cache.startElement;
var node,
sel = this.getNative();
switch ( this.getType() )
{
case CKEDITOR.SELECTION_ELEMENT :
return this.getSelectedElement();
case CKEDITOR.SELECTION_TEXT ... | javascript | function()
{
var cache = this._.cache;
if ( cache.startElement !== undefined )
return cache.startElement;
var node,
sel = this.getNative();
switch ( this.getType() )
{
case CKEDITOR.SELECTION_ELEMENT :
return this.getSelectedElement();
case CKEDITOR.SELECTION_TEXT ... | [
"function",
"(",
")",
"{",
"var",
"cache",
"=",
"this",
".",
"_",
".",
"cache",
";",
"if",
"(",
"cache",
".",
"startElement",
"!==",
"undefined",
")",
"return",
"cache",
".",
"startElement",
";",
"var",
"node",
",",
"sel",
"=",
"this",
".",
"getNativ... | Gets the DOM element in which the selection starts.
@returns {CKEDITOR.dom.element} The element at the beginning of the
selection.
@example
var element = editor.getSelection().<strong>getStartElement()</strong>;
alert( element.getName() ); | [
"Gets",
"the",
"DOM",
"element",
"in",
"which",
"the",
"selection",
"starts",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/selection/plugin.js#L1054-L1124 | |
47,402 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/selection/plugin.js | function()
{
var root,
retval,
range = self.getRanges()[ 0 ],
ancestor = range.getCommonAncestor( 1, 1 ),
tags = { table:1,ul:1,ol:1,dl:1 };
for ( var t in tags )
{
if ( root = ancestor.getAscendant( t, 1 ) )
break;
}
if ( root )
{... | javascript | function()
{
var root,
retval,
range = self.getRanges()[ 0 ],
ancestor = range.getCommonAncestor( 1, 1 ),
tags = { table:1,ul:1,ol:1,dl:1 };
for ( var t in tags )
{
if ( root = ancestor.getAscendant( t, 1 ) )
break;
}
if ( root )
{... | [
"function",
"(",
")",
"{",
"var",
"root",
",",
"retval",
",",
"range",
"=",
"self",
".",
"getRanges",
"(",
")",
"[",
"0",
"]",
",",
"ancestor",
"=",
"range",
".",
"getCommonAncestor",
"(",
"1",
",",
"1",
")",
",",
"tags",
"=",
"{",
"table",
":",
... | If a table or list is fully selected. | [
"If",
"a",
"table",
"or",
"list",
"is",
"fully",
"selected",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/selection/plugin.js#L1150-L1216 | |
47,403 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/selection/plugin.js | function()
{
var ranges = this.getRanges(),
startNode = ranges[ 0 ].startContainer,
endNode = ranges[ ranges.length - 1 ].endContainer;
return startNode.getCommonAncestor( endNode );
} | javascript | function()
{
var ranges = this.getRanges(),
startNode = ranges[ 0 ].startContainer,
endNode = ranges[ ranges.length - 1 ].endContainer;
return startNode.getCommonAncestor( endNode );
} | [
"function",
"(",
")",
"{",
"var",
"ranges",
"=",
"this",
".",
"getRanges",
"(",
")",
",",
"startNode",
"=",
"ranges",
"[",
"0",
"]",
".",
"startContainer",
",",
"endNode",
"=",
"ranges",
"[",
"ranges",
".",
"length",
"-",
"1",
"]",
".",
"endContainer... | Retrieves the common ancestor node of the first range and the last range.
@returns {CKEDITOR.dom.element} The common ancestor of the selection.
@example
var ancestor = editor.getSelection().<strong>getCommonAncestor()</strong>; | [
"Retrieves",
"the",
"common",
"ancestor",
"node",
"of",
"the",
"first",
"range",
"and",
"the",
"last",
"range",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/selection/plugin.js#L1577-L1583 | |
47,404 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/entities/plugin.js | buildTable | function buildTable( entities, reverse )
{
var table = {},
regex = [];
// Entities that the browsers DOM don't transform to the final char
// automatically.
var specialTable =
{
nbsp : '\u00A0', // IE | FF
shy : '\u00AD', // IE
gt : '\u003E', // IE | FF | -- | Opera
... | javascript | function buildTable( entities, reverse )
{
var table = {},
regex = [];
// Entities that the browsers DOM don't transform to the final char
// automatically.
var specialTable =
{
nbsp : '\u00A0', // IE | FF
shy : '\u00AD', // IE
gt : '\u003E', // IE | FF | -- | Opera
... | [
"function",
"buildTable",
"(",
"entities",
",",
"reverse",
")",
"{",
"var",
"table",
"=",
"{",
"}",
",",
"regex",
"=",
"[",
"]",
";",
"// Entities that the browsers DOM don't transform to the final char\r",
"// automatically.\r",
"var",
"specialTable",
"=",
"{",
"nb... | Create a mapping table between one character and its entity form from a list of entity names.
@param reverse {Boolean} Whether to create a reverse map from the entity string form to an actual character. | [
"Create",
"a",
"mapping",
"table",
"between",
"one",
"character",
"and",
"its",
"entity",
"form",
"from",
"a",
"list",
"of",
"entity",
"names",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/entities/plugin.js#L52-L103 |
47,405 | philmander/inverted | lib/inverted.js | function(config) {
this.config = config;
this.appContext = null;
this.injectAppContext = this.config.injectAppContext === true ? true : false;
//cache of loaded dependencies
this.moduleMap = {};
} | javascript | function(config) {
this.config = config;
this.appContext = null;
this.injectAppContext = this.config.injectAppContext === true ? true : false;
//cache of loaded dependencies
this.moduleMap = {};
} | [
"function",
"(",
"config",
")",
"{",
"this",
".",
"config",
"=",
"config",
";",
"this",
".",
"appContext",
"=",
"null",
";",
"this",
".",
"injectAppContext",
"=",
"this",
".",
"config",
".",
"injectAppContext",
"===",
"true",
"?",
"true",
":",
"false",
... | Create a new ProtoFactory with config
@constructor
@param {Object} config | [
"Create",
"a",
"new",
"ProtoFactory",
"with",
"config"
] | af49a1ab2f501a19c457a8b41a40306e12103bf4 | https://github.com/philmander/inverted/blob/af49a1ab2f501a19c457a8b41a40306e12103bf4/lib/inverted.js#L282-L291 | |
47,406 | philmander/inverted | lib/inverted.js | function(config, protoFactory, originalModule) {
this.config = config;
this.protoFactory = protoFactory;
this.originalModule = originalModule || module;
//defines if circular dependencies should throw an error or be gracefully handled
this.allowCircular = this.config.allowCircular || false;
this.modules =... | javascript | function(config, protoFactory, originalModule) {
this.config = config;
this.protoFactory = protoFactory;
this.originalModule = originalModule || module;
//defines if circular dependencies should throw an error or be gracefully handled
this.allowCircular = this.config.allowCircular || false;
this.modules =... | [
"function",
"(",
"config",
",",
"protoFactory",
",",
"originalModule",
")",
"{",
"this",
".",
"config",
"=",
"config",
";",
"this",
".",
"protoFactory",
"=",
"protoFactory",
";",
"this",
".",
"originalModule",
"=",
"originalModule",
"||",
"module",
";",
"//d... | Create a new AppContext with config
@constructor
@param {Object} config
@param {Object} protoFactory
@param {Object} originalModule The original node module use to load node modules on the right path | [
"Create",
"a",
"new",
"AppContext",
"with",
"config"
] | af49a1ab2f501a19c457a8b41a40306e12103bf4 | https://github.com/philmander/inverted/blob/af49a1ab2f501a19c457a8b41a40306e12103bf4/lib/inverted.js#L695-L712 | |
47,407 | slideme/rorschach | lib/ConnectionState.js | ConnectionState | function ConnectionState(code, stringId, connected) {
if (arguments.length === 2) {
connected = stringId;
stringId = 'NONAME';
}
if (!(this instanceof ConnectionState)) {
return new ConnectionState(code, stringId, connected);
}
this.id = stringId;
this.code = code;
this.connected = connected;... | javascript | function ConnectionState(code, stringId, connected) {
if (arguments.length === 2) {
connected = stringId;
stringId = 'NONAME';
}
if (!(this instanceof ConnectionState)) {
return new ConnectionState(code, stringId, connected);
}
this.id = stringId;
this.code = code;
this.connected = connected;... | [
"function",
"ConnectionState",
"(",
"code",
",",
"stringId",
",",
"connected",
")",
"{",
"if",
"(",
"arguments",
".",
"length",
"===",
"2",
")",
"{",
"connected",
"=",
"stringId",
";",
"stringId",
"=",
"'NONAME'",
";",
"}",
"if",
"(",
"!",
"(",
"this",... | Connection state.
@constructor
@param {Number} code
@param {String} stringId
@param {Boolean} connected | [
"Connection",
"state",
"."
] | 899339baf31682f8a62b2960cdd26fbb58a9e3a1 | https://github.com/slideme/rorschach/blob/899339baf31682f8a62b2960cdd26fbb58a9e3a1/lib/ConnectionState.js#L12-L24 |
47,408 | saggiyogesh/nodeportal | public/ckeditor/_source/core/htmlparser/element.js | function( obj )
{
var style = this.toString();
if ( style )
{
obj instanceof CKEDITOR.dom.element ?
obj.setAttribute( 'style', style ) :
obj instanceof CKEDITOR.htmlParser.element ?
obj.attributes.style = style :
obj.style = style;
}
} | javascript | function( obj )
{
var style = this.toString();
if ( style )
{
obj instanceof CKEDITOR.dom.element ?
obj.setAttribute( 'style', style ) :
obj instanceof CKEDITOR.htmlParser.element ?
obj.attributes.style = style :
obj.style = style;
}
} | [
"function",
"(",
"obj",
")",
"{",
"var",
"style",
"=",
"this",
".",
"toString",
"(",
")",
";",
"if",
"(",
"style",
")",
"{",
"obj",
"instanceof",
"CKEDITOR",
".",
"dom",
".",
"element",
"?",
"obj",
".",
"setAttribute",
"(",
"'style'",
",",
"style",
... | Apply the styles onto the specified element or object.
@param {CKEDITOR.htmlParser.element|CKEDITOR.dom.element|Object} obj | [
"Apply",
"the",
"styles",
"onto",
"the",
"specified",
"element",
"or",
"object",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/htmlparser/element.js#L95-L106 | |
47,409 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/clipboard/plugin.js | function( event )
{
if ( this.mode != 'wysiwyg' )
return;
switch ( event.data.keyCode )
{
// Paste
case CKEDITOR.CTRL + 86 : // CTRL+V
case CKEDITOR.SHIFT + 45 : // SHIFT+INS
var body = this.document.getBody();
// Simulate 'beforepaste' event for all none-IEs.
if ( !CKE... | javascript | function( event )
{
if ( this.mode != 'wysiwyg' )
return;
switch ( event.data.keyCode )
{
// Paste
case CKEDITOR.CTRL + 86 : // CTRL+V
case CKEDITOR.SHIFT + 45 : // SHIFT+INS
var body = this.document.getBody();
// Simulate 'beforepaste' event for all none-IEs.
if ( !CKE... | [
"function",
"(",
"event",
")",
"{",
"if",
"(",
"this",
".",
"mode",
"!=",
"'wysiwyg'",
")",
"return",
";",
"switch",
"(",
"event",
".",
"data",
".",
"keyCode",
")",
"{",
"// Paste\r",
"case",
"CKEDITOR",
".",
"CTRL",
"+",
"86",
":",
"// CTRL+V\r",
"c... | Listens for some clipboard related keystrokes, so they get customized. | [
"Listens",
"for",
"some",
"clipboard",
"related",
"keystrokes",
"so",
"they",
"get",
"customized",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/clipboard/plugin.js#L125-L159 | |
47,410 | hitsujiwool/node-holiday-jp | index.js | function(start, end) {
var date;
var res = [];
for (var key in holidays) {
date = beginningOfDay(new Date(key));
// given `start` and `end` Date object are both normalized to beginning of the day
if (beginningOfDay(start) <= date && date <= beginningOfDay(end)) {
res.push(holiday(d... | javascript | function(start, end) {
var date;
var res = [];
for (var key in holidays) {
date = beginningOfDay(new Date(key));
// given `start` and `end` Date object are both normalized to beginning of the day
if (beginningOfDay(start) <= date && date <= beginningOfDay(end)) {
res.push(holiday(d... | [
"function",
"(",
"start",
",",
"end",
")",
"{",
"var",
"date",
";",
"var",
"res",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"key",
"in",
"holidays",
")",
"{",
"date",
"=",
"beginningOfDay",
"(",
"new",
"Date",
"(",
"key",
")",
")",
";",
"// given `s... | Find holidays between `start` and `end`.
@param {Date} start
@param {Date} end
@return {Array[Object]}
@api public | [
"Find",
"holidays",
"between",
"start",
"and",
"end",
"."
] | d5d397ddd3a443ce0210ba05dc46a01b0668378d | https://github.com/hitsujiwool/node-holiday-jp/blob/d5d397ddd3a443ce0210ba05dc46a01b0668378d/index.js#L28-L39 | |
47,411 | saggiyogesh/nodeportal | lib/Router.js | Route | function Route(method, route, fn) {
this.method = method;
this.route = route;
this.fn = fn;
return function (app) {
var middleware = exports.isAppSettingsRoute(route) ? utils.getSettingsMiddlewares() :
utils.getRequestMiddlewares();
if (method == "get") {
app.ge... | javascript | function Route(method, route, fn) {
this.method = method;
this.route = route;
this.fn = fn;
return function (app) {
var middleware = exports.isAppSettingsRoute(route) ? utils.getSettingsMiddlewares() :
utils.getRequestMiddlewares();
if (method == "get") {
app.ge... | [
"function",
"Route",
"(",
"method",
",",
"route",
",",
"fn",
")",
"{",
"this",
".",
"method",
"=",
"method",
";",
"this",
".",
"route",
"=",
"route",
";",
"this",
".",
"fn",
"=",
"fn",
";",
"return",
"function",
"(",
"app",
")",
"{",
"var",
"midd... | Returns a fn, which return the express route object
@param method
@param route
@param fn | [
"Returns",
"a",
"fn",
"which",
"return",
"the",
"express",
"route",
"object"
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/lib/Router.js#L35-L53 |
47,412 | cloud9ide/frontdoor | lib/route.js | normalizePath | function normalizePath(path, keys, params) {
for (var name in params) {
var param = params[name];
if (typeof param == "string" || param instanceof RegExp)
params[name] = {type: param};
}
path = path
.concat("/?")
.replace(/\/:([\w.... | javascript | function normalizePath(path, keys, params) {
for (var name in params) {
var param = params[name];
if (typeof param == "string" || param instanceof RegExp)
params[name] = {type: param};
}
path = path
.concat("/?")
.replace(/\/:([\w.... | [
"function",
"normalizePath",
"(",
"path",
",",
"keys",
",",
"params",
")",
"{",
"for",
"(",
"var",
"name",
"in",
"params",
")",
"{",
"var",
"param",
"=",
"params",
"[",
"name",
"]",
";",
"if",
"(",
"typeof",
"param",
"==",
"\"string\"",
"||",
"param"... | Creates a rgular expression to match this route.
Url param names are stored in `keys` and the `params` are completed with
the default values for url parameters. | [
"Creates",
"a",
"rgular",
"expression",
"to",
"match",
"this",
"route",
".",
"Url",
"param",
"names",
"are",
"stored",
"in",
"keys",
"and",
"the",
"params",
"are",
"completed",
"with",
"the",
"default",
"values",
"for",
"url",
"parameters",
"."
] | d29907494ef2259235b7f331dd7e225b5c186cd6 | https://github.com/cloud9ide/frontdoor/blob/d29907494ef2259235b7f331dd7e225b5c186cd6/lib/route.js#L54-L89 |
47,413 | dominictarr/web-bootloader | bootloader.js | function (target, cb) {
if(!target) return cb(new Error('WebBoot.prune: size to clear must be provided'))
var cleared = 0, remove = []
function clear () {
var n = remove.length
while(remove.length) store.rm(remove.shift(), function () {
if(--n) return
if(clea... | javascript | function (target, cb) {
if(!target) return cb(new Error('WebBoot.prune: size to clear must be provided'))
var cleared = 0, remove = []
function clear () {
var n = remove.length
while(remove.length) store.rm(remove.shift(), function () {
if(--n) return
if(clea... | [
"function",
"(",
"target",
",",
"cb",
")",
"{",
"if",
"(",
"!",
"target",
")",
"return",
"cb",
"(",
"new",
"Error",
"(",
"'WebBoot.prune: size to clear must be provided'",
")",
")",
"var",
"cleared",
"=",
"0",
",",
"remove",
"=",
"[",
"]",
"function",
"c... | clear target amount of space. | [
"clear",
"target",
"amount",
"of",
"space",
"."
] | de995bc3e41ba4db94a6de41388dfe676ed37a7e | https://github.com/dominictarr/web-bootloader/blob/de995bc3e41ba4db94a6de41388dfe676ed37a7e/bootloader.js#L108-L152 | |
47,414 | jhermsmeier/node-speech | lib/distance/dice.js | dice | function dice( source, target ) {
var sources = dice.prepare( source )
var targets = dice.prepare( target )
var i, k, intersection = 0
var source_count = sources.length
var target_count = targets.length
var union = source_count + target_count
for( i = 0; i < source_count; i++ ) {
source = sou... | javascript | function dice( source, target ) {
var sources = dice.prepare( source )
var targets = dice.prepare( target )
var i, k, intersection = 0
var source_count = sources.length
var target_count = targets.length
var union = source_count + target_count
for( i = 0; i < source_count; i++ ) {
source = sou... | [
"function",
"dice",
"(",
"source",
",",
"target",
")",
"{",
"var",
"sources",
"=",
"dice",
".",
"prepare",
"(",
"source",
")",
"var",
"targets",
"=",
"dice",
".",
"prepare",
"(",
"target",
")",
"var",
"i",
",",
"k",
",",
"intersection",
"=",
"0",
"... | Computes dice's coefficient.
@param {String} source
@param {String} target
@return {Number} dice coefficient | [
"Computes",
"dice",
"s",
"coefficient",
"."
] | 984c4dd6e2fe640c01267f10e3804ef81391e73a | https://github.com/jhermsmeier/node-speech/blob/984c4dd6e2fe640c01267f10e3804ef81391e73a/lib/distance/dice.js#L9-L33 |
47,415 | reklatsmasters/unicast | lib/create-socket.js | createSocket | function createSocket(socket, options = {}) {
if (!isSocket(socket)) {
options = socket; // eslint-disable-line no-param-reassign
if (isSocket(options.socket)) {
// eslint-disable-next-line no-param-reassign, prefer-destructuring
socket = options.socket;
} else {
socket = dgram.createSo... | javascript | function createSocket(socket, options = {}) {
if (!isSocket(socket)) {
options = socket; // eslint-disable-line no-param-reassign
if (isSocket(options.socket)) {
// eslint-disable-next-line no-param-reassign, prefer-destructuring
socket = options.socket;
} else {
socket = dgram.createSo... | [
"function",
"createSocket",
"(",
"socket",
",",
"options",
"=",
"{",
"}",
")",
"{",
"if",
"(",
"!",
"isSocket",
"(",
"socket",
")",
")",
"{",
"options",
"=",
"socket",
";",
"// eslint-disable-line no-param-reassign",
"if",
"(",
"isSocket",
"(",
"options",
... | Create a new UDP unicast socket.
@param {dgram.Socket|string|object} socket
@param {object} [options]
@return {Socket} | [
"Create",
"a",
"new",
"UDP",
"unicast",
"socket",
"."
] | fe83eb884bcd8687e50a4b5163a5af584d32444b | https://github.com/reklatsmasters/unicast/blob/fe83eb884bcd8687e50a4b5163a5af584d32444b/lib/create-socket.js#L16-L30 |
47,416 | levilindsey/physx | src/collisions/contact-calculation/src/sphere-contact-calculation.js | sphereVsAabb | function sphereVsAabb(contactPoint, contactNormal, sphere, aabb) {
findClosestPointFromAabbSurfaceToPoint(contactPoint, aabb, sphere.centerOfVolume);
findAabbNormalFromContactPoint(contactNormal, contactPoint, aabb);
vec3.negate(contactNormal, contactNormal);
} | javascript | function sphereVsAabb(contactPoint, contactNormal, sphere, aabb) {
findClosestPointFromAabbSurfaceToPoint(contactPoint, aabb, sphere.centerOfVolume);
findAabbNormalFromContactPoint(contactNormal, contactPoint, aabb);
vec3.negate(contactNormal, contactNormal);
} | [
"function",
"sphereVsAabb",
"(",
"contactPoint",
",",
"contactNormal",
",",
"sphere",
",",
"aabb",
")",
"{",
"findClosestPointFromAabbSurfaceToPoint",
"(",
"contactPoint",
",",
"aabb",
",",
"sphere",
".",
"centerOfVolume",
")",
";",
"findAabbNormalFromContactPoint",
"... | Finds the closest point on the surface of the AABB to the sphere center.
@param {vec3} contactPoint Output param.
@param {vec3} contactNormal Output param.
@param {Sphere} sphere
@param {Aabb} aabb | [
"Finds",
"the",
"closest",
"point",
"on",
"the",
"surface",
"of",
"the",
"AABB",
"to",
"the",
"sphere",
"center",
"."
] | 62df9f6968082ed34aa784a23f3db6c8feca6f3a | https://github.com/levilindsey/physx/blob/62df9f6968082ed34aa784a23f3db6c8feca6f3a/src/collisions/contact-calculation/src/sphere-contact-calculation.js#L48-L52 |
47,417 | imcuttle/tiny-i18n | packages/react-live/src/index.js | argsGetter | function argsGetter(args, lang) {
return args.map(arg =>
rStrip(
String(arg),
(s, a, b, c, count) => {
const data = JSON.parse(s)
return toWrappedString(translatedGetter(data[0], () => data.slice(1), lang), void 0, count)
... | javascript | function argsGetter(args, lang) {
return args.map(arg =>
rStrip(
String(arg),
(s, a, b, c, count) => {
const data = JSON.parse(s)
return toWrappedString(translatedGetter(data[0], () => data.slice(1), lang), void 0, count)
... | [
"function",
"argsGetter",
"(",
"args",
",",
"lang",
")",
"{",
"return",
"args",
".",
"map",
"(",
"arg",
"=>",
"rStrip",
"(",
"String",
"(",
"arg",
")",
",",
"(",
"s",
",",
"a",
",",
"b",
",",
"c",
",",
"count",
")",
"=>",
"{",
"const",
"data",
... | Strips the outermost wrapper | [
"Strips",
"the",
"outermost",
"wrapper"
] | 2b37e4a189918d9e8cd0c9cecb41940c9257e8cb | https://github.com/imcuttle/tiny-i18n/blob/2b37e4a189918d9e8cd0c9cecb41940c9257e8cb/packages/react-live/src/index.js#L91-L102 |
47,418 | mitchwinn/gulp-serve-iis-express | lib/index.js | startSites | function startSites(config){
config.siteNames.forEach(function(item){
var cmd = 'iisexpress /site:"' + item + '"';
if(config.configFile !== ""){
cmd += ' /config:"' + config.configFile + '"';
}
if (config.sysTray){
cmd += ' /syst... | javascript | function startSites(config){
config.siteNames.forEach(function(item){
var cmd = 'iisexpress /site:"' + item + '"';
if(config.configFile !== ""){
cmd += ' /config:"' + config.configFile + '"';
}
if (config.sysTray){
cmd += ' /syst... | [
"function",
"startSites",
"(",
"config",
")",
"{",
"config",
".",
"siteNames",
".",
"forEach",
"(",
"function",
"(",
"item",
")",
"{",
"var",
"cmd",
"=",
"'iisexpress /site:\"'",
"+",
"item",
"+",
"'\"'",
";",
"if",
"(",
"config",
".",
"configFile",
"!==... | starting the sites. | [
"starting",
"the",
"sites",
"."
] | 34e00e8c8a717e82e8b2cd69a98deec1daf41b51 | https://github.com/mitchwinn/gulp-serve-iis-express/blob/34e00e8c8a717e82e8b2cd69a98deec1daf41b51/lib/index.js#L98-L122 |
47,419 | kaelzhang/node-semver-extra | index.js | maxPrerelease | function maxPrerelease (versions, prerelease) {
return first(desc(versions), function (version) {
return isPrerelease(version, prerelease);
});
} | javascript | function maxPrerelease (versions, prerelease) {
return first(desc(versions), function (version) {
return isPrerelease(version, prerelease);
});
} | [
"function",
"maxPrerelease",
"(",
"versions",
",",
"prerelease",
")",
"{",
"return",
"first",
"(",
"desc",
"(",
"versions",
")",
",",
"function",
"(",
"version",
")",
"{",
"return",
"isPrerelease",
"(",
"version",
",",
"prerelease",
")",
";",
"}",
")",
"... | Returns the max prerelease version of the maximun matched prerelease version | [
"Returns",
"the",
"max",
"prerelease",
"version",
"of",
"the",
"maximun",
"matched",
"prerelease",
"version"
] | eb249cfe9c7d32c8141481314d37bd02d619bfd9 | https://github.com/kaelzhang/node-semver-extra/blob/eb249cfe9c7d32c8141481314d37bd02d619bfd9/index.js#L49-L53 |
47,420 | kaelzhang/node-semver-extra | index.js | first | function first (array, filter) {
var i = 0;
var length = array.length;
var item;
for (; i < length; i ++) {
item = array[i];
if (filter(item)) {
return item;
}
}
return null;
} | javascript | function first (array, filter) {
var i = 0;
var length = array.length;
var item;
for (; i < length; i ++) {
item = array[i];
if (filter(item)) {
return item;
}
}
return null;
} | [
"function",
"first",
"(",
"array",
",",
"filter",
")",
"{",
"var",
"i",
"=",
"0",
";",
"var",
"length",
"=",
"array",
".",
"length",
";",
"var",
"item",
";",
"for",
"(",
";",
"i",
"<",
"length",
";",
"i",
"++",
")",
"{",
"item",
"=",
"array",
... | Returns the first matched array item | [
"Returns",
"the",
"first",
"matched",
"array",
"item"
] | eb249cfe9c7d32c8141481314d37bd02d619bfd9 | https://github.com/kaelzhang/node-semver-extra/blob/eb249cfe9c7d32c8141481314d37bd02d619bfd9/index.js#L66-L78 |
47,421 | creationix/git-node | examples/create.js | serialEach | function serialEach(object, fn, callback) {
var keys = Object.keys(object);
next();
function next(err) {
if (err) return callback(err);
var key = keys.shift();
if (!key) return callback();
fn(key, object[key], next);
}
} | javascript | function serialEach(object, fn, callback) {
var keys = Object.keys(object);
next();
function next(err) {
if (err) return callback(err);
var key = keys.shift();
if (!key) return callback();
fn(key, object[key], next);
}
} | [
"function",
"serialEach",
"(",
"object",
",",
"fn",
",",
"callback",
")",
"{",
"var",
"keys",
"=",
"Object",
".",
"keys",
"(",
"object",
")",
";",
"next",
"(",
")",
";",
"function",
"next",
"(",
"err",
")",
"{",
"if",
"(",
"err",
")",
"return",
"... | Mini control-flow library | [
"Mini",
"control",
"-",
"flow",
"library"
] | 74d927d0168ce1592303ac2f030e2ee6314ad6c6 | https://github.com/creationix/git-node/blob/74d927d0168ce1592303ac2f030e2ee6314ad6c6/examples/create.js#L51-L60 |
47,422 | saggiyogesh/nodeportal | lib/permissions/Cache.js | CacheItem | function CacheItem(permissionSchemaKey, actionsValue, permissions) {
if (!actionsValue) {
if (!utils.contains(permissionSchemaKey, TRIPLE_UNDERSCORE)) {
throw new Error("Invalid permissions schema key.")
}
else {
var key = permissionSchemaKey.split(TRIPLE_UNDERSCORE)[... | javascript | function CacheItem(permissionSchemaKey, actionsValue, permissions) {
if (!actionsValue) {
if (!utils.contains(permissionSchemaKey, TRIPLE_UNDERSCORE)) {
throw new Error("Invalid permissions schema key.")
}
else {
var key = permissionSchemaKey.split(TRIPLE_UNDERSCORE)[... | [
"function",
"CacheItem",
"(",
"permissionSchemaKey",
",",
"actionsValue",
",",
"permissions",
")",
"{",
"if",
"(",
"!",
"actionsValue",
")",
"{",
"if",
"(",
"!",
"utils",
".",
"contains",
"(",
"permissionSchemaKey",
",",
"TRIPLE_UNDERSCORE",
")",
")",
"{",
"... | Constructor to create cache item
@param permissionSchemaKey {String} unique key
@param actionsValue {Object} Object to Action key with value
@param permissions {Object} Object having array of permissions to each role.
@constructor | [
"Constructor",
"to",
"create",
"cache",
"item"
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/lib/permissions/Cache.js#L21-L82 |
47,423 | saggiyogesh/nodeportal | lib/permissions/Cache.js | storeModel | function storeModel(model, permissionSchemaKey) {
if (model && model.rolePermissions) {
var obj = {
permissionSchemaKey: permissionSchemaKey,
rolePermissions: model.rolePermissions
};
exports.store(obj);
}
} | javascript | function storeModel(model, permissionSchemaKey) {
if (model && model.rolePermissions) {
var obj = {
permissionSchemaKey: permissionSchemaKey,
rolePermissions: model.rolePermissions
};
exports.store(obj);
}
} | [
"function",
"storeModel",
"(",
"model",
",",
"permissionSchemaKey",
")",
"{",
"if",
"(",
"model",
"&&",
"model",
".",
"rolePermissions",
")",
"{",
"var",
"obj",
"=",
"{",
"permissionSchemaKey",
":",
"permissionSchemaKey",
",",
"rolePermissions",
":",
"model",
... | Method storing model's role permissions to cache
@param model {Object}
@param permissionSchemaKey {String} | [
"Method",
"storing",
"model",
"s",
"role",
"permissions",
"to",
"cache"
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/lib/permissions/Cache.js#L89-L97 |
47,424 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/stylescombo/plugin.js | function()
{
if ( combo )
{
delete combo._.panel;
delete combo._.list;
combo._.committed = 0;
combo._.items = {};
combo._.state = CKEDITOR.TRISTATE_OFF;
}
styles = {};
stylesList = [];
loadStylesSet();
} | javascript | function()
{
if ( combo )
{
delete combo._.panel;
delete combo._.list;
combo._.committed = 0;
combo._.items = {};
combo._.state = CKEDITOR.TRISTATE_OFF;
}
styles = {};
stylesList = [];
loadStylesSet();
} | [
"function",
"(",
")",
"{",
"if",
"(",
"combo",
")",
"{",
"delete",
"combo",
".",
"_",
".",
"panel",
";",
"delete",
"combo",
".",
"_",
".",
"list",
";",
"combo",
".",
"_",
".",
"committed",
"=",
"0",
";",
"combo",
".",
"_",
".",
"items",
"=",
... | Force a reload of the data | [
"Force",
"a",
"reload",
"of",
"the",
"data"
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/stylescombo/plugin.js#L187-L200 | |
47,425 | azu/spellcheck-technical-word | lib/spellcheck-technical-word.js | spellCheckText | function spellCheckText(text) {
var src = new StructuredSource(text);
var results = [];
for (var i = 0, length = dictionaryItems.length; i < length; i++) {
var dictionary = dictionaryItems[i];
var query = new RegExp(dictionary.pattern, dictionary.flag);
var match = query.exec(text);
... | javascript | function spellCheckText(text) {
var src = new StructuredSource(text);
var results = [];
for (var i = 0, length = dictionaryItems.length; i < length; i++) {
var dictionary = dictionaryItems[i];
var query = new RegExp(dictionary.pattern, dictionary.flag);
var match = query.exec(text);
... | [
"function",
"spellCheckText",
"(",
"text",
")",
"{",
"var",
"src",
"=",
"new",
"StructuredSource",
"(",
"text",
")",
";",
"var",
"results",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"length",
"=",
"dictionaryItems",
".",
"length",
";... | spell check the text, then return array of result.
@param {string} text
@returns {SpellCheckResult[]} | [
"spell",
"check",
"the",
"text",
"then",
"return",
"array",
"of",
"result",
"."
] | 11aad9e2f89c6cccc0e9387669ce56c83366e204 | https://github.com/azu/spellcheck-technical-word/blob/11aad9e2f89c6cccc0e9387669ce56c83366e204/lib/spellcheck-technical-word.js#L9-L54 |
47,426 | saggiyogesh/nodeportal | lib/Renderer/SettingsErrorRenderer.js | SettingsErrorRenderer | function SettingsErrorRenderer(err, req, res) {
SettingsRenderer.call(this, req, res);
Object.defineProperties(this, {
err: {
value: err || new Error()
}
});
req.attrs.isErrorPage = true;
} | javascript | function SettingsErrorRenderer(err, req, res) {
SettingsRenderer.call(this, req, res);
Object.defineProperties(this, {
err: {
value: err || new Error()
}
});
req.attrs.isErrorPage = true;
} | [
"function",
"SettingsErrorRenderer",
"(",
"err",
",",
"req",
",",
"res",
")",
"{",
"SettingsRenderer",
".",
"call",
"(",
"this",
",",
"req",
",",
"res",
")",
";",
"Object",
".",
"defineProperties",
"(",
"this",
",",
"{",
"err",
":",
"{",
"value",
":",
... | Constructor to create SettingsErrorRenderer
@param err
@param req
@param res
@constructor | [
"Constructor",
"to",
"create",
"SettingsErrorRenderer"
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/lib/Renderer/SettingsErrorRenderer.js#L15-L23 |
47,427 | jchook/virtual-dom-handlebars | lib/Template.js | reset | function reset(html) {
this.html = html || this.html;
this.root = new VNode('div');
this.node = this.root; // current working node
this.path = []; // current working node parents
this.blocks = []; // recursive components
} | javascript | function reset(html) {
this.html = html || this.html;
this.root = new VNode('div');
this.node = this.root; // current working node
this.path = []; // current working node parents
this.blocks = []; // recursive components
} | [
"function",
"reset",
"(",
"html",
")",
"{",
"this",
".",
"html",
"=",
"html",
"||",
"this",
".",
"html",
";",
"this",
".",
"root",
"=",
"new",
"VNode",
"(",
"'div'",
")",
";",
"this",
".",
"node",
"=",
"this",
".",
"root",
";",
"// current working ... | Update the HTML | [
"Update",
"the",
"HTML"
] | d1c2015449bad8489572114fe3d8facef2cce367 | https://github.com/jchook/virtual-dom-handlebars/blob/d1c2015449bad8489572114fe3d8facef2cce367/lib/Template.js#L87-L93 |
47,428 | jchook/virtual-dom-handlebars | lib/Template.js | push | function push() {
this.path.push(this.node);
this.node = this.node.children[this.node.children.length - 1];
} | javascript | function push() {
this.path.push(this.node);
this.node = this.node.children[this.node.children.length - 1];
} | [
"function",
"push",
"(",
")",
"{",
"this",
".",
"path",
".",
"push",
"(",
"this",
".",
"node",
")",
";",
"this",
".",
"node",
"=",
"this",
".",
"node",
".",
"children",
"[",
"this",
".",
"node",
".",
"children",
".",
"length",
"-",
"1",
"]",
";... | Move cursor to the latest child of the current node | [
"Move",
"cursor",
"to",
"the",
"latest",
"child",
"of",
"the",
"current",
"node"
] | d1c2015449bad8489572114fe3d8facef2cce367 | https://github.com/jchook/virtual-dom-handlebars/blob/d1c2015449bad8489572114fe3d8facef2cce367/lib/Template.js#L113-L116 |
47,429 | jchook/virtual-dom-handlebars | lib/Template.js | ontext | function ontext(template, text, config) {
var
blockStubPos = -1,
cursor = 0,
children = null,
nodes = []
;
config = extend({virtual: template.virtual}, config);
// Ensures that consecutive textOnly components are merged into a single VText node
function concatText(text) {
if ((nodes.length > 0) && nod... | javascript | function ontext(template, text, config) {
var
blockStubPos = -1,
cursor = 0,
children = null,
nodes = []
;
config = extend({virtual: template.virtual}, config);
// Ensures that consecutive textOnly components are merged into a single VText node
function concatText(text) {
if ((nodes.length > 0) && nod... | [
"function",
"ontext",
"(",
"template",
",",
"text",
",",
"config",
")",
"{",
"var",
"blockStubPos",
"=",
"-",
"1",
",",
"cursor",
"=",
"0",
",",
"children",
"=",
"null",
",",
"nodes",
"=",
"[",
"]",
";",
"config",
"=",
"extend",
"(",
"{",
"virtual"... | ontext helper for html parsing ensure that blocks are handled | [
"ontext",
"helper",
"for",
"html",
"parsing",
"ensure",
"that",
"blocks",
"are",
"handled"
] | d1c2015449bad8489572114fe3d8facef2cce367 | https://github.com/jchook/virtual-dom-handlebars/blob/d1c2015449bad8489572114fe3d8facef2cce367/lib/Template.js#L132-L195 |
47,430 | jchook/virtual-dom-handlebars | lib/Template.js | concatText | function concatText(text) {
if ((nodes.length > 0) && nodes[nodes.length - 1].addText) {
nodes[nodes.length - 1].addText(text);
} else {
nodes.push(new VText(text, config));
}
} | javascript | function concatText(text) {
if ((nodes.length > 0) && nodes[nodes.length - 1].addText) {
nodes[nodes.length - 1].addText(text);
} else {
nodes.push(new VText(text, config));
}
} | [
"function",
"concatText",
"(",
"text",
")",
"{",
"if",
"(",
"(",
"nodes",
".",
"length",
">",
"0",
")",
"&&",
"nodes",
"[",
"nodes",
".",
"length",
"-",
"1",
"]",
".",
"addText",
")",
"{",
"nodes",
"[",
"nodes",
".",
"length",
"-",
"1",
"]",
".... | Ensures that consecutive textOnly components are merged into a single VText node | [
"Ensures",
"that",
"consecutive",
"textOnly",
"components",
"are",
"merged",
"into",
"a",
"single",
"VText",
"node"
] | d1c2015449bad8489572114fe3d8facef2cce367 | https://github.com/jchook/virtual-dom-handlebars/blob/d1c2015449bad8489572114fe3d8facef2cce367/lib/Template.js#L143-L149 |
47,431 | jchook/virtual-dom-handlebars | lib/Template.js | attributesToJavascript | function attributesToJavascript(template, attr) {
var i, name, value, js = [];
for (i in attr) {
if (attr.hasOwnProperty(i)) {
// Translate
name = Template.HTML_ATTRIBUTES[i] ? Template.HTML_ATTRIBUTES[i] : i;
// Potentially interpolated attributes
if (typeof attr[i] === 'string') {
if (attr[i].le... | javascript | function attributesToJavascript(template, attr) {
var i, name, value, js = [];
for (i in attr) {
if (attr.hasOwnProperty(i)) {
// Translate
name = Template.HTML_ATTRIBUTES[i] ? Template.HTML_ATTRIBUTES[i] : i;
// Potentially interpolated attributes
if (typeof attr[i] === 'string') {
if (attr[i].le... | [
"function",
"attributesToJavascript",
"(",
"template",
",",
"attr",
")",
"{",
"var",
"i",
",",
"name",
",",
"value",
",",
"js",
"=",
"[",
"]",
";",
"for",
"(",
"i",
"in",
"attr",
")",
"{",
"if",
"(",
"attr",
".",
"hasOwnProperty",
"(",
"i",
")",
... | Not particularly proud of this function.. obv it should probably be located in some kind of AttributeList class or something, but as it stands, the use of htmlparser2 requires a more 'aware' parser to do proper block parsing | [
"Not",
"particularly",
"proud",
"of",
"this",
"function",
"..",
"obv",
"it",
"should",
"probably",
"be",
"located",
"in",
"some",
"kind",
"of",
"AttributeList",
"class",
"or",
"something",
"but",
"as",
"it",
"stands",
"the",
"use",
"of",
"htmlparser2",
"requ... | d1c2015449bad8489572114fe3d8facef2cce367 | https://github.com/jchook/virtual-dom-handlebars/blob/d1c2015449bad8489572114fe3d8facef2cce367/lib/Template.js#L201-L223 |
47,432 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/link/dialogs/link.js | function()
{
var dialog = this.getDialog(),
popupFeatures = dialog.getContentElement( 'target', 'popupFeatures' ),
targetName = dialog.getContentElement( 'target', 'linkTargetName' ),
value = this.getValue();
if ( !popupFeatures || !targetName )
return;
popupFeatures = popupFeatures.getEl... | javascript | function()
{
var dialog = this.getDialog(),
popupFeatures = dialog.getContentElement( 'target', 'popupFeatures' ),
targetName = dialog.getContentElement( 'target', 'linkTargetName' ),
value = this.getValue();
if ( !popupFeatures || !targetName )
return;
popupFeatures = popupFeatures.getEl... | [
"function",
"(",
")",
"{",
"var",
"dialog",
"=",
"this",
".",
"getDialog",
"(",
")",
",",
"popupFeatures",
"=",
"dialog",
".",
"getContentElement",
"(",
"'target'",
",",
"'popupFeatures'",
")",
",",
"targetName",
"=",
"dialog",
".",
"getContentElement",
"(",... | Handles the event when the "Target" selection box is changed. | [
"Handles",
"the",
"event",
"when",
"the",
"Target",
"selection",
"box",
"is",
"changed",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/link/dialogs/link.js#L10-L41 | |
47,433 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/link/dialogs/link.js | function()
{
var dialog = this.getDialog(),
partIds = [ 'urlOptions', 'anchorOptions', 'emailOptions' ],
typeValue = this.getValue(),
uploadTab = dialog.definition.getContents( 'upload' ),
uploadInitiallyHidden = uploadTab && uploadTab.hidden;
if ( typeValue == 'url' )
{
if ( editor.con... | javascript | function()
{
var dialog = this.getDialog(),
partIds = [ 'urlOptions', 'anchorOptions', 'emailOptions' ],
typeValue = this.getValue(),
uploadTab = dialog.definition.getContents( 'upload' ),
uploadInitiallyHidden = uploadTab && uploadTab.hidden;
if ( typeValue == 'url' )
{
if ( editor.con... | [
"function",
"(",
")",
"{",
"var",
"dialog",
"=",
"this",
".",
"getDialog",
"(",
")",
",",
"partIds",
"=",
"[",
"'urlOptions'",
",",
"'anchorOptions'",
",",
"'emailOptions'",
"]",
",",
"typeValue",
"=",
"this",
".",
"getValue",
"(",
")",
",",
"uploadTab",... | Handles the event when the "Type" selection box is changed. | [
"Handles",
"the",
"event",
"when",
"the",
"Type",
"selection",
"box",
"is",
"changed",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/link/dialogs/link.js#L44-L80 | |
47,434 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/link/dialogs/link.js | function()
{
var linkType = this.getContentElement( 'info', 'linkType' ),
urlField;
if ( linkType && linkType.getValue() == 'url' )
{
urlField = this.getContentElement( 'info', 'url' );
urlField.select();
}
} | javascript | function()
{
var linkType = this.getContentElement( 'info', 'linkType' ),
urlField;
if ( linkType && linkType.getValue() == 'url' )
{
urlField = this.getContentElement( 'info', 'url' );
urlField.select();
}
} | [
"function",
"(",
")",
"{",
"var",
"linkType",
"=",
"this",
".",
"getContentElement",
"(",
"'info'",
",",
"'linkType'",
")",
",",
"urlField",
";",
"if",
"(",
"linkType",
"&&",
"linkType",
".",
"getValue",
"(",
")",
"==",
"'url'",
")",
"{",
"urlField",
"... | Inital focus on 'url' field if link is of type URL. | [
"Inital",
"focus",
"on",
"url",
"field",
"if",
"link",
"is",
"of",
"type",
"URL",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/link/dialogs/link.js#L1388-L1397 | |
47,435 | mdreizin/webpack-config-stream | lib/failAfterStream.js | failAfterStream | function failAfterStream(options) {
if (!_.isObject(options)) {
options = {};
}
var files = [];
return through.obj(function(chunk, enc, cb) {
var stats = chunk[processStats.STATS_DATA_FIELD_NAME],
isStats = chunk[processStats.STATS_FLAG_FIELD_NAME],
filename = p... | javascript | function failAfterStream(options) {
if (!_.isObject(options)) {
options = {};
}
var files = [];
return through.obj(function(chunk, enc, cb) {
var stats = chunk[processStats.STATS_DATA_FIELD_NAME],
isStats = chunk[processStats.STATS_FLAG_FIELD_NAME],
filename = p... | [
"function",
"failAfterStream",
"(",
"options",
")",
"{",
"if",
"(",
"!",
"_",
".",
"isObject",
"(",
"options",
")",
")",
"{",
"options",
"=",
"{",
"}",
";",
"}",
"var",
"files",
"=",
"[",
"]",
";",
"return",
"through",
".",
"obj",
"(",
"function",
... | Stops a task if some `stats` objects have some errors or warnings. Can be piped.
@function
@alias failAfterStream
@param {Object=} options - Options.
@param {Boolean} [options.errors=false] - Fails build if some `stats` objects have some errors.
@param {Boolean} [options.warnings=false] - Fails build if some `stats` ob... | [
"Stops",
"a",
"task",
"if",
"some",
"stats",
"objects",
"have",
"some",
"errors",
"or",
"warnings",
".",
"Can",
"be",
"piped",
"."
] | f8424f97837a224bc07cc18a03ecf649d708e924 | https://github.com/mdreizin/webpack-config-stream/blob/f8424f97837a224bc07cc18a03ecf649d708e924/lib/failAfterStream.js#L40-L82 |
47,436 | campsi/campsi | lib/modules/sortCursor.js | getMongoSortArray | function getMongoSortArray (field, prefix) {
return (!field.startsWith('-'))
? [prefix + field, 1]
: [prefix + field.substr(1), -1];
} | javascript | function getMongoSortArray (field, prefix) {
return (!field.startsWith('-'))
? [prefix + field, 1]
: [prefix + field.substr(1), -1];
} | [
"function",
"getMongoSortArray",
"(",
"field",
",",
"prefix",
")",
"{",
"return",
"(",
"!",
"field",
".",
"startsWith",
"(",
"'-'",
")",
")",
"?",
"[",
"prefix",
"+",
"field",
",",
"1",
"]",
":",
"[",
"prefix",
"+",
"field",
".",
"substr",
"(",
"1"... | flips sorting order if field begins with minus '-'
@param {String} field
@param {String} prefix
@returns {Array<Array>} | [
"flips",
"sorting",
"order",
"if",
"field",
"begins",
"with",
"minus",
"-"
] | 65ff16d267ea7e60bbb9e8959e6805e009202d2c | https://github.com/campsi/campsi/blob/65ff16d267ea7e60bbb9e8959e6805e009202d2c/lib/modules/sortCursor.js#L7-L11 |
47,437 | elwayman02/ember-cli-opinionated | blueprints/ember-cli-opinionated/index.js | function () {
var packages = [
'ember-cli-autoprefixer',
'ember-cli-blanket',
'ember-cli-sass',
'ember-cpm',
'ember-feature-flags',
'ember-metrics',
'ember-moment',
'ember-responsive',
'ember-route-action-helper',
'ember-suave',
'ember-truth-helpers'... | javascript | function () {
var packages = [
'ember-cli-autoprefixer',
'ember-cli-blanket',
'ember-cli-sass',
'ember-cpm',
'ember-feature-flags',
'ember-metrics',
'ember-moment',
'ember-responsive',
'ember-route-action-helper',
'ember-suave',
'ember-truth-helpers'... | [
"function",
"(",
")",
"{",
"var",
"packages",
"=",
"[",
"'ember-cli-autoprefixer'",
",",
"'ember-cli-blanket'",
",",
"'ember-cli-sass'",
",",
"'ember-cpm'",
",",
"'ember-feature-flags'",
",",
"'ember-metrics'",
",",
"'ember-moment'",
",",
"'ember-responsive'",
",",
"'... | no-op since we're just adding dependencies | [
"no",
"-",
"op",
"since",
"we",
"re",
"just",
"adding",
"dependencies"
] | ceb7d0c0fb56406c09009c372dc018e89842c32b | https://github.com/elwayman02/ember-cli-opinionated/blob/ceb7d0c0fb56406c09009c372dc018e89842c32b/blueprints/ember-cli-opinionated/index.js#L10-L46 | |
47,438 | saggiyogesh/nodeportal | public/ckeditor/_source/core/dom/elementpath.js | function( element )
{
var childNodes = element.getChildren();
for ( var i = 0, count = childNodes.count() ; i < count ; i++ )
{
var child = childNodes.getItem( i );
if ( child.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$block[ child.getName() ] )
return true;
}
return false;
} | javascript | function( element )
{
var childNodes = element.getChildren();
for ( var i = 0, count = childNodes.count() ; i < count ; i++ )
{
var child = childNodes.getItem( i );
if ( child.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$block[ child.getName() ] )
return true;
}
return false;
} | [
"function",
"(",
"element",
")",
"{",
"var",
"childNodes",
"=",
"element",
".",
"getChildren",
"(",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"count",
"=",
"childNodes",
".",
"count",
"(",
")",
";",
"i",
"<",
"count",
";",
"i",
"++",
")",
... | Check if an element contains any block element. | [
"Check",
"if",
"an",
"element",
"contains",
"any",
"block",
"element",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/dom/elementpath.js#L15-L28 | |
47,439 | saggiyogesh/nodeportal | public/ckeditor/_source/core/dom/elementpath.js | function( otherPath )
{
var thisElements = this.elements;
var otherElements = otherPath && otherPath.elements;
if ( !otherElements || thisElements.length != otherElements.length )
return false;
for ( var i = 0 ; i < thisElements.length ; i++ )
{
if ( !thisElements[ i ].equals( otherElements... | javascript | function( otherPath )
{
var thisElements = this.elements;
var otherElements = otherPath && otherPath.elements;
if ( !otherElements || thisElements.length != otherElements.length )
return false;
for ( var i = 0 ; i < thisElements.length ; i++ )
{
if ( !thisElements[ i ].equals( otherElements... | [
"function",
"(",
"otherPath",
")",
"{",
"var",
"thisElements",
"=",
"this",
".",
"elements",
";",
"var",
"otherElements",
"=",
"otherPath",
"&&",
"otherPath",
".",
"elements",
";",
"if",
"(",
"!",
"otherElements",
"||",
"thisElements",
".",
"length",
"!=",
... | Compares this element path with another one.
@param {CKEDITOR.dom.elementPath} otherPath The elementPath object to be
compared with this one.
@returns {Boolean} "true" if the paths are equal, containing the same
number of elements and the same elements in the same order. | [
"Compares",
"this",
"element",
"path",
"with",
"another",
"one",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/dom/elementpath.js#L91-L106 | |
47,440 | RohanDoshi2018/google_directions | index.js | validateInput | function validateInput(params, cb) {
if (typeof params !== 'object')
return new TypeError("params must be an object");
if (typeof cb !== 'function')
return new TypeError("callback must be a function");
if (params.origin === "")
return new Error("params.origin is required");
if (params.destination === "")
re... | javascript | function validateInput(params, cb) {
if (typeof params !== 'object')
return new TypeError("params must be an object");
if (typeof cb !== 'function')
return new TypeError("callback must be a function");
if (params.origin === "")
return new Error("params.origin is required");
if (params.destination === "")
re... | [
"function",
"validateInput",
"(",
"params",
",",
"cb",
")",
"{",
"if",
"(",
"typeof",
"params",
"!==",
"'object'",
")",
"return",
"new",
"TypeError",
"(",
"\"params must be an object\"",
")",
";",
"if",
"(",
"typeof",
"cb",
"!==",
"'function'",
")",
"return"... | validation of input | [
"validation",
"of",
"input"
] | 9b0465604d65f26f385072adaf7fce18e1ed4037 | https://github.com/RohanDoshi2018/google_directions/blob/9b0465604d65f26f385072adaf7fce18e1ed4037/index.js#L10-L21 |
47,441 | jlewczyk/git-hooks-js-win | lib/cli.js | outputHelp | function outputHelp() {
console.log(
'\nUsage: git-hooks [options]\n\n' +
'A tool to manage project Git hooks\n\n' +
'Options:\n\n' +
Object.keys(options)
.map(function (key) {
return ' --' + key + '\t' + options[key] + '\n';
})
.j... | javascript | function outputHelp() {
console.log(
'\nUsage: git-hooks [options]\n\n' +
'A tool to manage project Git hooks\n\n' +
'Options:\n\n' +
Object.keys(options)
.map(function (key) {
return ' --' + key + '\t' + options[key] + '\n';
})
.j... | [
"function",
"outputHelp",
"(",
")",
"{",
"console",
".",
"log",
"(",
"'\\nUsage: git-hooks [options]\\n\\n'",
"+",
"'A tool to manage project Git hooks\\n\\n'",
"+",
"'Options:\\n\\n'",
"+",
"Object",
".",
"keys",
"(",
"options",
")",
".",
"map",
"(",
"function",
"(... | Outputs the help to console. | [
"Outputs",
"the",
"help",
"to",
"console",
"."
] | e156f88ad7aec76c9180c70656c5568ad89f9de7 | https://github.com/jlewczyk/git-hooks-js-win/blob/e156f88ad7aec76c9180c70656c5568ad89f9de7/lib/cli.js#L32-L43 |
47,442 | saggiyogesh/nodeportal | plugins/threadComments/ThreadCommentsController.js | function (err, m) {
if (m) {
model = m;
}
else {
err = new Error("Invalid linked model.");
}
n(err, m);
} | javascript | function (err, m) {
if (m) {
model = m;
}
else {
err = new Error("Invalid linked model.");
}
n(err, m);
} | [
"function",
"(",
"err",
",",
"m",
")",
"{",
"if",
"(",
"m",
")",
"{",
"model",
"=",
"m",
";",
"}",
"else",
"{",
"err",
"=",
"new",
"Error",
"(",
"\"Invalid linked model.\"",
")",
";",
"}",
"n",
"(",
"err",
",",
"m",
")",
";",
"}"
] | find model obj | [
"find",
"model",
"obj"
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/plugins/threadComments/ThreadCommentsController.js#L324-L332 | |
47,443 | ebceu4/waves-crypto | src/libs/blake2b.js | normalizeInput | function normalizeInput(input) {
var ret;
if (input instanceof Uint8Array) {
ret = input;
}
else if (input instanceof Buffer) {
ret = new Uint8Array(input);
}
else if (typeof (input) === 'string') {
ret = new Uint8Array(Buffer.from(input, 'utf8'));
}
else {
... | javascript | function normalizeInput(input) {
var ret;
if (input instanceof Uint8Array) {
ret = input;
}
else if (input instanceof Buffer) {
ret = new Uint8Array(input);
}
else if (typeof (input) === 'string') {
ret = new Uint8Array(Buffer.from(input, 'utf8'));
}
else {
... | [
"function",
"normalizeInput",
"(",
"input",
")",
"{",
"var",
"ret",
";",
"if",
"(",
"input",
"instanceof",
"Uint8Array",
")",
"{",
"ret",
"=",
"input",
";",
"}",
"else",
"if",
"(",
"input",
"instanceof",
"Buffer",
")",
"{",
"ret",
"=",
"new",
"Uint8Arr... | For convenience, let people hash a string, not just a Uint8Array | [
"For",
"convenience",
"let",
"people",
"hash",
"a",
"string",
"not",
"just",
"a",
"Uint8Array"
] | 76877f2df898505125eb55d45e00af194acd155f | https://github.com/ebceu4/waves-crypto/blob/76877f2df898505125eb55d45e00af194acd155f/src/libs/blake2b.js#L5-L20 |
47,444 | ebceu4/waves-crypto | src/libs/blake2b.js | B2B_GET32 | function B2B_GET32(arr, i) {
return (arr[i] ^
(arr[i + 1] << 8) ^
(arr[i + 2] << 16) ^
(arr[i + 3] << 24));
} | javascript | function B2B_GET32(arr, i) {
return (arr[i] ^
(arr[i + 1] << 8) ^
(arr[i + 2] << 16) ^
(arr[i + 3] << 24));
} | [
"function",
"B2B_GET32",
"(",
"arr",
",",
"i",
")",
"{",
"return",
"(",
"arr",
"[",
"i",
"]",
"^",
"(",
"arr",
"[",
"i",
"+",
"1",
"]",
"<<",
"8",
")",
"^",
"(",
"arr",
"[",
"i",
"+",
"2",
"]",
"<<",
"16",
")",
"^",
"(",
"arr",
"[",
"i"... | Little-endian byte access | [
"Little",
"-",
"endian",
"byte",
"access"
] | 76877f2df898505125eb55d45e00af194acd155f | https://github.com/ebceu4/waves-crypto/blob/76877f2df898505125eb55d45e00af194acd155f/src/libs/blake2b.js#L104-L109 |
47,445 | ebceu4/waves-crypto | src/libs/blake2b.js | B2B_G | function B2B_G(a, b, c, d, ix, iy) {
var x0 = m[ix];
var x1 = m[ix + 1];
var y0 = m[iy];
var y1 = m[iy + 1];
ADD64AA(v, a, b); // v[a,a+1] += v[b,b+1] ... in JS we must store a uint64 as two uint32s
ADD64AC(v, a, x0, x1); // v[a, a+1] += x ... x0 is the low 32 bits of x, x1 is the high 32 bits
... | javascript | function B2B_G(a, b, c, d, ix, iy) {
var x0 = m[ix];
var x1 = m[ix + 1];
var y0 = m[iy];
var y1 = m[iy + 1];
ADD64AA(v, a, b); // v[a,a+1] += v[b,b+1] ... in JS we must store a uint64 as two uint32s
ADD64AC(v, a, x0, x1); // v[a, a+1] += x ... x0 is the low 32 bits of x, x1 is the high 32 bits
... | [
"function",
"B2B_G",
"(",
"a",
",",
"b",
",",
"c",
",",
"d",
",",
"ix",
",",
"iy",
")",
"{",
"var",
"x0",
"=",
"m",
"[",
"ix",
"]",
";",
"var",
"x1",
"=",
"m",
"[",
"ix",
"+",
"1",
"]",
";",
"var",
"y0",
"=",
"m",
"[",
"iy",
"]",
";",... | G Mixing function The ROTRs are inlined for speed | [
"G",
"Mixing",
"function",
"The",
"ROTRs",
"are",
"inlined",
"for",
"speed"
] | 76877f2df898505125eb55d45e00af194acd155f | https://github.com/ebceu4/waves-crypto/blob/76877f2df898505125eb55d45e00af194acd155f/src/libs/blake2b.js#L112-L143 |
47,446 | ebceu4/waves-crypto | src/libs/blake2b.js | blake2bInit | function blake2bInit(outlen, key) {
if (outlen === 0 || outlen > 64) {
throw new Error('Illegal output length, expected 0 < length <= 64');
}
if (key && key.length > 64) {
throw new Error('Illegal key, expected Uint8Array with 0 < length <= 64');
}
// state, 'param block'
var ctx... | javascript | function blake2bInit(outlen, key) {
if (outlen === 0 || outlen > 64) {
throw new Error('Illegal output length, expected 0 < length <= 64');
}
if (key && key.length > 64) {
throw new Error('Illegal key, expected Uint8Array with 0 < length <= 64');
}
// state, 'param block'
var ctx... | [
"function",
"blake2bInit",
"(",
"outlen",
",",
"key",
")",
"{",
"if",
"(",
"outlen",
"===",
"0",
"||",
"outlen",
">",
"64",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Illegal output length, expected 0 < length <= 64'",
")",
";",
"}",
"if",
"(",
"key",
"&&",... | Creates a BLAKE2b hashing context Requires an output length between 1 and 64 bytes Takes an optional Uint8Array key | [
"Creates",
"a",
"BLAKE2b",
"hashing",
"context",
"Requires",
"an",
"output",
"length",
"between",
"1",
"and",
"64",
"bytes",
"Takes",
"an",
"optional",
"Uint8Array",
"key"
] | 76877f2df898505125eb55d45e00af194acd155f | https://github.com/ebceu4/waves-crypto/blob/76877f2df898505125eb55d45e00af194acd155f/src/libs/blake2b.js#L219-L247 |
47,447 | ebceu4/waves-crypto | src/libs/blake2b.js | blake2bFinal | function blake2bFinal(ctx) {
ctx.t += ctx.c; // mark last block offset
while (ctx.c < 128) { // fill up with zeros
ctx.b[ctx.c++] = 0;
}
blake2bCompress(ctx, true); // final block flag = 1
// little endian convert and store
var out = new Uint8Array(ctx.outlen);
for (var i = 0; i < ct... | javascript | function blake2bFinal(ctx) {
ctx.t += ctx.c; // mark last block offset
while (ctx.c < 128) { // fill up with zeros
ctx.b[ctx.c++] = 0;
}
blake2bCompress(ctx, true); // final block flag = 1
// little endian convert and store
var out = new Uint8Array(ctx.outlen);
for (var i = 0; i < ct... | [
"function",
"blake2bFinal",
"(",
"ctx",
")",
"{",
"ctx",
".",
"t",
"+=",
"ctx",
".",
"c",
";",
"// mark last block offset",
"while",
"(",
"ctx",
".",
"c",
"<",
"128",
")",
"{",
"// fill up with zeros",
"ctx",
".",
"b",
"[",
"ctx",
".",
"c",
"++",
"]"... | Completes a BLAKE2b streaming hash Returns a Uint8Array containing the message digest | [
"Completes",
"a",
"BLAKE2b",
"streaming",
"hash",
"Returns",
"a",
"Uint8Array",
"containing",
"the",
"message",
"digest"
] | 76877f2df898505125eb55d45e00af194acd155f | https://github.com/ebceu4/waves-crypto/blob/76877f2df898505125eb55d45e00af194acd155f/src/libs/blake2b.js#L264-L276 |
47,448 | saggiyogesh/nodeportal | lib/static/ThemesWatcher.js | generateIdFromFilePath | function generateIdFromFilePath(filePath) {
var arr = filePath.split("/"), len = arr.length, last = arr[len - 1],
secondLast = arr[len - 2], thirdLast = arr[len - 3];
var isPluginFile = utils.contains(filePath, "/plugins/");
return isPluginFile ? thirdLast + "/" + last : thirdLast + "/" + secondLas... | javascript | function generateIdFromFilePath(filePath) {
var arr = filePath.split("/"), len = arr.length, last = arr[len - 1],
secondLast = arr[len - 2], thirdLast = arr[len - 3];
var isPluginFile = utils.contains(filePath, "/plugins/");
return isPluginFile ? thirdLast + "/" + last : thirdLast + "/" + secondLas... | [
"function",
"generateIdFromFilePath",
"(",
"filePath",
")",
"{",
"var",
"arr",
"=",
"filePath",
".",
"split",
"(",
"\"/\"",
")",
",",
"len",
"=",
"arr",
".",
"length",
",",
"last",
"=",
"arr",
"[",
"len",
"-",
"1",
"]",
",",
"secondLast",
"=",
"arr",... | Returns unique id depends on file location i.e. a theme file or a plugin file
@param filePath | [
"Returns",
"unique",
"id",
"depends",
"on",
"file",
"location",
"i",
".",
"e",
".",
"a",
"theme",
"file",
"or",
"a",
"plugin",
"file"
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/lib/static/ThemesWatcher.js#L13-L19 |
47,449 | saggiyogesh/nodeportal | lib/static/ThemesWatcher.js | initThemeFilesWatch | function initThemeFilesWatch(app) {
utils.tick(function () {
var viewsPath = utils.getViewsPath();
var dbAction = new DBActions.DBActions(app.set("db"), {modelName: "Theme"});
dbAction.get("getAll", null, function (err, themes) {
if (err) throw err;
themes.forEach(fun... | javascript | function initThemeFilesWatch(app) {
utils.tick(function () {
var viewsPath = utils.getViewsPath();
var dbAction = new DBActions.DBActions(app.set("db"), {modelName: "Theme"});
dbAction.get("getAll", null, function (err, themes) {
if (err) throw err;
themes.forEach(fun... | [
"function",
"initThemeFilesWatch",
"(",
"app",
")",
"{",
"utils",
".",
"tick",
"(",
"function",
"(",
")",
"{",
"var",
"viewsPath",
"=",
"utils",
".",
"getViewsPath",
"(",
")",
";",
"var",
"dbAction",
"=",
"new",
"DBActions",
".",
"DBActions",
"(",
"app",... | Initiates file watcher and caching of theme's css and js files.
@param app | [
"Initiates",
"file",
"watcher",
"and",
"caching",
"of",
"theme",
"s",
"css",
"and",
"js",
"files",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/lib/static/ThemesWatcher.js#L121-L132 |
47,450 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/tabletools/plugin.js | trimCell | function trimCell( cell )
{
var bogus = cell.getBogus();
bogus && bogus.remove();
cell.trim();
} | javascript | function trimCell( cell )
{
var bogus = cell.getBogus();
bogus && bogus.remove();
cell.trim();
} | [
"function",
"trimCell",
"(",
"cell",
")",
"{",
"var",
"bogus",
"=",
"cell",
".",
"getBogus",
"(",
")",
";",
"bogus",
"&&",
"bogus",
".",
"remove",
"(",
")",
";",
"cell",
".",
"trim",
"(",
")",
";",
"}"
] | Remove filler at end and empty spaces around the cell content. | [
"Remove",
"filler",
"at",
"end",
"and",
"empty",
"spaces",
"around",
"the",
"cell",
"content",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/tabletools/plugin.js#L459-L464 |
47,451 | saggiyogesh/nodeportal | lib/DefaultDataHandler.js | getHandler | function getHandler(app, schema, data) {
function handleSave(err, results, next) {
if (!err) {
delete DependenciesMap[schema];
SavedSchemas.push(schema);
_l('schema saved: ' + schema);
}
next(err, results);
}
// Default handler function
var re... | javascript | function getHandler(app, schema, data) {
function handleSave(err, results, next) {
if (!err) {
delete DependenciesMap[schema];
SavedSchemas.push(schema);
_l('schema saved: ' + schema);
}
next(err, results);
}
// Default handler function
var re... | [
"function",
"getHandler",
"(",
"app",
",",
"schema",
",",
"data",
")",
"{",
"function",
"handleSave",
"(",
"err",
",",
"results",
",",
"next",
")",
"{",
"if",
"(",
"!",
"err",
")",
"{",
"delete",
"DependenciesMap",
"[",
"schema",
"]",
";",
"SavedSchema... | Returns data handler if provided with plugin otherwise return default handler function
@param app
@param schema {String} Schema name
@param data {Object|Array} default data
@returns {*|Function|Function} | [
"Returns",
"data",
"handler",
"if",
"provided",
"with",
"plugin",
"otherwise",
"return",
"default",
"handler",
"function"
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/lib/DefaultDataHandler.js#L27-L52 |
47,452 | saggiyogesh/nodeportal | lib/DefaultDataHandler.js | function (next) {
data = _.isObject(data) ? _.values(data) : data;
DBActions.getSimpleInstance(app, schema).multipleSave(data, function (err, results) {
handleSave(err, results, next);
});
} | javascript | function (next) {
data = _.isObject(data) ? _.values(data) : data;
DBActions.getSimpleInstance(app, schema).multipleSave(data, function (err, results) {
handleSave(err, results, next);
});
} | [
"function",
"(",
"next",
")",
"{",
"data",
"=",
"_",
".",
"isObject",
"(",
"data",
")",
"?",
"_",
".",
"values",
"(",
"data",
")",
":",
"data",
";",
"DBActions",
".",
"getSimpleInstance",
"(",
"app",
",",
"schema",
")",
".",
"multipleSave",
"(",
"d... | Default handler function | [
"Default",
"handler",
"function"
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/lib/DefaultDataHandler.js#L38-L43 | |
47,453 | saggiyogesh/nodeportal | lib/DefaultDataHandler.js | dependenciesExists | function dependenciesExists(schema) {
var deps = DependenciesMap[schema];
var f = false;
deps.forEach(function (d) {
f = SavedSchemas.indexOf(d) > -1
});
return f;
} | javascript | function dependenciesExists(schema) {
var deps = DependenciesMap[schema];
var f = false;
deps.forEach(function (d) {
f = SavedSchemas.indexOf(d) > -1
});
return f;
} | [
"function",
"dependenciesExists",
"(",
"schema",
")",
"{",
"var",
"deps",
"=",
"DependenciesMap",
"[",
"schema",
"]",
";",
"var",
"f",
"=",
"false",
";",
"deps",
".",
"forEach",
"(",
"function",
"(",
"d",
")",
"{",
"f",
"=",
"SavedSchemas",
".",
"index... | Checks for required dependencies for the schema are saved.
@param schema {String} schema name
@returns {boolean} | [
"Checks",
"for",
"required",
"dependencies",
"for",
"the",
"schema",
"are",
"saved",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/lib/DefaultDataHandler.js#L60-L67 |
47,454 | saggiyogesh/nodeportal | lib/DefaultDataHandler.js | saveSchemas | function saveSchemas(app) {
var keys = Object.keys(DependenciesMap);
if (keys.length == 0) {
_l('Default data saved...');
event.emit(COMPLETED_EVENT);
return;
}
HandlerArray = [];
var errFlag = true;
keys.forEach(function (k) {
dependenciesExists(k) && HandlerArra... | javascript | function saveSchemas(app) {
var keys = Object.keys(DependenciesMap);
if (keys.length == 0) {
_l('Default data saved...');
event.emit(COMPLETED_EVENT);
return;
}
HandlerArray = [];
var errFlag = true;
keys.forEach(function (k) {
dependenciesExists(k) && HandlerArra... | [
"function",
"saveSchemas",
"(",
"app",
")",
"{",
"var",
"keys",
"=",
"Object",
".",
"keys",
"(",
"DependenciesMap",
")",
";",
"if",
"(",
"keys",
".",
"length",
"==",
"0",
")",
"{",
"_l",
"(",
"'Default data saved...'",
")",
";",
"event",
".",
"emit",
... | Saves those schemas which depends on other collections data.
@param app | [
"Saves",
"those",
"schemas",
"which",
"depends",
"on",
"other",
"collections",
"data",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/lib/DefaultDataHandler.js#L74-L93 |
47,455 | saggiyogesh/nodeportal | lib/DefaultDataHandler.js | init | function init(app) {
var keys = Object.keys(DependenciesMap);
var allDeps = _.uniq(_.flatten(_.values(DependenciesMap)));
allDeps.forEach(function (d) {
if (!_.contains(keys, d)) {
throw new Error("Unresolved dependency: " + d)
}
});
keys.forEach(function (k) {
... | javascript | function init(app) {
var keys = Object.keys(DependenciesMap);
var allDeps = _.uniq(_.flatten(_.values(DependenciesMap)));
allDeps.forEach(function (d) {
if (!_.contains(keys, d)) {
throw new Error("Unresolved dependency: " + d)
}
});
keys.forEach(function (k) {
... | [
"function",
"init",
"(",
"app",
")",
"{",
"var",
"keys",
"=",
"Object",
".",
"keys",
"(",
"DependenciesMap",
")",
";",
"var",
"allDeps",
"=",
"_",
".",
"uniq",
"(",
"_",
".",
"flatten",
"(",
"_",
".",
"values",
"(",
"DependenciesMap",
")",
")",
")"... | Start handling default data provided in plugins and save those collections which are not having dependencies.
@param app | [
"Start",
"handling",
"default",
"data",
"provided",
"in",
"plugins",
"and",
"save",
"those",
"collections",
"which",
"are",
"not",
"having",
"dependencies",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/lib/DefaultDataHandler.js#L99-L127 |
47,456 | saggiyogesh/nodeportal | public/ckeditor/_source/core/dom/element.js | function( className )
{
var c = this.$.className;
if ( c )
{
var regex = new RegExp( '(?:^|\\s)' + className + '(?:\\s|$)', '' );
if ( !regex.test( c ) )
c += ' ' + className;
}
this.$.className = c || className;
} | javascript | function( className )
{
var c = this.$.className;
if ( c )
{
var regex = new RegExp( '(?:^|\\s)' + className + '(?:\\s|$)', '' );
if ( !regex.test( c ) )
c += ' ' + className;
}
this.$.className = c || className;
} | [
"function",
"(",
"className",
")",
"{",
"var",
"c",
"=",
"this",
".",
"$",
".",
"className",
";",
"if",
"(",
"c",
")",
"{",
"var",
"regex",
"=",
"new",
"RegExp",
"(",
"'(?:^|\\\\s)'",
"+",
"className",
"+",
"'(?:\\\\s|$)'",
",",
"''",
")",
";",
"if... | Adds a CSS class to the element. It appends the class to the
already existing names.
@param {String} className The name of the class to be added.
@example
var element = new CKEDITOR.dom.element( 'div' );
element.addClass( 'classA' ); // <div class="classA">
element.addClass( 'classB' ); // <div class="classA... | [
"Adds",
"a",
"CSS",
"class",
"to",
"the",
"element",
".",
"It",
"appends",
"the",
"class",
"to",
"the",
"already",
"existing",
"names",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/dom/element.js#L129-L139 | |
47,457 | saggiyogesh/nodeportal | public/ckeditor/_source/core/dom/element.js | function( className )
{
var c = this.getAttribute( 'class' );
if ( c )
{
var regex = new RegExp( '(?:^|\\s+)' + className + '(?=\\s|$)', 'i' );
if ( regex.test( c ) )
{
c = c.replace( regex, '' ).replace( /^\s+/, '' );
if ( c )
this.setAttribute( 'class', c );
el... | javascript | function( className )
{
var c = this.getAttribute( 'class' );
if ( c )
{
var regex = new RegExp( '(?:^|\\s+)' + className + '(?=\\s|$)', 'i' );
if ( regex.test( c ) )
{
c = c.replace( regex, '' ).replace( /^\s+/, '' );
if ( c )
this.setAttribute( 'class', c );
el... | [
"function",
"(",
"className",
")",
"{",
"var",
"c",
"=",
"this",
".",
"getAttribute",
"(",
"'class'",
")",
";",
"if",
"(",
"c",
")",
"{",
"var",
"regex",
"=",
"new",
"RegExp",
"(",
"'(?:^|\\\\s+)'",
"+",
"className",
"+",
"'(?=\\\\s|$)'",
",",
"'i'",
... | Removes a CSS class name from the elements classes. Other classes
remain untouched.
@param {String} className The name of the class to remove.
@example
var element = new CKEDITOR.dom.element( 'div' );
element.addClass( 'classA' ); // <div class="classA">
element.addClass( 'classB' ); // <div class="classA cl... | [
"Removes",
"a",
"CSS",
"class",
"name",
"from",
"the",
"elements",
"classes",
".",
"Other",
"classes",
"remain",
"untouched",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/dom/element.js#L152-L168 | |
47,458 | saggiyogesh/nodeportal | public/ckeditor/_source/core/dom/element.js | function( text )
{
CKEDITOR.dom.element.prototype.setText = ( this.$.innerText != undefined ) ?
function ( text )
{
return this.$.innerText = text;
} :
function ( text )
{
return this.$.textContent = text;
};
return this.setText( text );
} | javascript | function( text )
{
CKEDITOR.dom.element.prototype.setText = ( this.$.innerText != undefined ) ?
function ( text )
{
return this.$.innerText = text;
} :
function ( text )
{
return this.$.textContent = text;
};
return this.setText( text );
} | [
"function",
"(",
"text",
")",
"{",
"CKEDITOR",
".",
"dom",
".",
"element",
".",
"prototype",
".",
"setText",
"=",
"(",
"this",
".",
"$",
".",
"innerText",
"!=",
"undefined",
")",
"?",
"function",
"(",
"text",
")",
"{",
"return",
"this",
".",
"$",
"... | Sets the element contents as plain text.
@param {String} text The text to be set.
@returns {String} The inserted text.
@example
var element = new CKEDITOR.dom.element( 'div' );
element.setText( 'A > B & C < D' );
alert( element.innerHTML ); // "A &gt; B &amp; C &lt; D" | [
"Sets",
"the",
"element",
"contents",
"as",
"plain",
"text",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/dom/element.js#L391-L404 | |
47,459 | saggiyogesh/nodeportal | public/ckeditor/_source/core/dom/element.js | function( evaluator )
{
var first = this.$.firstChild,
retval = first && new CKEDITOR.dom.node( first );
if ( retval && evaluator && !evaluator( retval ) )
retval = retval.getNext( evaluator );
return retval;
} | javascript | function( evaluator )
{
var first = this.$.firstChild,
retval = first && new CKEDITOR.dom.node( first );
if ( retval && evaluator && !evaluator( retval ) )
retval = retval.getNext( evaluator );
return retval;
} | [
"function",
"(",
"evaluator",
")",
"{",
"var",
"first",
"=",
"this",
".",
"$",
".",
"firstChild",
",",
"retval",
"=",
"first",
"&&",
"new",
"CKEDITOR",
".",
"dom",
".",
"node",
"(",
"first",
")",
";",
"if",
"(",
"retval",
"&&",
"evaluator",
"&&",
"... | Gets the first child node of this element.
@param {Function} evaluator Filtering the result node.
@returns {CKEDITOR.dom.node} The first child node or null if not
available.
@example
var element = CKEDITOR.dom.element.createFromHtml( '<div><b>Example</b></div>' );
var first = <b>element.getFirst... | [
"Gets",
"the",
"first",
"child",
"node",
"of",
"this",
"element",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/dom/element.js#L672-L680 | |
47,460 | saggiyogesh/nodeportal | public/ckeditor/_source/core/dom/element.js | function()
{
var name = this.getName();
for ( var i = 0 ; i < arguments.length ; i++ )
{
if ( arguments[ i ] == name )
return true;
}
return false;
} | javascript | function()
{
var name = this.getName();
for ( var i = 0 ; i < arguments.length ; i++ )
{
if ( arguments[ i ] == name )
return true;
}
return false;
} | [
"function",
"(",
")",
"{",
"var",
"name",
"=",
"this",
".",
"getName",
"(",
")",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"arguments",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"arguments",
"[",
"i",
"]",
"==",
"name",
... | Checks if the element name matches one or more names.
@param {String} name[,name[,...]] One or more names to be checked.
@returns {Boolean} true if the element name matches any of the names.
@example
var element = new CKEDITOR.element( 'span' );
alert( <b>element.is( 'span' )</b> ); "true"
alert( <b>element.is( 'p', '... | [
"Checks",
"if",
"the",
"element",
"name",
"matches",
"one",
"or",
"more",
"names",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/dom/element.js#L711-L720 | |
47,461 | saggiyogesh/nodeportal | public/ckeditor/_source/core/dom/element.js | function()
{
var isVisible = ( this.$.offsetHeight || this.$.offsetWidth ) && this.getComputedStyle( 'visibility' ) != 'hidden',
elementWindow,
elementWindowFrame;
// Webkit and Opera report non-zero offsetHeight despite that
// element is inside an invisible iframe. (#4542)
if ( isVisibl... | javascript | function()
{
var isVisible = ( this.$.offsetHeight || this.$.offsetWidth ) && this.getComputedStyle( 'visibility' ) != 'hidden',
elementWindow,
elementWindowFrame;
// Webkit and Opera report non-zero offsetHeight despite that
// element is inside an invisible iframe. (#4542)
if ( isVisibl... | [
"function",
"(",
")",
"{",
"var",
"isVisible",
"=",
"(",
"this",
".",
"$",
".",
"offsetHeight",
"||",
"this",
".",
"$",
".",
"offsetWidth",
")",
"&&",
"this",
".",
"getComputedStyle",
"(",
"'visibility'",
")",
"!=",
"'hidden'",
",",
"elementWindow",
",",... | Checks if this element is visible. May not work if the element is
child of an element with visibility set to "hidden", but works well
on the great majority of cases.
@return {Boolean} True if the element is visible. | [
"Checks",
"if",
"this",
"element",
"is",
"visible",
".",
"May",
"not",
"work",
"if",
"the",
"element",
"is",
"child",
"of",
"an",
"element",
"with",
"visibility",
"set",
"to",
"hidden",
"but",
"works",
"well",
"on",
"the",
"great",
"majority",
"of",
"cas... | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/dom/element.js#L793-L813 | |
47,462 | saggiyogesh/nodeportal | public/ckeditor/_source/core/dom/element.js | function()
{
if ( !CKEDITOR.dtd.$removeEmpty[ this.getName() ] )
return false;
var children = this.getChildren();
for ( var i = 0, count = children.count(); i < count; i++ )
{
var child = children.getItem( i );
if ( child.type == CKEDITOR.NODE_ELEMENT && child.data( 'cke-bookmark' ... | javascript | function()
{
if ( !CKEDITOR.dtd.$removeEmpty[ this.getName() ] )
return false;
var children = this.getChildren();
for ( var i = 0, count = children.count(); i < count; i++ )
{
var child = children.getItem( i );
if ( child.type == CKEDITOR.NODE_ELEMENT && child.data( 'cke-bookmark' ... | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"CKEDITOR",
".",
"dtd",
".",
"$removeEmpty",
"[",
"this",
".",
"getName",
"(",
")",
"]",
")",
"return",
"false",
";",
"var",
"children",
"=",
"this",
".",
"getChildren",
"(",
")",
";",
"for",
"(",
"var",
... | Whether it's an empty inline elements which has no visual impact when removed. | [
"Whether",
"it",
"s",
"an",
"empty",
"inline",
"elements",
"which",
"has",
"no",
"visual",
"impact",
"when",
"removed",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/dom/element.js#L818-L838 | |
47,463 | saggiyogesh/nodeportal | public/ckeditor/_source/core/dom/element.js | function( opacity )
{
if ( CKEDITOR.env.ie )
{
opacity = Math.round( opacity * 100 );
this.setStyle( 'filter', opacity >= 100 ? '' : 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + opacity + ')' );
}
else
this.setStyle( 'opacity', opacity );
} | javascript | function( opacity )
{
if ( CKEDITOR.env.ie )
{
opacity = Math.round( opacity * 100 );
this.setStyle( 'filter', opacity >= 100 ? '' : 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + opacity + ')' );
}
else
this.setStyle( 'opacity', opacity );
} | [
"function",
"(",
"opacity",
")",
"{",
"if",
"(",
"CKEDITOR",
".",
"env",
".",
"ie",
")",
"{",
"opacity",
"=",
"Math",
".",
"round",
"(",
"opacity",
"*",
"100",
")",
";",
"this",
".",
"setStyle",
"(",
"'filter'",
",",
"opacity",
">=",
"100",
"?",
... | Sets the opacity of an element.
@param {Number} opacity A number within the range [0.0, 1.0].
@example
var element = CKEDITOR.dom.element.getById( 'myElement' );
<b>element.setOpacity( 0.75 )</b>; | [
"Sets",
"the",
"opacity",
"of",
"an",
"element",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/dom/element.js#L1227-L1236 | |
47,464 | saggiyogesh/nodeportal | public/ckeditor/_source/core/dom/element.js | function()
{
var $ = this.$;
try
{
// In IE, with custom document.domain, it may happen that
// the iframe is not yet available, resulting in "Access
// Denied" for the following property access.
$.contentWindow.document;
}
catch ( e )
{
// Trick to solve this issue... | javascript | function()
{
var $ = this.$;
try
{
// In IE, with custom document.domain, it may happen that
// the iframe is not yet available, resulting in "Access
// Denied" for the following property access.
$.contentWindow.document;
}
catch ( e )
{
// Trick to solve this issue... | [
"function",
"(",
")",
"{",
"var",
"$",
"=",
"this",
".",
"$",
";",
"try",
"{",
"// In IE, with custom document.domain, it may happen that\r",
"// the iframe is not yet available, resulting in \"Access\r",
"// Denied\" for the following property access.\r",
"$",
".",
"contentWindo... | Returns the inner document of this IFRAME element.
@returns {CKEDITOR.dom.document} The inner document. | [
"Returns",
"the",
"inner",
"document",
"of",
"this",
"IFRAME",
"element",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/dom/element.js#L1461-L1493 | |
47,465 | saggiyogesh/nodeportal | public/ckeditor/_source/core/dom/element.js | function( dest, skipAttributes )
{
var attributes = this.$.attributes;
skipAttributes = skipAttributes || {};
for ( var n = 0 ; n < attributes.length ; n++ )
{
var attribute = attributes[n];
// Lowercase attribute name hard rule is broken for
// some attribute on IE, e.g. CHECKED.
... | javascript | function( dest, skipAttributes )
{
var attributes = this.$.attributes;
skipAttributes = skipAttributes || {};
for ( var n = 0 ; n < attributes.length ; n++ )
{
var attribute = attributes[n];
// Lowercase attribute name hard rule is broken for
// some attribute on IE, e.g. CHECKED.
... | [
"function",
"(",
"dest",
",",
"skipAttributes",
")",
"{",
"var",
"attributes",
"=",
"this",
".",
"$",
".",
"attributes",
";",
"skipAttributes",
"=",
"skipAttributes",
"||",
"{",
"}",
";",
"for",
"(",
"var",
"n",
"=",
"0",
";",
"n",
"<",
"attributes",
... | Copy all the attributes from one node to the other, kinda like a clone
skipAttributes is an object with the attributes that must NOT be copied.
@param {CKEDITOR.dom.element} dest The destination element.
@param {Object} skipAttributes A dictionary of attributes to skip.
@example | [
"Copy",
"all",
"the",
"attributes",
"from",
"one",
"node",
"to",
"the",
"other",
"kinda",
"like",
"a",
"clone",
"skipAttributes",
"is",
"an",
"object",
"with",
"the",
"attributes",
"that",
"must",
"NOT",
"be",
"copied",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/dom/element.js#L1502-L1537 | |
47,466 | saggiyogesh/nodeportal | public/ckeditor/_source/core/dom/element.js | function( newTag )
{
// If it's already correct exit here.
if ( this.getName() == newTag )
return;
var doc = this.getDocument();
// Create the new node.
var newNode = new CKEDITOR.dom.element( newTag, doc );
// Copy all attributes.
this.copyAttributes( newNode );
// Move ... | javascript | function( newTag )
{
// If it's already correct exit here.
if ( this.getName() == newTag )
return;
var doc = this.getDocument();
// Create the new node.
var newNode = new CKEDITOR.dom.element( newTag, doc );
// Copy all attributes.
this.copyAttributes( newNode );
// Move ... | [
"function",
"(",
"newTag",
")",
"{",
"// If it's already correct exit here.\r",
"if",
"(",
"this",
".",
"getName",
"(",
")",
"==",
"newTag",
")",
"return",
";",
"var",
"doc",
"=",
"this",
".",
"getDocument",
"(",
")",
";",
"// Create the new node.\r",
"var",
... | Changes the tag name of the current element.
@param {String} newTag The new tag for the element. | [
"Changes",
"the",
"tag",
"name",
"of",
"the",
"current",
"element",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/dom/element.js#L1543-L1564 | |
47,467 | fvsch/gulp-task-maker | example/tasks/minjs/index.js | minjs | function minjs(config, tools) {
return tools.simpleStream(config, [
config.concat && concat(config.concat),
config.minify && uglify(config.uglifyjs)
])
} | javascript | function minjs(config, tools) {
return tools.simpleStream(config, [
config.concat && concat(config.concat),
config.minify && uglify(config.uglifyjs)
])
} | [
"function",
"minjs",
"(",
"config",
",",
"tools",
")",
"{",
"return",
"tools",
".",
"simpleStream",
"(",
"config",
",",
"[",
"config",
".",
"concat",
"&&",
"concat",
"(",
"config",
".",
"concat",
")",
",",
"config",
".",
"minify",
"&&",
"uglify",
"(",
... | Make a simple JS build, optionally concatenated and minified
@param {object} config - task configuration
@param {object} tools - gtm utility functions
@return {object} | [
"Make",
"a",
"simple",
"JS",
"build",
"optionally",
"concatenated",
"and",
"minified"
] | 20ab4245f2d75174786ad140793e9438c025d546 | https://github.com/fvsch/gulp-task-maker/blob/20ab4245f2d75174786ad140793e9438c025d546/example/tasks/minjs/index.js#L10-L15 |
47,468 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/docprops/dialogs/docprops.js | resetStyle | function resetStyle( element, prop, resetVal )
{
element.removeStyle( prop );
if ( element.getComputedStyle( prop ) != resetVal )
element.setStyle( prop, resetVal );
} | javascript | function resetStyle( element, prop, resetVal )
{
element.removeStyle( prop );
if ( element.getComputedStyle( prop ) != resetVal )
element.setStyle( prop, resetVal );
} | [
"function",
"resetStyle",
"(",
"element",
",",
"prop",
",",
"resetVal",
")",
"{",
"element",
".",
"removeStyle",
"(",
"prop",
")",
";",
"if",
"(",
"element",
".",
"getComputedStyle",
"(",
"prop",
")",
"!=",
"resetVal",
")",
"element",
".",
"setStyle",
"(... | We cannot just remove the style from the element, as it might be affected from non-inline stylesheets. To get the proper result, we should manually set the inline style to its default value. | [
"We",
"cannot",
"just",
"remove",
"the",
"style",
"from",
"the",
"element",
"as",
"it",
"might",
"be",
"affected",
"from",
"non",
"-",
"inline",
"stylesheets",
".",
"To",
"get",
"the",
"proper",
"result",
"we",
"should",
"manually",
"set",
"the",
"inline",... | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/docprops/dialogs/docprops.js#L132-L137 |
47,469 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/docprops/dialogs/docprops.js | function( id, label, fieldProps )
{
return {
type : 'hbox',
padding : 0,
widths : [ '60%', '40%' ],
children : [
CKEDITOR.tools.extend( {
type : 'text',
id : id,
label : lang[ label ]
}, fieldProps || {}, 1 ),
{
type : 'button',
id : id + 'Choose',
... | javascript | function( id, label, fieldProps )
{
return {
type : 'hbox',
padding : 0,
widths : [ '60%', '40%' ],
children : [
CKEDITOR.tools.extend( {
type : 'text',
id : id,
label : lang[ label ]
}, fieldProps || {}, 1 ),
{
type : 'button',
id : id + 'Choose',
... | [
"function",
"(",
"id",
",",
"label",
",",
"fieldProps",
")",
"{",
"return",
"{",
"type",
":",
"'hbox'",
",",
"padding",
":",
"0",
",",
"widths",
":",
"[",
"'60%'",
",",
"'40%'",
"]",
",",
"children",
":",
"[",
"CKEDITOR",
".",
"tools",
".",
"extend... | Utilty to shorten the creation of color fields in the dialog. | [
"Utilty",
"to",
"shorten",
"the",
"creation",
"of",
"color",
"fields",
"in",
"the",
"dialog",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/docprops/dialogs/docprops.js#L140-L169 | |
47,470 | cblanquera/acquire | acquire.js | function(paths, callback, results, cached) {
results = results || [];
if(!paths.length) {
callback.apply(null, results);
return results;
}
var path = paths.shift();
//what do we do if it's not a string ?
if(typeof path !== 'string') {
... | javascript | function(paths, callback, results, cached) {
results = results || [];
if(!paths.length) {
callback.apply(null, results);
return results;
}
var path = paths.shift();
//what do we do if it's not a string ?
if(typeof path !== 'string') {
... | [
"function",
"(",
"paths",
",",
"callback",
",",
"results",
",",
"cached",
")",
"{",
"results",
"=",
"results",
"||",
"[",
"]",
";",
"if",
"(",
"!",
"paths",
".",
"length",
")",
"{",
"callback",
".",
"apply",
"(",
"null",
",",
"results",
")",
";",
... | Loads files by the list
@param array
@param function
@param array current results
@param bool whether to use cache
@return void | [
"Loads",
"files",
"by",
"the",
"list"
] | 2675484be1bf352b8ecbec37bb8eec6fed8b8b0d | https://github.com/cblanquera/acquire/blob/2675484be1bf352b8ecbec37bb8eec6fed8b8b0d/acquire.js#L377-L399 | |
47,471 | cblanquera/acquire | acquire.js | function(source, callback) {
callback = callback || noop;
//if there's a queue
if (queue[source] instanceof Array) {
//just add it
return queue[source].push(callback);
}
//otherwise there is not a queue
//so let's create one
queue[source]... | javascript | function(source, callback) {
callback = callback || noop;
//if there's a queue
if (queue[source] instanceof Array) {
//just add it
return queue[source].push(callback);
}
//otherwise there is not a queue
//so let's create one
queue[source]... | [
"function",
"(",
"source",
",",
"callback",
")",
"{",
"callback",
"=",
"callback",
"||",
"noop",
";",
"//if there's a queue",
"if",
"(",
"queue",
"[",
"source",
"]",
"instanceof",
"Array",
")",
"{",
"//just add it",
"return",
"queue",
"[",
"source",
"]",
"... | Gets a script remotely, runs it
and caches it.
@param string
@param function
@return void | [
"Gets",
"a",
"script",
"remotely",
"runs",
"it",
"and",
"caches",
"it",
"."
] | 2675484be1bf352b8ecbec37bb8eec6fed8b8b0d | https://github.com/cblanquera/acquire/blob/2675484be1bf352b8ecbec37bb8eec6fed8b8b0d/acquire.js#L409-L445 | |
47,472 | cblanquera/acquire | acquire.js | function(source, callback) {
callback = callback || noop;
//if there's a queue
if (queue[source] instanceof Array) {
//just call the callback
return callback();
}
//otherwise there is not a queue
//so let's create one
queue[source] = [];
... | javascript | function(source, callback) {
callback = callback || noop;
//if there's a queue
if (queue[source] instanceof Array) {
//just call the callback
return callback();
}
//otherwise there is not a queue
//so let's create one
queue[source] = [];
... | [
"function",
"(",
"source",
",",
"callback",
")",
"{",
"callback",
"=",
"callback",
"||",
"noop",
";",
"//if there's a queue",
"if",
"(",
"queue",
"[",
"source",
"]",
"instanceof",
"Array",
")",
"{",
"//just call the callback",
"return",
"callback",
"(",
")",
... | Gets a style remotely
and caches it.
@param string
@param function
@return void | [
"Gets",
"a",
"style",
"remotely",
"and",
"caches",
"it",
"."
] | 2675484be1bf352b8ecbec37bb8eec6fed8b8b0d | https://github.com/cblanquera/acquire/blob/2675484be1bf352b8ecbec37bb8eec6fed8b8b0d/acquire.js#L455-L477 | |
47,473 | cblanquera/acquire | acquire.js | function(url, success, fail) {
success = success || noop;
fail = fail || noop;
//if there's a queue
if (queue[url] instanceof Array) {
//just add it
return queue[url].push({
success: success,
fail: fail
});
}
... | javascript | function(url, success, fail) {
success = success || noop;
fail = fail || noop;
//if there's a queue
if (queue[url] instanceof Array) {
//just add it
return queue[url].push({
success: success,
fail: fail
});
}
... | [
"function",
"(",
"url",
",",
"success",
",",
"fail",
")",
"{",
"success",
"=",
"success",
"||",
"noop",
";",
"fail",
"=",
"fail",
"||",
"noop",
";",
"//if there's a queue",
"if",
"(",
"queue",
"[",
"url",
"]",
"instanceof",
"Array",
")",
"{",
"//just a... | Gets a file remotely
and caches it.
@param string
@param function success callback
@param function fail callback
@return void | [
"Gets",
"a",
"file",
"remotely",
"and",
"caches",
"it",
"."
] | 2675484be1bf352b8ecbec37bb8eec6fed8b8b0d | https://github.com/cblanquera/acquire/blob/2675484be1bf352b8ecbec37bb8eec6fed8b8b0d/acquire.js#L488-L578 | |
47,474 | esha/Eventi | dist/eventi.js | function(type, event, handler) {
_.parsers.forEach(function(parser) {
type = type.replace(parser[0], function() {
var args = _.slice(arguments, 1);
args.unshift(event, handler);
return parser[1].apply(event, args) || '';
});
});
... | javascript | function(type, event, handler) {
_.parsers.forEach(function(parser) {
type = type.replace(parser[0], function() {
var args = _.slice(arguments, 1);
args.unshift(event, handler);
return parser[1].apply(event, args) || '';
});
});
... | [
"function",
"(",
"type",
",",
"event",
",",
"handler",
")",
"{",
"_",
".",
"parsers",
".",
"forEach",
"(",
"function",
"(",
"parser",
")",
"{",
"type",
"=",
"type",
".",
"replace",
"(",
"parser",
"[",
"0",
"]",
",",
"function",
"(",
")",
"{",
"va... | only an extension hook | [
"only",
"an",
"extension",
"hook"
] | 2a5cf530ee7f69c6a53426d38b129b6d0e2c45dd | https://github.com/esha/Eventi/blob/2a5cf530ee7f69c6a53426d38b129b6d0e2c45dd/dist/eventi.js#L74-L83 | |
47,475 | Testlio/lambda-foundation | lib/error/index.js | report | function report(error, additionalTags, extra) {
let sentTags = tags ? [].concat(tags) : [];
if (additionalTags) {
sentTags = sentTags.concat(additionalTags);
}
return Promise.resolve(sentTags).then(function(t) {
// Need this wrapping so that our internal implementation can safely throw... | javascript | function report(error, additionalTags, extra) {
let sentTags = tags ? [].concat(tags) : [];
if (additionalTags) {
sentTags = sentTags.concat(additionalTags);
}
return Promise.resolve(sentTags).then(function(t) {
// Need this wrapping so that our internal implementation can safely throw... | [
"function",
"report",
"(",
"error",
",",
"additionalTags",
",",
"extra",
")",
"{",
"let",
"sentTags",
"=",
"tags",
"?",
"[",
"]",
".",
"concat",
"(",
"tags",
")",
":",
"[",
"]",
";",
"if",
"(",
"additionalTags",
")",
"{",
"sentTags",
"=",
"sentTags",... | Report an error, with optional additional tags
@param error - error to report
@param additionalTags - optional additional tags to report, along with the
default set of tags set on the module
@param extra - optional extra metadata to include in the error report
@returns promise which resolves into the passed in error | [
"Report",
"an",
"error",
"with",
"optional",
"additional",
"tags"
] | d6db22ab7974b9279f17466f36f77af4d53fde01 | https://github.com/Testlio/lambda-foundation/blob/d6db22ab7974b9279f17466f36f77af4d53fde01/lib/error/index.js#L25-L58 |
47,476 | Testlio/lambda-foundation | lib/error/index.js | LambdaError | function LambdaError(code, message, extra, request) {
Error.captureStackTrace(this, this.constructor);
this.name = 'LambdaError';
this.message = `${code}: ${message}`;
this.code = code;
this.extra = extra;
this.request = request;
// Also capture a native error internally, which
// we ca... | javascript | function LambdaError(code, message, extra, request) {
Error.captureStackTrace(this, this.constructor);
this.name = 'LambdaError';
this.message = `${code}: ${message}`;
this.code = code;
this.extra = extra;
this.request = request;
// Also capture a native error internally, which
// we ca... | [
"function",
"LambdaError",
"(",
"code",
",",
"message",
",",
"extra",
",",
"request",
")",
"{",
"Error",
".",
"captureStackTrace",
"(",
"this",
",",
"this",
".",
"constructor",
")",
";",
"this",
".",
"name",
"=",
"'LambdaError'",
";",
"this",
".",
"messa... | Create a new error object
@param code - code for the error (for example HTTP response code)
@param message - error message
@param extra - additional metadata sent when reporting the error
@param request - optional request information sent when reporting
@returns error object | [
"Create",
"a",
"new",
"error",
"object"
] | d6db22ab7974b9279f17466f36f77af4d53fde01 | https://github.com/Testlio/lambda-foundation/blob/d6db22ab7974b9279f17466f36f77af4d53fde01/lib/error/index.js#L81-L93 |
47,477 | rhythmagency/rhythm.framework | lib/jquery/jquery.dataAttributeFramework.js | function ($element, event, fn) {
var handler = {
$element: $element,
event: event,
fn: fn
};
existingHandlers.push(handler);
return $element.on(event, fn);
} | javascript | function ($element, event, fn) {
var handler = {
$element: $element,
event: event,
fn: fn
};
existingHandlers.push(handler);
return $element.on(event, fn);
} | [
"function",
"(",
"$element",
",",
"event",
",",
"fn",
")",
"{",
"var",
"handler",
"=",
"{",
"$element",
":",
"$element",
",",
"event",
":",
"event",
",",
"fn",
":",
"fn",
"}",
";",
"existingHandlers",
".",
"push",
"(",
"handler",
")",
";",
"return",
... | Attaches events, keeping track of handlers. | [
"Attaches",
"events",
"keeping",
"track",
"of",
"handlers",
"."
] | 056671a8596f1d9c23f8cbe780659af0abc8041f | https://github.com/rhythmagency/rhythm.framework/blob/056671a8596f1d9c23f8cbe780659af0abc8041f/lib/jquery/jquery.dataAttributeFramework.js#L19-L27 | |
47,478 | jchook/virtual-dom-handlebars | lib/VNode.js | VNode | function VNode(tagName, attributes, children) {
this.simple = true;
this.tagName = tagName; // non-virtual VText
this.attributes = attributes; // javascript
this.children = new VTree(children);
} | javascript | function VNode(tagName, attributes, children) {
this.simple = true;
this.tagName = tagName; // non-virtual VText
this.attributes = attributes; // javascript
this.children = new VTree(children);
} | [
"function",
"VNode",
"(",
"tagName",
",",
"attributes",
",",
"children",
")",
"{",
"this",
".",
"simple",
"=",
"true",
";",
"this",
".",
"tagName",
"=",
"tagName",
";",
"// non-virtual VText",
"this",
".",
"attributes",
"=",
"attributes",
";",
"// javascript... | Node that can have children | [
"Node",
"that",
"can",
"have",
"children"
] | d1c2015449bad8489572114fe3d8facef2cce367 | https://github.com/jchook/virtual-dom-handlebars/blob/d1c2015449bad8489572114fe3d8facef2cce367/lib/VNode.js#L8-L13 |
47,479 | shlomiassaf/resty-stone | lib/RestListMetadata.js | groupFieldsByType | function groupFieldsByType(list){
var fields = {};
_.each(list.fields, function(v,k) {
if (! fields.hasOwnProperty(v.type)) fields[v.type] = [];
fields[v.type].push(v);
});
return fields;
} | javascript | function groupFieldsByType(list){
var fields = {};
_.each(list.fields, function(v,k) {
if (! fields.hasOwnProperty(v.type)) fields[v.type] = [];
fields[v.type].push(v);
});
return fields;
} | [
"function",
"groupFieldsByType",
"(",
"list",
")",
"{",
"var",
"fields",
"=",
"{",
"}",
";",
"_",
".",
"each",
"(",
"list",
".",
"fields",
",",
"function",
"(",
"v",
",",
"k",
")",
"{",
"if",
"(",
"!",
"fields",
".",
"hasOwnProperty",
"(",
"v",
"... | Groups all fields in a list by type.
@param list
@returns {{}} An object map of type/fields. | [
"Groups",
"all",
"fields",
"in",
"a",
"list",
"by",
"type",
"."
] | 9ab093272ea7b68c6fe0aba45384206571896295 | https://github.com/shlomiassaf/resty-stone/blob/9ab093272ea7b68c6fe0aba45384206571896295/lib/RestListMetadata.js#L76-L83 |
47,480 | saggiyogesh/nodeportal | plugins/manageResource/client/js/manageResource.js | getBytesWithUnit | function getBytesWithUnit(bytes) {
if (isNaN(bytes)) {
return;
}
var units = [ ' bytes', ' KB', ' MB', ' GB', ' TB', ' PB', ' EB', ' ZB', ' YB' ];
var amountOf2s = Math.floor(Math.log(+bytes) / Math.log(2));
if (amountOf2s < 1) {
amountOf2s = 0;
}
... | javascript | function getBytesWithUnit(bytes) {
if (isNaN(bytes)) {
return;
}
var units = [ ' bytes', ' KB', ' MB', ' GB', ' TB', ' PB', ' EB', ' ZB', ' YB' ];
var amountOf2s = Math.floor(Math.log(+bytes) / Math.log(2));
if (amountOf2s < 1) {
amountOf2s = 0;
}
... | [
"function",
"getBytesWithUnit",
"(",
"bytes",
")",
"{",
"if",
"(",
"isNaN",
"(",
"bytes",
")",
")",
"{",
"return",
";",
"}",
"var",
"units",
"=",
"[",
"' bytes'",
",",
"' KB'",
",",
"' MB'",
",",
"' GB'",
",",
"' TB'",
",",
"' PB'",
",",
"' EB'",
"... | code with the help of google | [
"code",
"with",
"the",
"help",
"of",
"google"
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/plugins/manageResource/client/js/manageResource.js#L32-L49 |
47,481 | saggiyogesh/nodeportal | plugins/manageResource/client/js/manageResource.js | renderActionButtons | function renderActionButtons() {
$('.manage-resource-container .action-button').each(function (i, action) {
action = $(action);
var type = action.parent().hasClass(FOLDER_TYPE) ? FOLDER_TYPE : "";
var id = action.attr("id"),
dataId = action.parent('.resource-i... | javascript | function renderActionButtons() {
$('.manage-resource-container .action-button').each(function (i, action) {
action = $(action);
var type = action.parent().hasClass(FOLDER_TYPE) ? FOLDER_TYPE : "";
var id = action.attr("id"),
dataId = action.parent('.resource-i... | [
"function",
"renderActionButtons",
"(",
")",
"{",
"$",
"(",
"'.manage-resource-container .action-button'",
")",
".",
"each",
"(",
"function",
"(",
"i",
",",
"action",
")",
"{",
"action",
"=",
"$",
"(",
"action",
")",
";",
"var",
"type",
"=",
"action",
".",... | render action button | [
"render",
"action",
"button"
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/plugins/manageResource/client/js/manageResource.js#L263-L319 |
47,482 | mdreizin/webpack-config-stream | lib/ignoreStream.js | ignoreStream | function ignoreStream(strategy) {
if (!(strategy instanceof IgnoreStrategy)) {
strategy = DefaultIgnoreStrategy.INSTANCE;
}
return through.obj(function(chunk, enc, cb) {
strategy.execute(this, chunk).then(function(isIgnored) {
if (!isIgnored) {
cb(null, chunk);
... | javascript | function ignoreStream(strategy) {
if (!(strategy instanceof IgnoreStrategy)) {
strategy = DefaultIgnoreStrategy.INSTANCE;
}
return through.obj(function(chunk, enc, cb) {
strategy.execute(this, chunk).then(function(isIgnored) {
if (!isIgnored) {
cb(null, chunk);
... | [
"function",
"ignoreStream",
"(",
"strategy",
")",
"{",
"if",
"(",
"!",
"(",
"strategy",
"instanceof",
"IgnoreStrategy",
")",
")",
"{",
"strategy",
"=",
"DefaultIgnoreStrategy",
".",
"INSTANCE",
";",
"}",
"return",
"through",
".",
"obj",
"(",
"function",
"(",... | Prevents writing of `webpack.config.js`. Can be piped.
@function
@alias ignoreStream
@param {IgnoreStrategy=} strategy
@returns {Stream} | [
"Prevents",
"writing",
"of",
"webpack",
".",
"config",
".",
"js",
".",
"Can",
"be",
"piped",
"."
] | f8424f97837a224bc07cc18a03ecf649d708e924 | https://github.com/mdreizin/webpack-config-stream/blob/f8424f97837a224bc07cc18a03ecf649d708e924/lib/ignoreStream.js#L14-L28 |
47,483 | saggiyogesh/nodeportal | public/ckeditor/_source/core/tools.js | function( text )
{
var standard = function( text )
{
var span = new CKEDITOR.dom.element( 'span' );
span.setText( text );
return span.getHtml();
};
var fix1 = ( standard( '\n' ).toLowerCase() == '<br>' ) ?
function( text )
{
// #3874 IE and Safari encode line-break in... | javascript | function( text )
{
var standard = function( text )
{
var span = new CKEDITOR.dom.element( 'span' );
span.setText( text );
return span.getHtml();
};
var fix1 = ( standard( '\n' ).toLowerCase() == '<br>' ) ?
function( text )
{
// #3874 IE and Safari encode line-break in... | [
"function",
"(",
"text",
")",
"{",
"var",
"standard",
"=",
"function",
"(",
"text",
")",
"{",
"var",
"span",
"=",
"new",
"CKEDITOR",
".",
"dom",
".",
"element",
"(",
"'span'",
")",
";",
"span",
".",
"setText",
"(",
"text",
")",
";",
"return",
"span... | Replace special HTML characters in a string with their relative HTML
entity values.
@param {String} text The string to be encoded.
@returns {String} The encode string.
@example
alert( CKEDITOR.tools.htmlEncode( 'A > B & C < D' ) ); // "A &gt; B &amp; C &lt; D" | [
"Replace",
"special",
"HTML",
"characters",
"in",
"a",
"string",
"with",
"their",
"relative",
"HTML",
"entity",
"values",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/tools.js#L296-L333 | |
47,484 | saggiyogesh/nodeportal | public/ckeditor/_source/core/tools.js | function( func, milliseconds, scope, args, ownerWindow )
{
if ( !ownerWindow )
ownerWindow = window;
if ( !scope )
scope = ownerWindow;
return ownerWindow.setTimeout(
function()
{
if ( args )
func.apply( scope, [].concat( args ) ) ;
else
func.apply( scope... | javascript | function( func, milliseconds, scope, args, ownerWindow )
{
if ( !ownerWindow )
ownerWindow = window;
if ( !scope )
scope = ownerWindow;
return ownerWindow.setTimeout(
function()
{
if ( args )
func.apply( scope, [].concat( args ) ) ;
else
func.apply( scope... | [
"function",
"(",
"func",
",",
"milliseconds",
",",
"scope",
",",
"args",
",",
"ownerWindow",
")",
"{",
"if",
"(",
"!",
"ownerWindow",
")",
"ownerWindow",
"=",
"window",
";",
"if",
"(",
"!",
"scope",
")",
"scope",
"=",
"ownerWindow",
";",
"return",
"own... | Executes a function after specified delay.
@param {Function} func The function to be executed.
@param {Number} [milliseconds] The amount of time (millisecods) to wait
to fire the function execution. Defaults to zero.
@param {Object} [scope] The object to hold the function execution scope
(the "this" object). By default... | [
"Executes",
"a",
"function",
"after",
"specified",
"delay",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/tools.js#L430-L447 | |
47,485 | saggiyogesh/nodeportal | public/ckeditor/_source/core/tools.js | function( ref )
{
var fn = functions[ ref ];
return fn && fn.apply( window, Array.prototype.slice.call( arguments, 1 ) );
} | javascript | function( ref )
{
var fn = functions[ ref ];
return fn && fn.apply( window, Array.prototype.slice.call( arguments, 1 ) );
} | [
"function",
"(",
"ref",
")",
"{",
"var",
"fn",
"=",
"functions",
"[",
"ref",
"]",
";",
"return",
"fn",
"&&",
"fn",
".",
"apply",
"(",
"window",
",",
"Array",
".",
"prototype",
".",
"slice",
".",
"call",
"(",
"arguments",
",",
"1",
")",
")",
";",
... | Executes a function based on the reference created with
CKEDITOR.tools.addFunction.
@param {Number} ref The function reference created with
CKEDITOR.tools.addFunction.
@param {[Any,[Any,...]} params Any number of parameters to be passed
to the executed function.
@returns {Any} The return value of the function.
@example... | [
"Executes",
"a",
"function",
"based",
"on",
"the",
"reference",
"created",
"with",
"CKEDITOR",
".",
"tools",
".",
"addFunction",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/core/tools.js#L671-L675 | |
47,486 | dailymotion/react-collider | lib/server.js | returnResponse | function returnResponse(res, Handler, data, perfInstance) {
var content = React.renderToString(React.createElement(Handler, { data: data })),
html = '<!DOCTYPE html>' + content;
options.log && log(options.log, 'perf', perfInstance());
res.end(html);
} | javascript | function returnResponse(res, Handler, data, perfInstance) {
var content = React.renderToString(React.createElement(Handler, { data: data })),
html = '<!DOCTYPE html>' + content;
options.log && log(options.log, 'perf', perfInstance());
res.end(html);
} | [
"function",
"returnResponse",
"(",
"res",
",",
"Handler",
",",
"data",
",",
"perfInstance",
")",
"{",
"var",
"content",
"=",
"React",
".",
"renderToString",
"(",
"React",
".",
"createElement",
"(",
"Handler",
",",
"{",
"data",
":",
"data",
"}",
")",
")",... | Server side rendering | [
"Server",
"side",
"rendering"
] | 00cea5d25928d4a3ff0c68b6535edbc231d2b0a1 | https://github.com/dailymotion/react-collider/blob/00cea5d25928d4a3ff0c68b6535edbc231d2b0a1/lib/server.js#L40-L45 |
47,487 | francois2metz/node-spore | lib/client.js | function(url, callback) {
var parsedUrl = urlparse(url, true);
var method = this._normalizeSpecMethod(this.spec, {
base_url: parsedUrl.protocol +'//' + parsedUrl.hostname,
headers: {},
method: 'GET',
path: parsedUrl.pathname + parsedUrl.search
});
... | javascript | function(url, callback) {
var parsedUrl = urlparse(url, true);
var method = this._normalizeSpecMethod(this.spec, {
base_url: parsedUrl.protocol +'//' + parsedUrl.hostname,
headers: {},
method: 'GET',
path: parsedUrl.pathname + parsedUrl.search
});
... | [
"function",
"(",
"url",
",",
"callback",
")",
"{",
"var",
"parsedUrl",
"=",
"urlparse",
"(",
"url",
",",
"true",
")",
";",
"var",
"method",
"=",
"this",
".",
"_normalizeSpecMethod",
"(",
"this",
".",
"spec",
",",
"{",
"base_url",
":",
"parsedUrl",
".",... | Direct get request | [
"Direct",
"get",
"request"
] | a74df36300852d8bab70c83506e4a3301137b6a0 | https://github.com/francois2metz/node-spore/blob/a74df36300852d8bab70c83506e4a3301137b6a0/lib/client.js#L38-L48 | |
47,488 | francois2metz/node-spore | lib/client.js | function(middleware) {
this.middlewares = this.middlewares.filter(function(element) {
if (element.fun === middleware)
return false;
return true;
});
} | javascript | function(middleware) {
this.middlewares = this.middlewares.filter(function(element) {
if (element.fun === middleware)
return false;
return true;
});
} | [
"function",
"(",
"middleware",
")",
"{",
"this",
".",
"middlewares",
"=",
"this",
".",
"middlewares",
".",
"filter",
"(",
"function",
"(",
"element",
")",
"{",
"if",
"(",
"element",
".",
"fun",
"===",
"middleware",
")",
"return",
"false",
";",
"return",
... | Disable middleware at runtime | [
"Disable",
"middleware",
"at",
"runtime"
] | a74df36300852d8bab70c83506e4a3301137b6a0 | https://github.com/francois2metz/node-spore/blob/a74df36300852d8bab70c83506e4a3301137b6a0/lib/client.js#L64-L70 | |
47,489 | francois2metz/node-spore | lib/client.js | function(methodName, args) {
var method = this.spec.methods[methodName];
if (method.deprecated === true)
console.warn('Method '+ methodName + ' is deprecated.')
var callback = args.pop(); // callback is always at the end
var middleware = args[0];
var params = null... | javascript | function(methodName, args) {
var method = this.spec.methods[methodName];
if (method.deprecated === true)
console.warn('Method '+ methodName + ' is deprecated.')
var callback = args.pop(); // callback is always at the end
var middleware = args[0];
var params = null... | [
"function",
"(",
"methodName",
",",
"args",
")",
"{",
"var",
"method",
"=",
"this",
".",
"spec",
".",
"methods",
"[",
"methodName",
"]",
";",
"if",
"(",
"method",
".",
"deprecated",
"===",
"true",
")",
"console",
".",
"warn",
"(",
"'Method '",
"+",
"... | args is an array with some possibilities
middleware, params, payload, callback
middleware, payload, callback
middleware, params, callback
middleware, callback
params, payload, callback
payload, callback
params, callback
callback | [
"args",
"is",
"an",
"array",
"with",
"some",
"possibilities",
"middleware",
"params",
"payload",
"callback",
"middleware",
"payload",
"callback",
"middleware",
"params",
"callback",
"middleware",
"callback",
"params",
"payload",
"callback",
"payload",
"callback",
"par... | a74df36300852d8bab70c83506e4a3301137b6a0 | https://github.com/francois2metz/node-spore/blob/a74df36300852d8bab70c83506e4a3301137b6a0/lib/client.js#L96-L127 | |
47,490 | francois2metz/node-spore | lib/client.js | function(request, callback, response_middlewares) {
var that = this;
request.finalize(function(err, res) {
if (err) callback(err, null);
else that._callResponseMiddlewares(response_middlewares, res, callback);
});
} | javascript | function(request, callback, response_middlewares) {
var that = this;
request.finalize(function(err, res) {
if (err) callback(err, null);
else that._callResponseMiddlewares(response_middlewares, res, callback);
});
} | [
"function",
"(",
"request",
",",
"callback",
",",
"response_middlewares",
")",
"{",
"var",
"that",
"=",
"this",
";",
"request",
".",
"finalize",
"(",
"function",
"(",
"err",
",",
"res",
")",
"{",
"if",
"(",
"err",
")",
"callback",
"(",
"err",
",",
"n... | Make http request | [
"Make",
"http",
"request"
] | a74df36300852d8bab70c83506e4a3301137b6a0 | https://github.com/francois2metz/node-spore/blob/a74df36300852d8bab70c83506e4a3301137b6a0/lib/client.js#L192-L198 | |
47,491 | francois2metz/node-spore | lib/client.js | function(methodDef, callback, params, payload) {
// check required params
for (var index in methodDef.required_params) {
var requiredParamName = methodDef.required_params[index];
if (!params.hasOwnProperty(requiredParamName)) {
callback(requiredParamName +' param ... | javascript | function(methodDef, callback, params, payload) {
// check required params
for (var index in methodDef.required_params) {
var requiredParamName = methodDef.required_params[index];
if (!params.hasOwnProperty(requiredParamName)) {
callback(requiredParamName +' param ... | [
"function",
"(",
"methodDef",
",",
"callback",
",",
"params",
",",
"payload",
")",
"{",
"// check required params",
"for",
"(",
"var",
"index",
"in",
"methodDef",
".",
"required_params",
")",
"{",
"var",
"requiredParamName",
"=",
"methodDef",
".",
"required_para... | Check params and payload | [
"Check",
"params",
"and",
"payload"
] | a74df36300852d8bab70c83506e4a3301137b6a0 | https://github.com/francois2metz/node-spore/blob/a74df36300852d8bab70c83506e4a3301137b6a0/lib/client.js#L235-L260 | |
47,492 | nijikokun/http-responses | index.js | GenericRestError | function GenericRestError (type, status) {
return function Handler (code, message, header) {
return new RestError(type, status, code, message, header)
}
} | javascript | function GenericRestError (type, status) {
return function Handler (code, message, header) {
return new RestError(type, status, code, message, header)
}
} | [
"function",
"GenericRestError",
"(",
"type",
",",
"status",
")",
"{",
"return",
"function",
"Handler",
"(",
"code",
",",
"message",
",",
"header",
")",
"{",
"return",
"new",
"RestError",
"(",
"type",
",",
"status",
",",
"code",
",",
"message",
",",
"head... | Setup pre-defined status code for RestError method
@param {Number} status HTTP Status Code
@private | [
"Setup",
"pre",
"-",
"defined",
"status",
"code",
"for",
"RestError",
"method"
] | f33f01c69ba720773adaba6d1b596f2b973f5189 | https://github.com/nijikokun/http-responses/blob/f33f01c69ba720773adaba6d1b596f2b973f5189/index.js#L174-L178 |
47,493 | jeffsu/js2 | src/core/js2-lexer.js | function(stuff) {
var len = this.str.length;
if (typeof stuff == 'number') {
this.str = this.str.substr(stuff);
} else if (typeof stuff == 'string') {
this.str = this.str.substr(stuff.length);
} else if (stuff instanceof RegExp) {
var m = this.str.match(stuff);
if... | javascript | function(stuff) {
var len = this.str.length;
if (typeof stuff == 'number') {
this.str = this.str.substr(stuff);
} else if (typeof stuff == 'string') {
this.str = this.str.substr(stuff.length);
} else if (stuff instanceof RegExp) {
var m = this.str.match(stuff);
if... | [
"function",
"(",
"stuff",
")",
"{",
"var",
"len",
"=",
"this",
".",
"str",
".",
"length",
";",
"if",
"(",
"typeof",
"stuff",
"==",
"'number'",
")",
"{",
"this",
".",
"str",
"=",
"this",
".",
"str",
".",
"substr",
"(",
"stuff",
")",
";",
"}",
"e... | stuff can be string, integer, or regex will return true if it actually made the string smaller | [
"stuff",
"can",
"be",
"string",
"integer",
"or",
"regex",
"will",
"return",
"true",
"if",
"it",
"actually",
"made",
"the",
"string",
"smaller"
] | 5651e6d8ceaea1239aa162462ab9eab80c640707 | https://github.com/jeffsu/js2/blob/5651e6d8ceaea1239aa162462ab9eab80c640707/src/core/js2-lexer.js#L350-L363 | |
47,494 | wombleton/angular-gettext-extract-loader | index.js | mergeReferences | function mergeReferences (oldRefs, newRefs) {
const _newRefs = _(newRefs);
return _(oldRefs)
.reject(function (oldRef) {
return _newRefs.any(function (newRef) {
return matches(oldRef, newRef);
});
})
.concat(newRefs)
.uniq()
.sort(... | javascript | function mergeReferences (oldRefs, newRefs) {
const _newRefs = _(newRefs);
return _(oldRefs)
.reject(function (oldRef) {
return _newRefs.any(function (newRef) {
return matches(oldRef, newRef);
});
})
.concat(newRefs)
.uniq()
.sort(... | [
"function",
"mergeReferences",
"(",
"oldRefs",
",",
"newRefs",
")",
"{",
"const",
"_newRefs",
"=",
"_",
"(",
"newRefs",
")",
";",
"return",
"_",
"(",
"oldRefs",
")",
".",
"reject",
"(",
"function",
"(",
"oldRef",
")",
"{",
"return",
"_newRefs",
".",
"a... | Merge new references with old references; ignore old references from the same file. | [
"Merge",
"new",
"references",
"with",
"old",
"references",
";",
"ignore",
"old",
"references",
"from",
"the",
"same",
"file",
"."
] | 8b977383b4f34a74e967d99267b70c83aa53cffd | https://github.com/wombleton/angular-gettext-extract-loader/blob/8b977383b4f34a74e967d99267b70c83aa53cffd/index.js#L15-L28 |
47,495 | bevacqua/measly | sample/sample.js | preventAll | function preventAll () {
function shield (req) {
req.prevent();
}
measly.on('create', shield);
text(preventButton, 'Shield On..');
preventButton.classList.add('cm-prevent-on');
setTimeout(function () {
measly.off('create', shield);
text(preventButton, 'Prevent for 5s');
... | javascript | function preventAll () {
function shield (req) {
req.prevent();
}
measly.on('create', shield);
text(preventButton, 'Shield On..');
preventButton.classList.add('cm-prevent-on');
setTimeout(function () {
measly.off('create', shield);
text(preventButton, 'Prevent for 5s');
... | [
"function",
"preventAll",
"(",
")",
"{",
"function",
"shield",
"(",
"req",
")",
"{",
"req",
".",
"prevent",
"(",
")",
";",
"}",
"measly",
".",
"on",
"(",
"'create'",
",",
"shield",
")",
";",
"text",
"(",
"preventButton",
",",
"'Shield On..'",
")",
";... | prevents all requests fired by measly for 5 seconds. | [
"prevents",
"all",
"requests",
"fired",
"by",
"measly",
"for",
"5",
"seconds",
"."
] | bc94d8207c61f7140da8a2a4879e3ca15e1a4b38 | https://github.com/bevacqua/measly/blob/bc94d8207c61f7140da8a2a4879e3ca15e1a4b38/sample/sample.js#L117-L130 |
47,496 | jeffsu/js2 | flavors/ringo-full.js | mainFunction | function mainFunction (arg) {
if (typeof arg == 'string') {
return JS2.Parser.parse(arg).toString();
} else if (arg instanceof Array) {
return new JS2.Array(arg);
} else {
return new JS2.Array();
}
} | javascript | function mainFunction (arg) {
if (typeof arg == 'string') {
return JS2.Parser.parse(arg).toString();
} else if (arg instanceof Array) {
return new JS2.Array(arg);
} else {
return new JS2.Array();
}
} | [
"function",
"mainFunction",
"(",
"arg",
")",
"{",
"if",
"(",
"typeof",
"arg",
"==",
"'string'",
")",
"{",
"return",
"JS2",
".",
"Parser",
".",
"parse",
"(",
"arg",
")",
".",
"toString",
"(",
")",
";",
"}",
"else",
"if",
"(",
"arg",
"instanceof",
"A... | temporarily set root to JS2 global var for this scope | [
"temporarily",
"set",
"root",
"to",
"JS2",
"global",
"var",
"for",
"this",
"scope"
] | 5651e6d8ceaea1239aa162462ab9eab80c640707 | https://github.com/jeffsu/js2/blob/5651e6d8ceaea1239aa162462ab9eab80c640707/flavors/ringo-full.js#L4-L12 |
47,497 | UsabilityDynamics/node-wordpress-client | examples/get-single.js | havePosts | function havePosts( error, post ) {
this.debug( 'haveSingle' );
console.log( require( 'util' ).inspect( post, { showHidden: false, colors: true, depth: 4 } ) );
} | javascript | function havePosts( error, post ) {
this.debug( 'haveSingle' );
console.log( require( 'util' ).inspect( post, { showHidden: false, colors: true, depth: 4 } ) );
} | [
"function",
"havePosts",
"(",
"error",
",",
"post",
")",
"{",
"this",
".",
"debug",
"(",
"'haveSingle'",
")",
";",
"console",
".",
"log",
"(",
"require",
"(",
"'util'",
")",
".",
"inspect",
"(",
"post",
",",
"{",
"showHidden",
":",
"false",
",",
"col... | Post Query Callback
@param error
@param post | [
"Post",
"Query",
"Callback"
] | 2b47a7c5cadd3d8f2cfd255f997f36af14a5d843 | https://github.com/UsabilityDynamics/node-wordpress-client/blob/2b47a7c5cadd3d8f2cfd255f997f36af14a5d843/examples/get-single.js#L14-L17 |
47,498 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/wysiwygarea/plugin.js | function( data )
{
if ( iframe )
iframe.remove();
var src =
'document.open();' +
// The document domain must be set any time we
// call document.open().
( isCustomDomain ? ( 'document.domain="' + document.domain + '";' ) : '' ) +
'document.close(... | javascript | function( data )
{
if ( iframe )
iframe.remove();
var src =
'document.open();' +
// The document domain must be set any time we
// call document.open().
( isCustomDomain ? ( 'document.domain="' + document.domain + '";' ) : '' ) +
'document.close(... | [
"function",
"(",
"data",
")",
"{",
"if",
"(",
"iframe",
")",
"iframe",
".",
"remove",
"(",
")",
";",
"var",
"src",
"=",
"'document.open();'",
"+",
"// The document domain must be set any time we\r",
"// call document.open().\r",
"(",
"isCustomDomain",
"?",
"(",
"'... | Creates the iframe that holds the editable document. | [
"Creates",
"the",
"iframe",
"that",
"holds",
"the",
"editable",
"document",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/wysiwygarea/plugin.js#L494-L549 | |
47,499 | saggiyogesh/nodeportal | public/ckeditor/_source/plugins/wysiwygarea/plugin.js | blinkCursor | function blinkCursor( retry )
{
if ( editor.readOnly )
return;
CKEDITOR.tools.tryThese(
function()
{
editor.document.$.designMode = 'on';
setTimeout( function()
{
editor.document.$.designMode = 'off';
if ( CKEDITOR.currentInstance == editor )
... | javascript | function blinkCursor( retry )
{
if ( editor.readOnly )
return;
CKEDITOR.tools.tryThese(
function()
{
editor.document.$.designMode = 'on';
setTimeout( function()
{
editor.document.$.designMode = 'off';
if ( CKEDITOR.currentInstance == editor )
... | [
"function",
"blinkCursor",
"(",
"retry",
")",
"{",
"if",
"(",
"editor",
".",
"readOnly",
")",
"return",
";",
"CKEDITOR",
".",
"tools",
".",
"tryThese",
"(",
"function",
"(",
")",
"{",
"editor",
".",
"document",
".",
"$",
".",
"designMode",
"=",
"'on'",... | Switch on design mode for a short while and close it after then. | [
"Switch",
"on",
"design",
"mode",
"for",
"a",
"short",
"while",
"and",
"close",
"it",
"after",
"then",
"."
] | cfd5b340f259d3a57c20892a1e2c95b133fe99ee | https://github.com/saggiyogesh/nodeportal/blob/cfd5b340f259d3a57c20892a1e2c95b133fe99ee/public/ckeditor/_source/plugins/wysiwygarea/plugin.js#L1171-L1199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.