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,200
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js
function ( buttonSet, wrapper ) { var buttonDef; for ( var i=0, iLen=buttonSet.length ; i<iLen ; i++ ) { if ( typeof buttonSet[i] == "string" ) { if ( typeof TableTools.BUTTONS[ buttonSet[i] ] == 'undefined' ) { alert( "TableTools: Warning - unknown button type: "+buttonSet[i] ); continu...
javascript
function ( buttonSet, wrapper ) { var buttonDef; for ( var i=0, iLen=buttonSet.length ; i<iLen ; i++ ) { if ( typeof buttonSet[i] == "string" ) { if ( typeof TableTools.BUTTONS[ buttonSet[i] ] == 'undefined' ) { alert( "TableTools: Warning - unknown button type: "+buttonSet[i] ); continu...
[ "function", "(", "buttonSet", ",", "wrapper", ")", "{", "var", "buttonDef", ";", "for", "(", "var", "i", "=", "0", ",", "iLen", "=", "buttonSet", ".", "length", ";", "i", "<", "iLen", ";", "i", "++", ")", "{", "if", "(", "typeof", "buttonSet", "[...
Take the user input arrays and expand them to be fully defined, and then add them to a given DOM element @method _fnButtonDefinations @param {array} buttonSet Set of user defined buttons @param {node} wrapper Node to add the created buttons to @returns void @private
[ "Take", "the", "user", "input", "arrays", "and", "expand", "them", "to", "be", "fully", "defined", "and", "then", "add", "them", "to", "a", "given", "DOM", "element" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js#L1234-L1269
39,201
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js
function ( oConfig, bCollectionButton ) { var nButton = this._fnButtonBase( oConfig, bCollectionButton ); if ( oConfig.sAction.match(/flash/) ) { if ( ! this._fnHasFlash() ) { return false; } this._fnFlashConfig( nButton, oConfig ); } else if ( oConfig.sAction == "text" ) { this._fnTextC...
javascript
function ( oConfig, bCollectionButton ) { var nButton = this._fnButtonBase( oConfig, bCollectionButton ); if ( oConfig.sAction.match(/flash/) ) { if ( ! this._fnHasFlash() ) { return false; } this._fnFlashConfig( nButton, oConfig ); } else if ( oConfig.sAction == "text" ) { this._fnTextC...
[ "function", "(", "oConfig", ",", "bCollectionButton", ")", "{", "var", "nButton", "=", "this", ".", "_fnButtonBase", "(", "oConfig", ",", "bCollectionButton", ")", ";", "if", "(", "oConfig", ".", "sAction", ".", "match", "(", "/", "flash", "/", ")", ")",...
Create and configure a TableTools button @method _fnCreateButton @param {Object} oConfig Button configuration object @returns {Node} Button element @private
[ "Create", "and", "configure", "a", "TableTools", "button" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js#L1279-L1333
39,202
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js
function ( o, bCollectionButton ) { var sTag, sLiner, sClass; if ( bCollectionButton ) { sTag = o.sTag && o.sTag !== "default" ? o.sTag : this.s.tags.collection.button; sLiner = o.sLinerTag && o.sLinerTag !== "default" ? o.sLiner : this.s.tags.collection.liner; sClass = this.classes.collection.buttons....
javascript
function ( o, bCollectionButton ) { var sTag, sLiner, sClass; if ( bCollectionButton ) { sTag = o.sTag && o.sTag !== "default" ? o.sTag : this.s.tags.collection.button; sLiner = o.sLinerTag && o.sLinerTag !== "default" ? o.sLiner : this.s.tags.collection.liner; sClass = this.classes.collection.buttons....
[ "function", "(", "o", ",", "bCollectionButton", ")", "{", "var", "sTag", ",", "sLiner", ",", "sClass", ";", "if", "(", "bCollectionButton", ")", "{", "sTag", "=", "o", ".", "sTag", "&&", "o", ".", "sTag", "!==", "\"default\"", "?", "o", ".", "sTag", ...
Create the DOM needed for the button and apply some base properties. All buttons start here @method _fnButtonBase @param {o} oConfig Button configuration object @returns {Node} DIV element for the button @private
[ "Create", "the", "DOM", "needed", "for", "the", "button", "and", "apply", "some", "base", "properties", ".", "All", "buttons", "start", "here" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js#L1343-L1373
39,203
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js
function ( nButton, oConfig ) { var that = this, oPos = $(nButton).offset(), nHidden = oConfig._collection, iDivX = oPos.left, iDivY = oPos.top + $(nButton).outerHeight(), iWinHeight = $(window).height(), iDocHeight = $(document).height(), iWinWidth = $(window).width(), iDocWidth = $(document).w...
javascript
function ( nButton, oConfig ) { var that = this, oPos = $(nButton).offset(), nHidden = oConfig._collection, iDivX = oPos.left, iDivY = oPos.top + $(nButton).outerHeight(), iWinHeight = $(window).height(), iDocHeight = $(document).height(), iWinWidth = $(window).width(), iDocWidth = $(document).w...
[ "function", "(", "nButton", ",", "oConfig", ")", "{", "var", "that", "=", "this", ",", "oPos", "=", "$", "(", "nButton", ")", ".", "offset", "(", ")", ",", "nHidden", "=", "oConfig", ".", "_collection", ",", "iDivX", "=", "oPos", ".", "left", ",", ...
Show a button collection @param {Node} nButton Button to use for the collection @param {Object} oConfig Button configuration object @returns void @private
[ "Show", "a", "button", "collection" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js#L1436-L1497
39,204
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js
function ( nButton, oConfig ) { if ( oConfig !== null && oConfig.sExtends == 'collection' ) { return; } if ( this.dom.collection.collection !== null ) { $(this.dom.collection.collection).animate({"opacity": 0}, 500, function (e) { this.style.display = "none"; } ); $(this.dom.collection.back...
javascript
function ( nButton, oConfig ) { if ( oConfig !== null && oConfig.sExtends == 'collection' ) { return; } if ( this.dom.collection.collection !== null ) { $(this.dom.collection.collection).animate({"opacity": 0}, 500, function (e) { this.style.display = "none"; } ); $(this.dom.collection.back...
[ "function", "(", "nButton", ",", "oConfig", ")", "{", "if", "(", "oConfig", "!==", "null", "&&", "oConfig", ".", "sExtends", "==", "'collection'", ")", "{", "return", ";", "}", "if", "(", "this", ".", "dom", ".", "collection", ".", "collection", "!==",...
Hide a button collection @param {Node} nButton Button to use for the collection @param {Object} oConfig Button configuration object @returns void @private
[ "Hide", "a", "button", "collection" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js#L1507-L1527
39,205
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js
function ( src ) { var out = [], pos, i, iLen; if ( src.nodeName ) { // Single node pos = this.s.dt.oInstance.fnGetPosition( src ); out.push( this.s.dt.aoData[pos] ); } else if ( typeof src.length !== 'undefined' ) { // jQuery object or an array of nodes, or aoData points for ( i=0, iLen=sr...
javascript
function ( src ) { var out = [], pos, i, iLen; if ( src.nodeName ) { // Single node pos = this.s.dt.oInstance.fnGetPosition( src ); out.push( this.s.dt.aoData[pos] ); } else if ( typeof src.length !== 'undefined' ) { // jQuery object or an array of nodes, or aoData points for ( i=0, iLen=sr...
[ "function", "(", "src", ")", "{", "var", "out", "=", "[", "]", ",", "pos", ",", "i", ",", "iLen", ";", "if", "(", "src", ".", "nodeName", ")", "{", "// Single node", "pos", "=", "this", ".", "s", ".", "dt", ".", "oInstance", ".", "fnGetPosition",...
Take a data source for row selection and convert it into aoData points for the DT @param {*} src Can be a single DOM TR node, an array of TR nodes (including a a jQuery object), a single aoData point from DataTables, an array of aoData points or an array of aoData indexes @returns {array} An array of aoData points
[ "Take", "a", "data", "source", "for", "row", "selection", "and", "convert", "it", "into", "aoData", "points", "for", "the", "DT" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js#L1780-L1823
39,206
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js
function ( nButton, oConfig ) { var that = this; var flash = new ZeroClipboard_TableTools.Client(); if ( oConfig.fnInit !== null ) { oConfig.fnInit.call( this, nButton, oConfig ); } flash.setHandCursor( true ); if ( oConfig.sAction == "flash_save" ) { flash.setAction( 'save' ); flash.setCha...
javascript
function ( nButton, oConfig ) { var that = this; var flash = new ZeroClipboard_TableTools.Client(); if ( oConfig.fnInit !== null ) { oConfig.fnInit.call( this, nButton, oConfig ); } flash.setHandCursor( true ); if ( oConfig.sAction == "flash_save" ) { flash.setAction( 'save' ); flash.setCha...
[ "function", "(", "nButton", ",", "oConfig", ")", "{", "var", "that", "=", "this", ";", "var", "flash", "=", "new", "ZeroClipboard_TableTools", ".", "Client", "(", ")", ";", "if", "(", "oConfig", ".", "fnInit", "!==", "null", ")", "{", "oConfig", ".", ...
Configure a flash based button for interaction events @method _fnFlashConfig @param {Node} nButton Button element which is being considered @param {o} oConfig Button configuration object @returns void @private
[ "Configure", "a", "flash", "based", "button", "for", "interaction", "events" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js#L1931-L1997
39,207
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js
function ( clip, sData ) { var asData = this._fnChunkData( sData, 8192 ); clip.clearText(); for ( var i=0, iLen=asData.length ; i<iLen ; i++ ) { clip.appendText( asData[i] ); } }
javascript
function ( clip, sData ) { var asData = this._fnChunkData( sData, 8192 ); clip.clearText(); for ( var i=0, iLen=asData.length ; i<iLen ; i++ ) { clip.appendText( asData[i] ); } }
[ "function", "(", "clip", ",", "sData", ")", "{", "var", "asData", "=", "this", ".", "_fnChunkData", "(", "sData", ",", "8192", ")", ";", "clip", ".", "clearText", "(", ")", ";", "for", "(", "var", "i", "=", "0", ",", "iLen", "=", "asData", ".", ...
Set the text for the flash clip to deal with This function is required for large information sets. There is a limit on the amount of data that can be transferred between Javascript and Flash in a single call, so we use this method to build up the text in Flash by sending over chunks. It is estimated that the data limi...
[ "Set", "the", "text", "for", "the", "flash", "clip", "to", "deal", "with" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js#L2042-L2051
39,208
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js
function ( sData, sBoundary, regex ) { if ( sBoundary === "" ) { return sData; } else { return sBoundary + sData.replace(regex, sBoundary+sBoundary) + sBoundary; } }
javascript
function ( sData, sBoundary, regex ) { if ( sBoundary === "" ) { return sData; } else { return sBoundary + sData.replace(regex, sBoundary+sBoundary) + sBoundary; } }
[ "function", "(", "sData", ",", "sBoundary", ",", "regex", ")", "{", "if", "(", "sBoundary", "===", "\"\"", ")", "{", "return", "sData", ";", "}", "else", "{", "return", "sBoundary", "+", "sData", ".", "replace", "(", "regex", ",", "sBoundary", "+", "...
Wrap data up with a boundary string @method _fnBoundData @param {String} sData data to bound @param {String} sBoundary bounding char(s) @param {RegExp} regex search for the bounding chars - constructed outside for efficiency in the loop @returns {String} bound data @private
[ "Wrap", "data", "up", "with", "a", "boundary", "string" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js#L2316-L2326
39,209
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js
function ( sData, iSize ) { var asReturn = []; var iStrlen = sData.length; for ( var i=0 ; i<iStrlen ; i+=iSize ) { if ( i+iSize < iStrlen ) { asReturn.push( sData.substring( i, i+iSize ) ); } else { asReturn.push( sData.substring( i, iStrlen ) ); } } return asReturn; }
javascript
function ( sData, iSize ) { var asReturn = []; var iStrlen = sData.length; for ( var i=0 ; i<iStrlen ; i+=iSize ) { if ( i+iSize < iStrlen ) { asReturn.push( sData.substring( i, i+iSize ) ); } else { asReturn.push( sData.substring( i, iStrlen ) ); } } return asReturn; }
[ "function", "(", "sData", ",", "iSize", ")", "{", "var", "asReturn", "=", "[", "]", ";", "var", "iStrlen", "=", "sData", ".", "length", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "iStrlen", ";", "i", "+=", "iSize", ")", "{", "if", ...
Break a string up into an array of smaller strings @method _fnChunkData @param {String} sData data to be broken up @param {Int} iSize chunk size @returns {Array} String array of broken up text @private
[ "Break", "a", "string", "up", "into", "an", "array", "of", "smaller", "strings" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js#L2337-L2355
39,210
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js
function ( sData ) { if ( sData.indexOf('&') === -1 ) { return sData; } var n = document.createElement('div'); return sData.replace( /&([^\s]*?);/g, function( match, match2 ) { if ( match.substr(1, 1) === '#' ) { return String.fromCharCode( Number(match2.substr(1)) ); } else { n.i...
javascript
function ( sData ) { if ( sData.indexOf('&') === -1 ) { return sData; } var n = document.createElement('div'); return sData.replace( /&([^\s]*?);/g, function( match, match2 ) { if ( match.substr(1, 1) === '#' ) { return String.fromCharCode( Number(match2.substr(1)) ); } else { n.i...
[ "function", "(", "sData", ")", "{", "if", "(", "sData", ".", "indexOf", "(", "'&'", ")", "===", "-", "1", ")", "{", "return", "sData", ";", "}", "var", "n", "=", "document", ".", "createElement", "(", "'div'", ")", ";", "return", "sData", ".", "r...
Decode HTML entities @method _fnHtmlDecode @param {String} sData encoded string @returns {String} decoded string @private
[ "Decode", "HTML", "entities" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js#L2365-L2385
39,211
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js
function ( e ) { var that = this; var oSetDT = this.s.dt; var oSetPrint = this.s.print; var oDomPrint = this.dom.print; /* Show all hidden nodes */ this._fnPrintShowNodes(); /* Restore DataTables' scrolling */ if ( oSetDT.oScroll.sX !== "" || oSetDT.oScroll.sY !== "" ) { $(this.s.dt.nTable).unbi...
javascript
function ( e ) { var that = this; var oSetDT = this.s.dt; var oSetPrint = this.s.print; var oDomPrint = this.dom.print; /* Show all hidden nodes */ this._fnPrintShowNodes(); /* Restore DataTables' scrolling */ if ( oSetDT.oScroll.sX !== "" || oSetDT.oScroll.sY !== "" ) { $(this.s.dt.nTable).unbi...
[ "function", "(", "e", ")", "{", "var", "that", "=", "this", ";", "var", "oSetDT", "=", "this", ".", "s", ".", "dt", ";", "var", "oSetPrint", "=", "this", ".", "s", ".", "print", ";", "var", "oDomPrint", "=", "this", ".", "dom", ".", "print", ";...
Printing is finished, resume normal display @method _fnPrintEnd @param {Event} e Event object @returns void @private
[ "Printing", "is", "finished", "resume", "normal", "display" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js#L2495-L2531
39,212
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js
function () { var oSetDT = this.s.dt, nScrollHeadInner = oSetDT.nScrollHead.getElementsByTagName('div')[0], nScrollHeadTable = nScrollHeadInner.getElementsByTagName('table')[0], nScrollBody = oSetDT.nTable.parentNode, nTheadSize, nTfootSize; /* Copy the header in the thead in the body table, this w...
javascript
function () { var oSetDT = this.s.dt, nScrollHeadInner = oSetDT.nScrollHead.getElementsByTagName('div')[0], nScrollHeadTable = nScrollHeadInner.getElementsByTagName('table')[0], nScrollBody = oSetDT.nTable.parentNode, nTheadSize, nTfootSize; /* Copy the header in the thead in the body table, this w...
[ "function", "(", ")", "{", "var", "oSetDT", "=", "this", ".", "s", ".", "dt", ",", "nScrollHeadInner", "=", "oSetDT", ".", "nScrollHead", ".", "getElementsByTagName", "(", "'div'", ")", "[", "0", "]", ",", "nScrollHeadTable", "=", "nScrollHeadInner", ".", ...
Take account of scrolling in DataTables by showing the full table @returns void @private
[ "Take", "account", "of", "scrolling", "in", "DataTables", "by", "showing", "the", "full", "table" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js#L2539-L2588
39,213
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js
function () { var oSetDT = this.s.dt, nScrollBody = oSetDT.nTable.parentNode; if ( oSetDT.oScroll.sX !== "" ) { nScrollBody.style.width = oSetDT.oApi._fnStringToCss( oSetDT.oScroll.sX ); nScrollBody.style.overflow = "auto"; } if ( oSetDT.oScroll.sY !== "" ) { nScrollBody.style.height = oSe...
javascript
function () { var oSetDT = this.s.dt, nScrollBody = oSetDT.nTable.parentNode; if ( oSetDT.oScroll.sX !== "" ) { nScrollBody.style.width = oSetDT.oApi._fnStringToCss( oSetDT.oScroll.sX ); nScrollBody.style.overflow = "auto"; } if ( oSetDT.oScroll.sY !== "" ) { nScrollBody.style.height = oSe...
[ "function", "(", ")", "{", "var", "oSetDT", "=", "this", ".", "s", ".", "dt", ",", "nScrollBody", "=", "oSetDT", ".", "nTable", ".", "parentNode", ";", "if", "(", "oSetDT", ".", "oScroll", ".", "sX", "!==", "\"\"", ")", "{", "nScrollBody", ".", "st...
Take account of scrolling in DataTables by showing the full table. Note that the redraw of the DataTable that we do will actually deal with the majority of the hard work here @returns void @private
[ "Take", "account", "of", "scrolling", "in", "DataTables", "by", "showing", "the", "full", "table", ".", "Note", "that", "the", "redraw", "of", "the", "DataTable", "that", "we", "do", "will", "actually", "deal", "with", "the", "majority", "of", "the", "hard...
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js#L2597-L2614
39,214
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js
function ( ) { var anHidden = this.dom.print.hidden; for ( var i=0, iLen=anHidden.length ; i<iLen ; i++ ) { anHidden[i].node.style.display = anHidden[i].display; } anHidden.splice( 0, anHidden.length ); }
javascript
function ( ) { var anHidden = this.dom.print.hidden; for ( var i=0, iLen=anHidden.length ; i<iLen ; i++ ) { anHidden[i].node.style.display = anHidden[i].display; } anHidden.splice( 0, anHidden.length ); }
[ "function", "(", ")", "{", "var", "anHidden", "=", "this", ".", "dom", ".", "print", ".", "hidden", ";", "for", "(", "var", "i", "=", "0", ",", "iLen", "=", "anHidden", ".", "length", ";", "i", "<", "iLen", ";", "i", "++", ")", "{", "anHidden",...
Resume the display of all TableTools hidden nodes @method _fnPrintShowNodes @returns void @private
[ "Resume", "the", "display", "of", "all", "TableTools", "hidden", "nodes" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js#L2623-L2632
39,215
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js
function ( nNode ) { var anHidden = this.dom.print.hidden; var nParent = nNode.parentNode; var nChildren = nParent.childNodes; for ( var i=0, iLen=nChildren.length ; i<iLen ; i++ ) { if ( nChildren[i] != nNode && nChildren[i].nodeType == 1 ) { /* If our node is shown (don't want to show nodes whic...
javascript
function ( nNode ) { var anHidden = this.dom.print.hidden; var nParent = nNode.parentNode; var nChildren = nParent.childNodes; for ( var i=0, iLen=nChildren.length ; i<iLen ; i++ ) { if ( nChildren[i] != nNode && nChildren[i].nodeType == 1 ) { /* If our node is shown (don't want to show nodes whic...
[ "function", "(", "nNode", ")", "{", "var", "anHidden", "=", "this", ".", "dom", ".", "print", ".", "hidden", ";", "var", "nParent", "=", "nNode", ".", "parentNode", ";", "var", "nChildren", "=", "nParent", ".", "childNodes", ";", "for", "(", "var", "...
Hide nodes which are not needed in order to display the table. Note that this function is recursive @method _fnPrintHideNodes @param {Node} nNode Element which should be showing in a 'print' display @returns void @private
[ "Hide", "nodes", "which", "are", "not", "needed", "in", "order", "to", "display", "the", "table", ".", "Note", "that", "this", "function", "is", "recursive" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/TableTools/js/dataTables.tableTools.js#L2643-L2671
39,216
lemonde/knex-schema
lib/populate.js
populate
function populate(schemas) { var resolver = new Resolver(schemas); // Reduce force sequential execution. return Promise.reduce(resolver.resolve(), populateSchema.bind(this), []); }
javascript
function populate(schemas) { var resolver = new Resolver(schemas); // Reduce force sequential execution. return Promise.reduce(resolver.resolve(), populateSchema.bind(this), []); }
[ "function", "populate", "(", "schemas", ")", "{", "var", "resolver", "=", "new", "Resolver", "(", "schemas", ")", ";", "// Reduce force sequential execution.", "return", "Promise", ".", "reduce", "(", "resolver", ".", "resolve", "(", ")", ",", "populateSchema", ...
Populate schemas tables with schemas data. @param {[Schemas]} schemas @return {Promise}
[ "Populate", "schemas", "tables", "with", "schemas", "data", "." ]
3e0f6cde374d240552eb08e50e123a513fda44ae
https://github.com/lemonde/knex-schema/blob/3e0f6cde374d240552eb08e50e123a513fda44ae/lib/populate.js#L19-L23
39,217
lemonde/knex-schema
lib/populate.js
populateSchema
function populateSchema(result, schema) { var knex = this.knex; return knex.schema.hasTable(schema.tableName) .then(function (exists) { if (! exists || ! schema.populate) return result; return schema.populate(knex) .then(function () { return result.concat([schema]); }); }); }
javascript
function populateSchema(result, schema) { var knex = this.knex; return knex.schema.hasTable(schema.tableName) .then(function (exists) { if (! exists || ! schema.populate) return result; return schema.populate(knex) .then(function () { return result.concat([schema]); }); }); }
[ "function", "populateSchema", "(", "result", ",", "schema", ")", "{", "var", "knex", "=", "this", ".", "knex", ";", "return", "knex", ".", "schema", ".", "hasTable", "(", "schema", ".", "tableName", ")", ".", "then", "(", "function", "(", "exists", ")"...
Populate schema table with schema data. @param {[Schema]} result - reduce accumulator @param {Schema} schema @return {Promise}
[ "Populate", "schema", "table", "with", "schema", "data", "." ]
3e0f6cde374d240552eb08e50e123a513fda44ae
https://github.com/lemonde/knex-schema/blob/3e0f6cde374d240552eb08e50e123a513fda44ae/lib/populate.js#L33-L43
39,218
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/FixedColumns/js/dataTables.fixedColumns.js
function () { var oGrid = this.dom.grid; var iWidth = $(oGrid.wrapper).width(); var iBodyHeight = $(this.s.dt.nTable.parentNode).outerHeight(); var iFullHeight = $(this.s.dt.nTable.parentNode.parentNode).outerHeight(); var oOverflow = this._fnDTOverflow(); var iLeftWidth = this.s.iLeftWidth, iRightWi...
javascript
function () { var oGrid = this.dom.grid; var iWidth = $(oGrid.wrapper).width(); var iBodyHeight = $(this.s.dt.nTable.parentNode).outerHeight(); var iFullHeight = $(this.s.dt.nTable.parentNode.parentNode).outerHeight(); var oOverflow = this._fnDTOverflow(); var iLeftWidth = this.s.iLeftWidth, iRightWi...
[ "function", "(", ")", "{", "var", "oGrid", "=", "this", ".", "dom", ".", "grid", ";", "var", "iWidth", "=", "$", "(", "oGrid", ".", "wrapper", ")", ".", "width", "(", ")", ";", "var", "iBodyHeight", "=", "$", "(", "this", ".", "s", ".", "dt", ...
Style and position the grid used for the FixedColumns layout @returns {void} @private
[ "Style", "and", "position", "the", "grid", "used", "for", "the", "FixedColumns", "layout" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/FixedColumns/js/dataTables.fixedColumns.js#L740-L807
39,219
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/FixedColumns/js/dataTables.fixedColumns.js
function () { var nTable = this.s.dt.nTable; var nTableScrollBody = nTable.parentNode; var out = { "x": false, "y": false, "bar": this.s.dt.oScroll.iBarWidth }; if ( nTable.offsetWidth > nTableScrollBody.clientWidth ) { out.x = true; } if ( nTable.offsetHeight > nTableScrollBody.clientHei...
javascript
function () { var nTable = this.s.dt.nTable; var nTableScrollBody = nTable.parentNode; var out = { "x": false, "y": false, "bar": this.s.dt.oScroll.iBarWidth }; if ( nTable.offsetWidth > nTableScrollBody.clientWidth ) { out.x = true; } if ( nTable.offsetHeight > nTableScrollBody.clientHei...
[ "function", "(", ")", "{", "var", "nTable", "=", "this", ".", "s", ".", "dt", ".", "nTable", ";", "var", "nTableScrollBody", "=", "nTable", ".", "parentNode", ";", "var", "out", "=", "{", "\"x\"", ":", "false", ",", "\"y\"", ":", "false", ",", "\"b...
Get information about the DataTable's scrolling state - specifically if the table is scrolling on either the x or y axis, and also the scrollbar width. @returns {object} Information about the DataTables scrolling state with the properties: 'x', 'y' and 'bar' @private
[ "Get", "information", "about", "the", "DataTable", "s", "scrolling", "state", "-", "specifically", "if", "the", "table", "is", "scrolling", "on", "either", "the", "x", "or", "y", "axis", "and", "also", "the", "scrollbar", "width", "." ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/FixedColumns/js/dataTables.fixedColumns.js#L817-L838
39,220
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/FixedColumns/js/dataTables.fixedColumns.js
function ( bAll ) { this._fnGridLayout(); this._fnCloneLeft( bAll ); this._fnCloneRight( bAll ); /* Draw callback function */ if ( this.s.fnDrawCallback !== null ) { this.s.fnDrawCallback.call( this, this.dom.clone.left, this.dom.clone.right ); } /* Event triggering */ $(this).trigger( 'draw.dtf...
javascript
function ( bAll ) { this._fnGridLayout(); this._fnCloneLeft( bAll ); this._fnCloneRight( bAll ); /* Draw callback function */ if ( this.s.fnDrawCallback !== null ) { this.s.fnDrawCallback.call( this, this.dom.clone.left, this.dom.clone.right ); } /* Event triggering */ $(this).trigger( 'draw.dtf...
[ "function", "(", "bAll", ")", "{", "this", ".", "_fnGridLayout", "(", ")", ";", "this", ".", "_fnCloneLeft", "(", "bAll", ")", ";", "this", ".", "_fnCloneRight", "(", "bAll", ")", ";", "/* Draw callback function */", "if", "(", "this", ".", "s", ".", "...
Clone and position the fixed columns @returns {void} @param {Boolean} bAll Indicate if the header and footer should be updated as well (true) @private
[ "Clone", "and", "position", "the", "fixed", "columns" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/FixedColumns/js/dataTables.fixedColumns.js#L847-L864
39,221
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/FixedColumns/js/dataTables.fixedColumns.js
function ( bAll ) { if ( this.s.iRightColumns <= 0 ) { return; } var that = this, i, jq, aiColumns = []; for ( i=this.s.iTableColumns-this.s.iRightColumns ; i<this.s.iTableColumns ; i++ ) { if ( this.s.dt.aoColumns[i].bVisible ) { aiColumns.push( i ); } } this._fnClone( this.dom.clone...
javascript
function ( bAll ) { if ( this.s.iRightColumns <= 0 ) { return; } var that = this, i, jq, aiColumns = []; for ( i=this.s.iTableColumns-this.s.iRightColumns ; i<this.s.iTableColumns ; i++ ) { if ( this.s.dt.aoColumns[i].bVisible ) { aiColumns.push( i ); } } this._fnClone( this.dom.clone...
[ "function", "(", "bAll", ")", "{", "if", "(", "this", ".", "s", ".", "iRightColumns", "<=", "0", ")", "{", "return", ";", "}", "var", "that", "=", "this", ",", "i", ",", "jq", ",", "aiColumns", "=", "[", "]", ";", "for", "(", "i", "=", "this"...
Clone the right columns @returns {void} @param {Boolean} bAll Indicate if the header and footer should be updated as well (true) @private
[ "Clone", "the", "right", "columns" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/FixedColumns/js/dataTables.fixedColumns.js#L873-L890
39,222
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/FixedColumns/js/dataTables.fixedColumns.js
function ( bAll ) { if ( this.s.iLeftColumns <= 0 ) { return; } var that = this, i, jq, aiColumns = []; for ( i=0 ; i<this.s.iLeftColumns ; i++ ) { if ( this.s.dt.aoColumns[i].bVisible ) { aiColumns.push( i ); } } this._fnClone( this.dom.clone.left, this.dom.grid.left, aiColumns, bAll...
javascript
function ( bAll ) { if ( this.s.iLeftColumns <= 0 ) { return; } var that = this, i, jq, aiColumns = []; for ( i=0 ; i<this.s.iLeftColumns ; i++ ) { if ( this.s.dt.aoColumns[i].bVisible ) { aiColumns.push( i ); } } this._fnClone( this.dom.clone.left, this.dom.grid.left, aiColumns, bAll...
[ "function", "(", "bAll", ")", "{", "if", "(", "this", ".", "s", ".", "iLeftColumns", "<=", "0", ")", "{", "return", ";", "}", "var", "that", "=", "this", ",", "i", ",", "jq", ",", "aiColumns", "=", "[", "]", ";", "for", "(", "i", "=", "0", ...
Clone the left columns @returns {void} @param {Boolean} bAll Indicate if the header and footer should be updated as well (true) @private
[ "Clone", "the", "left", "columns" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/FixedColumns/js/dataTables.fixedColumns.js#L899-L916
39,223
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/FixedColumns/js/dataTables.fixedColumns.js
function ( aoOriginal, aiColumns ) { var aReturn = []; var aClones = []; var aCloned = []; for ( var i=0, iLen=aoOriginal.length ; i<iLen ; i++ ) { var aRow = []; aRow.nTr = $(aoOriginal[i].nTr).clone(true, true)[0]; for ( var j=0, jLen=this.s.iTableColumns ; j<jLen ; j++ ) { if ( $.inArray...
javascript
function ( aoOriginal, aiColumns ) { var aReturn = []; var aClones = []; var aCloned = []; for ( var i=0, iLen=aoOriginal.length ; i<iLen ; i++ ) { var aRow = []; aRow.nTr = $(aoOriginal[i].nTr).clone(true, true)[0]; for ( var j=0, jLen=this.s.iTableColumns ; j<jLen ; j++ ) { if ( $.inArray...
[ "function", "(", "aoOriginal", ",", "aiColumns", ")", "{", "var", "aReturn", "=", "[", "]", ";", "var", "aClones", "=", "[", "]", ";", "var", "aCloned", "=", "[", "]", ";", "for", "(", "var", "i", "=", "0", ",", "iLen", "=", "aoOriginal", ".", ...
Make a copy of the layout object for a header or footer element from DataTables. Note that this method will clone the nodes in the layout object. @returns {Array} Copy of the layout array @param {Object} aoOriginal Layout array from DataTables (aoHeader or aoFooter) @param {Object} aiColumns Columns to copy @privat...
[ "Make", "a", "copy", "of", "the", "layout", "object", "for", "a", "header", "or", "footer", "element", "from", "DataTables", ".", "Note", "that", "this", "method", "will", "clone", "the", "nodes", "in", "the", "layout", "object", "." ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/FixedColumns/js/dataTables.fixedColumns.js#L927-L970
39,224
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/FixedColumns/js/dataTables.fixedColumns.js
function ( nodeName, original, clone ) { if ( this.s.sHeightMatch == 'none' && nodeName !== 'thead' && nodeName !== 'tfoot' ) { return; } var that = this, i, iLen, iHeight, iHeight2, iHeightOriginal, iHeightClone, rootOriginal = original.getElementsByTagName(nodeName)[0], rootClone = clone.getE...
javascript
function ( nodeName, original, clone ) { if ( this.s.sHeightMatch == 'none' && nodeName !== 'thead' && nodeName !== 'tfoot' ) { return; } var that = this, i, iLen, iHeight, iHeight2, iHeightOriginal, iHeightClone, rootOriginal = original.getElementsByTagName(nodeName)[0], rootClone = clone.getE...
[ "function", "(", "nodeName", ",", "original", ",", "clone", ")", "{", "if", "(", "this", ".", "s", ".", "sHeightMatch", "==", "'none'", "&&", "nodeName", "!==", "'thead'", "&&", "nodeName", "!==", "'tfoot'", ")", "{", "return", ";", "}", "var", "that",...
Equalise the heights of the rows in a given table node in a cross browser way @returns {void} @param {String} nodeName Node type - thead, tbody or tfoot @param {Node} original Original node to take the heights from @param {Node} clone Copy the heights to @private
[ "Equalise", "the", "heights", "of", "the", "rows", "in", "a", "given", "table", "node", "in", "a", "cross", "browser", "way" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/FixedColumns/js/dataTables.fixedColumns.js#L1246-L1282
39,225
tmcw-up-for-adoption/color-ops
index.js
function(r, g, b, a) { var rgb = [r, g, b].map(function (c) { return number(c); }); a = number(a); if (rgb.some(isNaN) || isNaN(a)) return null; rgb.push(a); return rgb; }
javascript
function(r, g, b, a) { var rgb = [r, g, b].map(function (c) { return number(c); }); a = number(a); if (rgb.some(isNaN) || isNaN(a)) return null; rgb.push(a); return rgb; }
[ "function", "(", "r", ",", "g", ",", "b", ",", "a", ")", "{", "var", "rgb", "=", "[", "r", ",", "g", ",", "b", "]", ".", "map", "(", "function", "(", "c", ")", "{", "return", "number", "(", "c", ")", ";", "}", ")", ";", "a", "=", "numbe...
Given an rgba color as number-like objects, return that array with numbers if possible, and null otherwise @param {number} r red @param {number} g green @param {number} b blue @param {number} a alpha @returns {Array} rgba array
[ "Given", "an", "rgba", "color", "as", "number", "-", "like", "objects", "return", "that", "array", "with", "numbers", "if", "possible", "and", "null", "otherwise" ]
eaa5b1ec2f679ac0ce850dc193621ff17fbf26da
https://github.com/tmcw-up-for-adoption/color-ops/blob/eaa5b1ec2f679ac0ce850dc193621ff17fbf26da/index.js#L52-L58
39,226
tmcw-up-for-adoption/color-ops
index.js
function(h, s, l, a) { h = (number(h) % 360) / 360; s = number(s); l = number(l); a = number(a); if ([h, s, l, a].some(isNaN)) return null; var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s, m1 = l * 2 - m2; return this.rgba(hue(h + 1 / 3) * 255, hue(h) * 255, hue(h - 1 / 3) * 255, ...
javascript
function(h, s, l, a) { h = (number(h) % 360) / 360; s = number(s); l = number(l); a = number(a); if ([h, s, l, a].some(isNaN)) return null; var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s, m1 = l * 2 - m2; return this.rgba(hue(h + 1 / 3) * 255, hue(h) * 255, hue(h - 1 / 3) * 255, ...
[ "function", "(", "h", ",", "s", ",", "l", ",", "a", ")", "{", "h", "=", "(", "number", "(", "h", ")", "%", "360", ")", "/", "360", ";", "s", "=", "number", "(", "s", ")", ";", "l", "=", "number", "(", "l", ")", ";", "a", "=", "number", ...
Given an HSL color as components, return an RGBA array @param {number} h hue @param {number} s saturation @param {number} l luminosity @param {number} a alpha @returns {Array} rgba color
[ "Given", "an", "HSL", "color", "as", "components", "return", "an", "RGBA", "array" ]
eaa5b1ec2f679ac0ce850dc193621ff17fbf26da
https://github.com/tmcw-up-for-adoption/color-ops/blob/eaa5b1ec2f679ac0ce850dc193621ff17fbf26da/index.js#L79-L99
39,227
tmcw-up-for-adoption/color-ops
index.js
function(color, amount) { var hsl = this.toHSL(color); hsl.s += amount / 100; hsl.s = clamp(hsl.s); return hsla(hsl); }
javascript
function(color, amount) { var hsl = this.toHSL(color); hsl.s += amount / 100; hsl.s = clamp(hsl.s); return hsla(hsl); }
[ "function", "(", "color", ",", "amount", ")", "{", "var", "hsl", "=", "this", ".", "toHSL", "(", "color", ")", ";", "hsl", ".", "s", "+=", "amount", "/", "100", ";", "hsl", ".", "s", "=", "clamp", "(", "hsl", ".", "s", ")", ";", "return", "hs...
Saturate or desaturate a color by a given amount @param {Color} color @param {Number} amount @returns {Color} color
[ "Saturate", "or", "desaturate", "a", "color", "by", "a", "given", "amount" ]
eaa5b1ec2f679ac0ce850dc193621ff17fbf26da
https://github.com/tmcw-up-for-adoption/color-ops/blob/eaa5b1ec2f679ac0ce850dc193621ff17fbf26da/index.js#L145-L151
39,228
tmcw-up-for-adoption/color-ops
index.js
function(color, amount) { var hsl = this.toHSL(color); hsl.l += amount / 100; hsl.l = clamp(hsl.l); return hsla(hsl); }
javascript
function(color, amount) { var hsl = this.toHSL(color); hsl.l += amount / 100; hsl.l = clamp(hsl.l); return hsla(hsl); }
[ "function", "(", "color", ",", "amount", ")", "{", "var", "hsl", "=", "this", ".", "toHSL", "(", "color", ")", ";", "hsl", ".", "l", "+=", "amount", "/", "100", ";", "hsl", ".", "l", "=", "clamp", "(", "hsl", ".", "l", ")", ";", "return", "hs...
Lighten or darken a color by a given amount @param {Color} color @param {Number} amount @returns {Color} color
[ "Lighten", "or", "darken", "a", "color", "by", "a", "given", "amount" ]
eaa5b1ec2f679ac0ce850dc193621ff17fbf26da
https://github.com/tmcw-up-for-adoption/color-ops/blob/eaa5b1ec2f679ac0ce850dc193621ff17fbf26da/index.js#L159-L165
39,229
tmcw-up-for-adoption/color-ops
index.js
function(color1, color2, amount) { var p = amount / 100.0; var w = p * 2 - 1; var hsl1 = this.toHSL(color1); var hsl2 = this.toHSL(color2); var a = hsl1.a - hsl2.a; var w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0; var w2 = 1 - w1; var rgb = [ color1[0] * w1 + c...
javascript
function(color1, color2, amount) { var p = amount / 100.0; var w = p * 2 - 1; var hsl1 = this.toHSL(color1); var hsl2 = this.toHSL(color2); var a = hsl1.a - hsl2.a; var w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0; var w2 = 1 - w1; var rgb = [ color1[0] * w1 + c...
[ "function", "(", "color1", ",", "color2", ",", "amount", ")", "{", "var", "p", "=", "amount", "/", "100.0", ";", "var", "w", "=", "p", "*", "2", "-", "1", ";", "var", "hsl1", "=", "this", ".", "toHSL", "(", "color1", ")", ";", "var", "hsl2", ...
Mix two colors. @param {Color} color1 @param {Color} color2 @param {Number} degrees @returns {Color} output
[ "Mix", "two", "colors", "." ]
eaa5b1ec2f679ac0ce850dc193621ff17fbf26da
https://github.com/tmcw-up-for-adoption/color-ops/blob/eaa5b1ec2f679ac0ce850dc193621ff17fbf26da/index.js#L200-L219
39,230
chrisJohn404/ljswitchboard-ljm_device_curator
lib/device_value_checker.js
reportResult
function reportResult(devRes, scriptRes, method) { debug('in performRetry', devRes, scriptRes, method); var returnData = { 'numAttempts': context.currentAttempt, 'maxAttempts': context.maxAttempts, // 'startTime': new Date(), // 'finishTime': new Date(), 'scriptRes': scrip...
javascript
function reportResult(devRes, scriptRes, method) { debug('in performRetry', devRes, scriptRes, method); var returnData = { 'numAttempts': context.currentAttempt, 'maxAttempts': context.maxAttempts, // 'startTime': new Date(), // 'finishTime': new Date(), 'scriptRes': scrip...
[ "function", "reportResult", "(", "devRes", ",", "scriptRes", ",", "method", ")", "{", "debug", "(", "'in performRetry'", ",", "devRes", ",", "scriptRes", ",", "method", ")", ";", "var", "returnData", "=", "{", "'numAttempts'", ":", "context", ".", "currentAt...
This function reports data when the value-checking has completed.
[ "This", "function", "reports", "data", "when", "the", "value", "-", "checking", "has", "completed", "." ]
36cb25645dfa0a68e906d5ec43e5514391947257
https://github.com/chrisJohn404/ljswitchboard-ljm_device_curator/blob/36cb25645dfa0a68e906d5ec43e5514391947257/lib/device_value_checker.js#L39-L56
39,231
chrisJohn404/ljswitchboard-ljm_device_curator
lib/device_value_checker.js
performRetry
function performRetry(devRes, scriptRes) { var currentAttempt = context.currentAttempt; var maxAttempts = context.maxAttempts; var delay = context.delay; debug('in performRetry', currentAttempt, maxAttempts, delay); if(currentAttempt < maxAttempts) { context.currentAttempt += 1; setTi...
javascript
function performRetry(devRes, scriptRes) { var currentAttempt = context.currentAttempt; var maxAttempts = context.maxAttempts; var delay = context.delay; debug('in performRetry', currentAttempt, maxAttempts, delay); if(currentAttempt < maxAttempts) { context.currentAttempt += 1; setTi...
[ "function", "performRetry", "(", "devRes", ",", "scriptRes", ")", "{", "var", "currentAttempt", "=", "context", ".", "currentAttempt", ";", "var", "maxAttempts", "=", "context", ".", "maxAttempts", ";", "var", "delay", "=", "context", ".", "delay", ";", "deb...
This function performs the re-try logic. It re-attempts a read or reports the results.
[ "This", "function", "performs", "the", "re", "-", "try", "logic", ".", "It", "re", "-", "attempts", "a", "read", "or", "reports", "the", "results", "." ]
36cb25645dfa0a68e906d5ec43e5514391947257
https://github.com/chrisJohn404/ljswitchboard-ljm_device_curator/blob/36cb25645dfa0a68e906d5ec43e5514391947257/lib/device_value_checker.js#L61-L76
39,232
theetrain/gulp-resource-hints
lib/helpers.js
urlMatch
function urlMatch (asset, pattern) { var multi = pattern.split(',') var re if (multi.length > 1) { for (var i = 0, len = multi.length; i < len; i++) { re = new RegExp(multi[i].replace(/([.?+^$[\]\\(){}|/-])/g, '\\$1').replace(/\*/g, '.*')) if (re.test(asset)) { return true } } ...
javascript
function urlMatch (asset, pattern) { var multi = pattern.split(',') var re if (multi.length > 1) { for (var i = 0, len = multi.length; i < len; i++) { re = new RegExp(multi[i].replace(/([.?+^$[\]\\(){}|/-])/g, '\\$1').replace(/\*/g, '.*')) if (re.test(asset)) { return true } } ...
[ "function", "urlMatch", "(", "asset", ",", "pattern", ")", "{", "var", "multi", "=", "pattern", ".", "split", "(", "','", ")", "var", "re", "if", "(", "multi", ".", "length", ">", "1", ")", "{", "for", "(", "var", "i", "=", "0", ",", "len", "="...
Determines if url matches glob pattern
[ "Determines", "if", "url", "matches", "glob", "pattern" ]
12a01e42b35ed07ddef80bddf07e21a69f2138f4
https://github.com/theetrain/gulp-resource-hints/blob/12a01e42b35ed07ddef80bddf07e21a69f2138f4/lib/helpers.js#L27-L43
39,233
theetrain/gulp-resource-hints
lib/helpers.js
isDuplicate
function isDuplicate (assetToCheck, isHost) { if (parsedAssets.length <= 0) { return false } return ~parsedAssets.findIndex(function (asset) { if (isHost) { // We don't want to preconnect twice, eh? return asset.split('//')[1] === assetToCheck.split('//')[1] } return asset === assetTo...
javascript
function isDuplicate (assetToCheck, isHost) { if (parsedAssets.length <= 0) { return false } return ~parsedAssets.findIndex(function (asset) { if (isHost) { // We don't want to preconnect twice, eh? return asset.split('//')[1] === assetToCheck.split('//')[1] } return asset === assetTo...
[ "function", "isDuplicate", "(", "assetToCheck", ",", "isHost", ")", "{", "if", "(", "parsedAssets", ".", "length", "<=", "0", ")", "{", "return", "false", "}", "return", "~", "parsedAssets", ".", "findIndex", "(", "function", "(", "asset", ")", "{", "if"...
Checking duplicates is necessary for dns-prefetch and prefetch resource hints since the same web page could have multiple assets from the same external host, but we only want to dns-prefetch an external host once. Check for duplicates in parsedAssets helper array @param {string} assetToCheck @param {boolean} isHost
[ "Checking", "duplicates", "is", "necessary", "for", "dns", "-", "prefetch", "and", "prefetch", "resource", "hints", "since", "the", "same", "web", "page", "could", "have", "multiple", "assets", "from", "the", "same", "external", "host", "but", "we", "only", ...
12a01e42b35ed07ddef80bddf07e21a69f2138f4
https://github.com/theetrain/gulp-resource-hints/blob/12a01e42b35ed07ddef80bddf07e21a69f2138f4/lib/helpers.js#L73-L84
39,234
theetrain/gulp-resource-hints
lib/helpers.js
logger
function logger (message, warn) { if (appOptions.silent) { return } if (warn) { console.warn(message) return } console.log(message) }
javascript
function logger (message, warn) { if (appOptions.silent) { return } if (warn) { console.warn(message) return } console.log(message) }
[ "function", "logger", "(", "message", ",", "warn", ")", "{", "if", "(", "appOptions", ".", "silent", ")", "{", "return", "}", "if", "(", "warn", ")", "{", "console", ".", "warn", "(", "message", ")", "return", "}", "console", ".", "log", "(", "mess...
Log to the console unless user opts out @param {string} message @param {boolean} warn
[ "Log", "to", "the", "console", "unless", "user", "opts", "out" ]
12a01e42b35ed07ddef80bddf07e21a69f2138f4
https://github.com/theetrain/gulp-resource-hints/blob/12a01e42b35ed07ddef80bddf07e21a69f2138f4/lib/helpers.js#L100-L110
39,235
theetrain/gulp-resource-hints
lib/helpers.js
hasInsertionPoint
function hasInsertionPoint (file) { var token = appOptions.pageToken if (token !== '' && String(file.contents).indexOf(token) > -1) { insertionPoint = 'token' return true } else if (token !== '' && token !== defaults.pageToken) { logger('Token not found in ' + file.relative) } var soup = new Sou...
javascript
function hasInsertionPoint (file) { var token = appOptions.pageToken if (token !== '' && String(file.contents).indexOf(token) > -1) { insertionPoint = 'token' return true } else if (token !== '' && token !== defaults.pageToken) { logger('Token not found in ' + file.relative) } var soup = new Sou...
[ "function", "hasInsertionPoint", "(", "file", ")", "{", "var", "token", "=", "appOptions", ".", "pageToken", "if", "(", "token", "!==", "''", "&&", "String", "(", "file", ".", "contents", ")", ".", "indexOf", "(", "token", ")", ">", "-", "1", ")", "{...
Determine if file has a valid area to inject resource hints @param {stream} file
[ "Determine", "if", "file", "has", "a", "valid", "area", "to", "inject", "resource", "hints" ]
12a01e42b35ed07ddef80bddf07e21a69f2138f4
https://github.com/theetrain/gulp-resource-hints/blob/12a01e42b35ed07ddef80bddf07e21a69f2138f4/lib/helpers.js#L117-L162
39,236
theetrain/gulp-resource-hints
lib/helpers.js
buildResourceHint
function buildResourceHint (hint, asset, glob) { var as = '' if (hint === 'dns-prefetch' || hint === 'preconnect') { if (!urlMatch(asset, glob)) { return '' } asset = urlParse(asset) if (isDuplicate(asset, true)) { return '' } } else { if (!minimatch(asset, glob) || isDuplica...
javascript
function buildResourceHint (hint, asset, glob) { var as = '' if (hint === 'dns-prefetch' || hint === 'preconnect') { if (!urlMatch(asset, glob)) { return '' } asset = urlParse(asset) if (isDuplicate(asset, true)) { return '' } } else { if (!minimatch(asset, glob) || isDuplica...
[ "function", "buildResourceHint", "(", "hint", ",", "asset", ",", "glob", ")", "{", "var", "as", "=", "''", "if", "(", "hint", "===", "'dns-prefetch'", "||", "hint", "===", "'preconnect'", ")", "{", "if", "(", "!", "urlMatch", "(", "asset", ",", "glob",...
Validate asset is desireable by user Build resource hint if so @param {string} hint @param {string} asset @param {string} glob @return {string}
[ "Validate", "asset", "is", "desireable", "by", "user", "Build", "resource", "hint", "if", "so" ]
12a01e42b35ed07ddef80bddf07e21a69f2138f4
https://github.com/theetrain/gulp-resource-hints/blob/12a01e42b35ed07ddef80bddf07e21a69f2138f4/lib/helpers.js#L173-L198
39,237
theetrain/gulp-resource-hints
lib/helpers.js
options
function options (userOpts) { if (appLoaded && typeof userOpts === 'undefined') { return appOptions } userOpts = typeof userOpts === 'object' ? userOpts : {} appOptions = Object.assign({}, defaults, userOpts) appOptions.paths = Object.assign({}, defaults.paths, userOpts.paths) appLoaded = true return...
javascript
function options (userOpts) { if (appLoaded && typeof userOpts === 'undefined') { return appOptions } userOpts = typeof userOpts === 'object' ? userOpts : {} appOptions = Object.assign({}, defaults, userOpts) appOptions.paths = Object.assign({}, defaults.paths, userOpts.paths) appLoaded = true return...
[ "function", "options", "(", "userOpts", ")", "{", "if", "(", "appLoaded", "&&", "typeof", "userOpts", "===", "'undefined'", ")", "{", "return", "appOptions", "}", "userOpts", "=", "typeof", "userOpts", "===", "'object'", "?", "userOpts", ":", "{", "}", "ap...
Merge user options with defaults @param {object} userOpts @return {object}
[ "Merge", "user", "options", "with", "defaults" ]
12a01e42b35ed07ddef80bddf07e21a69f2138f4
https://github.com/theetrain/gulp-resource-hints/blob/12a01e42b35ed07ddef80bddf07e21a69f2138f4/lib/helpers.js#L206-L216
39,238
theetrain/gulp-resource-hints
lib/helpers.js
writeDataToFile
function writeDataToFile (file, data, token) { // insertionPoint was set in hasInsertionPoint(), so we can assume it is safe to write to file var selectors = [ 'head > meta:last-of-type', 'head > link:first-of-type', 'head' ] var selectorIndex = 0 switch (insertionPoint) { case 'meta': ...
javascript
function writeDataToFile (file, data, token) { // insertionPoint was set in hasInsertionPoint(), so we can assume it is safe to write to file var selectors = [ 'head > meta:last-of-type', 'head > link:first-of-type', 'head' ] var selectorIndex = 0 switch (insertionPoint) { case 'meta': ...
[ "function", "writeDataToFile", "(", "file", ",", "data", ",", "token", ")", "{", "// insertionPoint was set in hasInsertionPoint(), so we can assume it is safe to write to file", "var", "selectors", "=", "[", "'head > meta:last-of-type'", ",", "'head > link:first-of-type'", ",", ...
Write resource hints to file @param {stream} file @param {string} data @param {string} token @return {string}
[ "Write", "resource", "hints", "to", "file" ]
12a01e42b35ed07ddef80bddf07e21a69f2138f4
https://github.com/theetrain/gulp-resource-hints/blob/12a01e42b35ed07ddef80bddf07e21a69f2138f4/lib/helpers.js#L226-L263
39,239
sbyrnes/classify.js
classify.js
function() { this.numTrainingExamples = 0; this.groupFrequencyCount = new Object(); this.numWords = 0; this.wordFrequencyCount = new Object(); this.groupWordTotal = new Object(); this.groupWordFrequencyCount = new Object(); }
javascript
function() { this.numTrainingExamples = 0; this.groupFrequencyCount = new Object(); this.numWords = 0; this.wordFrequencyCount = new Object(); this.groupWordTotal = new Object(); this.groupWordFrequencyCount = new Object(); }
[ "function", "(", ")", "{", "this", ".", "numTrainingExamples", "=", "0", ";", "this", ".", "groupFrequencyCount", "=", "new", "Object", "(", ")", ";", "this", ".", "numWords", "=", "0", ";", "this", ".", "wordFrequencyCount", "=", "new", "Object", "(", ...
Storage for the input parameters for the model
[ "Storage", "for", "the", "input", "parameters", "for", "the", "model" ]
0cf5ab334ae0f5353484cd33b0815e87766af2e4
https://github.com/sbyrnes/classify.js/blob/0cf5ab334ae0f5353484cd33b0815e87766af2e4/classify.js#L14-L23
39,240
sbyrnes/classify.js
classify.js
incrementOrCreateGroup
function incrementOrCreateGroup(object, group, value) { if(!object[group]) object[group] = new Object(); var myGroup = object[group]; if(myGroup[value]) myGroup[value] += 1; else myGroup[value] = 1; }
javascript
function incrementOrCreateGroup(object, group, value) { if(!object[group]) object[group] = new Object(); var myGroup = object[group]; if(myGroup[value]) myGroup[value] += 1; else myGroup[value] = 1; }
[ "function", "incrementOrCreateGroup", "(", "object", ",", "group", ",", "value", ")", "{", "if", "(", "!", "object", "[", "group", "]", ")", "object", "[", "group", "]", "=", "new", "Object", "(", ")", ";", "var", "myGroup", "=", "object", "[", "grou...
Looks for a field with the given group and value in the object and if found increments it. Otherwise, creates it with a value of 1.
[ "Looks", "for", "a", "field", "with", "the", "given", "group", "and", "value", "in", "the", "object", "and", "if", "found", "increments", "it", ".", "Otherwise", "creates", "it", "with", "a", "value", "of", "1", "." ]
0cf5ab334ae0f5353484cd33b0815e87766af2e4
https://github.com/sbyrnes/classify.js/blob/0cf5ab334ae0f5353484cd33b0815e87766af2e4/classify.js#L205-L213
39,241
base/base-helpers
index.js
isValid
function isValid(app) { if (isValidApp(app, 'base-helpers', ['app', 'views', 'collection'])) { debug('initializing <%s>, from <%s>', __filename, module.parent.id); return true; } return false; }
javascript
function isValid(app) { if (isValidApp(app, 'base-helpers', ['app', 'views', 'collection'])) { debug('initializing <%s>, from <%s>', __filename, module.parent.id); return true; } return false; }
[ "function", "isValid", "(", "app", ")", "{", "if", "(", "isValidApp", "(", "app", ",", "'base-helpers'", ",", "[", "'app'", ",", "'views'", ",", "'collection'", "]", ")", ")", "{", "debug", "(", "'initializing <%s>, from <%s>'", ",", "__filename", ",", "mo...
Return false if `app` is not a valid instance of `Base`, or the `base-helpers` plugin is alread registered.
[ "Return", "false", "if", "app", "is", "not", "a", "valid", "instance", "of", "Base", "or", "the", "base", "-", "helpers", "plugin", "is", "alread", "registered", "." ]
eaf080ca6ffb164bac9c48ae1d30fb5f331400a7
https://github.com/base/base-helpers/blob/eaf080ca6ffb164bac9c48ae1d30fb5f331400a7/index.js#L231-L237
39,242
janus-toendering/options-parser
src/helper.js
repeat
function repeat(ch, count) { var s = ''; for(var i = 0; i < count; i++) s += ch; return s; }
javascript
function repeat(ch, count) { var s = ''; for(var i = 0; i < count; i++) s += ch; return s; }
[ "function", "repeat", "(", "ch", ",", "count", ")", "{", "var", "s", "=", "''", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "count", ";", "i", "++", ")", "s", "+=", "ch", ";", "return", "s", ";", "}" ]
Create new string with ch repeated count times @param {String} ch character to repeat (should have length = 1) @param {Number} count number of repetitions of ch @return {String}
[ "Create", "new", "string", "with", "ch", "repeated", "count", "times" ]
f1e39aac203f26e7e4e67fadba63c8dce1c7d70e
https://github.com/janus-toendering/options-parser/blob/f1e39aac203f26e7e4e67fadba63c8dce1c7d70e/src/helper.js#L20-L26
39,243
janus-toendering/options-parser
src/helper.js
fitWidth
function fitWidth(s, len) { s = s.trim(); if(s.length <= len) return [s]; var result = []; while(s.length > len) { var i = len for(; s[i] != ' ' && i >= 0; i--) /* empty loop */ ; if(i == -1) { for(i = len + 1; s[i] != ' ' && i < s.length; i...
javascript
function fitWidth(s, len) { s = s.trim(); if(s.length <= len) return [s]; var result = []; while(s.length > len) { var i = len for(; s[i] != ' ' && i >= 0; i--) /* empty loop */ ; if(i == -1) { for(i = len + 1; s[i] != ' ' && i < s.length; i...
[ "function", "fitWidth", "(", "s", ",", "len", ")", "{", "s", "=", "s", ".", "trim", "(", ")", ";", "if", "(", "s", ".", "length", "<=", "len", ")", "return", "[", "s", "]", ";", "var", "result", "=", "[", "]", ";", "while", "(", "s", ".", ...
Break a string into lines of len characters and break on spaces @param {String} s @param {Number} len @return {Array.<String>} @remarks it might return longers lines if s contains words longer than len
[ "Break", "a", "string", "into", "lines", "of", "len", "characters", "and", "break", "on", "spaces" ]
f1e39aac203f26e7e4e67fadba63c8dce1c7d70e
https://github.com/janus-toendering/options-parser/blob/f1e39aac203f26e7e4e67fadba63c8dce1c7d70e/src/helper.js#L46-L74
39,244
janus-toendering/options-parser
src/helper.js
forEach
function forEach(obj, cb, ctx) { for(var key in obj) cb.call(ctx, key, obj[key]); }
javascript
function forEach(obj, cb, ctx) { for(var key in obj) cb.call(ctx, key, obj[key]); }
[ "function", "forEach", "(", "obj", ",", "cb", ",", "ctx", ")", "{", "for", "(", "var", "key", "in", "obj", ")", "cb", ".", "call", "(", "ctx", ",", "key", ",", "obj", "[", "key", "]", ")", ";", "}" ]
Standard for-each over objects @param {Object} obj @param {Function} cb @param {Object} ctx
[ "Standard", "for", "-", "each", "over", "objects" ]
f1e39aac203f26e7e4e67fadba63c8dce1c7d70e
https://github.com/janus-toendering/options-parser/blob/f1e39aac203f26e7e4e67fadba63c8dce1c7d70e/src/helper.js#L98-L102
39,245
janus-toendering/options-parser
src/helper.js
map
function map(obj, cb, ctx) { var result = {}; forEach(obj, function(key, val){ result[key] = cb.call(ctx, key, val); }, ctx); return result; }
javascript
function map(obj, cb, ctx) { var result = {}; forEach(obj, function(key, val){ result[key] = cb.call(ctx, key, val); }, ctx); return result; }
[ "function", "map", "(", "obj", ",", "cb", ",", "ctx", ")", "{", "var", "result", "=", "{", "}", ";", "forEach", "(", "obj", ",", "function", "(", "key", ",", "val", ")", "{", "result", "[", "key", "]", "=", "cb", ".", "call", "(", "ctx", ",",...
Standard map over objects @param {Object} obj @param {Function} cb @param {Object} ctx @return {Object}
[ "Standard", "map", "over", "objects" ]
f1e39aac203f26e7e4e67fadba63c8dce1c7d70e
https://github.com/janus-toendering/options-parser/blob/f1e39aac203f26e7e4e67fadba63c8dce1c7d70e/src/helper.js#L111-L118
39,246
smbape/node-umd-builder
utils/read-components.js
unique
function unique(list) { return Object.keys(list.reduce((obj, key) => { if (!hasProp.call(obj, key)) { obj[key] = true; } return obj; }, {})); }
javascript
function unique(list) { return Object.keys(list.reduce((obj, key) => { if (!hasProp.call(obj, key)) { obj[key] = true; } return obj; }, {})); }
[ "function", "unique", "(", "list", ")", "{", "return", "Object", ".", "keys", "(", "list", ".", "reduce", "(", "(", "obj", ",", "key", ")", "=>", "{", "if", "(", "!", "hasProp", ".", "call", "(", "obj", ",", "key", ")", ")", "{", "obj", "[", ...
Return unique list items.
[ "Return", "unique", "list", "items", "." ]
73b03e8c985f2660948f5df71140e4a8fb162549
https://github.com/smbape/node-umd-builder/blob/73b03e8c985f2660948f5df71140e4a8fb162549/utils/read-components.js#L56-L63
39,247
smbape/node-umd-builder
utils/read-components.js
find
function find(list, predicate) { // eslint-disable-line consistent-return for (var i = 0, length = list.length, item; i < length; i++) { item = list[i]; if (predicate(item)) { return item; } } }
javascript
function find(list, predicate) { // eslint-disable-line consistent-return for (var i = 0, length = list.length, item; i < length; i++) { item = list[i]; if (predicate(item)) { return item; } } }
[ "function", "find", "(", "list", ",", "predicate", ")", "{", "// eslint-disable-line consistent-return", "for", "(", "var", "i", "=", "0", ",", "length", "=", "list", ".", "length", ",", "item", ";", "i", "<", "length", ";", "i", "++", ")", "{", "item"...
Find an item in list.
[ "Find", "an", "item", "in", "list", "." ]
73b03e8c985f2660948f5df71140e4a8fb162549
https://github.com/smbape/node-umd-builder/blob/73b03e8c985f2660948f5df71140e4a8fb162549/utils/read-components.js#L241-L248
39,248
smbape/node-umd-builder
utils/read-components.js
setSortingLevels
function setSortingLevels(packages, type) { function setLevel(initial, pkg) { var level = Math.max(pkg.sortingLevel || 0, initial); var deps = Object.keys(pkg.dependencies); // console.log('setLevel', pkg.name, level); pkg.sortingLevel = level; deps.forEach(depName => { depName = sanitizeRep...
javascript
function setSortingLevels(packages, type) { function setLevel(initial, pkg) { var level = Math.max(pkg.sortingLevel || 0, initial); var deps = Object.keys(pkg.dependencies); // console.log('setLevel', pkg.name, level); pkg.sortingLevel = level; deps.forEach(depName => { depName = sanitizeRep...
[ "function", "setSortingLevels", "(", "packages", ",", "type", ")", "{", "function", "setLevel", "(", "initial", ",", "pkg", ")", "{", "var", "level", "=", "Math", ".", "max", "(", "pkg", ".", "sortingLevel", "||", "0", ",", "initial", ")", ";", "var", ...
Iterate recursively over each dependency and increase level on each iteration.
[ "Iterate", "recursively", "over", "each", "dependency", "and", "increase", "level", "on", "each", "iteration", "." ]
73b03e8c985f2660948f5df71140e4a8fb162549
https://github.com/smbape/node-umd-builder/blob/73b03e8c985f2660948f5df71140e4a8fb162549/utils/read-components.js#L252-L285
39,249
smbape/node-umd-builder
utils/read-components.js
sortPackages
function sortPackages(packages, type) { return setSortingLevels(packages, type).sort((a, b) => { return b.sortingLevel - a.sortingLevel; }); }
javascript
function sortPackages(packages, type) { return setSortingLevels(packages, type).sort((a, b) => { return b.sortingLevel - a.sortingLevel; }); }
[ "function", "sortPackages", "(", "packages", ",", "type", ")", "{", "return", "setSortingLevels", "(", "packages", ",", "type", ")", ".", "sort", "(", "(", "a", ",", "b", ")", "=>", "{", "return", "b", ".", "sortingLevel", "-", "a", ".", "sortingLevel"...
Sort packages automatically, bas'component'ed on their dependencies.
[ "Sort", "packages", "automatically", "bas", "component", "ed", "on", "their", "dependencies", "." ]
73b03e8c985f2660948f5df71140e4a8fb162549
https://github.com/smbape/node-umd-builder/blob/73b03e8c985f2660948f5df71140e4a8fb162549/utils/read-components.js#L288-L292
39,250
spyfu/spyfu-vue-factory
lib/factory.js
createStore
function createStore(ClonedVue, rawModules, state) { let Vuex = require('vuex'); if (typeof Vuex.default !== 'undefined') { Vuex = Vuex.default; } ClonedVue.use(Vuex); // create a normalized copy of our vuex modules const normalizedModules = normalizeModules(rawModules); // merge...
javascript
function createStore(ClonedVue, rawModules, state) { let Vuex = require('vuex'); if (typeof Vuex.default !== 'undefined') { Vuex = Vuex.default; } ClonedVue.use(Vuex); // create a normalized copy of our vuex modules const normalizedModules = normalizeModules(rawModules); // merge...
[ "function", "createStore", "(", "ClonedVue", ",", "rawModules", ",", "state", ")", "{", "let", "Vuex", "=", "require", "(", "'vuex'", ")", ";", "if", "(", "typeof", "Vuex", ".", "default", "!==", "'undefined'", ")", "{", "Vuex", "=", "Vuex", ".", "defa...
helper function to create a vuex store instance
[ "helper", "function", "to", "create", "a", "vuex", "store", "instance" ]
9d0513ecbd7f56ab082ded01bb17a28ac4f72430
https://github.com/spyfu/spyfu-vue-factory/blob/9d0513ecbd7f56ab082ded01bb17a28ac4f72430/lib/factory.js#L102-L119
39,251
JohnnyTheTank/angular-masonry-packed
dist/angular-masonry-packed.js
mungeNonPixel
function mungeNonPixel( elem, value ) { // IE8 and has percent value if ( window.getComputedStyle || value.indexOf('%') === -1 ) { return value; } var style = elem.style; // Remember the original values var left = style.left; var rs = elem.runtimeStyle; var rsLeft = rs && rs.left; // Put in the n...
javascript
function mungeNonPixel( elem, value ) { // IE8 and has percent value if ( window.getComputedStyle || value.indexOf('%') === -1 ) { return value; } var style = elem.style; // Remember the original values var left = style.left; var rs = elem.runtimeStyle; var rsLeft = rs && rs.left; // Put in the n...
[ "function", "mungeNonPixel", "(", "elem", ",", "value", ")", "{", "// IE8 and has percent value", "if", "(", "window", ".", "getComputedStyle", "||", "value", ".", "indexOf", "(", "'%'", ")", "===", "-", "1", ")", "{", "return", "value", ";", "}", "var", ...
IE8 returns percent values, not pixels taken from jQuery's curCSS
[ "IE8", "returns", "percent", "values", "not", "pixels", "taken", "from", "jQuery", "s", "curCSS" ]
4291ed734cc17decc8bf07a376c6d82e003e8c7b
https://github.com/JohnnyTheTank/angular-masonry-packed/blob/4291ed734cc17decc8bf07a376c6d82e003e8c7b/dist/angular-masonry-packed.js#L407-L432
39,252
JohnnyTheTank/angular-masonry-packed
dist/angular-masonry-packed.js
onReady
function onReady( event ) { // bail if already triggered or IE8 document is not ready just yet var isIE8NotReady = event.type === 'readystatechange' && document.readyState !== 'complete'; if ( docReady.isReady || isIE8NotReady ) { return; } trigger(); }
javascript
function onReady( event ) { // bail if already triggered or IE8 document is not ready just yet var isIE8NotReady = event.type === 'readystatechange' && document.readyState !== 'complete'; if ( docReady.isReady || isIE8NotReady ) { return; } trigger(); }
[ "function", "onReady", "(", "event", ")", "{", "// bail if already triggered or IE8 document is not ready just yet", "var", "isIE8NotReady", "=", "event", ".", "type", "===", "'readystatechange'", "&&", "document", ".", "readyState", "!==", "'complete'", ";", "if", "(",...
triggered on various doc ready events
[ "triggered", "on", "various", "doc", "ready", "events" ]
4291ed734cc17decc8bf07a376c6d82e003e8c7b
https://github.com/JohnnyTheTank/angular-masonry-packed/blob/4291ed734cc17decc8bf07a376c6d82e003e8c7b/dist/angular-masonry-packed.js#L1042-L1050
39,253
JohnnyTheTank/angular-masonry-packed
dist/angular-masonry-packed.js
query
function query( elem, selector ) { // append to fragment if no parent checkParent( elem ); // match elem with all selected elems of parent var elems = elem.parentNode.querySelectorAll( selector ); for ( var i=0, len = elems.length; i < len; i++ ) { // return true if match if ( elems[i] ...
javascript
function query( elem, selector ) { // append to fragment if no parent checkParent( elem ); // match elem with all selected elems of parent var elems = elem.parentNode.querySelectorAll( selector ); for ( var i=0, len = elems.length; i < len; i++ ) { // return true if match if ( elems[i] ...
[ "function", "query", "(", "elem", ",", "selector", ")", "{", "// append to fragment if no parent", "checkParent", "(", "elem", ")", ";", "// match elem with all selected elems of parent", "var", "elems", "=", "elem", ".", "parentNode", ".", "querySelectorAll", "(", "s...
fall back to using QSA thx @jonathantneal https://gist.github.com/3062955
[ "fall", "back", "to", "using", "QSA", "thx" ]
4291ed734cc17decc8bf07a376c6d82e003e8c7b
https://github.com/JohnnyTheTank/angular-masonry-packed/blob/4291ed734cc17decc8bf07a376c6d82e003e8c7b/dist/angular-masonry-packed.js#L1142-L1156
39,254
hogart/rpg-tools
lib/Dice.js
function (notation) { var tokens = this.notationRe.exec(notation); this.rolls = tokens[1] === undefined ? this.defaultRolls : parseInt(tokens[1]); // default if omitted this.sides = tokens[2] === undefined ? this.defaultSides : parseInt(tokens[2]); // default if omitted ...
javascript
function (notation) { var tokens = this.notationRe.exec(notation); this.rolls = tokens[1] === undefined ? this.defaultRolls : parseInt(tokens[1]); // default if omitted this.sides = tokens[2] === undefined ? this.defaultSides : parseInt(tokens[2]); // default if omitted ...
[ "function", "(", "notation", ")", "{", "var", "tokens", "=", "this", ".", "notationRe", ".", "exec", "(", "notation", ")", ";", "this", ".", "rolls", "=", "tokens", "[", "1", "]", "===", "undefined", "?", "this", ".", "defaultRolls", ":", "parseInt", ...
Parses a notation @param {String} notation e.g. "3d6+6" @returns {Dice} this instance (for chaining)
[ "Parses", "a", "notation" ]
6909e3f3c21c2fd4c9e7d82103a69f11ae7e4375
https://github.com/hogart/rpg-tools/blob/6909e3f3c21c2fd4c9e7d82103a69f11ae7e4375/lib/Dice.js#L38-L62
39,255
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColVis/js/dataTables.colVis.js
function( oDTSettings, oInit ) { /* Santiy check that we are a new instance */ if ( !this.CLASS || this.CLASS != "ColVis" ) { alert( "Warning: ColVis must be initialised with the keyword 'new'" ); } if ( typeof oInit == 'undefined' ) { oInit = {}; } var camelToHungarian = $.fn.dataTable.camelToHungarian; ...
javascript
function( oDTSettings, oInit ) { /* Santiy check that we are a new instance */ if ( !this.CLASS || this.CLASS != "ColVis" ) { alert( "Warning: ColVis must be initialised with the keyword 'new'" ); } if ( typeof oInit == 'undefined' ) { oInit = {}; } var camelToHungarian = $.fn.dataTable.camelToHungarian; ...
[ "function", "(", "oDTSettings", ",", "oInit", ")", "{", "/* Santiy check that we are a new instance */", "if", "(", "!", "this", ".", "CLASS", "||", "this", ".", "CLASS", "!=", "\"ColVis\"", ")", "{", "alert", "(", "\"Warning: ColVis must be initialised with the keywo...
ColVis provides column visibility control for DataTables @class ColVis @constructor @param {object} DataTables settings object. With DataTables 1.10 this can also be and API instance, table node, jQuery collection or jQuery selector. @param {object} ColVis configuration options
[ "ColVis", "provides", "column", "visibility", "control", "for", "DataTables" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColVis/js/dataTables.colVis.js#L39-L181
39,256
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColVis/js/dataTables.colVis.js
function ( init ) { $.extend( true, this.s, ColVis.defaults, init ); // Slightly messy overlap for the camelCase notation if ( ! this.s.showAll && this.s.bShowAll ) { this.s.showAll = this.s.sShowAll; } if ( ! this.s.restore && this.s.bRestore ) { this.s.restore = this.s.sRestore; } // CamelCase...
javascript
function ( init ) { $.extend( true, this.s, ColVis.defaults, init ); // Slightly messy overlap for the camelCase notation if ( ! this.s.showAll && this.s.bShowAll ) { this.s.showAll = this.s.sShowAll; } if ( ! this.s.restore && this.s.bRestore ) { this.s.restore = this.s.sRestore; } // CamelCase...
[ "function", "(", "init", ")", "{", "$", ".", "extend", "(", "true", ",", "this", ".", "s", ",", "ColVis", ".", "defaults", ",", "init", ")", ";", "// Slightly messy overlap for the camelCase notation", "if", "(", "!", "this", ".", "s", ".", "showAll", "&...
Apply any customisation to the settings from the DataTables initialisation @method _fnApplyCustomisation @returns void @private
[ "Apply", "any", "customisation", "to", "the", "settings", "from", "the", "DataTables", "initialisation" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColVis/js/dataTables.colVis.js#L318-L344
39,257
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColVis/js/dataTables.colVis.js
function () { var columns = this.s.dt.aoColumns; var buttons = this.dom.buttons; var groups = this.s.aoGroups; var button; for ( var i=0, ien=buttons.length ; i<ien ; i++ ) { button = buttons[i]; if ( button.__columnIdx !== undefined ) { $('input', button).prop( 'checked', columns[ button.__colum...
javascript
function () { var columns = this.s.dt.aoColumns; var buttons = this.dom.buttons; var groups = this.s.aoGroups; var button; for ( var i=0, ien=buttons.length ; i<ien ; i++ ) { button = buttons[i]; if ( button.__columnIdx !== undefined ) { $('input', button).prop( 'checked', columns[ button.__colum...
[ "function", "(", ")", "{", "var", "columns", "=", "this", ".", "s", ".", "dt", ".", "aoColumns", ";", "var", "buttons", "=", "this", ".", "dom", ".", "buttons", ";", "var", "groups", "=", "this", ".", "s", ".", "aoGroups", ";", "var", "button", "...
On each table draw, check the visibility checkboxes as needed. This allows any process to update the table's column visibility and ColVis will still be accurate. @method _fnDrawCallback @returns void @private
[ "On", "each", "table", "draw", "check", "the", "visibility", "checkboxes", "as", "needed", ".", "This", "allows", "any", "process", "to", "update", "the", "table", "s", "column", "visibility", "and", "ColVis", "will", "still", "be", "accurate", "." ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColVis/js/dataTables.colVis.js#L354-L401
39,258
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColVis/js/dataTables.colVis.js
function () { var nButton, columns = this.s.dt.aoColumns; if ( $.inArray( 'all', this.s.aiExclude ) === -1 ) { for ( var i=0, iLen=columns.length ; i<iLen ; i++ ) { if ( $.inArray( i, this.s.aiExclude ) === -1 ) { nButton = this._fnDomColumnButton( i ); nButton.__columnIdx = i; ...
javascript
function () { var nButton, columns = this.s.dt.aoColumns; if ( $.inArray( 'all', this.s.aiExclude ) === -1 ) { for ( var i=0, iLen=columns.length ; i<iLen ; i++ ) { if ( $.inArray( i, this.s.aiExclude ) === -1 ) { nButton = this._fnDomColumnButton( i ); nButton.__columnIdx = i; ...
[ "function", "(", ")", "{", "var", "nButton", ",", "columns", "=", "this", ".", "s", ".", "dt", ".", "aoColumns", ";", "if", "(", "$", ".", "inArray", "(", "'all'", ",", "this", ".", "s", ".", "aiExclude", ")", "===", "-", "1", ")", "{", "for", ...
Loop through the columns in the table and as a new button for each one. @method _fnAddButtons @returns void @private
[ "Loop", "through", "the", "columns", "in", "the", "table", "and", "as", "a", "new", "button", "for", "each", "one", "." ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColVis/js/dataTables.colVis.js#L433-L486
39,259
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColVis/js/dataTables.colVis.js
function () { var that = this, dt = this.s.dt; return $( '<li class="ColVis_Special '+(dt.bJUI ? 'ui-button ui-state-default' : '')+'">'+ this.s.restore+ '</li>' ) .click( function (e) { for ( var i=0, iLen=that.s.abOriginal.length ; i<iLen ; i++ ) { that.s.dt.oInstance.fnSet...
javascript
function () { var that = this, dt = this.s.dt; return $( '<li class="ColVis_Special '+(dt.bJUI ? 'ui-button ui-state-default' : '')+'">'+ this.s.restore+ '</li>' ) .click( function (e) { for ( var i=0, iLen=that.s.abOriginal.length ; i<iLen ; i++ ) { that.s.dt.oInstance.fnSet...
[ "function", "(", ")", "{", "var", "that", "=", "this", ",", "dt", "=", "this", ".", "s", ".", "dt", ";", "return", "$", "(", "'<li class=\"ColVis_Special '", "+", "(", "dt", ".", "bJUI", "?", "'ui-button ui-state-default'", ":", "''", ")", "+", "'\">'"...
Create a button which allows a "restore" action @method _fnDomRestoreButton @returns {Node} Created button @private
[ "Create", "a", "button", "which", "allows", "a", "restore", "action" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColVis/js/dataTables.colVis.js#L495-L515
39,260
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColVis/js/dataTables.colVis.js
function () { for ( var i=0, iLen=this.s.dt.oInstance.length ; i<iLen ; i++ ) { if ( this.s.dt.oInstance[i] == this.s.dt.nTable ) { return i; } } return 0; }
javascript
function () { for ( var i=0, iLen=this.s.dt.oInstance.length ; i<iLen ; i++ ) { if ( this.s.dt.oInstance[i] == this.s.dt.nTable ) { return i; } } return 0; }
[ "function", "(", ")", "{", "for", "(", "var", "i", "=", "0", ",", "iLen", "=", "this", ".", "s", ".", "dt", ".", "oInstance", ".", "length", ";", "i", "<", "iLen", ";", "i", "++", ")", "{", "if", "(", "this", ".", "s", ".", "dt", ".", "oI...
Get the position in the DataTables instance array of the table for this instance of ColVis @method _fnDataTablesApiIndex @returns {int} Index @private
[ "Get", "the", "position", "in", "the", "DataTables", "instance", "array", "of", "the", "table", "for", "this", "instance", "of", "ColVis" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColVis/js/dataTables.colVis.js#L666-L676
39,261
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColVis/js/dataTables.colVis.js
function () { var that = this, nCatcher = document.createElement('div'); nCatcher.className = "ColVis_catcher"; $(nCatcher).click( function () { that._fnCollectionHide.call( that, null, null ); } ); return nCatcher; }
javascript
function () { var that = this, nCatcher = document.createElement('div'); nCatcher.className = "ColVis_catcher"; $(nCatcher).click( function () { that._fnCollectionHide.call( that, null, null ); } ); return nCatcher; }
[ "function", "(", ")", "{", "var", "that", "=", "this", ",", "nCatcher", "=", "document", ".", "createElement", "(", "'div'", ")", ";", "nCatcher", ".", "className", "=", "\"ColVis_catcher\"", ";", "$", "(", "nCatcher", ")", ".", "click", "(", "function",...
An element to be placed on top of the activate button to catch events @method _fnDomCatcher @returns {Node} div container for the collection @private
[ "An", "element", "to", "be", "placed", "on", "top", "of", "the", "activate", "button", "to", "catch", "events" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColVis/js/dataTables.colVis.js#L709-L721
39,262
S3bb1/ah-dashboard-plugin
public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColVis/js/dataTables.colVis.js
function () { var aoOpen = this.s.dt.aoOpenRows; var iVisible = this.s.dt.oApi._fnVisbleColumns( this.s.dt ); for ( var i=0, iLen=aoOpen.length ; i<iLen ; i++ ) { aoOpen[i].nTr.getElementsByTagName('td')[0].colSpan = iVisible; } }
javascript
function () { var aoOpen = this.s.dt.aoOpenRows; var iVisible = this.s.dt.oApi._fnVisbleColumns( this.s.dt ); for ( var i=0, iLen=aoOpen.length ; i<iLen ; i++ ) { aoOpen[i].nTr.getElementsByTagName('td')[0].colSpan = iVisible; } }
[ "function", "(", ")", "{", "var", "aoOpen", "=", "this", ".", "s", ".", "dt", ".", "aoOpenRows", ";", "var", "iVisible", "=", "this", ".", "s", ".", "dt", ".", "oApi", ".", "_fnVisbleColumns", "(", "this", ".", "s", ".", "dt", ")", ";", "for", ...
Alter the colspan on any fnOpen rows
[ "Alter", "the", "colspan", "on", "any", "fnOpen", "rows" ]
c283370ec0f99a25db5bb7029a98b4febf8c5251
https://github.com/S3bb1/ah-dashboard-plugin/blob/c283370ec0f99a25db5bb7029a98b4febf8c5251/public/dashboard/bower_components/admin-lte/plugins/datatables/extensions/ColVis/js/dataTables.colVis.js#L863-L871
39,263
alexcjohnson/world-calendars
jquery-src/jquery.calendars.plus.js
function(match, value, len, step) { var num = '' + value; if (doubled(match, step)) { while (num.length < len) { num = '0' + num; } } return num; }
javascript
function(match, value, len, step) { var num = '' + value; if (doubled(match, step)) { while (num.length < len) { num = '0' + num; } } return num; }
[ "function", "(", "match", ",", "value", ",", "len", ",", "step", ")", "{", "var", "num", "=", "''", "+", "value", ";", "if", "(", "doubled", "(", "match", ",", "step", ")", ")", "{", "while", "(", "num", ".", "length", "<", "len", ")", "{", "...
Format a number, with leading zeroes if necessary
[ "Format", "a", "number", "with", "leading", "zeroes", "if", "necessary" ]
810693882512dec1b804456f8d435b962bd6cf31
https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.plus.js#L168-L176
39,264
alexcjohnson/world-calendars
jquery-src/jquery.calendars.plus.js
function(match, value, shortNames, longNames) { return (doubled(match) ? longNames[value] : shortNames[value]); }
javascript
function(match, value, shortNames, longNames) { return (doubled(match) ? longNames[value] : shortNames[value]); }
[ "function", "(", "match", ",", "value", ",", "shortNames", ",", "longNames", ")", "{", "return", "(", "doubled", "(", "match", ")", "?", "longNames", "[", "value", "]", ":", "shortNames", "[", "value", "]", ")", ";", "}" ]
Format a name, short or long as requested
[ "Format", "a", "name", "short", "or", "long", "as", "requested" ]
810693882512dec1b804456f8d435b962bd6cf31
https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.plus.js#L178-L180
39,265
alexcjohnson/world-calendars
jquery-src/jquery.calendars.plus.js
function(date, useLongName) { if (useLongName) { return (typeof monthNames === 'function') ? monthNames.call(calendar, date) : monthNames[date.month() - calendar.minMonth]; } else { return (typeof monthNamesShort === 'function') ? monthNamesShort.call(calendar, date) : monthNam...
javascript
function(date, useLongName) { if (useLongName) { return (typeof monthNames === 'function') ? monthNames.call(calendar, date) : monthNames[date.month() - calendar.minMonth]; } else { return (typeof monthNamesShort === 'function') ? monthNamesShort.call(calendar, date) : monthNam...
[ "function", "(", "date", ",", "useLongName", ")", "{", "if", "(", "useLongName", ")", "{", "return", "(", "typeof", "monthNames", "===", "'function'", ")", "?", "monthNames", ".", "call", "(", "calendar", ",", "date", ")", ":", "monthNames", "[", "date",...
Format a month name, short or long as requested
[ "Format", "a", "month", "name", "short", "or", "long", "as", "requested" ]
810693882512dec1b804456f8d435b962bd6cf31
https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.plus.js#L190-L200
39,266
alexcjohnson/world-calendars
jquery-src/jquery.calendars.plus.js
function(match, step) { var isDoubled = doubled(match, step); var size = [2, 3, isDoubled ? 4 : 2, isDoubled ? 4 : 2, 10, 11, 20]['oyYJ@!'.indexOf(match) + 1]; var digits = new RegExp('^-?\\d{1,' + size + '}'); var num = value.substring(iValue).match(digits); if (!num) { throw ($.calendars.loca...
javascript
function(match, step) { var isDoubled = doubled(match, step); var size = [2, 3, isDoubled ? 4 : 2, isDoubled ? 4 : 2, 10, 11, 20]['oyYJ@!'.indexOf(match) + 1]; var digits = new RegExp('^-?\\d{1,' + size + '}'); var num = value.substring(iValue).match(digits); if (!num) { throw ($.calendars.loca...
[ "function", "(", "match", ",", "step", ")", "{", "var", "isDoubled", "=", "doubled", "(", "match", ",", "step", ")", ";", "var", "size", "=", "[", "2", ",", "3", ",", "isDoubled", "?", "4", ":", "2", ",", "isDoubled", "?", "4", ":", "2", ",", ...
Extract a number from the string value
[ "Extract", "a", "number", "from", "the", "string", "value" ]
810693882512dec1b804456f8d435b962bd6cf31
https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.plus.js#L307-L318
39,267
alexcjohnson/world-calendars
jquery-src/jquery.calendars.plus.js
function() { if (typeof monthNames === 'function') { var month = doubled('M') ? monthNames.call(calendar, value.substring(iValue)) : monthNamesShort.call(calendar, value.substring(iValue)); iValue += month.length; return month; } return getName('M', monthNamesShort, monthNames); ...
javascript
function() { if (typeof monthNames === 'function') { var month = doubled('M') ? monthNames.call(calendar, value.substring(iValue)) : monthNamesShort.call(calendar, value.substring(iValue)); iValue += month.length; return month; } return getName('M', monthNamesShort, monthNames); ...
[ "function", "(", ")", "{", "if", "(", "typeof", "monthNames", "===", "'function'", ")", "{", "var", "month", "=", "doubled", "(", "'M'", ")", "?", "monthNames", ".", "call", "(", "calendar", ",", "value", ".", "substring", "(", "iValue", ")", ")", ":...
Extract a month number from the string value
[ "Extract", "a", "month", "number", "from", "the", "string", "value" ]
810693882512dec1b804456f8d435b962bd6cf31
https://github.com/alexcjohnson/world-calendars/blob/810693882512dec1b804456f8d435b962bd6cf31/jquery-src/jquery.calendars.plus.js#L344-L354
39,268
whyhankee/node-flw
flw.js
wrap
function wrap(fn, args, key) { const self = this; if (key === undefined && typeof(args) === 'string') { key = args; args = []; } if (!args) args = []; return function wrapper(context, cb) { const copyArgs = args.slice(args); copyArgs.unshift(self); copyArgs.push(onWra...
javascript
function wrap(fn, args, key) { const self = this; if (key === undefined && typeof(args) === 'string') { key = args; args = []; } if (!args) args = []; return function wrapper(context, cb) { const copyArgs = args.slice(args); copyArgs.unshift(self); copyArgs.push(onWra...
[ "function", "wrap", "(", "fn", ",", "args", ",", "key", ")", "{", "const", "self", "=", "this", ";", "if", "(", "key", "===", "undefined", "&&", "typeof", "(", "args", ")", "===", "'string'", ")", "{", "key", "=", "args", ";", "args", "=", "[", ...
Returns wrapped regular function that stores the result on the context key @param {function} fn function to wrap @param {any[]} [args] Array of arguments to pass (optional) @param {String} [key] name of context key to store the result in (optional)
[ "Returns", "wrapped", "regular", "function", "that", "stores", "the", "result", "on", "the", "context", "key" ]
61f438d2d9afe8acfb139f0c5f8c76452e07bedb
https://github.com/whyhankee/node-flw/blob/61f438d2d9afe8acfb139f0c5f8c76452e07bedb/flw.js#L122-L144
39,269
whyhankee/node-flw
flw.js
each
function each(items, numParralel, fn, done) { if (done === undefined) { done = fn; fn = numParralel; numParralel = 3; } if (numParralel <= 0) numParralel = 1; let doing = 0; let numProcessing = 0; let numDone = 0; const numTotal = items.length; const results = []; retur...
javascript
function each(items, numParralel, fn, done) { if (done === undefined) { done = fn; fn = numParralel; numParralel = 3; } if (numParralel <= 0) numParralel = 1; let doing = 0; let numProcessing = 0; let numDone = 0; const numTotal = items.length; const results = []; retur...
[ "function", "each", "(", "items", ",", "numParralel", ",", "fn", ",", "done", ")", "{", "if", "(", "done", "===", "undefined", ")", "{", "done", "=", "fn", ";", "fn", "=", "numParralel", ";", "numParralel", "=", "3", ";", "}", "if", "(", "numParral...
Calls fn with every item in the array @param {any[]} items Array items to process @param {Number} [numParallel] Limit parallelisation (default: 3) @param {function} fn function call for each item @param {function} done callback
[ "Calls", "fn", "with", "every", "item", "in", "the", "array" ]
61f438d2d9afe8acfb139f0c5f8c76452e07bedb
https://github.com/whyhankee/node-flw/blob/61f438d2d9afe8acfb139f0c5f8c76452e07bedb/flw.js#L153-L189
39,270
whyhankee/node-flw
flw.js
make
function make() { // create a map of all flow functions wrapped by _make const makeFnMap = {}; Object.keys(fnMap).forEach(function (key) { makeFnMap[key] = _make(fnMap[key]); }); return makeFnMap; // takes a function and wraps it so that execution is 'postponed' function _make(fn) { ...
javascript
function make() { // create a map of all flow functions wrapped by _make const makeFnMap = {}; Object.keys(fnMap).forEach(function (key) { makeFnMap[key] = _make(fnMap[key]); }); return makeFnMap; // takes a function and wraps it so that execution is 'postponed' function _make(fn) { ...
[ "function", "make", "(", ")", "{", "// create a map of all flow functions wrapped by _make", "const", "makeFnMap", "=", "{", "}", ";", "Object", ".", "keys", "(", "fnMap", ")", ".", "forEach", "(", "function", "(", "key", ")", "{", "makeFnMap", "[", "key", "...
build the list of exposed methods into the .make syntax
[ "build", "the", "list", "of", "exposed", "methods", "into", "the", ".", "make", "syntax" ]
61f438d2d9afe8acfb139f0c5f8c76452e07bedb
https://github.com/whyhankee/node-flw/blob/61f438d2d9afe8acfb139f0c5f8c76452e07bedb/flw.js#L250-L282
39,271
whyhankee/node-flw
flw.js
_make
function _make(fn) { // the user calls this function, e.g. flw.make.series(...) return function madeFunction(fns, context, returnKey) { if (typeof context === 'string') { returnKey = context; context = {}; } // this function is consumed by flw return function flowFu...
javascript
function _make(fn) { // the user calls this function, e.g. flw.make.series(...) return function madeFunction(fns, context, returnKey) { if (typeof context === 'string') { returnKey = context; context = {}; } // this function is consumed by flw return function flowFu...
[ "function", "_make", "(", "fn", ")", "{", "// the user calls this function, e.g. flw.make.series(...)", "return", "function", "madeFunction", "(", "fns", ",", "context", ",", "returnKey", ")", "{", "if", "(", "typeof", "context", "===", "'string'", ")", "{", "retu...
takes a function and wraps it so that execution is 'postponed'
[ "takes", "a", "function", "and", "wraps", "it", "so", "that", "execution", "is", "postponed" ]
61f438d2d9afe8acfb139f0c5f8c76452e07bedb
https://github.com/whyhankee/node-flw/blob/61f438d2d9afe8acfb139f0c5f8c76452e07bedb/flw.js#L259-L281
39,272
whyhankee/node-flw
flw.js
_checkContext
function _checkContext(c) { if (c.hasOwnProperty('_stopped')) return; // Already done? c._stopped = null; // Indicate that we gracefully stop // if set, stops the flow until we are back to the main callback function _flw_stop(reason, cb) { if (!cb && typeof reason === 'function') { ...
javascript
function _checkContext(c) { if (c.hasOwnProperty('_stopped')) return; // Already done? c._stopped = null; // Indicate that we gracefully stop // if set, stops the flow until we are back to the main callback function _flw_stop(reason, cb) { if (!cb && typeof reason === 'function') { ...
[ "function", "_checkContext", "(", "c", ")", "{", "if", "(", "c", ".", "hasOwnProperty", "(", "'_stopped'", ")", ")", "return", ";", "// Already done?", "c", ".", "_stopped", "=", "null", ";", "// Indicate that we gracefully stop", "// if set, stops the flow until w...
Ensures a enrichched flw context when a flow is starting @private
[ "Ensures", "a", "enrichched", "flw", "context", "when", "a", "flow", "is", "starting" ]
61f438d2d9afe8acfb139f0c5f8c76452e07bedb
https://github.com/whyhankee/node-flw/blob/61f438d2d9afe8acfb139f0c5f8c76452e07bedb/flw.js#L298-L364
39,273
whyhankee/node-flw
flw.js
_flw_stop
function _flw_stop(reason, cb) { if (!cb && typeof reason === 'function') { cb = reason; reason = 'stopped'; } c._stopped = reason; return cb(); }
javascript
function _flw_stop(reason, cb) { if (!cb && typeof reason === 'function') { cb = reason; reason = 'stopped'; } c._stopped = reason; return cb(); }
[ "function", "_flw_stop", "(", "reason", ",", "cb", ")", "{", "if", "(", "!", "cb", "&&", "typeof", "reason", "===", "'function'", ")", "{", "cb", "=", "reason", ";", "reason", "=", "'stopped'", ";", "}", "c", ".", "_stopped", "=", "reason", ";", "r...
Indicate that we gracefully stop if set, stops the flow until we are back to the main callback
[ "Indicate", "that", "we", "gracefully", "stop", "if", "set", "stops", "the", "flow", "until", "we", "are", "back", "to", "the", "main", "callback" ]
61f438d2d9afe8acfb139f0c5f8c76452e07bedb
https://github.com/whyhankee/node-flw/blob/61f438d2d9afe8acfb139f0c5f8c76452e07bedb/flw.js#L305-L312
39,274
whyhankee/node-flw
flw.js
_flw_store
function _flw_store(key, cb) { const self = this; const fn = function (err, data) { if (err) return cb(err); self[key] = data; return cb(); }; return fn; }
javascript
function _flw_store(key, cb) { const self = this; const fn = function (err, data) { if (err) return cb(err); self[key] = data; return cb(); }; return fn; }
[ "function", "_flw_store", "(", "key", ",", "cb", ")", "{", "const", "self", "=", "this", ";", "const", "fn", "=", "function", "(", "err", ",", "data", ")", "{", "if", "(", "err", ")", "return", "cb", "(", "err", ")", ";", "self", "[", "key", "]...
Stores the data returned from the callback in the context with key 'key' then calls the callback
[ "Stores", "the", "data", "returned", "from", "the", "callback", "in", "the", "context", "with", "key", "key", "then", "calls", "the", "callback" ]
61f438d2d9afe8acfb139f0c5f8c76452e07bedb
https://github.com/whyhankee/node-flw/blob/61f438d2d9afe8acfb139f0c5f8c76452e07bedb/flw.js#L322-L332
39,275
whyhankee/node-flw
flw.js
_flw_clean
function _flw_clean() { const self = this; const contextCopy = {}; Object.keys(this).forEach(function (k) { if (ourContextKeys.indexOf(k) !== -1) return; contextCopy[k] = self[k]; }); return contextCopy; }
javascript
function _flw_clean() { const self = this; const contextCopy = {}; Object.keys(this).forEach(function (k) { if (ourContextKeys.indexOf(k) !== -1) return; contextCopy[k] = self[k]; }); return contextCopy; }
[ "function", "_flw_clean", "(", ")", "{", "const", "self", "=", "this", ";", "const", "contextCopy", "=", "{", "}", ";", "Object", ".", "keys", "(", "this", ")", ".", "forEach", "(", "function", "(", "k", ")", "{", "if", "(", "ourContextKeys", ".", ...
Cleans all flw related properties from the context object
[ "Cleans", "all", "flw", "related", "properties", "from", "the", "context", "object" ]
61f438d2d9afe8acfb139f0c5f8c76452e07bedb
https://github.com/whyhankee/node-flw/blob/61f438d2d9afe8acfb139f0c5f8c76452e07bedb/flw.js#L340-L348
39,276
quancheng-ec/pomjs
src/middleware/logger.js
getNullLogger
function getNullLogger() { return new Proxy( {}, { get: function(target, propKey) { // not proxy for Timer if (propKey === 'Timer') { return _.bind(InnerTimer, {}, undefined) } return function() {} }, apply: function(target, object, args) {} } ...
javascript
function getNullLogger() { return new Proxy( {}, { get: function(target, propKey) { // not proxy for Timer if (propKey === 'Timer') { return _.bind(InnerTimer, {}, undefined) } return function() {} }, apply: function(target, object, args) {} } ...
[ "function", "getNullLogger", "(", ")", "{", "return", "new", "Proxy", "(", "{", "}", ",", "{", "get", ":", "function", "(", "target", ",", "propKey", ")", "{", "// not proxy for Timer", "if", "(", "propKey", "===", "'Timer'", ")", "{", "return", "_", "...
always return a dummy logger
[ "always", "return", "a", "dummy", "logger" ]
2080973d89be7156f5915b846895fb86902f1e9e
https://github.com/quancheng-ec/pomjs/blob/2080973d89be7156f5915b846895fb86902f1e9e/src/middleware/logger.js#L111-L126
39,277
vinkaga/angular-mock-backend
mock-protractor.js
getModuleCode
function getModuleCode(mocks) { var filename = path.join(__dirname, './mock-angular.js'); var code = fs.readFileSync(filename, 'utf8'); return code.replace(/angular\.noop\(\);/, getModuleConfig(mocks)); }
javascript
function getModuleCode(mocks) { var filename = path.join(__dirname, './mock-angular.js'); var code = fs.readFileSync(filename, 'utf8'); return code.replace(/angular\.noop\(\);/, getModuleConfig(mocks)); }
[ "function", "getModuleCode", "(", "mocks", ")", "{", "var", "filename", "=", "path", ".", "join", "(", "__dirname", ",", "'./mock-angular.js'", ")", ";", "var", "code", "=", "fs", ".", "readFileSync", "(", "filename", ",", "'utf8'", ")", ";", "return", "...
Get AngularJS module code to inject into browser @param mocks [] @returns {string}
[ "Get", "AngularJS", "module", "code", "to", "inject", "into", "browser" ]
bed0610d65b223430c9a52ff5c9490e6d9b7ad14
https://github.com/vinkaga/angular-mock-backend/blob/bed0610d65b223430c9a52ff5c9490e6d9b7ad14/mock-protractor.js#L27-L31
39,278
vinkaga/angular-mock-backend
mock-protractor.js
getModuleConfig
function getModuleConfig(mocks) { // Functions cannot be transferred directly // Convert to string for (var i = 0; i < mocks.length; ++i) { var mock = mocks[i]; if (typeof mock[0] === 'function') { mock[0] = mock[0].toString(); } } return "angular.module('vinkaga.mockBackend').constant('vinkaga.mockBacken...
javascript
function getModuleConfig(mocks) { // Functions cannot be transferred directly // Convert to string for (var i = 0; i < mocks.length; ++i) { var mock = mocks[i]; if (typeof mock[0] === 'function') { mock[0] = mock[0].toString(); } } return "angular.module('vinkaga.mockBackend').constant('vinkaga.mockBacken...
[ "function", "getModuleConfig", "(", "mocks", ")", "{", "// Functions cannot be transferred directly", "// Convert to string", "for", "(", "var", "i", "=", "0", ";", "i", "<", "mocks", ".", "length", ";", "++", "i", ")", "{", "var", "mock", "=", "mocks", "[",...
Create module mock config code @param mocks @returns {string}
[ "Create", "module", "mock", "config", "code" ]
bed0610d65b223430c9a52ff5c9490e6d9b7ad14
https://github.com/vinkaga/angular-mock-backend/blob/bed0610d65b223430c9a52ff5c9490e6d9b7ad14/mock-protractor.js#L38-L48
39,279
telehash/hashname
index.js
rollup
function rollup(imbuff) { var roll = new Buffer(0); Object.keys(imbuff).sort().forEach(function(id){ roll = crypto.createHash('sha256').update(Buffer.concat([roll,new Buffer(id, 'hex')])).digest(); roll = crypto.createHash('sha256').update(Buffer.concat([roll,imbuff[id]])).digest(); }); return roll; }
javascript
function rollup(imbuff) { var roll = new Buffer(0); Object.keys(imbuff).sort().forEach(function(id){ roll = crypto.createHash('sha256').update(Buffer.concat([roll,new Buffer(id, 'hex')])).digest(); roll = crypto.createHash('sha256').update(Buffer.concat([roll,imbuff[id]])).digest(); }); return roll; }
[ "function", "rollup", "(", "imbuff", ")", "{", "var", "roll", "=", "new", "Buffer", "(", "0", ")", ";", "Object", ".", "keys", "(", "imbuff", ")", ".", "sort", "(", ")", ".", "forEach", "(", "function", "(", "id", ")", "{", "roll", "=", "crypto",...
rollup uses only intermediate buffers, data must be validated first
[ "rollup", "uses", "only", "intermediate", "buffers", "data", "must", "be", "validated", "first" ]
c038acc3a96e68309135c054c68375cdc56fb62f
https://github.com/telehash/hashname/blob/c038acc3a96e68309135c054c68375cdc56fb62f/index.js#L6-L14
39,280
Neil-G/redux-mastermind
lib/createMastermind.js
connectStore
function connectStore(component, keys) { var shouldReturnAFunction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; // function that maps store state to component props var mapStateToProps = function mapStateToProps(state) { // initialize return object var mappedState = {...
javascript
function connectStore(component, keys) { var shouldReturnAFunction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; // function that maps store state to component props var mapStateToProps = function mapStateToProps(state) { // initialize return object var mappedState = {...
[ "function", "connectStore", "(", "component", ",", "keys", ")", "{", "var", "shouldReturnAFunction", "=", "arguments", ".", "length", ">", "2", "&&", "arguments", "[", "2", "]", "!==", "undefined", "?", "arguments", "[", "2", "]", ":", "false", ";", "// ...
creates a mapStateToProps function for connected components takes an array of strings
[ "creates", "a", "mapStateToProps", "function", "for", "connected", "components", "takes", "an", "array", "of", "strings" ]
669e2978b4a7cdd48fbd33d4fd6dbe47e92d3cef
https://github.com/Neil-G/redux-mastermind/blob/669e2978b4a7cdd48fbd33d4fd6dbe47e92d3cef/lib/createMastermind.js#L289-L317
39,281
Neil-G/redux-mastermind
lib/createMastermind.js
mapStateToProps
function mapStateToProps(state) { // initialize return object var mappedState = {}; // populate return object keys.forEach(function (key) { // add selector connection if (key.split(':').length === 2 && selectors[key.split(':')[1]]) { mappedState[key.split(':')[0]] = selectors[key.spli...
javascript
function mapStateToProps(state) { // initialize return object var mappedState = {}; // populate return object keys.forEach(function (key) { // add selector connection if (key.split(':').length === 2 && selectors[key.split(':')[1]]) { mappedState[key.split(':')[0]] = selectors[key.spli...
[ "function", "mapStateToProps", "(", "state", ")", "{", "// initialize return object", "var", "mappedState", "=", "{", "}", ";", "// populate return object", "keys", ".", "forEach", "(", "function", "(", "key", ")", "{", "// add selector connection", "if", "(", "ke...
function that maps store state to component props
[ "function", "that", "maps", "store", "state", "to", "component", "props" ]
669e2978b4a7cdd48fbd33d4fd6dbe47e92d3cef
https://github.com/Neil-G/redux-mastermind/blob/669e2978b4a7cdd48fbd33d4fd6dbe47e92d3cef/lib/createMastermind.js#L294-L315
39,282
vinkaga/angular-mock-backend
mock-angular.js
applyTransform
function applyTransform(data, headers, status, fns) { if (typeof fns === 'function') { data = fns(data, headers, status); } else { for (var i = 0; i < fns.length; i++) { data = fns[i](data, headers, status); } } return data; }
javascript
function applyTransform(data, headers, status, fns) { if (typeof fns === 'function') { data = fns(data, headers, status); } else { for (var i = 0; i < fns.length; i++) { data = fns[i](data, headers, status); } } return data; }
[ "function", "applyTransform", "(", "data", ",", "headers", ",", "status", ",", "fns", ")", "{", "if", "(", "typeof", "fns", "===", "'function'", ")", "{", "data", "=", "fns", "(", "data", ",", "headers", ",", "status", ")", ";", "}", "else", "{", "...
Apply request or response transform @param data @param headers @param status @param fns @returns {*}
[ "Apply", "request", "or", "response", "transform" ]
bed0610d65b223430c9a52ff5c9490e6d9b7ad14
https://github.com/vinkaga/angular-mock-backend/blob/bed0610d65b223430c9a52ff5c9490e6d9b7ad14/mock-angular.js#L65-L74
39,283
vinkaga/angular-mock-backend
mock-angular.js
isMatch
function isMatch(config, mock) { if (angular.isFunction(mock)) { return !!mock(config.method, config.url, config.params, config.data, config.headers); } mock = mock || {}; var fail = false; if (mock.method) { fail = fail || (config.method ? config.method.toLowerCase() : 'get') != mock.method.toLowerCase...
javascript
function isMatch(config, mock) { if (angular.isFunction(mock)) { return !!mock(config.method, config.url, config.params, config.data, config.headers); } mock = mock || {}; var fail = false; if (mock.method) { fail = fail || (config.method ? config.method.toLowerCase() : 'get') != mock.method.toLowerCase...
[ "function", "isMatch", "(", "config", ",", "mock", ")", "{", "if", "(", "angular", ".", "isFunction", "(", "mock", ")", ")", "{", "return", "!", "!", "mock", "(", "config", ".", "method", ",", "config", ".", "url", ",", "config", ".", "params", ","...
Any missing property on mock matches everything @param config @param mock @returns bool
[ "Any", "missing", "property", "on", "mock", "matches", "everything" ]
bed0610d65b223430c9a52ff5c9490e6d9b7ad14
https://github.com/vinkaga/angular-mock-backend/blob/bed0610d65b223430c9a52ff5c9490e6d9b7ad14/mock-angular.js#L82-L117
39,284
vinkaga/angular-mock-backend
mock-angular.js
applyRequestInterceptors
function applyRequestInterceptors(config) { for (var i = 0; i < interceptors.length; i++) { var interceptor = getInterceptor(interceptors[i]); if (interceptor.request) { config = interceptor.request(config); } } if (config.transformRequest) { config.data = applyTransform(config.dat...
javascript
function applyRequestInterceptors(config) { for (var i = 0; i < interceptors.length; i++) { var interceptor = getInterceptor(interceptors[i]); if (interceptor.request) { config = interceptor.request(config); } } if (config.transformRequest) { config.data = applyTransform(config.dat...
[ "function", "applyRequestInterceptors", "(", "config", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "interceptors", ".", "length", ";", "i", "++", ")", "{", "var", "interceptor", "=", "getInterceptor", "(", "interceptors", "[", "i", "]", ...
Apply request interceptors in forward order @param config @returns {*}
[ "Apply", "request", "interceptors", "in", "forward", "order" ]
bed0610d65b223430c9a52ff5c9490e6d9b7ad14
https://github.com/vinkaga/angular-mock-backend/blob/bed0610d65b223430c9a52ff5c9490e6d9b7ad14/mock-angular.js#L196-L207
39,285
vinkaga/angular-mock-backend
mock-angular.js
applyResponseInterceptors
function applyResponseInterceptors(response) { if (response.config.transformResponse) { response.data = applyTransform(response.data, response.headers, response.status, response.config.transformResponse); } for (var i = interceptors.length - 1; i >= 0; i--) { var interceptor = getInterceptor(inter...
javascript
function applyResponseInterceptors(response) { if (response.config.transformResponse) { response.data = applyTransform(response.data, response.headers, response.status, response.config.transformResponse); } for (var i = interceptors.length - 1; i >= 0; i--) { var interceptor = getInterceptor(inter...
[ "function", "applyResponseInterceptors", "(", "response", ")", "{", "if", "(", "response", ".", "config", ".", "transformResponse", ")", "{", "response", ".", "data", "=", "applyTransform", "(", "response", ".", "data", ",", "response", ".", "headers", ",", ...
Apply response interceptors in reverse order @param response @returns {*}
[ "Apply", "response", "interceptors", "in", "reverse", "order" ]
bed0610d65b223430c9a52ff5c9490e6d9b7ad14
https://github.com/vinkaga/angular-mock-backend/blob/bed0610d65b223430c9a52ff5c9490e6d9b7ad14/mock-angular.js#L214-L225
39,286
vinkaga/angular-mock-backend
mock-angular.js
getMock
function getMock(config) { for (var i = 0; i < mocks.length; i++) { if (isMatch(config, mocks[i].config)) { return mocks[i]; } } return undefined; }
javascript
function getMock(config) { for (var i = 0; i < mocks.length; i++) { if (isMatch(config, mocks[i].config)) { return mocks[i]; } } return undefined; }
[ "function", "getMock", "(", "config", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "mocks", ".", "length", ";", "i", "++", ")", "{", "if", "(", "isMatch", "(", "config", ",", "mocks", "[", "i", "]", ".", "config", ")", ")", "{",...
Get mock config if any @param config @returns {*}
[ "Get", "mock", "config", "if", "any" ]
bed0610d65b223430c9a52ff5c9490e6d9b7ad14
https://github.com/vinkaga/angular-mock-backend/blob/bed0610d65b223430c9a52ff5c9490e6d9b7ad14/mock-angular.js#L232-L239
39,287
vinkaga/angular-mock-backend
mock-angular.js
delay
function delay(mock, response) { if (!mock || !mock.delay) { return response; } return $q(function(resolve, reject) { setTimeout(function() { resolve(response); }, mock.delay); }); }
javascript
function delay(mock, response) { if (!mock || !mock.delay) { return response; } return $q(function(resolve, reject) { setTimeout(function() { resolve(response); }, mock.delay); }); }
[ "function", "delay", "(", "mock", ",", "response", ")", "{", "if", "(", "!", "mock", "||", "!", "mock", ".", "delay", ")", "{", "return", "response", ";", "}", "return", "$q", "(", "function", "(", "resolve", ",", "reject", ")", "{", "setTimeout", ...
Insert optional delay in response @param mock @param response @returns {*}
[ "Insert", "optional", "delay", "in", "response" ]
bed0610d65b223430c9a52ff5c9490e6d9b7ad14
https://github.com/vinkaga/angular-mock-backend/blob/bed0610d65b223430c9a52ff5c9490e6d9b7ad14/mock-angular.js#L278-L287
39,288
vinkaga/angular-mock-backend
mock-angular.js
responsePromise
function responsePromise(response) { response.status = response.status || 200; return $q(function(resolve, reject) { (response.status >= 200 && response.status <= 299 ? resolve : reject)(response); }); }
javascript
function responsePromise(response) { response.status = response.status || 200; return $q(function(resolve, reject) { (response.status >= 200 && response.status <= 299 ? resolve : reject)(response); }); }
[ "function", "responsePromise", "(", "response", ")", "{", "response", ".", "status", "=", "response", ".", "status", "||", "200", ";", "return", "$q", "(", "function", "(", "resolve", ",", "reject", ")", "{", "(", "response", ".", "status", ">=", "200", ...
Create promise for mock response @param response @returns {*}
[ "Create", "promise", "for", "mock", "response" ]
bed0610d65b223430c9a52ff5c9490e6d9b7ad14
https://github.com/vinkaga/angular-mock-backend/blob/bed0610d65b223430c9a52ff5c9490e6d9b7ad14/mock-angular.js#L294-L299
39,289
iximiuz/js-itertools
lib/tools.js
makeIter
function makeIter(iterable) { if (typeof iterable[iterSymbol] === 'function') { // passed argument can create iterators - create new one. return iterable[iterSymbol](); } if (!_isSubscriptable(iterable)) { throw Error('Unsupported argument type'); } // passed argument can b...
javascript
function makeIter(iterable) { if (typeof iterable[iterSymbol] === 'function') { // passed argument can create iterators - create new one. return iterable[iterSymbol](); } if (!_isSubscriptable(iterable)) { throw Error('Unsupported argument type'); } // passed argument can b...
[ "function", "makeIter", "(", "iterable", ")", "{", "if", "(", "typeof", "iterable", "[", "iterSymbol", "]", "===", "'function'", ")", "{", "// passed argument can create iterators - create new one.", "return", "iterable", "[", "iterSymbol", "]", "(", ")", ";", "}"...
Makes a new iterator from iterable. NOTE: an existing iterator can be passed to this function. @param {Iterable|Array|String} iterable @returns {Iterator}
[ "Makes", "a", "new", "iterator", "from", "iterable", "." ]
a228cc89c39e959f0461a04cabb4f625bea1fe33
https://github.com/iximiuz/js-itertools/blob/a228cc89c39e959f0461a04cabb4f625bea1fe33/lib/tools.js#L46-L66
39,290
iximiuz/js-itertools
lib/tools.js
toArray
function toArray(iterable) { // kinda optimisations if (isArray(iterable)) { return iterable.slice(); } if (typeof iterable === 'string') { return iterable.split(''); } var iter = ensureIter(iterable); var result = []; var next = iter.next(); while (!next.done) { ...
javascript
function toArray(iterable) { // kinda optimisations if (isArray(iterable)) { return iterable.slice(); } if (typeof iterable === 'string') { return iterable.split(''); } var iter = ensureIter(iterable); var result = []; var next = iter.next(); while (!next.done) { ...
[ "function", "toArray", "(", "iterable", ")", "{", "// kinda optimisations", "if", "(", "isArray", "(", "iterable", ")", ")", "{", "return", "iterable", ".", "slice", "(", ")", ";", "}", "if", "(", "typeof", "iterable", "===", "'string'", ")", "{", "retur...
Unrolls passed iterable producing new array. @param {Iterable|Iterator|Array|String} iterable @returns Array
[ "Unrolls", "passed", "iterable", "producing", "new", "array", "." ]
a228cc89c39e959f0461a04cabb4f625bea1fe33
https://github.com/iximiuz/js-itertools/blob/a228cc89c39e959f0461a04cabb4f625bea1fe33/lib/tools.js#L83-L100
39,291
P2PVPS/openbazaar-node
openbazaar.js
getOBAuth
function getOBAuth(config) { // debugger; // Encoding as per API Specification. const combinedCredential = `${config.clientId}:${config.clientSecret}`; // var base64Credential = window.btoa(combinedCredential); const base64Credential = Buffer.from(combinedCredential).toString("base64"); const readyCredenti...
javascript
function getOBAuth(config) { // debugger; // Encoding as per API Specification. const combinedCredential = `${config.clientId}:${config.clientSecret}`; // var base64Credential = window.btoa(combinedCredential); const base64Credential = Buffer.from(combinedCredential).toString("base64"); const readyCredenti...
[ "function", "getOBAuth", "(", "config", ")", "{", "// debugger;", "// Encoding as per API Specification.", "const", "combinedCredential", "=", "`", "${", "config", ".", "clientId", "}", "${", "config", ".", "clientSecret", "}", "`", ";", "// var base64Credential = win...
Generate an auth key for the header. Required fall all OpenBazaar API calls.
[ "Generate", "an", "auth", "key", "for", "the", "header", ".", "Required", "fall", "all", "OpenBazaar", "API", "calls", "." ]
e75db966dfc56192db44c5fefa9a268975396204
https://github.com/P2PVPS/openbazaar-node/blob/e75db966dfc56192db44c5fefa9a268975396204/openbazaar.js#L45-L55
39,292
P2PVPS/openbazaar-node
openbazaar.js
getNotifications
async function getNotifications(config) { try { const options = { method: "GET", uri: `${config.obServer}:${config.obPort}/ob/notifications`, json: true, // Automatically stringifies the body to JSON headers: { Authorization: config.apiCredentials, }, // resolveWithFull...
javascript
async function getNotifications(config) { try { const options = { method: "GET", uri: `${config.obServer}:${config.obPort}/ob/notifications`, json: true, // Automatically stringifies the body to JSON headers: { Authorization: config.apiCredentials, }, // resolveWithFull...
[ "async", "function", "getNotifications", "(", "config", ")", "{", "try", "{", "const", "options", "=", "{", "method", ":", "\"GET\"", ",", "uri", ":", "`", "${", "config", ".", "obServer", "}", "${", "config", ".", "obPort", "}", "`", ",", "json", ":...
This function returns a Promise that resolves to a list of notifications recieved by the OB store.
[ "This", "function", "returns", "a", "Promise", "that", "resolves", "to", "a", "list", "of", "notifications", "recieved", "by", "the", "OB", "store", "." ]
e75db966dfc56192db44c5fefa9a268975396204
https://github.com/P2PVPS/openbazaar-node/blob/e75db966dfc56192db44c5fefa9a268975396204/openbazaar.js#L59-L77
39,293
P2PVPS/openbazaar-node
openbazaar.js
createListing
function createListing(config, listingData) { const options = { method: "POST", uri: `${config.obServer}:${config.obPort}/ob/listing/`, body: listingData, json: true, // Automatically stringifies the body to JSON headers: { Authorization: config.apiCredentials, }, }; return rp(optio...
javascript
function createListing(config, listingData) { const options = { method: "POST", uri: `${config.obServer}:${config.obPort}/ob/listing/`, body: listingData, json: true, // Automatically stringifies the body to JSON headers: { Authorization: config.apiCredentials, }, }; return rp(optio...
[ "function", "createListing", "(", "config", ",", "listingData", ")", "{", "const", "options", "=", "{", "method", ":", "\"POST\"", ",", "uri", ":", "`", "${", "config", ".", "obServer", "}", "${", "config", ".", "obPort", "}", "`", ",", "body", ":", ...
Create a listing in the OB store.
[ "Create", "a", "listing", "in", "the", "OB", "store", "." ]
e75db966dfc56192db44c5fefa9a268975396204
https://github.com/P2PVPS/openbazaar-node/blob/e75db966dfc56192db44c5fefa9a268975396204/openbazaar.js#L137-L149
39,294
P2PVPS/openbazaar-node
openbazaar.js
createProfile
function createProfile(config, profileData) { const options = { method: "POST", uri: `${config.obServer}:${config.obPort}/ob/profile/`, body: profileData, json: true, // Automatically stringifies the body to JSON headers: { Authorization: config.apiCredentials, }, // resolveWithFullR...
javascript
function createProfile(config, profileData) { const options = { method: "POST", uri: `${config.obServer}:${config.obPort}/ob/profile/`, body: profileData, json: true, // Automatically stringifies the body to JSON headers: { Authorization: config.apiCredentials, }, // resolveWithFullR...
[ "function", "createProfile", "(", "config", ",", "profileData", ")", "{", "const", "options", "=", "{", "method", ":", "\"POST\"", ",", "uri", ":", "`", "${", "config", ".", "obServer", "}", "${", "config", ".", "obPort", "}", "`", ",", "body", ":", ...
Create a profile for a new store
[ "Create", "a", "profile", "for", "a", "new", "store" ]
e75db966dfc56192db44c5fefa9a268975396204
https://github.com/P2PVPS/openbazaar-node/blob/e75db966dfc56192db44c5fefa9a268975396204/openbazaar.js#L168-L181
39,295
P2PVPS/openbazaar-node
openbazaar.js
getExchangeRate
function getExchangeRate(config) { const options = { method: "GET", uri: `${config.obServer}:${config.obPort}/ob/exchangerate`, json: true, // Automatically stringifies the body to JSON headers: { Authorization: config.apiCredentials, }, // resolveWithFullResponse: true }; return rp...
javascript
function getExchangeRate(config) { const options = { method: "GET", uri: `${config.obServer}:${config.obPort}/ob/exchangerate`, json: true, // Automatically stringifies the body to JSON headers: { Authorization: config.apiCredentials, }, // resolveWithFullResponse: true }; return rp...
[ "function", "getExchangeRate", "(", "config", ")", "{", "const", "options", "=", "{", "method", ":", "\"GET\"", ",", "uri", ":", "`", "${", "config", ".", "obServer", "}", "${", "config", ".", "obPort", "}", "`", ",", "json", ":", "true", ",", "// Au...
Get wallet balance
[ "Get", "wallet", "balance" ]
e75db966dfc56192db44c5fefa9a268975396204
https://github.com/P2PVPS/openbazaar-node/blob/e75db966dfc56192db44c5fefa9a268975396204/openbazaar.js#L199-L211
39,296
mikolalysenko/planar-dual
loops.js
cut
function cut(c, i) { var a = adj[i][c[i]] a.splice(a.indexOf(c), 1) }
javascript
function cut(c, i) { var a = adj[i][c[i]] a.splice(a.indexOf(c), 1) }
[ "function", "cut", "(", "c", ",", "i", ")", "{", "var", "a", "=", "adj", "[", "i", "]", "[", "c", "[", "i", "]", "]", "a", ".", "splice", "(", "a", ".", "indexOf", "(", "c", ")", ",", "1", ")", "}" ]
Remove a half edge
[ "Remove", "a", "half", "edge" ]
b67fdd01b1f9f2aba08fcbac0fe8139ee96be261
https://github.com/mikolalysenko/planar-dual/blob/b67fdd01b1f9f2aba08fcbac0fe8139ee96be261/loops.js#L32-L35
39,297
mikolalysenko/planar-dual
loops.js
next
function next(a, b, noCut) { var nextCell, nextVertex, nextDir for(var i=0; i<2; ++i) { if(adj[i][b].length > 0) { nextCell = adj[i][b][0] nextDir = i break } } nextVertex = nextCell[nextDir^1] for(var dir=0; dir<2; ++dir) { var nbhd = adj[dir][b] for...
javascript
function next(a, b, noCut) { var nextCell, nextVertex, nextDir for(var i=0; i<2; ++i) { if(adj[i][b].length > 0) { nextCell = adj[i][b][0] nextDir = i break } } nextVertex = nextCell[nextDir^1] for(var dir=0; dir<2; ++dir) { var nbhd = adj[dir][b] for...
[ "function", "next", "(", "a", ",", "b", ",", "noCut", ")", "{", "var", "nextCell", ",", "nextVertex", ",", "nextDir", "for", "(", "var", "i", "=", "0", ";", "i", "<", "2", ";", "++", "i", ")", "{", "if", "(", "adj", "[", "i", "]", "[", "b",...
Find next vertex and cut edge
[ "Find", "next", "vertex", "and", "cut", "edge" ]
b67fdd01b1f9f2aba08fcbac0fe8139ee96be261
https://github.com/mikolalysenko/planar-dual/blob/b67fdd01b1f9f2aba08fcbac0fe8139ee96be261/loops.js#L38-L73
39,298
LaxarJS/laxar-angular-adapter
lib/services/visibility_service.js
handlerFor
function handlerFor( scope ) { const { axVisibility } = widgetServices( scope ); axVisibility.onChange( updateState ); scope.$on( '$destroy', () => { axVisibility.unsubscribe( updateState ); } ); let lastState = axVisibility.isVisible(); /** * A scope bound visibi...
javascript
function handlerFor( scope ) { const { axVisibility } = widgetServices( scope ); axVisibility.onChange( updateState ); scope.$on( '$destroy', () => { axVisibility.unsubscribe( updateState ); } ); let lastState = axVisibility.isVisible(); /** * A scope bound visibi...
[ "function", "handlerFor", "(", "scope", ")", "{", "const", "{", "axVisibility", "}", "=", "widgetServices", "(", "scope", ")", ";", "axVisibility", ".", "onChange", "(", "updateState", ")", ";", "scope", ".", "$on", "(", "'$destroy'", ",", "(", ")", "=>"...
Create a DOM visibility handler for the given scope. @param {Object} scope the scope from which to infer visibility. Must be a widget scope or nested in a widget scope @return {axVisibilityServiceHandler} a visibility handler for the given scope @memberOf axVisibilityService
[ "Create", "a", "DOM", "visibility", "handler", "for", "the", "given", "scope", "." ]
62306263c6146c71271a929585f4bd39727cb2e0
https://github.com/LaxarJS/laxar-angular-adapter/blob/62306263c6146c71271a929585f4bd39727cb2e0/lib/services/visibility_service.js#L53-L197
39,299
LaxarJS/laxar-angular-adapter
lib/services/visibility_service.js
updateState
function updateState( targetState ) { const state = axVisibility.isVisible(); if( state === lastState ) { return; } lastState = state; heartbeat.onAfterNext( () => { const handlers = targetState ? showHandlers : hideHandlers; ...
javascript
function updateState( targetState ) { const state = axVisibility.isVisible(); if( state === lastState ) { return; } lastState = state; heartbeat.onAfterNext( () => { const handlers = targetState ? showHandlers : hideHandlers; ...
[ "function", "updateState", "(", "targetState", ")", "{", "const", "state", "=", "axVisibility", ".", "isVisible", "(", ")", ";", "if", "(", "state", "===", "lastState", ")", "{", "return", ";", "}", "lastState", "=", "state", ";", "heartbeat", ".", "onAf...
eslint-disable-next-line valid-jsdoc Run all handlers registered for the given area and target state after the next heartbeat. Also remove any handlers that have been cleared since the last run. @private
[ "eslint", "-", "disable", "-", "next", "-", "line", "valid", "-", "jsdoc", "Run", "all", "handlers", "registered", "for", "the", "given", "area", "and", "target", "state", "after", "the", "next", "heartbeat", ".", "Also", "remove", "any", "handlers", "that...
62306263c6146c71271a929585f4bd39727cb2e0
https://github.com/LaxarJS/laxar-angular-adapter/blob/62306263c6146c71271a929585f4bd39727cb2e0/lib/services/visibility_service.js#L168-L178