id
int32
0
58k
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
9,700
SAP/ui5-builder
lib/processors/jsdoc/jsdocGenerator.js
writeJsdocConfig
async function writeJsdocConfig(targetDirPath, config) { const configPath = path.join(targetDirPath, "jsdoc-config.json"); await writeFile(configPath, config); return configPath; }
javascript
async function writeJsdocConfig(targetDirPath, config) { const configPath = path.join(targetDirPath, "jsdoc-config.json"); await writeFile(configPath, config); return configPath; }
[ "async", "function", "writeJsdocConfig", "(", "targetDirPath", ",", "config", ")", "{", "const", "configPath", "=", "path", ".", "join", "(", "targetDirPath", ",", "\"jsdoc-config.json\"", ")", ";", "await", "writeFile", "(", "configPath", ",", "config", ")", ...
Write jsdoc-config.json to file system @private @param {string} targetDirPath Directory Path to write the jsdoc-config.json file to @param {string} config jsdoc-config.json content @returns {string} Full path to the written jsdoc-config.json file
[ "Write", "jsdoc", "-", "config", ".", "json", "to", "file", "system" ]
bea878bd64d7d6a9b549717d26e4e928355a0c6c
https://github.com/SAP/ui5-builder/blob/bea878bd64d7d6a9b549717d26e4e928355a0c6c/lib/processors/jsdoc/jsdocGenerator.js#L123-L127
9,701
SAP/ui5-builder
lib/processors/jsdoc/jsdocGenerator.js
buildJsdoc
async function buildJsdoc({sourcePath, configPath}) { const args = [ require.resolve("jsdoc/jsdoc"), "-c", configPath, "--verbose", sourcePath ]; return new Promise((resolve, reject) => { const child = spawn("node", args, { stdio: ["ignore", "ignore", process.stderr] }); child.on("close", function...
javascript
async function buildJsdoc({sourcePath, configPath}) { const args = [ require.resolve("jsdoc/jsdoc"), "-c", configPath, "--verbose", sourcePath ]; return new Promise((resolve, reject) => { const child = spawn("node", args, { stdio: ["ignore", "ignore", process.stderr] }); child.on("close", function...
[ "async", "function", "buildJsdoc", "(", "{", "sourcePath", ",", "configPath", "}", ")", "{", "const", "args", "=", "[", "require", ".", "resolve", "(", "\"jsdoc/jsdoc\"", ")", ",", "\"-c\"", ",", "configPath", ",", "\"--verbose\"", ",", "sourcePath", "]", ...
Execute JSDoc build by spawning JSDoc as an external process @private @param {Object} parameters Parameters @param {string} parameters.sourcePath Project resources (input for JSDoc generation) @param {string} parameters.configPath Full path to jsdoc-config.json file @returns {Promise<undefined>}
[ "Execute", "JSDoc", "build", "by", "spawning", "JSDoc", "as", "an", "external", "process" ]
bea878bd64d7d6a9b549717d26e4e928355a0c6c
https://github.com/SAP/ui5-builder/blob/bea878bd64d7d6a9b549717d26e4e928355a0c6c/lib/processors/jsdoc/jsdocGenerator.js#L139-L159
9,702
SAP/ui5-builder
lib/lbt/utils/ModuleName.js
fromUI5LegacyName
function fromUI5LegacyName(name, suffix) { // UI5 only supports a few names with dots in them, anything else will be converted to slashes if ( name.startsWith("sap.ui.thirdparty.jquery.jquery-") ) { name = "sap/ui/thirdparty/jquery/jquery-" + name.slice("sap.ui.thirdparty.jquery.jquery-".length); } else if ( name....
javascript
function fromUI5LegacyName(name, suffix) { // UI5 only supports a few names with dots in them, anything else will be converted to slashes if ( name.startsWith("sap.ui.thirdparty.jquery.jquery-") ) { name = "sap/ui/thirdparty/jquery/jquery-" + name.slice("sap.ui.thirdparty.jquery.jquery-".length); } else if ( name....
[ "function", "fromUI5LegacyName", "(", "name", ",", "suffix", ")", "{", "// UI5 only supports a few names with dots in them, anything else will be converted to slashes", "if", "(", "name", ".", "startsWith", "(", "\"sap.ui.thirdparty.jquery.jquery-\"", ")", ")", "{", "name", "...
Creates a ModuleName from a string in UI5 module name syntax. @private @param {string} name String that represents a UI5 module name (dot separated) @param {string} [suffix='.js'] Suffix to add to the resulting resource name @returns {string} URN representing the same resource
[ "Creates", "a", "ModuleName", "from", "a", "string", "in", "UI5", "module", "name", "syntax", "." ]
bea878bd64d7d6a9b549717d26e4e928355a0c6c
https://github.com/SAP/ui5-builder/blob/bea878bd64d7d6a9b549717d26e4e928355a0c6c/lib/lbt/utils/ModuleName.js#L11-L21
9,703
SAP/ui5-builder
lib/types/typeRepository.js
addType
function addType(typeName, type) { if (types[typeName]) { throw new Error("Type already registered '" + typeName + "'"); } types[typeName] = type; }
javascript
function addType(typeName, type) { if (types[typeName]) { throw new Error("Type already registered '" + typeName + "'"); } types[typeName] = type; }
[ "function", "addType", "(", "typeName", ",", "type", ")", "{", "if", "(", "types", "[", "typeName", "]", ")", "{", "throw", "new", "Error", "(", "\"Type already registered '\"", "+", "typeName", "+", "\"'\"", ")", ";", "}", "types", "[", "typeName", "]",...
Adds a type @param {string} typeName unique identifier for the type @param {Object} type @throws {Error} if duplicate with same name was found
[ "Adds", "a", "type" ]
bea878bd64d7d6a9b549717d26e4e928355a0c6c
https://github.com/SAP/ui5-builder/blob/bea878bd64d7d6a9b549717d26e4e928355a0c6c/lib/types/typeRepository.js#L34-L39
9,704
SAP/ui5-builder
lib/tasks/jsdoc/generateJsdoc.js
async function({workspace, dependencies, options} = {}) { if (!options || !options.projectName || !options.namespace || !options.version || !options.pattern) { throw new Error("[generateJsdoc]: One or more mandatory options not provided"); } const {sourcePath: resourcePath, targetPath, tmpPath} = await generateJs...
javascript
async function({workspace, dependencies, options} = {}) { if (!options || !options.projectName || !options.namespace || !options.version || !options.pattern) { throw new Error("[generateJsdoc]: One or more mandatory options not provided"); } const {sourcePath: resourcePath, targetPath, tmpPath} = await generateJs...
[ "async", "function", "(", "{", "workspace", ",", "dependencies", ",", "options", "}", "=", "{", "}", ")", "{", "if", "(", "!", "options", "||", "!", "options", ".", "projectName", "||", "!", "options", ".", "namespace", "||", "!", "options", ".", "ve...
Task to execute a JSDoc build for UI5 projects @public @alias module:@ui5/builder.tasks.generateJsdoc @param {Object} parameters Parameters @param {module:@ui5/fs.DuplexCollection} parameters.workspace DuplexCollection to read and write files @param {module:@ui5/fs.AbstractReader} parameters.dependencies Reader or Col...
[ "Task", "to", "execute", "a", "JSDoc", "build", "for", "UI5", "projects" ]
bea878bd64d7d6a9b549717d26e4e928355a0c6c
https://github.com/SAP/ui5-builder/blob/bea878bd64d7d6a9b549717d26e4e928355a0c6c/lib/tasks/jsdoc/generateJsdoc.js#L25-L65
9,705
SAP/ui5-builder
lib/tasks/jsdoc/generateJsdoc.js
createTmpDirs
async function createTmpDirs(projectName) { const {path: tmpDirPath} = await createTmpDir(projectName); const sourcePath = path.join(tmpDirPath, "src"); // dir will be created by writing project resources below await makeDir(sourcePath, {fs}); const targetPath = path.join(tmpDirPath, "target"); // dir will be crea...
javascript
async function createTmpDirs(projectName) { const {path: tmpDirPath} = await createTmpDir(projectName); const sourcePath = path.join(tmpDirPath, "src"); // dir will be created by writing project resources below await makeDir(sourcePath, {fs}); const targetPath = path.join(tmpDirPath, "target"); // dir will be crea...
[ "async", "function", "createTmpDirs", "(", "projectName", ")", "{", "const", "{", "path", ":", "tmpDirPath", "}", "=", "await", "createTmpDir", "(", "projectName", ")", ";", "const", "sourcePath", "=", "path", ".", "join", "(", "tmpDirPath", ",", "\"src\"", ...
Create temporary directories for JSDoc generation processor @private @param {string} projectName Project name used for naming the temporary working directory @returns {Promise<Object>} Promise resolving with sourcePath, targetPath and tmpPath strings
[ "Create", "temporary", "directories", "for", "JSDoc", "generation", "processor" ]
bea878bd64d7d6a9b549717d26e4e928355a0c6c
https://github.com/SAP/ui5-builder/blob/bea878bd64d7d6a9b549717d26e4e928355a0c6c/lib/tasks/jsdoc/generateJsdoc.js#L75-L91
9,706
SAP/ui5-builder
lib/tasks/jsdoc/generateJsdoc.js
createTmpDir
function createTmpDir(projectName, keep = false) { // Remove all non alpha-num characters from project name const sanitizedProjectName = projectName.replace(/[^A-Za-z0-9]/g, ""); return new Promise((resolve, reject) => { tmp.dir({ prefix: `ui5-tooling-tmp-jsdoc-${sanitizedProjectName}-`, keep, unsafeClean...
javascript
function createTmpDir(projectName, keep = false) { // Remove all non alpha-num characters from project name const sanitizedProjectName = projectName.replace(/[^A-Za-z0-9]/g, ""); return new Promise((resolve, reject) => { tmp.dir({ prefix: `ui5-tooling-tmp-jsdoc-${sanitizedProjectName}-`, keep, unsafeClean...
[ "function", "createTmpDir", "(", "projectName", ",", "keep", "=", "false", ")", "{", "// Remove all non alpha-num characters from project name", "const", "sanitizedProjectName", "=", "projectName", ".", "replace", "(", "/", "[^A-Za-z0-9]", "/", "g", ",", "\"\"", ")", ...
Create a temporary directory on the host system @private @param {string} projectName Project name used for naming the temporary directory @param {boolean} [keep=false] Whether to keep the temporary directory @returns {Promise<Object>} Promise resolving with path of the temporary directory
[ "Create", "a", "temporary", "directory", "on", "the", "host", "system" ]
bea878bd64d7d6a9b549717d26e4e928355a0c6c
https://github.com/SAP/ui5-builder/blob/bea878bd64d7d6a9b549717d26e4e928355a0c6c/lib/tasks/jsdoc/generateJsdoc.js#L101-L120
9,707
SAP/ui5-builder
lib/tasks/jsdoc/generateJsdoc.js
writeResourcesToDir
async function writeResourcesToDir({workspace, pattern, targetPath}) { const fsTarget = resourceFactory.createAdapter({ fsBasePath: targetPath, virBasePath: "/resources/" }); let allResources; if (workspace.byGlobSource) { // API only available on duplex collections allResources = await workspace.byGlobSourc...
javascript
async function writeResourcesToDir({workspace, pattern, targetPath}) { const fsTarget = resourceFactory.createAdapter({ fsBasePath: targetPath, virBasePath: "/resources/" }); let allResources; if (workspace.byGlobSource) { // API only available on duplex collections allResources = await workspace.byGlobSourc...
[ "async", "function", "writeResourcesToDir", "(", "{", "workspace", ",", "pattern", ",", "targetPath", "}", ")", "{", "const", "fsTarget", "=", "resourceFactory", ".", "createAdapter", "(", "{", "fsBasePath", ":", "targetPath", ",", "virBasePath", ":", "\"/resour...
Write resources from workspace matching the given pattern to the given fs destination @private @param {Object} parameters Parameters @param {module:@ui5/fs.DuplexCollection} parameters.workspace DuplexCollection to read and write files @param {string} parameters.pattern Pattern to match resources in workspace against ...
[ "Write", "resources", "from", "workspace", "matching", "the", "given", "pattern", "to", "the", "given", "fs", "destination" ]
bea878bd64d7d6a9b549717d26e4e928355a0c6c
https://github.com/SAP/ui5-builder/blob/bea878bd64d7d6a9b549717d26e4e928355a0c6c/lib/tasks/jsdoc/generateJsdoc.js#L132-L148
9,708
SAP/ui5-builder
lib/tasks/jsdoc/generateJsdoc.js
writeDependencyApisToDir
async function writeDependencyApisToDir({dependencies, targetPath}) { const depApis = await dependencies.byGlob("/test-resources/**/designtime/api.json"); // Clone resources before changing their path const apis = await Promise.all(depApis.map((resource) => resource.clone())); for (let i = 0; i < apis.length; i++...
javascript
async function writeDependencyApisToDir({dependencies, targetPath}) { const depApis = await dependencies.byGlob("/test-resources/**/designtime/api.json"); // Clone resources before changing their path const apis = await Promise.all(depApis.map((resource) => resource.clone())); for (let i = 0; i < apis.length; i++...
[ "async", "function", "writeDependencyApisToDir", "(", "{", "dependencies", ",", "targetPath", "}", ")", "{", "const", "depApis", "=", "await", "dependencies", ".", "byGlob", "(", "\"/test-resources/**/designtime/api.json\"", ")", ";", "// Clone resources before changing t...
Write api.json files of dependencies to given target path in a flat structure @private @param {Object} parameters Parameters @param {module:@ui5/fs.AbstractReader} parameters.dependencies Reader or Collection to read dependency files @param {string} parameters.targetPath Path to write the resources to @returns {Promis...
[ "Write", "api", ".", "json", "files", "of", "dependencies", "to", "given", "target", "path", "in", "a", "flat", "structure" ]
bea878bd64d7d6a9b549717d26e4e928355a0c6c
https://github.com/SAP/ui5-builder/blob/bea878bd64d7d6a9b549717d26e4e928355a0c6c/lib/tasks/jsdoc/generateJsdoc.js#L159-L175
9,709
SAP/ui5-builder
lib/builder/builder.js
getElapsedTime
function getElapsedTime(startTime) { const prettyHrtime = require("pretty-hrtime"); const timeDiff = process.hrtime(startTime); return prettyHrtime(timeDiff); }
javascript
function getElapsedTime(startTime) { const prettyHrtime = require("pretty-hrtime"); const timeDiff = process.hrtime(startTime); return prettyHrtime(timeDiff); }
[ "function", "getElapsedTime", "(", "startTime", ")", "{", "const", "prettyHrtime", "=", "require", "(", "\"pretty-hrtime\"", ")", ";", "const", "timeDiff", "=", "process", ".", "hrtime", "(", "startTime", ")", ";", "return", "prettyHrtime", "(", "timeDiff", ")...
Calculates the elapsed build time and returns a prettified output @private @param {Array} startTime Array provided by <code>process.hrtime()</code> @returns {string} Difference between now and the provided time array as formatted string
[ "Calculates", "the", "elapsed", "build", "time", "and", "returns", "a", "prettified", "output" ]
bea878bd64d7d6a9b549717d26e4e928355a0c6c
https://github.com/SAP/ui5-builder/blob/bea878bd64d7d6a9b549717d26e4e928355a0c6c/lib/builder/builder.js#L23-L27
9,710
SAP/ui5-builder
lib/builder/builder.js
composeTaskList
function composeTaskList({dev, selfContained, jsdoc, includedTasks, excludedTasks}) { let selectedTasks = Object.keys(definedTasks).reduce((list, key) => { list[key] = true; return list; }, {}); // Exclude non default tasks selectedTasks.generateManifestBundle = false; selectedTasks.generateStandaloneAppBundl...
javascript
function composeTaskList({dev, selfContained, jsdoc, includedTasks, excludedTasks}) { let selectedTasks = Object.keys(definedTasks).reduce((list, key) => { list[key] = true; return list; }, {}); // Exclude non default tasks selectedTasks.generateManifestBundle = false; selectedTasks.generateStandaloneAppBundl...
[ "function", "composeTaskList", "(", "{", "dev", ",", "selfContained", ",", "jsdoc", ",", "includedTasks", ",", "excludedTasks", "}", ")", "{", "let", "selectedTasks", "=", "Object", ".", "keys", "(", "definedTasks", ")", ".", "reduce", "(", "(", "list", ",...
Creates the list of tasks to be executed by the build process Sets specific tasks to be disabled by default, these tasks need to be included explicitly. Based on the selected build mode (dev|selfContained|preload), different tasks are enabled. Tasks can be enabled or disabled. The wildcard <code>*</code> is also suppo...
[ "Creates", "the", "list", "of", "tasks", "to", "be", "executed", "by", "the", "build", "process" ]
bea878bd64d7d6a9b549717d26e4e928355a0c6c
https://github.com/SAP/ui5-builder/blob/bea878bd64d7d6a9b549717d26e4e928355a0c6c/lib/builder/builder.js#L45-L131
9,711
SAP/ui5-builder
lib/processors/manifestCreator.js
registrationIds
function registrationIds() { const ids = []; for (const regid of findChildren(sapFioriAppData, "registrationId")) { ids.push(regid._); } return ids.length > 0 ? ids : undefined; }
javascript
function registrationIds() { const ids = []; for (const regid of findChildren(sapFioriAppData, "registrationId")) { ids.push(regid._); } return ids.length > 0 ? ids : undefined; }
[ "function", "registrationIds", "(", ")", "{", "const", "ids", "=", "[", "]", ";", "for", "(", "const", "regid", "of", "findChildren", "(", "sapFioriAppData", ",", "\"registrationId\"", ")", ")", "{", "ids", ".", "push", "(", "regid", ".", "_", ")", ";"...
collect registrationIds if present
[ "collect", "registrationIds", "if", "present" ]
bea878bd64d7d6a9b549717d26e4e928355a0c6c
https://github.com/SAP/ui5-builder/blob/bea878bd64d7d6a9b549717d26e4e928355a0c6c/lib/processors/manifestCreator.js#L470-L476
9,712
SAP/ui5-builder
lib/lbt/graph/topologicalSort.js
createDependencyGraph
function createDependencyGraph(pool, moduleNames, indegreeOnly) { const graph = Object.create(null); const promises = moduleNames.map( (moduleName) => { return pool.getModuleInfo(moduleName). then( (module) => { let node = graph[moduleName]; if ( node == null ) { node = new GraphNode(moduleName, in...
javascript
function createDependencyGraph(pool, moduleNames, indegreeOnly) { const graph = Object.create(null); const promises = moduleNames.map( (moduleName) => { return pool.getModuleInfo(moduleName). then( (module) => { let node = graph[moduleName]; if ( node == null ) { node = new GraphNode(moduleName, in...
[ "function", "createDependencyGraph", "(", "pool", ",", "moduleNames", ",", "indegreeOnly", ")", "{", "const", "graph", "=", "Object", ".", "create", "(", "null", ")", ";", "const", "promises", "=", "moduleNames", ".", "map", "(", "(", "moduleName", ")", "=...
Creates a dependency graph from the given moduleNames. Ignores modules not in the pool @param {ResourcePool} pool @param {string[]} moduleNames @param {boolean} indegreeOnly @returns {Promise<Object>} @private
[ "Creates", "a", "dependency", "graph", "from", "the", "given", "moduleNames", ".", "Ignores", "modules", "not", "in", "the", "pool" ]
bea878bd64d7d6a9b549717d26e4e928355a0c6c
https://github.com/SAP/ui5-builder/blob/bea878bd64d7d6a9b549717d26e4e928355a0c6c/lib/lbt/graph/topologicalSort.js#L40-L81
9,713
SAP/ui5-builder
lib/lbt/utils/ASTUtils.js
isString
function isString(node, literal) { if ( node == null || node.type !== Syntax.Literal || typeof node.value !== "string" ) { return false; } return literal == null ? true : node.value === literal; }
javascript
function isString(node, literal) { if ( node == null || node.type !== Syntax.Literal || typeof node.value !== "string" ) { return false; } return literal == null ? true : node.value === literal; }
[ "function", "isString", "(", "node", ",", "literal", ")", "{", "if", "(", "node", "==", "null", "||", "node", ".", "type", "!==", "Syntax", ".", "Literal", "||", "typeof", "node", ".", "value", "!==", "\"string\"", ")", "{", "return", "false", ";", "...
Checks whether the given node is a string literal. If second parameter 'literal' is given, the value of the node is additionally compared with that literal. @private @param {ESTree} node @param {string} [literal] @returns {boolean} Whether the node is a literal and whether its value matches the given string
[ "Checks", "whether", "the", "given", "node", "is", "a", "string", "literal", "." ]
bea878bd64d7d6a9b549717d26e4e928355a0c6c
https://github.com/SAP/ui5-builder/blob/bea878bd64d7d6a9b549717d26e4e928355a0c6c/lib/lbt/utils/ASTUtils.js#L15-L20
9,714
SAP/ui5-builder
lib/lbt/utils/ASTUtils.js
getStringArray
function getStringArray(array, skipNonStringLiterals) { return array.elements.reduce( (result, item) => { if ( isString(item) ) { result.push(item.value); } else if ( !skipNonStringLiterals ) { throw new TypeError("array element is not a string literal:" + item.type); } return result; }, []); }
javascript
function getStringArray(array, skipNonStringLiterals) { return array.elements.reduce( (result, item) => { if ( isString(item) ) { result.push(item.value); } else if ( !skipNonStringLiterals ) { throw new TypeError("array element is not a string literal:" + item.type); } return result; }, []); }
[ "function", "getStringArray", "(", "array", ",", "skipNonStringLiterals", ")", "{", "return", "array", ".", "elements", ".", "reduce", "(", "(", "result", ",", "item", ")", "=>", "{", "if", "(", "isString", "(", "item", ")", ")", "{", "result", ".", "p...
Converts an AST node of type 'ArrayExpression' into an array of strings, assuming that each item in the array literal is a string literal. Depending on the parameter skipNonStringLiterals, unexpected items in the array are either ignored or cause the method to fail with a TypeError. @param {ESTree} array @param {bool...
[ "Converts", "an", "AST", "node", "of", "type", "ArrayExpression", "into", "an", "array", "of", "strings", "assuming", "that", "each", "item", "in", "the", "array", "literal", "is", "a", "string", "literal", "." ]
bea878bd64d7d6a9b549717d26e4e928355a0c6c
https://github.com/SAP/ui5-builder/blob/bea878bd64d7d6a9b549717d26e4e928355a0c6c/lib/lbt/utils/ASTUtils.js#L96-L105
9,715
perry-mitchell/webdav-client
source/factory.js
copyFile
function copyFile(remotePath, targetRemotePath, options) { const copyOptions = merge(baseOptions, options || {}); return copy.copyFile(remotePath, targetRemotePath, copyOptions); }
javascript
function copyFile(remotePath, targetRemotePath, options) { const copyOptions = merge(baseOptions, options || {}); return copy.copyFile(remotePath, targetRemotePath, copyOptions); }
[ "function", "copyFile", "(", "remotePath", ",", "targetRemotePath", ",", "options", ")", "{", "const", "copyOptions", "=", "merge", "(", "baseOptions", ",", "options", "||", "{", "}", ")", ";", "return", "copy", ".", "copyFile", "(", "remotePath", ",", "ta...
Copy a remote item to another path @param {String} remotePath The remote item path @param {String} targetRemotePath The path file will be copied to @param {UserOptions=} options Options for the request @memberof ClientInterface @returns {Promise} A promise that resolves once the request has completed @example await cli...
[ "Copy", "a", "remote", "item", "to", "another", "path" ]
d23165a7e3e3760312fe39ec1227e729a4e3ab80
https://github.com/perry-mitchell/webdav-client/blob/d23165a7e3e3760312fe39ec1227e729a4e3ab80/source/factory.js#L127-L130
9,716
perry-mitchell/webdav-client
source/factory.js
createReadStream
function createReadStream(remoteFilename, options) { const createOptions = merge(baseOptions, options || {}); return createStream.createReadStream(remoteFilename, createOptions); }
javascript
function createReadStream(remoteFilename, options) { const createOptions = merge(baseOptions, options || {}); return createStream.createReadStream(remoteFilename, createOptions); }
[ "function", "createReadStream", "(", "remoteFilename", ",", "options", ")", "{", "const", "createOptions", "=", "merge", "(", "baseOptions", ",", "options", "||", "{", "}", ")", ";", "return", "createStream", ".", "createReadStream", "(", "remoteFilename", ",", ...
Create a readable stream of a remote file @param {String} remoteFilename The file to stream @param {UserOptions=} options Options for the request @memberof ClientInterface @returns {Readable} A readable stream @example const remote = client.createReadStream("/data.zip"); remote.pipe(someWriteStream);
[ "Create", "a", "readable", "stream", "of", "a", "remote", "file" ]
d23165a7e3e3760312fe39ec1227e729a4e3ab80
https://github.com/perry-mitchell/webdav-client/blob/d23165a7e3e3760312fe39ec1227e729a4e3ab80/source/factory.js#L156-L159
9,717
perry-mitchell/webdav-client
source/factory.js
createWriteStream
function createWriteStream(remoteFilename, options) { const createOptions = merge(baseOptions, options || {}); return createStream.createWriteStream(remoteFilename, createOptions); }
javascript
function createWriteStream(remoteFilename, options) { const createOptions = merge(baseOptions, options || {}); return createStream.createWriteStream(remoteFilename, createOptions); }
[ "function", "createWriteStream", "(", "remoteFilename", ",", "options", ")", "{", "const", "createOptions", "=", "merge", "(", "baseOptions", ",", "options", "||", "{", "}", ")", ";", "return", "createStream", ".", "createWriteStream", "(", "remoteFilename", ","...
Create a writeable stream to a remote file @param {String} remoteFilename The file to write to @param {PutOptions=} options Options for the request @memberof ClientInterface @returns {Writeable} A writeable stream @example const remote = client.createWriteStream("/data.zip"); fs.createReadStream("~/myData.zip").pipe(re...
[ "Create", "a", "writeable", "stream", "to", "a", "remote", "file" ]
d23165a7e3e3760312fe39ec1227e729a4e3ab80
https://github.com/perry-mitchell/webdav-client/blob/d23165a7e3e3760312fe39ec1227e729a4e3ab80/source/factory.js#L171-L174
9,718
perry-mitchell/webdav-client
source/factory.js
deleteFile
function deleteFile(remotePath, options) { const deleteOptions = merge(baseOptions, options || {}); return deletion.deleteFile(remotePath, deleteOptions); }
javascript
function deleteFile(remotePath, options) { const deleteOptions = merge(baseOptions, options || {}); return deletion.deleteFile(remotePath, deleteOptions); }
[ "function", "deleteFile", "(", "remotePath", ",", "options", ")", "{", "const", "deleteOptions", "=", "merge", "(", "baseOptions", ",", "options", "||", "{", "}", ")", ";", "return", "deletion", ".", "deleteFile", "(", "remotePath", ",", "deleteOptions", ")"...
Delete a remote file @param {String} remotePath The remote path to delete @param {UserOptions=} options The options for the request @memberof ClientInterface @returns {Promise} A promise that resolves when the remote file as been deleted @example await client.deleteFile("/some/file.txt");
[ "Delete", "a", "remote", "file" ]
d23165a7e3e3760312fe39ec1227e729a4e3ab80
https://github.com/perry-mitchell/webdav-client/blob/d23165a7e3e3760312fe39ec1227e729a4e3ab80/source/factory.js#L185-L188
9,719
perry-mitchell/webdav-client
source/factory.js
getDirectoryContents
function getDirectoryContents(remotePath, options) { const getOptions = merge(baseOptions, options || {}); return directoryContents.getDirectoryContents(remotePath, getOptions); }
javascript
function getDirectoryContents(remotePath, options) { const getOptions = merge(baseOptions, options || {}); return directoryContents.getDirectoryContents(remotePath, getOptions); }
[ "function", "getDirectoryContents", "(", "remotePath", ",", "options", ")", "{", "const", "getOptions", "=", "merge", "(", "baseOptions", ",", "options", "||", "{", "}", ")", ";", "return", "directoryContents", ".", "getDirectoryContents", "(", "remotePath", ","...
Get the contents of a remote directory @param {String} remotePath The path to fetch the contents of @param {GetDirectoryContentsOptions=} options Options for the remote the request @returns {Promise.<Array.<Stat>>} A promise that resolves with an array of remote item stats @memberof ClientInterface @example const conte...
[ "Get", "the", "contents", "of", "a", "remote", "directory" ]
d23165a7e3e3760312fe39ec1227e729a4e3ab80
https://github.com/perry-mitchell/webdav-client/blob/d23165a7e3e3760312fe39ec1227e729a4e3ab80/source/factory.js#L199-L202
9,720
perry-mitchell/webdav-client
source/factory.js
getFileContents
function getFileContents(remoteFilename, options) { const getOptions = merge(baseOptions, options || {}); getOptions.format = getOptions.format || "binary"; if (["binary", "text"].indexOf(getOptions.format) < 0) { throw new Error("Unknown format: " + getOptions.format...
javascript
function getFileContents(remoteFilename, options) { const getOptions = merge(baseOptions, options || {}); getOptions.format = getOptions.format || "binary"; if (["binary", "text"].indexOf(getOptions.format) < 0) { throw new Error("Unknown format: " + getOptions.format...
[ "function", "getFileContents", "(", "remoteFilename", ",", "options", ")", "{", "const", "getOptions", "=", "merge", "(", "baseOptions", ",", "options", "||", "{", "}", ")", ";", "getOptions", ".", "format", "=", "getOptions", ".", "format", "||", "\"binary\...
Get the contents of a remote file @param {String} remoteFilename The file to fetch @param {OptionsWithFormat=} options Options for the request @memberof ClientInterface @returns {Promise.<Buffer|String>} A promise that resolves with the contents of the remote file @example // Fetching data: const buff = await client.ge...
[ "Get", "the", "contents", "of", "a", "remote", "file" ]
d23165a7e3e3760312fe39ec1227e729a4e3ab80
https://github.com/perry-mitchell/webdav-client/blob/d23165a7e3e3760312fe39ec1227e729a4e3ab80/source/factory.js#L216-L225
9,721
perry-mitchell/webdav-client
source/factory.js
getFileDownloadLink
function getFileDownloadLink(remoteFilename, options) { const getOptions = merge(baseOptions, options || {}); return getFile.getFileLink(remoteFilename, getOptions); }
javascript
function getFileDownloadLink(remoteFilename, options) { const getOptions = merge(baseOptions, options || {}); return getFile.getFileLink(remoteFilename, getOptions); }
[ "function", "getFileDownloadLink", "(", "remoteFilename", ",", "options", ")", "{", "const", "getOptions", "=", "merge", "(", "baseOptions", ",", "options", "||", "{", "}", ")", ";", "return", "getFile", ".", "getFileLink", "(", "remoteFilename", ",", "getOpti...
Get the download link of a remote file Only supported for Basic authentication or unauthenticated connections. @param {String} remoteFilename The file url to fetch @param {UserOptions=} options Options for the request @memberof ClientInterface @returns {String} A download URL
[ "Get", "the", "download", "link", "of", "a", "remote", "file", "Only", "supported", "for", "Basic", "authentication", "or", "unauthenticated", "connections", "." ]
d23165a7e3e3760312fe39ec1227e729a4e3ab80
https://github.com/perry-mitchell/webdav-client/blob/d23165a7e3e3760312fe39ec1227e729a4e3ab80/source/factory.js#L235-L238
9,722
perry-mitchell/webdav-client
source/factory.js
getFileUploadLink
function getFileUploadLink(remoteFilename, options) { var putOptions = merge(baseOptions, options || {}); return putFile.getFileUploadLink(remoteFilename, putOptions); }
javascript
function getFileUploadLink(remoteFilename, options) { var putOptions = merge(baseOptions, options || {}); return putFile.getFileUploadLink(remoteFilename, putOptions); }
[ "function", "getFileUploadLink", "(", "remoteFilename", ",", "options", ")", "{", "var", "putOptions", "=", "merge", "(", "baseOptions", ",", "options", "||", "{", "}", ")", ";", "return", "putFile", ".", "getFileUploadLink", "(", "remoteFilename", ",", "putOp...
Get a file upload link Only supported for Basic authentication or unauthenticated connections. @param {String} remoteFilename The path of the remote file location @param {PutOptions=} options The options for the request @memberof ClientInterface @returns {String} A upload URL
[ "Get", "a", "file", "upload", "link", "Only", "supported", "for", "Basic", "authentication", "or", "unauthenticated", "connections", "." ]
d23165a7e3e3760312fe39ec1227e729a4e3ab80
https://github.com/perry-mitchell/webdav-client/blob/d23165a7e3e3760312fe39ec1227e729a4e3ab80/source/factory.js#L248-L251
9,723
perry-mitchell/webdav-client
source/factory.js
moveFile
function moveFile(remotePath, targetRemotePath, options) { const moveOptions = merge(baseOptions, options || {}); return move.moveFile(remotePath, targetRemotePath, moveOptions); }
javascript
function moveFile(remotePath, targetRemotePath, options) { const moveOptions = merge(baseOptions, options || {}); return move.moveFile(remotePath, targetRemotePath, moveOptions); }
[ "function", "moveFile", "(", "remotePath", ",", "targetRemotePath", ",", "options", ")", "{", "const", "moveOptions", "=", "merge", "(", "baseOptions", ",", "options", "||", "{", "}", ")", ";", "return", "move", ".", "moveFile", "(", "remotePath", ",", "ta...
Move a remote item to another path @param {String} remotePath The remote item path @param {String} targetRemotePath The new path after moving @param {UserOptions=} options Options for the request @memberof ClientInterface @returns {Promise} A promise that resolves once the request has completed @example await client.mo...
[ "Move", "a", "remote", "item", "to", "another", "path" ]
d23165a7e3e3760312fe39ec1227e729a4e3ab80
https://github.com/perry-mitchell/webdav-client/blob/d23165a7e3e3760312fe39ec1227e729a4e3ab80/source/factory.js#L274-L277
9,724
perry-mitchell/webdav-client
source/factory.js
putFileContents
function putFileContents(remoteFilename, data, options) { const putOptions = merge(baseOptions, options || {}); return putFile.putFileContents(remoteFilename, data, putOptions); }
javascript
function putFileContents(remoteFilename, data, options) { const putOptions = merge(baseOptions, options || {}); return putFile.putFileContents(remoteFilename, data, putOptions); }
[ "function", "putFileContents", "(", "remoteFilename", ",", "data", ",", "options", ")", "{", "const", "putOptions", "=", "merge", "(", "baseOptions", ",", "options", "||", "{", "}", ")", ";", "return", "putFile", ".", "putFileContents", "(", "remoteFilename", ...
Write contents to a remote file path @param {String} remoteFilename The path of the remote file @param {String|Buffer} data The data to write @param {PutOptions=} options The options for the request @returns {Promise} A promise that resolves once the contents have been written @memberof ClientInterface @example await c...
[ "Write", "contents", "to", "a", "remote", "file", "path" ]
d23165a7e3e3760312fe39ec1227e729a4e3ab80
https://github.com/perry-mitchell/webdav-client/blob/d23165a7e3e3760312fe39ec1227e729a4e3ab80/source/factory.js#L291-L294
9,725
perry-mitchell/webdav-client
source/factory.js
stat
function stat(remotePath, options) { const getOptions = merge(baseOptions, options || {}); return stats.getStat(remotePath, getOptions); }
javascript
function stat(remotePath, options) { const getOptions = merge(baseOptions, options || {}); return stats.getStat(remotePath, getOptions); }
[ "function", "stat", "(", "remotePath", ",", "options", ")", "{", "const", "getOptions", "=", "merge", "(", "baseOptions", ",", "options", "||", "{", "}", ")", ";", "return", "stats", ".", "getStat", "(", "remotePath", ",", "getOptions", ")", ";", "}" ]
Stat a remote object @param {String} remotePath The path of the item @param {OptionsForAdvancedResponses=} options Options for the request @memberof ClientInterface @returns {Promise.<Stat>} A promise that resolves with the stat data
[ "Stat", "a", "remote", "object" ]
d23165a7e3e3760312fe39ec1227e729a4e3ab80
https://github.com/perry-mitchell/webdav-client/blob/d23165a7e3e3760312fe39ec1227e729a4e3ab80/source/factory.js#L303-L306
9,726
perry-mitchell/webdav-client
source/request.js
encodePath
function encodePath(path) { const replaced = path.replace(/\//g, SEP_PATH_POSIX).replace(/\\\\/g, SEP_PATH_WINDOWS); const formatted = encodeURIComponent(replaced); return formatted .split(SEP_PATH_WINDOWS) .join("\\\\") .split(SEP_PATH_POSIX) .join("/"); }
javascript
function encodePath(path) { const replaced = path.replace(/\//g, SEP_PATH_POSIX).replace(/\\\\/g, SEP_PATH_WINDOWS); const formatted = encodeURIComponent(replaced); return formatted .split(SEP_PATH_WINDOWS) .join("\\\\") .split(SEP_PATH_POSIX) .join("/"); }
[ "function", "encodePath", "(", "path", ")", "{", "const", "replaced", "=", "path", ".", "replace", "(", "/", "\\/", "/", "g", ",", "SEP_PATH_POSIX", ")", ".", "replace", "(", "/", "\\\\\\\\", "/", "g", ",", "SEP_PATH_WINDOWS", ")", ";", "const", "forma...
Encode a path for use with WebDAV servers @param {String} path The path to encode @returns {String} The encoded path (separators protected)
[ "Encode", "a", "path", "for", "use", "with", "WebDAV", "servers" ]
d23165a7e3e3760312fe39ec1227e729a4e3ab80
https://github.com/perry-mitchell/webdav-client/blob/d23165a7e3e3760312fe39ec1227e729a4e3ab80/source/request.js#L13-L21
9,727
lumapps/lumX
modules/select/demo/js/demo-select_controller.js
callApi
function callApi() { vm.pageInfiniteScroll++; vm.loadingInfiniteScroll = true; return $http .get( 'https://randomuser.me/api/?results=10&seed=lumapps&page=' + vm.pageInfiniteScroll ) .then(function(response) { ...
javascript
function callApi() { vm.pageInfiniteScroll++; vm.loadingInfiniteScroll = true; return $http .get( 'https://randomuser.me/api/?results=10&seed=lumapps&page=' + vm.pageInfiniteScroll ) .then(function(response) { ...
[ "function", "callApi", "(", ")", "{", "vm", ".", "pageInfiniteScroll", "++", ";", "vm", ".", "loadingInfiniteScroll", "=", "true", ";", "return", "$http", ".", "get", "(", "'https://randomuser.me/api/?results=10&seed=lumapps&page='", "+", "vm", ".", "pageInfiniteScr...
Call sample API. @return {Promise} Promise containing an array of users.
[ "Call", "sample", "API", "." ]
50bfa6202261c5b311a59e8a2cc0d5eea6db1655
https://github.com/lumapps/lumX/blob/50bfa6202261c5b311a59e8a2cc0d5eea6db1655/modules/select/demo/js/demo-select_controller.js#L405-L432
9,728
lumapps/lumX
modules/notification/js/notification_service.js
reComputeElementsPosition
function reComputeElementsPosition() { var baseOffset = 0; for (var idx = notificationList.length -1; idx >= 0; idx--) { notificationList[idx].height = getElementHeight(notificationList[idx].elem[0]); notificationList[idx].margin = baseOffset;...
javascript
function reComputeElementsPosition() { var baseOffset = 0; for (var idx = notificationList.length -1; idx >= 0; idx--) { notificationList[idx].height = getElementHeight(notificationList[idx].elem[0]); notificationList[idx].margin = baseOffset;...
[ "function", "reComputeElementsPosition", "(", ")", "{", "var", "baseOffset", "=", "0", ";", "for", "(", "var", "idx", "=", "notificationList", ".", "length", "-", "1", ";", "idx", ">=", "0", ";", "idx", "--", ")", "{", "notificationList", "[", "idx", "...
Compute the notification list element new position. Usefull when the height change programmatically and you need other notifications to fit.
[ "Compute", "the", "notification", "list", "element", "new", "position", ".", "Usefull", "when", "the", "height", "change", "programmatically", "and", "you", "need", "other", "notifications", "to", "fit", "." ]
50bfa6202261c5b311a59e8a2cc0d5eea6db1655
https://github.com/lumapps/lumX/blob/50bfa6202261c5b311a59e8a2cc0d5eea6db1655/modules/notification/js/notification_service.js#L102-L115
9,729
lumapps/lumX
modules/notification/js/notification_service.js
buildDialogActions
function buildDialogActions(_buttons, _callback, _unbind) { var $compile = $injector.get('$compile'); var dialogActions = angular.element('<div/>', { class: 'dialog__footer' }); var dialogLastBtn = angular.element('<button/>', ...
javascript
function buildDialogActions(_buttons, _callback, _unbind) { var $compile = $injector.get('$compile'); var dialogActions = angular.element('<div/>', { class: 'dialog__footer' }); var dialogLastBtn = angular.element('<button/>', ...
[ "function", "buildDialogActions", "(", "_buttons", ",", "_callback", ",", "_unbind", ")", "{", "var", "$compile", "=", "$injector", ".", "get", "(", "'$compile'", ")", ";", "var", "dialogActions", "=", "angular", ".", "element", "(", "'<div/>'", ",", "{", ...
ALERT & CONFIRM
[ "ALERT", "&", "CONFIRM" ]
50bfa6202261c5b311a59e8a2cc0d5eea6db1655
https://github.com/lumapps/lumX/blob/50bfa6202261c5b311a59e8a2cc0d5eea6db1655/modules/notification/js/notification_service.js#L254-L320
9,730
lumapps/lumX
dist/lumx.js
_closePanes
function _closePanes() { toggledPanes = {}; if (lxSelect.choicesViewSize === 'large') { if (angular.isDefined(lxSelect.choices) && lxSelect.choices !== null) { lxSelect.panes = [lxSelect.choices]; } else { lxSelect.panes = ...
javascript
function _closePanes() { toggledPanes = {}; if (lxSelect.choicesViewSize === 'large') { if (angular.isDefined(lxSelect.choices) && lxSelect.choices !== null) { lxSelect.panes = [lxSelect.choices]; } else { lxSelect.panes = ...
[ "function", "_closePanes", "(", ")", "{", "toggledPanes", "=", "{", "}", ";", "if", "(", "lxSelect", ".", "choicesViewSize", "===", "'large'", ")", "{", "if", "(", "angular", ".", "isDefined", "(", "lxSelect", ".", "choices", ")", "&&", "lxSelect", ".", ...
Close all panes.
[ "Close", "all", "panes", "." ]
50bfa6202261c5b311a59e8a2cc0d5eea6db1655
https://github.com/lumapps/lumX/blob/50bfa6202261c5b311a59e8a2cc0d5eea6db1655/dist/lumx.js#L4436-L4452
9,731
lumapps/lumX
dist/lumx.js
_findIndex
function _findIndex(haystack, needle) { if (angular.isUndefined(haystack) || haystack.length === 0) { return -1; } for (var i = 0, len = haystack.length; i < len; i++) { if (haystack[i] === needle) { return i; } ...
javascript
function _findIndex(haystack, needle) { if (angular.isUndefined(haystack) || haystack.length === 0) { return -1; } for (var i = 0, len = haystack.length; i < len; i++) { if (haystack[i] === needle) { return i; } ...
[ "function", "_findIndex", "(", "haystack", ",", "needle", ")", "{", "if", "(", "angular", ".", "isUndefined", "(", "haystack", ")", "||", "haystack", ".", "length", "===", "0", ")", "{", "return", "-", "1", ";", "}", "for", "(", "var", "i", "=", "0...
Find the index of an element in an array. @param {Array} haystack The array in which to search for the value. @param {*} needle The value to search in the array. @return {number} The index of the value of the array, or -1 if not found.
[ "Find", "the", "index", "of", "an", "element", "in", "an", "array", "." ]
50bfa6202261c5b311a59e8a2cc0d5eea6db1655
https://github.com/lumapps/lumX/blob/50bfa6202261c5b311a59e8a2cc0d5eea6db1655/dist/lumx.js#L4461-L4473
9,732
lumapps/lumX
dist/lumx.js
_getLongestMatchingPath
function _getLongestMatchingPath(containing) { if (angular.isUndefined(lxSelect.matchingPaths) || lxSelect.matchingPaths.length === 0) { return undefined; } containing = containing || lxSelect.matchingPaths[0]; var longest = lxSelect.matchingPaths[0]; ...
javascript
function _getLongestMatchingPath(containing) { if (angular.isUndefined(lxSelect.matchingPaths) || lxSelect.matchingPaths.length === 0) { return undefined; } containing = containing || lxSelect.matchingPaths[0]; var longest = lxSelect.matchingPaths[0]; ...
[ "function", "_getLongestMatchingPath", "(", "containing", ")", "{", "if", "(", "angular", ".", "isUndefined", "(", "lxSelect", ".", "matchingPaths", ")", "||", "lxSelect", ".", "matchingPaths", ".", "length", "===", "0", ")", "{", "return", "undefined", ";", ...
Get the longest matching path containing the given string. @param {string} [containing] The string we want the matching path to contain. If none given, just take the longest matching path of the first matching path.
[ "Get", "the", "longest", "matching", "path", "containing", "the", "given", "string", "." ]
50bfa6202261c5b311a59e8a2cc0d5eea6db1655
https://github.com/lumapps/lumX/blob/50bfa6202261c5b311a59e8a2cc0d5eea6db1655/dist/lumx.js#L4481-L4508
9,733
lumapps/lumX
dist/lumx.js
_keyLeft
function _keyLeft() { if (lxSelect.choicesViewMode !== 'panes' || lxSelect.panes.length < 2) { return; } var previousPaneIndex = lxSelect.panes.length - 2; lxSelect.activeChoiceIndex = ( Object.keys(lxSelect.panes[previousPaneIndex]) || [...
javascript
function _keyLeft() { if (lxSelect.choicesViewMode !== 'panes' || lxSelect.panes.length < 2) { return; } var previousPaneIndex = lxSelect.panes.length - 2; lxSelect.activeChoiceIndex = ( Object.keys(lxSelect.panes[previousPaneIndex]) || [...
[ "function", "_keyLeft", "(", ")", "{", "if", "(", "lxSelect", ".", "choicesViewMode", "!==", "'panes'", "||", "lxSelect", ".", "panes", ".", "length", "<", "2", ")", "{", "return", ";", "}", "var", "previousPaneIndex", "=", "lxSelect", ".", "panes", ".",...
When the left key is pressed and we are displaying the choices in pane mode, close the most right opened pane.
[ "When", "the", "left", "key", "is", "pressed", "and", "we", "are", "displaying", "the", "choices", "in", "pane", "mode", "close", "the", "most", "right", "opened", "pane", "." ]
50bfa6202261c5b311a59e8a2cc0d5eea6db1655
https://github.com/lumapps/lumX/blob/50bfa6202261c5b311a59e8a2cc0d5eea6db1655/dist/lumx.js#L4544-L4558
9,734
lumapps/lumX
dist/lumx.js
_keyRight
function _keyRight() { if (lxSelect.choicesViewMode !== 'panes' || lxSelect.activeChoiceIndex === -1) { return; } var paneOpened = _openPane((lxSelect.panes.length - 1), lxSelect.activeChoiceIndex, true); if (paneOpened) { lxSelect.active...
javascript
function _keyRight() { if (lxSelect.choicesViewMode !== 'panes' || lxSelect.activeChoiceIndex === -1) { return; } var paneOpened = _openPane((lxSelect.panes.length - 1), lxSelect.activeChoiceIndex, true); if (paneOpened) { lxSelect.active...
[ "function", "_keyRight", "(", ")", "{", "if", "(", "lxSelect", ".", "choicesViewMode", "!==", "'panes'", "||", "lxSelect", ".", "activeChoiceIndex", "===", "-", "1", ")", "{", "return", ";", "}", "var", "paneOpened", "=", "_openPane", "(", "(", "lxSelect",...
When the right key is pressed and we are displaying the choices in pane mode, open the currently selected pane.
[ "When", "the", "right", "key", "is", "pressed", "and", "we", "are", "displaying", "the", "choices", "in", "pane", "mode", "open", "the", "currently", "selected", "pane", "." ]
50bfa6202261c5b311a59e8a2cc0d5eea6db1655
https://github.com/lumapps/lumX/blob/50bfa6202261c5b311a59e8a2cc0d5eea6db1655/dist/lumx.js#L4581-L4593
9,735
lumapps/lumX
dist/lumx.js
_keySelect
function _keySelect() { var filteredChoices; if (lxSelect.choicesViewMode === 'panes') { filteredChoices = lxSelect.panes[(lxSelect.panes.length - 1)]; if (!lxSelect.isLeaf(filteredChoices[lxSelect.activeChoiceIndex])) { return; ...
javascript
function _keySelect() { var filteredChoices; if (lxSelect.choicesViewMode === 'panes') { filteredChoices = lxSelect.panes[(lxSelect.panes.length - 1)]; if (!lxSelect.isLeaf(filteredChoices[lxSelect.activeChoiceIndex])) { return; ...
[ "function", "_keySelect", "(", ")", "{", "var", "filteredChoices", ";", "if", "(", "lxSelect", ".", "choicesViewMode", "===", "'panes'", ")", "{", "filteredChoices", "=", "lxSelect", ".", "panes", "[", "(", "lxSelect", ".", "panes", ".", "length", "-", "1"...
When the enter key is pressed, select the currently active choice.
[ "When", "the", "enter", "key", "is", "pressed", "select", "the", "currently", "active", "choice", "." ]
50bfa6202261c5b311a59e8a2cc0d5eea6db1655
https://github.com/lumapps/lumX/blob/50bfa6202261c5b311a59e8a2cc0d5eea6db1655/dist/lumx.js#L4598-L4628
9,736
lumapps/lumX
dist/lumx.js
_openPane
function _openPane(parentIndex, indexOrKey, checkIsLeaf) { if (angular.isDefined(toggledPanes[parentIndex])) { return false; } var pane = pane || lxSelect.choicesViewSize === 'large' ? lxSelect.panes[parentIndex] : lxSelect.openedPanes[parentIndex]; if (...
javascript
function _openPane(parentIndex, indexOrKey, checkIsLeaf) { if (angular.isDefined(toggledPanes[parentIndex])) { return false; } var pane = pane || lxSelect.choicesViewSize === 'large' ? lxSelect.panes[parentIndex] : lxSelect.openedPanes[parentIndex]; if (...
[ "function", "_openPane", "(", "parentIndex", ",", "indexOrKey", ",", "checkIsLeaf", ")", "{", "if", "(", "angular", ".", "isDefined", "(", "toggledPanes", "[", "parentIndex", "]", ")", ")", "{", "return", "false", ";", "}", "var", "pane", "=", "pane", "|...
Open a pane. If the pane is already opened, don't do anything. @param {number} parentIndex The index of the parent of the pane to open. @param {number|string} indexOrKey The index or the name of the pane to open. @param {boolean} [checkIsLeaf=false] Check if the pane we want to open is...
[ "Open", "a", "pane", ".", "If", "the", "pane", "is", "already", "opened", "don", "t", "do", "anything", "." ]
50bfa6202261c5b311a59e8a2cc0d5eea6db1655
https://github.com/lumapps/lumX/blob/50bfa6202261c5b311a59e8a2cc0d5eea6db1655/dist/lumx.js#L4677-L4710
9,737
lumapps/lumX
dist/lumx.js
_searchPath
function _searchPath(container, regexp, previousKey, limitToFields) { limitToFields = limitToFields || []; limitToFields = (angular.isArray(limitToFields)) ? limitToFields : [limitToFields]; var results = []; angular.forEach(container, function forEachItemsInContainer(i...
javascript
function _searchPath(container, regexp, previousKey, limitToFields) { limitToFields = limitToFields || []; limitToFields = (angular.isArray(limitToFields)) ? limitToFields : [limitToFields]; var results = []; angular.forEach(container, function forEachItemsInContainer(i...
[ "function", "_searchPath", "(", "container", ",", "regexp", ",", "previousKey", ",", "limitToFields", ")", "{", "limitToFields", "=", "limitToFields", "||", "[", "]", ";", "limitToFields", "=", "(", "angular", ".", "isArray", "(", "limitToFields", ")", ")", ...
Search for any path in an object containing the given regexp as a key or as a value. @param {*} container The container in which to search for the regexp. @param {RegExp} regexp The regular expression to search in keys or values of the object (nested) @param {string} previousKey ...
[ "Search", "for", "any", "path", "in", "an", "object", "containing", "the", "given", "regexp", "as", "a", "key", "or", "as", "a", "value", "." ]
50bfa6202261c5b311a59e8a2cc0d5eea6db1655
https://github.com/lumapps/lumX/blob/50bfa6202261c5b311a59e8a2cc0d5eea6db1655/dist/lumx.js#L4722-L4763
9,738
lumapps/lumX
dist/lumx.js
isLeaf
function isLeaf(obj) { if (angular.isUndefined(obj)) { return false; } if (angular.isArray(obj)) { return false; } if (!angular.isObject(obj)) { return true; } if (obj.isLeaf) { ...
javascript
function isLeaf(obj) { if (angular.isUndefined(obj)) { return false; } if (angular.isArray(obj)) { return false; } if (!angular.isObject(obj)) { return true; } if (obj.isLeaf) { ...
[ "function", "isLeaf", "(", "obj", ")", "{", "if", "(", "angular", ".", "isUndefined", "(", "obj", ")", ")", "{", "return", "false", ";", "}", "if", "(", "angular", ".", "isArray", "(", "obj", ")", ")", "{", "return", "false", ";", "}", "if", "(",...
Check if an object is a leaf object. A leaf object is an object that contains the `isLeaf` property or that has property that are anything else than object or arrays. @param {*} obj The object to check if it's a leaf @return {boolean} If the object is a leaf object.
[ "Check", "if", "an", "object", "is", "a", "leaf", "object", ".", "A", "leaf", "object", "is", "an", "object", "that", "contains", "the", "isLeaf", "property", "or", "that", "has", "property", "that", "are", "anything", "else", "than", "object", "or", "ar...
50bfa6202261c5b311a59e8a2cc0d5eea6db1655
https://github.com/lumapps/lumX/blob/50bfa6202261c5b311a59e8a2cc0d5eea6db1655/dist/lumx.js#L4882-L4914
9,739
lumapps/lumX
dist/lumx.js
isPaneToggled
function isPaneToggled(parentIndex, indexOrKey) { var pane = lxSelect.choicesViewSize === 'large' ? lxSelect.panes[parentIndex] : lxSelect.openedPanes[parentIndex]; if (angular.isUndefined(pane)) { return false; } var key = indexOrKey; if (an...
javascript
function isPaneToggled(parentIndex, indexOrKey) { var pane = lxSelect.choicesViewSize === 'large' ? lxSelect.panes[parentIndex] : lxSelect.openedPanes[parentIndex]; if (angular.isUndefined(pane)) { return false; } var key = indexOrKey; if (an...
[ "function", "isPaneToggled", "(", "parentIndex", ",", "indexOrKey", ")", "{", "var", "pane", "=", "lxSelect", ".", "choicesViewSize", "===", "'large'", "?", "lxSelect", ".", "panes", "[", "parentIndex", "]", ":", "lxSelect", ".", "openedPanes", "[", "parentInd...
Check if a pane is toggled. @param {number} parentIndex The parent index of the pane in which to check. @param {number|string} indexOrKey The index or the name of the pane to check. @return {boolean} If the pane is toggled or not.
[ "Check", "if", "a", "pane", "is", "toggled", "." ]
50bfa6202261c5b311a59e8a2cc0d5eea6db1655
https://github.com/lumapps/lumX/blob/50bfa6202261c5b311a59e8a2cc0d5eea6db1655/dist/lumx.js#L4923-L4936
9,740
lumapps/lumX
dist/lumx.js
isMatchingPath
function isMatchingPath(parentIndex, indexOrKey) { var pane = lxSelect.choicesViewSize === 'large' ? lxSelect.panes[parentIndex] : lxSelect.openedPanes[parentIndex]; if (angular.isUndefined(pane)) { return; } var key = indexOrKey; if (angular...
javascript
function isMatchingPath(parentIndex, indexOrKey) { var pane = lxSelect.choicesViewSize === 'large' ? lxSelect.panes[parentIndex] : lxSelect.openedPanes[parentIndex]; if (angular.isUndefined(pane)) { return; } var key = indexOrKey; if (angular...
[ "function", "isMatchingPath", "(", "parentIndex", ",", "indexOrKey", ")", "{", "var", "pane", "=", "lxSelect", ".", "choicesViewSize", "===", "'large'", "?", "lxSelect", ".", "panes", "[", "parentIndex", "]", ":", "lxSelect", ".", "openedPanes", "[", "parentIn...
Check if a path of a pane is matching the filter. @param {number} parentIndex The index of the pane. @param {number|string} indexOrKey The index or the name of the item to check.
[ "Check", "if", "a", "path", "of", "a", "pane", "is", "matching", "the", "filter", "." ]
50bfa6202261c5b311a59e8a2cc0d5eea6db1655
https://github.com/lumapps/lumX/blob/50bfa6202261c5b311a59e8a2cc0d5eea6db1655/dist/lumx.js#L4944-L4966
9,741
lumapps/lumX
dist/lumx.js
keyEvent
function keyEvent(evt) { if (evt.keyCode !== 8) { lxSelect.activeSelectedIndex = -1; } if (!LxDropdownService.isOpen('dropdown-' + lxSelect.uuid)) { lxSelect.activeChoiceIndex = -1; } switch (evt.keyCode) { cas...
javascript
function keyEvent(evt) { if (evt.keyCode !== 8) { lxSelect.activeSelectedIndex = -1; } if (!LxDropdownService.isOpen('dropdown-' + lxSelect.uuid)) { lxSelect.activeChoiceIndex = -1; } switch (evt.keyCode) { cas...
[ "function", "keyEvent", "(", "evt", ")", "{", "if", "(", "evt", ".", "keyCode", "!==", "8", ")", "{", "lxSelect", ".", "activeSelectedIndex", "=", "-", "1", ";", "}", "if", "(", "!", "LxDropdownService", ".", "isOpen", "(", "'dropdown-'", "+", "lxSelec...
Handle a key press event @param {Event} evt The key press event.
[ "Handle", "a", "key", "press", "event" ]
50bfa6202261c5b311a59e8a2cc0d5eea6db1655
https://github.com/lumapps/lumX/blob/50bfa6202261c5b311a59e8a2cc0d5eea6db1655/dist/lumx.js#L4994-L5041
9,742
lumapps/lumX
dist/lumx.js
toggleChoice
function toggleChoice(choice, evt) { if (lxSelect.multiple && !lxSelect.autocomplete && angular.isDefined(evt)) { evt.stopPropagation(); } if (lxSelect.areChoicesOpened() && lxSelect.multiple) { var dropdownElement = angular.element(angular.element(ev...
javascript
function toggleChoice(choice, evt) { if (lxSelect.multiple && !lxSelect.autocomplete && angular.isDefined(evt)) { evt.stopPropagation(); } if (lxSelect.areChoicesOpened() && lxSelect.multiple) { var dropdownElement = angular.element(angular.element(ev...
[ "function", "toggleChoice", "(", "choice", ",", "evt", ")", "{", "if", "(", "lxSelect", ".", "multiple", "&&", "!", "lxSelect", ".", "autocomplete", "&&", "angular", ".", "isDefined", "(", "evt", ")", ")", "{", "evt", ".", "stopPropagation", "(", ")", ...
Toggle the given choice. If it was selected, unselect it. If it wasn't selected, select it. @param {Object} choice The choice to toggle. @param {Event} [evt] The event that triggered the function.
[ "Toggle", "the", "given", "choice", ".", "If", "it", "was", "selected", "unselect", "it", ".", "If", "it", "wasn", "t", "selected", "select", "it", "." ]
50bfa6202261c5b311a59e8a2cc0d5eea6db1655
https://github.com/lumapps/lumX/blob/50bfa6202261c5b311a59e8a2cc0d5eea6db1655/dist/lumx.js#L5133-L5173
9,743
lumapps/lumX
dist/lumx.js
togglePane
function togglePane(evt, parentIndex, indexOrKey, selectLeaf) { selectLeaf = (angular.isUndefined(selectLeaf)) ? true : selectLeaf; var pane = lxSelect.choicesViewSize === 'large' ? lxSelect.panes[parentIndex] : lxSelect.openedPanes[parentIndex]; if (angular.isUndefined(pane)) { ...
javascript
function togglePane(evt, parentIndex, indexOrKey, selectLeaf) { selectLeaf = (angular.isUndefined(selectLeaf)) ? true : selectLeaf; var pane = lxSelect.choicesViewSize === 'large' ? lxSelect.panes[parentIndex] : lxSelect.openedPanes[parentIndex]; if (angular.isUndefined(pane)) { ...
[ "function", "togglePane", "(", "evt", ",", "parentIndex", ",", "indexOrKey", ",", "selectLeaf", ")", "{", "selectLeaf", "=", "(", "angular", ".", "isUndefined", "(", "selectLeaf", ")", ")", "?", "true", ":", "selectLeaf", ";", "var", "pane", "=", "lxSelect...
Toggle a pane. @param {Event} evt The click event that led to toggle the pane. @param {number} parentIndex The index of the containing pane. @param {number|string} indexOrKey The index or the name of the pane to toggle. @param {boolean} [selectLeaf=true] Indicates if we ...
[ "Toggle", "a", "pane", "." ]
50bfa6202261c5b311a59e8a2cc0d5eea6db1655
https://github.com/lumapps/lumX/blob/50bfa6202261c5b311a59e8a2cc0d5eea6db1655/dist/lumx.js#L5184-L5217
9,744
lumapps/lumX
dist/lumx.js
updateFilter
function updateFilter() { if (angular.isFunction(lxSelect.resetDropdownSize)) { lxSelect.resetDropdownSize(); } if (angular.isDefined(lxSelect.filter)) { lxSelect.matchingPaths = lxSelect.filter({ newValue: lxSelect.filterModel ...
javascript
function updateFilter() { if (angular.isFunction(lxSelect.resetDropdownSize)) { lxSelect.resetDropdownSize(); } if (angular.isDefined(lxSelect.filter)) { lxSelect.matchingPaths = lxSelect.filter({ newValue: lxSelect.filterModel ...
[ "function", "updateFilter", "(", ")", "{", "if", "(", "angular", ".", "isFunction", "(", "lxSelect", ".", "resetDropdownSize", ")", ")", "{", "lxSelect", ".", "resetDropdownSize", "(", ")", ";", "}", "if", "(", "angular", ".", "isDefined", "(", "lxSelect",...
Update the filter. Either filter the choices available or highlight the path to the matching elements.
[ "Update", "the", "filter", ".", "Either", "filter", "the", "choices", "available", "or", "highlight", "the", "path", "to", "the", "matching", "elements", "." ]
50bfa6202261c5b311a59e8a2cc0d5eea6db1655
https://github.com/lumapps/lumX/blob/50bfa6202261c5b311a59e8a2cc0d5eea6db1655/dist/lumx.js#L5276-L5315
9,745
lumapps/lumX
dist/lumx.js
searchPath
function searchPath(newValue) { if (!newValue || newValue.length < 2) { return undefined; } var regexp = new RegExp(LxUtils.escapeRegexp(newValue), 'ig'); return _searchPath(lxSelect.choices, regexp); }
javascript
function searchPath(newValue) { if (!newValue || newValue.length < 2) { return undefined; } var regexp = new RegExp(LxUtils.escapeRegexp(newValue), 'ig'); return _searchPath(lxSelect.choices, regexp); }
[ "function", "searchPath", "(", "newValue", ")", "{", "if", "(", "!", "newValue", "||", "newValue", ".", "length", "<", "2", ")", "{", "return", "undefined", ";", "}", "var", "regexp", "=", "new", "RegExp", "(", "LxUtils", ".", "escapeRegexp", "(", "new...
Search in the multipane select for the paths matching the search. @param {string} newValue The filter string.
[ "Search", "in", "the", "multipane", "select", "for", "the", "paths", "matching", "the", "search", "." ]
50bfa6202261c5b311a59e8a2cc0d5eea6db1655
https://github.com/lumapps/lumX/blob/50bfa6202261c5b311a59e8a2cc0d5eea6db1655/dist/lumx.js#L5368-L5376
9,746
mozilla/aframe-xr
src/components/ar-mode-ui.js
createEnterARButton
function createEnterARButton (clickHandler) { var arButton; // Create elements. arButton = document.createElement('button'); arButton.className = ENTER_AR_BTN_CLASS; arButton.setAttribute('title', 'Enter AR mode.'); arButton.setAttribute('aframe-injected', ''); arButton.addEventListener('click', functio...
javascript
function createEnterARButton (clickHandler) { var arButton; // Create elements. arButton = document.createElement('button'); arButton.className = ENTER_AR_BTN_CLASS; arButton.setAttribute('title', 'Enter AR mode.'); arButton.setAttribute('aframe-injected', ''); arButton.addEventListener('click', functio...
[ "function", "createEnterARButton", "(", "clickHandler", ")", "{", "var", "arButton", ";", "// Create elements.", "arButton", "=", "document", ".", "createElement", "(", "'button'", ")", ";", "arButton", ".", "className", "=", "ENTER_AR_BTN_CLASS", ";", "arButton", ...
Creates a button that when clicked will enter into stereo-rendering mode for AR. Structure: <div><button></div> @param {function} enterARHandler @returns {Element} Wrapper <div>.
[ "Creates", "a", "button", "that", "when", "clicked", "will", "enter", "into", "stereo", "-", "rendering", "mode", "for", "AR", "." ]
7ec17af3e65325b62fd2112e8158eb2e4310c0e0
https://github.com/mozilla/aframe-xr/blob/7ec17af3e65325b62fd2112e8158eb2e4310c0e0/src/components/ar-mode-ui.js#L135-L150
9,747
ryanhugh/searchneu
frontend/components/panels/LocationLinks.js
LocationLinks
function LocationLinks(props) { const elements = props.locations.map((location, index, locations) => { let buildingName; if (location.match(/\d+\s*$/i)) { buildingName = location.replace(/\d+\s*$/i, ''); } else { buildingName = location; } let optionalComma = null; if (index !== l...
javascript
function LocationLinks(props) { const elements = props.locations.map((location, index, locations) => { let buildingName; if (location.match(/\d+\s*$/i)) { buildingName = location.replace(/\d+\s*$/i, ''); } else { buildingName = location; } let optionalComma = null; if (index !== l...
[ "function", "LocationLinks", "(", "props", ")", "{", "const", "elements", "=", "props", ".", "locations", ".", "map", "(", "(", "location", ",", "index", ",", "locations", ")", "=>", "{", "let", "buildingName", ";", "if", "(", "location", ".", "match", ...
Calculate the Google Maps links from a given section. This is used in both the mobile section panel and the desktop section panel.
[ "Calculate", "the", "Google", "Maps", "links", "from", "a", "given", "section", ".", "This", "is", "used", "in", "both", "the", "mobile", "section", "panel", "and", "the", "desktop", "section", "panel", "." ]
9ede451e45924a86611fbbc252087ee3cccb4c63
https://github.com/ryanhugh/searchneu/blob/9ede451e45924a86611fbbc252087ee3cccb4c63/frontend/components/panels/LocationLinks.js#L15-L63
9,748
crazychicken/t-scroll
theme/js/custom.js
setCookie
function setCookie(pr_name, exdays) { var d = new Date(); d = (d.getTime() + (exdays*24*60*60*1000)); document.cookie = pr_name+"="+d + ";" + ";path=/"; }
javascript
function setCookie(pr_name, exdays) { var d = new Date(); d = (d.getTime() + (exdays*24*60*60*1000)); document.cookie = pr_name+"="+d + ";" + ";path=/"; }
[ "function", "setCookie", "(", "pr_name", ",", "exdays", ")", "{", "var", "d", "=", "new", "Date", "(", ")", ";", "d", "=", "(", "d", ".", "getTime", "(", ")", "+", "(", "exdays", "*", "24", "*", "60", "*", "60", "*", "1000", ")", ")", ";", ...
set the value, save data browser
[ "set", "the", "value", "save", "data", "browser" ]
a0e721f2e641fcae3f22b242e384d892fdd0d6e6
https://github.com/crazychicken/t-scroll/blob/a0e721f2e641fcae3f22b242e384d892fdd0d6e6/theme/js/custom.js#L47-L51
9,749
crazychicken/t-scroll
theme/js/custom.js
getCookie
function getCookie(pr_name) { var name = pr_name + "="; var ca = document.cookie.split(';'); for(var i = 0; i < ca.length; i++) { var c = ca[i]; c = c.trim(); if (c.indexOf(pr_name+"=") === 0) { return c.substring(name.length, c.length); ...
javascript
function getCookie(pr_name) { var name = pr_name + "="; var ca = document.cookie.split(';'); for(var i = 0; i < ca.length; i++) { var c = ca[i]; c = c.trim(); if (c.indexOf(pr_name+"=") === 0) { return c.substring(name.length, c.length); ...
[ "function", "getCookie", "(", "pr_name", ")", "{", "var", "name", "=", "pr_name", "+", "\"=\"", ";", "var", "ca", "=", "document", ".", "cookie", ".", "split", "(", "';'", ")", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "ca", ".", "l...
get the cookie and check value
[ "get", "the", "cookie", "and", "check", "value" ]
a0e721f2e641fcae3f22b242e384d892fdd0d6e6
https://github.com/crazychicken/t-scroll/blob/a0e721f2e641fcae3f22b242e384d892fdd0d6e6/theme/js/custom.js#L53-L65
9,750
Asana/node-asana
lib/auth/app.js
App
function App(options) { this.clientId = options.clientId; this.clientSecret = options.clientSecret || null; this.redirectUri = options.redirectUri || null; this.scope = options.scope || 'default'; this.asanaBaseUrl = options.asanaBaseUrl || 'https://app.asana.com/'; }
javascript
function App(options) { this.clientId = options.clientId; this.clientSecret = options.clientSecret || null; this.redirectUri = options.redirectUri || null; this.scope = options.scope || 'default'; this.asanaBaseUrl = options.asanaBaseUrl || 'https://app.asana.com/'; }
[ "function", "App", "(", "options", ")", "{", "this", ".", "clientId", "=", "options", ".", "clientId", ";", "this", ".", "clientSecret", "=", "options", ".", "clientSecret", "||", "null", ";", "this", ".", "redirectUri", "=", "options", ".", "redirectUri",...
An abstraction around an App used with Asana. @options {Object} Options to construct the app @option {String} clientId The ID of the app @option {String} [clientSecret] The secret key, if available here @option {String} [redirectUri] The default redirect URI @option {String} [scope] Scope to use, support...
[ "An", "abstraction", "around", "an", "App", "used", "with", "Asana", "." ]
afcc41fedba997654f0e52a1652da128d5961486
https://github.com/Asana/node-asana/blob/afcc41fedba997654f0e52a1652da128d5961486/lib/auth/app.js#L41-L47
9,751
Asana/node-asana
lib/auth/chrome_extension_flow.js
ChromeExtensionFlow
function ChromeExtensionFlow(options) { BaseBrowserFlow.call(this, options); this._authorizationPromise = null; this._receiverUrl = chrome.runtime.getURL( options.receiverPath || 'asana_oauth_receiver.html'); }
javascript
function ChromeExtensionFlow(options) { BaseBrowserFlow.call(this, options); this._authorizationPromise = null; this._receiverUrl = chrome.runtime.getURL( options.receiverPath || 'asana_oauth_receiver.html'); }
[ "function", "ChromeExtensionFlow", "(", "options", ")", "{", "BaseBrowserFlow", ".", "call", "(", "this", ",", "options", ")", ";", "this", ".", "_authorizationPromise", "=", "null", ";", "this", ".", "_receiverUrl", "=", "chrome", ".", "runtime", ".", "getU...
An Oauth flow that runs in a Chrome browser extension and requests user authorization by opening a temporary tab to prompt the user. @param {Object} options See `BaseBrowserFlow` for options, plus the below: @options {String} [receiverPath] Full path and filename from the base directory of the extension to the receiver...
[ "An", "Oauth", "flow", "that", "runs", "in", "a", "Chrome", "browser", "extension", "and", "requests", "user", "authorization", "by", "opening", "a", "temporary", "tab", "to", "prompt", "the", "user", "." ]
afcc41fedba997654f0e52a1652da128d5961486
https://github.com/Asana/node-asana/blob/afcc41fedba997654f0e52a1652da128d5961486/lib/auth/chrome_extension_flow.js#L19-L24
9,752
Asana/node-asana
lib/auth/native_flow.js
NativeFlow
function NativeFlow(options) { this.app = options.app; this.instructions = options.instructions || defaultInstructions; this.prompt = options.prompt || defaultPrompt; this.redirectUri = oauthUtil.NATIVE_REDIRECT_URI; }
javascript
function NativeFlow(options) { this.app = options.app; this.instructions = options.instructions || defaultInstructions; this.prompt = options.prompt || defaultPrompt; this.redirectUri = oauthUtil.NATIVE_REDIRECT_URI; }
[ "function", "NativeFlow", "(", "options", ")", "{", "this", ".", "app", "=", "options", ".", "app", ";", "this", ".", "instructions", "=", "options", ".", "instructions", "||", "defaultInstructions", ";", "this", ".", "prompt", "=", "options", ".", "prompt...
An Oauth flow that can be run from the console or an app that does not have the ability to open and manage a browser on its own. @param {Object} options @option {App} app App to authenticate for @option {String function(String)} [instructions] Function returning the instructions to output to the user. Passed the author...
[ "An", "Oauth", "flow", "that", "can", "be", "run", "from", "the", "console", "or", "an", "app", "that", "does", "not", "have", "the", "ability", "to", "open", "and", "manage", "a", "browser", "on", "its", "own", "." ]
afcc41fedba997654f0e52a1652da128d5961486
https://github.com/Asana/node-asana/blob/afcc41fedba997654f0e52a1652da128d5961486/lib/auth/native_flow.js#L44-L49
9,753
Asana/node-asana
lib/util/collection.js
Collection
function Collection(response, dispatcher, dispatchOptions) { if (!Collection.isCollectionResponse(response)) { throw new Error( 'Cannot create Collection from response that does not have resources'); } this.data = response.data; this._response = response; this._dispatcher = dispatcher; this._di...
javascript
function Collection(response, dispatcher, dispatchOptions) { if (!Collection.isCollectionResponse(response)) { throw new Error( 'Cannot create Collection from response that does not have resources'); } this.data = response.data; this._response = response; this._dispatcher = dispatcher; this._di...
[ "function", "Collection", "(", "response", ",", "dispatcher", ",", "dispatchOptions", ")", "{", "if", "(", "!", "Collection", ".", "isCollectionResponse", "(", "response", ")", ")", "{", "throw", "new", "Error", "(", "'Cannot create Collection from response that doe...
Create a Collection object from a response containing a list of resources. @param {Object} response Full payload from a response to a collection request. @param {Dispatcher} dispatcher @param {Object} [dispatchOptions] @returns {Object} Collection
[ "Create", "a", "Collection", "object", "from", "a", "response", "containing", "a", "list", "of", "resources", "." ]
afcc41fedba997654f0e52a1652da128d5961486
https://github.com/Asana/node-asana/blob/afcc41fedba997654f0e52a1652da128d5961486/lib/util/collection.js#L21-L31
9,754
Asana/node-asana
lib/util/resource_stream.js
ResourceStream
function ResourceStream(collection) { var me = this; BufferedReadable.call(me, { objectMode: true }); // @type {Collection} The collection whose data was last pushed into the // stream, such that if we have to go back for more, we should fetch // its `nextPage`. me._collection = collection; ...
javascript
function ResourceStream(collection) { var me = this; BufferedReadable.call(me, { objectMode: true }); // @type {Collection} The collection whose data was last pushed into the // stream, such that if we have to go back for more, we should fetch // its `nextPage`. me._collection = collection; ...
[ "function", "ResourceStream", "(", "collection", ")", "{", "var", "me", "=", "this", ";", "BufferedReadable", ".", "call", "(", "me", ",", "{", "objectMode", ":", "true", "}", ")", ";", "// @type {Collection} The collection whose data was last pushed into the", "// ...
A ResourceStream is a Node stream implementation for objects that are fetched from the API. Basically, any Collection of resources from the API can be wrapped in this stream, and the stream will fetch new pages of items as needed. @param {Collection} collection Response from initial collection request. @constructor
[ "A", "ResourceStream", "is", "a", "Node", "stream", "implementation", "for", "objects", "that", "are", "fetched", "from", "the", "API", ".", "Basically", "any", "Collection", "of", "resources", "from", "the", "API", "can", "be", "wrapped", "in", "this", "str...
afcc41fedba997654f0e52a1652da128d5961486
https://github.com/Asana/node-asana/blob/afcc41fedba997654f0e52a1652da128d5961486/lib/util/resource_stream.js#L14-L30
9,755
Asana/node-asana
lib/auth/oauth_authenticator.js
OauthAuthenticator
function OauthAuthenticator(options) { Authenticator.call(this); if (typeof(options.credentials) === 'string') { this.credentials = { 'access_token': options.credentials }; } else { this.credentials = options.credentials || null; } this.flow = options.flow || null; this.app = options.app; ...
javascript
function OauthAuthenticator(options) { Authenticator.call(this); if (typeof(options.credentials) === 'string') { this.credentials = { 'access_token': options.credentials }; } else { this.credentials = options.credentials || null; } this.flow = options.flow || null; this.app = options.app; ...
[ "function", "OauthAuthenticator", "(", "options", ")", "{", "Authenticator", ".", "call", "(", "this", ")", ";", "if", "(", "typeof", "(", "options", ".", "credentials", ")", "===", "'string'", ")", "{", "this", ".", "credentials", "=", "{", "'access_token...
Creates an authenticator that uses Oauth for authentication. @param {Object} options Configure the authenticator; must specify one of `flow` or `credentials`. @option {App} app The app being authenticated for. @option {OauthFlow} [flow] The flow to use to get credentials when needed. @op...
[ "Creates", "an", "authenticator", "that", "uses", "Oauth", "for", "authentication", "." ]
afcc41fedba997654f0e52a1652da128d5961486
https://github.com/Asana/node-asana/blob/afcc41fedba997654f0e52a1652da128d5961486/lib/auth/oauth_authenticator.js#L19-L30
9,756
Asana/node-asana
lib/client.js
Client
function Client(dispatcher, options) { options = options || {}; /** * The internal dispatcher. This is mostly used by the resources but provided * for custom requests to the API or API features that have not yet been added * to the client. * @type {Dispatcher} */ this.dispatcher = dispatcher; /**...
javascript
function Client(dispatcher, options) { options = options || {}; /** * The internal dispatcher. This is mostly used by the resources but provided * for custom requests to the API or API features that have not yet been added * to the client. * @type {Dispatcher} */ this.dispatcher = dispatcher; /**...
[ "function", "Client", "(", "dispatcher", ",", "options", ")", "{", "options", "=", "options", "||", "{", "}", ";", "/**\n * The internal dispatcher. This is mostly used by the resources but provided\n * for custom requests to the API or API features that have not yet been added\n ...
Constructs a Client with instances of all the resources using the dispatcher. It also keeps a reference to the dispatcher so that way the end user can have access to it. @class @classdesc A wrapper for the Asana API which is authenticated for one user @param {Dispatcher} dispatcher The request dispatcher to use @param ...
[ "Constructs", "a", "Client", "with", "instances", "of", "all", "the", "resources", "using", "the", "dispatcher", ".", "It", "also", "keeps", "a", "reference", "to", "the", "dispatcher", "so", "that", "way", "the", "end", "user", "can", "have", "access", "t...
afcc41fedba997654f0e52a1652da128d5961486
https://github.com/Asana/node-asana/blob/afcc41fedba997654f0e52a1652da128d5961486/lib/client.js#L21-L113
9,757
Asana/node-asana
gulpfile.js
browserTask
function browserTask(minify) { return function() { var task = browserify( { entries: [index], standalone: 'Asana' }) .bundle() .pipe(vinylSourceStream('asana' + (minify ? '-min' : '') + '.js')); if (minify) { task = task .pipe(vinylBuffer()) ...
javascript
function browserTask(minify) { return function() { var task = browserify( { entries: [index], standalone: 'Asana' }) .bundle() .pipe(vinylSourceStream('asana' + (minify ? '-min' : '') + '.js')); if (minify) { task = task .pipe(vinylBuffer()) ...
[ "function", "browserTask", "(", "minify", ")", "{", "return", "function", "(", ")", "{", "var", "task", "=", "browserify", "(", "{", "entries", ":", "[", "index", "]", ",", "standalone", ":", "'Asana'", "}", ")", ".", "bundle", "(", ")", ".", "pipe",...
Bundles the code, full version to `asana.js` and minified to `asana-min.js`
[ "Bundles", "the", "code", "full", "version", "to", "asana", ".", "js", "and", "minified", "to", "asana", "-", "min", ".", "js" ]
afcc41fedba997654f0e52a1652da128d5961486
https://github.com/Asana/node-asana/blob/afcc41fedba997654f0e52a1652da128d5961486/gulpfile.js#L31-L47
9,758
Asana/node-asana
lib/auth/auto_detect.js
autoDetect
function autoDetect(env) { env = env || defaultEnvironment(); if (typeof(env.chrome) !== 'undefined' && env.chrome.runtime && env.chrome.runtime.id) { if (env.chrome.tabs && env.chrome.tabs.create) { return ChromeExtensionFlow; } else { // Chrome packaged app, not supported yet. return...
javascript
function autoDetect(env) { env = env || defaultEnvironment(); if (typeof(env.chrome) !== 'undefined' && env.chrome.runtime && env.chrome.runtime.id) { if (env.chrome.tabs && env.chrome.tabs.create) { return ChromeExtensionFlow; } else { // Chrome packaged app, not supported yet. return...
[ "function", "autoDetect", "(", "env", ")", "{", "env", "=", "env", "||", "defaultEnvironment", "(", ")", ";", "if", "(", "typeof", "(", "env", ".", "chrome", ")", "!==", "'undefined'", "&&", "env", ".", "chrome", ".", "runtime", "&&", "env", ".", "ch...
Auto-detects the type of Oauth flow to use that's appropriate to the environment. @returns {Function|null} The type of Oauth flow to use, or null if no appropriate type could be determined.
[ "Auto", "-", "detects", "the", "type", "of", "Oauth", "flow", "to", "use", "that", "s", "appropriate", "to", "the", "environment", "." ]
afcc41fedba997654f0e52a1652da128d5961486
https://github.com/Asana/node-asana/blob/afcc41fedba997654f0e52a1652da128d5961486/lib/auth/auto_detect.js#L14-L34
9,759
Asana/node-asana
examples/oauth/webserver/oauth_webserver.js
createClient
function createClient() { return Asana.Client.create({ clientId: clientId, clientSecret: clientSecret, redirectUri: 'http://localhost:' + port + '/oauth_callback' }); }
javascript
function createClient() { return Asana.Client.create({ clientId: clientId, clientSecret: clientSecret, redirectUri: 'http://localhost:' + port + '/oauth_callback' }); }
[ "function", "createClient", "(", ")", "{", "return", "Asana", ".", "Client", ".", "create", "(", "{", "clientId", ":", "clientId", ",", "clientSecret", ":", "clientSecret", ",", "redirectUri", ":", "'http://localhost:'", "+", "port", "+", "'/oauth_callback'", ...
Create an Asana client. Do this per request since it keeps state that shouldn't be shared across requests.
[ "Create", "an", "Asana", "client", ".", "Do", "this", "per", "request", "since", "it", "keeps", "state", "that", "shouldn", "t", "be", "shared", "across", "requests", "." ]
afcc41fedba997654f0e52a1652da128d5961486
https://github.com/Asana/node-asana/blob/afcc41fedba997654f0e52a1652da128d5961486/examples/oauth/webserver/oauth_webserver.js#L28-L34
9,760
Asana/node-asana
lib/auth/oauth_util.js
parseOauthResultFromUrl
function parseOauthResultFromUrl(currentUrl) { var oauthUrl = url.parse(currentUrl); return oauthUrl.hash ? querystring.parse(oauthUrl.hash.substr(1)) : null; }
javascript
function parseOauthResultFromUrl(currentUrl) { var oauthUrl = url.parse(currentUrl); return oauthUrl.hash ? querystring.parse(oauthUrl.hash.substr(1)) : null; }
[ "function", "parseOauthResultFromUrl", "(", "currentUrl", ")", "{", "var", "oauthUrl", "=", "url", ".", "parse", "(", "currentUrl", ")", ";", "return", "oauthUrl", ".", "hash", "?", "querystring", ".", "parse", "(", "oauthUrl", ".", "hash", ".", "substr", ...
Parses a URL and returns any Oauth result that may be encoded therein. @param currentUrl {String} Complete URL of a page. @returns {Object|null} Oauth fields found in the hash of the URL, or null if the URL does not contain a valid hash.
[ "Parses", "a", "URL", "and", "returns", "any", "Oauth", "result", "that", "may", "be", "encoded", "therein", "." ]
afcc41fedba997654f0e52a1652da128d5961486
https://github.com/Asana/node-asana/blob/afcc41fedba997654f0e52a1652da128d5961486/lib/auth/oauth_util.js#L24-L27
9,761
Asana/node-asana
lib/auth/oauth_util.js
removeOauthResultFromCurrentUrl
function removeOauthResultFromCurrentUrl() { if (window.history && window.history.replaceState) { var url = window.location.href; var hashIndex = url.indexOf('#'); window.history.replaceState({}, document.title, url.substring(0, hashIndex)); } else { window.location.hash = ''; } }
javascript
function removeOauthResultFromCurrentUrl() { if (window.history && window.history.replaceState) { var url = window.location.href; var hashIndex = url.indexOf('#'); window.history.replaceState({}, document.title, url.substring(0, hashIndex)); } else { window.location.hash = ''; } }
[ "function", "removeOauthResultFromCurrentUrl", "(", ")", "{", "if", "(", "window", ".", "history", "&&", "window", ".", "history", ".", "replaceState", ")", "{", "var", "url", "=", "window", ".", "location", ".", "href", ";", "var", "hashIndex", "=", "url"...
Clean Oauth results out of the current browser URL, for security and cleanliness purposes. @returns {Object|null} Oauth fields found in the hash of the URL, or null if the URL does not contain a valid hash.
[ "Clean", "Oauth", "results", "out", "of", "the", "current", "browser", "URL", "for", "security", "and", "cleanliness", "purposes", "." ]
afcc41fedba997654f0e52a1652da128d5961486
https://github.com/Asana/node-asana/blob/afcc41fedba997654f0e52a1652da128d5961486/lib/auth/oauth_util.js#L35-L44
9,762
protobufjs/bytebuffer.js
dist/bytebuffer-node.js
stringSource
function stringSource(s) { var i=0; return function() { return i < s.length ? s.charCodeAt(i++) : null; }; }
javascript
function stringSource(s) { var i=0; return function() { return i < s.length ? s.charCodeAt(i++) : null; }; }
[ "function", "stringSource", "(", "s", ")", "{", "var", "i", "=", "0", ";", "return", "function", "(", ")", "{", "return", "i", "<", "s", ".", "length", "?", "s", ".", "charCodeAt", "(", "i", "++", ")", ":", "null", ";", "}", ";", "}" ]
Creates a source function for a string. @param {string} s String to read from @returns {function():number|null} Source function returning the next char code respectively `null` if there are no more characters left. @throws {TypeError} If the argument is invalid @inner
[ "Creates", "a", "source", "function", "for", "a", "string", "." ]
4144951c7f583d9394d18487ff0b2b7474b1e775
https://github.com/protobufjs/bytebuffer.js/blob/4144951c7f583d9394d18487ff0b2b7474b1e775/dist/bytebuffer-node.js#L205-L209
9,763
protobufjs/bytebuffer.js
dist/bytebuffer-node.js
stringDestination
function stringDestination() { var cs = [], ps = []; return function() { if (arguments.length === 0) return ps.join('')+stringFromCharCode.apply(String, cs); if (cs.length + arguments.length > 1024) ps.push(stringFromCharCode.apply(String, cs)), ...
javascript
function stringDestination() { var cs = [], ps = []; return function() { if (arguments.length === 0) return ps.join('')+stringFromCharCode.apply(String, cs); if (cs.length + arguments.length > 1024) ps.push(stringFromCharCode.apply(String, cs)), ...
[ "function", "stringDestination", "(", ")", "{", "var", "cs", "=", "[", "]", ",", "ps", "=", "[", "]", ";", "return", "function", "(", ")", "{", "if", "(", "arguments", ".", "length", "===", "0", ")", "return", "ps", ".", "join", "(", "''", ")", ...
Creates a destination function for a string. @returns {function(number=):undefined|string} Destination function successively called with the next char code. Returns the final string when called without arguments. @inner
[ "Creates", "a", "destination", "function", "for", "a", "string", "." ]
4144951c7f583d9394d18487ff0b2b7474b1e775
https://github.com/protobufjs/bytebuffer.js/blob/4144951c7f583d9394d18487ff0b2b7474b1e775/dist/bytebuffer-node.js#L217-L226
9,764
protobufjs/bytebuffer.js
src/helpers.js
assertLong
function assertLong(value, unsigned) { if (typeof value === 'number') { return Long.fromNumber(value, unsigned); } else if (typeof value === 'string') { return Long.fromString(value, unsigned); } else if (value && value instanceof Long) { if (typeof unsigned !== 'undefined') { ...
javascript
function assertLong(value, unsigned) { if (typeof value === 'number') { return Long.fromNumber(value, unsigned); } else if (typeof value === 'string') { return Long.fromString(value, unsigned); } else if (value && value instanceof Long) { if (typeof unsigned !== 'undefined') { ...
[ "function", "assertLong", "(", "value", ",", "unsigned", ")", "{", "if", "(", "typeof", "value", "===", "'number'", ")", "{", "return", "Long", ".", "fromNumber", "(", "value", ",", "unsigned", ")", ";", "}", "else", "if", "(", "typeof", "value", "==="...
Asserts that a value is an integer or Long. @param {number|!Long} value Value to assert @param {boolean=} unsigned Whether explicitly unsigned @returns {number|!Long} Type-safe value @throws {TypeError} If `value` is not an integer or Long @inner
[ "Asserts", "that", "a", "value", "is", "an", "integer", "or", "Long", "." ]
4144951c7f583d9394d18487ff0b2b7474b1e775
https://github.com/protobufjs/bytebuffer.js/blob/4144951c7f583d9394d18487ff0b2b7474b1e775/src/helpers.js#L41-L54
9,765
protobufjs/bytebuffer.js
src/helpers.js
assertOffset
function assertOffset(offset, min, cap, size) { if (typeof offset !== 'number' || offset % 1 !== 0) throw TypeError("Illegal offset: "+offset+" (not an integer)"); offset = offset | 0; if (offset < min || offset > cap-size) throw RangeError("Illegal offset: "+min+" <= "+value+" <= "+cap+"-"+...
javascript
function assertOffset(offset, min, cap, size) { if (typeof offset !== 'number' || offset % 1 !== 0) throw TypeError("Illegal offset: "+offset+" (not an integer)"); offset = offset | 0; if (offset < min || offset > cap-size) throw RangeError("Illegal offset: "+min+" <= "+value+" <= "+cap+"-"+...
[ "function", "assertOffset", "(", "offset", ",", "min", ",", "cap", ",", "size", ")", "{", "if", "(", "typeof", "offset", "!==", "'number'", "||", "offset", "%", "1", "!==", "0", ")", "throw", "TypeError", "(", "\"Illegal offset: \"", "+", "offset", "+", ...
Asserts that `min <= offset <= cap-size` and returns the type-safe offset. @param {number} offset Offset to assert @param {number} min Minimum offset @param {number} cap Cap offset @param {number} size Required size in bytes @returns {number} Type-safe offset @throws {TypeError} If `offset` is not an integer @throws {R...
[ "Asserts", "that", "min", "<", "=", "offset", "<", "=", "cap", "-", "size", "and", "returns", "the", "type", "-", "safe", "offset", "." ]
4144951c7f583d9394d18487ff0b2b7474b1e775
https://github.com/protobufjs/bytebuffer.js/blob/4144951c7f583d9394d18487ff0b2b7474b1e775/src/helpers.js#L67-L74
9,766
protobufjs/bytebuffer.js
src/helpers.js
assertRange
function assertRange(begin, end, min, cap) { if (typeof begin !== 'number' || begin % 1 !== 0) throw TypeError("Illegal begin: "+begin+" (not a number)"); begin = begin | 0; if (typeof end !== 'number' || end % 1 !== 0) throw TypeError("Illegal end: "+range[1]+" (not a number)"); end = e...
javascript
function assertRange(begin, end, min, cap) { if (typeof begin !== 'number' || begin % 1 !== 0) throw TypeError("Illegal begin: "+begin+" (not a number)"); begin = begin | 0; if (typeof end !== 'number' || end % 1 !== 0) throw TypeError("Illegal end: "+range[1]+" (not a number)"); end = e...
[ "function", "assertRange", "(", "begin", ",", "end", ",", "min", ",", "cap", ")", "{", "if", "(", "typeof", "begin", "!==", "'number'", "||", "begin", "%", "1", "!==", "0", ")", "throw", "TypeError", "(", "\"Illegal begin: \"", "+", "begin", "+", "\" (...
Asserts that `min <= begin <= end <= cap`. Updates `rangeVal` with the type-safe range. @param {number} begin Begin offset @param {number} end End offset @param {number} min Minimum offset @param {number} cap Cap offset @throws {TypeError} If `begin` or `end` is not an integer @throws {RangeError} If `begin < min || be...
[ "Asserts", "that", "min", "<", "=", "begin", "<", "=", "end", "<", "=", "cap", ".", "Updates", "rangeVal", "with", "the", "type", "-", "safe", "range", "." ]
4144951c7f583d9394d18487ff0b2b7474b1e775
https://github.com/protobufjs/bytebuffer.js/blob/4144951c7f583d9394d18487ff0b2b7474b1e775/src/helpers.js#L92-L102
9,767
googleads/videojs-ima
src/sdk-impl.js
function(controller) { /** * Plugin controller. */ this.controller = controller; /** * IMA SDK AdDisplayContainer. */ this.adDisplayContainer = null; /** * True if the AdDisplayContainer has been initialized. False otherwise. */ this.adDisplayContainerInitialized = false; /** * IMA...
javascript
function(controller) { /** * Plugin controller. */ this.controller = controller; /** * IMA SDK AdDisplayContainer. */ this.adDisplayContainer = null; /** * True if the AdDisplayContainer has been initialized. False otherwise. */ this.adDisplayContainerInitialized = false; /** * IMA...
[ "function", "(", "controller", ")", "{", "/**\n * Plugin controller.\n */", "this", ".", "controller", "=", "controller", ";", "/**\n * IMA SDK AdDisplayContainer.\n */", "this", ".", "adDisplayContainer", "=", "null", ";", "/**\n * True if the AdDisplayContainer has ...
Implementation of the IMA SDK for the plugin. @param {Object} controller Reference to the parent controller. @constructor @struct @final
[ "Implementation", "of", "the", "IMA", "SDK", "for", "the", "plugin", "." ]
e0d59f5a479467d954b3f31431f6535c6b8deb66
https://github.com/googleads/videojs-ima/blob/e0d59f5a479467d954b3f31431f6535c6b8deb66/src/sdk-impl.js#L31-L140
9,768
googleads/videojs-ima
src/controller.js
function(player, options) { /** * Stores user-provided settings. * @type {Object} */ this.settings = {}; /** * Content and ads ended listeners passed by the publisher to the plugin. * These will be called when the plugin detects that content *and all * ads* have completed. This differs from the...
javascript
function(player, options) { /** * Stores user-provided settings. * @type {Object} */ this.settings = {}; /** * Content and ads ended listeners passed by the publisher to the plugin. * These will be called when the plugin detects that content *and all * ads* have completed. This differs from the...
[ "function", "(", "player", ",", "options", ")", "{", "/**\n * Stores user-provided settings.\n * @type {Object}\n */", "this", ".", "settings", "=", "{", "}", ";", "/**\n * Content and ads ended listeners passed by the publisher to the plugin.\n * These will be called when th...
The grand coordinator of the plugin. Facilitates communication between all other plugin classes. @param {Object} player Instance of the video.js player. @param {Object} options Options provided by the implementation. @constructor @struct @final
[ "The", "grand", "coordinator", "of", "the", "plugin", ".", "Facilitates", "communication", "between", "all", "other", "plugin", "classes", "." ]
e0d59f5a479467d954b3f31431f6535c6b8deb66
https://github.com/googleads/videojs-ima/blob/e0d59f5a479467d954b3f31431f6535c6b8deb66/src/controller.js#L33-L79
9,769
cowbell/cordova-plugin-geofence
www/geofence.js
function (geofences, success, error) { if (!Array.isArray(geofences)) { geofences = [geofences]; } geofences.forEach(coerceProperties); if (isIOS) { return addOrUpdateIOS(geofences, success, error); } return execPromise(success, error, "Geofence...
javascript
function (geofences, success, error) { if (!Array.isArray(geofences)) { geofences = [geofences]; } geofences.forEach(coerceProperties); if (isIOS) { return addOrUpdateIOS(geofences, success, error); } return execPromise(success, error, "Geofence...
[ "function", "(", "geofences", ",", "success", ",", "error", ")", "{", "if", "(", "!", "Array", ".", "isArray", "(", "geofences", ")", ")", "{", "geofences", "=", "[", "geofences", "]", ";", "}", "geofences", ".", "forEach", "(", "coerceProperties", ")"...
Adding new geofence to monitor. Geofence could override the previously one with the same id. @name addOrUpdate @param {Geofence|Array} geofences @param {Function} success callback @param {Function} error callback @return {Promise}
[ "Adding", "new", "geofence", "to", "monitor", ".", "Geofence", "could", "override", "the", "previously", "one", "with", "the", "same", "id", "." ]
091907de34304202dc461f8787b292294ee6d1b0
https://github.com/cowbell/cordova-plugin-geofence/blob/091907de34304202dc461f8787b292294ee6d1b0/www/geofence.js#L51-L63
9,770
cowbell/cordova-plugin-geofence
www/geofence.js
function (ids, success, error) { if (!Array.isArray(ids)) { ids = [ids]; } return execPromise(success, error, "GeofencePlugin", "remove", ids); }
javascript
function (ids, success, error) { if (!Array.isArray(ids)) { ids = [ids]; } return execPromise(success, error, "GeofencePlugin", "remove", ids); }
[ "function", "(", "ids", ",", "success", ",", "error", ")", "{", "if", "(", "!", "Array", ".", "isArray", "(", "ids", ")", ")", "{", "ids", "=", "[", "ids", "]", ";", "}", "return", "execPromise", "(", "success", ",", "error", ",", "\"GeofencePlugin...
Removing geofences with given ids @name remove @param {Number|Array} ids @param {Function} success callback @param {Function} error callback @return {Promise}
[ "Removing", "geofences", "with", "given", "ids" ]
091907de34304202dc461f8787b292294ee6d1b0
https://github.com/cowbell/cordova-plugin-geofence/blob/091907de34304202dc461f8787b292294ee6d1b0/www/geofence.js#L73-L78
9,771
dgraph-io/dgraph-js
examples/tls/index.js
newClientStub
function newClientStub() { // First create the appropriate TLS certs with dgraph cert: // $ dgraph cert // $ dgraph cert -n localhost // $ dgraph cert -c user const rootCaCert = fs.readFileSync(path.join(__dirname, 'tls', 'ca.crt')); const clientCertKey = fs.readFileSync(path.join(__...
javascript
function newClientStub() { // First create the appropriate TLS certs with dgraph cert: // $ dgraph cert // $ dgraph cert -n localhost // $ dgraph cert -c user const rootCaCert = fs.readFileSync(path.join(__dirname, 'tls', 'ca.crt')); const clientCertKey = fs.readFileSync(path.join(__...
[ "function", "newClientStub", "(", ")", "{", "// First create the appropriate TLS certs with dgraph cert:", "// $ dgraph cert", "// $ dgraph cert -n localhost", "// $ dgraph cert -c user", "const", "rootCaCert", "=", "fs", ".", "readFileSync", "(", "path", ".", "join",...
Create a client stub.
[ "Create", "a", "client", "stub", "." ]
c32c1af2c3d536bf0d14252be604a863556920a7
https://github.com/dgraph-io/dgraph-js/blob/c32c1af2c3d536bf0d14252be604a863556920a7/examples/tls/index.js#L8-L19
9,772
dgraph-io/dgraph-js
examples/tls/index.js
dropAll
async function dropAll(dgraphClient) { const op = new dgraph.Operation(); op.setDropAll(true); await dgraphClient.alter(op); }
javascript
async function dropAll(dgraphClient) { const op = new dgraph.Operation(); op.setDropAll(true); await dgraphClient.alter(op); }
[ "async", "function", "dropAll", "(", "dgraphClient", ")", "{", "const", "op", "=", "new", "dgraph", ".", "Operation", "(", ")", ";", "op", ".", "setDropAll", "(", "true", ")", ";", "await", "dgraphClient", ".", "alter", "(", "op", ")", ";", "}" ]
Drop All - discard all data and start from a clean slate.
[ "Drop", "All", "-", "discard", "all", "data", "and", "start", "from", "a", "clean", "slate", "." ]
c32c1af2c3d536bf0d14252be604a863556920a7
https://github.com/dgraph-io/dgraph-js/blob/c32c1af2c3d536bf0d14252be604a863556920a7/examples/tls/index.js#L27-L31
9,773
dgraph-io/dgraph-js
examples/tls/index.js
createData
async function createData(dgraphClient) { // Create a new transaction. const txn = dgraphClient.newTxn(); try { // Create data. const p = { name: "Alice", age: 26, married: true, loc: { type: "Point", coordinates...
javascript
async function createData(dgraphClient) { // Create a new transaction. const txn = dgraphClient.newTxn(); try { // Create data. const p = { name: "Alice", age: 26, married: true, loc: { type: "Point", coordinates...
[ "async", "function", "createData", "(", "dgraphClient", ")", "{", "// Create a new transaction.", "const", "txn", "=", "dgraphClient", ".", "newTxn", "(", ")", ";", "try", "{", "// Create data.", "const", "p", "=", "{", "name", ":", "\"Alice\"", ",", "age", ...
Create data using JSON.
[ "Create", "data", "using", "JSON", "." ]
c32c1af2c3d536bf0d14252be604a863556920a7
https://github.com/dgraph-io/dgraph-js/blob/c32c1af2c3d536bf0d14252be604a863556920a7/examples/tls/index.js#L48-L101
9,774
darthbatman/billboard-top-100
billboard-top-100.js
yyyymmddDateFromMonthDayYearDate
function yyyymmddDateFromMonthDayYearDate(monthDayYearDate) { var yyyy = monthDayYearDate.split(',')[1].trim(); var dd = monthDayYearDate.split(' ')[1].split(',')[0]; var mm = ''; switch (monthDayYearDate.split(' ')[0]) { case 'January': mm = '01'; break; case 'February': mm = '02'; break; case '...
javascript
function yyyymmddDateFromMonthDayYearDate(monthDayYearDate) { var yyyy = monthDayYearDate.split(',')[1].trim(); var dd = monthDayYearDate.split(' ')[1].split(',')[0]; var mm = ''; switch (monthDayYearDate.split(' ')[0]) { case 'January': mm = '01'; break; case 'February': mm = '02'; break; case '...
[ "function", "yyyymmddDateFromMonthDayYearDate", "(", "monthDayYearDate", ")", "{", "var", "yyyy", "=", "monthDayYearDate", ".", "split", "(", "','", ")", "[", "1", "]", ".", "trim", "(", ")", ";", "var", "dd", "=", "monthDayYearDate", ".", "split", "(", "'...
Converts Month Day, Year date to YYYY-MM-DD date @param {string} monthDayYearDate - The Month Day, Year date @return {string} The YYYY-MM-DD date @example yyyymmddDateFromMonthDayYearDate("November 19, 2016") // 2016-11-19
[ "Converts", "Month", "Day", "Year", "date", "to", "YYYY", "-", "MM", "-", "DD", "date" ]
6169e74bda974c004575dd71f28d50eb07aa1dcf
https://github.com/darthbatman/billboard-top-100/blob/6169e74bda974c004575dd71f28d50eb07aa1dcf/billboard-top-100.js#L53-L96
9,775
darthbatman/billboard-top-100
billboard-top-100.js
getTitleFromChartItem
function getTitleFromChartItem(chartItem) { var title; try { title = chartItem.children[1].children[5].children[1].children[1].children[1].children[0].data.replace(/\n/g, ''); } catch (e) { title = ''; } return title; }
javascript
function getTitleFromChartItem(chartItem) { var title; try { title = chartItem.children[1].children[5].children[1].children[1].children[1].children[0].data.replace(/\n/g, ''); } catch (e) { title = ''; } return title; }
[ "function", "getTitleFromChartItem", "(", "chartItem", ")", "{", "var", "title", ";", "try", "{", "title", "=", "chartItem", ".", "children", "[", "1", "]", ".", "children", "[", "5", "]", ".", "children", "[", "1", "]", ".", "children", "[", "1", "]...
IMPLEMENTATION FUNCTIONS Gets the title from the specified chart item @param {HTMLElement} chartItem - The chart item @return {string} The title @example getTitleFromChartItem(<div class="chart-list-item">...</div>) // 'The Real Slim Shady'
[ "IMPLEMENTATION", "FUNCTIONS", "Gets", "the", "title", "from", "the", "specified", "chart", "item" ]
6169e74bda974c004575dd71f28d50eb07aa1dcf
https://github.com/darthbatman/billboard-top-100/blob/6169e74bda974c004575dd71f28d50eb07aa1dcf/billboard-top-100.js#L110-L118
9,776
darthbatman/billboard-top-100
billboard-top-100.js
getArtistFromChartItem
function getArtistFromChartItem(chartItem) { var artist; try { artist = chartItem.children[1].children[5].children[1].children[3].children[0].data.replace(/\n/g, ''); } catch (e) { artist = ''; } if (artist.trim().length < 1) { try { artist = chartItem.children[1].children[5].children[1].children[3].child...
javascript
function getArtistFromChartItem(chartItem) { var artist; try { artist = chartItem.children[1].children[5].children[1].children[3].children[0].data.replace(/\n/g, ''); } catch (e) { artist = ''; } if (artist.trim().length < 1) { try { artist = chartItem.children[1].children[5].children[1].children[3].child...
[ "function", "getArtistFromChartItem", "(", "chartItem", ")", "{", "var", "artist", ";", "try", "{", "artist", "=", "chartItem", ".", "children", "[", "1", "]", ".", "children", "[", "5", "]", ".", "children", "[", "1", "]", ".", "children", "[", "3", ...
Gets the artist from the specified chart item @param {HTMLElement} chartItem - The chart item @return {string} The artist @example getArtistFromChartItem(<div class="chart-list-item">...</div>) // 'Eminem'
[ "Gets", "the", "artist", "from", "the", "specified", "chart", "item" ]
6169e74bda974c004575dd71f28d50eb07aa1dcf
https://github.com/darthbatman/billboard-top-100/blob/6169e74bda974c004575dd71f28d50eb07aa1dcf/billboard-top-100.js#L130-L145
9,777
darthbatman/billboard-top-100
billboard-top-100.js
getPositionLastWeekFromChartItem
function getPositionLastWeekFromChartItem(chartItem) { var positionLastWeek; try { if (chartItem.children[3].children.length > 5) { positionLastWeek = chartItem.children[3].children[5].children[3].children[3].children[0].data } else { positionLastWeek = chartItem.children[3].children[3].children[1].children...
javascript
function getPositionLastWeekFromChartItem(chartItem) { var positionLastWeek; try { if (chartItem.children[3].children.length > 5) { positionLastWeek = chartItem.children[3].children[5].children[3].children[3].children[0].data } else { positionLastWeek = chartItem.children[3].children[3].children[1].children...
[ "function", "getPositionLastWeekFromChartItem", "(", "chartItem", ")", "{", "var", "positionLastWeek", ";", "try", "{", "if", "(", "chartItem", ".", "children", "[", "3", "]", ".", "children", ".", "length", ">", "5", ")", "{", "positionLastWeek", "=", "char...
Gets the position last week from the specified chart item @param {HTMLElement} chartItem - The chart item @return {number} The position last week @example getPositionLastWeekFromChartItem(<div class="chart-list-item">...</div>) // 4
[ "Gets", "the", "position", "last", "week", "from", "the", "specified", "chart", "item" ]
6169e74bda974c004575dd71f28d50eb07aa1dcf
https://github.com/darthbatman/billboard-top-100/blob/6169e74bda974c004575dd71f28d50eb07aa1dcf/billboard-top-100.js#L201-L213
9,778
darthbatman/billboard-top-100
billboard-top-100.js
getPeakPositionFromChartItem
function getPeakPositionFromChartItem(chartItem) { var peakPosition; try { if (chartItem.children[3].children.length > 5) { peakPosition = chartItem.children[3].children[5].children[5].children[3].children[0].data; } else { peakPosition = chartItem.children[3].children[3].children[3].children[3].children[0]...
javascript
function getPeakPositionFromChartItem(chartItem) { var peakPosition; try { if (chartItem.children[3].children.length > 5) { peakPosition = chartItem.children[3].children[5].children[5].children[3].children[0].data; } else { peakPosition = chartItem.children[3].children[3].children[3].children[3].children[0]...
[ "function", "getPeakPositionFromChartItem", "(", "chartItem", ")", "{", "var", "peakPosition", ";", "try", "{", "if", "(", "chartItem", ".", "children", "[", "3", "]", ".", "children", ".", "length", ">", "5", ")", "{", "peakPosition", "=", "chartItem", "....
Gets the peak position from the specified chart item @param {HTMLElement} chartItem - The chart item @return {number} The peak position @example getPeakPositionFromChartItem(<div class="chart-list-item">...</div>) // 4
[ "Gets", "the", "peak", "position", "from", "the", "specified", "chart", "item" ]
6169e74bda974c004575dd71f28d50eb07aa1dcf
https://github.com/darthbatman/billboard-top-100/blob/6169e74bda974c004575dd71f28d50eb07aa1dcf/billboard-top-100.js#L225-L237
9,779
darthbatman/billboard-top-100
billboard-top-100.js
getWeeksOnChartFromChartItem
function getWeeksOnChartFromChartItem(chartItem) { var weeksOnChart; try { if (chartItem.children[3].children.length > 5) { weeksOnChart = chartItem.children[3].children[5].children[7].children[3].children[0].data; } else { weeksOnChart = chartItem.children[3].children[3].children[5].children[3].children[0]...
javascript
function getWeeksOnChartFromChartItem(chartItem) { var weeksOnChart; try { if (chartItem.children[3].children.length > 5) { weeksOnChart = chartItem.children[3].children[5].children[7].children[3].children[0].data; } else { weeksOnChart = chartItem.children[3].children[3].children[5].children[3].children[0]...
[ "function", "getWeeksOnChartFromChartItem", "(", "chartItem", ")", "{", "var", "weeksOnChart", ";", "try", "{", "if", "(", "chartItem", ".", "children", "[", "3", "]", ".", "children", ".", "length", ">", "5", ")", "{", "weeksOnChart", "=", "chartItem", "....
Gets the weeks on chart last week from the specified chart item @param {HTMLElement} chartItem - The chart item @return {number} The weeks on chart @example getWeeksOnChartFromChartItem(<div class="chart-list-item">...</div>) // 4
[ "Gets", "the", "weeks", "on", "chart", "last", "week", "from", "the", "specified", "chart", "item" ]
6169e74bda974c004575dd71f28d50eb07aa1dcf
https://github.com/darthbatman/billboard-top-100/blob/6169e74bda974c004575dd71f28d50eb07aa1dcf/billboard-top-100.js#L249-L261
9,780
darthbatman/billboard-top-100
billboard-top-100.js
getNeighboringChart
function getNeighboringChart(chartItem, neighboringWeek) { if (neighboringWeek == NeighboringWeek.Previous) { if (chartItem[0].attribs.class.indexOf('dropdown__date-selector-option--disabled') == -1) { return { url: BILLBOARD_BASE_URL + chartItem[0].children[1].attribs.href, date: chartItem[0].children[1]...
javascript
function getNeighboringChart(chartItem, neighboringWeek) { if (neighboringWeek == NeighboringWeek.Previous) { if (chartItem[0].attribs.class.indexOf('dropdown__date-selector-option--disabled') == -1) { return { url: BILLBOARD_BASE_URL + chartItem[0].children[1].attribs.href, date: chartItem[0].children[1]...
[ "function", "getNeighboringChart", "(", "chartItem", ",", "neighboringWeek", ")", "{", "if", "(", "neighboringWeek", "==", "NeighboringWeek", ".", "Previous", ")", "{", "if", "(", "chartItem", "[", "0", "]", ".", "attribs", ".", "class", ".", "indexOf", "(",...
Gets the neighboring chart for a given chart item and neighboring week type. @param {HTMLElement} chartItem - The chart item @param {enum} neighboringWeek - The type of neighboring week @return {object} The neighboring chart with url and week @example getNeighboringChart(<div class="dropdown__date-selector-option">....
[ "Gets", "the", "neighboring", "chart", "for", "a", "given", "chart", "item", "and", "neighboring", "week", "type", "." ]
6169e74bda974c004575dd71f28d50eb07aa1dcf
https://github.com/darthbatman/billboard-top-100/blob/6169e74bda974c004575dd71f28d50eb07aa1dcf/billboard-top-100.js#L274-L294
9,781
darthbatman/billboard-top-100
billboard-top-100.js
getChart
function getChart(chartName, date, cb) { // check if chart was specified if (typeof chartName === 'function') { // if chartName not specified, default to hot-100 chart for current week, // and set callback method accordingly cb = chartName; chartName = 'hot-100'; date = ''; } // check if date was specifi...
javascript
function getChart(chartName, date, cb) { // check if chart was specified if (typeof chartName === 'function') { // if chartName not specified, default to hot-100 chart for current week, // and set callback method accordingly cb = chartName; chartName = 'hot-100'; date = ''; } // check if date was specifi...
[ "function", "getChart", "(", "chartName", ",", "date", ",", "cb", ")", "{", "// check if chart was specified", "if", "(", "typeof", "chartName", "===", "'function'", ")", "{", "// if chartName not specified, default to hot-100 chart for current week, ", "// and set callback m...
Gets information for specified chart and date @param {string} chartName - The specified chart @param {string} date - Date represented as string in format 'YYYY-MM-DD' @param {function} cb - The specified callback method @example getChart('hot-100', '2016-08-27', function(err, chart) {...})
[ "Gets", "information", "for", "specified", "chart", "and", "date" ]
6169e74bda974c004575dd71f28d50eb07aa1dcf
https://github.com/darthbatman/billboard-top-100/blob/6169e74bda974c004575dd71f28d50eb07aa1dcf/billboard-top-100.js#L307-L373
9,782
darthbatman/billboard-top-100
billboard-top-100.js
listCharts
function listCharts(cb) { if (typeof cb !== 'function') { cb('Specified callback is not a function.', null); return; } request(BILLBOARD_CHARTS_URL, function completedRequest(error, response, html) { if (error) { cb(error, null); return; } var $ = cheerio.load(html); /** * A chart * @typedef ...
javascript
function listCharts(cb) { if (typeof cb !== 'function') { cb('Specified callback is not a function.', null); return; } request(BILLBOARD_CHARTS_URL, function completedRequest(error, response, html) { if (error) { cb(error, null); return; } var $ = cheerio.load(html); /** * A chart * @typedef ...
[ "function", "listCharts", "(", "cb", ")", "{", "if", "(", "typeof", "cb", "!==", "'function'", ")", "{", "cb", "(", "'Specified callback is not a function.'", ",", "null", ")", ";", "return", ";", "}", "request", "(", "BILLBOARD_CHARTS_URL", ",", "function", ...
Gets all charts available via Billboard @param {string} chart - The specified chart @param {string} date - Date represented as string in format 'YYYY-MM-DD' @param {function} cb - The specified callback method @example listCharts(function(err, charts) {...})
[ "Gets", "all", "charts", "available", "via", "Billboard" ]
6169e74bda974c004575dd71f28d50eb07aa1dcf
https://github.com/darthbatman/billboard-top-100/blob/6169e74bda974c004575dd71f28d50eb07aa1dcf/billboard-top-100.js#L386-L424
9,783
woocommerce/wc-api-node
index.js
WooCommerceAPI
function WooCommerceAPI(opt) { if (!(this instanceof WooCommerceAPI)) { return new WooCommerceAPI(opt); } opt = opt || {}; if (!(opt.url)) { throw new Error('url is required'); } if (!(opt.consumerKey)) { throw new Error('consumerKey is required'); } if (!(opt.consumerSecret)) { thro...
javascript
function WooCommerceAPI(opt) { if (!(this instanceof WooCommerceAPI)) { return new WooCommerceAPI(opt); } opt = opt || {}; if (!(opt.url)) { throw new Error('url is required'); } if (!(opt.consumerKey)) { throw new Error('consumerKey is required'); } if (!(opt.consumerSecret)) { thro...
[ "function", "WooCommerceAPI", "(", "opt", ")", "{", "if", "(", "!", "(", "this", "instanceof", "WooCommerceAPI", ")", ")", "{", "return", "new", "WooCommerceAPI", "(", "opt", ")", ";", "}", "opt", "=", "opt", "||", "{", "}", ";", "if", "(", "!", "(...
WooCommerce REST API wrapper @param {Object} opt
[ "WooCommerce", "REST", "API", "wrapper" ]
0844e882ffd675bcae489d89621fb39350eec483
https://github.com/woocommerce/wc-api-node/blob/0844e882ffd675bcae489d89621fb39350eec483/index.js#L16-L37
9,784
salsify/ember-css-modules
lib/resolve-path.js
resolveExternalPath
function resolveExternalPath(importPath, options) { let baseIndex = importPath[0] === '@' ? importPath.indexOf('/') + 1 : 0; let addonName = importPath.substring(0, importPath.indexOf('/', baseIndex)); let addon = options.parent.addons.find(addon => addon.name === addonName); if (!addon) { throw new Error(...
javascript
function resolveExternalPath(importPath, options) { let baseIndex = importPath[0] === '@' ? importPath.indexOf('/') + 1 : 0; let addonName = importPath.substring(0, importPath.indexOf('/', baseIndex)); let addon = options.parent.addons.find(addon => addon.name === addonName); if (!addon) { throw new Error(...
[ "function", "resolveExternalPath", "(", "importPath", ",", "options", ")", "{", "let", "baseIndex", "=", "importPath", "[", "0", "]", "===", "'@'", "?", "importPath", ".", "indexOf", "(", "'/'", ")", "+", "1", ":", "0", ";", "let", "addonName", "=", "i...
Resolve absolute paths pointing to external addons
[ "Resolve", "absolute", "paths", "pointing", "to", "external", "addons" ]
cb6b2bf03eb6512f7fa3f66bf886540a16fdbfdc
https://github.com/salsify/ember-css-modules/blob/cb6b2bf03eb6512f7fa3f66bf886540a16fdbfdc/lib/resolve-path.js#L40-L55
9,785
salsify/ember-css-modules
addon/decorators.js
isStage1ClassDescriptor
function isStage1ClassDescriptor(possibleDesc) { let [target] = possibleDesc; return ( possibleDesc.length === 1 && typeof target === 'function' && 'prototype' in target && !target.__isComputedDecorator ); }
javascript
function isStage1ClassDescriptor(possibleDesc) { let [target] = possibleDesc; return ( possibleDesc.length === 1 && typeof target === 'function' && 'prototype' in target && !target.__isComputedDecorator ); }
[ "function", "isStage1ClassDescriptor", "(", "possibleDesc", ")", "{", "let", "[", "target", "]", "=", "possibleDesc", ";", "return", "(", "possibleDesc", ".", "length", "===", "1", "&&", "typeof", "target", "===", "'function'", "&&", "'prototype'", "in", "targ...
These utilities are from @ember-decorators/utils https://github.com/ember-decorators/ember-decorators/blob/f3e3d636a38d99992af326a1012d69bf10a2cb4c/packages/utils/addon/-private/class-field-descriptor.js
[ "These", "utilities", "are", "from" ]
cb6b2bf03eb6512f7fa3f66bf886540a16fdbfdc
https://github.com/salsify/ember-css-modules/blob/cb6b2bf03eb6512f7fa3f66bf886540a16fdbfdc/addon/decorators.js#L126-L135
9,786
madebymany/sir-trevor-js
src/block_mixins/droppable.js
function() { this.inner.setAttribute('tabindex', 0); this.inner.addEventListener('keyup', (e) => { if (e.target !== this.inner) { return; } switch(e.keyCode) { case 13: this.mediator.trigger("block:create", 'Text', null, this.el, { autoFocus: true }); break; case...
javascript
function() { this.inner.setAttribute('tabindex', 0); this.inner.addEventListener('keyup', (e) => { if (e.target !== this.inner) { return; } switch(e.keyCode) { case 13: this.mediator.trigger("block:create", 'Text', null, this.el, { autoFocus: true }); break; case...
[ "function", "(", ")", "{", "this", ".", "inner", ".", "setAttribute", "(", "'tabindex'", ",", "0", ")", ";", "this", ".", "inner", ".", "addEventListener", "(", "'keyup'", ",", "(", "e", ")", "=>", "{", "if", "(", "e", ".", "target", "!==", "this",...
Allow this block to be managed with the keyboard
[ "Allow", "this", "block", "to", "be", "managed", "with", "the", "keyboard" ]
1e604eb0715ba4b78ed20e8a0eef0abb76985edb
https://github.com/madebymany/sir-trevor-js/blob/1e604eb0715ba4b78ed20e8a0eef0abb76985edb/src/block_mixins/droppable.js#L73-L87
9,787
madebymany/sir-trevor-js
examples/javascript/example_block.js
function(){ var dataObj = {}; var content = this.getTextBlock().html(); if (content.length > 0) { dataObj.text = SirTrevor.toMarkdown(content, this.type); } this.setData(dataObj); }
javascript
function(){ var dataObj = {}; var content = this.getTextBlock().html(); if (content.length > 0) { dataObj.text = SirTrevor.toMarkdown(content, this.type); } this.setData(dataObj); }
[ "function", "(", ")", "{", "var", "dataObj", "=", "{", "}", ";", "var", "content", "=", "this", ".", "getTextBlock", "(", ")", ".", "html", "(", ")", ";", "if", "(", "content", ".", "length", ">", "0", ")", "{", "dataObj", ".", "text", "=", "Si...
Function; Executed on save of the block, once the block is validated toData expects a way for the block to be transformed from inputs into structured data The default toData function provides a pretty comprehensive way of turning data into JSON In this example we take the text data and save it to the data object on the...
[ "Function", ";", "Executed", "on", "save", "of", "the", "block", "once", "the", "block", "is", "validated", "toData", "expects", "a", "way", "for", "the", "block", "to", "be", "transformed", "from", "inputs", "into", "structured", "data", "The", "default", ...
1e604eb0715ba4b78ed20e8a0eef0abb76985edb
https://github.com/madebymany/sir-trevor-js/blob/1e604eb0715ba4b78ed20e8a0eef0abb76985edb/examples/javascript/example_block.js#L126-L135
9,788
madebymany/sir-trevor-js
src/blocks/scribe-plugins/scribe-paste-plugin.js
removeWrappingParagraphForFirefox
function removeWrappingParagraphForFirefox(value) { var fakeContent = document.createElement('div'); fakeContent.innerHTML = value; if (fakeContent.childNodes.length === 1) { var node = [].slice.call(fakeContent.childNodes)[0]; if (node && node.nodeName === "P") { value = node.innerHTML; } } ...
javascript
function removeWrappingParagraphForFirefox(value) { var fakeContent = document.createElement('div'); fakeContent.innerHTML = value; if (fakeContent.childNodes.length === 1) { var node = [].slice.call(fakeContent.childNodes)[0]; if (node && node.nodeName === "P") { value = node.innerHTML; } } ...
[ "function", "removeWrappingParagraphForFirefox", "(", "value", ")", "{", "var", "fakeContent", "=", "document", ".", "createElement", "(", "'div'", ")", ";", "fakeContent", ".", "innerHTML", "=", "value", ";", "if", "(", "fakeContent", ".", "childNodes", ".", ...
In firefox when you paste any text is wraps in a paragraph block which we don't want.
[ "In", "firefox", "when", "you", "paste", "any", "text", "is", "wraps", "in", "a", "paragraph", "block", "which", "we", "don", "t", "want", "." ]
1e604eb0715ba4b78ed20e8a0eef0abb76985edb
https://github.com/madebymany/sir-trevor-js/blob/1e604eb0715ba4b78ed20e8a0eef0abb76985edb/src/blocks/scribe-plugins/scribe-paste-plugin.js#L28-L40
9,789
roman01la/html-to-react-components
lib/html2jsx.js
eachObj
function eachObj(obj, iteratee, context) { for (var key in obj) { if (obj.hasOwnProperty(key)) { iteratee.call(context || obj, key, obj[key]); } } }
javascript
function eachObj(obj, iteratee, context) { for (var key in obj) { if (obj.hasOwnProperty(key)) { iteratee.call(context || obj, key, obj[key]); } } }
[ "function", "eachObj", "(", "obj", ",", "iteratee", ",", "context", ")", "{", "for", "(", "var", "key", "in", "obj", ")", "{", "if", "(", "obj", ".", "hasOwnProperty", "(", "key", ")", ")", "{", "iteratee", ".", "call", "(", "context", "||", "obj",...
Iterates over elements of object invokes iteratee for each element @param {object} obj Collection object @param {function} iteratee Callback function called in iterative processing @param {any} context This arg (aka Context)
[ "Iterates", "over", "elements", "of", "object", "invokes", "iteratee", "for", "each", "element" ]
74b76fafbd0728f77c2bbe32a0b26a94e604442b
https://github.com/roman01la/html-to-react-components/blob/74b76fafbd0728f77c2bbe32a0b26a94e604442b/lib/html2jsx.js#L146-L152
9,790
roman01la/html-to-react-components
lib/html2jsx.js
jsxTagName
function jsxTagName(tagName) { var name = tagName.toLowerCase(); if (ELEMENT_TAG_NAME_MAPPING.hasOwnProperty(name)) { name = ELEMENT_TAG_NAME_MAPPING[name]; } return name; }
javascript
function jsxTagName(tagName) { var name = tagName.toLowerCase(); if (ELEMENT_TAG_NAME_MAPPING.hasOwnProperty(name)) { name = ELEMENT_TAG_NAME_MAPPING[name]; } return name; }
[ "function", "jsxTagName", "(", "tagName", ")", "{", "var", "name", "=", "tagName", ".", "toLowerCase", "(", ")", ";", "if", "(", "ELEMENT_TAG_NAME_MAPPING", ".", "hasOwnProperty", "(", "name", ")", ")", "{", "name", "=", "ELEMENT_TAG_NAME_MAPPING", "[", "nam...
Convert tag name to tag name suitable for JSX. @param {string} tagName String of tag name @return {string}
[ "Convert", "tag", "name", "to", "tag", "name", "suitable", "for", "JSX", "." ]
74b76fafbd0728f77c2bbe32a0b26a94e604442b
https://github.com/roman01la/html-to-react-components/blob/74b76fafbd0728f77c2bbe32a0b26a94e604442b/lib/html2jsx.js#L174-L182
9,791
roman01la/html-to-react-components
lib/html2jsx.js
trimEnd
function trimEnd(haystack, needle) { return endsWith(haystack, needle) ? haystack.slice(0, -needle.length) : haystack; }
javascript
function trimEnd(haystack, needle) { return endsWith(haystack, needle) ? haystack.slice(0, -needle.length) : haystack; }
[ "function", "trimEnd", "(", "haystack", ",", "needle", ")", "{", "return", "endsWith", "(", "haystack", ",", "needle", ")", "?", "haystack", ".", "slice", "(", "0", ",", "-", "needle", ".", "length", ")", ":", "haystack", ";", "}" ]
Trim the specified substring off the string. If the string does not end with the specified substring, this is a no-op. @param {string} haystack String to search in @param {string} needle String to search for @return {string}
[ "Trim", "the", "specified", "substring", "off", "the", "string", ".", "If", "the", "string", "does", "not", "end", "with", "the", "specified", "substring", "this", "is", "a", "no", "-", "op", "." ]
74b76fafbd0728f77c2bbe32a0b26a94e604442b
https://github.com/roman01la/html-to-react-components/blob/74b76fafbd0728f77c2bbe32a0b26a94e604442b/lib/html2jsx.js#L229-L233
9,792
roman01la/html-to-react-components
lib/html2jsx.js
isNumeric
function isNumeric(input) { return input !== undefined && input !== null && (typeof input === 'number' || parseInt(input, 10) == input); }
javascript
function isNumeric(input) { return input !== undefined && input !== null && (typeof input === 'number' || parseInt(input, 10) == input); }
[ "function", "isNumeric", "(", "input", ")", "{", "return", "input", "!==", "undefined", "&&", "input", "!==", "null", "&&", "(", "typeof", "input", "===", "'number'", "||", "parseInt", "(", "input", ",", "10", ")", "==", "input", ")", ";", "}" ]
Determines if the specified string consists entirely of numeric characters.
[ "Determines", "if", "the", "specified", "string", "consists", "entirely", "of", "numeric", "characters", "." ]
74b76fafbd0728f77c2bbe32a0b26a94e604442b
https://github.com/roman01la/html-to-react-components/blob/74b76fafbd0728f77c2bbe32a0b26a94e604442b/lib/html2jsx.js#L265-L269
9,793
roman01la/html-to-react-components
lib/html2jsx.js
function (html) { this.reset(); var containerEl = createElement('div'); containerEl.innerHTML = '\n' + this._cleanInput(html) + '\n'; if (this.config.createClass) { if (this.config.outputClassName) { this.output = 'var ' + this.config.outputClassName + ' = React.createClass({\n'; }...
javascript
function (html) { this.reset(); var containerEl = createElement('div'); containerEl.innerHTML = '\n' + this._cleanInput(html) + '\n'; if (this.config.createClass) { if (this.config.outputClassName) { this.output = 'var ' + this.config.outputClassName + ' = React.createClass({\n'; }...
[ "function", "(", "html", ")", "{", "this", ".", "reset", "(", ")", ";", "var", "containerEl", "=", "createElement", "(", "'div'", ")", ";", "containerEl", ".", "innerHTML", "=", "'\\n'", "+", "this", ".", "_cleanInput", "(", "html", ")", "+", "'\\n'", ...
Main entry point to the converter. Given the specified HTML, returns a JSX object representing it. @param {string} html HTML to convert @return {string} JSX
[ "Main", "entry", "point", "to", "the", "converter", ".", "Given", "the", "specified", "HTML", "returns", "a", "JSX", "object", "representing", "it", "." ]
74b76fafbd0728f77c2bbe32a0b26a94e604442b
https://github.com/roman01la/html-to-react-components/blob/74b76fafbd0728f77c2bbe32a0b26a94e604442b/lib/html2jsx.js#L326-L362
9,794
roman01la/html-to-react-components
lib/html2jsx.js
function (containerEl) { // Only a single child element if ( containerEl.childNodes.length === 1 && containerEl.childNodes[0].nodeType === NODE_TYPE.ELEMENT ) { return true; } // Only one element, and all other children are whitespace var foundElement = false; for (var i = ...
javascript
function (containerEl) { // Only a single child element if ( containerEl.childNodes.length === 1 && containerEl.childNodes[0].nodeType === NODE_TYPE.ELEMENT ) { return true; } // Only one element, and all other children are whitespace var foundElement = false; for (var i = ...
[ "function", "(", "containerEl", ")", "{", "// Only a single child element", "if", "(", "containerEl", ".", "childNodes", ".", "length", "===", "1", "&&", "containerEl", ".", "childNodes", "[", "0", "]", ".", "nodeType", "===", "NODE_TYPE", ".", "ELEMENT", ")",...
Determines if there's only one top-level node in the DOM tree. That is, all the HTML is wrapped by a single HTML tag. @param {DOMElement} containerEl Container element @return {boolean}
[ "Determines", "if", "there", "s", "only", "one", "top", "-", "level", "node", "in", "the", "DOM", "tree", ".", "That", "is", "all", "the", "HTML", "is", "wrapped", "by", "a", "single", "HTML", "tag", "." ]
74b76fafbd0728f77c2bbe32a0b26a94e604442b
https://github.com/roman01la/html-to-react-components/blob/74b76fafbd0728f77c2bbe32a0b26a94e604442b/lib/html2jsx.js#L387-L413
9,795
roman01la/html-to-react-components
lib/html2jsx.js
function (node) { this.level++; for (var i = 0, count = node.childNodes.length; i < count; i++) { this._visit(node.childNodes[i]); } this.level--; }
javascript
function (node) { this.level++; for (var i = 0, count = node.childNodes.length; i < count; i++) { this._visit(node.childNodes[i]); } this.level--; }
[ "function", "(", "node", ")", "{", "this", ".", "level", "++", ";", "for", "(", "var", "i", "=", "0", ",", "count", "=", "node", ".", "childNodes", ".", "length", ";", "i", "<", "count", ";", "i", "++", ")", "{", "this", ".", "_visit", "(", "...
Traverses all the children of the specified node @param {Node} node
[ "Traverses", "all", "the", "children", "of", "the", "specified", "node" ]
74b76fafbd0728f77c2bbe32a0b26a94e604442b
https://github.com/roman01la/html-to-react-components/blob/74b76fafbd0728f77c2bbe32a0b26a94e604442b/lib/html2jsx.js#L441-L447
9,796
roman01la/html-to-react-components
lib/html2jsx.js
function (node) { switch (node.nodeType) { case NODE_TYPE.ELEMENT: this._beginVisitElement(node); break; case NODE_TYPE.TEXT: this._visitText(node); break; case NODE_TYPE.COMMENT: this._visitComment(node); break; default: console.war...
javascript
function (node) { switch (node.nodeType) { case NODE_TYPE.ELEMENT: this._beginVisitElement(node); break; case NODE_TYPE.TEXT: this._visitText(node); break; case NODE_TYPE.COMMENT: this._visitComment(node); break; default: console.war...
[ "function", "(", "node", ")", "{", "switch", "(", "node", ".", "nodeType", ")", "{", "case", "NODE_TYPE", ".", "ELEMENT", ":", "this", ".", "_beginVisitElement", "(", "node", ")", ";", "break", ";", "case", "NODE_TYPE", ".", "TEXT", ":", "this", ".", ...
Handle pre-visit behaviour for the specified node. @param {Node} node
[ "Handle", "pre", "-", "visit", "behaviour", "for", "the", "specified", "node", "." ]
74b76fafbd0728f77c2bbe32a0b26a94e604442b
https://github.com/roman01la/html-to-react-components/blob/74b76fafbd0728f77c2bbe32a0b26a94e604442b/lib/html2jsx.js#L454-L471
9,797
roman01la/html-to-react-components
lib/html2jsx.js
function (node) { switch (node.nodeType) { case NODE_TYPE.ELEMENT: this._endVisitElement(node); break; // No ending tags required for these types case NODE_TYPE.TEXT: case NODE_TYPE.COMMENT: break; } }
javascript
function (node) { switch (node.nodeType) { case NODE_TYPE.ELEMENT: this._endVisitElement(node); break; // No ending tags required for these types case NODE_TYPE.TEXT: case NODE_TYPE.COMMENT: break; } }
[ "function", "(", "node", ")", "{", "switch", "(", "node", ".", "nodeType", ")", "{", "case", "NODE_TYPE", ".", "ELEMENT", ":", "this", ".", "_endVisitElement", "(", "node", ")", ";", "break", ";", "// No ending tags required for these types", "case", "NODE_TYP...
Handles post-visit behaviour for the specified node. @param {Node} node
[ "Handles", "post", "-", "visit", "behaviour", "for", "the", "specified", "node", "." ]
74b76fafbd0728f77c2bbe32a0b26a94e604442b
https://github.com/roman01la/html-to-react-components/blob/74b76fafbd0728f77c2bbe32a0b26a94e604442b/lib/html2jsx.js#L478-L488
9,798
roman01la/html-to-react-components
lib/html2jsx.js
function (node) { var tagName = jsxTagName(node.tagName); var attributes = []; for (var i = 0, count = node.attributes.length; i < count; i++) { attributes.push(this._getElementAttribute(node, node.attributes[i])); } if (tagName === 'textarea') { // Hax: textareas need their inner text ...
javascript
function (node) { var tagName = jsxTagName(node.tagName); var attributes = []; for (var i = 0, count = node.attributes.length; i < count; i++) { attributes.push(this._getElementAttribute(node, node.attributes[i])); } if (tagName === 'textarea') { // Hax: textareas need their inner text ...
[ "function", "(", "node", ")", "{", "var", "tagName", "=", "jsxTagName", "(", "node", ".", "tagName", ")", ";", "var", "attributes", "=", "[", "]", ";", "for", "(", "var", "i", "=", "0", ",", "count", "=", "node", ".", "attributes", ".", "length", ...
Handles pre-visit behaviour for the specified element node @param {DOMElement} node
[ "Handles", "pre", "-", "visit", "behaviour", "for", "the", "specified", "element", "node" ]
74b76fafbd0728f77c2bbe32a0b26a94e604442b
https://github.com/roman01la/html-to-react-components/blob/74b76fafbd0728f77c2bbe32a0b26a94e604442b/lib/html2jsx.js#L495-L521
9,799
roman01la/html-to-react-components
lib/html2jsx.js
function (node) { var tagName = jsxTagName(node.tagName); // De-indent a bit // TODO: It's inefficient to do it this way :/ this.output = trimEnd(this.output, this.config.indent); if (this._isSelfClosing(node)) { this.output += ' />'; } else { this.output += '</' + tagName + '>'; ...
javascript
function (node) { var tagName = jsxTagName(node.tagName); // De-indent a bit // TODO: It's inefficient to do it this way :/ this.output = trimEnd(this.output, this.config.indent); if (this._isSelfClosing(node)) { this.output += ' />'; } else { this.output += '</' + tagName + '>'; ...
[ "function", "(", "node", ")", "{", "var", "tagName", "=", "jsxTagName", "(", "node", ".", "tagName", ")", ";", "// De-indent a bit", "// TODO: It's inefficient to do it this way :/", "this", ".", "output", "=", "trimEnd", "(", "this", ".", "output", ",", "this",...
Handles post-visit behaviour for the specified element node @param {Node} node
[ "Handles", "post", "-", "visit", "behaviour", "for", "the", "specified", "element", "node" ]
74b76fafbd0728f77c2bbe32a0b26a94e604442b
https://github.com/roman01la/html-to-react-components/blob/74b76fafbd0728f77c2bbe32a0b26a94e604442b/lib/html2jsx.js#L528-L542