code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
addTrigger = function (triggers, currentTrigger, affectedSpecs) {
if (!triggers[currentTrigger]) {
triggers[currentTrigger] = [];
}
triggers[currentTrigger] = _.uniq(triggers[currentTrigger].concat(affectedSpecs));
return triggers;
} | affectedFiles
This program outputs a list of files affected by changes in other files that are in the former ones dependency tree.
The problem that inspired this program is to know what test files can be broken because of modifications on
another files in the code base. This way, we'll know the exact test files that w... | addTrigger | javascript | CartoDB/cartodb | lib/build/affectedFiles/affectedFiles.js | https://github.com/CartoDB/cartodb/blob/master/lib/build/affectedFiles/affectedFiles.js | BSD-3-Clause |
logTriggers = function (triggers) {
var keys = Object.keys(triggers);
keys.forEach(function (key) {
console.log('');
console.log(colors.yellow(key));
console.log(colors.yellow(new Array(key.length + 1).join('-')));
triggers[key].forEach(function (trigger) {
console.log(trigger);
});
});
... | affectedFiles
This program outputs a list of files affected by changes in other files that are in the former ones dependency tree.
The problem that inspired this program is to know what test files can be broken because of modifications on
another files in the code base. This way, we'll know the exact test files that w... | logTriggers | javascript | CartoDB/cartodb | lib/build/affectedFiles/affectedFiles.js | https://github.com/CartoDB/cartodb/blob/master/lib/build/affectedFiles/affectedFiles.js | BSD-3-Clause |
main = function (testsFolder, modifiedFiles, filesRegex) {
filesRegex = filesRegex || 'spec\\.js$';
var onlyTheseFiles = function (file, stats) {
var theRegex = new RegExp(filesRegex);
return !stats.isDirectory() && !theRegex.test(file);
};
function promiseMap (xs, f) {
const reducer = (ysAcc$, x)... | affectedFiles
This program outputs a list of files affected by changes in other files that are in the former ones dependency tree.
The problem that inspired this program is to know what test files can be broken because of modifications on
another files in the code base. This way, we'll know the exact test files that w... | main | javascript | CartoDB/cartodb | lib/build/affectedFiles/affectedFiles.js | https://github.com/CartoDB/cartodb/blob/master/lib/build/affectedFiles/affectedFiles.js | BSD-3-Clause |
onlyTheseFiles = function (file, stats) {
var theRegex = new RegExp(filesRegex);
return !stats.isDirectory() && !theRegex.test(file);
} | affectedFiles
This program outputs a list of files affected by changes in other files that are in the former ones dependency tree.
The problem that inspired this program is to know what test files can be broken because of modifications on
another files in the code base. This way, we'll know the exact test files that w... | onlyTheseFiles | javascript | CartoDB/cartodb | lib/build/affectedFiles/affectedFiles.js | https://github.com/CartoDB/cartodb/blob/master/lib/build/affectedFiles/affectedFiles.js | BSD-3-Clause |
function promiseMap (xs, f) {
const reducer = (ysAcc$, x) =>
ysAcc$.then(ysAcc => f(x).then(y => ysAcc.push(y) && ysAcc));
return xs.reduce(reducer, Promise.resolve([]));
} | affectedFiles
This program outputs a list of files affected by changes in other files that are in the former ones dependency tree.
The problem that inspired this program is to know what test files can be broken because of modifications on
another files in the code base. This way, we'll know the exact test files that w... | promiseMap | javascript | CartoDB/cartodb | lib/build/affectedFiles/affectedFiles.js | https://github.com/CartoDB/cartodb/blob/master/lib/build/affectedFiles/affectedFiles.js | BSD-3-Clause |
reducer = (ysAcc$, x) =>
ysAcc$.then(ysAcc => f(x).then(y => ysAcc.push(y) && ysAcc)) | affectedFiles
This program outputs a list of files affected by changes in other files that are in the former ones dependency tree.
The problem that inspired this program is to know what test files can be broken because of modifications on
another files in the code base. This way, we'll know the exact test files that w... | reducer | javascript | CartoDB/cartodb | lib/build/affectedFiles/affectedFiles.js | https://github.com/CartoDB/cartodb/blob/master/lib/build/affectedFiles/affectedFiles.js | BSD-3-Clause |
reducer = (ysAcc$, x) =>
ysAcc$.then(ysAcc => f(x).then(y => ysAcc.push(y) && ysAcc)) | affectedFiles
This program outputs a list of files affected by changes in other files that are in the former ones dependency tree.
The problem that inspired this program is to know what test files can be broken because of modifications on
another files in the code base. This way, we'll know the exact test files that w... | reducer | javascript | CartoDB/cartodb | lib/build/affectedFiles/affectedFiles.js | https://github.com/CartoDB/cartodb/blob/master/lib/build/affectedFiles/affectedFiles.js | BSD-3-Clause |
function readFiles (folder) {
return recursive(folder, [onlyTheseFiles]);
} | affectedFiles
This program outputs a list of files affected by changes in other files that are in the former ones dependency tree.
The problem that inspired this program is to know what test files can be broken because of modifications on
another files in the code base. This way, we'll know the exact test files that w... | readFiles | javascript | CartoDB/cartodb | lib/build/affectedFiles/affectedFiles.js | https://github.com/CartoDB/cartodb/blob/master/lib/build/affectedFiles/affectedFiles.js | BSD-3-Clause |
function getAffectedFilesFrom (files) {
if (!files || files.length === 0) {
console.error('Spec files not found.');
process.exit(1);
}
console.log('Found ' + files.length + ' spec files.');
var allFilePromises = files.reduce(function (acc, file) {
acc.push(trie.addFileRequires(file));... | affectedFiles
This program outputs a list of files affected by changes in other files that are in the former ones dependency tree.
The problem that inspired this program is to know what test files can be broken because of modifications on
another files in the code base. This way, we'll know the exact test files that w... | getAffectedFilesFrom | javascript | CartoDB/cartodb | lib/build/affectedFiles/affectedFiles.js | https://github.com/CartoDB/cartodb/blob/master/lib/build/affectedFiles/affectedFiles.js | BSD-3-Clause |
function getCurrentBranchName () {
var promise = new Promise(function (resolve, reject) {
child.exec('git rev-parse --abbrev-ref HEAD', function (error, stdout, stderr) {
if (!error) {
resolve(stdout.replace(/(\r\n|\n|\r)/gm, ''));
}
});
});
return promise;
} | getCurrentBranchName
@returns {string} The name of the current git branch | getCurrentBranchName | javascript | CartoDB/cartodb | lib/build/branchFiles/modifiedFiles.js | https://github.com/CartoDB/cartodb/blob/master/lib/build/branchFiles/modifiedFiles.js | BSD-3-Clause |
function getFilesModifiedInBranch (branchName) {
var promise = new Promise(function (resolve, reject) {
var files;
var command = 'git diff --name-only ' + branchName + ' `git merge-base ' + branchName + ' master`';
child.exec(command, function (error, stdout, stderr) {
if (!error) {
var new... | getFilesModifiedInBranch
@param {string} branchName The branch name to get the list of modified file list from.
@returns {Promise} result.
@resolves {string[]} The list of modified files in the given branch. | getFilesModifiedInBranch | javascript | CartoDB/cartodb | lib/build/branchFiles/modifiedFiles.js | https://github.com/CartoDB/cartodb/blob/master/lib/build/branchFiles/modifiedFiles.js | BSD-3-Clause |
notNodeModules = function (file, stats) {
return stats.isDirectory() && file.toLowerCase().indexOf('node_modules') > -1;
} | getFilesModifiedInBranch
@param {string} branchName The branch name to get the list of modified file list from.
@returns {Promise} result.
@resolves {string[]} The list of modified files in the given branch. | notNodeModules | javascript | CartoDB/cartodb | lib/build/branchFiles/modifiedFiles.js | https://github.com/CartoDB/cartodb/blob/master/lib/build/branchFiles/modifiedFiles.js | BSD-3-Clause |
function getFilesInStatus () {
var promise = new Promise(function (resolve, reject) {
child.exec('git status --short', function (error, stdout, stderr) {
if (!error) {
var newLine = /\n/;
var files = stdout.split(newLine);
var promises = files.reduce(function (acc, file) {
... | getFilesInStatus
@returns {Promise} result.
@resolves {string[]} The list of working tree files as shown by `git status --short` but without status codes. | getFilesInStatus | javascript | CartoDB/cartodb | lib/build/branchFiles/modifiedFiles.js | https://github.com/CartoDB/cartodb/blob/master/lib/build/branchFiles/modifiedFiles.js | BSD-3-Clause |
function duplicatedDependencies (lockFileContent, modulesToValidate) {
var all = alldeps(lockFileContent);
modulesToValidate = modulesToValidate || Object.keys(all);
return modulesToValidate.reduce(function (duplicatedMods, mod) {
if (all[mod] === undefined) {
console.error('!!! ERROR !!!');
con... | Checks all modules dependencies versions within a package-lock to not be
duplicated from different parent dependencies.
For instance if there are a couple of dependencies using a different version
of backbone it will return backbone with its parent dependencies. | duplicatedDependencies | javascript | CartoDB/cartodb | lib/build/tasks/locked-dependencies.js | https://github.com/CartoDB/cartodb/blob/master/lib/build/tasks/locked-dependencies.js | BSD-3-Clause |
function dependenciesVersion (lockFileContentOne, lockFileContentTwo, modulesToValidate) {
var allDependenciesOne = alldeps(lockFileContentOne);
var allDependenciesTwo = alldeps(lockFileContentTwo);
return modulesToValidate.reduce(function (depWithDiffVer, mod) {
var verDepFromOne = Object.keys(allDependenci... | Checks if the version of a package-lock file matches with the version of another lock file.
It is necessary to pass the modules to validate.
It will return the modules where the version differs. | dependenciesVersion | javascript | CartoDB/cartodb | lib/build/tasks/locked-dependencies.js | https://github.com/CartoDB/cartodb/blob/master/lib/build/tasks/locked-dependencies.js | BSD-3-Clause |
function filterSpecs (affectedSpecs, match) {
const re = new RegExp(match);
return affectedSpecs.filter(specFile => {
const fileName = specFile.split(/spec\//)[1];
return re.test(fileName);
});
} | /*.spec.js',
dashboard_specs: './lib/assets/test/spec/dashboard/* | filterSpecs | javascript | CartoDB/cartodb | lib/build/tasks/webpack/webpack.js | https://github.com/CartoDB/cartodb/blob/master/lib/build/tasks/webpack/webpack.js | BSD-3-Clause |
affected = function (option, grunt) {
var done = this.async();
affectedSpecs = [
'./lib/assets/javascripts/builder/components/form-components/index.js',
'./lib/assets/test/spec/builder/components/modals/add-analysis/analysis-options.spec.js',
'./lib/assets/test/spec/builder/routes/router.spec.js'
];
... | /*.spec.js'
};
// Filter a list of files with a string
// the string will be converted to a RegExp
function filterSpecs (affectedSpecs, match) {
const re = new RegExp(match);
return affectedSpecs.filter(specFile => {
const fileName = specFile.split(/spec\//)[1];
return re.test(fileName);
});
}
/**
affec... | affected | javascript | CartoDB/cartodb | lib/build/tasks/webpack/webpack.js | https://github.com/CartoDB/cartodb/blob/master/lib/build/tasks/webpack/webpack.js | BSD-3-Clause |
dashboard = function (option, grunt) {
affectedSpecs = glob.sync(paths.dashboard_specs);
const match = grunt.option('match');
if (match) {
affectedSpecs = filterSpecs(affectedSpecs, match);
}
affectedSpecs = _.uniq(affectedSpecs);
console.log(colors.yellow('All specs. ' + affectedSpecs.length + ' spe... | dashboard - To be used as part of a 'registerTask' Grunt definition | dashboard | javascript | CartoDB/cartodb | lib/build/tasks/webpack/webpack.js | https://github.com/CartoDB/cartodb/blob/master/lib/build/tasks/webpack/webpack.js | BSD-3-Clause |
bootstrap = function (config, grunt) {
if (!config) {
throw new Error('Please provide subconfiguration key for webpack.');
}
const cfg = configGenerator(config);
cfg.entry.main = affectedSpecs;
compiler[config] = webpack(cfg);
cache[config] = {};
compiler[config].apply(new webpack.CachePlugin(cache... | dashboard - To be used as part of a 'registerTask' Grunt definition | bootstrap | javascript | CartoDB/cartodb | lib/build/tasks/webpack/webpack.js | https://github.com/CartoDB/cartodb/blob/master/lib/build/tasks/webpack/webpack.js | BSD-3-Clause |
function logAssets (assets) {
_.each(assets, function (asset) {
var trace = asset.name;
trace += ' ' + pretty(asset.size);
console.log(colors.yellow(trace));
});
} | dashboard - To be used as part of a 'registerTask' Grunt definition | logAssets | javascript | CartoDB/cartodb | lib/build/tasks/webpack/webpack.js | https://github.com/CartoDB/cartodb/blob/master/lib/build/tasks/webpack/webpack.js | BSD-3-Clause |
function Animator(callback, options) {
if(!options.steps) {
throw new Error("steps option missing")
}
this.options = options;
this.running = false;
this._tick = this._tick.bind(this);
this._t0 = +new Date();
this.callback = callback;
this._time = 0.0;
this.itemsReady = false;
... | options:
animationDuration in seconds
animationDelay in seconds | Animator | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function extend() {
var objs = arguments;
var a = objs[0];
for (var i = 1; i < objs.length; ++i) {
var b = objs[i];
for (var k in b) {
a[k] = b[k];
}
}
return a;
} | options:
animationDuration in seconds
animationDelay in seconds | extend | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function clone(a) {
return extend({}, a);
} | options:
animationDuration in seconds
animationDelay in seconds | clone | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function isFunction(f) {
return typeof f == 'function' || false;
} | options:
animationDuration in seconds
animationDelay in seconds | isFunction | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function isArray(value) {
return value && typeof value == 'object' && Object.prototype.toString.call(value) == '[object Array]';
} | options:
animationDuration in seconds
animationDelay in seconds | isArray | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function isBrowserSupported() {
return !!document.createElement('canvas');
} | options:
animationDuration in seconds
animationDelay in seconds | isBrowserSupported | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function userAgent() {
return typeof navigator !== 'undefined' ? navigator.userAgent : '';
} | options:
animationDuration in seconds
animationDelay in seconds | userAgent | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function CanvasLayer(opt_options) {
/**
* If true, canvas is in a map pane and the OverlayView is fully functional.
* See google.maps.OverlayView.onAdd for more information.
* @type {boolean}
* @private
*/
this.isAdded_ = false;
/**
* If true, each update will immediately schedule the next.
... | A map layer that provides a canvas over the slippy map and a callback
system for efficient animation. Requires canvas and CSS 2D transform
support.
@constructor
@extends google.maps.OverlayView
@param {CanvasLayerOptions=} opt_options Options to set in this CanvasLayer. | CanvasLayer | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function simpleBindShim(thisArg, func) {
return function() { func.apply(thisArg); };
} | Simple bind for functions with no args for bind-less browsers (Safari).
@param {Object} thisArg The this value used for the target function.
@param {function} func The function to be bound. | simpleBindShim | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function CanvasTileLayer(canvas_setup, render) {
this.tileSize = new google.maps.Size(256, 256);
this.maxZoom = 19;
this.name = "Tile #s";
this.alt = "Canvas tile layer";
this.tiles = {};
this.canvas_setup = canvas_setup;
this.render = render;
if (!render) {
this.render = canvas_setup;
}
} | Schedule a requestAnimationFrame callback to updateHandler. If one is
already scheduled, there is no effect. | CanvasTileLayer | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function distanceToCenterSq(point) {
var dx = point.x - center.x;
var dy = point.y - center.y;
return dx * dx + dy * dy;
} | Schedule a requestAnimationFrame callback to updateHandler. If one is
already scheduled, there is no effect. | distanceToCenterSq | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function GMapsTorqueLayer(options) {
var self = this;
if (!torque.isBrowserSupported()) {
throw new Error("browser is not supported by torque");
}
this.key = 0;
this.shader = null;
this.ready = false;
this.options = torque.extend({}, options);
this.options = torque.extend({
provider: 'windshaft'... | Schedule a requestAnimationFrame callback to updateHandler. If one is
already scheduled, there is no effect. | GMapsTorqueLayer | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function GMapsTiledTorqueLayer(options) {
this.options = torque.extend({}, options);
CanvasTileLayer.call(this, this._loadTile.bind(this), this.drawTile.bind(this));
this.initialize(options);
} | set the cartocss for the current renderer | GMapsTiledTorqueLayer | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function clamp(a, b) {
return function(t) {
return Math.max(Math.min(t, b), a);
};
} | return the value for position relative to map coordinates. null for no value | clamp | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function invLinear(a, b) {
var c = clamp(0, 1.0);
return function(t) {
return c((t - a)/(b - a));
};
} | return the value for position relative to map coordinates. null for no value | invLinear | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function linear(a, b) {
var c = clamp(a, b);
function _linear(t) {
return c(a*(1.0 - t) + t*b);
}
_linear.invert = function() {
return invLinear(a, b);
};
return _linear;
} | return the value for position relative to map coordinates. null for no value | linear | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function _linear(t) {
return c(a*(1.0 - t) + t*b);
} | return the value for position relative to map coordinates. null for no value | _linear | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
Point = function(x, y) {
this.x = x || 0;
this.y = y || 0;
} | return the value for position relative to map coordinates. null for no value | Point | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function clamp(value, optMin, optMax) {
if (optMin !== null) value = Math.max(value, optMin);
if (optMax !== null) value = Math.min(value, optMax);
return value;
} | return the value for position relative to map coordinates. null for no value | clamp | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function degreesToRadians(deg) {
return deg * (Math.PI / 180);
} | return the value for position relative to map coordinates. null for no value | degreesToRadians | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function radiansToDegrees(rad) {
return rad / (Math.PI / 180);
} | return the value for position relative to map coordinates. null for no value | radiansToDegrees | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
MercatorProjection = function() {
// this._tileSize = L.Browser.retina ? 512 : 256;
this._tileSize = 256;
this._pixelOrigin = new Point(this._tileSize / 2, this._tileSize / 2);
this._pixelsPerLonDegree = this._tileSize / 360;
this._pixelsPerLonRadian = this._tileSize / (2 * Math.PI);
} | return the value for position relative to map coordinates. null for no value | MercatorProjection | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function Metric(name) {
this.t0 = null;
this.name = name;
this.count = 0;
} | return the value for position relative to map coordinates. null for no value | Metric | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function format(str) {
for(var i = 1; i < arguments.length; ++i) {
var attrs = arguments[i];
for(var attr in attrs) {
str = str.replace(RegExp('\\{' + attr + '\\}', 'g'), attrs[attr]);
}
}
return str;
} | return the value for position relative to map coordinates. null for no value | format | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
json = function (options) {
this._ready = false;
this._tileQueue = [];
this.options = options;
this.options.is_time = this.options.is_time === undefined ? true: this.options.is_time;
this.options.tiler_protocol = options.tiler_protocol || 'http';
this.options.tiler_domain = options.tiler_domain... | return the value for position relative to map coordinates. null for no value | json | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function format(str, attrs) {
for(var i = 1; i < arguments.length; ++i) {
var attrs = arguments[i];
for(var attr in attrs) {
str = str.replace(RegExp('\\{' + attr + '\\}', 'g'), attrs[attr]);
}
}
return str;
} | `coord` object like {x : tilex, y: tiley }
`zoom` quadtree zoom level | format | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
json = function (options) {
// check options
this.options = options;
} | `coord` object like {x : tilex, y: tiley }
`zoom` quadtree zoom level | json | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function getKeys(row) {
var HEADER_SIZE = 3;
var valuesCount = row.data[2];
var keys = {};
for (var s = 0; s < valuesCount; ++s) {
keys[row.data[HEADER_SIZE + s]] = row.data[HEADER_SIZE + valuesCount + s];
}
return keys;
} | `coord` object like {x : tilex, y: tiley }
`zoom` quadtree zoom level | getKeys | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function format(str) {
for(var i = 1; i < arguments.length; ++i) {
var attrs = arguments[i];
for(var attr in attrs) {
str = str.replace(RegExp('\\{' + attr + '\\}', 'g'), attrs[attr]);
}
}
return str;
} | `coord` object like {x : tilex, y: tiley }
`zoom` quadtree zoom level | format | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
windshaft = function (options) {
this._ready = false;
this._tileQueue = [];
this.options = options;
this.options.is_time = this.options.is_time === undefined ? true: this.options.is_time;
this.options.tiler_protocol = options.tiler_protocol || 'http';
this.options.tiler_domain = options.tiler_d... | `coord` object like {x : tilex, y: tiley }
`zoom` quadtree zoom level | windshaft | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function renderPoint(ctx, st) {
ctx.fillStyle = st['marker-fill'];
var pixel_size = st['marker-width'];
// render a circle
// TODO: fill and stroke order should depend on the order of the properties
// in the cartocss.
// fill
ctx.beginPath();
ctx.arc(0, 0, pixel_size, 0, TAU, true, tr... | `coord` object like {x : tilex, y: tiley }
`zoom` quadtree zoom level | renderPoint | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function renderRectangle(ctx, st) {
ctx.fillStyle = st['marker-fill'];
var pixel_size = st['marker-width'];
var w = pixel_size * 2;
// fill
if (st['marker-fill']) {
if (st['marker-fill-opacity'] !== undefined || st['marker-opacity'] !== undefined) {
ctx.globalAlpha = st['marker-fill-o... | `coord` object like {x : tilex, y: tiley }
`zoom` quadtree zoom level | renderRectangle | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function renderSprite(ctx, img, st) {
if(img.complete){
if (st['marker-fill-opacity'] !== undefined || st['marker-opacity'] !== undefined) {
ctx.globalAlpha = st['marker-fill-opacity'] || st['marker-opacity'];
}
ctx.drawImage(img, 0, 0, Math.min(img.width, MAX_SPRITE_RADIUS), Math.min(img... | `coord` object like {x : tilex, y: tiley }
`zoom` quadtree zoom level | renderSprite | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function compop2canvas(compop) {
return COMP_OP_TO_CANVAS[compop] || compop;
} | `coord` object like {x : tilex, y: tiley }
`zoom` quadtree zoom level | compop2canvas | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function PointRenderer(canvas, options) {
if (!canvas) {
throw new Error("canvas can't be undefined");
}
this.options = options;
this._canvas = canvas;
this._ctx = canvas.getContext('2d');
this._sprites = []; // sprites per layer
this._shader = null;
this._icons = {};
this._ico... | `coord` object like {x : tilex, y: tiley }
`zoom` quadtree zoom level | PointRenderer | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function gradientKey(imf){
var hash = ""
for(var i = 0; i < imf.args.length; i++){
var rgb = imf.args[i].rgb;
hash += rgb[0] + ":" + rgb[1] + ":" + rgb[2];
}
return hash;
} | get active points for a step in active zoom
returns a list of bounding boxes [[sw, ne] , [], []] where ne is a {lat: .., lon: ...} obj
empty list if there is no active pixels | gradientKey | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function componentToHex(c) {
var hex = c.toString(16);
return hex.length == 1 ? "0" + hex : hex;
} | get active points for a step in active zoom
returns a list of bounding boxes [[sw, ne] , [], []] where ne is a {lat: .., lon: ...} obj
empty list if there is no active pixels | componentToHex | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function rgbToHex(r, g, b) {
return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b);
} | get active points for a step in active zoom
returns a list of bounding boxes [[sw, ne] , [], []] where ne is a {lat: .., lon: ...} obj
empty list if there is no active pixels | rgbToHex | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function RectanbleRenderer(canvas, options) {
this.options = options;
carto.tree.Reference.set(torque['torque-reference']);
this.setCanvas(canvas);
this.setCartoCSS(this.options.cartocss || DEFAULT_CARTOCSS);
} | get active points for a step in active zoom
returns a list of bounding boxes [[sw, ne] , [], []] where ne is a {lat: .., lon: ...} obj
empty list if there is no active pixels | RectanbleRenderer | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function torque_filters(canvas, options) {
// jshint newcap: false, validthis: true
if (!(this instanceof torque_filters)) { return new torque_filters(canvas, options); }
options = options || {};
this._canvas = canvas = typeof canvas === 'string' ? document.getElementById(canvas) : canvas;
this._... | get active points for a step in active zoom
returns a list of bounding boxes [[sw, ne] , [], []] where ne is a {lat: .., lon: ...} obj
empty list if there is no active pixels | torque_filters | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function jsonp(url, callback, options) {
options = options || {};
options.timeout = options.timeout === undefined ? 10000: options.timeout;
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
// function name
var fnName = options.callbackNam... | get active points for a step in active zoom
returns a list of bounding boxes [[sw, ne] , [], []] where ne is a {lat: .., lon: ...} obj
empty list if there is no active pixels | jsonp | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function clean() {
head.removeChild(script);
clearTimeout(timeoutTimer);
delete window[fnName];
} | get active points for a step in active zoom
returns a list of bounding boxes [[sw, ne] , [], []] where ne is a {lat: .., lon: ...} obj
empty list if there is no active pixels | clean | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function get(url, callback, options) {
options = options || {
method: 'GET',
data: null,
responseType: 'text'
};
lastCall = { url: url, callback: callback };
var request = XMLHttpRequest;
// from d3.js
if (global.XDomainRequest
&& !("withCredentials" in request)
... | get active points for a step in active zoom
returns a list of bounding boxes [[sw, ne] , [], []] where ne is a {lat: .., lon: ...} obj
empty list if there is no active pixels | get | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function respond() {
var status = req.status, result;
var r = options.responseType === 'arraybuffer' ? req.response: req.responseText;
if (!status && r || status >= 200 && status < 300 || status === 304) {
callback(req);
} else {
callback(null);
}
} | get active points for a step in active zoom
returns a list of bounding boxes [[sw, ne] , [], []] where ne is a {lat: .., lon: ...} obj
empty list if there is no active pixels | respond | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function post(url, data, callback) {
return get(url, callback, {
data: data,
method: "POST"
});
} | get active points for a step in active zoom
returns a list of bounding boxes [[sw, ne] , [], []] where ne is a {lat: .., lon: ...} obj
empty list if there is no active pixels | post | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
GMapsTorqueLayerView = function(layerModel, gmapsMap) {
var extra = layerModel.get('extra_params');
cdb.geo.GMapsLayerView.call(this, layerModel, this, gmapsMap);
var query = this._getQuery(layerModel);
torque.GMapsTorqueLayer.call(this, {
table: layerModel.get('table_name'),
user: layerModel.get(... | get active points for a step in active zoom
returns a list of bounding boxes [[sw, ne] , [], []] where ne is a {lat: .., lon: ...} obj
empty list if there is no active pixels | GMapsTorqueLayerView | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.mod.torque.uncompressed.js | BSD-3-Clause |
function parseTemplate(template, tags) {
if (!template)
return [];
var sections = []; // Stack to hold section tokens
var tokens = []; // Buffer to hold the tokens
var spaces = []; // Indices of whitespace tokens on the current line
var hasTag = false; // Is there a {{tag}}... | Breaks up the given `template` string into a tree of tokens. If the `tags`
argument is given here it must be an array with two string values: the
opening and closing tags used in the template (e.g. [ "<%", "%>" ]). Of
course, the default is to use mustaches (i.e. mustache.tags).
A token is an array with at least 4 ele... | parseTemplate | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
function stripSpace() {
if (hasTag && !nonSpace) {
while (spaces.length)
delete tokens[spaces.pop()];
} else {
spaces = [];
}
hasTag = false;
nonSpace = false;
} | Breaks up the given `template` string into a tree of tokens. If the `tags`
argument is given here it must be an array with two string values: the
opening and closing tags used in the template (e.g. [ "<%", "%>" ]). Of
course, the default is to use mustaches (i.e. mustache.tags).
A token is an array with at least 4 ele... | stripSpace | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
function compileTags(tags) {
if (typeof tags === 'string')
tags = tags.split(spaceRe, 2);
if (!isArray(tags) || tags.length !== 2)
throw new Error('Invalid tags: ' + tags);
openingTagRe = new RegExp(escapeRegExp(tags[0]) + '\\s*');
closingTagRe = new RegExp('\\s*' + escapeRegEx... | Breaks up the given `template` string into a tree of tokens. If the `tags`
argument is given here it must be an array with two string values: the
opening and closing tags used in the template (e.g. [ "<%", "%>" ]). Of
course, the default is to use mustaches (i.e. mustache.tags).
A token is an array with at least 4 ele... | compileTags | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
function squashTokens(tokens) {
var squashedTokens = [];
var token, lastToken;
for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {
token = tokens[i];
if (token) {
if (token[0] === 'text' && lastToken && lastToken[0] === 'text') {
lastToken[1] += token[1];
... | Combines the values of consecutive text tokens in the given `tokens` array
to a single token. | squashTokens | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
function nestTokens(tokens) {
var nestedTokens = [];
var collector = nestedTokens;
var sections = [];
var token, section;
for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {
token = tokens[i];
switch (token[0]) {
case '#':
case '^':
collector.push(token... | Forms the given array of `tokens` into a nested tree structure where
tokens that represent a section have two additional items: 1) an array of
all tokens that appear in that section and 2) the index in the original
template that represents the end of that section. | nestTokens | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
function Scanner(string) {
this.string = string;
this.tail = string;
this.pos = 0;
} | A simple string scanner that is used by the template parser to find
tokens in template strings. | Scanner | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
function Context(view, parentContext) {
this.view = view == null ? {} : view;
this.cache = { '.': this.view };
this.parent = parentContext;
} | Represents a rendering context by wrapping a view object and
maintaining a reference to the parent context. | Context | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
function Writer() {
this.cache = {};
} | A Writer knows how to take a stream of tokens and render them to a
string, given a context. It also maintains a cache of templates to
avoid the need to parse the same template twice. | Writer | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
function getPrefixed(name) {
var i, fn,
prefixes = ['webkit', 'moz', 'o', 'ms'];
for (i = 0; i < prefixes.length && !fn; i++) {
fn = window[prefixes[i] + name];
}
return fn;
} | Renders the `template` with the given `view` and `partials` using the
default writer. | getPrefixed | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
function timeoutDefer(fn) {
var time = +new Date(),
timeToCall = Math.max(0, 16 - (time - lastTime));
lastTime = time + timeToCall;
return window.setTimeout(fn, timeToCall);
} | Renders the `template` with the given `view` and `partials` using the
default writer. | timeoutDefer | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
NewClass = function () {
// call the constructor
if (this.initialize) {
this.initialize.apply(this, arguments);
}
// call all constructor hooks
if (this._initHooks) {
this.callInitHooks();
}
} | Renders the `template` with the given `view` and `partials` using the
default writer. | NewClass | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
function createMulti(Klass) {
return L.FeatureGroup.extend({
initialize: function (latlngs, options) {
this._layers = {};
this._options = options;
this.setLatLngs(latlngs);
},
setLatLngs: function (latlngs) {
var i = 0,
len = latlngs.length;
this.eachLayer(function (layer) {
... | Renders the `template` with the given `view` and `partials` using the
default writer. | createMulti | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
function multiToGeoJSON(type) {
return function () {
var coords = [];
this.eachLayer(function (layer) {
coords.push(layer.toGeoJSON().geometry.coordinates);
});
return L.GeoJSON.getFeature(this, {
type: type,
coordinates: coords
});
};
} | Renders the `template` with the given `view` and `partials` using the
default writer. | multiToGeoJSON | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
function onTouchStart(e) {
var count;
if (L.Browser.pointer) {
trackedTouches.push(e.pointerId);
count = trackedTouches.length;
} else {
count = e.touches.length;
}
if (count > 1) {
return;
}
var now = Date.now(),
delta = now - (last || now);
touch = e.touches ? e.touches[... | Renders the `template` with the given `view` and `partials` using the
default writer. | onTouchStart | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
function onTouchEnd(e) {
if (L.Browser.pointer) {
var idx = trackedTouches.indexOf(e.pointerId);
if (idx === -1) {
return;
}
trackedTouches.splice(idx, 1);
}
if (doubleTap) {
if (L.Browser.pointer) {
// work around .type being readonly with MSPointer* events
var newTouch = {... | Renders the `template` with the given `view` and `partials` using the
default writer. | onTouchEnd | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
cb = function (e) {
L.DomEvent.preventDefault(e);
var alreadyInArray = false;
for (var i = 0; i < pointers.length; i++) {
if (pointers[i].pointerId === e.pointerId) {
alreadyInArray = true;
break;
}
}
if (!alreadyInArray) {
pointers.push(e);
}
e.touches = pointers.slice();
... | Renders the `template` with the given `view` and `partials` using the
default writer. | cb | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
internalCb = function (e) {
for (var i = 0; i < pointers.length; i++) {
if (pointers[i].pointerId === e.pointerId) {
pointers.splice(i, 1);
break;
}
}
} | Renders the `template` with the given `view` and `partials` using the
default writer. | internalCb | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
function cb(e) {
// don't fire touch moves when mouse isn't down
if ((e.pointerType === e.MSPOINTER_TYPE_MOUSE || e.pointerType === 'mouse') && e.buttons === 0) { return; }
for (var i = 0; i < touches.length; i++) {
if (touches[i].pointerId === e.pointerId) {
touches[i] = e;
break;
}
}
... | Renders the `template` with the given `view` and `partials` using the
default writer. | cb | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
cb = function (e) {
for (var i = 0; i < touches.length; i++) {
if (touches[i].pointerId === e.pointerId) {
touches.splice(i, 1);
break;
}
}
e.touches = touches.slice();
e.changedTouches = [e];
handler(e);
} | Renders the `template` with the given `view` and `partials` using the
default writer. | cb | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
function createCorner(vSide, hSide) {
var className = l + vSide + ' ' + l + hSide;
corners[vSide + hSide] = L.DomUtil.create('div', className, container);
} | Renders the `template` with the given `view` and `partials` using the
default writer. | createCorner | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
function isDescendant(parent, node) {
while ((node = node.parentNode) !== null) {
if (node === parent) return true
}
return false
} | Renders the `template` with the given `view` and `partials` using the
default writer. | isDescendant | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
function check(event) {
var related = event.relatedTarget
if (!related) return related === null
return (related !== this && related.prefix !== 'xul' && !/document/.test(this.toString()) && !isDescendant(this, related))
} | Renders the `template` with the given `view` and `partials` using the
default writer. | check | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
createPreventDefault = function (event) {
return function () {
if (event[preventDefault])
event[preventDefault]()
else
event.returnValue = false
}
} | Renders the `template` with the given `view` and `partials` using the
default writer. | createPreventDefault | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
createStopPropagation = function (event) {
return function () {
if (event[stopPropagation])
event[stopPropagation]()
else
event.cancelBubble = true
}
} | Renders the `template` with the given `view` and `partials` using the
default writer. | createStopPropagation | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
createStop = function (synEvent) {
return function () {
synEvent[preventDefault]()
synEvent[stopPropagation]()
synEvent.stopped = true
}
} | Renders the `template` with the given `view` and `partials` using the
default writer. | createStop | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
copyProps = function (event, result, props) {
var i, p
for (i = props.length; i--;) {
p = props[i]
if (!(p in result) && p in event) result[p] = event[p]
}
} | Renders the `template` with the given `view` and `partials` using the
default writer. | copyProps | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
targetElement = function (element, isNative) {
return !W3C_MODEL && !isNative && (element === doc || element === win) ? root : element
} | Renders the `template` with the given `view` and `partials` using the
default writer. | targetElement | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
function entry(element, type, handler, original, namespaces) {
this.element = element
this.type = type
this.handler = handler
this.original = original
this.namespaces = namespaces
this.custom = customEvents[type]
this.isNative = nativeEvents[type] &&... | Renders the `template` with the given `view` and `partials` using the
default writer. | entry | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
forAll = function (element, type, original, handler, fn) {
if (!type || type === '*') {
// search the whole registry
for (var t in map) {
if (t.charAt(0) === '$')
forAll(element, t.substr(1), original, handler, fn)
}
... | Renders the `template` with the given `view` and `partials` using the
default writer. | forAll | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
has = function (element, type, original) {
// we're not using forAll here simply because it's a bit slower and this
// needs to be fast
var i, list = map['$' + type]
if (list) {
for (i = list.length; i--;) {
if (list[i].matches(el... | Renders the `template` with the given `view` and `partials` using the
default writer. | has | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
get = function (element, type, original) {
var entries = []
forAll(element, type, original, null, function (entry) { return entries.push(entry) })
return entries
} | Renders the `template` with the given `view` and `partials` using the
default writer. | get | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
put = function (entry) {
(map['$' + entry.type] || (map['$' + entry.type] = [])).push(entry)
return entry
} | Renders the `template` with the given `view` and `partials` using the
default writer. | put | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
del = function (entry) {
forAll(entry.element, entry.type, null, entry.handler, function (entry, list, i) {
list.splice(i, 1)
if (list.length === 0)
delete map['$' + entry.type]
return false
})
} | Renders the `template` with the given `view` and `partials` using the
default writer. | del | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
entries = function () {
var t, entries = []
for (t in map) {
if (t.charAt(0) === '$')
entries = entries.concat(map[t])
}
return entries
} | Renders the `template` with the given `view` and `partials` using the
default writer. | entries | javascript | CartoDB/cartodb | vendor/assets/javascripts/cartodb.uncompressed.js | https://github.com/CartoDB/cartodb/blob/master/vendor/assets/javascripts/cartodb.uncompressed.js | BSD-3-Clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.