_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 52 373k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q45800 | splitCommand | train | function splitCommand(line) {
// Make sure we get the same results irrespective of leading/trailing spaces
var match = line.match(TOKEN_WHITESPACE);
if (!match) {
return {
name: line.toUpperCase(),
rest: ''
};
}
var name = line.substr(0, match.index).toUpperCa... | javascript | {
"resource": ""
} |
q45801 | findRuntimePath | train | function findRuntimePath() {
const upPkg = readPkgUp.sync();
// case 1: we're in NR itself
if (upPkg.pkg.name === 'node-red') {
if (checkSemver(upPkg.pkg.version,"<0.20.0")) {
return path.join(path.dirname(upPkg.path), upPkg.pkg.main);
} else {
return path.join(path.d... | javascript | {
"resource": ""
} |
q45802 | checkSemver | train | function checkSemver(localVersion,testRange) {
var parts = localVersion.split("-");
return semver.satisfies(parts[0],testRange);
} | javascript | {
"resource": ""
} |
q45803 | createNeighborArrayForNode | train | function createNeighborArrayForNode(type, direction, nodeData) {
// If we want only undirected or in or out, we can roll some optimizations
if (type !== 'mixed') {
if (type === 'undirected')
return Object.keys(nodeData.undirected);
if (typeof direction === 'string')
return Object.keys(nodeData... | javascript | {
"resource": ""
} |
q45804 | forEachInObject | train | function forEachInObject(nodeData, object, callback) {
for (const k in object) {
let edgeData = object[k];
if (edgeData instanceof Set)
edgeData = edgeData.values().next().value;
const sourceData = edgeData.source,
targetData = edgeData.target;
const neighborData = sourceData === no... | javascript | {
"resource": ""
} |
q45805 | nodeHasNeighbor | train | function nodeHasNeighbor(graph, type, direction, node, neighbor) {
const nodeData = graph._nodes.get(node);
if (type !== 'undirected') {
if (direction !== 'out' && typeof nodeData.in !== 'undefined') {
for (const k in nodeData.in)
if (k === neighbor)
return true;
}
if (directi... | javascript | {
"resource": ""
} |
q45806 | attachNeighborArrayCreator | train | function attachNeighborArrayCreator(Class, description) {
const {
name,
type,
direction
} = description;
/**
* Function returning an array or the count of certain neighbors.
*
* Arity 1: Return all of a node's relevant neighbors.
* @param {any} node - Target node.
*
* Arity 2: ... | javascript | {
"resource": ""
} |
q45807 | collectForKey | train | function collectForKey(edges, object, k) {
if (!(k in object))
return;
if (object[k] instanceof Set)
object[k].forEach(edgeData => edges.push(edgeData.key));
else
edges.push(object[k].key);
return;
} | javascript | {
"resource": ""
} |
q45808 | forEachForKey | train | function forEachForKey(object, k, callback) {
if (!(k in object))
return;
if (object[k] instanceof Set)
object[k].forEach(edgeData => callback(
edgeData.key,
edgeData.attributes,
edgeData.source.key,
edgeData.target.key,
edgeData.source.attributes,
edgeData.target.attri... | javascript | {
"resource": ""
} |
q45809 | createIteratorForKey | train | function createIteratorForKey(object, k) {
const v = object[k];
if (v instanceof Set) {
const iterator = v.values();
return new Iterator(function() {
const step = iterator.next();
if (step.done)
return step;
const edgeData = step.value;
return {
done: false,
... | javascript | {
"resource": ""
} |
q45810 | createEdgeArray | train | function createEdgeArray(graph, type) {
if (graph.size === 0)
return [];
if (type === 'mixed' || type === graph.type)
return take(graph._edges.keys(), graph._edges.size);
const size = type === 'undirected' ?
graph.undirectedSize :
graph.directedSize;
const list = new Array(size),
mask... | javascript | {
"resource": ""
} |
q45811 | forEachEdge | train | function forEachEdge(graph, type, callback) {
if (graph.size === 0)
return;
if (type === 'mixed' || type === graph.type) {
graph._edges.forEach((data, key) => {
const {attributes, source, target} = data;
callback(
key,
attributes,
source.key,
target.key,
... | javascript | {
"resource": ""
} |
q45812 | createEdgeIterator | train | function createEdgeIterator(graph, type) {
if (graph.size === 0)
return Iterator.empty();
let iterator;
if (type === 'mixed') {
iterator = graph._edges.values();
return new Iterator(function next() {
const step = iterator.next();
if (step.done)
return step;
const data = ... | javascript | {
"resource": ""
} |
q45813 | createEdgeArrayForNode | train | function createEdgeArrayForNode(type, direction, nodeData) {
const edges = [];
if (type !== 'undirected') {
if (direction !== 'out')
collect(edges, nodeData.in);
if (direction !== 'in')
collect(edges, nodeData.out);
}
if (type !== 'directed') {
collect(edges, nodeData.undirected);
}
... | javascript | {
"resource": ""
} |
q45814 | createEdgeArrayForPath | train | function createEdgeArrayForPath(type, direction, sourceData, target) {
const edges = [];
if (type !== 'undirected') {
if (typeof sourceData.in !== 'undefined' && direction !== 'out')
collectForKey(edges, sourceData.in, target);
if (typeof sourceData.out !== 'undefined' && direction !== 'in')
... | javascript | {
"resource": ""
} |
q45815 | forEachEdgeForPath | train | function forEachEdgeForPath(type, direction, sourceData, target, callback) {
if (type !== 'undirected') {
if (typeof sourceData.in !== 'undefined' && direction !== 'out')
forEachForKey(sourceData.in, target, callback);
if (typeof sourceData.out !== 'undefined' && direction !== 'in')
forEachForKe... | javascript | {
"resource": ""
} |
q45816 | createEdgeIteratorForPath | train | function createEdgeIteratorForPath(type, direction, sourceData, target) {
let iterator = Iterator.empty();
if (type !== 'undirected') {
if (
typeof sourceData.in !== 'undefined' &&
direction !== 'out' &&
target in sourceData.in
)
iterator = chain(iterator, createIteratorForKey(sour... | javascript | {
"resource": ""
} |
q45817 | attachEdgeArrayCreator | train | function attachEdgeArrayCreator(Class, description) {
const {
name,
type,
direction
} = description;
/**
* Function returning an array of certain edges.
*
* Arity 0: Return all the relevant edges.
*
* Arity 1: Return all of a node's relevant edges.
* @param {any} node - Target ... | javascript | {
"resource": ""
} |
q45818 | attachForEachEdge | train | function attachForEachEdge(Class, description) {
const {
name,
type,
direction
} = description;
const forEachName = 'forEach' + name[0].toUpperCase() + name.slice(1, -1);
/**
* Function iterating over the graph's relevant edges by applying the given
* callback.
*
* Arity 1: Iterate ove... | javascript | {
"resource": ""
} |
q45819 | addEdge | train | function addEdge(
graph,
name,
mustGenerateKey,
undirected,
edge,
source,
target,
attributes
) {
// Checking validity of operation
if (!undirected && graph.type === 'undirected')
throw new UsageGraphError(`Graph.${name}: you cannot add a directed edge to an undirected graph. Use the #.addEdge o... | javascript | {
"resource": ""
} |
q45820 | attachAttributeGetter | train | function attachAttributeGetter(Class, method, type, EdgeDataClass) {
/**
* Get the desired attribute for the given element (node or edge).
*
* Arity 2:
* @param {any} element - Target element.
* @param {string} name - Attribute's name.
*
* Arity 3 (only for edges):
* @param {any} ... | javascript | {
"resource": ""
} |
q45821 | getLoaderDoc | train | function getLoaderDoc(message) {
let tpl = defaults.templates.loader;
let str = (tpl && tpl({message: message})) || '<document></document>';
return Parser.dom(str);
} | javascript | {
"resource": ""
} |
q45822 | getErrorDoc | train | function getErrorDoc(message) {
let cfg = {};
if (_.isPlainObject(message)) {
cfg = message;
if (cfg.status && !cfg.template && defaults.templates.status[cfg.status]) {
cfg.template = defaults.templates.status[cfg.status];
}
} else {
cfg.template = defaults.templa... | javascript | {
"resource": ""
} |
q45823 | initMenu | train | function initMenu() {
let menuCfg = defaults.menu;
// no configuration given and neither the menu created earlier
// no need to proceed
if (!menuCfg && !Menu.created) {
return;
}
// set options to create menu
if (menuCfg) {
Menu.setOptions(menuCfg);
}
menuDoc = Men... | javascript | {
"resource": ""
} |
q45824 | show | train | function show(cfg = {}) {
if (_.isFunction(cfg)) {
cfg = {
template: cfg
};
}
// no template exists, cannot proceed
if (!cfg.template) {
console.warn('No template found!')
return;
}
let doc = null;
if (getLastDocumentFromStack() && cfg.type === 'm... | javascript | {
"resource": ""
} |
q45825 | showLoading | train | function showLoading(cfg = {}) {
if (_.isString(cfg)) {
cfg = {
data: {
message: cfg
}
};
}
// use default loading template if not passed as a configuration
_.defaultsDeep(cfg, {
template: defaults.templates.loader,
type: 'modal'
... | javascript | {
"resource": ""
} |
q45826 | showError | train | function showError(cfg = {}) {
if (_.isBoolean(cfg) && !cfg && errorDoc) { // hide error
navigationDocument.removeDocument(errorDoc);
return;
}
if (_.isString(cfg)) {
cfg = {
data: {
message: cfg
}
};
}
// use default error temp... | javascript | {
"resource": ""
} |
q45827 | pushDocument | train | function pushDocument(doc) {
if (!(doc instanceof Document)) {
console.warn('Cannot navigate to the document.', doc);
return;
}
navigationDocument.pushDocument(doc);
} | javascript | {
"resource": ""
} |
q45828 | replaceDocument | train | function replaceDocument(doc, docToReplace) {
if (!(doc instanceof Document) || !(docToReplace instanceof Document)) {
console.warn('Cannot replace document.');
return;
}
navigationDocument.replaceDocument(doc, docToReplace);
} | javascript | {
"resource": ""
} |
q45829 | cleanNavigate | train | function cleanNavigate(doc, replace = false) {
let navigated = false;
let docs = navigationDocument.documents;
let last = getLastDocumentFromStack();
if (!replace && (!last || last !== loaderDoc && last !== errorDoc)) {
pushDocument(doc);
} else if (last && last === loaderDoc || last === er... | javascript | {
"resource": ""
} |
q45830 | navigateToMenuPage | train | function navigateToMenuPage() {
console.log('navigating to menu...');
return new Promise((resolve, reject) => {
if (!menuDoc) {
initMenu();
}
if (!menuDoc) {
console.warn('No menu configuration exists, cannot navigate to the menu page.');
reject();
... | javascript | {
"resource": ""
} |
q45831 | navigate | train | function navigate(page, options, replace) {
let p = Page.get(page);
if (_.isBoolean(options)) {
replace = options;
} else {
options = options || {};
}
if (_.isBoolean(options.replace)) {
replace = options.replace;
}
console.log('navigating... page:', page, ':: opti... | javascript | {
"resource": ""
} |
q45832 | presentModal | train | function presentModal(modal) {
let doc = modal; // assume a document object is passed
if (_.isString(modal)) { // if a modal document string is passed
doc = Parser.dom(modal);
} else if (_.isPlainObject(modal)) { // if a modal page configuration is passed
doc = Page.makeDom(modal);
}
... | javascript | {
"resource": ""
} |
q45833 | pop | train | function pop(doc) {
if (doc instanceof Document) {
_.defer(() => navigationDocument.popToDocument(doc));
} else {
_.defer(() => navigationDocument.popDocument());
}
} | javascript | {
"resource": ""
} |
q45834 | appendStyle | train | function appendStyle(style, doc) {
if (!_.isString(style) || !doc) {
console.log('invalid document or style string...', style, doc);
return;
}
let docEl = (doc.getElementsByTagName('document')).item(0);
let styleString = ['<style>', style, '</style>'].join('');
let headTag = doc.getE... | javascript | {
"resource": ""
} |
q45835 | prepareDom | train | function prepareDom(doc, cfg = {}) {
if (!(doc instanceof Document)) {
console.warn('Cannnot prepare, the provided element is not a document.');
return;
}
// apply defaults
_.defaults(cfg, defaults);
// append any default styles
appendStyle(cfg.style, doc);
// attach event ha... | javascript | {
"resource": ""
} |
q45836 | makeDom | train | function makeDom(cfg, response) {
// apply defaults
_.defaults(cfg, defaults);
// create Document
let doc = Parser.dom(cfg.template, (_.isPlainObject(cfg.data) ? cfg.data: cfg.data(response)));
// prepare the Document
prepareDom(doc, cfg);
// call the after ready method if defined in the con... | javascript | {
"resource": ""
} |
q45837 | makePage | train | function makePage(cfg) {
return (options) => {
_.defaultsDeep(cfg, defaults);
console.log('making page... options:', cfg);
// return a promise that resolves after completion of the ajax request
// if no ready method or url configuration exist, the promise is resolved immediately an... | javascript | {
"resource": ""
} |
q45838 | parse | train | function parse(s, data) {
// if a template function is provided, call the function with data
s = _.isFunction(s) ? s(data) : s;
console.log('parsing string...');
console.log(s);
// prepend the xml string if not already present
if (!_.startsWith(s, '<?xml')) {
s = xmlPrefix + s;
}
... | javascript | {
"resource": ""
} |
q45839 | setAttributes | train | function setAttributes(el, attributes) {
console.log('setting attributes on element...', el, attributes);
_.each(attributes, (value, name) => el.setAttribute(name, value));
} | javascript | {
"resource": ""
} |
q45840 | addItem | train | function addItem(item = {}) {
if (!item.id) {
console.warn('Cannot add menuitem. A unique identifier is required for the menuitem to work correctly.');
return;
}
let el = doc.createElement('menuItem');
// assign unique id
item.attributes = _.assign({}, item.attributes, {
id: ... | javascript | {
"resource": ""
} |
q45841 | create | train | function create(cfg = {}) {
if (created) {
console.warn('An instance of menu already exists, skipping creation...');
return;
}
// defaults
_.assign(defaults, cfg);
console.log('creating menu...', defaults);
// set attributes to the menubar element
setAttributes(menu... | javascript | {
"resource": ""
} |
q45842 | ajax | train | function ajax(url, options, method = 'GET') {
if (typeof url == 'undefined') {
console.error('No url specified for the ajax.');
throw new TypeError('A URL is required for making the ajax request.');
}
if (typeof options === 'undefined' && typeof url === 'object' && url.url) {
option... | javascript | {
"resource": ""
} |
q45843 | initLibraries | train | function initLibraries(cfg = {}) {
_.each(configMap, (keys, libName) => {
let lib = libs[libName];
let options = {};
_.each(keys, (key) => options[key] = cfg[key]);
lib.setOptions && lib.setOptions(options);
});
} | javascript | {
"resource": ""
} |
q45844 | initAppHandlers | train | function initAppHandlers (cfg = {}) {
_.each(handlers, (handler, name) => App[name] = _.partial(handler, _, (_.isFunction(cfg[name])) ? cfg[name] : _.noop));
} | javascript | {
"resource": ""
} |
q45845 | start | train | function start(cfg = {}) {
if (started) {
console.warn('Application already started, cannot call start again.');
return;
}
initLibraries(cfg);
initAppHandlers(cfg);
// if already bootloaded somewhere
// immediately call the onLaunch method
if (cfg.bootloaded) {
App.onLaunch(App.launchOpt... | javascript | {
"resource": ""
} |
q45846 | reload | train | function reload(options, reloadData) {
App.onReload(options);
App.reload(options, reloadData);
} | javascript | {
"resource": ""
} |
q45847 | setOptions | train | function setOptions(cfg = {}) {
console.log('setting handler options...', cfg);
// override the default options
_.defaultsDeep(handlers, cfg.handlers);
} | javascript | {
"resource": ""
} |
q45848 | setListeners | train | function setListeners(doc, cfg = {}, add = true) {
if (!doc || !(doc instanceof Document)) {
return;
}
let listenerFn = doc.addEventListener;
if (!add) {
listenerFn = doc.removeEventListener;
}
if (_.isObject(cfg.events)) {
let events = cfg.events;
_.eac... | javascript | {
"resource": ""
} |
q45849 | map | train | function map(resultSet, maps, mapId, columnPrefix) {
let mappedCollection = [];
resultSet.forEach(result => {
injectResultInCollection(result, mappedCollection, maps, mapId, columnPrefix);
});
return mappedCollection;
} | javascript | {
"resource": ""
} |
q45850 | mapOne | train | function mapOne(resultSet, maps, mapId, columnPrefix, isRequired = true) {
var mappedCollection = map(resultSet, maps, mapId, columnPrefix);
if (mappedCollection.length > 0) {
return mappedCollection[0];
}
else if (isRequired) {
throw new NotFoundError('EmptyResponse');
}
else ... | javascript | {
"resource": ""
} |
q45851 | injectResultInCollection | train | function injectResultInCollection(result, mappedCollection, maps, mapId, columnPrefix = '') {
// Check if the object is already in mappedCollection
let resultMap = maps.find(map => map.mapId === mapId);
let idProperty = getIdProperty(resultMap);
let predicate = idProperty.reduce((accumulator, field) =>... | javascript | {
"resource": ""
} |
q45852 | injectResultInObject | train | function injectResultInObject(result, mappedObject, maps, mapId, columnPrefix = '') {
// Get the resultMap for this object
let resultMap = maps.find(map => map.mapId === mapId);
// Copy id property
let idProperty = getIdProperty(resultMap);
idProperty.forEach(field => {
if (!mappedObject[... | javascript | {
"resource": ""
} |
q45853 | train | function (vObject, filter) {
/**
* Definition:
* <!ELEMENT filter (comp-filter)>
*/
if (filter) {
if (vObject.name == filter.name) {
return this._validateFilterSet(vObject, filter["comp-filters"], this._validateCompFilter) &&
... | javascript | {
"resource": ""
} | |
q45854 | train | function (component, textMatch) {
if (component.hasFeature && component.hasFeature(jsVObject_Node))
component = component.getValue();
var isMatching = Util.textMatch(component, textMatch.value, textMatch["match-type"]);
return (textMatch["negate-condition"] ^ isMatching);
} | javascript | {
"resource": ""
} | |
q45855 | train | function (component, filter) {
if (!filter)
return true;
var start = filter.start, end = filter.end;
if (!start)
start = new Date(1900, 1, 1);
if (!end)
end = new Date(3000, 1, 1);
switch (component.name) {
case "VEVENT" :
... | javascript | {
"resource": ""
} | |
q45856 | train | function(name, data, enc, cbfscreatefile) {
jsDAV_FS_Directory.createFile.call(this, name, data, enc,
afterCreateFile.bind(this, name, cbfscreatefile));
} | javascript | {
"resource": ""
} | |
q45857 | train | function(handler, name, enc, cbfscreatefile) {
jsDAV_FS_Directory.createFileStream.call(this, handler, name, enc,
afterCreateFile.bind(this, name, cbfscreatefile));
} | javascript | {
"resource": ""
} | |
q45858 | train | function(name, cbfsgetchild) {
var path = Path.join(this.path, name);
Fs.stat(path, function(err, stat) {
if (err || typeof stat == "undefined") {
return cbfsgetchild(new Exc.FileNotFound("File with name "
+ path + " could not be located"));
}... | javascript | {
"resource": ""
} | |
q45859 | train | function(cbfsgetchildren) {
var nodes = [];
Async.readdir(this.path)
.stat()
.filter(function(file) {
return file.indexOf(jsDAV_FSExt_File.PROPS_DIR) !== 0;
})
.each(function(file, cbnextdirch) {
nodes.push(file.stat.is... | javascript | {
"resource": ""
} | |
q45860 | train | function(cbfsdel) {
var self = this;
Async.rmtree(this.path, function(err) {
if (err)
return cbfsdel(err);
self.deleteResourceData(cbfsdel);
});
} | javascript | {
"resource": ""
} | |
q45861 | getDigest | train | function getDigest(req) {
// most other servers
var digest = req.headers["authorization"];
if (digest && digest.toLowerCase().indexOf("digest") === 0)
return digest.substr(7);
else
return null;
} | javascript | {
"resource": ""
} |
q45862 | parseDigest | train | function parseDigest(digest) {
if (!digest)
return false;
// protect against missing data
var needed_parts = {"nonce": 1, "nc": 1, "cnonce": 1, "qop": 1,
"username": 1, "uri": 1, "response": 1};
var data = {};
digest.replace(/(\w+)=(?:(?:")([^"]+)"|([^\s,]+))/g, function(m, m1, m2, ... | javascript | {
"resource": ""
} |
q45863 | train | function(realm, req) {
this.realm = realm;
this.opaque = Util.createHash(this.realm);
this.digest = getDigest(req);
this.digestParts = parseDigest(this.digest);
} | javascript | {
"resource": ""
} | |
q45864 | train | function(handler, password, cbvalidpass) {
this.A1 = Util.createHash(this.digestParts["username"] + ":" + this.realm + ":" + password);
this.validate(handler, cbvalidpass);
} | javascript | {
"resource": ""
} | |
q45865 | train | function(handler, cbvalidate) {
var req = handler.httpRequest;
var A2 = req.method + ":" + this.digestParts["uri"];
var self = this;
if (this.digestParts["qop"] == "auth-int") {
// Making sure we support this qop value
if (!(this.qop & QOP_AUTHINT))
... | javascript | {
"resource": ""
} | |
q45866 | train | function(realm, err, cbreqauth) {
if (!(err instanceof Exc.jsDAV_Exception))
err = new Exc.NotAuthenticated(err);
var currQop = "";
switch (this.qop) {
case QOP_AUTH:
currQop = "auth";
break;
case QOP_AUTHINT:
c... | javascript | {
"resource": ""
} | |
q45867 | train | function(handler, realm, cbauth) {
var req = handler.httpRequest;
this.init(realm, req);
var username = this.digestParts["username"];
// No username was given
if (!username)
return this.requireAuth(realm, "No digest authentication headers were found", cbauth);
... | javascript | {
"resource": ""
} | |
q45868 | train | function(opts){
opts = opts || {};
this.db = opts.db;
this.config = {
maxConnection : opts.maxConnection || DEFAULT_MAX_CONNECTION,
connectionIdleTimeout : opts.connectionIdleTimeout || DEFAULT_CONNECTION_IDLE_TIMEOUT,
maxPendingTask : opts.maxPendingTask || DEFAULT_MAX_PENDING_TAS... | javascript | {
"resource": ""
} | |
q45869 | prepareFilesForPublishing | train | async function prepareFilesForPublishing(
tmpDir,
files = [],
ignorePatterns = null
) {
// Ignored files filter
const filter = ignore().add(ignorePatterns)
const projectRoot = findProjectRoot()
function createFilter(files, ignorePath) {
let f = fs.readFileSync(ignorePath).toString()
files.forEach... | javascript | {
"resource": ""
} |
q45870 | moduleDefine | train | function moduleDefine(exports, name, members) {
var target = [exports];
var publicNS = null;
if (name) {
publicNS = createNamespace(_Global, name);
target.push(publicNS);
}
initializeProperties(target, members, name || "<ANONYMO... | javascript | {
"resource": ""
} |
q45871 | completed | train | function completed(promise, value) {
var targetState;
if (value && typeof value === "object" && typeof value.then === "function") {
targetState = state_waiting;
} else {
targetState = state_success_notify;
}
promise._value = value;
promise._setStat... | javascript | {
"resource": ""
} |
q45872 | timeout | train | function timeout(timeoutMS) {
var id;
return new Promise(
function (c) {
if (timeoutMS) {
id = _Global.setTimeout(c, timeoutMS);
} else {
_BaseCoreUtils._setImmediate(c);
}
},
func... | javascript | {
"resource": ""
} |
q45873 | setState | train | function setState(state) {
return function (job, arg0, arg1) {
job._setState(state, arg0, arg1);
};
} | javascript | {
"resource": ""
} |
q45874 | notifyCurrentDrainListener | train | function notifyCurrentDrainListener() {
var listener = drainQueue.shift();
if (listener) {
drainStopping(listener);
drainQueue[0] && drainStarting(drainQueue[0]);
listener.complete();
}
} | javascript | {
"resource": ""
} |
q45875 | notifyDrainListeners | train | function notifyDrainListeners() {
var notifiedSomebody = false;
if (!!drainQueue.length) {
// As we exhaust priority levels, notify the appropriate drain listeners.
//
var drainPriority = currentDrainPriority();
while (+drainPriority === drainPriority && d... | javascript | {
"resource": ""
} |
q45876 | addJobAtHeadOfPriority | train | function addJobAtHeadOfPriority(node, priority) {
var marker = markerFromPriority(priority);
if (marker.priority > highWaterMark) {
highWaterMark = marker.priority;
immediateYield = true;
}
marker._insertJobAfter(node);
} | javascript | {
"resource": ""
} |
q45877 | setAttribute | train | function setAttribute(element, attribute, value) {
if (element.getAttribute(attribute) !== "" + value) {
element.setAttribute(attribute, value);
}
} | javascript | {
"resource": ""
} |
q45878 | addListenerToEventMap | train | function addListenerToEventMap(element, type, listener, useCapture, data) {
var eventNameLowercase = type.toLowerCase();
if (!element._eventsMap) {
element._eventsMap = {};
}
if (!element._eventsMap[eventNameLowercase]) {
element._eventsMap[eventNameLowercase] = [... | javascript | {
"resource": ""
} |
q45879 | train | function (element) {
var hiddenElement = _Global.document.createElement("div");
hiddenElement.style[_BaseUtils._browserStyleEquivalents["animation-name"].scriptName] = "WinJS-node-inserted";
hiddenElement.style[_BaseUtils._browserStyleEquivalents["animation-duration"].scriptName] = "... | javascript | {
"resource": ""
} | |
q45880 | readWhitespace | train | function readWhitespace(text, offset, limit) {
while (offset < limit) {
var code = text.charCodeAt(offset);
switch (code) {
case 0x0009: // tab
case 0x000B: // vertical tab
... | javascript | {
"resource": ""
} |
q45881 | train | function () {
if (this._notificationsSent && !this._externalBegin && !this._endNotificationsPosted) {
this._endNotificationsPosted = true;
var that = this;
Scheduler.schedule(function ItemsManager_async_endNotifications() {
... | javascript | {
"resource": ""
} | |
q45882 | tabbableElementsNodeFilter | train | function tabbableElementsNodeFilter(node) {
var nodeStyle = _ElementUtilities._getComputedStyle(node);
if (nodeStyle.display === "none" || nodeStyle.visibility === "hidden") {
return _Global.NodeFilter.FILTER_REJECT;
}
if (node._tabContainer) {
return _Global.Node... | javascript | {
"resource": ""
} |
q45883 | drainQueue | train | function drainQueue(jobInfo) {
function drainNext() {
return drainQueue;
}
var queue = jobInfo.job._queue;
if (queue.length === 0 && eventQueue.length > 0) {
queue = jobInfo.job._queue = copyAndClearQueue();
}
jobInfo.setPromise(drainOneEvent(qu... | javascript | {
"resource": ""
} |
q45884 | activatedHandler | train | function activatedHandler(e) {
var def = captureDeferral(e.activatedOperation);
_State._loadState(e).then(function () {
queueEvent({ type: activatedET, detail: e, _deferral: def.deferral, _deferralID: def.id });
});
} | javascript | {
"resource": ""
} |
q45885 | transformWithTransition | train | function transformWithTransition(element, transition) {
// transition's properties:
// - duration: Number representing the duration of the animation in milliseconds.
// - timing: String representing the CSS timing function that controls the progress of the animation.
// - to: The value o... | javascript | {
"resource": ""
} |
q45886 | disposeInstance | train | function disposeInstance(container, workPromise, renderCompletePromise) {
var bindings = _ElementUtilities.data(container).bindTokens;
if (bindings) {
bindings.forEach(function (binding) {
if (binding && binding.cancel) {
... | javascript | {
"resource": ""
} |
q45887 | PageControl_ctor | train | function PageControl_ctor(element, options, complete, parentedPromise) {
var that = this;
this._disposed = false;
this.element = element = element || _Global.document.createElement("div");
_ElementUtilities.addClass(element, "win-disposable... | javascript | {
"resource": ""
} |
q45888 | moveSequenceBefore | train | function moveSequenceBefore(slotNext, slotFirst, slotLast) {
slotFirst.prev.next = slotLast.next;
slotLast.next.prev = slotFirst.prev;
slotFirst.prev = slotNext.prev;
slotLast.next = slotNext;
slotFirst.prev.next = slo... | javascript | {
"resource": ""
} |
q45889 | moveSequenceAfter | train | function moveSequenceAfter(slotPrev, slotFirst, slotLast) {
slotFirst.prev.next = slotLast.next;
slotLast.next.prev = slotFirst.prev;
slotFirst.prev = slotPrev;
slotLast.next = slotPrev.next;
slotPrev.next = slotFirst;... | javascript | {
"resource": ""
} |
q45890 | insertAndMergeSlot | train | function insertAndMergeSlot(slot, slotNext, mergeWithPrev, mergeWithNext) {
insertSlot(slot, slotNext);
var slotPrev = slot.prev;
if (slotPrev.lastInSequence) {
if (mergeWithPrev) {
delete slotPrev.lastInSe... | javascript | {
"resource": ""
} |
q45891 | setSlotKey | train | function setSlotKey(slot, key) {
slot.key = key;
// Add the slot to the keyMap, so it is possible to quickly find the slot given its key
keyMap[slot.key] = slot;
} | javascript | {
"resource": ""
} |
q45892 | createAndAddSlot | train | function createAndAddSlot(slotNext, indexMapForSlot) {
var slotNew = (indexMapForSlot === indexMap ? createPrimarySlot() : createSlot());
insertSlot(slotNew, slotNext);
return slotNew;
} | javascript | {
"resource": ""
} |
q45893 | adjustedIndex | train | function adjustedIndex(slot) {
var undefinedIndex;
if (!slot) {
return undefinedIndex;
}
var delta = 0;
while (!slot.firstInSequence) {
delta++;
s... | javascript | {
"resource": ""
} |
q45894 | updateNewIndicesAfterSlot | train | function updateNewIndicesAfterSlot(slot, indexDelta) {
// Adjust all the indexNews after this slot
for (slot = slot.next; slot; slot = slot.next) {
if (slot.firstInSequence) {
var indexNew = (slot.indexNew !== undefined ? slot.i... | javascript | {
"resource": ""
} |
q45895 | updateNewIndices | train | function updateNewIndices(slot, indexDelta) {
// If this slot is at the start of a sequence, transfer the indexNew
if (slot.firstInSequence) {
var indexNew;
if (indexDelta < 0) {
// The given slot is abo... | javascript | {
"resource": ""
} |
q45896 | updateNewIndicesFromIndex | train | function updateNewIndicesFromIndex(index, indexDelta) {
for (var slot = slotsStart; slot !== slotListEnd; slot = slot.next) {
var indexNew = slot.indexNew;
if (indexNew !== undefined && index <= indexNew) {
updateNewIndices... | javascript | {
"resource": ""
} |
q45897 | updateIndices | train | function updateIndices() {
var slot,
slotFirstInSequence,
indexNew;
for (slot = slotsStart; ; slot = slot.next) {
if (slot.firstInSequence) {
slotFirstInSequence = slot;
... | javascript | {
"resource": ""
} |
q45898 | addMarkers | train | function addMarkers(fetchResult) {
var items = fetchResult.items,
offset = fetchResult.offset,
totalCount = fetchResult.totalCount,
absoluteIndex = fetchResult.absoluteIndex,
atStart = fetchResult.atStart... | javascript | {
"resource": ""
} |
q45899 | itemChanged | train | function itemChanged(slot) {
var itemNew = slot.itemNew;
if (!itemNew) {
return false;
}
var item = slot.item;
for (var property in item) {
switch (property) {
... | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.