repo stringlengths 5 67 | path stringlengths 4 116 | func_name stringlengths 0 58 | original_string stringlengths 52 373k | language stringclasses 1
value | code stringlengths 52 373k | code_tokens list | docstring stringlengths 4 11.8k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 86 226 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
feedm3/hypem-resolver | hypem-resolver.js | requestHypemKey | function requestHypemKey(hypemId, callback) {
var options = {
method: "GET",
url: HYPEM_TRACK_URL + hypemId,
headers: {"Cookie": COOKIE},
timeout: FIVE_SECONDS_IN_MILLIS
};
request(options, function (error, response) {
if (!error && re... | javascript | function requestHypemKey(hypemId, callback) {
var options = {
method: "GET",
url: HYPEM_TRACK_URL + hypemId,
headers: {"Cookie": COOKIE},
timeout: FIVE_SECONDS_IN_MILLIS
};
request(options, function (error, response) {
if (!error && re... | [
"function",
"requestHypemKey",
"(",
"hypemId",
",",
"callback",
")",
"{",
"var",
"options",
"=",
"{",
"method",
":",
"\"GET\"",
",",
"url",
":",
"HYPEM_TRACK_URL",
"+",
"hypemId",
",",
"headers",
":",
"{",
"\"Cookie\"",
":",
"COOKIE",
"}",
",",
"timeout",
... | Get the key for hypem. The key is necessary to request
the hypem serve url which gives us the mp3 url. We dont
need a key if the song is hosted on soundcloud.
@private
@param {string} hypemId the id of the song
@param {Function}[callback] callback function
@param {Error} callback.err null if no error occurred
@param {... | [
"Get",
"the",
"key",
"for",
"hypem",
".",
"The",
"key",
"is",
"necessary",
"to",
"request",
"the",
"hypem",
"serve",
"url",
"which",
"gives",
"us",
"the",
"mp3",
"url",
".",
"We",
"dont",
"need",
"a",
"key",
"if",
"the",
"song",
"is",
"hosted",
"on",... | e20e0cf1ba93eac47f830c4b8693f13c4ca2588b | https://github.com/feedm3/hypem-resolver/blob/e20e0cf1ba93eac47f830c4b8693f13c4ca2588b/hypem-resolver.js#L91-L119 | train |
feedm3/hypem-resolver | hypem-resolver.js | requestMp3Url | function requestMp3Url(hypemId, hypemKey, callback) {
var options = {
method: "GET",
url: HYPEM_SERVE_URL + hypemId + "/" + hypemKey,
headers: {"Cookie": COOKIE},
timeout: FIVE_SECONDS_IN_MILLIS
};
request(options, function (error, response) {
... | javascript | function requestMp3Url(hypemId, hypemKey, callback) {
var options = {
method: "GET",
url: HYPEM_SERVE_URL + hypemId + "/" + hypemKey,
headers: {"Cookie": COOKIE},
timeout: FIVE_SECONDS_IN_MILLIS
};
request(options, function (error, response) {
... | [
"function",
"requestMp3Url",
"(",
"hypemId",
",",
"hypemKey",
",",
"callback",
")",
"{",
"var",
"options",
"=",
"{",
"method",
":",
"\"GET\"",
",",
"url",
":",
"HYPEM_SERVE_URL",
"+",
"hypemId",
"+",
"\"/\"",
"+",
"hypemKey",
",",
"headers",
":",
"{",
"\... | Get the mp3 url of the song's id with a given key.
@private
@param {string} hypemId the id of the song
@param {string} hypemKey the key to make the request succeed
@param {Function}[callback] callback function
@param {Error} callback.err null if no error occurred
@param {string} callback.url the mp3 url | [
"Get",
"the",
"mp3",
"url",
"of",
"the",
"song",
"s",
"id",
"with",
"a",
"given",
"key",
"."
] | e20e0cf1ba93eac47f830c4b8693f13c4ca2588b | https://github.com/feedm3/hypem-resolver/blob/e20e0cf1ba93eac47f830c4b8693f13c4ca2588b/hypem-resolver.js#L131-L154 | train |
feedm3/hypem-resolver | hypem-resolver.js | getNormalizedSoundcloudUrl | function getNormalizedSoundcloudUrl(soundcloudUrl) {
var parsedUrl = url.parse(soundcloudUrl);
var protocol = parsedUrl.protocol;
var host = parsedUrl.host;
var pathname = parsedUrl.pathname;
var splitHostname = pathname.split('/');
var normalizedUrl = protocol + "//" + h... | javascript | function getNormalizedSoundcloudUrl(soundcloudUrl) {
var parsedUrl = url.parse(soundcloudUrl);
var protocol = parsedUrl.protocol;
var host = parsedUrl.host;
var pathname = parsedUrl.pathname;
var splitHostname = pathname.split('/');
var normalizedUrl = protocol + "//" + h... | [
"function",
"getNormalizedSoundcloudUrl",
"(",
"soundcloudUrl",
")",
"{",
"var",
"parsedUrl",
"=",
"url",
".",
"parse",
"(",
"soundcloudUrl",
")",
";",
"var",
"protocol",
"=",
"parsedUrl",
".",
"protocol",
";",
"var",
"host",
"=",
"parsedUrl",
".",
"host",
"... | Get the normalized soundcloud url. This means that every
parameter or path which is not necessary gets removed.
@private
@param {string} soundcloudUrl the url to normalize
@returns {string} the normalized soundcloud url | [
"Get",
"the",
"normalized",
"soundcloud",
"url",
".",
"This",
"means",
"that",
"every",
"parameter",
"or",
"path",
"which",
"is",
"not",
"necessary",
"gets",
"removed",
"."
] | e20e0cf1ba93eac47f830c4b8693f13c4ca2588b | https://github.com/feedm3/hypem-resolver/blob/e20e0cf1ba93eac47f830c4b8693f13c4ca2588b/hypem-resolver.js#L176-L184 | train |
mrself/ya-del | del.js | function(options) {
this.DelOptions = $.extend({}, defaults, this.DelOptions, options);
this.dName = this.DelOptions.dName || this._name;
this.selector = this.selector || '.' + this.dName;
this.namespace = this.DelOptions.namespace || this.dName;
this.initEl();
} | javascript | function(options) {
this.DelOptions = $.extend({}, defaults, this.DelOptions, options);
this.dName = this.DelOptions.dName || this._name;
this.selector = this.selector || '.' + this.dName;
this.namespace = this.DelOptions.namespace || this.dName;
this.initEl();
} | [
"function",
"(",
"options",
")",
"{",
"this",
".",
"DelOptions",
"=",
"$",
".",
"extend",
"(",
"{",
"}",
",",
"defaults",
",",
"this",
".",
"DelOptions",
",",
"options",
")",
";",
"this",
".",
"dName",
"=",
"this",
".",
"DelOptions",
".",
"dName",
... | Init del module
@param {Object} options
@param {String} [options.dName]
@param {String} [options.namespace] Namespace
@param {jQuery|DOMElement} [options.$el] | [
"Init",
"del",
"module"
] | 11f8bff925f4df385a79e74f5d53830b20447b17 | https://github.com/mrself/ya-del/blob/11f8bff925f4df385a79e74f5d53830b20447b17/del.js#L23-L29 | train | |
mrself/ya-del | del.js | function(el) {
return (el instanceof $ ? el : $(el)).find(this.makeSelector.apply(this, [].slice.call(arguments, 1)));
} | javascript | function(el) {
return (el instanceof $ ? el : $(el)).find(this.makeSelector.apply(this, [].slice.call(arguments, 1)));
} | [
"function",
"(",
"el",
")",
"{",
"return",
"(",
"el",
"instanceof",
"$",
"?",
"el",
":",
"$",
"(",
"el",
")",
")",
".",
"find",
"(",
"this",
".",
"makeSelector",
".",
"apply",
"(",
"this",
",",
"[",
"]",
".",
"slice",
".",
"call",
"(",
"argumen... | Find element in other el
@param {jQuery|string|DOMElement} el el to find in
@param {string|array} element name
@return {jQuery} | [
"Find",
"element",
"in",
"other",
"el"
] | 11f8bff925f4df385a79e74f5d53830b20447b17 | https://github.com/mrself/ya-del/blob/11f8bff925f4df385a79e74f5d53830b20447b17/del.js#L79-L81 | train | |
gabrielcsapo/krayon | util.js | parse | function parse (code) {
Object.keys(syntax).forEach((s) => {
code = code.replace(syntax[s], (_, m) => {
// ensure if the regex only matches part of the string that we keep the leftover
let leftOver = _.replace(m, '')
// encode the string and class
let parsed = `{#${s}#${encode(m)}#}`
... | javascript | function parse (code) {
Object.keys(syntax).forEach((s) => {
code = code.replace(syntax[s], (_, m) => {
// ensure if the regex only matches part of the string that we keep the leftover
let leftOver = _.replace(m, '')
// encode the string and class
let parsed = `{#${s}#${encode(m)}#}`
... | [
"function",
"parse",
"(",
"code",
")",
"{",
"Object",
".",
"keys",
"(",
"syntax",
")",
".",
"forEach",
"(",
"(",
"s",
")",
"=>",
"{",
"code",
"=",
"code",
".",
"replace",
"(",
"syntax",
"[",
"s",
"]",
",",
"(",
"_",
",",
"m",
")",
"=>",
"{",
... | walks through the syntaxes that we have and tokenizes the entities that correspond
@method parse
@param {String} code - raw code string
@return {String} - encoded code string | [
"walks",
"through",
"the",
"syntaxes",
"that",
"we",
"have",
"and",
"tokenizes",
"the",
"entities",
"that",
"correspond"
] | 3a97cd33715a6e2fe5d9cac3c8c6a7e6e15d43c2 | https://github.com/gabrielcsapo/krayon/blob/3a97cd33715a6e2fe5d9cac3c8c6a7e6e15d43c2/util.js#L48-L83 | train |
gabrielcsapo/krayon | util.js | encode | function encode (str) {
return str.split('').map((s) => {
if (s.charCodeAt(0) > 127) return s
return String.fromCharCode(s.charCodeAt(0) + 0x2800)
}).join(' ')
} | javascript | function encode (str) {
return str.split('').map((s) => {
if (s.charCodeAt(0) > 127) return s
return String.fromCharCode(s.charCodeAt(0) + 0x2800)
}).join(' ')
} | [
"function",
"encode",
"(",
"str",
")",
"{",
"return",
"str",
".",
"split",
"(",
"''",
")",
".",
"map",
"(",
"(",
"s",
")",
"=>",
"{",
"if",
"(",
"s",
".",
"charCodeAt",
"(",
"0",
")",
">",
"127",
")",
"return",
"s",
"return",
"String",
".",
"... | encode utf8 string to braile
@method encode
@param {String} str - utf8 string
@return {String} - brailed encoded string | [
"encode",
"utf8",
"string",
"to",
"braile"
] | 3a97cd33715a6e2fe5d9cac3c8c6a7e6e15d43c2 | https://github.com/gabrielcsapo/krayon/blob/3a97cd33715a6e2fe5d9cac3c8c6a7e6e15d43c2/util.js#L91-L96 | train |
gabrielcsapo/krayon | util.js | decode | function decode (str) {
return str.trim().split(' ').map((s) => {
if (s.charCodeAt(0) - 0x2800 > 127) return s
return String.fromCharCode(s.charCodeAt(0) - 0x2800)
}).join('')
} | javascript | function decode (str) {
return str.trim().split(' ').map((s) => {
if (s.charCodeAt(0) - 0x2800 > 127) return s
return String.fromCharCode(s.charCodeAt(0) - 0x2800)
}).join('')
} | [
"function",
"decode",
"(",
"str",
")",
"{",
"return",
"str",
".",
"trim",
"(",
")",
".",
"split",
"(",
"' '",
")",
".",
"map",
"(",
"(",
"s",
")",
"=>",
"{",
"if",
"(",
"s",
".",
"charCodeAt",
"(",
"0",
")",
"-",
"0x2800",
">",
"127",
")",
... | decode brail back to utf8
@method decode
@param {String} str - brail string
@return {String} - utf8 decoded string | [
"decode",
"brail",
"back",
"to",
"utf8"
] | 3a97cd33715a6e2fe5d9cac3c8c6a7e6e15d43c2 | https://github.com/gabrielcsapo/krayon/blob/3a97cd33715a6e2fe5d9cac3c8c6a7e6e15d43c2/util.js#L104-L109 | train |
ForbesLindesay-Unmaintained/sauce-test | lib/run-browsers-bail.js | runBrowsersBail | function runBrowsersBail(location, remote, platforms, options) {
var throttle = options.throttle || function (fn) { return fn(); };
var results = [];
results.passedBrowsers = [];
results.failedBrowsers = [];
return new Promise(function (resolve) {
function next(i) {
if (i >= platforms.length) {
... | javascript | function runBrowsersBail(location, remote, platforms, options) {
var throttle = options.throttle || function (fn) { return fn(); };
var results = [];
results.passedBrowsers = [];
results.failedBrowsers = [];
return new Promise(function (resolve) {
function next(i) {
if (i >= platforms.length) {
... | [
"function",
"runBrowsersBail",
"(",
"location",
",",
"remote",
",",
"platforms",
",",
"options",
")",
"{",
"var",
"throttle",
"=",
"options",
".",
"throttle",
"||",
"function",
"(",
"fn",
")",
"{",
"return",
"fn",
"(",
")",
";",
"}",
";",
"var",
"resul... | Run a test in a series of browsers, one at at time until one of them fails
@option {Function} throttle
@option {Object} capabilities
@option {Boolean} debug
@option {Object|Function} jobInfo
@option {Boolean} allowExceptions
@option {String|Function} testComplete
@option {String|Functio... | [
"Run",
"a",
"test",
"in",
"a",
"series",
"of",
"browsers",
"one",
"at",
"at",
"time",
"until",
"one",
"of",
"them",
"fails"
] | 7c671b3321dc63aefc00c1c8d49e943ead2e7f5e | https://github.com/ForbesLindesay-Unmaintained/sauce-test/blob/7c671b3321dc63aefc00c1c8d49e943ead2e7f5e/lib/run-browsers-bail.js#L32-L83 | train |
danheberden/bear | lib/bear.js | function() {
var bear = this;
// don't bind until we're ready
var srv = bear.ready.then( function() {
var dfd = _.Deferred();
// only make once
if ( !bear.githInstance ) {
bear.githInstance = bear.gith({
repo: bear.settings.repo,
}).on( 'all', bear._processPayload... | javascript | function() {
var bear = this;
// don't bind until we're ready
var srv = bear.ready.then( function() {
var dfd = _.Deferred();
// only make once
if ( !bear.githInstance ) {
bear.githInstance = bear.gith({
repo: bear.settings.repo,
}).on( 'all', bear._processPayload... | [
"function",
"(",
")",
"{",
"var",
"bear",
"=",
"this",
";",
"// don't bind until we're ready",
"var",
"srv",
"=",
"bear",
".",
"ready",
".",
"then",
"(",
"function",
"(",
")",
"{",
"var",
"dfd",
"=",
"_",
".",
"Deferred",
"(",
")",
";",
"// only make o... | but this is where the gold is | [
"but",
"this",
"is",
"where",
"the",
"gold",
"is"
] | c712108a0fe0ba105e9f65e925f9918b25ecec5c | https://github.com/danheberden/bear/blob/c712108a0fe0ba105e9f65e925f9918b25ecec5c/lib/bear.js#L187-L203 | train | |
danheberden/bear | lib/bear.js | function( payload ) {
var bear = this;
var dfd = _.Deferred();
var action = dfd.promise();
// ok to launch live?
if ( payload.branch === bear.settings.liveBranch ) {
// can we just upload master without worrying about tags?
if ( !bear.settings.deployOnTag ) {
action = action.th... | javascript | function( payload ) {
var bear = this;
var dfd = _.Deferred();
var action = dfd.promise();
// ok to launch live?
if ( payload.branch === bear.settings.liveBranch ) {
// can we just upload master without worrying about tags?
if ( !bear.settings.deployOnTag ) {
action = action.th... | [
"function",
"(",
"payload",
")",
"{",
"var",
"bear",
"=",
"this",
";",
"var",
"dfd",
"=",
"_",
".",
"Deferred",
"(",
")",
";",
"var",
"action",
"=",
"dfd",
".",
"promise",
"(",
")",
";",
"// ok to launch live?",
"if",
"(",
"payload",
".",
"branch",
... | process the payload gith emitted | [
"process",
"the",
"payload",
"gith",
"emitted"
] | c712108a0fe0ba105e9f65e925f9918b25ecec5c | https://github.com/danheberden/bear/blob/c712108a0fe0ba105e9f65e925f9918b25ecec5c/lib/bear.js#L206-L240 | train | |
danheberden/bear | lib/bear.js | function() {
return dexec( 'cd ' + this.settings.git + '; npm install' ).done(function( stdout, stderr ) {
log( 'npm install successful' );
log.extra( stdout, stderr );
});
} | javascript | function() {
return dexec( 'cd ' + this.settings.git + '; npm install' ).done(function( stdout, stderr ) {
log( 'npm install successful' );
log.extra( stdout, stderr );
});
} | [
"function",
"(",
")",
"{",
"return",
"dexec",
"(",
"'cd '",
"+",
"this",
".",
"settings",
".",
"git",
"+",
"'; npm install'",
")",
".",
"done",
"(",
"function",
"(",
"stdout",
",",
"stderr",
")",
"{",
"log",
"(",
"'npm install successful'",
")",
";",
"... | hook into our process | [
"hook",
"into",
"our",
"process"
] | c712108a0fe0ba105e9f65e925f9918b25ecec5c | https://github.com/danheberden/bear/blob/c712108a0fe0ba105e9f65e925f9918b25ecec5c/lib/bear.js#L268-L273 | train | |
sfrdmn/node-randword | index.js | textStream | function textStream() {
var start = randomInt(0, config.size - bufferSize)
return fs.createReadStream(dictPath, {
encoding: config.encoding,
start: start,
end: start + bufferSize
})
} | javascript | function textStream() {
var start = randomInt(0, config.size - bufferSize)
return fs.createReadStream(dictPath, {
encoding: config.encoding,
start: start,
end: start + bufferSize
})
} | [
"function",
"textStream",
"(",
")",
"{",
"var",
"start",
"=",
"randomInt",
"(",
"0",
",",
"config",
".",
"size",
"-",
"bufferSize",
")",
"return",
"fs",
".",
"createReadStream",
"(",
"dictPath",
",",
"{",
"encoding",
":",
"config",
".",
"encoding",
",",
... | read dictionary with stream | [
"read",
"dictionary",
"with",
"stream"
] | cab6611aa44c4b572ba405e266f0a4f736a21e3d | https://github.com/sfrdmn/node-randword/blob/cab6611aa44c4b572ba405e266f0a4f736a21e3d/index.js#L12-L19 | train |
transomjs/transom-socketio-internal | lib/socket-io-handler.js | SocketioHandler | function SocketioHandler(io, options) {
/**
* Emit 'data' to all sockets for the provided User or array of Users.
*
* @param {*} channelName
* @param {*} users
* @param {*} data
*/
function emitToUsers(users, channelName, data) {
const usersArray = Array.isArray(users)... | javascript | function SocketioHandler(io, options) {
/**
* Emit 'data' to all sockets for the provided User or array of Users.
*
* @param {*} channelName
* @param {*} users
* @param {*} data
*/
function emitToUsers(users, channelName, data) {
const usersArray = Array.isArray(users)... | [
"function",
"SocketioHandler",
"(",
"io",
",",
"options",
")",
"{",
"/**\n * Emit 'data' to all sockets for the provided User or array of Users.\n * \n * @param {*} channelName \n * @param {*} users \n * @param {*} data \n */",
"function",
"emitToUsers",
"(",
"users",... | Module for the socket handler. Exports this function that creates the instance of the handler.
which is added to the server registry as 'transomMessageClient'
@param {*} io the initialized SocketIO server
@param {*} options The socketHandler options object | [
"Module",
"for",
"the",
"socket",
"handler",
".",
"Exports",
"this",
"function",
"that",
"creates",
"the",
"instance",
"of",
"the",
"handler",
".",
"which",
"is",
"added",
"to",
"the",
"server",
"registry",
"as",
"transomMessageClient"
] | 24932b1f3614ec3d234ff8654f63f15b395126e8 | https://github.com/transomjs/transom-socketio-internal/blob/24932b1f3614ec3d234ff8654f63f15b395126e8/lib/socket-io-handler.js#L10-L52 | train |
transomjs/transom-socketio-internal | lib/socket-io-handler.js | emitToUsers | function emitToUsers(users, channelName, data) {
const usersArray = Array.isArray(users) ? users : [users];
usersArray.map(function (user) {
Object.keys(io.sockets.sockets).filter(function (key) {
return io.sockets.sockets[key].transomUser._id.toString() === user._id.toString... | javascript | function emitToUsers(users, channelName, data) {
const usersArray = Array.isArray(users) ? users : [users];
usersArray.map(function (user) {
Object.keys(io.sockets.sockets).filter(function (key) {
return io.sockets.sockets[key].transomUser._id.toString() === user._id.toString... | [
"function",
"emitToUsers",
"(",
"users",
",",
"channelName",
",",
"data",
")",
"{",
"const",
"usersArray",
"=",
"Array",
".",
"isArray",
"(",
"users",
")",
"?",
"users",
":",
"[",
"users",
"]",
";",
"usersArray",
".",
"map",
"(",
"function",
"(",
"user... | Emit 'data' to all sockets for the provided User or array of Users.
@param {*} channelName
@param {*} users
@param {*} data | [
"Emit",
"data",
"to",
"all",
"sockets",
"for",
"the",
"provided",
"User",
"or",
"array",
"of",
"Users",
"."
] | 24932b1f3614ec3d234ff8654f63f15b395126e8 | https://github.com/transomjs/transom-socketio-internal/blob/24932b1f3614ec3d234ff8654f63f15b395126e8/lib/socket-io-handler.js#L19-L28 | train |
transomjs/transom-socketio-internal | lib/socket-io-handler.js | emitToEveryone | function emitToEveryone(channelName, data) {
Object.keys(io.sockets.sockets).filter(function (key) {
return !!io.sockets.sockets[key].transomUser;
}).map(function (socketKey) {
io.sockets.sockets[socketKey].emit(channelName, data);
});
} | javascript | function emitToEveryone(channelName, data) {
Object.keys(io.sockets.sockets).filter(function (key) {
return !!io.sockets.sockets[key].transomUser;
}).map(function (socketKey) {
io.sockets.sockets[socketKey].emit(channelName, data);
});
} | [
"function",
"emitToEveryone",
"(",
"channelName",
",",
"data",
")",
"{",
"Object",
".",
"keys",
"(",
"io",
".",
"sockets",
".",
"sockets",
")",
".",
"filter",
"(",
"function",
"(",
"key",
")",
"{",
"return",
"!",
"!",
"io",
".",
"sockets",
".",
"sock... | Emit 'data' to all sockets for the authenticated Users.
@param {*} channelName
@param {*} data | [
"Emit",
"data",
"to",
"all",
"sockets",
"for",
"the",
"authenticated",
"Users",
"."
] | 24932b1f3614ec3d234ff8654f63f15b395126e8 | https://github.com/transomjs/transom-socketio-internal/blob/24932b1f3614ec3d234ff8654f63f15b395126e8/lib/socket-io-handler.js#L36-L42 | train |
skerit/alchemy-styleboost | public/ckeditor/4.4dev/plugins/floatingspace/plugin.js | updatePos | function updatePos( pos, prop, val ) {
floatSpace.setStyle( prop, pixelate( val ) );
floatSpace.setStyle( 'position', pos );
} | javascript | function updatePos( pos, prop, val ) {
floatSpace.setStyle( prop, pixelate( val ) );
floatSpace.setStyle( 'position', pos );
} | [
"function",
"updatePos",
"(",
"pos",
",",
"prop",
",",
"val",
")",
"{",
"floatSpace",
".",
"setStyle",
"(",
"prop",
",",
"pixelate",
"(",
"val",
")",
")",
";",
"floatSpace",
".",
"setStyle",
"(",
"'position'",
",",
"pos",
")",
";",
"}"
] | Update the float space position. | [
"Update",
"the",
"float",
"space",
"position",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/floatingspace/plugin.js#L49-L52 | train |
skerit/alchemy-styleboost | public/ckeditor/4.4dev/plugins/floatingspace/plugin.js | changeMode | function changeMode( newMode ) {
var editorPos = editable.getDocumentPosition();
switch ( newMode ) {
case 'top':
updatePos( 'absolute', 'top', editorPos.y - spaceHeight - dockedOffsetY );
break;
case 'pin':
updatePos( 'fixed', 'top', pinnedOffsetY );
break;
... | javascript | function changeMode( newMode ) {
var editorPos = editable.getDocumentPosition();
switch ( newMode ) {
case 'top':
updatePos( 'absolute', 'top', editorPos.y - spaceHeight - dockedOffsetY );
break;
case 'pin':
updatePos( 'fixed', 'top', pinnedOffsetY );
break;
... | [
"function",
"changeMode",
"(",
"newMode",
")",
"{",
"var",
"editorPos",
"=",
"editable",
".",
"getDocumentPosition",
"(",
")",
";",
"switch",
"(",
"newMode",
")",
"{",
"case",
"'top'",
":",
"updatePos",
"(",
"'absolute'",
",",
"'top'",
",",
"editorPos",
".... | Change the current mode and update float space position accordingly. | [
"Change",
"the",
"current",
"mode",
"and",
"update",
"float",
"space",
"position",
"accordingly",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/floatingspace/plugin.js#L55-L71 | train |
agneta/angularjs | source/ui/gallery/photoswipe.module.js | function(e) {
e = e || window.event;
e.preventDefault ? e.preventDefault() : (e.returnValue = false);
var eTarget = e.target || e.srcElement;
// find root element of slide
var clickedListItem = closest(eTarget, function(el) {
//console.log(el.getAttribute('ui-gallery-item'));
return el... | javascript | function(e) {
e = e || window.event;
e.preventDefault ? e.preventDefault() : (e.returnValue = false);
var eTarget = e.target || e.srcElement;
// find root element of slide
var clickedListItem = closest(eTarget, function(el) {
//console.log(el.getAttribute('ui-gallery-item'));
return el... | [
"function",
"(",
"e",
")",
"{",
"e",
"=",
"e",
"||",
"window",
".",
"event",
";",
"e",
".",
"preventDefault",
"?",
"e",
".",
"preventDefault",
"(",
")",
":",
"(",
"e",
".",
"returnValue",
"=",
"false",
")",
";",
"var",
"eTarget",
"=",
"e",
".",
... | triggers when user clicks on thumbnail | [
"triggers",
"when",
"user",
"clicks",
"on",
"thumbnail"
] | 25fa30337a609b4f79948d7f1b86f8d49208a417 | https://github.com/agneta/angularjs/blob/25fa30337a609b4f79948d7f1b86f8d49208a417/source/ui/gallery/photoswipe.module.js#L60-L109 | train | |
alonbardavid/coffee-script-mapped | lib/source-map-support.js | handleUncaughtExceptions | function handleUncaughtExceptions(error) {
if (!error || !error.stack) {
console.log('Uncaught exception:', error);
process.exit();
}
var match = /\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error.stack);
if (match) {
var cache = {};
var position = mapSourcePosition(cache, {
source: match[1]... | javascript | function handleUncaughtExceptions(error) {
if (!error || !error.stack) {
console.log('Uncaught exception:', error);
process.exit();
}
var match = /\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error.stack);
if (match) {
var cache = {};
var position = mapSourcePosition(cache, {
source: match[1]... | [
"function",
"handleUncaughtExceptions",
"(",
"error",
")",
"{",
"if",
"(",
"!",
"error",
"||",
"!",
"error",
".",
"stack",
")",
"{",
"console",
".",
"log",
"(",
"'Uncaught exception:'",
",",
"error",
")",
";",
"process",
".",
"exit",
"(",
")",
";",
"}"... | Mimic node's stack trace printing when an exception escapes the process | [
"Mimic",
"node",
"s",
"stack",
"trace",
"printing",
"when",
"an",
"exception",
"escapes",
"the",
"process"
] | c658ca79ab24800ab5bbde6e56343cfa4a5e6dfe | https://github.com/alonbardavid/coffee-script-mapped/blob/c658ca79ab24800ab5bbde6e56343cfa4a5e6dfe/lib/source-map-support.js#L127-L152 | train |
JohnnieFucker/dreamix-admin | lib/master/masterAgent.js | broadcastMonitors | function broadcastMonitors(records, moduleId, msg) {
msg = protocol.composeRequest(null, moduleId, msg);
if (records instanceof Array) {
for (let i = 0, l = records.length; i < l; i++) {
const socket = records[i].socket;
doSend(socket, 'monitor', msg);
}
} else {
... | javascript | function broadcastMonitors(records, moduleId, msg) {
msg = protocol.composeRequest(null, moduleId, msg);
if (records instanceof Array) {
for (let i = 0, l = records.length; i < l; i++) {
const socket = records[i].socket;
doSend(socket, 'monitor', msg);
}
} else {
... | [
"function",
"broadcastMonitors",
"(",
"records",
",",
"moduleId",
",",
"msg",
")",
"{",
"msg",
"=",
"protocol",
".",
"composeRequest",
"(",
"null",
",",
"moduleId",
",",
"msg",
")",
";",
"if",
"(",
"records",
"instanceof",
"Array",
")",
"{",
"for",
"(",
... | broadcast msg to monitor
@param {Object} records registered modules
@param {String} moduleId module id/name
@param {Object} msg message
@api private | [
"broadcast",
"msg",
"to",
"monitor"
] | fc169e2481d5a7456725fb33f7a7907e0776ef79 | https://github.com/JohnnieFucker/dreamix-admin/blob/fc169e2481d5a7456725fb33f7a7907e0776ef79/lib/master/masterAgent.js#L137-L153 | train |
OctaveWealth/passy | lib/baseURL.js | getChar | function getChar (bits) {
var index = parseInt(bits,2);
if (isNaN(index) || index < 0 || index > 63) throw new Error('baseURL#getChar: Need valid bitString');
return ALPHABET[index];
} | javascript | function getChar (bits) {
var index = parseInt(bits,2);
if (isNaN(index) || index < 0 || index > 63) throw new Error('baseURL#getChar: Need valid bitString');
return ALPHABET[index];
} | [
"function",
"getChar",
"(",
"bits",
")",
"{",
"var",
"index",
"=",
"parseInt",
"(",
"bits",
",",
"2",
")",
";",
"if",
"(",
"isNaN",
"(",
"index",
")",
"||",
"index",
"<",
"0",
"||",
"index",
">",
"63",
")",
"throw",
"new",
"Error",
"(",
"'baseURL... | Get baseURL char from given 6bit bitstring
@param {string} bits 6bit bitstring
@return {string} baseURL char | [
"Get",
"baseURL",
"char",
"from",
"given",
"6bit",
"bitstring"
] | 6e357b018952f73e8570b89eda95393780328fab | https://github.com/OctaveWealth/passy/blob/6e357b018952f73e8570b89eda95393780328fab/lib/baseURL.js#L26-L30 | train |
OctaveWealth/passy | lib/baseURL.js | indexOfBits | function indexOfBits (char) {
var index = ALPHABET.indexOf(char);
if (index < 0) throw new Error('baseURL#indexOfBits: Need valid baseURL char');
return bitString.pad(index.toString(2), 6) ;
} | javascript | function indexOfBits (char) {
var index = ALPHABET.indexOf(char);
if (index < 0) throw new Error('baseURL#indexOfBits: Need valid baseURL char');
return bitString.pad(index.toString(2), 6) ;
} | [
"function",
"indexOfBits",
"(",
"char",
")",
"{",
"var",
"index",
"=",
"ALPHABET",
".",
"indexOf",
"(",
"char",
")",
";",
"if",
"(",
"index",
"<",
"0",
")",
"throw",
"new",
"Error",
"(",
"'baseURL#indexOfBits: Need valid baseURL char'",
")",
";",
"return",
... | Get 6bit bitstring given a baseURL char
@param {string} char Single baseURL char
@return {string} 6bit bitstring of 'indexof' (0-63) | [
"Get",
"6bit",
"bitstring",
"given",
"a",
"baseURL",
"char"
] | 6e357b018952f73e8570b89eda95393780328fab | https://github.com/OctaveWealth/passy/blob/6e357b018952f73e8570b89eda95393780328fab/lib/baseURL.js#L37-L41 | train |
OctaveWealth/passy | lib/baseURL.js | encode | function encode (bits) {
if (!bitString.isValid(bits)) throw new Error('baseURL#encode: bits not valid bitstring');
if (bits.length % 6 !== 0) throw new Error('baseURL#encode: bits must be a multiple of 6');
var result = '';
for (var i = 0; i < bits.length; i = i + 6) {
result += getChar(bits.slice(i, i + ... | javascript | function encode (bits) {
if (!bitString.isValid(bits)) throw new Error('baseURL#encode: bits not valid bitstring');
if (bits.length % 6 !== 0) throw new Error('baseURL#encode: bits must be a multiple of 6');
var result = '';
for (var i = 0; i < bits.length; i = i + 6) {
result += getChar(bits.slice(i, i + ... | [
"function",
"encode",
"(",
"bits",
")",
"{",
"if",
"(",
"!",
"bitString",
".",
"isValid",
"(",
"bits",
")",
")",
"throw",
"new",
"Error",
"(",
"'baseURL#encode: bits not valid bitstring'",
")",
";",
"if",
"(",
"bits",
".",
"length",
"%",
"6",
"!==",
"0",... | Encode a mod 6 bitstring into a baseURL string
@param {string} bits A mod 6 bitstring
@return {string} baseURL encoded string | [
"Encode",
"a",
"mod",
"6",
"bitstring",
"into",
"a",
"baseURL",
"string"
] | 6e357b018952f73e8570b89eda95393780328fab | https://github.com/OctaveWealth/passy/blob/6e357b018952f73e8570b89eda95393780328fab/lib/baseURL.js#L48-L57 | train |
OctaveWealth/passy | lib/baseURL.js | decode | function decode (str) {
if (!isValid(str)) throw new Error('baseURL#decode: str not valid baseURL string');
var bits = '';
// Decode
for (var i = 0; i < str.length; i++) {
bits += indexOfBits(str[i]);
}
return bits;
} | javascript | function decode (str) {
if (!isValid(str)) throw new Error('baseURL#decode: str not valid baseURL string');
var bits = '';
// Decode
for (var i = 0; i < str.length; i++) {
bits += indexOfBits(str[i]);
}
return bits;
} | [
"function",
"decode",
"(",
"str",
")",
"{",
"if",
"(",
"!",
"isValid",
"(",
"str",
")",
")",
"throw",
"new",
"Error",
"(",
"'baseURL#decode: str not valid baseURL string'",
")",
";",
"var",
"bits",
"=",
"''",
";",
"// Decode",
"for",
"(",
"var",
"i",
"="... | Decode a baseURL string to a mod 6 bitstring
@param {string} str A valid baseURL string
@return {string} A mod 6 bitstring | [
"Decode",
"a",
"baseURL",
"string",
"to",
"a",
"mod",
"6",
"bitstring"
] | 6e357b018952f73e8570b89eda95393780328fab | https://github.com/OctaveWealth/passy/blob/6e357b018952f73e8570b89eda95393780328fab/lib/baseURL.js#L75-L84 | train |
Pilatch/simple-component-v0 | index.js | simpleComponent | function simpleComponent(elementName, elementClass, elementClassToExtend) {
elementClass = elementClass || {}
elementClassToExtend = elementClassToExtend || HTMLElement
elementClass.prototype = Object.create(elementClassToExtend.prototype)
assign(elementClass.prototype, elementClass)
elementClass._... | javascript | function simpleComponent(elementName, elementClass, elementClassToExtend) {
elementClass = elementClass || {}
elementClassToExtend = elementClassToExtend || HTMLElement
elementClass.prototype = Object.create(elementClassToExtend.prototype)
assign(elementClass.prototype, elementClass)
elementClass._... | [
"function",
"simpleComponent",
"(",
"elementName",
",",
"elementClass",
",",
"elementClassToExtend",
")",
"{",
"elementClass",
"=",
"elementClass",
"||",
"{",
"}",
"elementClassToExtend",
"=",
"elementClassToExtend",
"||",
"HTMLElement",
"elementClass",
".",
"prototype"... | Define a stateless custom element with no behaviors.
Give the element's template an ID attribute with the "-template" suffix.
@module simpleComponent
@example
<template id="simple-bling-template">
<style>
simple-bling {
color: gold;
font-weight: bold;
}
</style>
</template>
<script>
simpleComponent('simple-bling')
</sc... | [
"Define",
"a",
"stateless",
"custom",
"element",
"with",
"no",
"behaviors",
".",
"Give",
"the",
"element",
"s",
"template",
"an",
"ID",
"attribute",
"with",
"the",
"-",
"template",
"suffix",
"."
] | da1f223a85beff68420f579e34a07f6b2851d734 | https://github.com/Pilatch/simple-component-v0/blob/da1f223a85beff68420f579e34a07f6b2851d734/index.js#L36-L56 | train |
Pilatch/simple-component-v0 | index.js | fill | function fill(toElement, templateElement) {
var templateContentClone = templateElement.content.cloneNode(true)
var slot
var i
if (toElement.childNodes.length) {
slot = templateContentClone.querySelector('slot')
if (slot) {
while (toElement.childNodes.length) {
slot.append... | javascript | function fill(toElement, templateElement) {
var templateContentClone = templateElement.content.cloneNode(true)
var slot
var i
if (toElement.childNodes.length) {
slot = templateContentClone.querySelector('slot')
if (slot) {
while (toElement.childNodes.length) {
slot.append... | [
"function",
"fill",
"(",
"toElement",
",",
"templateElement",
")",
"{",
"var",
"templateContentClone",
"=",
"templateElement",
".",
"content",
".",
"cloneNode",
"(",
"true",
")",
"var",
"slot",
"var",
"i",
"if",
"(",
"toElement",
".",
"childNodes",
".",
"len... | Attach a template's content to an element.
@public
@memberof module:simpleComponent
@param {HTMLElement} toElement The element to attach the template content to
@param {HTMLElement} template A template element that has the markup guts for the custom element.
@return {void} | [
"Attach",
"a",
"template",
"s",
"content",
"to",
"an",
"element",
"."
] | da1f223a85beff68420f579e34a07f6b2851d734 | https://github.com/Pilatch/simple-component-v0/blob/da1f223a85beff68420f579e34a07f6b2851d734/index.js#L66-L82 | train |
bryanwayb/js-html | lib/context.js | makeRequire | function makeRequire(m, self) {
function _require(_path) {
return m.require(_path);
}
_require.resolve = function(request) {
return _module._resolveFilename(request, self);
};
_require.cache = _module._cache;
_require.extensions = _module._extensions;
return _require;
} | javascript | function makeRequire(m, self) {
function _require(_path) {
return m.require(_path);
}
_require.resolve = function(request) {
return _module._resolveFilename(request, self);
};
_require.cache = _module._cache;
_require.extensions = _module._extensions;
return _require;
} | [
"function",
"makeRequire",
"(",
"m",
",",
"self",
")",
"{",
"function",
"_require",
"(",
"_path",
")",
"{",
"return",
"m",
".",
"require",
"(",
"_path",
")",
";",
"}",
"_require",
".",
"resolve",
"=",
"function",
"(",
"request",
")",
"{",
"return",
"... | Basically takes the place of Module.prototype._compile, with some features stripped out | [
"Basically",
"takes",
"the",
"place",
"of",
"Module",
".",
"prototype",
".",
"_compile",
"with",
"some",
"features",
"stripped",
"out"
] | 6cfb9bb73cc4609d3089da0eba6ed2b3c3ce4380 | https://github.com/bryanwayb/js-html/blob/6cfb9bb73cc4609d3089da0eba6ed2b3c3ce4380/lib/context.js#L88-L100 | train |
Industryswarm/isnode-mod-data | lib/mongodb/mongodb-core/lib/connection/pool.js | _connectionFailureHandler | function _connectionFailureHandler(self) {
return function() {
if (this._connectionFailHandled) return;
this._connectionFailHandled = true;
// Destroy the connection
this.destroy();
// Count down the number of reconnects
self.retriesLeft = self.retriesLeft - 1;
... | javascript | function _connectionFailureHandler(self) {
return function() {
if (this._connectionFailHandled) return;
this._connectionFailHandled = true;
// Destroy the connection
this.destroy();
// Count down the number of reconnects
self.retriesLeft = self.retriesLeft - 1;
... | [
"function",
"_connectionFailureHandler",
"(",
"self",
")",
"{",
"return",
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"_connectionFailHandled",
")",
"return",
";",
"this",
".",
"_connectionFailHandled",
"=",
"true",
";",
"// Destroy the connection",
"this",... | If we have failure schedule a retry | [
"If",
"we",
"have",
"failure",
"schedule",
"a",
"retry"
] | 5adc639b88a0d72cbeef23a6b5df7f4540745089 | https://github.com/Industryswarm/isnode-mod-data/blob/5adc639b88a0d72cbeef23a6b5df7f4540745089/lib/mongodb/mongodb-core/lib/connection/pool.js#L349-L376 | train |
Industryswarm/isnode-mod-data | lib/mongodb/mongodb-core/lib/connection/pool.js | _connectHandler | function _connectHandler(self) {
return function() {
// Assign
var connection = this;
// Pool destroyed stop the connection
if (self.state === DESTROYED || self.state === DESTROYING) {
return connection.destroy();
}
// Clear out all handlers
hand... | javascript | function _connectHandler(self) {
return function() {
// Assign
var connection = this;
// Pool destroyed stop the connection
if (self.state === DESTROYED || self.state === DESTROYING) {
return connection.destroy();
}
// Clear out all handlers
hand... | [
"function",
"_connectHandler",
"(",
"self",
")",
"{",
"return",
"function",
"(",
")",
"{",
"// Assign",
"var",
"connection",
"=",
"this",
";",
"// Pool destroyed stop the connection",
"if",
"(",
"self",
".",
"state",
"===",
"DESTROYED",
"||",
"self",
".",
"sta... | Got a connect handler | [
"Got",
"a",
"connect",
"handler"
] | 5adc639b88a0d72cbeef23a6b5df7f4540745089 | https://github.com/Industryswarm/isnode-mod-data/blob/5adc639b88a0d72cbeef23a6b5df7f4540745089/lib/mongodb/mongodb-core/lib/connection/pool.js#L379-L417 | train |
Industryswarm/isnode-mod-data | lib/mongodb/mongodb-core/lib/connection/pool.js | authenticateStragglers | function authenticateStragglers(self, connection, callback) {
// Get any non authenticated connections
var connections = self.nonAuthenticatedConnections.slice(0);
var nonAuthenticatedConnections = self.nonAuthenticatedConnections;
self.nonAuthenticatedConnections = [];
// Establish if th... | javascript | function authenticateStragglers(self, connection, callback) {
// Get any non authenticated connections
var connections = self.nonAuthenticatedConnections.slice(0);
var nonAuthenticatedConnections = self.nonAuthenticatedConnections;
self.nonAuthenticatedConnections = [];
// Establish if th... | [
"function",
"authenticateStragglers",
"(",
"self",
",",
"connection",
",",
"callback",
")",
"{",
"// Get any non authenticated connections",
"var",
"connections",
"=",
"self",
".",
"nonAuthenticatedConnections",
".",
"slice",
"(",
"0",
")",
";",
"var",
"nonAuthenticat... | Authenticate any straggler connections | [
"Authenticate",
"any",
"straggler",
"connections"
] | 5adc639b88a0d72cbeef23a6b5df7f4540745089 | https://github.com/Industryswarm/isnode-mod-data/blob/5adc639b88a0d72cbeef23a6b5df7f4540745089/lib/mongodb/mongodb-core/lib/connection/pool.js#L479-L526 | train |
Industryswarm/isnode-mod-data | lib/mongodb/mongodb-core/lib/connection/pool.js | authenticateLiveConnections | function authenticateLiveConnections(self, args, cb) {
// Get the current viable connections
var connections = self.allConnections();
// Allow nothing else to use the connections while we authenticate them
self.availableConnections = [];
self.inUseConnections = [];
self.connectingConnections = [... | javascript | function authenticateLiveConnections(self, args, cb) {
// Get the current viable connections
var connections = self.allConnections();
// Allow nothing else to use the connections while we authenticate them
self.availableConnections = [];
self.inUseConnections = [];
self.connectingConnections = [... | [
"function",
"authenticateLiveConnections",
"(",
"self",
",",
"args",
",",
"cb",
")",
"{",
"// Get the current viable connections",
"var",
"connections",
"=",
"self",
".",
"allConnections",
"(",
")",
";",
"// Allow nothing else to use the connections while we authenticate them... | Authenticate all live connections | [
"Authenticate",
"all",
"live",
"connections"
] | 5adc639b88a0d72cbeef23a6b5df7f4540745089 | https://github.com/Industryswarm/isnode-mod-data/blob/5adc639b88a0d72cbeef23a6b5df7f4540745089/lib/mongodb/mongodb-core/lib/connection/pool.js#L801-L851 | train |
Industryswarm/isnode-mod-data | lib/mongodb/mongodb-core/lib/connection/pool.js | waitForLogout | function waitForLogout(self, cb) {
if (!self.loggingout) return cb();
setTimeout(function() {
waitForLogout(self, cb);
}, 1);
} | javascript | function waitForLogout(self, cb) {
if (!self.loggingout) return cb();
setTimeout(function() {
waitForLogout(self, cb);
}, 1);
} | [
"function",
"waitForLogout",
"(",
"self",
",",
"cb",
")",
"{",
"if",
"(",
"!",
"self",
".",
"loggingout",
")",
"return",
"cb",
"(",
")",
";",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"waitForLogout",
"(",
"self",
",",
"cb",
")",
";",
"}",
",",... | Wait for a logout in process to happen | [
"Wait",
"for",
"a",
"logout",
"in",
"process",
"to",
"happen"
] | 5adc639b88a0d72cbeef23a6b5df7f4540745089 | https://github.com/Industryswarm/isnode-mod-data/blob/5adc639b88a0d72cbeef23a6b5df7f4540745089/lib/mongodb/mongodb-core/lib/connection/pool.js#L854-L859 | train |
Industryswarm/isnode-mod-data | lib/mongodb/mongodb-core/lib/connection/pool.js | function(_connection) {
return function() {
// Destroyed state return
if (self.state === DESTROYED || self.state === DESTROYING) {
// Remove the connection from the list
removeConnection(self, _connection);
return _connection.destroy();
}
// Destroy all event emitter... | javascript | function(_connection) {
return function() {
// Destroyed state return
if (self.state === DESTROYED || self.state === DESTROYING) {
// Remove the connection from the list
removeConnection(self, _connection);
return _connection.destroy();
}
// Destroy all event emitter... | [
"function",
"(",
"_connection",
")",
"{",
"return",
"function",
"(",
")",
"{",
"// Destroyed state return",
"if",
"(",
"self",
".",
"state",
"===",
"DESTROYED",
"||",
"self",
".",
"state",
"===",
"DESTROYING",
")",
"{",
"// Remove the connection from the list",
... | Handle successful connection | [
"Handle",
"successful",
"connection"
] | 5adc639b88a0d72cbeef23a6b5df7f4540745089 | https://github.com/Industryswarm/isnode-mod-data/blob/5adc639b88a0d72cbeef23a6b5df7f4540745089/lib/mongodb/mongodb-core/lib/connection/pool.js#L1336-L1382 | train | |
decanat/miscue | lib/miscue.js | Miscue | function Miscue(code, data) {
if (!(this instanceof Miscue))
return new Miscue(code, data);
return this.initialize(code, data);
} | javascript | function Miscue(code, data) {
if (!(this instanceof Miscue))
return new Miscue(code, data);
return this.initialize(code, data);
} | [
"function",
"Miscue",
"(",
"code",
",",
"data",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Miscue",
")",
")",
"return",
"new",
"Miscue",
"(",
"code",
",",
"data",
")",
";",
"return",
"this",
".",
"initialize",
"(",
"code",
",",
"data",
"... | Creates a new Miscue object
@constructor
@param {Number} code
@param {Mixed} data [optional]
@return {Object} | [
"Creates",
"a",
"new",
"Miscue",
"object"
] | 45e4cbbfe0868c81cb5a407e6139656b237e9191 | https://github.com/decanat/miscue/blob/45e4cbbfe0868c81cb5a407e6139656b237e9191/lib/miscue.js#L42-L47 | train |
meisterplayer/js-dev | gulp/eslint.js | createLint | function createLint(inPath, opts = {}) {
if (!inPath) {
throw new Error('Input path argument is required');
}
return function lint() {
return gulp.src(inPath)
.pipe(eslint(opts))
.pipe(eslint.format())
.pipe(eslint.failAfterError());
};
} | javascript | function createLint(inPath, opts = {}) {
if (!inPath) {
throw new Error('Input path argument is required');
}
return function lint() {
return gulp.src(inPath)
.pipe(eslint(opts))
.pipe(eslint.format())
.pipe(eslint.failAfterError());
};
} | [
"function",
"createLint",
"(",
"inPath",
",",
"opts",
"=",
"{",
"}",
")",
"{",
"if",
"(",
"!",
"inPath",
")",
"{",
"throw",
"new",
"Error",
"(",
"'Input path argument is required'",
")",
";",
"}",
"return",
"function",
"lint",
"(",
")",
"{",
"return",
... | Higher order function to create gulp function that lints files using eslint.
@param {string|string[]} inPath The globs to the files that need to be copied.
@param {Object} [opts={}] Options object to be passed to the gulp eslint plugin.
@return {function} Function that can be used as a gulp task. | [
"Higher",
"order",
"function",
"to",
"create",
"gulp",
"function",
"that",
"lints",
"files",
"using",
"eslint",
"."
] | c2646678c49dcdaa120ba3f24824da52b0c63e31 | https://github.com/meisterplayer/js-dev/blob/c2646678c49dcdaa120ba3f24824da52b0c63e31/gulp/eslint.js#L10-L21 | train |
angeloocana/joj-core | dist-esnext/Board.js | getStartEndRowsFromBoardSize | function getStartEndRowsFromBoardSize(boardSize) {
const endRow = boardSize.y - 1;
return {
white: getStartEndRow(endRow, false),
black: getStartEndRow(endRow, true)
};
} | javascript | function getStartEndRowsFromBoardSize(boardSize) {
const endRow = boardSize.y - 1;
return {
white: getStartEndRow(endRow, false),
black: getStartEndRow(endRow, true)
};
} | [
"function",
"getStartEndRowsFromBoardSize",
"(",
"boardSize",
")",
"{",
"const",
"endRow",
"=",
"boardSize",
".",
"y",
"-",
"1",
";",
"return",
"{",
"white",
":",
"getStartEndRow",
"(",
"endRow",
",",
"false",
")",
",",
"black",
":",
"getStartEndRow",
"(",
... | Takes a boardSize and return START and END rows for WHITE and BLACK.
returns { white:{startRow, endRow}, black:{startRow, endRow} } | [
"Takes",
"a",
"boardSize",
"and",
"return",
"START",
"and",
"END",
"rows",
"for",
"WHITE",
"and",
"BLACK",
"."
] | 14bc7801c004271cefafff6cc0abb0c3173c805a | https://github.com/angeloocana/joj-core/blob/14bc7801c004271cefafff6cc0abb0c3173c805a/dist-esnext/Board.js#L37-L43 | train |
angeloocana/joj-core | dist-esnext/Board.js | getJumpPosition | function getJumpPosition(from, toJump, board) {
const jumpXY = getJumpXY(from, toJump);
if (!hasPosition(board, jumpXY))
return;
const jumpPosition = getPositionFromBoard(board, jumpXY);
if (Position.hasPiece(jumpPosition))
return;
return jumpPosition;
} | javascript | function getJumpPosition(from, toJump, board) {
const jumpXY = getJumpXY(from, toJump);
if (!hasPosition(board, jumpXY))
return;
const jumpPosition = getPositionFromBoard(board, jumpXY);
if (Position.hasPiece(jumpPosition))
return;
return jumpPosition;
} | [
"function",
"getJumpPosition",
"(",
"from",
",",
"toJump",
",",
"board",
")",
"{",
"const",
"jumpXY",
"=",
"getJumpXY",
"(",
"from",
",",
"toJump",
")",
";",
"if",
"(",
"!",
"hasPosition",
"(",
"board",
",",
"jumpXY",
")",
")",
"return",
";",
"const",
... | Returns the target board position from a jump if this position exists and is empty. | [
"Returns",
"the",
"target",
"board",
"position",
"from",
"a",
"jump",
"if",
"this",
"position",
"exists",
"and",
"is",
"empty",
"."
] | 14bc7801c004271cefafff6cc0abb0c3173c805a | https://github.com/angeloocana/joj-core/blob/14bc7801c004271cefafff6cc0abb0c3173c805a/dist-esnext/Board.js#L284-L292 | train |
s-p-n/devez-node-gyp | lib/install.js | isValid | function isValid (path, entry) {
var isValid = valid(path)
if (isValid) {
log.verbose('extracted file from tarball', path)
extractCount++
} else {
// invalid
log.silly('ignoring from tarball', path)
}
return isValid
} | javascript | function isValid (path, entry) {
var isValid = valid(path)
if (isValid) {
log.verbose('extracted file from tarball', path)
extractCount++
} else {
// invalid
log.silly('ignoring from tarball', path)
}
return isValid
} | [
"function",
"isValid",
"(",
"path",
",",
"entry",
")",
"{",
"var",
"isValid",
"=",
"valid",
"(",
"path",
")",
"if",
"(",
"isValid",
")",
"{",
"log",
".",
"verbose",
"(",
"'extracted file from tarball'",
",",
"path",
")",
"extractCount",
"++",
"}",
"else"... | checks if a file to be extracted from the tarball is valid. only .h header files and the gyp files get extracted | [
"checks",
"if",
"a",
"file",
"to",
"be",
"extracted",
"from",
"the",
"tarball",
"is",
"valid",
".",
"only",
".",
"h",
"header",
"files",
"and",
"the",
"gyp",
"files",
"get",
"extracted"
] | a55f5b8c885c417e7d1ce0af5e16aabfaa6ed73e | https://github.com/s-p-n/devez-node-gyp/blob/a55f5b8c885c417e7d1ce0af5e16aabfaa6ed73e/lib/install.js#L155-L165 | train |
adoyle-h/config-sp | src/get.js | get | function get(path) {
var conf = this;
if (typeof path !== 'string') {
throw new Error('path should be a string!');
} else if (path.length === 0) {
throw new Error('path cannot be empty!');
}
var result = baseGet(conf, getPathArray(path));
if (result === undefined) {
thr... | javascript | function get(path) {
var conf = this;
if (typeof path !== 'string') {
throw new Error('path should be a string!');
} else if (path.length === 0) {
throw new Error('path cannot be empty!');
}
var result = baseGet(conf, getPathArray(path));
if (result === undefined) {
thr... | [
"function",
"get",
"(",
"path",
")",
"{",
"var",
"conf",
"=",
"this",
";",
"if",
"(",
"typeof",
"path",
"!==",
"'string'",
")",
"{",
"throw",
"new",
"Error",
"(",
"'path should be a string!'",
")",
";",
"}",
"else",
"if",
"(",
"path",
".",
"length",
... | Gets the property value at path of config.
If the resolved value is undefined, it will throw an error.
@param {String} path
@return {*}
@method get | [
"Gets",
"the",
"property",
"value",
"at",
"path",
"of",
"config",
".",
"If",
"the",
"resolved",
"value",
"is",
"undefined",
"it",
"will",
"throw",
"an",
"error",
"."
] | cdfefc1b1c292d834b1144695bb284f0e26a6a77 | https://github.com/adoyle-h/config-sp/blob/cdfefc1b1c292d834b1144695bb284f0e26a6a77/src/get.js#L64-L81 | train |
el-fuego/grunt-concat-properties | tasks/lib/reader.js | addProperty | function addProperty(sourceData, propertiesGroups, filePath) {
var group = propertiesUtils.getGroup(sourceData[2], propertiesGroups),
propertyName,
data,
propertyDefinitionWithoutObjectName;
if (!group) {
grunt.log.error('Object ' + sourceData[2] + ' wit... | javascript | function addProperty(sourceData, propertiesGroups, filePath) {
var group = propertiesUtils.getGroup(sourceData[2], propertiesGroups),
propertyName,
data,
propertyDefinitionWithoutObjectName;
if (!group) {
grunt.log.error('Object ' + sourceData[2] + ' wit... | [
"function",
"addProperty",
"(",
"sourceData",
",",
"propertiesGroups",
",",
"filePath",
")",
"{",
"var",
"group",
"=",
"propertiesUtils",
".",
"getGroup",
"(",
"sourceData",
"[",
"2",
"]",
",",
"propertiesGroups",
")",
",",
"propertyName",
",",
"data",
",",
... | Add property data to their properties group
@param sourceData {String}
@param propertiesGroups [{Object}]
@param filePath {String}
@returns {Object} | [
"Add",
"property",
"data",
"to",
"their",
"properties",
"group"
] | a7efad68106d81aec262deee12190c75952f09b3 | https://github.com/el-fuego/grunt-concat-properties/blob/a7efad68106d81aec262deee12190c75952f09b3/tasks/lib/reader.js#L64-L93 | train |
el-fuego/grunt-concat-properties | tasks/lib/reader.js | addJSONProperties | function addJSONProperties(jsonData, propertiesGroups, filePath, currentNamesPath) {
var i,
group,
propertyDefinition,
propertyDefinitionWithoutObjectName,
propertyName,
data;
if (currentNamesPath === undefined) {
currentNamesPath... | javascript | function addJSONProperties(jsonData, propertiesGroups, filePath, currentNamesPath) {
var i,
group,
propertyDefinition,
propertyDefinitionWithoutObjectName,
propertyName,
data;
if (currentNamesPath === undefined) {
currentNamesPath... | [
"function",
"addJSONProperties",
"(",
"jsonData",
",",
"propertiesGroups",
",",
"filePath",
",",
"currentNamesPath",
")",
"{",
"var",
"i",
",",
"group",
",",
"propertyDefinition",
",",
"propertyDefinitionWithoutObjectName",
",",
"propertyName",
",",
"data",
";",
"if... | Add JSON properties values to their properties group
@param jsonData {String}
@param propertiesGroups [{Object}]
@param filePath {String}
@param currentNamesPath {String}
@returns {Object} | [
"Add",
"JSON",
"properties",
"values",
"to",
"their",
"properties",
"group"
] | a7efad68106d81aec262deee12190c75952f09b3 | https://github.com/el-fuego/grunt-concat-properties/blob/a7efad68106d81aec262deee12190c75952f09b3/tasks/lib/reader.js#L104-L177 | train |
Gozala/fs-reduce | reader.js | onChunk | function onChunk(count) {
// If chunk read has no bytes than there is nothing left, so end a
// collection.
if (count === 0) return next(end)
// Move a offset `position` with `count` towards the end unless
// position was a `null` in which case we just keep it (`null` means
// from ... | javascript | function onChunk(count) {
// If chunk read has no bytes than there is nothing left, so end a
// collection.
if (count === 0) return next(end)
// Move a offset `position` with `count` towards the end unless
// position was a `null` in which case we just keep it (`null` means
// from ... | [
"function",
"onChunk",
"(",
"count",
")",
"{",
"// If chunk read has no bytes than there is nothing left, so end a",
"// collection.",
"if",
"(",
"count",
"===",
"0",
")",
"return",
"next",
"(",
"end",
")",
"// Move a offset `position` with `count` towards the end unless",
"/... | Function is used to read out given `count` bytes from the file starting from the current position. Note that `position` is captured. `onChunk` handler is invoked after reading a chunk of a file. | [
"Function",
"is",
"used",
"to",
"read",
"out",
"given",
"count",
"bytes",
"from",
"the",
"file",
"starting",
"from",
"the",
"current",
"position",
".",
"Note",
"that",
"position",
"is",
"captured",
".",
"onChunk",
"handler",
"is",
"invoked",
"after",
"readin... | 4b59070f0ccba17ce35ce419c27e83a2ec152d98 | https://github.com/Gozala/fs-reduce/blob/4b59070f0ccba17ce35ce419c27e83a2ec152d98/reader.js#L49-L65 | train |
Gozala/fs-reduce | reader.js | onDrain | function onDrain(value) {
state = value
// If value is marked as `reduced` no further reads should take place,
// as consumer has finished consumption.
if (isReduced(value)) return next(end)
// If current `position` has reached or passed `finish` mark end a
// collection.
else ... | javascript | function onDrain(value) {
state = value
// If value is marked as `reduced` no further reads should take place,
// as consumer has finished consumption.
if (isReduced(value)) return next(end)
// If current `position` has reached or passed `finish` mark end a
// collection.
else ... | [
"function",
"onDrain",
"(",
"value",
")",
"{",
"state",
"=",
"value",
"// If value is marked as `reduced` no further reads should take place,",
"// as consumer has finished consumption.",
"if",
"(",
"isReduced",
"(",
"value",
")",
")",
"return",
"next",
"(",
"end",
")",
... | Handler is invoked whenever consumer of the collection finished consumption of the previous chunk and can accept more data. It's also passed a new state value that is being accumulated. | [
"Handler",
"is",
"invoked",
"whenever",
"consumer",
"of",
"the",
"collection",
"finished",
"consumption",
"of",
"the",
"previous",
"chunk",
"and",
"can",
"accept",
"more",
"data",
".",
"It",
"s",
"also",
"passed",
"a",
"new",
"state",
"value",
"that",
"is",
... | 4b59070f0ccba17ce35ce419c27e83a2ec152d98 | https://github.com/Gozala/fs-reduce/blob/4b59070f0ccba17ce35ce419c27e83a2ec152d98/reader.js#L70-L86 | train |
RnbWd/parse-browserify | lib/relation.js | function(objects) {
if (!_.isArray(objects)) {
objects = [objects];
}
var change = new Parse.Op.Relation(objects, []);
this.parent.set(this.key, change);
this.targetClassName = change._targetClassName;
} | javascript | function(objects) {
if (!_.isArray(objects)) {
objects = [objects];
}
var change = new Parse.Op.Relation(objects, []);
this.parent.set(this.key, change);
this.targetClassName = change._targetClassName;
} | [
"function",
"(",
"objects",
")",
"{",
"if",
"(",
"!",
"_",
".",
"isArray",
"(",
"objects",
")",
")",
"{",
"objects",
"=",
"[",
"objects",
"]",
";",
"}",
"var",
"change",
"=",
"new",
"Parse",
".",
"Op",
".",
"Relation",
"(",
"objects",
",",
"[",
... | Adds a Parse.Object or an array of Parse.Objects to the relation.
@param {} objects The item or items to add. | [
"Adds",
"a",
"Parse",
".",
"Object",
"or",
"an",
"array",
"of",
"Parse",
".",
"Objects",
"to",
"the",
"relation",
"."
] | c19c1b798e4010a552e130b1a9ce3b5d084dc101 | https://github.com/RnbWd/parse-browserify/blob/c19c1b798e4010a552e130b1a9ce3b5d084dc101/lib/relation.js#L45-L53 | train | |
RnbWd/parse-browserify | lib/relation.js | function() {
var targetClass;
var query;
if (!this.targetClassName) {
targetClass = Parse.Object._getSubclass(this.parent.className);
query = new Parse.Query(targetClass);
query._extraOptions.redirectClassNameForKey = this.key;
} else {
targetClass = Parse.Object.... | javascript | function() {
var targetClass;
var query;
if (!this.targetClassName) {
targetClass = Parse.Object._getSubclass(this.parent.className);
query = new Parse.Query(targetClass);
query._extraOptions.redirectClassNameForKey = this.key;
} else {
targetClass = Parse.Object.... | [
"function",
"(",
")",
"{",
"var",
"targetClass",
";",
"var",
"query",
";",
"if",
"(",
"!",
"this",
".",
"targetClassName",
")",
"{",
"targetClass",
"=",
"Parse",
".",
"Object",
".",
"_getSubclass",
"(",
"this",
".",
"parent",
".",
"className",
")",
";"... | Returns a Parse.Query that is limited to objects in this
relation.
@return {Parse.Query} | [
"Returns",
"a",
"Parse",
".",
"Query",
"that",
"is",
"limited",
"to",
"objects",
"in",
"this",
"relation",
"."
] | c19c1b798e4010a552e130b1a9ce3b5d084dc101 | https://github.com/RnbWd/parse-browserify/blob/c19c1b798e4010a552e130b1a9ce3b5d084dc101/lib/relation.js#L82-L97 | train | |
blake-regalia/rapunzel.js | lib/main/index.js | function(s_line, s_close_delim, z_merge_delim) {
// open block
add(
s_line || '',
z_merge_delim,
true
);
// set close delim
s_close = ('string' === typeof s_close_delim)? s_close_delim: a_closers.slice(-1)[0];
a_closers.push(s_close);
// increase indentation
add.tabs +=... | javascript | function(s_line, s_close_delim, z_merge_delim) {
// open block
add(
s_line || '',
z_merge_delim,
true
);
// set close delim
s_close = ('string' === typeof s_close_delim)? s_close_delim: a_closers.slice(-1)[0];
a_closers.push(s_close);
// increase indentation
add.tabs +=... | [
"function",
"(",
"s_line",
",",
"s_close_delim",
",",
"z_merge_delim",
")",
"{",
"// open block",
"add",
"(",
"s_line",
"||",
"''",
",",
"z_merge_delim",
",",
"true",
")",
";",
"// set close delim",
"s_close",
"=",
"(",
"'string'",
"===",
"typeof",
"s_close_de... | block open helper | [
"block",
"open",
"helper"
] | bc8e231bf248eeaec6aa86f5c9f073d1fe615c1c | https://github.com/blake-regalia/rapunzel.js/blob/bc8e231bf248eeaec6aa86f5c9f073d1fe615c1c/lib/main/index.js#L176-L191 | train | |
adiwidjaja/frontend-pagebuilder | js/tinymce/plugins/paste/plugin.js | trimHtml | function trimHtml(html) {
function trimSpaces(all, s1, s2) {
// WebKit meant to preserve multiple spaces but instead inserted around all inline tags,
// including the spans with inline styles created on paste
if (!s1 && !s2) {
return ' ';
}
return '\u00a0'... | javascript | function trimHtml(html) {
function trimSpaces(all, s1, s2) {
// WebKit meant to preserve multiple spaces but instead inserted around all inline tags,
// including the spans with inline styles created on paste
if (!s1 && !s2) {
return ' ';
}
return '\u00a0'... | [
"function",
"trimHtml",
"(",
"html",
")",
"{",
"function",
"trimSpaces",
"(",
"all",
",",
"s1",
",",
"s2",
")",
"{",
"// WebKit meant to preserve multiple spaces but instead inserted around all inline tags,",
"// including the spans with inline styles created on paste",
"i... | Trims the specified HTML by removing all WebKit fragments, all elements wrapping the body trailing BR elements etc.
@param {String} html Html string to trim contents on.
@return {String} Html contents that got trimmed. | [
"Trims",
"the",
"specified",
"HTML",
"by",
"removing",
"all",
"WebKit",
"fragments",
"all",
"elements",
"wrapping",
"the",
"body",
"trailing",
"BR",
"elements",
"etc",
"."
] | a08caa06cd9f919d575eb68f0d6b56fdedfb7d0f | https://github.com/adiwidjaja/frontend-pagebuilder/blob/a08caa06cd9f919d575eb68f0d6b56fdedfb7d0f/js/tinymce/plugins/paste/plugin.js#L392-L412 | train |
adiwidjaja/frontend-pagebuilder | js/tinymce/plugins/paste/plugin.js | getDataTransferItems | function getDataTransferItems(dataTransfer) {
var items = {};
if (dataTransfer) {
// Use old WebKit/IE API
if (dataTransfer.getData) {
var legacyText = dataTransfer.getData('Text');
if (legacyText && legacyText.length > 0) {
if (legacyText.index... | javascript | function getDataTransferItems(dataTransfer) {
var items = {};
if (dataTransfer) {
// Use old WebKit/IE API
if (dataTransfer.getData) {
var legacyText = dataTransfer.getData('Text');
if (legacyText && legacyText.length > 0) {
if (legacyText.index... | [
"function",
"getDataTransferItems",
"(",
"dataTransfer",
")",
"{",
"var",
"items",
"=",
"{",
"}",
";",
"if",
"(",
"dataTransfer",
")",
"{",
"// Use old WebKit/IE API",
"if",
"(",
"dataTransfer",
".",
"getData",
")",
"{",
"var",
"legacyText",
"=",
"dataTransfer... | Gets various content types out of a datatransfer object.
@param {DataTransfer} dataTransfer Event fired on paste.
@return {Object} Object with mime types and data for those mime types. | [
"Gets",
"various",
"content",
"types",
"out",
"of",
"a",
"datatransfer",
"object",
"."
] | a08caa06cd9f919d575eb68f0d6b56fdedfb7d0f | https://github.com/adiwidjaja/frontend-pagebuilder/blob/a08caa06cd9f919d575eb68f0d6b56fdedfb7d0f/js/tinymce/plugins/paste/plugin.js#L1033-L1060 | train |
floriancargoet/jasmine-async-errors | index.js | function (originalIt) {
return function it(desc, cb) {
if (cb.length === 0) {
originalIt(desc, cb);
} else {
originalIt(desc, wrapInTryCatch(cb));
}
};
} | javascript | function (originalIt) {
return function it(desc, cb) {
if (cb.length === 0) {
originalIt(desc, cb);
} else {
originalIt(desc, wrapInTryCatch(cb));
}
};
} | [
"function",
"(",
"originalIt",
")",
"{",
"return",
"function",
"it",
"(",
"desc",
",",
"cb",
")",
"{",
"if",
"(",
"cb",
".",
"length",
"===",
"0",
")",
"{",
"originalIt",
"(",
"desc",
",",
"cb",
")",
";",
"}",
"else",
"{",
"originalIt",
"(",
"des... | wrap jasmine's "it" function so that each
test is wrapped in a trycatch handler | [
"wrap",
"jasmine",
"s",
"it",
"function",
"so",
"that",
"each",
"test",
"is",
"wrapped",
"in",
"a",
"trycatch",
"handler"
] | 496bccb0f6c7feb803bf2767cf7762d3cb0c5198 | https://github.com/floriancargoet/jasmine-async-errors/blob/496bccb0f6c7feb803bf2767cf7762d3cb0c5198/index.js#L28-L36 | train | |
michaelpb/elmoed | lib/adaptors/riotjs.js | mount | function mount(mountLocation, tagname, props) {
// return riot.mount(mountLocation, tagname, props)[0];
const id = makeUID(`riotjs_mount_${tagname}`);
const fauxTag = `<${tagname} data-elmoed-editor="${tagname}" id="${id}">
</${tagname}>`;
// Loop through all sub-mounted editors that might alre... | javascript | function mount(mountLocation, tagname, props) {
// return riot.mount(mountLocation, tagname, props)[0];
const id = makeUID(`riotjs_mount_${tagname}`);
const fauxTag = `<${tagname} data-elmoed-editor="${tagname}" id="${id}">
</${tagname}>`;
// Loop through all sub-mounted editors that might alre... | [
"function",
"mount",
"(",
"mountLocation",
",",
"tagname",
",",
"props",
")",
"{",
"// return riot.mount(mountLocation, tagname, props)[0];",
"const",
"id",
"=",
"makeUID",
"(",
"`",
"${",
"tagname",
"}",
"`",
")",
";",
"const",
"fauxTag",
"=",
"`",
"${",
"tag... | riot.js adaptor | [
"riot",
".",
"js",
"adaptor"
] | f1f51a06fb5c9703dcd36e320472572b311e2649 | https://github.com/michaelpb/elmoed/blob/f1f51a06fb5c9703dcd36e320472572b311e2649/lib/adaptors/riotjs.js#L25-L58 | train |
skerit/alchemy-styleboost | public/ckeditor/4.4dev/plugins/indent/plugin.js | function( editor, name, isIndent ) {
this.name = name;
this.editor = editor;
/**
* An object of jobs handled by the command. Each job consists
* of two functions: `refresh` and `exec` as well as the execution priority.
*
* * The `refresh` function determines whether a job is doable for... | javascript | function( editor, name, isIndent ) {
this.name = name;
this.editor = editor;
/**
* An object of jobs handled by the command. Each job consists
* of two functions: `refresh` and `exec` as well as the execution priority.
*
* * The `refresh` function determines whether a job is doable for... | [
"function",
"(",
"editor",
",",
"name",
",",
"isIndent",
")",
"{",
"this",
".",
"name",
"=",
"name",
";",
"this",
".",
"editor",
"=",
"editor",
";",
"/**\r\n\t\t\t * An object of jobs handled by the command. Each job consists\r\n\t\t\t * of two functions: `refresh` and `exe... | A base class for specific indentation command definitions responsible for
handling a pre-defined set of elements i.e. indentlist for lists or
indentblock for text block elements.
Commands of this class perform indentation operations and modify the DOM structure.
They listen for events fired by {@link CKEDITOR.plugins.... | [
"A",
"base",
"class",
"for",
"specific",
"indentation",
"command",
"definitions",
"responsible",
"for",
"handling",
"a",
"pre",
"-",
"defined",
"set",
"of",
"elements",
"i",
".",
"e",
".",
"indentlist",
"for",
"lists",
"or",
"indentblock",
"for",
"text",
"bl... | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/indent/plugin.js#L143-L236 | train | |
skerit/alchemy-styleboost | public/ckeditor/4.4dev/plugins/indent/plugin.js | function( editor, commands ) {
editor.on( 'pluginsLoaded', function() {
for ( var name in commands ) {
( function( editor, command ) {
var relatedGlobal = editor.getCommand( command.relatedGlobal );
for ( var priority in command.jobs ) {
// Observe generic exec event and execute c... | javascript | function( editor, commands ) {
editor.on( 'pluginsLoaded', function() {
for ( var name in commands ) {
( function( editor, command ) {
var relatedGlobal = editor.getCommand( command.relatedGlobal );
for ( var priority in command.jobs ) {
// Observe generic exec event and execute c... | [
"function",
"(",
"editor",
",",
"commands",
")",
"{",
"editor",
".",
"on",
"(",
"'pluginsLoaded'",
",",
"function",
"(",
")",
"{",
"for",
"(",
"var",
"name",
"in",
"commands",
")",
"{",
"(",
"function",
"(",
"editor",
",",
"command",
")",
"{",
"var",... | Registers content-specific commands as a part of the indentation system
directed by generic commands. Once a command is registered,
it listens for events of a related generic command.
CKEDITOR.plugins.indent.registerCommands( editor, {
'indentlist': new indentListCommand( editor, 'indentlist' ),
'outdentlist': new ind... | [
"Registers",
"content",
"-",
"specific",
"commands",
"as",
"a",
"part",
"of",
"the",
"indentation",
"system",
"directed",
"by",
"generic",
"commands",
".",
"Once",
"a",
"command",
"is",
"registered",
"it",
"listens",
"for",
"events",
"of",
"a",
"related",
"g... | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/indent/plugin.js#L261-L308 | train | |
skerit/alchemy-styleboost | public/ckeditor/4.4dev/plugins/indent/plugin.js | function( editor, priority ) {
var job = this.jobs[ priority ];
if ( job.state != TRISTATE_DISABLED )
return job.exec.call( this, editor );
} | javascript | function( editor, priority ) {
var job = this.jobs[ priority ];
if ( job.state != TRISTATE_DISABLED )
return job.exec.call( this, editor );
} | [
"function",
"(",
"editor",
",",
"priority",
")",
"{",
"var",
"job",
"=",
"this",
".",
"jobs",
"[",
"priority",
"]",
";",
"if",
"(",
"job",
".",
"state",
"!=",
"TRISTATE_DISABLED",
")",
"return",
"job",
".",
"exec",
".",
"call",
"(",
"this",
",",
"e... | Executes the content-specific procedure if the context is correct.
It calls the `exec` function of a job of the given `priority`
that modifies the DOM.
@param {CKEDITOR.editor} editor The editor instance this command
will be applied to.
@param {Number} priority The priority of the job to be executed.
@returns {Boolean... | [
"Executes",
"the",
"content",
"-",
"specific",
"procedure",
"if",
"the",
"context",
"is",
"correct",
".",
"It",
"calls",
"the",
"exec",
"function",
"of",
"a",
"job",
"of",
"the",
"given",
"priority",
"that",
"modifies",
"the",
"DOM",
"."
] | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/indent/plugin.js#L328-L333 | train | |
skerit/alchemy-styleboost | public/ckeditor/4.4dev/plugins/indent/plugin.js | setupGenericListeners | function setupGenericListeners( editor, command ) {
var selection, bookmarks;
// Set the command state according to content-specific
// command states.
command.on( 'refresh', function( evt ) {
// If no state comes with event data, disable command.
var states = [ TRISTATE_DISABLED ];
for ( va... | javascript | function setupGenericListeners( editor, command ) {
var selection, bookmarks;
// Set the command state according to content-specific
// command states.
command.on( 'refresh', function( evt ) {
// If no state comes with event data, disable command.
var states = [ TRISTATE_DISABLED ];
for ( va... | [
"function",
"setupGenericListeners",
"(",
"editor",
",",
"command",
")",
"{",
"var",
"selection",
",",
"bookmarks",
";",
"// Set the command state according to content-specific\r",
"// command states.\r",
"command",
".",
"on",
"(",
"'refresh'",
",",
"function",
"(",
"ev... | Attaches event listeners for this generic command. Since the indentation
system is event-oriented, generic commands communicate with
content-specific commands using the `exec` and `refresh` events.
Listener priorities are crucial. Different indentation phases
are executed with different priorities.
For the `exec` eve... | [
"Attaches",
"event",
"listeners",
"for",
"this",
"generic",
"command",
".",
"Since",
"the",
"indentation",
"system",
"is",
"event",
"-",
"oriented",
"generic",
"commands",
"communicate",
"with",
"content",
"-",
"specific",
"commands",
"using",
"the",
"exec",
"an... | 2b90b8a6afc9f065f785651292fb193940021d90 | https://github.com/skerit/alchemy-styleboost/blob/2b90b8a6afc9f065f785651292fb193940021d90/public/ckeditor/4.4dev/plugins/indent/plugin.js#L424-L461 | train |
j-/ok | ok.js | function (event, fn, context) {
this._events = this._events || {};
var e = this._events[event] || (this._events[event] = []);
e.push([fn, context]);
} | javascript | function (event, fn, context) {
this._events = this._events || {};
var e = this._events[event] || (this._events[event] = []);
e.push([fn, context]);
} | [
"function",
"(",
"event",
",",
"fn",
",",
"context",
")",
"{",
"this",
".",
"_events",
"=",
"this",
".",
"_events",
"||",
"{",
"}",
";",
"var",
"e",
"=",
"this",
".",
"_events",
"[",
"event",
"]",
"||",
"(",
"this",
".",
"_events",
"[",
"event",
... | Adds a callback to the event queue which is executed when an event fires
@param {string} event Event name
@param {Function} fn Callback function. Executed when event fires.
@param {*=} context Optional context to apply to callback | [
"Adds",
"a",
"callback",
"to",
"the",
"event",
"queue",
"which",
"is",
"executed",
"when",
"an",
"event",
"fires"
] | f1e4d9af3565574c5fdeccf4313972f2428cf3f8 | https://github.com/j-/ok/blob/f1e4d9af3565574c5fdeccf4313972f2428cf3f8/ok.js#L442-L446 | train | |
j-/ok | ok.js | function (obj, event, fn, context) {
var listeningTo = this._listeningTo || (this._listeningTo = {});
var id = obj._listenId || (obj._listenId = eventIndex++);
listeningTo[id] = obj;
if (!fn && typeof event === 'object') {
fn = this;
}
if (!context) {
context = this;
}
obj.on(event, fn, context);
... | javascript | function (obj, event, fn, context) {
var listeningTo = this._listeningTo || (this._listeningTo = {});
var id = obj._listenId || (obj._listenId = eventIndex++);
listeningTo[id] = obj;
if (!fn && typeof event === 'object') {
fn = this;
}
if (!context) {
context = this;
}
obj.on(event, fn, context);
... | [
"function",
"(",
"obj",
",",
"event",
",",
"fn",
",",
"context",
")",
"{",
"var",
"listeningTo",
"=",
"this",
".",
"_listeningTo",
"||",
"(",
"this",
".",
"_listeningTo",
"=",
"{",
"}",
")",
";",
"var",
"id",
"=",
"obj",
".",
"_listenId",
"||",
"("... | Observe another object by adding a callback to its event queue which is
executed when an event fires
@param {Events} obj Object to listen to
@param {string} event Event name
@param {Function} fn Callback function. Executed when event fires.
@param {*=} context Optional context to apply to callback | [
"Observe",
"another",
"object",
"by",
"adding",
"a",
"callback",
"to",
"its",
"event",
"queue",
"which",
"is",
"executed",
"when",
"an",
"event",
"fires"
] | f1e4d9af3565574c5fdeccf4313972f2428cf3f8 | https://github.com/j-/ok/blob/f1e4d9af3565574c5fdeccf4313972f2428cf3f8/ok.js#L455-L466 | train | |
j-/ok | ok.js | function (event, fn) {
this._events = this._events || {};
var e = this._events[event];
if (e) {
for (var i = 0, l = e.length; i < l; i++) {
if (e[i][0] === fn) {
e.splice(i, 1);
i--;
l--;
}
}
}
} | javascript | function (event, fn) {
this._events = this._events || {};
var e = this._events[event];
if (e) {
for (var i = 0, l = e.length; i < l; i++) {
if (e[i][0] === fn) {
e.splice(i, 1);
i--;
l--;
}
}
}
} | [
"function",
"(",
"event",
",",
"fn",
")",
"{",
"this",
".",
"_events",
"=",
"this",
".",
"_events",
"||",
"{",
"}",
";",
"var",
"e",
"=",
"this",
".",
"_events",
"[",
"event",
"]",
";",
"if",
"(",
"e",
")",
"{",
"for",
"(",
"var",
"i",
"=",
... | Removes a callback from the event queue
@param {string} event Event name
@param {Function} fn Callback function. No longer executed when event
fires. | [
"Removes",
"a",
"callback",
"from",
"the",
"event",
"queue"
] | f1e4d9af3565574c5fdeccf4313972f2428cf3f8 | https://github.com/j-/ok/blob/f1e4d9af3565574c5fdeccf4313972f2428cf3f8/ok.js#L473-L485 | train | |
j-/ok | ok.js | function (obj, event, fn) {
var listeningTo = this._listeningTo;
if (!listeningTo) {
return;
}
var remove = !event && !fn;
if (!fn && typeof event === 'object') {
fn = this;
}
if (obj) {
(listeningTo = {})[obj._listenId] = obj;
}
for (var id in listeningTo) {
obj = listeningTo[id];
obj.... | javascript | function (obj, event, fn) {
var listeningTo = this._listeningTo;
if (!listeningTo) {
return;
}
var remove = !event && !fn;
if (!fn && typeof event === 'object') {
fn = this;
}
if (obj) {
(listeningTo = {})[obj._listenId] = obj;
}
for (var id in listeningTo) {
obj = listeningTo[id];
obj.... | [
"function",
"(",
"obj",
",",
"event",
",",
"fn",
")",
"{",
"var",
"listeningTo",
"=",
"this",
".",
"_listeningTo",
";",
"if",
"(",
"!",
"listeningTo",
")",
"{",
"return",
";",
"}",
"var",
"remove",
"=",
"!",
"event",
"&&",
"!",
"fn",
";",
"if",
"... | Stop observing another object
@param {Events=} obj Object to stop observing. Omit to stop observing all
objects.
@param {string=} event Event name. Omit to stop observing all events on
this object.
@param {Function} fn Callback function. Stops this function executing
when `event` is triggered. | [
"Stop",
"observing",
"another",
"object"
] | f1e4d9af3565574c5fdeccf4313972f2428cf3f8 | https://github.com/j-/ok/blob/f1e4d9af3565574c5fdeccf4313972f2428cf3f8/ok.js#L495-L514 | train | |
j-/ok | ok.js | function (event/*, args... */) {
this._events = this._events || {};
var e = this._events[event];
if (e) {
for (var i = 0, l = e.length; i < l; i++){
e[i][0].apply(e[i][1] || this, slice(arguments, 1));
}
}
} | javascript | function (event/*, args... */) {
this._events = this._events || {};
var e = this._events[event];
if (e) {
for (var i = 0, l = e.length; i < l; i++){
e[i][0].apply(e[i][1] || this, slice(arguments, 1));
}
}
} | [
"function",
"(",
"event",
"/*, args... */",
")",
"{",
"this",
".",
"_events",
"=",
"this",
".",
"_events",
"||",
"{",
"}",
";",
"var",
"e",
"=",
"this",
".",
"_events",
"[",
"event",
"]",
";",
"if",
"(",
"e",
")",
"{",
"for",
"(",
"var",
"i",
"... | Trigger an event and execute all callbacks in the event queue
@param {string} event Event name
@param {...*} args Event arguments passed through to all callbacks | [
"Trigger",
"an",
"event",
"and",
"execute",
"all",
"callbacks",
"in",
"the",
"event",
"queue"
] | f1e4d9af3565574c5fdeccf4313972f2428cf3f8 | https://github.com/j-/ok/blob/f1e4d9af3565574c5fdeccf4313972f2428cf3f8/ok.js#L520-L528 | train | |
j-/ok | ok.js | Property | function Property (initValue) {
if (arguments.length) {
this.set(initValue);
}
else {
this.set(this.defaultValue);
}
ok.Data.apply(this, arguments);
} | javascript | function Property (initValue) {
if (arguments.length) {
this.set(initValue);
}
else {
this.set(this.defaultValue);
}
ok.Data.apply(this, arguments);
} | [
"function",
"Property",
"(",
"initValue",
")",
"{",
"if",
"(",
"arguments",
".",
"length",
")",
"{",
"this",
".",
"set",
"(",
"initValue",
")",
";",
"}",
"else",
"{",
"this",
".",
"set",
"(",
"this",
".",
"defaultValue",
")",
";",
"}",
"ok",
".",
... | Optionally initialize this property with a value
@param {*=} initValue Initial value for this property | [
"Optionally",
"initialize",
"this",
"property",
"with",
"a",
"value"
] | f1e4d9af3565574c5fdeccf4313972f2428cf3f8 | https://github.com/j-/ok/blob/f1e4d9af3565574c5fdeccf4313972f2428cf3f8/ok.js#L701-L709 | train |
j-/ok | ok.js | function (newValue) {
var oldValue = this._value;
if (oldValue !== newValue) {
this._value = newValue;
this.trigger(EVENT_CHANGE, this, newValue, oldValue);
}
} | javascript | function (newValue) {
var oldValue = this._value;
if (oldValue !== newValue) {
this._value = newValue;
this.trigger(EVENT_CHANGE, this, newValue, oldValue);
}
} | [
"function",
"(",
"newValue",
")",
"{",
"var",
"oldValue",
"=",
"this",
".",
"_value",
";",
"if",
"(",
"oldValue",
"!==",
"newValue",
")",
"{",
"this",
".",
"_value",
"=",
"newValue",
";",
"this",
".",
"trigger",
"(",
"EVENT_CHANGE",
",",
"this",
",",
... | Replace the internal property with a new value and trigger a 'change'
@param {*} newValue New property value
@fires change | [
"Replace",
"the",
"internal",
"property",
"with",
"a",
"new",
"value",
"and",
"trigger",
"a",
"change"
] | f1e4d9af3565574c5fdeccf4313972f2428cf3f8 | https://github.com/j-/ok/blob/f1e4d9af3565574c5fdeccf4313972f2428cf3f8/ok.js#L722-L728 | train | |
eclipse/orion.client | modules/orionode/lib/metastore/mongodb/store.js | deleteUser | function deleteUser(id, callback) {
orionAccount.findByUsername(id, function(err, user) {
if(err) {
callback(err);
}
const userPath = path.join(this.options.workspaceDir, id.substring(0,2));
fs.access(userPath, (err) => {
if(err) {
callback(err);
}
//TODO should a delete failure preve... | javascript | function deleteUser(id, callback) {
orionAccount.findByUsername(id, function(err, user) {
if(err) {
callback(err);
}
const userPath = path.join(this.options.workspaceDir, id.substring(0,2));
fs.access(userPath, (err) => {
if(err) {
callback(err);
}
//TODO should a delete failure preve... | [
"function",
"deleteUser",
"(",
"id",
",",
"callback",
")",
"{",
"orionAccount",
".",
"findByUsername",
"(",
"id",
",",
"function",
"(",
"err",
",",
"user",
")",
"{",
"if",
"(",
"err",
")",
"{",
"callback",
"(",
"err",
")",
";",
"}",
"const",
"userPat... | Delete the user from the store with the given user ID
@param {string} id The user identifier to delete
@param {fn(Error: err)} callback The callback to call when complete | [
"Delete",
"the",
"user",
"from",
"the",
"store",
"with",
"the",
"given",
"user",
"ID"
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/modules/orionode/lib/metastore/mongodb/store.js#L325-L344 | train |
eclipse/orion.client | bundles/org.eclipse.orion.client.javascript/web/eslint/lib/rules/quotes.js | isDirective | function isDirective(node) {
return node.type === "ExpressionStatement" &&
node.expression.type === "Literal" &&
typeof node.expression.value === "string";
} | javascript | function isDirective(node) {
return node.type === "ExpressionStatement" &&
node.expression.type === "Literal" &&
typeof node.expression.value === "string";
} | [
"function",
"isDirective",
"(",
"node",
")",
"{",
"return",
"node",
".",
"type",
"===",
"\"ExpressionStatement\"",
"&&",
"node",
".",
"expression",
".",
"type",
"===",
"\"Literal\"",
"&&",
"typeof",
"node",
".",
"expression",
".",
"value",
"===",
"\"string\"",... | Checks whether or not a given node is a directive.
The directive is a `ExpressionStatement` which has only a string literal.
@param {ASTNode} node - A node to check.
@returns {boolean} Whether or not the node is a directive.
@private | [
"Checks",
"whether",
"or",
"not",
"a",
"given",
"node",
"is",
"a",
"directive",
".",
"The",
"directive",
"is",
"a",
"ExpressionStatement",
"which",
"has",
"only",
"a",
"string",
"literal",
"."
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/rules/quotes.js#L82-L86 | train |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/orion/tasks.js | TaskList | function TaskList(options) {
var parent = lib.node(options.parent);
if (!parent) { throw messages['no parent']; }
if (!options.serviceRegistry) {throw messages["no service registry"]; }
this._parent = parent;
this._registry = options.serviceRegistry;
this._description = options.description;
this._tasks =... | javascript | function TaskList(options) {
var parent = lib.node(options.parent);
if (!parent) { throw messages['no parent']; }
if (!options.serviceRegistry) {throw messages["no service registry"]; }
this._parent = parent;
this._registry = options.serviceRegistry;
this._description = options.description;
this._tasks =... | [
"function",
"TaskList",
"(",
"options",
")",
"{",
"var",
"parent",
"=",
"lib",
".",
"node",
"(",
"options",
".",
"parent",
")",
";",
"if",
"(",
"!",
"parent",
")",
"{",
"throw",
"messages",
"[",
"'no parent'",
"]",
";",
"}",
"if",
"(",
"!",
"option... | Creates a new user interface element showing a list of tasks
@name orion.tasks.TaskList
@class A user interface element showing a list of various user tasks.
@param {Object} options The service options
@param {Object} options.parent The parent of this task list
@prarm {String} options.id The id of the section
@param {... | [
"Creates",
"a",
"new",
"user",
"interface",
"element",
"showing",
"a",
"list",
"of",
"tasks"
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/tasks.js#L34-L52 | train |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/edit/setup.js | function() {
/** All events from last tick */
var pendingEvents = this._annotationChangedContext.events;
var pendingLocations = this._annotationChangedContext.locations;
var pendingModels = this._annotationChangedContext.textModels;
/** All unique events from last tick */
var handlingEvents = [];
var hand... | javascript | function() {
/** All events from last tick */
var pendingEvents = this._annotationChangedContext.events;
var pendingLocations = this._annotationChangedContext.locations;
var pendingModels = this._annotationChangedContext.textModels;
/** All unique events from last tick */
var handlingEvents = [];
var hand... | [
"function",
"(",
")",
"{",
"/** All events from last tick */",
"var",
"pendingEvents",
"=",
"this",
".",
"_annotationChangedContext",
".",
"events",
";",
"var",
"pendingLocations",
"=",
"this",
".",
"_annotationChangedContext",
".",
"locations",
";",
"var",
"pendingMo... | Handle all annotation changed events in the last tick.
This avoids duplicate events from a single text model. | [
"Handle",
"all",
"annotation",
"changed",
"events",
"in",
"the",
"last",
"tick",
".",
"This",
"avoids",
"duplicate",
"events",
"from",
"a",
"single",
"text",
"model",
"."
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/edit/setup.js#L1523-L1582 | train | |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/edit/setup.js | function(serviceRegistry, setup) {
this._setup = setup;
this._projectClient = serviceRegistry.getService("orion.project.client");
serviceRegistry.registerService("orion.edit.hover", this, {
name: 'Hover Evaluation',
contentType: ["application/javascript", "text/x-c++src", "text/x-python"] // TODO: get by sub-ser... | javascript | function(serviceRegistry, setup) {
this._setup = setup;
this._projectClient = serviceRegistry.getService("orion.project.client");
serviceRegistry.registerService("orion.edit.hover", this, {
name: 'Hover Evaluation',
contentType: ["application/javascript", "text/x-c++src", "text/x-python"] // TODO: get by sub-ser... | [
"function",
"(",
"serviceRegistry",
",",
"setup",
")",
"{",
"this",
".",
"_setup",
"=",
"setup",
";",
"this",
".",
"_projectClient",
"=",
"serviceRegistry",
".",
"getService",
"(",
"\"orion.project.client\"",
")",
";",
"serviceRegistry",
".",
"registerService",
... | Provides hover evaluation by project
@name orion.projects.HoverEvaluationService
@param {orion.serviceregistry.ServiceRegistry} serviceRegistry
@param {EditorSetup} setup - need this to get the current project | [
"Provides",
"hover",
"evaluation",
"by",
"project"
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/edit/setup.js#L2353-L2360 | train | |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/edit/setup.js | function(editorContext, ctxt) {
var promise = new Deferred();
var launchConf = this._setup.runBar.getSelectedLaunchConfiguration();
if (launchConf) {
this._projectClient.getProjectDeployService(launchConf.ServiceId, launchConf.Type).then(function(service){
if (service && service.computeHoverInfo) {
se... | javascript | function(editorContext, ctxt) {
var promise = new Deferred();
var launchConf = this._setup.runBar.getSelectedLaunchConfiguration();
if (launchConf) {
this._projectClient.getProjectDeployService(launchConf.ServiceId, launchConf.Type).then(function(service){
if (service && service.computeHoverInfo) {
se... | [
"function",
"(",
"editorContext",
",",
"ctxt",
")",
"{",
"var",
"promise",
"=",
"new",
"Deferred",
"(",
")",
";",
"var",
"launchConf",
"=",
"this",
".",
"_setup",
".",
"runBar",
".",
"getSelectedLaunchConfiguration",
"(",
")",
";",
"if",
"(",
"launchConf",... | Evaluate the hover
@param {Object} editorContext
@param {Object} ctxt
@return {Promise.<string>} | [
"Evaluate",
"the",
"hover"
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/edit/setup.js#L2369-L2389 | train | |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/gcli/gcli/ui/fields/basic.js | StringField | function StringField(type, options) {
Field.call(this, type, options);
this.arg = new Argument();
this.element = util.createElement(this.document, 'input');
this.element.type = 'text';
this.element.classList.add('gcli-field');
this.onInputChange = this.onInputChange.bind(this);
this.element.addEventList... | javascript | function StringField(type, options) {
Field.call(this, type, options);
this.arg = new Argument();
this.element = util.createElement(this.document, 'input');
this.element.type = 'text';
this.element.classList.add('gcli-field');
this.onInputChange = this.onInputChange.bind(this);
this.element.addEventList... | [
"function",
"StringField",
"(",
"type",
",",
"options",
")",
"{",
"Field",
".",
"call",
"(",
"this",
",",
"type",
",",
"options",
")",
";",
"this",
".",
"arg",
"=",
"new",
"Argument",
"(",
")",
";",
"this",
".",
"element",
"=",
"util",
".",
"create... | A field that allows editing of strings | [
"A",
"field",
"that",
"allows",
"editing",
"of",
"strings"
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/gcli/gcli/ui/fields/basic.js#L63-L75 | train |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/gcli/gcli/ui/fields/basic.js | BooleanField | function BooleanField(type, options) {
Field.call(this, type, options);
this.name = options.name;
this.named = options.named;
this.element = util.createElement(this.document, 'input');
this.element.type = 'checkbox';
this.element.id = 'gcliForm' + this.name;
this.onInputChange = this.onInputChange.bind... | javascript | function BooleanField(type, options) {
Field.call(this, type, options);
this.name = options.name;
this.named = options.named;
this.element = util.createElement(this.document, 'input');
this.element.type = 'checkbox';
this.element.id = 'gcliForm' + this.name;
this.onInputChange = this.onInputChange.bind... | [
"function",
"BooleanField",
"(",
"type",
",",
"options",
")",
"{",
"Field",
".",
"call",
"(",
"this",
",",
"type",
",",
"options",
")",
";",
"this",
".",
"name",
"=",
"options",
".",
"name",
";",
"this",
".",
"named",
"=",
"options",
".",
"named",
... | A field that uses a checkbox to toggle a boolean field | [
"A",
"field",
"that",
"uses",
"a",
"checkbox",
"to",
"toggle",
"a",
"boolean",
"field"
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/gcli/gcli/ui/fields/basic.js#L158-L172 | train |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/gcli/gcli/ui/fields/basic.js | DelegateField | function DelegateField(type, options) {
Field.call(this, type, options);
this.options = options;
this.requisition.onAssignmentChange.add(this.update, this);
this.element = util.createElement(this.document, 'div');
this.update();
this.onFieldChange = util.createEvent('DelegateField.onFieldChange');
} | javascript | function DelegateField(type, options) {
Field.call(this, type, options);
this.options = options;
this.requisition.onAssignmentChange.add(this.update, this);
this.element = util.createElement(this.document, 'div');
this.update();
this.onFieldChange = util.createEvent('DelegateField.onFieldChange');
} | [
"function",
"DelegateField",
"(",
"type",
",",
"options",
")",
"{",
"Field",
".",
"call",
"(",
"this",
",",
"type",
",",
"options",
")",
";",
"this",
".",
"options",
"=",
"options",
";",
"this",
".",
"requisition",
".",
"onAssignmentChange",
".",
"add",
... | A field that works with delegate types by delaying resolution until that
last possible time | [
"A",
"field",
"that",
"works",
"with",
"delegate",
"types",
"by",
"delaying",
"resolution",
"until",
"that",
"last",
"possible",
"time"
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/gcli/gcli/ui/fields/basic.js#L211-L220 | train |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js | function() {
this._createSettingsCommand();
this._createGotoLineCommnand();
this._createFindCommnand();
this._createBlameCommand();
this._createDiffCommand();
this._createShowTooltipCommand();
this._createUndoStackCommands();
this._createClipboardCommands();
this._createDelimiterCommands();
... | javascript | function() {
this._createSettingsCommand();
this._createGotoLineCommnand();
this._createFindCommnand();
this._createBlameCommand();
this._createDiffCommand();
this._createShowTooltipCommand();
this._createUndoStackCommands();
this._createClipboardCommands();
this._createDelimiterCommands();
... | [
"function",
"(",
")",
"{",
"this",
".",
"_createSettingsCommand",
"(",
")",
";",
"this",
".",
"_createGotoLineCommnand",
"(",
")",
";",
"this",
".",
"_createFindCommnand",
"(",
")",
";",
"this",
".",
"_createBlameCommand",
"(",
")",
";",
"this",
".",
"_cre... | Creates the common text editing commands. Also generates commands for any installed plug-ins that
contribute editor actions. | [
"Creates",
"the",
"common",
"text",
"editing",
"commands",
".",
"Also",
"generates",
"commands",
"for",
"any",
"installed",
"plug",
"-",
"ins",
"that",
"contribute",
"editor",
"actions",
"."
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/editorCommands.js#L175-L195 | train | |
eclipse/orion.client | bundles/org.eclipse.orion.client.javascript/web/javascript/astManager.js | ASTManager | function ASTManager(serviceRegistry, jsProject) {
this.cache = new LRU(10);
this.orionAcorn = new OrionAcorn();
this.jsProject = jsProject;
registry = serviceRegistry;
} | javascript | function ASTManager(serviceRegistry, jsProject) {
this.cache = new LRU(10);
this.orionAcorn = new OrionAcorn();
this.jsProject = jsProject;
registry = serviceRegistry;
} | [
"function",
"ASTManager",
"(",
"serviceRegistry",
",",
"jsProject",
")",
"{",
"this",
".",
"cache",
"=",
"new",
"LRU",
"(",
"10",
")",
";",
"this",
".",
"orionAcorn",
"=",
"new",
"OrionAcorn",
"(",
")",
";",
"this",
".",
"jsProject",
"=",
"jsProject",
... | Provides a shared AST.
@name javascript.ASTManager
@class Provides a shared AST.
@param {?} serviceRegistry The platform service registry
@param {?} servjsProject The backing project context | [
"Provides",
"a",
"shared",
"AST",
"."
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.javascript/web/javascript/astManager.js#L30-L35 | train |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js | CommandRegistry | function CommandRegistry(options) {
this._commandList = {};
this._contributionsByScopeId = {};
this._activeBindings = {};
this._urlBindings = {};
this._pendingBindings = {}; // bindings for as-yet-unknown commands
this._parameterCollector = null;
this._init(options || {});
} | javascript | function CommandRegistry(options) {
this._commandList = {};
this._contributionsByScopeId = {};
this._activeBindings = {};
this._urlBindings = {};
this._pendingBindings = {}; // bindings for as-yet-unknown commands
this._parameterCollector = null;
this._init(options || {});
} | [
"function",
"CommandRegistry",
"(",
"options",
")",
"{",
"this",
".",
"_commandList",
"=",
"{",
"}",
";",
"this",
".",
"_contributionsByScopeId",
"=",
"{",
"}",
";",
"this",
".",
"_activeBindings",
"=",
"{",
"}",
";",
"this",
".",
"_urlBindings",
"=",
"{... | Constructs a new command registry with the given options.
@class CommandRegistry can render commands appropriate for a particular scope and DOM element.
@name orion.commandregistry.CommandRegistry
@param {Object} options The registry options object
@param {orion.selection.Selection} [options.selection] Optional selecti... | [
"Constructs",
"a",
"new",
"command",
"registry",
"with",
"the",
"given",
"options",
"."
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js#L37-L45 | train |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js | function(url) {
for (var id in this._urlBindings) {
if (this._urlBindings[id] && this._urlBindings[id].urlBinding && this._urlBindings[id].command) {
var match = this._urlBindings[id].urlBinding.match(url);
if (match) {
var urlBinding = this._urlBindings[id];
var command = urlBinding.comman... | javascript | function(url) {
for (var id in this._urlBindings) {
if (this._urlBindings[id] && this._urlBindings[id].urlBinding && this._urlBindings[id].command) {
var match = this._urlBindings[id].urlBinding.match(url);
if (match) {
var urlBinding = this._urlBindings[id];
var command = urlBinding.comman... | [
"function",
"(",
"url",
")",
"{",
"for",
"(",
"var",
"id",
"in",
"this",
".",
"_urlBindings",
")",
"{",
"if",
"(",
"this",
".",
"_urlBindings",
"[",
"id",
"]",
"&&",
"this",
".",
"_urlBindings",
"[",
"id",
"]",
".",
"urlBinding",
"&&",
"this",
".",... | Process the provided URL to determine whether any commands should be invoked. Note that we never
invoke a command callback by URL, only its parameter collector. If a parameter collector is not
specified, commands in the URL will be ignored.
@param {String} url a url that may contain URL bindings. | [
"Process",
"the",
"provided",
"URL",
"to",
"determine",
"whether",
"any",
"commands",
"should",
"be",
"invoked",
".",
"Note",
"that",
"we",
"never",
"invoke",
"a",
"command",
"callback",
"by",
"URL",
"only",
"its",
"parameter",
"collector",
".",
"If",
"a",
... | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js#L92-L112 | train | |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js | function(commandId, item, handler, parameters, userData, parent) {
var self = this;
if (item) {
var command = this._commandList[commandId];
var enabled = command && (command.visibleWhen ? command.visibleWhen(item) : true);
if (enabled && command.callback) {
var commandInvocation = new Commands.Co... | javascript | function(commandId, item, handler, parameters, userData, parent) {
var self = this;
if (item) {
var command = this._commandList[commandId];
var enabled = command && (command.visibleWhen ? command.visibleWhen(item) : true);
if (enabled && command.callback) {
var commandInvocation = new Commands.Co... | [
"function",
"(",
"commandId",
",",
"item",
",",
"handler",
",",
"parameters",
",",
"userData",
",",
"parent",
")",
"{",
"var",
"self",
"=",
"this",
";",
"if",
"(",
"item",
")",
"{",
"var",
"command",
"=",
"this",
".",
"_commandList",
"[",
"commandId",
... | Run the command with the specified commandId.
@param {String} commandId the id of the command to run.
@param {Object} item the item on which the command should run.
@param {Object} handler the handler for the command.
@param {orion.commands.ParametersDescription} [parameters] Parameters used on this invocation. Option... | [
"Run",
"the",
"command",
"with",
"the",
"specified",
"commandId",
"."
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js#L135-L154 | train | |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js | function(node, fillFunction, onClose, name) {
if (this._parameterCollector) {
this._parameterCollector.close();
this._parameterCollector.open(node, fillFunction, onClose, name);
}
} | javascript | function(node, fillFunction, onClose, name) {
if (this._parameterCollector) {
this._parameterCollector.close();
this._parameterCollector.open(node, fillFunction, onClose, name);
}
} | [
"function",
"(",
"node",
",",
"fillFunction",
",",
"onClose",
",",
"name",
")",
"{",
"if",
"(",
"this",
".",
"_parameterCollector",
")",
"{",
"this",
".",
"_parameterCollector",
".",
"close",
"(",
")",
";",
"this",
".",
"_parameterCollector",
".",
"open",
... | Open a parameter collector suitable for collecting information about a command.
Once a collector is created, the specified function is used to fill it with
information needed by the command. This method is used for commands that cannot
rely on a simple parameter description to collect parameters. Commands that descri... | [
"Open",
"a",
"parameter",
"collector",
"suitable",
"for",
"collecting",
"information",
"about",
"a",
"command",
".",
"Once",
"a",
"collector",
"is",
"created",
"the",
"specified",
"function",
"is",
"used",
"to",
"fill",
"it",
"with",
"information",
"needed",
"... | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js#L226-L231 | train | |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js | function(node, message, yesString, noString, modal, onConfirm) {
this._popupDialog(modal,"CONFIRM", node, message, [{label:yesString,callback:onConfirm,type:"ok"},{label:noString,callback:null,type:"cancel"}]);
} | javascript | function(node, message, yesString, noString, modal, onConfirm) {
this._popupDialog(modal,"CONFIRM", node, message, [{label:yesString,callback:onConfirm,type:"ok"},{label:noString,callback:null,type:"cancel"}]);
} | [
"function",
"(",
"node",
",",
"message",
",",
"yesString",
",",
"noString",
",",
"modal",
",",
"onConfirm",
")",
"{",
"this",
".",
"_popupDialog",
"(",
"modal",
",",
"\"CONFIRM\"",
",",
"node",
",",
"message",
",",
"[",
"{",
"label",
":",
"yesString",
... | Open a parameter collector to confirm a command.
@param {DOMElement} node the dom node that is displaying the command
@param {String} message the message to show when confirming the command
@param {String} yesString the label to show on a yes/true choice
@param {String} noString the label to show on a no/false choice
... | [
"Open",
"a",
"parameter",
"collector",
"to",
"confirm",
"a",
"command",
"."
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js#L244-L246 | train | |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js | function(node, message, yesString, onConfirm) {
this._popupDialog(false, "ALERT", node, message, [{label:yesString,callback:onConfirm,type:"ok"}]);
} | javascript | function(node, message, yesString, onConfirm) {
this._popupDialog(false, "ALERT", node, message, [{label:yesString,callback:onConfirm,type:"ok"}]);
} | [
"function",
"(",
"node",
",",
"message",
",",
"yesString",
",",
"onConfirm",
")",
"{",
"this",
".",
"_popupDialog",
"(",
"false",
",",
"\"ALERT\"",
",",
"node",
",",
"message",
",",
"[",
"{",
"label",
":",
"yesString",
",",
"callback",
":",
"onConfirm",
... | Open an alert tooltip
@param {DOMElement} node the dom node that is displaying the command
@param {String} message the message to show when confirming the command
@param {String} yesString the label to show on a yes/true choice
@param {Function} onConfirm a function that will be called when the user confirms the comma... | [
"Open",
"an",
"alert",
"tooltip"
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js#L257-L259 | train | |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js | function(node, message, yesString, noString, defaultInput, modal, onConfirm, positionString) {
var position = null;
if(positionString === "below"){position = ["below", "right", "above", "left"];}
else if(positionString === "right"){position = ["right", "above", "below", "left"];}
this._popupDialog(modal,"PR... | javascript | function(node, message, yesString, noString, defaultInput, modal, onConfirm, positionString) {
var position = null;
if(positionString === "below"){position = ["below", "right", "above", "left"];}
else if(positionString === "right"){position = ["right", "above", "below", "left"];}
this._popupDialog(modal,"PR... | [
"function",
"(",
"node",
",",
"message",
",",
"yesString",
",",
"noString",
",",
"defaultInput",
",",
"modal",
",",
"onConfirm",
",",
"positionString",
")",
"{",
"var",
"position",
"=",
"null",
";",
"if",
"(",
"positionString",
"===",
"\"below\"",
")",
"{"... | Open a tolltip parameter collector to collect user input.
@param {DOMElement} node the dom node that is displaying the command
@param {String} message the message to show when confirming the command
@param {String} yesString the label to show on a yes/true choice
@param {String} noString the label to show on a no/fals... | [
"Open",
"a",
"tolltip",
"parameter",
"collector",
"to",
"collect",
"user",
"input",
"."
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js#L384-L389 | train | |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js | function(keyAssist) {
var scopes = {};
var binding;
// see commands.js _processKey
function execute(activeBinding) {
return function() {
Commands.executeBinding(activeBinding);
};
}
var bindings = [];
for (var aBinding in this._activeBindings) {
binding = this._activeBindings[a... | javascript | function(keyAssist) {
var scopes = {};
var binding;
// see commands.js _processKey
function execute(activeBinding) {
return function() {
Commands.executeBinding(activeBinding);
};
}
var bindings = [];
for (var aBinding in this._activeBindings) {
binding = this._activeBindings[a... | [
"function",
"(",
"keyAssist",
")",
"{",
"var",
"scopes",
"=",
"{",
"}",
";",
"var",
"binding",
";",
"// see commands.js _processKey",
"function",
"execute",
"(",
"activeBinding",
")",
"{",
"return",
"function",
"(",
")",
"{",
"Commands",
".",
"executeBinding",... | Show the keybindings that are registered with the command registry inside the specified target node.
@param {KeyAssistPanel} keyAssist the key assist panel | [
"Show",
"the",
"keybindings",
"that",
"are",
"registered",
"with",
"the",
"command",
"registry",
"inside",
"the",
"specified",
"target",
"node",
"."
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js#L524-L566 | train | |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js | function(command) {
this._commandList[command.id] = command;
// Resolve any pending key/url bindings against this command
var pending = this._pendingBindings[command.id];
if (pending) {
var _self = this;
pending.forEach(function(binding) {
_self._addBinding(command, binding.type, binding.bindin... | javascript | function(command) {
this._commandList[command.id] = command;
// Resolve any pending key/url bindings against this command
var pending = this._pendingBindings[command.id];
if (pending) {
var _self = this;
pending.forEach(function(binding) {
_self._addBinding(command, binding.type, binding.bindin... | [
"function",
"(",
"command",
")",
"{",
"this",
".",
"_commandList",
"[",
"command",
".",
"id",
"]",
"=",
"command",
";",
"// Resolve any pending key/url bindings against this command",
"var",
"pending",
"=",
"this",
".",
"_pendingBindings",
"[",
"command",
".",
"id... | Add a command to the command registry. Nothing will be shown in the UI
until this command is referenced in a contribution.
@param {orion.commands.Command} command The command being added.
@see registerCommandContribution | [
"Add",
"a",
"command",
"to",
"the",
"command",
"registry",
".",
"Nothing",
"will",
"be",
"shown",
"in",
"the",
"UI",
"until",
"this",
"command",
"is",
"referenced",
"in",
"a",
"contribution",
"."
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js#L703-L714 | train | |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js | function(scopeId, groupId, position, title, parentPath, emptyGroupMessage, imageClass, tooltip, selectionClass, defaultActionId, extraClasses) {
if (!this._contributionsByScopeId[scopeId]) {
this._contributionsByScopeId[scopeId] = {};
}
var parentTable = this._contributionsByScopeId[scopeId];
if (parent... | javascript | function(scopeId, groupId, position, title, parentPath, emptyGroupMessage, imageClass, tooltip, selectionClass, defaultActionId, extraClasses) {
if (!this._contributionsByScopeId[scopeId]) {
this._contributionsByScopeId[scopeId] = {};
}
var parentTable = this._contributionsByScopeId[scopeId];
if (parent... | [
"function",
"(",
"scopeId",
",",
"groupId",
",",
"position",
",",
"title",
",",
"parentPath",
",",
"emptyGroupMessage",
",",
"imageClass",
",",
"tooltip",
",",
"selectionClass",
",",
"defaultActionId",
",",
"extraClasses",
")",
"{",
"if",
"(",
"!",
"this",
"... | Registers a command group and specifies visual information about the group.
@param {String} scopeId The id of a DOM element in which the group should be visible. Required.
When commands are rendered for a particular element, the group will be shown only if its scopeId
matches the id being rendered.
@param {String} gro... | [
"Registers",
"a",
"command",
"group",
"and",
"specifies",
"visual",
"information",
"about",
"the",
"group",
"."
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js#L740-L793 | train | |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js | function(scopeId, selectionService) {
if (!this._contributionsByScopeId[scopeId]) {
this._contributionsByScopeId[scopeId] = {};
}
this._contributionsByScopeId[scopeId].localSelectionService = selectionService;
} | javascript | function(scopeId, selectionService) {
if (!this._contributionsByScopeId[scopeId]) {
this._contributionsByScopeId[scopeId] = {};
}
this._contributionsByScopeId[scopeId].localSelectionService = selectionService;
} | [
"function",
"(",
"scopeId",
",",
"selectionService",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_contributionsByScopeId",
"[",
"scopeId",
"]",
")",
"{",
"this",
".",
"_contributionsByScopeId",
"[",
"scopeId",
"]",
"=",
"{",
"}",
";",
"}",
"this",
".",
"_con... | Register a selection service that should be used for certain command scopes.
@param {String} scopeId The id describing the scope for which this selection service applies. Required.
Only contributions made to this scope will use the selection service.
@param {orion.selection.Selection} selectionService the selection se... | [
"Register",
"a",
"selection",
"service",
"that",
"should",
"be",
"used",
"for",
"certain",
"command",
"scopes",
"."
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js#L818-L823 | train | |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js | function(scopeId, commandId, position, parentPath, bindingOnly, keyBinding, urlBinding, handler) {
if (!this._contributionsByScopeId[scopeId]) {
this._contributionsByScopeId[scopeId] = {};
}
var parentTable = this._contributionsByScopeId[scopeId];
if (parentPath) {
parentTable = this._createEntryFor... | javascript | function(scopeId, commandId, position, parentPath, bindingOnly, keyBinding, urlBinding, handler) {
if (!this._contributionsByScopeId[scopeId]) {
this._contributionsByScopeId[scopeId] = {};
}
var parentTable = this._contributionsByScopeId[scopeId];
if (parentPath) {
parentTable = this._createEntryFor... | [
"function",
"(",
"scopeId",
",",
"commandId",
",",
"position",
",",
"parentPath",
",",
"bindingOnly",
",",
"keyBinding",
",",
"urlBinding",
",",
"handler",
")",
"{",
"if",
"(",
"!",
"this",
".",
"_contributionsByScopeId",
"[",
"scopeId",
"]",
")",
"{",
"th... | Register a command contribution, which identifies how a command appears
on a page and how it is invoked.
@param {String} scopeId The id describing the scope of the command. Required.
This scope id is used when rendering commands.
@param {String} commandId the id of the command. Required.
@param {Number} position the ... | [
"Register",
"a",
"command",
"contribution",
"which",
"identifies",
"how",
"a",
"command",
"appears",
"on",
"a",
"page",
"and",
"how",
"it",
"is",
"invoked",
"."
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js#L891-L931 | train | |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js | function(commandId, type, binding, bindingOnly) {
this._pendingBindings[commandId] = this._pendingBindings[commandId] || [];
this._pendingBindings[commandId].push({
type: type,
binding: binding,
bindingOnly: bindingOnly
});
} | javascript | function(commandId, type, binding, bindingOnly) {
this._pendingBindings[commandId] = this._pendingBindings[commandId] || [];
this._pendingBindings[commandId].push({
type: type,
binding: binding,
bindingOnly: bindingOnly
});
} | [
"function",
"(",
"commandId",
",",
"type",
",",
"binding",
",",
"bindingOnly",
")",
"{",
"this",
".",
"_pendingBindings",
"[",
"commandId",
"]",
"=",
"this",
".",
"_pendingBindings",
"[",
"commandId",
"]",
"||",
"[",
"]",
";",
"this",
".",
"_pendingBinding... | Remembers a key or url binding that has not yet been resolved to a command.
@param {String} type One of <code>"key"</code>, <code>"url"</code>. | [
"Remembers",
"a",
"key",
"or",
"url",
"binding",
"that",
"has",
"not",
"yet",
"been",
"resolved",
"to",
"a",
"command",
"."
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js#L978-L985 | train | |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js | function(scopeId, parent, items, handler, renderType, userData, domNodeWrapperList) {
if (typeof(scopeId) !== "string") { //$NON-NLS-0$
throw "a scope id for rendering must be specified"; //$NON-NLS-0$
}
parent = lib.node(parent);
if (!parent) {
throw "no parent"; //$NON-NLS-0$
}
var contri... | javascript | function(scopeId, parent, items, handler, renderType, userData, domNodeWrapperList) {
if (typeof(scopeId) !== "string") { //$NON-NLS-0$
throw "a scope id for rendering must be specified"; //$NON-NLS-0$
}
parent = lib.node(parent);
if (!parent) {
throw "no parent"; //$NON-NLS-0$
}
var contri... | [
"function",
"(",
"scopeId",
",",
"parent",
",",
"items",
",",
"handler",
",",
"renderType",
",",
"userData",
",",
"domNodeWrapperList",
")",
"{",
"if",
"(",
"typeof",
"(",
"scopeId",
")",
"!==",
"\"string\"",
")",
"{",
"//$NON-NLS-0$",
"throw",
"\"a scope id... | Render the commands that are appropriate for the given scope.
@param {String} scopeId The id describing the scope for which we are rendering commands. Required.
Only contributions made to this scope will be rendered.
@param {DOMElement} parent The element in which commands should be rendered. If commands have been
pr... | [
"Render",
"the",
"commands",
"that",
"are",
"appropriate",
"for",
"the",
"given",
"scope",
"."
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js#L1034-L1061 | train | |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js | function(parent) {
parent = lib.node(parent);
if (!parent) {
throw "no parent"; //$NON-NLS-0$
}
while (parent.hasChildNodes()) {
var node = parent.firstChild;
if (node.commandTooltip) {
node.commandTooltip.destroy();
}
if (node.emptyGroupTooltip) {
node.emptyGroupTooltip.dest... | javascript | function(parent) {
parent = lib.node(parent);
if (!parent) {
throw "no parent"; //$NON-NLS-0$
}
while (parent.hasChildNodes()) {
var node = parent.firstChild;
if (node.commandTooltip) {
node.commandTooltip.destroy();
}
if (node.emptyGroupTooltip) {
node.emptyGroupTooltip.dest... | [
"function",
"(",
"parent",
")",
"{",
"parent",
"=",
"lib",
".",
"node",
"(",
"parent",
")",
";",
"if",
"(",
"!",
"parent",
")",
"{",
"throw",
"\"no parent\"",
";",
"//$NON-NLS-0$",
"}",
"while",
"(",
"parent",
".",
"hasChildNodes",
"(",
")",
")",
"{"... | Destroy all DOM nodes and any other resources used by rendered commands.
This call does not remove the commands from the command registry. Clients typically call this
function to empty a command area when a client wants to render the commands again due to some
change in state.
@param {String|DOMElement} parent The id ... | [
"Destroy",
"all",
"DOM",
"nodes",
"and",
"any",
"other",
"resources",
"used",
"by",
"rendered",
"commands",
".",
"This",
"call",
"does",
"not",
"remove",
"the",
"commands",
"from",
"the",
"command",
"registry",
".",
"Clients",
"typically",
"call",
"this",
"f... | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js#L1070-L1086 | train | |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js | function (url) {
//ensure this is only the hash portion
var params = PageUtil.matchResourceParameters(url);
if (typeof params[this.token] !== "undefined") { //$NON-NLS-0$
this.parameterValue = params[this.token];
return this;
}
return null;
} | javascript | function (url) {
//ensure this is only the hash portion
var params = PageUtil.matchResourceParameters(url);
if (typeof params[this.token] !== "undefined") { //$NON-NLS-0$
this.parameterValue = params[this.token];
return this;
}
return null;
} | [
"function",
"(",
"url",
")",
"{",
"//ensure this is only the hash portion",
"var",
"params",
"=",
"PageUtil",
".",
"matchResourceParameters",
"(",
"url",
")",
";",
"if",
"(",
"typeof",
"params",
"[",
"this",
".",
"token",
"]",
"!==",
"\"undefined\"",
")",
"{",... | Returns whether this URL binding matches the given URL
@param url the URL.
@returns {Boolean} whether this URL binding matches | [
"Returns",
"whether",
"this",
"URL",
"binding",
"matches",
"the",
"given",
"URL"
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js#L1509-L1517 | train | |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js | CommandParameter | function CommandParameter (name, type, label, value, lines, eventListeners, validator) {
this.name = name;
this.type = type;
this.label = label;
this.value = value;
this.lines = lines || 1;
this.validator = validator;
this.eventListeners = (Array.isArray(eventListeners)) ?
eventListeners : (eventLis... | javascript | function CommandParameter (name, type, label, value, lines, eventListeners, validator) {
this.name = name;
this.type = type;
this.label = label;
this.value = value;
this.lines = lines || 1;
this.validator = validator;
this.eventListeners = (Array.isArray(eventListeners)) ?
eventListeners : (eventLis... | [
"function",
"CommandParameter",
"(",
"name",
",",
"type",
",",
"label",
",",
"value",
",",
"lines",
",",
"eventListeners",
",",
"validator",
")",
"{",
"this",
".",
"name",
"=",
"name",
";",
"this",
".",
"type",
"=",
"type",
";",
"this",
".",
"label",
... | A CommandParameter defines a parameter that is required by a command.
@param {String} name the name of the parameter
@param {String} type the type of the parameter, one of the HTML5 input types, or "boolean"
@param {String} [label] the (optional) label that should be used when showing the parameter
@param {String} [va... | [
"A",
"CommandParameter",
"defines",
"a",
"parameter",
"that",
"is",
"required",
"by",
"a",
"command",
"."
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js#L1551-L1561 | train |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js | ParametersDescription | function ParametersDescription (parameters, options, getParameters) {
this._storeParameters(parameters);
this._hasOptionalParameters = options && options.hasOptionalParameters;
this._options = options; // saved for making a copy
this.optionsRequested = false;
this.getParameters = getParameters;
this.client... | javascript | function ParametersDescription (parameters, options, getParameters) {
this._storeParameters(parameters);
this._hasOptionalParameters = options && options.hasOptionalParameters;
this._options = options; // saved for making a copy
this.optionsRequested = false;
this.getParameters = getParameters;
this.client... | [
"function",
"ParametersDescription",
"(",
"parameters",
",",
"options",
",",
"getParameters",
")",
"{",
"this",
".",
"_storeParameters",
"(",
"parameters",
")",
";",
"this",
".",
"_hasOptionalParameters",
"=",
"options",
"&&",
"options",
".",
"hasOptionalParameters"... | A ParametersDescription defines the parameters required by a command, and whether there are additional
optional parameters that can be specified. The command registry will attempt to collect required parameters
before calling a command callback. The command is expected to provide UI for optional parameter, when the u... | [
"A",
"ParametersDescription",
"defines",
"the",
"parameters",
"required",
"by",
"a",
"command",
"and",
"whether",
"there",
"are",
"additional",
"optional",
"parameters",
"that",
"can",
"be",
"specified",
".",
"The",
"command",
"registry",
"will",
"attempt",
"to",
... | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js#L1601-L1612 | train |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js | function(func) {
for (var key in this.parameterTable) {
if (this.parameterTable[key].type && this.parameterTable[key].name) {
func(this.parameterTable[key]);
}
}
} | javascript | function(func) {
for (var key in this.parameterTable) {
if (this.parameterTable[key].type && this.parameterTable[key].name) {
func(this.parameterTable[key]);
}
}
} | [
"function",
"(",
"func",
")",
"{",
"for",
"(",
"var",
"key",
"in",
"this",
".",
"parameterTable",
")",
"{",
"if",
"(",
"this",
".",
"parameterTable",
"[",
"key",
"]",
".",
"type",
"&&",
"this",
".",
"parameterTable",
"[",
"key",
"]",
".",
"name",
"... | Evaluate the specified function for each parameter.
@param {Function} func a function which operates on a provided command parameter | [
"Evaluate",
"the",
"specified",
"function",
"for",
"each",
"parameter",
"."
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js#L1699-L1705 | train | |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js | function() {
var parameters = [];
this.forEach(function(parm) {
var newParm = new CommandParameter(parm.name, parm.type, parm.label, parm.value, parm.lines, parm.eventListeners, parm.validator);
parameters.push(newParm);
});
var copy = new ParametersDescription(parameters, this._options, this.getPar... | javascript | function() {
var parameters = [];
this.forEach(function(parm) {
var newParm = new CommandParameter(parm.name, parm.type, parm.label, parm.value, parm.lines, parm.eventListeners, parm.validator);
parameters.push(newParm);
});
var copy = new ParametersDescription(parameters, this._options, this.getPar... | [
"function",
"(",
")",
"{",
"var",
"parameters",
"=",
"[",
"]",
";",
"this",
".",
"forEach",
"(",
"function",
"(",
"parm",
")",
"{",
"var",
"newParm",
"=",
"new",
"CommandParameter",
"(",
"parm",
".",
"name",
",",
"parm",
".",
"type",
",",
"parm",
"... | Make a copy of this description. Used for collecting values when a client doesn't want
the values to be persisted across different objects. | [
"Make",
"a",
"copy",
"of",
"this",
"description",
".",
"Used",
"for",
"collecting",
"values",
"when",
"a",
"client",
"doesn",
"t",
"want",
"the",
"values",
"to",
"be",
"persisted",
"across",
"different",
"objects",
"."
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/orion/commandRegistry.js#L1720-L1732 | train | |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/plugins/site/siteServiceImpl.js | xhrJson | function xhrJson(method, url, options) {
if (options && typeof options.data !== 'undefined') {
options.data = JSON.stringify(options.data);
}
return xhr.apply(null, Array.prototype.slice.call(arguments)).then(function(result) {
return JSON.parse(result.response || null);
});
} | javascript | function xhrJson(method, url, options) {
if (options && typeof options.data !== 'undefined') {
options.data = JSON.stringify(options.data);
}
return xhr.apply(null, Array.prototype.slice.call(arguments)).then(function(result) {
return JSON.parse(result.response || null);
});
} | [
"function",
"xhrJson",
"(",
"method",
",",
"url",
",",
"options",
")",
"{",
"if",
"(",
"options",
"&&",
"typeof",
"options",
".",
"data",
"!==",
"'undefined'",
")",
"{",
"options",
".",
"data",
"=",
"JSON",
".",
"stringify",
"(",
"options",
".",
"data"... | Invoke the xhr API passing JSON data and returning the response as JSON.
@returns {Deferred} A deferred that resolves to a JS object, or null if the server returned
an empty response. | [
"Invoke",
"the",
"xhr",
"API",
"passing",
"JSON",
"data",
"and",
"returning",
"the",
"response",
"as",
"JSON",
"."
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/plugins/site/siteServiceImpl.js#L81-L88 | train |
eclipse/orion.client | bundles/org.eclipse.orion.client.ui/web/gcli/util/host.js | flashNode | function flashNode(node, match) {
if (!node.__gcliHighlighting) {
node.__gcliHighlighting = true;
var original = node.style.background;
node.style.background = match ? 'green' : 'red';
setTimeout(function() {
node.style.background = original;
delete node.__gcliHighlighting;
}, 500);
... | javascript | function flashNode(node, match) {
if (!node.__gcliHighlighting) {
node.__gcliHighlighting = true;
var original = node.style.background;
node.style.background = match ? 'green' : 'red';
setTimeout(function() {
node.style.background = original;
delete node.__gcliHighlighting;
}, 500);
... | [
"function",
"flashNode",
"(",
"node",
",",
"match",
")",
"{",
"if",
"(",
"!",
"node",
".",
"__gcliHighlighting",
")",
"{",
"node",
".",
"__gcliHighlighting",
"=",
"true",
";",
"var",
"original",
"=",
"node",
".",
"style",
".",
"background",
";",
"node",
... | Internal helper to turn a single nodes background another color for 0.5
second. There is likely a better way to do this, but this will do for now. | [
"Internal",
"helper",
"to",
"turn",
"a",
"single",
"nodes",
"background",
"another",
"color",
"for",
"0",
".",
"5",
"second",
".",
"There",
"is",
"likely",
"a",
"better",
"way",
"to",
"do",
"this",
"but",
"this",
"will",
"do",
"for",
"now",
"."
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.ui/web/gcli/util/host.js#L40-L50 | train |
eclipse/orion.client | modules/orionode/lib/accessRights.js | removeWorkspaceAccess | function removeWorkspaceAccess(userAccessRights, workspaceId) {
var newAccessRights = [];
if(Array.isArray(userAccessRights)) {
userAccessRights.forEach(function(accessRight) {
if(!new RegExp("/" + workspaceId + "(\/|$)").test(accessRight.Uri)) {
newAccessRights.push(accessRight);
}
});
}
return newAc... | javascript | function removeWorkspaceAccess(userAccessRights, workspaceId) {
var newAccessRights = [];
if(Array.isArray(userAccessRights)) {
userAccessRights.forEach(function(accessRight) {
if(!new RegExp("/" + workspaceId + "(\/|$)").test(accessRight.Uri)) {
newAccessRights.push(accessRight);
}
});
}
return newAc... | [
"function",
"removeWorkspaceAccess",
"(",
"userAccessRights",
",",
"workspaceId",
")",
"{",
"var",
"newAccessRights",
"=",
"[",
"]",
";",
"if",
"(",
"Array",
".",
"isArray",
"(",
"userAccessRights",
")",
")",
"{",
"userAccessRights",
".",
"forEach",
"(",
"func... | Remove the workspace access for the given workspace ID
@param {{?}[]} userAccessRights The current array of access rights
@param {string} workspaceId The ID of the workspace to remove access for
@returns {{?}[]} The new array of access rights | [
"Remove",
"the",
"workspace",
"access",
"for",
"the",
"given",
"workspace",
"ID"
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/modules/orionode/lib/accessRights.js#L52-L62 | train |
eclipse/orion.client | modules/orionode/lib/accessRights.js | hasAccess | function hasAccess(access, res, err, next, uri){
if (err) {
api.writeError(404, res, err);
}
if(access) {
next();
} else {
api.writeError(403, res, "You are not authorized to access: " + uri);
}
} | javascript | function hasAccess(access, res, err, next, uri){
if (err) {
api.writeError(404, res, err);
}
if(access) {
next();
} else {
api.writeError(403, res, "You are not authorized to access: " + uri);
}
} | [
"function",
"hasAccess",
"(",
"access",
",",
"res",
",",
"err",
",",
"next",
",",
"uri",
")",
"{",
"if",
"(",
"err",
")",
"{",
"api",
".",
"writeError",
"(",
"404",
",",
"res",
",",
"err",
")",
";",
"}",
"if",
"(",
"access",
")",
"{",
"next",
... | Callback used in checkAccess
@param {bool} access If the requesting user has access
@param {XmlHttpRespsose} res The backing response
@param {*} err The returned error, if any
@param {fn} next The function to move the express routing queue
@param {string} uri The URI that attempted to be accessed | [
"Callback",
"used",
"in",
"checkAccess"
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/modules/orionode/lib/accessRights.js#L86-L95 | train |
eclipse/orion.client | modules/orionode/lib/accessRights.js | wildCardMatch | function wildCardMatch(text, pattern){
var cards = pattern.split("*");
if (!pattern.startsWith("*") && !text.startsWith(cards[0])) { //$NON-NLS-1$
return false;
}
if (!pattern.endsWith("*") && !text.endsWith(cards[cards.length - 1])) { //$NON-NLS-1$
return false;
}
return !cards.some(function(card){
var idx... | javascript | function wildCardMatch(text, pattern){
var cards = pattern.split("*");
if (!pattern.startsWith("*") && !text.startsWith(cards[0])) { //$NON-NLS-1$
return false;
}
if (!pattern.endsWith("*") && !text.endsWith(cards[cards.length - 1])) { //$NON-NLS-1$
return false;
}
return !cards.some(function(card){
var idx... | [
"function",
"wildCardMatch",
"(",
"text",
",",
"pattern",
")",
"{",
"var",
"cards",
"=",
"pattern",
".",
"split",
"(",
"\"*\"",
")",
";",
"if",
"(",
"!",
"pattern",
".",
"startsWith",
"(",
"\"*\"",
")",
"&&",
"!",
"text",
".",
"startsWith",
"(",
"car... | Utility function to check if the request matches a given pattern of access
@param {string} text The text to check
@param {string} pattern The access pattern
@returns {bool} If the text matches the given access pattern | [
"Utility",
"function",
"to",
"check",
"if",
"the",
"request",
"matches",
"a",
"given",
"pattern",
"of",
"access"
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/modules/orionode/lib/accessRights.js#L117-L132 | train |
eclipse/orion.client | modules/orionode/lib/accessRights.js | getAuthorizationData | function getAuthorizationData(metadata, store){
var properties;
var workspaceIDs;
var isPropertyString;
if (typeof metadata.properties === "string") {
isPropertyString = true;
properties = JSON.parse(metadata.properties); // metadata.properties need to be parse when using MongoDB
workspaceIDs = metadata.works... | javascript | function getAuthorizationData(metadata, store){
var properties;
var workspaceIDs;
var isPropertyString;
if (typeof metadata.properties === "string") {
isPropertyString = true;
properties = JSON.parse(metadata.properties); // metadata.properties need to be parse when using MongoDB
workspaceIDs = metadata.works... | [
"function",
"getAuthorizationData",
"(",
"metadata",
",",
"store",
")",
"{",
"var",
"properties",
";",
"var",
"workspaceIDs",
";",
"var",
"isPropertyString",
";",
"if",
"(",
"typeof",
"metadata",
".",
"properties",
"===",
"\"string\"",
")",
"{",
"isPropertyStrin... | Function to fetch the authorization data from the given metadata
@param {{?}} metadata The metadata object
@param {{?}} store The backing metastore
@returns {{?}[]} | [
"Function",
"to",
"fetch",
"the",
"authorization",
"data",
"from",
"the",
"given",
"metadata"
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/modules/orionode/lib/accessRights.js#L140-L171 | train |
eclipse/orion.client | bundles/org.eclipse.orion.client.core/web/lsp/languageServer.js | function() {
if (this.capabilities && this.capabilities.textDocumentSync) {
var kind = this.capabilities.textDocumentSync;
if (this.capabilities.textDocumentSync.change) {
kind = this.capabilities.textDocumentSync.change;
}
switch (kind) {
case this.ipc.TEXT_DOCUMENT_SYNC_KIND.None:
ca... | javascript | function() {
if (this.capabilities && this.capabilities.textDocumentSync) {
var kind = this.capabilities.textDocumentSync;
if (this.capabilities.textDocumentSync.change) {
kind = this.capabilities.textDocumentSync.change;
}
switch (kind) {
case this.ipc.TEXT_DOCUMENT_SYNC_KIND.None:
ca... | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"capabilities",
"&&",
"this",
".",
"capabilities",
".",
"textDocumentSync",
")",
"{",
"var",
"kind",
"=",
"this",
".",
"capabilities",
".",
"textDocumentSync",
";",
"if",
"(",
"this",
".",
"capabilities",
... | Retrieves the method in which the server wishes to have documents synchronized by.
@return {number} a TextDocumentSyncKind, may be None, Full, or Incremental | [
"Retrieves",
"the",
"method",
"in",
"which",
"the",
"server",
"wishes",
"to",
"have",
"documents",
"synchronized",
"by",
"."
] | eb2583100c662b5cfc1b461a978b31d3b8555ce1 | https://github.com/eclipse/orion.client/blob/eb2583100c662b5cfc1b461a978b31d3b8555ce1/bundles/org.eclipse.orion.client.core/web/lsp/languageServer.js#L115-L129 | train |
Subsets and Splits
SQL Console for semeru/code-text-javascript
Retrieves 20,000 non-null code samples labeled as JavaScript, providing a basic overview of the dataset.