_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 27 233k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q8800 | proxy | train | function proxy(scope, map, emitter) {
var args = slice.call(arguments, 3)
, tmp = {}, len, name, methods, method, i
if (isArray(map)) {
len = map.length
while (len--) {
tmp[map[len]] = map[len]
}
map = tmp
}
for (name in map) {
methods = map[name]
| javascript | {
"resource": ""
} |
q8801 | train | function() {
ElementController.call(this, this.observations);
this.observersEnabled = false;
this.listenersEnabled = false;
if (this.expression && this.updated !== Binding.prototype.updated) {
// An observer to observe value changes | javascript | {
"resource": ""
} | |
q8802 | initNodePath | train | function initNodePath(node, view) {
var path = [];
while (node !== view) {
var | javascript | {
"resource": ""
} |
q8803 | BrotliFilter | train | function BrotliFilter(inputNode, options) {
if (!(this instanceof BrotliFilter))
return new BrotliFilter(inputNode, options);
options = options || {};
this.brotliOptions = {
mode: options.mode || 0,
quality: options.quality || 11,
lgwin: options.lgwin || 22,
lgblock... | javascript | {
"resource": ""
} |
q8804 | train | function (o, cb) {
try {
var reader = new FileReader();
reader.onload = function (event) {
cb && cb(reader.result);
| javascript | {
"resource": ""
} | |
q8805 | train | function (param, allowTypes) {
var t$ = Tool;
allowTypes = allowTypes || [];
if (t$.isUndefinedOrNull(param)) { return [] }
if (allowTypes.findIndex(function (value, index, err) {
return value === | javascript | {
"resource": ""
} | |
q8806 | train | function (err) {
var msg = '';
var t$ = Tool;
try {
if (t$.isString(err)) {
msg = err;
} else if (t$.isError(err)) {
msg = err.message;
} else if (t$.isObject(err)) {
var errMsg = [];
for (var p in err) {
if (err.hasOwnProperty(p)) {
er... | javascript | {
"resource": ""
} | |
q8807 | train | function (fileName, fileTypes) {
var _fileNameStr = fileName.substring(fileName.lastIndexOf('.') | javascript | {
"resource": ""
} | |
q8808 | outer | train | function outer(A, B) {
if (A.shape.length === 1) {
A.reshape([A.shape[0], 1]);
}
else if (A.shape.length === 2) {
if (A.shape[1] !== 1) {
throw new Error('A is not a column vector');
}
}
else {
throw new Error('A has invalid dimensions');
}
if (B.s... | javascript | {
"resource": ""
} |
q8809 | cholesky | train | function cholesky(A) {
if (A.shape.length !== 2) {
throw new Error('A is not a matrix');
}
if (A.shape[0] !== A.shape[1]) {
| javascript | {
"resource": ""
} |
q8810 | lstsq | train | function lstsq(A, B, rcond) {
if (rcond === void 0) { rcond = -1; }
var copyA = A.clone();
var copyB = B.clone();
var is_1d = false;
if (copyB.shape.length === 1) {
copyB.reshape([copyB.shape[0], 1]);
is_1d = true;
}
var m;
var n;
m = copyA.shape[0];
n = copyA.sha... | javascript | {
"resource": ""
} |
q8811 | slogdet | train | function slogdet(A) {
if (A.shape.length !== 2) {
throw new Error('Input is not matrix');
}
if (A.shape[0] !== A.shape[1]) {
throw new Error('Input is not square matrix');
}
var m = A.shape[0];
var copyA = A.clone();
copyA.swapOrder();
var ipiv = new common_1.NDArray({ sh... | javascript | {
"resource": ""
} |
q8812 | det | train | function det(A) {
var _a = slogdet(A), sign = _a[0], log = _a[1];
| javascript | {
"resource": ""
} |
q8813 | tril | train | function tril(A, k) {
if (k === void 0) { k = 0; }
if (A.shape.length !== 2) {
throw new Error('Input is not matrix');
}
var copyA = A.clone(); | javascript | {
"resource": ""
} |
q8814 | qr | train | function qr(A) {
if (A.shape.length !== 2) {
throw new Error('Input is not matrix');
}
var _a = A.shape, m = _a[0], n = _a[1];
if (m === 0 || n === 0) {
throw new Error('Empty matrix');
}
var copyA = A.clone();
var minmn = Math.min(m, n);
copyA.swapOrder();
var tau = ... | javascript | {
"resource": ""
} |
q8815 | eig | train | function eig(A) {
if (A.shape.length !== 2) {
throw new Error('Input is not matrix');
}
if (A.shape[0] !== A.shape[1]) {
throw new Error('Input is not square matrix');
}
var n = A.shape[0];
var copyA = A.clone();
copyA.swapOrder();
var _a = lapack.geev(copyA.data, n, true... | javascript | {
"resource": ""
} |
q8816 | processBreakpoint | train | function processBreakpoint(root, breakpointOption) {
if (breakpointOption && breakpointOption !== Object(breakpointOption)) {
throw new Error('Breakpoint must be of type Object.');
}
const processedBreakpoint = Object.assign({}, breakpointOption);
let atRule;
/* search current rules to see if one exists... | javascript | {
"resource": ""
} |
q8817 | processBreakpoints | train | function processBreakpoints(root, breakpointsOption) {
if (breakpointsOption && !Array.isArray(breakpointsOption)) {
throw new Error('Breakpoints option must be of type Array.');
}
const defaultBreakpoints = [
{
prefix: 'xs-',
mediaQuery: '(max-width: 40em)',
},
{
prefix: 'sm-',... | javascript | {
"resource": ""
} |
q8818 | createPrefixedRule | train | function createPrefixedRule(rule, prefix) {
const prefixLength = prefix.length;
const selectorStart = rule.selector.slice(1, prefixLength + 1);
const isAlreadyPrefixed = selectorStart === | javascript | {
"resource": ""
} |
q8819 | responsifyRule | train | function responsifyRule(breakpoints) {
/**
* Closure function that handles each @responsive sub rule
* @param {Object} rule
*/
return (rule) => {
/* insert the base rule right before the @responsive rule */
const root = rule.parent.parent;
const clone = rule.clone();
root.insertBefore(rule.... | javascript | {
"resource": ""
} |
q8820 | loopResponsiveRules | train | function loopResponsiveRules(breakpoints) {
/**
* Closure function that handles each @responsive atRule
* @param {Object} rule
*/
return (rule) => {
const subRules = rule.nodes;
subRules.forEach(responsifyRule(breakpoints));
| javascript | {
"resource": ""
} |
q8821 | processDefinition | train | function processDefinition(definition) {
var fields = [];
var types = {};
var key;
var fieldDefinition;
var type;
for (key in definition) {
if (definition.hasOwnProperty(key)) {
fields.push(key);
fieldDefinition = definition[key];
type = determineTyp... | javascript | {
"resource": ""
} |
q8822 | findProcessWithIndex | train | function findProcessWithIndex( index, callback ) {
var i, process;
try {
forever.list(false, function(context, list) {
i = list ? list.length : 0;
while( --i > -1 ) {
process = list[i];
if( process.hasOwnProperty('file') &&
process.file === index ) {
break;
... | javascript | {
"resource": ""
} |
q8823 | startForeverWithIndex | train | function startForeverWithIndex( index, doneCB ) {
log( 'Attempting to start ' + index + ' as daemon.');
var config;
var appendConfig = function(prop, value) {
log('Adding to config: ' + prop + ', ' + value);
if(value !== undefined) {
config[prop] = value;
}
};
done = doneCB || this.async();... | javascript | {
"resource": ""
} |
q8824 | stopOnProcess | train | function stopOnProcess(index) {
log( 'Attempting to stop ' + index + '...' );
done = this.async();
findProcessWithIndex( index, function(process) {
if( typeof process !== 'undefined' ) {
log( forever.format(true,[process]) );
| javascript | {
"resource": ""
} |
q8825 | restartOnProcess | train | function restartOnProcess( index ) {
log( 'Attempting to restart ' + index + '...' );
// generate delegate function to pass with proper contexts.
var startRequest = (function(context, index) {
return function(cb) {
startForeverWithIndex.call(context, index, cb);
};
}(this, index));
done = th... | javascript | {
"resource": ""
} |
q8826 | train | function(target, source) {
if (!ES.TypeIsObject(target)) {
throw new TypeError('target must be an object');
}
return Array.prototype.reduce.call(arguments, function(target, source) {
| javascript | {
"resource": ""
} | |
q8827 | train | function(C) {
if (!ES.IsCallable(C)) {
throw new TypeError('bad promise constructor');
}
var capability = this;
var resolver = function(resolve, reject) {
capability.resolve = resolve;
capability.reject = reject;
};
capability.promise = ES.Co... | javascript | {
"resource": ""
} | |
q8828 | Set | train | function Set() {
var set = this;
set = emulateES6construct(set);
if (!set._es6set) {
throw new TypeError('bad set');
}
defineProperties(set, {
'[[SetData]]': null,
'_storage': emptyObject()
});
... | javascript | {
"resource": ""
} |
q8829 | ensureMap | train | function ensureMap(set) {
if (!set['[[SetData]]']) {
var m = set['[[SetData]]'] = new collectionShims.Map();
Object.keys(set._storage).forEach(function(k) {
// fast check for leading '$'
if (k.charCodeAt(0) === 36) {
k = k.substri... | javascript | {
"resource": ""
} |
q8830 | details | train | function details(id) {
return new Promise((resolve, reject) => {
if (!id || id === '') throw new Error('id cannot be blank');
const options = {
method: 'GET',
hostname: 'www.exploitalert.com',
port: null,
path: `/view-details.html?id=${id}`,
headers: {},
};
const req = ... | javascript | {
"resource": ""
} |
q8831 | train | function(data_dir) {
var data_files = {}
var format = new RegExp("([0-9a-z\\-_]+)\\.(json|csv)$" , "i");
//see if there's a folder for partial data relating to this page or layout
//if so iterate all json/csv files and load the data
var partial_data_folder = data_dir + "/"+$type +"s/partials/" + $name;
var stat... | javascript | {
"resource": ""
} | |
q8832 | train | function (dt) {
_.each(
systems,
function (system) {
if (_.has(system, 'tickStart')) {
| javascript | {
"resource": ""
} | |
q8833 | train | function (dt) {
_.each(
systems,
function (system) {
if (_.has(system, 'update')) {
_.each(
entities,
function (entity) {
if (!_.isUndefined(ent... | javascript | {
"resource": ""
} | |
q8834 | train | function (dt) {
_.each(
systems,
function (system) {
if (_.has(system, 'tickEnd')) {
| javascript | {
"resource": ""
} | |
q8835 | train | function (entity, just) {
_.each(
systems,
function (system) {
if (_.has(system, 'destroy')) {
_.each(system.destroy, function (func, id) {
if (entity.has(id)){
// Only rem... | javascript | {
"resource": ""
} | |
q8836 | train | function(piece, quote_char) {
// Matches everything that is not a quote or \
var regex = new RegExp("[^" + quote_char + "\\\\]", 'g');
// Remove eveything that is not quote or \
var replaced = piece.replace(regex, '');
// Remove escaped quotes, | javascript | {
"resource": ""
} | |
q8837 | train | function(piece, quote_char, position = 0) {
var i = position - 1; //-1 because we're incrementing it
do {
| javascript | {
"resource": ""
} | |
q8838 | train | function(pieces, quote_char) {
var unclosed_quote = false;
var result = [];
for (var i = 0; i < pieces.length; i++) {
if (unclosed_quote) {
// Two scenarios. Either we have a closing quote or we don't.
if (hasQuote(pieces[i], quote_char)) {
// If it does, then there are two sce... | javascript | {
"resource": ""
} | |
q8839 | runPngquant | train | function runPngquant(args, callback) {
grunt.log.debug('Trying to spawn "' + options.binary + '" with arguments: ');
grunt.log.debug(args.join(' '));
| javascript | {
"resource": ""
} |
q8840 | addOrSubtractDurationFromMoment | train | function addOrSubtractDurationFromMoment(mom, duration, isAdding) {
var ms = duration._milliseconds,
d = duration._days,
M = duration._months,
currentDate;
if (ms) {
mom._d.setTime(+mom + ms * isAdding);
}
if (d) {
mom.date(mom... | javascript | {
"resource": ""
} |
q8841 | train | function (config, loggerContext) {
config = config || {};
Layout.call(this, config, loggerContext);
| javascript | {
"resource": ""
} | |
q8842 | requestHandlerComposer | train | function requestHandlerComposer(componentMap) {
const buildTemplateData = buildTemplateDataComposer(componentMap);
/**
* @async
* @callback {handler}
*
* Handles an incoming request to a Hapi route configured by a Windshield server.
* The request is handled with by using Windshield t... | javascript | {
"resource": ""
} |
q8843 | baseCompareAscending | train | function baseCompareAscending(value, other) {
if (value !== other) {
if (value > other || typeof value == | javascript | {
"resource": ""
} |
q8844 | compareMultipleAscending | train | function compareMultipleAscending(object, other) {
var index = -1,
objCriteria = object.criteria,
othCriteria = other.criteria,
length = objCriteria.length;
while (++index < length) {
var result = baseCompareAscending(objCriteria[index], othCriteria[index]);
if (result) {
| javascript | {
"resource": ""
} |
q8845 | arrayEachRight | train | function arrayEachRight(array, callback) {
var length = array ? array.length : 0;
while (length--) {
| javascript | {
"resource": ""
} |
q8846 | arrayMap | train | function arrayMap(array, callback) {
var index = -1,
length = array ? array.length >>> 0 : 0,
| javascript | {
"resource": ""
} |
q8847 | baseClone | train | function baseClone(value, isDeep, callback, stackA, stackB) {
if (callback) {
var result = callback(value);
if (typeof result != 'undefined') {
return result;
}
}
var isObj = isObject(value);
if (isObj) {
var className = toString.call(value);
if ... | javascript | {
"resource": ""
} |
q8848 | baseEach | train | function baseEach(collection, callback) {
var index = -1,
iterable = collection,
length = collection ? collection.length : 0;
if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) {
while (++index < length) {
if (callback(iterable[index], index, col... | javascript | {
"resource": ""
} |
q8849 | baseEachRight | train | function baseEachRight(collection, callback) {
var iterable = collection,
length = collection ? collection.length : 0;
if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) {
while (length--) {
if (callback(iterable[length], length, collection) === false) {
... | javascript | {
"resource": ""
} |
q8850 | baseFor | train | function baseFor(object, callback, keysFunc) {
var index = -1,
props = keysFunc(object),
length = props.length;
| javascript | {
"resource": ""
} |
q8851 | baseForRight | train | function baseForRight(object, callback, keysFunc) {
var props = keysFunc(object),
length = props.length;
| javascript | {
"resource": ""
} |
q8852 | baseUniq | train | function baseUniq(array, isSorted, callback) {
var length = array ? array.length : 0;
if (!length) {
return [];
}
var index = -1,
indexOf = getIndexOf(),
prereq = !isSorted && indexOf === baseIndexOf,
isLarge = prereq && createCache && length >= 200,
... | javascript | {
"resource": ""
} |
q8853 | createAggregator | train | function createAggregator(setter, initializer) {
return function(collection, callback, thisArg) {
var result = initializer ? initializer() : {};
callback = lodash.createCallback(callback, thisArg, 3);
var index = -1,
length = collection ? collection.length : 0;
if (ty... | javascript | {
"resource": ""
} |
q8854 | createPad | train | function createPad(string, length, chars) {
var strLength = string.length;
length = +length;
if (strLength >= length || !nativeIsFinite(length)) {
return '';
}
var padLength = length - strLength;
| javascript | {
"resource": ""
} |
q8855 | createWrapper | train | function createWrapper(func, bitmask, arity, thisArg, partialArgs, partialRightArgs) {
var isBind = bitmask & BIND_FLAG,
isBindKey = bitmask & BIND_KEY_FLAG,
isPartial = bitmask & PARTIAL_FLAG,
isPartialRight = bitmask & PARTIAL_RIGHT_FLAG;
if (!isBindKey && !isFunction(func))... | javascript | {
"resource": ""
} |
q8856 | shimKeys | train | function shimKeys(object) {
var keyIndex,
index = -1,
props = keysIn(object),
length = props.length,
objLength = length && object.length,
maxIndex = objLength - 1,
result = [];
var allowIndexes = typeof objLength == 'number' && objLength > 0 &&
... | javascript | {
"resource": ""
} |
q8857 | findIndex | train | function findIndex(array, predicate, thisArg) {
var index = -1,
length = array ? array.length : 0;
predicate = lodash.createCallback(predicate, thisArg, 3);
while (++index < length) {
| javascript | {
"resource": ""
} |
q8858 | rest | train | function rest(array, predicate, thisArg) {
if (typeof predicate != 'number' && predicate != null) {
var index = -1,
length = array ? array.length : 0,
n = 0;
predicate = lodash.createCallback(predicate, thisArg, 3);
while (++index < length && predicate(array[index]... | javascript | {
"resource": ""
} |
q8859 | slice | train | function slice(array, start, end) {
var index = -1,
length = array ? array.length : 0;
start = typeof start == 'undefined' ? 0 : (+start || 0);
if (start < 0) {
start = nativeMax(length + start, 0);
} else if (start > length) {
start = length;
}
end = typeo... | javascript | {
"resource": ""
} |
q8860 | size | train | function size(collection) {
var length = collection ? collection.length : 0;
return (typeof length == 'number' && length > -1 && | javascript | {
"resource": ""
} |
q8861 | toArray | train | function toArray(collection) {
var length = collection && collection.length;
if (typeof length == 'number' && length > -1 && length <= maxSafeInteger) {
| javascript | {
"resource": ""
} |
q8862 | delay | train | function delay(func, wait) {
if (!isFunction(func)) {
throw new TypeError(funcErrorText);
}
var args = slice(arguments, 2); | javascript | {
"resource": ""
} |
q8863 | once | train | function once(func) {
var ran,
result;
if (!isFunction(func)) {
throw new TypeError(funcErrorText);
}
return function() {
if (ran) {
return result;
}
| javascript | {
"resource": ""
} |
q8864 | findKey | train | function findKey(object, predicate, thisArg) {
predicate = lodash.createCallback(predicate, thisArg, 3);
return | javascript | {
"resource": ""
} |
q8865 | isArguments | train | function isArguments(value) {
return (value && typeof value == 'object' && typeof value.length == 'number' &&
| javascript | {
"resource": ""
} |
q8866 | isEmpty | train | function isEmpty(value) {
var result = true;
if (!value) {
return result;
}
var length = value.length;
if ((length > -1 && length <= maxSafeInteger) &&
| javascript | {
"resource": ""
} |
q8867 | endsWith | train | function endsWith(string, target, position) {
string = string == null ? '' : String(string);
target = String(target);
var length = string.length;
position = (typeof position == 'undefined' ? length : nativeMin(position < 0 | javascript | {
"resource": ""
} |
q8868 | pad | train | function pad(string, length, chars) {
string = string == null ? '' : String(string);
length = +length;
var strLength = string.length;
if (strLength >= length || !nativeIsFinite(length)) {
return string;
}
var mid = (length - strLength) / 2,
| javascript | {
"resource": ""
} |
q8869 | padLeft | train | function padLeft(string, length, chars) {
string = string == null ? '' : String(string);
| javascript | {
"resource": ""
} |
q8870 | padRight | train | function padRight(string, length, chars) {
string = string == null ? '' : String(string);
| javascript | {
"resource": ""
} |
q8871 | template | train | function template(string, data, options) {
// based on John Resig's `tmpl` implementation
// http://ejohn.org/blog/javascript-micro-templating/
// and Laura Doktorova's doT.js
// https://github.com/olado/doT
var settings = lodash.templateSettings;
options = defaults({}, options, sett... | javascript | {
"resource": ""
} |
q8872 | truncate | train | function truncate(string, options) {
var length = 30,
omission = '...';
if (options && isObject(options)) {
var separator = 'separator' in options ? options.separator : separator;
length = 'length' in options ? +options.length || 0 : length;
omission = 'omission' in option... | javascript | {
"resource": ""
} |
q8873 | createCallback | train | function createCallback(func, thisArg, argCount) {
var type = typeof func;
if (type == 'function' || func == null) {
return (typeof thisArg == 'undefined' || !('prototype' | javascript | {
"resource": ""
} |
q8874 | matches | train | function matches(source) {
var props = keys(source),
propsLength = props.length,
key = props[0],
value = propsLength && source[key];
// fast path the common case of providing an object with a single
// property containing a primitive value
if (propsLength == 1 && v... | javascript | {
"resource": ""
} |
q8875 | train | function(line) {
return {
'id': Number(line[0]),
'geoname_id': Number(line[1]),
'isolanguage': String(line[2]),
'alternate_name': String(line[3]),
'is_preferred': Boolean(line[4]),
| javascript | {
"resource": ""
} | |
q8876 | train | function(line) {
return {
'name': String(line[1]),
'country_code': String(line[0]), | javascript | {
"resource": ""
} | |
q8877 | train | function(line) {
return {
'iso': String(line[0]),
'iso3': String(line[1]),
'iso_numeric': Number(line[2]),
'fips': String(line[3]),
'name': String(line[4]),
'capital': String(line[5]),
'area': Number(line[6]),
'population': Number(line[7]),
'continent': String(line[8]),
'tld': String(lin... | javascript | {
"resource": ""
} | |
q8878 | train | function(name) {
var cookie = document.cookie, e, p = name + "=", b;
if ( !cookie )
return;
b = cookie.indexOf("; " + p);
if ( b == -1 ) {
b = cookie.indexOf(p);
if ( b != 0 )
return null;
} else {
b += 2;
| javascript | {
"resource": ""
} | |
q8879 | determineType | train | function determineType(obj) {
var type;
var typeValue;
var name;
if (value(obj).typeOf(Object)) {
type = obj.type || "Object";
} else {
type = obj;
}
typeValue = value(type);
if (typeValue.typeOf(String)) {
name = type.charAt(0).toUpperCase() + type.substring(1... | javascript | {
"resource": ""
} |
q8880 | buildSlotSegLevels | train | function buildSlotSegLevels(segs) {
var levels = [];
var i, seg;
var j;
for (i=0; i<segs.length; i++) {
seg = segs[i];
// go through all the levels and stop on the first level where there are no collisions
for (j=0; j<levels.length; j++) {
| javascript | {
"resource": ""
} |
q8881 | computeForwardSlotSegs | train | function computeForwardSlotSegs(levels) {
var i, level;
var j, seg;
var k;
for (i=0; i<levels.length; i++) {
level = levels[i];
for (j=0; j<level.length; j++) {
seg = level[j];
| javascript | {
"resource": ""
} |
q8882 | flattenSlotSegLevels | train | function flattenSlotSegLevels(levels) {
var segs = [];
var i, level;
var j;
for (i=0; i<levels.length; i++) {
level = levels[i];
| javascript | {
"resource": ""
} |
q8883 | computeSlotSegCollisions | train | function computeSlotSegCollisions(seg, otherSegs, results) {
results = results || [];
for (var | javascript | {
"resource": ""
} |
q8884 | isSlotSegCollision | train | function isSlotSegCollision(seg1, seg2) {
return seg1.end | javascript | {
"resource": ""
} |
q8885 | compareForwardSlotSegs | train | function compareForwardSlotSegs(seg1, seg2) {
// put higher-pressure first
return seg2.forwardPressure - seg1.forwardPressure ||
// put segments | javascript | {
"resource": ""
} |
q8886 | eventElementHandlers | train | function eventElementHandlers(event, eventElement) {
eventElement
.click(function(ev) {
if (!eventElement.hasClass('ui-draggable-dragging') &&
!eventElement.hasClass('ui-resizable-resizing')) {
return trigger('eventClick', this, event, ev);
}
})
.hover(
function(ev) {
trigger('ev... | javascript | {
"resource": ""
} |
q8887 | cellOffsetToDayOffset | train | function cellOffsetToDayOffset(cellOffset) {
var day0 = t.visStart.getDay(); // first date's day of week
cellOffset += dayToCellMap[day0]; // normlize cellOffset to beginning-of-week
return Math.floor(cellOffset / cellsPerWeek) * 7 // # of days from full weeks
+ cellToDayMap[ // # | javascript | {
"resource": ""
} |
q8888 | dayOffsetToCellOffset | train | function dayOffsetToCellOffset(dayOffset) {
var day0 = t.visStart.getDay(); // first date's day of week
dayOffset += day0; // normalize dayOffset to beginning-of-week
return Math.floor(dayOffset / 7) * cellsPerWeek // # of cells from full weeks
+ dayToCellMap[ // # | javascript | {
"resource": ""
} |
q8889 | renderTempDayEvent | train | function renderTempDayEvent(event, adjustRow, adjustTop) {
// actually render the event. `true` for appending element to container.
// Recieve the intermediate "segment" data structures.
var segments = _renderDayEvents(
[ event ],
true, // append event elements
false // don't set the heights of the rows... | javascript | {
"resource": ""
} |
q8890 | _renderDayEvents | train | function _renderDayEvents(events, doAppend, doRowHeights) {
// where the DOM nodes will eventually end up
var finalContainer = getDaySegmentContainer();
// the container where the initial HTML will be rendered.
// If `doAppend`==true, uses a temporary container.
var renderContainer = doAppend ? $("<div/>") ... | javascript | {
"resource": ""
} |
q8891 | buildSegments | train | function buildSegments(events) {
var segments = [];
for (var i=0; i<events.length; i++) {
var eventSegments = buildSegmentsForEvent(events[i]);
| javascript | {
"resource": ""
} |
q8892 | buildSegmentsForEvent | train | function buildSegmentsForEvent(event) {
var startDate = event.start;
var endDate = exclEndDay(event);
var segments = rangeToSegments(startDate, endDate);
| javascript | {
"resource": ""
} |
q8893 | calculateHorizontals | train | function calculateHorizontals(segments) {
var isRTL = opt('isRTL');
for (var i=0; i<segments.length; i++) {
var segment = segments[i];
// Determine functions used for calulating the elements left/right coordinates,
// depending on whether the view is RTL or not.
// NOTE:
// colLeft/colRight returns ... | javascript | {
"resource": ""
} |
q8894 | buildHTML | train | function buildHTML(segments) {
var html = '';
for (var i=0; | javascript | {
"resource": ""
} |
q8895 | setVerticals | train | function setVerticals(segments, doRowHeights) {
var rowContentHeights = calculateVerticals(segments); // also sets segment.top
var rowContentElements = getRowContentElements(); // returns 1 inner div per row
var rowContentTops = [];
// Set each row's height by setting height of first inner div
if (doRowHeigh... | javascript | {
"resource": ""
} |
q8896 | buildSegmentRows | train | function buildSegmentRows(segments) {
var rowCnt = getRowCnt();
var segmentRows = [];
var segmentI;
var segment;
var rowI;
// group segments by row
for (segmentI=0; segmentI<segments.length; segmentI++) {
segment = segments[segmentI];
rowI = segment.row;
if (segment.element) { // was rendered?
... | javascript | {
"resource": ""
} |
q8897 | sortSegmentRow | train | function sortSegmentRow(segments) {
var sortedSegments = [];
// build the subrow array
var subrows = buildSegmentSubrows(segments);
| javascript | {
"resource": ""
} |
q8898 | buildSegmentSubrows | train | function buildSegmentSubrows(segments) {
// Give preference to elements with certain criteria, so they have
// a chance to be closer to the top.
segments.sort(compareDaySegments);
var subrows = [];
for (var i=0; i<segments.length; i++) {
var segment = segments[i];
// loop through subrows, starting wi... | javascript | {
"resource": ""
} |
q8899 | getRowContentElements | train | function getRowContentElements() {
var i;
var rowCnt = getRowCnt();
var rowDivs = | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.