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
5,500
stylelint/stylelint
lib/augmentConfig.js
augmentConfigExtended
function augmentConfigExtended( stylelint /*: stylelint$internalApi*/, cosmiconfigResultArg /*: ?{ config: stylelint$config, filepath: string, }*/ ) /*: Promise<?{ config: stylelint$config, filepath: string }>*/ { const cosmiconfigResult = cosmiconfigResultArg; // Lock in for Flow if (!cosmiconfig...
javascript
function augmentConfigExtended( stylelint /*: stylelint$internalApi*/, cosmiconfigResultArg /*: ?{ config: stylelint$config, filepath: string, }*/ ) /*: Promise<?{ config: stylelint$config, filepath: string }>*/ { const cosmiconfigResult = cosmiconfigResultArg; // Lock in for Flow if (!cosmiconfig...
[ "function", "augmentConfigExtended", "(", "stylelint", "/*: stylelint$internalApi*/", ",", "cosmiconfigResultArg", "/*: ?{\n config: stylelint$config,\n filepath: string,\n }*/", ")", "/*: Promise<?{ config: stylelint$config, filepath: string }>*/", "{", "const", "cosmiconfigResult...
Extended configs need to be run through augmentConfigBasic but do not need the full treatment. Things like pluginFunctions will be resolved and added by the parent config.
[ "Extended", "configs", "need", "to", "be", "run", "through", "augmentConfigBasic", "but", "do", "not", "need", "the", "full", "treatment", ".", "Things", "like", "pluginFunctions", "will", "be", "resolved", "and", "added", "by", "the", "parent", "config", "." ...
b35c55f6144d0cb03924498f275cc39c39de3816
https://github.com/stylelint/stylelint/blob/b35c55f6144d0cb03924498f275cc39c39de3816/lib/augmentConfig.js#L39-L61
5,501
stylelint/stylelint
lib/augmentConfig.js
absolutizeProcessors
function absolutizeProcessors( processors /*: stylelint$configProcessors*/, configDir /*: string*/ ) /*: stylelint$configProcessors*/ { const normalizedProcessors = Array.isArray(processors) ? processors : [processors]; return normalizedProcessors.map(item => { if (typeof item === "string") { ...
javascript
function absolutizeProcessors( processors /*: stylelint$configProcessors*/, configDir /*: string*/ ) /*: stylelint$configProcessors*/ { const normalizedProcessors = Array.isArray(processors) ? processors : [processors]; return normalizedProcessors.map(item => { if (typeof item === "string") { ...
[ "function", "absolutizeProcessors", "(", "processors", "/*: stylelint$configProcessors*/", ",", "configDir", "/*: string*/", ")", "/*: stylelint$configProcessors*/", "{", "const", "normalizedProcessors", "=", "Array", ".", "isArray", "(", "processors", ")", "?", "processors...
Processors are absolutized in their own way because they can be and return a string or an array
[ "Processors", "are", "absolutized", "in", "their", "own", "way", "because", "they", "can", "be", "and", "return", "a", "string", "or", "an", "array" ]
b35c55f6144d0cb03924498f275cc39c39de3816
https://github.com/stylelint/stylelint/blob/b35c55f6144d0cb03924498f275cc39c39de3816/lib/augmentConfig.js#L136-L151
5,502
stylelint/stylelint
lib/utils/addEmptyLineAfter.js
addEmptyLineAfter
function addEmptyLineAfter( node /*: postcss$node*/, newline /*: '\n' | '\r\n'*/ ) /*: postcss$node*/ { const after = _.last(node.raws.after.split(";")); if (!/\r?\n/.test(after)) { node.raws.after = node.raws.after + _.repeat(newline, 2); } else { node.raws.after = node.raws.after.replace(/(\r?\n)/,...
javascript
function addEmptyLineAfter( node /*: postcss$node*/, newline /*: '\n' | '\r\n'*/ ) /*: postcss$node*/ { const after = _.last(node.raws.after.split(";")); if (!/\r?\n/.test(after)) { node.raws.after = node.raws.after + _.repeat(newline, 2); } else { node.raws.after = node.raws.after.replace(/(\r?\n)/,...
[ "function", "addEmptyLineAfter", "(", "node", "/*: postcss$node*/", ",", "newline", "/*: '\\n' | '\\r\\n'*/", ")", "/*: postcss$node*/", "{", "const", "after", "=", "_", ".", "last", "(", "node", ".", "raws", ".", "after", ".", "split", "(", "\";\"", ")", ")",...
Add an empty line after a node. Mutates the node.
[ "Add", "an", "empty", "line", "after", "a", "node", ".", "Mutates", "the", "node", "." ]
b35c55f6144d0cb03924498f275cc39c39de3816
https://github.com/stylelint/stylelint/blob/b35c55f6144d0cb03924498f275cc39c39de3816/lib/utils/addEmptyLineAfter.js#L7-L20
5,503
stylelint/stylelint
lib/utils/addEmptyLineBefore.js
addEmptyLineBefore
function addEmptyLineBefore( node /*: postcss$node*/, newline /*: '\n' | '\r\n'*/ ) /*: postcss$node*/ { if (!/\r?\n/.test(node.raws.before)) { node.raws.before = _.repeat(newline, 2) + node.raws.before; } else { node.raws.before = node.raws.before.replace(/(\r?\n)/, `${newline}$1`); } return node;...
javascript
function addEmptyLineBefore( node /*: postcss$node*/, newline /*: '\n' | '\r\n'*/ ) /*: postcss$node*/ { if (!/\r?\n/.test(node.raws.before)) { node.raws.before = _.repeat(newline, 2) + node.raws.before; } else { node.raws.before = node.raws.before.replace(/(\r?\n)/, `${newline}$1`); } return node;...
[ "function", "addEmptyLineBefore", "(", "node", "/*: postcss$node*/", ",", "newline", "/*: '\\n' | '\\r\\n'*/", ")", "/*: postcss$node*/", "{", "if", "(", "!", "/", "\\r?\\n", "/", ".", "test", "(", "node", ".", "raws", ".", "before", ")", ")", "{", "node", "...
Add an empty line before a node. Mutates the node.
[ "Add", "an", "empty", "line", "before", "a", "node", ".", "Mutates", "the", "node", "." ]
b35c55f6144d0cb03924498f275cc39c39de3816
https://github.com/stylelint/stylelint/blob/b35c55f6144d0cb03924498f275cc39c39de3816/lib/utils/addEmptyLineBefore.js#L7-L18
5,504
lambci/docker-lambda
nodejs6.10/run/awslambda-mock.js
function(invokeId, errType, resultStr) { if (!invoked) return var diffMs = hrTimeMs(process.hrtime(start)) var billedMs = Math.min(100 * (Math.floor(diffMs / 100) + 1), TIMEOUT * 1000) systemLog('END RequestId: ' + invokeId) systemLog([ 'REPORT RequestId: ' + invokeId, 'Duration: ' + dif...
javascript
function(invokeId, errType, resultStr) { if (!invoked) return var diffMs = hrTimeMs(process.hrtime(start)) var billedMs = Math.min(100 * (Math.floor(diffMs / 100) + 1), TIMEOUT * 1000) systemLog('END RequestId: ' + invokeId) systemLog([ 'REPORT RequestId: ' + invokeId, 'Duration: ' + dif...
[ "function", "(", "invokeId", ",", "errType", ",", "resultStr", ")", "{", "if", "(", "!", "invoked", ")", "return", "var", "diffMs", "=", "hrTimeMs", "(", "process", ".", "hrtime", "(", "start", ")", ")", "var", "billedMs", "=", "Math", ".", "min", "(...
eslint-disable-line no-unused-vars
[ "eslint", "-", "disable", "-", "line", "no", "-", "unused", "-", "vars" ]
d5a7c1d5cb8615b98cfab8e802140182c897b23a
https://github.com/lambci/docker-lambda/blob/d5a7c1d5cb8615b98cfab8e802140182c897b23a/nodejs6.10/run/awslambda-mock.js#L88-L108
5,505
lambci/docker-lambda
nodejs6.10/run/awslambda-mock.js
uuid
function uuid() { return crypto.randomBytes(4).toString('hex') + '-' + crypto.randomBytes(2).toString('hex') + '-' + crypto.randomBytes(2).toString('hex').replace(/^./, '1') + '-' + crypto.randomBytes(2).toString('hex') + '-' + crypto.randomBytes(6).toString('hex') }
javascript
function uuid() { return crypto.randomBytes(4).toString('hex') + '-' + crypto.randomBytes(2).toString('hex') + '-' + crypto.randomBytes(2).toString('hex').replace(/^./, '1') + '-' + crypto.randomBytes(2).toString('hex') + '-' + crypto.randomBytes(6).toString('hex') }
[ "function", "uuid", "(", ")", "{", "return", "crypto", ".", "randomBytes", "(", "4", ")", ".", "toString", "(", "'hex'", ")", "+", "'-'", "+", "crypto", ".", "randomBytes", "(", "2", ")", ".", "toString", "(", "'hex'", ")", "+", "'-'", "+", "crypto...
Approximates the look of a v1 UUID
[ "Approximates", "the", "look", "of", "a", "v1", "UUID" ]
d5a7c1d5cb8615b98cfab8e802140182c897b23a
https://github.com/lambci/docker-lambda/blob/d5a7c1d5cb8615b98cfab8e802140182c897b23a/nodejs6.10/run/awslambda-mock.js#L143-L149
5,506
priologic/easyrtc
lib/easyrtc_public_obj.js
function(roomName, appRoomObj, callback) { // Join room. Creates a default connection room object e.app[appName].connection[easyrtcid].room[roomName] = { apiField: {}, enteredOn: Date.now(), gotListOn: Date.now(), ...
javascript
function(roomName, appRoomObj, callback) { // Join room. Creates a default connection room object e.app[appName].connection[easyrtcid].room[roomName] = { apiField: {}, enteredOn: Date.now(), gotListOn: Date.now(), ...
[ "function", "(", "roomName", ",", "appRoomObj", ",", "callback", ")", "{", "// Join room. Creates a default connection room object\r", "e", ".", "app", "[", "appName", "]", ".", "connection", "[", "easyrtcid", "]", ".", "room", "[", "roomName", "]", "=", "{", ...
Local private function to create the default connection-room object in the private variable
[ "Local", "private", "function", "to", "create", "the", "default", "connection", "-", "room", "object", "in", "the", "private", "variable" ]
5ea69776f319fab15a784f94db91a2c1f5154ef5
https://github.com/priologic/easyrtc/blob/5ea69776f319fab15a784f94db91a2c1f5154ef5/lib/easyrtc_public_obj.js#L2362-L2381
5,507
priologic/easyrtc
lib/easyrtc_default_event_listeners.js
function (err) { if (err) { try{ pub.util.sendSocketCallbackMsg(easyrtcid, socketCallback, pub.util.getErrorMsg("LOGIN_GEN_FAIL"), appObj); socket.disconnect(); pub.util.logError("["+easyrtcid+"] General authentication error. Socket disconnected.", err...
javascript
function (err) { if (err) { try{ pub.util.sendSocketCallbackMsg(easyrtcid, socketCallback, pub.util.getErrorMsg("LOGIN_GEN_FAIL"), appObj); socket.disconnect(); pub.util.logError("["+easyrtcid+"] General authentication error. Socket disconnected.", err...
[ "function", "(", "err", ")", "{", "if", "(", "err", ")", "{", "try", "{", "pub", ".", "util", ".", "sendSocketCallbackMsg", "(", "easyrtcid", ",", "socketCallback", ",", "pub", ".", "util", ".", "getErrorMsg", "(", "\"LOGIN_GEN_FAIL\"", ")", ",", "appObj...
This function is called upon completion of the async waterfall, or upon an error being thrown.
[ "This", "function", "is", "called", "upon", "completion", "of", "the", "async", "waterfall", "or", "upon", "an", "error", "being", "thrown", "." ]
5ea69776f319fab15a784f94db91a2c1f5154ef5
https://github.com/priologic/easyrtc/blob/5ea69776f319fab15a784f94db91a2c1f5154ef5/lib/easyrtc_default_event_listeners.js#L491-L501
5,508
priologic/easyrtc
demos/js/demo_ice_filter.js
iceCandidateFilter
function iceCandidateFilter( iceCandidate, fromPeer) { var sdp = iceCandidate.candidate; if( sdp.indexOf("typ relay") > 0) { // is turn candidate if( document.getElementById("allowTurn").checked ) { return iceCandidate; } else { return null; } } else if( sdp...
javascript
function iceCandidateFilter( iceCandidate, fromPeer) { var sdp = iceCandidate.candidate; if( sdp.indexOf("typ relay") > 0) { // is turn candidate if( document.getElementById("allowTurn").checked ) { return iceCandidate; } else { return null; } } else if( sdp...
[ "function", "iceCandidateFilter", "(", "iceCandidate", ",", "fromPeer", ")", "{", "var", "sdp", "=", "iceCandidate", ".", "candidate", ";", "if", "(", "sdp", ".", "indexOf", "(", "\"typ relay\"", ")", ">", "0", ")", "{", "// is turn candidate", "if", "(", ...
filter ice candidates according to the ice candidates checkbox.
[ "filter", "ice", "candidates", "according", "to", "the", "ice", "candidates", "checkbox", "." ]
5ea69776f319fab15a784f94db91a2c1f5154ef5
https://github.com/priologic/easyrtc/blob/5ea69776f319fab15a784f94db91a2c1f5154ef5/demos/js/demo_ice_filter.js#L6-L35
5,509
priologic/easyrtc
demos/js/demo_multiparty.js
setThumbSizeAspect
function setThumbSizeAspect(percentSize, percentLeft, percentTop, parentw, parenth, aspect) { var width, height; if( parentw < parenth*aspectRatio){ width = parentw * percentSize; height = width/aspect; } else { height = parenth * percentSize; width = height*asp...
javascript
function setThumbSizeAspect(percentSize, percentLeft, percentTop, parentw, parenth, aspect) { var width, height; if( parentw < parenth*aspectRatio){ width = parentw * percentSize; height = width/aspect; } else { height = parenth * percentSize; width = height*asp...
[ "function", "setThumbSizeAspect", "(", "percentSize", ",", "percentLeft", ",", "percentTop", ",", "parentw", ",", "parenth", ",", "aspect", ")", "{", "var", "width", ",", "height", ";", "if", "(", "parentw", "<", "parenth", "*", "aspectRatio", ")", "{", "w...
a negative percentLeft is interpreted as setting the right edge of the object that distance from the right edge of the parent. Similar for percentTop.
[ "a", "negative", "percentLeft", "is", "interpreted", "as", "setting", "the", "right", "edge", "of", "the", "object", "that", "distance", "from", "the", "right", "edge", "of", "the", "parent", ".", "Similar", "for", "percentTop", "." ]
5ea69776f319fab15a784f94db91a2c1f5154ef5
https://github.com/priologic/easyrtc/blob/5ea69776f319fab15a784f94db91a2c1f5154ef5/demos/js/demo_multiparty.js#L70-L103
5,510
priologic/easyrtc
demos/js/demo_multiparty.js
establishConnection
function establishConnection(position) { function callSuccess() { connectCount++; if( connectCount < maxCALLERS && position > 0) { establishConnection(position-1); } } function callFailure(errorCode, errorText) { easyrtc.sho...
javascript
function establishConnection(position) { function callSuccess() { connectCount++; if( connectCount < maxCALLERS && position > 0) { establishConnection(position-1); } } function callFailure(errorCode, errorText) { easyrtc.sho...
[ "function", "establishConnection", "(", "position", ")", "{", "function", "callSuccess", "(", ")", "{", "connectCount", "++", ";", "if", "(", "connectCount", "<", "maxCALLERS", "&&", "position", ">", "0", ")", "{", "establishConnection", "(", "position", "-", ...
Connect in reverse order. Latter arriving people are more likely to have empty slots.
[ "Connect", "in", "reverse", "order", ".", "Latter", "arriving", "people", "are", "more", "likely", "to", "have", "empty", "slots", "." ]
5ea69776f319fab15a784f94db91a2c1f5154ef5
https://github.com/priologic/easyrtc/blob/5ea69776f319fab15a784f94db91a2c1f5154ef5/demos/js/demo_multiparty.js#L541-L556
5,511
priologic/easyrtc
api/easyrtc.js
getCommonCapabilities
function getCommonCapabilities(localCapabilities, remoteCapabilities) { var commonCapabilities = { codecs: [], headerExtensions: [], fecMechanisms: [] }; var findCodecByPayloadType = function(pt, codecs) { pt = parseInt(pt, 10); for (var i = 0; i < codecs.length; i++) { if (codecs[i].pa...
javascript
function getCommonCapabilities(localCapabilities, remoteCapabilities) { var commonCapabilities = { codecs: [], headerExtensions: [], fecMechanisms: [] }; var findCodecByPayloadType = function(pt, codecs) { pt = parseInt(pt, 10); for (var i = 0; i < codecs.length; i++) { if (codecs[i].pa...
[ "function", "getCommonCapabilities", "(", "localCapabilities", ",", "remoteCapabilities", ")", "{", "var", "commonCapabilities", "=", "{", "codecs", ":", "[", "]", ",", "headerExtensions", ":", "[", "]", ",", "fecMechanisms", ":", "[", "]", "}", ";", "var", ...
Determines the intersection of local and remote capabilities.
[ "Determines", "the", "intersection", "of", "local", "and", "remote", "capabilities", "." ]
5ea69776f319fab15a784f94db91a2c1f5154ef5
https://github.com/priologic/easyrtc/blob/5ea69776f319fab15a784f94db91a2c1f5154ef5/api/easyrtc.js#L182-L257
5,512
priologic/easyrtc
api/easyrtc.js
isActionAllowedInSignalingState
function isActionAllowedInSignalingState(action, type, signalingState) { return { offer: { setLocalDescription: ['stable', 'have-local-offer'], setRemoteDescription: ['stable', 'have-remote-offer'] }, answer: { setLocalDescription: ['have-remote-offer', 'have-local-pranswer'], setR...
javascript
function isActionAllowedInSignalingState(action, type, signalingState) { return { offer: { setLocalDescription: ['stable', 'have-local-offer'], setRemoteDescription: ['stable', 'have-remote-offer'] }, answer: { setLocalDescription: ['have-remote-offer', 'have-local-pranswer'], setR...
[ "function", "isActionAllowedInSignalingState", "(", "action", ",", "type", ",", "signalingState", ")", "{", "return", "{", "offer", ":", "{", "setLocalDescription", ":", "[", "'stable'", ",", "'have-local-offer'", "]", ",", "setRemoteDescription", ":", "[", "'stab...
is action=setLocalDescription with type allowed in signalingState
[ "is", "action", "=", "setLocalDescription", "with", "type", "allowed", "in", "signalingState" ]
5ea69776f319fab15a784f94db91a2c1f5154ef5
https://github.com/priologic/easyrtc/blob/5ea69776f319fab15a784f94db91a2c1f5154ef5/api/easyrtc.js#L260-L271
5,513
priologic/easyrtc
api/easyrtc.js
function(window) { var URL = window && window.URL; if (!(typeof window === 'object' && window.HTMLMediaElement && 'srcObject' in window.HTMLMediaElement.prototype && URL.createObjectURL && URL.revokeObjectURL)) { // Only shim CreateObjectURL using srcObject if srcObject exists. re...
javascript
function(window) { var URL = window && window.URL; if (!(typeof window === 'object' && window.HTMLMediaElement && 'srcObject' in window.HTMLMediaElement.prototype && URL.createObjectURL && URL.revokeObjectURL)) { // Only shim CreateObjectURL using srcObject if srcObject exists. re...
[ "function", "(", "window", ")", "{", "var", "URL", "=", "window", "&&", "window", ".", "URL", ";", "if", "(", "!", "(", "typeof", "window", "===", "'object'", "&&", "window", ".", "HTMLMediaElement", "&&", "'srcObject'", "in", "window", ".", "HTMLMediaEl...
shimCreateObjectURL must be called before shimSourceObject to avoid loop.
[ "shimCreateObjectURL", "must", "be", "called", "before", "shimSourceObject", "to", "avoid", "loop", "." ]
5ea69776f319fab15a784f94db91a2c1f5154ef5
https://github.com/priologic/easyrtc/blob/5ea69776f319fab15a784f94db91a2c1f5154ef5/api/easyrtc.js#L4038-L4087
5,514
priologic/easyrtc
api/easyrtc.js
function(constraints, onSuccess, onError) { var constraintsToFF37_ = function(c) { if (typeof c !== 'object' || c.require) { return c; } var require = []; Object.keys(c).forEach(function(key) { if (key === 'require' || key === 'advanced' || key === 'mediaSource') { ...
javascript
function(constraints, onSuccess, onError) { var constraintsToFF37_ = function(c) { if (typeof c !== 'object' || c.require) { return c; } var require = []; Object.keys(c).forEach(function(key) { if (key === 'require' || key === 'advanced' || key === 'mediaSource') { ...
[ "function", "(", "constraints", ",", "onSuccess", ",", "onError", ")", "{", "var", "constraintsToFF37_", "=", "function", "(", "c", ")", "{", "if", "(", "typeof", "c", "!==", "'object'", "||", "c", ".", "require", ")", "{", "return", "c", ";", "}", "...
getUserMedia constraints shim.
[ "getUserMedia", "constraints", "shim", "." ]
5ea69776f319fab15a784f94db91a2c1f5154ef5
https://github.com/priologic/easyrtc/blob/5ea69776f319fab15a784f94db91a2c1f5154ef5/api/easyrtc.js#L4791-L4849
5,515
priologic/easyrtc
api/easyrtc.js
extractVersion
function extractVersion(uastring, expr, pos) { var match = uastring.match(expr); return match && match.length >= pos && parseInt(match[pos], 10); }
javascript
function extractVersion(uastring, expr, pos) { var match = uastring.match(expr); return match && match.length >= pos && parseInt(match[pos], 10); }
[ "function", "extractVersion", "(", "uastring", ",", "expr", ",", "pos", ")", "{", "var", "match", "=", "uastring", ".", "match", "(", "expr", ")", ";", "return", "match", "&&", "match", ".", "length", ">=", "pos", "&&", "parseInt", "(", "match", "[", ...
Extract browser version out of the provided user agent string. @param {!string} uastring userAgent string. @param {!string} expr Regular expression used as match criteria. @param {!number} pos position in the version string to be returned. @return {!number} browser version.
[ "Extract", "browser", "version", "out", "of", "the", "provided", "user", "agent", "string", "." ]
5ea69776f319fab15a784f94db91a2c1f5154ef5
https://github.com/priologic/easyrtc/blob/5ea69776f319fab15a784f94db91a2c1f5154ef5/api/easyrtc.js#L5300-L5303
5,516
priologic/easyrtc
api/easyrtc.js
function(window) { var navigator = window && window.navigator; // Returned result object. var result = {}; result.browser = null; result.version = null; // Fail early if it's not a browser if (typeof window === 'undefined' || !window.navigator) { result.browser = 'Not a browser.'; ...
javascript
function(window) { var navigator = window && window.navigator; // Returned result object. var result = {}; result.browser = null; result.version = null; // Fail early if it's not a browser if (typeof window === 'undefined' || !window.navigator) { result.browser = 'Not a browser.'; ...
[ "function", "(", "window", ")", "{", "var", "navigator", "=", "window", "&&", "window", ".", "navigator", ";", "// Returned result object.", "var", "result", "=", "{", "}", ";", "result", ".", "browser", "=", "null", ";", "result", ".", "version", "=", "...
Browser detector. @return {object} result containing browser and version properties.
[ "Browser", "detector", "." ]
5ea69776f319fab15a784f94db91a2c1f5154ef5
https://github.com/priologic/easyrtc/blob/5ea69776f319fab15a784f94db91a2c1f5154ef5/api/easyrtc.js#L5417-L5457
5,517
priologic/easyrtc
api/easyrtc.js
addStreamToPeerConnection
function addStreamToPeerConnection(stream, peerConnection) { if( peerConnection.addStream ) { var existingStreams = peerConnection.getLocalStreams(); if (existingStreams.indexOf(stream) === -1) { peerConnection.addStream(stream); } } else { v...
javascript
function addStreamToPeerConnection(stream, peerConnection) { if( peerConnection.addStream ) { var existingStreams = peerConnection.getLocalStreams(); if (existingStreams.indexOf(stream) === -1) { peerConnection.addStream(stream); } } else { v...
[ "function", "addStreamToPeerConnection", "(", "stream", ",", "peerConnection", ")", "{", "if", "(", "peerConnection", ".", "addStream", ")", "{", "var", "existingStreams", "=", "peerConnection", ".", "getLocalStreams", "(", ")", ";", "if", "(", "existingStreams", ...
this private method handles adding a stream to a peer connection. chrome only supports adding streams, safari only supports adding tracks.
[ "this", "private", "method", "handles", "adding", "a", "stream", "to", "a", "peer", "connection", ".", "chrome", "only", "supports", "adding", "streams", "safari", "only", "supports", "adding", "tracks", "." ]
5ea69776f319fab15a784f94db91a2c1f5154ef5
https://github.com/priologic/easyrtc/blob/5ea69776f319fab15a784f94db91a2c1f5154ef5/api/easyrtc.js#L5731-L5754
5,518
priologic/easyrtc
api/easyrtc.js
isSocketConnected
function isSocketConnected(socket) { return socket && ( (socket.socket && socket.socket.connected) || socket.connected ); }
javascript
function isSocketConnected(socket) { return socket && ( (socket.socket && socket.socket.connected) || socket.connected ); }
[ "function", "isSocketConnected", "(", "socket", ")", "{", "return", "socket", "&&", "(", "(", "socket", ".", "socket", "&&", "socket", ".", "socket", ".", "connected", ")", "||", "socket", ".", "connected", ")", ";", "}" ]
This function checks if a socket is actually connected. @private @param {Object} socket a socket.io socket. @return true if the socket exists and is connected, false otherwise.
[ "This", "function", "checks", "if", "a", "socket", "is", "actually", "connected", "." ]
5ea69776f319fab15a784f94db91a2c1f5154ef5
https://github.com/priologic/easyrtc/blob/5ea69776f319fab15a784f94db91a2c1f5154ef5/api/easyrtc.js#L5804-L5808
5,519
priologic/easyrtc
api/easyrtc.js
event
function event(eventName, callingFunction) { if (typeof eventName !== 'string') { self.showError(self.errCodes.DEVELOPER_ERR, callingFunction + " called without a string as the first argument"); throw "developer error"; } if (!allowedEvents[eventName]) { self....
javascript
function event(eventName, callingFunction) { if (typeof eventName !== 'string') { self.showError(self.errCodes.DEVELOPER_ERR, callingFunction + " called without a string as the first argument"); throw "developer error"; } if (!allowedEvents[eventName]) { self....
[ "function", "event", "(", "eventName", ",", "callingFunction", ")", "{", "if", "(", "typeof", "eventName", "!==", "'string'", ")", "{", "self", ".", "showError", "(", "self", ".", "errCodes", ".", "DEVELOPER_ERR", ",", "callingFunction", "+", "\" called withou...
This function checks if an attempt was made to add an event listener or or emit an unlisted event, since such is typically a typo. @private @param {String} eventName @param {String} callingFunction the name of the calling function.
[ "This", "function", "checks", "if", "an", "attempt", "was", "made", "to", "add", "an", "event", "listener", "or", "or", "emit", "an", "unlisted", "event", "since", "such", "is", "typically", "a", "typo", "." ]
5ea69776f319fab15a784f94db91a2c1f5154ef5
https://github.com/priologic/easyrtc/blob/5ea69776f319fab15a784f94db91a2c1f5154ef5/api/easyrtc.js#L5857-L5866
5,520
priologic/easyrtc
api/easyrtc.js
disconnectBody
function disconnectBody() { var key; self.loggingOut = true; offersPending = {}; acceptancePending = {}; self.disconnecting = true; closedChannel = self.webSocket; if( stillAliveTimer ) { clearTimeout(stillAliveTimer); stillAliveTimer = null...
javascript
function disconnectBody() { var key; self.loggingOut = true; offersPending = {}; acceptancePending = {}; self.disconnecting = true; closedChannel = self.webSocket; if( stillAliveTimer ) { clearTimeout(stillAliveTimer); stillAliveTimer = null...
[ "function", "disconnectBody", "(", ")", "{", "var", "key", ";", "self", ".", "loggingOut", "=", "true", ";", "offersPending", "=", "{", "}", ";", "acceptancePending", "=", "{", "}", ";", "self", ".", "disconnecting", "=", "true", ";", "closedChannel", "=...
easyrtc.disconnect performs a clean disconnection of the client from the server.
[ "easyrtc", ".", "disconnect", "performs", "a", "clean", "disconnection", "of", "the", "client", "from", "the", "server", "." ]
5ea69776f319fab15a784f94db91a2c1f5154ef5
https://github.com/priologic/easyrtc/blob/5ea69776f319fab15a784f94db91a2c1f5154ef5/api/easyrtc.js#L8392-L8427
5,521
priologic/easyrtc
api/easyrtc.js
function() { var alteredData = findDeltas(oldConfig, newConfig); // // send all the configuration information that changes during the session // if (alteredData) { logDebug("cfg=" + JSON.stringify(alteredData.added)); if (self....
javascript
function() { var alteredData = findDeltas(oldConfig, newConfig); // // send all the configuration information that changes during the session // if (alteredData) { logDebug("cfg=" + JSON.stringify(alteredData.added)); if (self....
[ "function", "(", ")", "{", "var", "alteredData", "=", "findDeltas", "(", "oldConfig", ",", "newConfig", ")", ";", "//", "// send all the configuration information that changes during the session", "//", "if", "(", "alteredData", ")", "{", "logDebug", "(", "\"cfg=\"", ...
we need to give the getStats calls a chance to fish out the data. The longest I've seen it take is 5 milliseconds so 100 should be overkill.
[ "we", "need", "to", "give", "the", "getStats", "calls", "a", "chance", "to", "fish", "out", "the", "data", ".", "The", "longest", "I", "ve", "seen", "it", "take", "is", "5", "milliseconds", "so", "100", "should", "be", "overkill", "." ]
5ea69776f319fab15a784f94db91a2c1f5154ef5
https://github.com/priologic/easyrtc/blob/5ea69776f319fab15a784f94db91a2c1f5154ef5/api/easyrtc.js#L8993-L9006
5,522
priologic/easyrtc
api/easyrtc.js
checkIceGatheringState
function checkIceGatheringState(otherPeer) { console.log("entered checkIceGatheringState"); if( peerConns[otherPeer] && peerConns[otherPeer].pc && peerConns[otherPeer].pc.iceGatheringState ) { if( peerConns[otherPeer].pc.iceGatheringState === "complete" ) { self.sendPeerMessage...
javascript
function checkIceGatheringState(otherPeer) { console.log("entered checkIceGatheringState"); if( peerConns[otherPeer] && peerConns[otherPeer].pc && peerConns[otherPeer].pc.iceGatheringState ) { if( peerConns[otherPeer].pc.iceGatheringState === "complete" ) { self.sendPeerMessage...
[ "function", "checkIceGatheringState", "(", "otherPeer", ")", "{", "console", ".", "log", "(", "\"entered checkIceGatheringState\"", ")", ";", "if", "(", "peerConns", "[", "otherPeer", "]", "&&", "peerConns", "[", "otherPeer", "]", ".", "pc", "&&", "peerConns", ...
this is a support function for halfTrickIce support. it sends a message to the peer when ice collection has finished on this side. it is only invoked for peers that have sent us a supportHalfTrickIce message.
[ "this", "is", "a", "support", "function", "for", "halfTrickIce", "support", ".", "it", "sends", "a", "message", "to", "the", "peer", "when", "ice", "collection", "has", "finished", "on", "this", "side", ".", "it", "is", "only", "invoked", "for", "peers", ...
5ea69776f319fab15a784f94db91a2c1f5154ef5
https://github.com/priologic/easyrtc/blob/5ea69776f319fab15a784f94db91a2c1f5154ef5/api/easyrtc.js#L11194-L11211
5,523
priologic/easyrtc
api/easyrtc.js
validateVideoIds
function validateVideoIds(monitorVideoId, videoIds) { var i; // verify that video ids were not typos. if (monitorVideoId && !document.getElementById(monitorVideoId)) { easyrtc.showError(easyrtc.errCodes.DEVELOPER_ERR, "The monitor video id passed to easyApp was bad, s...
javascript
function validateVideoIds(monitorVideoId, videoIds) { var i; // verify that video ids were not typos. if (monitorVideoId && !document.getElementById(monitorVideoId)) { easyrtc.showError(easyrtc.errCodes.DEVELOPER_ERR, "The monitor video id passed to easyApp was bad, s...
[ "function", "validateVideoIds", "(", "monitorVideoId", ",", "videoIds", ")", "{", "var", "i", ";", "// verify that video ids were not typos.", "if", "(", "monitorVideoId", "&&", "!", "document", ".", "getElementById", "(", "monitorVideoId", ")", ")", "{", "easyrtc",...
Validates that the video ids correspond to dom objects. @param {String} monitorVideoId @param {Array} videoIds @returns {Boolean} @private
[ "Validates", "that", "the", "video", "ids", "correspond", "to", "dom", "objects", "." ]
5ea69776f319fab15a784f94db91a2c1f5154ef5
https://github.com/priologic/easyrtc/blob/5ea69776f319fab15a784f94db91a2c1f5154ef5/api/easyrtc.js#L11375-L11394
5,524
priologic/easyrtc
demos/js/demo_data_channel_messaging.js
connect
function connect() { easyrtc.enableDebug(false); easyrtc.enableDataChannels(true); easyrtc.enableVideo(false); easyrtc.enableAudio(false); easyrtc.enableVideoReceive(false); easyrtc.enableAudioReceive(false); easyrtc.setDataChannelOpenListener(openListener); easyrtc.setDataChanne...
javascript
function connect() { easyrtc.enableDebug(false); easyrtc.enableDataChannels(true); easyrtc.enableVideo(false); easyrtc.enableAudio(false); easyrtc.enableVideoReceive(false); easyrtc.enableAudioReceive(false); easyrtc.setDataChannelOpenListener(openListener); easyrtc.setDataChanne...
[ "function", "connect", "(", ")", "{", "easyrtc", ".", "enableDebug", "(", "false", ")", ";", "easyrtc", ".", "enableDataChannels", "(", "true", ")", ";", "easyrtc", ".", "enableVideo", "(", "false", ")", ";", "easyrtc", ".", "enableAudio", "(", "false", ...
tracks which channels are active
[ "tracks", "which", "channels", "are", "active" ]
5ea69776f319fab15a784f94db91a2c1f5154ef5
https://github.com/priologic/easyrtc/blob/5ea69776f319fab15a784f94db91a2c1f5154ef5/demos/js/demo_data_channel_messaging.js#L31-L43
5,525
priologic/easyrtc
api/labs/easyrtc_sc_extension/background-script.js
onAccessApproved
function onAccessApproved(sourceId) { pending = false; // if "cancel" button is clicked if(!sourceId || !sourceId.length) { return port.postMessage('PermissionDeniedError'); } // "ok" button is clicked; share "sourceId" with the // content-s...
javascript
function onAccessApproved(sourceId) { pending = false; // if "cancel" button is clicked if(!sourceId || !sourceId.length) { return port.postMessage('PermissionDeniedError'); } // "ok" button is clicked; share "sourceId" with the // content-s...
[ "function", "onAccessApproved", "(", "sourceId", ")", "{", "pending", "=", "false", ";", "// if \"cancel\" button is clicked", "if", "(", "!", "sourceId", "||", "!", "sourceId", ".", "length", ")", "{", "return", "port", ".", "postMessage", "(", "'PermissionDeni...
on getting sourceId "sourceId" will be empty if permission is denied.
[ "on", "getting", "sourceId", "sourceId", "will", "be", "empty", "if", "permission", "is", "denied", "." ]
5ea69776f319fab15a784f94db91a2c1f5154ef5
https://github.com/priologic/easyrtc/blob/5ea69776f319fab15a784f94db91a2c1f5154ef5/api/labs/easyrtc_sc_extension/background-script.js#L12-L26
5,526
priologic/easyrtc
api/labs/easyrtc_sc_extension/background-script.js
portOnMessageHanlder
function portOnMessageHanlder(message) { if(message === 'get-sourceId' && !pending) { pending = true; chrome.desktopCapture.chooseDesktopMedia(session, port.sender.tab, onAccessApproved); } }
javascript
function portOnMessageHanlder(message) { if(message === 'get-sourceId' && !pending) { pending = true; chrome.desktopCapture.chooseDesktopMedia(session, port.sender.tab, onAccessApproved); } }
[ "function", "portOnMessageHanlder", "(", "message", ")", "{", "if", "(", "message", "===", "'get-sourceId'", "&&", "!", "pending", ")", "{", "pending", "=", "true", ";", "chrome", ".", "desktopCapture", ".", "chooseDesktopMedia", "(", "session", ",", "port", ...
this one is called for each message from "content-script.js"
[ "this", "one", "is", "called", "for", "each", "message", "from", "content", "-", "script", ".", "js" ]
5ea69776f319fab15a784f94db91a2c1f5154ef5
https://github.com/priologic/easyrtc/blob/5ea69776f319fab15a784f94db91a2c1f5154ef5/api/labs/easyrtc_sc_extension/background-script.js#L29-L34
5,527
yaronn/blessed-contrib
examples/dashboard.js
fillBar
function fillBar() { var arr = [] for (var i=0; i<servers.length; i++) { arr.push(Math.round(Math.random()*10)) } bar.setData({titles: servers, data: arr}) }
javascript
function fillBar() { var arr = [] for (var i=0; i<servers.length; i++) { arr.push(Math.round(Math.random()*10)) } bar.setData({titles: servers, data: arr}) }
[ "function", "fillBar", "(", ")", "{", "var", "arr", "=", "[", "]", "for", "(", "var", "i", "=", "0", ";", "i", "<", "servers", ".", "length", ";", "i", "++", ")", "{", "arr", ".", "push", "(", "Math", ".", "round", "(", "Math", ".", "random",...
set dummy data on bar chart
[ "set", "dummy", "data", "on", "bar", "chart" ]
a497e6d3a54f3947f94a22823dfed832837e2802
https://github.com/yaronn/blessed-contrib/blob/a497e6d3a54f3947f94a22823dfed832837e2802/examples/dashboard.js#L130-L136
5,528
yaronn/blessed-contrib
lib/widget/charts/line.js
getMaxY
function getMaxY() { if (self.options.maxY) { return self.options.maxY; } var max = -Infinity; for(let i = 0; i < data.length; i++) { if (data[i].y.length) { var current = _.max(data[i].y, parseFloat); if (current > max) { max = current; } } } ...
javascript
function getMaxY() { if (self.options.maxY) { return self.options.maxY; } var max = -Infinity; for(let i = 0; i < data.length; i++) { if (data[i].y.length) { var current = _.max(data[i].y, parseFloat); if (current > max) { max = current; } } } ...
[ "function", "getMaxY", "(", ")", "{", "if", "(", "self", ".", "options", ".", "maxY", ")", "{", "return", "self", ".", "options", ".", "maxY", ";", "}", "var", "max", "=", "-", "Infinity", ";", "for", "(", "let", "i", "=", "0", ";", "i", "<", ...
iteratee for lodash _.max
[ "iteratee", "for", "lodash", "_", ".", "max" ]
a497e6d3a54f3947f94a22823dfed832837e2802
https://github.com/yaronn/blessed-contrib/blob/a497e6d3a54f3947f94a22823dfed832837e2802/lib/widget/charts/line.js#L87-L104
5,529
yaronn/blessed-contrib
lib/widget/charts/line.js
drawLine
function drawLine(values, style, minY) { style = style || {} var color = self.options.style.line c.strokeStyle = style.line || color c.moveTo(0, 0) c.beginPath(); c.lineTo(getXPixel(0), getYPixel(values[0], minY)); for(var k = 1; k < values.length; k++) { c.lineTo(getXPixel(k), getYP...
javascript
function drawLine(values, style, minY) { style = style || {} var color = self.options.style.line c.strokeStyle = style.line || color c.moveTo(0, 0) c.beginPath(); c.lineTo(getXPixel(0), getYPixel(values[0], minY)); for(var k = 1; k < values.length; k++) { c.lineTo(getXPixel(k), getYP...
[ "function", "drawLine", "(", "values", ",", "style", ",", "minY", ")", "{", "style", "=", "style", "||", "{", "}", "var", "color", "=", "self", ".", "options", ".", "style", ".", "line", "c", ".", "strokeStyle", "=", "style", ".", "line", "||", "co...
Draw the line graph
[ "Draw", "the", "line", "graph" ]
a497e6d3a54f3947f94a22823dfed832837e2802
https://github.com/yaronn/blessed-contrib/blob/a497e6d3a54f3947f94a22823dfed832837e2802/lib/widget/charts/line.js#L152-L166
5,530
Streamedian/html5_rtsp_player
streamedian.min.js
function(ev) { this.count = this.count || 0; if (this.count >= 256 || rng_pptr >= rng_psize) { if (window.removeEventListener) window.removeEventListener("mousemove", onMouseMoveListener, false); else if (window.detachEvent) window.detachEvent("onmousemove", onMouseMoveListener); ...
javascript
function(ev) { this.count = this.count || 0; if (this.count >= 256 || rng_pptr >= rng_psize) { if (window.removeEventListener) window.removeEventListener("mousemove", onMouseMoveListener, false); else if (window.detachEvent) window.detachEvent("onmousemove", onMouseMoveListener); ...
[ "function", "(", "ev", ")", "{", "this", ".", "count", "=", "this", ".", "count", "||", "0", ";", "if", "(", "this", ".", "count", ">=", "256", "||", "rng_pptr", ">=", "rng_psize", ")", "{", "if", "(", "window", ".", "removeEventListener", ")", "wi...
Use mouse events for entropy, if we do not have enough entropy by the time we need it, entropy will be generated by Math.random.
[ "Use", "mouse", "events", "for", "entropy", "if", "we", "do", "not", "have", "enough", "entropy", "by", "the", "time", "we", "need", "it", "entropy", "will", "be", "generated", "by", "Math", ".", "random", "." ]
4d04d4a075992cc5ef828ed644d9a3e4a00606d7
https://github.com/Streamedian/html5_rtsp_player/blob/4d04d4a075992cc5ef828ed644d9a3e4a00606d7/streamedian.min.js#L5133-L5149
5,531
CJex/regulex
src/Kit.js
hashUnique
function hashUnique(a) { var table={},i=0,j=0,l=a.length,x; for (;i<l;i++) { x=a[i]; if (table.hasOwnProperty(x)) continue; table[x]=1; a[j++]=x; } a.length=j; return a; }
javascript
function hashUnique(a) { var table={},i=0,j=0,l=a.length,x; for (;i<l;i++) { x=a[i]; if (table.hasOwnProperty(x)) continue; table[x]=1; a[j++]=x; } a.length=j; return a; }
[ "function", "hashUnique", "(", "a", ")", "{", "var", "table", "=", "{", "}", ",", "i", "=", "0", ",", "j", "=", "0", ",", "l", "=", "a", ".", "length", ",", "x", ";", "for", "(", ";", "i", "<", "l", ";", "i", "++", ")", "{", "x", "=", ...
Unique by toString. This function will corrupt the original array but preserve the original order.
[ "Unique", "by", "toString", ".", "This", "function", "will", "corrupt", "the", "original", "array", "but", "preserve", "the", "original", "order", "." ]
398d0b6d8b30a4d47999e4400c935ffddf30a4f1
https://github.com/CJex/regulex/blob/398d0b6d8b30a4d47999e4400c935ffddf30a4f1/src/Kit.js#L112-L122
5,532
CJex/regulex
src/Kit.js
parseCharset
function parseCharset(charset /*:String*/) { charset=charset.split(''); var chars=[],ranges=[], exclude = charset[0]==='^' && charset.length > 1 && charset.shift(); charset.forEach(function (c) { if (chars[0]=='-' && chars.length>1) {//chars=['-','a'],c=='z' if (chars[1] > c ) // z-a is invalid ...
javascript
function parseCharset(charset /*:String*/) { charset=charset.split(''); var chars=[],ranges=[], exclude = charset[0]==='^' && charset.length > 1 && charset.shift(); charset.forEach(function (c) { if (chars[0]=='-' && chars.length>1) {//chars=['-','a'],c=='z' if (chars[1] > c ) // z-a is invalid ...
[ "function", "parseCharset", "(", "charset", "/*:String*/", ")", "{", "charset", "=", "charset", ".", "split", "(", "''", ")", ";", "var", "chars", "=", "[", "]", ",", "ranges", "=", "[", "]", ",", "exclude", "=", "charset", "[", "0", "]", "===", "'...
Parse simple regex style charset string like '^a-bcdf' to disjoint ranges. Character classes like "\w\s" are not supported! @param {String} charset Valid regex charset [^a-z0-9_] input as "^a-z0-9_". @return {[Range]} return sorted disjoint ranges
[ "Parse", "simple", "regex", "style", "charset", "string", "like", "^a", "-", "bcdf", "to", "disjoint", "ranges", ".", "Character", "classes", "like", "\\", "w", "\\", "s", "are", "not", "supported!" ]
398d0b6d8b30a4d47999e4400c935ffddf30a4f1
https://github.com/CJex/regulex/blob/398d0b6d8b30a4d47999e4400c935ffddf30a4f1/src/Kit.js#L288-L303
5,533
CJex/regulex
src/Kit.js
toPrint
function toPrint(s,isRaw) { var ctrl=/[\x00-\x1F\x7F-\x9F]/,unicode=/[\u009F-\uFFFF]/; s=s.split('').map(function (c) { if (!isRaw && printEscapeMap.hasOwnProperty(c)) return printEscapeMap[c]; else if (unicode.test(c)) return '\\u'+('00'+ord(c).toString(16).toUpperCase()).slice(-4); else if (ctrl.test(...
javascript
function toPrint(s,isRaw) { var ctrl=/[\x00-\x1F\x7F-\x9F]/,unicode=/[\u009F-\uFFFF]/; s=s.split('').map(function (c) { if (!isRaw && printEscapeMap.hasOwnProperty(c)) return printEscapeMap[c]; else if (unicode.test(c)) return '\\u'+('00'+ord(c).toString(16).toUpperCase()).slice(-4); else if (ctrl.test(...
[ "function", "toPrint", "(", "s", ",", "isRaw", ")", "{", "var", "ctrl", "=", "/", "[\\x00-\\x1F\\x7F-\\x9F]", "/", ",", "unicode", "=", "/", "[\\u009F-\\uFFFF]", "/", ";", "s", "=", "s", ".", "split", "(", "''", ")", ".", "map", "(", "function", "(",...
Convert string to printable,replace all control chars and unicode to hex escape
[ "Convert", "string", "to", "printable", "replace", "all", "control", "chars", "and", "unicode", "to", "hex", "escape" ]
398d0b6d8b30a4d47999e4400c935ffddf30a4f1
https://github.com/CJex/regulex/blob/398d0b6d8b30a4d47999e4400c935ffddf30a4f1/src/Kit.js#L343-L352
5,534
CJex/regulex
src/parse.js
endChoice
function endChoice(stack) { if (stack._parentChoice) { var choice=stack._parentChoice; delete stack._parentChoice; delete stack._parentGroup; delete stack.groupCounter; var parentStack=choice._parentStack; delete choice._parentStack; return parentStack; } ret...
javascript
function endChoice(stack) { if (stack._parentChoice) { var choice=stack._parentChoice; delete stack._parentChoice; delete stack._parentGroup; delete stack.groupCounter; var parentStack=choice._parentStack; delete choice._parentStack; return parentStack; } ret...
[ "function", "endChoice", "(", "stack", ")", "{", "if", "(", "stack", ".", "_parentChoice", ")", "{", "var", "choice", "=", "stack", ".", "_parentChoice", ";", "delete", "stack", ".", "_parentChoice", ";", "delete", "stack", ".", "_parentGroup", ";", "delet...
if current stack is a choice's branch,return the original parent stack
[ "if", "current", "stack", "is", "a", "choice", "s", "branch", "return", "the", "original", "parent", "stack" ]
398d0b6d8b30a4d47999e4400c935ffddf30a4f1
https://github.com/CJex/regulex/blob/398d0b6d8b30a4d47999e4400c935ffddf30a4f1/src/parse.js#L633-L645
5,535
CJex/regulex
src/NFA.js
structure
function structure(a) { a.accepts=a.accepts.split(','); var ts=a.trans, i=ts.length,t,s,from,to; while (i--) { t=ts[i]; s=t[0].split('>'); from=s[0].split(','); to=s[1].split(','); ts[i]={from:from,to:to,charset:t[1],action:t[2],assert:t[3]}; } a.compact=false; return a; }
javascript
function structure(a) { a.accepts=a.accepts.split(','); var ts=a.trans, i=ts.length,t,s,from,to; while (i--) { t=ts[i]; s=t[0].split('>'); from=s[0].split(','); to=s[1].split(','); ts[i]={from:from,to:to,charset:t[1],action:t[2],assert:t[3]}; } a.compact=false; return a; }
[ "function", "structure", "(", "a", ")", "{", "a", ".", "accepts", "=", "a", ".", "accepts", ".", "split", "(", "','", ")", ";", "var", "ts", "=", "a", ".", "trans", ",", "i", "=", "ts", ".", "length", ",", "t", ",", "s", ",", "from", ",", "...
Convert CompactNFAConfig to NFAConfig @param {CompactNFAConfig} a type CompactNFAConfig={compact:true,accepts:CompactStateSet,trans:[CompactTransition]} type CompactStateSet = StateSet.join(",") type CompactTransition = [CompactStateMap,Charset,Action,Assert] type CompactStateMap = FromStateSet.join(",")+">"+ToStateSet...
[ "Convert", "CompactNFAConfig", "to", "NFAConfig" ]
398d0b6d8b30a4d47999e4400c935ffddf30a4f1
https://github.com/CJex/regulex/blob/398d0b6d8b30a4d47999e4400c935ffddf30a4f1/src/NFA.js#L289-L302
5,536
petkaantonov/bluebird
src/util.js
function(Child, Parent) { var hasProp = {}.hasOwnProperty; function T() { this.constructor = Child; this.constructor$ = Parent; for (var propertyName in Parent.prototype) { if (hasProp.call(Parent.prototype, propertyName) && propertyName.charAt(propertyName.l...
javascript
function(Child, Parent) { var hasProp = {}.hasOwnProperty; function T() { this.constructor = Child; this.constructor$ = Parent; for (var propertyName in Parent.prototype) { if (hasProp.call(Parent.prototype, propertyName) && propertyName.charAt(propertyName.l...
[ "function", "(", "Child", ",", "Parent", ")", "{", "var", "hasProp", "=", "{", "}", ".", "hasOwnProperty", ";", "function", "T", "(", ")", "{", "this", ".", "constructor", "=", "Child", ";", "this", ".", "constructor$", "=", "Parent", ";", "for", "("...
Un-magical enough that using this doesn't prevent extending classes from outside using any convention
[ "Un", "-", "magical", "enough", "that", "using", "this", "doesn", "t", "prevent", "extending", "classes", "from", "outside", "using", "any", "convention" ]
17f69f3b0fa89a0b7a5cfb9a6546d1180a3610e0
https://github.com/petkaantonov/bluebird/blob/17f69f3b0fa89a0b7a5cfb9a6546d1180a3610e0/src/util.js#L34-L51
5,537
petkaantonov/bluebird
src/async.js
AsyncInvokeLater
function AsyncInvokeLater(fn, receiver, arg) { ASSERT(arguments.length === 3); this._lateQueue.push(fn, receiver, arg); this._queueTick(); }
javascript
function AsyncInvokeLater(fn, receiver, arg) { ASSERT(arguments.length === 3); this._lateQueue.push(fn, receiver, arg); this._queueTick(); }
[ "function", "AsyncInvokeLater", "(", "fn", ",", "receiver", ",", "arg", ")", "{", "ASSERT", "(", "arguments", ".", "length", "===", "3", ")", ";", "this", ".", "_lateQueue", ".", "push", "(", "fn", ",", "receiver", ",", "arg", ")", ";", "this", ".", ...
When the fn absolutely needs to be called after the queue has been completely flushed
[ "When", "the", "fn", "absolutely", "needs", "to", "be", "called", "after", "the", "queue", "has", "been", "completely", "flushed" ]
17f69f3b0fa89a0b7a5cfb9a6546d1180a3610e0
https://github.com/petkaantonov/bluebird/blob/17f69f3b0fa89a0b7a5cfb9a6546d1180a3610e0/src/async.js#L80-L84
5,538
petkaantonov/bluebird
src/async.js
_drainQueueStep
function _drainQueueStep(queue) { var fn = queue.shift(); if (typeof fn !== "function") { fn._settlePromises(); } else { var receiver = queue.shift(); var arg = queue.shift(); fn.call(receiver, arg); } }
javascript
function _drainQueueStep(queue) { var fn = queue.shift(); if (typeof fn !== "function") { fn._settlePromises(); } else { var receiver = queue.shift(); var arg = queue.shift(); fn.call(receiver, arg); } }
[ "function", "_drainQueueStep", "(", "queue", ")", "{", "var", "fn", "=", "queue", ".", "shift", "(", ")", ";", "if", "(", "typeof", "fn", "!==", "\"function\"", ")", "{", "fn", ".", "_settlePromises", "(", ")", ";", "}", "else", "{", "var", "receiver...
Shift the queue in a separate function to allow garbage collection after each step
[ "Shift", "the", "queue", "in", "a", "separate", "function", "to", "allow", "garbage", "collection", "after", "each", "step" ]
17f69f3b0fa89a0b7a5cfb9a6546d1180a3610e0
https://github.com/petkaantonov/bluebird/blob/17f69f3b0fa89a0b7a5cfb9a6546d1180a3610e0/src/async.js#L143-L152
5,539
petkaantonov/bluebird
benchmark/lib/timers-ctx.js
insert
function insert(item, msecs) { item._idleStart = Timer.now(); item._idleTimeout = msecs; if (msecs < 0) return; var list; if (lists[msecs]) { list = lists[msecs]; } else { list = new Timer(); list.start(msecs, 0); L.init(list); lists[msecs] = list; list.msecs = msecs; list[k...
javascript
function insert(item, msecs) { item._idleStart = Timer.now(); item._idleTimeout = msecs; if (msecs < 0) return; var list; if (lists[msecs]) { list = lists[msecs]; } else { list = new Timer(); list.start(msecs, 0); L.init(list); lists[msecs] = list; list.msecs = msecs; list[k...
[ "function", "insert", "(", "item", ",", "msecs", ")", "{", "item", ".", "_idleStart", "=", "Timer", ".", "now", "(", ")", ";", "item", ".", "_idleTimeout", "=", "msecs", ";", "if", "(", "msecs", "<", "0", ")", "return", ";", "var", "list", ";", "...
the main function - creates lists on demand and the watchers associated with them.
[ "the", "main", "function", "-", "creates", "lists", "on", "demand", "and", "the", "watchers", "associated", "with", "them", "." ]
17f69f3b0fa89a0b7a5cfb9a6546d1180a3610e0
https://github.com/petkaantonov/bluebird/blob/17f69f3b0fa89a0b7a5cfb9a6546d1180a3610e0/benchmark/lib/timers-ctx.js#L50-L73
5,540
petkaantonov/bluebird
benchmark/lib/fakesP-ctx.js
dummyP
function dummyP(n) { return function lifted() { var deferred = Promise.pending(); timers.setTimeout(nodeback, deferred, global.asyncTime || 100); return deferred.promise; } }
javascript
function dummyP(n) { return function lifted() { var deferred = Promise.pending(); timers.setTimeout(nodeback, deferred, global.asyncTime || 100); return deferred.promise; } }
[ "function", "dummyP", "(", "n", ")", "{", "return", "function", "lifted", "(", ")", "{", "var", "deferred", "=", "Promise", ".", "pending", "(", ")", ";", "timers", ".", "setTimeout", "(", "nodeback", ",", "deferred", ",", "global", ".", "asyncTime", "...
A function taking n values or promises and returning a promise
[ "A", "function", "taking", "n", "values", "or", "promises", "and", "returning", "a", "promise" ]
17f69f3b0fa89a0b7a5cfb9a6546d1180a3610e0
https://github.com/petkaantonov/bluebird/blob/17f69f3b0fa89a0b7a5cfb9a6546d1180a3610e0/benchmark/lib/fakesP-ctx.js#L65-L71
5,541
petkaantonov/bluebird
tools/ast_passes.js
function( src, fileName ) { var ast = parse(src, fileName); walk.simple(ast, { ExpressionStatement: function( node ) { if( node.expression.type !== 'CallExpression' ) { return; } var start = node.start; var ...
javascript
function( src, fileName ) { var ast = parse(src, fileName); walk.simple(ast, { ExpressionStatement: function( node ) { if( node.expression.type !== 'CallExpression' ) { return; } var start = node.start; var ...
[ "function", "(", "src", ",", "fileName", ")", "{", "var", "ast", "=", "parse", "(", "src", ",", "fileName", ")", ";", "walk", ".", "simple", "(", "ast", ",", "{", "ExpressionStatement", ":", "function", "(", "node", ")", "{", "if", "(", "node", "."...
Parse constants in from constants.js
[ "Parse", "constants", "in", "from", "constants", ".", "js" ]
17f69f3b0fa89a0b7a5cfb9a6546d1180a3610e0
https://github.com/petkaantonov/bluebird/blob/17f69f3b0fa89a0b7a5cfb9a6546d1180a3610e0/tools/ast_passes.js#L492-L539
5,542
petkaantonov/bluebird
tools/ast_passes.js
function( src, fileName ) { var results = []; var identifiers = []; var ast = parse(src, fileName); walk.simple(ast, { Identifier: function( node ) { identifiers.push( node ); } }); for( var i = 0, len = identifiers.length; i < len...
javascript
function( src, fileName ) { var results = []; var identifiers = []; var ast = parse(src, fileName); walk.simple(ast, { Identifier: function( node ) { identifiers.push( node ); } }); for( var i = 0, len = identifiers.length; i < len...
[ "function", "(", "src", ",", "fileName", ")", "{", "var", "results", "=", "[", "]", ";", "var", "identifiers", "=", "[", "]", ";", "var", "ast", "=", "parse", "(", "src", ",", "fileName", ")", ";", "walk", ".", "simple", "(", "ast", ",", "{", "...
Expand constants in normal source files
[ "Expand", "constants", "in", "normal", "source", "files" ]
17f69f3b0fa89a0b7a5cfb9a6546d1180a3610e0
https://github.com/petkaantonov/bluebird/blob/17f69f3b0fa89a0b7a5cfb9a6546d1180a3610e0/tools/ast_passes.js#L542-L569
5,543
electron-userland/electron-packager
targets.js
validateListFromOptions
function validateListFromOptions (opts, name) { if (opts.all) return Array.from(supported[name].values()) let list = opts[name] if (!list) { if (name === 'arch') { list = hostArch() } else { list = process[name] } } else if (list === 'all') { return Array.from(su...
javascript
function validateListFromOptions (opts, name) { if (opts.all) return Array.from(supported[name].values()) let list = opts[name] if (!list) { if (name === 'arch') { list = hostArch() } else { list = process[name] } } else if (list === 'all') { return Array.from(su...
[ "function", "validateListFromOptions", "(", "opts", ",", "name", ")", "{", "if", "(", "opts", ".", "all", ")", "return", "Array", ".", "from", "(", "supported", "[", "name", "]", ".", "values", "(", ")", ")", "let", "list", "=", "opts", "[", "name", ...
Validates list of architectures or platforms. Returns a normalized array if successful, or throws an Error.
[ "Validates", "list", "of", "architectures", "or", "platforms", ".", "Returns", "a", "normalized", "array", "if", "successful", "or", "throws", "an", "Error", "." ]
e65bc99ea3e06f9b72305d3fcf6589bdcb54810b
https://github.com/electron-userland/electron-packager/blob/e65bc99ea3e06f9b72305d3fcf6589bdcb54810b/targets.js#L104-L135
5,544
FineUploader/fine-uploader
client/js/azure/azure.xhr.upload.handler.js
function(reason) { log(qq.format("Failed to determine blob name for ID {} - {}", id, reason), "error"); promise.failure({error: reason}); }
javascript
function(reason) { log(qq.format("Failed to determine blob name for ID {} - {}", id, reason), "error"); promise.failure({error: reason}); }
[ "function", "(", "reason", ")", "{", "log", "(", "qq", ".", "format", "(", "\"Failed to determine blob name for ID {} - {}\"", ",", "id", ",", "reason", ")", ",", "\"error\"", ")", ";", "promise", ".", "failure", "(", "{", "error", ":", "reason", "}", ")",...
We may have multiple SAS requests in progress for the same file, so we must include the chunk idx as part of the ID when communicating with the SAS ajax requester to avoid collisions.
[ "We", "may", "have", "multiple", "SAS", "requests", "in", "progress", "for", "the", "same", "file", "so", "we", "must", "include", "the", "chunk", "idx", "as", "part", "of", "the", "ID", "when", "communicating", "with", "the", "SAS", "ajax", "requester", ...
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/azure/azure.xhr.upload.handler.js#L121-L124
5,545
FineUploader/fine-uploader
client/js/ui.handler.edit.filename.js
handleNameUpdate
function handleNameUpdate(newFilenameInputEl, fileId) { var newName = newFilenameInputEl.value, origExtension; if (newName !== undefined && qq.trimStr(newName).length > 0) { origExtension = getOriginalExtension(fileId); if (origExtension !== undefined) { ...
javascript
function handleNameUpdate(newFilenameInputEl, fileId) { var newName = newFilenameInputEl.value, origExtension; if (newName !== undefined && qq.trimStr(newName).length > 0) { origExtension = getOriginalExtension(fileId); if (origExtension !== undefined) { ...
[ "function", "handleNameUpdate", "(", "newFilenameInputEl", ",", "fileId", ")", "{", "var", "newName", "=", "newFilenameInputEl", ".", "value", ",", "origExtension", ";", "if", "(", "newName", "!==", "undefined", "&&", "qq", ".", "trimStr", "(", "newName", ")",...
Callback iff the name has been changed
[ "Callback", "iff", "the", "name", "has", "been", "changed" ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/ui.handler.edit.filename.js#L33-L48
5,546
FineUploader/fine-uploader
client/js/ui.handler.edit.filename.js
registerInputBlurHandler
function registerInputBlurHandler(inputEl, fileId) { inheritedInternalApi.getDisposeSupport().attach(inputEl, "blur", function() { handleNameUpdate(inputEl, fileId); }); }
javascript
function registerInputBlurHandler(inputEl, fileId) { inheritedInternalApi.getDisposeSupport().attach(inputEl, "blur", function() { handleNameUpdate(inputEl, fileId); }); }
[ "function", "registerInputBlurHandler", "(", "inputEl", ",", "fileId", ")", "{", "inheritedInternalApi", ".", "getDisposeSupport", "(", ")", ".", "attach", "(", "inputEl", ",", "\"blur\"", ",", "function", "(", ")", "{", "handleNameUpdate", "(", "inputEl", ",", ...
The name has been updated if the filename edit input loses focus.
[ "The", "name", "has", "been", "updated", "if", "the", "filename", "edit", "input", "loses", "focus", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/ui.handler.edit.filename.js#L51-L55
5,547
FineUploader/fine-uploader
client/js/ui.handler.edit.filename.js
registerInputEnterKeyHandler
function registerInputEnterKeyHandler(inputEl, fileId) { inheritedInternalApi.getDisposeSupport().attach(inputEl, "keyup", function(event) { var code = event.keyCode || event.which; if (code === 13) { handleNameUpdate(inputEl, fileId); } }); }
javascript
function registerInputEnterKeyHandler(inputEl, fileId) { inheritedInternalApi.getDisposeSupport().attach(inputEl, "keyup", function(event) { var code = event.keyCode || event.which; if (code === 13) { handleNameUpdate(inputEl, fileId); } }); }
[ "function", "registerInputEnterKeyHandler", "(", "inputEl", ",", "fileId", ")", "{", "inheritedInternalApi", ".", "getDisposeSupport", "(", ")", ".", "attach", "(", "inputEl", ",", "\"keyup\"", ",", "function", "(", "event", ")", "{", "var", "code", "=", "even...
The name has been updated if the user presses enter.
[ "The", "name", "has", "been", "updated", "if", "the", "user", "presses", "enter", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/ui.handler.edit.filename.js#L58-L67
5,548
FineUploader/fine-uploader
client/js/dnd.js
getFilesInDirectory
function getFilesInDirectory(entry, reader, accumEntries, existingPromise) { var promise = existingPromise || new qq.Promise(), dirReader = reader || entry.createReader(); dirReader.readEntries( function readSuccess(entries) { var newEntries = accumEntries ? accu...
javascript
function getFilesInDirectory(entry, reader, accumEntries, existingPromise) { var promise = existingPromise || new qq.Promise(), dirReader = reader || entry.createReader(); dirReader.readEntries( function readSuccess(entries) { var newEntries = accumEntries ? accu...
[ "function", "getFilesInDirectory", "(", "entry", ",", "reader", ",", "accumEntries", ",", "existingPromise", ")", "{", "var", "promise", "=", "existingPromise", "||", "new", "qq", ".", "Promise", "(", ")", ",", "dirReader", "=", "reader", "||", "entry", ".",...
Promissory. Guaranteed to read all files in the root of the passed directory.
[ "Promissory", ".", "Guaranteed", "to", "read", "all", "files", "in", "the", "root", "of", "the", "passed", "directory", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/dnd.js#L93-L115
5,549
FineUploader/fine-uploader
client/js/jquery-plugin.js
addCallbacks
function addCallbacks(transformedOpts, newUploaderInstance) { var callbacks = transformedOpts.callbacks = {}; $.each(newUploaderInstance._options.callbacks, function(prop, nonJqueryCallback) { var name, callbackEventTarget; name = /^on(\w+)/.exec(prop)[1]; name = na...
javascript
function addCallbacks(transformedOpts, newUploaderInstance) { var callbacks = transformedOpts.callbacks = {}; $.each(newUploaderInstance._options.callbacks, function(prop, nonJqueryCallback) { var name, callbackEventTarget; name = /^on(\w+)/.exec(prop)[1]; name = na...
[ "function", "addCallbacks", "(", "transformedOpts", ",", "newUploaderInstance", ")", "{", "var", "callbacks", "=", "transformedOpts", ".", "callbacks", "=", "{", "}", ";", "$", ".", "each", "(", "newUploaderInstance", ".", "_options", ".", "callbacks", ",", "f...
Implement all callbacks defined in Fine Uploader as functions that trigger appropriately names events and return the result of executing the bound handler back to Fine Uploader
[ "Implement", "all", "callbacks", "defined", "in", "Fine", "Uploader", "as", "functions", "that", "trigger", "appropriately", "names", "events", "and", "return", "the", "result", "of", "executing", "the", "bound", "handler", "back", "to", "Fine", "Uploader" ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/jquery-plugin.js#L72-L109
5,550
FineUploader/fine-uploader
client/js/jquery-plugin.js
maybeWrapInJquery
function maybeWrapInJquery(val) { var transformedVal = val; // If the command is returning an `HTMLElement` or `HTMLDocument`, wrap it in a `jQuery` object /*jshint -W116*/ if (val != null && typeof val === "object" && (val.nodeType === 1 || val.nodeType === 9) && val.cloneNo...
javascript
function maybeWrapInJquery(val) { var transformedVal = val; // If the command is returning an `HTMLElement` or `HTMLDocument`, wrap it in a `jQuery` object /*jshint -W116*/ if (val != null && typeof val === "object" && (val.nodeType === 1 || val.nodeType === 9) && val.cloneNo...
[ "function", "maybeWrapInJquery", "(", "val", ")", "{", "var", "transformedVal", "=", "val", ";", "// If the command is returning an `HTMLElement` or `HTMLDocument`, wrap it in a `jQuery` object", "/*jshint -W116*/", "if", "(", "val", "!=", "null", "&&", "typeof", "val", "==...
If the value is an `HTMLElement` or `HTMLDocument`, wrap it in a `jQuery` object
[ "If", "the", "value", "is", "an", "HTMLElement", "or", "HTMLDocument", "wrap", "it", "in", "a", "jQuery", "object" ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/jquery-plugin.js#L187-L199
5,551
FineUploader/fine-uploader
client/js/total-progress.js
function(id, loaded, total) { updateTotalProgress(id, loaded, total); perFileProgress[id] = {loaded: loaded, total: total}; }
javascript
function(id, loaded, total) { updateTotalProgress(id, loaded, total); perFileProgress[id] = {loaded: loaded, total: total}; }
[ "function", "(", "id", ",", "loaded", ",", "total", ")", "{", "updateTotalProgress", "(", "id", ",", "loaded", ",", "total", ")", ";", "perFileProgress", "[", "id", "]", "=", "{", "loaded", ":", "loaded", ",", "total", ":", "total", "}", ";", "}" ]
Called whenever the upload progress of an individual file has changed.
[ "Called", "whenever", "the", "upload", "progress", "of", "an", "individual", "file", "has", "changed", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/total-progress.js#L110-L113
5,552
FineUploader/fine-uploader
client/js/ui.handler.click.filename.js
examineEvent
function examineEvent(target, event) { if (spec.templating.isFileName(target) || spec.templating.isEditIcon(target)) { var fileId = spec.templating.getFileId(target), status = spec.onGetUploadStatus(fileId); // We only allow users to change filenames of files that have b...
javascript
function examineEvent(target, event) { if (spec.templating.isFileName(target) || spec.templating.isEditIcon(target)) { var fileId = spec.templating.getFileId(target), status = spec.onGetUploadStatus(fileId); // We only allow users to change filenames of files that have b...
[ "function", "examineEvent", "(", "target", ",", "event", ")", "{", "if", "(", "spec", ".", "templating", ".", "isFileName", "(", "target", ")", "||", "spec", ".", "templating", ".", "isEditIcon", "(", "target", ")", ")", "{", "var", "fileId", "=", "spe...
This will be called by the parent handler when a `click` event is received on the list element.
[ "This", "will", "be", "called", "by", "the", "parent", "handler", "when", "a", "click", "event", "is", "received", "on", "the", "list", "element", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/ui.handler.click.filename.js#L21-L34
5,553
FineUploader/fine-uploader
client/js/image-support/exif.js
getDirEntryCount
function getDirEntryCount(app1Start, littleEndian) { var promise = new qq.Promise(); qq.readBlobToHex(fileOrBlob, app1Start + 18, 2).then(function(hex) { if (littleEndian) { return promise.success(parseLittleEndian(hex)); } else { prom...
javascript
function getDirEntryCount(app1Start, littleEndian) { var promise = new qq.Promise(); qq.readBlobToHex(fileOrBlob, app1Start + 18, 2).then(function(hex) { if (littleEndian) { return promise.success(parseLittleEndian(hex)); } else { prom...
[ "function", "getDirEntryCount", "(", "app1Start", ",", "littleEndian", ")", "{", "var", "promise", "=", "new", "qq", ".", "Promise", "(", ")", ";", "qq", ".", "readBlobToHex", "(", "fileOrBlob", ",", "app1Start", "+", "18", ",", "2", ")", ".", "then", ...
Determine the number of directory entries in the EXIF header.
[ "Determine", "the", "number", "of", "directory", "entries", "in", "the", "EXIF", "header", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/image-support/exif.js#L99-L112
5,554
FineUploader/fine-uploader
client/js/image-support/exif.js
getIfd
function getIfd(app1Start, dirEntries) { var offset = app1Start + 20, bytes = dirEntries * 12; return qq.readBlobToHex(fileOrBlob, offset, bytes); }
javascript
function getIfd(app1Start, dirEntries) { var offset = app1Start + 20, bytes = dirEntries * 12; return qq.readBlobToHex(fileOrBlob, offset, bytes); }
[ "function", "getIfd", "(", "app1Start", ",", "dirEntries", ")", "{", "var", "offset", "=", "app1Start", "+", "20", ",", "bytes", "=", "dirEntries", "*", "12", ";", "return", "qq", ".", "readBlobToHex", "(", "fileOrBlob", ",", "offset", ",", "bytes", ")",...
Get the IFD portion of the EXIF header as a hex string.
[ "Get", "the", "IFD", "portion", "of", "the", "EXIF", "header", "as", "a", "hex", "string", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/image-support/exif.js#L115-L120
5,555
FineUploader/fine-uploader
client/js/image-support/exif.js
getTagValues
function getTagValues(littleEndian, dirEntries) { var TAG_VAL_OFFSET = 16, tagsToFind = qq.extend([], TAG_IDS), vals = {}; qq.each(dirEntries, function(idx, entry) { var idHex = entry.slice(0, 4), id = littleEndian ? parseLittleEndian(idHex) : parseIn...
javascript
function getTagValues(littleEndian, dirEntries) { var TAG_VAL_OFFSET = 16, tagsToFind = qq.extend([], TAG_IDS), vals = {}; qq.each(dirEntries, function(idx, entry) { var idHex = entry.slice(0, 4), id = littleEndian ? parseLittleEndian(idHex) : parseIn...
[ "function", "getTagValues", "(", "littleEndian", ",", "dirEntries", ")", "{", "var", "TAG_VAL_OFFSET", "=", "16", ",", "tagsToFind", "=", "qq", ".", "extend", "(", "[", "]", ",", "TAG_IDS", ")", ",", "vals", "=", "{", "}", ";", "qq", ".", "each", "("...
Obtain values for all relevant tags and return them.
[ "Obtain", "values", "for", "all", "relevant", "tags", "and", "return", "them", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/image-support/exif.js#L136-L162
5,556
FineUploader/fine-uploader
client/js/s3/multipart.complete.ajax.requester.js
handleCompleteRequestComplete
function handleCompleteRequestComplete(id, xhr, isError) { var promise = pendingCompleteRequests[id], domParser = new DOMParser(), bucket = options.getBucket(id), key = options.getKey(id), responseDoc = domParser.parseFromString(xhr.responseText, "application/xml"...
javascript
function handleCompleteRequestComplete(id, xhr, isError) { var promise = pendingCompleteRequests[id], domParser = new DOMParser(), bucket = options.getBucket(id), key = options.getKey(id), responseDoc = domParser.parseFromString(xhr.responseText, "application/xml"...
[ "function", "handleCompleteRequestComplete", "(", "id", ",", "xhr", ",", "isError", ")", "{", "var", "promise", "=", "pendingCompleteRequests", "[", "id", "]", ",", "domParser", "=", "new", "DOMParser", "(", ")", ",", "bucket", "=", "options", ".", "getBucke...
Called by the base ajax requester when the response has been received. We definitively determine here if the "Complete MPU" request has been a success or not. @param id ID associated with the file. @param xhr `XMLHttpRequest` object containing the response, among other things. @param isError A boolean indicating succ...
[ "Called", "by", "the", "base", "ajax", "requester", "when", "the", "response", "has", "been", "received", ".", "We", "definitively", "determine", "here", "if", "the", "Complete", "MPU", "request", "has", "been", "a", "success", "or", "not", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/s3/multipart.complete.ajax.requester.js#L69-L108
5,557
FineUploader/fine-uploader
client/js/s3/multipart.complete.ajax.requester.js
function(id, uploadId, etagEntries) { var promise = new qq.Promise(), body = getCompleteRequestBody(etagEntries); getHeaders(id, uploadId, body).then(function(headers, endOfUrl) { options.log("Submitting S3 complete multipart upload request for " + id); ...
javascript
function(id, uploadId, etagEntries) { var promise = new qq.Promise(), body = getCompleteRequestBody(etagEntries); getHeaders(id, uploadId, body).then(function(headers, endOfUrl) { options.log("Submitting S3 complete multipart upload request for " + id); ...
[ "function", "(", "id", ",", "uploadId", ",", "etagEntries", ")", "{", "var", "promise", "=", "new", "qq", ".", "Promise", "(", ")", ",", "body", "=", "getCompleteRequestBody", "(", "etagEntries", ")", ";", "getHeaders", "(", "id", ",", "uploadId", ",", ...
Sends the "Complete" request and fulfills the returned promise when the success of this request is known. @param id ID associated with the file. @param uploadId AWS uploadId for this file @param etagEntries Array of objects containing `etag` values and their associated `part` numbers. @returns {qq.Promise}
[ "Sends", "the", "Complete", "request", "and", "fulfills", "the", "returned", "promise", "when", "the", "success", "of", "this", "request", "is", "known", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/s3/multipart.complete.ajax.requester.js#L165-L183
5,558
FineUploader/fine-uploader
client/js/identify.js
function() { var self = this, identifier = new qq.Promise(), previewable = false, name = fileOrBlob.name === undefined ? "blob" : fileOrBlob.name; log(qq.format("Attempting to determine if {} can be rendered in this browser", name)); ...
javascript
function() { var self = this, identifier = new qq.Promise(), previewable = false, name = fileOrBlob.name === undefined ? "blob" : fileOrBlob.name; log(qq.format("Attempting to determine if {} can be rendered in this browser", name)); ...
[ "function", "(", ")", "{", "var", "self", "=", "this", ",", "identifier", "=", "new", "qq", ".", "Promise", "(", ")", ",", "previewable", "=", "false", ",", "name", "=", "fileOrBlob", ".", "name", "===", "undefined", "?", "\"blob\"", ":", "fileOrBlob",...
Determines if a Blob can be displayed natively in the current browser. This is done by reading magic bytes in the beginning of the file, so this is an asynchronous operation. Before we attempt to read the file, we will examine the blob's type attribute to save CPU cycles. @returns {qq.Promise} Promise that is fulfil...
[ "Determines", "if", "a", "Blob", "can", "be", "displayed", "natively", "in", "the", "current", "browser", ".", "This", "is", "done", "by", "reading", "magic", "bytes", "in", "the", "beginning", "of", "the", "file", "so", "this", "is", "an", "asynchronous",...
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/identify.js#L28-L71
5,559
FineUploader/fine-uploader
client/js/s3/s3.xhr.upload.handler.js
function(id, xhr, chunkIdx) { var response = upload.response.parse(id, xhr), etag; if (response.success) { etag = xhr.getResponseHeader("ETag"); if (!handler._getPersistableData(id).etags) { handler._ge...
javascript
function(id, xhr, chunkIdx) { var response = upload.response.parse(id, xhr), etag; if (response.success) { etag = xhr.getResponseHeader("ETag"); if (!handler._getPersistableData(id).etags) { handler._ge...
[ "function", "(", "id", ",", "xhr", ",", "chunkIdx", ")", "{", "var", "response", "=", "upload", ".", "response", ".", "parse", "(", "id", ",", "xhr", ")", ",", "etag", ";", "if", "(", "response", ".", "success", ")", "{", "etag", "=", "xhr", ".",...
The last step in handling a chunked upload. This is called after each chunk has been sent. The request may be successful, or not. If it was successful, we must extract the "ETag" element in the XML response and store that along with the associated part number. We need these items to "Complete" the multipart upload af...
[ "The", "last", "step", "in", "handling", "a", "chunked", "upload", ".", "This", "is", "called", "after", "each", "chunk", "has", "been", "sent", ".", "The", "request", "may", "be", "successful", "or", "not", ".", "If", "it", "was", "successful", "we", ...
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/s3/s3.xhr.upload.handler.js#L56-L68
5,560
FineUploader/fine-uploader
client/js/s3/s3.xhr.upload.handler.js
function(awsParams) { xhr.open("POST", url, true); qq.obj2FormData(awsParams, formData); // AWS requires the file field be named "file". formData.append("file", fileOrBlob); promise.success(formDat...
javascript
function(awsParams) { xhr.open("POST", url, true); qq.obj2FormData(awsParams, formData); // AWS requires the file field be named "file". formData.append("file", fileOrBlob); promise.success(formDat...
[ "function", "(", "awsParams", ")", "{", "xhr", ".", "open", "(", "\"POST\"", ",", "url", ",", "true", ")", ";", "qq", ".", "obj2FormData", "(", "awsParams", ",", "formData", ")", ";", "// AWS requires the file field be named \"file\".", "formData", ".", "appen...
Success - all params determined
[ "Success", "-", "all", "params", "determined" ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/s3/s3.xhr.upload.handler.js#L349-L358
5,561
FineUploader/fine-uploader
client/js/s3/s3.xhr.upload.handler.js
function(awsResponseXml) { var parser = new DOMParser(), parsedDoc = parser.parseFromString(awsResponseXml, "application/xml"), errorEls = parsedDoc.getElementsByTagName("Error"), errorDetails = {}, codeE...
javascript
function(awsResponseXml) { var parser = new DOMParser(), parsedDoc = parser.parseFromString(awsResponseXml, "application/xml"), errorEls = parsedDoc.getElementsByTagName("Error"), errorDetails = {}, codeE...
[ "function", "(", "awsResponseXml", ")", "{", "var", "parser", "=", "new", "DOMParser", "(", ")", ",", "parsedDoc", "=", "parser", ".", "parseFromString", "(", "awsResponseXml", ",", "\"application/xml\"", ")", ",", "errorEls", "=", "parsedDoc", ".", "getElemen...
This parses an XML response by extracting the "Message" and "Code" elements that accompany AWS error responses. @param awsResponseXml XML response from AWS @returns {object} Object w/ `code` and `message` properties, or undefined if we couldn't find error info in the XML document.
[ "This", "parses", "an", "XML", "response", "by", "extracting", "the", "Message", "and", "Code", "elements", "that", "accompany", "AWS", "error", "responses", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/s3/s3.xhr.upload.handler.js#L507-L528
5,562
FineUploader/fine-uploader
client/js/s3/multipart.abort.ajax.requester.js
function(id, uploadId) { getHeaders(id, uploadId).then(function(headers, endOfUrl) { options.log("Submitting S3 Abort multipart upload request for " + id); requester.initTransport(id) .withPath(endOfUrl) .withHeaders(headers) ...
javascript
function(id, uploadId) { getHeaders(id, uploadId).then(function(headers, endOfUrl) { options.log("Submitting S3 Abort multipart upload request for " + id); requester.initTransport(id) .withPath(endOfUrl) .withHeaders(headers) ...
[ "function", "(", "id", ",", "uploadId", ")", "{", "getHeaders", "(", "id", ",", "uploadId", ")", ".", "then", "(", "function", "(", "headers", ",", "endOfUrl", ")", "{", "options", ".", "log", "(", "\"Submitting S3 Abort multipart upload request for \"", "+", ...
Sends the "Abort" request. @param id ID associated with the file. @param uploadId AWS uploadId for this file
[ "Sends", "the", "Abort", "request", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/s3/multipart.abort.ajax.requester.js#L113-L121
5,563
FineUploader/fine-uploader
client/js/uploader.basic.api.js
function(fileId, imgOrCanvas, maxSize, fromServer, customResizeFunction) { var promiseToReturn = new qq.Promise(), fileOrUrl, options; if (this._imageGenerator) { fileOrUrl = this._thumbnailUrls[fileId]; options = { customResiz...
javascript
function(fileId, imgOrCanvas, maxSize, fromServer, customResizeFunction) { var promiseToReturn = new qq.Promise(), fileOrUrl, options; if (this._imageGenerator) { fileOrUrl = this._thumbnailUrls[fileId]; options = { customResiz...
[ "function", "(", "fileId", ",", "imgOrCanvas", ",", "maxSize", ",", "fromServer", ",", "customResizeFunction", ")", "{", "var", "promiseToReturn", "=", "new", "qq", ".", "Promise", "(", ")", ",", "fileOrUrl", ",", "options", ";", "if", "(", "this", ".", ...
Generate a variable size thumbnail on an img or canvas, returning a promise that is fulfilled when the attempt completes. Thumbnail can either be based off of a URL for an image returned by the server in the upload response, or the associated `Blob`.
[ "Generate", "a", "variable", "size", "thumbnail", "on", "an", "img", "or", "canvas", "returning", "a", "promise", "that", "is", "fulfilled", "when", "the", "attempt", "completes", ".", "Thumbnail", "can", "either", "be", "based", "off", "of", "a", "URL", "...
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/uploader.basic.api.js#L173-L212
5,564
FineUploader/fine-uploader
client/js/uploader.basic.api.js
function(id) { var uploadDataEntry = this.getUploads({id: id}), parentId = null; if (uploadDataEntry) { if (uploadDataEntry.parentId !== undefined) { parentId = uploadDataEntry.parentId; } } return pare...
javascript
function(id) { var uploadDataEntry = this.getUploads({id: id}), parentId = null; if (uploadDataEntry) { if (uploadDataEntry.parentId !== undefined) { parentId = uploadDataEntry.parentId; } } return pare...
[ "function", "(", "id", ")", "{", "var", "uploadDataEntry", "=", "this", ".", "getUploads", "(", "{", "id", ":", "id", "}", ")", ",", "parentId", "=", "null", ";", "if", "(", "uploadDataEntry", ")", "{", "if", "(", "uploadDataEntry", ".", "parentId", ...
Parent ID for a specific file, or null if this is the parent, or if it has no parent.
[ "Parent", "ID", "for", "a", "specific", "file", "or", "null", "if", "this", "is", "the", "parent", "or", "if", "it", "has", "no", "parent", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/uploader.basic.api.js#L252-L263
5,565
FineUploader/fine-uploader
client/js/uploader.basic.api.js
function(spec) { var self = this, acceptFiles = spec.accept || this._options.validation.acceptFiles, allowedExtensions = spec.allowedExtensions || this._options.validation.allowedExtensions, button; function allowMultiple() { if (q...
javascript
function(spec) { var self = this, acceptFiles = spec.accept || this._options.validation.acceptFiles, allowedExtensions = spec.allowedExtensions || this._options.validation.allowedExtensions, button; function allowMultiple() { if (q...
[ "function", "(", "spec", ")", "{", "var", "self", "=", "this", ",", "acceptFiles", "=", "spec", ".", "accept", "||", "this", ".", "_options", ".", "validation", ".", "acceptFiles", ",", "allowedExtensions", "=", "spec", ".", "allowedExtensions", "||", "thi...
Generate a tracked upload button. @param spec Object containing a required `element` property along with optional `multiple`, `accept`, and `folders`. @returns {qq.UploadButton} @private
[ "Generate", "a", "tracked", "upload", "button", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/uploader.basic.api.js#L670-L719
5,566
FineUploader/fine-uploader
client/js/uploader.basic.api.js
function(buttonOrFileInputOrFile) { var inputs, fileInput, fileBlobOrInput = buttonOrFileInputOrFile; // We want the reference file/blob here if this is a proxy (a file that will be generated on-demand later) if (fileBlobOrInput instanceof qq.BlobProxy) { ...
javascript
function(buttonOrFileInputOrFile) { var inputs, fileInput, fileBlobOrInput = buttonOrFileInputOrFile; // We want the reference file/blob here if this is a proxy (a file that will be generated on-demand later) if (fileBlobOrInput instanceof qq.BlobProxy) { ...
[ "function", "(", "buttonOrFileInputOrFile", ")", "{", "var", "inputs", ",", "fileInput", ",", "fileBlobOrInput", "=", "buttonOrFileInputOrFile", ";", "// We want the reference file/blob here if this is a proxy (a file that will be generated on-demand later)", "if", "(", "fileBlobOr...
Gets the internally used tracking ID for a button. @param buttonOrFileInputOrFile `File`, `<input type="file">`, or a button container element @returns {*} The button's ID, or undefined if no ID is recoverable @private
[ "Gets", "the", "internally", "used", "tracking", "ID", "for", "a", "button", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/uploader.basic.api.js#L942-L975
5,567
FineUploader/fine-uploader
client/js/uploader.basic.api.js
function() { if (this._options.camera.ios && qq.ios()) { var acceptIosCamera = "image/*;capture=camera", button = this._options.camera.button, buttonId = button ? this._getButtonId(button) : this._defaultButtonId, optionRoot = this....
javascript
function() { if (this._options.camera.ios && qq.ios()) { var acceptIosCamera = "image/*;capture=camera", button = this._options.camera.button, buttonId = button ? this._getButtonId(button) : this._defaultButtonId, optionRoot = this....
[ "function", "(", ")", "{", "if", "(", "this", ".", "_options", ".", "camera", ".", "ios", "&&", "qq", ".", "ios", "(", ")", ")", "{", "var", "acceptIosCamera", "=", "\"image/*;capture=camera\"", ",", "button", "=", "this", ".", "_options", ".", "camera...
Allows camera access on either the default or an extra button for iOS devices.
[ "Allows", "camera", "access", "on", "either", "the", "default", "or", "an", "extra", "button", "for", "iOS", "devices", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/uploader.basic.api.js#L1028-L1061
5,568
FineUploader/fine-uploader
client/js/uploader.basic.api.js
function(spec) { var button = this._createUploadButton({ accept: spec.validation.acceptFiles, allowedExtensions: spec.validation.allowedExtensions, element: spec.element, folders: spec.folders, multiple: spec.multiple, ...
javascript
function(spec) { var button = this._createUploadButton({ accept: spec.validation.acceptFiles, allowedExtensions: spec.validation.allowedExtensions, element: spec.element, folders: spec.folders, multiple: spec.multiple, ...
[ "function", "(", "spec", ")", "{", "var", "button", "=", "this", ".", "_createUploadButton", "(", "{", "accept", ":", "spec", ".", "validation", ".", "acceptFiles", ",", "allowedExtensions", ":", "spec", ".", "validation", ".", "allowedExtensions", ",", "ele...
Creates an extra button element
[ "Creates", "an", "extra", "button", "element" ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/uploader.basic.api.js#L1192-L1203
5,569
FineUploader/fine-uploader
client/js/uploader.basic.api.js
function(id) { var buttonId; if (qq.supportedFeatures.ajaxUploading) { buttonId = this._handler.getFile(id).qqButtonId; } else { buttonId = this._getButtonId(this._handler.getInput(id)); } if (buttonId) { ...
javascript
function(id) { var buttonId; if (qq.supportedFeatures.ajaxUploading) { buttonId = this._handler.getFile(id).qqButtonId; } else { buttonId = this._getButtonId(this._handler.getInput(id)); } if (buttonId) { ...
[ "function", "(", "id", ")", "{", "var", "buttonId", ";", "if", "(", "qq", ".", "supportedFeatures", ".", "ajaxUploading", ")", "{", "buttonId", "=", "this", ".", "_handler", ".", "getFile", "(", "id", ")", ".", "qqButtonId", ";", "}", "else", "{", "b...
Maps a file with the button that was used to select it.
[ "Maps", "a", "file", "with", "the", "button", "that", "was", "used", "to", "select", "it", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/uploader.basic.api.js#L1810-L1823
5,570
FineUploader/fine-uploader
client/js/uploader.basic.api.js
function(fileWrapper, validationDescriptor) { var self = this, file = (function() { if (fileWrapper.file instanceof qq.BlobProxy) { return fileWrapper.file.referenceBlob; } return fileWrapper.file; ...
javascript
function(fileWrapper, validationDescriptor) { var self = this, file = (function() { if (fileWrapper.file instanceof qq.BlobProxy) { return fileWrapper.file.referenceBlob; } return fileWrapper.file; ...
[ "function", "(", "fileWrapper", ",", "validationDescriptor", ")", "{", "var", "self", "=", "this", ",", "file", "=", "(", "function", "(", ")", "{", "if", "(", "fileWrapper", ".", "file", "instanceof", "qq", ".", "BlobProxy", ")", "{", "return", "fileWra...
Performs some internal validation checks on an item, defined in the `validation` option. @param fileWrapper Wrapper containing a `file` along with an `id` @param validationDescriptor Normalized information about the item (`size`, `name`). @returns qq.Promise with appropriate callbacks invoked depending on the validity...
[ "Performs", "some", "internal", "validation", "checks", "on", "an", "item", "defined", "in", "the", "validation", "option", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/uploader.basic.api.js#L1895-L1949
5,571
FineUploader/fine-uploader
client/js/image-support/scaler.js
function(sizes) { "use strict"; sizes = qq.extend([], sizes); return sizes.sort(function(a, b) { if (a.maxSize > b.maxSize) { return 1; } if (a.maxSize < b.maxSize) { return -1; } return 0; }); ...
javascript
function(sizes) { "use strict"; sizes = qq.extend([], sizes); return sizes.sort(function(a, b) { if (a.maxSize > b.maxSize) { return 1; } if (a.maxSize < b.maxSize) { return -1; } return 0; }); ...
[ "function", "(", "sizes", ")", "{", "\"use strict\"", ";", "sizes", "=", "qq", ".", "extend", "(", "[", "]", ",", "sizes", ")", ";", "return", "sizes", ".", "sort", "(", "function", "(", "a", ",", "b", ")", "{", "if", "(", "a", ".", "maxSize", ...
We want the smallest scaled file to be uploaded first
[ "We", "want", "the", "smallest", "scaled", "file", "to", "be", "uploaded", "first" ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/image-support/scaler.js#L276-L290
5,572
FineUploader/fine-uploader
client/js/image-support/scaler.js
function(originalImage, scaledImageDataUri, log) { "use strict"; var reader = new FileReader(), insertionEffort = new qq.Promise(), originalImageDataUri = ""; reader.onload = function() { originalImageDataUri = reader.result; insertionEffort.succ...
javascript
function(originalImage, scaledImageDataUri, log) { "use strict"; var reader = new FileReader(), insertionEffort = new qq.Promise(), originalImageDataUri = ""; reader.onload = function() { originalImageDataUri = reader.result; insertionEffort.succ...
[ "function", "(", "originalImage", ",", "scaledImageDataUri", ",", "log", ")", "{", "\"use strict\"", ";", "var", "reader", "=", "new", "FileReader", "(", ")", ",", "insertionEffort", "=", "new", "qq", ".", "Promise", "(", ")", ",", "originalImageDataUri", "=...
Attempt to insert the original image's EXIF header into a scaled version.
[ "Attempt", "to", "insert", "the", "original", "image", "s", "EXIF", "header", "into", "a", "scaled", "version", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/image-support/scaler.js#L340-L360
5,573
FineUploader/fine-uploader
client/js/form-support.js
maybeUploadOnSubmit
function maybeUploadOnSubmit(formEl) { var nativeSubmit = formEl.submit; // Intercept and squelch submit events. qq(formEl).attach("submit", function(event) { event = event || window.event; if (event.preventDefault) { event.preventDefault(); ...
javascript
function maybeUploadOnSubmit(formEl) { var nativeSubmit = formEl.submit; // Intercept and squelch submit events. qq(formEl).attach("submit", function(event) { event = event || window.event; if (event.preventDefault) { event.preventDefault(); ...
[ "function", "maybeUploadOnSubmit", "(", "formEl", ")", "{", "var", "nativeSubmit", "=", "formEl", ".", "submit", ";", "// Intercept and squelch submit events.", "qq", "(", "formEl", ")", ".", "attach", "(", "\"submit\"", ",", "function", "(", "event", ")", "{", ...
Intercept form submit attempts, unless the integrator has told us not to do this.
[ "Intercept", "form", "submit", "attempts", "unless", "the", "integrator", "has", "told", "us", "not", "to", "do", "this", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/form-support.js#L62-L84
5,574
FineUploader/fine-uploader
client/js/upload-data.js
function(spec) { var status = spec.status || qq.status.SUBMITTING, id = data.push({ name: spec.name, originalName: spec.name, uuid: spec.uuid, size: spec.size == null ? -1 : spec.size, status:...
javascript
function(spec) { var status = spec.status || qq.status.SUBMITTING, id = data.push({ name: spec.name, originalName: spec.name, uuid: spec.uuid, size: spec.size == null ? -1 : spec.size, status:...
[ "function", "(", "spec", ")", "{", "var", "status", "=", "spec", ".", "status", "||", "qq", ".", "status", ".", "SUBMITTING", ",", "id", "=", "data", ".", "push", "(", "{", "name", ":", "spec", ".", "name", ",", "originalName", ":", "spec", ".", ...
Adds a new file to the data cache for tracking purposes. @param spec Data that describes this file. Possible properties are: - uuid: Initial UUID for this file. - name: Initial name of this file. - size: Size of this file, omit if this cannot be determined - status: Initial `qq.status` for this file. Omit for `qq.s...
[ "Adds", "a", "new", "file", "to", "the", "data", "cache", "for", "tracking", "purposes", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/upload-data.js#L72-L113
5,575
FineUploader/fine-uploader
client/js/azure/util.js
function(name) { if (qq.azure.util._paramNameMatchesAzureParameter(name)) { return name; } else { return qq.azure.util.AZURE_PARAM_PREFIX + name; } }
javascript
function(name) { if (qq.azure.util._paramNameMatchesAzureParameter(name)) { return name; } else { return qq.azure.util.AZURE_PARAM_PREFIX + name; } }
[ "function", "(", "name", ")", "{", "if", "(", "qq", ".", "azure", ".", "util", ".", "_paramNameMatchesAzureParameter", "(", "name", ")", ")", "{", "return", "name", ";", "}", "else", "{", "return", "qq", ".", "azure", ".", "util", ".", "AZURE_PARAM_PRE...
Create Prefixed request headers which are appropriate for Azure. If the request header is appropriate for Azure (e.g. Cache-Control) then it should be passed along without a metadata prefix. For all other request header parameter names, qq.azure.util.AZURE_PARAM_PREFIX should be prepended. @param name Name of the Req...
[ "Create", "Prefixed", "request", "headers", "which", "are", "appropriate", "for", "Azure", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/azure/util.js#L39-L46
5,576
FineUploader/fine-uploader
client/js/ui.handler.focusin.filenameinput.js
handleInputFocus
function handleInputFocus(target, event) { if (spec.templating.isEditInput(target)) { var fileId = spec.templating.getFileId(target), status = spec.onGetUploadStatus(fileId); if (status === qq.status.SUBMITTED) { spec.log(qq.format("Detected valid filenam...
javascript
function handleInputFocus(target, event) { if (spec.templating.isEditInput(target)) { var fileId = spec.templating.getFileId(target), status = spec.onGetUploadStatus(fileId); if (status === qq.status.SUBMITTED) { spec.log(qq.format("Detected valid filenam...
[ "function", "handleInputFocus", "(", "target", ",", "event", ")", "{", "if", "(", "spec", ".", "templating", ".", "isEditInput", "(", "target", ")", ")", "{", "var", "fileId", "=", "spec", ".", "templating", ".", "getFileId", "(", "target", ")", ",", "...
This will be called by the parent handler when a `focusin` event is received on the list element.
[ "This", "will", "be", "called", "by", "the", "parent", "handler", "when", "a", "focusin", "event", "is", "received", "on", "the", "list", "element", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/ui.handler.focusin.filenameinput.js#L17-L27
5,577
FineUploader/fine-uploader
client/js/image-support/image.js
draw
function draw(fileOrBlob, container, options) { var drawPreview = new qq.Promise(), identifier = new qq.Identify(fileOrBlob, log), maxSize = options.maxSize, // jshint eqnull:true orient = options.orient == null ? true : options.orient, megapixErrorHan...
javascript
function draw(fileOrBlob, container, options) { var drawPreview = new qq.Promise(), identifier = new qq.Identify(fileOrBlob, log), maxSize = options.maxSize, // jshint eqnull:true orient = options.orient == null ? true : options.orient, megapixErrorHan...
[ "function", "draw", "(", "fileOrBlob", ",", "container", ",", "options", ")", "{", "var", "drawPreview", "=", "new", "qq", ".", "Promise", "(", ")", ",", "identifier", "=", "new", "qq", ".", "Identify", "(", "fileOrBlob", ",", "log", ")", ",", "maxSize...
Draw a preview iff the current UA can natively display it. Also rotate the image if necessary.
[ "Draw", "a", "preview", "iff", "the", "current", "UA", "can", "natively", "display", "it", ".", "Also", "rotate", "the", "image", "if", "necessary", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/image-support/image.js#L136-L196
5,578
FineUploader/fine-uploader
client/js/third-party/crypto-js/core.js
function (nBytes) { var words = []; for (var i = 0; i < nBytes; i += 4) { words.push((Math.random() * 0x100000000) | 0); } return new WordArray.init(words, nBytes); }
javascript
function (nBytes) { var words = []; for (var i = 0; i < nBytes; i += 4) { words.push((Math.random() * 0x100000000) | 0); } return new WordArray.init(words, nBytes); }
[ "function", "(", "nBytes", ")", "{", "var", "words", "=", "[", "]", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "nBytes", ";", "i", "+=", "4", ")", "{", "words", ".", "push", "(", "(", "Math", ".", "random", "(", ")", "*", "0x1000...
Creates a word array filled with random bytes. @param {number} nBytes The number of random bytes to generate. @return {WordArray} The random word array. @static @example var wordArray = CryptoJS.lib.WordArray.random(16);
[ "Creates", "a", "word", "array", "filled", "with", "random", "bytes", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/third-party/crypto-js/core.js#L280-L287
5,579
FineUploader/fine-uploader
client/js/third-party/crypto-js/core.js
function (data) { // Convert string to WordArray, else assume WordArray already if (typeof data == 'string') { data = Utf8.parse(data); } // Append this._data.concat(data); this._nDataBytes += data.sigBytes; }
javascript
function (data) { // Convert string to WordArray, else assume WordArray already if (typeof data == 'string') { data = Utf8.parse(data); } // Append this._data.concat(data); this._nDataBytes += data.sigBytes; }
[ "function", "(", "data", ")", "{", "// Convert string to WordArray, else assume WordArray already", "if", "(", "typeof", "data", "==", "'string'", ")", "{", "data", "=", "Utf8", ".", "parse", "(", "data", ")", ";", "}", "// Append", "this", ".", "_data", ".", ...
Adds new data to this block algorithm's buffer. @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. @example bufferedBlockAlgorithm._append('data'); bufferedBlockAlgorithm._append(wordArray);
[ "Adds", "new", "data", "to", "this", "block", "algorithm", "s", "buffer", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/third-party/crypto-js/core.js#L488-L497
5,580
FineUploader/fine-uploader
client/js/third-party/crypto-js/core.js
function (hasher) { return function (message, key) { return new C_algo.HMAC.init(hasher, key).finalize(message); }; }
javascript
function (hasher) { return function (message, key) { return new C_algo.HMAC.init(hasher, key).finalize(message); }; }
[ "function", "(", "hasher", ")", "{", "return", "function", "(", "message", ",", "key", ")", "{", "return", "new", "C_algo", ".", "HMAC", ".", "init", "(", "hasher", ",", "key", ")", ".", "finalize", "(", "message", ")", ";", "}", ";", "}" ]
Creates a shortcut function to the HMAC's object interface. @param {Hasher} hasher The hasher to use in this HMAC helper. @return {Function} The shortcut function. @static @example var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
[ "Creates", "a", "shortcut", "function", "to", "the", "HMAC", "s", "object", "interface", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/third-party/crypto-js/core.js#L699-L703
5,581
FineUploader/fine-uploader
client/js/s3/util.js
function(endpoint) { var patterns = [ //bucket in domain /^(?:https?:\/\/)?([a-z0-9.\-_]+)\.s3(?:-[a-z0-9\-]+)?\.amazonaws\.com/i, //bucket in path /^(?:https?:\/\/)?s3(?:-[a-z0-9\-]+)?\.amazonaws\.com\/([a-z0-9.\-_]+)/i, ...
javascript
function(endpoint) { var patterns = [ //bucket in domain /^(?:https?:\/\/)?([a-z0-9.\-_]+)\.s3(?:-[a-z0-9\-]+)?\.amazonaws\.com/i, //bucket in path /^(?:https?:\/\/)?s3(?:-[a-z0-9\-]+)?\.amazonaws\.com\/([a-z0-9.\-_]+)/i, ...
[ "function", "(", "endpoint", ")", "{", "var", "patterns", "=", "[", "//bucket in domain", "/", "^(?:https?:\\/\\/)?([a-z0-9.\\-_]+)\\.s3(?:-[a-z0-9\\-]+)?\\.amazonaws\\.com", "/", "i", ",", "//bucket in path", "/", "^(?:https?:\\/\\/)?s3(?:-[a-z0-9\\-]+)?\\.amazonaws\\.com\\/([a-z0...
This allows for the region to be specified in the bucket's endpoint URL, or not. Examples of some valid endpoints are: http://foo.s3.amazonaws.com https://foo.s3.amazonaws.com http://foo.s3-ap-northeast-1.amazonaws.com foo.s3.amazonaws.com http://foo.bar.com http://s3.amazonaws.com/foo.bar.com ...etc @param endpoint ...
[ "This", "allows", "for", "the", "region", "to", "be", "specified", "in", "the", "bucket", "s", "endpoint", "URL", "or", "not", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/s3/util.js#L69-L90
5,582
FineUploader/fine-uploader
client/js/s3/util.js
function(name) { if (qq.indexOf(qq.s3.util.UNPREFIXED_PARAM_NAMES, name) >= 0) { return name; } return qq.s3.util.AWS_PARAM_PREFIX + name; }
javascript
function(name) { if (qq.indexOf(qq.s3.util.UNPREFIXED_PARAM_NAMES, name) >= 0) { return name; } return qq.s3.util.AWS_PARAM_PREFIX + name; }
[ "function", "(", "name", ")", "{", "if", "(", "qq", ".", "indexOf", "(", "qq", ".", "s3", ".", "util", ".", "UNPREFIXED_PARAM_NAMES", ",", "name", ")", ">=", "0", ")", "{", "return", "name", ";", "}", "return", "qq", ".", "s3", ".", "util", ".", ...
Create Prefixed request headers which are appropriate for S3. If the request header is appropriate for S3 (e.g. Cache-Control) then pass it along without a metadata prefix. For all other request header parameter names, apply qq.s3.util.AWS_PARAM_PREFIX before the name. See: http://docs.aws.amazon.com/AmazonS3/latest/A...
[ "Create", "Prefixed", "request", "headers", "which", "are", "appropriate", "for", "S3", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/s3/util.js#L99-L104
5,583
FineUploader/fine-uploader
client/js/s3/util.js
function(policy, minSize, maxSize) { var adjustedMinSize = minSize < 0 ? 0 : minSize, // Adjust a maxSize of 0 to the largest possible integer, since we must specify a high and a low in the request adjustedMaxSize = maxSize <= 0 ? 9007199254740992 : maxSize; if (...
javascript
function(policy, minSize, maxSize) { var adjustedMinSize = minSize < 0 ? 0 : minSize, // Adjust a maxSize of 0 to the largest possible integer, since we must specify a high and a low in the request adjustedMaxSize = maxSize <= 0 ? 9007199254740992 : maxSize; if (...
[ "function", "(", "policy", ",", "minSize", ",", "maxSize", ")", "{", "var", "adjustedMinSize", "=", "minSize", "<", "0", "?", "0", ":", "minSize", ",", "// Adjust a maxSize of 0 to the largest possible integer, since we must specify a high and a low in the request", "adjust...
Add a condition to an existing S3 upload request policy document used to ensure AWS enforces any size restrictions placed on files server-side. This is important to do, in case users mess with the client-side checks already in place. @param policy Policy document as an `Object`, with a `conditions` property already a...
[ "Add", "a", "condition", "to", "an", "existing", "S3", "upload", "request", "policy", "document", "used", "to", "ensure", "AWS", "enforces", "any", "size", "restrictions", "placed", "on", "files", "server", "-", "side", ".", "This", "is", "important", "to", ...
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/s3/util.js#L361-L369
5,584
FineUploader/fine-uploader
client/js/s3/util.js
function(iframe) { var doc = iframe.contentDocument || iframe.contentWindow.document, queryString = doc.location.search, match = /bucket=(.+)&key=(.+)&etag=(.+)/.exec(queryString); if (match) { return { bucket: match[1], ...
javascript
function(iframe) { var doc = iframe.contentDocument || iframe.contentWindow.document, queryString = doc.location.search, match = /bucket=(.+)&key=(.+)&etag=(.+)/.exec(queryString); if (match) { return { bucket: match[1], ...
[ "function", "(", "iframe", ")", "{", "var", "doc", "=", "iframe", ".", "contentDocument", "||", "iframe", ".", "contentWindow", ".", "document", ",", "queryString", "=", "doc", ".", "location", ".", "search", ",", "match", "=", "/", "bucket=(.+)&key=(.+)&eta...
Looks at a response from S3 contained in an iframe and parses the query string in an attempt to identify the associated resource. @param iframe Iframe containing response @returns {{bucket: *, key: *, etag: *}}
[ "Looks", "at", "a", "response", "from", "S3", "contained", "in", "an", "iframe", "and", "parses", "the", "query", "string", "in", "an", "attempt", "to", "identify", "the", "associated", "resource", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/s3/util.js#L422-L434
5,585
FineUploader/fine-uploader
client/js/ajax.requester.js
getCorsAjaxTransport
function getCorsAjaxTransport() { var xhrOrXdr; if (window.XMLHttpRequest || window.ActiveXObject) { xhrOrXdr = qq.createXhrInstance(); if (xhrOrXdr.withCredentials === undefined) { xhrOrXdr = new XDomainRequest(); // Workaround for XDR bug in IE...
javascript
function getCorsAjaxTransport() { var xhrOrXdr; if (window.XMLHttpRequest || window.ActiveXObject) { xhrOrXdr = qq.createXhrInstance(); if (xhrOrXdr.withCredentials === undefined) { xhrOrXdr = new XDomainRequest(); // Workaround for XDR bug in IE...
[ "function", "getCorsAjaxTransport", "(", ")", "{", "var", "xhrOrXdr", ";", "if", "(", "window", ".", "XMLHttpRequest", "||", "window", ".", "ActiveXObject", ")", "{", "xhrOrXdr", "=", "qq", ".", "createXhrInstance", "(", ")", ";", "if", "(", "xhrOrXdr", "....
Returns either a new `XMLHttpRequest` or `XDomainRequest` instance.
[ "Returns", "either", "a", "new", "XMLHttpRequest", "or", "XDomainRequest", "instance", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/ajax.requester.js#L73-L90
5,586
FineUploader/fine-uploader
client/js/ajax.requester.js
dequeue
function dequeue(id) { var i = qq.indexOf(queue, id), max = options.maxConnections, nextId; delete requestData[id]; queue.splice(i, 1); if (queue.length >= max && i < max) { nextId = queue[max - 1]; sendRequest(nextId); } }
javascript
function dequeue(id) { var i = qq.indexOf(queue, id), max = options.maxConnections, nextId; delete requestData[id]; queue.splice(i, 1); if (queue.length >= max && i < max) { nextId = queue[max - 1]; sendRequest(nextId); } }
[ "function", "dequeue", "(", "id", ")", "{", "var", "i", "=", "qq", ".", "indexOf", "(", "queue", ",", "id", ")", ",", "max", "=", "options", ".", "maxConnections", ",", "nextId", ";", "delete", "requestData", "[", "id", "]", ";", "queue", ".", "spl...
Removes element from queue, sends next request
[ "Removes", "element", "from", "queue", "sends", "next", "request" ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/ajax.requester.js#L116-L128
5,587
FineUploader/fine-uploader
client/js/ajax.requester.js
function(optXhr) { if (cacheBuster && qq.indexOf(["GET", "DELETE"], options.method) >= 0) { params.qqtimestamp = new Date().getTime(); } return prepareToSend(id, optXhr, path, params, additionalQueryParams, headers, payload); ...
javascript
function(optXhr) { if (cacheBuster && qq.indexOf(["GET", "DELETE"], options.method) >= 0) { params.qqtimestamp = new Date().getTime(); } return prepareToSend(id, optXhr, path, params, additionalQueryParams, headers, payload); ...
[ "function", "(", "optXhr", ")", "{", "if", "(", "cacheBuster", "&&", "qq", ".", "indexOf", "(", "[", "\"GET\"", ",", "\"DELETE\"", "]", ",", "options", ".", "method", ")", ">=", "0", ")", "{", "params", ".", "qqtimestamp", "=", "new", "Date", "(", ...
Send the constructed request.
[ "Send", "the", "constructed", "request", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/ajax.requester.js#L390-L396
5,588
FineUploader/fine-uploader
client/js/s3/uploader.basic.js
function() { var self = this, additionalOptions = { aclStore: this._aclStore, getBucket: qq.bind(this._determineBucket, this), getHost: qq.bind(this._determineHost, this), getKeyName: qq.bind(this._determineKeyNa...
javascript
function() { var self = this, additionalOptions = { aclStore: this._aclStore, getBucket: qq.bind(this._determineBucket, this), getHost: qq.bind(this._determineHost, this), getKeyName: qq.bind(this._determineKeyNa...
[ "function", "(", ")", "{", "var", "self", "=", "this", ",", "additionalOptions", "=", "{", "aclStore", ":", "this", ".", "_aclStore", ",", "getBucket", ":", "qq", ".", "bind", "(", "this", ".", "_determineBucket", ",", "this", ")", ",", "getHost", ":",...
Ensures the parent's upload handler creator passes any additional S3-specific options to the handler as well as information required to instantiate the specific handler based on the current browser's capabilities. @returns {qq.UploadHandlerController} @private
[ "Ensures", "the", "parent", "s", "upload", "handler", "creator", "passes", "any", "additional", "S3", "-", "specific", "options", "to", "the", "handler", "as", "well", "as", "information", "required", "to", "instantiate", "the", "specific", "handler", "based", ...
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/s3/uploader.basic.js#L197-L286
5,589
FineUploader/fine-uploader
client/js/s3/uploader.basic.js
function(keynameFunc, id, successCallback, failureCallback) { var self = this, onSuccess = function(keyname) { successCallback(keyname); }, onFailure = function(reason) { self.log(qq.format("Failed to retrieve key name f...
javascript
function(keynameFunc, id, successCallback, failureCallback) { var self = this, onSuccess = function(keyname) { successCallback(keyname); }, onFailure = function(reason) { self.log(qq.format("Failed to retrieve key name f...
[ "function", "(", "keynameFunc", ",", "id", ",", "successCallback", ",", "failureCallback", ")", "{", "var", "self", "=", "this", ",", "onSuccess", "=", "function", "(", "keyname", ")", "{", "successCallback", "(", "keyname", ")", ";", "}", ",", "onFailure"...
Called by the internal onUpload handler if the integrator has supplied a function to determine the file's key name. The integrator's function may be promissory. We also need to fulfill the promise contract associated with the caller as well. @param keynameFunc Integrator-supplied function that must be executed to de...
[ "Called", "by", "the", "internal", "onUpload", "handler", "if", "the", "integrator", "has", "supplied", "a", "function", "to", "determine", "the", "file", "s", "key", "name", ".", "The", "integrator", "s", "function", "may", "be", "promissory", ".", "We", ...
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/s3/uploader.basic.js#L384-L405
5,590
FineUploader/fine-uploader
client/js/s3/uploader.basic.js
function(id, onSuccessCallback) { var additionalMandatedParams = { key: this.getKey(id), bucket: this.getBucket(id) }; return qq.FineUploaderBasic.prototype._onSubmitDelete.call(this, id, onSuccessCallback, additionalMandatedParams); }
javascript
function(id, onSuccessCallback) { var additionalMandatedParams = { key: this.getKey(id), bucket: this.getBucket(id) }; return qq.FineUploaderBasic.prototype._onSubmitDelete.call(this, id, onSuccessCallback, additionalMandatedParams); }
[ "function", "(", "id", ",", "onSuccessCallback", ")", "{", "var", "additionalMandatedParams", "=", "{", "key", ":", "this", ".", "getKey", "(", "id", ")", ",", "bucket", ":", "this", ".", "getBucket", "(", "id", ")", "}", ";", "return", "qq", ".", "F...
Hooks into the base internal `_onSubmitDelete` to add key and bucket params to the delete file request.
[ "Hooks", "into", "the", "base", "internal", "_onSubmitDelete", "to", "add", "key", "and", "bucket", "params", "to", "the", "delete", "file", "request", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/s3/uploader.basic.js#L426-L433
5,591
FineUploader/fine-uploader
client/js/upload-handler/upload.handler.controller.js
function(id, chunkIdx, response, xhr) { var chunkData = handler._getChunkData(id, chunkIdx); handler._getFileState(id).attemptingResume = false; delete handler._getFileState(id).temp.chunkProgress[chunkIdx]; handler._getFileState(id).loaded += chunkData.size; ...
javascript
function(id, chunkIdx, response, xhr) { var chunkData = handler._getChunkData(id, chunkIdx); handler._getFileState(id).attemptingResume = false; delete handler._getFileState(id).temp.chunkProgress[chunkIdx]; handler._getFileState(id).loaded += chunkData.size; ...
[ "function", "(", "id", ",", "chunkIdx", ",", "response", ",", "xhr", ")", "{", "var", "chunkData", "=", "handler", ".", "_getChunkData", "(", "id", ",", "chunkIdx", ")", ";", "handler", ".", "_getFileState", "(", "id", ")", ".", "attemptingResume", "=", ...
Called when each chunk has uploaded successfully
[ "Called", "when", "each", "chunk", "has", "uploaded", "successfully" ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/upload-handler/upload.handler.controller.js#L46-L55
5,592
FineUploader/fine-uploader
client/js/upload-handler/upload.handler.controller.js
function(id) { var size = options.getSize(id), name = options.getName(id); log("All chunks have been uploaded for " + id + " - finalizing...."); handler.finalizeChunks(id).then( function(response, xhr) { log("Finalize successful fo...
javascript
function(id) { var size = options.getSize(id), name = options.getName(id); log("All chunks have been uploaded for " + id + " - finalizing...."); handler.finalizeChunks(id).then( function(response, xhr) { log("Finalize successful fo...
[ "function", "(", "id", ")", "{", "var", "size", "=", "options", ".", "getSize", "(", "id", ")", ",", "name", "=", "options", ".", "getName", "(", "id", ")", ";", "log", "(", "\"All chunks have been uploaded for \"", "+", "id", "+", "\" - finalizing....\"",...
Called when all chunks have been successfully uploaded and we want to ask the handler to perform any logic associated with closing out the file, such as combining the chunks.
[ "Called", "when", "all", "chunks", "have", "been", "successfully", "uploaded", "and", "we", "want", "to", "ask", "the", "handler", "to", "perform", "any", "logic", "associated", "with", "closing", "out", "the", "file", "such", "as", "combining", "the", "chun...
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/upload-handler/upload.handler.controller.js#L59-L91
5,593
FineUploader/fine-uploader
client/js/upload-handler/upload.handler.controller.js
function(errorMessage) { var errorResponse = {}; if (errorMessage) { errorResponse.error = errorMessage; } log(qq.format("Failed to generate blob for ID {}. Error message: {}.", id, errorMessage), "error"); ...
javascript
function(errorMessage) { var errorResponse = {}; if (errorMessage) { errorResponse.error = errorMessage; } log(qq.format("Failed to generate blob for ID {}. Error message: {}.", id, errorMessage), "error"); ...
[ "function", "(", "errorMessage", ")", "{", "var", "errorResponse", "=", "{", "}", ";", "if", "(", "errorMessage", ")", "{", "errorResponse", ".", "error", "=", "errorMessage", ";", "}", "log", "(", "qq", ".", "format", "(", "\"Failed to generate blob for ID ...
Blob could not be generated. Fail the upload & attempt to prevent retries. Also bubble error message.
[ "Blob", "could", "not", "be", "generated", ".", "Fail", "the", "upload", "&", "attempt", "to", "prevent", "retries", ".", "Also", "bubble", "error", "message", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/upload-handler/upload.handler.controller.js#L519-L531
5,594
FineUploader/fine-uploader
client/js/upload-handler/upload.handler.controller.js
function(originalResponse, successful) { var response = originalResponse; // The passed "response" param may not be a response at all. // It could be a string, detailing the error, for example. if (!qq.isObject(originalResponse)) { response = {}; ...
javascript
function(originalResponse, successful) { var response = originalResponse; // The passed "response" param may not be a response at all. // It could be a string, detailing the error, for example. if (!qq.isObject(originalResponse)) { response = {}; ...
[ "function", "(", "originalResponse", ",", "successful", ")", "{", "var", "response", "=", "originalResponse", ";", "// The passed \"response\" param may not be a response at all.", "// It could be a string, detailing the error, for example.", "if", "(", "!", "qq", ".", "isObjec...
The response coming from handler implementations may be in various formats. Instead of hoping a promise nested 5 levels deep will always return an object as its first param, let's just normalize the response here.
[ "The", "response", "coming", "from", "handler", "implementations", "may", "be", "in", "various", "formats", ".", "Instead", "of", "hoping", "a", "promise", "nested", "5", "levels", "deep", "will", "always", "return", "an", "object", "as", "its", "first", "pa...
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/upload-handler/upload.handler.controller.js#L575-L591
5,595
FineUploader/fine-uploader
client/js/upload-handler/upload.handler.controller.js
function() { var waitingOrConnected = connectionManager.getWaitingOrConnected(), i; // ensure files are cancelled in reverse order which they were added // to avoid a flash of time where a queued file begins to upload before it is canceled if (waitingOrCo...
javascript
function() { var waitingOrConnected = connectionManager.getWaitingOrConnected(), i; // ensure files are cancelled in reverse order which they were added // to avoid a flash of time where a queued file begins to upload before it is canceled if (waitingOrCo...
[ "function", "(", ")", "{", "var", "waitingOrConnected", "=", "connectionManager", ".", "getWaitingOrConnected", "(", ")", ",", "i", ";", "// ensure files are cancelled in reverse order which they were added", "// to avoid a flash of time where a queued file begins to upload before it...
Cancels all queued or in-progress uploads
[ "Cancels", "all", "queued", "or", "in", "-", "progress", "uploads" ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/upload-handler/upload.handler.controller.js#L703-L716
5,596
FineUploader/fine-uploader
client/js/upload-handler/upload.handler.controller.js
function(id) { if (controller.isResumable(id) && handler.pause && controller.isValid(id) && handler.pause(id)) { connectionManager.free(id); handler.moveInProgressToRemaining(id); return true; } return false; }
javascript
function(id) { if (controller.isResumable(id) && handler.pause && controller.isValid(id) && handler.pause(id)) { connectionManager.free(id); handler.moveInProgressToRemaining(id); return true; } return false; }
[ "function", "(", "id", ")", "{", "if", "(", "controller", ".", "isResumable", "(", "id", ")", "&&", "handler", ".", "pause", "&&", "controller", ".", "isValid", "(", "id", ")", "&&", "handler", ".", "pause", "(", "id", ")", ")", "{", "connectionManag...
Attempts to pause the associated upload if the specific handler supports this and the file is "valid". @param id ID of the upload/file to pause @returns {boolean} true if the upload was paused
[ "Attempts", "to", "pause", "the", "associated", "upload", "if", "the", "specific", "handler", "supports", "this", "and", "the", "file", "is", "valid", "." ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/upload-handler/upload.handler.controller.js#L797-L804
5,597
FineUploader/fine-uploader
client/js/features.js
isChrome14OrHigher
function isChrome14OrHigher() { return (qq.chrome() || qq.opera()) && navigator.userAgent.match(/Chrome\/[1][4-9]|Chrome\/[2-9][0-9]/) !== undefined; }
javascript
function isChrome14OrHigher() { return (qq.chrome() || qq.opera()) && navigator.userAgent.match(/Chrome\/[1][4-9]|Chrome\/[2-9][0-9]/) !== undefined; }
[ "function", "isChrome14OrHigher", "(", ")", "{", "return", "(", "qq", ".", "chrome", "(", ")", "||", "qq", ".", "opera", "(", ")", ")", "&&", "navigator", ".", "userAgent", ".", "match", "(", "/", "Chrome\\/[1][4-9]|Chrome\\/[2-9][0-9]", "/", ")", "!==", ...
only way to test for complete Clipboard API support at this time
[ "only", "way", "to", "test", "for", "complete", "Clipboard", "API", "support", "at", "this", "time" ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/features.js#L42-L45
5,598
FineUploader/fine-uploader
client/js/features.js
isCrossOriginXhrSupported
function isCrossOriginXhrSupported() { if (window.XMLHttpRequest) { var xhr = qq.createXhrInstance(); //Commonly accepted test for XHR CORS support. return xhr.withCredentials !== undefined; } return false; }
javascript
function isCrossOriginXhrSupported() { if (window.XMLHttpRequest) { var xhr = qq.createXhrInstance(); //Commonly accepted test for XHR CORS support. return xhr.withCredentials !== undefined; } return false; }
[ "function", "isCrossOriginXhrSupported", "(", ")", "{", "if", "(", "window", ".", "XMLHttpRequest", ")", "{", "var", "xhr", "=", "qq", ".", "createXhrInstance", "(", ")", ";", "//Commonly accepted test for XHR CORS support.", "return", "xhr", ".", "withCredentials",...
Ensure we can send cross-origin `XMLHttpRequest`s
[ "Ensure", "we", "can", "send", "cross", "-", "origin", "XMLHttpRequest", "s" ]
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/features.js#L48-L57
5,599
FineUploader/fine-uploader
client/js/s3/request-signer.js
function(id, toBeSigned) { var params = toBeSigned, signatureConstructor = toBeSigned.signatureConstructor, signatureEffort = new qq.Promise(), queryParams; if (options.signatureSpec.version === 4) { queryParams = {v4: true}; ...
javascript
function(id, toBeSigned) { var params = toBeSigned, signatureConstructor = toBeSigned.signatureConstructor, signatureEffort = new qq.Promise(), queryParams; if (options.signatureSpec.version === 4) { queryParams = {v4: true}; ...
[ "function", "(", "id", ",", "toBeSigned", ")", "{", "var", "params", "=", "toBeSigned", ",", "signatureConstructor", "=", "toBeSigned", ".", "signatureConstructor", ",", "signatureEffort", "=", "new", "qq", ".", "Promise", "(", ")", ",", "queryParams", ";", ...
On success, an object containing the parsed JSON response will be passed into the success handler if the request succeeds. Otherwise an error message will be passed into the failure method. @param id File ID. @param toBeSigned an Object that holds the item(s) to be signed @returns {qq.Promise} A promise that is fulfi...
[ "On", "success", "an", "object", "containing", "the", "parsed", "JSON", "response", "will", "be", "passed", "into", "the", "success", "handler", "if", "the", "request", "succeeds", ".", "Otherwise", "an", "error", "message", "will", "be", "passed", "into", "...
057cc83a7e7657d032a75cf4a6b3612c7b4191da
https://github.com/FineUploader/fine-uploader/blob/057cc83a7e7657d032a75cf4a6b3612c7b4191da/client/js/s3/request-signer.js#L489-L545