id
int32
0
58k
repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
9,300
amqp/rhea
lib/sasl.js
function (connection, mechanisms) { this.connection = connection; this.transport = new Transport(connection.amqp_transport.identifier, SASL_PROTOCOL_ID, frames.TYPE_SASL, this); this.next = connection.amqp_transport; this.mechanisms = mechanisms; this.mechanism = undefined; this.outcome = undefi...
javascript
function (connection, mechanisms) { this.connection = connection; this.transport = new Transport(connection.amqp_transport.identifier, SASL_PROTOCOL_ID, frames.TYPE_SASL, this); this.next = connection.amqp_transport; this.mechanisms = mechanisms; this.mechanism = undefined; this.outcome = undefi...
[ "function", "(", "connection", ",", "mechanisms", ")", "{", "this", ".", "connection", "=", "connection", ";", "this", ".", "transport", "=", "new", "Transport", "(", "connection", ".", "amqp_transport", ".", "identifier", ",", "SASL_PROTOCOL_ID", ",", "frames...
The mechanisms argument is a map of mechanism names to factory functions for objects that implement that mechanism.
[ "The", "mechanisms", "argument", "is", "a", "map", "of", "mechanism", "names", "to", "factory", "functions", "for", "objects", "that", "implement", "that", "mechanism", "." ]
f2142dbc4077695141e0f2d62f03575c31e59968
https://github.com/amqp/rhea/blob/f2142dbc4077695141e0f2d62f03575c31e59968/lib/sasl.js#L154-L164
9,301
mapbox/mapbox-gl-geocoder
lib/index.js
function(){ if (this.options.placeholder) return this.options.placeholder; if (this.options.language){ var firstLanguage = this.options.language.split(",")[0]; var language = subtag.language(firstLanguage); var localizedValue = localization.placeholder[language]; if (localizedValue) ret...
javascript
function(){ if (this.options.placeholder) return this.options.placeholder; if (this.options.language){ var firstLanguage = this.options.language.split(",")[0]; var language = subtag.language(firstLanguage); var localizedValue = localization.placeholder[language]; if (localizedValue) ret...
[ "function", "(", ")", "{", "if", "(", "this", ".", "options", ".", "placeholder", ")", "return", "this", ".", "options", ".", "placeholder", ";", "if", "(", "this", ".", "options", ".", "language", ")", "{", "var", "firstLanguage", "=", "this", ".", ...
Get the text to use as the search bar placeholder If placeholder is provided in options, then use options.placeholder Otherwise, if language is provided in options, then use the localized string of the first language if available Otherwise use the default @returns {String} the value to use as the search bar placehold...
[ "Get", "the", "text", "to", "use", "as", "the", "search", "bar", "placeholder" ]
355634a36314c5a2edaecdfefa0d59d1a5007ffd
https://github.com/mapbox/mapbox-gl-geocoder/blob/355634a36314c5a2edaecdfefa0d59d1a5007ffd/lib/index.js#L552-L561
9,302
mapbox/mapbox-gl-geocoder
lib/index.js
function(language){ var browserLocale = navigator.language || navigator.userLanguage || navigator.browserLanguage; this.options.language = language || this.options.language || browserLocale; return this; }
javascript
function(language){ var browserLocale = navigator.language || navigator.userLanguage || navigator.browserLanguage; this.options.language = language || this.options.language || browserLocale; return this; }
[ "function", "(", "language", ")", "{", "var", "browserLocale", "=", "navigator", ".", "language", "||", "navigator", ".", "userLanguage", "||", "navigator", ".", "browserLanguage", ";", "this", ".", "options", ".", "language", "=", "language", "||", "this", ...
Get the language to use in UI elements and when making search requests Look first at the explicitly set options otherwise use the browser's language settings @param {String} language Specify the language to use for response text and query result weighting. Options are IETF language tags comprised of a mandatory ISO 63...
[ "Get", "the", "language", "to", "use", "in", "UI", "elements", "and", "when", "making", "search", "requests" ]
355634a36314c5a2edaecdfefa0d59d1a5007ffd
https://github.com/mapbox/mapbox-gl-geocoder/blob/355634a36314c5a2edaecdfefa0d59d1a5007ffd/lib/index.js#L623-L627
9,303
mapbox/mapbox-gl-geocoder
lib/index.js
function(selected){ // clean up any old marker that might be present this._removeMarker(); var defaultMarkerOptions = { color: '#4668F2' } var markerOptions = extend({}, defaultMarkerOptions, this.options.marker) this.mapMarker = new this._mapboxgl.Marker(markerOptions); this.mapMarker...
javascript
function(selected){ // clean up any old marker that might be present this._removeMarker(); var defaultMarkerOptions = { color: '#4668F2' } var markerOptions = extend({}, defaultMarkerOptions, this.options.marker) this.mapMarker = new this._mapboxgl.Marker(markerOptions); this.mapMarker...
[ "function", "(", "selected", ")", "{", "// clean up any old marker that might be present", "this", ".", "_removeMarker", "(", ")", ";", "var", "defaultMarkerOptions", "=", "{", "color", ":", "'#4668F2'", "}", "var", "markerOptions", "=", "extend", "(", "{", "}", ...
Handle the placement of a result marking the selected result @private @param {Object} selected the selected geojson feature @returns {MapboxGeocoder} this
[ "Handle", "the", "placement", "of", "a", "result", "marking", "the", "selected", "result" ]
355634a36314c5a2edaecdfefa0d59d1a5007ffd
https://github.com/mapbox/mapbox-gl-geocoder/blob/355634a36314c5a2edaecdfefa0d59d1a5007ffd/lib/index.js#L807-L819
9,304
mapbox/mapbox-gl-geocoder
lib/events.js
MapboxEventManager
function MapboxEventManager(options) { this.origin = options.origin || 'https://api.mapbox.com'; this.endpoint = 'events/v2'; this.access_token = options.accessToken; this.version = '0.2.0' this.sessionID = this.generateSessionID(); this.userAgent = this.getUserAgent(); this.options = options; this.sen...
javascript
function MapboxEventManager(options) { this.origin = options.origin || 'https://api.mapbox.com'; this.endpoint = 'events/v2'; this.access_token = options.accessToken; this.version = '0.2.0' this.sessionID = this.generateSessionID(); this.userAgent = this.getUserAgent(); this.options = options; this.sen...
[ "function", "MapboxEventManager", "(", "options", ")", "{", "this", ".", "origin", "=", "options", ".", "origin", "||", "'https://api.mapbox.com'", ";", "this", ".", "endpoint", "=", "'events/v2'", ";", "this", ".", "access_token", "=", "options", ".", "access...
Construct a new mapbox event client to send interaction events to the mapbox event service @param {Object} options options with which to create the service @param {String} options.accessToken the mapbox access token to make requests @param {Number} [options.flushInterval=1000] the number of ms after which to flush the ...
[ "Construct", "a", "new", "mapbox", "event", "client", "to", "send", "interaction", "events", "to", "the", "mapbox", "event", "service" ]
355634a36314c5a2edaecdfefa0d59d1a5007ffd
https://github.com/mapbox/mapbox-gl-geocoder/blob/355634a36314c5a2edaecdfefa0d59d1a5007ffd/lib/events.js#L12-L39
9,305
mapbox/mapbox-gl-geocoder
lib/events.js
function(selected, geocoder){ var resultIndex = this.getSelectedIndex(selected, geocoder); var payload = this.getEventPayload('search.select', geocoder); payload.resultIndex = resultIndex; payload.resultPlaceName = selected.place_name; payload.resultId = selected.id; if ((resultIndex === this.l...
javascript
function(selected, geocoder){ var resultIndex = this.getSelectedIndex(selected, geocoder); var payload = this.getEventPayload('search.select', geocoder); payload.resultIndex = resultIndex; payload.resultPlaceName = selected.place_name; payload.resultId = selected.id; if ((resultIndex === this.l...
[ "function", "(", "selected", ",", "geocoder", ")", "{", "var", "resultIndex", "=", "this", ".", "getSelectedIndex", "(", "selected", ",", "geocoder", ")", ";", "var", "payload", "=", "this", ".", "getEventPayload", "(", "'search.select'", ",", "geocoder", ")...
Send a search.select event to the mapbox events service This event marks the array index of the item selected by the user out of the array of possible options @private @param {Object} selected the geojson feature selected by the user @param {Object} geocoder a mapbox-gl-geocoder instance @returns {Promise}
[ "Send", "a", "search", ".", "select", "event", "to", "the", "mapbox", "events", "service", "This", "event", "marks", "the", "array", "index", "of", "the", "item", "selected", "by", "the", "user", "out", "of", "the", "array", "of", "possible", "options" ]
355634a36314c5a2edaecdfefa0d59d1a5007ffd
https://github.com/mapbox/mapbox-gl-geocoder/blob/355634a36314c5a2edaecdfefa0d59d1a5007ffd/lib/events.js#L50-L64
9,306
mapbox/mapbox-gl-geocoder
lib/events.js
function (payload, callback) { if (!this.enableEventLogging) { if (callback) return callback(); return; } var options = this.getRequestOptions(payload); this.request(options, function(err){ if (err) return this.handleError(err, callback); if (callback) { return callback()...
javascript
function (payload, callback) { if (!this.enableEventLogging) { if (callback) return callback(); return; } var options = this.getRequestOptions(payload); this.request(options, function(err){ if (err) return this.handleError(err, callback); if (callback) { return callback()...
[ "function", "(", "payload", ",", "callback", ")", "{", "if", "(", "!", "this", ".", "enableEventLogging", ")", "{", "if", "(", "callback", ")", "return", "callback", "(", ")", ";", "return", ";", "}", "var", "options", "=", "this", ".", "getRequestOpti...
Send an event to the events service The event is skipped if the instance is not enabled to send logging events @private @param {Object} payload the http POST body of the event @param {Function} [callback] a callback function to invoke when the send has completed @returns {Promise}
[ "Send", "an", "event", "to", "the", "events", "service" ]
355634a36314c5a2edaecdfefa0d59d1a5007ffd
https://github.com/mapbox/mapbox-gl-geocoder/blob/355634a36314c5a2edaecdfefa0d59d1a5007ffd/lib/events.js#L109-L121
9,307
mapbox/mapbox-gl-geocoder
lib/events.js
function(payload){ if (!Array.isArray(payload)) payload = [payload]; var options = { // events must be sent with POST method: "POST", host: this.origin, path: this.endpoint + "?access_token=" + this.access_token, headers: { 'Content-Type': 'application/json' }, ...
javascript
function(payload){ if (!Array.isArray(payload)) payload = [payload]; var options = { // events must be sent with POST method: "POST", host: this.origin, path: this.endpoint + "?access_token=" + this.access_token, headers: { 'Content-Type': 'application/json' }, ...
[ "function", "(", "payload", ")", "{", "if", "(", "!", "Array", ".", "isArray", "(", "payload", ")", ")", "payload", "=", "[", "payload", "]", ";", "var", "options", "=", "{", "// events must be sent with POST", "method", ":", "\"POST\"", ",", "host", ":"...
Get http request options @private @param {*} payload
[ "Get", "http", "request", "options" ]
355634a36314c5a2edaecdfefa0d59d1a5007ffd
https://github.com/mapbox/mapbox-gl-geocoder/blob/355634a36314c5a2edaecdfefa0d59d1a5007ffd/lib/events.js#L127-L140
9,308
mapbox/mapbox-gl-geocoder
lib/events.js
function (event, geocoder) { var proximity; if (!geocoder.options.proximity) proximity = null; else proximity = [geocoder.options.proximity.longitude, geocoder.options.proximity.latitude]; var zoom = (geocoder._map) ? geocoder._map.getZoom() : null; var payload = { event: event, created...
javascript
function (event, geocoder) { var proximity; if (!geocoder.options.proximity) proximity = null; else proximity = [geocoder.options.proximity.longitude, geocoder.options.proximity.latitude]; var zoom = (geocoder._map) ? geocoder._map.getZoom() : null; var payload = { event: event, created...
[ "function", "(", "event", ",", "geocoder", ")", "{", "var", "proximity", ";", "if", "(", "!", "geocoder", ".", "options", ".", "proximity", ")", "proximity", "=", "null", ";", "else", "proximity", "=", "[", "geocoder", ".", "options", ".", "proximity", ...
Get the event payload to send to the events service Most payload properties are shared across all events @private @param {String} event the name of the event to send to the events service. Valid options are 'search.start', 'search.select', 'search.feedback'. @param {Object} geocoder a mapbox-gl-geocoder instance @retur...
[ "Get", "the", "event", "payload", "to", "send", "to", "the", "events", "service", "Most", "payload", "properties", "are", "shared", "across", "all", "events" ]
355634a36314c5a2edaecdfefa0d59d1a5007ffd
https://github.com/mapbox/mapbox-gl-geocoder/blob/355634a36314c5a2edaecdfefa0d59d1a5007ffd/lib/events.js#L150-L183
9,309
mapbox/mapbox-gl-geocoder
lib/events.js
function (opts, callback) { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 ) { if (this.status == 204){ //success return callback(null); }else { return callback(this.statusText); } } }; ...
javascript
function (opts, callback) { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 ) { if (this.status == 204){ //success return callback(null); }else { return callback(this.statusText); } } }; ...
[ "function", "(", "opts", ",", "callback", ")", "{", "var", "xhttp", "=", "new", "XMLHttpRequest", "(", ")", ";", "xhttp", ".", "onreadystatechange", "=", "function", "(", ")", "{", "if", "(", "this", ".", "readyState", "==", "4", ")", "{", "if", "(",...
Wraps the request function for easier testing Make an http request and invoke a callback @private @param {Object} opts options describing the http request to be made @param {Function} callback the callback to invoke when the http request is completed
[ "Wraps", "the", "request", "function", "for", "easier", "testing", "Make", "an", "http", "request", "and", "invoke", "a", "callback" ]
355634a36314c5a2edaecdfefa0d59d1a5007ffd
https://github.com/mapbox/mapbox-gl-geocoder/blob/355634a36314c5a2edaecdfefa0d59d1a5007ffd/lib/events.js#L192-L211
9,310
mapbox/mapbox-gl-geocoder
lib/events.js
function(selected, geocoder){ if (!geocoder._typeahead) return; var results = geocoder._typeahead.data; var selectedID = selected.id; var resultIDs = results.map(function (feature) { return feature.id; }); var selectedIdx = resultIDs.indexOf(selectedID); return selectedIdx; }
javascript
function(selected, geocoder){ if (!geocoder._typeahead) return; var results = geocoder._typeahead.data; var selectedID = selected.id; var resultIDs = results.map(function (feature) { return feature.id; }); var selectedIdx = resultIDs.indexOf(selectedID); return selectedIdx; }
[ "function", "(", "selected", ",", "geocoder", ")", "{", "if", "(", "!", "geocoder", ".", "_typeahead", ")", "return", ";", "var", "results", "=", "geocoder", ".", "_typeahead", ".", "data", ";", "var", "selectedID", "=", "selected", ".", "id", ";", "va...
Get the 0-based numeric index of the item that the user selected out of the list of options @private @param {Object} selected the geojson feature selected by the user @param {Object} geocoder a Mapbox-GL-Geocoder instance @returns {Number} the index of the selected result
[ "Get", "the", "0", "-", "based", "numeric", "index", "of", "the", "item", "that", "the", "user", "selected", "out", "of", "the", "list", "of", "options" ]
355634a36314c5a2edaecdfefa0d59d1a5007ffd
https://github.com/mapbox/mapbox-gl-geocoder/blob/355634a36314c5a2edaecdfefa0d59d1a5007ffd/lib/events.js#L246-L255
9,311
mapbox/mapbox-gl-geocoder
lib/events.js
function(options){ if (options.enableEventLogging === false) return false; if (options.origin && options.origin.indexOf('api.mapbox.com') == -1) return false; // hard to make sense of events when a local instance is suplementing results from origin if (options.localGeocoder) return false; // hard to...
javascript
function(options){ if (options.enableEventLogging === false) return false; if (options.origin && options.origin.indexOf('api.mapbox.com') == -1) return false; // hard to make sense of events when a local instance is suplementing results from origin if (options.localGeocoder) return false; // hard to...
[ "function", "(", "options", ")", "{", "if", "(", "options", ".", "enableEventLogging", "===", "false", ")", "return", "false", ";", "if", "(", "options", ".", "origin", "&&", "options", ".", "origin", ".", "indexOf", "(", "'api.mapbox.com'", ")", "==", "...
Check whether events should be logged Clients using a localGeocoder or an origin other than mapbox should not have events logged @private
[ "Check", "whether", "events", "should", "be", "logged", "Clients", "using", "a", "localGeocoder", "or", "an", "origin", "other", "than", "mapbox", "should", "not", "have", "events", "logged" ]
355634a36314c5a2edaecdfefa0d59d1a5007ffd
https://github.com/mapbox/mapbox-gl-geocoder/blob/355634a36314c5a2edaecdfefa0d59d1a5007ffd/lib/events.js#L262-L270
9,312
mapbox/mapbox-gl-geocoder
lib/events.js
function(){ if (this.eventQueue.length > 0){ this.send(this.eventQueue); this.eventQueue = new Array(); } // //reset the timer if (this.timer) clearTimeout(this.timer); if (this.flushInterval) this.timer = setTimeout(this.flush.bind(this), this.flushInterval) }
javascript
function(){ if (this.eventQueue.length > 0){ this.send(this.eventQueue); this.eventQueue = new Array(); } // //reset the timer if (this.timer) clearTimeout(this.timer); if (this.flushInterval) this.timer = setTimeout(this.flush.bind(this), this.flushInterval) }
[ "function", "(", ")", "{", "if", "(", "this", ".", "eventQueue", ".", "length", ">", "0", ")", "{", "this", ".", "send", "(", "this", ".", "eventQueue", ")", ";", "this", ".", "eventQueue", "=", "new", "Array", "(", ")", ";", "}", "// //reset the t...
Flush out the event queue by sending events to the events service @private
[ "Flush", "out", "the", "event", "queue", "by", "sending", "events", "to", "the", "events", "service" ]
355634a36314c5a2edaecdfefa0d59d1a5007ffd
https://github.com/mapbox/mapbox-gl-geocoder/blob/355634a36314c5a2edaecdfefa0d59d1a5007ffd/lib/events.js#L276-L284
9,313
mapbox/mapbox-gl-geocoder
lib/events.js
function(evt, forceFlush){ this.eventQueue.push(evt); if (this.eventQueue.length >= this.maxQueueSize || forceFlush){ this.flush(); } }
javascript
function(evt, forceFlush){ this.eventQueue.push(evt); if (this.eventQueue.length >= this.maxQueueSize || forceFlush){ this.flush(); } }
[ "function", "(", "evt", ",", "forceFlush", ")", "{", "this", ".", "eventQueue", ".", "push", "(", "evt", ")", ";", "if", "(", "this", ".", "eventQueue", ".", "length", ">=", "this", ".", "maxQueueSize", "||", "forceFlush", ")", "{", "this", ".", "flu...
Push event into the pending queue @param {Object} evt the event to send to the events service @param {Boolean} forceFlush indicates that the event queue should be flushed after adding this event regardless of size of the queue @private
[ "Push", "event", "into", "the", "pending", "queue" ]
355634a36314c5a2edaecdfefa0d59d1a5007ffd
https://github.com/mapbox/mapbox-gl-geocoder/blob/355634a36314c5a2edaecdfefa0d59d1a5007ffd/lib/events.js#L292-L297
9,314
actionhero/actionhero
config/logger.js
buildConsoleLogger
function buildConsoleLogger (level = 'info') { return function (api) { return winston.createLogger({ format: winston.format.combine( winston.format.timestamp(), winston.format.colorize(), winston.format.printf(info => { return `${api.id} @ ${info.timestamp} - ${info.level}:...
javascript
function buildConsoleLogger (level = 'info') { return function (api) { return winston.createLogger({ format: winston.format.combine( winston.format.timestamp(), winston.format.colorize(), winston.format.printf(info => { return `${api.id} @ ${info.timestamp} - ${info.level}:...
[ "function", "buildConsoleLogger", "(", "level", "=", "'info'", ")", "{", "return", "function", "(", "api", ")", "{", "return", "winston", ".", "createLogger", "(", "{", "format", ":", "winston", ".", "format", ".", "combine", "(", "winston", ".", "format",...
learn more about winston v3 loggers @ - https://github.com/winstonjs/winston - https://github.com/winstonjs/winston/blob/master/docs/transports.md
[ "learn", "more", "about", "winston", "v3", "loggers" ]
046c81f1879efcad47048f4505b215e38bd72b7f
https://github.com/actionhero/actionhero/blob/046c81f1879efcad47048f4505b215e38bd72b7f/config/logger.js#L10-L25
9,315
wnr/element-resize-detector
src/listener-handler.js
getListeners
function getListeners(element) { var id = idHandler.get(element); if (id === undefined) { return []; } return eventListeners[id] || []; }
javascript
function getListeners(element) { var id = idHandler.get(element); if (id === undefined) { return []; } return eventListeners[id] || []; }
[ "function", "getListeners", "(", "element", ")", "{", "var", "id", "=", "idHandler", ".", "get", "(", "element", ")", ";", "if", "(", "id", "===", "undefined", ")", "{", "return", "[", "]", ";", "}", "return", "eventListeners", "[", "id", "]", "||", ...
Gets all listeners for the given element. @public @param {element} element The element to get all listeners for. @returns All listeners for the given element.
[ "Gets", "all", "listeners", "for", "the", "given", "element", "." ]
27983e59dce9d8f1296d8f555dc2340840fb0804
https://github.com/wnr/element-resize-detector/blob/27983e59dce9d8f1296d8f555dc2340840fb0804/src/listener-handler.js#L12-L20
9,316
wnr/element-resize-detector
src/listener-handler.js
addListener
function addListener(element, listener) { var id = idHandler.get(element); if(!eventListeners[id]) { eventListeners[id] = []; } eventListeners[id].push(listener); }
javascript
function addListener(element, listener) { var id = idHandler.get(element); if(!eventListeners[id]) { eventListeners[id] = []; } eventListeners[id].push(listener); }
[ "function", "addListener", "(", "element", ",", "listener", ")", "{", "var", "id", "=", "idHandler", ".", "get", "(", "element", ")", ";", "if", "(", "!", "eventListeners", "[", "id", "]", ")", "{", "eventListeners", "[", "id", "]", "=", "[", "]", ...
Stores the given listener for the given element. Will not actually add the listener to the element. @public @param {element} element The element that should have the listener added. @param {function} listener The callback that the element has added.
[ "Stores", "the", "given", "listener", "for", "the", "given", "element", ".", "Will", "not", "actually", "add", "the", "listener", "to", "the", "element", "." ]
27983e59dce9d8f1296d8f555dc2340840fb0804
https://github.com/wnr/element-resize-detector/blob/27983e59dce9d8f1296d8f555dc2340840fb0804/src/listener-handler.js#L28-L36
9,317
wnr/element-resize-detector
src/id-handler.js
getId
function getId(element) { var state = getState(element); if (state && state.id !== undefined) { return state.id; } return null; }
javascript
function getId(element) { var state = getState(element); if (state && state.id !== undefined) { return state.id; } return null; }
[ "function", "getId", "(", "element", ")", "{", "var", "state", "=", "getState", "(", "element", ")", ";", "if", "(", "state", "&&", "state", ".", "id", "!==", "undefined", ")", "{", "return", "state", ".", "id", ";", "}", "return", "null", ";", "}"...
Gets the resize detector id of the element. @public @param {element} element The target element to get the id of. @returns {string|number|null} The id of the element. Null if it has no id.
[ "Gets", "the", "resize", "detector", "id", "of", "the", "element", "." ]
27983e59dce9d8f1296d8f555dc2340840fb0804
https://github.com/wnr/element-resize-detector/blob/27983e59dce9d8f1296d8f555dc2340840fb0804/src/id-handler.js#L13-L21
9,318
wnr/element-resize-detector
src/id-handler.js
setId
function setId(element) { var state = getState(element); if (!state) { throw new Error("setId required the element to have a resize detection state."); } var id = idGenerator.generate(); state.id = id; return id; }
javascript
function setId(element) { var state = getState(element); if (!state) { throw new Error("setId required the element to have a resize detection state."); } var id = idGenerator.generate(); state.id = id; return id; }
[ "function", "setId", "(", "element", ")", "{", "var", "state", "=", "getState", "(", "element", ")", ";", "if", "(", "!", "state", ")", "{", "throw", "new", "Error", "(", "\"setId required the element to have a resize detection state.\"", ")", ";", "}", "var",...
Sets the resize detector id of the element. Requires the element to have a resize detector state initialized. @public @param {element} element The target element to set the id of. @returns {string|number|null} The id of the element.
[ "Sets", "the", "resize", "detector", "id", "of", "the", "element", ".", "Requires", "the", "element", "to", "have", "a", "resize", "detector", "state", "initialized", "." ]
27983e59dce9d8f1296d8f555dc2340840fb0804
https://github.com/wnr/element-resize-detector/blob/27983e59dce9d8f1296d8f555dc2340840fb0804/src/id-handler.js#L29-L41
9,319
bitpay/bitcore-wallet-service
lib/server.js
chunkArray
function chunkArray(myArray, chunk_size){ var results = []; while (myArray.length) { results.push(myArray.splice(0, chunk_size)); } return results; }
javascript
function chunkArray(myArray, chunk_size){ var results = []; while (myArray.length) { results.push(myArray.splice(0, chunk_size)); } return results; }
[ "function", "chunkArray", "(", "myArray", ",", "chunk_size", ")", "{", "var", "results", "=", "[", "]", ";", "while", "(", "myArray", ".", "length", ")", "{", "results", ".", "push", "(", "myArray", ".", "splice", "(", "0", ",", "chunk_size", ")", ")...
Returns an array with arrays of the given size. @param myArray {Array} Array to split @param chunkSize {Integer} Size of every group
[ "Returns", "an", "array", "with", "arrays", "of", "the", "given", "size", "." ]
750172ff7c508a41e612e5ca037094d967964383
https://github.com/bitpay/bitcore-wallet-service/blob/750172ff7c508a41e612e5ca037094d967964383/lib/server.js#L3254-L3262
9,320
mapbox/carto
lib/carto/parser.js
function() { var args = [], arg; arg = $(this.expression); while (arg) { args.push(arg); if (! $(',')) { break; } arg = $(this.expression); } retu...
javascript
function() { var args = [], arg; arg = $(this.expression); while (arg) { args.push(arg); if (! $(',')) { break; } arg = $(this.expression); } retu...
[ "function", "(", ")", "{", "var", "args", "=", "[", "]", ",", "arg", ";", "arg", "=", "$", "(", "this", ".", "expression", ")", ";", "while", "(", "arg", ")", "{", "args", ".", "push", "(", "arg", ")", ";", "if", "(", "!", "$", "(", "','", ...
Arguments are comma-separated expressions
[ "Arguments", "are", "comma", "-", "separated", "expressions" ]
13a3962315b61b892f4ad64053cd3a2f67824f74
https://github.com/mapbox/carto/blob/13a3962315b61b892f4ad64053cd3a2f67824f74/lib/carto/parser.js#L387-L398
9,321
mapbox/carto
lib/carto/parser.js
function() { var c = input.charCodeAt(i); if ((c > 57 || c < 45) || c === 47) return; var value = $(/^(-?\d*\.?\d+(?:[eE][-+]?\d+)?)(\%|\w+)?/); if (value) { return new tree.Dimension(value[1], value[2], memo, env.fi...
javascript
function() { var c = input.charCodeAt(i); if ((c > 57 || c < 45) || c === 47) return; var value = $(/^(-?\d*\.?\d+(?:[eE][-+]?\d+)?)(\%|\w+)?/); if (value) { return new tree.Dimension(value[1], value[2], memo, env.fi...
[ "function", "(", ")", "{", "var", "c", "=", "input", ".", "charCodeAt", "(", "i", ")", ";", "if", "(", "(", "c", ">", "57", "||", "c", "<", "45", ")", "||", "c", "===", "47", ")", "return", ";", "var", "value", "=", "$", "(", "/", "^(-?\\d*...
A Dimension, that is, a number and a unit. The only unit that has an effect is %
[ "A", "Dimension", "that", "is", "a", "number", "and", "a", "unit", ".", "The", "only", "unit", "that", "has", "an", "effect", "is", "%" ]
13a3962315b61b892f4ad64053cd3a2f67824f74
https://github.com/mapbox/carto/blob/13a3962315b61b892f4ad64053cd3a2f67824f74/lib/carto/parser.js#L463-L470
9,322
mapbox/carto
lib/carto/parser.js
function() { var a, attachment, e, elements = [], f, filters = new tree.Filterset(), z, zooms = [], segments = 0, conditions = 0; while ( (e = $(this.element)) || ...
javascript
function() { var a, attachment, e, elements = [], f, filters = new tree.Filterset(), z, zooms = [], segments = 0, conditions = 0; while ( (e = $(this.element)) || ...
[ "function", "(", ")", "{", "var", "a", ",", "attachment", ",", "e", ",", "elements", "=", "[", "]", ",", "f", ",", "filters", "=", "new", "tree", ".", "Filterset", "(", ")", ",", "z", ",", "zooms", "=", "[", "]", ",", "segments", "=", "0", ",...
Selectors are made out of one or more Elements, see above.
[ "Selectors", "are", "made", "out", "of", "one", "or", "more", "Elements", "see", "above", "." ]
13a3962315b61b892f4ad64053cd3a2f67824f74
https://github.com/mapbox/carto/blob/13a3962315b61b892f4ad64053cd3a2f67824f74/lib/carto/parser.js#L516-L564
9,323
mapbox/carto
lib/carto/parser.js
function() { var m, a, op, operation; m = $(this.operand); if (m) { while ((op = ($('/') || $('*') || $('%'))) && (a = $(this.operand))) { operation = new tree.Operation(op, [operation || m, a], memo, env.filename); ...
javascript
function() { var m, a, op, operation; m = $(this.operand); if (m) { while ((op = ($('/') || $('*') || $('%'))) && (a = $(this.operand))) { operation = new tree.Operation(op, [operation || m, a], memo, env.filename); ...
[ "function", "(", ")", "{", "var", "m", ",", "a", ",", "op", ",", "operation", ";", "m", "=", "$", "(", "this", ".", "operand", ")", ";", "if", "(", "m", ")", "{", "while", "(", "(", "op", "=", "(", "$", "(", "'/'", ")", "||", "$", "(", ...
This is a misnomer because it actually handles multiplication and division.
[ "This", "is", "a", "misnomer", "because", "it", "actually", "handles", "multiplication", "and", "division", "." ]
13a3962315b61b892f4ad64053cd3a2f67824f74
https://github.com/mapbox/carto/blob/13a3962315b61b892f4ad64053cd3a2f67824f74/lib/carto/parser.js#L733-L742
9,324
mapbox/carto
lib/carto/parser.js
function() { var e, entities = []; e = $(this.addition); while (e || $(this.entity)) { entities.push(e); e = $(this.addition); } if (entities.length > 0) { return new tree.Expres...
javascript
function() { var e, entities = []; e = $(this.addition); while (e || $(this.entity)) { entities.push(e); e = $(this.addition); } if (entities.length > 0) { return new tree.Expres...
[ "function", "(", ")", "{", "var", "e", ",", "entities", "=", "[", "]", ";", "e", "=", "$", "(", "this", ".", "addition", ")", ";", "while", "(", "e", "||", "$", "(", "this", ".", "entity", ")", ")", "{", "entities", ".", "push", "(", "e", "...
Expressions either represent mathematical operations, or white-space delimited Entities. @var * 2
[ "Expressions", "either", "represent", "mathematical", "operations", "or", "white", "-", "space", "delimited", "Entities", "." ]
13a3962315b61b892f4ad64053cd3a2f67824f74
https://github.com/mapbox/carto/blob/13a3962315b61b892f4ad64053cd3a2f67824f74/lib/carto/parser.js#L763-L775
9,325
mapbox/carto
lib/carto/functions.js
function (val) { var color, mode; if (arguments.length > 1) color = arguments[1]; if (arguments.length > 2) mode = arguments[2]; return { is: 'tag', val: val, color: color, mode: mode, toString: function(env) { ...
javascript
function (val) { var color, mode; if (arguments.length > 1) color = arguments[1]; if (arguments.length > 2) mode = arguments[2]; return { is: 'tag', val: val, color: color, mode: mode, toString: function(env) { ...
[ "function", "(", "val", ")", "{", "var", "color", ",", "mode", ";", "if", "(", "arguments", ".", "length", ">", "1", ")", "color", "=", "arguments", "[", "1", "]", ";", "if", "(", "arguments", ".", "length", ">", "2", ")", "mode", "=", "arguments...
Only require val
[ "Only", "require", "val" ]
13a3962315b61b892f4ad64053cd3a2f67824f74
https://github.com/mapbox/carto/blob/13a3962315b61b892f4ad64053cd3a2f67824f74/lib/carto/functions.js#L28-L54
9,326
mapbox/carto
lib/carto/renderer.js
addRules
function addRules(current, definition, byFilter) { var newFilters = definition.filters, newRules = definition.rules, updatedFilters, clone, previous; // The current definition might have been split up into // multiple definitions already. for (var k = 0; k < current.length; k++) { ...
javascript
function addRules(current, definition, byFilter) { var newFilters = definition.filters, newRules = definition.rules, updatedFilters, clone, previous; // The current definition might have been split up into // multiple definitions already. for (var k = 0; k < current.length; k++) { ...
[ "function", "addRules", "(", "current", ",", "definition", ",", "byFilter", ")", "{", "var", "newFilters", "=", "definition", ".", "filters", ",", "newRules", "=", "definition", ".", "rules", ",", "updatedFilters", ",", "clone", ",", "previous", ";", "// The...
This function currently modifies 'current' @param {Array} current current list of rules @param {Object} definition a Definition object to add to the rules @param {Object} byFilter an object/dictionary of existing filters. This is actually keyed `attachment->filter`
[ "This", "function", "currently", "modifies", "current" ]
13a3962315b61b892f4ad64053cd3a2f67824f74
https://github.com/mapbox/carto/blob/13a3962315b61b892f4ad64053cd3a2f67824f74/lib/carto/renderer.js#L473-L523
9,327
mapbox/carto
lib/carto/renderer.js
inheritDefinitions
function inheritDefinitions(definitions, env) { var inheritTime = +new Date(); // definitions are ordered by specificity, // high (index 0) to low var byAttachment = {}, byFilter = {}; var result = []; var current, attachment; // Evaluate the filters specified by each definition wit...
javascript
function inheritDefinitions(definitions, env) { var inheritTime = +new Date(); // definitions are ordered by specificity, // high (index 0) to low var byAttachment = {}, byFilter = {}; var result = []; var current, attachment; // Evaluate the filters specified by each definition wit...
[ "function", "inheritDefinitions", "(", "definitions", ",", "env", ")", "{", "var", "inheritTime", "=", "+", "new", "Date", "(", ")", ";", "// definitions are ordered by specificity,", "// high (index 0) to low", "var", "byAttachment", "=", "{", "}", ",", "byFilter",...
Apply inherited styles from their ancestors to them. called either once per render (in the case of mss) or per layer (for mml) @param {Object} definitions - a list of definitions objects that contain .rules @param {Object} env - the environment @return {Array<Array>} an array of arrays is returned, in which each arra...
[ "Apply", "inherited", "styles", "from", "their", "ancestors", "to", "them", "." ]
13a3962315b61b892f4ad64053cd3a2f67824f74
https://github.com/mapbox/carto/blob/13a3962315b61b892f4ad64053cd3a2f67824f74/lib/carto/renderer.js#L537-L582
9,328
mapbox/carto
lib/carto/renderer.js
foldStyle
function foldStyle(style) { for (var i = 0; i < style.length; i++) { for (var j = style.length - 1; j > i; j--) { if (style[j].filters.cloneWith(style[i].filters) === null) { style.splice(j, 1); } } } return style; }
javascript
function foldStyle(style) { for (var i = 0; i < style.length; i++) { for (var j = style.length - 1; j > i; j--) { if (style[j].filters.cloneWith(style[i].filters) === null) { style.splice(j, 1); } } } return style; }
[ "function", "foldStyle", "(", "style", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "style", ".", "length", ";", "i", "++", ")", "{", "for", "(", "var", "j", "=", "style", ".", "length", "-", "1", ";", "j", ">", "i", ";", "j",...
Removes dead style definitions that can never be reached when filter-mode="first". The style is modified in-place and returned. The style must be sorted.
[ "Removes", "dead", "style", "definitions", "that", "can", "never", "be", "reached", "when", "filter", "-", "mode", "=", "first", ".", "The", "style", "is", "modified", "in", "-", "place", "and", "returned", ".", "The", "style", "must", "be", "sorted", "....
13a3962315b61b892f4ad64053cd3a2f67824f74
https://github.com/mapbox/carto/blob/13a3962315b61b892f4ad64053cd3a2f67824f74/lib/carto/renderer.js#L611-L620
9,329
mapbox/carto
lib/carto/tree/ruleset.js
function(env) { for (var i = 0; i < this.selectors.length; i++) { var zval = tree.Zoom.all; for (var z = 0; z < this.selectors[i].zoom.length; z++) { zval = zval & this.selectors[i].zoom[z].ev(env).zoom; } this.selectors[i].zoom = zval; } ...
javascript
function(env) { for (var i = 0; i < this.selectors.length; i++) { var zval = tree.Zoom.all; for (var z = 0; z < this.selectors[i].zoom.length; z++) { zval = zval & this.selectors[i].zoom[z].ev(env).zoom; } this.selectors[i].zoom = zval; } ...
[ "function", "(", "env", ")", "{", "for", "(", "var", "i", "=", "0", ";", "i", "<", "this", ".", "selectors", ".", "length", ";", "i", "++", ")", "{", "var", "zval", "=", "tree", ".", "Zoom", ".", "all", ";", "for", "(", "var", "z", "=", "0"...
Zooms can use variables. This replaces tree.Zoom objects on selectors with simple bit-arrays that we can compare easily.
[ "Zooms", "can", "use", "variables", ".", "This", "replaces", "tree", ".", "Zoom", "objects", "on", "selectors", "with", "simple", "bit", "-", "arrays", "that", "we", "can", "compare", "easily", "." ]
13a3962315b61b892f4ad64053cd3a2f67824f74
https://github.com/mapbox/carto/blob/13a3962315b61b892f4ad64053cd3a2f67824f74/lib/carto/tree/ruleset.js#L85-L93
9,330
mapbox/carto
lib/carto/tree/definition.js
symbolizerList
function symbolizerList(sym_order) { return sym_order.sort(function(a, b) { return a[1] - b[1]; }) .map(function(v) { return v[0]; }); }
javascript
function symbolizerList(sym_order) { return sym_order.sort(function(a, b) { return a[1] - b[1]; }) .map(function(v) { return v[0]; }); }
[ "function", "symbolizerList", "(", "sym_order", ")", "{", "return", "sym_order", ".", "sort", "(", "function", "(", "a", ",", "b", ")", "{", "return", "a", "[", "1", "]", "-", "b", "[", "1", "]", ";", "}", ")", ".", "map", "(", "function", "(", ...
Get a simple list of the symbolizers, in order
[ "Get", "a", "simple", "list", "of", "the", "symbolizers", "in", "order" ]
13a3962315b61b892f4ad64053cd3a2f67824f74
https://github.com/mapbox/carto/blob/13a3962315b61b892f4ad64053cd3a2f67824f74/lib/carto/tree/definition.js#L96-L99
9,331
mapbox/carto
lib/carto/tree/color.js
function() { if (this.hsl !== null) { if (this.alpha < 1.0) { if (this.perceptual) { return 'rgba(' + hsluv.hsluvToRgb([this.hsl[0], this.hsl[1] * 100, this.hsl[2] * 100]).map(function(c) { return Math.round(c * 255); })...
javascript
function() { if (this.hsl !== null) { if (this.alpha < 1.0) { if (this.perceptual) { return 'rgba(' + hsluv.hsluvToRgb([this.hsl[0], this.hsl[1] * 100, this.hsl[2] * 100]).map(function(c) { return Math.round(c * 255); })...
[ "function", "(", ")", "{", "if", "(", "this", ".", "hsl", "!==", "null", ")", "{", "if", "(", "this", ".", "alpha", "<", "1.0", ")", "{", "if", "(", "this", ".", "perceptual", ")", "{", "return", "'rgba('", "+", "hsluv", ".", "hsluvToRgb", "(", ...
If we have some transparency, the only way to represent it is via `rgba`. Otherwise, we use the hex representation, which has better compatibility with older browsers.
[ "If", "we", "have", "some", "transparency", "the", "only", "way", "to", "represent", "it", "is", "via", "rgba", ".", "Otherwise", "we", "use", "the", "hex", "representation", "which", "has", "better", "compatibility", "with", "older", "browsers", "." ]
13a3962315b61b892f4ad64053cd3a2f67824f74
https://github.com/mapbox/carto/blob/13a3962315b61b892f4ad64053cd3a2f67824f74/lib/carto/tree/color.js#L41-L64
9,332
mapbox/carto
lib/carto/tree/color.js
function(env, op, other) { var result = [], rgb2; if (other instanceof tree.Color) { rgb2 = chroma(other.toString()).rgb(); } else if (_.isArray(other)) { rgb2 = _.slice(other, 0, Math.max(other.length, 3)); } else if (_.isObject(other...
javascript
function(env, op, other) { var result = [], rgb2; if (other instanceof tree.Color) { rgb2 = chroma(other.toString()).rgb(); } else if (_.isArray(other)) { rgb2 = _.slice(other, 0, Math.max(other.length, 3)); } else if (_.isObject(other...
[ "function", "(", "env", ",", "op", ",", "other", ")", "{", "var", "result", "=", "[", "]", ",", "rgb2", ";", "if", "(", "other", "instanceof", "tree", ".", "Color", ")", "{", "rgb2", "=", "chroma", "(", "other", ".", "toString", "(", ")", ")", ...
Operations have to be done in RGB per-channel, if not, channels will spill onto each other. Once we have our result, in the form of an integer triplet, we create a new Color node to hold the result.
[ "Operations", "have", "to", "be", "done", "in", "RGB", "per", "-", "channel", "if", "not", "channels", "will", "spill", "onto", "each", "other", ".", "Once", "we", "have", "our", "result", "in", "the", "form", "of", "an", "integer", "triplet", "we", "c...
13a3962315b61b892f4ad64053cd3a2f67824f74
https://github.com/mapbox/carto/blob/13a3962315b61b892f4ad64053cd3a2f67824f74/lib/carto/tree/color.js#L100-L141
9,333
mozilla-comm/ical.js
build/ical.js
function(vcal) { var allsubs, properties, vtimezones, reqTzid, i, tzid; if (!vcal || vcal.name !== "vcalendar") { //not a top-level vcalendar component return vcal; } //Store vtimezone subcomponents in an object reference by tzid. //Store properties from everything else in another arra...
javascript
function(vcal) { var allsubs, properties, vtimezones, reqTzid, i, tzid; if (!vcal || vcal.name !== "vcalendar") { //not a top-level vcalendar component return vcal; } //Store vtimezone subcomponents in an object reference by tzid. //Store properties from everything else in another arra...
[ "function", "(", "vcal", ")", "{", "var", "allsubs", ",", "properties", ",", "vtimezones", ",", "reqTzid", ",", "i", ",", "tzid", ";", "if", "(", "!", "vcal", "||", "vcal", ".", "name", "!==", "\"vcalendar\"", ")", "{", "//not a top-level vcalendar compone...
Compiles a list of all referenced TZIDs in all subcomponents and removes any extra VTIMEZONE subcomponents. In addition, if any TZIDs are referenced by a component, but a VTIMEZONE does not exist, an attempt will be made to generate a VTIMEZONE using ICAL.TimezoneService. @param {ICAL.Component} vcal The top-level...
[ "Compiles", "a", "list", "of", "all", "referenced", "TZIDs", "in", "all", "subcomponents", "and", "removes", "any", "extra", "VTIMEZONE", "subcomponents", ".", "In", "addition", "if", "any", "TZIDs", "are", "referenced", "by", "a", "component", "but", "a", "...
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L50-L99
9,334
mozilla-comm/ical.js
build/ical.js
function(string) { var result = parseInt(string, 10); if (ICAL.helpers.isStrictlyNaN(result)) { throw new Error( 'Could not extract integer from "' + string + '"' ); } return result; }
javascript
function(string) { var result = parseInt(string, 10); if (ICAL.helpers.isStrictlyNaN(result)) { throw new Error( 'Could not extract integer from "' + string + '"' ); } return result; }
[ "function", "(", "string", ")", "{", "var", "result", "=", "parseInt", "(", "string", ",", "10", ")", ";", "if", "(", "ICAL", ".", "helpers", ".", "isStrictlyNaN", "(", "result", ")", ")", "{", "throw", "new", "Error", "(", "'Could not extract integer fr...
Parses a string value that is expected to be an integer, when the valid is not an integer throws a decoration error. @param {String} string Raw string input @return {Number} Parsed integer
[ "Parses", "a", "string", "value", "that", "is", "expected", "to", "be", "an", "integer", "when", "the", "valid", "is", "not", "an", "integer", "throws", "a", "decoration", "error", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L118-L128
9,335
mozilla-comm/ical.js
build/ical.js
formatClassType
function formatClassType(data, type) { if (typeof(data) === 'undefined') { return undefined; } if (data instanceof type) { return data; } return new type(data); }
javascript
function formatClassType(data, type) { if (typeof(data) === 'undefined') { return undefined; } if (data instanceof type) { return data; } return new type(data); }
[ "function", "formatClassType", "(", "data", ",", "type", ")", "{", "if", "(", "typeof", "(", "data", ")", "===", "'undefined'", ")", "{", "return", "undefined", ";", "}", "if", "(", "data", "instanceof", "type", ")", "{", "return", "data", ";", "}", ...
Creates or returns a class instance of a given type with the initialization data if the data is not already an instance of the given type. @example var time = new ICAL.Time(...); var result = ICAL.helpers.formatClassType(time, ICAL.Time); (result instanceof ICAL.Time) // => true result = ICAL.helpers.formatClassType...
[ "Creates", "or", "returns", "a", "class", "instance", "of", "a", "given", "type", "with", "the", "initialization", "data", "if", "the", "data", "is", "not", "already", "an", "instance", "of", "the", "given", "type", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L150-L159
9,336
mozilla-comm/ical.js
build/ical.js
function(buffer, search, pos) { while ((pos = buffer.indexOf(search, pos)) !== -1) { if (pos > 0 && buffer[pos - 1] === '\\') { pos += 1; } else { return pos; } } return -1; }
javascript
function(buffer, search, pos) { while ((pos = buffer.indexOf(search, pos)) !== -1) { if (pos > 0 && buffer[pos - 1] === '\\') { pos += 1; } else { return pos; } } return -1; }
[ "function", "(", "buffer", ",", "search", ",", "pos", ")", "{", "while", "(", "(", "pos", "=", "buffer", ".", "indexOf", "(", "search", ",", "pos", ")", ")", "!==", "-", "1", ")", "{", "if", "(", "pos", ">", "0", "&&", "buffer", "[", "pos", "...
Identical to indexOf but will only match values when they are not preceded by a backslash character. @param {String} buffer String to search @param {String} search Value to look for @param {Number} pos Start position @return {Number} The position, or -1 if not found
[ "Identical", "to", "indexOf", "but", "will", "only", "match", "values", "when", "they", "are", "not", "preceded", "by", "a", "backslash", "character", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L170-L179
9,337
mozilla-comm/ical.js
build/ical.js
function(list, seekVal, cmpfunc) { if (!list.length) return 0; var low = 0, high = list.length - 1, mid, cmpval; while (low <= high) { mid = low + Math.floor((high - low) / 2); cmpval = cmpfunc(seekVal, list[mid]); if (cmpval < 0) high = mid - 1; else if (cmp...
javascript
function(list, seekVal, cmpfunc) { if (!list.length) return 0; var low = 0, high = list.length - 1, mid, cmpval; while (low <= high) { mid = low + Math.floor((high - low) / 2); cmpval = cmpfunc(seekVal, list[mid]); if (cmpval < 0) high = mid - 1; else if (cmp...
[ "function", "(", "list", ",", "seekVal", ",", "cmpfunc", ")", "{", "if", "(", "!", "list", ".", "length", ")", "return", "0", ";", "var", "low", "=", "0", ",", "high", "=", "list", ".", "length", "-", "1", ",", "mid", ",", "cmpval", ";", "while...
Find the index for insertion using binary search. @param {Array} list The list to search @param {?} seekVal The value to insert @param {function(?,?)} cmpfunc The comparison func, that can compare two seekVals @return {Number} The insert position
[ "Find", "the", "index", "for", "insertion", "using", "binary", "search", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L190-L215
9,338
mozilla-comm/ical.js
build/ical.js
function() { if (!ICAL.debug) { return; } if (typeof (console) !== 'undefined' && 'log' in console) { ICAL.helpers.dumpn = function consoleDumpn(input) { console.log(input); }; } else { ICAL.helpers.dumpn = function geckoDumpn(input) { dump(input + '\n'); }...
javascript
function() { if (!ICAL.debug) { return; } if (typeof (console) !== 'undefined' && 'log' in console) { ICAL.helpers.dumpn = function consoleDumpn(input) { console.log(input); }; } else { ICAL.helpers.dumpn = function geckoDumpn(input) { dump(input + '\n'); }...
[ "function", "(", ")", "{", "if", "(", "!", "ICAL", ".", "debug", ")", "{", "return", ";", "}", "if", "(", "typeof", "(", "console", ")", "!==", "'undefined'", "&&", "'log'", "in", "console", ")", "{", "ICAL", ".", "helpers", ".", "dumpn", "=", "f...
Convenience function for debug output @private
[ "Convenience", "function", "for", "debug", "output" ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L221-L237
9,339
mozilla-comm/ical.js
build/ical.js
function(aSrc, aDeep) { if (!aSrc || typeof aSrc != "object") { return aSrc; } else if (aSrc instanceof Date) { return new Date(aSrc.getTime()); } else if ("clone" in aSrc) { return aSrc.clone(); } else if (Array.isArray(aSrc)) { var arr = []; for (var i = 0; i < aSrc.lengt...
javascript
function(aSrc, aDeep) { if (!aSrc || typeof aSrc != "object") { return aSrc; } else if (aSrc instanceof Date) { return new Date(aSrc.getTime()); } else if ("clone" in aSrc) { return aSrc.clone(); } else if (Array.isArray(aSrc)) { var arr = []; for (var i = 0; i < aSrc.lengt...
[ "function", "(", "aSrc", ",", "aDeep", ")", "{", "if", "(", "!", "aSrc", "||", "typeof", "aSrc", "!=", "\"object\"", ")", "{", "return", "aSrc", ";", "}", "else", "if", "(", "aSrc", "instanceof", "Date", ")", "{", "return", "new", "Date", "(", "aSr...
Clone the passed object or primitive. By default a shallow clone will be executed. @param {*} aSrc The thing to clone @param {Boolean=} aDeep If true, a deep clone will be performed @return {*} The copy of the thing
[ "Clone", "the", "passed", "object", "or", "primitive", ".", "By", "default", "a", "shallow", "clone", "will", "be", "executed", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L247-L275
9,340
mozilla-comm/ical.js
build/ical.js
foldline
function foldline(aLine) { var result = ""; var line = aLine || ""; while (line.length) { result += ICAL.newLineChar + " " + line.substr(0, ICAL.foldLength); line = line.substr(ICAL.foldLength); } return result.substr(ICAL.newLineChar.length + 1); }
javascript
function foldline(aLine) { var result = ""; var line = aLine || ""; while (line.length) { result += ICAL.newLineChar + " " + line.substr(0, ICAL.foldLength); line = line.substr(ICAL.foldLength); } return result.substr(ICAL.newLineChar.length + 1); }
[ "function", "foldline", "(", "aLine", ")", "{", "var", "result", "=", "\"\"", ";", "var", "line", "=", "aLine", "||", "\"\"", ";", "while", "(", "line", ".", "length", ")", "{", "result", "+=", "ICAL", ".", "newLineChar", "+", "\" \"", "+", "line", ...
Performs iCalendar line folding. A line ending character is inserted and the next line begins with a whitespace. @example SUMMARY:This line will be fold ed right in the middle of a word. @param {String} aLine The line to fold @return {String} The folded line
[ "Performs", "iCalendar", "line", "folding", ".", "A", "line", "ending", "character", "is", "inserted", "and", "the", "next", "line", "begins", "with", "a", "whitespace", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L288-L297
9,341
mozilla-comm/ical.js
build/ical.js
pad
function pad(data) { if (typeof(data) !== 'string') { // handle fractions. if (typeof(data) === 'number') { data = parseInt(data); } data = String(data); } var len = data.length; switch (len) { case 0: return '00'; case 1: return '0' + data; ...
javascript
function pad(data) { if (typeof(data) !== 'string') { // handle fractions. if (typeof(data) === 'number') { data = parseInt(data); } data = String(data); } var len = data.length; switch (len) { case 0: return '00'; case 1: return '0' + data; ...
[ "function", "pad", "(", "data", ")", "{", "if", "(", "typeof", "(", "data", ")", "!==", "'string'", ")", "{", "// handle fractions.", "if", "(", "typeof", "(", "data", ")", "===", "'number'", ")", "{", "data", "=", "parseInt", "(", "data", ")", ";", ...
Pads the given string or number with zeros so it will have at least two characters. @param {String|Number} data The string or number to pad @return {String} The number padded as a string
[ "Pads", "the", "given", "string", "or", "number", "with", "zeros", "so", "it", "will", "have", "at", "least", "two", "characters", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L306-L325
9,342
mozilla-comm/ical.js
build/ical.js
function(base, child, extra) { function F() {} F.prototype = base.prototype; child.prototype = new F(); if (extra) { ICAL.helpers.extend(extra, child.prototype); } }
javascript
function(base, child, extra) { function F() {} F.prototype = base.prototype; child.prototype = new F(); if (extra) { ICAL.helpers.extend(extra, child.prototype); } }
[ "function", "(", "base", ",", "child", ",", "extra", ")", "{", "function", "F", "(", ")", "{", "}", "F", ".", "prototype", "=", "base", ".", "prototype", ";", "child", ".", "prototype", "=", "new", "F", "(", ")", ";", "if", "(", "extra", ")", "...
Poor-man's cross-browser inheritance for JavaScript. Doesn't support all the features, but enough for our usage. @param {Function} base The base class constructor function. @param {Function} child The child class constructor function. @param {Object} extra Extends the prototype with extra properties and me...
[ "Poor", "-", "man", "s", "cross", "-", "browser", "inheritance", "for", "JavaScript", ".", "Doesn", "t", "support", "all", "the", "features", "but", "enough", "for", "our", "usage", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L346-L354
9,343
mozilla-comm/ical.js
build/ical.js
function(source, target) { for (var key in source) { var descr = Object.getOwnPropertyDescriptor(source, key); if (descr && !Object.getOwnPropertyDescriptor(target, key)) { Object.defineProperty(target, key, descr); } } return target; }
javascript
function(source, target) { for (var key in source) { var descr = Object.getOwnPropertyDescriptor(source, key); if (descr && !Object.getOwnPropertyDescriptor(target, key)) { Object.defineProperty(target, key, descr); } } return target; }
[ "function", "(", "source", ",", "target", ")", "{", "for", "(", "var", "key", "in", "source", ")", "{", "var", "descr", "=", "Object", ".", "getOwnPropertyDescriptor", "(", "source", ",", "key", ")", ";", "if", "(", "descr", "&&", "!", "Object", ".",...
Poor-man's cross-browser object extension. Doesn't support all the features, but enough for our usage. Note that the target's properties are not overwritten with the source properties. @example var child = ICAL.helpers.extend(parent, { "bar": 123 }); @param {Object} source The object to extend @param {Object} tar...
[ "Poor", "-", "man", "s", "cross", "-", "browser", "object", "extension", ".", "Doesn", "t", "support", "all", "the", "features", "but", "enough", "for", "our", "usage", ".", "Note", "that", "the", "target", "s", "properties", "are", "not", "overwritten", ...
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L370-L378
9,344
mozilla-comm/ical.js
build/ical.js
function(componentName) { var isInDesign = componentName && componentName in design.components; return isInDesign ? design.components[componentName] : design.defaultSet; }
javascript
function(componentName) { var isInDesign = componentName && componentName in design.components; return isInDesign ? design.components[componentName] : design.defaultSet; }
[ "function", "(", "componentName", ")", "{", "var", "isInDesign", "=", "componentName", "&&", "componentName", "in", "design", ".", "components", ";", "return", "isInDesign", "?", "design", ".", "components", "[", "componentName", "]", ":", "design", ".", "defa...
Gets the design set for the given component name. @param {String} componentName The name of the component @return {ICAL.design.designSet} The design set for the component
[ "Gets", "the", "design", "set", "for", "the", "given", "component", "name", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L1359-L1362
9,345
mozilla-comm/ical.js
build/ical.js
ParserError
function ParserError(message) { this.message = message; this.name = 'ParserError'; try { throw new Error(); } catch (e) { if (e.stack) { var split = e.stack.split('\n'); split.shift(); this.stack = split.join('\n'); } } }
javascript
function ParserError(message) { this.message = message; this.name = 'ParserError'; try { throw new Error(); } catch (e) { if (e.stack) { var split = e.stack.split('\n'); split.shift(); this.stack = split.join('\n'); } } }
[ "function", "ParserError", "(", "message", ")", "{", "this", ".", "message", "=", "message", ";", "this", ".", "name", "=", "'ParserError'", ";", "try", "{", "throw", "new", "Error", "(", ")", ";", "}", "catch", "(", "e", ")", "{", "if", "(", "e", ...
An error that occurred during parsing. @param {String} message The error message @memberof ICAL.parse @extends {Error} @class
[ "An", "error", "that", "occurred", "during", "parsing", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L1697-L1710
9,346
mozilla-comm/ical.js
build/ical.js
function(name) { if (name) { var i = 0; var comps = this.jCal[COMPONENT_INDEX]; var len = comps.length; for (; i < len; i++) { if (comps[i][NAME_INDEX] === name) { var result = this._hydrateComponent(i); return result; } } ...
javascript
function(name) { if (name) { var i = 0; var comps = this.jCal[COMPONENT_INDEX]; var len = comps.length; for (; i < len; i++) { if (comps[i][NAME_INDEX] === name) { var result = this._hydrateComponent(i); return result; } } ...
[ "function", "(", "name", ")", "{", "if", "(", "name", ")", "{", "var", "i", "=", "0", ";", "var", "comps", "=", "this", ".", "jCal", "[", "COMPONENT_INDEX", "]", ";", "var", "len", "=", "comps", ".", "length", ";", "for", "(", ";", "i", "<", ...
Finds first sub component, optionally filtered by name. @param {String=} name Optional name to filter by @return {?ICAL.Component} The found subcomponent
[ "Finds", "first", "sub", "component", "optionally", "filtered", "by", "name", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L2336-L2356
9,347
mozilla-comm/ical.js
build/ical.js
function(name) { var jCalLen = this.jCal[COMPONENT_INDEX].length; var i = 0; if (name) { var comps = this.jCal[COMPONENT_INDEX]; var result = []; for (; i < jCalLen; i++) { if (name === comps[i][NAME_INDEX]) { result.push( this._hydrateComp...
javascript
function(name) { var jCalLen = this.jCal[COMPONENT_INDEX].length; var i = 0; if (name) { var comps = this.jCal[COMPONENT_INDEX]; var result = []; for (; i < jCalLen; i++) { if (name === comps[i][NAME_INDEX]) { result.push( this._hydrateComp...
[ "function", "(", "name", ")", "{", "var", "jCalLen", "=", "this", ".", "jCal", "[", "COMPONENT_INDEX", "]", ".", "length", ";", "var", "i", "=", "0", ";", "if", "(", "name", ")", "{", "var", "comps", "=", "this", ".", "jCal", "[", "COMPONENT_INDEX"...
Finds all sub components, optionally filtering by name. @param {String=} name Optional name to filter by @return {ICAL.Component[]} The found sub components
[ "Finds", "all", "sub", "components", "optionally", "filtering", "by", "name", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L2364-L2390
9,348
mozilla-comm/ical.js
build/ical.js
function(name) { var props = this.jCal[PROPERTY_INDEX]; var len = props.length; var i = 0; for (; i < len; i++) { // 0 is property name if (props[i][NAME_INDEX] === name) { return true; } } return false; }
javascript
function(name) { var props = this.jCal[PROPERTY_INDEX]; var len = props.length; var i = 0; for (; i < len; i++) { // 0 is property name if (props[i][NAME_INDEX] === name) { return true; } } return false; }
[ "function", "(", "name", ")", "{", "var", "props", "=", "this", ".", "jCal", "[", "PROPERTY_INDEX", "]", ";", "var", "len", "=", "props", ".", "length", ";", "var", "i", "=", "0", ";", "for", "(", ";", "i", "<", "len", ";", "i", "++", ")", "{...
Returns true when a named property exists. @param {String} name The property name @return {Boolean} True, when property is found
[ "Returns", "true", "when", "a", "named", "property", "exists", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L2398-L2411
9,349
mozilla-comm/ical.js
build/ical.js
function(name) { if (name) { var i = 0; var props = this.jCal[PROPERTY_INDEX]; var len = props.length; for (; i < len; i++) { if (props[i][NAME_INDEX] === name) { var result = this._hydrateProperty(i); return result; } } } ...
javascript
function(name) { if (name) { var i = 0; var props = this.jCal[PROPERTY_INDEX]; var len = props.length; for (; i < len; i++) { if (props[i][NAME_INDEX] === name) { var result = this._hydrateProperty(i); return result; } } } ...
[ "function", "(", "name", ")", "{", "if", "(", "name", ")", "{", "var", "i", "=", "0", ";", "var", "props", "=", "this", ".", "jCal", "[", "PROPERTY_INDEX", "]", ";", "var", "len", "=", "props", ".", "length", ";", "for", "(", ";", "i", "<", "...
Finds the first property, optionally with the given name. @param {String=} name Lowercase property name @return {?ICAL.Property} The found property
[ "Finds", "the", "first", "property", "optionally", "with", "the", "given", "name", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L2419-L2438
9,350
mozilla-comm/ical.js
build/ical.js
function(name) { var jCalLen = this.jCal[PROPERTY_INDEX].length; var i = 0; if (name) { var props = this.jCal[PROPERTY_INDEX]; var result = []; for (; i < jCalLen; i++) { if (name === props[i][NAME_INDEX]) { result.push( this._hydrateProper...
javascript
function(name) { var jCalLen = this.jCal[PROPERTY_INDEX].length; var i = 0; if (name) { var props = this.jCal[PROPERTY_INDEX]; var result = []; for (; i < jCalLen; i++) { if (name === props[i][NAME_INDEX]) { result.push( this._hydrateProper...
[ "function", "(", "name", ")", "{", "var", "jCalLen", "=", "this", ".", "jCal", "[", "PROPERTY_INDEX", "]", ".", "length", ";", "var", "i", "=", "0", ";", "if", "(", "name", ")", "{", "var", "props", "=", "this", ".", "jCal", "[", "PROPERTY_INDEX", ...
Get all properties in the component, optionally filtered by name. @param {String=} name Lowercase property name @return {ICAL.Property[]} List of properties
[ "Get", "all", "properties", "in", "the", "component", "optionally", "filtered", "by", "name", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L2461-L2487
9,351
mozilla-comm/ical.js
build/ical.js
function(component) { if (!this._components) { this._components = []; this._hydratedComponentCount = 0; } if (component.parent) { component.parent.removeSubcomponent(component); } var idx = this.jCal[COMPONENT_INDEX].push(component.jCal); this._components[id...
javascript
function(component) { if (!this._components) { this._components = []; this._hydratedComponentCount = 0; } if (component.parent) { component.parent.removeSubcomponent(component); } var idx = this.jCal[COMPONENT_INDEX].push(component.jCal); this._components[id...
[ "function", "(", "component", ")", "{", "if", "(", "!", "this", ".", "_components", ")", "{", "this", ".", "_components", "=", "[", "]", ";", "this", ".", "_hydratedComponentCount", "=", "0", ";", "}", "if", "(", "component", ".", "parent", ")", "{",...
Adds a single sub component. @param {ICAL.Component} component The component to add @return {ICAL.Component} The passed in component
[ "Adds", "a", "single", "sub", "component", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L2553-L2568
9,352
mozilla-comm/ical.js
build/ical.js
function(name, value) { var prop = new ICAL.Property(name); prop.setValue(value); this.addProperty(prop); return prop; }
javascript
function(name, value) { var prop = new ICAL.Property(name); prop.setValue(value); this.addProperty(prop); return prop; }
[ "function", "(", "name", ",", "value", ")", "{", "var", "prop", "=", "new", "ICAL", ".", "Property", "(", "name", ")", ";", "prop", ".", "setValue", "(", "value", ")", ";", "this", ".", "addProperty", "(", "prop", ")", ";", "return", "prop", ";", ...
Helper method to add a property with a value to the component. @param {String} name Property name to add @param {String|Number|Object} value Property value @return {ICAL.Property} The created property
[ "Helper", "method", "to", "add", "a", "property", "with", "a", "value", "to", "the", "component", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L2631-L2638
9,353
mozilla-comm/ical.js
build/ical.js
function(name, value) { var prop = this.getFirstProperty(name); if (prop) { prop.setValue(value); } else { prop = this.addPropertyWithValue(name, value); } return prop; }
javascript
function(name, value) { var prop = this.getFirstProperty(name); if (prop) { prop.setValue(value); } else { prop = this.addPropertyWithValue(name, value); } return prop; }
[ "function", "(", "name", ",", "value", ")", "{", "var", "prop", "=", "this", ".", "getFirstProperty", "(", "name", ")", ";", "if", "(", "prop", ")", "{", "prop", ".", "setValue", "(", "value", ")", ";", "}", "else", "{", "prop", "=", "this", ".",...
Helper method that will update or create a property of the given name and sets its value. If multiple properties with the given name exist, only the first is updated. @param {String} name Property name to update @param {String|Number|Object} value Property value @return {ICAL.Property} ...
[ "Helper", "method", "that", "will", "update", "or", "create", "a", "property", "of", "the", "given", "name", "and", "sets", "its", "value", ".", "If", "multiple", "properties", "with", "the", "given", "name", "exist", "only", "the", "first", "is", "updated...
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L2649-L2659
9,354
mozilla-comm/ical.js
build/ical.js
function() { var designSet = this._designSet; if (this.type in designSet.value) { var designType = designSet.value[this.type]; if ('decorate' in designSet.value[this.type]) { this.isDecorated = true; } else { this.isDecorated = false; } if (this...
javascript
function() { var designSet = this._designSet; if (this.type in designSet.value) { var designType = designSet.value[this.type]; if ('decorate' in designSet.value[this.type]) { this.isDecorated = true; } else { this.isDecorated = false; } if (this...
[ "function", "(", ")", "{", "var", "designSet", "=", "this", ".", "_designSet", ";", "if", "(", "this", ".", "type", "in", "designSet", ".", "value", ")", "{", "var", "designType", "=", "designSet", ".", "value", "[", "this", ".", "type", "]", ";", ...
Updates the type metadata from the current jCal type and design set. @private
[ "Updates", "the", "type", "metadata", "from", "the", "current", "jCal", "type", "and", "design", "set", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L2830-L2847
9,355
mozilla-comm/ical.js
build/ical.js
function(value, index) { if (!this._values) { this._values = []; } if (typeof(value) === 'object' && 'icaltype' in value) { // decorated value this.jCal[VALUE_INDEX + index] = this._undecorate(value); this._values[index] = value; } else { // undecorated v...
javascript
function(value, index) { if (!this._values) { this._values = []; } if (typeof(value) === 'object' && 'icaltype' in value) { // decorated value this.jCal[VALUE_INDEX + index] = this._undecorate(value); this._values[index] = value; } else { // undecorated v...
[ "function", "(", "value", ",", "index", ")", "{", "if", "(", "!", "this", ".", "_values", ")", "{", "this", ".", "_values", "=", "[", "]", ";", "}", "if", "(", "typeof", "(", "value", ")", "===", "'object'", "&&", "'icaltype'", "in", "value", ")"...
Sets the value at the given index while also hydrating it. The passed value can either be a decorated or undecorated value. @private @param {?} value The value to set @param {Number} index The index to set it at
[ "Sets", "the", "value", "at", "the", "given", "index", "while", "also", "hydrating", "it", ".", "The", "passed", "value", "can", "either", "be", "a", "decorated", "or", "undecorated", "value", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L2910-L2924
9,356
mozilla-comm/ical.js
build/ical.js
function(name, value) { var lcname = name.toLowerCase(); if (typeof value === "string" && lcname in this._designSet.param && 'multiValue' in this._designSet.param[lcname]) { value = [value]; } this.jCal[PROP_INDEX][name] = value; }
javascript
function(name, value) { var lcname = name.toLowerCase(); if (typeof value === "string" && lcname in this._designSet.param && 'multiValue' in this._designSet.param[lcname]) { value = [value]; } this.jCal[PROP_INDEX][name] = value; }
[ "function", "(", "name", ",", "value", ")", "{", "var", "lcname", "=", "name", ".", "toLowerCase", "(", ")", ";", "if", "(", "typeof", "value", "===", "\"string\"", "&&", "lcname", "in", "this", ".", "_designSet", ".", "param", "&&", "'multiValue'", "i...
Sets a parameter on the property. @param {String} name The parameter name @param {Array|String} value The parameter value
[ "Sets", "a", "parameter", "on", "the", "property", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L2962-L2970
9,357
mozilla-comm/ical.js
build/ical.js
function() { var name = this.jCal[NAME_INDEX]; var designSet = this._designSet; if (name in designSet.property) { var details = designSet.property[name]; if ('defaultType' in details) { return details.defaultType; } } return design.defaultType; }
javascript
function() { var name = this.jCal[NAME_INDEX]; var designSet = this._designSet; if (name in designSet.property) { var details = designSet.property[name]; if ('defaultType' in details) { return details.defaultType; } } return design.defaultType; }
[ "function", "(", ")", "{", "var", "name", "=", "this", ".", "jCal", "[", "NAME_INDEX", "]", ";", "var", "designSet", "=", "this", ".", "_designSet", ";", "if", "(", "name", "in", "designSet", ".", "property", ")", "{", "var", "details", "=", "designS...
Get the default type based on this property's name. @return {String} The default type for this property
[ "Get", "the", "default", "type", "based", "on", "this", "property", "s", "name", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L2986-L2997
9,358
mozilla-comm/ical.js
build/ical.js
function() { var len = this.jCal.length - VALUE_INDEX; if (len < 1) { // its possible for a property to have no value. return []; } var i = 0; var result = []; for (; i < len; i++) { result[i] = this._hydrateValue(i); } return result; }
javascript
function() { var len = this.jCal.length - VALUE_INDEX; if (len < 1) { // its possible for a property to have no value. return []; } var i = 0; var result = []; for (; i < len; i++) { result[i] = this._hydrateValue(i); } return result; }
[ "function", "(", ")", "{", "var", "len", "=", "this", ".", "jCal", ".", "length", "-", "VALUE_INDEX", ";", "if", "(", "len", "<", "1", ")", "{", "// its possible for a property to have no value.", "return", "[", "]", ";", "}", "var", "i", "=", "0", ";"...
Gets all values on the property. NOTE: this creates an array during each call. @return {Array} List of values
[ "Gets", "all", "values", "on", "the", "property", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L3027-L3043
9,359
mozilla-comm/ical.js
build/ical.js
function(values) { if (!this.isMultiValue) { throw new Error( this.name + ': does not not support mulitValue.\n' + 'override isMultiValue' ); } var len = values.length; var i = 0; this.removeAllValues(); if (len > 0 && typeof(values[0])...
javascript
function(values) { if (!this.isMultiValue) { throw new Error( this.name + ': does not not support mulitValue.\n' + 'override isMultiValue' ); } var len = values.length; var i = 0; this.removeAllValues(); if (len > 0 && typeof(values[0])...
[ "function", "(", "values", ")", "{", "if", "(", "!", "this", ".", "isMultiValue", ")", "{", "throw", "new", "Error", "(", "this", ".", "name", "+", "': does not not support mulitValue.\\n'", "+", "'override isMultiValue'", ")", ";", "}", "var", "len", "=", ...
Sets the values of the property. Will overwrite the existing values. This can only be used for multi-value properties. @param {Array} values An array of values
[ "Sets", "the", "values", "of", "the", "property", ".", "Will", "overwrite", "the", "existing", "values", ".", "This", "can", "only", "be", "used", "for", "multi", "-", "value", "properties", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L3061-L3088
9,360
mozilla-comm/ical.js
build/ical.js
function(value) { this.removeAllValues(); if (typeof(value) === 'object' && 'icaltype' in value) { this.resetType(value.icaltype); } if (this.isDecorated) { this._setDecoratedValue(value, 0); } else { this.jCal[VALUE_INDEX] = value; } }
javascript
function(value) { this.removeAllValues(); if (typeof(value) === 'object' && 'icaltype' in value) { this.resetType(value.icaltype); } if (this.isDecorated) { this._setDecoratedValue(value, 0); } else { this.jCal[VALUE_INDEX] = value; } }
[ "function", "(", "value", ")", "{", "this", ".", "removeAllValues", "(", ")", ";", "if", "(", "typeof", "(", "value", ")", "===", "'object'", "&&", "'icaltype'", "in", "value", ")", "{", "this", ".", "resetType", "(", "value", ".", "icaltype", ")", "...
Sets the current value of the property. If this is a multi-value property, all other values will be removed. @param {String|Object} value New property value.
[ "Sets", "the", "current", "value", "of", "the", "property", ".", "If", "this", "is", "a", "multi", "-", "value", "property", "all", "other", "values", "will", "be", "removed", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L3096-L3107
9,361
mozilla-comm/ical.js
build/ical.js
icaltime_compare
function icaltime_compare(other) { var a = this.toSeconds(); var b = other.toSeconds(); return (a > b) - (b > a); }
javascript
function icaltime_compare(other) { var a = this.toSeconds(); var b = other.toSeconds(); return (a > b) - (b > a); }
[ "function", "icaltime_compare", "(", "other", ")", "{", "var", "a", "=", "this", ".", "toSeconds", "(", ")", ";", "var", "b", "=", "other", ".", "toSeconds", "(", ")", ";", "return", "(", "a", ">", "b", ")", "-", "(", "b", ">", "a", ")", ";", ...
Compare this utc offset with another one. @param {ICAL.UtcOffset} other The other offset to compare with @return {Number} -1, 0 or 1 for less/equal/greater
[ "Compare", "this", "utc", "offset", "with", "another", "one", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L3261-L3265
9,362
mozilla-comm/ical.js
build/ical.js
function() { return ICAL.Period.fromData({ start: this.start ? this.start.clone() : null, end: this.end ? this.end.clone() : null, duration: this.duration ? this.duration.clone() : null }); }
javascript
function() { return ICAL.Period.fromData({ start: this.start ? this.start.clone() : null, end: this.end ? this.end.clone() : null, duration: this.duration ? this.duration.clone() : null }); }
[ "function", "(", ")", "{", "return", "ICAL", ".", "Period", ".", "fromData", "(", "{", "start", ":", "this", ".", "start", "?", "this", ".", "start", ".", "clone", "(", ")", ":", "null", ",", "end", ":", "this", ".", "end", "?", "this", ".", "e...
Returns a clone of the duration object. @return {ICAL.Period} The cloned object
[ "Returns", "a", "clone", "of", "the", "duration", "object", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L3609-L3615
9,363
mozilla-comm/ical.js
build/ical.js
toSeconds
function toSeconds() { var seconds = this.seconds + 60 * this.minutes + 3600 * this.hours + 86400 * this.days + 7 * 86400 * this.weeks; return (this.isNegative ? -seconds : seconds); }
javascript
function toSeconds() { var seconds = this.seconds + 60 * this.minutes + 3600 * this.hours + 86400 * this.days + 7 * 86400 * this.weeks; return (this.isNegative ? -seconds : seconds); }
[ "function", "toSeconds", "(", ")", "{", "var", "seconds", "=", "this", ".", "seconds", "+", "60", "*", "this", ".", "minutes", "+", "3600", "*", "this", ".", "hours", "+", "86400", "*", "this", ".", "days", "+", "7", "*", "86400", "*", "this", "....
The duration value expressed as a number of seconds. @return {Number} The duration value in seconds
[ "The", "duration", "value", "expressed", "as", "a", "number", "of", "seconds", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L3844-L3848
9,364
mozilla-comm/ical.js
build/ical.js
compare
function compare(aOther) { var thisSeconds = this.toSeconds(); var otherSeconds = aOther.toSeconds(); return (thisSeconds > otherSeconds) - (thisSeconds < otherSeconds); }
javascript
function compare(aOther) { var thisSeconds = this.toSeconds(); var otherSeconds = aOther.toSeconds(); return (thisSeconds > otherSeconds) - (thisSeconds < otherSeconds); }
[ "function", "compare", "(", "aOther", ")", "{", "var", "thisSeconds", "=", "this", ".", "toSeconds", "(", ")", ";", "var", "otherSeconds", "=", "aOther", ".", "toSeconds", "(", ")", ";", "return", "(", "thisSeconds", ">", "otherSeconds", ")", "-", "(", ...
Compares the duration instance with another one. @param {ICAL.Duration} aOther The instance to compare with @return {Number} -1, 0 or 1 for less/equal/greater
[ "Compares", "the", "duration", "instance", "with", "another", "one", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L3930-L3934
9,365
mozilla-comm/ical.js
build/ical.js
parseDurationChunk
function parseDurationChunk(letter, number, object) { var type; switch (letter) { case 'P': if (number && number === '-') { object.isNegative = true; } else { object.isNegative = false; } // period break; case 'D': type = 'days'; ...
javascript
function parseDurationChunk(letter, number, object) { var type; switch (letter) { case 'P': if (number && number === '-') { object.isNegative = true; } else { object.isNegative = false; } // period break; case 'D': type = 'days'; ...
[ "function", "parseDurationChunk", "(", "letter", ",", "number", ",", "object", ")", "{", "var", "type", ";", "switch", "(", "letter", ")", "{", "case", "'P'", ":", "if", "(", "number", "&&", "number", "===", "'-'", ")", "{", "object", ".", "isNegative"...
Internal helper function to handle a chunk of a duration. @param {String} letter type of duration chunk @param {String} number numeric value or -/+ @param {Object} dict target to assign values to
[ "Internal", "helper", "function", "to", "handle", "a", "chunk", "of", "a", "duration", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L3994-L4041
9,366
mozilla-comm/ical.js
build/ical.js
utcOffset
function utcOffset(tt) { if (this == ICAL.Timezone.utcTimezone || this == ICAL.Timezone.localTimezone) { return 0; } this._ensureCoverage(tt.year); if (!this.changes.length) { return 0; } var tt_change = { year: tt.year, month: tt.month, day...
javascript
function utcOffset(tt) { if (this == ICAL.Timezone.utcTimezone || this == ICAL.Timezone.localTimezone) { return 0; } this._ensureCoverage(tt.year); if (!this.changes.length) { return 0; } var tt_change = { year: tt.year, month: tt.month, day...
[ "function", "utcOffset", "(", "tt", ")", "{", "if", "(", "this", "==", "ICAL", ".", "Timezone", ".", "utcTimezone", "||", "this", "==", "ICAL", ".", "Timezone", ".", "localTimezone", ")", "{", "return", "0", ";", "}", "this", ".", "_ensureCoverage", "(...
Finds the utcOffset the given time would occur in this timezone. @param {ICAL.Time} tt The time to check for @return {Number} utc offset in seconds
[ "Finds", "the", "utcOffset", "the", "given", "time", "would", "occur", "in", "this", "timezone", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L4262-L4341
9,367
mozilla-comm/ical.js
build/ical.js
function(name, timezone) { if (name instanceof ICAL.Component) { if (name.name === 'vtimezone') { timezone = new ICAL.Timezone(name); name = timezone.tzid; } } if (timezone instanceof ICAL.Timezone) { zones[name] = timezone; } else { throw new...
javascript
function(name, timezone) { if (name instanceof ICAL.Component) { if (name.name === 'vtimezone') { timezone = new ICAL.Timezone(name); name = timezone.tzid; } } if (timezone instanceof ICAL.Timezone) { zones[name] = timezone; } else { throw new...
[ "function", "(", "name", ",", "timezone", ")", "{", "if", "(", "name", "instanceof", "ICAL", ".", "Component", ")", "{", "if", "(", "name", ".", "name", "===", "'vtimezone'", ")", "{", "timezone", "=", "new", "ICAL", ".", "Timezone", "(", "name", ")"...
Registers a timezone object or component. @param {String=} name The name of the timezone. Defaults to the component's TZID if not passed. @param {ICAL.Component|ICAL.Timezone} zone The initialized zone or vtimezone.
[ "Registers", "a", "timezone", "object", "or", "component", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L4689-L4702
9,368
mozilla-comm/ical.js
build/ical.js
icaltime_fromJSDate
function icaltime_fromJSDate(aDate, useUTC) { if (!aDate) { this.reset(); } else { if (useUTC) { this.zone = ICAL.Timezone.utcTimezone; this.year = aDate.getUTCFullYear(); this.month = aDate.getUTCMonth() + 1; this.day = aDate.getUTCDate(); t...
javascript
function icaltime_fromJSDate(aDate, useUTC) { if (!aDate) { this.reset(); } else { if (useUTC) { this.zone = ICAL.Timezone.utcTimezone; this.year = aDate.getUTCFullYear(); this.month = aDate.getUTCMonth() + 1; this.day = aDate.getUTCDate(); t...
[ "function", "icaltime_fromJSDate", "(", "aDate", ",", "useUTC", ")", "{", "if", "(", "!", "aDate", ")", "{", "this", ".", "reset", "(", ")", ";", "}", "else", "{", "if", "(", "useUTC", ")", "{", "this", ".", "zone", "=", "ICAL", ".", "Timezone", ...
Set up the current instance from the Javascript date value. @param {?Date} aDate The Javascript Date to read, or null to reset @param {Boolean} useUTC If true, the UTC values of the date will be used
[ "Set", "up", "the", "current", "instance", "from", "the", "Javascript", "date", "value", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L4863-L4887
9,369
mozilla-comm/ical.js
build/ical.js
icaltime_dayOfWeek
function icaltime_dayOfWeek() { var dowCacheKey = (this.year << 9) + (this.month << 5) + this.day; if (dowCacheKey in ICAL.Time._dowCache) { return ICAL.Time._dowCache[dowCacheKey]; } // Using Zeller's algorithm var q = this.day; var m = this.month + (this.month < 3 ? 12 : 0...
javascript
function icaltime_dayOfWeek() { var dowCacheKey = (this.year << 9) + (this.month << 5) + this.day; if (dowCacheKey in ICAL.Time._dowCache) { return ICAL.Time._dowCache[dowCacheKey]; } // Using Zeller's algorithm var q = this.day; var m = this.month + (this.month < 3 ? 12 : 0...
[ "function", "icaltime_dayOfWeek", "(", ")", "{", "var", "dowCacheKey", "=", "(", "this", ".", "year", "<<", "9", ")", "+", "(", "this", ".", "month", "<<", "5", ")", "+", "this", ".", "day", ";", "if", "(", "dowCacheKey", "in", "ICAL", ".", "Time",...
Calculate the day of week. @return {ICAL.Time.weekDay}
[ "Calculate", "the", "day", "of", "week", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L4949-L4972
9,370
mozilla-comm/ical.js
build/ical.js
dayOfYear
function dayOfYear() { var is_leap = (ICAL.Time.isLeapYear(this.year) ? 1 : 0); var diypm = ICAL.Time.daysInYearPassedMonth; return diypm[is_leap][this.month - 1] + this.day; }
javascript
function dayOfYear() { var is_leap = (ICAL.Time.isLeapYear(this.year) ? 1 : 0); var diypm = ICAL.Time.daysInYearPassedMonth; return diypm[is_leap][this.month - 1] + this.day; }
[ "function", "dayOfYear", "(", ")", "{", "var", "is_leap", "=", "(", "ICAL", ".", "Time", ".", "isLeapYear", "(", "this", ".", "year", ")", "?", "1", ":", "0", ")", ";", "var", "diypm", "=", "ICAL", ".", "Time", ".", "daysInYearPassedMonth", ";", "r...
Calculate the day of year. @return {Number}
[ "Calculate", "the", "day", "of", "year", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L4978-L4982
9,371
mozilla-comm/ical.js
build/ical.js
startDoyWeek
function startDoyWeek(aFirstDayOfWeek) { var firstDow = aFirstDayOfWeek || ICAL.Time.SUNDAY; var delta = this.dayOfWeek() - firstDow; if (delta < 0) delta += 7; return this.dayOfYear() - delta; }
javascript
function startDoyWeek(aFirstDayOfWeek) { var firstDow = aFirstDayOfWeek || ICAL.Time.SUNDAY; var delta = this.dayOfWeek() - firstDow; if (delta < 0) delta += 7; return this.dayOfYear() - delta; }
[ "function", "startDoyWeek", "(", "aFirstDayOfWeek", ")", "{", "var", "firstDow", "=", "aFirstDayOfWeek", "||", "ICAL", ".", "Time", ".", "SUNDAY", ";", "var", "delta", "=", "this", ".", "dayOfWeek", "(", ")", "-", "firstDow", ";", "if", "(", "delta", "<"...
First calculates the start of the week, then returns the day of year for this date. If the day falls into the previous year, the day is zero or negative. @param {ICAL.Time.weekDay=} aFirstDayOfWeek The week start weekday, defaults to SUNDAY @return {Number} The calculated day of year
[ "First", "calculates", "the", "start", "of", "the", "week", "then", "returns", "the", "day", "of", "year", "for", "this", "date", ".", "If", "the", "day", "falls", "into", "the", "previous", "year", "the", "day", "is", "zero", "or", "negative", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L5102-L5107
9,372
mozilla-comm/ical.js
build/ical.js
function(aDayOfWeek, aPos) { var dow = this.dayOfWeek(); if (aPos === 0 && dow === aDayOfWeek) { return true; } // get pos var day = this.nthWeekDay(aDayOfWeek, aPos); if (day === this.day) { return true; } return false; }
javascript
function(aDayOfWeek, aPos) { var dow = this.dayOfWeek(); if (aPos === 0 && dow === aDayOfWeek) { return true; } // get pos var day = this.nthWeekDay(aDayOfWeek, aPos); if (day === this.day) { return true; } return false; }
[ "function", "(", "aDayOfWeek", ",", "aPos", ")", "{", "var", "dow", "=", "this", ".", "dayOfWeek", "(", ")", ";", "if", "(", "aPos", "===", "0", "&&", "dow", "===", "aDayOfWeek", ")", "{", "return", "true", ";", "}", "// get pos", "var", "day", "="...
Checks if current time is the nth weekday, relative to the current month. Will always return false when rule resolves outside of current month. @param {ICAL.Time.weekDay} aDayOfWeek Day of week to check @param {Number} aPos Relative position @return {Boolean} Tru...
[ "Checks", "if", "current", "time", "is", "the", "nth", "weekday", "relative", "to", "the", "current", "month", ".", "Will", "always", "return", "false", "when", "rule", "resolves", "outside", "of", "current", "month", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L5216-L5231
9,373
mozilla-comm/ical.js
build/ical.js
weekNumber
function weekNumber(aWeekStart) { var wnCacheKey = (this.year << 12) + (this.month << 8) + (this.day << 3) + aWeekStart; if (wnCacheKey in ICAL.Time._wnCache) { return ICAL.Time._wnCache[wnCacheKey]; } // This function courtesty of Julian Bucknall, published under the MIT license /...
javascript
function weekNumber(aWeekStart) { var wnCacheKey = (this.year << 12) + (this.month << 8) + (this.day << 3) + aWeekStart; if (wnCacheKey in ICAL.Time._wnCache) { return ICAL.Time._wnCache[wnCacheKey]; } // This function courtesty of Julian Bucknall, published under the MIT license /...
[ "function", "weekNumber", "(", "aWeekStart", ")", "{", "var", "wnCacheKey", "=", "(", "this", ".", "year", "<<", "12", ")", "+", "(", "this", ".", "month", "<<", "8", ")", "+", "(", "this", ".", "day", "<<", "3", ")", "+", "aWeekStart", ";", "if"...
Calculates the ISO 8601 week number. The first week of a year is the week that contains the first Thursday. The year can have 53 weeks, if January 1st is a Friday. Note there are regions where the first week of the year is the one that starts on January 1st, which may offset the week number. Also, if a different week ...
[ "Calculates", "the", "ISO", "8601", "week", "number", ".", "The", "first", "week", "of", "a", "year", "is", "the", "week", "that", "contains", "the", "first", "Thursday", ".", "The", "year", "can", "have", "53", "weeks", "if", "January", "1st", "is", "...
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L5247-L5279
9,374
mozilla-comm/ical.js
build/ical.js
icaltime_add
function icaltime_add(aDuration) { var mult = (aDuration.isNegative ? -1 : 1); // because of the duration optimizations it is much // more efficient to grab all the values up front // then set them directly (which will avoid a normalization call). // So we don't actually normalize until w...
javascript
function icaltime_add(aDuration) { var mult = (aDuration.isNegative ? -1 : 1); // because of the duration optimizations it is much // more efficient to grab all the values up front // then set them directly (which will avoid a normalization call). // So we don't actually normalize until w...
[ "function", "icaltime_add", "(", "aDuration", ")", "{", "var", "mult", "=", "(", "aDuration", ".", "isNegative", "?", "-", "1", ":", "1", ")", ";", "// because of the duration optimizations it is much", "// more efficient to grab all the values up front", "// then set the...
Adds the duration to the current time. The instance is modified in place. @param {ICAL.Duration} aDuration The duration to add
[ "Adds", "the", "duration", "to", "the", "current", "time", ".", "The", "instance", "is", "modified", "in", "place", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L5287-L5311
9,375
mozilla-comm/ical.js
build/ical.js
icaltime_subtract_abs
function icaltime_subtract_abs(aDate) { var unixTime = this.toUnixTime(); var other = aDate.toUnixTime(); return ICAL.Duration.fromSeconds(unixTime - other); }
javascript
function icaltime_subtract_abs(aDate) { var unixTime = this.toUnixTime(); var other = aDate.toUnixTime(); return ICAL.Duration.fromSeconds(unixTime - other); }
[ "function", "icaltime_subtract_abs", "(", "aDate", ")", "{", "var", "unixTime", "=", "this", ".", "toUnixTime", "(", ")", ";", "var", "other", "=", "aDate", ".", "toUnixTime", "(", ")", ";", "return", "ICAL", ".", "Duration", ".", "fromSeconds", "(", "un...
Subtract the date details, taking timezones into account. @param {ICAL.Time} aDate The date to subtract @return {ICAL.Duration} The difference in duration
[ "Subtract", "the", "date", "details", "taking", "timezones", "into", "account", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L5333-L5337
9,376
mozilla-comm/ical.js
build/ical.js
icaltime_compare
function icaltime_compare(other) { var a = this.toUnixTime(); var b = other.toUnixTime(); if (a > b) return 1; if (b > a) return -1; return 0; }
javascript
function icaltime_compare(other) { var a = this.toUnixTime(); var b = other.toUnixTime(); if (a > b) return 1; if (b > a) return -1; return 0; }
[ "function", "icaltime_compare", "(", "other", ")", "{", "var", "a", "=", "this", ".", "toUnixTime", "(", ")", ";", "var", "b", "=", "other", ".", "toUnixTime", "(", ")", ";", "if", "(", "a", ">", "b", ")", "return", "1", ";", "if", "(", "b", ">...
Compares the ICAL.Time instance with another one. @param {ICAL.Duration} aOther The instance to compare with @return {Number} -1, 0 or 1 for less/equal/greater
[ "Compares", "the", "ICAL", ".", "Time", "instance", "with", "another", "one", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L5345-L5352
9,377
mozilla-comm/ical.js
build/ical.js
icaltime_compareDateOnlyTz
function icaltime_compareDateOnlyTz(other, tz) { function cmp(attr) { return ICAL.Time._cmp_attr(a, b, attr); } var a = this.convertToZone(tz); var b = other.convertToZone(tz); var rc = 0; if ((rc = cmp("year")) != 0) return rc; if ((rc = cmp("month")) != 0) return rc;...
javascript
function icaltime_compareDateOnlyTz(other, tz) { function cmp(attr) { return ICAL.Time._cmp_attr(a, b, attr); } var a = this.convertToZone(tz); var b = other.convertToZone(tz); var rc = 0; if ((rc = cmp("year")) != 0) return rc; if ((rc = cmp("month")) != 0) return rc;...
[ "function", "icaltime_compareDateOnlyTz", "(", "other", ",", "tz", ")", "{", "function", "cmp", "(", "attr", ")", "{", "return", "ICAL", ".", "Time", ".", "_cmp_attr", "(", "a", ",", "b", ",", "attr", ")", ";", "}", "var", "a", "=", "this", ".", "c...
Compares only the date part of this instance with another one. @param {ICAL.Duration} other The instance to compare with @param {ICAL.Timezone} tz The timezone to compare in @return {Number} -1, 0 or 1 for less/equal/greater
[ "Compares", "only", "the", "date", "part", "of", "this", "instance", "with", "another", "one", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L5361-L5374
9,378
mozilla-comm/ical.js
build/ical.js
convertToZone
function convertToZone(zone) { var copy = this.clone(); var zone_equals = (this.zone.tzid == zone.tzid); if (!this.isDate && !zone_equals) { ICAL.Timezone.convert_time(copy, this.zone, zone); } copy.zone = zone; return copy; }
javascript
function convertToZone(zone) { var copy = this.clone(); var zone_equals = (this.zone.tzid == zone.tzid); if (!this.isDate && !zone_equals) { ICAL.Timezone.convert_time(copy, this.zone, zone); } copy.zone = zone; return copy; }
[ "function", "convertToZone", "(", "zone", ")", "{", "var", "copy", "=", "this", ".", "clone", "(", ")", ";", "var", "zone_equals", "=", "(", "this", ".", "zone", ".", "tzid", "==", "zone", ".", "tzid", ")", ";", "if", "(", "!", "this", ".", "isDa...
Convert the instance into another timzone. The returned ICAL.Time instance is always a copy. @param {ICAL.Timezone} zone The zone to convert to @return {ICAL.Time} The copy, converted to the zone
[ "Convert", "the", "instance", "into", "another", "timzone", ".", "The", "returned", "ICAL", ".", "Time", "instance", "is", "always", "a", "copy", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L5383-L5393
9,379
mozilla-comm/ical.js
build/ical.js
function() { var string = this.toString(); if (string.length > 10) { return ICAL.design.icalendar.value['date-time'].toICAL(string); } else { return ICAL.design.icalendar.value.date.toICAL(string); } }
javascript
function() { var string = this.toString(); if (string.length > 10) { return ICAL.design.icalendar.value['date-time'].toICAL(string); } else { return ICAL.design.icalendar.value.date.toICAL(string); } }
[ "function", "(", ")", "{", "var", "string", "=", "this", ".", "toString", "(", ")", ";", "if", "(", "string", ".", "length", ">", "10", ")", "{", "return", "ICAL", ".", "design", ".", "icalendar", ".", "value", "[", "'date-time'", "]", ".", "toICAL...
Returns an RFC 5545 compliant ical representation of this object. @return {String} ical date/date-time
[ "Returns", "an", "RFC", "5545", "compliant", "ical", "representation", "of", "this", "object", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L5415-L5423
9,380
mozilla-comm/ical.js
build/ical.js
toJSDate
function toJSDate() { if (this.zone == ICAL.Timezone.localTimezone) { if (this.isDate) { return new Date(this.year, this.month - 1, this.day); } else { return new Date(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, 0); ...
javascript
function toJSDate() { if (this.zone == ICAL.Timezone.localTimezone) { if (this.isDate) { return new Date(this.year, this.month - 1, this.day); } else { return new Date(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, 0); ...
[ "function", "toJSDate", "(", ")", "{", "if", "(", "this", ".", "zone", "==", "ICAL", ".", "Timezone", ".", "localTimezone", ")", "{", "if", "(", "this", ".", "isDate", ")", "{", "return", "new", "Date", "(", "this", ".", "year", ",", "this", ".", ...
Converts the current instance to a Javascript date @return {Date}
[ "Converts", "the", "current", "instance", "to", "a", "Javascript", "date" ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L5452-L5463
9,381
mozilla-comm/ical.js
build/ical.js
fromUnixTime
function fromUnixTime(seconds) { this.zone = ICAL.Timezone.utcTimezone; var epoch = ICAL.Time.epochTime.clone(); epoch.adjust(0, 0, 0, seconds); this.year = epoch.year; this.month = epoch.month; this.day = epoch.day; this.hour = epoch.hour; this.minute = epoch.minute; ...
javascript
function fromUnixTime(seconds) { this.zone = ICAL.Timezone.utcTimezone; var epoch = ICAL.Time.epochTime.clone(); epoch.adjust(0, 0, 0, seconds); this.year = epoch.year; this.month = epoch.month; this.day = epoch.day; this.hour = epoch.hour; this.minute = epoch.minute; ...
[ "function", "fromUnixTime", "(", "seconds", ")", "{", "this", ".", "zone", "=", "ICAL", ".", "Timezone", ".", "utcTimezone", ";", "var", "epoch", "=", "ICAL", ".", "Time", ".", "epochTime", ".", "clone", "(", ")", ";", "epoch", ".", "adjust", "(", "0...
Sets up the current instance from unix time, the number of seconds since January 1st, 1970. @param {Number} seconds The seconds to set up with
[ "Sets", "up", "the", "current", "instance", "from", "unix", "time", "the", "number", "of", "seconds", "since", "January", "1st", "1970", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L5580-L5593
9,382
mozilla-comm/ical.js
build/ical.js
toUnixTime
function toUnixTime() { if (this._cachedUnixTime !== null) { return this._cachedUnixTime; } var offset = this.utcOffset(); // we use the offset trick to ensure // that we are getting the actual UTC time var ms = Date.UTC( this.year, this.month - 1, th...
javascript
function toUnixTime() { if (this._cachedUnixTime !== null) { return this._cachedUnixTime; } var offset = this.utcOffset(); // we use the offset trick to ensure // that we are getting the actual UTC time var ms = Date.UTC( this.year, this.month - 1, th...
[ "function", "toUnixTime", "(", ")", "{", "if", "(", "this", ".", "_cachedUnixTime", "!==", "null", ")", "{", "return", "this", ".", "_cachedUnixTime", ";", "}", "var", "offset", "=", "this", ".", "utcOffset", "(", ")", ";", "// we use the offset trick to ens...
Converts the current instance to seconds since January 1st 1970. @return {Number} Seconds since 1970
[ "Converts", "the", "current", "instance", "to", "seconds", "since", "January", "1st", "1970", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L5600-L5620
9,383
mozilla-comm/ical.js
build/ical.js
function() { var copy = [ 'year', 'month', 'day', 'hour', 'minute', 'second', 'isDate' ]; var result = Object.create(null); var i = 0; var len = copy.length; var prop; for (; i < len; i++) { prop = copy[i]; ...
javascript
function() { var copy = [ 'year', 'month', 'day', 'hour', 'minute', 'second', 'isDate' ]; var result = Object.create(null); var i = 0; var len = copy.length; var prop; for (; i < len; i++) { prop = copy[i]; ...
[ "function", "(", ")", "{", "var", "copy", "=", "[", "'year'", ",", "'month'", ",", "'day'", ",", "'hour'", ",", "'minute'", ",", "'second'", ",", "'isDate'", "]", ";", "var", "result", "=", "Object", ".", "create", "(", "null", ")", ";", "var", "i"...
Converts time to into Object which can be serialized then re-created using the constructor. @example // toJSON will automatically be called var json = JSON.stringify(mytime); var deserialized = JSON.parse(json); var time = new ICAL.Time(deserialized); @return {Object}
[ "Converts", "time", "to", "into", "Object", "which", "can", "be", "serialized", "then", "re", "-", "created", "using", "the", "constructor", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L5636-L5663
9,384
mozilla-comm/ical.js
build/ical.js
function() { var res = Object.create(null); res.freq = this.freq; if (this.count) { res.count = this.count; } if (this.interval > 1) { res.interval = this.interval; } for (var k in this.parts) { /* istanbul ignore if */ if (!this.parts.hasOwnP...
javascript
function() { var res = Object.create(null); res.freq = this.freq; if (this.count) { res.count = this.count; } if (this.interval > 1) { res.interval = this.interval; } for (var k in this.parts) { /* istanbul ignore if */ if (!this.parts.hasOwnP...
[ "function", "(", ")", "{", "var", "res", "=", "Object", ".", "create", "(", "null", ")", ";", "res", ".", "freq", "=", "this", ".", "freq", ";", "if", "(", "this", ".", "count", ")", "{", "res", ".", "count", "=", "this", ".", "count", ";", "...
The jCal representation of this recurrence type. @return {Object}
[ "The", "jCal", "representation", "of", "this", "recurrence", "type", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L6507-L6539
9,385
mozilla-comm/ical.js
build/ical.js
icalrecur_toString
function icalrecur_toString() { // TODO retain order var str = "FREQ=" + this.freq; if (this.count) { str += ";COUNT=" + this.count; } if (this.interval > 1) { str += ";INTERVAL=" + this.interval; } for (var k in this.parts) { /* istanbul ignore else */ ...
javascript
function icalrecur_toString() { // TODO retain order var str = "FREQ=" + this.freq; if (this.count) { str += ";COUNT=" + this.count; } if (this.interval > 1) { str += ";INTERVAL=" + this.interval; } for (var k in this.parts) { /* istanbul ignore else */ ...
[ "function", "icalrecur_toString", "(", ")", "{", "// TODO retain order", "var", "str", "=", "\"FREQ=\"", "+", "this", ".", "freq", ";", "if", "(", "this", ".", "count", ")", "{", "str", "+=", "\";COUNT=\"", "+", "this", ".", "count", ";", "}", "if", "(...
The string representation of this recurrence rule. @return {String}
[ "The", "string", "representation", "of", "this", "recurrence", "rule", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L6545-L6567
9,386
mozilla-comm/ical.js
build/ical.js
function(options) { this.rule = ICAL.helpers.formatClassType(options.rule, ICAL.Recur); if (!this.rule) { throw new Error('iterator requires a (ICAL.Recur) rule'); } this.dtstart = ICAL.helpers.formatClassType(options.dtstart, ICAL.Time); if (!this.dtstart) { throw new E...
javascript
function(options) { this.rule = ICAL.helpers.formatClassType(options.rule, ICAL.Recur); if (!this.rule) { throw new Error('iterator requires a (ICAL.Recur) rule'); } this.dtstart = ICAL.helpers.formatClassType(options.dtstart, ICAL.Time); if (!this.dtstart) { throw new E...
[ "function", "(", "options", ")", "{", "this", ".", "rule", "=", "ICAL", ".", "helpers", ".", "formatClassType", "(", "options", ".", "rule", ",", "ICAL", ".", "Recur", ")", ";", "if", "(", "!", "this", ".", "rule", ")", "{", "throw", "new", "Error"...
Initialize the recurrence iterator from the passed data object. This method is usually not called directly, you can initialize the iterator through the constructor. @param {Object} options The iterator options @param {ICAL.Recur} options.rule The rule to iterate. @param {ICAL.Time} options.dtstart...
[ "Initialize", "the", "recurrence", "iterator", "from", "the", "passed", "data", "object", ".", "This", "method", "is", "usually", "not", "called", "directly", "you", "can", "initialize", "the", "iterator", "through", "the", "constructor", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L6898-L6944
9,387
mozilla-comm/ical.js
build/ical.js
icalrecur_iterator_next
function icalrecur_iterator_next() { var before = (this.last ? this.last.clone() : null); if ((this.rule.count && this.occurrence_number >= this.rule.count) || (this.rule.until && this.last.compare(this.rule.until) > 0)) { //XXX: right now this is just a flag and has no impact //...
javascript
function icalrecur_iterator_next() { var before = (this.last ? this.last.clone() : null); if ((this.rule.count && this.occurrence_number >= this.rule.count) || (this.rule.until && this.last.compare(this.rule.until) > 0)) { //XXX: right now this is just a flag and has no impact //...
[ "function", "icalrecur_iterator_next", "(", ")", "{", "var", "before", "=", "(", "this", ".", "last", "?", "this", ".", "last", ".", "clone", "(", ")", ":", "null", ")", ";", "if", "(", "(", "this", ".", "rule", ".", "count", "&&", "this", ".", "...
Retrieve the next occurrence from the iterator. @return {ICAL.Time}
[ "Retrieve", "the", "next", "occurrence", "from", "the", "iterator", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L7096-L7163
9,388
mozilla-comm/ical.js
build/ical.js
check_set_position
function check_set_position(aPos) { if (this.has_by_data('BYSETPOS')) { var idx = this.by_data.BYSETPOS.indexOf(aPos); // negative numbers are not false-y return idx !== -1; } return false; }
javascript
function check_set_position(aPos) { if (this.has_by_data('BYSETPOS')) { var idx = this.by_data.BYSETPOS.indexOf(aPos); // negative numbers are not false-y return idx !== -1; } return false; }
[ "function", "check_set_position", "(", "aPos", ")", "{", "if", "(", "this", ".", "has_by_data", "(", "'BYSETPOS'", ")", ")", "{", "var", "idx", "=", "this", ".", "by_data", ".", "BYSETPOS", ".", "indexOf", "(", "aPos", ")", ";", "// negative numbers are no...
Checks if given value is in BYSETPOS. @private @param {Numeric} aPos position to check for. @return {Boolean} false unless BYSETPOS rules exist and the given value is present in rules.
[ "Checks", "if", "given", "value", "is", "in", "BYSETPOS", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L8073-L8080
9,389
mozilla-comm/ical.js
build/ical.js
function() { var result = Object.create(null); result.initialized = this.initialized; result.rule = this.rule.toJSON(); result.dtstart = this.dtstart.toJSON(); result.by_data = this.by_data; result.days = this.days; result.last = this.last.toJSON(); result.by_indices = t...
javascript
function() { var result = Object.create(null); result.initialized = this.initialized; result.rule = this.rule.toJSON(); result.dtstart = this.dtstart.toJSON(); result.by_data = this.by_data; result.days = this.days; result.last = this.last.toJSON(); result.by_indices = t...
[ "function", "(", ")", "{", "var", "result", "=", "Object", ".", "create", "(", "null", ")", ";", "result", ".", "initialized", "=", "this", ".", "initialized", ";", "result", ".", "rule", "=", "this", ".", "rule", ".", "toJSON", "(", ")", ";", "res...
Convert iterator into a serialize-able object. Will preserve current iteration sequence to ensure the seamless continuation of the recurrence rule. @return {Object}
[ "Convert", "iterator", "into", "a", "serialize", "-", "able", "object", ".", "Will", "preserve", "current", "iteration", "sequence", "to", "ensure", "the", "seamless", "continuation", "of", "the", "recurrence", "rule", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L8163-L8176
9,390
mozilla-comm/ical.js
build/ical.js
function() { var iter; var ruleOfDay; var next; var compare; var maxTries = 500; var currentTry = 0; while (true) { if (currentTry++ > maxTries) { throw new Error( 'max tries have occured, rule may be impossible to forfill.' ); ...
javascript
function() { var iter; var ruleOfDay; var next; var compare; var maxTries = 500; var currentTry = 0; while (true) { if (currentTry++ > maxTries) { throw new Error( 'max tries have occured, rule may be impossible to forfill.' ); ...
[ "function", "(", ")", "{", "var", "iter", ";", "var", "ruleOfDay", ";", "var", "next", ";", "var", "compare", ";", "var", "maxTries", "=", "500", ";", "var", "currentTry", "=", "0", ";", "while", "(", "true", ")", "{", "if", "(", "currentTry", "++"...
Retrieve the next occurrence in the series. @return {ICAL.Time}
[ "Retrieve", "the", "next", "occurrence", "in", "the", "series", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L8427-L8494
9,391
mozilla-comm/ical.js
build/ical.js
function() { function toJSON(item) { return item.toJSON(); } var result = Object.create(null); result.ruleIterators = this.ruleIterators.map(toJSON); if (this.ruleDates) { result.ruleDates = this.ruleDates.map(toJSON); } if (this.exDates) { result.exD...
javascript
function() { function toJSON(item) { return item.toJSON(); } var result = Object.create(null); result.ruleIterators = this.ruleIterators.map(toJSON); if (this.ruleDates) { result.ruleDates = this.ruleDates.map(toJSON); } if (this.exDates) { result.exD...
[ "function", "(", ")", "{", "function", "toJSON", "(", "item", ")", "{", "return", "item", ".", "toJSON", "(", ")", ";", "}", "var", "result", "=", "Object", ".", "create", "(", "null", ")", ";", "result", ".", "ruleIterators", "=", "this", ".", "ru...
Converts object into a serialize-able format. This format can be passed back into the expansion to resume iteration. @return {Object}
[ "Converts", "object", "into", "a", "serialize", "-", "able", "format", ".", "This", "format", "can", "be", "passed", "back", "into", "the", "expansion", "to", "resume", "iteration", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L8501-L8524
9,392
mozilla-comm/ical.js
build/ical.js
function(component, propertyName) { function handleProp(prop) { idx = ICAL.helpers.binsearchInsert( result, prop, compareTime ); // ordered insert result.splice(idx, 0, prop); } var result = []; var props = component.getAllPropertie...
javascript
function(component, propertyName) { function handleProp(prop) { idx = ICAL.helpers.binsearchInsert( result, prop, compareTime ); // ordered insert result.splice(idx, 0, prop); } var result = []; var props = component.getAllPropertie...
[ "function", "(", "component", ",", "propertyName", ")", "{", "function", "handleProp", "(", "prop", ")", "{", "idx", "=", "ICAL", ".", "helpers", ".", "binsearchInsert", "(", "result", ",", "prop", ",", "compareTime", ")", ";", "// ordered insert", "result",...
Extract all dates from the properties in the given component. The properties will be filtered by the property name. @private @param {ICAL.Component} component The component to search in @param {String} propertyName The property name to search for @return {ICAL.Time[]} The extracte...
[ "Extract", "all", "dates", "from", "the", "properties", "in", "the", "given", "component", ".", "The", "properties", "will", "be", "filtered", "by", "the", "property", "name", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L8535-L8560
9,393
mozilla-comm/ical.js
build/ical.js
function(component) { this.ruleIterators = []; this.last = this.dtstart.clone(); // to provide api consistency non-recurring // events can also use the iterator though it will // only return a single time. if (!isRecurringComponent(component)) { this.ruleDate = this.last.cl...
javascript
function(component) { this.ruleIterators = []; this.last = this.dtstart.clone(); // to provide api consistency non-recurring // events can also use the iterator though it will // only return a single time. if (!isRecurringComponent(component)) { this.ruleDate = this.last.cl...
[ "function", "(", "component", ")", "{", "this", ".", "ruleIterators", "=", "[", "]", ";", "this", ".", "last", "=", "this", ".", "dtstart", ".", "clone", "(", ")", ";", "// to provide api consistency non-recurring", "// events can also use the iterator though it wil...
Initialize the recurrence expansion. @private @param {ICAL.Component} component The component to initialize from.
[ "Initialize", "the", "recurrence", "expansion", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L8568-L8636
9,394
mozilla-comm/ical.js
build/ical.js
function() { var iters = this.ruleIterators; if (iters.length === 0) { return null; } var len = iters.length; var iter; var iterTime; var iterIdx = 0; var chosenIter; // loop through each iterator for (; iterIdx < len; iterIdx++) { iter = it...
javascript
function() { var iters = this.ruleIterators; if (iters.length === 0) { return null; } var len = iters.length; var iter; var iterTime; var iterIdx = 0; var chosenIter; // loop through each iterator for (; iterIdx < len; iterIdx++) { iter = it...
[ "function", "(", ")", "{", "var", "iters", "=", "this", ".", "ruleIterators", ";", "if", "(", "iters", ".", "length", "===", "0", ")", "{", "return", "null", ";", "}", "var", "len", "=", "iters", ".", "length", ";", "var", "iter", ";", "var", "it...
Find and return the recurrence rule with the most recent event and return it. @private @return {?ICAL.RecurIterator} Found iterator.
[ "Find", "and", "return", "the", "recurrence", "rule", "with", "the", "most", "recent", "event", "and", "return", "it", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L8661-L8701
9,395
mozilla-comm/ical.js
build/ical.js
function(obj) { if (this.isRecurrenceException()) { throw new Error('cannot relate exception to exceptions'); } if (obj instanceof ICAL.Component) { obj = new ICAL.Event(obj); } if (this.strictExceptions && obj.uid !== this.uid) { throw new Error('attempted to rel...
javascript
function(obj) { if (this.isRecurrenceException()) { throw new Error('cannot relate exception to exceptions'); } if (obj instanceof ICAL.Component) { obj = new ICAL.Event(obj); } if (this.strictExceptions && obj.uid !== this.uid) { throw new Error('attempted to rel...
[ "function", "(", "obj", ")", "{", "if", "(", "this", ".", "isRecurrenceException", "(", ")", ")", "{", "throw", "new", "Error", "(", "'cannot relate exception to exceptions'", ")", ";", "}", "if", "(", "obj", "instanceof", "ICAL", ".", "Component", ")", "{...
Relates a given event exception to this object. If the given component does not share the UID of this event it cannot be related and will throw an exception. If this component is an exception it cannot have other exceptions related to it. @param {ICAL.Component|ICAL.Event} obj Component or event
[ "Relates", "a", "given", "event", "exception", "to", "this", "object", ".", "If", "the", "given", "component", "does", "not", "share", "the", "UID", "of", "this", "event", "it", "cannot", "be", "related", "and", "will", "throw", "an", "exception", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L8795-L8831
9,396
mozilla-comm/ical.js
build/ical.js
function(time) { if (!this.rangeExceptions.length) { return null; } var utc = time.toUnixTime(); var idx = ICAL.helpers.binsearchInsert( this.rangeExceptions, [utc], compareRangeException ); idx -= 1; // occurs before if (idx < 0) { ...
javascript
function(time) { if (!this.rangeExceptions.length) { return null; } var utc = time.toUnixTime(); var idx = ICAL.helpers.binsearchInsert( this.rangeExceptions, [utc], compareRangeException ); idx -= 1; // occurs before if (idx < 0) { ...
[ "function", "(", "time", ")", "{", "if", "(", "!", "this", ".", "rangeExceptions", ".", "length", ")", "{", "return", "null", ";", "}", "var", "utc", "=", "time", ".", "toUnixTime", "(", ")", ";", "var", "idx", "=", "ICAL", ".", "helpers", ".", "...
Finds the range exception nearest to the given date. @param {ICAL.Time} time usually an occurrence time of an event @return {?ICAL.Event} the related event/exception or null
[ "Finds", "the", "range", "exception", "nearest", "to", "the", "given", "date", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L8854-L8881
9,397
mozilla-comm/ical.js
build/ical.js
function() { var rules = this.component.getAllProperties('rrule'); var i = 0; var len = rules.length; var result = Object.create(null); for (; i < len; i++) { var value = rules[i].getFirstValue(); result[value.freq] = true; } return result; }
javascript
function() { var rules = this.component.getAllProperties('rrule'); var i = 0; var len = rules.length; var result = Object.create(null); for (; i < len; i++) { var value = rules[i].getFirstValue(); result[value.freq] = true; } return result; }
[ "function", "(", ")", "{", "var", "rules", "=", "this", ".", "component", ".", "getAllProperties", "(", "'rrule'", ")", ";", "var", "i", "=", "0", ";", "var", "len", "=", "rules", ".", "length", ";", "var", "result", "=", "Object", ".", "create", "...
Returns the types of recurrences this event may have. Returned as an object with the following possible keys: - YEARLY - MONTHLY - WEEKLY - DAILY - MINUTELY - SECONDLY @return {Object.<ICAL.Recur.frequencyValues, Boolean>} Object of recurrence flags
[ "Returns", "the", "types", "of", "recurrences", "this", "event", "may", "have", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L9025-L9037
9,398
mozilla-comm/ical.js
build/ical.js
function(ical) { //TODO: this is sync now in the future we will have a incremental parser. if (typeof(ical) === 'string') { ical = ICAL.parse(ical); } if (!(ical instanceof ICAL.Component)) { ical = new ICAL.Component(ical); } var components = ical.getAllSubcomponen...
javascript
function(ical) { //TODO: this is sync now in the future we will have a incremental parser. if (typeof(ical) === 'string') { ical = ICAL.parse(ical); } if (!(ical instanceof ICAL.Component)) { ical = new ICAL.Component(ical); } var components = ical.getAllSubcomponen...
[ "function", "(", "ical", ")", "{", "//TODO: this is sync now in the future we will have a incremental parser.", "if", "(", "typeof", "(", "ical", ")", "===", "'string'", ")", "{", "ical", "=", "ICAL", ".", "parse", "(", "ical", ")", ";", "}", "if", "(", "!", ...
Process a string or parse ical object. This function itself will return nothing but will start the parsing process. Events must be registered prior to calling this method. @param {ICAL.Component|String|Object} ical The component to process, either in its final form, as a jCal Object, or string representation
[ "Process", "a", "string", "or", "parse", "ical", "object", ".", "This", "function", "itself", "will", "return", "nothing", "but", "will", "start", "the", "parsing", "process", "." ]
2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d
https://github.com/mozilla-comm/ical.js/blob/2d08c79b4e77bfe4dbf1c9ac0b463580f0605a7d/build/ical.js#L9376-L9419
9,399
serverless/serverless-kubeless
lib/deploy.js
deployMQTrigger
function deployMQTrigger(mqType, name, namespace, topic, options) { const opts = _.defaults({}, options, { log: console.log, }); const trigger = { apiVersion: 'kubeless.io/v1beta1', kind: `${mqType}Trigger`, metadata: { name: _.kebabCase(`${name}-${topic}`), namespace, labels: { ...
javascript
function deployMQTrigger(mqType, name, namespace, topic, options) { const opts = _.defaults({}, options, { log: console.log, }); const trigger = { apiVersion: 'kubeless.io/v1beta1', kind: `${mqType}Trigger`, metadata: { name: _.kebabCase(`${name}-${topic}`), namespace, labels: { ...
[ "function", "deployMQTrigger", "(", "mqType", ",", "name", ",", "namespace", ",", "topic", ",", "options", ")", "{", "const", "opts", "=", "_", ".", "defaults", "(", "{", "}", ",", "options", ",", "{", "log", ":", "console", ".", "log", ",", "}", "...
Handling Kafka and NATS message queue trigger @param {MQTypes} mqType @param {string} name @param {string} namespace @param {string} topic @param {object} options
[ "Handling", "Kafka", "and", "NATS", "message", "queue", "trigger" ]
b85b77f584139a8d53f06346b3036f8b3017c9f9
https://github.com/serverless/serverless-kubeless/blob/b85b77f584139a8d53f06346b3036f8b3017c9f9/lib/deploy.js#L347-L386