repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
partition
stringclasses
1 value
NASAWorldWind/WebWorldWind
src/util/WcsTileUrlBuilder.js
function (serviceAddress, coverageName, wcsVersion) { if (!serviceAddress || (serviceAddress.length === 0)) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "WcsTileUrlBuilder", "constructor", "The WCS service address is missing.")...
javascript
function (serviceAddress, coverageName, wcsVersion) { if (!serviceAddress || (serviceAddress.length === 0)) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "WcsTileUrlBuilder", "constructor", "The WCS service address is missing.")...
[ "function", "(", "serviceAddress", ",", "coverageName", ",", "wcsVersion", ")", "{", "if", "(", "!", "serviceAddress", "||", "(", "serviceAddress", ".", "length", "===", "0", ")", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", ...
Constructs a WCS tile URL builder. @alias WcsTileUrlBuilder @constructor @classdesc Provides a factory to create URLs for WCS Get Coverage requests. @param {String} serviceAddress The address of the WCS server. @param {String} coverageName The name of the coverage to retrieve. @param {String} wcsVersion The version of ...
[ "Constructs", "a", "WCS", "tile", "URL", "builder", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/util/WcsTileUrlBuilder.js#L40-L78
train
NASAWorldWind/WebWorldWind
src/shapes/Annotation.js
function (position, attributes) { if (!position) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "Annotation", "constructor", "missingPosition")); } Renderable.call(this); /** * This annotation's geogra...
javascript
function (position, attributes) { if (!position) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "Annotation", "constructor", "missingPosition")); } Renderable.call(this); /** * This annotation's geogra...
[ "function", "(", "position", ",", "attributes", ")", "{", "if", "(", "!", "position", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"Annotation\"", ",", "\"constructor\"", ",", "\"miss...
Constructs an annotation. @alias Annotation @constructor @augments Renderable @classdesc Represents an Annotation shape. An annotation displays a callout, a text and a leader pointing the annotation's geographic position to the ground. @param {Position} position The annotations's geographic position. @param {Annotation...
[ "Constructs", "an", "annotation", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/shapes/Annotation.js#L62-L126
train
NASAWorldWind/WebWorldWind
src/shapes/SurfaceRectangle.js
function (center, width, height, heading, attributes) { if (!center) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "SurfaceRectangle", "constructor", "missingLocation")); } if (width < 0 || height < 0) { throw n...
javascript
function (center, width, height, heading, attributes) { if (!center) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "SurfaceRectangle", "constructor", "missingLocation")); } if (width < 0 || height < 0) { throw n...
[ "function", "(", "center", ",", "width", ",", "height", ",", "heading", ",", "attributes", ")", "{", "if", "(", "!", "center", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"Surfac...
Constructs a surface rectangle with a specified center and size and an optional attributes bundle. @alias SurfaceRectangle @constructor @augments SurfaceShape @classdesc Represents a rectangle draped over the terrain surface. <p> SurfaceRectangle uses the following attributes from its associated shape attributes bundle...
[ "Constructs", "a", "surface", "rectangle", "with", "a", "specified", "center", "and", "size", "and", "an", "optional", "attributes", "bundle", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/shapes/SurfaceRectangle.js#L64-L82
train
NASAWorldWind/WebWorldWind
src/geom/Matrix3.js
function (m11, m12, m13, m21, m22, m23, m31, m32, m33) { this[0] = m11; this[1] = m12; this[2] = m13; this[3] = m21; this[4] = m22; this[5] = m23; this[6] = m31; ...
javascript
function (m11, m12, m13, m21, m22, m23, m31, m32, m33) { this[0] = m11; this[1] = m12; this[2] = m13; this[3] = m21; this[4] = m22; this[5] = m23; this[6] = m31; ...
[ "function", "(", "m11", ",", "m12", ",", "m13", ",", "m21", ",", "m22", ",", "m23", ",", "m31", ",", "m32", ",", "m33", ")", "{", "this", "[", "0", "]", "=", "m11", ";", "this", "[", "1", "]", "=", "m12", ";", "this", "[", "2", "]", "=", ...
Constructs a 3 x 3 matrix. @alias Matrix3 @constructor @classdesc Represents a 3 x 3 double precision matrix stored in a Float64Array in row-major order. @param {Number} m11 matrix element at row 1, column 1. @param {Number} m12 matrix element at row 1, column 2. @param {Number} m13 matrix element at row 1, column 3. ...
[ "Constructs", "a", "3", "x", "3", "matrix", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/geom/Matrix3.js#L44-L56
train
NASAWorldWind/WebWorldWind
src/error/UnsupportedOperationError.js
function (message) { AbstractError.call(this, "UnsupportedOperationError", message); var stack; try { //noinspection ExceptionCaughtLocallyJS throw new Error(); } catch (e) { stack = e.stack; } this....
javascript
function (message) { AbstractError.call(this, "UnsupportedOperationError", message); var stack; try { //noinspection ExceptionCaughtLocallyJS throw new Error(); } catch (e) { stack = e.stack; } this....
[ "function", "(", "message", ")", "{", "AbstractError", ".", "call", "(", "this", ",", "\"UnsupportedOperationError\"", ",", "message", ")", ";", "var", "stack", ";", "try", "{", "//noinspection ExceptionCaughtLocallyJS", "throw", "new", "Error", "(", ")", ";", ...
Constructs an unsupported-operation error with a specified message. @alias UnsupportedOperationError @constructor @classdesc Represents an error associated with an operation that is not available or should not be invoked. Typically raised when an abstract function of an abstract base class is called because a subclass ...
[ "Constructs", "an", "unsupported", "-", "operation", "error", "with", "a", "specified", "message", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/error/UnsupportedOperationError.js#L34-L45
train
NASAWorldWind/WebWorldWind
src/globe/TerrainTile.js
function (sector, level, row, column) { Tile.call(this, sector, level, row, column); // args are checked in the superclass' constructor /** * The transformation matrix that maps tile local coordinates to model coordinates. * @type {Matrix} */ t...
javascript
function (sector, level, row, column) { Tile.call(this, sector, level, row, column); // args are checked in the superclass' constructor /** * The transformation matrix that maps tile local coordinates to model coordinates. * @type {Matrix} */ t...
[ "function", "(", "sector", ",", "level", ",", "row", ",", "column", ")", "{", "Tile", ".", "call", "(", "this", ",", "sector", ",", "level", ",", "row", ",", "column", ")", ";", "// args are checked in the superclass' constructor", "/**\n * The trans...
Constructs a terrain tile. @alias TerrainTile @constructor @augments Tile @classdesc Represents a portion of a globe's terrain. Applications typically do not interact directly with this class. @param {Sector} sector The sector this tile covers. @param {Level} level The level this tile is associated with. @param {Number...
[ "Constructs", "a", "terrain", "tile", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/globe/TerrainTile.js#L46-L90
train
NASAWorldWind/WebWorldWind
src/layer/RestTiledImageLayer.js
function (serverAddress, pathToData, displayName, configuration) { var cachePath = WWUtil.urlPath(serverAddress + "/" + pathToData); TiledImageLayer.call(this, (configuration && configuration.sector) || Sector.FULL_SPHERE, (configuration && configuration.levelZer...
javascript
function (serverAddress, pathToData, displayName, configuration) { var cachePath = WWUtil.urlPath(serverAddress + "/" + pathToData); TiledImageLayer.call(this, (configuration && configuration.sector) || Sector.FULL_SPHERE, (configuration && configuration.levelZer...
[ "function", "(", "serverAddress", ",", "pathToData", ",", "displayName", ",", "configuration", ")", "{", "var", "cachePath", "=", "WWUtil", ".", "urlPath", "(", "serverAddress", "+", "\"/\"", "+", "pathToData", ")", ";", "TiledImageLayer", ".", "call", "(", ...
Constructs a tiled image layer that uses a REST interface to retrieve its imagery. @alias RestTiledImageLayer @constructor @augments TiledImageLayer @classdesc Displays a layer whose imagery is retrieved using a REST interface. See [LevelRowColumnUrlBuilder]{@link LevelRowColumnUrlBuilder} for a description of the REST...
[ "Constructs", "a", "tiled", "image", "layer", "that", "uses", "a", "REST", "interface", "to", "retrieve", "its", "imagery", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/layer/RestTiledImageLayer.js#L61-L76
train
NASAWorldWind/WebWorldWind
src/ogc/wcs/WcsCoverage.js
function (coverageId, webCoverageService) { if (!coverageId) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "WcsCoverage", "constructor", "missingId")); } if (!webCoverageService) { throw new ArgumentError( ...
javascript
function (coverageId, webCoverageService) { if (!coverageId) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "WcsCoverage", "constructor", "missingId")); } if (!webCoverageService) { throw new ArgumentError( ...
[ "function", "(", "coverageId", ",", "webCoverageService", ")", "{", "if", "(", "!", "coverageId", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"WcsCoverage\"", ",", "\"constructor\"", "...
A simple object representation of a Web Coverage Service coverage. Provides utility methods and properties for use in common WCS Coverage operations. @param {String} coverageId the name or id of the coverage @param {WebCoverageService} webCoverageService the WebCoverageService providing the coverage @constructor
[ "A", "simple", "object", "representation", "of", "a", "Web", "Coverage", "Service", "coverage", ".", "Provides", "utility", "methods", "and", "properties", "for", "use", "in", "common", "WCS", "Coverage", "operations", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/ogc/wcs/WcsCoverage.js#L37-L77
train
NASAWorldWind/WebWorldWind
src/layer/BMNGRestLayer.js
function (serverAddress, pathToData, displayName, initialTime) { Layer.call(this, displayName || "Blue Marble time series"); /** * A value indicating the month to display. The nearest month to the specified time is displayed. * @type {Date} * @default Janu...
javascript
function (serverAddress, pathToData, displayName, initialTime) { Layer.call(this, displayName || "Blue Marble time series"); /** * A value indicating the month to display. The nearest month to the specified time is displayed. * @type {Date} * @default Janu...
[ "function", "(", "serverAddress", ",", "pathToData", ",", "displayName", ",", "initialTime", ")", "{", "Layer", ".", "call", "(", "this", ",", "displayName", "||", "\"Blue Marble time series\"", ")", ";", "/**\n * A value indicating the month to display. The n...
Constructs a Blue Marble layer. @alias BMNGRestLayer @constructor @augments Layer @classdesc Represents the 12 month collection of Blue Marble Next Generation imagery for the year 2004. By default the month of January is displayed, but this can be changed by setting this class' time property to indicate the month to di...
[ "Constructs", "a", "Blue", "Marble", "layer", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/layer/BMNGRestLayer.js#L53-L92
train
NASAWorldWind/WebWorldWind
examples/ParseUrlArguments.js
function () { var result = {}; var queryString = window.location.href.split("?"); if (queryString && queryString.length > 1) { var args = queryString[1].split("&"); for (var a = 0; a < args.length; a++) { var arg = args[a].split("...
javascript
function () { var result = {}; var queryString = window.location.href.split("?"); if (queryString && queryString.length > 1) { var args = queryString[1].split("&"); for (var a = 0; a < args.length; a++) { var arg = args[a].split("...
[ "function", "(", ")", "{", "var", "result", "=", "{", "}", ";", "var", "queryString", "=", "window", ".", "location", ".", "href", ".", "split", "(", "\"?\"", ")", ";", "if", "(", "queryString", "&&", "queryString", ".", "length", ">", "1", ")", "{...
Function to obtain arguments from query string.
[ "Function", "to", "obtain", "arguments", "from", "query", "string", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/examples/ParseUrlArguments.js#L54-L77
train
NASAWorldWind/WebWorldWind
src/render/TextRenderer.js
function (drawContext) { if (!drawContext) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "TextRenderer", "constructor", "missingDc")); } // Internal use only. Intentionally not documented. this.canvas2D = document.cr...
javascript
function (drawContext) { if (!drawContext) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "TextRenderer", "constructor", "missingDc")); } // Internal use only. Intentionally not documented. this.canvas2D = document.cr...
[ "function", "(", "drawContext", ")", "{", "if", "(", "!", "drawContext", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"TextRenderer\"", ",", "\"constructor\"", ",", "\"missingDc\"", ")"...
Constructs a TextRenderer instance. @alias TextRenderer @constructor @classdesc Provides methods useful for displaying text. An instance of this class is attached to the WorldWindow {@link DrawContext} and is not intended to be used independently of that. Applications typically do not create instances of this class. @p...
[ "Constructs", "a", "TextRenderer", "instance", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/render/TextRenderer.js#L51-L99
train
NASAWorldWind/WebWorldWind
apps/util/GoToBox.js
function (worldWindow) { var thisGoToBox = this; this.wwd = worldWindow; $("#searchBox").find("button").on("click", function (e) { thisGoToBox.onSearchButton(e); }); this.geocoder = new WorldWind.NominatimGeocoder(); $("#searchText").on("keypress", function ...
javascript
function (worldWindow) { var thisGoToBox = this; this.wwd = worldWindow; $("#searchBox").find("button").on("click", function (e) { thisGoToBox.onSearchButton(e); }); this.geocoder = new WorldWind.NominatimGeocoder(); $("#searchText").on("keypress", function ...
[ "function", "(", "worldWindow", ")", "{", "var", "thisGoToBox", "=", "this", ";", "this", ".", "wwd", "=", "worldWindow", ";", "$", "(", "\"#searchBox\"", ")", ".", "find", "(", "\"button\"", ")", ".", "on", "(", "\"click\"", ",", "function", "(", "e",...
Constructs a GoToBox. @alias GoToBox @constructor @classdesc Provides a search box enabling the user to find and move to specified locations. @param {WorldWindow} worldWindow The WorldWindow to associate this GoToBox with.
[ "Constructs", "a", "GoToBox", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/apps/util/GoToBox.js#L30-L42
train
NASAWorldWind/WebWorldWind
examples/WMS.js
function (xmlDom) { // Create a WmsCapabilities object from the XML DOM var wms = new WorldWind.WmsCapabilities(xmlDom); // Retrieve a WmsLayerCapabilities object by the desired layer name var wmsLayerCapabilities = wms.getNamedLayer(layerName); // Form a conf...
javascript
function (xmlDom) { // Create a WmsCapabilities object from the XML DOM var wms = new WorldWind.WmsCapabilities(xmlDom); // Retrieve a WmsLayerCapabilities object by the desired layer name var wmsLayerCapabilities = wms.getNamedLayer(layerName); // Form a conf...
[ "function", "(", "xmlDom", ")", "{", "// Create a WmsCapabilities object from the XML DOM", "var", "wms", "=", "new", "WorldWind", ".", "WmsCapabilities", "(", "xmlDom", ")", ";", "// Retrieve a WmsLayerCapabilities object by the desired layer name", "var", "wmsLayerCapabilitie...
Called asynchronously to parse and create the WMS layer
[ "Called", "asynchronously", "to", "parse", "and", "create", "the", "WMS", "layer" ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/examples/WMS.js#L59-L74
train
NASAWorldWind/WebWorldWind
src/formats/kml/util/KmlRemoteFile.js
function(options) { if(!options.ajax && !options.zip) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "RemoteDocument", "constructor", "Invalid option for retrieval specified. Use either ajax or zip option.") ); } thi...
javascript
function(options) { if(!options.ajax && !options.zip) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "RemoteDocument", "constructor", "Invalid option for retrieval specified. Use either ajax or zip option.") ); } thi...
[ "function", "(", "options", ")", "{", "if", "(", "!", "options", ".", "ajax", "&&", "!", "options", ".", "zip", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"RemoteDocument\"", ",...
Creates representation of KmlRemoteFile. In order to load an object it is necessary to run get function on created object. @param options {Object} @param options.ajax {Boolean} If we should use plain AJAX @param options.zip {Boolean} If we are downloading kmz @param options.responseType {String} Optional responseType a...
[ "Creates", "representation", "of", "KmlRemoteFile", ".", "In", "order", "to", "load", "an", "object", "it", "is", "necessary", "to", "run", "get", "function", "on", "created", "object", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/formats/kml/util/KmlRemoteFile.js#L36-L45
train
NASAWorldWind/WebWorldWind
src/shapes/SurfaceEllipse.js
function (center, majorRadius, minorRadius, heading, attributes) { if (!center) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "SurfaceEllipse", "constructor", "missingLocation")); } if (majorRadius < 0 || minorRadius < 0) { ...
javascript
function (center, majorRadius, minorRadius, heading, attributes) { if (!center) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "SurfaceEllipse", "constructor", "missingLocation")); } if (majorRadius < 0 || minorRadius < 0) { ...
[ "function", "(", "center", ",", "majorRadius", ",", "minorRadius", ",", "heading", ",", "attributes", ")", "{", "if", "(", "!", "center", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", ...
Constructs a surface ellipse with a specified center and radii and an optional attributes bundle. @alias SurfaceEllipse @constructor @augments SurfaceShape @classdesc Represents an ellipse draped over the terrain surface. <p> SurfaceEllipse uses the following attributes from its associated shape attributes bundle: <ul>...
[ "Constructs", "a", "surface", "ellipse", "with", "a", "specified", "center", "and", "radii", "and", "an", "optional", "attributes", "bundle", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/shapes/SurfaceEllipse.js#L64-L83
train
NASAWorldWind/WebWorldWind
src/ogc/wms/WmsLayerCapabilities.js
function (layerElement, parentNode) { if (!layerElement) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "WmsLayerCapabilities", "constructor", "Layer element is null or undefined.")); } /** *...
javascript
function (layerElement, parentNode) { if (!layerElement) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "WmsLayerCapabilities", "constructor", "Layer element is null or undefined.")); } /** *...
[ "function", "(", "layerElement", ",", "parentNode", ")", "{", "if", "(", "!", "layerElement", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"WmsLayerCapabilities\"", ",", "\"constructor\""...
Constructs an WMS Layer instance from an XML DOM. @alias WmsLayerCapabilities @constructor @classdesc Represents a WMS layer description from a WMS Capabilities document. This object holds all the fields specified in the associated WMS Capabilities document. @param {{}} layerElement A WMS Layer element describing the l...
[ "Constructs", "an", "WMS", "Layer", "instance", "from", "an", "XML", "DOM", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/ogc/wms/WmsLayerCapabilities.js#L38-L119
train
NASAWorldWind/WebWorldWind
src/shapes/Placemark.js
function (position, eyeDistanceScaling, attributes) { if (!position) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "Placemark", "constructor", "missingPosition")); } Renderable.call(this); /** * The pl...
javascript
function (position, eyeDistanceScaling, attributes) { if (!position) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "Placemark", "constructor", "missingPosition")); } Renderable.call(this); /** * The pl...
[ "function", "(", "position", ",", "eyeDistanceScaling", ",", "attributes", ")", "{", "if", "(", "!", "position", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"Placemark\"", ",", "\"co...
Constructs a placemark. @alias Placemark @constructor @augments Renderable @classdesc Represents a Placemark shape. A placemark displays an image, a label and a leader line connecting the placemark's geographic position to the ground. All three of these items are optional. By default, the leader line is not pickable. S...
[ "Constructs", "a", "placemark", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/shapes/Placemark.js#L75-L281
train
NASAWorldWind/WebWorldWind
src/shapes/SurfaceSector.js
function (sector, attributes) { if (!sector) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "SurfaceSector", "constructor", "missingSector")); } SurfaceShape.call(this, attributes); /** * This shape's s...
javascript
function (sector, attributes) { if (!sector) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "SurfaceSector", "constructor", "missingSector")); } SurfaceShape.call(this, attributes); /** * This shape's s...
[ "function", "(", "sector", ",", "attributes", ")", "{", "if", "(", "!", "sector", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"SurfaceSector\"", ",", "\"constructor\"", ",", "\"missi...
Constructs a surface sector. @alias SurfaceSector @constructor @augments SurfaceShape @classdesc Represents a sector draped over the terrain surface. The sector is specified as a rectangular region in geographic coordinates. By default, a surface sector is drawn with a linear path, see {@link SurfaceShape#pathType}. <p...
[ "Constructs", "a", "surface", "sector", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/shapes/SurfaceSector.js#L58-L74
train
NASAWorldWind/WebWorldWind
src/layer/WmsLayer.js
function (config, timeString) { if (!config) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "WmsLayer", "constructor", "No configuration specified.")); } var cachePath = config.service + config.layerNames + config.styleNames; ...
javascript
function (config, timeString) { if (!config) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "WmsLayer", "constructor", "No configuration specified.")); } var cachePath = config.service + config.layerNames + config.styleNames; ...
[ "function", "(", "config", ",", "timeString", ")", "{", "if", "(", "!", "config", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"WmsLayer\"", ",", "\"constructor\"", ",", "\"No configu...
Constructs a WMS image layer. @alias WmsLayer @constructor @augments TiledImageLayer @classdesc Displays a WMS image layer. @param {{}} config Specifies configuration information for the layer. Must contain the following properties: <ul> <li>service: {String} The URL of the WMS server.</li> <li>layerNames: {String} A c...
[ "Constructs", "a", "WMS", "image", "layer", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/layer/WmsLayer.js#L63-L92
train
NASAWorldWind/WebWorldWind
src/geom/BoundingBox.js
function () { /** * The box's center point. * @type {Vec3} * @default (0, 0, 0) */ this.center = new Vec3(0, 0, 0); /** * The center point of the box's bottom. (The origin of the R axis.) * @type {Vec3} ...
javascript
function () { /** * The box's center point. * @type {Vec3} * @default (0, 0, 0) */ this.center = new Vec3(0, 0, 0); /** * The center point of the box's bottom. (The origin of the R axis.) * @type {Vec3} ...
[ "function", "(", ")", "{", "/**\n * The box's center point.\n * @type {Vec3}\n * @default (0, 0, 0)\n */", "this", ".", "center", "=", "new", "Vec3", "(", "0", ",", "0", ",", "0", ")", ";", "/**\n * The center point of...
Constructs a unit bounding box. The unit box has its R, S and T axes aligned with the X, Y and Z axes, respectively, and has its length, width and height set to 1. @alias BoundingBox @constructor @classdesc Represents a bounding box in Cartesian coordinates. Typically used as a bounding volume.
[ "Constructs", "a", "unit", "bounding", "box", ".", "The", "unit", "box", "has", "its", "R", "S", "and", "T", "axes", "aligned", "with", "the", "X", "Y", "and", "Z", "axes", "respectively", "and", "has", "its", "length", "width", "and", "height", "set",...
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/geom/BoundingBox.js#L54-L113
train
NASAWorldWind/WebWorldWind
src/globe/TiledElevationCoverage.js
function (config) { if (!config) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "TiledElevationCoverage", "constructor", "missingConfig")); } if (!config.coverageSector) { throw new ArgumentError( ...
javascript
function (config) { if (!config) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "TiledElevationCoverage", "constructor", "missingConfig")); } if (!config.coverageSector) { throw new ArgumentError( ...
[ "function", "(", "config", ")", "{", "if", "(", "!", "config", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage", "(", "Logger", ".", "LEVEL_SEVERE", ",", "\"TiledElevationCoverage\"", ",", "\"constructor\"", ",", "\"missingConfig\"", ...
Constructs a TiledElevationCoverage @alias TiledElevationCoverage @constructor @classdesc Represents the elevations for an area, often but not necessarily the whole globe. @param {{}} config Configuration properties for the coverage: <ul> <li>coverageSector: {Sector} The sector this coverage spans.</li> <li>resolution:...
[ "Constructs", "a", "TiledElevationCoverage" ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/globe/TiledElevationCoverage.js#L63-L198
train
NASAWorldWind/WebWorldWind
src/layer/WmtsLayerTile.js
function (sector, tileMatrix, row, column, imagePath) { this.sector = sector; this.tileMatrix = tileMatrix; this.row = row; this.column = column; this.imagePath = imagePath; this.texelSize = (sector.deltaLatitude() * Angle.DEGREES_TO_RADIANS) / ti...
javascript
function (sector, tileMatrix, row, column, imagePath) { this.sector = sector; this.tileMatrix = tileMatrix; this.row = row; this.column = column; this.imagePath = imagePath; this.texelSize = (sector.deltaLatitude() * Angle.DEGREES_TO_RADIANS) / ti...
[ "function", "(", "sector", ",", "tileMatrix", ",", "row", ",", "column", ",", "imagePath", ")", "{", "this", ".", "sector", "=", "sector", ";", "this", ".", "tileMatrix", "=", "tileMatrix", ";", "this", ".", "row", "=", "row", ";", "this", ".", "colu...
This is an internal class and is intentionally not documented.
[ "This", "is", "an", "internal", "class", "and", "is", "intentionally", "not", "documented", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/layer/WmtsLayerTile.js#L34-L46
train
NASAWorldWind/WebWorldWind
src/render/FramebufferTile.js
function (sector, level, row, column, cacheKey) { if (!cacheKey || (cacheKey.length < 1)) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "FramebufferTile", "constructor", "The specified cache name is null, undefined or zero lengt...
javascript
function (sector, level, row, column, cacheKey) { if (!cacheKey || (cacheKey.length < 1)) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "FramebufferTile", "constructor", "The specified cache name is null, undefined or zero lengt...
[ "function", "(", "sector", ",", "level", ",", "row", ",", "column", ",", "cacheKey", ")", "{", "if", "(", "!", "cacheKey", "||", "(", "cacheKey", ".", "length", "<", "1", ")", ")", "{", "throw", "new", "ArgumentError", "(", "Logger", ".", "logMessage...
Constructs a framebuffer tile. @alias FramebufferTile @constructor @augments TextureTile @classdesc Represents a WebGL framebuffer applied to a portion of a globe's terrain. The framebuffer's width and height in pixels are equal to this tile's [tileWidth]{@link FramebufferTile#tileWidth} and [tileHeight]{@link Framebuf...
[ "Constructs", "a", "framebuffer", "tile", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/src/render/FramebufferTile.js#L57-L74
train
NASAWorldWind/WebWorldWind
examples/Measurements.js
doCalc
function doCalc() { var distance = lengthMeasurer.getLength(pathPositions, false, WorldWind.GREAT_CIRCLE); var terrainDistance = lengthMeasurer.getLength(pathPositions, true, WorldWind.GREAT_CIRCLE); var geographicDistance = lengthMeasurer.getGeographicDistance(pathPositions, WorldWi...
javascript
function doCalc() { var distance = lengthMeasurer.getLength(pathPositions, false, WorldWind.GREAT_CIRCLE); var terrainDistance = lengthMeasurer.getLength(pathPositions, true, WorldWind.GREAT_CIRCLE); var geographicDistance = lengthMeasurer.getGeographicDistance(pathPositions, WorldWi...
[ "function", "doCalc", "(", ")", "{", "var", "distance", "=", "lengthMeasurer", ".", "getLength", "(", "pathPositions", ",", "false", ",", "WorldWind", ".", "GREAT_CIRCLE", ")", ";", "var", "terrainDistance", "=", "lengthMeasurer", ".", "getLength", "(", "pathP...
Calculate the length and area measurements of the path defined before.
[ "Calculate", "the", "length", "and", "area", "measurements", "of", "the", "path", "defined", "before", "." ]
399daee66deded581a2d1067a2ac04232c954b8f
https://github.com/NASAWorldWind/WebWorldWind/blob/399daee66deded581a2d1067a2ac04232c954b8f/examples/Measurements.js#L93-L106
train
objectivehtml/FlipClock
src/flipclock/js/libs/timer.js
function(callback) { this.factory.running = false; this._clearInterval(callback); this.callback(this.callbacks.stop); this.callback(callback); }
javascript
function(callback) { this.factory.running = false; this._clearInterval(callback); this.callback(this.callbacks.stop); this.callback(callback); }
[ "function", "(", "callback", ")", "{", "this", ".", "factory", ".", "running", "=", "false", ";", "this", ".", "_clearInterval", "(", "callback", ")", ";", "this", ".", "callback", "(", "this", ".", "callbacks", ".", "stop", ")", ";", "this", ".", "c...
This method is stops the timer @param callback A function that is called once the timer is destroyed @return void
[ "This", "method", "is", "stops", "the", "timer" ]
6559204ce92585d29ccc1b5f303de9b85bf3f76a
https://github.com/objectivehtml/FlipClock/blob/6559204ce92585d29ccc1b5f303de9b85bf3f76a/src/flipclock/js/libs/timer.js#L129-L134
train
objectivehtml/FlipClock
src/flipclock/js/libs/timer.js
function(callback) { var t = this; t._interval(callback); t.timer = setInterval(function() { t._interval(callback); }, this.interval); }
javascript
function(callback) { var t = this; t._interval(callback); t.timer = setInterval(function() { t._interval(callback); }, this.interval); }
[ "function", "(", "callback", ")", "{", "var", "t", "=", "this", ";", "t", ".", "_interval", "(", "callback", ")", ";", "t", ".", "timer", "=", "setInterval", "(", "function", "(", ")", "{", "t", ".", "_interval", "(", "callback", ")", ";", "}", "...
This sets the timer interval @param callback A function that is called once the timer is destroyed @return void
[ "This", "sets", "the", "timer", "interval" ]
6559204ce92585d29ccc1b5f303de9b85bf3f76a
https://github.com/objectivehtml/FlipClock/blob/6559204ce92585d29ccc1b5f303de9b85bf3f76a/src/flipclock/js/libs/timer.js#L191-L199
train
objectivehtml/FlipClock
src/flipclock/js/libs/face.js
function(digit) { var obj = this.createList(digit, { classes: { active: this.factory.classes.active, before: this.factory.classes.before, flip: this.factory.classes.flip } }); this.appendDigitToClock(obj); }
javascript
function(digit) { var obj = this.createList(digit, { classes: { active: this.factory.classes.active, before: this.factory.classes.before, flip: this.factory.classes.flip } }); this.appendDigitToClock(obj); }
[ "function", "(", "digit", ")", "{", "var", "obj", "=", "this", ".", "createList", "(", "digit", ",", "{", "classes", ":", "{", "active", ":", "this", ".", "factory", ".", "classes", ".", "active", ",", "before", ":", "this", ".", "factory", ".", "c...
Add a digit to the clock face
[ "Add", "a", "digit", "to", "the", "clock", "face" ]
6559204ce92585d29ccc1b5f303de9b85bf3f76a
https://github.com/objectivehtml/FlipClock/blob/6559204ce92585d29ccc1b5f303de9b85bf3f76a/src/flipclock/js/libs/face.js#L160-L170
train
objectivehtml/FlipClock
src/flipclock/js/libs/factory.js
function(name) { var lang; if(FlipClock.Lang[name.ucfirst()]) { lang = FlipClock.Lang[name.ucfirst()]; } else if(FlipClock.Lang[name]) { lang = FlipClock.Lang[name]; } else { lang = FlipClock.Lang[this.defaultLanguage]; } return this.lang = lang; }
javascript
function(name) { var lang; if(FlipClock.Lang[name.ucfirst()]) { lang = FlipClock.Lang[name.ucfirst()]; } else if(FlipClock.Lang[name]) { lang = FlipClock.Lang[name]; } else { lang = FlipClock.Lang[this.defaultLanguage]; } return this.lang = lang; }
[ "function", "(", "name", ")", "{", "var", "lang", ";", "if", "(", "FlipClock", ".", "Lang", "[", "name", ".", "ucfirst", "(", ")", "]", ")", "{", "lang", "=", "FlipClock", ".", "Lang", "[", "name", ".", "ucfirst", "(", ")", "]", ";", "}", "else...
Load the FlipClock.Lang object @param object The name of the language to load
[ "Load", "the", "FlipClock", ".", "Lang", "object" ]
6559204ce92585d29ccc1b5f303de9b85bf3f76a
https://github.com/objectivehtml/FlipClock/blob/6559204ce92585d29ccc1b5f303de9b85bf3f76a/src/flipclock/js/libs/factory.js#L245-L259
train
objectivehtml/FlipClock
src/flipclock/js/libs/factory.js
function(callback) { var t = this; if(!t.running && (!t.countdown || t.countdown && t.time.time > 0)) { t.face.start(t.time); t.timer.start(function() { t.flip(); if(typeof callback === "function") { callback(); } }); } else { t.log('Trying to start timer when co...
javascript
function(callback) { var t = this; if(!t.running && (!t.countdown || t.countdown && t.time.time > 0)) { t.face.start(t.time); t.timer.start(function() { t.flip(); if(typeof callback === "function") { callback(); } }); } else { t.log('Trying to start timer when co...
[ "function", "(", "callback", ")", "{", "var", "t", "=", "this", ";", "if", "(", "!", "t", ".", "running", "&&", "(", "!", "t", ".", "countdown", "||", "t", ".", "countdown", "&&", "t", ".", "time", ".", "time", ">", "0", ")", ")", "{", "t", ...
Starts the clock
[ "Starts", "the", "clock" ]
6559204ce92585d29ccc1b5f303de9b85bf3f76a
https://github.com/objectivehtml/FlipClock/blob/6559204ce92585d29ccc1b5f303de9b85bf3f76a/src/flipclock/js/libs/factory.js#L293-L309
train
objectivehtml/FlipClock
src/flipclock/js/libs/core.js
function(_default, options) { if(typeof _default !== "object") { _default = {}; } if(typeof options !== "object") { options = {}; } this.setOptions($.extend(true, {}, _default, options)); }
javascript
function(_default, options) { if(typeof _default !== "object") { _default = {}; } if(typeof options !== "object") { options = {}; } this.setOptions($.extend(true, {}, _default, options)); }
[ "function", "(", "_default", ",", "options", ")", "{", "if", "(", "typeof", "_default", "!==", "\"object\"", ")", "{", "_default", "=", "{", "}", ";", "}", "if", "(", "typeof", "options", "!==", "\"object\"", ")", "{", "options", "=", "{", "}", ";", ...
Sets the default options @param object The default options @param object The override options
[ "Sets", "the", "default", "options" ]
6559204ce92585d29ccc1b5f303de9b85bf3f76a
https://github.com/objectivehtml/FlipClock/blob/6559204ce92585d29ccc1b5f303de9b85bf3f76a/src/flipclock/js/libs/core.js#L69-L77
train
objectivehtml/FlipClock
src/flipclock/js/libs/core.js
function(method) { if(typeof method === "function") { var args = []; for(var x = 1; x <= arguments.length; x++) { if(arguments[x]) { args.push(arguments[x]); } } method.apply(this, args); } }
javascript
function(method) { if(typeof method === "function") { var args = []; for(var x = 1; x <= arguments.length; x++) { if(arguments[x]) { args.push(arguments[x]); } } method.apply(this, args); } }
[ "function", "(", "method", ")", "{", "if", "(", "typeof", "method", "===", "\"function\"", ")", "{", "var", "args", "=", "[", "]", ";", "for", "(", "var", "x", "=", "1", ";", "x", "<=", "arguments", ".", "length", ";", "x", "++", ")", "{", "if"...
Delegates the callback to the defined method @param object The default options @param object The override options
[ "Delegates", "the", "callback", "to", "the", "defined", "method" ]
6559204ce92585d29ccc1b5f303de9b85bf3f76a
https://github.com/objectivehtml/FlipClock/blob/6559204ce92585d29ccc1b5f303de9b85bf3f76a/src/flipclock/js/libs/core.js#L86-L98
train
objectivehtml/FlipClock
src/flipclock/js/libs/time.js
function(str) { var data = []; str = str.toString(); for(var x = 0;x < str.length; x++) { if(str[x].match(/^\d*$/g)) { data.push(str[x]); } } return data; }
javascript
function(str) { var data = []; str = str.toString(); for(var x = 0;x < str.length; x++) { if(str[x].match(/^\d*$/g)) { data.push(str[x]); } } return data; }
[ "function", "(", "str", ")", "{", "var", "data", "=", "[", "]", ";", "str", "=", "str", ".", "toString", "(", ")", ";", "for", "(", "var", "x", "=", "0", ";", "x", "<", "str", ".", "length", ";", "x", "++", ")", "{", "if", "(", "str", "["...
Convert a string or integer to an array of digits @param mixed String or Integer of digits @return array An array of digits
[ "Convert", "a", "string", "or", "integer", "to", "an", "array", "of", "digits" ]
6559204ce92585d29ccc1b5f303de9b85bf3f76a
https://github.com/objectivehtml/FlipClock/blob/6559204ce92585d29ccc1b5f303de9b85bf3f76a/src/flipclock/js/libs/time.js#L77-L89
train
objectivehtml/FlipClock
src/flipclock/js/libs/time.js
function(i) { var timeStr = this.toString(); var length = timeStr.length; if(timeStr[length - i]) { return timeStr[length - i]; } return false; }
javascript
function(i) { var timeStr = this.toString(); var length = timeStr.length; if(timeStr[length - i]) { return timeStr[length - i]; } return false; }
[ "function", "(", "i", ")", "{", "var", "timeStr", "=", "this", ".", "toString", "(", ")", ";", "var", "length", "=", "timeStr", ".", "length", ";", "if", "(", "timeStr", "[", "length", "-", "i", "]", ")", "{", "return", "timeStr", "[", "length", ...
Get a specific digit from the time integer @param int The specific digit to select from the time @return mixed Returns FALSE if no digit is found, otherwise the method returns the defined digit
[ "Get", "a", "specific", "digit", "from", "the", "time", "integer" ]
6559204ce92585d29ccc1b5f303de9b85bf3f76a
https://github.com/objectivehtml/FlipClock/blob/6559204ce92585d29ccc1b5f303de9b85bf3f76a/src/flipclock/js/libs/time.js#L99-L108
train
objectivehtml/FlipClock
src/flipclock/js/libs/time.js
function(obj) { var data = []; $.each(obj, function(i, value) { value = value.toString(); if(value.length == 1) { value = '0'+value; } for(var x = 0; x < value.length; x++) { data.push(value.charAt(x)); } }); if(data.length > this.minimumDigits) { this.minim...
javascript
function(obj) { var data = []; $.each(obj, function(i, value) { value = value.toString(); if(value.length == 1) { value = '0'+value; } for(var x = 0; x < value.length; x++) { data.push(value.charAt(x)); } }); if(data.length > this.minimumDigits) { this.minim...
[ "function", "(", "obj", ")", "{", "var", "data", "=", "[", "]", ";", "$", ".", "each", "(", "obj", ",", "function", "(", "i", ",", "value", ")", "{", "value", "=", "value", ".", "toString", "(", ")", ";", "if", "(", "value", ".", "length", "=...
Formats any array of digits into a valid array of digits @param mixed An array of digits @return array An array of digits
[ "Formats", "any", "array", "of", "digits", "into", "a", "valid", "array", "of", "digits" ]
6559204ce92585d29ccc1b5f303de9b85bf3f76a
https://github.com/objectivehtml/FlipClock/blob/6559204ce92585d29ccc1b5f303de9b85bf3f76a/src/flipclock/js/libs/time.js#L117-L143
train
objectivehtml/FlipClock
src/flipclock/js/libs/time.js
function(includeSeconds) { var digits = [ this.getDays(), this.getHours(true), this.getMinutes(true) ]; if(includeSeconds) { digits.push(this.getSeconds(true)); } return this.digitize(digits); }
javascript
function(includeSeconds) { var digits = [ this.getDays(), this.getHours(true), this.getMinutes(true) ]; if(includeSeconds) { digits.push(this.getSeconds(true)); } return this.digitize(digits); }
[ "function", "(", "includeSeconds", ")", "{", "var", "digits", "=", "[", "this", ".", "getDays", "(", ")", ",", "this", ".", "getHours", "(", "true", ")", ",", "this", ".", "getMinutes", "(", "true", ")", "]", ";", "if", "(", "includeSeconds", ")", ...
Gets a digitized daily counter @return object Returns a digitized object
[ "Gets", "a", "digitized", "daily", "counter" ]
6559204ce92585d29ccc1b5f303de9b85bf3f76a
https://github.com/objectivehtml/FlipClock/blob/6559204ce92585d29ccc1b5f303de9b85bf3f76a/src/flipclock/js/libs/time.js#L165-L177
train
objectivehtml/FlipClock
src/flipclock/js/libs/time.js
function(date) { if(!date) { date = new Date(); } if (this.time instanceof Date) { if (this.factory.countdown) { return Math.max(this.time.getTime()/1000 - date.getTime()/1000,0); } else { return date.getTime()/1000 - this.time.getTime()/1000 ; } } else { return this.time; ...
javascript
function(date) { if(!date) { date = new Date(); } if (this.time instanceof Date) { if (this.factory.countdown) { return Math.max(this.time.getTime()/1000 - date.getTime()/1000,0); } else { return date.getTime()/1000 - this.time.getTime()/1000 ; } } else { return this.time; ...
[ "function", "(", "date", ")", "{", "if", "(", "!", "date", ")", "{", "date", "=", "new", "Date", "(", ")", ";", "}", "if", "(", "this", ".", "time", "instanceof", "Date", ")", "{", "if", "(", "this", ".", "factory", ".", "countdown", ")", "{", ...
Gets time count in seconds regardless of if targetting date or not. @return int Returns a floored integer
[ "Gets", "time", "count", "in", "seconds", "regardless", "of", "if", "targetting", "date", "or", "not", "." ]
6559204ce92585d29ccc1b5f303de9b85bf3f76a
https://github.com/objectivehtml/FlipClock/blob/6559204ce92585d29ccc1b5f303de9b85bf3f76a/src/flipclock/js/libs/time.js#L302-L316
train
objectivehtml/FlipClock
src/flipclock/js/libs/time.js
function(totalDigits, digits) { var total = 0; var newArray = []; $.each(digits, function(i, digit) { if(i < totalDigits) { total += parseInt(digits[i], 10); } else { newArray.push(digits[i]); } }); if(total === 0) { return newArray; } return digits; }
javascript
function(totalDigits, digits) { var total = 0; var newArray = []; $.each(digits, function(i, digit) { if(i < totalDigits) { total += parseInt(digits[i], 10); } else { newArray.push(digits[i]); } }); if(total === 0) { return newArray; } return digits; }
[ "function", "(", "totalDigits", ",", "digits", ")", "{", "var", "total", "=", "0", ";", "var", "newArray", "=", "[", "]", ";", "$", ".", "each", "(", "digits", ",", "function", "(", "i", ",", "digit", ")", "{", "if", "(", "i", "<", "totalDigits",...
Removes a specific number of leading zeros from the array. This method prevents you from removing too many digits, even if you try. @param int Total number of digits to remove @return array An array of digits
[ "Removes", "a", "specific", "number", "of", "leading", "zeros", "from", "the", "array", ".", "This", "method", "prevents", "you", "from", "removing", "too", "many", "digits", "even", "if", "you", "try", "." ]
6559204ce92585d29ccc1b5f303de9b85bf3f76a
https://github.com/objectivehtml/FlipClock/blob/6559204ce92585d29ccc1b5f303de9b85bf3f76a/src/flipclock/js/libs/time.js#L398-L416
train
objectivehtml/FlipClock
src/flipclock/js/libs/time.js
function(x) { if(this.time instanceof Date) { this.time.setSeconds(this.time.getSeconds() + x); } else { this.time += x; } }
javascript
function(x) { if(this.time instanceof Date) { this.time.setSeconds(this.time.getSeconds() + x); } else { this.time += x; } }
[ "function", "(", "x", ")", "{", "if", "(", "this", ".", "time", "instanceof", "Date", ")", "{", "this", ".", "time", ".", "setSeconds", "(", "this", ".", "time", ".", "getSeconds", "(", ")", "+", "x", ")", ";", "}", "else", "{", "this", ".", "t...
Adds X second to the current time
[ "Adds", "X", "second", "to", "the", "current", "time" ]
6559204ce92585d29ccc1b5f303de9b85bf3f76a
https://github.com/objectivehtml/FlipClock/blob/6559204ce92585d29ccc1b5f303de9b85bf3f76a/src/flipclock/js/libs/time.js#L422-L429
train
joeferner/redis-commander
lib/util.js
createRedisClient
function createRedisClient(clientConfig, callback) { let c = require('config'); let client = null; let conId = null; let redisOpts = { //showFriendlyErrorStack: true, db: clientConfig.dbIndex, password: clientConfig.password, connectionName: clientConfig.connectionName || c.get('redis.connectio...
javascript
function createRedisClient(clientConfig, callback) { let c = require('config'); let client = null; let conId = null; let redisOpts = { //showFriendlyErrorStack: true, db: clientConfig.dbIndex, password: clientConfig.password, connectionName: clientConfig.connectionName || c.get('redis.connectio...
[ "function", "createRedisClient", "(", "clientConfig", ",", "callback", ")", "{", "let", "c", "=", "require", "(", "'config'", ")", ";", "let", "client", "=", "null", ";", "let", "conId", "=", "null", ";", "let", "redisOpts", "=", "{", "//showFriendlyErrorS...
Function to craete a new redis client object by given parameter This one is used by creating clients at startup from command line, config file or new connections added via ui during runtime. The redis client created can be either a normal redis client or a sentinel client, base on configuration given. @param {object} ...
[ "Function", "to", "craete", "a", "new", "redis", "client", "object", "by", "given", "parameter", "This", "one", "is", "used", "by", "creating", "clients", "at", "startup", "from", "command", "line", "config", "file", "or", "new", "connections", "added", "via...
c8966ff20f53fac73537643b64162d4007af68a8
https://github.com/joeferner/redis-commander/blob/c8966ff20f53fac73537643b64162d4007af68a8/lib/util.js#L282-L338
train
joeferner/redis-commander
lib/util.js
parseRedisSentinel
function parseRedisSentinel(key, sentinelsString) { if (!sentinelsString) return []; // convert array entries from string to object if needed if (Array.isArray(sentinelsString)) { sentinelsString.forEach(function(entry, index) { if (typeof entry === 'string') { let tmp = entry.trim().split(':')...
javascript
function parseRedisSentinel(key, sentinelsString) { if (!sentinelsString) return []; // convert array entries from string to object if needed if (Array.isArray(sentinelsString)) { sentinelsString.forEach(function(entry, index) { if (typeof entry === 'string') { let tmp = entry.trim().split(':')...
[ "function", "parseRedisSentinel", "(", "key", ",", "sentinelsString", ")", "{", "if", "(", "!", "sentinelsString", ")", "return", "[", "]", ";", "// convert array entries from string to object if needed", "if", "(", "Array", ".", "isArray", "(", "sentinelsString", "...
Parse a string with redis sentinel names and ports to an objects as needed by ioredis for connections. Allowed formats are: <ul> <li>comma separeted list of <code>hostname:port</code> values, port is optional</li> <li>JSON-String with list of <code>hostname:port</code> string entries</li> <li>JSON-String with list of ...
[ "Parse", "a", "string", "with", "redis", "sentinel", "names", "and", "ports", "to", "an", "objects", "as", "needed", "by", "ioredis", "for", "connections", "." ]
c8966ff20f53fac73537643b64162d4007af68a8
https://github.com/joeferner/redis-commander/blob/c8966ff20f53fac73537643b64162d4007af68a8/lib/util.js#L621-L666
train
joeferner/redis-commander
web/static/scripts/redisCommander.js
enableJsonValidationCheck
function enableJsonValidationCheck(value, isJsonCheckBox) { try { JSON.parse(value); // if this is valid json and is array or object assume we want validation active if (value.match(/^\s*[{\[]/)) { $(isJsonCheckBox).click(); } } catch (ex) { // do nothing } }
javascript
function enableJsonValidationCheck(value, isJsonCheckBox) { try { JSON.parse(value); // if this is valid json and is array or object assume we want validation active if (value.match(/^\s*[{\[]/)) { $(isJsonCheckBox).click(); } } catch (ex) { // do nothing } }
[ "function", "enableJsonValidationCheck", "(", "value", ",", "isJsonCheckBox", ")", "{", "try", "{", "JSON", ".", "parse", "(", "value", ")", ";", "// if this is valid json and is array or object assume we want validation active", "if", "(", "value", ".", "match", "(", ...
check if given string value is valid json and, if so enable validation for given field if this is an json object or array. Do not automatically enable validation on numbers or quted strings. May be coincidence that this is json... @param {string} value string to check if valid json @param {string} isJsonCheckBox id st...
[ "check", "if", "given", "string", "value", "is", "valid", "json", "and", "if", "so", "enable", "validation", "for", "given", "field", "if", "this", "is", "an", "json", "object", "or", "array", ".", "Do", "not", "automatically", "enable", "validation", "on"...
c8966ff20f53fac73537643b64162d4007af68a8
https://github.com/joeferner/redis-commander/blob/c8966ff20f53fac73537643b64162d4007af68a8/web/static/scripts/redisCommander.js#L645-L656
train
joeferner/redis-commander
web/static/scripts/redisCommander.js
addInputValidator
function addInputValidator(inputId, format, currentState) { var input; if (typeof inputId === 'string') { input = $('#' + inputId) } else if (typeof inputId === 'object') { input = inputId; } if (!input){ console.log('Invalid html id given to validate format: ', inputId); return; } swi...
javascript
function addInputValidator(inputId, format, currentState) { var input; if (typeof inputId === 'string') { input = $('#' + inputId) } else if (typeof inputId === 'object') { input = inputId; } if (!input){ console.log('Invalid html id given to validate format: ', inputId); return; } swi...
[ "function", "addInputValidator", "(", "inputId", ",", "format", ",", "currentState", ")", "{", "var", "input", ";", "if", "(", "typeof", "inputId", "===", "'string'", ")", "{", "input", "=", "$", "(", "'#'", "+", "inputId", ")", "}", "else", "if", "(",...
Add data format validation function to an input element. The field gets decorated to visualize if input is valid for given data format. @param {string|object} inputId id of html input element to watch or jquery object @param {string} format data format to validate against, possible values: "json" @param {boolean} [cur...
[ "Add", "data", "format", "validation", "function", "to", "an", "input", "element", ".", "The", "field", "gets", "decorated", "to", "visualize", "if", "input", "is", "valid", "for", "given", "data", "format", "." ]
c8966ff20f53fac73537643b64162d4007af68a8
https://github.com/joeferner/redis-commander/blob/c8966ff20f53fac73537643b64162d4007af68a8/web/static/scripts/redisCommander.js#L816-L846
train
joeferner/redis-commander
web/static/scripts/redisCommander.js
validateInputAsJson
function validateInputAsJson() { if (this.value) { try { JSON.parse(this.value); setValidationClasses(this, true); } catch(e) { setValidationClasses(this, false); } } else { setValidationClasses(this, false) } }
javascript
function validateInputAsJson() { if (this.value) { try { JSON.parse(this.value); setValidationClasses(this, true); } catch(e) { setValidationClasses(this, false); } } else { setValidationClasses(this, false) } }
[ "function", "validateInputAsJson", "(", ")", "{", "if", "(", "this", ".", "value", ")", "{", "try", "{", "JSON", ".", "parse", "(", "this", ".", "value", ")", ";", "setValidationClasses", "(", "this", ",", "true", ")", ";", "}", "catch", "(", "e", ...
method to check if a input field contains valid json and set visual accordingly.
[ "method", "to", "check", "if", "a", "input", "field", "contains", "valid", "json", "and", "set", "visual", "accordingly", "." ]
c8966ff20f53fac73537643b64162d4007af68a8
https://github.com/joeferner/redis-commander/blob/c8966ff20f53fac73537643b64162d4007af68a8/web/static/scripts/redisCommander.js#L851-L864
train
joeferner/redis-commander
web/static/scripts/redisCommander.js
setValidationClasses
function setValidationClasses(element, success) { var add = (success ? 'validate-positive' : 'validate-negative'); var remove = (success ? 'validate-negative' : 'validate-positive'); if (element.className.indexOf(add) < 0) { $(element).removeClass(remove).addClass(add); } }
javascript
function setValidationClasses(element, success) { var add = (success ? 'validate-positive' : 'validate-negative'); var remove = (success ? 'validate-negative' : 'validate-positive'); if (element.className.indexOf(add) < 0) { $(element).removeClass(remove).addClass(add); } }
[ "function", "setValidationClasses", "(", "element", ",", "success", ")", "{", "var", "add", "=", "(", "success", "?", "'validate-positive'", ":", "'validate-negative'", ")", ";", "var", "remove", "=", "(", "success", "?", "'validate-negative'", ":", "'validate-p...
classes are only changed if not set right now @param {Element} element HTML DOM element to change validation classes @param {boolean} success true if positive validation class shall be assigned, false for error class
[ "classes", "are", "only", "changed", "if", "not", "set", "right", "now" ]
c8966ff20f53fac73537643b64162d4007af68a8
https://github.com/joeferner/redis-commander/blob/c8966ff20f53fac73537643b64162d4007af68a8/web/static/scripts/redisCommander.js#L871-L877
train
joeferner/redis-commander
web/static/scripts/redisCommander.js
renderEjs
function renderEjs(filename, data, element, callback) { $.get(filename) .done(function(htmlTmpl) { element.html(ejs.render(htmlTmpl, data)); }) .fail(function(error) { console.log('failed to get html template ' + filename + ': ' + JSON.stringify(error)); alert('failed to fetch html templ...
javascript
function renderEjs(filename, data, element, callback) { $.get(filename) .done(function(htmlTmpl) { element.html(ejs.render(htmlTmpl, data)); }) .fail(function(error) { console.log('failed to get html template ' + filename + ': ' + JSON.stringify(error)); alert('failed to fetch html templ...
[ "function", "renderEjs", "(", "filename", ",", "data", ",", "element", ",", "callback", ")", "{", "$", ".", "get", "(", "filename", ")", ".", "done", "(", "function", "(", "htmlTmpl", ")", "{", "element", ".", "html", "(", "ejs", ".", "render", "(", ...
Fetch the url give at filename from the server and render the content of this template with the data object. Afterwards the rendered html is added at the html element given. @param {string} filename url to retrieve as template @param {object} data object to use for rendering @param {object} element jquery html element...
[ "Fetch", "the", "url", "give", "at", "filename", "from", "the", "server", "and", "render", "the", "content", "of", "this", "template", "with", "the", "data", "object", ".", "Afterwards", "the", "rendered", "html", "is", "added", "at", "the", "html", "eleme...
c8966ff20f53fac73537643b64162d4007af68a8
https://github.com/joeferner/redis-commander/blob/c8966ff20f53fac73537643b64162d4007af68a8/web/static/scripts/redisCommander.js#L896-L909
train
joeferner/redis-commander
lib/routes/apiv1.js
getConnection
function getConnection (req, res, next, connectionId) { let con = req.app.locals.redisConnections.find(function(connection) { return (connection.options.connectionId === connectionId); }); if (con) { res.locals.connection = con; res.locals.connectionId = connectionId; } else { console.error('C...
javascript
function getConnection (req, res, next, connectionId) { let con = req.app.locals.redisConnections.find(function(connection) { return (connection.options.connectionId === connectionId); }); if (con) { res.locals.connection = con; res.locals.connectionId = connectionId; } else { console.error('C...
[ "function", "getConnection", "(", "req", ",", "res", ",", "next", ",", "connectionId", ")", "{", "let", "con", "=", "req", ".", "app", ".", "locals", ".", "redisConnections", ".", "find", "(", "function", "(", "connection", ")", "{", "return", "(", "co...
method called to extract url parameter 'connectionId' from all routes. The connection object found is attached to the res.locals.connection variable for all following routes to work with. The connectionId param is attached to res.locals.connectionId. This method exits with JSON error response if no connection is found...
[ "method", "called", "to", "extract", "url", "parameter", "connectionId", "from", "all", "routes", ".", "The", "connection", "object", "found", "is", "attached", "to", "the", "res", ".", "locals", ".", "connection", "variable", "for", "all", "following", "route...
c8966ff20f53fac73537643b64162d4007af68a8
https://github.com/joeferner/redis-commander/blob/c8966ff20f53fac73537643b64162d4007af68a8/lib/routes/apiv1.js#L147-L160
train
joeferner/redis-commander
lib/routes/apiv1.js
postExec
function postExec (req, res) { let cmd = req.body.cmd; let connection = res.locals.connection; let parts = myutil.split(cmd); parts[0] = parts[0].toLowerCase(); let commandName = parts[0].toLowerCase(); // must be in our white list to be allowed in read only mode if (req.app.locals.redisReadOnly) { i...
javascript
function postExec (req, res) { let cmd = req.body.cmd; let connection = res.locals.connection; let parts = myutil.split(cmd); parts[0] = parts[0].toLowerCase(); let commandName = parts[0].toLowerCase(); // must be in our white list to be allowed in read only mode if (req.app.locals.redisReadOnly) { i...
[ "function", "postExec", "(", "req", ",", "res", ")", "{", "let", "cmd", "=", "req", ".", "body", ".", "cmd", ";", "let", "connection", "=", "res", ".", "locals", ".", "connection", ";", "let", "parts", "=", "myutil", ".", "split", "(", "cmd", ")", ...
this needs special handling for read-only mode. Must check all commands and classify if command to view or manipulatie data...
[ "this", "needs", "special", "handling", "for", "read", "-", "only", "mode", ".", "Must", "check", "all", "commands", "and", "classify", "if", "command", "to", "view", "or", "manipulatie", "data", "..." ]
c8966ff20f53fac73537643b64162d4007af68a8
https://github.com/joeferner/redis-commander/blob/c8966ff20f53fac73537643b64162d4007af68a8/lib/routes/apiv1.js#L254-L279
train
thelinmichael/spotify-web-api-node
src/server-methods.js
function(options, callback) { return AuthenticationRequest.builder() .withPath('/api/token') .withBodyParameters({ grant_type: 'client_credentials' }) .withBodyParameters(options) .withHeaders({ Authorization: 'Basic ' + new Buffer( this....
javascript
function(options, callback) { return AuthenticationRequest.builder() .withPath('/api/token') .withBodyParameters({ grant_type: 'client_credentials' }) .withBodyParameters(options) .withHeaders({ Authorization: 'Basic ' + new Buffer( this....
[ "function", "(", "options", ",", "callback", ")", "{", "return", "AuthenticationRequest", ".", "builder", "(", ")", ".", "withPath", "(", "'/api/token'", ")", ".", "withBodyParameters", "(", "{", "grant_type", ":", "'client_credentials'", "}", ")", ".", "withB...
Request an access token using the Client Credentials flow. Requires that client ID and client secret has been set previous to the call. @param {Object} options Options. @param {requestCallback} [callback] Optional callback method to be called instead of the promise. @returns {Promise|undefined} A promise that if succes...
[ "Request", "an", "access", "token", "using", "the", "Client", "Credentials", "flow", ".", "Requires", "that", "client", "ID", "and", "client", "secret", "has", "been", "set", "previous", "to", "the", "call", "." ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/server-methods.js#L15-L31
train
thelinmichael/spotify-web-api-node
src/server-methods.js
function(code, callback) { return AuthenticationRequest.builder() .withPath('/api/token') .withBodyParameters({ grant_type: 'authorization_code', redirect_uri: this.getRedirectURI(), code: code, client_id: this.getClientId(), client_secret: this.getClientSecret() ...
javascript
function(code, callback) { return AuthenticationRequest.builder() .withPath('/api/token') .withBodyParameters({ grant_type: 'authorization_code', redirect_uri: this.getRedirectURI(), code: code, client_id: this.getClientId(), client_secret: this.getClientSecret() ...
[ "function", "(", "code", ",", "callback", ")", "{", "return", "AuthenticationRequest", ".", "builder", "(", ")", ".", "withPath", "(", "'/api/token'", ")", ".", "withBodyParameters", "(", "{", "grant_type", ":", "'authorization_code'", ",", "redirect_uri", ":", ...
Request an access token using the Authorization Code flow. Requires that client ID, client secret, and redirect URI has been set previous to the call. @param {string} code The authorization code returned in the callback in the Authorization Code flow. @param {requestCallback} [callback] Optional callback method to be c...
[ "Request", "an", "access", "token", "using", "the", "Authorization", "Code", "flow", ".", "Requires", "that", "client", "ID", "client", "secret", "and", "redirect", "URI", "has", "been", "set", "previous", "to", "the", "call", "." ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/server-methods.js#L42-L54
train
thelinmichael/spotify-web-api-node
src/spotify-web-api.js
function(trackId, options, callback) { // In case someone is using a version where options parameter did not exist. var actualCallback, actualOptions; if (typeof options === 'function' && !callback) { actualCallback = options; actualOptions = {}; } else { actualCallback = callback; ...
javascript
function(trackId, options, callback) { // In case someone is using a version where options parameter did not exist. var actualCallback, actualOptions; if (typeof options === 'function' && !callback) { actualCallback = options; actualOptions = {}; } else { actualCallback = callback; ...
[ "function", "(", "trackId", ",", "options", ",", "callback", ")", "{", "// In case someone is using a version where options parameter did not exist.", "var", "actualCallback", ",", "actualOptions", ";", "if", "(", "typeof", "options", "===", "'function'", "&&", "!", "ca...
Look up a track. @param {string} trackId The track's ID. @param {Object} [options] The possible options, currently only market. @param {requestCallback} [callback] Optional callback method to be called instead of the promise. @example getTrack('3Qm86XLflmIXVm1wcwkgDK').then(...) @returns {Promise|undefined} A promise t...
[ "Look", "up", "a", "track", "." ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/spotify-web-api.js#L118-L134
train
thelinmichael/spotify-web-api-node
src/spotify-web-api.js
function(trackIds, options, callback) { // In case someone is using a version where options parameter did not exist. var actualCallback, actualOptions; if (typeof options === 'function' && !callback) { actualCallback = options; actualOptions = {}; } else { actualCallback = callback; ...
javascript
function(trackIds, options, callback) { // In case someone is using a version where options parameter did not exist. var actualCallback, actualOptions; if (typeof options === 'function' && !callback) { actualCallback = options; actualOptions = {}; } else { actualCallback = callback; ...
[ "function", "(", "trackIds", ",", "options", ",", "callback", ")", "{", "// In case someone is using a version where options parameter did not exist.", "var", "actualCallback", ",", "actualOptions", ";", "if", "(", "typeof", "options", "===", "'function'", "&&", "!", "c...
Look up several tracks. @param {string[]} trackIds The IDs of the artists. @param {Object} [options] The possible options, currently only market. @param {requestCallback} [callback] Optional callback method to be called instead of the promise. @example getArtists(['0oSGxfWSnnOXhD2fKuz2Gy', '3dBVyJ7JuOMt4GE9607Qin']).th...
[ "Look", "up", "several", "tracks", "." ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/spotify-web-api.js#L145-L166
train
thelinmichael/spotify-web-api-node
src/spotify-web-api.js
function(query, types, options, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/search/') .withQueryParameters( { type: types.join(','), q: query }, options ) .build() .execute(HttpManager.get, callback); }
javascript
function(query, types, options, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/search/') .withQueryParameters( { type: types.join(','), q: query }, options ) .build() .execute(HttpManager.get, callback); }
[ "function", "(", "query", ",", "types", ",", "options", ",", "callback", ")", "{", "return", "WebApiRequest", ".", "builder", "(", "this", ".", "getAccessToken", "(", ")", ")", ".", "withPath", "(", "'/v1/search/'", ")", ".", "withQueryParameters", "(", "{...
Search for music entities of certain types. @param {string} query The search query. @param {string[]} types An array of item types to search across. Valid types are: 'album', 'artist', 'playlist', and 'track'. @param {Object} [options] The possible options, e.g. limit, offset. @param {requestCallback} [callback] Option...
[ "Search", "for", "music", "entities", "of", "certain", "types", "." ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/spotify-web-api.js#L272-L284
train
thelinmichael/spotify-web-api-node
src/spotify-web-api.js
function(userId, options, callback) { var path; if (typeof userId === 'string') { path = '/v1/users/' + encodeURIComponent(userId) + '/playlists'; } else if (typeof userId === 'object') { callback = options; options = userId; path = '/v1/me/playlists'; } /* undefined */ else { ...
javascript
function(userId, options, callback) { var path; if (typeof userId === 'string') { path = '/v1/users/' + encodeURIComponent(userId) + '/playlists'; } else if (typeof userId === 'object') { callback = options; options = userId; path = '/v1/me/playlists'; } /* undefined */ else { ...
[ "function", "(", "userId", ",", "options", ",", "callback", ")", "{", "var", "path", ";", "if", "(", "typeof", "userId", "===", "'string'", ")", "{", "path", "=", "'/v1/users/'", "+", "encodeURIComponent", "(", "userId", ")", "+", "'/playlists'", ";", "}...
Get a user's playlists. @param {string} userId An optional id of the user. If you know the Spotify URI it is easy to find the id (e.g. spotify:user:<here_is_the_id>). If not provided, the id of the user that granted the permissions will be used. @param {Object} [options] The options supplied to this request. @param {re...
[ "Get", "a", "user", "s", "playlists", "." ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/spotify-web-api.js#L456-L473
train
thelinmichael/spotify-web-api-node
src/spotify-web-api.js
function(userId, playlistName, options, callback) { // In case someone is using a version where options parameter did not exist. var actualCallback; if (typeof options === 'function' && !callback) { actualCallback = options; } else { actualCallback = callback; } var actualOptions = ...
javascript
function(userId, playlistName, options, callback) { // In case someone is using a version where options parameter did not exist. var actualCallback; if (typeof options === 'function' && !callback) { actualCallback = options; } else { actualCallback = callback; } var actualOptions = ...
[ "function", "(", "userId", ",", "playlistName", ",", "options", ",", "callback", ")", "{", "// In case someone is using a version where options parameter did not exist.", "var", "actualCallback", ";", "if", "(", "typeof", "options", "===", "'function'", "&&", "!", "call...
Create a playlist. @param {string} userId The playlist's owner's user ID. @param {string} playlistName The name of the playlist. @param {Object} [options] The possible options, currently only public. @param {requestCallback} [callback] Optional callback method to be called instead of the promise. @example createPlaylis...
[ "Create", "a", "playlist", "." ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/spotify-web-api.js#L519-L541
train
thelinmichael/spotify-web-api-node
src/spotify-web-api.js
function(playlistId, options, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/playlists/' + playlistId + '/followers') .withHeaders({ 'Content-Type': 'application/json' }) .withBodyParameters(options) .build() .execute(HttpManager.put, callback); }
javascript
function(playlistId, options, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/playlists/' + playlistId + '/followers') .withHeaders({ 'Content-Type': 'application/json' }) .withBodyParameters(options) .build() .execute(HttpManager.put, callback); }
[ "function", "(", "playlistId", ",", "options", ",", "callback", ")", "{", "return", "WebApiRequest", ".", "builder", "(", "this", ".", "getAccessToken", "(", ")", ")", ".", "withPath", "(", "'/v1/playlists/'", "+", "playlistId", "+", "'/followers'", ")", "."...
Follow a playlist. @param {string} playlistId The playlist's ID @param {Object} [options] The possible options, currently only public. @param {requestCallback} [callback] Optional callback method to be called instead of the promise. @returns {Promise|undefined} A promise that if successful, simply resolves to an empty ...
[ "Follow", "a", "playlist", "." ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/spotify-web-api.js#L551-L558
train
thelinmichael/spotify-web-api-node
src/spotify-web-api.js
function(playlistId, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/playlists/' + playlistId + '/followers') .withHeaders({ 'Content-Type': 'application/json' }) .build() .execute(HttpManager.del, callback); }
javascript
function(playlistId, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/playlists/' + playlistId + '/followers') .withHeaders({ 'Content-Type': 'application/json' }) .build() .execute(HttpManager.del, callback); }
[ "function", "(", "playlistId", ",", "callback", ")", "{", "return", "WebApiRequest", ".", "builder", "(", "this", ".", "getAccessToken", "(", ")", ")", ".", "withPath", "(", "'/v1/playlists/'", "+", "playlistId", "+", "'/followers'", ")", ".", "withHeaders", ...
Unfollow a playlist. @param {string} playlistId The playlist's ID @param {Object} [options] The possible options, currently only public. @param {requestCallback} [callback] Optional callback method to be called instead of the promise. @returns {Promise|undefined} A promise that if successful, simply resolves to an empt...
[ "Unfollow", "a", "playlist", "." ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/spotify-web-api.js#L568-L574
train
thelinmichael/spotify-web-api-node
src/spotify-web-api.js
function(playlistId, tracks, options, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/playlists/' + playlistId + '/tracks') .withHeaders({ 'Content-Type': 'application/json' }) .withQueryParameters(options) .withBodyParameters({ uris: tracks }) ...
javascript
function(playlistId, tracks, options, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/playlists/' + playlistId + '/tracks') .withHeaders({ 'Content-Type': 'application/json' }) .withQueryParameters(options) .withBodyParameters({ uris: tracks }) ...
[ "function", "(", "playlistId", ",", "tracks", ",", "options", ",", "callback", ")", "{", "return", "WebApiRequest", ".", "builder", "(", "this", ".", "getAccessToken", "(", ")", ")", ".", "withPath", "(", "'/v1/playlists/'", "+", "playlistId", "+", "'/tracks...
Add tracks to a playlist. @param {string} playlistId The playlist's ID @param {string[]} tracks URIs of the tracks to add to the playlist. @param {Object} [options] Options, position being the only one. @param {requestCallback} [callback] Optional callback method to be called instead of the promise. @example addTracksT...
[ "Add", "tracks", "to", "a", "playlist", "." ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/spotify-web-api.js#L623-L633
train
thelinmichael/spotify-web-api-node
src/spotify-web-api.js
function( playlistId, positions, snapshotId, callback ) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/playlists/' + playlistId + '/tracks') .withHeaders({ 'Content-Type': 'application/json' }) .withBodyParameters({ positions: positions, snap...
javascript
function( playlistId, positions, snapshotId, callback ) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/playlists/' + playlistId + '/tracks') .withHeaders({ 'Content-Type': 'application/json' }) .withBodyParameters({ positions: positions, snap...
[ "function", "(", "playlistId", ",", "positions", ",", "snapshotId", ",", "callback", ")", "{", "return", "WebApiRequest", ".", "builder", "(", "this", ".", "getAccessToken", "(", ")", ")", ".", "withPath", "(", "'/v1/playlists/'", "+", "playlistId", "+", "'/...
Remove tracks from a playlist by position instead of specifying the tracks' URIs. @param {string} playlistId The playlist's ID @param {int[]} positions The positions of the tracks in the playlist that should be removed @param {string} snapshot_id The snapshot ID, or version, of the playlist. Required @param {requestCal...
[ "Remove", "tracks", "from", "a", "playlist", "by", "position", "instead", "of", "specifying", "the", "tracks", "URIs", "." ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/spotify-web-api.js#L668-L683
train
thelinmichael/spotify-web-api-node
src/spotify-web-api.js
function( playlistId, rangeStart, insertBefore, options, callback ) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/playlists/' + playlistId + '/tracks') .withHeaders({ 'Content-Type': 'application/json' }) .withBodyParameters( { range_s...
javascript
function( playlistId, rangeStart, insertBefore, options, callback ) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/playlists/' + playlistId + '/tracks') .withHeaders({ 'Content-Type': 'application/json' }) .withBodyParameters( { range_s...
[ "function", "(", "playlistId", ",", "rangeStart", ",", "insertBefore", ",", "options", ",", "callback", ")", "{", "return", "WebApiRequest", ".", "builder", "(", "this", ".", "getAccessToken", "(", ")", ")", ".", "withPath", "(", "'/v1/playlists/'", "+", "pl...
Reorder tracks in a playlist. @param {string} playlistId The playlist's ID @param {int} rangeStart The position of the first track to be reordered. @param {int} insertBefore The position where the tracks should be inserted. @param {Object} options Optional parameters, i.e. range_length and snapshot_id. @param {requestC...
[ "Reorder", "tracks", "in", "a", "playlist", "." ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/spotify-web-api.js#L714-L733
train
thelinmichael/spotify-web-api-node
src/spotify-web-api.js
function(options, callback) { var _opts = {}; var optionsOfTypeArray = ['seed_artists', 'seed_genres', 'seed_tracks']; for (var option in options) { if (options.hasOwnProperty(option)) { if ( optionsOfTypeArray.indexOf(option) !== -1 && Object.prototype.toString.call(option...
javascript
function(options, callback) { var _opts = {}; var optionsOfTypeArray = ['seed_artists', 'seed_genres', 'seed_tracks']; for (var option in options) { if (options.hasOwnProperty(option)) { if ( optionsOfTypeArray.indexOf(option) !== -1 && Object.prototype.toString.call(option...
[ "function", "(", "options", ",", "callback", ")", "{", "var", "_opts", "=", "{", "}", ";", "var", "optionsOfTypeArray", "=", "[", "'seed_artists'", ",", "'seed_genres'", ",", "'seed_tracks'", "]", ";", "for", "(", "var", "option", "in", "options", ")", "...
Create a playlist-style listening experience based on seed artists, tracks and genres. @param {Object} [options] The options supplied to this request. @param {requestCallback} [callback] Optional callback method to be called instead of the promise. @example getRecommendations({ min_energy: 0.4, seed_artists: ['6mfK6Q2t...
[ "Create", "a", "playlist", "-", "style", "listening", "experience", "based", "on", "seed", "artists", "tracks", "and", "genres", "." ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/spotify-web-api.js#L794-L815
train
thelinmichael/spotify-web-api-node
src/spotify-web-api.js
function(scopes, state, showDialog) { return AuthenticationRequest.builder() .withPath('/authorize') .withQueryParameters({ client_id: this.getClientId(), response_type: 'code', redirect_uri: this.getRedirectURI(), scope: scopes.join('%20'), state: state, ...
javascript
function(scopes, state, showDialog) { return AuthenticationRequest.builder() .withPath('/authorize') .withQueryParameters({ client_id: this.getClientId(), response_type: 'code', redirect_uri: this.getRedirectURI(), scope: scopes.join('%20'), state: state, ...
[ "function", "(", "scopes", ",", "state", ",", "showDialog", ")", "{", "return", "AuthenticationRequest", ".", "builder", "(", ")", ".", "withPath", "(", "'/authorize'", ")", ".", "withQueryParameters", "(", "{", "client_id", ":", "this", ".", "getClientId", ...
Retrieve a URL where the user can give the application permissions. @param {string[]} scopes The scopes corresponding to the permissions the application needs. @param {string} state A parameter that you can use to maintain a value between the request and the callback to redirect_uri.It is useful to prevent CSRF exploit...
[ "Retrieve", "a", "URL", "where", "the", "user", "can", "give", "the", "application", "permissions", "." ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/spotify-web-api.js#L839-L852
train
thelinmichael/spotify-web-api-node
src/spotify-web-api.js
function(trackIds, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/me/tracks') .withHeaders({ 'Content-Type': 'application/json' }) .withBodyParameters({ ids: trackIds }) .build() .execute(HttpManager.del, callback); }
javascript
function(trackIds, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/me/tracks') .withHeaders({ 'Content-Type': 'application/json' }) .withBodyParameters({ ids: trackIds }) .build() .execute(HttpManager.del, callback); }
[ "function", "(", "trackIds", ",", "callback", ")", "{", "return", "WebApiRequest", ".", "builder", "(", "this", ".", "getAccessToken", "(", ")", ")", ".", "withPath", "(", "'/v1/me/tracks'", ")", ".", "withHeaders", "(", "{", "'Content-Type'", ":", "'applica...
Remove a track from the authenticated user's Your Music library. @param {string[]} trackIds The track IDs @param {requestCallback} [callback] Optional callback method to be called instead of the promise. @returns {Promise|undefined} A promise that if successful returns null, otherwise an error. Not returned if a callba...
[ "Remove", "a", "track", "from", "the", "authenticated", "user", "s", "Your", "Music", "library", "." ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/spotify-web-api.js#L895-L902
train
thelinmichael/spotify-web-api-node
src/spotify-web-api.js
function(albumIds, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/me/albums') .withHeaders({ 'Content-Type': 'application/json' }) .withBodyParameters(albumIds) .build() .execute(HttpManager.del, callback); }
javascript
function(albumIds, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/me/albums') .withHeaders({ 'Content-Type': 'application/json' }) .withBodyParameters(albumIds) .build() .execute(HttpManager.del, callback); }
[ "function", "(", "albumIds", ",", "callback", ")", "{", "return", "WebApiRequest", ".", "builder", "(", "this", ".", "getAccessToken", "(", ")", ")", ".", "withPath", "(", "'/v1/me/albums'", ")", ".", "withHeaders", "(", "{", "'Content-Type'", ":", "'applica...
Remove an album from the authenticated user's Your Music library. @param {string[]} albumIds The album IDs @param {requestCallback} [callback] Optional callback method to be called instead of the promise. @returns {Promise|undefined} A promise that if successful returns null, otherwise an error. Not returned if a callb...
[ "Remove", "an", "album", "from", "the", "authenticated", "user", "s", "Your", "Music", "library", "." ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/spotify-web-api.js#L926-L933
train
thelinmichael/spotify-web-api-node
src/spotify-web-api.js
function(options, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/me/player') .withHeaders({ 'Content-Type': 'application/json' }) .withBodyParameters({ device_ids: options.deviceIds, play: !!options.play }) .build() .execute(HttpMan...
javascript
function(options, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/me/player') .withHeaders({ 'Content-Type': 'application/json' }) .withBodyParameters({ device_ids: options.deviceIds, play: !!options.play }) .build() .execute(HttpMan...
[ "function", "(", "options", ",", "callback", ")", "{", "return", "WebApiRequest", ".", "builder", "(", "this", ".", "getAccessToken", "(", ")", ")", ".", "withPath", "(", "'/v1/me/player'", ")", ".", "withHeaders", "(", "{", "'Content-Type'", ":", "'applicat...
Transfer a User's Playback @param {Object} [options] Options, being market. @param {requestCallback} [callback] Optional callback method to be called instead of the promise. @returns {Promise|undefined} A promise that if successful, resolves into a paging object of tracks, otherwise an error. Not returned if a callback...
[ "Transfer", "a", "User", "s", "Playback" ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/spotify-web-api.js#L1079-L1089
train
thelinmichael/spotify-web-api-node
src/spotify-web-api.js
function(options, callback) { /*jshint camelcase: false */ var _options = options || {}; var queryParams = _options.device_id ? { device_id: _options.device_id } : null; var postData = {}; ['context_uri', 'uris', 'offset'].forEach(function(field) { if (field in _options) { ...
javascript
function(options, callback) { /*jshint camelcase: false */ var _options = options || {}; var queryParams = _options.device_id ? { device_id: _options.device_id } : null; var postData = {}; ['context_uri', 'uris', 'offset'].forEach(function(field) { if (field in _options) { ...
[ "function", "(", "options", ",", "callback", ")", "{", "/*jshint camelcase: false */", "var", "_options", "=", "options", "||", "{", "}", ";", "var", "queryParams", "=", "_options", ".", "device_id", "?", "{", "device_id", ":", "_options", ".", "device_id", ...
Starts o Resumes the Current User's Playback @param {Object} [options] Options, being device_id, context_uri, offset, uris. @param {requestCallback} [callback] Optional callback method to be called instead of the promise. @example playbackResume({context_uri: 'spotify:album:5ht7ItJgpBH7W6vJ5BqpPr'}).then(...) @returns ...
[ "Starts", "o", "Resumes", "the", "Current", "User", "s", "Playback" ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/spotify-web-api.js#L1099-L1118
train
thelinmichael/spotify-web-api-node
src/spotify-web-api.js
function(options, callback) { return ( WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/me/player/pause') /*jshint camelcase: false */ .withQueryParameters( options && options.device_id ? { device_id: options.device_id } : null ) .withHeaders({ 'Con...
javascript
function(options, callback) { return ( WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/me/player/pause') /*jshint camelcase: false */ .withQueryParameters( options && options.device_id ? { device_id: options.device_id } : null ) .withHeaders({ 'Con...
[ "function", "(", "options", ",", "callback", ")", "{", "return", "(", "WebApiRequest", ".", "builder", "(", "this", ".", "getAccessToken", "(", ")", ")", ".", "withPath", "(", "'/v1/me/player/pause'", ")", "/*jshint camelcase: false */", ".", "withQueryParameters"...
Pauses the Current User's Playback @param {Object} [options] Options, for now device_id, @param {requestCallback} [callback] Optional callback method to be called instead of the promise. @example playbackPause().then(...) @returns {Promise|undefined} A promise that if successful, resolves into a paging object of tracks...
[ "Pauses", "the", "Current", "User", "s", "Playback" ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/spotify-web-api.js#L1128-L1140
train
thelinmichael/spotify-web-api-node
src/spotify-web-api.js
function(callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/me/player/previous') .withHeaders({ 'Content-Type': 'application/json' }) .build() .execute(HttpManager.post, callback); }
javascript
function(callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/me/player/previous') .withHeaders({ 'Content-Type': 'application/json' }) .build() .execute(HttpManager.post, callback); }
[ "function", "(", "callback", ")", "{", "return", "WebApiRequest", ".", "builder", "(", "this", ".", "getAccessToken", "(", ")", ")", ".", "withPath", "(", "'/v1/me/player/previous'", ")", ".", "withHeaders", "(", "{", "'Content-Type'", ":", "'application/json'",...
Skip the Current User's Playback To Previous Track @param {requestCallback} [callback] Optional callback method to be called instead of the promise. @example playbackPrevious().then(...) @returns {Promise|undefined} A promise that if successful, resolves into a paging object of tracks, otherwise an error. Not returned ...
[ "Skip", "the", "Current", "User", "s", "Playback", "To", "Previous", "Track" ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/spotify-web-api.js#L1149-L1155
train
thelinmichael/spotify-web-api-node
src/spotify-web-api.js
function(options, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/me/player/repeat') .withQueryParameters({ state: options.state || 'off' }) .build() .execute(HttpManager.put, callback); }
javascript
function(options, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/me/player/repeat') .withQueryParameters({ state: options.state || 'off' }) .build() .execute(HttpManager.put, callback); }
[ "function", "(", "options", ",", "callback", ")", "{", "return", "WebApiRequest", ".", "builder", "(", "this", ".", "getAccessToken", "(", ")", ")", ".", "withPath", "(", "'/v1/me/player/repeat'", ")", ".", "withQueryParameters", "(", "{", "state", ":", "opt...
Set Repeat Mode On The Current User's Playback @param {Object} [options] Options, being state (track, context, off). @param {requestCallback} [callback] Optional callback method to be called instead of the promise. @example playbackRepeat({state: 'context'}).then(...) @returns {Promise|undefined} A promise that if succ...
[ "Set", "Repeat", "Mode", "On", "The", "Current", "User", "s", "Playback" ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/spotify-web-api.js#L1205-L1213
train
thelinmichael/spotify-web-api-node
src/spotify-web-api.js
function(userIds, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/me/following') .withQueryParameters({ ids: userIds.join(','), type: 'user' }) .build() .execute(HttpManager.del, callback); }
javascript
function(userIds, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/me/following') .withQueryParameters({ ids: userIds.join(','), type: 'user' }) .build() .execute(HttpManager.del, callback); }
[ "function", "(", "userIds", ",", "callback", ")", "{", "return", "WebApiRequest", ".", "builder", "(", "this", ".", "getAccessToken", "(", ")", ")", ".", "withPath", "(", "'/v1/me/following'", ")", ".", "withQueryParameters", "(", "{", "ids", ":", "userIds",...
Remove the current user as a follower of one or more other Spotify users. @param {string[]} userIds The IDs of the users to be unfollowed. @param {requestCallback} [callback] Optional callback method to be called instead of the promise. @example unfollowUsers(['thelinmichael', 'wizzler']).then(...) @returns {Promise|un...
[ "Remove", "the", "current", "user", "as", "a", "follower", "of", "one", "or", "more", "other", "Spotify", "users", "." ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/spotify-web-api.js#L1304-L1313
train
thelinmichael/spotify-web-api-node
src/spotify-web-api.js
function(options, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/me/following') .withHeaders({ 'Content-Type': 'application/json' }) .withQueryParameters( { type: 'artist' }, options ) .build() .execute(HttpManager...
javascript
function(options, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath('/v1/me/following') .withHeaders({ 'Content-Type': 'application/json' }) .withQueryParameters( { type: 'artist' }, options ) .build() .execute(HttpManager...
[ "function", "(", "options", ",", "callback", ")", "{", "return", "WebApiRequest", ".", "builder", "(", "this", ".", "getAccessToken", "(", ")", ")", ".", "withPath", "(", "'/v1/me/following'", ")", ".", "withHeaders", "(", "{", "'Content-Type'", ":", "'appli...
Get the current user's followed artists. @param {Object} [options] Options, being after and limit. @param {requestCallback} [callback] Optional callback method to be called instead of the promise. @returns {Promise|undefined} A promise that if successful, resolves to an object containing a paging object which contains ...
[ "Get", "the", "current", "user", "s", "followed", "artists", "." ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/spotify-web-api.js#L1362-L1374
train
thelinmichael/spotify-web-api-node
src/spotify-web-api.js
function(userId, playlistId, followerIds, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath( '/v1/users/' + encodeURIComponent(userId) + '/playlists/' + playlistId + '/followers/contains' ) .withQueryParameters({ ids: ...
javascript
function(userId, playlistId, followerIds, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath( '/v1/users/' + encodeURIComponent(userId) + '/playlists/' + playlistId + '/followers/contains' ) .withQueryParameters({ ids: ...
[ "function", "(", "userId", ",", "playlistId", ",", "followerIds", ",", "callback", ")", "{", "return", "WebApiRequest", ".", "builder", "(", "this", ".", "getAccessToken", "(", ")", ")", ".", "withPath", "(", "'/v1/users/'", "+", "encodeURIComponent", "(", "...
Check if users are following a playlist. @param {string} userId The playlist's owner's user ID @param {string} playlistId The playlist's ID @param {String[]} User IDs of the following users @param {requestCallback} [callback] Optional callback method to be called instead of the promise. @returns {Promise|undefined} A p...
[ "Check", "if", "users", "are", "following", "a", "playlist", "." ]
37a78656198185776ca825b37e2de4a31c2ae5de
https://github.com/thelinmichael/spotify-web-api-node/blob/37a78656198185776ca825b37e2de4a31c2ae5de/src/spotify-web-api.js#L1385-L1399
train
bee-queue/arena
src/server/views/dashboard/queueJobsByState.js
isValidState
function isValidState(state, isBee) { const validStates = isBee ? BEE_STATES : BULL_STATES; return _.includes(validStates, state); }
javascript
function isValidState(state, isBee) { const validStates = isBee ? BEE_STATES : BULL_STATES; return _.includes(validStates, state); }
[ "function", "isValidState", "(", "state", ",", "isBee", ")", "{", "const", "validStates", "=", "isBee", "?", "BEE_STATES", ":", "BULL_STATES", ";", "return", "_", ".", "includes", "(", "validStates", ",", "state", ")", ";", "}" ]
Determines if the requested job state lookup is valid. @param {String} state @param {Boolean} isBee States vary between bull and bee @return {Boolean}
[ "Determines", "if", "the", "requested", "job", "state", "lookup", "is", "valid", "." ]
ae39d9051e87f5f0f120db24dc649c98129a9f1e
https://github.com/bee-queue/arena/blob/ae39d9051e87f5f0f120db24dc649c98129a9f1e/src/server/views/dashboard/queueJobsByState.js#L12-L15
train
bee-queue/arena
src/server/views/dashboard/queueJobsByState.js
_json
async function _json(req, res) { const { queueName, queueHost, state } = req.params; const {Queues} = req.app.locals; const queue = await Queues.get(queueName, queueHost); if (!queue) return res.status(404).json({ message: 'Queue not found' }); if (!isValidState(state, queue.IS_BEE)) return res.status(400).j...
javascript
async function _json(req, res) { const { queueName, queueHost, state } = req.params; const {Queues} = req.app.locals; const queue = await Queues.get(queueName, queueHost); if (!queue) return res.status(404).json({ message: 'Queue not found' }); if (!isValidState(state, queue.IS_BEE)) return res.status(400).j...
[ "async", "function", "_json", "(", "req", ",", "res", ")", "{", "const", "{", "queueName", ",", "queueHost", ",", "state", "}", "=", "req", ".", "params", ";", "const", "{", "Queues", "}", "=", "req", ".", "app", ".", "locals", ";", "const", "queue...
Returns the queue jobs in the requested state as a json document. @prop {Object} req express request object @prop {Object} res express response object
[ "Returns", "the", "queue", "jobs", "in", "the", "requested", "state", "as", "a", "json", "document", "." ]
ae39d9051e87f5f0f120db24dc649c98129a9f1e
https://github.com/bee-queue/arena/blob/ae39d9051e87f5f0f120db24dc649c98129a9f1e/src/server/views/dashboard/queueJobsByState.js#L29-L51
train
bee-queue/arena
src/server/views/dashboard/queueJobsByState.js
_html
async function _html(req, res) { const { queueName, queueHost, state } = req.params; const {Queues} = req.app.locals; const queue = await Queues.get(queueName, queueHost); const basePath = req.baseUrl; if (!queue) return res.status(404).render('dashboard/templates/queueNotFound', {basePath, queueName, queueHo...
javascript
async function _html(req, res) { const { queueName, queueHost, state } = req.params; const {Queues} = req.app.locals; const queue = await Queues.get(queueName, queueHost); const basePath = req.baseUrl; if (!queue) return res.status(404).render('dashboard/templates/queueNotFound', {basePath, queueName, queueHo...
[ "async", "function", "_html", "(", "req", ",", "res", ")", "{", "const", "{", "queueName", ",", "queueHost", ",", "state", "}", "=", "req", ".", "params", ";", "const", "{", "Queues", "}", "=", "req", ".", "app", ".", "locals", ";", "const", "queue...
Renders an html view of the queue jobs in the requested state. @prop {Object} req express request object @prop {Object} res express response object
[ "Renders", "an", "html", "view", "of", "the", "queue", "jobs", "in", "the", "requested", "state", "." ]
ae39d9051e87f5f0f120db24dc649c98129a9f1e
https://github.com/bee-queue/arena/blob/ae39d9051e87f5f0f120db24dc649c98129a9f1e/src/server/views/dashboard/queueJobsByState.js#L59-L121
train
hustcc/timeago.js
src/lang/fa.js
toPersianNumber
function toPersianNumber(number) { // List of standard persian numbers from 0 to 9 const persianDigits = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹']; return number .toString() .replace(/\d/g, x => persianDigits[x]); }
javascript
function toPersianNumber(number) { // List of standard persian numbers from 0 to 9 const persianDigits = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹']; return number .toString() .replace(/\d/g, x => persianDigits[x]); }
[ "function", "toPersianNumber", "(", "number", ")", "{", "// List of standard persian numbers from 0 to 9", "const", "persianDigits", "=", "[", "'۰',", " ", "۱', ", "'", "', '", "۳", ", '۴", "'", " '۵'", ",", "'۶',", " ", "۷', ", "'", "', '", "۹", "];", "", "...
As persian language has different number symbols we need to replace regular numbers to standard persian numbres.
[ "As", "persian", "language", "has", "different", "number", "symbols", "we", "need", "to", "replace", "regular", "numbers", "to", "standard", "persian", "numbres", "." ]
1c58c61ced7ab40f630311c392a9142b8ee021fd
https://github.com/hustcc/timeago.js/blob/1c58c61ced7ab40f630311c392a9142b8ee021fd/src/lang/fa.js#L25-L32
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
_subclassObject
function _subclassObject(tree, base, extension, extName) { // $.ui.fancytree.debug("_subclassObject", tree, base, extension, extName); for (var attrName in extension) { if (typeof extension[attrName] === "function") { if (typeof tree[attrName] === "function") { // override existing method tree[attr...
javascript
function _subclassObject(tree, base, extension, extName) { // $.ui.fancytree.debug("_subclassObject", tree, base, extension, extName); for (var attrName in extension) { if (typeof extension[attrName] === "function") { if (typeof tree[attrName] === "function") { // override existing method tree[attr...
[ "function", "_subclassObject", "(", "tree", ",", "base", ",", "extension", ",", "extName", ")", "{", "// $.ui.fancytree.debug(\"_subclassObject\", tree, base, extension, extName);", "for", "(", "var", "attrName", "in", "extension", ")", "{", "if", "(", "typeof", "exte...
Subclass `base` by creating proxy functions
[ "Subclass", "base", "by", "creating", "proxy", "functions" ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L1704-L1743
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
function(node, mode) { var i, n; mode = mode || "child"; if (node === false) { for (i = this.children.length - 1; i >= 0; i--) { n = this.children[i]; if (n.statusNodeType === "paging") { this.removeChild(n); } } this.partload = false; return; } node = $.extend( ...
javascript
function(node, mode) { var i, n; mode = mode || "child"; if (node === false) { for (i = this.children.length - 1; i >= 0; i--) { n = this.children[i]; if (n.statusNodeType === "paging") { this.removeChild(n); } } this.partload = false; return; } node = $.extend( ...
[ "function", "(", "node", ",", "mode", ")", "{", "var", "i", ",", "n", ";", "mode", "=", "mode", "||", "\"child\"", ";", "if", "(", "node", "===", "false", ")", "{", "for", "(", "i", "=", "this", ".", "children", ".", "length", "-", "1", ";", ...
Add child status nodes that indicate 'More...', etc. This also maintains the node's `partload` property. @param {boolean|object} node optional node definition. Pass `false` to remove all paging nodes. @param {string} [mode='child'] 'child'|firstChild' @since 2.15
[ "Add", "child", "status", "nodes", "that", "indicate", "More", "...", "etc", "." ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L2092-L2116
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
function(patch) { // patch [key, null] means 'remove' if (patch === null) { this.remove(); return _getResolvedPromise(this); } // TODO: make sure that root node is not collapsed or modified // copy (most) attributes to node.ATTR or node.data.ATTR var name, promise, v, IGNORE_MAP = ...
javascript
function(patch) { // patch [key, null] means 'remove' if (patch === null) { this.remove(); return _getResolvedPromise(this); } // TODO: make sure that root node is not collapsed or modified // copy (most) attributes to node.ATTR or node.data.ATTR var name, promise, v, IGNORE_MAP = ...
[ "function", "(", "patch", ")", "{", "// patch [key, null] means 'remove'", "if", "(", "patch", "===", "null", ")", "{", "this", ".", "remove", "(", ")", ";", "return", "_getResolvedPromise", "(", "this", ")", ";", "}", "// TODO: make sure that root node is not col...
Modify existing child nodes. @param {NodePatch} patch @returns {$.Promise} @see FancytreeNode#addChildren
[ "Modify", "existing", "child", "nodes", "." ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L2135-L2179
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
function(deep) { var cl = this.children, i, l, n; if (!cl) { return 0; } n = cl.length; if (deep !== false) { for (i = 0, l = n; i < l; i++) { n += cl[i].countChildren(); } } return n; }
javascript
function(deep) { var cl = this.children, i, l, n; if (!cl) { return 0; } n = cl.length; if (deep !== false) { for (i = 0, l = n; i < l; i++) { n += cl[i].countChildren(); } } return n; }
[ "function", "(", "deep", ")", "{", "var", "cl", "=", "this", ".", "children", ",", "i", ",", "l", ",", "n", ";", "if", "(", "!", "cl", ")", "{", "return", "0", ";", "}", "n", "=", "cl", ".", "length", ";", "if", "(", "deep", "!==", "false",...
Count direct and indirect children. @param {boolean} [deep=true] pass 'false' to only count direct children @returns {int} number of child nodes
[ "Count", "direct", "and", "indirect", "children", "." ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L2201-L2216
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
function() { if (this.lazy) { if (this.children == null) { // null or undefined: Not yet loaded return undefined; } else if (this.children.length === 0) { // Loaded, but response was empty return false; } else if ( this.children.length === 1 && this.children[0].isStatusNode(...
javascript
function() { if (this.lazy) { if (this.children == null) { // null or undefined: Not yet loaded return undefined; } else if (this.children.length === 0) { // Loaded, but response was empty return false; } else if ( this.children.length === 1 && this.children[0].isStatusNode(...
[ "function", "(", ")", "{", "if", "(", "this", ".", "lazy", ")", "{", "if", "(", "this", ".", "children", "==", "null", ")", "{", "// null or undefined: Not yet loaded", "return", "undefined", ";", "}", "else", "if", "(", "this", ".", "children", ".", "...
Return true if node has children. Return undefined if not sure, i.e. the node is lazy and not yet loaded). @returns {boolean | undefined}
[ "Return", "true", "if", "node", "has", "children", ".", "Return", "undefined", "if", "not", "sure", "i", ".", "e", ".", "the", "node", "is", "lazy", "and", "not", "yet", "loaded", ")", "." ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L2673-L2691
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
function(opts) { var i, that = this, deferreds = [], dfd = new $.Deferred(), parents = this.getParentList(false, false), len = parents.length, effects = !(opts && opts.noAnimation === true), scroll = !(opts && opts.scrollIntoView === false); // Expand bottom-up, so only the top node i...
javascript
function(opts) { var i, that = this, deferreds = [], dfd = new $.Deferred(), parents = this.getParentList(false, false), len = parents.length, effects = !(opts && opts.noAnimation === true), scroll = !(opts && opts.scrollIntoView === false); // Expand bottom-up, so only the top node i...
[ "function", "(", "opts", ")", "{", "var", "i", ",", "that", "=", "this", ",", "deferreds", "=", "[", "]", ",", "dfd", "=", "new", "$", ".", "Deferred", "(", ")", ",", "parents", "=", "this", ".", "getParentList", "(", "false", ",", "false", ")", ...
Expand all parents and optionally scroll into visible area as neccessary. Promise is resolved, when lazy loading and animations are done. @param {object} [opts] passed to `setExpanded()`. Defaults to {noAnimation: false, noEvents: false, scrollIntoView: true} @returns {$.Promise}
[ "Expand", "all", "parents", "and", "optionally", "scroll", "into", "visible", "area", "as", "neccessary", ".", "Promise", "is", "resolved", "when", "lazy", "loading", "and", "animations", "are", "done", "." ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L2927-L2955
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
_goto
function _goto(n) { if (n) { // setFocus/setActive will scroll later (if autoScroll is specified) try { n.makeVisible({ scrollIntoView: false }); } catch (e) {} // #272 // Node may still be hidden by a filter if (!$(n.span).is(":visible")) { n.debug("Navigate: skipping hidden no...
javascript
function _goto(n) { if (n) { // setFocus/setActive will scroll later (if autoScroll is specified) try { n.makeVisible({ scrollIntoView: false }); } catch (e) {} // #272 // Node may still be hidden by a filter if (!$(n.span).is(":visible")) { n.debug("Navigate: skipping hidden no...
[ "function", "_goto", "(", "n", ")", "{", "if", "(", "n", ")", "{", "// setFocus/setActive will scroll later (if autoScroll is specified)", "try", "{", "n", ".", "makeVisible", "(", "{", "scrollIntoView", ":", "false", "}", ")", ";", "}", "catch", "(", "e", "...
Navigate to node
[ "Navigate", "to", "node" ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L3137-L3151
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
function(cmp, deep) { var i, l, cl = this.children; if (!cl) { return; } cmp = cmp || function(a, b) { var x = a.title.toLowerCase(), y = b.title.toLowerCase(); return x === y ? 0 : x > y ? 1 : -1; }; cl.sort(cmp); if (deep) { for (i = 0, l = cl.length; i <...
javascript
function(cmp, deep) { var i, l, cl = this.children; if (!cl) { return; } cmp = cmp || function(a, b) { var x = a.title.toLowerCase(), y = b.title.toLowerCase(); return x === y ? 0 : x > y ? 1 : -1; }; cl.sort(cmp); if (deep) { for (i = 0, l = cl.length; i <...
[ "function", "(", "cmp", ",", "deep", ")", "{", "var", "i", ",", "l", ",", "cl", "=", "this", ".", "children", ";", "if", "(", "!", "cl", ")", "{", "return", ";", "}", "cmp", "=", "cmp", "||", "function", "(", "a", ",", "b", ")", "{", "var",...
Sort child list by title. @param {function} [cmp] custom compare function(a, b) that returns -1, 0, or 1 (defaults to sort by title). @param {boolean} [deep=false] pass true to sort all descendant nodes
[ "Sort", "child", "list", "by", "title", "." ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L3609-L3636
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
function(value, flag) { var className, hasClass, rnotwhite = /\S+/g, classNames = value.match(rnotwhite) || [], i = 0, wasAdded = false, statusElem = this[this.tree.statusClassPropName], curClasses = " " + (this.extraClasses || "") + " "; // this.info("toggleClass('" + value + "', " +...
javascript
function(value, flag) { var className, hasClass, rnotwhite = /\S+/g, classNames = value.match(rnotwhite) || [], i = 0, wasAdded = false, statusElem = this[this.tree.statusClassPropName], curClasses = " " + (this.extraClasses || "") + " "; // this.info("toggleClass('" + value + "', " +...
[ "function", "(", "value", ",", "flag", ")", "{", "var", "className", ",", "hasClass", ",", "rnotwhite", "=", "/", "\\S+", "/", "g", ",", "classNames", "=", "value", ".", "match", "(", "rnotwhite", ")", "||", "[", "]", ",", "i", "=", "0", ",", "wa...
Set, clear, or toggle class of node's span tag and .extraClasses. @param {string} className class name (separate multiple classes by space) @param {boolean} [flag] true/false to add/remove class. If omitted, class is toggled. @returns {boolean} true if a class was added @since 2.17
[ "Set", "clear", "or", "toggle", "class", "of", "node", "s", "span", "tag", "and", ".", "extraClasses", "." ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L3690-L3727
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
function(operation, childNode, extra) { var data, modifyChild = this.tree.options.modifyChild; if (modifyChild) { if (childNode && childNode.parent !== this) { $.error( "childNode " + childNode + " is not a child of " + this ); } data = { node: this, tree: this.tree, ...
javascript
function(operation, childNode, extra) { var data, modifyChild = this.tree.options.modifyChild; if (modifyChild) { if (childNode && childNode.parent !== this) { $.error( "childNode " + childNode + " is not a child of " + this ); } data = { node: this, tree: this.tree, ...
[ "function", "(", "operation", ",", "childNode", ",", "extra", ")", "{", "var", "data", ",", "modifyChild", "=", "this", ".", "tree", ".", "options", ".", "modifyChild", ";", "if", "(", "modifyChild", ")", "{", "if", "(", "childNode", "&&", "childNode", ...
Trigger `modifyChild` event on a parent to signal that a child was modified. @param {string} operation Type of change: 'add', 'remove', 'rename', 'move', 'data', ... @param {FancytreeNode} [childNode] @param {object} [extra]
[ "Trigger", "modifyChild", "event", "on", "a", "parent", "to", "signal", "that", "a", "child", "was", "modified", "." ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L3746-L3767
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
function(flag) { flag = flag !== false; // Confusing use of '!' /*jshint -W018 */ if (!!this._enableUpdate === !!flag) { return flag; } /*jshint +W018 */ this._enableUpdate = flag; if (flag) { this.debug("enableUpdate(true): redraw "); //, this._dirtyRoots); this.render(); } else { ...
javascript
function(flag) { flag = flag !== false; // Confusing use of '!' /*jshint -W018 */ if (!!this._enableUpdate === !!flag) { return flag; } /*jshint +W018 */ this._enableUpdate = flag; if (flag) { this.debug("enableUpdate(true): redraw "); //, this._dirtyRoots); this.render(); } else { ...
[ "function", "(", "flag", ")", "{", "flag", "=", "flag", "!==", "false", ";", "// Confusing use of '!'", "/*jshint -W018 */", "if", "(", "!", "!", "this", ".", "_enableUpdate", "===", "!", "!", "flag", ")", "{", "return", "flag", ";", "}", "/*jshint +W018 *...
Temporarily suppress rendering to improve performance on bulk-updates. @param {boolean} flag @returns {boolean} previous status @since 2.19
[ "Temporarily", "suppress", "rendering", "to", "improve", "performance", "on", "bulk", "-", "updates", "." ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L4285-L4300
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
function(match, startNode, visibleOnly) { match = typeof match === "string" ? _makeNodeTitleStartMatcher(match) : match; startNode = startNode || this.getFirstChild(); var stopNode = null, parentChildren = startNode.parent.children, matchingNode = null, walkVisible = function(parent,...
javascript
function(match, startNode, visibleOnly) { match = typeof match === "string" ? _makeNodeTitleStartMatcher(match) : match; startNode = startNode || this.getFirstChild(); var stopNode = null, parentChildren = startNode.parent.children, matchingNode = null, walkVisible = function(parent,...
[ "function", "(", "match", ",", "startNode", ",", "visibleOnly", ")", "{", "match", "=", "typeof", "match", "===", "\"string\"", "?", "_makeNodeTitleStartMatcher", "(", "match", ")", ":", "match", ";", "startNode", "=", "startNode", "||", "this", ".", "getFir...
Find the next visible node that starts with `match`, starting at `startNode` and wrap-around at the end. @param {string|function} match @param {FancytreeNode} [startNode] defaults to first node @returns {FancytreeNode} matching node or null
[ "Find", "the", "next", "visible", "node", "that", "starts", "with", "match", "starting", "at", "startNode", "and", "wrap", "-", "around", "at", "the", "end", "." ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L4350-L4422
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
function(key, searchRoot) { // Search the DOM by element ID (assuming this is faster than traversing all nodes). var el, match; // TODO: use tree.keyMap if available // TODO: check opts.generateIds === true if (!searchRoot) { el = document.getElementById(this.options.idPrefix + key); if (el) { ...
javascript
function(key, searchRoot) { // Search the DOM by element ID (assuming this is faster than traversing all nodes). var el, match; // TODO: use tree.keyMap if available // TODO: check opts.generateIds === true if (!searchRoot) { el = document.getElementById(this.options.idPrefix + key); if (el) { ...
[ "function", "(", "key", ",", "searchRoot", ")", "{", "// Search the DOM by element ID (assuming this is faster than traversing all nodes).", "var", "el", ",", "match", ";", "// TODO: use tree.keyMap if available", "// TODO: check opts.generateIds === true", "if", "(", "!", "searc...
Return node with a given key or null if not found. @param {string} key @param {FancytreeNode} [searchRoot] only search below this node @returns {FancytreeNode | null}
[ "Return", "node", "with", "a", "given", "key", "or", "null", "if", "not", "found", "." ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L4545-L4566
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
function(ctx, callOpts) { // TODO: return promise? var ac, i, l, node = ctx.node; if (node.parent) { ac = node.parent.children; for (i = 0, l = ac.length; i < l; i++) { if (ac[i] !== node && ac[i].expanded) { this._callHook( "nodeSetExpanded", ac[i], ...
javascript
function(ctx, callOpts) { // TODO: return promise? var ac, i, l, node = ctx.node; if (node.parent) { ac = node.parent.children; for (i = 0, l = ac.length; i < l; i++) { if (ac[i] !== node && ac[i].expanded) { this._callHook( "nodeSetExpanded", ac[i], ...
[ "function", "(", "ctx", ",", "callOpts", ")", "{", "// TODO: return promise?", "var", "ac", ",", "i", ",", "l", ",", "node", "=", "ctx", ".", "node", ";", "if", "(", "node", ".", "parent", ")", "{", "ac", "=", "node", ".", "parent", ".", "children"...
Collapse all other children of same parent. @param {EventData} ctx @param {object} callOpts
[ "Collapse", "all", "other", "children", "of", "same", "parent", "." ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L5148-L5168
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
function(ctx) { var node = ctx.node; // FT.debug("nodeRemoveMarkup()", node.toString()); // TODO: Unlink attr.ftnode to support GC if (node.li) { $(node.li).remove(); node.li = null; } this.nodeRemoveChildMarkup(ctx); }
javascript
function(ctx) { var node = ctx.node; // FT.debug("nodeRemoveMarkup()", node.toString()); // TODO: Unlink attr.ftnode to support GC if (node.li) { $(node.li).remove(); node.li = null; } this.nodeRemoveChildMarkup(ctx); }
[ "function", "(", "ctx", ")", "{", "var", "node", "=", "ctx", ".", "node", ";", "// FT.debug(\"nodeRemoveMarkup()\", node.toString());", "// TODO: Unlink attr.ftnode to support GC", "if", "(", "node", ".", "li", ")", "{", "$", "(", "node", ".", "li", ")", ".", ...
Remove HTML markup for ctx.node and all its descendents. @param {EventData} ctx
[ "Remove", "HTML", "markup", "for", "ctx", ".", "node", "and", "all", "its", "descendents", "." ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L5741-L5750
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
function(ctx, flag) { // ctx.node.debug("nodeSetFocus(" + flag + ")"); var ctx2, tree = ctx.tree, node = ctx.node, opts = tree.options, // et = ctx.originalEvent && ctx.originalEvent.type, isInput = ctx.originalEvent ? $(ctx.originalEvent.target).is(":input") : false; f...
javascript
function(ctx, flag) { // ctx.node.debug("nodeSetFocus(" + flag + ")"); var ctx2, tree = ctx.tree, node = ctx.node, opts = tree.options, // et = ctx.originalEvent && ctx.originalEvent.type, isInput = ctx.originalEvent ? $(ctx.originalEvent.target).is(":input") : false; f...
[ "function", "(", "ctx", ",", "flag", ")", "{", "// ctx.node.debug(\"nodeSetFocus(\" + flag + \")\");", "var", "ctx2", ",", "tree", "=", "ctx", ".", "tree", ",", "node", "=", "ctx", ".", "node", ",", "opts", "=", "tree", ".", "options", ",", "// et = ctx.orig...
Focus or blur this node. @param {EventData} ctx @param {boolean} [flag=true]
[ "Focus", "or", "blur", "this", "node", "." ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L6618-L6693
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
function(ctx) { var tree = ctx.tree; tree.activeNode = null; tree.focusNode = null; tree.$div.find(">ul.fancytree-container").empty(); // TODO: call destructors and remove reference loops tree.rootNode.children = null; }
javascript
function(ctx) { var tree = ctx.tree; tree.activeNode = null; tree.focusNode = null; tree.$div.find(">ul.fancytree-container").empty(); // TODO: call destructors and remove reference loops tree.rootNode.children = null; }
[ "function", "(", "ctx", ")", "{", "var", "tree", "=", "ctx", ".", "tree", ";", "tree", ".", "activeNode", "=", "null", ";", "tree", ".", "focusNode", "=", "null", ";", "tree", ".", "$div", ".", "find", "(", "\">ul.fancytree-container\"", ")", ".", "e...
Remove all nodes. @param {EventData} ctx
[ "Remove", "all", "nodes", "." ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L6914-L6921
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
function(el) { var widget; if (el instanceof Fancytree) { return el; // el already was a Fancytree } if (el === undefined) { el = 0; // get first tree } if (typeof el === "number") { el = $(".fancytree-container").eq(el); // el was an integer: return nth instance } else if (t...
javascript
function(el) { var widget; if (el instanceof Fancytree) { return el; // el already was a Fancytree } if (el === undefined) { el = 0; // get first tree } if (typeof el === "number") { el = $(".fancytree-container").eq(el); // el was an integer: return nth instance } else if (t...
[ "function", "(", "el", ")", "{", "var", "widget", ";", "if", "(", "el", "instanceof", "Fancytree", ")", "{", "return", "el", ";", "// el already was a Fancytree", "}", "if", "(", "el", "===", "undefined", ")", "{", "el", "=", "0", ";", "// get first tree...
Return a Fancytree instance, from element, index, event, or jQueryObject. @param {Element | jQueryObject | Event | integer | string} [el] @returns {Fancytree} matching tree or null @example $.ui.fancytree.getTree(); // Get first Fancytree instance on page $.ui.fancytree.getTree(1); // Get second Fancytree instance ...
[ "Return", "a", "Fancytree", "instance", "from", "element", "index", "event", "or", "jQueryObject", "." ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L7859-L7880
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
function( optionName, node, nodeObject, treeOptions, defaultValue ) { var ctx, res, tree = node.tree, treeOpt = treeOptions[optionName], nodeOpt = nodeObject[optionName]; if ($.isFunction(treeOpt)) { ctx = { node: node, tree: tree, widget: tree....
javascript
function( optionName, node, nodeObject, treeOptions, defaultValue ) { var ctx, res, tree = node.tree, treeOpt = treeOptions[optionName], nodeOpt = nodeObject[optionName]; if ($.isFunction(treeOpt)) { ctx = { node: node, tree: tree, widget: tree....
[ "function", "(", "optionName", ",", "node", ",", "nodeObject", ",", "treeOptions", ",", "defaultValue", ")", "{", "var", "ctx", ",", "res", ",", "tree", "=", "node", ".", "tree", ",", "treeOpt", "=", "treeOptions", "[", "optionName", "]", ",", "nodeOpt",...
Return an option value that has a default, but may be overridden by a callback or a node instance attribute. Evaluation sequence:<br> If tree.options.<optionName> is a callback that returns something, use that.<br> Else if node.<optionName> is defined, use that.<br> Else if tree.options.<optionName> is a value, use t...
[ "Return", "an", "option", "value", "that", "has", "a", "default", "but", "may", "be", "overridden", "by", "a", "callback", "or", "a", "node", "instance", "attribute", "." ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L7906-L7938
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
function(span, baseClass, icon) { var $span = $(span); if (typeof icon === "string") { $span.attr("class", baseClass + " " + icon); } else { // support object syntax: { text: ligature, addClasse: classname } if (icon.text) { $span.text("" + icon.text); } else if (icon.html) { ...
javascript
function(span, baseClass, icon) { var $span = $(span); if (typeof icon === "string") { $span.attr("class", baseClass + " " + icon); } else { // support object syntax: { text: ligature, addClasse: classname } if (icon.text) { $span.text("" + icon.text); } else if (icon.html) { ...
[ "function", "(", "span", ",", "baseClass", ",", "icon", ")", "{", "var", "$span", "=", "$", "(", "span", ")", ";", "if", "(", "typeof", "icon", "===", "\"string\"", ")", "{", "$span", ".", "attr", "(", "\"class\"", ",", "baseClass", "+", "\" \"", "...
Set expander, checkbox, or node icon, supporting string and object format. @param {Element | jQueryObject} span @param {string} baseClass @param {string | object} icon @since 2.27
[ "Set", "expander", "checkbox", "or", "node", "icon", "supporting", "string", "and", "object", "format", "." ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L7946-L7963
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
function(event) { // Poor-man's hotkeys. See here for a complete implementation: // https://github.com/jeresig/jquery.hotkeys var which = event.which, et = event.type, s = []; if (event.altKey) { s.push("alt"); } if (event.ctrlKey) { s.push("ctrl"); } if (event.met...
javascript
function(event) { // Poor-man's hotkeys. See here for a complete implementation: // https://github.com/jeresig/jquery.hotkeys var which = event.which, et = event.type, s = []; if (event.altKey) { s.push("alt"); } if (event.ctrlKey) { s.push("ctrl"); } if (event.met...
[ "function", "(", "event", ")", "{", "// Poor-man's hotkeys. See here for a complete implementation:", "// https://github.com/jeresig/jquery.hotkeys", "var", "which", "=", "event", ".", "which", ",", "et", "=", "event", ".", "type", ",", "s", "=", "[", "]", ";", "i...
Convert a keydown or mouse event to a canonical string like 'ctrl+a', 'ctrl+shift+f2', 'shift+leftdblclick'. This is especially handy for switch-statements in event handlers. @param {event} @returns {string} @example switch( $.ui.fancytree.eventToString(event) ) { case "-": tree.nodeSetExpanded(ctx, false); break; ...
[ "Convert", "a", "keydown", "or", "mouse", "event", "to", "a", "canonical", "string", "like", "ctrl", "+", "a", "ctrl", "+", "shift", "+", "f2", "shift", "+", "leftdblclick", "." ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L7991-L8022
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
function(instance, methodName, handler, context) { var prevSuper, _super = instance[methodName] || $.noop; instance[methodName] = function() { var self = context || this; try { prevSuper = self._super; self._super = _super; return handler.apply(self, arguments); } finally...
javascript
function(instance, methodName, handler, context) { var prevSuper, _super = instance[methodName] || $.noop; instance[methodName] = function() { var self = context || this; try { prevSuper = self._super; self._super = _super; return handler.apply(self, arguments); } finally...
[ "function", "(", "instance", ",", "methodName", ",", "handler", ",", "context", ")", "{", "var", "prevSuper", ",", "_super", "=", "instance", "[", "methodName", "]", "||", "$", ".", "noop", ";", "instance", "[", "methodName", "]", "=", "function", "(", ...
Return a wrapped handler method, that provides `this._super`. @example Implement `opts.createNode` event to add the 'draggable' attribute $.ui.fancytree.overrideMethod(ctx.options, "createNode", function(event, data) { Default processing if any this._super.apply(this, arguments); Add 'draggable' attribute data.node.sp...
[ "Return", "a", "wrapped", "handler", "method", "that", "provides", "this", ".", "_super", "." ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L8055-L8070
train
mar10/fancytree
dist/jquery.fancytree-all-deps.js
function(definition) { _assert( definition.name != null, "extensions must have a `name` property." ); _assert( definition.version != null, "extensions must have a `version` property." ); $.ui.fancytree._extensions[definition.name] = definition; }
javascript
function(definition) { _assert( definition.name != null, "extensions must have a `name` property." ); _assert( definition.version != null, "extensions must have a `version` property." ); $.ui.fancytree._extensions[definition.name] = definition; }
[ "function", "(", "definition", ")", "{", "_assert", "(", "definition", ".", "name", "!=", "null", ",", "\"extensions must have a `name` property.\"", ")", ";", "_assert", "(", "definition", ".", "version", "!=", "null", ",", "\"extensions must have a `version` propert...
Add Fancytree extension definition to the list of globally available extensions. @param {object} definition
[ "Add", "Fancytree", "extension", "definition", "to", "the", "list", "of", "globally", "available", "extensions", "." ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/dist/jquery.fancytree-all-deps.js#L8189-L8199
train
mar10/fancytree
lib/jquery.planize.js
function() { var level = 0; var levels = [0,0,0,0,0,0,0]; var hLevelText = ''; var prependText = ''; var prevLevel = 0; var n = 0; self.children('*:header:visible').each(function(index, heading) { log('Processing heading %o', heading); level = parseInt(heading.tagName.su...
javascript
function() { var level = 0; var levels = [0,0,0,0,0,0,0]; var hLevelText = ''; var prependText = ''; var prevLevel = 0; var n = 0; self.children('*:header:visible').each(function(index, heading) { log('Processing heading %o', heading); level = parseInt(heading.tagName.su...
[ "function", "(", ")", "{", "var", "level", "=", "0", ";", "var", "levels", "=", "[", "0", ",", "0", ",", "0", ",", "0", ",", "0", ",", "0", ",", "0", "]", ";", "var", "hLevelText", "=", "''", ";", "var", "prependText", "=", "''", ";", "var"...
Prepends all headers text with the current tree number reference @return void
[ "Prepends", "all", "headers", "text", "with", "the", "current", "tree", "number", "reference" ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/lib/jquery.planize.js#L59-L120
train
mar10/fancytree
lib/jquery.planize.js
function() { if (!config.debug) { return; } try { console.log.apply(console, arguments); } catch(e) { try { opera.postError.apply(opera, arguments); } catch(e){} } }
javascript
function() { if (!config.debug) { return; } try { console.log.apply(console, arguments); } catch(e) { try { opera.postError.apply(opera, arguments); } catch(e){} } }
[ "function", "(", ")", "{", "if", "(", "!", "config", ".", "debug", ")", "{", "return", ";", "}", "try", "{", "console", ".", "log", ".", "apply", "(", "console", ",", "arguments", ")", ";", "}", "catch", "(", "e", ")", "{", "try", "{", "opera",...
Logs a message into the firebug or opera console if available
[ "Logs", "a", "message", "into", "the", "firebug", "or", "opera", "console", "if", "available" ]
54307b76844177207e321c5b88eb03a23a6e23a2
https://github.com/mar10/fancytree/blob/54307b76844177207e321c5b88eb03a23a6e23a2/lib/jquery.planize.js#L126-L137
train