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
18,300
Reportr/dashboard
public/build/static/application.js
mixin
function mixin(object, source, options) { var chain = true, methodNames = source && functions(source); if (!source || (!options && !methodNames.length)) { if (options == null) { options = source; } source = object; object = lodash; methodNames = f...
javascript
function mixin(object, source, options) { var chain = true, methodNames = source && functions(source); if (!source || (!options && !methodNames.length)) { if (options == null) { options = source; } source = object; object = lodash; methodNames = f...
[ "function", "mixin", "(", "object", ",", "source", ",", "options", ")", "{", "var", "chain", "=", "true", ",", "methodNames", "=", "source", "&&", "functions", "(", "source", ")", ";", "if", "(", "!", "source", "||", "(", "!", "options", "&&", "!", ...
Adds function properties of a source object to the destination object. If `object` is a function methods will be added to its prototype as well. @static @memberOf _ @category Utilities @param {Function|Object} [object=lodash] object The destination object. @param {Object} source The object of functions to add. @param ...
[ "Adds", "function", "properties", "of", "a", "source", "object", "to", "the", "destination", "object", ".", "If", "object", "is", "a", "function", "methods", "will", "be", "added", "to", "its", "prototype", "as", "well", "." ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L20369-L20415
18,301
Reportr/dashboard
public/build/static/application.js
result
function result(object, key, defaultValue) { var value = object == null ? undefined : object[key]; if (typeof value == 'undefined') { return defaultValue; } return isFunction(value) ? object[key]() : value; }
javascript
function result(object, key, defaultValue) { var value = object == null ? undefined : object[key]; if (typeof value == 'undefined') { return defaultValue; } return isFunction(value) ? object[key]() : value; }
[ "function", "result", "(", "object", ",", "key", ",", "defaultValue", ")", "{", "var", "value", "=", "object", "==", "null", "?", "undefined", ":", "object", "[", "key", "]", ";", "if", "(", "typeof", "value", "==", "'undefined'", ")", "{", "return", ...
Resolves the value of property `key` on `object`. If `key` is a function it will be invoked with the `this` binding of `object` and its result returned, else the property value is returned. If `object` is `null` or `undefined` then `undefined` is returned. If a default value is provided it will be returned if the prope...
[ "Resolves", "the", "value", "of", "property", "key", "on", "object", ".", "If", "key", "is", "a", "function", "it", "will", "be", "invoked", "with", "the", "this", "binding", "of", "object", "and", "its", "result", "returned", "else", "the", "property", ...
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L20617-L20623
18,302
Reportr/dashboard
public/build/static/application.js
function(obj, name, callback) { var listeningTo = this._listeningTo; if (!listeningTo) return this; var remove = !name && !callback; if (!callback && typeof name === 'object') callback = this; if (obj) (listeningTo = {})[obj.cid] = obj; for (var i...
javascript
function(obj, name, callback) { var listeningTo = this._listeningTo; if (!listeningTo) return this; var remove = !name && !callback; if (!callback && typeof name === 'object') callback = this; if (obj) (listeningTo = {})[obj.cid] = obj; for (var i...
[ "function", "(", "obj", ",", "name", ",", "callback", ")", "{", "var", "listeningTo", "=", "this", ".", "_listeningTo", ";", "if", "(", "!", "listeningTo", ")", "return", "this", ";", "var", "remove", "=", "!", "name", "&&", "!", "callback", ";", "if...
Tell this object to stop listening to either specific events or to every object it's currently listening to. @method stopListening @param {Class} [obj] object to stop listening to @param {string} [name] event to stop listening for @param {function} [callback] callback to stop listening for @chainable
[ "Tell", "this", "object", "to", "stop", "listening", "to", "either", "specific", "events", "or", "to", "every", "object", "it", "s", "currently", "listening", "to", "." ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L21363-L21376
18,303
Reportr/dashboard
public/build/static/application.js
function(namespace, key) { key = JSON.stringify(key); return "cache_" + configs.revision + "_" + namespace + "_" + key; }
javascript
function(namespace, key) { key = JSON.stringify(key); return "cache_" + configs.revision + "_" + namespace + "_" + key; }
[ "function", "(", "namespace", ",", "key", ")", "{", "key", "=", "JSON", ".", "stringify", "(", "key", ")", ";", "return", "\"cache_\"", "+", "configs", ".", "revision", "+", "\"_\"", "+", "namespace", "+", "\"_\"", "+", "key", ";", "}" ]
Transform a key in cache key @method key @param {string} namespace namespace for this key @param {string} key key of the data to cache @return {string} complete key for the cache
[ "Transform", "a", "key", "in", "cache", "key" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L21907-L21910
18,304
Reportr/dashboard
public/build/static/application.js
function(namespace, key) { var ckey = Cache.key(namespace, key); var ctime = (new Date()).getTime(); var v = Storage.get(ckey); if (v == null) { return null; } else { if (v.expiration == -1 || v.expiration > ctime) { ...
javascript
function(namespace, key) { var ckey = Cache.key(namespace, key); var ctime = (new Date()).getTime(); var v = Storage.get(ckey); if (v == null) { return null; } else { if (v.expiration == -1 || v.expiration > ctime) { ...
[ "function", "(", "namespace", ",", "key", ")", "{", "var", "ckey", "=", "Cache", ".", "key", "(", "namespace", ",", "key", ")", ";", "var", "ctime", "=", "(", "new", "Date", "(", ")", ")", ".", "getTime", "(", ")", ";", "var", "v", "=", "Storag...
Get data from the cache @method get @param {string} namespace namespace for this key @param {string} key key of the data to cache @return {object} value from the cache
[ "Get", "data", "from", "the", "cache" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L21920-L21935
18,305
Reportr/dashboard
public/build/static/application.js
function(namespace, key) { var ckey = Cache.key(namespace, key); var ctime = (new Date()).getTime(); Storage.remove(ckey); }
javascript
function(namespace, key) { var ckey = Cache.key(namespace, key); var ctime = (new Date()).getTime(); Storage.remove(ckey); }
[ "function", "(", "namespace", ",", "key", ")", "{", "var", "ckey", "=", "Cache", ".", "key", "(", "namespace", ",", "key", ")", ";", "var", "ctime", "=", "(", "new", "Date", "(", ")", ")", ".", "getTime", "(", ")", ";", "Storage", ".", "remove", ...
Delete a cache value @method remove @param {string} namespace namespace for this key @param {string} key key of the data to cache
[ "Delete", "a", "cache", "value" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L21944-L21948
18,306
Reportr/dashboard
public/build/static/application.js
function(namespace, key, value, expiration) { var ckey = Cache.key(namespace, key); var ctime = (new Date()).getTime(); if (expiration > 0) { expiration = ctime + expiration * 1000; } else { expiration = -1; } Stor...
javascript
function(namespace, key, value, expiration) { var ckey = Cache.key(namespace, key); var ctime = (new Date()).getTime(); if (expiration > 0) { expiration = ctime + expiration * 1000; } else { expiration = -1; } Stor...
[ "function", "(", "namespace", ",", "key", ",", "value", ",", "expiration", ")", "{", "var", "ckey", "=", "Cache", ".", "key", "(", "namespace", ",", "key", ")", ";", "var", "ctime", "=", "(", "new", "Date", "(", ")", ")", ".", "getTime", "(", ")"...
Set a data in the cache @method get @param {string} namespace namespace for this key @param {string} key key of the data to cache @param {object} value value to store in teh cache associated to this key @param {number} [expiration] seconds before epiration of this value in the cache
[ "Set", "a", "data", "in", "the", "cache" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L21959-L21974
18,307
Reportr/dashboard
public/build/static/application.js
function() { var s = Storage.storage(); if (s == null) { return false; } Object.keys(s).forEach(function(key){ if (/^(cache_)/.test(key)) { s.removeItem(key); } }); }
javascript
function() { var s = Storage.storage(); if (s == null) { return false; } Object.keys(s).forEach(function(key){ if (/^(cache_)/.test(key)) { s.removeItem(key); } }); }
[ "function", "(", ")", "{", "var", "s", "=", "Storage", ".", "storage", "(", ")", ";", "if", "(", "s", "==", "null", ")", "{", "return", "false", ";", "}", "Object", ".", "keys", "(", "s", ")", ".", "forEach", "(", "function", "(", "key", ")", ...
Clear the entire cache @method clear
[ "Clear", "the", "entire", "cache" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L21981-L21991
18,308
Reportr/dashboard
public/build/static/application.js
function(namespace) { var ncache = {}; _.each(cache_methods, function(method) { ncache[method] = _.partial(Cache[method], namespace); }) return ncache; }
javascript
function(namespace) { var ncache = {}; _.each(cache_methods, function(method) { ncache[method] = _.partial(Cache[method], namespace); }) return ncache; }
[ "function", "(", "namespace", ")", "{", "var", "ncache", "=", "{", "}", ";", "_", ".", "each", "(", "cache_methods", ",", "function", "(", "method", ")", "{", "ncache", "[", "method", "]", "=", "_", ".", "partial", "(", "Cache", "[", "method", "]",...
Return a cahce interface for a specific namespace @method namespace @param {string} namespace name of the namespace
[ "Return", "a", "cahce", "interface", "for", "a", "specific", "namespace" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L21999-L22005
18,309
Reportr/dashboard
public/build/static/application.js
function() { if (!this.available) return; if (window.applicationCache.status === window.applicationCache.UPDATEREADY) { this.trigger("update"); } return window.applicationCache.status === window.applicationCache.UPDATEREADY; }
javascript
function() { if (!this.available) return; if (window.applicationCache.status === window.applicationCache.UPDATEREADY) { this.trigger("update"); } return window.applicationCache.status === window.applicationCache.UPDATEREADY; }
[ "function", "(", ")", "{", "if", "(", "!", "this", ".", "available", ")", "return", ";", "if", "(", "window", ".", "applicationCache", ".", "status", "===", "window", ".", "applicationCache", ".", "UPDATEREADY", ")", "{", "this", ".", "trigger", "(", "...
Check for cache update
[ "Check", "for", "cache", "update" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L22490-L22497
18,310
Reportr/dashboard
public/build/static/application.js
function(state) { if (state == this.state) return; this.state = state; logging.log("state ", this.state); this.trigger("state", this.state); }
javascript
function(state) { if (state == this.state) return; this.state = state; logging.log("state ", this.state); this.trigger("state", this.state); }
[ "function", "(", "state", ")", "{", "if", "(", "state", "==", "this", ".", "state", ")", "return", ";", "this", ".", "state", "=", "state", ";", "logging", ".", "log", "(", "\"state \"", ",", "this", ".", "state", ")", ";", "this", ".", "trigger", ...
Set connexion status
[ "Set", "connexion", "status" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L22500-L22506
18,311
Reportr/dashboard
public/build/static/application.js
function(title) { if (this._preTitle.length > 0) title = this._preTitle + " " + title; if (_.size(title) == 0) return this.app.name; return title + " - " + this.app.name; }
javascript
function(title) { if (this._preTitle.length > 0) title = this._preTitle + " " + title; if (_.size(title) == 0) return this.app.name; return title + " - " + this.app.name; }
[ "function", "(", "title", ")", "{", "if", "(", "this", ".", "_preTitle", ".", "length", ">", "0", ")", "title", "=", "this", ".", "_preTitle", "+", "\" \"", "+", "title", ";", "if", "(", "_", ".", "size", "(", "title", ")", "==", "0", ")", "ret...
Transform a page name in complete title @method completeTitle @param {string} title title of the page @return {string} complete name with application name
[ "Transform", "a", "page", "name", "in", "complete", "title" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L23076-L23080
18,312
Reportr/dashboard
public/build/static/application.js
function(name, value, metaName) { if (_.isObject(name)) { _.each(name, function(value, name) { this.meta(name, value); }, this); return; } if (metaName == null) metaName = "name"; var mt = this.$('meta['...
javascript
function(name, value, metaName) { if (_.isObject(name)) { _.each(name, function(value, name) { this.meta(name, value); }, this); return; } if (metaName == null) metaName = "name"; var mt = this.$('meta['...
[ "function", "(", "name", ",", "value", ",", "metaName", ")", "{", "if", "(", "_", ".", "isObject", "(", "name", ")", ")", "{", "_", ".", "each", "(", "name", ",", "function", "(", "value", ",", "name", ")", "{", "this", ".", "meta", "(", "name"...
Set or get a meta tag value @method meta @param {string} name name of the meta tag @param {string} [value] value to set on the meta tag @param {string} [metaName="name"] selector for the meta name @return {string} value of the meta tag
[ "Set", "or", "get", "a", "meta", "tag", "value" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L23091-L23110
18,313
Reportr/dashboard
public/build/static/application.js
function(rel, href, mimetype) { if (_.isObject(rel)) { _.each(rel, function(value, name) { this.link(name, value); }, this); return; } var mt = this.$('link[rel="'+rel+'"]'); if (mt.length === 0) { ...
javascript
function(rel, href, mimetype) { if (_.isObject(rel)) { _.each(rel, function(value, name) { this.link(name, value); }, this); return; } var mt = this.$('link[rel="'+rel+'"]'); if (mt.length === 0) { ...
[ "function", "(", "rel", ",", "href", ",", "mimetype", ")", "{", "if", "(", "_", ".", "isObject", "(", "rel", ")", ")", "{", "_", ".", "each", "(", "rel", ",", "function", "(", "value", ",", "name", ")", "{", "this", ".", "link", "(", "name", ...
Set or get a link tag value @method link @param {string} ref name of the link tag @param {string} [href] value to set on the link tag @param {string} [mimetype] mimetype for this link @return {string} value of the link tag
[ "Set", "or", "get", "a", "link", "tag", "value" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L23121-L23139
18,314
Reportr/dashboard
public/build/static/application.js
function(value, absolute) { var mt = this.$('title'); if (mt.length === 0) { mt = $("<title>", {}).appendTo(this.$el); } if (value != null) { this._title = value; if (absolute !== false) value = this.completeTitle(value); ...
javascript
function(value, absolute) { var mt = this.$('title'); if (mt.length === 0) { mt = $("<title>", {}).appendTo(this.$el); } if (value != null) { this._title = value; if (absolute !== false) value = this.completeTitle(value); ...
[ "function", "(", "value", ",", "absolute", ")", "{", "var", "mt", "=", "this", ".", "$", "(", "'title'", ")", ";", "if", "(", "mt", ".", "length", "===", "0", ")", "{", "mt", "=", "$", "(", "\"<title>\"", ",", "{", "}", ")", ".", "appendTo", ...
Set or get the page title @method title @param {string} value value for the title @param {boolean} [absolute] if true, it'll not use completeTitle @return {string} value of the title
[ "Set", "or", "get", "the", "page", "title" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L23149-L23161
18,315
Reportr/dashboard
public/build/static/application.js
function(index, follow) { if (_.isNull(follow)) follow = index; var value = ""; value = index ? "index" : "noindex"; value = value + "," + (follow ? "follow" : "nofollow"); this.meta("robots", value); return this; }
javascript
function(index, follow) { if (_.isNull(follow)) follow = index; var value = ""; value = index ? "index" : "noindex"; value = value + "," + (follow ? "follow" : "nofollow"); this.meta("robots", value); return this; }
[ "function", "(", "index", ",", "follow", ")", "{", "if", "(", "_", ".", "isNull", "(", "follow", ")", ")", "follow", "=", "index", ";", "var", "value", "=", "\"\"", ";", "value", "=", "index", "?", "\"index\"", ":", "\"noindex\"", ";", "value", "="...
Active or desactive page indexation using robots meta tag @method setCrawling @param {boolean} index @return {boolean} follow
[ "Active", "or", "desactive", "page", "indexation", "using", "robots", "meta", "tag" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L23195-L23202
18,316
Reportr/dashboard
public/build/static/application.js
function() { if (this.started) { logging.warn("routing history already started"); return false; } var self = this; var $window = $(window); var rootUrl = document.location.protocol+'//'+(document.location.hostname||document.loc...
javascript
function() { if (this.started) { logging.warn("routing history already started"); return false; } var self = this; var $window = $(window); var rootUrl = document.location.protocol+'//'+(document.location.hostname||document.loc...
[ "function", "(", ")", "{", "if", "(", "this", ".", "started", ")", "{", "logging", ".", "warn", "(", "\"routing history already started\"", ")", ";", "return", "false", ";", "}", "var", "self", "=", "this", ";", "var", "$window", "=", "$", "(", "window...
Add the navigation handling @method start @chainable
[ "Add", "the", "navigation", "handling" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L23262-L23279
18,317
Reportr/dashboard
public/build/static/application.js
function(route, args) { url = urls.route(route, args); logging.log("navigate to ", url); window.location.hash = url; return this; }
javascript
function(route, args) { url = urls.route(route, args); logging.log("navigate to ", url); window.location.hash = url; return this; }
[ "function", "(", "route", ",", "args", ")", "{", "url", "=", "urls", ".", "route", "(", "route", ",", "args", ")", ";", "logging", ".", "log", "(", "\"navigate to \"", ",", "url", ")", ";", "window", ".", "location", ".", "hash", "=", "url", ";", ...
Navigation to a specific route @method navigate @param {string} route to navigate to @param {object} [args] arguments for the route @chainable
[ "Navigation", "to", "a", "specific", "route" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L23289-L23294
18,318
Reportr/dashboard
public/build/static/application.js
function(route, name) { var handler; if (_.isObject(route) && !_.isRegExp(route)) { _.each(route, function(callback, route) { this.route(route, callback); }, this); return this; } handler = this[name]; ...
javascript
function(route, name) { var handler; if (_.isObject(route) && !_.isRegExp(route)) { _.each(route, function(callback, route) { this.route(route, callback); }, this); return this; } handler = this[name]; ...
[ "function", "(", "route", ",", "name", ")", "{", "var", "handler", ";", "if", "(", "_", ".", "isObject", "(", "route", ")", "&&", "!", "_", ".", "isRegExp", "(", "route", ")", ")", "{", "_", ".", "each", "(", "route", ",", "function", "(", "cal...
Add new route @method route @param {string} route regex or route string @param {string} name method to use as a route callback @return {string} page title
[ "Add", "new", "route" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L23560-L23587
18,319
Reportr/dashboard
public/build/static/application.js
function(models, options) { options = _.defaults(options || {}, { totalCount: false }); // Manage {list:[], n:0} for infinite list if (_.size(models) == 2 && models.list != null && models.n != null) { this._totalCount = models....
javascript
function(models, options) { options = _.defaults(options || {}, { totalCount: false }); // Manage {list:[], n:0} for infinite list if (_.size(models) == 2 && models.list != null && models.n != null) { this._totalCount = models....
[ "function", "(", "models", ",", "options", ")", "{", "options", "=", "_", ".", "defaults", "(", "options", "||", "{", "}", ",", "{", "totalCount", ":", "false", "}", ")", ";", "// Manage {list:[], n:0} for infinite list", "if", "(", "_", ".", "size", "("...
Reset the collection with new models or new data. @method reset @param {array} models array of models or data to set in the collection @param {object} [options] options for reseting @chainable
[ "Reset", "the", "collection", "with", "new", "models", "or", "new", "data", "." ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L24829-L24856
18,320
Reportr/dashboard
public/build/static/application.js
function(model, options) { var index; if (_.isArray(model)) { _.each(model, function(m) { this.remove(m, options); }, this); return this; } options = _.defaults(options || {}, { silent: ...
javascript
function(model, options) { var index; if (_.isArray(model)) { _.each(model, function(m) { this.remove(m, options); }, this); return this; } options = _.defaults(options || {}, { silent: ...
[ "function", "(", "model", ",", "options", ")", "{", "var", "index", ";", "if", "(", "_", ".", "isArray", "(", "model", ")", ")", "{", "_", ".", "each", "(", "model", ",", "function", "(", "m", ")", "{", "this", ".", "remove", "(", "m", ",", "...
Remove a model from the collection. @method remove @param {Model} model model or data to remove @param {object} [options] options for removing @chainable
[ "Remove", "a", "model", "from", "the", "collection", "." ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L24929-L24961
18,321
Reportr/dashboard
public/build/static/application.js
function(model, options) { model = this._prepareModel(model, options); this.add(model, options); return model; }
javascript
function(model, options) { model = this._prepareModel(model, options); this.add(model, options); return model; }
[ "function", "(", "model", ",", "options", ")", "{", "model", "=", "this", ".", "_prepareModel", "(", "model", ",", "options", ")", ";", "this", ".", "add", "(", "model", ",", "options", ")", ";", "return", "model", ";", "}" ]
Add a model at the end of the collection. @method push @param {Model} model model or data to add @param {object} [options] options for adding @return {Model} Return the new added model
[ "Add", "a", "model", "at", "the", "end", "of", "the", "collection", "." ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L25000-L25004
18,322
Reportr/dashboard
public/build/static/application.js
function(options) { this.queue.defer(function() { options = _.defaults(options || {}, { refresh: false }); var d, self = this; if (this.options.loader == null) return this; if (options.refresh) { ...
javascript
function(options) { this.queue.defer(function() { options = _.defaults(options || {}, { refresh: false }); var d, self = this; if (this.options.loader == null) return this; if (options.refresh) { ...
[ "function", "(", "options", ")", "{", "this", ".", "queue", ".", "defer", "(", "function", "(", ")", "{", "options", "=", "_", ".", "defaults", "(", "options", "||", "{", "}", ",", "{", "refresh", ":", "false", "}", ")", ";", "var", "d", ",", "...
Get more elements from an infinite collection @method getMore @chainable
[ "Get", "more", "elements", "from", "an", "infinite", "collection" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L25134-L25162
18,323
Reportr/dashboard
public/build/static/application.js
function(method, properties) { if (this.methods[method]) throw "Method already define for this backend: "+method; properties.id = method; properties.regexp = this.routeToRegExp(method); this.methods[method] = properties; return this; }
javascript
function(method, properties) { if (this.methods[method]) throw "Method already define for this backend: "+method; properties.id = method; properties.regexp = this.routeToRegExp(method); this.methods[method] = properties; return this; }
[ "function", "(", "method", ",", "properties", ")", "{", "if", "(", "this", ".", "methods", "[", "method", "]", ")", "throw", "\"Method already define for this backend: \"", "+", "method", ";", "properties", ".", "id", "=", "method", ";", "properties", ".", "...
Add a backend method @method addMethod @param {string} method name for this method @param {object} informations about this method
[ "Add", "a", "backend", "method" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L25705-L25713
18,324
Reportr/dashboard
public/build/static/application.js
function(method, sId) { sId = sId || method; sId = this.options.prefix+"."+sId; return this.addMethod(method, { fallback: function(args, options, method) { return Storage.get(sId+"."+method); }, after: function(args,...
javascript
function(method, sId) { sId = sId || method; sId = this.options.prefix+"."+sId; return this.addMethod(method, { fallback: function(args, options, method) { return Storage.get(sId+"."+method); }, after: function(args,...
[ "function", "(", "method", ",", "sId", ")", "{", "sId", "=", "sId", "||", "method", ";", "sId", "=", "this", ".", "options", ".", "prefix", "+", "\".\"", "+", "sId", ";", "return", "this", ".", "addMethod", "(", "method", ",", "{", "fallback", ":",...
Add a cached method for offline mode only @method addCachedMethod @param {string} method name for this method @param {string} [sId] id used for caching
[ "Add", "a", "cached", "method", "for", "offline", "mode", "only" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L25722-L25733
18,325
Reportr/dashboard
public/build/static/application.js
function(method) { return _.find(this.methods, function(handler) { return handler.regexp.test(method); }) || this.defaultHandler; }
javascript
function(method) { return _.find(this.methods, function(handler) { return handler.regexp.test(method); }) || this.defaultHandler; }
[ "function", "(", "method", ")", "{", "return", "_", ".", "find", "(", "this", ".", "methods", ",", "function", "(", "handler", ")", "{", "return", "handler", ".", "regexp", ".", "test", "(", "method", ")", ";", "}", ")", "||", "this", ".", "default...
Get the method handler to use for a method @method getHandler
[ "Get", "the", "method", "handler", "to", "use", "for", "a", "method" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L25740-L25744
18,326
Reportr/dashboard
public/build/static/application.js
function(method, args, options) { var that = this, methodHandler; options = options || {}; var handler = this.getHandler(method); if (!handler) return Q.reject(new Error("No handler found for method: "+method)); // Is offline if (!Offline.isConn...
javascript
function(method, args, options) { var that = this, methodHandler; options = options || {}; var handler = this.getHandler(method); if (!handler) return Q.reject(new Error("No handler found for method: "+method)); // Is offline if (!Offline.isConn...
[ "function", "(", "method", ",", "args", ",", "options", ")", "{", "var", "that", "=", "this", ",", "methodHandler", ";", "options", "=", "options", "||", "{", "}", ";", "var", "handler", "=", "this", ".", "getHandler", "(", "method", ")", ";", "if", ...
Execute a method @method execute @param {string} method name of the method to execute @param {object} args arguments for this method @param {options} [options] options for execution @return {promise<object>}
[ "Execute", "a", "method" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L25767-L25799
18,327
Reportr/dashboard
public/build/static/application.js
function (url, protocol, hostname, port) { var match = text.xdRegExp.exec(url), uProtocol, uHostName, uPort; if (!match) { return true; } uProtocol = match[2]; uHostName = match[3]; u...
javascript
function (url, protocol, hostname, port) { var match = text.xdRegExp.exec(url), uProtocol, uHostName, uPort; if (!match) { return true; } uProtocol = match[2]; uHostName = match[3]; u...
[ "function", "(", "url", ",", "protocol", ",", "hostname", ",", "port", ")", "{", "var", "match", "=", "text", ".", "xdRegExp", ".", "exec", "(", "url", ")", ",", "uProtocol", ",", "uHostName", ",", "uPort", ";", "if", "(", "!", "match", ")", "{", ...
Is an URL on another domain. Only works for browser use, returns false in non-browser environments. Only used to know if an optimized .js version of a text resource should be loaded instead. @param {String} url @returns Boolean
[ "Is", "an", "URL", "on", "another", "domain", ".", "Only", "works", "for", "browser", "use", "returns", "false", "in", "non", "-", "browser", "environments", ".", "Only", "used", "to", "know", "if", "an", "optimized", ".", "js", "version", "of", "a", "...
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L26162-L26178
18,328
Reportr/dashboard
public/build/static/application.js
function(cls, options) { var d = Q.defer(); cls = cls || DialogView; var diag = new cls(options); diag.once("close", function(result, e) { if (result != null) { d.resolve(result); } else { d.reject(...
javascript
function(cls, options) { var d = Q.defer(); cls = cls || DialogView; var diag = new cls(options); diag.once("close", function(result, e) { if (result != null) { d.resolve(result); } else { d.reject(...
[ "function", "(", "cls", ",", "options", ")", "{", "var", "d", "=", "Q", ".", "defer", "(", ")", ";", "cls", "=", "cls", "||", "DialogView", ";", "var", "diag", "=", "new", "cls", "(", "options", ")", ";", "diag", ".", "once", "(", "\"close\"", ...
Open a dialog from a specific view class with some configuration @param {DialogView} cls dialog view class @param {options} options dialog view constructor options @return {promise}
[ "Open", "a", "dialog", "from", "a", "specific", "view", "class", "with", "some", "configuration" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L26446-L26465
18,329
Reportr/dashboard
public/build/static/application.js
function(title, message, defaultmsg) { return Dialogs.open(null, { "title": title, "message": message, "dialog": "prompt", "default": defaultmsg, "autoFocus": true, "valueSelector": "selectorPrompt" }...
javascript
function(title, message, defaultmsg) { return Dialogs.open(null, { "title": title, "message": message, "dialog": "prompt", "default": defaultmsg, "autoFocus": true, "valueSelector": "selectorPrompt" }...
[ "function", "(", "title", ",", "message", ",", "defaultmsg", ")", "{", "return", "Dialogs", ".", "open", "(", "null", ",", "{", "\"title\"", ":", "title", ",", "\"message\"", ":", "message", ",", "\"dialog\"", ":", "\"prompt\"", ",", "\"default\"", ":", ...
Open a prompt modal dialog @param {string} title @param {string} message @param {string} defaultmsg
[ "Open", "a", "prompt", "modal", "dialog" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L26512-L26521
18,330
Reportr/dashboard
public/build/static/application.js
function(title, message, choices, defaultChoice) { return Dialogs.open(null, { "title": title, "message": message, "dialog": "select", "default": defaultChoice, "choices": choices, "autoFocus": true, ...
javascript
function(title, message, choices, defaultChoice) { return Dialogs.open(null, { "title": title, "message": message, "dialog": "select", "default": defaultChoice, "choices": choices, "autoFocus": true, ...
[ "function", "(", "title", ",", "message", ",", "choices", ",", "defaultChoice", ")", "{", "return", "Dialogs", ".", "open", "(", "null", ",", "{", "\"title\"", ":", "title", ",", "\"message\"", ":", "message", ",", "\"dialog\"", ":", "\"select\"", ",", "...
Open a select modal dialog @param {string} title @param {string} message @param {object} choices @param {string} defaultChoice
[ "Open", "a", "select", "modal", "dialog" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L26531-L26541
18,331
Reportr/dashboard
public/build/static/application.js
function(title, message) { if (!message) { message = title; title = null; } return Dialogs.open(null, { "title": title, "message": message, "dialog": "confirm" }); }
javascript
function(title, message) { if (!message) { message = title; title = null; } return Dialogs.open(null, { "title": title, "message": message, "dialog": "confirm" }); }
[ "function", "(", "title", ",", "message", ")", "{", "if", "(", "!", "message", ")", "{", "message", "=", "title", ";", "title", "=", "null", ";", "}", "return", "Dialogs", ".", "open", "(", "null", ",", "{", "\"title\"", ":", "title", ",", "\"messa...
Open a confirmation modal dialog @param {string} title @param {string} message
[ "Open", "a", "confirmation", "modal", "dialog" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L26549-L26560
18,332
Reportr/dashboard
public/build/static/application.js
function(err) { Dialogs.alert("Error:", err.message || err); console.error(err.stack || err.message || err); return Q.reject(err); }
javascript
function(err) { Dialogs.alert("Error:", err.message || err); console.error(err.stack || err.message || err); return Q.reject(err); }
[ "function", "(", "err", ")", "{", "Dialogs", ".", "alert", "(", "\"Error:\"", ",", "err", ".", "message", "||", "err", ")", ";", "console", ".", "error", "(", "err", ".", "stack", "||", "err", ".", "message", "||", "err", ")", ";", "return", "Q", ...
Show an error message
[ "Show", "an", "error", "message" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L26579-L26583
18,333
Reportr/dashboard
public/build/static/application.js
dfl
function dfl(a, b, c) { switch (arguments.length) { case 2: return a != null ? a : b; case 3: return a != null ? a : b != null ? b : c; default: throw new Error("Implement me"); } }
javascript
function dfl(a, b, c) { switch (arguments.length) { case 2: return a != null ? a : b; case 3: return a != null ? a : b != null ? b : c; default: throw new Error("Implement me"); } }
[ "function", "dfl", "(", "a", ",", "b", ",", "c", ")", "{", "switch", "(", "arguments", ".", "length", ")", "{", "case", "2", ":", "return", "a", "!=", "null", "?", "a", ":", "b", ";", "case", "3", ":", "return", "a", "!=", "null", "?", "a", ...
Pick the first defined of two or three arguments. dfl comes from default.
[ "Pick", "the", "first", "defined", "of", "two", "or", "three", "arguments", ".", "dfl", "comes", "from", "default", "." ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L27061-L27067
18,334
Reportr/dashboard
public/build/static/application.js
setProjection
function setProjection( element, options ) { var width = options.width || element.offsetWidth; var height = options.height || element.offsetHeight; var projection, path; if ( options && typeof options.scope === 'undefined') { options.scope = 'world'; } if ( options.scope === 'usa' ) { ...
javascript
function setProjection( element, options ) { var width = options.width || element.offsetWidth; var height = options.height || element.offsetHeight; var projection, path; if ( options && typeof options.scope === 'undefined') { options.scope = 'world'; } if ( options.scope === 'usa' ) { ...
[ "function", "setProjection", "(", "element", ",", "options", ")", "{", "var", "width", "=", "options", ".", "width", "||", "element", ".", "offsetWidth", ";", "var", "height", "=", "options", ".", "height", "||", "element", ".", "offsetHeight", ";", "var",...
setProjection takes the svg element and options
[ "setProjection", "takes", "the", "svg", "element", "and", "options" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L43432-L43455
18,335
Reportr/dashboard
public/build/static/application.js
addLegend
function addLegend(layer, data, options) { data = data || {}; if ( !this.options.fills ) { return; } var html = '<dl>'; var label = ''; if ( data.legendTitle ) { html = '<h2>' + data.legendTitle + '</h2>' + html; } for ( var fillKey in this.options.fills ) { if ( fill...
javascript
function addLegend(layer, data, options) { data = data || {}; if ( !this.options.fills ) { return; } var html = '<dl>'; var label = ''; if ( data.legendTitle ) { html = '<h2>' + data.legendTitle + '</h2>' + html; } for ( var fillKey in this.options.fills ) { if ( fill...
[ "function", "addLegend", "(", "layer", ",", "data", ",", "options", ")", "{", "data", "=", "data", "||", "{", "}", ";", "if", "(", "!", "this", ".", "options", ".", "fills", ")", "{", "return", ";", "}", "var", "html", "=", "'<dl>'", ";", "var", ...
plugin to add a simple map legend
[ "plugin", "to", "add", "a", "simple", "map", "legend" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L43563-L43596
18,336
Reportr/dashboard
public/build/static/application.js
defaults
function defaults(obj) { Array.prototype.slice.call(arguments, 1).forEach(function(source) { if (source) { for (var prop in source) { if (obj[prop] == null) obj[prop] = source[prop]; } } }); return obj; }
javascript
function defaults(obj) { Array.prototype.slice.call(arguments, 1).forEach(function(source) { if (source) { for (var prop in source) { if (obj[prop] == null) obj[prop] = source[prop]; } } }); return obj; }
[ "function", "defaults", "(", "obj", ")", "{", "Array", ".", "prototype", ".", "slice", ".", "call", "(", "arguments", ",", "1", ")", ".", "forEach", "(", "function", "(", "source", ")", "{", "if", "(", "source", ")", "{", "for", "(", "var", "prop",...
stolen from underscore.js
[ "stolen", "from", "underscore", ".", "js" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L43811-L43820
18,337
Reportr/dashboard
public/build/static/application.js
function(data) { var that = this; data = data || this.toJSON(); return api.execute("put:report/"+this.get("id"), data) .then(function(_data) { that.set(_data); return that; }); }
javascript
function(data) { var that = this; data = data || this.toJSON(); return api.execute("put:report/"+this.get("id"), data) .then(function(_data) { that.set(_data); return that; }); }
[ "function", "(", "data", ")", "{", "var", "that", "=", "this", ";", "data", "=", "data", "||", "this", ".", "toJSON", "(", ")", ";", "return", "api", ".", "execute", "(", "\"put:report/\"", "+", "this", ".", "get", "(", "\"id\"", ")", ",", "data", ...
Update a report
[ "Update", "a", "report" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L55720-L55729
18,338
Reportr/dashboard
public/build/static/application.js
function() { var that = this; return api.execute("get:alerts") .then(function(data) { console.log("alerts", data); that.reset(data); return that; }); }
javascript
function() { var that = this; return api.execute("get:alerts") .then(function(data) { console.log("alerts", data); that.reset(data); return that; }); }
[ "function", "(", ")", "{", "var", "that", "=", "this", ";", "return", "api", ".", "execute", "(", "\"get:alerts\"", ")", ".", "then", "(", "function", "(", "data", ")", "{", "console", ".", "log", "(", "\"alerts\"", ",", "data", ")", ";", "that", "...
Load all alerts
[ "Load", "all", "alerts" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L55893-L55902
18,339
Reportr/dashboard
public/build/static/application.js
function(r) { r = r.toJSON? r.toJSON() : r; this.report.del("visualizations", { silent: true }); this.report.set(r); hr.History.navigate("report/"+this.report.get("id")); }
javascript
function(r) { r = r.toJSON? r.toJSON() : r; this.report.del("visualizations", { silent: true }); this.report.set(r); hr.History.navigate("report/"+this.report.get("id")); }
[ "function", "(", "r", ")", "{", "r", "=", "r", ".", "toJSON", "?", "r", ".", "toJSON", "(", ")", ":", "r", ";", "this", ".", "report", ".", "del", "(", "\"visualizations\"", ",", "{", "silent", ":", "true", "}", ")", ";", "this", ".", "report",...
Set active report
[ "Set", "active", "report" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L56542-L56548
18,340
Reportr/dashboard
public/build/static/application.js
function() { var that = this; return that.reports.loadAll() .then(function() { return dialogs.select( i18n.t("reports.select.title"), i18n.t("reports.select.message"), _.object(that.reports.map(function(r) {...
javascript
function() { var that = this; return that.reports.loadAll() .then(function() { return dialogs.select( i18n.t("reports.select.title"), i18n.t("reports.select.message"), _.object(that.reports.map(function(r) {...
[ "function", "(", ")", "{", "var", "that", "=", "this", ";", "return", "that", ".", "reports", ".", "loadAll", "(", ")", ".", "then", "(", "function", "(", ")", "{", "return", "dialogs", ".", "select", "(", "i18n", ".", "t", "(", "\"reports.select.tit...
Change current report
[ "Change", "current", "report" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L56551-L56571
18,341
Reportr/dashboard
public/build/static/application.js
function() { var that = this; return dialogs.fields(i18n.t("reports.create.title"), { "title": { label: i18n.t("reports.create.fields.title"), type: "text" } }) .then(function(args) { ...
javascript
function() { var that = this; return dialogs.fields(i18n.t("reports.create.title"), { "title": { label: i18n.t("reports.create.fields.title"), type: "text" } }) .then(function(args) { ...
[ "function", "(", ")", "{", "var", "that", "=", "this", ";", "return", "dialogs", ".", "fields", "(", "i18n", ".", "t", "(", "\"reports.create.title\"", ")", ",", "{", "\"title\"", ":", "{", "label", ":", "i18n", ".", "t", "(", "\"reports.create.fields.ti...
Create a new report
[ "Create", "a", "new", "report" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L56574-L56586
18,342
Reportr/dashboard
public/build/static/application.js
function() { var that = this; return dialogs.fields(i18n.t("reports.edit.title"), { "title": { label: i18n.t("reports.edit.fields.title"), type: "text" } }, this.report.toJSON()) .then(function(data) ...
javascript
function() { var that = this; return dialogs.fields(i18n.t("reports.edit.title"), { "title": { label: i18n.t("reports.edit.fields.title"), type: "text" } }, this.report.toJSON()) .then(function(data) ...
[ "function", "(", ")", "{", "var", "that", "=", "this", ";", "return", "dialogs", ".", "fields", "(", "i18n", ".", "t", "(", "\"reports.edit.title\"", ")", ",", "{", "\"title\"", ":", "{", "label", ":", "i18n", ".", "t", "(", "\"reports.edit.fields.title\...
Edit current report
[ "Edit", "current", "report" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L56589-L56600
18,343
Reportr/dashboard
public/build/static/application.js
function() { var that = this; return dialogs.confirm(i18n.t("reports.remove.title")) .then(function() { return that.report.remove(); }) .then(function() { that.report.clear(); return that.reports.loadAll(); ...
javascript
function() { var that = this; return dialogs.confirm(i18n.t("reports.remove.title")) .then(function() { return that.report.remove(); }) .then(function() { that.report.clear(); return that.reports.loadAll(); ...
[ "function", "(", ")", "{", "var", "that", "=", "this", ";", "return", "dialogs", ".", "confirm", "(", "i18n", ".", "t", "(", "\"reports.remove.title\"", ")", ")", ".", "then", "(", "function", "(", ")", "{", "return", "that", ".", "report", ".", "rem...
Remove current report
[ "Remove", "current", "report" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L56603-L56618
18,344
Reportr/dashboard
public/build/static/application.js
function() { var that = this; return api.execute("get:types") .then(function(types) { return dialogs.fields(i18n.t("visualization.create.title"), { "eventName": { 'label': i18n.t("visualization.create.fields.eventName"), ...
javascript
function() { var that = this; return api.execute("get:types") .then(function(types) { return dialogs.fields(i18n.t("visualization.create.title"), { "eventName": { 'label': i18n.t("visualization.create.fields.eventName"), ...
[ "function", "(", ")", "{", "var", "that", "=", "this", ";", "return", "api", ".", "execute", "(", "\"get:types\"", ")", ".", "then", "(", "function", "(", "types", ")", "{", "return", "dialogs", ".", "fields", "(", "i18n", ".", "t", "(", "\"visualiza...
Create a new visualization
[ "Create", "a", "new", "visualization" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L56621-L56657
18,345
Reportr/dashboard
public/build/static/application.js
function(e) { if (e) e.preventDefault(); var that = this; return api.execute("get:types") .fail(dialogs.error) .then(function(events) { return dialogs.fields(i18n.t("alerts.create.title"), { "title": { ...
javascript
function(e) { if (e) e.preventDefault(); var that = this; return api.execute("get:types") .fail(dialogs.error) .then(function(events) { return dialogs.fields(i18n.t("alerts.create.title"), { "title": { ...
[ "function", "(", "e", ")", "{", "if", "(", "e", ")", "e", ".", "preventDefault", "(", ")", ";", "var", "that", "=", "this", ";", "return", "api", ".", "execute", "(", "\"get:types\"", ")", ".", "fail", "(", "dialogs", ".", "error", ")", ".", "the...
Create an alert
[ "Create", "an", "alert" ]
bff0ea7f324de78ab8bf8c4301ce30696ad7d960
https://github.com/Reportr/dashboard/blob/bff0ea7f324de78ab8bf8c4301ce30696ad7d960/public/build/static/application.js#L56672-L56729
18,346
APIDevTools/swagger-cli
bin/swagger-cli.js
parseArgs
function parseArgs () { // Configure the argument parser yargs .option("schema", { type: "boolean", default: true, }) .option("spec", { type: "boolean", default: true, }) .option("o", { alias: "outfile", type: "string", normalize: true, }) .optio...
javascript
function parseArgs () { // Configure the argument parser yargs .option("schema", { type: "boolean", default: true, }) .option("spec", { type: "boolean", default: true, }) .option("o", { alias: "outfile", type: "string", normalize: true, }) .optio...
[ "function", "parseArgs", "(", ")", "{", "// Configure the argument parser", "yargs", ".", "option", "(", "\"schema\"", ",", "{", "type", ":", "\"boolean\"", ",", "default", ":", "true", ",", "}", ")", ".", "option", "(", "\"spec\"", ",", "{", "type", ":", ...
Parses the command-line arguments @returns {object} - The parsed arguments
[ "Parses", "the", "command", "-", "line", "arguments" ]
e3cc39e223e2e5dcb92128447d297649ca338076
https://github.com/APIDevTools/swagger-cli/blob/e3cc39e223e2e5dcb92128447d297649ca338076/bin/swagger-cli.js#L56-L134
18,347
APIDevTools/swagger-cli
bin/swagger-cli.js
bundle
function bundle (file, options) { api.bundle(file, options) .then((bundled) => { if (options.outfile) { console.log("Created %s from %s", options.outfile, file); } else { // Write the bundled API to stdout console.log(bundled); } }) .catch(errorHandler); }
javascript
function bundle (file, options) { api.bundle(file, options) .then((bundled) => { if (options.outfile) { console.log("Created %s from %s", options.outfile, file); } else { // Write the bundled API to stdout console.log(bundled); } }) .catch(errorHandler); }
[ "function", "bundle", "(", "file", ",", "options", ")", "{", "api", ".", "bundle", "(", "file", ",", "options", ")", ".", "then", "(", "(", "bundled", ")", "=>", "{", "if", "(", "options", ".", "outfile", ")", "{", "console", ".", "log", "(", "\"...
Bundles a multi-file API definition @param {string} file - The path of the file to validate @param {object} options - Validation options
[ "Bundles", "a", "multi", "-", "file", "API", "definition" ]
e3cc39e223e2e5dcb92128447d297649ca338076
https://github.com/APIDevTools/swagger-cli/blob/e3cc39e223e2e5dcb92128447d297649ca338076/bin/swagger-cli.js#L160-L172
18,348
APIDevTools/swagger-cli
bin/swagger-cli.js
errorHandler
function errorHandler (err) { let errorMessage = process.env.DEBUG ? err.stack : err.message; console.error(chalk.red(errorMessage)); process.exit(1); }
javascript
function errorHandler (err) { let errorMessage = process.env.DEBUG ? err.stack : err.message; console.error(chalk.red(errorMessage)); process.exit(1); }
[ "function", "errorHandler", "(", "err", ")", "{", "let", "errorMessage", "=", "process", ".", "env", ".", "DEBUG", "?", "err", ".", "stack", ":", "err", ".", "message", ";", "console", ".", "error", "(", "chalk", ".", "red", "(", "errorMessage", ")", ...
Writes error information to stderr and exits with a non-zero code @param {Error} err
[ "Writes", "error", "information", "to", "stderr", "and", "exits", "with", "a", "non", "-", "zero", "code" ]
e3cc39e223e2e5dcb92128447d297649ca338076
https://github.com/APIDevTools/swagger-cli/blob/e3cc39e223e2e5dcb92128447d297649ca338076/bin/swagger-cli.js#L192-L196
18,349
APIDevTools/swagger-cli
lib/bundle.js
toYAML
function toYAML (api, spaces, wrap) { const jsYaml = require("js-yaml"); return jsYaml.dump(api, { indent: spaces, lineWidth: wrap, noRefs: true }); }
javascript
function toYAML (api, spaces, wrap) { const jsYaml = require("js-yaml"); return jsYaml.dump(api, { indent: spaces, lineWidth: wrap, noRefs: true }); }
[ "function", "toYAML", "(", "api", ",", "spaces", ",", "wrap", ")", "{", "const", "jsYaml", "=", "require", "(", "\"js-yaml\"", ")", ";", "return", "jsYaml", ".", "dump", "(", "api", ",", "{", "indent", ":", "spaces", ",", "lineWidth", ":", "wrap", ",...
Serializes the given API as YAML, using the given spaces for formatting. @param {object} api API to convert to YAML @param {string|number} spaces number of spaces to ident @param {number} wrap the column to word-wrap at
[ "Serializes", "the", "given", "API", "as", "YAML", "using", "the", "given", "spaces", "for", "formatting", "." ]
e3cc39e223e2e5dcb92128447d297649ca338076
https://github.com/APIDevTools/swagger-cli/blob/e3cc39e223e2e5dcb92128447d297649ca338076/lib/bundle.js#L91-L99
18,350
ethul/purs-loader
src/to-javascript.js
makeBundleJS
function makeBundleJS(psModule) { const bundleOutput = psModule.options.bundleOutput; const name = psModule.name; const srcDir = psModule.srcDir; const escaped = jsStringEscape(path.relative(srcDir, bundleOutput)); const result = `module.exports = require("${escaped}")["${name}"]`; return Promise.resol...
javascript
function makeBundleJS(psModule) { const bundleOutput = psModule.options.bundleOutput; const name = psModule.name; const srcDir = psModule.srcDir; const escaped = jsStringEscape(path.relative(srcDir, bundleOutput)); const result = `module.exports = require("${escaped}")["${name}"]`; return Promise.resol...
[ "function", "makeBundleJS", "(", "psModule", ")", "{", "const", "bundleOutput", "=", "psModule", ".", "options", ".", "bundleOutput", ";", "const", "name", "=", "psModule", ".", "name", ";", "const", "srcDir", "=", "psModule", ".", "srcDir", ";", "const", ...
Reference the bundle.
[ "Reference", "the", "bundle", "." ]
f5a2abb1da6068203698255c123f097979443b6b
https://github.com/ethul/purs-loader/blob/f5a2abb1da6068203698255c123f097979443b6b/src/to-javascript.js#L51-L63
18,351
ethul/purs-loader
src/to-javascript.js
makeJS
function makeJS(psModule, psModuleMap, js) { const requireRE = /require\(['"]\.\.\/([\w\.]+)(?:\/index\.js)?['"]\)/g; const foreignRE = /require\(['"]\.\/foreign(?:\.js)?['"]\)/g; const name = psModule.name; const imports = psModuleMap[name].imports; var replacedImports = []; const result = js .rep...
javascript
function makeJS(psModule, psModuleMap, js) { const requireRE = /require\(['"]\.\.\/([\w\.]+)(?:\/index\.js)?['"]\)/g; const foreignRE = /require\(['"]\.\/foreign(?:\.js)?['"]\)/g; const name = psModule.name; const imports = psModuleMap[name].imports; var replacedImports = []; const result = js .rep...
[ "function", "makeJS", "(", "psModule", ",", "psModuleMap", ",", "js", ")", "{", "const", "requireRE", "=", "/", "require\\(['\"]\\.\\.\\/([\\w\\.]+)(?:\\/index\\.js)?['\"]\\)", "/", "g", ";", "const", "foreignRE", "=", "/", "require\\(['\"]\\.\\/foreign(?:\\.js)?['\"]\\)"...
Replace require paths to output files generated by psc with paths to purescript sources, which are then also run through this loader. Additionally, the imports replaced are tracked so that in the event the compiler fails to compile the PureScript source, we can tack on any new imports in order to allow webpack to watch...
[ "Replace", "require", "paths", "to", "output", "files", "generated", "by", "psc", "with", "paths", "to", "purescript", "sources", "which", "are", "then", "also", "run", "through", "this", "loader", ".", "Additionally", "the", "imports", "replaced", "are", "tra...
f5a2abb1da6068203698255c123f097979443b6b
https://github.com/ethul/purs-loader/blob/f5a2abb1da6068203698255c123f097979443b6b/src/to-javascript.js#L71-L135
18,352
nolimits4web/dom7
dist/dom7.module.js
addClass
function addClass(className) { if (typeof className === 'undefined') { return this; } const classes = className.split(' '); for (let i = 0; i < classes.length; i += 1) { for (let j = 0; j < this.length; j += 1) { if (typeof this[j] !== 'undefined' && typeof this[j].classList !== 'undefined') this[...
javascript
function addClass(className) { if (typeof className === 'undefined') { return this; } const classes = className.split(' '); for (let i = 0; i < classes.length; i += 1) { for (let j = 0; j < this.length; j += 1) { if (typeof this[j] !== 'undefined' && typeof this[j].classList !== 'undefined') this[...
[ "function", "addClass", "(", "className", ")", "{", "if", "(", "typeof", "className", "===", "'undefined'", ")", "{", "return", "this", ";", "}", "const", "classes", "=", "className", ".", "split", "(", "' '", ")", ";", "for", "(", "let", "i", "=", "...
Classes and attributes
[ "Classes", "and", "attributes" ]
28b0db30d77fa765ccae9497a2f0e3dfbc2cf55f
https://github.com/nolimits4web/dom7/blob/28b0db30d77fa765ccae9497a2f0e3dfbc2cf55f/dist/dom7.module.js#L107-L118
18,353
nolimits4web/dom7
dist/dom7.module.js
transform
function transform(transform) { for (let i = 0; i < this.length; i += 1) { const elStyle = this[i].style; elStyle.webkitTransform = transform; elStyle.transform = transform; } return this; }
javascript
function transform(transform) { for (let i = 0; i < this.length; i += 1) { const elStyle = this[i].style; elStyle.webkitTransform = transform; elStyle.transform = transform; } return this; }
[ "function", "transform", "(", "transform", ")", "{", "for", "(", "let", "i", "=", "0", ";", "i", "<", "this", ".", "length", ";", "i", "+=", "1", ")", "{", "const", "elStyle", "=", "this", "[", "i", "]", ".", "style", ";", "elStyle", ".", "webk...
Transforms eslint-disable-next-line
[ "Transforms", "eslint", "-", "disable", "-", "next", "-", "line" ]
28b0db30d77fa765ccae9497a2f0e3dfbc2cf55f
https://github.com/nolimits4web/dom7/blob/28b0db30d77fa765ccae9497a2f0e3dfbc2cf55f/dist/dom7.module.js#L285-L292
18,354
nolimits4web/dom7
dist/dom7.module.js
each
function each(callback) { // Don't bother continuing without a callback if (!callback) return this; // Iterate over the current collection for (let i = 0; i < this.length; i += 1) { // If the callback returns false if (callback.call(this[i], i, this[i]) === false) { // End the loop early ret...
javascript
function each(callback) { // Don't bother continuing without a callback if (!callback) return this; // Iterate over the current collection for (let i = 0; i < this.length; i += 1) { // If the callback returns false if (callback.call(this[i], i, this[i]) === false) { // End the loop early ret...
[ "function", "each", "(", "callback", ")", "{", "// Don't bother continuing without a callback", "if", "(", "!", "callback", ")", "return", "this", ";", "// Iterate over the current collection", "for", "(", "let", "i", "=", "0", ";", "i", "<", "this", ".", "lengt...
Iterate over the collection passing elements to `callback`
[ "Iterate", "over", "the", "collection", "passing", "elements", "to", "callback" ]
28b0db30d77fa765ccae9497a2f0e3dfbc2cf55f
https://github.com/nolimits4web/dom7/blob/28b0db30d77fa765ccae9497a2f0e3dfbc2cf55f/dist/dom7.module.js#L604-L617
18,355
bitovi/funcunit
site/examples/todo/js/todos/todos.js
function (el, e) { var value = can.trim(el.val()); if (e.keyCode === ENTER_KEY && value !== '') { new Models.Todo({ text : value, complete : false }).save(function () { el.val(''); }); } }
javascript
function (el, e) { var value = can.trim(el.val()); if (e.keyCode === ENTER_KEY && value !== '') { new Models.Todo({ text : value, complete : false }).save(function () { el.val(''); }); } }
[ "function", "(", "el", ",", "e", ")", "{", "var", "value", "=", "can", ".", "trim", "(", "el", ".", "val", "(", ")", ")", ";", "if", "(", "e", ".", "keyCode", "===", "ENTER_KEY", "&&", "value", "!==", "''", ")", "{", "new", "Models", ".", "To...
Listen for when a new Todo has been entered
[ "Listen", "for", "when", "a", "new", "Todo", "has", "been", "entered" ]
6c0056bed585927c76c3a22c0f482adb48b0fde2
https://github.com/bitovi/funcunit/blob/6c0056bed585927c76c3a22c0f482adb48b0fde2/site/examples/todo/js/todos/todos.js#L19-L29
18,356
bitovi/funcunit
site/examples/todo/js/todos/todos.js
function (list, e, item) { this.options.todos.push(item); // Reset the filter so that you always see your new todo this.options.state.attr('filter', ''); }
javascript
function (list, e, item) { this.options.todos.push(item); // Reset the filter so that you always see your new todo this.options.state.attr('filter', ''); }
[ "function", "(", "list", ",", "e", ",", "item", ")", "{", "this", ".", "options", ".", "todos", ".", "push", "(", "item", ")", ";", "// Reset the filter so that you always see your new todo", "this", ".", "options", ".", "state", ".", "attr", "(", "'filter'"...
Handle a newly created Todo
[ "Handle", "a", "newly", "created", "Todo" ]
6c0056bed585927c76c3a22c0f482adb48b0fde2
https://github.com/bitovi/funcunit/blob/6c0056bed585927c76c3a22c0f482adb48b0fde2/site/examples/todo/js/todos/todos.js#L32-L36
18,357
bitovi/funcunit
site/examples/todo/js/todos/todos.js
function () { // Remove the `selected` class from the old link and add it to the link for the current location hash this.element.find('#filters').find('a').removeClass('selected') .end().find('[href="' + window.location.hash + '"]').addClass('selected'); }
javascript
function () { // Remove the `selected` class from the old link and add it to the link for the current location hash this.element.find('#filters').find('a').removeClass('selected') .end().find('[href="' + window.location.hash + '"]').addClass('selected'); }
[ "function", "(", ")", "{", "// Remove the `selected` class from the old link and add it to the link for the current location hash", "this", ".", "element", ".", "find", "(", "'#filters'", ")", ".", "find", "(", "'a'", ")", ".", "removeClass", "(", "'selected'", ")", "."...
Listener for when the route changes
[ "Listener", "for", "when", "the", "route", "changes" ]
6c0056bed585927c76c3a22c0f482adb48b0fde2
https://github.com/bitovi/funcunit/blob/6c0056bed585927c76c3a22c0f482adb48b0fde2/site/examples/todo/js/todos/todos.js#L39-L43
18,358
bitovi/funcunit
site/examples/todo/js/todos/todos.js
function (el) { var value = can.trim(el.val()), todo = el.closest('.todo').data('todo'); // If we don't have a todo we don't need to do anything if (!todo) { return; } if (value === '') { todo.destroy(); } else { todo.attr({ editing : false, text : value }).save(); }...
javascript
function (el) { var value = can.trim(el.val()), todo = el.closest('.todo').data('todo'); // If we don't have a todo we don't need to do anything if (!todo) { return; } if (value === '') { todo.destroy(); } else { todo.attr({ editing : false, text : value }).save(); }...
[ "function", "(", "el", ")", "{", "var", "value", "=", "can", ".", "trim", "(", "el", ".", "val", "(", ")", ")", ",", "todo", "=", "el", ".", "closest", "(", "'.todo'", ")", ".", "data", "(", "'todo'", ")", ";", "// If we don't have a todo we don't ne...
Update a todo
[ "Update", "a", "todo" ]
6c0056bed585927c76c3a22c0f482adb48b0fde2
https://github.com/bitovi/funcunit/blob/6c0056bed585927c76c3a22c0f482adb48b0fde2/site/examples/todo/js/todos/todos.js#L53-L70
18,359
bitovi/funcunit
site/examples/todo/js/todos/todos.js
function (el) { var toggle = el.prop('checked'); can.each(this.options.todos, function (todo) { todo.attr('complete', toggle).save(); }); }
javascript
function (el) { var toggle = el.prop('checked'); can.each(this.options.todos, function (todo) { todo.attr('complete', toggle).save(); }); }
[ "function", "(", "el", ")", "{", "var", "toggle", "=", "el", ".", "prop", "(", "'checked'", ")", ";", "can", ".", "each", "(", "this", ".", "options", ".", "todos", ",", "function", "(", "todo", ")", "{", "todo", ".", "attr", "(", "'complete'", "...
Listen for toggle all completed Todos
[ "Listen", "for", "toggle", "all", "completed", "Todos" ]
6c0056bed585927c76c3a22c0f482adb48b0fde2
https://github.com/bitovi/funcunit/blob/6c0056bed585927c76c3a22c0f482adb48b0fde2/site/examples/todo/js/todos/todos.js#L94-L99
18,360
bitovi/funcunit
site/examples/todo/js/todos/todos.js
function () { for (var i = this.options.todos.length - 1, todo; i > -1 && (todo = this.options.todos[i]); i--) { if (todo.attr('complete')) { todo.destroy(); } } }
javascript
function () { for (var i = this.options.todos.length - 1, todo; i > -1 && (todo = this.options.todos[i]); i--) { if (todo.attr('complete')) { todo.destroy(); } } }
[ "function", "(", ")", "{", "for", "(", "var", "i", "=", "this", ".", "options", ".", "todos", ".", "length", "-", "1", ",", "todo", ";", "i", ">", "-", "1", "&&", "(", "todo", "=", "this", ".", "options", ".", "todos", "[", "i", "]", ")", "...
Listen for removing all completed Todos
[ "Listen", "for", "removing", "all", "completed", "Todos" ]
6c0056bed585927c76c3a22c0f482adb48b0fde2
https://github.com/bitovi/funcunit/blob/6c0056bed585927c76c3a22c0f482adb48b0fde2/site/examples/todo/js/todos/todos.js#L102-L108
18,361
bitovi/funcunit
site/examples/resources/funcunit.js
function( type, options, element ) { options || (options = {}); var create = Syn.create, setup = create[type] && create[type].setup, kind = key.test(type) ? 'key' : (page.test(type) ? "page" : "mouse"), createType = create[type] || {}, createKind = create[kind], event, ret, autoPrevent, dispa...
javascript
function( type, options, element ) { options || (options = {}); var create = Syn.create, setup = create[type] && create[type].setup, kind = key.test(type) ? 'key' : (page.test(type) ? "page" : "mouse"), createType = create[type] || {}, createKind = create[kind], event, ret, autoPrevent, dispa...
[ "function", "(", "type", ",", "options", ",", "element", ")", "{", "options", "||", "(", "options", "=", "{", "}", ")", ";", "var", "create", "=", "Syn", ".", "create", ",", "setup", "=", "create", "[", "type", "]", "&&", "create", "[", "type", "...
Creates a synthetic event and dispatches it on the element. This will run any default actions for the element. Typically you want to use Syn, but if you want the return value, use this. @param {String} type @param {Object} options @param {HTMLElement} element @return {Boolean} true if default events were run, false if ...
[ "Creates", "a", "synthetic", "event", "and", "dispatches", "it", "on", "the", "element", ".", "This", "will", "run", "any", "default", "actions", "for", "the", "element", ".", "Typically", "you", "want", "to", "use", "Syn", "but", "if", "you", "want", "t...
6c0056bed585927c76c3a22c0f482adb48b0fde2
https://github.com/bitovi/funcunit/blob/6c0056bed585927c76c3a22c0f482adb48b0fde2/site/examples/resources/funcunit.js#L608-L644
18,362
bitovi/funcunit
site/examples/resources/funcunit.js
function( type, options, element ) { //check if options is character or has character options = typeof options != "object" ? { character: options } : options; //don't change the orignial options = h.extend({}, options) if ( options.character ) { h.extend(options, Syn.key.options(optio...
javascript
function( type, options, element ) { //check if options is character or has character options = typeof options != "object" ? { character: options } : options; //don't change the orignial options = h.extend({}, options) if ( options.character ) { h.extend(options, Syn.key.options(optio...
[ "function", "(", "type", ",", "options", ",", "element", ")", "{", "//check if options is character or has character", "options", "=", "typeof", "options", "!=", "\"object\"", "?", "{", "character", ":", "options", "}", ":", "options", ";", "//don't change the orign...
return the options for a key event
[ "return", "the", "options", "for", "a", "key", "event" ]
6c0056bed585927c76c3a22c0f482adb48b0fde2
https://github.com/bitovi/funcunit/blob/6c0056bed585927c76c3a22c0f482adb48b0fde2/site/examples/resources/funcunit.js#L1951-L1972
18,363
bitovi/funcunit
site/examples/todo/js/lib/canjs/can.jquery.js
function (elems, context) { var oldFragment = $.buildFragment, ret; elems = [elems]; // Set context per 1.8 logic context = context || document; context = !context.nodeType && context[0] || context; context = context.ownerDocument ...
javascript
function (elems, context) { var oldFragment = $.buildFragment, ret; elems = [elems]; // Set context per 1.8 logic context = context || document; context = !context.nodeType && context[0] || context; context = context.ownerDocument ...
[ "function", "(", "elems", ",", "context", ")", "{", "var", "oldFragment", "=", "$", ".", "buildFragment", ",", "ret", ";", "elems", "=", "[", "elems", "]", ";", "// Set context per 1.8 logic", "context", "=", "context", "||", "document", ";", "context", "=...
jquery caches fragments, we always needs a new one
[ "jquery", "caches", "fragments", "we", "always", "needs", "a", "new", "one" ]
6c0056bed585927c76c3a22c0f482adb48b0fde2
https://github.com/bitovi/funcunit/blob/6c0056bed585927c76c3a22c0f482adb48b0fde2/site/examples/todo/js/lib/canjs/can.jquery.js#L74-L87
18,364
bitovi/funcunit
site/examples/todo/js/lib/canjs/can.jquery.js
function (content) { // Convert bad values into empty strings var isInvalid = content === null || content === undefined || (isNaN(content) && ("" + content === 'NaN')); return ("" + (isInvalid ? '' : content)).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace...
javascript
function (content) { // Convert bad values into empty strings var isInvalid = content === null || content === undefined || (isNaN(content) && ("" + content === 'NaN')); return ("" + (isInvalid ? '' : content)).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace...
[ "function", "(", "content", ")", "{", "// Convert bad values into empty strings", "var", "isInvalid", "=", "content", "===", "null", "||", "content", "===", "undefined", "||", "(", "isNaN", "(", "content", ")", "&&", "(", "\"\"", "+", "content", "===", "'NaN'"...
Escapes strings for HTML.
[ "Escapes", "strings", "for", "HTML", "." ]
6c0056bed585927c76c3a22c0f482adb48b0fde2
https://github.com/bitovi/funcunit/blob/6c0056bed585927c76c3a22c0f482adb48b0fde2/site/examples/todo/js/lib/canjs/can.jquery.js#L149-L153
18,365
bitovi/funcunit
site/examples/todo/js/lib/canjs/can.jquery.js
function (s) { return s.replace(strColons, '/').replace(strWords, '$1_$2').replace(strLowUp, '$1_$2').replace(strDash, '_').toLowerCase(); }
javascript
function (s) { return s.replace(strColons, '/').replace(strWords, '$1_$2').replace(strLowUp, '$1_$2').replace(strDash, '_').toLowerCase(); }
[ "function", "(", "s", ")", "{", "return", "s", ".", "replace", "(", "strColons", ",", "'/'", ")", ".", "replace", "(", "strWords", ",", "'$1_$2'", ")", ".", "replace", "(", "strLowUp", ",", "'$1_$2'", ")", ".", "replace", "(", "strDash", ",", "'_'", ...
Underscores a string.
[ "Underscores", "a", "string", "." ]
6c0056bed585927c76c3a22c0f482adb48b0fde2
https://github.com/bitovi/funcunit/blob/6c0056bed585927c76c3a22c0f482adb48b0fde2/site/examples/todo/js/lib/canjs/can.jquery.js#L208-L210
18,366
bitovi/funcunit
site/examples/todo/js/lib/canjs/can.jquery.js
function (str, data, remove) { var obs = []; obs.push(str.replace(strReplacer, function (whole, inside) { // Convert inside to type. var ob = can.getObject(inside, data, remove === undefined ? remove : !remove); if (ob === undefined) { ...
javascript
function (str, data, remove) { var obs = []; obs.push(str.replace(strReplacer, function (whole, inside) { // Convert inside to type. var ob = can.getObject(inside, data, remove === undefined ? remove : !remove); if (ob === undefined) { ...
[ "function", "(", "str", ",", "data", ",", "remove", ")", "{", "var", "obs", "=", "[", "]", ";", "obs", ".", "push", "(", "str", ".", "replace", "(", "strReplacer", ",", "function", "(", "whole", ",", "inside", ")", "{", "// Convert inside to type.", ...
Micro-templating.
[ "Micro", "-", "templating", "." ]
6c0056bed585927c76c3a22c0f482adb48b0fde2
https://github.com/bitovi/funcunit/blob/6c0056bed585927c76c3a22c0f482adb48b0fde2/site/examples/todo/js/lib/canjs/can.jquery.js#L212-L235
18,367
bitovi/funcunit
site/examples/todo/js/lib/canjs/can.jquery.js
function (result) { var frag = can.buildFragment(result, document.body); // If we have an empty frag... if (!frag.childNodes.length) { frag.appendChild(document.createTextNode('')); } return frag; }
javascript
function (result) { var frag = can.buildFragment(result, document.body); // If we have an empty frag... if (!frag.childNodes.length) { frag.appendChild(document.createTextNode('')); } return frag; }
[ "function", "(", "result", ")", "{", "var", "frag", "=", "can", ".", "buildFragment", "(", "result", ",", "document", ".", "body", ")", ";", "// If we have an empty frag...", "if", "(", "!", "frag", ".", "childNodes", ".", "length", ")", "{", "frag", "."...
simply creates a frag this is used internally to create a frag insert it then hook it up
[ "simply", "creates", "a", "frag", "this", "is", "used", "internally", "to", "create", "a", "frag", "insert", "it", "then", "hook", "it", "up" ]
6c0056bed585927c76c3a22c0f482adb48b0fde2
https://github.com/bitovi/funcunit/blob/6c0056bed585927c76c3a22c0f482adb48b0fde2/site/examples/todo/js/lib/canjs/can.jquery.js#L2194-L2201
18,368
bitovi/funcunit
site/examples/todo/js/lib/canjs/can.jquery.js
function (src) { return can.map(src.toString().split(/\/|\./g), function (part) { // Dont include empty strings in toId functions if (part) { return part; } }).join("_"); }
javascript
function (src) { return can.map(src.toString().split(/\/|\./g), function (part) { // Dont include empty strings in toId functions if (part) { return part; } }).join("_"); }
[ "function", "(", "src", ")", "{", "return", "can", ".", "map", "(", "src", ".", "toString", "(", ")", ".", "split", "(", "/", "\\/|\\.", "/", "g", ")", ",", "function", "(", "part", ")", "{", "// Dont include empty strings in toId functions", "if", "(", ...
Convert a path like string into something that's ok for an `element` ID.
[ "Convert", "a", "path", "like", "string", "into", "something", "that", "s", "ok", "for", "an", "element", "ID", "." ]
6c0056bed585927c76c3a22c0f482adb48b0fde2
https://github.com/bitovi/funcunit/blob/6c0056bed585927c76c3a22c0f482adb48b0fde2/site/examples/todo/js/lib/canjs/can.jquery.js#L2204-L2211
18,369
bitovi/funcunit
site/examples/todo/js/lib/canjs/can.jquery.js
function (url, async) { var suffix = url.match(/\.[\w\d]+$/), type, // If we are reading a script element for the content of the template, // `el` will be set to that script element. el, // A unique identifier for the view (used...
javascript
function (url, async) { var suffix = url.match(/\.[\w\d]+$/), type, // If we are reading a script element for the content of the template, // `el` will be set to that script element. el, // A unique identifier for the view (used...
[ "function", "(", "url", ",", "async", ")", "{", "var", "suffix", "=", "url", ".", "match", "(", "/", "\\.[\\w\\d]+$", "/", ")", ",", "type", ",", "// If we are reading a script element for the content of the template,", "// `el` will be set to that script element.", "el...
Makes sure there's a template, if not, have `steal` provide a warning.
[ "Makes", "sure", "there", "s", "a", "template", "if", "not", "have", "steal", "provide", "a", "warning", "." ]
6c0056bed585927c76c3a22c0f482adb48b0fde2
https://github.com/bitovi/funcunit/blob/6c0056bed585927c76c3a22c0f482adb48b0fde2/site/examples/todo/js/lib/canjs/can.jquery.js#L2398-L2472
18,370
bitovi/funcunit
site/examples/todo/js/lib/canjs/can.jquery.js
function () { for (var name in observing) { var ob = observing[name]; ob.observe.obj.unbind(ob.observe.attr, onchanged); delete observing[name]; } }
javascript
function () { for (var name in observing) { var ob = observing[name]; ob.observe.obj.unbind(ob.observe.attr, onchanged); delete observing[name]; } }
[ "function", "(", ")", "{", "for", "(", "var", "name", "in", "observing", ")", "{", "var", "ob", "=", "observing", "[", "name", "]", ";", "ob", ".", "observe", ".", "obj", ".", "unbind", "(", "ob", ".", "observe", ".", "attr", ",", "onchanged", ")...
a teardown method that stops listening
[ "a", "teardown", "method", "that", "stops", "listening" ]
6c0056bed585927c76c3a22c0f482adb48b0fde2
https://github.com/bitovi/funcunit/blob/6c0056bed585927c76c3a22c0f482adb48b0fde2/site/examples/todo/js/lib/canjs/can.jquery.js#L2592-L2598
18,371
bitovi/funcunit
site/examples/todo/js/lib/canjs/can.jquery.js
function (ev) { // If the compute is no longer bound (because the same change event led to an unbind) // then do not call getValueAndBind, or we will leak bindings. if (computeState && !computeState.bound) { return; } if...
javascript
function (ev) { // If the compute is no longer bound (because the same change event led to an unbind) // then do not call getValueAndBind, or we will leak bindings. if (computeState && !computeState.bound) { return; } if...
[ "function", "(", "ev", ")", "{", "// If the compute is no longer bound (because the same change event led to an unbind)", "// then do not call getValueAndBind, or we will leak bindings.", "if", "(", "computeState", "&&", "!", "computeState", ".", "bound", ")", "{", "return", ";",...
when a property value is changed
[ "when", "a", "property", "value", "is", "changed" ]
6c0056bed585927c76c3a22c0f482adb48b0fde2
https://github.com/bitovi/funcunit/blob/6c0056bed585927c76c3a22c0f482adb48b0fde2/site/examples/todo/js/lib/canjs/can.jquery.js#L2603-L2624
18,372
bitovi/funcunit
site/examples/todo/js/lib/canjs/can.jquery.js
function () { var info = getValueAndObserved(getterSetter, context), newObserveSet = info.observed; var value = info.value; matched = !matched; // go through every attribute read by this observe can.each(newObserveSet,...
javascript
function () { var info = getValueAndObserved(getterSetter, context), newObserveSet = info.observed; var value = info.value; matched = !matched; // go through every attribute read by this observe can.each(newObserveSet,...
[ "function", "(", ")", "{", "var", "info", "=", "getValueAndObserved", "(", "getterSetter", ",", "context", ")", ",", "newObserveSet", "=", "info", ".", "observed", ";", "var", "value", "=", "info", ".", "value", ";", "matched", "=", "!", "matched", ";", ...
gets the value returned by `getterSetter` and also binds to any attributes read by the call
[ "gets", "the", "value", "returned", "by", "getterSetter", "and", "also", "binds", "to", "any", "attributes", "read", "by", "the", "call" ]
6c0056bed585927c76c3a22c0f482adb48b0fde2
https://github.com/bitovi/funcunit/blob/6c0056bed585927c76c3a22c0f482adb48b0fde2/site/examples/todo/js/lib/canjs/can.jquery.js#L2628-L2661
18,373
bitovi/funcunit
site/examples/todo/js/lib/canjs/can.jquery.js
function (el, parentNode) { // updates the text of the text node update = function (newVal) { node.nodeValue = "" + newVal; teardownCheck(node.parentNode); }; var parent = getParentNode(el, p...
javascript
function (el, parentNode) { // updates the text of the text node update = function (newVal) { node.nodeValue = "" + newVal; teardownCheck(node.parentNode); }; var parent = getParentNode(el, p...
[ "function", "(", "el", ",", "parentNode", ")", "{", "// updates the text of the text node", "update", "=", "function", "(", "newVal", ")", "{", "node", ".", "nodeValue", "=", "\"\"", "+", "newVal", ";", "teardownCheck", "(", "node", ".", "parentNode", ")", "...
If we are escaping, replace the parentNode with a text node who's value is `func`'s return value.
[ "If", "we", "are", "escaping", "replace", "the", "parentNode", "with", "a", "text", "node", "who", "s", "value", "is", "func", "s", "return", "value", "." ]
6c0056bed585927c76c3a22c0f482adb48b0fde2
https://github.com/bitovi/funcunit/blob/6c0056bed585927c76c3a22c0f482adb48b0fde2/site/examples/todo/js/lib/canjs/can.jquery.js#L3433-L3456
18,374
bitovi/funcunit
site/examples/todo/js/lib/canjs/can.jquery.js
function (span, parentNode) { // updates the elements with the new content update = function (newVal) { // is this still part of the DOM? var attached = nodes[0].parentNode; // update the nodes in the DOM wit...
javascript
function (span, parentNode) { // updates the elements with the new content update = function (newVal) { // is this still part of the DOM? var attached = nodes[0].parentNode; // update the nodes in the DOM wit...
[ "function", "(", "span", ",", "parentNode", ")", "{", "// updates the elements with the new content", "update", "=", "function", "(", "newVal", ")", "{", "// is this still part of the DOM?", "var", "attached", "=", "nodes", "[", "0", "]", ".", "parentNode", ";", "...
If we are not escaping, replace the parentNode with a documentFragment created as with `func`'s return value.
[ "If", "we", "are", "not", "escaping", "replace", "the", "parentNode", "with", "a", "documentFragment", "created", "as", "with", "func", "s", "return", "value", "." ]
6c0056bed585927c76c3a22c0f482adb48b0fde2
https://github.com/bitovi/funcunit/blob/6c0056bed585927c76c3a22c0f482adb48b0fde2/site/examples/todo/js/lib/canjs/can.jquery.js#L3461-L3516
18,375
bitovi/funcunit
site/examples/todo/js/lib/canjs/can.jquery.js
function (val) { // create the fragment, but don't hook it up // we need to insert it into the document first var frag = can.view.frag(val, parentNode), // keep a reference to each node newNod...
javascript
function (val) { // create the fragment, but don't hook it up // we need to insert it into the document first var frag = can.view.frag(val, parentNode), // keep a reference to each node newNod...
[ "function", "(", "val", ")", "{", "// create the fragment, but don't hook it up", "// we need to insert it into the document first", "var", "frag", "=", "can", ".", "view", ".", "frag", "(", "val", ",", "parentNode", ")", ",", "// keep a reference to each node", "newNodes...
A helper function to manage inserting the contents and removing the old contents
[ "A", "helper", "function", "to", "manage", "inserting", "the", "contents", "and", "removing", "the", "old", "contents" ]
6c0056bed585927c76c3a22c0f482adb48b0fde2
https://github.com/bitovi/funcunit/blob/6c0056bed585927c76c3a22c0f482adb48b0fde2/site/examples/todo/js/lib/canjs/can.jquery.js#L3477-L3509
18,376
deseretdigital/dayzed
src/utils.js
getStartDate
function getStartDate(date, minDate, maxDate) { let startDate = startOfDay(date); if (minDate) { const minDateNormalized = startOfDay(minDate); if (isBefore(startDate, minDateNormalized)) { startDate = minDateNormalized; } } if (maxDate) { const maxDateNormalized = startOfDay(maxDate); ...
javascript
function getStartDate(date, minDate, maxDate) { let startDate = startOfDay(date); if (minDate) { const minDateNormalized = startOfDay(minDate); if (isBefore(startDate, minDateNormalized)) { startDate = minDateNormalized; } } if (maxDate) { const maxDateNormalized = startOfDay(maxDate); ...
[ "function", "getStartDate", "(", "date", ",", "minDate", ",", "maxDate", ")", "{", "let", "startDate", "=", "startOfDay", "(", "date", ")", ";", "if", "(", "minDate", ")", "{", "const", "minDateNormalized", "=", "startOfDay", "(", "minDate", ")", ";", "i...
Figures out the actual start date based on the min and max dates available. @param {Date} date The we want to start the calendar at @param {Date} minDate The earliest date available to start at @param {Date} maxDate The latest date available to start at @returns {Date} The actual start date
[ "Figures", "out", "the", "actual", "start", "date", "based", "on", "the", "min", "and", "max", "dates", "available", "." ]
93499eb6d9434219d6f0697bb8c8a99bde704109
https://github.com/deseretdigital/dayzed/blob/93499eb6d9434219d6f0697bb8c8a99bde704109/src/utils.js#L174-L189
18,377
deseretdigital/dayzed
src/utils.js
fillFrontWeek
function fillFrontWeek({ firstDayOfMonth, minDate, maxDate, selectedDates, firstDayOfWeek, showOutsideDays }) { const dates = []; let firstDay = (firstDayOfMonth.getDay() + 7 - firstDayOfWeek) % 7; if (showOutsideDays) { const lastDayOfPrevMonth = addDays(firstDayOfMonth, -1); const prevDate ...
javascript
function fillFrontWeek({ firstDayOfMonth, minDate, maxDate, selectedDates, firstDayOfWeek, showOutsideDays }) { const dates = []; let firstDay = (firstDayOfMonth.getDay() + 7 - firstDayOfWeek) % 7; if (showOutsideDays) { const lastDayOfPrevMonth = addDays(firstDayOfMonth, -1); const prevDate ...
[ "function", "fillFrontWeek", "(", "{", "firstDayOfMonth", ",", "minDate", ",", "maxDate", ",", "selectedDates", ",", "firstDayOfWeek", ",", "showOutsideDays", "}", ")", "{", "const", "dates", "=", "[", "]", ";", "let", "firstDay", "=", "(", "firstDayOfMonth", ...
Fill front week with either empty buffer or dates from previous month, depending on showOutsideDays flag @param {Object} param The param object @param {Array.<Date>} param.selectedDates An array of dates currently selected @param {Date} param.minDate The earliest date available @param {Date} param.maxDate The furthest ...
[ "Fill", "front", "week", "with", "either", "empty", "buffer", "or", "dates", "from", "previous", "month", "depending", "on", "showOutsideDays", "flag" ]
93499eb6d9434219d6f0697bb8c8a99bde704109
https://github.com/deseretdigital/dayzed/blob/93499eb6d9434219d6f0697bb8c8a99bde704109/src/utils.js#L284-L327
18,378
deseretdigital/dayzed
src/utils.js
fillBackWeek
function fillBackWeek({ lastDayOfMonth, minDate, maxDate, selectedDates, firstDayOfWeek, showOutsideDays }) { const dates = []; let lastDay = (lastDayOfMonth.getDay() + 7 - firstDayOfWeek) % 7; if (showOutsideDays) { const firstDayOfNextMonth = addDays(lastDayOfMonth, 1); const nextDateMonth ...
javascript
function fillBackWeek({ lastDayOfMonth, minDate, maxDate, selectedDates, firstDayOfWeek, showOutsideDays }) { const dates = []; let lastDay = (lastDayOfMonth.getDay() + 7 - firstDayOfWeek) % 7; if (showOutsideDays) { const firstDayOfNextMonth = addDays(lastDayOfMonth, 1); const nextDateMonth ...
[ "function", "fillBackWeek", "(", "{", "lastDayOfMonth", ",", "minDate", ",", "maxDate", ",", "selectedDates", ",", "firstDayOfWeek", ",", "showOutsideDays", "}", ")", "{", "const", "dates", "=", "[", "]", ";", "let", "lastDay", "=", "(", "lastDayOfMonth", "....
Fill back weeks with either empty buffer or dates from next month, depending on showOutsideDays flag @param {Object} param The param object @param {Array.<Date>} param.selectedDates An array of dates currently selected @param {Date} param.minDate The earliest date available @param {Date} param.maxDate The furthest date...
[ "Fill", "back", "weeks", "with", "either", "empty", "buffer", "or", "dates", "from", "next", "month", "depending", "on", "showOutsideDays", "flag" ]
93499eb6d9434219d6f0697bb8c8a99bde704109
https://github.com/deseretdigital/dayzed/blob/93499eb6d9434219d6f0697bb8c8a99bde704109/src/utils.js#L341-L383
18,379
deseretdigital/dayzed
src/utils.js
getWeeks
function getWeeks(dates) { const weeksLength = Math.ceil(dates.length / 7); const weeks = []; for (let i = 0; i < weeksLength; i++) { weeks[i] = []; for (let x = 0; x < 7; x++) { weeks[i].push(dates[i * 7 + x]); } } return weeks; }
javascript
function getWeeks(dates) { const weeksLength = Math.ceil(dates.length / 7); const weeks = []; for (let i = 0; i < weeksLength; i++) { weeks[i] = []; for (let x = 0; x < 7; x++) { weeks[i].push(dates[i * 7 + x]); } } return weeks; }
[ "function", "getWeeks", "(", "dates", ")", "{", "const", "weeksLength", "=", "Math", ".", "ceil", "(", "dates", ".", "length", "/", "7", ")", ";", "const", "weeks", "=", "[", "]", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", "weeksLength...
Takes an array of dates, and turns them into a multi dimensional array with 7 entries for each week. @param {Array.<Object>} dates An array of dates @returns {Array} The weeks as a multi dimensional array
[ "Takes", "an", "array", "of", "dates", "and", "turns", "them", "into", "a", "multi", "dimensional", "array", "with", "7", "entries", "for", "each", "week", "." ]
93499eb6d9434219d6f0697bb8c8a99bde704109
https://github.com/deseretdigital/dayzed/blob/93499eb6d9434219d6f0697bb8c8a99bde704109/src/utils.js#L416-L426
18,380
deseretdigital/dayzed
src/utils.js
isSelected
function isSelected(selectedDates, date) { selectedDates = Array.isArray(selectedDates) ? selectedDates : [selectedDates]; return selectedDates.some(selectedDate => { if ( selectedDate instanceof Date && startOfDay(selectedDate).getTime() === startOfDay(date).getTime() ) { return t...
javascript
function isSelected(selectedDates, date) { selectedDates = Array.isArray(selectedDates) ? selectedDates : [selectedDates]; return selectedDates.some(selectedDate => { if ( selectedDate instanceof Date && startOfDay(selectedDate).getTime() === startOfDay(date).getTime() ) { return t...
[ "function", "isSelected", "(", "selectedDates", ",", "date", ")", "{", "selectedDates", "=", "Array", ".", "isArray", "(", "selectedDates", ")", "?", "selectedDates", ":", "[", "selectedDates", "]", ";", "return", "selectedDates", ".", "some", "(", "selectedDa...
Normalizes dates to the beginning of the day, then checks to see if the day given is found in the selectedDates. @param {Array.<Date>} selectedDates An array of dates currently selected @param {Date} date The date to search with against selectedDates @returns {Boolean} Whether day is found in selectedDates
[ "Normalizes", "dates", "to", "the", "beginning", "of", "the", "day", "then", "checks", "to", "see", "if", "the", "day", "given", "is", "found", "in", "the", "selectedDates", "." ]
93499eb6d9434219d6f0697bb8c8a99bde704109
https://github.com/deseretdigital/dayzed/blob/93499eb6d9434219d6f0697bb8c8a99bde704109/src/utils.js#L436-L449
18,381
deseretdigital/dayzed
src/utils.js
isSelectable
function isSelectable(minDate, maxDate, date) { if ( (minDate && isBefore(date, minDate)) || (maxDate && isBefore(maxDate, date)) ) { return false; } return true; }
javascript
function isSelectable(minDate, maxDate, date) { if ( (minDate && isBefore(date, minDate)) || (maxDate && isBefore(maxDate, date)) ) { return false; } return true; }
[ "function", "isSelectable", "(", "minDate", ",", "maxDate", ",", "date", ")", "{", "if", "(", "(", "minDate", "&&", "isBefore", "(", "date", ",", "minDate", ")", ")", "||", "(", "maxDate", "&&", "isBefore", "(", "maxDate", ",", "date", ")", ")", ")",...
Checks to see if the date given is between the min and max dates. @param {Date} minDate The earliest date available @param {Date} maxDate The furthest date available @param {Date} date The date to compare with @returns {Boolean} Whether the date is between min and max date
[ "Checks", "to", "see", "if", "the", "date", "given", "is", "between", "the", "min", "and", "max", "dates", "." ]
93499eb6d9434219d6f0697bb8c8a99bde704109
https://github.com/deseretdigital/dayzed/blob/93499eb6d9434219d6f0697bb8c8a99bde704109/src/utils.js#L459-L467
18,382
taromero/swal-forms
swal-forms.js
extendPreventingOverrides
function extendPreventingOverrides (a, b) { Object.keys(b).forEach(addContentFromBtoA) return a function addContentFromBtoA (key) { if (a.hasOwnProperty(key)) { mergeIntoAnArray(a, b, key) } else { a[key] = b[key] } ...
javascript
function extendPreventingOverrides (a, b) { Object.keys(b).forEach(addContentFromBtoA) return a function addContentFromBtoA (key) { if (a.hasOwnProperty(key)) { mergeIntoAnArray(a, b, key) } else { a[key] = b[key] } ...
[ "function", "extendPreventingOverrides", "(", "a", ",", "b", ")", "{", "Object", ".", "keys", "(", "b", ")", ".", "forEach", "(", "addContentFromBtoA", ")", "return", "a", "function", "addContentFromBtoA", "(", "key", ")", "{", "if", "(", "a", ".", "hasO...
for checkboxes we want to obtain all selected values in an array
[ "for", "checkboxes", "we", "want", "to", "obtain", "all", "selected", "values", "in", "an", "array" ]
8095f1f89d60eedf0c24dc6850b65f32116925e7
https://github.com/taromero/swal-forms/blob/8095f1f89d60eedf0c24dc6850b65f32116925e7/swal-forms.js#L91-L102
18,383
taromero/swal-forms
swal-forms.js
t
function t (template, data) { for (var key in data) { template = template.replace(new RegExp('{' + key + '}', 'g'), data[key] || '') } return template }
javascript
function t (template, data) { for (var key in data) { template = template.replace(new RegExp('{' + key + '}', 'g'), data[key] || '') } return template }
[ "function", "t", "(", "template", ",", "data", ")", "{", "for", "(", "var", "key", "in", "data", ")", "{", "template", "=", "template", ".", "replace", "(", "new", "RegExp", "(", "'{'", "+", "key", "+", "'}'", ",", "'g'", ")", ",", "data", "[", ...
string interpolation hack
[ "string", "interpolation", "hack" ]
8095f1f89d60eedf0c24dc6850b65f32116925e7
https://github.com/taromero/swal-forms/blob/8095f1f89d60eedf0c24dc6850b65f32116925e7/swal-forms.js#L230-L235
18,384
kentcdodds/rtl-css-js
src/internal/utils.js
getValuesAsList
function getValuesAsList(value) { return ( value .replace(/ +/g, ' ') // remove all extraneous spaces .split(' ') .map(i => i.trim()) // get rid of extra space before/after each item .filter(Boolean) // get rid of empty strings // join items which are within parenthese // lucki...
javascript
function getValuesAsList(value) { return ( value .replace(/ +/g, ' ') // remove all extraneous spaces .split(' ') .map(i => i.trim()) // get rid of extra space before/after each item .filter(Boolean) // get rid of empty strings // join items which are within parenthese // lucki...
[ "function", "getValuesAsList", "(", "value", ")", "{", "return", "(", "value", ".", "replace", "(", "/", " +", "/", "g", ",", "' '", ")", "// remove all extraneous spaces", ".", "split", "(", "' '", ")", ".", "map", "(", "i", "=>", "i", ".", "trim", ...
This takes a list of CSS values and converts it to an array @param {String} value - something like `1px`, `1px 2em`, or `3pt rgb(150, 230, 550) 40px calc(100% - 5px)` @return {Array} the split values (for example: `['3pt', 'rgb(150, 230, 550)', '40px', 'calc(100% - 5px)']`)
[ "This", "takes", "a", "list", "of", "CSS", "values", "and", "converts", "it", "to", "an", "array" ]
b148865ce6a4c994eba292015b8f44b5dae7edaa
https://github.com/kentcdodds/rtl-css-js/blob/b148865ce6a4c994eba292015b8f44b5dae7edaa/src/internal/utils.js#L89-L113
18,385
kentcdodds/rtl-css-js
src/internal/utils.js
handleQuartetValues
function handleQuartetValues(value) { const splitValues = getValuesAsList(value) if (splitValues.length <= 3 || splitValues.length > 4) { return value } const [top, right, bottom, left] = splitValues return [top, left, bottom, right].join(' ') }
javascript
function handleQuartetValues(value) { const splitValues = getValuesAsList(value) if (splitValues.length <= 3 || splitValues.length > 4) { return value } const [top, right, bottom, left] = splitValues return [top, left, bottom, right].join(' ') }
[ "function", "handleQuartetValues", "(", "value", ")", "{", "const", "splitValues", "=", "getValuesAsList", "(", "value", ")", "if", "(", "splitValues", ".", "length", "<=", "3", "||", "splitValues", ".", "length", ">", "4", ")", "{", "return", "value", "}"...
This is intended for properties that are `top right bottom left` and will switch them to `top left bottom right` @param {String} value - `1px 2px 3px 4px` for example, but also handles cases where there are too few/too many and simply returns the value in those cases (which is the correct behavior) @return {String} the...
[ "This", "is", "intended", "for", "properties", "that", "are", "top", "right", "bottom", "left", "and", "will", "switch", "them", "to", "top", "left", "bottom", "right" ]
b148865ce6a4c994eba292015b8f44b5dae7edaa
https://github.com/kentcdodds/rtl-css-js/blob/b148865ce6a4c994eba292015b8f44b5dae7edaa/src/internal/utils.js#L121-L128
18,386
kentcdodds/rtl-css-js
src/index.js
convert
function convert(object) { return Object.keys(object).reduce((newObj, originalKey) => { let originalValue = object[originalKey] if (isString(originalValue)) { // you're welcome to later code 😺 originalValue = originalValue.trim() } // Some properties should never be transformed if (i...
javascript
function convert(object) { return Object.keys(object).reduce((newObj, originalKey) => { let originalValue = object[originalKey] if (isString(originalValue)) { // you're welcome to later code 😺 originalValue = originalValue.trim() } // Some properties should never be transformed if (i...
[ "function", "convert", "(", "object", ")", "{", "return", "Object", ".", "keys", "(", "object", ")", ".", "reduce", "(", "(", "newObj", ",", "originalKey", ")", "=>", "{", "let", "originalValue", "=", "object", "[", "originalKey", "]", "if", "(", "isSt...
converts properties and values in the CSS in JS object to their corresponding RTL values @param {Object} object the CSS in JS object @return {Object} the RTL converted object
[ "converts", "properties", "and", "values", "in", "the", "CSS", "in", "JS", "object", "to", "their", "corresponding", "RTL", "values" ]
b148865ce6a4c994eba292015b8f44b5dae7edaa
https://github.com/kentcdodds/rtl-css-js/blob/b148865ce6a4c994eba292015b8f44b5dae7edaa/src/index.js#L61-L79
18,387
kentcdodds/rtl-css-js
src/index.js
convertProperty
function convertProperty(originalKey, originalValue) { const isNoFlip = /\/\*\s?@noflip\s?\*\//.test(originalValue) const key = isNoFlip ? originalKey : getPropertyDoppelganger(originalKey) const value = isNoFlip ? originalValue : getValueDoppelganger(key, originalValue) return {key, value} }
javascript
function convertProperty(originalKey, originalValue) { const isNoFlip = /\/\*\s?@noflip\s?\*\//.test(originalValue) const key = isNoFlip ? originalKey : getPropertyDoppelganger(originalKey) const value = isNoFlip ? originalValue : getValueDoppelganger(key, originalValue) return {key, value} }
[ "function", "convertProperty", "(", "originalKey", ",", "originalValue", ")", "{", "const", "isNoFlip", "=", "/", "\\/\\*\\s?@noflip\\s?\\*\\/", "/", ".", "test", "(", "originalValue", ")", "const", "key", "=", "isNoFlip", "?", "originalKey", ":", "getPropertyDopp...
Converts a property and its value to the corresponding RTL key and value @param {String} originalKey the original property key @param {Number|String|Object} originalValue the original css property value @return {Object} the new {key, value} pair
[ "Converts", "a", "property", "and", "its", "value", "to", "the", "corresponding", "RTL", "key", "and", "value" ]
b148865ce6a4c994eba292015b8f44b5dae7edaa
https://github.com/kentcdodds/rtl-css-js/blob/b148865ce6a4c994eba292015b8f44b5dae7edaa/src/index.js#L87-L94
18,388
kentcdodds/rtl-css-js
src/index.js
getValueDoppelganger
function getValueDoppelganger(key, originalValue) { /* eslint complexity:[2, 9] */ // let's try to keep the complexity down... If we have to do this much more, let's break this up if (isNullOrUndefined(originalValue) || isBoolean(originalValue)) { return originalValue } if (isObject(originalValue)) { r...
javascript
function getValueDoppelganger(key, originalValue) { /* eslint complexity:[2, 9] */ // let's try to keep the complexity down... If we have to do this much more, let's break this up if (isNullOrUndefined(originalValue) || isBoolean(originalValue)) { return originalValue } if (isObject(originalValue)) { r...
[ "function", "getValueDoppelganger", "(", "key", ",", "originalValue", ")", "{", "/* eslint complexity:[2, 9] */", "// let's try to keep the complexity down... If we have to do this much more, let's break this up", "if", "(", "isNullOrUndefined", "(", "originalValue", ")", "||", "is...
This converts the given value to the RTL version of that value based on the key @param {String} key this is the key (note: this should be the RTL version of the originalKey) @param {String|Number|Object} originalValue the original css property value. If it's an object, then we'll convert that as well @return {String|Nu...
[ "This", "converts", "the", "given", "value", "to", "the", "RTL", "version", "of", "that", "value", "based", "on", "the", "key" ]
b148865ce6a4c994eba292015b8f44b5dae7edaa
https://github.com/kentcdodds/rtl-css-js/blob/b148865ce6a4c994eba292015b8f44b5dae7edaa/src/index.js#L111-L143
18,389
chain/chain
docs/common/js/layout.js
selectOSTab
function selectOSTab(target, osName) { // Declare all variables var i, tabcontent, tablinks; // Get all elements with class="tabcontent" and hide them tabcontent = document.getElementsByClassName("tabcontent"); for (i = 0; i < tabcontent.length; i++) { tabcontent[i].style.display = "none"; } // Get ...
javascript
function selectOSTab(target, osName) { // Declare all variables var i, tabcontent, tablinks; // Get all elements with class="tabcontent" and hide them tabcontent = document.getElementsByClassName("tabcontent"); for (i = 0; i < tabcontent.length; i++) { tabcontent[i].style.display = "none"; } // Get ...
[ "function", "selectOSTab", "(", "target", ",", "osName", ")", "{", "// Declare all variables", "var", "i", ",", "tabcontent", ",", "tablinks", ";", "// Get all elements with class=\"tabcontent\" and hide them", "tabcontent", "=", "document", ".", "getElementsByClassName", ...
switcher between the navtabs for operating systems
[ "switcher", "between", "the", "navtabs", "for", "operating", "systems" ]
4e9b90d76fe9a4c53adadf03cf8db96a0a5ff38c
https://github.com/chain/chain/blob/4e9b90d76fe9a4c53adadf03cf8db96a0a5ff38c/docs/common/js/layout.js#L104-L123
18,390
chain/chain
docs/common/js/layout.js
showSignUpForm
function showSignUpForm() { var modal = document.getElementById('downloadModal'); // Make sure modal is in the body, not where it was originally deployed. $("body").append($(modal)) // Get the button that opens the modal var btn = document.getElementById("downloadBtn"); // Get the <span> element that closes ...
javascript
function showSignUpForm() { var modal = document.getElementById('downloadModal'); // Make sure modal is in the body, not where it was originally deployed. $("body").append($(modal)) // Get the button that opens the modal var btn = document.getElementById("downloadBtn"); // Get the <span> element that closes ...
[ "function", "showSignUpForm", "(", ")", "{", "var", "modal", "=", "document", ".", "getElementById", "(", "'downloadModal'", ")", ";", "// Make sure modal is in the body, not where it was originally deployed.", "$", "(", "\"body\"", ")", ".", "append", "(", "$", "(", ...
Modal to sign up for newsletter
[ "Modal", "to", "sign", "up", "for", "newsletter" ]
4e9b90d76fe9a4c53adadf03cf8db96a0a5ff38c
https://github.com/chain/chain/blob/4e9b90d76fe9a4c53adadf03cf8db96a0a5ff38c/docs/common/js/layout.js#L133-L159
18,391
atsepkov/RapydScript
tools/repl.js
global_names
function global_names(ctx, options) { try { var ans = vm.runInContext(options.enum_global, ctx); ans = ans.concat(all_keywords); ans.sort(); var seen = {}; ans.filter(function (item) { if (Object.prototype.hasOwnProperty.call(seen, item)) return false; ...
javascript
function global_names(ctx, options) { try { var ans = vm.runInContext(options.enum_global, ctx); ans = ans.concat(all_keywords); ans.sort(); var seen = {}; ans.filter(function (item) { if (Object.prototype.hasOwnProperty.call(seen, item)) return false; ...
[ "function", "global_names", "(", "ctx", ",", "options", ")", "{", "try", "{", "var", "ans", "=", "vm", ".", "runInContext", "(", "options", ".", "enum_global", ",", "ctx", ")", ";", "ans", "=", "ans", ".", "concat", "(", "all_keywords", ")", ";", "an...
tab-completion
[ "tab", "-", "completion" ]
ef3c03dab890eedb1eed9b5d427153743f55e919
https://github.com/atsepkov/RapydScript/blob/ef3c03dab890eedb1eed9b5d427153743f55e919/tools/repl.js#L95-L111
18,392
zhangxiang958/vue-tab
src/lib/demo.js
function(element, type, handler) { if(element.addEventListener) { addEvent = function(element, type, handler) { element.addEventListener(type, handler, false); }; } else if(element.attachEvent) { addEvent = function(element, type, handler) { element.attachEvent('on' + type, han...
javascript
function(element, type, handler) { if(element.addEventListener) { addEvent = function(element, type, handler) { element.addEventListener(type, handler, false); }; } else if(element.attachEvent) { addEvent = function(element, type, handler) { element.attachEvent('on' + type, han...
[ "function", "(", "element", ",", "type", ",", "handler", ")", "{", "if", "(", "element", ".", "addEventListener", ")", "{", "addEvent", "=", "function", "(", "element", ",", "type", ",", "handler", ")", "{", "element", ".", "addEventListener", "(", "type...
Cross-browser compatible event handler.
[ "Cross", "-", "browser", "compatible", "event", "handler", "." ]
8d54e04abbfe134ecc63ccc21872f45f165516e4
https://github.com/zhangxiang958/vue-tab/blob/8d54e04abbfe134ecc63ccc21872f45f165516e4/src/lib/demo.js#L28-L43
18,393
zhangxiang958/vue-tab
src/lib/demo.js
function(arr) { var key = 0; var min = arr[0]; for(var i = 1, len = arr.length; i < len; i++) { if(arr[i] < min) { key = i; min = arr[i]; } } return key; }
javascript
function(arr) { var key = 0; var min = arr[0]; for(var i = 1, len = arr.length; i < len; i++) { if(arr[i] < min) { key = i; min = arr[i]; } } return key; }
[ "function", "(", "arr", ")", "{", "var", "key", "=", "0", ";", "var", "min", "=", "arr", "[", "0", "]", ";", "for", "(", "var", "i", "=", "1", ",", "len", "=", "arr", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "if", ...
Get index of the minimal value within an array of numbers.
[ "Get", "index", "of", "the", "minimal", "value", "within", "an", "array", "of", "numbers", "." ]
8d54e04abbfe134ecc63ccc21872f45f165516e4
https://github.com/zhangxiang958/vue-tab/blob/8d54e04abbfe134ecc63ccc21872f45f165516e4/src/lib/demo.js#L56-L66
18,394
zhangxiang958/vue-tab
src/lib/demo.js
function(arr) { var key = 0; var max = arr[0]; for(var i = 1, len = arr.length; i < len; i++) { if(arr[i] > max) { key = i; max = arr[i]; } } return key; }
javascript
function(arr) { var key = 0; var max = arr[0]; for(var i = 1, len = arr.length; i < len; i++) { if(arr[i] > max) { key = i; max = arr[i]; } } return key; }
[ "function", "(", "arr", ")", "{", "var", "key", "=", "0", ";", "var", "max", "=", "arr", "[", "0", "]", ";", "for", "(", "var", "i", "=", "1", ",", "len", "=", "arr", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "if", ...
Get index of the maximal value within an array of numbers.
[ "Get", "index", "of", "the", "maximal", "value", "within", "an", "array", "of", "numbers", "." ]
8d54e04abbfe134ecc63ccc21872f45f165516e4
https://github.com/zhangxiang958/vue-tab/blob/8d54e04abbfe134ecc63ccc21872f45f165516e4/src/lib/demo.js#L69-L79
18,395
zhangxiang958/vue-tab
src/lib/demo.js
function(event) { clearTimeout(noticeDelay); var e = event || window.event; var target = e.target || e.srcElement; if(target.tagName == 'SPAN') { var targetTitle = target.parentNode.tagLine; noticeContainer.innerHTML = (target.className == 'like' ? 'Liked ' : 'Marked ') + '<strong>' + target...
javascript
function(event) { clearTimeout(noticeDelay); var e = event || window.event; var target = e.target || e.srcElement; if(target.tagName == 'SPAN') { var targetTitle = target.parentNode.tagLine; noticeContainer.innerHTML = (target.className == 'like' ? 'Liked ' : 'Marked ') + '<strong>' + target...
[ "function", "(", "event", ")", "{", "clearTimeout", "(", "noticeDelay", ")", ";", "var", "e", "=", "event", "||", "window", ".", "event", ";", "var", "target", "=", "e", ".", "target", "||", "e", ".", "srcElement", ";", "if", "(", "target", ".", "t...
Pop notice tag after user liked or marked an item.
[ "Pop", "notice", "tag", "after", "user", "liked", "or", "marked", "an", "item", "." ]
8d54e04abbfe134ecc63ccc21872f45f165516e4
https://github.com/zhangxiang958/vue-tab/blob/8d54e04abbfe134ecc63ccc21872f45f165516e4/src/lib/demo.js#L82-L94
18,396
zhangxiang958/vue-tab
src/lib/demo.js
function() { return Math.max(MIN_COLUMN_COUNT, Math.floor((document.body.offsetWidth + GAP_WIDTH) / (COLUMN_WIDTH + GAP_WIDTH))); }
javascript
function() { return Math.max(MIN_COLUMN_COUNT, Math.floor((document.body.offsetWidth + GAP_WIDTH) / (COLUMN_WIDTH + GAP_WIDTH))); }
[ "function", "(", ")", "{", "return", "Math", ".", "max", "(", "MIN_COLUMN_COUNT", ",", "Math", ".", "floor", "(", "(", "document", ".", "body", ".", "offsetWidth", "+", "GAP_WIDTH", ")", "/", "(", "COLUMN_WIDTH", "+", "GAP_WIDTH", ")", ")", ")", ";", ...
Calculate column count from current page width.
[ "Calculate", "column", "count", "from", "current", "page", "width", "." ]
8d54e04abbfe134ecc63ccc21872f45f165516e4
https://github.com/zhangxiang958/vue-tab/blob/8d54e04abbfe134ecc63ccc21872f45f165516e4/src/lib/demo.js#L97-L99
18,397
zhangxiang958/vue-tab
src/lib/demo.js
function(count) { columnHeights = []; for(var i = 0; i < count; i++) { columnHeights.push(0); } cellsContainer.style.width = (count * (COLUMN_WIDTH + GAP_WIDTH) - GAP_WIDTH) + 'px'; }
javascript
function(count) { columnHeights = []; for(var i = 0; i < count; i++) { columnHeights.push(0); } cellsContainer.style.width = (count * (COLUMN_WIDTH + GAP_WIDTH) - GAP_WIDTH) + 'px'; }
[ "function", "(", "count", ")", "{", "columnHeights", "=", "[", "]", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "count", ";", "i", "++", ")", "{", "columnHeights", ".", "push", "(", "0", ")", ";", "}", "cellsContainer", ".", "style", ...
Reset array of column heights and container width.
[ "Reset", "array", "of", "column", "heights", "and", "container", "width", "." ]
8d54e04abbfe134ecc63ccc21872f45f165516e4
https://github.com/zhangxiang958/vue-tab/blob/8d54e04abbfe134ecc63ccc21872f45f165516e4/src/lib/demo.js#L102-L108
18,398
zhangxiang958/vue-tab
src/lib/demo.js
function(num) { if(loading) { // Avoid sending too many requests to get new cells. return; } var xhrRequest = new XMLHttpRequest(); var fragment = document.createDocumentFragment(); var cells = []; var images; xhrRequest.open('GET', 'json.php?n=' + num, true); xhrRequest.onre...
javascript
function(num) { if(loading) { // Avoid sending too many requests to get new cells. return; } var xhrRequest = new XMLHttpRequest(); var fragment = document.createDocumentFragment(); var cells = []; var images; xhrRequest.open('GET', 'json.php?n=' + num, true); xhrRequest.onre...
[ "function", "(", "num", ")", "{", "if", "(", "loading", ")", "{", "// Avoid sending too many requests to get new cells.", "return", ";", "}", "var", "xhrRequest", "=", "new", "XMLHttpRequest", "(", ")", ";", "var", "fragment", "=", "document", ".", "createDocume...
Fetch JSON string via Ajax, parse to HTML and append to the container.
[ "Fetch", "JSON", "string", "via", "Ajax", "parse", "to", "HTML", "and", "append", "to", "the", "container", "." ]
8d54e04abbfe134ecc63ccc21872f45f165516e4
https://github.com/zhangxiang958/vue-tab/blob/8d54e04abbfe134ecc63ccc21872f45f165516e4/src/lib/demo.js#L111-L139
18,399
zhangxiang958/vue-tab
src/lib/demo.js
function(num) { if(loading) { // Avoid sending too many requests to get new cells. return; } var fragment = document.createDocumentFragment(); var cells = []; var images = [0, 286, 143, 270, 143, 190, 285, 152, 275, 285, 285, 128, 281, 242, 339, 236, 157, 286, 259, 267, 137, 253, 127, 19...
javascript
function(num) { if(loading) { // Avoid sending too many requests to get new cells. return; } var fragment = document.createDocumentFragment(); var cells = []; var images = [0, 286, 143, 270, 143, 190, 285, 152, 275, 285, 285, 128, 281, 242, 339, 236, 157, 286, 259, 267, 137, 253, 127, 19...
[ "function", "(", "num", ")", "{", "if", "(", "loading", ")", "{", "// Avoid sending too many requests to get new cells.", "return", ";", "}", "var", "fragment", "=", "document", ".", "createDocumentFragment", "(", ")", ";", "var", "cells", "=", "[", "]", ";", ...
Fake mode, only for GitHub demo. Delete this function in your project.
[ "Fake", "mode", "only", "for", "GitHub", "demo", ".", "Delete", "this", "function", "in", "your", "project", "." ]
8d54e04abbfe134ecc63ccc21872f45f165516e4
https://github.com/zhangxiang958/vue-tab/blob/8d54e04abbfe134ecc63ccc21872f45f165516e4/src/lib/demo.js#L142-L165