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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
39,400 | S3bb1/ah-dashboard-plugin | public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColReorder/js/dataTables.colReorder.js | function ()
{
var aoColumns = this.s.dt.aoColumns;
this.s.aoTargets.splice( 0, this.s.aoTargets.length );
this.s.aoTargets.push( {
"x": $(this.s.dt.nTable).offset().left,
"to": 0
} );
var iToPoint = 0;
for ( var i=0, iLen=aoColumns.length ; i<iLen ; i++ )
{
/* For the column / header in ques... | javascript | function ()
{
var aoColumns = this.s.dt.aoColumns;
this.s.aoTargets.splice( 0, this.s.aoTargets.length );
this.s.aoTargets.push( {
"x": $(this.s.dt.nTable).offset().left,
"to": 0
} );
var iToPoint = 0;
for ( var i=0, iLen=aoColumns.length ; i<iLen ; i++ )
{
/* For the column / header in ques... | [
"function",
"(",
")",
"{",
"var",
"aoColumns",
"=",
"this",
".",
"s",
".",
"dt",
".",
"aoColumns",
";",
"this",
".",
"s",
".",
"aoTargets",
".",
"splice",
"(",
"0",
",",
"this",
".",
"s",
".",
"aoTargets",
".",
"length",
")",
";",
"this",
".",
... | Calculate a cached array with the points of the column inserts, and the
'to' points
@method _fnRegions
@returns void
@private | [
"Calculate",
"a",
"cached",
"array",
"with",
"the",
"points",
"of",
"the",
"column",
"inserts",
"and",
"the",
"to",
"points"
] | c283370ec0f99a25db5bb7029a98b4febf8c5251 | https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColReorder/js/dataTables.colReorder.js#L989-L1032 | |
39,401 | S3bb1/ah-dashboard-plugin | public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColReorder/js/dataTables.colReorder.js | function ()
{
var scrolling = this.s.dt.oScroll.sX !== "" || this.s.dt.oScroll.sY !== "";
var origCell = this.s.dt.aoColumns[ this.s.mouse.targetIndex ].nTh;
var origTr = origCell.parentNode;
var origThead = origTr.parentNode;
var origTable = origThead.parentNode;
var cloneCell = $(origCell).clone();
/... | javascript | function ()
{
var scrolling = this.s.dt.oScroll.sX !== "" || this.s.dt.oScroll.sY !== "";
var origCell = this.s.dt.aoColumns[ this.s.mouse.targetIndex ].nTh;
var origTr = origCell.parentNode;
var origThead = origTr.parentNode;
var origTable = origThead.parentNode;
var cloneCell = $(origCell).clone();
/... | [
"function",
"(",
")",
"{",
"var",
"scrolling",
"=",
"this",
".",
"s",
".",
"dt",
".",
"oScroll",
".",
"sX",
"!==",
"\"\"",
"||",
"this",
".",
"s",
".",
"dt",
".",
"oScroll",
".",
"sY",
"!==",
"\"\"",
";",
"var",
"origCell",
"=",
"this",
".",
"s... | Copy the TH element that is being drags so the user has the idea that they are actually
moving it around the page.
@method _fnCreateDragNode
@returns void
@private | [
"Copy",
"the",
"TH",
"element",
"that",
"is",
"being",
"drags",
"so",
"the",
"user",
"has",
"the",
"idea",
"that",
"they",
"are",
"actually",
"moving",
"it",
"around",
"the",
"page",
"."
] | c283370ec0f99a25db5bb7029a98b4febf8c5251 | https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColReorder/js/dataTables.colReorder.js#L1042-L1085 | |
39,402 | S3bb1/ah-dashboard-plugin | public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColReorder/js/dataTables.colReorder.js | function ()
{
var i, iLen;
for ( i=0, iLen=this.s.dt.aoDrawCallback.length ; i<iLen ; i++ )
{
if ( this.s.dt.aoDrawCallback[i].sName === 'ColReorder_Pre' )
{
this.s.dt.aoDrawCallback.splice( i, 1 );
break;
}
}
$(this.s.dt.nTHead).find( '*' ).off( '.ColReorder' );
$.each( this.s.dt.aoCol... | javascript | function ()
{
var i, iLen;
for ( i=0, iLen=this.s.dt.aoDrawCallback.length ; i<iLen ; i++ )
{
if ( this.s.dt.aoDrawCallback[i].sName === 'ColReorder_Pre' )
{
this.s.dt.aoDrawCallback.splice( i, 1 );
break;
}
}
$(this.s.dt.nTHead).find( '*' ).off( '.ColReorder' );
$.each( this.s.dt.aoCol... | [
"function",
"(",
")",
"{",
"var",
"i",
",",
"iLen",
";",
"for",
"(",
"i",
"=",
"0",
",",
"iLen",
"=",
"this",
".",
"s",
".",
"dt",
".",
"aoDrawCallback",
".",
"length",
";",
"i",
"<",
"iLen",
";",
"i",
"++",
")",
"{",
"if",
"(",
"this",
"."... | Clean up ColReorder memory references and event handlers
@method _fnDestroy
@returns void
@private | [
"Clean",
"up",
"ColReorder",
"memory",
"references",
"and",
"event",
"handlers"
] | c283370ec0f99a25db5bb7029a98b4febf8c5251 | https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColReorder/js/dataTables.colReorder.js#L1093-L1114 | |
39,403 | S3bb1/ah-dashboard-plugin | public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColReorder/js/dataTables.colReorder.js | function ()
{
$.each( this.s.dt.aoColumns, function (i, column) {
$(column.nTh).attr('data-column-index', i);
} );
} | javascript | function ()
{
$.each( this.s.dt.aoColumns, function (i, column) {
$(column.nTh).attr('data-column-index', i);
} );
} | [
"function",
"(",
")",
"{",
"$",
".",
"each",
"(",
"this",
".",
"s",
".",
"dt",
".",
"aoColumns",
",",
"function",
"(",
"i",
",",
"column",
")",
"{",
"$",
"(",
"column",
".",
"nTh",
")",
".",
"attr",
"(",
"'data-column-index'",
",",
"i",
")",
";... | Add a data attribute to the column headers, so we know the index of
the row to be reordered. This allows fast detection of the index, and
for this plug-in to work with FixedHeader which clones the nodes.
@private | [
"Add",
"a",
"data",
"attribute",
"to",
"the",
"column",
"headers",
"so",
"we",
"know",
"the",
"index",
"of",
"the",
"row",
"to",
"be",
"reordered",
".",
"This",
"allows",
"fast",
"detection",
"of",
"the",
"index",
"and",
"for",
"this",
"plug",
"-",
"in... | c283370ec0f99a25db5bb7029a98b4febf8c5251 | https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColReorder/js/dataTables.colReorder.js#L1123-L1128 | |
39,404 | Mozu/grunt-mozu-appdev-sync | tasks/mozusync.js | function() {
return appdev.getMetadata(['./assets/functions.json']).then(function() {
if (!appdev.client.context['user-claims']) {
grunt.fail.fatal('failed to authenticate to Mozu');
done();
return false;
}
... | javascript | function() {
return appdev.getMetadata(['./assets/functions.json']).then(function() {
if (!appdev.client.context['user-claims']) {
grunt.fail.fatal('failed to authenticate to Mozu');
done();
return false;
}
... | [
"function",
"(",
")",
"{",
"return",
"appdev",
".",
"getMetadata",
"(",
"[",
"'./assets/functions.json'",
"]",
")",
".",
"then",
"(",
"function",
"(",
")",
"{",
"if",
"(",
"!",
"appdev",
".",
"client",
".",
"context",
"[",
"'user-claims'",
"]",
")",
"{... | add a single get call to initialize the credentials. Paralallezing calls caused issues reading from the console . | [
"add",
"a",
"single",
"get",
"call",
"to",
"initialize",
"the",
"credentials",
".",
"Paralallezing",
"calls",
"caused",
"issues",
"reading",
"from",
"the",
"console",
"."
] | 5eb27b91113c8b30420404b767895bcb7e9a92b5 | https://github.com/Mozu/grunt-mozu-appdev-sync/blob/5eb27b91113c8b30420404b767895bcb7e9a92b5/tasks/mozusync.js#L246-L260 | |
39,405 | tywei90/arr-del | index.js | arrDel | function arrDel(arr, indexArr) {
// check params
if (arr == null) {
return [];
}else if(Object.prototype.toString.call(arr) !== "[object Array]"){
throw new TypeError('PARAM MUST BE ARRAY');
}
if(indexArr == null){
return arr
}else if(Object.prototype.toString.call(indexArr) !== "[object Array]")... | javascript | function arrDel(arr, indexArr) {
// check params
if (arr == null) {
return [];
}else if(Object.prototype.toString.call(arr) !== "[object Array]"){
throw new TypeError('PARAM MUST BE ARRAY');
}
if(indexArr == null){
return arr
}else if(Object.prototype.toString.call(indexArr) !== "[object Array]")... | [
"function",
"arrDel",
"(",
"arr",
",",
"indexArr",
")",
"{",
"// check params",
"if",
"(",
"arr",
"==",
"null",
")",
"{",
"return",
"[",
"]",
";",
"}",
"else",
"if",
"(",
"Object",
".",
"prototype",
".",
"toString",
".",
"call",
"(",
"arr",
")",
"!... | Delete array elements in one time by array consists of their indexes
@param {Array} `arr` The Array to sort.
@param {Number Array} `indexArr` Array consists of indexes which you want to delete.
@return {Array} Returns a new deleted array.
@api public | [
"Delete",
"array",
"elements",
"in",
"one",
"time",
"by",
"array",
"consists",
"of",
"their",
"indexes"
] | c1f55b9621a154785d8ef35bfc60fb4d1c3a2d62 | https://github.com/tywei90/arr-del/blob/c1f55b9621a154785d8ef35bfc60fb4d1c3a2d62/index.js#L21-L64 |
39,406 | gillesruppert/nodecopter-leap | leap-remote.js | getGesture | function getGesture(gestures, type) {
if (!gestures.length) return;
var types = _.pluck(gestures, 'type');
var index = types.indexOf(type);
if (index > -1) return gestures[index];
} | javascript | function getGesture(gestures, type) {
if (!gestures.length) return;
var types = _.pluck(gestures, 'type');
var index = types.indexOf(type);
if (index > -1) return gestures[index];
} | [
"function",
"getGesture",
"(",
"gestures",
",",
"type",
")",
"{",
"if",
"(",
"!",
"gestures",
".",
"length",
")",
"return",
";",
"var",
"types",
"=",
"_",
".",
"pluck",
"(",
"gestures",
",",
"'type'",
")",
";",
"var",
"index",
"=",
"types",
".",
"i... | get only the circle gesture from the gestures array | [
"get",
"only",
"the",
"circle",
"gesture",
"from",
"the",
"gestures",
"array"
] | d0fea0166bc13f0bec5ede97dd418be0016260f6 | https://github.com/gillesruppert/nodecopter-leap/blob/d0fea0166bc13f0bec5ede97dd418be0016260f6/leap-remote.js#L94-L99 |
39,407 | tarunc/mongoose-stamp | lib/mongoose-stamps.js | timestampsPlugin | function timestampsPlugin(schema, options) {
// Add the fields to the schema
schema.add({
createdAt: {
type: Date,
'default': Date.now
},
updatedAt: {
type: Date,
'default': Date.now
},
deletedAt: {
type: Date,
sparse: true
}
});
// Define the pre sa... | javascript | function timestampsPlugin(schema, options) {
// Add the fields to the schema
schema.add({
createdAt: {
type: Date,
'default': Date.now
},
updatedAt: {
type: Date,
'default': Date.now
},
deletedAt: {
type: Date,
sparse: true
}
});
// Define the pre sa... | [
"function",
"timestampsPlugin",
"(",
"schema",
",",
"options",
")",
"{",
"// Add the fields to the schema",
"schema",
".",
"add",
"(",
"{",
"createdAt",
":",
"{",
"type",
":",
"Date",
",",
"'default'",
":",
"Date",
".",
"now",
"}",
",",
"updatedAt",
":",
"... | `Timestamps` Plugin for Mongoose.
@param {mongoose.Schema} schema -
@param {Object} options - some options
@api public | [
"Timestamps",
"Plugin",
"for",
"Mongoose",
"."
] | 9714b79b5cd1ee17195fc4812c28cf5534f7764a | https://github.com/tarunc/mongoose-stamp/blob/9714b79b5cd1ee17195fc4812c28cf5534f7764a/lib/mongoose-stamps.js#L9-L37 |
39,408 | alexcjohnson/world-calendars | dist/main.js | function(date) {
if (this._calendar.name !== date._calendar.name) {
throw (_exports.local.differentCalendars || _exports.regionalOptions[''].differentCalendars).
replace(/\{0\}/, this._calendar.local.name).replace(/\{1\}/, date._calendar.local.name);
}
var c = (this._... | javascript | function(date) {
if (this._calendar.name !== date._calendar.name) {
throw (_exports.local.differentCalendars || _exports.regionalOptions[''].differentCalendars).
replace(/\{0\}/, this._calendar.local.name).replace(/\{1\}/, date._calendar.local.name);
}
var c = (this._... | [
"function",
"(",
"date",
")",
"{",
"if",
"(",
"this",
".",
"_calendar",
".",
"name",
"!==",
"date",
".",
"_calendar",
".",
"name",
")",
"{",
"throw",
"(",
"_exports",
".",
"local",
".",
"differentCalendars",
"||",
"_exports",
".",
"regionalOptions",
"[",... | Compare this date to another date.
@memberof CDate
@param date {CDate} The other date.
@return {number} -1 if this date is before the other date,
0 if they are equal, or +1 if this date is after the other date. | [
"Compare",
"this",
"date",
"to",
"another",
"date",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/dist/main.js#L302-L311 | |
39,409 | alexcjohnson/world-calendars | dist/main.js | function(year) {
var date = this._validate(year, this.minMonth, this.minDay,
_exports.local.invalidYear || _exports.regionalOptions[''].invalidYear);
return (date.year() < 0 ? '-' : '') + pad(Math.abs(date.year()), 4)
} | javascript | function(year) {
var date = this._validate(year, this.minMonth, this.minDay,
_exports.local.invalidYear || _exports.regionalOptions[''].invalidYear);
return (date.year() < 0 ? '-' : '') + pad(Math.abs(date.year()), 4)
} | [
"function",
"(",
"year",
")",
"{",
"var",
"date",
"=",
"this",
".",
"_validate",
"(",
"year",
",",
"this",
".",
"minMonth",
",",
"this",
".",
"minDay",
",",
"_exports",
".",
"local",
".",
"invalidYear",
"||",
"_exports",
".",
"regionalOptions",
"[",
"'... | Format the year, if not a simple sequential number
@memberof BaseCalendar
@param year {CDate|number} The date to format or the year to format.
@return {string} The formatted year.
@throws Error if an invalid year or a different calendar used. | [
"Format",
"the",
"year",
"if",
"not",
"a",
"simple",
"sequential",
"number"
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/dist/main.js#L415-L419 | |
39,410 | alexcjohnson/world-calendars | dist/main.js | function(year, ord) {
var m = (ord + this.firstMonth - 2 * this.minMonth) %
this.monthsInYear(year) + this.minMonth;
this._validate(year, m, this.minDay,
_exports.local.invalidMonth || _exports.regionalOptions[''].invalidMonth);
return m;
} | javascript | function(year, ord) {
var m = (ord + this.firstMonth - 2 * this.minMonth) %
this.monthsInYear(year) + this.minMonth;
this._validate(year, m, this.minDay,
_exports.local.invalidMonth || _exports.regionalOptions[''].invalidMonth);
return m;
} | [
"function",
"(",
"year",
",",
"ord",
")",
"{",
"var",
"m",
"=",
"(",
"ord",
"+",
"this",
".",
"firstMonth",
"-",
"2",
"*",
"this",
".",
"minMonth",
")",
"%",
"this",
".",
"monthsInYear",
"(",
"year",
")",
"+",
"this",
".",
"minMonth",
";",
"this"... | Calculate actual month from ordinal position, starting from minMonth.
@memberof BaseCalendar
@param year {number} The year to examine.
@param ord {number} The month's ordinal position.
@return {number} The month's number.
@throws Error if an invalid year/month. | [
"Calculate",
"actual",
"month",
"from",
"ordinal",
"position",
"starting",
"from",
"minMonth",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/dist/main.js#L452-L458 | |
39,411 | alexcjohnson/world-calendars | dist/main.js | function(year, month, day) {
var date = this._validate(year, month, day,
_exports.local.invalidDate || _exports.regionalOptions[''].invalidDate);
return date.toJD() - this.newDate(date.year(),
this.fromMonthOfYear(date.year(), this.minMonth), this.minDay).toJD() + 1;
} | javascript | function(year, month, day) {
var date = this._validate(year, month, day,
_exports.local.invalidDate || _exports.regionalOptions[''].invalidDate);
return date.toJD() - this.newDate(date.year(),
this.fromMonthOfYear(date.year(), this.minMonth), this.minDay).toJD() + 1;
} | [
"function",
"(",
"year",
",",
"month",
",",
"day",
")",
"{",
"var",
"date",
"=",
"this",
".",
"_validate",
"(",
"year",
",",
"month",
",",
"day",
",",
"_exports",
".",
"local",
".",
"invalidDate",
"||",
"_exports",
".",
"regionalOptions",
"[",
"''",
... | Retrieve the day of the year for a date.
@memberof BaseCalendar
@param year {CDate|number} The date to convert or the year to convert.
@param [month] {number} The month to convert.
@param [day] {number} The day to convert.
@return {number} The day of the year.
@throws Error if an invalid date or a different calendar us... | [
"Retrieve",
"the",
"day",
"of",
"the",
"year",
"for",
"a",
"date",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/dist/main.js#L478-L483 | |
39,412 | alexcjohnson/world-calendars | dist/main.js | function(year, month, day) {
var date = this._validate(year, month, day,
_exports.local.invalidDate || _exports.regionalOptions[''].invalidDate);
return (Math.floor(this.toJD(date)) + 2) % this.daysInWeek();
} | javascript | function(year, month, day) {
var date = this._validate(year, month, day,
_exports.local.invalidDate || _exports.regionalOptions[''].invalidDate);
return (Math.floor(this.toJD(date)) + 2) % this.daysInWeek();
} | [
"function",
"(",
"year",
",",
"month",
",",
"day",
")",
"{",
"var",
"date",
"=",
"this",
".",
"_validate",
"(",
"year",
",",
"month",
",",
"day",
",",
"_exports",
".",
"local",
".",
"invalidDate",
"||",
"_exports",
".",
"regionalOptions",
"[",
"''",
... | Retrieve the day of the week for a date.
@memberof BaseCalendar
@param year {CDate|number} The date to examine or the year to examine.
@param [month] {number} The month to examine.
@param [day] {number} The day to examine.
@return {number} The day of the week: 0 to number of days - 1.
@throws Error if an invalid date o... | [
"Retrieve",
"the",
"day",
"of",
"the",
"week",
"for",
"a",
"date",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/dist/main.js#L499-L503 | |
39,413 | alexcjohnson/world-calendars | dist/main.js | function(year, month, day) {
this._validate(year, month, day,
_exports.local.invalidDate || _exports.regionalOptions[''].invalidDate);
return {};
} | javascript | function(year, month, day) {
this._validate(year, month, day,
_exports.local.invalidDate || _exports.regionalOptions[''].invalidDate);
return {};
} | [
"function",
"(",
"year",
",",
"month",
",",
"day",
")",
"{",
"this",
".",
"_validate",
"(",
"year",
",",
"month",
",",
"day",
",",
"_exports",
".",
"local",
".",
"invalidDate",
"||",
"_exports",
".",
"regionalOptions",
"[",
"''",
"]",
".",
"invalidDate... | Retrieve additional information about a date.
@memberof BaseCalendar
@param year {CDate|number} The date to examine or the year to examine.
@param [month] {number} The month to examine.
@param [day] {number} The day to examine.
@return {object} Additional information - contents depends on calendar.
@throws Error if an ... | [
"Retrieve",
"additional",
"information",
"about",
"a",
"date",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/dist/main.js#L512-L516 | |
39,414 | alexcjohnson/world-calendars | dist/main.js | function(date, value, period) {
this._validate(date, this.minMonth, this.minDay,
_exports.local.invalidDate || _exports.regionalOptions[''].invalidDate);
var y = (period === 'y' ? value : date.year());
var m = (period === 'm' ? value : date.month());
var d = (period === 'd' ?... | javascript | function(date, value, period) {
this._validate(date, this.minMonth, this.minDay,
_exports.local.invalidDate || _exports.regionalOptions[''].invalidDate);
var y = (period === 'y' ? value : date.year());
var m = (period === 'm' ? value : date.month());
var d = (period === 'd' ?... | [
"function",
"(",
"date",
",",
"value",
",",
"period",
")",
"{",
"this",
".",
"_validate",
"(",
"date",
",",
"this",
".",
"minMonth",
",",
"this",
".",
"minDay",
",",
"_exports",
".",
"local",
".",
"invalidDate",
"||",
"_exports",
".",
"regionalOptions",
... | Set a portion of the date.
@memberof BaseCalendar
@param date {CDate} The starting date.
@param value {number} The new value for the period.
@param period {string} One of 'y' for year, 'm' for month, 'd' for day.
@return {CDate} The updated date.
@throws Error if an invalid date or a different calendar used. | [
"Set",
"a",
"portion",
"of",
"the",
"date",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/dist/main.js#L615-L625 | |
39,415 | S3bb1/ah-dashboard-plugin | public/dashboard/bower_components/admin-lte/dist/js/app.js | function () {
//Get the object
var _this = this;
//Update options
var o = $.AdminLTE.options.controlSidebarOptions;
//Get the sidebar
var sidebar = $(o.selector);
//The toggle button
var btn = $(o.toggleBtnSelector);
//Listen to the click event
btn.on('click'... | javascript | function () {
//Get the object
var _this = this;
//Update options
var o = $.AdminLTE.options.controlSidebarOptions;
//Get the sidebar
var sidebar = $(o.selector);
//The toggle button
var btn = $(o.toggleBtnSelector);
//Listen to the click event
btn.on('click'... | [
"function",
"(",
")",
"{",
"//Get the object",
"var",
"_this",
"=",
"this",
";",
"//Update options",
"var",
"o",
"=",
"$",
".",
"AdminLTE",
".",
"options",
".",
"controlSidebarOptions",
";",
"//Get the sidebar",
"var",
"sidebar",
"=",
"$",
"(",
"o",
".",
"... | instantiate the object | [
"instantiate",
"the",
"object"
] | c283370ec0f99a25db5bb7029a98b4febf8c5251 | https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/dist/js/app.js#L443-L479 | |
39,416 | burnnat/grunt-debug | tasks/debug.js | function(name, brk, debugChildren) {
var deferred = Q.defer();
var args = process.argv;
grunt.task.clearQueue();
var tasks = args.slice(args.indexOf(name) + 1);
if (debugChildren) {
tasks.unshift('debug:hook' + (brk ? '-break' : ''));
}
var child = child_process.fork(
args[1],
tasks,
... | javascript | function(name, brk, debugChildren) {
var deferred = Q.defer();
var args = process.argv;
grunt.task.clearQueue();
var tasks = args.slice(args.indexOf(name) + 1);
if (debugChildren) {
tasks.unshift('debug:hook' + (brk ? '-break' : ''));
}
var child = child_process.fork(
args[1],
tasks,
... | [
"function",
"(",
"name",
",",
"brk",
",",
"debugChildren",
")",
"{",
"var",
"deferred",
"=",
"Q",
".",
"defer",
"(",
")",
";",
"var",
"args",
"=",
"process",
".",
"argv",
";",
"grunt",
".",
"task",
".",
"clearQueue",
"(",
")",
";",
"var",
"tasks",
... | Manually forks the Grunt process for debugging | [
"Manually",
"forks",
"the",
"Grunt",
"process",
"for",
"debugging"
] | 968fefb5c99621752bc8b81d0fe865c1f90b8eb0 | https://github.com/burnnat/grunt-debug/blob/968fefb5c99621752bc8b81d0fe865c1f90b8eb0/tasks/debug.js#L17-L51 | |
39,417 | burnnat/grunt-debug | tasks/debug.js | function() {
var pid = process.pid;
return Q.fcall(function() {
if (process.platform === 'win32') {
process._debugProcess(pid);
}
else {
process.kill(pid, 'SIGUSR1');
}
});
} | javascript | function() {
var pid = process.pid;
return Q.fcall(function() {
if (process.platform === 'win32') {
process._debugProcess(pid);
}
else {
process.kill(pid, 'SIGUSR1');
}
});
} | [
"function",
"(",
")",
"{",
"var",
"pid",
"=",
"process",
".",
"pid",
";",
"return",
"Q",
".",
"fcall",
"(",
"function",
"(",
")",
"{",
"if",
"(",
"process",
".",
"platform",
"===",
"'win32'",
")",
"{",
"process",
".",
"_debugProcess",
"(",
"pid",
"... | Sets up existing Grunt process for debugging | [
"Sets",
"up",
"existing",
"Grunt",
"process",
"for",
"debugging"
] | 968fefb5c99621752bc8b81d0fe865c1f90b8eb0 | https://github.com/burnnat/grunt-debug/blob/968fefb5c99621752bc8b81d0fe865c1f90b8eb0/tasks/debug.js#L56-L67 | |
39,418 | burnnat/grunt-debug | tasks/debug.js | function(brk) {
hooks.enableHooks(
brk,
function(module, port) {
grunt.log.ok('Debugging forked process %s on port %d', module, port);
}
);
} | javascript | function(brk) {
hooks.enableHooks(
brk,
function(module, port) {
grunt.log.ok('Debugging forked process %s on port %d', module, port);
}
);
} | [
"function",
"(",
"brk",
")",
"{",
"hooks",
".",
"enableHooks",
"(",
"brk",
",",
"function",
"(",
"module",
",",
"port",
")",
"{",
"grunt",
".",
"log",
".",
"ok",
"(",
"'Debugging forked process %s on port %d'",
",",
"module",
",",
"port",
")",
";",
"}",
... | Enabled debugging hooks for child processes | [
"Enabled",
"debugging",
"hooks",
"for",
"child",
"processes"
] | 968fefb5c99621752bc8b81d0fe865c1f90b8eb0 | https://github.com/burnnat/grunt-debug/blob/968fefb5c99621752bc8b81d0fe865c1f90b8eb0/tasks/debug.js#L72-L79 | |
39,419 | wearefractal/warlock | warlock.js | Transport | function Transport (opts) {
this.path = opts.path;
this.host = opts.host;
this.port = opts.port;
this.secure = opts.secure;
this.query = opts.query;
this.timestampParam = opts.timestampParam;
this.timestampRequests = opts.timestampRequests;
this.readyState = '';
} | javascript | function Transport (opts) {
this.path = opts.path;
this.host = opts.host;
this.port = opts.port;
this.secure = opts.secure;
this.query = opts.query;
this.timestampParam = opts.timestampParam;
this.timestampRequests = opts.timestampRequests;
this.readyState = '';
} | [
"function",
"Transport",
"(",
"opts",
")",
"{",
"this",
".",
"path",
"=",
"opts",
".",
"path",
";",
"this",
".",
"host",
"=",
"opts",
".",
"host",
";",
"this",
".",
"port",
"=",
"opts",
".",
"port",
";",
"this",
".",
"secure",
"=",
"opts",
".",
... | Transport abstract constructor.
@param {Object} options.
@api private | [
"Transport",
"abstract",
"constructor",
"."
] | de4a9ad1d030f3cdf1dc5c4560c7653c50ce3cde | https://github.com/wearefractal/warlock/blob/de4a9ad1d030f3cdf1dc5c4560c7653c50ce3cde/warlock.js#L906-L915 |
39,420 | wearefractal/warlock | warlock.js | create | function create (path, fn) {
if (scripts[path]) return fn();
var el = document.createElement('script');
var loaded = false;
// debug: loading "%s", path
el.onload = el.onreadystatechange = function () {
if (loaded || scripts[path]) return;
var rs = el.readyState;
if (!rs || 'loaded' == rs || 'co... | javascript | function create (path, fn) {
if (scripts[path]) return fn();
var el = document.createElement('script');
var loaded = false;
// debug: loading "%s", path
el.onload = el.onreadystatechange = function () {
if (loaded || scripts[path]) return;
var rs = el.readyState;
if (!rs || 'loaded' == rs || 'co... | [
"function",
"create",
"(",
"path",
",",
"fn",
")",
"{",
"if",
"(",
"scripts",
"[",
"path",
"]",
")",
"return",
"fn",
"(",
")",
";",
"var",
"el",
"=",
"document",
".",
"createElement",
"(",
"'script'",
")",
";",
"var",
"loaded",
"=",
"false",
";",
... | Injects a script. Keeps tracked of injected ones.
@param {String} path
@param {Function} callback
@api private | [
"Injects",
"a",
"script",
".",
"Keeps",
"tracked",
"of",
"injected",
"ones",
"."
] | de4a9ad1d030f3cdf1dc5c4560c7653c50ce3cde | https://github.com/wearefractal/warlock/blob/de4a9ad1d030f3cdf1dc5c4560c7653c50ce3cde/warlock.js#L1237-L1261 |
39,421 | express-bem/express-bem | lib/index.js | initVar | function initVar (key, envKey, def) {
var negate = !def;
switch (true) {
case cacheObj.hasOwnProperty(key):
return cacheObj[key];
case process.env.hasOwnProperty(envGlobalCacheKey):
return process.env[envGlobalCacheKey] !== '';
case pro... | javascript | function initVar (key, envKey, def) {
var negate = !def;
switch (true) {
case cacheObj.hasOwnProperty(key):
return cacheObj[key];
case process.env.hasOwnProperty(envGlobalCacheKey):
return process.env[envGlobalCacheKey] !== '';
case pro... | [
"function",
"initVar",
"(",
"key",
",",
"envKey",
",",
"def",
")",
"{",
"var",
"negate",
"=",
"!",
"def",
";",
"switch",
"(",
"true",
")",
"{",
"case",
"cacheObj",
".",
"hasOwnProperty",
"(",
"key",
")",
":",
"return",
"cacheObj",
"[",
"key",
"]",
... | cache variable initializer
@param {String} key
@param {String} envKey
@param {Boolean} def
@returns {Boolean} | [
"cache",
"variable",
"initializer"
] | 6ea49e5ecdd8e949dd5051ecc5762e40cbcead9c | https://github.com/express-bem/express-bem/blob/6ea49e5ecdd8e949dd5051ecc5762e40cbcead9c/lib/index.js#L213-L225 |
39,422 | CodingKoopa/eslint-plugin-more-naming-conventions | Source/Rules/UpperCamelCase.js | function(node)
{
// declarations is an array of the comma-separated variable declarations like "var foo, zerp;"
node.declarations.forEach(declaration =>
{
// id contains info about the variable being declare.
var variable_name = declaration.id.name;
// Skip if the variable ... | javascript | function(node)
{
// declarations is an array of the comma-separated variable declarations like "var foo, zerp;"
node.declarations.forEach(declaration =>
{
// id contains info about the variable being declare.
var variable_name = declaration.id.name;
// Skip if the variable ... | [
"function",
"(",
"node",
")",
"{",
"// declarations is an array of the comma-separated variable declarations like \"var foo, zerp;\"",
"node",
".",
"declarations",
".",
"forEach",
"(",
"declaration",
"=>",
"{",
"// id contains info about the variable being declare.",
"var",
"variab... | When a new variable is declared. This is where we whitelist nodes to check function calls of. | [
"When",
"a",
"new",
"variable",
"is",
"declared",
".",
"This",
"is",
"where",
"we",
"whitelist",
"nodes",
"to",
"check",
"function",
"calls",
"of",
"."
] | 98ad46204e7d50b0886fd11d90b1571eb6991de7 | https://github.com/CodingKoopa/eslint-plugin-more-naming-conventions/blob/98ad46204e7d50b0886fd11d90b1571eb6991de7/Source/Rules/UpperCamelCase.js#L38-L83 | |
39,423 | XadillaX/illyria2 | lib/server_zookeeper.js | function(connectString, options, root, prefix) {
EventEmitter.call(this);
if(util.isArray(connectString)) {
connectString = connectString.join(",");
}
this.connectString = connectString;
this.options = options;
this.root = root || "/illyria";
this.prefix = prefix || "/HB_";
thi... | javascript | function(connectString, options, root, prefix) {
EventEmitter.call(this);
if(util.isArray(connectString)) {
connectString = connectString.join(",");
}
this.connectString = connectString;
this.options = options;
this.root = root || "/illyria";
this.prefix = prefix || "/HB_";
thi... | [
"function",
"(",
"connectString",
",",
"options",
",",
"root",
",",
"prefix",
")",
"{",
"EventEmitter",
".",
"call",
"(",
"this",
")",
";",
"if",
"(",
"util",
".",
"isArray",
"(",
"connectString",
")",
")",
"{",
"connectString",
"=",
"connectString",
"."... | illyria zookeeper wrapper
@param {String|Array} connectString the connect string(s)
@param {Object} options the connect options, refer to
https://github.com/alexguan/node-zookeeper-client
#client-createclientconnectionstring-options
@param {String} [root] the root path
@param {String} [prefix] the path's prefix
@constr... | [
"illyria",
"zookeeper",
"wrapper"
] | ced0cc71cdcda11afcbab33f13739cbe547a2a17 | https://github.com/XadillaX/illyria2/blob/ced0cc71cdcda11afcbab33f13739cbe547a2a17/lib/server_zookeeper.js#L32-L64 | |
39,424 | patsissons/hubot-giphy | src/giphy.js | extend | function extend(object, properties) {
object = object || { };
const anotherObject = properties || { };
for (const key in anotherObject) {
const val = anotherObject[key];
if (val || (val === '')) {
object[key] = val;
}
}
return object;
} | javascript | function extend(object, properties) {
object = object || { };
const anotherObject = properties || { };
for (const key in anotherObject) {
const val = anotherObject[key];
if (val || (val === '')) {
object[key] = val;
}
}
return object;
} | [
"function",
"extend",
"(",
"object",
",",
"properties",
")",
"{",
"object",
"=",
"object",
"||",
"{",
"}",
";",
"const",
"anotherObject",
"=",
"properties",
"||",
"{",
"}",
";",
"for",
"(",
"const",
"key",
"in",
"anotherObject",
")",
"{",
"const",
"val... | utility method for extending an object definition | [
"utility",
"method",
"for",
"extending",
"an",
"object",
"definition"
] | 59d8904a66206ba2147b5016a4a20bb1bea6f34b | https://github.com/patsissons/hubot-giphy/blob/59d8904a66206ba2147b5016a4a20bb1bea6f34b/src/giphy.js#L35-L47 |
39,425 | divio/browserslist-saucelabs | getdata.js | eliminateDuplicates | function eliminateDuplicates(browsers) {
var set = {};
browsers.forEach(function (browser) {
var osgroup = browser.os;
var subgroup = browser.long_name;
var version = browser.short_version;
var device;
var browserName;
if (browser.api_name === "iphone") {
... | javascript | function eliminateDuplicates(browsers) {
var set = {};
browsers.forEach(function (browser) {
var osgroup = browser.os;
var subgroup = browser.long_name;
var version = browser.short_version;
var device;
var browserName;
if (browser.api_name === "iphone") {
... | [
"function",
"eliminateDuplicates",
"(",
"browsers",
")",
"{",
"var",
"set",
"=",
"{",
"}",
";",
"browsers",
".",
"forEach",
"(",
"function",
"(",
"browser",
")",
"{",
"var",
"osgroup",
"=",
"browser",
".",
"os",
";",
"var",
"subgroup",
"=",
"browser",
... | The platforms API lists multiple versions of platforms with different properties. Pull out just the essentials, and eliminate duplicates. | [
"The",
"platforms",
"API",
"lists",
"multiple",
"versions",
"of",
"platforms",
"with",
"different",
"properties",
".",
"Pull",
"out",
"just",
"the",
"essentials",
"and",
"eliminate",
"duplicates",
"."
] | e28f1a163cde9c48b0d6e0f9861ffd5dea523106 | https://github.com/divio/browserslist-saucelabs/blob/e28f1a163cde9c48b0d6e0f9861ffd5dea523106/getdata.js#L21-L62 |
39,426 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.validation.js | function(elem, target) {
this.selectDateOrig(elem, target);
var inst = $.calendarsPicker._getInst(elem);
if (!inst.inline && $.fn.validate) {
var validation = $(elem).parents('form').validate();
if (validation) {
validation.element('#' + elem.id);
}
}
} | javascript | function(elem, target) {
this.selectDateOrig(elem, target);
var inst = $.calendarsPicker._getInst(elem);
if (!inst.inline && $.fn.validate) {
var validation = $(elem).parents('form').validate();
if (validation) {
validation.element('#' + elem.id);
}
}
} | [
"function",
"(",
"elem",
",",
"target",
")",
"{",
"this",
".",
"selectDateOrig",
"(",
"elem",
",",
"target",
")",
";",
"var",
"inst",
"=",
"$",
".",
"calendarsPicker",
".",
"_getInst",
"(",
"elem",
")",
";",
"if",
"(",
"!",
"inst",
".",
"inline",
"... | Trigger a validation after updating the input field with the selected date.
@param elem {Element} The control to examine.
@param target {Element} The selected datepicker element. | [
"Trigger",
"a",
"validation",
"after",
"updating",
"the",
"input",
"field",
"with",
"the",
"selected",
"date",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.validation.js#L38-L47 | |
39,427 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.validation.js | function(error, elem) {
var inst = $.calendarsPicker._getInst(elem);
if (inst) {
error[inst.options.isRTL ? 'insertBefore' : 'insertAfter'](
inst.trigger.length > 0 ? inst.trigger : elem);
}
else {
error.insertAfter(elem);
}
} | javascript | function(error, elem) {
var inst = $.calendarsPicker._getInst(elem);
if (inst) {
error[inst.options.isRTL ? 'insertBefore' : 'insertAfter'](
inst.trigger.length > 0 ? inst.trigger : elem);
}
else {
error.insertAfter(elem);
}
} | [
"function",
"(",
"error",
",",
"elem",
")",
"{",
"var",
"inst",
"=",
"$",
".",
"calendarsPicker",
".",
"_getInst",
"(",
"elem",
")",
";",
"if",
"(",
"inst",
")",
"{",
"error",
"[",
"inst",
".",
"options",
".",
"isRTL",
"?",
"'insertBefore'",
":",
"... | Correct error placement for validation errors - after any trigger.
@param error {jQuery} The error message.
@param elem {jQuery} The field in error. | [
"Correct",
"error",
"placement",
"for",
"validation",
"errors",
"-",
"after",
"any",
"trigger",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.validation.js#L52-L61 | |
39,428 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.validation.js | function(source, params) {
var format = ($.calendarsPicker.curInst ?
$.calendarsPicker.curInst.get('dateFormat') :
$.calendarsPicker.defaultOptions.dateFormat);
$.each(params, function(index, value) {
source = source.replace(new RegExp('\\{' + index + '\\}', 'g'),
value.formatDate(format) |... | javascript | function(source, params) {
var format = ($.calendarsPicker.curInst ?
$.calendarsPicker.curInst.get('dateFormat') :
$.calendarsPicker.defaultOptions.dateFormat);
$.each(params, function(index, value) {
source = source.replace(new RegExp('\\{' + index + '\\}', 'g'),
value.formatDate(format) |... | [
"function",
"(",
"source",
",",
"params",
")",
"{",
"var",
"format",
"=",
"(",
"$",
".",
"calendarsPicker",
".",
"curInst",
"?",
"$",
".",
"calendarsPicker",
".",
"curInst",
".",
"get",
"(",
"'dateFormat'",
")",
":",
"$",
".",
"calendarsPicker",
".",
"... | Format a validation error message involving dates.
@param source {string} The error message.
@param params {Date[]} The dates.
@return {string} The formatted message. | [
"Format",
"a",
"validation",
"error",
"message",
"involving",
"dates",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.validation.js#L67-L76 | |
39,429 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.validation.js | validateEach | function validateEach(value, elem) {
var inst = $.calendarsPicker._getInst(elem);
var dates = (inst.options.multiSelect ? value.split(inst.options.multiSeparator) :
(inst.options.rangeSelect ? value.split(inst.options.rangeSeparator) : [value]));
var ok = (inst.options.multiSelect && dates.length <= inst.o... | javascript | function validateEach(value, elem) {
var inst = $.calendarsPicker._getInst(elem);
var dates = (inst.options.multiSelect ? value.split(inst.options.multiSeparator) :
(inst.options.rangeSelect ? value.split(inst.options.rangeSeparator) : [value]));
var ok = (inst.options.multiSelect && dates.length <= inst.o... | [
"function",
"validateEach",
"(",
"value",
",",
"elem",
")",
"{",
"var",
"inst",
"=",
"$",
".",
"calendarsPicker",
".",
"_getInst",
"(",
"elem",
")",
";",
"var",
"dates",
"=",
"(",
"inst",
".",
"options",
".",
"multiSelect",
"?",
"value",
".",
"split",
... | Apply a validation test to each date provided.
@private
@param value {string} The current field value.
@param elem {Element} The field control.
@return {boolean} <code>true</code> if OK, <code>false</code> if failed validation. | [
"Apply",
"a",
"validation",
"test",
"to",
"each",
"date",
"provided",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.validation.js#L103-L131 |
39,430 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.validation.js | normaliseParams | function normaliseParams(params) {
if (typeof params === 'string') {
params = params.split(' ');
}
else if (!$.isArray(params)) {
var opts = [];
for (var name in params) {
opts[0] = name;
opts[1] = params[name];
}
params = opts;
}
return params;
} | javascript | function normaliseParams(params) {
if (typeof params === 'string') {
params = params.split(' ');
}
else if (!$.isArray(params)) {
var opts = [];
for (var name in params) {
opts[0] = name;
opts[1] = params[name];
}
params = opts;
}
return params;
} | [
"function",
"normaliseParams",
"(",
"params",
")",
"{",
"if",
"(",
"typeof",
"params",
"===",
"'string'",
")",
"{",
"params",
"=",
"params",
".",
"split",
"(",
"' '",
")",
";",
"}",
"else",
"if",
"(",
"!",
"$",
".",
"isArray",
"(",
"params",
")",
"... | Normalise the comparison parameters to an array.
@param params {Array|object|string} The original parameters.
@return {Array} The normalised parameters. | [
"Normalise",
"the",
"comparison",
"parameters",
"to",
"an",
"array",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.validation.js#L189-L202 |
39,431 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.validation.js | extractOtherDate | function extractOtherDate(elem, source, noOther) {
if (source.newDate && source.extraInfo) { // Already a CDate
return [source];
}
var inst = $.calendarsPicker._getInst(elem);
var thatDate = null;
try {
if (typeof source === 'string' && source !== 'today') {
thatDate = inst.options.calendar.... | javascript | function extractOtherDate(elem, source, noOther) {
if (source.newDate && source.extraInfo) { // Already a CDate
return [source];
}
var inst = $.calendarsPicker._getInst(elem);
var thatDate = null;
try {
if (typeof source === 'string' && source !== 'today') {
thatDate = inst.options.calendar.... | [
"function",
"extractOtherDate",
"(",
"elem",
",",
"source",
",",
"noOther",
")",
"{",
"if",
"(",
"source",
".",
"newDate",
"&&",
"source",
".",
"extraInfo",
")",
"{",
"// Already a CDate",
"return",
"[",
"source",
"]",
";",
"}",
"var",
"inst",
"=",
"$",
... | Determine the comparison date.
@param elem {Element} The current datepicker element.
@param source {string|CDate|jQueryElement} The source of the other date.
@param noOther {boolean} <code>true</code> to not get the date from another field.
@return {CDate[]} The date for comparison. | [
"Determine",
"the",
"comparison",
"date",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.validation.js#L209-L226 |
39,432 | Neil-G/redux-mastermind | lib/helpers.js | objectToArray | function objectToArray(object) {
var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';
var convertedArray = [];
Object.keys(object).forEach(function (_key) {
var item = object[_key];
item[key] = _key;
convertedArray.push(item);
});
return convertedA... | javascript | function objectToArray(object) {
var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';
var convertedArray = [];
Object.keys(object).forEach(function (_key) {
var item = object[_key];
item[key] = _key;
convertedArray.push(item);
});
return convertedA... | [
"function",
"objectToArray",
"(",
"object",
")",
"{",
"var",
"key",
"=",
"arguments",
".",
"length",
">",
"1",
"&&",
"arguments",
"[",
"1",
"]",
"!==",
"undefined",
"?",
"arguments",
"[",
"1",
"]",
":",
"'id'",
";",
"var",
"convertedArray",
"=",
"[",
... | converts an object to an array | [
"converts",
"an",
"object",
"to",
"an",
"array"
] | 669e2978b4a7cdd48fbd33d4fd6dbe47e92d3cef | https://github.com/Neil-G/redux-mastermind/blob/669e2978b4a7cdd48fbd33d4fd6dbe47e92d3cef/lib/helpers.js#L22-L34 |
39,433 | HasakiUI/hsk-jinx | src/component/intro/intro.js | _nextStep | function _nextStep() {
this._direction = 'forward';
if (typeof this._currentStepNumber !== 'undefined') {
for (var i = 0, len = this._introItems.length; i < len; i++) {
var item = this._introItems[i];
if (item.step === this._currentStepNumber) {
this._currentStep... | javascript | function _nextStep() {
this._direction = 'forward';
if (typeof this._currentStepNumber !== 'undefined') {
for (var i = 0, len = this._introItems.length; i < len; i++) {
var item = this._introItems[i];
if (item.step === this._currentStepNumber) {
this._currentStep... | [
"function",
"_nextStep",
"(",
")",
"{",
"this",
".",
"_direction",
"=",
"'forward'",
";",
"if",
"(",
"typeof",
"this",
".",
"_currentStepNumber",
"!==",
"'undefined'",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"len",
"=",
"this",
".",
"_introIte... | Go to next step on intro
@api private
@method _nextStep | [
"Go",
"to",
"next",
"step",
"on",
"intro"
] | 6e32220356e2aa336c36a8d2092db4ccddfdc328 | https://github.com/HasakiUI/hsk-jinx/blob/6e32220356e2aa336c36a8d2092db4ccddfdc328/src/component/intro/intro.js#L357-L398 |
39,434 | HasakiUI/hsk-jinx | src/component/intro/intro.js | _exitIntro | function _exitIntro(targetElement, force) {
var continueExit = true;
// calling onbeforeexit callback
//
// If this callback return `false`, it would halt the process
if (this._introBeforeExitCallback != undefined) {
continueExit = this._introBeforeExitCallback.call(self);
}
// ski... | javascript | function _exitIntro(targetElement, force) {
var continueExit = true;
// calling onbeforeexit callback
//
// If this callback return `false`, it would halt the process
if (this._introBeforeExitCallback != undefined) {
continueExit = this._introBeforeExitCallback.call(self);
}
// ski... | [
"function",
"_exitIntro",
"(",
"targetElement",
",",
"force",
")",
"{",
"var",
"continueExit",
"=",
"true",
";",
"// calling onbeforeexit callback",
"//",
"// If this callback return `false`, it would halt the process",
"if",
"(",
"this",
".",
"_introBeforeExitCallback",
"!... | Exit from intro
@api private
@method _exitIntro
@param {Object} targetElement
@param {Boolean} force - Setting to `true` will skip the result of beforeExit callback | [
"Exit",
"from",
"intro"
] | 6e32220356e2aa336c36a8d2092db4ccddfdc328 | https://github.com/HasakiUI/hsk-jinx/blob/6e32220356e2aa336c36a8d2092db4ccddfdc328/src/component/intro/intro.js#L466-L549 |
39,435 | HasakiUI/hsk-jinx | src/component/intro/intro.js | _checkRight | function _checkRight(targetOffset, tooltipLayerStyleLeft, tooltipOffset, windowSize, tooltipLayer) {
if (targetOffset.left + tooltipLayerStyleLeft + tooltipOffset.width > windowSize.width) {
// off the right side of the window
tooltipLayer.style.left = windowSize.width - tooltipOffset.width - target... | javascript | function _checkRight(targetOffset, tooltipLayerStyleLeft, tooltipOffset, windowSize, tooltipLayer) {
if (targetOffset.left + tooltipLayerStyleLeft + tooltipOffset.width > windowSize.width) {
// off the right side of the window
tooltipLayer.style.left = windowSize.width - tooltipOffset.width - target... | [
"function",
"_checkRight",
"(",
"targetOffset",
",",
"tooltipLayerStyleLeft",
",",
"tooltipOffset",
",",
"windowSize",
",",
"tooltipLayer",
")",
"{",
"if",
"(",
"targetOffset",
".",
"left",
"+",
"tooltipLayerStyleLeft",
"+",
"tooltipOffset",
".",
"width",
">",
"wi... | Set tooltip left so it doesn't go off the right side of the window
@return boolean true, if tooltipLayerStyleLeft is ok. false, otherwise. | [
"Set",
"tooltip",
"left",
"so",
"it",
"doesn",
"t",
"go",
"off",
"the",
"right",
"side",
"of",
"the",
"window"
] | 6e32220356e2aa336c36a8d2092db4ccddfdc328 | https://github.com/HasakiUI/hsk-jinx/blob/6e32220356e2aa336c36a8d2092db4ccddfdc328/src/component/intro/intro.js#L739-L747 |
39,436 | HasakiUI/hsk-jinx | src/component/intro/intro.js | _determineAutoPosition | function _determineAutoPosition(targetElement, tooltipLayer, desiredTooltipPosition) {
// Take a clone of position precedence. These will be the available
var possiblePositions = this._options.positionPrecedence.slice();
var windowSize = _getWinSize();
var tooltipHeight = _getOffset(tooltipLayer).heigh... | javascript | function _determineAutoPosition(targetElement, tooltipLayer, desiredTooltipPosition) {
// Take a clone of position precedence. These will be the available
var possiblePositions = this._options.positionPrecedence.slice();
var windowSize = _getWinSize();
var tooltipHeight = _getOffset(tooltipLayer).heigh... | [
"function",
"_determineAutoPosition",
"(",
"targetElement",
",",
"tooltipLayer",
",",
"desiredTooltipPosition",
")",
"{",
"// Take a clone of position precedence. These will be the available",
"var",
"possiblePositions",
"=",
"this",
".",
"_options",
".",
"positionPrecedence",
... | Determines the position of the tooltip based on the position precedence and availability
of screen space.
@param {Object} targetElement
@param {Object} tooltipLayer
@param {Object} desiredTooltipPosition | [
"Determines",
"the",
"position",
"of",
"the",
"tooltip",
"based",
"on",
"the",
"position",
"precedence",
"and",
"availability",
"of",
"screen",
"space",
"."
] | 6e32220356e2aa336c36a8d2092db4ccddfdc328 | https://github.com/HasakiUI/hsk-jinx/blob/6e32220356e2aa336c36a8d2092db4ccddfdc328/src/component/intro/intro.js#L773-L827 |
39,437 | HasakiUI/hsk-jinx | src/component/intro/intro.js | _removeEntry | function _removeEntry(stringArray, stringToRemove) {
if (stringArray.indexOf(stringToRemove) > -1) {
stringArray.splice(stringArray.indexOf(stringToRemove), 1);
}
} | javascript | function _removeEntry(stringArray, stringToRemove) {
if (stringArray.indexOf(stringToRemove) > -1) {
stringArray.splice(stringArray.indexOf(stringToRemove), 1);
}
} | [
"function",
"_removeEntry",
"(",
"stringArray",
",",
"stringToRemove",
")",
"{",
"if",
"(",
"stringArray",
".",
"indexOf",
"(",
"stringToRemove",
")",
">",
"-",
"1",
")",
"{",
"stringArray",
".",
"splice",
"(",
"stringArray",
".",
"indexOf",
"(",
"stringToRe... | Remove an entry from a string array if it's there, does nothing if it isn't there.
@param {Array} stringArray
@param {String} stringToRemove | [
"Remove",
"an",
"entry",
"from",
"a",
"string",
"array",
"if",
"it",
"s",
"there",
"does",
"nothing",
"if",
"it",
"isn",
"t",
"there",
"."
] | 6e32220356e2aa336c36a8d2092db4ccddfdc328 | https://github.com/HasakiUI/hsk-jinx/blob/6e32220356e2aa336c36a8d2092db4ccddfdc328/src/component/intro/intro.js#L835-L839 |
39,438 | HasakiUI/hsk-jinx | src/component/intro/intro.js | _setHelperLayerPosition | function _setHelperLayerPosition(helperLayer) {
if (helperLayer) {
//prevent error when `this._currentStep` in undefined
if (!this._introItems[this._currentStep]) return;
var currentElement = this._introItems[this._currentStep],
elementPosition = _getOffset(currentElement.elemen... | javascript | function _setHelperLayerPosition(helperLayer) {
if (helperLayer) {
//prevent error when `this._currentStep` in undefined
if (!this._introItems[this._currentStep]) return;
var currentElement = this._introItems[this._currentStep],
elementPosition = _getOffset(currentElement.elemen... | [
"function",
"_setHelperLayerPosition",
"(",
"helperLayer",
")",
"{",
"if",
"(",
"helperLayer",
")",
"{",
"//prevent error when `this._currentStep` in undefined",
"if",
"(",
"!",
"this",
".",
"_introItems",
"[",
"this",
".",
"_currentStep",
"]",
")",
"return",
";",
... | Update the position of the helper layer on the screen
@api private
@method _setHelperLayerPosition
@param {Object} helperLayer | [
"Update",
"the",
"position",
"of",
"the",
"helper",
"layer",
"on",
"the",
"screen"
] | 6e32220356e2aa336c36a8d2092db4ccddfdc328 | https://github.com/HasakiUI/hsk-jinx/blob/6e32220356e2aa336c36a8d2092db4ccddfdc328/src/component/intro/intro.js#L848-L887 |
39,439 | HasakiUI/hsk-jinx | src/component/intro/intro.js | _disableInteraction | function _disableInteraction() {
var disableInteractionLayer = document.querySelector('.introjs-disableInteraction');
if (disableInteractionLayer === null) {
disableInteractionLayer = document.createElement('div');
disableInteractionLayer.className = 'introjs-disableInteraction';
this._... | javascript | function _disableInteraction() {
var disableInteractionLayer = document.querySelector('.introjs-disableInteraction');
if (disableInteractionLayer === null) {
disableInteractionLayer = document.createElement('div');
disableInteractionLayer.className = 'introjs-disableInteraction';
this._... | [
"function",
"_disableInteraction",
"(",
")",
"{",
"var",
"disableInteractionLayer",
"=",
"document",
".",
"querySelector",
"(",
"'.introjs-disableInteraction'",
")",
";",
"if",
"(",
"disableInteractionLayer",
"===",
"null",
")",
"{",
"disableInteractionLayer",
"=",
"d... | Add disableinteraction layer and adjust the size and position of the layer
@api private
@method _disableInteraction | [
"Add",
"disableinteraction",
"layer",
"and",
"adjust",
"the",
"size",
"and",
"position",
"of",
"the",
"layer"
] | 6e32220356e2aa336c36a8d2092db4ccddfdc328 | https://github.com/HasakiUI/hsk-jinx/blob/6e32220356e2aa336c36a8d2092db4ccddfdc328/src/component/intro/intro.js#L895-L905 |
39,440 | HasakiUI/hsk-jinx | src/component/intro/intro.js | _scrollTo | function _scrollTo(scrollTo, targetElement, tooltipLayer) {
if (!this._options.scrollToElement) return;
if (scrollTo === 'tooltip') {
var rect = tooltipLayer.getBoundingClientRect();
} else {
var rect = targetElement.element.getBoundingClientRect();
}
if (!_elementInViewport(target... | javascript | function _scrollTo(scrollTo, targetElement, tooltipLayer) {
if (!this._options.scrollToElement) return;
if (scrollTo === 'tooltip') {
var rect = tooltipLayer.getBoundingClientRect();
} else {
var rect = targetElement.element.getBoundingClientRect();
}
if (!_elementInViewport(target... | [
"function",
"_scrollTo",
"(",
"scrollTo",
",",
"targetElement",
",",
"tooltipLayer",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_options",
".",
"scrollToElement",
")",
"return",
";",
"if",
"(",
"scrollTo",
"===",
"'tooltip'",
")",
"{",
"var",
"rect",
"=",
"... | To change the scroll of `window` after highlighting an element
@api private
@method _scrollTo
@param {String} scrollTo
@param {Object} targetElement
@param {Object} tooltipLayer | [
"To",
"change",
"the",
"scroll",
"of",
"window",
"after",
"highlighting",
"an",
"element"
] | 6e32220356e2aa336c36a8d2092db4ccddfdc328 | https://github.com/HasakiUI/hsk-jinx/blob/6e32220356e2aa336c36a8d2092db4ccddfdc328/src/component/intro/intro.js#L1309-L1341 |
39,441 | HasakiUI/hsk-jinx | src/component/intro/intro.js | _populateHints | function _populateHints(targetElm) {
var self = this;
this._introItems = [];
if (this._options.hints) {
for (var i = 0, l = this._options.hints.length; i < l; i++) {
var currentItem = _cloneObject(this._options.hints[i]);
if (typeof currentItem.element === 'string') {
... | javascript | function _populateHints(targetElm) {
var self = this;
this._introItems = [];
if (this._options.hints) {
for (var i = 0, l = this._options.hints.length; i < l; i++) {
var currentItem = _cloneObject(this._options.hints[i]);
if (typeof currentItem.element === 'string') {
... | [
"function",
"_populateHints",
"(",
"targetElm",
")",
"{",
"var",
"self",
"=",
"this",
";",
"this",
".",
"_introItems",
"=",
"[",
"]",
";",
"if",
"(",
"this",
".",
"_options",
".",
"hints",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"l",
"="... | Start parsing hint items
@api private
@param {Object} targetElm
@method _startHint | [
"Start",
"parsing",
"hint",
"items"
] | 6e32220356e2aa336c36a8d2092db4ccddfdc328 | https://github.com/HasakiUI/hsk-jinx/blob/6e32220356e2aa336c36a8d2092db4ccddfdc328/src/component/intro/intro.js#L1604-L1669 |
39,442 | HasakiUI/hsk-jinx | src/component/intro/intro.js | _reAlignHints | function _reAlignHints() {
for (var i = 0, l = this._introItems.length; i < l; i++) {
var item = this._introItems[i];
if (typeof item.targetElement == 'undefined') continue;
_alignHintPosition.call(this, item.hintPosition, item.element, item.targetElement);
}
} | javascript | function _reAlignHints() {
for (var i = 0, l = this._introItems.length; i < l; i++) {
var item = this._introItems[i];
if (typeof item.targetElement == 'undefined') continue;
_alignHintPosition.call(this, item.hintPosition, item.element, item.targetElement);
}
} | [
"function",
"_reAlignHints",
"(",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
",",
"l",
"=",
"this",
".",
"_introItems",
".",
"length",
";",
"i",
"<",
"l",
";",
"i",
"++",
")",
"{",
"var",
"item",
"=",
"this",
".",
"_introItems",
"[",
"i",
"]",... | Re-aligns all hint elements
@api private
@method _reAlignHints | [
"Re",
"-",
"aligns",
"all",
"hint",
"elements"
] | 6e32220356e2aa336c36a8d2092db4ccddfdc328 | https://github.com/HasakiUI/hsk-jinx/blob/6e32220356e2aa336c36a8d2092db4ccddfdc328/src/component/intro/intro.js#L1677-L1685 |
39,443 | HasakiUI/hsk-jinx | src/component/intro/intro.js | _hideHint | function _hideHint(stepId) {
_removeHintTooltip.call(this);
var hint = this._targetElement.querySelector('.introjs-hint[data-step="' + stepId + '"]');
if (hint) {
hint.className += ' introjs-hidehint';
}
// call the callback function (if any)
if (typeof this._hintCloseCallback !== 'und... | javascript | function _hideHint(stepId) {
_removeHintTooltip.call(this);
var hint = this._targetElement.querySelector('.introjs-hint[data-step="' + stepId + '"]');
if (hint) {
hint.className += ' introjs-hidehint';
}
// call the callback function (if any)
if (typeof this._hintCloseCallback !== 'und... | [
"function",
"_hideHint",
"(",
"stepId",
")",
"{",
"_removeHintTooltip",
".",
"call",
"(",
"this",
")",
";",
"var",
"hint",
"=",
"this",
".",
"_targetElement",
".",
"querySelector",
"(",
"'.introjs-hint[data-step=\"'",
"+",
"stepId",
"+",
"'\"]'",
")",
";",
"... | Hide a hint
@api private
@method _hideHint | [
"Hide",
"a",
"hint"
] | 6e32220356e2aa336c36a8d2092db4ccddfdc328 | https://github.com/HasakiUI/hsk-jinx/blob/6e32220356e2aa336c36a8d2092db4ccddfdc328/src/component/intro/intro.js#L1693-L1705 |
39,444 | HasakiUI/hsk-jinx | src/component/intro/intro.js | _hideHints | function _hideHints() {
var hints = this._targetElement.querySelectorAll('.introjs-hint');
if (hints && hints.length > 0) {
for (var i = 0; i < hints.length; i++) {
_hideHint.call(this, hints[i].getAttribute('data-step'));
}
}
} | javascript | function _hideHints() {
var hints = this._targetElement.querySelectorAll('.introjs-hint');
if (hints && hints.length > 0) {
for (var i = 0; i < hints.length; i++) {
_hideHint.call(this, hints[i].getAttribute('data-step'));
}
}
} | [
"function",
"_hideHints",
"(",
")",
"{",
"var",
"hints",
"=",
"this",
".",
"_targetElement",
".",
"querySelectorAll",
"(",
"'.introjs-hint'",
")",
";",
"if",
"(",
"hints",
"&&",
"hints",
".",
"length",
">",
"0",
")",
"{",
"for",
"(",
"var",
"i",
"=",
... | Hide all hints
@api private
@method _hideHints | [
"Hide",
"all",
"hints"
] | 6e32220356e2aa336c36a8d2092db4ccddfdc328 | https://github.com/HasakiUI/hsk-jinx/blob/6e32220356e2aa336c36a8d2092db4ccddfdc328/src/component/intro/intro.js#L1713-L1721 |
39,445 | HasakiUI/hsk-jinx | src/component/intro/intro.js | _showHints | function _showHints() {
var hints = this._targetElement.querySelectorAll('.introjs-hint');
if (hints && hints.length > 0) {
for (var i = 0; i < hints.length; i++) {
_showHint.call(this, hints[i].getAttribute('data-step'));
}
} else {
_populateHints.call(this, this._targe... | javascript | function _showHints() {
var hints = this._targetElement.querySelectorAll('.introjs-hint');
if (hints && hints.length > 0) {
for (var i = 0; i < hints.length; i++) {
_showHint.call(this, hints[i].getAttribute('data-step'));
}
} else {
_populateHints.call(this, this._targe... | [
"function",
"_showHints",
"(",
")",
"{",
"var",
"hints",
"=",
"this",
".",
"_targetElement",
".",
"querySelectorAll",
"(",
"'.introjs-hint'",
")",
";",
"if",
"(",
"hints",
"&&",
"hints",
".",
"length",
">",
"0",
")",
"{",
"for",
"(",
"var",
"i",
"=",
... | Show all hints
@api private
@method _showHints | [
"Show",
"all",
"hints"
] | 6e32220356e2aa336c36a8d2092db4ccddfdc328 | https://github.com/HasakiUI/hsk-jinx/blob/6e32220356e2aa336c36a8d2092db4ccddfdc328/src/component/intro/intro.js#L1729-L1739 |
39,446 | HasakiUI/hsk-jinx | src/component/intro/intro.js | _showHint | function _showHint(stepId) {
var hint = this._targetElement.querySelector('.introjs-hint[data-step="' + stepId + '"]');
if (hint) {
hint.className = hint.className.replace(/introjs\-hidehint/g, '');
}
} | javascript | function _showHint(stepId) {
var hint = this._targetElement.querySelector('.introjs-hint[data-step="' + stepId + '"]');
if (hint) {
hint.className = hint.className.replace(/introjs\-hidehint/g, '');
}
} | [
"function",
"_showHint",
"(",
"stepId",
")",
"{",
"var",
"hint",
"=",
"this",
".",
"_targetElement",
".",
"querySelector",
"(",
"'.introjs-hint[data-step=\"'",
"+",
"stepId",
"+",
"'\"]'",
")",
";",
"if",
"(",
"hint",
")",
"{",
"hint",
".",
"className",
"=... | Show a hint
@api private
@method _showHint | [
"Show",
"a",
"hint"
] | 6e32220356e2aa336c36a8d2092db4ccddfdc328 | https://github.com/HasakiUI/hsk-jinx/blob/6e32220356e2aa336c36a8d2092db4ccddfdc328/src/component/intro/intro.js#L1747-L1753 |
39,447 | HasakiUI/hsk-jinx | src/component/intro/intro.js | _addHints | function _addHints() {
var self = this;
var oldHintsWrapper = document.querySelector('.introjs-hints');
if (oldHintsWrapper != null) {
hintsWrapper = oldHintsWrapper;
} else {
var hintsWrapper = document.createElement('div');
hintsWrapper.className = 'introjs-hints';
}
... | javascript | function _addHints() {
var self = this;
var oldHintsWrapper = document.querySelector('.introjs-hints');
if (oldHintsWrapper != null) {
hintsWrapper = oldHintsWrapper;
} else {
var hintsWrapper = document.createElement('div');
hintsWrapper.className = 'introjs-hints';
}
... | [
"function",
"_addHints",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"oldHintsWrapper",
"=",
"document",
".",
"querySelector",
"(",
"'.introjs-hints'",
")",
";",
"if",
"(",
"oldHintsWrapper",
"!=",
"null",
")",
"{",
"hintsWrapper",
"=",
"oldHintsW... | Add all available hints to the page
@api private
@method _addHints | [
"Add",
"all",
"available",
"hints",
"to",
"the",
"page"
] | 6e32220356e2aa336c36a8d2092db4ccddfdc328 | https://github.com/HasakiUI/hsk-jinx/blob/6e32220356e2aa336c36a8d2092db4ccddfdc328/src/component/intro/intro.js#L1794-L1864 |
39,448 | canjs/can-bind | can-bind.js | turnOffListeningAndUpdate | function turnOffListeningAndUpdate(listenToObservable, updateObservable, updateFunction, queue) {
var offValueOrOffEmitFn;
// Use either offValue or offEmit depending on which Symbols are on the `observable`
if (listenToObservable[onValueSymbol]) {
offValueOrOffEmitFn = canReflect.offValue;
} else if (listenToOb... | javascript | function turnOffListeningAndUpdate(listenToObservable, updateObservable, updateFunction, queue) {
var offValueOrOffEmitFn;
// Use either offValue or offEmit depending on which Symbols are on the `observable`
if (listenToObservable[onValueSymbol]) {
offValueOrOffEmitFn = canReflect.offValue;
} else if (listenToOb... | [
"function",
"turnOffListeningAndUpdate",
"(",
"listenToObservable",
",",
"updateObservable",
",",
"updateFunction",
",",
"queue",
")",
"{",
"var",
"offValueOrOffEmitFn",
";",
"// Use either offValue or offEmit depending on which Symbols are on the `observable`",
"if",
"(",
"liste... | Given an observable, stop listening to it and tear down the mutation dependencies | [
"Given",
"an",
"observable",
"stop",
"listening",
"to",
"it",
"and",
"tear",
"down",
"the",
"mutation",
"dependencies"
] | 22be6557a5e2e1c5fc04bf4bca3eb6a16bdda761 | https://github.com/canjs/can-bind/blob/22be6557a5e2e1c5fc04bf4bca3eb6a16bdda761/can-bind.js#L39-L65 |
39,449 | canjs/can-bind | can-bind.js | turnOnListeningAndUpdate | function turnOnListeningAndUpdate(listenToObservable, updateObservable, updateFunction, queue) {
var onValueOrOnEmitFn;
// Use either onValue or onEmit depending on which Symbols are on the `observable`
if (listenToObservable[onValueSymbol]) {
onValueOrOnEmitFn = canReflect.onValue;
} else if (listenToObservable... | javascript | function turnOnListeningAndUpdate(listenToObservable, updateObservable, updateFunction, queue) {
var onValueOrOnEmitFn;
// Use either onValue or onEmit depending on which Symbols are on the `observable`
if (listenToObservable[onValueSymbol]) {
onValueOrOnEmitFn = canReflect.onValue;
} else if (listenToObservable... | [
"function",
"turnOnListeningAndUpdate",
"(",
"listenToObservable",
",",
"updateObservable",
",",
"updateFunction",
",",
"queue",
")",
"{",
"var",
"onValueOrOnEmitFn",
";",
"// Use either onValue or onEmit depending on which Symbols are on the `observable`",
"if",
"(",
"listenToOb... | Given an observable, start listening to it and set up the mutation dependencies | [
"Given",
"an",
"observable",
"start",
"listening",
"to",
"it",
"and",
"set",
"up",
"the",
"mutation",
"dependencies"
] | 22be6557a5e2e1c5fc04bf4bca3eb6a16bdda761 | https://github.com/canjs/can-bind/blob/22be6557a5e2e1c5fc04bf4bca3eb6a16bdda761/can-bind.js#L68-L100 |
39,450 | canjs/can-bind | can-bind.js | function() {
if (this._bindingState.child === false && this._childToParent === true) {
var options = this._options;
this._bindingState.child = true;
turnOnListeningAndUpdate(options.child, options.parent, this._updateParent, options.queue);
}
} | javascript | function() {
if (this._bindingState.child === false && this._childToParent === true) {
var options = this._options;
this._bindingState.child = true;
turnOnListeningAndUpdate(options.child, options.parent, this._updateParent, options.queue);
}
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_bindingState",
".",
"child",
"===",
"false",
"&&",
"this",
".",
"_childToParent",
"===",
"true",
")",
"{",
"var",
"options",
"=",
"this",
".",
"_options",
";",
"this",
".",
"_bindingState",
".",
"chi... | Listen for changes to the child observable and update the parent | [
"Listen",
"for",
"changes",
"to",
"the",
"child",
"observable",
"and",
"update",
"the",
"parent"
] | 22be6557a5e2e1c5fc04bf4bca3eb6a16bdda761 | https://github.com/canjs/can-bind/blob/22be6557a5e2e1c5fc04bf4bca3eb6a16bdda761/can-bind.js#L402-L408 | |
39,451 | canjs/can-bind | can-bind.js | function() {
if (this._bindingState.parent === false && this._parentToChild === true) {
var options = this._options;
this._bindingState.parent = true;
turnOnListeningAndUpdate(options.parent, options.child, this._updateChild, options.queue);
}
} | javascript | function() {
if (this._bindingState.parent === false && this._parentToChild === true) {
var options = this._options;
this._bindingState.parent = true;
turnOnListeningAndUpdate(options.parent, options.child, this._updateChild, options.queue);
}
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_bindingState",
".",
"parent",
"===",
"false",
"&&",
"this",
".",
"_parentToChild",
"===",
"true",
")",
"{",
"var",
"options",
"=",
"this",
".",
"_options",
";",
"this",
".",
"_bindingState",
".",
"pa... | Listen for changes to the parent observable and update the child | [
"Listen",
"for",
"changes",
"to",
"the",
"parent",
"observable",
"and",
"update",
"the",
"child"
] | 22be6557a5e2e1c5fc04bf4bca3eb6a16bdda761 | https://github.com/canjs/can-bind/blob/22be6557a5e2e1c5fc04bf4bca3eb6a16bdda761/can-bind.js#L411-L417 | |
39,452 | canjs/can-bind | can-bind.js | function() {
var bindingState = this._bindingState;
var options = this._options;
// Turn off the parent listener
if (bindingState.parent === true && this._parentToChild === true) {
bindingState.parent = false;
turnOffListeningAndUpdate(options.parent, options.child, this._updateChild, options.queue);
}... | javascript | function() {
var bindingState = this._bindingState;
var options = this._options;
// Turn off the parent listener
if (bindingState.parent === true && this._parentToChild === true) {
bindingState.parent = false;
turnOffListeningAndUpdate(options.parent, options.child, this._updateChild, options.queue);
}... | [
"function",
"(",
")",
"{",
"var",
"bindingState",
"=",
"this",
".",
"_bindingState",
";",
"var",
"options",
"=",
"this",
".",
"_options",
";",
"// Turn off the parent listener",
"if",
"(",
"bindingState",
".",
"parent",
"===",
"true",
"&&",
"this",
".",
"_pa... | Turn off all the bindings | [
"Turn",
"off",
"all",
"the",
"bindings"
] | 22be6557a5e2e1c5fc04bf4bca3eb6a16bdda761 | https://github.com/canjs/can-bind/blob/22be6557a5e2e1c5fc04bf4bca3eb6a16bdda761/can-bind.js#L420-L435 | |
39,453 | verma/greyhound.js | lib/greyhound.js | function(mins, maxs) {
// make sure correct number of elements in both mins and maxs
if (mins.length != 3 ||
maxs.length != 3)
throw new Error("Mins and Maxs should have 3 elements each");
// make sure all maxes are greater than mins
mins.forEach(function(v, i) {
if (v >= maxs[i... | javascript | function(mins, maxs) {
// make sure correct number of elements in both mins and maxs
if (mins.length != 3 ||
maxs.length != 3)
throw new Error("Mins and Maxs should have 3 elements each");
// make sure all maxes are greater than mins
mins.forEach(function(v, i) {
if (v >= maxs[i... | [
"function",
"(",
"mins",
",",
"maxs",
")",
"{",
"// make sure correct number of elements in both mins and maxs",
"if",
"(",
"mins",
".",
"length",
"!=",
"3",
"||",
"maxs",
".",
"length",
"!=",
"3",
")",
"throw",
"new",
"Error",
"(",
"\"Mins and Maxs should have 3 ... | A bounding box abstraction class which can be passed to or returned by the reader. This bounding box is not a general
purpose bounding box, but is rather geared towards geo data. It is also, always axis aligned.
The ground is in the X,Y plane and Z represents the height, the Z coordinate is never touched when perfomin... | [
"A",
"bounding",
"box",
"abstraction",
"class",
"which",
"can",
"be",
"passed",
"to",
"or",
"returned",
"by",
"the",
"reader",
".",
"This",
"bounding",
"box",
"is",
"not",
"a",
"general",
"purpose",
"bounding",
"box",
"but",
"is",
"rather",
"geared",
"towa... | d219b9eb9ec12af6a006f29d604543b61d2ae0a9 | https://github.com/verma/greyhound.js/blob/d219b9eb9ec12af6a006f29d604543b61d2ae0a9/lib/greyhound.js#L206-L220 | |
39,454 | verma/greyhound.js | lib/greyhound.js | function(host) {
if (!host)
throw new Error('Need hostname to initialize reader');
if (host.match(/^(\S+):\/\//))
throw new Error('Protocol specified, need bare hostname');
this.host = host;
var portParts = this.host.match(/:(\d+)$/);
if (portParts !== null)
this.port ... | javascript | function(host) {
if (!host)
throw new Error('Need hostname to initialize reader');
if (host.match(/^(\S+):\/\//))
throw new Error('Protocol specified, need bare hostname');
this.host = host;
var portParts = this.host.match(/:(\d+)$/);
if (portParts !== null)
this.port ... | [
"function",
"(",
"host",
")",
"{",
"if",
"(",
"!",
"host",
")",
"throw",
"new",
"Error",
"(",
"'Need hostname to initialize reader'",
")",
";",
"if",
"(",
"host",
".",
"match",
"(",
"/",
"^(\\S+):\\/\\/",
"/",
")",
")",
"throw",
"new",
"Error",
"(",
"'... | A greyhound data reader implementation. This class abstracts the details of reading data
from greyhound servers.
@example
var gh = new GrehoundReader("myserver.com");
// create a session
//
gh.createSession("pipelineid", function(err, id) {
// read some stats just for kicks
gh.getStats(id, function(err, stats) {
// p... | [
"A",
"greyhound",
"data",
"reader",
"implementation",
".",
"This",
"class",
"abstracts",
"the",
"details",
"of",
"reading",
"data",
"from",
"greyhound",
"servers",
"."
] | d219b9eb9ec12af6a006f29d604543b61d2ae0a9 | https://github.com/verma/greyhound.js/blob/d219b9eb9ec12af6a006f29d604543b61d2ae0a9/lib/greyhound.js#L426-L446 | |
39,455 | owejs/owe | src/filter.js | filterGenerator | function filterGenerator(filter) {
if(typeof filter === "boolean")
return () => filter;
if(typeof filter === "function")
return filter;
if(filter instanceof RegExp)
return input => filter.test(input);
if(filter instanceof Set)
return input => filter.has(input);
if(filter instanceof Map)
return input ... | javascript | function filterGenerator(filter) {
if(typeof filter === "boolean")
return () => filter;
if(typeof filter === "function")
return filter;
if(filter instanceof RegExp)
return input => filter.test(input);
if(filter instanceof Set)
return input => filter.has(input);
if(filter instanceof Map)
return input ... | [
"function",
"filterGenerator",
"(",
"filter",
")",
"{",
"if",
"(",
"typeof",
"filter",
"===",
"\"boolean\"",
")",
"return",
"(",
")",
"=>",
"filter",
";",
"if",
"(",
"typeof",
"filter",
"===",
"\"function\"",
")",
"return",
"filter",
";",
"if",
"(",
"fil... | Generates a filter function out of the given filter.
@param {any} filter The filter.
@return {function} A filter function for `filter`. | [
"Generates",
"a",
"filter",
"function",
"out",
"of",
"the",
"given",
"filter",
"."
] | 5e1ed342a9b2f20af4e633d706543da7f3a64b8a | https://github.com/owejs/owe/blob/5e1ed342a9b2f20af4e633d706543da7f3a64b8a/src/filter.js#L8-L31 |
39,456 | nearform/nscale-docker-ssh-analyzer | dockerApi.js | preconnect | function preconnect(user, sshKeyPath, ipaddress, cb, pollCount) {
if (pollCount === undefined) {
pollCount = 0;
}
logger.info({
user: user,
identityFile: sshKeyPath,
ipAddress: ipaddress
}, 'waiting for connectivity');
portscanner.checkPortStatus(22, ipaddress, function(err, status) {
if... | javascript | function preconnect(user, sshKeyPath, ipaddress, cb, pollCount) {
if (pollCount === undefined) {
pollCount = 0;
}
logger.info({
user: user,
identityFile: sshKeyPath,
ipAddress: ipaddress
}, 'waiting for connectivity');
portscanner.checkPortStatus(22, ipaddress, function(err, status) {
if... | [
"function",
"preconnect",
"(",
"user",
",",
"sshKeyPath",
",",
"ipaddress",
",",
"cb",
",",
"pollCount",
")",
"{",
"if",
"(",
"pollCount",
"===",
"undefined",
")",
"{",
"pollCount",
"=",
"0",
";",
"}",
"logger",
".",
"info",
"(",
"{",
"user",
":",
"u... | preconnect in the case that ssh multiplexing is operative | [
"preconnect",
"in",
"the",
"case",
"that",
"ssh",
"multiplexing",
"is",
"operative"
] | 2e983b2e58ce40aba5842d0d97aea86a90654b02 | https://github.com/nearform/nscale-docker-ssh-analyzer/blob/2e983b2e58ce40aba5842d0d97aea86a90654b02/dockerApi.js#L58-L87 |
39,457 | seattleacademy/mcp9808 | examples/graph-webpage/js/main.js | UpdateChartData | function UpdateChartData()
{
while(Points > 10)
{
Points -= 1;
myLineChart.removeData();
}
myLineChart.addData([Data["Temperature"]], Math.floor((Date.now() - StartTime) / 1000.0));
myLineChart.update();
Points+=1;
} | javascript | function UpdateChartData()
{
while(Points > 10)
{
Points -= 1;
myLineChart.removeData();
}
myLineChart.addData([Data["Temperature"]], Math.floor((Date.now() - StartTime) / 1000.0));
myLineChart.update();
Points+=1;
} | [
"function",
"UpdateChartData",
"(",
")",
"{",
"while",
"(",
"Points",
">",
"10",
")",
"{",
"Points",
"-=",
"1",
";",
"myLineChart",
".",
"removeData",
"(",
")",
";",
"}",
"myLineChart",
".",
"addData",
"(",
"[",
"Data",
"[",
"\"Temperature\"",
"]",
"]"... | update the chart function | [
"update",
"the",
"chart",
"function"
] | 211c07158e0585dfc3c2149b1e5e93d105d89723 | https://github.com/seattleacademy/mcp9808/blob/211c07158e0585dfc3c2149b1e5e93d105d89723/examples/graph-webpage/js/main.js#L10-L22 |
39,458 | redturn/jsonresponse | lib/jsonresponse.js | function(err, results) {
if(err) {
this.success = false;
this.error = err;
this.results = null;
// customize error for error types
if(util.isError(err)) {
this.error = {
message: err.message,
type: err.type,
arguments: err.arguments
};
if(NODE_ENV === 'de... | javascript | function(err, results) {
if(err) {
this.success = false;
this.error = err;
this.results = null;
// customize error for error types
if(util.isError(err)) {
this.error = {
message: err.message,
type: err.type,
arguments: err.arguments
};
if(NODE_ENV === 'de... | [
"function",
"(",
"err",
",",
"results",
")",
"{",
"if",
"(",
"err",
")",
"{",
"this",
".",
"success",
"=",
"false",
";",
"this",
".",
"error",
"=",
"err",
";",
"this",
".",
"results",
"=",
"null",
";",
"// customize error for error types",
"if",
"(",
... | Creates a uniform Json response object
@param err the optional error
@param results the optional results
@constructor | [
"Creates",
"a",
"uniform",
"Json",
"response",
"object"
] | 2b8ca09784a3596c758e14230b4c1bb6111fd991 | https://github.com/redturn/jsonresponse/blob/2b8ca09784a3596c758e14230b4c1bb6111fd991/lib/jsonresponse.js#L10-L33 | |
39,459 | iximiuz/js-itertools | lib/permutations.js | permutations | function permutations(iterable, r) {
// (ABCD, 2) -> AB AC AD BA BC BD CA CB CD DA DB DC
// (012, 3) -> 012 021 102 120 201 210
/*
0 1 2 3, 3
______
(0, 1, 2)
(0, 1, 3)
(0, 2, 1)
(0, 2, 3)
(0, 3, 1)
(0, 3, 2)
(1, 0, 2)
(1, 0, 3)
(1, 2, 0)
(1, 2, 3)
(1, 3, 0)
... | javascript | function permutations(iterable, r) {
// (ABCD, 2) -> AB AC AD BA BC BD CA CB CD DA DB DC
// (012, 3) -> 012 021 102 120 201 210
/*
0 1 2 3, 3
______
(0, 1, 2)
(0, 1, 3)
(0, 2, 1)
(0, 2, 3)
(0, 3, 1)
(0, 3, 2)
(1, 0, 2)
(1, 0, 3)
(1, 2, 0)
(1, 2, 3)
(1, 3, 0)
... | [
"function",
"permutations",
"(",
"iterable",
",",
"r",
")",
"{",
"// (ABCD, 2) -> AB AC AD BA BC BD CA CB CD DA DB DC",
"// (012, 3) -> 012 021 102 120 201 210",
"/*\n 0 1 2 3, 3\n ______\n (0, 1, 2)\n (0, 1, 3)\n (0, 2, 1)\n (0, 2, 3)\n (0, 3, 1)\n (0, 3, 2)\n (1, 0,... | Return successive r length permutations of elements in the iterable.
@param {Iterator|Iterable|Array|String} iterable
@param {Number} r - length of permutations.
@returns {Iterator|Iterable} | [
"Return",
"successive",
"r",
"length",
"permutations",
"of",
"elements",
"in",
"the",
"iterable",
"."
] | a228cc89c39e959f0461a04cabb4f625bea1fe33 | https://github.com/iximiuz/js-itertools/blob/a228cc89c39e959f0461a04cabb4f625bea1fe33/lib/permutations.js#L12-L125 |
39,460 | lemonde/knex-schema | lib/drop.js | drop | function drop(schemas) {
var resolver = new Resolver(schemas);
var knex = this.knex;
return Promise.map(schemas || [], function(schema) {
return (schema.preDrop || _.noop)(knex);
})
.then(function () {
// Reduce force sequential execution.
return Promise.reduce(resolver.resolve().reverse(), dropSc... | javascript | function drop(schemas) {
var resolver = new Resolver(schemas);
var knex = this.knex;
return Promise.map(schemas || [], function(schema) {
return (schema.preDrop || _.noop)(knex);
})
.then(function () {
// Reduce force sequential execution.
return Promise.reduce(resolver.resolve().reverse(), dropSc... | [
"function",
"drop",
"(",
"schemas",
")",
"{",
"var",
"resolver",
"=",
"new",
"Resolver",
"(",
"schemas",
")",
";",
"var",
"knex",
"=",
"this",
".",
"knex",
";",
"return",
"Promise",
".",
"map",
"(",
"schemas",
"||",
"[",
"]",
",",
"function",
"(",
... | Drop schemas tables. If it exists, it calls `preDrop` beforehand
@param {[Schemas]} schemas
@return {Promise} | [
"Drop",
"schemas",
"tables",
".",
"If",
"it",
"exists",
"it",
"calls",
"preDrop",
"beforehand"
] | 3e0f6cde374d240552eb08e50e123a513fda44ae | https://github.com/lemonde/knex-schema/blob/3e0f6cde374d240552eb08e50e123a513fda44ae/lib/drop.js#L20-L30 |
39,461 | lemonde/knex-schema | lib/drop.js | dropSchema | function dropSchema(result, schema) {
return this.knex.schema.dropTableIfExists(schema.tableName)
.then(function () {
return result.concat([schema]);
});
} | javascript | function dropSchema(result, schema) {
return this.knex.schema.dropTableIfExists(schema.tableName)
.then(function () {
return result.concat([schema]);
});
} | [
"function",
"dropSchema",
"(",
"result",
",",
"schema",
")",
"{",
"return",
"this",
".",
"knex",
".",
"schema",
".",
"dropTableIfExists",
"(",
"schema",
".",
"tableName",
")",
".",
"then",
"(",
"function",
"(",
")",
"{",
"return",
"result",
".",
"concat"... | Drop schema table.
@param {[Schema]} result - reduce accumulator
@param {Schema} schema
@return {Promise} | [
"Drop",
"schema",
"table",
"."
] | 3e0f6cde374d240552eb08e50e123a513fda44ae | https://github.com/lemonde/knex-schema/blob/3e0f6cde374d240552eb08e50e123a513fda44ae/lib/drop.js#L40-L45 |
39,462 | IDfr-Corporation/format-number-french | index.js | formatNumber | function formatNumber(value, options) {
options = options || {};
value += ''; // must be String Type
// not a number !!
if (!__isNumber(value)) {
return false;
}
var valueArr = __splitValue(value),
integer = valueArr[0],
negative = integer < 0,
absInteger = Math... | javascript | function formatNumber(value, options) {
options = options || {};
value += ''; // must be String Type
// not a number !!
if (!__isNumber(value)) {
return false;
}
var valueArr = __splitValue(value),
integer = valueArr[0],
negative = integer < 0,
absInteger = Math... | [
"function",
"formatNumber",
"(",
"value",
",",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"value",
"+=",
"''",
";",
"// must be String Type",
"// not a number !!",
"if",
"(",
"!",
"__isNumber",
"(",
"value",
")",
")",
"{",
"return... | Return a well formatted number according to french rules
@param value
@param options | [
"Return",
"a",
"well",
"formatted",
"number",
"according",
"to",
"french",
"rules"
] | 55dd37f034cbbb8f82ad964c1ae75975e396f642 | https://github.com/IDfr-Corporation/format-number-french/blob/55dd37f034cbbb8f82ad964c1ae75975e396f642/index.js#L21-L68 |
39,463 | IDfr-Corporation/format-number-french | index.js | __addSpacesSeparator | function __addSpacesSeparator(val) {
var reg = /(\d+)(\d{3})/,
sep = ' ';
// val must be a type String
val += '';
while (reg.test(val)) {
val = val.replace(reg, '$1' + sep + '$2');
}
return val;
} | javascript | function __addSpacesSeparator(val) {
var reg = /(\d+)(\d{3})/,
sep = ' ';
// val must be a type String
val += '';
while (reg.test(val)) {
val = val.replace(reg, '$1' + sep + '$2');
}
return val;
} | [
"function",
"__addSpacesSeparator",
"(",
"val",
")",
"{",
"var",
"reg",
"=",
"/",
"(\\d+)(\\d{3})",
"/",
",",
"sep",
"=",
"' '",
";",
"// val must be a type String",
"val",
"+=",
"''",
";",
"while",
"(",
"reg",
".",
"test",
"(",
"val",
")",
")",
"{",
"... | Add a space every three characters
@param val
@returns {string}
@private | [
"Add",
"a",
"space",
"every",
"three",
"characters"
] | 55dd37f034cbbb8f82ad964c1ae75975e396f642 | https://github.com/IDfr-Corporation/format-number-french/blob/55dd37f034cbbb8f82ad964c1ae75975e396f642/index.js#L97-L107 |
39,464 | alexcjohnson/world-calendars | jquery-src/jquery.plugin.js | function(name, otherArgs) {
if (name === 'option' && (otherArgs.length === 0 ||
(otherArgs.length === 1 && typeof otherArgs[0] === 'string'))) {
return true;
}
return $.inArray(name, this._getters) > -1;
} | javascript | function(name, otherArgs) {
if (name === 'option' && (otherArgs.length === 0 ||
(otherArgs.length === 1 && typeof otherArgs[0] === 'string'))) {
return true;
}
return $.inArray(name, this._getters) > -1;
} | [
"function",
"(",
"name",
",",
"otherArgs",
")",
"{",
"if",
"(",
"name",
"===",
"'option'",
"&&",
"(",
"otherArgs",
".",
"length",
"===",
"0",
"||",
"(",
"otherArgs",
".",
"length",
"===",
"1",
"&&",
"typeof",
"otherArgs",
"[",
"0",
"]",
"===",
"'stri... | Determine whether a method is a getter and doesn't permit chaining.
@private
@param name {string} The method name.
@param otherArgs {any[]} Any other arguments for the method.
@return {boolean} True if this method is a getter, false otherwise. | [
"Determine",
"whether",
"a",
"method",
"is",
"a",
"getter",
"and",
"doesn",
"t",
"permit",
"chaining",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.plugin.js#L155-L161 | |
39,465 | alexcjohnson/world-calendars | jquery-src/jquery.plugin.js | function(elem, options) {
elem = $(elem);
if (elem.hasClass(this._getMarker())) {
return;
}
elem.addClass(this._getMarker());
options = $.extend({}, this.defaultOptions, this._getMetadata(elem), options || {});
var inst = $.extend({name: this.name, elem: elem, options: options},
this._instSett... | javascript | function(elem, options) {
elem = $(elem);
if (elem.hasClass(this._getMarker())) {
return;
}
elem.addClass(this._getMarker());
options = $.extend({}, this.defaultOptions, this._getMetadata(elem), options || {});
var inst = $.extend({name: this.name, elem: elem, options: options},
this._instSett... | [
"function",
"(",
"elem",
",",
"options",
")",
"{",
"elem",
"=",
"$",
"(",
"elem",
")",
";",
"if",
"(",
"elem",
".",
"hasClass",
"(",
"this",
".",
"_getMarker",
"(",
")",
")",
")",
"{",
"return",
";",
"}",
"elem",
".",
"addClass",
"(",
"this",
"... | Initialise an element. Called internally only.
Adds an instance object as data named for the plugin.
@param elem {Element} The element to enhance.
@param options {object} Overriding settings. | [
"Initialise",
"an",
"element",
".",
"Called",
"internally",
"only",
".",
"Adds",
"an",
"instance",
"object",
"as",
"data",
"named",
"for",
"the",
"plugin",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.plugin.js#L167-L179 | |
39,466 | alexcjohnson/world-calendars | jquery-src/jquery.plugin.js | function(elem, name, value) {
elem = $(elem);
var inst = elem.data(this.name);
if (!name || (typeof name === 'string' && value == null)) {
var options = (inst || {}).options;
return (options && name ? options[name] : options);
}
if (!elem.hasClass(this._getMarker())) {
return;
}
var op... | javascript | function(elem, name, value) {
elem = $(elem);
var inst = elem.data(this.name);
if (!name || (typeof name === 'string' && value == null)) {
var options = (inst || {}).options;
return (options && name ? options[name] : options);
}
if (!elem.hasClass(this._getMarker())) {
return;
}
var op... | [
"function",
"(",
"elem",
",",
"name",
",",
"value",
")",
"{",
"elem",
"=",
"$",
"(",
"elem",
")",
";",
"var",
"inst",
"=",
"elem",
".",
"data",
"(",
"this",
".",
"name",
")",
";",
"if",
"(",
"!",
"name",
"||",
"(",
"typeof",
"name",
"===",
"'... | Retrieve or reconfigure the settings for a plugin.
@param elem {Element} The source element.
@param name {object|string} The collection of new option values or the name of a single option.
@param [value] {any} The value for a single named option.
@return {any|object} If retrieving a single value or all options.
@exampl... | [
"Retrieve",
"or",
"reconfigure",
"the",
"settings",
"for",
"a",
"plugin",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.plugin.js#L250-L267 | |
39,467 | alexcjohnson/world-calendars | jquery-src/jquery.plugin.js | function(superClass, overrides) {
if (typeof superClass === 'object') {
overrides = superClass;
superClass = 'JQPlugin';
}
superClass = camelCase(superClass);
var className = camelCase(overrides.name);
JQClass.classes[className] = JQClass.classes[superClass].extend(overrides);
new JQClass.clas... | javascript | function(superClass, overrides) {
if (typeof superClass === 'object') {
overrides = superClass;
superClass = 'JQPlugin';
}
superClass = camelCase(superClass);
var className = camelCase(overrides.name);
JQClass.classes[className] = JQClass.classes[superClass].extend(overrides);
new JQClass.clas... | [
"function",
"(",
"superClass",
",",
"overrides",
")",
"{",
"if",
"(",
"typeof",
"superClass",
"===",
"'object'",
")",
"{",
"overrides",
"=",
"superClass",
";",
"superClass",
"=",
"'JQPlugin'",
";",
"}",
"superClass",
"=",
"camelCase",
"(",
"superClass",
")",... | Create a new collection plugin.
@memberof "$.JQPlugin"
@param [superClass='JQPlugin'] {string} The name of the parent class to inherit from.
@param overrides {object} The property/function overrides for the new class.
@example $.JQPlugin.createPlugin({
name: 'tabs',
defaultOptions: {selectedClass: 'selected'},
_initSet... | [
"Create",
"a",
"new",
"collection",
"plugin",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.plugin.js#L332-L341 | |
39,468 | ssulleyymmann/ng-all-login | docs/vendor.bundle.js | fingerprint | function fingerprint(str) {
var /** @type {?} */ utf8 = utf8Encode(str);
var _a = [hash32(utf8, 0), hash32(utf8, 102072)], hi = _a[0], lo = _a[1];
if (hi == 0 && (lo == 0 || lo == 1)) {
hi = hi ^ 0x130f9bef;
lo = lo ^ -0x6b5f56d8;
}
return [hi, lo];
} | javascript | function fingerprint(str) {
var /** @type {?} */ utf8 = utf8Encode(str);
var _a = [hash32(utf8, 0), hash32(utf8, 102072)], hi = _a[0], lo = _a[1];
if (hi == 0 && (lo == 0 || lo == 1)) {
hi = hi ^ 0x130f9bef;
lo = lo ^ -0x6b5f56d8;
}
return [hi, lo];
} | [
"function",
"fingerprint",
"(",
"str",
")",
"{",
"var",
"/** @type {?} */",
"utf8",
"=",
"utf8Encode",
"(",
"str",
")",
";",
"var",
"_a",
"=",
"[",
"hash32",
"(",
"utf8",
",",
"0",
")",
",",
"hash32",
"(",
"utf8",
",",
"102072",
")",
"]",
",",
"hi"... | Compute the fingerprint of the given string
The output is 64 bit number encoded as a decimal string
based on:
https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/GoogleJsMessageIdGenerator.java
@param {?} str
@return {?} | [
"Compute",
"the",
"fingerprint",
"of",
"the",
"given",
"string"
] | 4aa73280c4858011894a416760bef34339ab11b1 | https://github.com/ssulleyymmann/ng-all-login/blob/4aa73280c4858011894a416760bef34339ab11b1/docs/vendor.bundle.js#L32838-L32846 |
39,469 | ssulleyymmann/ng-all-login | docs/vendor.bundle.js | _removeDotSegments | function _removeDotSegments(path) {
if (path == '/')
return '/';
var /** @type {?} */ leadingSlash = path[0] == '/' ? '/' : '';
var /** @type {?} */ trailingSlash = path[path.length - 1] === '/' ? '/' : '';
var /** @type {?} */ segments = path.split('/');
var /** @type {?} */ out = [];
v... | javascript | function _removeDotSegments(path) {
if (path == '/')
return '/';
var /** @type {?} */ leadingSlash = path[0] == '/' ? '/' : '';
var /** @type {?} */ trailingSlash = path[path.length - 1] === '/' ? '/' : '';
var /** @type {?} */ segments = path.split('/');
var /** @type {?} */ out = [];
v... | [
"function",
"_removeDotSegments",
"(",
"path",
")",
"{",
"if",
"(",
"path",
"==",
"'/'",
")",
"return",
"'/'",
";",
"var",
"/** @type {?} */",
"leadingSlash",
"=",
"path",
"[",
"0",
"]",
"==",
"'/'",
"?",
"'/'",
":",
"''",
";",
"var",
"/** @type {?} */",... | Removes dot segments in given path component, as described in
RFC 3986, section 5.2.4.
@param {?} path A non-empty path component.
@return {?} Path component with removed dot segments. | [
"Removes",
"dot",
"segments",
"in",
"given",
"path",
"component",
"as",
"described",
"in",
"RFC",
"3986",
"section",
"5",
".",
"2",
".",
"4",
"."
] | 4aa73280c4858011894a416760bef34339ab11b1 | https://github.com/ssulleyymmann/ng-all-login/blob/4aa73280c4858011894a416760bef34339ab11b1/docs/vendor.bundle.js#L39097-L39131 |
39,470 | ssulleyymmann/ng-all-login | docs/vendor.bundle.js | convertPropertyBinding | function convertPropertyBinding(localResolver, implicitReceiver, expressionWithoutBuiltins, bindingId) {
if (!localResolver) {
localResolver = new DefaultLocalResolver();
}
var /** @type {?} */ currValExpr = createCurrValueExpr(bindingId);
var /** @type {?} */ stmts = [];
var /** @type {?} *... | javascript | function convertPropertyBinding(localResolver, implicitReceiver, expressionWithoutBuiltins, bindingId) {
if (!localResolver) {
localResolver = new DefaultLocalResolver();
}
var /** @type {?} */ currValExpr = createCurrValueExpr(bindingId);
var /** @type {?} */ stmts = [];
var /** @type {?} *... | [
"function",
"convertPropertyBinding",
"(",
"localResolver",
",",
"implicitReceiver",
",",
"expressionWithoutBuiltins",
",",
"bindingId",
")",
"{",
"if",
"(",
"!",
"localResolver",
")",
"{",
"localResolver",
"=",
"new",
"DefaultLocalResolver",
"(",
")",
";",
"}",
"... | Converts the given expression AST into an executable output AST, assuming the expression
is used in property binding. The expression has to be preprocessed via
`convertPropertyBindingBuiltins`.
@param {?} localResolver
@param {?} implicitReceiver
@param {?} expressionWithoutBuiltins
@param {?} bindingId
@return {?} | [
"Converts",
"the",
"given",
"expression",
"AST",
"into",
"an",
"executable",
"output",
"AST",
"assuming",
"the",
"expression",
"is",
"used",
"in",
"property",
"binding",
".",
"The",
"expression",
"has",
"to",
"be",
"preprocessed",
"via",
"convertPropertyBindingBui... | 4aa73280c4858011894a416760bef34339ab11b1 | https://github.com/ssulleyymmann/ng-all-login/blob/4aa73280c4858011894a416760bef34339ab11b1/docs/vendor.bundle.js#L46432-L46447 |
39,471 | ssulleyymmann/ng-all-login | docs/vendor.bundle.js | Class | function Class(clsDef) {
var /** @type {?} */ constructor = applyParams(clsDef.hasOwnProperty('constructor') ? clsDef.constructor : undefined, 'constructor');
var /** @type {?} */ proto = constructor.prototype;
if (clsDef.hasOwnProperty('extends')) {
if (typeof clsDef.extends === 'function') {
... | javascript | function Class(clsDef) {
var /** @type {?} */ constructor = applyParams(clsDef.hasOwnProperty('constructor') ? clsDef.constructor : undefined, 'constructor');
var /** @type {?} */ proto = constructor.prototype;
if (clsDef.hasOwnProperty('extends')) {
if (typeof clsDef.extends === 'function') {
... | [
"function",
"Class",
"(",
"clsDef",
")",
"{",
"var",
"/** @type {?} */",
"constructor",
"=",
"applyParams",
"(",
"clsDef",
".",
"hasOwnProperty",
"(",
"'constructor'",
")",
"?",
"clsDef",
".",
"constructor",
":",
"undefined",
",",
"'constructor'",
")",
";",
"v... | Provides a way for expressing ES6 classes with parameter annotations in ES5.
## Basic Example
```
var Greeter = ng.Class({
constructor: function(name) {
this.name = name;
},
greet: function() {
alert('Hello ' + this.name + '!');
}
});
```
is equivalent to ES6:
```
class Greeter {
constructor(name) {
this.name = na... | [
"Provides",
"a",
"way",
"for",
"expressing",
"ES6",
"classes",
"with",
"parameter",
"annotations",
"in",
"ES5",
"."
] | 4aa73280c4858011894a416760bef34339ab11b1 | https://github.com/ssulleyymmann/ng-all-login/blob/4aa73280c4858011894a416760bef34339ab11b1/docs/vendor.bundle.js#L53307-L53332 |
39,472 | elmarburke/hoodie-plugin-angularjs | src/hoodieArray.js | mapFromArray | function mapFromArray(array, prop) {
var map = {};
for (var i = 0; i < array.length; i++) {
map[ array[i][prop] ] = array[i];
}
return map;
} | javascript | function mapFromArray(array, prop) {
var map = {};
for (var i = 0; i < array.length; i++) {
map[ array[i][prop] ] = array[i];
}
return map;
} | [
"function",
"mapFromArray",
"(",
"array",
",",
"prop",
")",
"{",
"var",
"map",
"=",
"{",
"}",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"array",
".",
"length",
";",
"i",
"++",
")",
"{",
"map",
"[",
"array",
"[",
"i",
"]",
"[",
"... | Creates a map out of an array be choosing what property to key by
@param {object[]} array Array that will be converted into a map
@param {string} prop Name of property to key by
@return {object} The mapped array. Example:
mapFromArray([{a:1,b:2}, {a:3,b:4}], 'a')
returns {1: {a:1,b:2}, 3: {a:3,b:4}} | [
"Creates",
"a",
"map",
"out",
"of",
"an",
"array",
"be",
"choosing",
"what",
"property",
"to",
"key",
"by"
] | 7f38248a0162ebea439e747d81a7423f43fd3cc8 | https://github.com/elmarburke/hoodie-plugin-angularjs/blob/7f38248a0162ebea439e747d81a7423f43fd3cc8/src/hoodieArray.js#L70-L76 |
39,473 | solid/contacts-pane | toolsPane.js | saveCleanPeople | function saveCleanPeople () {
var cleanPeople
return Promise.resolve()
.then(() => {
cleanPeople = kb.sym(stats.book.dir().uri + 'clean-people.ttl')
var sts = []
for (let i = 0; i < stats.uniques.length; i++) {
sts = sts.concat(k... | javascript | function saveCleanPeople () {
var cleanPeople
return Promise.resolve()
.then(() => {
cleanPeople = kb.sym(stats.book.dir().uri + 'clean-people.ttl')
var sts = []
for (let i = 0; i < stats.uniques.length; i++) {
sts = sts.concat(k... | [
"function",
"saveCleanPeople",
"(",
")",
"{",
"var",
"cleanPeople",
"return",
"Promise",
".",
"resolve",
"(",
")",
".",
"then",
"(",
"(",
")",
"=>",
"{",
"cleanPeople",
"=",
"kb",
".",
"sym",
"(",
"stats",
".",
"book",
".",
"dir",
"(",
")",
".",
"u... | Save a new clean version | [
"Save",
"a",
"new",
"clean",
"version"
] | 373c55fc6e2c584603741ee972d036fcb1e2f4b8 | https://github.com/solid/contacts-pane/blob/373c55fc6e2c584603741ee972d036fcb1e2f4b8/toolsPane.js#L465-L488 |
39,474 | alexcjohnson/world-calendars | dist/plus.js | function() {
if (value.charAt(iValue) !== format.charAt(iFormat)) {
throw (main.local.unexpectedLiteralAt ||
main.regionalOptions[''].unexpectedLiteralAt).replace(/\{0\}/, iValue);
}
iValue++;
} | javascript | function() {
if (value.charAt(iValue) !== format.charAt(iFormat)) {
throw (main.local.unexpectedLiteralAt ||
main.regionalOptions[''].unexpectedLiteralAt).replace(/\{0\}/, iValue);
}
iValue++;
} | [
"function",
"(",
")",
"{",
"if",
"(",
"value",
".",
"charAt",
"(",
"iValue",
")",
"!==",
"format",
".",
"charAt",
"(",
"iFormat",
")",
")",
"{",
"throw",
"(",
"main",
".",
"local",
".",
"unexpectedLiteralAt",
"||",
"main",
".",
"regionalOptions",
"[",
... | Confirm that a literal character matches the string value | [
"Confirm",
"that",
"a",
"literal",
"character",
"matches",
"the",
"string",
"value"
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/dist/plus.js#L369-L375 | |
39,475 | sat-utils/sat-api-lib | libs/api.js | function (intersects) {
if (_.isString(intersects)) {
try {
intersects = JSON.parse(intersects);
} catch (e) {
throw new Error('Invalid Geojson');
}
}
return intersects;
} | javascript | function (intersects) {
if (_.isString(intersects)) {
try {
intersects = JSON.parse(intersects);
} catch (e) {
throw new Error('Invalid Geojson');
}
}
return intersects;
} | [
"function",
"(",
"intersects",
")",
"{",
"if",
"(",
"_",
".",
"isString",
"(",
"intersects",
")",
")",
"{",
"try",
"{",
"intersects",
"=",
"JSON",
".",
"parse",
"(",
"intersects",
")",
";",
"}",
"catch",
"(",
"e",
")",
"{",
"throw",
"new",
"Error",... | converts string intersect to js object | [
"converts",
"string",
"intersect",
"to",
"js",
"object"
] | 74ef1cb09789ecc9c18512781a95eada6fdc3813 | https://github.com/sat-utils/sat-api-lib/blob/74ef1cb09789ecc9c18512781a95eada6fdc3813/libs/api.js#L11-L21 | |
39,476 | XadillaX/illyria2 | benchmark/index.js | function(callback) {
server = illyria2.createServer();
server.expose("benchmark", {
echo: function(req, resp) {
resp.send(req.params());
}
});
server.listen(SERVER_PORT, function() {
callback();
});
} | javascript | function(callback) {
server = illyria2.createServer();
server.expose("benchmark", {
echo: function(req, resp) {
resp.send(req.params());
}
});
server.listen(SERVER_PORT, function() {
callback();
});
} | [
"function",
"(",
"callback",
")",
"{",
"server",
"=",
"illyria2",
".",
"createServer",
"(",
")",
";",
"server",
".",
"expose",
"(",
"\"benchmark\"",
",",
"{",
"echo",
":",
"function",
"(",
"req",
",",
"resp",
")",
"{",
"resp",
".",
"send",
"(",
"req"... | step 1.
create server | [
"step",
"1",
".",
"create",
"server"
] | ced0cc71cdcda11afcbab33f13739cbe547a2a17 | https://github.com/XadillaX/illyria2/blob/ced0cc71cdcda11afcbab33f13739cbe547a2a17/benchmark/index.js#L80-L90 | |
39,477 | XadillaX/illyria2 | benchmark/index.js | function(callback) {
var scarlet = new Scarlet(Math.min(opts.n, 100));
function connect(taskObject) {
var client = taskObject.task.client;
var i = taskObject.task.idx;
client.connect(function() {
scarlet.taskDone(taskObject);
});
... | javascript | function(callback) {
var scarlet = new Scarlet(Math.min(opts.n, 100));
function connect(taskObject) {
var client = taskObject.task.client;
var i = taskObject.task.idx;
client.connect(function() {
scarlet.taskDone(taskObject);
});
... | [
"function",
"(",
"callback",
")",
"{",
"var",
"scarlet",
"=",
"new",
"Scarlet",
"(",
"Math",
".",
"min",
"(",
"opts",
".",
"n",
",",
"100",
")",
")",
";",
"function",
"connect",
"(",
"taskObject",
")",
"{",
"var",
"client",
"=",
"taskObject",
".",
... | step 2.
create clients and connect to server | [
"step",
"2",
".",
"create",
"clients",
"and",
"connect",
"to",
"server"
] | ced0cc71cdcda11afcbab33f13739cbe547a2a17 | https://github.com/XadillaX/illyria2/blob/ced0cc71cdcda11afcbab33f13739cbe547a2a17/benchmark/index.js#L96-L133 | |
39,478 | XadillaX/illyria2 | benchmark/index.js | function(callback) {
block = "";
for(var i = 0; i < opts.size; i++) block + ".";
testAbility(callback);
} | javascript | function(callback) {
block = "";
for(var i = 0; i < opts.size; i++) block + ".";
testAbility(callback);
} | [
"function",
"(",
"callback",
")",
"{",
"block",
"=",
"\"\"",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"opts",
".",
"size",
";",
"i",
"++",
")",
"block",
"+",
"\".\"",
";",
"testAbility",
"(",
"callback",
")",
";",
"}"
] | step 3.
start testing | [
"step",
"3",
".",
"start",
"testing"
] | ced0cc71cdcda11afcbab33f13739cbe547a2a17 | https://github.com/XadillaX/illyria2/blob/ced0cc71cdcda11afcbab33f13739cbe547a2a17/benchmark/index.js#L139-L143 | |
39,479 | balderdashy/mast | dist/mast.dev.js | function (events, options) {
var eventKeys = _.keys(events || {}),
limitEvents,
parsedEvents = [];
// Optionally filter using set of acceptable event types
limitEvents = options.only;
eventKeys = _.filter(eventKeys, function checkEventName (eventKey) {
// Parse event string into semantic representat... | javascript | function (events, options) {
var eventKeys = _.keys(events || {}),
limitEvents,
parsedEvents = [];
// Optionally filter using set of acceptable event types
limitEvents = options.only;
eventKeys = _.filter(eventKeys, function checkEventName (eventKey) {
// Parse event string into semantic representat... | [
"function",
"(",
"events",
",",
"options",
")",
"{",
"var",
"eventKeys",
"=",
"_",
".",
"keys",
"(",
"events",
"||",
"{",
"}",
")",
",",
"limitEvents",
",",
"parsedEvents",
"=",
"[",
"]",
";",
"// Optionally filter using set of acceptable event types",
"limitE... | Parses a dictionary of events and optionally filters by the event type. If the event
@param {Object} events [A Backbone.View events object]
@param {Object} options [Options object that allows us to filter parsing to certain event
names]
@return {Array} [Array containing parsedEvents that are matching even... | [
"Parses",
"a",
"dictionary",
"of",
"events",
"and",
"optionally",
"filters",
"by",
"the",
"event",
"type",
".",
"If",
"the",
"event"
] | 6fc2b07849ec6a6fe15f66e456e556e5270ed37f | https://github.com/balderdashy/mast/blob/6fc2b07849ec6a6fe15f66e456e556e5270ed37f/dist/mast.dev.js#L2350-L2372 | |
39,480 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.picker.js | function(inst) {
var maxDate = inst.get('maxDate');
return (!maxDate || inst.drawDate.newDate().
add(inst.options.monthsToJump - inst.options.monthsOffset, 'm').
day(inst.options.calendar.minDay).compareTo(maxDate) !== +1); } | javascript | function(inst) {
var maxDate = inst.get('maxDate');
return (!maxDate || inst.drawDate.newDate().
add(inst.options.monthsToJump - inst.options.monthsOffset, 'm').
day(inst.options.calendar.minDay).compareTo(maxDate) !== +1); } | [
"function",
"(",
"inst",
")",
"{",
"var",
"maxDate",
"=",
"inst",
".",
"get",
"(",
"'maxDate'",
")",
";",
"return",
"(",
"!",
"maxDate",
"||",
"inst",
".",
"drawDate",
".",
"newDate",
"(",
")",
".",
"add",
"(",
"inst",
".",
"options",
".",
"monthsT... | Ctrl + Page down | [
"Ctrl",
"+",
"Page",
"down"
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.picker.js#L164-L168 | |
39,481 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.picker.js | function(inst) {
var minDate = inst.curMinDate();
var maxDate = inst.get('maxDate');
var curDate = inst.selectedDates[0] || inst.options.calendar.today();
return (!minDate || curDate.compareTo(minDate) !== -1) &&
(!maxDate || curDate.compareTo(maxDate) !== +1); } | javascript | function(inst) {
var minDate = inst.curMinDate();
var maxDate = inst.get('maxDate');
var curDate = inst.selectedDates[0] || inst.options.calendar.today();
return (!minDate || curDate.compareTo(minDate) !== -1) &&
(!maxDate || curDate.compareTo(maxDate) !== +1); } | [
"function",
"(",
"inst",
")",
"{",
"var",
"minDate",
"=",
"inst",
".",
"curMinDate",
"(",
")",
";",
"var",
"maxDate",
"=",
"inst",
".",
"get",
"(",
"'maxDate'",
")",
";",
"var",
"curDate",
"=",
"inst",
".",
"selectedDates",
"[",
"0",
"]",
"||",
"in... | Ctrl + Home | [
"Ctrl",
"+",
"Home"
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.picker.js#L178-L183 | |
39,482 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.picker.js | function(inst) {
var minDate = inst.curMinDate();
return (!minDate || inst.drawDate.newDate().
add(-inst.options.calendar.daysInWeek(), 'd').compareTo(minDate) !== -1); } | javascript | function(inst) {
var minDate = inst.curMinDate();
return (!minDate || inst.drawDate.newDate().
add(-inst.options.calendar.daysInWeek(), 'd').compareTo(minDate) !== -1); } | [
"function",
"(",
"inst",
")",
"{",
"var",
"minDate",
"=",
"inst",
".",
"curMinDate",
"(",
")",
";",
"return",
"(",
"!",
"minDate",
"||",
"inst",
".",
"drawDate",
".",
"newDate",
"(",
")",
".",
"add",
"(",
"-",
"inst",
".",
"options",
".",
"calendar... | Ctrl + Up | [
"Ctrl",
"+",
"Up"
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.picker.js#L214-L217 | |
39,483 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.picker.js | function(inst) {
var minDate = inst.curMinDate();
return (!minDate || inst.drawDate.newDate().add(-1, 'd').
compareTo(minDate) !== -1); } | javascript | function(inst) {
var minDate = inst.curMinDate();
return (!minDate || inst.drawDate.newDate().add(-1, 'd').
compareTo(minDate) !== -1); } | [
"function",
"(",
"inst",
")",
"{",
"var",
"minDate",
"=",
"inst",
".",
"curMinDate",
"(",
")",
";",
"return",
"(",
"!",
"minDate",
"||",
"inst",
".",
"drawDate",
".",
"newDate",
"(",
")",
".",
"add",
"(",
"-",
"1",
",",
"'d'",
")",
".",
"compareT... | Ctrl + Left | [
"Ctrl",
"+",
"Left"
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.picker.js#L224-L227 | |
39,484 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.picker.js | function(inst) {
var maxDate = inst.get('maxDate');
return (!maxDate || inst.drawDate.newDate().add(1, 'd').
compareTo(maxDate) !== +1); } | javascript | function(inst) {
var maxDate = inst.get('maxDate');
return (!maxDate || inst.drawDate.newDate().add(1, 'd').
compareTo(maxDate) !== +1); } | [
"function",
"(",
"inst",
")",
"{",
"var",
"maxDate",
"=",
"inst",
".",
"get",
"(",
"'maxDate'",
")",
";",
"return",
"(",
"!",
"maxDate",
"||",
"inst",
".",
"drawDate",
".",
"newDate",
"(",
")",
".",
"add",
"(",
"1",
",",
"'d'",
")",
".",
"compare... | Ctrl + Right | [
"Ctrl",
"+",
"Right"
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.picker.js#L233-L236 | |
39,485 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.picker.js | function(inst) {
var maxDate = inst.get('maxDate');
return (!maxDate || inst.drawDate.newDate().
add(inst.options.calendar.daysInWeek(), 'd').compareTo(maxDate) !== +1); } | javascript | function(inst) {
var maxDate = inst.get('maxDate');
return (!maxDate || inst.drawDate.newDate().
add(inst.options.calendar.daysInWeek(), 'd').compareTo(maxDate) !== +1); } | [
"function",
"(",
"inst",
")",
"{",
"var",
"maxDate",
"=",
"inst",
".",
"get",
"(",
"'maxDate'",
")",
";",
"return",
"(",
"!",
"maxDate",
"||",
"inst",
".",
"drawDate",
".",
"newDate",
"(",
")",
".",
"add",
"(",
"inst",
".",
"options",
".",
"calenda... | Ctrl + Down | [
"Ctrl",
"+",
"Down"
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.picker.js#L242-L245 | |
39,486 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.picker.js | function(elem, inst) {
elem.off('focus.' + inst.name);
if (inst.options.showOnFocus) {
elem.on('focus.' + inst.name, this.show);
}
if (inst.trigger) {
inst.trigger.remove();
}
var trigger = inst.options.showTrigger;
inst.trigger = (!trigger ? $([]) :
$(trigger).clone().removeAttr('id').... | javascript | function(elem, inst) {
elem.off('focus.' + inst.name);
if (inst.options.showOnFocus) {
elem.on('focus.' + inst.name, this.show);
}
if (inst.trigger) {
inst.trigger.remove();
}
var trigger = inst.options.showTrigger;
inst.trigger = (!trigger ? $([]) :
$(trigger).clone().removeAttr('id').... | [
"function",
"(",
"elem",
",",
"inst",
")",
"{",
"elem",
".",
"off",
"(",
"'focus.'",
"+",
"inst",
".",
"name",
")",
";",
"if",
"(",
"inst",
".",
"options",
".",
"showOnFocus",
")",
"{",
"elem",
".",
"on",
"(",
"'focus.'",
"+",
"inst",
".",
"name"... | Attach events and trigger, if necessary.
@memberof CalendarsPicker
@private
@param elem {jQuery} The control to affect.
@param inst {object} The current instance settings. | [
"Attach",
"events",
"and",
"trigger",
"if",
"necessary",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.picker.js#L585-L611 | |
39,487 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.picker.js | function(elem, inst) {
if (inst.options.autoSize && !inst.inline) {
var calendar = inst.options.calendar;
var date = calendar.newDate(2009, 10, 20); // Ensure double digits
var dateFormat = inst.get('dateFormat');
if (dateFormat.match(/[DM]/)) {
var findMax = function(names) {
var max = 0;... | javascript | function(elem, inst) {
if (inst.options.autoSize && !inst.inline) {
var calendar = inst.options.calendar;
var date = calendar.newDate(2009, 10, 20); // Ensure double digits
var dateFormat = inst.get('dateFormat');
if (dateFormat.match(/[DM]/)) {
var findMax = function(names) {
var max = 0;... | [
"function",
"(",
"elem",
",",
"inst",
")",
"{",
"if",
"(",
"inst",
".",
"options",
".",
"autoSize",
"&&",
"!",
"inst",
".",
"inline",
")",
"{",
"var",
"calendar",
"=",
"inst",
".",
"options",
".",
"calendar",
";",
"var",
"date",
"=",
"calendar",
".... | Apply the maximum length for the date format.
@memberof CalendarsPicker
@private
@param elem {jQuery} The control to affect.
@param inst {object} The current instance settings. | [
"Apply",
"the",
"maximum",
"length",
"for",
"the",
"date",
"format",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.picker.js#L618-L643 | |
39,488 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.picker.js | function(fns) {
var funcs = arguments;
return function(args) {
for (var i = 0; i < funcs.length; i++) {
funcs[i].apply(this, arguments);
}
};
} | javascript | function(fns) {
var funcs = arguments;
return function(args) {
for (var i = 0; i < funcs.length; i++) {
funcs[i].apply(this, arguments);
}
};
} | [
"function",
"(",
"fns",
")",
"{",
"var",
"funcs",
"=",
"arguments",
";",
"return",
"function",
"(",
"args",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"funcs",
".",
"length",
";",
"i",
"++",
")",
"{",
"funcs",
"[",
"i",
"]",
"... | Apply multiple event functions.
@memberof CalendarsPicker
@param fns {function} The functions to apply.
@example onShow: multipleEvents(fn1, fn2, ...) | [
"Apply",
"multiple",
"event",
"functions",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.picker.js#L662-L669 | |
39,489 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.picker.js | function(elem) {
elem = $(elem);
if (!elem.hasClass(this._getMarker())) {
return;
}
var inst = this._getInst(elem);
if (inst.inline) {
elem.children('.' + this._disableClass).remove().end().
find('button,select').prop('disabled', false).end().
find('a').attr('href', 'javascript:void(0)'... | javascript | function(elem) {
elem = $(elem);
if (!elem.hasClass(this._getMarker())) {
return;
}
var inst = this._getInst(elem);
if (inst.inline) {
elem.children('.' + this._disableClass).remove().end().
find('button,select').prop('disabled', false).end().
find('a').attr('href', 'javascript:void(0)'... | [
"function",
"(",
"elem",
")",
"{",
"elem",
"=",
"$",
"(",
"elem",
")",
";",
"if",
"(",
"!",
"elem",
".",
"hasClass",
"(",
"this",
".",
"_getMarker",
"(",
")",
")",
")",
"{",
"return",
";",
"}",
"var",
"inst",
"=",
"this",
".",
"_getInst",
"(",
... | Enable the control.
@memberof CalendarsPicker
@param elem {Element} The control to affect.
@example $(selector).datepick('enable') | [
"Enable",
"the",
"control",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.picker.js#L675-L693 | |
39,490 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.picker.js | function(elem) {
elem = $(elem);
if (!elem.hasClass(this._getMarker())) {
return;
}
var inst = this._getInst(elem);
if (inst.inline) {
var inline = elem.children(':last');
var offset = inline.offset();
var relOffset = {left: 0, top: 0};
inline.parents().each(function() {
if ($(th... | javascript | function(elem) {
elem = $(elem);
if (!elem.hasClass(this._getMarker())) {
return;
}
var inst = this._getInst(elem);
if (inst.inline) {
var inline = elem.children(':last');
var offset = inline.offset();
var relOffset = {left: 0, top: 0};
inline.parents().each(function() {
if ($(th... | [
"function",
"(",
"elem",
")",
"{",
"elem",
"=",
"$",
"(",
"elem",
")",
";",
"if",
"(",
"!",
"elem",
".",
"hasClass",
"(",
"this",
".",
"_getMarker",
"(",
")",
")",
")",
"{",
"return",
";",
"}",
"var",
"inst",
"=",
"this",
".",
"_getInst",
"(",
... | Disable the control.
@memberof CalendarsPicker
@param elem {Element} The control to affect.
@example $(selector).datepick('disable') | [
"Disable",
"the",
"control",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.picker.js#L699-L732 | |
39,491 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.picker.js | function(elem) {
elem = $(elem.target || elem);
var inst = plugin._getInst(elem);
if (plugin.curInst === inst) {
return;
}
if (plugin.curInst) {
plugin.hide(plugin.curInst, true);
}
if (!$.isEmptyObject(inst)) {
// Retrieve existing date(s)
inst.lastVal = null;
inst.selectedDate... | javascript | function(elem) {
elem = $(elem.target || elem);
var inst = plugin._getInst(elem);
if (plugin.curInst === inst) {
return;
}
if (plugin.curInst) {
plugin.hide(plugin.curInst, true);
}
if (!$.isEmptyObject(inst)) {
// Retrieve existing date(s)
inst.lastVal = null;
inst.selectedDate... | [
"function",
"(",
"elem",
")",
"{",
"elem",
"=",
"$",
"(",
"elem",
".",
"target",
"||",
"elem",
")",
";",
"var",
"inst",
"=",
"plugin",
".",
"_getInst",
"(",
"elem",
")",
";",
"if",
"(",
"plugin",
".",
"curInst",
"===",
"inst",
")",
"{",
"return",... | Show a popup datepicker.
@memberof CalendarsPicker
@param elem {Event|Element} a focus event or the control to use.
@example $(selector).datepick('show') | [
"Show",
"a",
"popup",
"datepicker",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.picker.js#L747-L788 | |
39,492 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.picker.js | function(inst, datesText) {
if (datesText === inst.lastVal) {
return;
}
inst.lastVal = datesText;
datesText = datesText.split(inst.options.multiSelect ? inst.options.multiSeparator :
(inst.options.rangeSelect ? inst.options.rangeSeparator : '\x00'));
var dates = [];
for (var i = 0; i < datesTe... | javascript | function(inst, datesText) {
if (datesText === inst.lastVal) {
return;
}
inst.lastVal = datesText;
datesText = datesText.split(inst.options.multiSelect ? inst.options.multiSeparator :
(inst.options.rangeSelect ? inst.options.rangeSeparator : '\x00'));
var dates = [];
for (var i = 0; i < datesTe... | [
"function",
"(",
"inst",
",",
"datesText",
")",
"{",
"if",
"(",
"datesText",
"===",
"inst",
".",
"lastVal",
")",
"{",
"return",
";",
"}",
"inst",
".",
"lastVal",
"=",
"datesText",
";",
"datesText",
"=",
"datesText",
".",
"split",
"(",
"inst",
".",
"o... | Extract possible dates from a string.
@memberof CalendarsPicker
@private
@param inst {object} The current instance settings.
@param text {string} The text to extract from.
@return {CDate[]} The extracted dates. | [
"Extract",
"possible",
"dates",
"from",
"a",
"string",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.picker.js#L796-L829 | |
39,493 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.picker.js | function(elem, hidden) {
elem = $(elem.target || elem);
var inst = plugin._getInst(elem);
if (!$.isEmptyObject(inst)) {
if (inst.inline || plugin.curInst === inst) {
if ($.isFunction(inst.options.onChangeMonthYear) && (!inst.prevDate ||
inst.prevDate.year() !== inst.drawDate.year() ||
in... | javascript | function(elem, hidden) {
elem = $(elem.target || elem);
var inst = plugin._getInst(elem);
if (!$.isEmptyObject(inst)) {
if (inst.inline || plugin.curInst === inst) {
if ($.isFunction(inst.options.onChangeMonthYear) && (!inst.prevDate ||
inst.prevDate.year() !== inst.drawDate.year() ||
in... | [
"function",
"(",
"elem",
",",
"hidden",
")",
"{",
"elem",
"=",
"$",
"(",
"elem",
".",
"target",
"||",
"elem",
")",
";",
"var",
"inst",
"=",
"plugin",
".",
"_getInst",
"(",
"elem",
")",
";",
"if",
"(",
"!",
"$",
".",
"isEmptyObject",
"(",
"inst",
... | Update the datepicker display.
@memberof CalendarsPicker
@private
@param elem {Event|Element} a focus event or the control to use.
@param hidden {boolean} <code>true</code> to initially hide the datepicker. | [
"Update",
"the",
"datepicker",
"display",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.picker.js#L836-L868 | |
39,494 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.picker.js | function(elem, keyUp) {
var inst = this._getInst(elem);
if (!$.isEmptyObject(inst)) {
var value = '';
var altValue = '';
var sep = (inst.options.multiSelect ? inst.options.multiSeparator :
inst.options.rangeSeparator);
var calendar = inst.options.calendar;
var dateFormat = inst.get('dateF... | javascript | function(elem, keyUp) {
var inst = this._getInst(elem);
if (!$.isEmptyObject(inst)) {
var value = '';
var altValue = '';
var sep = (inst.options.multiSelect ? inst.options.multiSeparator :
inst.options.rangeSeparator);
var calendar = inst.options.calendar;
var dateFormat = inst.get('dateF... | [
"function",
"(",
"elem",
",",
"keyUp",
")",
"{",
"var",
"inst",
"=",
"this",
".",
"_getInst",
"(",
"elem",
")",
";",
"if",
"(",
"!",
"$",
".",
"isEmptyObject",
"(",
"inst",
")",
")",
"{",
"var",
"value",
"=",
"''",
";",
"var",
"altValue",
"=",
... | Update the input field and any alternate field with the current dates.
@memberof CalendarsPicker
@private
@param elem {Element} The control to use.
@param keyUp {boolean} <code>true</code> if coming from <code>keyUp</code> processing (internal). | [
"Update",
"the",
"input",
"field",
"and",
"any",
"alternate",
"field",
"with",
"the",
"current",
"dates",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.picker.js#L875-L902 | |
39,495 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.picker.js | function(elem) {
var convert = function(value) {
return {thin: 1, medium: 3, thick: 5}[value] || value;
};
return [parseFloat(convert(elem.css('border-left-width'))),
parseFloat(convert(elem.css('border-top-width')))];
} | javascript | function(elem) {
var convert = function(value) {
return {thin: 1, medium: 3, thick: 5}[value] || value;
};
return [parseFloat(convert(elem.css('border-left-width'))),
parseFloat(convert(elem.css('border-top-width')))];
} | [
"function",
"(",
"elem",
")",
"{",
"var",
"convert",
"=",
"function",
"(",
"value",
")",
"{",
"return",
"{",
"thin",
":",
"1",
",",
"medium",
":",
"3",
",",
"thick",
":",
"5",
"}",
"[",
"value",
"]",
"||",
"value",
";",
"}",
";",
"return",
"[",... | Retrieve the size of left and top borders for an element.
@memberof CalendarsPicker
@private
@param elem {jQuery} The element of interest.
@return {number[]} The left and top borders. | [
"Retrieve",
"the",
"size",
"of",
"left",
"and",
"top",
"borders",
"for",
"an",
"element",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.picker.js#L909-L915 | |
39,496 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.picker.js | function(inst) {
var base = (inst.elem.is(':hidden') && inst.trigger ? inst.trigger : inst.elem);
var offset = base.offset();
var browserWidth = $(window).width();
var browserHeight = $(window).height();
if (browserWidth === 0) {
return offset;
}
var isFixed = false;
$(inst.elem).parents().e... | javascript | function(inst) {
var base = (inst.elem.is(':hidden') && inst.trigger ? inst.trigger : inst.elem);
var offset = base.offset();
var browserWidth = $(window).width();
var browserHeight = $(window).height();
if (browserWidth === 0) {
return offset;
}
var isFixed = false;
$(inst.elem).parents().e... | [
"function",
"(",
"inst",
")",
"{",
"var",
"base",
"=",
"(",
"inst",
".",
"elem",
".",
"is",
"(",
"':hidden'",
")",
"&&",
"inst",
".",
"trigger",
"?",
"inst",
".",
"trigger",
":",
"inst",
".",
"elem",
")",
";",
"var",
"offset",
"=",
"base",
".",
... | Check positioning to remain on the screen.
@memberof CalendarsPicker
@private
@param inst {object} The current instance settings.
@return {object} The updated offset for the datepicker. | [
"Check",
"positioning",
"to",
"remain",
"on",
"the",
"screen",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.picker.js#L922-L968 | |
39,497 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.picker.js | function(event) {
if (!plugin.curInst) {
return;
}
var elem = $(event.target);
if (elem.closest('.' + plugin._popupClass + ',.' + plugin._triggerClass).length === 0 &&
!elem.hasClass(plugin._getMarker())) {
plugin.hide(plugin.curInst);
}
} | javascript | function(event) {
if (!plugin.curInst) {
return;
}
var elem = $(event.target);
if (elem.closest('.' + plugin._popupClass + ',.' + plugin._triggerClass).length === 0 &&
!elem.hasClass(plugin._getMarker())) {
plugin.hide(plugin.curInst);
}
} | [
"function",
"(",
"event",
")",
"{",
"if",
"(",
"!",
"plugin",
".",
"curInst",
")",
"{",
"return",
";",
"}",
"var",
"elem",
"=",
"$",
"(",
"event",
".",
"target",
")",
";",
"if",
"(",
"elem",
".",
"closest",
"(",
"'.'",
"+",
"plugin",
".",
"_pop... | Close date picker if clicked elsewhere.
@memberof CalendarsPicker
@private
@param event {MouseEvent} The mouse click to check. | [
"Close",
"date",
"picker",
"if",
"clicked",
"elsewhere",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.picker.js#L974-L983 | |
39,498 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.picker.js | function(elem, immediate) {
if (!elem) {
return;
}
var inst = this._getInst(elem);
if ($.isEmptyObject(inst)) {
inst = elem;
}
if (inst && inst === plugin.curInst) {
var showAnim = (immediate ? '' : inst.options.showAnim);
var showSpeed = inst.options.showSpeed;
showSpeed = (showSp... | javascript | function(elem, immediate) {
if (!elem) {
return;
}
var inst = this._getInst(elem);
if ($.isEmptyObject(inst)) {
inst = elem;
}
if (inst && inst === plugin.curInst) {
var showAnim = (immediate ? '' : inst.options.showAnim);
var showSpeed = inst.options.showSpeed;
showSpeed = (showSp... | [
"function",
"(",
"elem",
",",
"immediate",
")",
"{",
"if",
"(",
"!",
"elem",
")",
"{",
"return",
";",
"}",
"var",
"inst",
"=",
"this",
".",
"_getInst",
"(",
"elem",
")",
";",
"if",
"(",
"$",
".",
"isEmptyObject",
"(",
"inst",
")",
")",
"{",
"in... | Hide a popup datepicker.
@memberof CalendarsPicker
@param elem {Element|object} The control to use or the current instance settings.
@param immediate {boolean} <code>true</code> to close immediately without animation (internal).
@example $(selector).datepick('hide') | [
"Hide",
"a",
"popup",
"datepicker",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.picker.js#L990-L1027 | |
39,499 | alexcjohnson/world-calendars | jquery-src/jquery.calendars.picker.js | function(event) {
var elem = (event.data && event.data.elem) || event.target;
var inst = plugin._getInst(elem);
var handled = false;
if (inst.inline || inst.div) {
if (event.keyCode === 9) { // Tab - close
plugin.hide(elem);
}
else if (event.keyCode === 13) { // Enter - select
plugin.s... | javascript | function(event) {
var elem = (event.data && event.data.elem) || event.target;
var inst = plugin._getInst(elem);
var handled = false;
if (inst.inline || inst.div) {
if (event.keyCode === 9) { // Tab - close
plugin.hide(elem);
}
else if (event.keyCode === 13) { // Enter - select
plugin.s... | [
"function",
"(",
"event",
")",
"{",
"var",
"elem",
"=",
"(",
"event",
".",
"data",
"&&",
"event",
".",
"data",
".",
"elem",
")",
"||",
"event",
".",
"target",
";",
"var",
"inst",
"=",
"plugin",
".",
"_getInst",
"(",
"elem",
")",
";",
"var",
"hand... | Handle keystrokes in the datepicker.
@memberof CalendarsPicker
@private
@param event {KeyEvent} The keystroke.
@return {boolean} <code>true</code> if not handled, <code>false</code> if handled. | [
"Handle",
"keystrokes",
"in",
"the",
"datepicker",
"."
] | 810693882512dec1b804456f8d435b962bd6cf31 | https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.picker.js#L1034-L1078 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.