_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 52 373k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q24900 | delegate | train | function delegate(selector, events, method) {
$(document.body).delegate(selector,
(events.split ? events : events.join('.'+NAMESPACE + ' ')) + '.'+NAMESPACE,
function() {
var api = QTIP.api[ $.attr(this, ATTR_ID) ];
api && !api.disabled && method.apply(api, arguments);
}
);
} | javascript | {
"resource": ""
} |
q24901 | hoverIntent | train | function hoverIntent(hoverEvent) {
// Only continue if tooltip isn't disabled
if(this.disabled || this.destroyed) { return FALSE; }
// Cache the event data
this.cache.event = hoverEvent && $.event.fix(hoverEvent);
this.cache.target = hoverEvent && $(hoverEvent.target);
// Start the event sequence
clearT... | javascript | {
"resource": ""
} |
q24902 | stealFocus | train | function stealFocus(event) {
if(!elem.is(':visible')) { return; }
var target = $(event.target),
tooltip = current.tooltip,
container = target.closest(SELECTOR),
targetOnTop;
// Determine if input container target is above this
targetOnTop = container.length < 1 ? FALSE :
parseInt(container[0].styl... | javascript | {
"resource": ""
} |
q24903 | calculate | train | function calculate(side, otherSide, type, adjustment, side1, side2, lengthName, targetLength, elemLength) {
var initialPos = position[side1],
mySide = my[side],
atSide = at[side],
isShift = type === SHIFT,
myLength = mySide === side1 ? elemLength : mySide === side2 ? -elemLength : -elemLength / 2,
atLe... | javascript | {
"resource": ""
} |
q24904 | zeroBuffer | train | function zeroBuffer(buf) {
for (var i = 0; i < buf.length; i++) {
buf[i] = 0;
}
return buf;
} | javascript | {
"resource": ""
} |
q24905 | ErrorAbstract | train | function ErrorAbstract(msg, constructor) {
this.message = msg;
Error.call(this, this.message);
/* istanbul ignore else */
if (canCapture) {
Error.captureStackTrace(this, constructor);
} else if (canStack) {
this.stack = new Error().stack;
} else {
this.stack = '';
}
} | javascript | {
"resource": ""
} |
q24906 | formatResolutionText | train | function formatResolutionText(resolution, maxResolutionSize) {
const pp = precisionPrefix(maxResolutionSize, resolution);
const f = formatPrefix(`.${pp}`, resolution);
const formattedResolution = f(resolution);
return formattedResolution;
} | javascript | {
"resource": ""
} |
q24907 | getResolutionBasedResolutionText | train | function getResolutionBasedResolutionText(resolutions, zoomLevel) {
const sortedResolutions = resolutions.map(x => +x).sort((a, b) => b - a);
const resolution = sortedResolutions[zoomLevel];
const maxResolutionSize = sortedResolutions[sortedResolutions.length - 1];
return formatResolutionText(resolution, maxRe... | javascript | {
"resource": ""
} |
q24908 | getWidthBasedResolutionText | train | function getWidthBasedResolutionText(
zoomLevel, maxWidth, binsPerDimension, maxZoom
) {
const resolution = maxWidth / ((2 ** zoomLevel) * binsPerDimension);
// we can't display a NaN resolution
if (!Number.isNaN(resolution)) {
// what is the maximum possible resolution?
// this will determine how we f... | javascript | {
"resource": ""
} |
q24909 | json | train | async function json(url, callback, pubSub) {
// Fritz: What is going on here? Can someone explain?
if (url.indexOf('hg19') >= 0) {
await sleep(1);
}
// console.log('url:', url);
return fetchEither(url, callback, 'json', pubSub);
} | javascript | {
"resource": ""
} |
q24910 | train | function (params) {
var url = params.url,
method = params.method,
helperParams = params.helperParams,
queryParams = params.queryParams,
bodyParams = params.bodyParams,
signatureParams,
message,
accessor = {},
allPara... | javascript | {
"resource": ""
} | |
q24911 | train | function (headers, headerKey, defaultValue) {
var headerName = _.findKey(headers, function (value, key) {
return key.toLowerCase() === headerKey.toLowerCase();
});
if (!headerName) {
headers[headerKey] = defaultValue;
}
} | javascript | {
"resource": ""
} | |
q24912 | train | function (request, protocolProfileBehavior) {
if (!(request && request.body)) {
return;
}
var requestBody = request.body,
requestBodyType = requestBody.mode,
requestMethod = (typeof request.method === 'string') ? request.method.toLowerCase() : undefined,
... | javascript | {
"resource": ""
} | |
q24913 | train | function (buffer) {
var str = '',
uArrayVal = new Uint8Array(buffer),
i,
ii;
for (i = 0, ii = uArrayVal.length; i < ii; i++) {
str += String.fromCharCode(uArrayVal[i]);
}
return str;
} | javascript | {
"resource": ""
} | |
q24914 | train | function (arr) {
if (!_.isArray(arr)) {
return;
}
var obj = {},
key,
val,
i,
ii;
for (i = 0, ii = arr.length; i < ii; i += 2) {
key = arr[i];
val = arr[i + 1];
if (_.has(obj, key)) {
... | javascript | {
"resource": ""
} | |
q24915 | train | function (Handler, name) {
if (!_.isFunction(Handler.init)) {
throw new Error('The handler for "' + name + '" does not have an "init" function, which is necessary');
}
if (!_.isFunction(Handler.pre)) {
throw new Error('The handler for "' + name + '" does not have a "pre"... | javascript | {
"resource": ""
} | |
q24916 | train | function (context, run, done) {
// if no response is provided, there's nothing to do, and probably means that the request errored out
// let the actual request command handle whatever needs to be done.
if (!context.response) { return done(); }
// bail out if there is no auth
if ... | javascript | {
"resource": ""
} | |
q24917 | train | function (auth, done) {
!auth.get('nonce') && auth.set('nonce', randomString(6));
!_.parseInt(auth.get('timestamp')) && auth.set('timestamp', Math.floor(Date.now() / 1e3));
done(null, true);
} | javascript | {
"resource": ""
} | |
q24918 | train | function (params) {
return Hawk.header(url.parse(params.url), params.method, params);
} | javascript | {
"resource": ""
} | |
q24919 | train | function (context, item, desiredPayload, success, failure) {
// max retries exceeded
if (this.count >= MAX_REPLAY_COUNT) {
return failure(new Error('runtime: maximum intermediate request limit exceeded'));
}
// update replay count state
this.count++;
// upda... | javascript | {
"resource": ""
} | |
q24920 | train | function () {
try {
authHandler.sign(authInterface, context.item.request, function (err) {
// handle all types of errors in one place, see catch block
if (err) { throw err; }
done();
});
... | javascript | {
"resource": ""
} | |
q24921 | train | function (cb) {
if (_.isFunction(_.get(proxies, 'resolve'))) {
return cb(null, proxies.resolve(url));
}
return cb(null, undefined);
} | javascript | {
"resource": ""
} | |
q24922 | train | function (config, cb) {
if (config) {
return cb(null, config);
}
return _.isFunction(run.options.systemProxy) ? run.options.systemProxy(url, cb) : cb(null, undefined);
} | javascript | {
"resource": ""
} | |
q24923 | train | function (context, run, done) {
var request,
pfxPath,
keyPath,
certPath,
fileResolver,
certificate;
// A. Check if we have the file resolver
fileResolver = run.options.fileResolver;
if (!fileResolver) { return done(); } // No... | javascript | {
"resource": ""
} | |
q24924 | train | function (cb, expect) {
if (_.isFunction(cb) && cb.__normalised) {
return meetExpectations(cb, expect);
}
var userback, // this var will be populated and returned
// keep a reference of all initial callbacks sent by user
callback = (_.isFunction(cb) && cb) ||... | javascript | {
"resource": ""
} | |
q24925 | train | function (flags, callback, args, ms) {
var status = {},
sealed;
// ensure that the callback times out after a while
callback = backpack.timeback(callback, ms, null, function () {
sealed = true;
});
return function (err, flag, value) {
if (sea... | javascript | {
"resource": ""
} | |
q24926 | train | function (callback, ms, scope, when) {
ms = Number(ms);
// if np callback time is specified, just return the callback function and exit. this is because we do need to
// track timeout in 0ms
if (!ms) {
return callback;
}
var sealed = false,
irq =... | javascript | {
"resource": ""
} | |
q24927 | train | function (options) {
// combine runner config and make a copy
var runOptions = _.merge(_.omit(options, ['environment', 'globals', 'data']), this.options.run) || {};
// start timeout sanitization
!runOptions.timeout && (runOptions.timeout = {});
_.mergeWith(runOptions.timeout, d... | javascript | {
"resource": ""
} | |
q24928 | train | function (collection, options, callback) {
var self = this,
runOptions = this.prepareRunConfig(options);
callback = backpack.normalise(callback);
!_.isObject(options) && (options = {});
// @todo make the extract runnables interface better defined and documented
// -... | javascript | {
"resource": ""
} | |
q24929 | train | function (callback) {
callback = backpack.ensure(callback, this);
if (this.paused) { return callback && callback(new Error('run: already paused')); }
// schedule the pause command as an interrupt and flag that the run is pausing
this.paused = true;
this.inte... | javascript | {
"resource": ""
} | |
q24930 | train | function (callback) {
callback = backpack.ensure(callback, this);
if (!this.paused) { return callback && callback(new Error('run: not paused')); }
// set flag that it is no longer paused and fire the stored callback for the command when it was paused
this.paused = false... | javascript | {
"resource": ""
} | |
q24931 | train | function (summarise, callback) {
if (_.isFunction(summarise) && !callback) {
callback = summarise;
summarise = true;
}
this.interrupt('abort', {
summarise: summarise
}, callback);
_.isFunction(this.__resume) &&... | javascript | {
"resource": ""
} | |
q24932 | train | function (callback, scope) {
var coords = _.isFunction(callback) && this.current();
this.position = 0;
this.iteration = 0;
// send before and after values to the callback
return coords && callback.call(scope || this, null, this.current(), coords);
} | javascript | {
"resource": ""
} | |
q24933 | train | function (position, iteration, callback, scope) {
var coords = _.isFunction(callback) && this.current();
// if null or undefined implies use existing seek position
_.isNil(position) && (position = this.position);
_.isNil(iteration) && (iteration = this.iteration);
// make the p... | javascript | {
"resource": ""
} | |
q24934 | train | function (callback, scope) {
var position = this.position,
iteration = this.iteration,
coords;
// increment position
position += 1;
// check if we need to increment cycle
if (position >= this.length) {
// set position to 0 and increment iter... | javascript | {
"resource": ""
} | |
q24935 | train | function (coords) {
return _.isObject(coords) && !((this.position === coords.position) && (this.iteration === coords.iteration));
} | javascript | {
"resource": ""
} | |
q24936 | train | function () {
return {
position: this.position,
iteration: this.iteration,
length: this.length,
cycles: this.cycles,
empty: this.empty(),
eof: this.eof(),
bof: this.bof(),
cr: this.cr(),
ref: this.ref
... | javascript | {
"resource": ""
} | |
q24937 | train | function (name, payload, args) {
var processor = processors[name];
if (!_.isString(name) || !_.isFunction(processor)) {
throw new Error('run-instruction: invalid construction');
}
// ensure that payload is an object so that data storage can be done. also ensure arguments is... | javascript | {
"resource": ""
} | |
q24938 | is_crossDomain | train | function is_crossDomain(url) {
var rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/
// jQuery #8138, IE may throw an exception when accessing
// a field from window.location if document.domain has been set
var ajaxLocation
try { ajaxLocation = location.href }
catch (e) {
// Use t... | javascript | {
"resource": ""
} |
q24939 | _getDigestAuthHeader | train | function _getDigestAuthHeader (headers) {
return headers.find(function (property) {
return (property.key.toLowerCase() === WWW_AUTHENTICATE) && (_.startsWith(property.value, DIGEST_PREFIX));
});
} | javascript | {
"resource": ""
} |
q24940 | train | function (auth, response, done) {
if (auth.get(DISABLE_RETRY_REQUEST) || !response) {
return done(null, true);
}
var code,
realm,
nonce,
qop,
opaque,
authHeader,
authParams = {};
code = response.code;
... | javascript | {
"resource": ""
} | |
q24941 | train | function (params) {
var algorithm = params.algorithm,
username = params.username,
realm = params.realm,
password = params.password,
method = params.method,
nonce = params.nonce,
nonceCount = params.nonceCount,
clientNonce = para... | javascript | {
"resource": ""
} | |
q24942 | train | function (fn, ctx) {
// extract the arguments that are to be forwarded to the function to be called
var args = Array.prototype.slice.call(arguments, 2);
try {
(typeof fn === FUNCTION) && fn.apply(ctx || global, args);
}
catch (err) {
return err;
}... | javascript | {
"resource": ""
} | |
q24943 | train | function (dest, src) {
var prop;
// update or add values from src
for (prop in src) {
if (src.hasOwnProperty(prop)) {
dest[prop] = src[prop];
}
}
// remove values that no longer exist
for (prop in dest) {
if (dest.hasO... | javascript | {
"resource": ""
} | |
q24944 | train | function (resolver, fileSrc, callback) {
// bail out if resolver not found.
if (!resolver) {
return callback(new Error('file resolver not supported'));
}
// bail out if resolver is not supported.
if (typeof resolver.stat !== FUNCTION || typeof resolver.createReadStre... | javascript | {
"resource": ""
} | |
q24945 | escapeForIOSAndAndroid | train | function escapeForIOSAndAndroid(args) {
if (Platform.OS === 'android' || Platform.OS === 'ios') {
return map(args, escapeBlob)
} else {
return args
}
} | javascript | {
"resource": ""
} |
q24946 | SessionManagerFactory | train | function SessionManagerFactory(options) {
log.debug('[chimp][session-manager-factory] options are', options);
if (!options) {
throw new Error('options is required');
}
if (!options.port) {
throw new Error('options.port is required');
}
if (!options.browser && !options.deviceName) {
throw n... | javascript | {
"resource": ""
} |
q24947 | Jenkins | train | function Jenkins(opts) {
if (!(this instanceof Jenkins)) {
return new Jenkins(opts);
}
if (typeof opts === 'string') {
opts = { baseUrl: opts };
} else {
opts = opts || {};
}
opts = Object.assign({}, opts);
if (!opts.baseUrl) {
if (opts.url) {
opts.baseUrl = opts.url;
delete... | javascript | {
"resource": ""
} |
q24948 | ignoreErrorForStatusCodes | train | function ignoreErrorForStatusCodes() {
var statusCodes = Array.prototype.slice.call(arguments);
return function(ctx, next) {
if (ctx.err && ctx.res && statusCodes.indexOf(ctx.res.statusCode) !== -1) {
delete ctx.err;
}
next();
};
} | javascript | {
"resource": ""
} |
q24949 | require302 | train | function require302(message) {
return function(ctx, next) {
if (ctx.res && ctx.res.statusCode === 302) {
return next(false);
} else if (ctx.res) {
if (ctx.err) {
if (!ctx.res.headers['x-error']) ctx.err.message = message;
} else {
ctx.err = new Error(message);
}
... | javascript | {
"resource": ""
} |
q24950 | parseName | train | function parseName(value) {
var jobParts = [];
var pathParts = (urlParse(value).pathname || '').split('/').filter(Boolean);
var state = 0;
var part;
// iterate until we find our first job, then collect the continuous job parts
// ['foo', 'job', 'a', 'job', 'b', 'bar', 'job', 'c'] => ['a', 'b']
loop:
... | javascript | {
"resource": ""
} |
q24951 | FolderPath | train | function FolderPath(value) {
if (!(this instanceof FolderPath)) {
return new FolderPath(value);
}
if (Array.isArray(value)) {
this.value = value;
} else if (typeof value === 'string') {
if (value.match('^https?:\/\/')) {
this.value = parseName(value);
} else {
this.value = value.spli... | javascript | {
"resource": ""
} |
q24952 | crumbIssuer | train | function crumbIssuer(jenkins, callback) {
jenkins.crumbIssuer.get(function(err, data) {
if (err) return callback(err);
if (!data || !data.crumbRequestField || !data.crumb) {
return callback(new Error('Failed to get crumb'));
}
callback(null, {
headerName: data.crumbRequestField,
hea... | javascript | {
"resource": ""
} |
q24953 | isFileLike | train | function isFileLike(v) {
return Buffer.isBuffer(v) ||
typeof v === 'object' &&
typeof v.pipe === 'function' &&
v.readable !== false;
} | javascript | {
"resource": ""
} |
q24954 | LogStream | train | function LogStream(jenkins, opts) {
var self = this;
events.EventEmitter.call(self);
self._jenkins = jenkins;
opts = opts || {};
self._delay = opts.delay || 1000;
delete opts.delay;
self._opts = {};
for (var key in opts) {
if (opts.hasOwnProperty(key)) {
self._opts[key] = opts[key];
}... | javascript | {
"resource": ""
} |
q24955 | setRaspberryVersion | train | function setRaspberryVersion() {
if (currentPins) {
return Promise.resolve();
}
return new Promise(function(resolve, reject) {
fs.readFile('/proc/cpuinfo', 'utf8', function(err, data) {
if (err) {
return reject(err);
}
... | javascript | {
"resource": ""
} |
q24956 | listen | train | function listen(channel, onChange) {
var pin = getPinForCurrentMode(channel);
if (!exportedInputPins[pin] && !exportedOutputPins[pin]) {
throw new Error('Channel %d has not been exported', channel);
}
debug('listen for pin %d', pin);
var poller = new Epoll(function(... | javascript | {
"resource": ""
} |
q24957 | encode | train | function encode (n) {
var o = ''
var i = 0
var i1, i2, i3, e1, e2, e3, e4
n = utf8Encode(n)
while (i < n.length) {
i1 = n.charCodeAt(i++)
i2 = n.charCodeAt(i++)
i3 = n.charCodeAt(i++)
e1 = (i1 >> 2)
e2 = (((i1 & 3) << 4) | (i2 >> 4))
e3 = (isNaN(i2) ? 64 : ((i2 & 15) << 2) | (i3 >> 6))... | javascript | {
"resource": ""
} |
q24958 | validateRecord | train | function validateRecord (table, record) {
invariant(
_.isString(table),
'Must provide a table'
)
invariant(
/^[a-z0-9_]{3,255}$/.test(table),
'Table must be between 3 and 255 characters and must ' +
'consist only of lower case letters, numbers, and _'
)
invariant(
_.isObject(record),... | javascript | {
"resource": ""
} |
q24959 | train | function (header) {
/**
* This property is the mimetype for the file
*
* @property mime
* @type {String}
*/
this.mime = null;
/**
* This is the file size in bytes
*
* @type {Number}
*/
this.size = null;
/**
* This is a Date object which represents the last time this file was mo... | javascript | {
"resource": ""
} | |
q24960 | train | function (header) {
this.httpHeader = parseHTTPHeader(header);
if (this.httpHeader[ 'content-length' ]) this.size = this.httpHeader[ 'content-length' ];
if (this.httpHeader[ 'content-type' ]) this.mime = this.httpHeader[ 'content-type' ];
if (this.httpHeader[ 'last-modified' ]) this.lastModified = ne... | javascript | {
"resource": ""
} | |
q24961 | train | function (url) {
this.url = url;
if (this.canLoadUsingXHR()) {
this.xhr = new XMLHttpRequest();
this.xhr.open('GET', url, true);
this.xhr.onreadystatechange = this._onStateChange;
this.xhr.onprogress !== undefined && (this.xhr.onprogress = this._onProgress);
if (this.loadType !=... | javascript | {
"resource": ""
} | |
q24962 | train | function (ev) {
var loaded = ev.loaded || ev.position;
var totalSize = ev.total || ev.totalSize;
if (totalSize) {
this._dispatchProgress(loaded / totalSize);
} else {
this._dispatchProgress(0);
}
} | javascript | {
"resource": ""
} | |
q24963 | train | function () {
if (this.xhr.readyState > 1) {
var status;
var waiting = false;
// Fix error in IE8 where status isn't available until readyState=4
try { status = this.xhr.status; } catch (e) { waiting = true; }
if (status === 200) {
switch (this.xhr.readyState) {
// ... | javascript | {
"resource": ""
} | |
q24964 | train | function () {
if (this.loadTypeSet || this.loadType === LoaderBase.typeText) {
this.content = this.xhr.response || this.xhr.responseText;
} else {
switch (this.loadType) {
case LoaderBase.typeArraybuffer:
if (ArrayBuffer) {
this.content = stringToArrayBuffer(this.xhr.... | javascript | {
"resource": ""
} | |
q24965 | freezeAll | train | function freezeAll(exceptions) {
_freezeAllEvents = true;
if (!exceptions) {
return;
}
if (!utils.isArray(exceptions)) {
exceptions = [exceptions];
}
utils.forEach(exceptions, e => {
_freezeAllExceptions[e] = true;
});
} | javascript | {
"resource": ""
} |
q24966 | unfreezeAll | train | function unfreezeAll() {
_freezeAllEvents = false;
_freezeAllExceptions = {};
//unfreeze all instances
const keys = Object.keys(_frozenEventInstances);
for (let i = 0; i < keys.length; i++) {
const instance = _frozenEventInstances[keys[i]];
if (!instance) {
continue;
}
instance.unfreeze(... | javascript | {
"resource": ""
} |
q24967 | _mapOne | train | function _mapOne(name) {
const parts = name.split(".");
let current = _this.parent.model;
let current_name = "";
while (parts.length) {
current_name = parts.shift();
current = current[current_name];
}
return {
name,
model: current,
type: curren... | javascript | {
"resource": ""
} |
q24968 | templateFunc | train | function templateFunc(str, data) {
const func = function(obj) {
return str.replace(/<%=([^%]*)%>/g, match => {
//match t("...")
let s = match.match(/t\s*\(([^)]+)\)/g);
//replace with translation
if (s.length) {
s = obj.t(s[0].match(/"([^"]+)"/g)[0].split('"').join(""));
}
... | javascript | {
"resource": ""
} |
q24969 | initSubmodel | train | function initSubmodel(attr, val, ctx, persistent) {
let submodel;
// if value is a value -> leaf
if (!utils.isPlainObject(val) || utils.isArray(val) || ctx.isObjectLeaf(attr)) {
const binds = {
//the submodel has changed (multiple times)
"change": onChange
};
submodel = new ModelLeaf(at... | javascript | {
"resource": ""
} |
q24970 | onChange | train | function onChange(evt, path) {
if (!ctx._ready) return; //block change propagation if model isnt ready
path = ctx._name + "." + path;
ctx.trigger(evt, path);
} | javascript | {
"resource": ""
} |
q24971 | getIntervals | train | function getIntervals(ctx) {
return ctx._intervals || (ctx._parent ? getIntervals(ctx._parent) : new Intervals());
} | javascript | {
"resource": ""
} |
q24972 | train | function(val) {
if (val === undefined) {
return "undefined";
}
if (val === null) {
return "null";
}
let type = typeof val;
if (type === "object") {
type = getClass(val).toLowerCase();
}
if (type === "number") {
return val.toString().indexOf(".") > 0 ?
... | javascript | {
"resource": ""
} | |
q24973 | train | function(a, b) {
if (a !== b) {
const atype = whatis(a);
const btype = whatis(b);
if (atype === btype) {
return _equal.hasOwnProperty(atype) ? _equal[atype](a, b) : a == b;
}
return false;
}
return true;
} | javascript | {
"resource": ""
} | |
q24974 | deepCloneArray | train | function deepCloneArray(arr) {
const clone = [];
forEach(arr, (item, index) => {
if (typeof item === "object" && item !== null) {
if (isArray(item)) {
clone[index] = deepCloneArray(item);
} else if (isSpecificValue(item)) {
clone[index] = cloneSpecificValue(item);
} else {
... | javascript | {
"resource": ""
} |
q24975 | finish | train | function finish(err) {
if (!calledDone) {
calledDone = true;
exports.finalize(err, resolve, reject);
}
} | javascript | {
"resource": ""
} |
q24976 | train | function() {
return window.innerWidth || document.documentElement[LEXICON.cW] || document.body[LEXICON.cW];
} | javascript | {
"resource": ""
} | |
q24977 | train | function() {
return window.innerHeight || document.documentElement[LEXICON.cH] || document.body[LEXICON.cH];
} | javascript | {
"resource": ""
} | |
q24978 | train | function(event) {
if(event.preventDefault && event.cancelable)
event.preventDefault();
else
event.returnValue = false;
} | javascript | {
"resource": ""
} | |
q24979 | train | function(event) {
event = event.originalEvent || event;
var strPage = 'page';
var strClient = 'client';
var strX = 'X';
var strY = 'Y';
var target = event.target || event.srcElement || document;
var eventDoc... | javascript | {
"resource": ""
} | |
q24980 | train | function(event) {
var button = event.button;
if (!event.which && button !== undefined)
return (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0)));
else
return event.which;
} | javascript | {
"resource": ""
} | |
q24981 | train | function(item, arr) {
for (var i = 0; i < arr[LEXICON.l]; i++)
//Sometiems in IE a "SCRIPT70" Permission denied error occurs if HTML elements in a iFrame are compared
try {
if (arr[i] === item)
return i;
... | javascript | {
"resource": ""
} | |
q24982 | train | function(arr) {
var def = Array.isArray;
return def ? def(arr) : this.type(arr) == TYPES.a;
} | javascript | {
"resource": ""
} | |
q24983 | initOverlayScrollbarsStatics | train | function initOverlayScrollbarsStatics() {
if(!_pluginsGlobals)
_pluginsGlobals = new OverlayScrollbarsGlobals(_pluginsOptions._defaults);
if(!_pluginsAutoUpdateLoop)
_pluginsAutoUpdateLoop = new OverlayScrollbarsAutoUpdateLoop(_pluginsGlobals);
... | javascript | {
"resource": ""
} |
q24984 | train | function() {
if(_loopingInstances[_strLength] > 0 && _loopIsActive) {
_loopID = COMPATIBILITY.rAF()(function () {
loop();
});
var timeNew = COMPATIBILITY.now();
var timeDelta =... | javascript | {
"resource": ""
} | |
q24985 | removePassiveEventListener | train | function removePassiveEventListener(element, eventNames, listener) {
var events = eventNames.split(_strSpace);
for (var i = 0; i < events.length; i++)
element[0].removeEventListener(events[i], listener, {passive: true});
} | javascript | {
"resource": ""
} |
q24986 | train | function () {
/*
var sizeResetWidth = observerElement[LEXICON.oW] + nativeScrollbarSize.x * factor + nativeScrollbarSize.y * factor + _overlayScrollbarDummySize.x + _overlayScrollbarDummySize.y;
var sizeResetHeight = obser... | javascript | {
"resource": ""
} | |
q24987 | removeResizeObserver | train | function removeResizeObserver(targetElement) {
if (_supportResizeObserver) {
var element = targetElement.contents()[0];
element[_strResizeObserverProperty].disconnect();
delete element[_strResizeObserverProperty];
... | javascript | {
"resource": ""
} |
q24988 | connectMutationObservers | train | function connectMutationObservers() {
if (_supportMutationObserver && !_mutationObserversConnected) {
_mutationObserverHost.observe(_hostElementNative, {
attributes: true,
attributeOldValue: true,
... | javascript | {
"resource": ""
} |
q24989 | hostOnMouseMove | train | function hostOnMouseMove() {
if (_scrollbarsAutoHideMove) {
refreshScrollbarsAutoHide(true);
clearTimeout(_scrollbarsAutoHideMoveTimeoutId);
_scrollbarsAutoHideMoveTimeoutId = setTimeout(function () {
... | javascript | {
"resource": ""
} |
q24990 | isUnknownMutation | train | function isUnknownMutation(mutation) {
var attributeName = mutation.attributeName;
var mutationTarget = mutation.target;
var mutationType = mutation.type;
var strClosest = 'closest';
if (mutationTarget === _contentEleme... | javascript | {
"resource": ""
} |
q24991 | updateAutoContentSizeChanged | train | function updateAutoContentSizeChanged() {
if (_isSleeping)
return false;
var float;
var textareaValueLength = _isTextarea && _widthAutoCache && !_textareaAutoWrappingCache ? _targetElement.val().length : 0;
var setC... | javascript | {
"resource": ""
} |
q24992 | isSizeAffectingCSSProperty | train | function isSizeAffectingCSSProperty(propertyName) {
if (!_initialized)
return true;
var flexGrow = 'flex-grow';
var flexShrink = 'flex-shrink';
var flexBasis = 'flex-basis';
var affectingPropsX = ... | javascript | {
"resource": ""
} |
q24993 | refreshScrollbarAppearance | train | function refreshScrollbarAppearance(isHorizontal, shallBeVisible, canScroll) {
var scrollbarClassName = isHorizontal ? _classNameHostScrollbarHorizontalHidden : _classNameHostScrollbarVerticalHidden;
var scrollbarElement = isHorizontal ? _scrollbarHorizontalElement : _scrollbarVe... | javascript | {
"resource": ""
} |
q24994 | refreshScrollbarHandleLength | train | function refreshScrollbarHandleLength(isHorizontal) {
var handleCSS = {};
var scrollbarVars = getScrollbarVars(isHorizontal);
var scrollbarVarsInfo = scrollbarVars._info;
var digit = 1000000;
//get and apply intended han... | javascript | {
"resource": ""
} |
q24995 | refreshScrollbarsInteractive | train | function refreshScrollbarsInteractive(isTrack, value) {
var action = value ? 'removeClass' : 'addClass';
var element1 = isTrack ? _scrollbarHorizontalTrackElement : _scrollbarHorizontalHandleElement;
var element2 = isTrack ? _scrollbarVerticalTrackElement : _s... | javascript | {
"resource": ""
} |
q24996 | getScrollbarVars | train | function getScrollbarVars(isHorizontal) {
return {
_width_height: isHorizontal ? _strWidth : _strHeight,
_Width_Height: isHorizontal ? 'Width' : 'Height',
_left_top: isHorizontal ? _strLeft : _strTop,
_Le... | javascript | {
"resource": ""
} |
q24997 | setupScrollbarCornerEvents | train | function setupScrollbarCornerEvents() {
var insideIFrame = _windowElementNative.top !== _windowElementNative;
var mouseDownPosition = { };
var mouseDownSize = { };
var mouseDownInvertedScale = { };
_resizeOnMouseTouchDo... | javascript | {
"resource": ""
} |
q24998 | setTopRightBottomLeft | train | function setTopRightBottomLeft(targetCSSObject, prefix, values) {
if (values === undefined)
values = [_strEmpty, _strEmpty, _strEmpty, _strEmpty];
targetCSSObject[prefix + _strTop] = values[0];
targetCSSObject[prefix + _strRight] = val... | javascript | {
"resource": ""
} |
q24999 | getCSSTransitionString | train | function getCSSTransitionString(element) {
var transitionStr = VENDORS._cssProperty('transition');
var assembledValue = element.css(transitionStr);
if(assembledValue)
return assembledValue;
var regExpString = '\\s*('... | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.