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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
11,000 | ternjs/tern | lib/tern.js | invalidDoc | function invalidDoc(doc) {
if (doc.query) {
if (typeof doc.query.type != "string") return ".query.type must be a string";
if (doc.query.start && !isPosition(doc.query.start)) return ".query.start must be a position";
if (doc.query.end && !isPosition(doc.query.end)) return ".query.end must be a pos... | javascript | function invalidDoc(doc) {
if (doc.query) {
if (typeof doc.query.type != "string") return ".query.type must be a string";
if (doc.query.start && !isPosition(doc.query.start)) return ".query.start must be a position";
if (doc.query.end && !isPosition(doc.query.end)) return ".query.end must be a pos... | [
"function",
"invalidDoc",
"(",
"doc",
")",
"{",
"if",
"(",
"doc",
".",
"query",
")",
"{",
"if",
"(",
"typeof",
"doc",
".",
"query",
".",
"type",
"!=",
"\"string\"",
")",
"return",
"\".query.type must be a string\"",
";",
"if",
"(",
"doc",
".",
"query",
... | Baseline query document validation | [
"Baseline",
"query",
"document",
"validation"
] | 3b2707c1c4fa82af8949dd6bb180b439883762be | https://github.com/ternjs/tern/blob/3b2707c1c4fa82af8949dd6bb180b439883762be/lib/tern.js#L546-L566 |
11,001 | ternjs/tern | lib/tern.js | clean | function clean(obj) {
for (var prop in obj) if (obj[prop] == null) delete obj[prop];
return obj;
} | javascript | function clean(obj) {
for (var prop in obj) if (obj[prop] == null) delete obj[prop];
return obj;
} | [
"function",
"clean",
"(",
"obj",
")",
"{",
"for",
"(",
"var",
"prop",
"in",
"obj",
")",
"if",
"(",
"obj",
"[",
"prop",
"]",
"==",
"null",
")",
"delete",
"obj",
"[",
"prop",
"]",
";",
"return",
"obj",
";",
"}"
] | Delete empty fields from result objects | [
"Delete",
"empty",
"fields",
"from",
"result",
"objects"
] | 3b2707c1c4fa82af8949dd6bb180b439883762be | https://github.com/ternjs/tern/blob/3b2707c1c4fa82af8949dd6bb180b439883762be/lib/tern.js#L651-L654 |
11,002 | ternjs/tern | lib/tern.js | compareCompletions | function compareCompletions(a, b) {
if (typeof a != "string") { a = a.name; b = b.name; }
var aUp = /^[A-Z]/.test(a), bUp = /^[A-Z]/.test(b);
if (aUp == bUp) return a < b ? -1 : a == b ? 0 : 1;
else return aUp ? 1 : -1;
} | javascript | function compareCompletions(a, b) {
if (typeof a != "string") { a = a.name; b = b.name; }
var aUp = /^[A-Z]/.test(a), bUp = /^[A-Z]/.test(b);
if (aUp == bUp) return a < b ? -1 : a == b ? 0 : 1;
else return aUp ? 1 : -1;
} | [
"function",
"compareCompletions",
"(",
"a",
",",
"b",
")",
"{",
"if",
"(",
"typeof",
"a",
"!=",
"\"string\"",
")",
"{",
"a",
"=",
"a",
".",
"name",
";",
"b",
"=",
"b",
".",
"name",
";",
"}",
"var",
"aUp",
"=",
"/",
"^[A-Z]",
"/",
".",
"test",
... | Built-in query types | [
"Built",
"-",
"in",
"query",
"types"
] | 3b2707c1c4fa82af8949dd6bb180b439883762be | https://github.com/ternjs/tern/blob/3b2707c1c4fa82af8949dd6bb180b439883762be/lib/tern.js#L661-L666 |
11,003 | Semantic-Org/Semantic-UI-CSS | components/state.js | function() {
var
activeText = text.active || $module.data(metadata.storedText),
inactiveText = text.inactive || $module.data(metadata.storedText)
;
if( module.is.textEnabled() ) {
if( module.is.active() && activeText) {
mo... | javascript | function() {
var
activeText = text.active || $module.data(metadata.storedText),
inactiveText = text.inactive || $module.data(metadata.storedText)
;
if( module.is.textEnabled() ) {
if( module.is.active() && activeText) {
mo... | [
"function",
"(",
")",
"{",
"var",
"activeText",
"=",
"text",
".",
"active",
"||",
"$module",
".",
"data",
"(",
"metadata",
".",
"storedText",
")",
",",
"inactiveText",
"=",
"text",
".",
"inactive",
"||",
"$module",
".",
"data",
"(",
"metadata",
".",
"s... | on mouseout sets text to previous value | [
"on",
"mouseout",
"sets",
"text",
"to",
"previous",
"value"
] | fc9f8bd7e4f5934756ec60c0423f77d1c7be7c6f | https://github.com/Semantic-Org/Semantic-UI-CSS/blob/fc9f8bd7e4f5934756ec60c0423f77d1c7be7c6f/components/state.js#L367-L382 | |
11,004 | Semantic-Org/Semantic-UI-CSS | semantic.js | function(errors) {
var
html = '<ul class="list">'
;
$.each(errors, function(index, value) {
html += '<li>' + value + '</li>';
});
html += '</ul>';
return $(html);
} | javascript | function(errors) {
var
html = '<ul class="list">'
;
$.each(errors, function(index, value) {
html += '<li>' + value + '</li>';
});
html += '</ul>';
return $(html);
} | [
"function",
"(",
"errors",
")",
"{",
"var",
"html",
"=",
"'<ul class=\"list\">'",
";",
"$",
".",
"each",
"(",
"errors",
",",
"function",
"(",
"index",
",",
"value",
")",
"{",
"html",
"+=",
"'<li>'",
"+",
"value",
"+",
"'</li>'",
";",
"}",
")",
";",
... | template that produces error message | [
"template",
"that",
"produces",
"error",
"message"
] | fc9f8bd7e4f5934756ec60c0423f77d1c7be7c6f | https://github.com/Semantic-Org/Semantic-UI-CSS/blob/fc9f8bd7e4f5934756ec60c0423f77d1c7be7c6f/semantic.js#L1812-L1821 | |
11,005 | Semantic-Org/Semantic-UI-CSS | semantic.js | function(value, regExp) {
if(regExp instanceof RegExp) {
return value.match(regExp);
}
var
regExpParts = regExp.match($.fn.form.settings.regExp.flags),
flags
;
// regular expression specified as /baz/gi (flags)
if(regExpParts) {
regExp = (regExpParts.l... | javascript | function(value, regExp) {
if(regExp instanceof RegExp) {
return value.match(regExp);
}
var
regExpParts = regExp.match($.fn.form.settings.regExp.flags),
flags
;
// regular expression specified as /baz/gi (flags)
if(regExpParts) {
regExp = (regExpParts.l... | [
"function",
"(",
"value",
",",
"regExp",
")",
"{",
"if",
"(",
"regExp",
"instanceof",
"RegExp",
")",
"{",
"return",
"value",
".",
"match",
"(",
"regExp",
")",
";",
"}",
"var",
"regExpParts",
"=",
"regExp",
".",
"match",
"(",
"$",
".",
"fn",
".",
"f... | matches specified regExp | [
"matches",
"specified",
"regExp"
] | fc9f8bd7e4f5934756ec60c0423f77d1c7be7c6f | https://github.com/Semantic-Org/Semantic-UI-CSS/blob/fc9f8bd7e4f5934756ec60c0423f77d1c7be7c6f/semantic.js#L1855-L1875 | |
11,006 | Semantic-Org/Semantic-UI-CSS | semantic.js | function(value, range) {
var
intRegExp = $.fn.form.settings.regExp.integer,
min,
max,
parts
;
if( !range || ['', '..'].indexOf(range) !== -1) {
// do nothing
}
else if(range.indexOf('..') == -1) {
if(intRegExp.test(range)) {
min = m... | javascript | function(value, range) {
var
intRegExp = $.fn.form.settings.regExp.integer,
min,
max,
parts
;
if( !range || ['', '..'].indexOf(range) !== -1) {
// do nothing
}
else if(range.indexOf('..') == -1) {
if(intRegExp.test(range)) {
min = m... | [
"function",
"(",
"value",
",",
"range",
")",
"{",
"var",
"intRegExp",
"=",
"$",
".",
"fn",
".",
"form",
".",
"settings",
".",
"regExp",
".",
"integer",
",",
"min",
",",
"max",
",",
"parts",
";",
"if",
"(",
"!",
"range",
"||",
"[",
"''",
",",
"'... | is valid integer or matches range | [
"is",
"valid",
"integer",
"or",
"matches",
"range"
] | fc9f8bd7e4f5934756ec60c0423f77d1c7be7c6f | https://github.com/Semantic-Org/Semantic-UI-CSS/blob/fc9f8bd7e4f5934756ec60c0423f77d1c7be7c6f/semantic.js#L1878-L1907 | |
11,007 | Semantic-Org/Semantic-UI-CSS | semantic.js | function(value, identifier) {
var
$form = $(this),
matchingValue
;
if( $('[data-validate="'+ identifier +'"]').length > 0 ) {
matchingValue = $('[data-validate="'+ identifier +'"]').val();
}
else if($('#' + identifier).length > 0) {
matchingValue = $('#' + i... | javascript | function(value, identifier) {
var
$form = $(this),
matchingValue
;
if( $('[data-validate="'+ identifier +'"]').length > 0 ) {
matchingValue = $('[data-validate="'+ identifier +'"]').val();
}
else if($('#' + identifier).length > 0) {
matchingValue = $('#' + i... | [
"function",
"(",
"value",
",",
"identifier",
")",
"{",
"var",
"$form",
"=",
"$",
"(",
"this",
")",
",",
"matchingValue",
";",
"if",
"(",
"$",
"(",
"'[data-validate=\"'",
"+",
"identifier",
"+",
"'\"]'",
")",
".",
"length",
">",
"0",
")",
"{",
"matchi... | matches another field | [
"matches",
"another",
"field"
] | fc9f8bd7e4f5934756ec60c0423f77d1c7be7c6f | https://github.com/Semantic-Org/Semantic-UI-CSS/blob/fc9f8bd7e4f5934756ec60c0423f77d1c7be7c6f/semantic.js#L2016-L2037 | |
11,008 | Semantic-Org/Semantic-UI-CSS | semantic.js | function(select) {
var
placeholder = select.placeholder || false,
values = select.values || {},
html = ''
;
html += '<i class="dropdown icon"></i>';
if(select.placeholder) {
html += '<div class="default text">' + placeholder + '</div>';
}
else {
html +=... | javascript | function(select) {
var
placeholder = select.placeholder || false,
values = select.values || {},
html = ''
;
html += '<i class="dropdown icon"></i>';
if(select.placeholder) {
html += '<div class="default text">' + placeholder + '</div>';
}
else {
html +=... | [
"function",
"(",
"select",
")",
"{",
"var",
"placeholder",
"=",
"select",
".",
"placeholder",
"||",
"false",
",",
"values",
"=",
"select",
".",
"values",
"||",
"{",
"}",
",",
"html",
"=",
"''",
";",
"html",
"+=",
"'<i class=\"dropdown icon\"></i>'",
";",
... | generates dropdown from select values | [
"generates",
"dropdown",
"from",
"select",
"values"
] | fc9f8bd7e4f5934756ec60c0423f77d1c7be7c6f | https://github.com/Semantic-Org/Semantic-UI-CSS/blob/fc9f8bd7e4f5934756ec60c0423f77d1c7be7c6f/semantic.js#L8276-L8298 | |
11,009 | Semantic-Org/Semantic-UI-CSS | semantic.js | function(response, fields) {
var
values = response[fields.values] || {},
html = ''
;
$.each(values, function(index, option) {
var
maybeText = (option[fields.text])
? 'data-text="' + option[fields.text] + '"'
: '',
maybeDisabled = (option[fields.disable... | javascript | function(response, fields) {
var
values = response[fields.values] || {},
html = ''
;
$.each(values, function(index, option) {
var
maybeText = (option[fields.text])
? 'data-text="' + option[fields.text] + '"'
: '',
maybeDisabled = (option[fields.disable... | [
"function",
"(",
"response",
",",
"fields",
")",
"{",
"var",
"values",
"=",
"response",
"[",
"fields",
".",
"values",
"]",
"||",
"{",
"}",
",",
"html",
"=",
"''",
";",
"$",
".",
"each",
"(",
"values",
",",
"function",
"(",
"index",
",",
"option",
... | generates just menu from select | [
"generates",
"just",
"menu",
"from",
"select"
] | fc9f8bd7e4f5934756ec60c0423f77d1c7be7c6f | https://github.com/Semantic-Org/Semantic-UI-CSS/blob/fc9f8bd7e4f5934756ec60c0423f77d1c7be7c6f/semantic.js#L8301-L8320 | |
11,010 | Semantic-Org/Semantic-UI-CSS | semantic.js | function(source, id, url) {
module.debug('Changing video to ', source, id, url);
$module
.data(metadata.source, source)
.data(metadata.id, id)
;
if(url) {
$module.data(metadata.url, url);
}
else {
$module.removeD... | javascript | function(source, id, url) {
module.debug('Changing video to ', source, id, url);
$module
.data(metadata.source, source)
.data(metadata.id, id)
;
if(url) {
$module.data(metadata.url, url);
}
else {
$module.removeD... | [
"function",
"(",
"source",
",",
"id",
",",
"url",
")",
"{",
"module",
".",
"debug",
"(",
"'Changing video to '",
",",
"source",
",",
"id",
",",
"url",
")",
";",
"$module",
".",
"data",
"(",
"metadata",
".",
"source",
",",
"source",
")",
".",
"data",
... | sets new embed | [
"sets",
"new",
"embed"
] | fc9f8bd7e4f5934756ec60c0423f77d1c7be7c6f | https://github.com/Semantic-Org/Semantic-UI-CSS/blob/fc9f8bd7e4f5934756ec60c0423f77d1c7be7c6f/semantic.js#L8502-L8520 | |
11,011 | Semantic-Org/Semantic-UI-CSS | semantic.js | function() {
if(settings.throttle) {
clearTimeout(module.timer);
module.timer = setTimeout(function() {
$context.triggerHandler('scrollchange' + eventNamespace, [ $context.scrollTop() ]);
}, settings.throttle);
}
else {
... | javascript | function() {
if(settings.throttle) {
clearTimeout(module.timer);
module.timer = setTimeout(function() {
$context.triggerHandler('scrollchange' + eventNamespace, [ $context.scrollTop() ]);
}, settings.throttle);
}
else {
... | [
"function",
"(",
")",
"{",
"if",
"(",
"settings",
".",
"throttle",
")",
"{",
"clearTimeout",
"(",
"module",
".",
"timer",
")",
";",
"module",
".",
"timer",
"=",
"setTimeout",
"(",
"function",
"(",
")",
"{",
"$context",
".",
"triggerHandler",
"(",
"'scr... | publishes scrollchange event on one scroll | [
"publishes",
"scrollchange",
"event",
"on",
"one",
"scroll"
] | fc9f8bd7e4f5934756ec60c0423f77d1c7be7c6f | https://github.com/Semantic-Org/Semantic-UI-CSS/blob/fc9f8bd7e4f5934756ec60c0423f77d1c7be7c6f/semantic.js#L21416-L21428 | |
11,012 | dthree/vorpal | lib/session.js | Session | function Session(options) {
options = options || {};
this.id = options.id || this._guid();
this.parent = options.parent || undefined;
this.authenticating = options.authenticating || false;
this.authenticated = options.authenticated || undefined;
this.user = options.user || 'guest';
this.host = options.hos... | javascript | function Session(options) {
options = options || {};
this.id = options.id || this._guid();
this.parent = options.parent || undefined;
this.authenticating = options.authenticating || false;
this.authenticated = options.authenticated || undefined;
this.user = options.user || 'guest';
this.host = options.hos... | [
"function",
"Session",
"(",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"this",
".",
"id",
"=",
"options",
".",
"id",
"||",
"this",
".",
"_guid",
"(",
")",
";",
"this",
".",
"parent",
"=",
"options",
".",
"parent",
"||",
... | Initialize a new `Session` instance.
@param {String} name
@return {Session}
@api public | [
"Initialize",
"a",
"new",
"Session",
"instance",
"."
] | 51f5e2b545631b6a86c9781c274a1b0916a67ee8 | https://github.com/dthree/vorpal/blob/51f5e2b545631b6a86c9781c274a1b0916a67ee8/lib/session.js#L22-L46 |
11,013 | dthree/vorpal | lib/vorpal.js | Vorpal | function Vorpal() {
if (!(this instanceof Vorpal)) {
return new Vorpal();
}
// Program version
// Exposed through vorpal.version(str);
this._version = '';
// Program title
this._title = '';
// Program description
this._description = '';
// Program baner
this._banner = '';
// Command lin... | javascript | function Vorpal() {
if (!(this instanceof Vorpal)) {
return new Vorpal();
}
// Program version
// Exposed through vorpal.version(str);
this._version = '';
// Program title
this._title = '';
// Program description
this._description = '';
// Program baner
this._banner = '';
// Command lin... | [
"function",
"Vorpal",
"(",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Vorpal",
")",
")",
"{",
"return",
"new",
"Vorpal",
"(",
")",
";",
"}",
"// Program version",
"// Exposed through vorpal.version(str);",
"this",
".",
"_version",
"=",
"''",
";",
... | Initialize a new `Vorpal` instance.
@return {Vorpal}
@api public | [
"Initialize",
"a",
"new",
"Vorpal",
"instance",
"."
] | 51f5e2b545631b6a86c9781c274a1b0916a67ee8 | https://github.com/dthree/vorpal/blob/51f5e2b545631b6a86c9781c274a1b0916a67ee8/lib/vorpal.js#L40-L113 |
11,014 | dthree/vorpal | dist/command.js | Command | function Command(name, parent) {
if (!(this instanceof Command)) {
return new Command();
}
this.commands = [];
this.options = [];
this._args = [];
this._aliases = [];
this._name = name;
this._relay = false;
this._hidden = false;
this._parent = parent;
this._mode = false;
this._catch = false;... | javascript | function Command(name, parent) {
if (!(this instanceof Command)) {
return new Command();
}
this.commands = [];
this.options = [];
this._args = [];
this._aliases = [];
this._name = name;
this._relay = false;
this._hidden = false;
this._parent = parent;
this._mode = false;
this._catch = false;... | [
"function",
"Command",
"(",
"name",
",",
"parent",
")",
"{",
"if",
"(",
"!",
"(",
"this",
"instanceof",
"Command",
")",
")",
"{",
"return",
"new",
"Command",
"(",
")",
";",
"}",
"this",
".",
"commands",
"=",
"[",
"]",
";",
"this",
".",
"options",
... | Initialize a new `Command` instance.
@param {String} name
@param {Vorpal} parent
@return {Command}
@api public | [
"Initialize",
"a",
"new",
"Command",
"instance",
"."
] | 51f5e2b545631b6a86c9781c274a1b0916a67ee8 | https://github.com/dthree/vorpal/blob/51f5e2b545631b6a86c9781c274a1b0916a67ee8/dist/command.js#L33-L51 |
11,015 | dthree/vorpal | dist/command.js | _camelcase | function _camelcase(flag) {
return flag.split('-').reduce(function (str, word) {
return str + word[0].toUpperCase() + word.slice(1);
});
} | javascript | function _camelcase(flag) {
return flag.split('-').reduce(function (str, word) {
return str + word[0].toUpperCase() + word.slice(1);
});
} | [
"function",
"_camelcase",
"(",
"flag",
")",
"{",
"return",
"flag",
".",
"split",
"(",
"'-'",
")",
".",
"reduce",
"(",
"function",
"(",
"str",
",",
"word",
")",
"{",
"return",
"str",
"+",
"word",
"[",
"0",
"]",
".",
"toUpperCase",
"(",
")",
"+",
"... | Converts string to camel case.
@param {String} flag
@return {String}
@api private | [
"Converts",
"string",
"to",
"camel",
"case",
"."
] | 51f5e2b545631b6a86c9781c274a1b0916a67ee8 | https://github.com/dthree/vorpal/blob/51f5e2b545631b6a86c9781c274a1b0916a67ee8/dist/command.js#L567-L571 |
11,016 | dthree/vorpal | dist/autocomplete.js | handleTabCounts | function handleTabCounts(str, freezeTabs) {
var result;
if (_.isArray(str)) {
this._tabCtr += 1;
if (this._tabCtr > 1) {
result = str.length === 0 ? undefined : str;
}
} else {
this._tabCtr = freezeTabs === true ? this._tabCtr + 1 : 0;
result = str;
}
return result;
} | javascript | function handleTabCounts(str, freezeTabs) {
var result;
if (_.isArray(str)) {
this._tabCtr += 1;
if (this._tabCtr > 1) {
result = str.length === 0 ? undefined : str;
}
} else {
this._tabCtr = freezeTabs === true ? this._tabCtr + 1 : 0;
result = str;
}
return result;
} | [
"function",
"handleTabCounts",
"(",
"str",
",",
"freezeTabs",
")",
"{",
"var",
"result",
";",
"if",
"(",
"_",
".",
"isArray",
"(",
"str",
")",
")",
"{",
"this",
".",
"_tabCtr",
"+=",
"1",
";",
"if",
"(",
"this",
".",
"_tabCtr",
">",
"1",
")",
"{"... | Tracks how many times tab was pressed
based on whether the UI changed.
@param {String} str
@return {String} result
@api private | [
"Tracks",
"how",
"many",
"times",
"tab",
"was",
"pressed",
"based",
"on",
"whether",
"the",
"UI",
"changed",
"."
] | 51f5e2b545631b6a86c9781c274a1b0916a67ee8 | https://github.com/dthree/vorpal/blob/51f5e2b545631b6a86c9781c274a1b0916a67ee8/dist/autocomplete.js#L136-L148 |
11,017 | dthree/vorpal | dist/autocomplete.js | getMatch | function getMatch(ctx, data, options) {
// Look for a command match, eliminating and then
// re-introducing leading spaces.
var len = ctx.length;
var trimmed = ctx.replace(/^\s+/g, '');
var match = autocomplete.match(trimmed, data.slice(), options);
if (_.isArray(match)) {
return match;
}
var prefix... | javascript | function getMatch(ctx, data, options) {
// Look for a command match, eliminating and then
// re-introducing leading spaces.
var len = ctx.length;
var trimmed = ctx.replace(/^\s+/g, '');
var match = autocomplete.match(trimmed, data.slice(), options);
if (_.isArray(match)) {
return match;
}
var prefix... | [
"function",
"getMatch",
"(",
"ctx",
",",
"data",
",",
"options",
")",
"{",
"// Look for a command match, eliminating and then",
"// re-introducing leading spaces.",
"var",
"len",
"=",
"ctx",
".",
"length",
";",
"var",
"trimmed",
"=",
"ctx",
".",
"replace",
"(",
"/... | Looks for a potential exact match
based on given data.
@param {String} ctx
@param {Array} data
@return {String}
@api private | [
"Looks",
"for",
"a",
"potential",
"exact",
"match",
"based",
"on",
"given",
"data",
"."
] | 51f5e2b545631b6a86c9781c274a1b0916a67ee8 | https://github.com/dthree/vorpal/blob/51f5e2b545631b6a86c9781c274a1b0916a67ee8/dist/autocomplete.js#L160-L177 |
11,018 | dthree/vorpal | dist/autocomplete.js | assembleInput | function assembleInput(input) {
if (_.isArray(input.context)) {
return input.context;
}
var result = (input.prefix || '') + (input.context || '') + (input.suffix || '');
return strip(result);
} | javascript | function assembleInput(input) {
if (_.isArray(input.context)) {
return input.context;
}
var result = (input.prefix || '') + (input.context || '') + (input.suffix || '');
return strip(result);
} | [
"function",
"assembleInput",
"(",
"input",
")",
"{",
"if",
"(",
"_",
".",
"isArray",
"(",
"input",
".",
"context",
")",
")",
"{",
"return",
"input",
".",
"context",
";",
"}",
"var",
"result",
"=",
"(",
"input",
".",
"prefix",
"||",
"''",
")",
"+",
... | Takes the input object and assembles
the final result to display on the screen.
@param {Object} input
@return {String}
@api private | [
"Takes",
"the",
"input",
"object",
"and",
"assembles",
"the",
"final",
"result",
"to",
"display",
"on",
"the",
"screen",
"."
] | 51f5e2b545631b6a86c9781c274a1b0916a67ee8 | https://github.com/dthree/vorpal/blob/51f5e2b545631b6a86c9781c274a1b0916a67ee8/dist/autocomplete.js#L188-L194 |
11,019 | dthree/vorpal | dist/autocomplete.js | parseInput | function parseInput(str, idx) {
var raw = String(str || '');
var sliced = raw.slice(0, idx);
var sections = sliced.split('|');
var prefix = sections.slice(0, sections.length - 1) || [];
prefix.push('');
prefix = prefix.join('|');
var suffix = getSuffix(raw.slice(idx));
var context = sections[sections.le... | javascript | function parseInput(str, idx) {
var raw = String(str || '');
var sliced = raw.slice(0, idx);
var sections = sliced.split('|');
var prefix = sections.slice(0, sections.length - 1) || [];
prefix.push('');
prefix = prefix.join('|');
var suffix = getSuffix(raw.slice(idx));
var context = sections[sections.le... | [
"function",
"parseInput",
"(",
"str",
",",
"idx",
")",
"{",
"var",
"raw",
"=",
"String",
"(",
"str",
"||",
"''",
")",
";",
"var",
"sliced",
"=",
"raw",
".",
"slice",
"(",
"0",
",",
"idx",
")",
";",
"var",
"sections",
"=",
"sliced",
".",
"split",
... | Takes the user's current prompt
string and breaks it into its
integral parts for analysis and
modification.
@param {String} str
@param {Integer} idx
@return {Object}
@api private | [
"Takes",
"the",
"user",
"s",
"current",
"prompt",
"string",
"and",
"breaks",
"it",
"into",
"its",
"integral",
"parts",
"for",
"analysis",
"and",
"modification",
"."
] | 51f5e2b545631b6a86c9781c274a1b0916a67ee8 | https://github.com/dthree/vorpal/blob/51f5e2b545631b6a86c9781c274a1b0916a67ee8/dist/autocomplete.js#L239-L254 |
11,020 | dthree/vorpal | dist/autocomplete.js | parseMatchSection | function parseMatchSection(input) {
var parts = (input.context || '').split(' ');
var last = parts.pop();
var beforeLast = strip(parts[parts.length - 1] || '').trim();
if (beforeLast.slice(0, 1) === '-') {
input.option = beforeLast;
}
input.context = last;
input.prefix = (input.prefix || '') + parts.j... | javascript | function parseMatchSection(input) {
var parts = (input.context || '').split(' ');
var last = parts.pop();
var beforeLast = strip(parts[parts.length - 1] || '').trim();
if (beforeLast.slice(0, 1) === '-') {
input.option = beforeLast;
}
input.context = last;
input.prefix = (input.prefix || '') + parts.j... | [
"function",
"parseMatchSection",
"(",
"input",
")",
"{",
"var",
"parts",
"=",
"(",
"input",
".",
"context",
"||",
"''",
")",
".",
"split",
"(",
"' '",
")",
";",
"var",
"last",
"=",
"parts",
".",
"pop",
"(",
")",
";",
"var",
"beforeLast",
"=",
"stri... | Takes the context after a
matched command and figures
out the applicable context,
including assigning its role
such as being an option
parameter, etc.
@param {Object} input
@return {Object}
@api private | [
"Takes",
"the",
"context",
"after",
"a",
"matched",
"command",
"and",
"figures",
"out",
"the",
"applicable",
"context",
"including",
"assigning",
"its",
"role",
"such",
"as",
"being",
"an",
"option",
"parameter",
"etc",
"."
] | 51f5e2b545631b6a86c9781c274a1b0916a67ee8 | https://github.com/dthree/vorpal/blob/51f5e2b545631b6a86c9781c274a1b0916a67ee8/dist/autocomplete.js#L269-L279 |
11,021 | dthree/vorpal | dist/autocomplete.js | getCommandNames | function getCommandNames(cmds) {
var commands = _.map(cmds, '_name');
commands = commands.concat.apply(commands, _.map(cmds, '_aliases'));
commands.sort();
return commands;
} | javascript | function getCommandNames(cmds) {
var commands = _.map(cmds, '_name');
commands = commands.concat.apply(commands, _.map(cmds, '_aliases'));
commands.sort();
return commands;
} | [
"function",
"getCommandNames",
"(",
"cmds",
")",
"{",
"var",
"commands",
"=",
"_",
".",
"map",
"(",
"cmds",
",",
"'_name'",
")",
";",
"commands",
"=",
"commands",
".",
"concat",
".",
"apply",
"(",
"commands",
",",
"_",
".",
"map",
"(",
"cmds",
",",
... | Compile all available commands and aliases
in alphabetical order.
@param {Array} cmds
@return {Array}
@api private | [
"Compile",
"all",
"available",
"commands",
"and",
"aliases",
"in",
"alphabetical",
"order",
"."
] | 51f5e2b545631b6a86c9781c274a1b0916a67ee8 | https://github.com/dthree/vorpal/blob/51f5e2b545631b6a86c9781c274a1b0916a67ee8/dist/autocomplete.js#L305-L310 |
11,022 | dthree/vorpal | dist/autocomplete.js | getMatchData | function getMatchData(input, cb) {
var string = input.context;
var cmd = input.match;
var midOption = String(string).trim().slice(0, 1) === '-';
var afterOption = input.option !== undefined;
if (midOption === true && !cmd._allowUnknownOptions) {
var results = [];
for (var i = 0; i < cmd.options.length... | javascript | function getMatchData(input, cb) {
var string = input.context;
var cmd = input.match;
var midOption = String(string).trim().slice(0, 1) === '-';
var afterOption = input.option !== undefined;
if (midOption === true && !cmd._allowUnknownOptions) {
var results = [];
for (var i = 0; i < cmd.options.length... | [
"function",
"getMatchData",
"(",
"input",
",",
"cb",
")",
"{",
"var",
"string",
"=",
"input",
".",
"context",
";",
"var",
"cmd",
"=",
"input",
".",
"match",
";",
"var",
"midOption",
"=",
"String",
"(",
"string",
")",
".",
"trim",
"(",
")",
".",
"sl... | Takes a known matched command, and reads
the applicable data by calling its autocompletion
instructions, whether it is the command's
autocompletion or one of its options.
@param {Object} input
@param {Function} cb
@return {Array}
@api private | [
"Takes",
"a",
"known",
"matched",
"command",
"and",
"reads",
"the",
"applicable",
"data",
"by",
"calling",
"its",
"autocompletion",
"instructions",
"whether",
"it",
"is",
"the",
"command",
"s",
"autocompletion",
"or",
"one",
"of",
"its",
"options",
"."
] | 51f5e2b545631b6a86c9781c274a1b0916a67ee8 | https://github.com/dthree/vorpal/blob/51f5e2b545631b6a86c9781c274a1b0916a67ee8/dist/autocomplete.js#L383-L443 |
11,023 | dthree/vorpal | lib/autocomplete.js | function (str, cb) {
var self = this;
var input = parseInput(str, this.parent.ui._activePrompt.screen.rl.cursor);
var commands = getCommandNames(this.parent.commands);
var vorpalMatch = getMatch(input.context, commands, {ignoreSlashes: true});
var freezeTabs = false;
function end(str) {
v... | javascript | function (str, cb) {
var self = this;
var input = parseInput(str, this.parent.ui._activePrompt.screen.rl.cursor);
var commands = getCommandNames(this.parent.commands);
var vorpalMatch = getMatch(input.context, commands, {ignoreSlashes: true});
var freezeTabs = false;
function end(str) {
v... | [
"function",
"(",
"str",
",",
"cb",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"input",
"=",
"parseInput",
"(",
"str",
",",
"this",
".",
"parent",
".",
"ui",
".",
"_activePrompt",
".",
"screen",
".",
"rl",
".",
"cursor",
")",
";",
"var",
"c... | Handles tabbed autocompletion.
- Initial tabbing lists all registered commands.
- Completes a command halfway typed.
- Recognizes options and lists all possible options.
- Recognizes option arguments and lists them.
- Supports cursor positions anywhere in the string.
- Supports piping.
@param {String} str
@return {St... | [
"Handles",
"tabbed",
"autocompletion",
"."
] | 51f5e2b545631b6a86c9781c274a1b0916a67ee8 | https://github.com/dthree/vorpal/blob/51f5e2b545631b6a86c9781c274a1b0916a67ee8/lib/autocomplete.js#L23-L64 | |
11,024 | dthree/vorpal | lib/autocomplete.js | filterData | function filterData(str, data) {
data = data || [];
var ctx = String(str || '').trim();
var slashParts = ctx.split('/');
ctx = slashParts.pop();
var wordParts = String(ctx).trim().split(' ');
var res = data.filter(function (item) {
return (strip(item).slice(0, ctx.length) === ctx);
});
res = res.map... | javascript | function filterData(str, data) {
data = data || [];
var ctx = String(str || '').trim();
var slashParts = ctx.split('/');
ctx = slashParts.pop();
var wordParts = String(ctx).trim().split(' ');
var res = data.filter(function (item) {
return (strip(item).slice(0, ctx.length) === ctx);
});
res = res.map... | [
"function",
"filterData",
"(",
"str",
",",
"data",
")",
"{",
"data",
"=",
"data",
"||",
"[",
"]",
";",
"var",
"ctx",
"=",
"String",
"(",
"str",
"||",
"''",
")",
".",
"trim",
"(",
")",
";",
"var",
"slashParts",
"=",
"ctx",
".",
"split",
"(",
"'/... | Reduces an array of possible
matches to list based on a given
string.
@param {String} str
@param {Array} data
@return {Array}
@api private | [
"Reduces",
"an",
"array",
"of",
"possible",
"matches",
"to",
"list",
"based",
"on",
"a",
"given",
"string",
"."
] | 51f5e2b545631b6a86c9781c274a1b0916a67ee8 | https://github.com/dthree/vorpal/blob/51f5e2b545631b6a86c9781c274a1b0916a67ee8/lib/autocomplete.js#L211-L229 |
11,025 | dthree/vorpal | lib/autocomplete.js | getSuffix | function getSuffix(suffix) {
suffix = (suffix.slice(0, 1) === ' ') ?
suffix :
suffix.replace(/.+?(?=\s)/, '');
suffix = suffix.slice(1, suffix.length);
return suffix;
} | javascript | function getSuffix(suffix) {
suffix = (suffix.slice(0, 1) === ' ') ?
suffix :
suffix.replace(/.+?(?=\s)/, '');
suffix = suffix.slice(1, suffix.length);
return suffix;
} | [
"function",
"getSuffix",
"(",
"suffix",
")",
"{",
"suffix",
"=",
"(",
"suffix",
".",
"slice",
"(",
"0",
",",
"1",
")",
"===",
"' '",
")",
"?",
"suffix",
":",
"suffix",
".",
"replace",
"(",
"/",
".+?(?=\\s)",
"/",
",",
"''",
")",
";",
"suffix",
"=... | Returns a cleaned up version of the
remaining text to the right of the cursor.
@param {String} suffix
@return {String}
@api private | [
"Returns",
"a",
"cleaned",
"up",
"version",
"of",
"the",
"remaining",
"text",
"to",
"the",
"right",
"of",
"the",
"cursor",
"."
] | 51f5e2b545631b6a86c9781c274a1b0916a67ee8 | https://github.com/dthree/vorpal/blob/51f5e2b545631b6a86c9781c274a1b0916a67ee8/lib/autocomplete.js#L294-L300 |
11,026 | dthree/vorpal | lib/autocomplete.js | getMatchObject | function getMatchObject(input, commands) {
var len = input.context.length;
var trimmed = String(input.context).replace(/^\s+/g, '');
var prefix = new Array((len - trimmed.length) + 1).join(' ');
var match;
var suffix;
commands.forEach(function (cmd) {
var nextChar = trimmed.substr(cmd.length, 1);
if... | javascript | function getMatchObject(input, commands) {
var len = input.context.length;
var trimmed = String(input.context).replace(/^\s+/g, '');
var prefix = new Array((len - trimmed.length) + 1).join(' ');
var match;
var suffix;
commands.forEach(function (cmd) {
var nextChar = trimmed.substr(cmd.length, 1);
if... | [
"function",
"getMatchObject",
"(",
"input",
",",
"commands",
")",
"{",
"var",
"len",
"=",
"input",
".",
"context",
".",
"length",
";",
"var",
"trimmed",
"=",
"String",
"(",
"input",
".",
"context",
")",
".",
"replace",
"(",
"/",
"^\\s+",
"/",
"g",
",... | When we know that we've
exceeded a known command, grab
on to that command and return it,
fixing the overall input context
at the same time.
@param {Object} input
@param {Array} commands
@return {Object}
@api private | [
"When",
"we",
"know",
"that",
"we",
"ve",
"exceeded",
"a",
"known",
"command",
"grab",
"on",
"to",
"that",
"command",
"and",
"return",
"it",
"fixing",
"the",
"overall",
"input",
"context",
"at",
"the",
"same",
"time",
"."
] | 51f5e2b545631b6a86c9781c274a1b0916a67ee8 | https://github.com/dthree/vorpal/blob/51f5e2b545631b6a86c9781c274a1b0916a67ee8/lib/autocomplete.js#L331-L377 |
11,027 | Microsoft/maker.js | docs/demos/js/pixel-heart.js | PixelWalker | function PixelWalker(firstPoint, pixel_path) {
// go clockwise starting first point
var points = [];
points.push(firstPoint);
var moveHorizontal = true; // alternate horizontal and vertical movements to form pixel heart
pixel_path.forEach(function (p) {
var previous_point = points[points... | javascript | function PixelWalker(firstPoint, pixel_path) {
// go clockwise starting first point
var points = [];
points.push(firstPoint);
var moveHorizontal = true; // alternate horizontal and vertical movements to form pixel heart
pixel_path.forEach(function (p) {
var previous_point = points[points... | [
"function",
"PixelWalker",
"(",
"firstPoint",
",",
"pixel_path",
")",
"{",
"// go clockwise starting first point",
"var",
"points",
"=",
"[",
"]",
";",
"points",
".",
"push",
"(",
"firstPoint",
")",
";",
"var",
"moveHorizontal",
"=",
"true",
";",
"// alternate h... | starting point so the heart is located properly in space
Builds an array of points that define a model by generating points
from the `path` defined above. | [
"starting",
"point",
"so",
"the",
"heart",
"is",
"located",
"properly",
"in",
"space",
"Builds",
"an",
"array",
"of",
"points",
"that",
"define",
"a",
"model",
"by",
"generating",
"points",
"from",
"the",
"path",
"defined",
"above",
"."
] | 22cc3b46abb1997b301dd3b2b300aa848d431efd | https://github.com/Microsoft/maker.js/blob/22cc3b46abb1997b301dd3b2b300aa848d431efd/docs/demos/js/pixel-heart.js#L37-L63 |
11,028 | Microsoft/maker.js | docs/demos/js/pixel-heart.js | Heart | function Heart(desired_width) {
var points = PixelWalker(STARTING_POINT, path);
var pathModel = new makerjs.models.ConnectTheDots(true, points);
if (typeof desired_width != 'undefined') {
var scale = desired_width / HEART_WIDTH;
makerjs.model.scale(pathModel, scale);
}
return pathMo... | javascript | function Heart(desired_width) {
var points = PixelWalker(STARTING_POINT, path);
var pathModel = new makerjs.models.ConnectTheDots(true, points);
if (typeof desired_width != 'undefined') {
var scale = desired_width / HEART_WIDTH;
makerjs.model.scale(pathModel, scale);
}
return pathMo... | [
"function",
"Heart",
"(",
"desired_width",
")",
"{",
"var",
"points",
"=",
"PixelWalker",
"(",
"STARTING_POINT",
",",
"path",
")",
";",
"var",
"pathModel",
"=",
"new",
"makerjs",
".",
"models",
".",
"ConnectTheDots",
"(",
"true",
",",
"points",
")",
";",
... | Builds a pixel heart model and scale it to the specified input width. | [
"Builds",
"a",
"pixel",
"heart",
"model",
"and",
"scale",
"it",
"to",
"the",
"specified",
"input",
"width",
"."
] | 22cc3b46abb1997b301dd3b2b300aa848d431efd | https://github.com/Microsoft/maker.js/blob/22cc3b46abb1997b301dd3b2b300aa848d431efd/docs/demos/js/pixel-heart.js#L68-L77 |
11,029 | Microsoft/maker.js | docs/playground/js/require-iframe.js | complete2 | function complete2() {
//reset any calls to document.write
resetLog();
//reinstate alert
window.alert = originalAlert;
var originalFn = parent.makerjs.exporter.toSVG;
var captureExportedModel;
parent.makerjs.exporter.toSVG = function (i... | javascript | function complete2() {
//reset any calls to document.write
resetLog();
//reinstate alert
window.alert = originalAlert;
var originalFn = parent.makerjs.exporter.toSVG;
var captureExportedModel;
parent.makerjs.exporter.toSVG = function (i... | [
"function",
"complete2",
"(",
")",
"{",
"//reset any calls to document.write",
"resetLog",
"(",
")",
";",
"//reinstate alert",
"window",
".",
"alert",
"=",
"originalAlert",
";",
"var",
"originalFn",
"=",
"parent",
".",
"makerjs",
".",
"exporter",
".",
"toSVG",
"... | run the code in 2 passes, first - to cache all required libraries, secondly the actual execution | [
"run",
"the",
"code",
"in",
"2",
"passes",
"first",
"-",
"to",
"cache",
"all",
"required",
"libraries",
"secondly",
"the",
"actual",
"execution"
] | 22cc3b46abb1997b301dd3b2b300aa848d431efd | https://github.com/Microsoft/maker.js/blob/22cc3b46abb1997b301dd3b2b300aa848d431efd/docs/playground/js/require-iframe.js#L175-L241 |
11,030 | ghettovoice/vuelayers | src/index.js | plugin | function plugin (Vue, options = {}) {
if (plugin.installed) {
return
}
plugin.installed = true
// install components
Vue.use(ArcgisRestSource, options)
Vue.use(BingmapsSource, options)
Vue.use(CircleGeom, options)
Vue.use(CircleStyle, options)
Vue.use(ClusterSource, options)
Vue.use(DrawInterac... | javascript | function plugin (Vue, options = {}) {
if (plugin.installed) {
return
}
plugin.installed = true
// install components
Vue.use(ArcgisRestSource, options)
Vue.use(BingmapsSource, options)
Vue.use(CircleGeom, options)
Vue.use(CircleStyle, options)
Vue.use(ClusterSource, options)
Vue.use(DrawInterac... | [
"function",
"plugin",
"(",
"Vue",
",",
"options",
"=",
"{",
"}",
")",
"{",
"if",
"(",
"plugin",
".",
"installed",
")",
"{",
"return",
"}",
"plugin",
".",
"installed",
"=",
"true",
"// install components",
"Vue",
".",
"use",
"(",
"ArcgisRestSource",
",",
... | Registers all VueLayers components.
@param {Vue|VueConstructor} Vue
@param {VueLayersOptions} [options] | [
"Registers",
"all",
"VueLayers",
"components",
"."
] | 73bf8aa6fb08c4a683324706d54177552808a32d | https://github.com/ghettovoice/vuelayers/blob/73bf8aa6fb08c4a683324706d54177552808a32d/src/index.js#L56-L106 |
11,031 | anvaka/panzoom | index.js | getBoundingBox | function getBoundingBox() {
if (!bounds) return // client does not want to restrict movement
if (typeof bounds === 'boolean') {
// for boolean type we use parent container bounds
var ownerRect = owner.getBoundingClientRect()
var sceneWidth = ownerRect.width
var sceneHeight = ownerRect.h... | javascript | function getBoundingBox() {
if (!bounds) return // client does not want to restrict movement
if (typeof bounds === 'boolean') {
// for boolean type we use parent container bounds
var ownerRect = owner.getBoundingClientRect()
var sceneWidth = ownerRect.width
var sceneHeight = ownerRect.h... | [
"function",
"getBoundingBox",
"(",
")",
"{",
"if",
"(",
"!",
"bounds",
")",
"return",
"// client does not want to restrict movement",
"if",
"(",
"typeof",
"bounds",
"===",
"'boolean'",
")",
"{",
"// for boolean type we use parent container bounds",
"var",
"ownerRect",
"... | Returns bounding box that should be used to restrict scene movement. | [
"Returns",
"bounding",
"box",
"that",
"should",
"be",
"used",
"to",
"restrict",
"scene",
"movement",
"."
] | 57bb78383a371eccea115035d24c631e0e6819bb | https://github.com/anvaka/panzoom/blob/57bb78383a371eccea115035d24c631e0e6819bb/index.js#L280-L298 |
11,032 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(source) {
var copy, i, len, prop;
if (typeof source !== "object" || source == null || typeof source.nodeType === "number") {
copy = source;
} else if (typeof source.length === "number") {
copy = [];
for (i = 0, len = source.length; i < len; i++) {
if (_hasOwn.call(source, ... | javascript | function(source) {
var copy, i, len, prop;
if (typeof source !== "object" || source == null || typeof source.nodeType === "number") {
copy = source;
} else if (typeof source.length === "number") {
copy = [];
for (i = 0, len = source.length; i < len; i++) {
if (_hasOwn.call(source, ... | [
"function",
"(",
"source",
")",
"{",
"var",
"copy",
",",
"i",
",",
"len",
",",
"prop",
";",
"if",
"(",
"typeof",
"source",
"!==",
"\"object\"",
"||",
"source",
"==",
"null",
"||",
"typeof",
"source",
".",
"nodeType",
"===",
"\"number\"",
")",
"{",
"c... | Return a deep copy of the source object or array.
@returns Object or Array
@private | [
"Return",
"a",
"deep",
"copy",
"of",
"the",
"source",
"object",
"or",
"array",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L68-L88 | |
11,033 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(obj) {
if (obj) {
for (var prop in obj) {
if (_hasOwn.call(obj, prop)) {
delete obj[prop];
}
}
}
return obj;
} | javascript | function(obj) {
if (obj) {
for (var prop in obj) {
if (_hasOwn.call(obj, prop)) {
delete obj[prop];
}
}
}
return obj;
} | [
"function",
"(",
"obj",
")",
"{",
"if",
"(",
"obj",
")",
"{",
"for",
"(",
"var",
"prop",
"in",
"obj",
")",
"{",
"if",
"(",
"_hasOwn",
".",
"call",
"(",
"obj",
",",
"prop",
")",
")",
"{",
"delete",
"obj",
"[",
"prop",
"]",
";",
"}",
"}",
"}"... | Remove all owned, enumerable properties from an object.
@returns The original object without its owned, enumerable properties.
@private | [
"Remove",
"all",
"owned",
"enumerable",
"properties",
"from",
"an",
"object",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L128-L137 | |
11,034 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(el, ancestorEl) {
if (el && el.nodeType === 1 && el.ownerDocument && ancestorEl && (ancestorEl.nodeType === 1 && ancestorEl.ownerDocument && ancestorEl.ownerDocument === el.ownerDocument || ancestorEl.nodeType === 9 && !ancestorEl.ownerDocument && ancestorEl === el.ownerDocument)) {
do {
if (... | javascript | function(el, ancestorEl) {
if (el && el.nodeType === 1 && el.ownerDocument && ancestorEl && (ancestorEl.nodeType === 1 && ancestorEl.ownerDocument && ancestorEl.ownerDocument === el.ownerDocument || ancestorEl.nodeType === 9 && !ancestorEl.ownerDocument && ancestorEl === el.ownerDocument)) {
do {
if (... | [
"function",
"(",
"el",
",",
"ancestorEl",
")",
"{",
"if",
"(",
"el",
"&&",
"el",
".",
"nodeType",
"===",
"1",
"&&",
"el",
".",
"ownerDocument",
"&&",
"ancestorEl",
"&&",
"(",
"ancestorEl",
".",
"nodeType",
"===",
"1",
"&&",
"ancestorEl",
".",
"ownerDoc... | Determine if an element is contained within another element.
@returns Boolean
@private | [
"Determine",
"if",
"an",
"element",
"is",
"contained",
"within",
"another",
"element",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L144-L154 | |
11,035 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(url) {
var dir;
if (typeof url === "string" && url) {
dir = url.split("#")[0].split("?")[0];
dir = url.slice(0, url.lastIndexOf("/") + 1);
}
return dir;
} | javascript | function(url) {
var dir;
if (typeof url === "string" && url) {
dir = url.split("#")[0].split("?")[0];
dir = url.slice(0, url.lastIndexOf("/") + 1);
}
return dir;
} | [
"function",
"(",
"url",
")",
"{",
"var",
"dir",
";",
"if",
"(",
"typeof",
"url",
"===",
"\"string\"",
"&&",
"url",
")",
"{",
"dir",
"=",
"url",
".",
"split",
"(",
"\"#\"",
")",
"[",
"0",
"]",
".",
"split",
"(",
"\"?\"",
")",
"[",
"0",
"]",
";... | Get the URL path's parent directory.
@returns String or `undefined`
@private | [
"Get",
"the",
"URL",
"path",
"s",
"parent",
"directory",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L161-L168 | |
11,036 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function() {
var jsPath, scripts, i;
if (_document.currentScript && (jsPath = _document.currentScript.src)) {
return jsPath;
}
scripts = _document.getElementsByTagName("script");
if (scripts.length === 1) {
return scripts[0].src || undefined;
}
if ("readyState" in (scripts[0] || ... | javascript | function() {
var jsPath, scripts, i;
if (_document.currentScript && (jsPath = _document.currentScript.src)) {
return jsPath;
}
scripts = _document.getElementsByTagName("script");
if (scripts.length === 1) {
return scripts[0].src || undefined;
}
if ("readyState" in (scripts[0] || ... | [
"function",
"(",
")",
"{",
"var",
"jsPath",
",",
"scripts",
",",
"i",
";",
"if",
"(",
"_document",
".",
"currentScript",
"&&",
"(",
"jsPath",
"=",
"_document",
".",
"currentScript",
".",
"src",
")",
")",
"{",
"return",
"jsPath",
";",
"}",
"scripts",
... | Get the current script's URL.
@returns String or `undefined`
@private | [
"Get",
"the",
"current",
"script",
"s",
"URL",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L214-L237 | |
11,037 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function() {
var isWindowsRegex = /win(dows|[\s]?(nt|me|ce|xp|vista|[\d]+))/i;
return !!_navigator && (isWindowsRegex.test(_navigator.appVersion || "") || isWindowsRegex.test(_navigator.platform || "") || (_navigator.userAgent || "").indexOf("Windows") !== -1);
} | javascript | function() {
var isWindowsRegex = /win(dows|[\s]?(nt|me|ce|xp|vista|[\d]+))/i;
return !!_navigator && (isWindowsRegex.test(_navigator.appVersion || "") || isWindowsRegex.test(_navigator.platform || "") || (_navigator.userAgent || "").indexOf("Windows") !== -1);
} | [
"function",
"(",
")",
"{",
"var",
"isWindowsRegex",
"=",
"/",
"win(dows|[\\s]?(nt|me|ce|xp|vista|[\\d]+))",
"/",
"i",
";",
"return",
"!",
"!",
"_navigator",
"&&",
"(",
"isWindowsRegex",
".",
"test",
"(",
"_navigator",
".",
"appVersion",
"||",
"\"\"",
")",
"||"... | Is the client's operating system some version of Windows?
@returns Boolean
@private | [
"Is",
"the",
"client",
"s",
"operating",
"system",
"some",
"version",
"of",
"Windows?"
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L280-L283 | |
11,038 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(options) {
if (typeof options === "object" && options && !("length" in options)) {
_keys(options).forEach(function(prop) {
if (/^(?:forceHandCursor|title|zIndex|bubbleEvents|fixLineEndings)$/.test(prop)) {
_globalConfig[prop] = options[prop];
} else if (_flashState.bridge ==... | javascript | function(options) {
if (typeof options === "object" && options && !("length" in options)) {
_keys(options).forEach(function(prop) {
if (/^(?:forceHandCursor|title|zIndex|bubbleEvents|fixLineEndings)$/.test(prop)) {
_globalConfig[prop] = options[prop];
} else if (_flashState.bridge ==... | [
"function",
"(",
"options",
")",
"{",
"if",
"(",
"typeof",
"options",
"===",
"\"object\"",
"&&",
"options",
"&&",
"!",
"(",
"\"length\"",
"in",
"options",
")",
")",
"{",
"_keys",
"(",
"options",
")",
".",
"forEach",
"(",
"function",
"(",
"prop",
")",
... | The underlying implementation of `ZeroClipboard.config`.
@private | [
"The",
"underlying",
"implementation",
"of",
"ZeroClipboard",
".",
"config",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L437-L462 | |
11,039 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function() {
_detectSandbox();
return {
browser: _extend(_pick(_navigator, [ "userAgent", "platform", "appName", "appVersion" ]), {
isSupported: _isBrowserSupported()
}),
flash: _omit(_flashState, [ "bridge" ]),
zeroclipboard: {
version: ZeroClipboard.version,
con... | javascript | function() {
_detectSandbox();
return {
browser: _extend(_pick(_navigator, [ "userAgent", "platform", "appName", "appVersion" ]), {
isSupported: _isBrowserSupported()
}),
flash: _omit(_flashState, [ "bridge" ]),
zeroclipboard: {
version: ZeroClipboard.version,
con... | [
"function",
"(",
")",
"{",
"_detectSandbox",
"(",
")",
";",
"return",
"{",
"browser",
":",
"_extend",
"(",
"_pick",
"(",
"_navigator",
",",
"[",
"\"userAgent\"",
",",
"\"platform\"",
",",
"\"appName\"",
",",
"\"appVersion\"",
"]",
")",
",",
"{",
"isSupport... | The underlying implementation of `ZeroClipboard.state`.
@private | [
"The",
"underlying",
"implementation",
"of",
"ZeroClipboard",
".",
"state",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L467-L479 | |
11,040 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function() {
return !!(_flashState.sandboxed || _flashState.disabled || _flashState.outdated || _flashState.unavailable || _flashState.degraded || _flashState.deactivated);
} | javascript | function() {
return !!(_flashState.sandboxed || _flashState.disabled || _flashState.outdated || _flashState.unavailable || _flashState.degraded || _flashState.deactivated);
} | [
"function",
"(",
")",
"{",
"return",
"!",
"!",
"(",
"_flashState",
".",
"sandboxed",
"||",
"_flashState",
".",
"disabled",
"||",
"_flashState",
".",
"outdated",
"||",
"_flashState",
".",
"unavailable",
"||",
"_flashState",
".",
"degraded",
"||",
"_flashState",... | The underlying implementation of `ZeroClipboard.isFlashUnusable`.
@private | [
"The",
"underlying",
"implementation",
"of",
"ZeroClipboard",
".",
"isFlashUnusable",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L491-L493 | |
11,041 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(eventType, listener) {
var i, len, events, added = {};
if (typeof eventType === "string" && eventType) {
events = eventType.toLowerCase().split(/\s+/);
} else if (typeof eventType === "object" && eventType && !("length" in eventType) && typeof listener === "undefined") {
_keys(eventType... | javascript | function(eventType, listener) {
var i, len, events, added = {};
if (typeof eventType === "string" && eventType) {
events = eventType.toLowerCase().split(/\s+/);
} else if (typeof eventType === "object" && eventType && !("length" in eventType) && typeof listener === "undefined") {
_keys(eventType... | [
"function",
"(",
"eventType",
",",
"listener",
")",
"{",
"var",
"i",
",",
"len",
",",
"events",
",",
"added",
"=",
"{",
"}",
";",
"if",
"(",
"typeof",
"eventType",
"===",
"\"string\"",
"&&",
"eventType",
")",
"{",
"events",
"=",
"eventType",
".",
"to... | The underlying implementation of `ZeroClipboard.on`.
@private | [
"The",
"underlying",
"implementation",
"of",
"ZeroClipboard",
".",
"on",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L498-L551 | |
11,042 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(eventType, listener) {
var i, len, foundIndex, events, perEventHandlers;
if (arguments.length === 0) {
events = _keys(_handlers);
} else if (typeof eventType === "string" && eventType) {
events = eventType.toLowerCase().split(/\s+/);
} else if (typeof eventType === "object" && event... | javascript | function(eventType, listener) {
var i, len, foundIndex, events, perEventHandlers;
if (arguments.length === 0) {
events = _keys(_handlers);
} else if (typeof eventType === "string" && eventType) {
events = eventType.toLowerCase().split(/\s+/);
} else if (typeof eventType === "object" && event... | [
"function",
"(",
"eventType",
",",
"listener",
")",
"{",
"var",
"i",
",",
"len",
",",
"foundIndex",
",",
"events",
",",
"perEventHandlers",
";",
"if",
"(",
"arguments",
".",
"length",
"===",
"0",
")",
"{",
"events",
"=",
"_keys",
"(",
"_handlers",
")",... | The underlying implementation of `ZeroClipboard.off`.
@private | [
"The",
"underlying",
"implementation",
"of",
"ZeroClipboard",
".",
"off",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L556-L588 | |
11,043 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(eventType) {
var copy;
if (typeof eventType === "string" && eventType) {
copy = _deepCopy(_handlers[eventType]) || null;
} else {
copy = _deepCopy(_handlers);
}
return copy;
} | javascript | function(eventType) {
var copy;
if (typeof eventType === "string" && eventType) {
copy = _deepCopy(_handlers[eventType]) || null;
} else {
copy = _deepCopy(_handlers);
}
return copy;
} | [
"function",
"(",
"eventType",
")",
"{",
"var",
"copy",
";",
"if",
"(",
"typeof",
"eventType",
"===",
"\"string\"",
"&&",
"eventType",
")",
"{",
"copy",
"=",
"_deepCopy",
"(",
"_handlers",
"[",
"eventType",
"]",
")",
"||",
"null",
";",
"}",
"else",
"{",... | The underlying implementation of `ZeroClipboard.handlers`.
@private | [
"The",
"underlying",
"implementation",
"of",
"ZeroClipboard",
".",
"handlers",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L593-L601 | |
11,044 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(event) {
var eventCopy, returnVal, tmp;
event = _createEvent(event);
if (!event) {
return;
}
if (_preprocessEvent(event)) {
return;
}
if (event.type === "ready" && _flashState.overdue === true) {
return ZeroClipboard.emit({
type: "error",
name: "fla... | javascript | function(event) {
var eventCopy, returnVal, tmp;
event = _createEvent(event);
if (!event) {
return;
}
if (_preprocessEvent(event)) {
return;
}
if (event.type === "ready" && _flashState.overdue === true) {
return ZeroClipboard.emit({
type: "error",
name: "fla... | [
"function",
"(",
"event",
")",
"{",
"var",
"eventCopy",
",",
"returnVal",
",",
"tmp",
";",
"event",
"=",
"_createEvent",
"(",
"event",
")",
";",
"if",
"(",
"!",
"event",
")",
"{",
"return",
";",
"}",
"if",
"(",
"_preprocessEvent",
"(",
"event",
")",
... | The underlying implementation of `ZeroClipboard.emit`.
@private | [
"The",
"underlying",
"implementation",
"of",
"ZeroClipboard",
".",
"emit",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L606-L629 | |
11,045 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function() {
var swfPath = _globalConfig.swfPath || "", swfPathFirstTwoChars = swfPath.slice(0, 2), swfProtocol = swfPath.slice(0, swfPath.indexOf("://") + 1);
return swfPathFirstTwoChars === "\\\\" ? "file:" : swfPathFirstTwoChars === "//" || swfProtocol === "" ? _window.location.protocol : swfProtocol;
} | javascript | function() {
var swfPath = _globalConfig.swfPath || "", swfPathFirstTwoChars = swfPath.slice(0, 2), swfProtocol = swfPath.slice(0, swfPath.indexOf("://") + 1);
return swfPathFirstTwoChars === "\\\\" ? "file:" : swfPathFirstTwoChars === "//" || swfProtocol === "" ? _window.location.protocol : swfProtocol;
} | [
"function",
"(",
")",
"{",
"var",
"swfPath",
"=",
"_globalConfig",
".",
"swfPath",
"||",
"\"\"",
",",
"swfPathFirstTwoChars",
"=",
"swfPath",
".",
"slice",
"(",
"0",
",",
"2",
")",
",",
"swfProtocol",
"=",
"swfPath",
".",
"slice",
"(",
"0",
",",
"swfPa... | Get the protocol of the configured SWF path.
@private | [
"Get",
"the",
"protocol",
"of",
"the",
"configured",
"SWF",
"path",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L634-L637 | |
11,046 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function() {
var maxWait, swfProtocol, previousState = _flashState.sandboxed;
if (!_isBrowserSupported()) {
_flashState.ready = false;
ZeroClipboard.emit({
type: "error",
name: "browser-unsupported"
});
return;
}
_detectSandbox();
if (typeof _flashState.ready ... | javascript | function() {
var maxWait, swfProtocol, previousState = _flashState.sandboxed;
if (!_isBrowserSupported()) {
_flashState.ready = false;
ZeroClipboard.emit({
type: "error",
name: "browser-unsupported"
});
return;
}
_detectSandbox();
if (typeof _flashState.ready ... | [
"function",
"(",
")",
"{",
"var",
"maxWait",
",",
"swfProtocol",
",",
"previousState",
"=",
"_flashState",
".",
"sandboxed",
";",
"if",
"(",
"!",
"_isBrowserSupported",
"(",
")",
")",
"{",
"_flashState",
".",
"ready",
"=",
"false",
";",
"ZeroClipboard",
".... | The underlying implementation of `ZeroClipboard.create`.
@private | [
"The",
"underlying",
"implementation",
"of",
"ZeroClipboard",
".",
"create",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L642-L688 | |
11,047 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(format, data) {
var dataObj;
if (typeof format === "object" && format && typeof data === "undefined") {
dataObj = format;
ZeroClipboard.clearData();
} else if (typeof format === "string" && format) {
dataObj = {};
dataObj[format] = data;
} else {
return;
}
... | javascript | function(format, data) {
var dataObj;
if (typeof format === "object" && format && typeof data === "undefined") {
dataObj = format;
ZeroClipboard.clearData();
} else if (typeof format === "string" && format) {
dataObj = {};
dataObj[format] = data;
} else {
return;
}
... | [
"function",
"(",
"format",
",",
"data",
")",
"{",
"var",
"dataObj",
";",
"if",
"(",
"typeof",
"format",
"===",
"\"object\"",
"&&",
"format",
"&&",
"typeof",
"data",
"===",
"\"undefined\"",
")",
"{",
"dataObj",
"=",
"format",
";",
"ZeroClipboard",
".",
"c... | The underlying implementation of `ZeroClipboard.setData`.
@private | [
"The",
"underlying",
"implementation",
"of",
"ZeroClipboard",
".",
"setData",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L704-L720 | |
11,048 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(format) {
if (typeof format === "undefined") {
_deleteOwnProperties(_clipData);
_clipDataFormatMap = null;
} else if (typeof format === "string" && _hasOwn.call(_clipData, format)) {
delete _clipData[format];
}
} | javascript | function(format) {
if (typeof format === "undefined") {
_deleteOwnProperties(_clipData);
_clipDataFormatMap = null;
} else if (typeof format === "string" && _hasOwn.call(_clipData, format)) {
delete _clipData[format];
}
} | [
"function",
"(",
"format",
")",
"{",
"if",
"(",
"typeof",
"format",
"===",
"\"undefined\"",
")",
"{",
"_deleteOwnProperties",
"(",
"_clipData",
")",
";",
"_clipDataFormatMap",
"=",
"null",
";",
"}",
"else",
"if",
"(",
"typeof",
"format",
"===",
"\"string\"",... | The underlying implementation of `ZeroClipboard.clearData`.
@private | [
"The",
"underlying",
"implementation",
"of",
"ZeroClipboard",
".",
"clearData",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L725-L732 | |
11,049 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(format) {
if (typeof format === "undefined") {
return _deepCopy(_clipData);
} else if (typeof format === "string" && _hasOwn.call(_clipData, format)) {
return _clipData[format];
}
} | javascript | function(format) {
if (typeof format === "undefined") {
return _deepCopy(_clipData);
} else if (typeof format === "string" && _hasOwn.call(_clipData, format)) {
return _clipData[format];
}
} | [
"function",
"(",
"format",
")",
"{",
"if",
"(",
"typeof",
"format",
"===",
"\"undefined\"",
")",
"{",
"return",
"_deepCopy",
"(",
"_clipData",
")",
";",
"}",
"else",
"if",
"(",
"typeof",
"format",
"===",
"\"string\"",
"&&",
"_hasOwn",
".",
"call",
"(",
... | The underlying implementation of `ZeroClipboard.getData`.
@private | [
"The",
"underlying",
"implementation",
"of",
"ZeroClipboard",
".",
"getData",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L737-L743 | |
11,050 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(event) {
var eventType;
if (typeof event === "string" && event) {
eventType = event;
event = {};
} else if (typeof event === "object" && event && typeof event.type === "string" && event.type) {
eventType = event.type;
}
if (!eventType) {
return;
}
eventType =... | javascript | function(event) {
var eventType;
if (typeof event === "string" && event) {
eventType = event;
event = {};
} else if (typeof event === "object" && event && typeof event.type === "string" && event.type) {
eventType = event.type;
}
if (!eventType) {
return;
}
eventType =... | [
"function",
"(",
"event",
")",
"{",
"var",
"eventType",
";",
"if",
"(",
"typeof",
"event",
"===",
"\"string\"",
"&&",
"event",
")",
"{",
"eventType",
"=",
"event",
";",
"event",
"=",
"{",
"}",
";",
"}",
"else",
"if",
"(",
"typeof",
"event",
"===",
... | Create or update an `event` object, based on the `eventType`.
@private | [
"Create",
"or",
"update",
"an",
"event",
"object",
"based",
"on",
"the",
"eventType",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L808-L875 | |
11,051 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(targetEl) {
var relatedTargetId = targetEl && targetEl.getAttribute && targetEl.getAttribute("data-clipboard-target");
return relatedTargetId ? _document.getElementById(relatedTargetId) : null;
} | javascript | function(targetEl) {
var relatedTargetId = targetEl && targetEl.getAttribute && targetEl.getAttribute("data-clipboard-target");
return relatedTargetId ? _document.getElementById(relatedTargetId) : null;
} | [
"function",
"(",
"targetEl",
")",
"{",
"var",
"relatedTargetId",
"=",
"targetEl",
"&&",
"targetEl",
".",
"getAttribute",
"&&",
"targetEl",
".",
"getAttribute",
"(",
"\"data-clipboard-target\"",
")",
";",
"return",
"relatedTargetId",
"?",
"_document",
".",
"getElem... | Get a relatedTarget from the target's `data-clipboard-target` attribute
@private | [
"Get",
"a",
"relatedTarget",
"from",
"the",
"target",
"s",
"data",
"-",
"clipboard",
"-",
"target",
"attribute"
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L880-L883 | |
11,052 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(event) {
if (event && /^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) {
var srcElement = event.target;
var fromElement = event.type === "_mouseover" && event.relatedTarget ? event.relatedTarget : undefined;
var toElement = event.type === "_mouseout" && event.relatedTarget ... | javascript | function(event) {
if (event && /^_(?:click|mouse(?:over|out|down|up|move))$/.test(event.type)) {
var srcElement = event.target;
var fromElement = event.type === "_mouseover" && event.relatedTarget ? event.relatedTarget : undefined;
var toElement = event.type === "_mouseout" && event.relatedTarget ... | [
"function",
"(",
"event",
")",
"{",
"if",
"(",
"event",
"&&",
"/",
"^_(?:click|mouse(?:over|out|down|up|move))$",
"/",
".",
"test",
"(",
"event",
".",
"type",
")",
")",
"{",
"var",
"srcElement",
"=",
"event",
".",
"target",
";",
"var",
"fromElement",
"=",
... | Add element and position data to `MouseEvent` instances
@private | [
"Add",
"element",
"and",
"position",
"data",
"to",
"MouseEvent",
"instances"
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L888-L929 | |
11,053 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(func, context, args, async) {
if (async) {
_setTimeout(function() {
func.apply(context, args);
}, 0);
} else {
func.apply(context, args);
}
} | javascript | function(func, context, args, async) {
if (async) {
_setTimeout(function() {
func.apply(context, args);
}, 0);
} else {
func.apply(context, args);
}
} | [
"function",
"(",
"func",
",",
"context",
",",
"args",
",",
"async",
")",
"{",
"if",
"(",
"async",
")",
"{",
"_setTimeout",
"(",
"function",
"(",
")",
"{",
"func",
".",
"apply",
"(",
"context",
",",
"args",
")",
";",
"}",
",",
"0",
")",
";",
"}"... | Control if a callback should be executed asynchronously or not.
@returns `undefined`
@private | [
"Control",
"if",
"a",
"callback",
"should",
"be",
"executed",
"asynchronously",
"or",
"not",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L946-L954 | |
11,054 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(event) {
var isSandboxed = null;
if (_pageIsFramed === false || event && event.type === "error" && event.name && _errorsThatOnlyOccurAfterFlashLoads.indexOf(event.name) !== -1) {
isSandboxed = false;
}
return isSandboxed;
} | javascript | function(event) {
var isSandboxed = null;
if (_pageIsFramed === false || event && event.type === "error" && event.name && _errorsThatOnlyOccurAfterFlashLoads.indexOf(event.name) !== -1) {
isSandboxed = false;
}
return isSandboxed;
} | [
"function",
"(",
"event",
")",
"{",
"var",
"isSandboxed",
"=",
"null",
";",
"if",
"(",
"_pageIsFramed",
"===",
"false",
"||",
"event",
"&&",
"event",
".",
"type",
"===",
"\"error\"",
"&&",
"event",
".",
"name",
"&&",
"_errorsThatOnlyOccurAfterFlashLoads",
".... | Check an `error` event's `name` property to see if Flash has
already loaded, which rules out possible `iframe` sandboxing.
@private | [
"Check",
"an",
"error",
"event",
"s",
"name",
"property",
"to",
"see",
"if",
"Flash",
"has",
"already",
"loaded",
"which",
"rules",
"out",
"possible",
"iframe",
"sandboxing",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L994-L1000 | |
11,055 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(aftercopyEvent) {
if (aftercopyEvent.errors && aftercopyEvent.errors.length > 0) {
var errorEvent = _deepCopy(aftercopyEvent);
_extend(errorEvent, {
type: "error",
name: "clipboard-error"
});
delete errorEvent.success;
_setTimeout(function() {
ZeroClipb... | javascript | function(aftercopyEvent) {
if (aftercopyEvent.errors && aftercopyEvent.errors.length > 0) {
var errorEvent = _deepCopy(aftercopyEvent);
_extend(errorEvent, {
type: "error",
name: "clipboard-error"
});
delete errorEvent.success;
_setTimeout(function() {
ZeroClipb... | [
"function",
"(",
"aftercopyEvent",
")",
"{",
"if",
"(",
"aftercopyEvent",
".",
"errors",
"&&",
"aftercopyEvent",
".",
"errors",
".",
"length",
">",
"0",
")",
"{",
"var",
"errorEvent",
"=",
"_deepCopy",
"(",
"aftercopyEvent",
")",
";",
"_extend",
"(",
"erro... | Check an "aftercopy" event for clipboard errors and emit a corresponding "error" event.
@private | [
"Check",
"an",
"aftercopy",
"event",
"for",
"clipboard",
"errors",
"and",
"emit",
"a",
"corresponding",
"error",
"event",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L1171-L1183 | |
11,056 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(event) {
if (!(event && typeof event.type === "string" && event)) {
return;
}
var e, target = event.target || null, doc = target && target.ownerDocument || _document, defaults = {
view: doc.defaultView || _window,
canBubble: true,
cancelable: true,
detail: event.type =... | javascript | function(event) {
if (!(event && typeof event.type === "string" && event)) {
return;
}
var e, target = event.target || null, doc = target && target.ownerDocument || _document, defaults = {
view: doc.defaultView || _window,
canBubble: true,
cancelable: true,
detail: event.type =... | [
"function",
"(",
"event",
")",
"{",
"if",
"(",
"!",
"(",
"event",
"&&",
"typeof",
"event",
".",
"type",
"===",
"\"string\"",
"&&",
"event",
")",
")",
"{",
"return",
";",
"}",
"var",
"e",
",",
"target",
"=",
"event",
".",
"target",
"||",
"null",
"... | Dispatch a synthetic MouseEvent.
@returns `undefined`
@private | [
"Dispatch",
"a",
"synthetic",
"MouseEvent",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L1190-L1213 | |
11,057 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function() {
var container = _document.createElement("div");
container.id = _globalConfig.containerId;
container.className = _globalConfig.containerClass;
container.style.position = "absolute";
container.style.left = "0px";
container.style.top = "-9999px";
container.style.width = "1px";
... | javascript | function() {
var container = _document.createElement("div");
container.id = _globalConfig.containerId;
container.className = _globalConfig.containerClass;
container.style.position = "absolute";
container.style.left = "0px";
container.style.top = "-9999px";
container.style.width = "1px";
... | [
"function",
"(",
")",
"{",
"var",
"container",
"=",
"_document",
".",
"createElement",
"(",
"\"div\"",
")",
";",
"container",
".",
"id",
"=",
"_globalConfig",
".",
"containerId",
";",
"container",
".",
"className",
"=",
"_globalConfig",
".",
"containerClass",
... | Create the HTML bridge element to embed the Flash object into.
@private | [
"Create",
"the",
"HTML",
"bridge",
"element",
"to",
"embed",
"the",
"Flash",
"object",
"into",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L1252-L1263 | |
11,058 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function() {
var len, flashBridge = _flashState.bridge, container = _getHtmlBridge(flashBridge);
if (!flashBridge) {
var allowScriptAccess = _determineScriptAccess(_window.location.host, _globalConfig);
var allowNetworking = allowScriptAccess === "never" ? "none" : "all";
var flashvars = _vars... | javascript | function() {
var len, flashBridge = _flashState.bridge, container = _getHtmlBridge(flashBridge);
if (!flashBridge) {
var allowScriptAccess = _determineScriptAccess(_window.location.host, _globalConfig);
var allowNetworking = allowScriptAccess === "never" ? "none" : "all";
var flashvars = _vars... | [
"function",
"(",
")",
"{",
"var",
"len",
",",
"flashBridge",
"=",
"_flashState",
".",
"bridge",
",",
"container",
"=",
"_getHtmlBridge",
"(",
"flashBridge",
")",
";",
"if",
"(",
"!",
"flashBridge",
")",
"{",
"var",
"allowScriptAccess",
"=",
"_determineScript... | Create the SWF object.
@returns The SWF object reference.
@private | [
"Create",
"the",
"SWF",
"object",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L1311-L1347 | |
11,059 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function() {
var flashBridge = _flashState.bridge;
if (flashBridge) {
var htmlBridge = _getHtmlBridge(flashBridge);
if (htmlBridge) {
if (_flashState.pluginType === "activex" && "readyState" in flashBridge) {
flashBridge.style.display = "none";
(function removeSwfFromIE()... | javascript | function() {
var flashBridge = _flashState.bridge;
if (flashBridge) {
var htmlBridge = _getHtmlBridge(flashBridge);
if (htmlBridge) {
if (_flashState.pluginType === "activex" && "readyState" in flashBridge) {
flashBridge.style.display = "none";
(function removeSwfFromIE()... | [
"function",
"(",
")",
"{",
"var",
"flashBridge",
"=",
"_flashState",
".",
"bridge",
";",
"if",
"(",
"flashBridge",
")",
"{",
"var",
"htmlBridge",
"=",
"_getHtmlBridge",
"(",
"flashBridge",
")",
";",
"if",
"(",
"htmlBridge",
")",
"{",
"if",
"(",
"_flashSt... | Destroy the SWF object.
@private | [
"Destroy",
"the",
"SWF",
"object",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L1352-L1392 | |
11,060 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(clipData) {
var newClipData = {}, formatMap = {};
if (!(typeof clipData === "object" && clipData)) {
return;
}
for (var dataFormat in clipData) {
if (dataFormat && _hasOwn.call(clipData, dataFormat) && typeof clipData[dataFormat] === "string" && clipData[dataFormat]) {
switc... | javascript | function(clipData) {
var newClipData = {}, formatMap = {};
if (!(typeof clipData === "object" && clipData)) {
return;
}
for (var dataFormat in clipData) {
if (dataFormat && _hasOwn.call(clipData, dataFormat) && typeof clipData[dataFormat] === "string" && clipData[dataFormat]) {
switc... | [
"function",
"(",
"clipData",
")",
"{",
"var",
"newClipData",
"=",
"{",
"}",
",",
"formatMap",
"=",
"{",
"}",
";",
"if",
"(",
"!",
"(",
"typeof",
"clipData",
"===",
"\"object\"",
"&&",
"clipData",
")",
")",
"{",
"return",
";",
"}",
"for",
"(",
"var"... | Map the data format names of the "clipData" to Flash-friendly names.
@returns A new transformed object.
@private | [
"Map",
"the",
"data",
"format",
"names",
"of",
"the",
"clipData",
"to",
"Flash",
"-",
"friendly",
"names",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L1399-L1442 | |
11,061 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(options) {
var i, len, domain, domains, str = "", trustedOriginsExpanded = [];
if (options.trustedDomains) {
if (typeof options.trustedDomains === "string") {
domains = [ options.trustedDomains ];
} else if (typeof options.trustedDomains === "object" && "length" in options.trustedDo... | javascript | function(options) {
var i, len, domain, domains, str = "", trustedOriginsExpanded = [];
if (options.trustedDomains) {
if (typeof options.trustedDomains === "string") {
domains = [ options.trustedDomains ];
} else if (typeof options.trustedDomains === "object" && "length" in options.trustedDo... | [
"function",
"(",
"options",
")",
"{",
"var",
"i",
",",
"len",
",",
"domain",
",",
"domains",
",",
"str",
"=",
"\"\"",
",",
"trustedOriginsExpanded",
"=",
"[",
"]",
";",
"if",
"(",
"options",
".",
"trustedDomains",
")",
"{",
"if",
"(",
"typeof",
"opti... | Creates a query string for the FlashVars param.
Does NOT include the cache-busting query param.
@returns FlashVars query string
@private | [
"Creates",
"a",
"query",
"string",
"for",
"the",
"FlashVars",
"param",
".",
"Does",
"NOT",
"include",
"the",
"cache",
"-",
"busting",
"query",
"param",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L1499-L1537 | |
11,062 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(element, value) {
var c, cl, className, classNames = [];
if (typeof value === "string" && value) {
classNames = value.split(/\s+/);
}
if (element && element.nodeType === 1 && classNames.length > 0) {
className = (" " + (element.className || "") + " ").replace(/[\t\r\n\f]/g, " ");
... | javascript | function(element, value) {
var c, cl, className, classNames = [];
if (typeof value === "string" && value) {
classNames = value.split(/\s+/);
}
if (element && element.nodeType === 1 && classNames.length > 0) {
className = (" " + (element.className || "") + " ").replace(/[\t\r\n\f]/g, " ");
... | [
"function",
"(",
"element",
",",
"value",
")",
"{",
"var",
"c",
",",
"cl",
",",
"className",
",",
"classNames",
"=",
"[",
"]",
";",
"if",
"(",
"typeof",
"value",
"===",
"\"string\"",
"&&",
"value",
")",
"{",
"classNames",
"=",
"value",
".",
"split",
... | Add a class to an element, if it doesn't already have it.
@returns The element, with its new class added.
@private | [
"Add",
"a",
"class",
"to",
"an",
"element",
"if",
"it",
"doesn",
"t",
"already",
"have",
"it",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L1631-L1649 | |
11,063 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(el) {
var pos = {
left: 0,
top: 0,
width: 0,
height: 0
};
if (el.getBoundingClientRect) {
var elRect = el.getBoundingClientRect();
var pageXOffset = _window.pageXOffset;
var pageYOffset = _window.pageYOffset;
var leftBorderWidth = _document.documentEl... | javascript | function(el) {
var pos = {
left: 0,
top: 0,
width: 0,
height: 0
};
if (el.getBoundingClientRect) {
var elRect = el.getBoundingClientRect();
var pageXOffset = _window.pageXOffset;
var pageYOffset = _window.pageYOffset;
var leftBorderWidth = _document.documentEl... | [
"function",
"(",
"el",
")",
"{",
"var",
"pos",
"=",
"{",
"left",
":",
"0",
",",
"top",
":",
"0",
",",
"width",
":",
"0",
",",
"height",
":",
"0",
"}",
";",
"if",
"(",
"el",
".",
"getBoundingClientRect",
")",
"{",
"var",
"elRect",
"=",
"el",
"... | Get the absolutely positioned coordinates of a DOM element.
@returns Object containing the element's position, width, and height.
@private | [
"Get",
"the",
"absolutely",
"positioned",
"coordinates",
"of",
"a",
"DOM",
"element",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L1700-L1727 | |
11,064 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function() {
var htmlBridge;
if (_currentElement && (htmlBridge = _getHtmlBridge(_flashState.bridge))) {
var pos = _getElementPosition(_currentElement);
_extend(htmlBridge.style, {
width: pos.width + "px",
height: pos.height + "px",
top: pos.top + "px",
left: pos.left... | javascript | function() {
var htmlBridge;
if (_currentElement && (htmlBridge = _getHtmlBridge(_flashState.bridge))) {
var pos = _getElementPosition(_currentElement);
_extend(htmlBridge.style, {
width: pos.width + "px",
height: pos.height + "px",
top: pos.top + "px",
left: pos.left... | [
"function",
"(",
")",
"{",
"var",
"htmlBridge",
";",
"if",
"(",
"_currentElement",
"&&",
"(",
"htmlBridge",
"=",
"_getHtmlBridge",
"(",
"_flashState",
".",
"bridge",
")",
")",
")",
"{",
"var",
"pos",
"=",
"_getElementPosition",
"(",
"_currentElement",
")",
... | Reposition the Flash object to cover the currently activated element.
@returns `undefined`
@private | [
"Reposition",
"the",
"Flash",
"object",
"to",
"cover",
"the",
"currently",
"activated",
"element",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L1769-L1781 | |
11,065 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(enabled) {
if (_flashState.ready === true) {
if (_flashState.bridge && typeof _flashState.bridge.setHandCursor === "function") {
_flashState.bridge.setHandCursor(enabled);
} else {
_flashState.ready = false;
}
}
} | javascript | function(enabled) {
if (_flashState.ready === true) {
if (_flashState.bridge && typeof _flashState.bridge.setHandCursor === "function") {
_flashState.bridge.setHandCursor(enabled);
} else {
_flashState.ready = false;
}
}
} | [
"function",
"(",
"enabled",
")",
"{",
"if",
"(",
"_flashState",
".",
"ready",
"===",
"true",
")",
"{",
"if",
"(",
"_flashState",
".",
"bridge",
"&&",
"typeof",
"_flashState",
".",
"bridge",
".",
"setHandCursor",
"===",
"\"function\"",
")",
"{",
"_flashStat... | Sends a signal to the Flash object to display the hand cursor if `true`.
@returns `undefined`
@private | [
"Sends",
"a",
"signal",
"to",
"the",
"Flash",
"object",
"to",
"display",
"the",
"hand",
"cursor",
"if",
"true",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L1788-L1796 | |
11,066 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(val) {
if (/^(?:auto|inherit)$/.test(val)) {
return val;
}
var zIndex;
if (typeof val === "number" && !_isNaN(val)) {
zIndex = val;
} else if (typeof val === "string") {
zIndex = _getSafeZIndex(_parseInt(val, 10));
}
return typeof zIndex === "number" ? zIndex : "au... | javascript | function(val) {
if (/^(?:auto|inherit)$/.test(val)) {
return val;
}
var zIndex;
if (typeof val === "number" && !_isNaN(val)) {
zIndex = val;
} else if (typeof val === "string") {
zIndex = _getSafeZIndex(_parseInt(val, 10));
}
return typeof zIndex === "number" ? zIndex : "au... | [
"function",
"(",
"val",
")",
"{",
"if",
"(",
"/",
"^(?:auto|inherit)$",
"/",
".",
"test",
"(",
"val",
")",
")",
"{",
"return",
"val",
";",
"}",
"var",
"zIndex",
";",
"if",
"(",
"typeof",
"val",
"===",
"\"number\"",
"&&",
"!",
"_isNaN",
"(",
"val",
... | Get a safe value for `zIndex`
@returns an integer, or "auto"
@private | [
"Get",
"a",
"safe",
"value",
"for",
"zIndex"
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L1803-L1814 | |
11,067 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(content) {
var replaceRegex = /(\r\n|\r|\n)/g;
if (typeof content === "string" && _globalConfig.fixLineEndings === true) {
if (_isWindows()) {
if (/((^|[^\r])\n|\r([^\n]|$))/.test(content)) {
content = content.replace(replaceRegex, "\r\n");
}
} else if (/\r/.test(c... | javascript | function(content) {
var replaceRegex = /(\r\n|\r|\n)/g;
if (typeof content === "string" && _globalConfig.fixLineEndings === true) {
if (_isWindows()) {
if (/((^|[^\r])\n|\r([^\n]|$))/.test(content)) {
content = content.replace(replaceRegex, "\r\n");
}
} else if (/\r/.test(c... | [
"function",
"(",
"content",
")",
"{",
"var",
"replaceRegex",
"=",
"/",
"(\\r\\n|\\r|\\n)",
"/",
"g",
";",
"if",
"(",
"typeof",
"content",
"===",
"\"string\"",
"&&",
"_globalConfig",
".",
"fixLineEndings",
"===",
"true",
")",
"{",
"if",
"(",
"_isWindows",
"... | Ensure OS-compliant line endings, i.e. "\r\n" on Windows, "\n" elsewhere
@returns string
@private | [
"Ensure",
"OS",
"-",
"compliant",
"line",
"endings",
"i",
".",
"e",
".",
"\\",
"r",
"\\",
"n",
"on",
"Windows",
"\\",
"n",
"elsewhere"
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L1821-L1833 | |
11,068 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(doNotReassessFlashSupport) {
var effectiveScriptOrigin, frame, frameError, previousState = _flashState.sandboxed, isSandboxed = null;
doNotReassessFlashSupport = doNotReassessFlashSupport === true;
if (_pageIsFramed === false) {
isSandboxed = false;
} else {
try {
frame = wi... | javascript | function(doNotReassessFlashSupport) {
var effectiveScriptOrigin, frame, frameError, previousState = _flashState.sandboxed, isSandboxed = null;
doNotReassessFlashSupport = doNotReassessFlashSupport === true;
if (_pageIsFramed === false) {
isSandboxed = false;
} else {
try {
frame = wi... | [
"function",
"(",
"doNotReassessFlashSupport",
")",
"{",
"var",
"effectiveScriptOrigin",
",",
"frame",
",",
"frameError",
",",
"previousState",
"=",
"_flashState",
".",
"sandboxed",
",",
"isSandboxed",
"=",
"null",
";",
"doNotReassessFlashSupport",
"=",
"doNotReassessF... | Attempt to detect if ZeroClipboard is executing inside of a sandboxed iframe.
If it is, Flash Player cannot be used, so ZeroClipboard is dead in the water.
@see {@link http://lists.w3.org/Archives/Public/public-whatwg-archive/2014Dec/0002.html}
@see {@link https://github.com/zeroclipboard/zeroclipboard/issues/511}
@se... | [
"Attempt",
"to",
"detect",
"if",
"ZeroClipboard",
"is",
"executing",
"inside",
"of",
"a",
"sandboxed",
"iframe",
".",
"If",
"it",
"is",
"Flash",
"Player",
"cannot",
"be",
"used",
"so",
"ZeroClipboard",
"is",
"dead",
"in",
"the",
"water",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L1845-L1881 | |
11,069 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | parseFlashVersion | function parseFlashVersion(desc) {
var matches = desc.match(/[\d]+/g);
matches.length = 3;
return matches.join(".");
} | javascript | function parseFlashVersion(desc) {
var matches = desc.match(/[\d]+/g);
matches.length = 3;
return matches.join(".");
} | [
"function",
"parseFlashVersion",
"(",
"desc",
")",
"{",
"var",
"matches",
"=",
"desc",
".",
"match",
"(",
"/",
"[\\d]+",
"/",
"g",
")",
";",
"matches",
".",
"length",
"=",
"3",
";",
"return",
"matches",
".",
"join",
"(",
"\".\"",
")",
";",
"}"
] | Derived from Apple's suggested sniffer.
@param {String} desc e.g. "Shockwave Flash 7.0 r61"
@returns {String} "7.0.61"
@private | [
"Derived",
"from",
"Apple",
"s",
"suggested",
"sniffer",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L1899-L1903 |
11,070 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(elements) {
var meta, client = this;
client.id = "" + _clientIdCounter++;
meta = {
instance: client,
elements: [],
handlers: {},
coreWildcardHandler: function(event) {
return client.emit(event);
}
};
_clientMeta[client.id] = meta;
if (elements) {
... | javascript | function(elements) {
var meta, client = this;
client.id = "" + _clientIdCounter++;
meta = {
instance: client,
elements: [],
handlers: {},
coreWildcardHandler: function(event) {
return client.emit(event);
}
};
_clientMeta[client.id] = meta;
if (elements) {
... | [
"function",
"(",
"elements",
")",
"{",
"var",
"meta",
",",
"client",
"=",
"this",
";",
"client",
".",
"id",
"=",
"\"\"",
"+",
"_clientIdCounter",
"++",
";",
"meta",
"=",
"{",
"instance",
":",
"client",
",",
"elements",
":",
"[",
"]",
",",
"handlers",... | The real constructor for `ZeroClipboard` client instances.
@private | [
"The",
"real",
"constructor",
"for",
"ZeroClipboard",
"client",
"instances",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L2183-L2203 | |
11,071 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(eventType, listener) {
var i, len, events, added = {}, client = this, meta = _clientMeta[client.id], handlers = meta && meta.handlers;
if (!meta) {
throw new Error("Attempted to add new listener(s) to a destroyed ZeroClipboard client instance");
}
if (typeof eventType === "string" && even... | javascript | function(eventType, listener) {
var i, len, events, added = {}, client = this, meta = _clientMeta[client.id], handlers = meta && meta.handlers;
if (!meta) {
throw new Error("Attempted to add new listener(s) to a destroyed ZeroClipboard client instance");
}
if (typeof eventType === "string" && even... | [
"function",
"(",
"eventType",
",",
"listener",
")",
"{",
"var",
"i",
",",
"len",
",",
"events",
",",
"added",
"=",
"{",
"}",
",",
"client",
"=",
"this",
",",
"meta",
"=",
"_clientMeta",
"[",
"client",
".",
"id",
"]",
",",
"handlers",
"=",
"meta",
... | The underlying implementation of `ZeroClipboard.Client.prototype.on`.
@private | [
"The",
"underlying",
"implementation",
"of",
"ZeroClipboard",
".",
"Client",
".",
"prototype",
".",
"on",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L2208-L2260 | |
11,072 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(eventType, listener) {
var i, len, foundIndex, events, perEventHandlers, client = this, meta = _clientMeta[client.id], handlers = meta && meta.handlers;
if (!handlers) {
return client;
}
if (arguments.length === 0) {
events = _keys(handlers);
} else if (typeof eventType === "str... | javascript | function(eventType, listener) {
var i, len, foundIndex, events, perEventHandlers, client = this, meta = _clientMeta[client.id], handlers = meta && meta.handlers;
if (!handlers) {
return client;
}
if (arguments.length === 0) {
events = _keys(handlers);
} else if (typeof eventType === "str... | [
"function",
"(",
"eventType",
",",
"listener",
")",
"{",
"var",
"i",
",",
"len",
",",
"foundIndex",
",",
"events",
",",
"perEventHandlers",
",",
"client",
"=",
"this",
",",
"meta",
"=",
"_clientMeta",
"[",
"client",
".",
"id",
"]",
",",
"handlers",
"="... | The underlying implementation of `ZeroClipboard.Client.prototype.off`.
@private | [
"The",
"underlying",
"implementation",
"of",
"ZeroClipboard",
".",
"Client",
".",
"prototype",
".",
"off",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L2265-L2300 | |
11,073 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(eventType) {
var copy = null, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers;
if (handlers) {
if (typeof eventType === "string" && eventType) {
copy = handlers[eventType] ? handlers[eventType].slice(0) : [];
} else {
copy = _deepCopy(handlers);
}
... | javascript | function(eventType) {
var copy = null, handlers = _clientMeta[this.id] && _clientMeta[this.id].handlers;
if (handlers) {
if (typeof eventType === "string" && eventType) {
copy = handlers[eventType] ? handlers[eventType].slice(0) : [];
} else {
copy = _deepCopy(handlers);
}
... | [
"function",
"(",
"eventType",
")",
"{",
"var",
"copy",
"=",
"null",
",",
"handlers",
"=",
"_clientMeta",
"[",
"this",
".",
"id",
"]",
"&&",
"_clientMeta",
"[",
"this",
".",
"id",
"]",
".",
"handlers",
";",
"if",
"(",
"handlers",
")",
"{",
"if",
"("... | The underlying implementation of `ZeroClipboard.Client.prototype.handlers`.
@private | [
"The",
"underlying",
"implementation",
"of",
"ZeroClipboard",
".",
"Client",
".",
"prototype",
".",
"handlers",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L2305-L2315 | |
11,074 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(event) {
var eventCopy, client = this;
if (_clientShouldEmit.call(client, event)) {
if (typeof event === "object" && event && typeof event.type === "string" && event.type) {
event = _extend({}, event);
}
eventCopy = _extend({}, _createEvent(event), {
client: client
... | javascript | function(event) {
var eventCopy, client = this;
if (_clientShouldEmit.call(client, event)) {
if (typeof event === "object" && event && typeof event.type === "string" && event.type) {
event = _extend({}, event);
}
eventCopy = _extend({}, _createEvent(event), {
client: client
... | [
"function",
"(",
"event",
")",
"{",
"var",
"eventCopy",
",",
"client",
"=",
"this",
";",
"if",
"(",
"_clientShouldEmit",
".",
"call",
"(",
"client",
",",
"event",
")",
")",
"{",
"if",
"(",
"typeof",
"event",
"===",
"\"object\"",
"&&",
"event",
"&&",
... | The underlying implementation of `ZeroClipboard.Client.prototype.emit`.
@private | [
"The",
"underlying",
"implementation",
"of",
"ZeroClipboard",
".",
"Client",
".",
"prototype",
".",
"emit",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L2320-L2332 | |
11,075 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(elements) {
if (!_clientMeta[this.id]) {
throw new Error("Attempted to clip element(s) to a destroyed ZeroClipboard client instance");
}
elements = _prepClip(elements);
for (var i = 0; i < elements.length; i++) {
if (_hasOwn.call(elements, i) && elements[i] && elements[i].nodeType =... | javascript | function(elements) {
if (!_clientMeta[this.id]) {
throw new Error("Attempted to clip element(s) to a destroyed ZeroClipboard client instance");
}
elements = _prepClip(elements);
for (var i = 0; i < elements.length; i++) {
if (_hasOwn.call(elements, i) && elements[i] && elements[i].nodeType =... | [
"function",
"(",
"elements",
")",
"{",
"if",
"(",
"!",
"_clientMeta",
"[",
"this",
".",
"id",
"]",
")",
"{",
"throw",
"new",
"Error",
"(",
"\"Attempted to clip element(s) to a destroyed ZeroClipboard client instance\"",
")",
";",
"}",
"elements",
"=",
"_prepClip",... | The underlying implementation of `ZeroClipboard.Client.prototype.clip`.
@private | [
"The",
"underlying",
"implementation",
"of",
"ZeroClipboard",
".",
"Client",
".",
"prototype",
".",
"clip",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L2337-L2360 | |
11,076 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(elements) {
var meta = _clientMeta[this.id];
if (!meta) {
return this;
}
var clippedElements = meta.elements;
var arrayIndex;
if (typeof elements === "undefined") {
elements = clippedElements.slice(0);
} else {
elements = _prepClip(elements);
}
for (var i =... | javascript | function(elements) {
var meta = _clientMeta[this.id];
if (!meta) {
return this;
}
var clippedElements = meta.elements;
var arrayIndex;
if (typeof elements === "undefined") {
elements = clippedElements.slice(0);
} else {
elements = _prepClip(elements);
}
for (var i =... | [
"function",
"(",
"elements",
")",
"{",
"var",
"meta",
"=",
"_clientMeta",
"[",
"this",
".",
"id",
"]",
";",
"if",
"(",
"!",
"meta",
")",
"{",
"return",
"this",
";",
"}",
"var",
"clippedElements",
"=",
"meta",
".",
"elements",
";",
"var",
"arrayIndex"... | The underlying implementation of `ZeroClipboard.Client.prototype.unclip`.
@private | [
"The",
"underlying",
"implementation",
"of",
"ZeroClipboard",
".",
"Client",
".",
"prototype",
".",
"unclip",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L2365-L2399 | |
11,077 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function() {
var meta = _clientMeta[this.id];
if (!meta) {
return;
}
this.unclip();
this.off();
ZeroClipboard.off("*", meta.coreWildcardHandler);
delete _clientMeta[this.id];
} | javascript | function() {
var meta = _clientMeta[this.id];
if (!meta) {
return;
}
this.unclip();
this.off();
ZeroClipboard.off("*", meta.coreWildcardHandler);
delete _clientMeta[this.id];
} | [
"function",
"(",
")",
"{",
"var",
"meta",
"=",
"_clientMeta",
"[",
"this",
".",
"id",
"]",
";",
"if",
"(",
"!",
"meta",
")",
"{",
"return",
";",
"}",
"this",
".",
"unclip",
"(",
")",
";",
"this",
".",
"off",
"(",
")",
";",
"ZeroClipboard",
".",... | The underlying implementation of `ZeroClipboard.Client.prototype.destroy`.
@private | [
"The",
"underlying",
"implementation",
"of",
"ZeroClipboard",
".",
"Client",
".",
"prototype",
".",
"destroy",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L2412-L2421 | |
11,078 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(event) {
var meta = _clientMeta[this.id];
if (!(typeof event === "object" && event && event.type && meta)) {
return;
}
var async = _shouldPerformAsync(event);
var wildcardTypeHandlers = meta && meta.handlers["*"] || [];
var specificTypeHandlers = meta && meta.handlers[event.type] ... | javascript | function(event) {
var meta = _clientMeta[this.id];
if (!(typeof event === "object" && event && event.type && meta)) {
return;
}
var async = _shouldPerformAsync(event);
var wildcardTypeHandlers = meta && meta.handlers["*"] || [];
var specificTypeHandlers = meta && meta.handlers[event.type] ... | [
"function",
"(",
"event",
")",
"{",
"var",
"meta",
"=",
"_clientMeta",
"[",
"this",
".",
"id",
"]",
";",
"if",
"(",
"!",
"(",
"typeof",
"event",
"===",
"\"object\"",
"&&",
"event",
"&&",
"event",
".",
"type",
"&&",
"meta",
")",
")",
"{",
"return",
... | Handle the actual dispatching of events to a client instance.
@returns `undefined`
@private | [
"Handle",
"the",
"actual",
"dispatching",
"of",
"events",
"to",
"a",
"client",
"instance",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L2450-L2477 | |
11,079 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(element) {
if (!(element && element.nodeType === 1)) {
return;
}
var _suppressMouseEvents = function(event) {
if (!(event || (event = _window.event))) {
return;
}
if (event._source !== "js") {
event.stopImmediatePropagation();
event.preventDefault();
... | javascript | function(element) {
if (!(element && element.nodeType === 1)) {
return;
}
var _suppressMouseEvents = function(event) {
if (!(event || (event = _window.event))) {
return;
}
if (event._source !== "js") {
event.stopImmediatePropagation();
event.preventDefault();
... | [
"function",
"(",
"element",
")",
"{",
"if",
"(",
"!",
"(",
"element",
"&&",
"element",
".",
"nodeType",
"===",
"1",
")",
")",
"{",
"return",
";",
"}",
"var",
"_suppressMouseEvents",
"=",
"function",
"(",
"event",
")",
"{",
"if",
"(",
"!",
"(",
"eve... | Add a `mouseover` handler function for a clipped element.
@returns `undefined`
@private | [
"Add",
"a",
"mouseover",
"handler",
"function",
"for",
"a",
"clipped",
"element",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L2496-L2529 | |
11,080 | zeroclipboard/zeroclipboard | dist/ZeroClipboard.js | function(element) {
if (!(element && element.nodeType === 1)) {
return;
}
var mouseHandlers = _mouseHandlers[element.zcClippingId];
if (!(typeof mouseHandlers === "object" && mouseHandlers)) {
return;
}
var key, val, mouseEvents = [ "move", "leave", "enter", "out", "over" ];
for ... | javascript | function(element) {
if (!(element && element.nodeType === 1)) {
return;
}
var mouseHandlers = _mouseHandlers[element.zcClippingId];
if (!(typeof mouseHandlers === "object" && mouseHandlers)) {
return;
}
var key, val, mouseEvents = [ "move", "leave", "enter", "out", "over" ];
for ... | [
"function",
"(",
"element",
")",
"{",
"if",
"(",
"!",
"(",
"element",
"&&",
"element",
".",
"nodeType",
"===",
"1",
")",
")",
"{",
"return",
";",
"}",
"var",
"mouseHandlers",
"=",
"_mouseHandlers",
"[",
"element",
".",
"zcClippingId",
"]",
";",
"if",
... | Remove a `mouseover` handler function for a clipped element.
@returns `undefined`
@private | [
"Remove",
"a",
"mouseover",
"handler",
"function",
"for",
"a",
"clipped",
"element",
"."
] | 09660421dd377fda5bd66ce9bb69c916470bfbb5 | https://github.com/zeroclipboard/zeroclipboard/blob/09660421dd377fda5bd66ce9bb69c916470bfbb5/dist/ZeroClipboard.js#L2536-L2553 | |
11,081 | whitedogg13/react-native-nfc-manager | ndef-lib/ndef-text.js | decode | function decode(data) {
var languageCodeLength = (data[0] & 0x3F), // 6 LSBs
languageCode = data.slice(1, 1 + languageCodeLength),
utf16 = (data[0] & 0x80) !== 0; // assuming UTF-16BE
// TODO need to deal with UTF in the future
// console.log("lang " + languageCode + (utf16 ? " utf16" : " ... | javascript | function decode(data) {
var languageCodeLength = (data[0] & 0x3F), // 6 LSBs
languageCode = data.slice(1, 1 + languageCodeLength),
utf16 = (data[0] & 0x80) !== 0; // assuming UTF-16BE
// TODO need to deal with UTF in the future
// console.log("lang " + languageCode + (utf16 ? " utf16" : " ... | [
"function",
"decode",
"(",
"data",
")",
"{",
"var",
"languageCodeLength",
"=",
"(",
"data",
"[",
"0",
"]",
"&",
"0x3F",
")",
",",
"// 6 LSBs",
"languageCode",
"=",
"data",
".",
"slice",
"(",
"1",
",",
"1",
"+",
"languageCodeLength",
")",
",",
"utf16",
... | decode text bytes from ndef record payload @returns a string | [
"decode",
"text",
"bytes",
"from",
"ndef",
"record",
"payload"
] | 77ad9a17be20c89e0a45956870c4e9d732981dee | https://github.com/whitedogg13/react-native-nfc-manager/blob/77ad9a17be20c89e0a45956870c4e9d732981dee/ndef-lib/ndef-text.js#L5-L15 |
11,082 | whitedogg13/react-native-nfc-manager | ndef-lib/ndef-text.js | encode | function encode(text, lang, encoding) {
// ISO/IANA language code, but we're not enforcing
if (!lang) { lang = 'en'; }
var encoded = util.stringToBytes(lang + text);
encoded.unshift(lang.length);
return encoded;
} | javascript | function encode(text, lang, encoding) {
// ISO/IANA language code, but we're not enforcing
if (!lang) { lang = 'en'; }
var encoded = util.stringToBytes(lang + text);
encoded.unshift(lang.length);
return encoded;
} | [
"function",
"encode",
"(",
"text",
",",
"lang",
",",
"encoding",
")",
"{",
"// ISO/IANA language code, but we're not enforcing",
"if",
"(",
"!",
"lang",
")",
"{",
"lang",
"=",
"'en'",
";",
"}",
"var",
"encoded",
"=",
"util",
".",
"stringToBytes",
"(",
"lang"... | encode text payload @returns an array of bytes | [
"encode",
"text",
"payload"
] | 77ad9a17be20c89e0a45956870c4e9d732981dee | https://github.com/whitedogg13/react-native-nfc-manager/blob/77ad9a17be20c89e0a45956870c4e9d732981dee/ndef-lib/ndef-text.js#L19-L28 |
11,083 | whitedogg13/react-native-nfc-manager | ndef-lib/index.js | function (text, languageCode, id) {
var payload = textHelper.encodePayload(text, languageCode);
if (!id) { id = []; }
return ndef.record(ndef.TNF_WELL_KNOWN, ndef.RTD_TEXT, id, payload);
} | javascript | function (text, languageCode, id) {
var payload = textHelper.encodePayload(text, languageCode);
if (!id) { id = []; }
return ndef.record(ndef.TNF_WELL_KNOWN, ndef.RTD_TEXT, id, payload);
} | [
"function",
"(",
"text",
",",
"languageCode",
",",
"id",
")",
"{",
"var",
"payload",
"=",
"textHelper",
".",
"encodePayload",
"(",
"text",
",",
"languageCode",
")",
";",
"if",
"(",
"!",
"id",
")",
"{",
"id",
"=",
"[",
"]",
";",
"}",
"return",
"ndef... | Helper that creates an NDEF record containing plain text.
@text String of text to encode
@languageCode ISO/IANA language code. Examples: “fi”, “en-US”, “fr-CA”, “jp”. (optional)
@id byte[] (optional) | [
"Helper",
"that",
"creates",
"an",
"NDEF",
"record",
"containing",
"plain",
"text",
"."
] | 77ad9a17be20c89e0a45956870c4e9d732981dee | https://github.com/whitedogg13/react-native-nfc-manager/blob/77ad9a17be20c89e0a45956870c4e9d732981dee/ndef-lib/index.js#L96-L101 | |
11,084 | whitedogg13/react-native-nfc-manager | ndef-lib/index.js | function (uri, id) {
var payload = uriHelper.encodePayload(uri);
if (!id) { id = []; }
return ndef.record(ndef.TNF_WELL_KNOWN, ndef.RTD_URI, id, payload);
} | javascript | function (uri, id) {
var payload = uriHelper.encodePayload(uri);
if (!id) { id = []; }
return ndef.record(ndef.TNF_WELL_KNOWN, ndef.RTD_URI, id, payload);
} | [
"function",
"(",
"uri",
",",
"id",
")",
"{",
"var",
"payload",
"=",
"uriHelper",
".",
"encodePayload",
"(",
"uri",
")",
";",
"if",
"(",
"!",
"id",
")",
"{",
"id",
"=",
"[",
"]",
";",
"}",
"return",
"ndef",
".",
"record",
"(",
"ndef",
".",
"TNF_... | Helper that creates a NDEF record containing a URI.
@uri String
@id byte[] (optional) | [
"Helper",
"that",
"creates",
"a",
"NDEF",
"record",
"containing",
"a",
"URI",
"."
] | 77ad9a17be20c89e0a45956870c4e9d732981dee | https://github.com/whitedogg13/react-native-nfc-manager/blob/77ad9a17be20c89e0a45956870c4e9d732981dee/ndef-lib/index.js#L109-L113 | |
11,085 | whitedogg13/react-native-nfc-manager | ndef-lib/index.js | function (uri, payload, id) {
if (!id) { id = []; }
if (!payload) { payload = []; }
return ndef.record(ndef.TNF_ABSOLUTE_URI, uri, id, payload);
} | javascript | function (uri, payload, id) {
if (!id) { id = []; }
if (!payload) { payload = []; }
return ndef.record(ndef.TNF_ABSOLUTE_URI, uri, id, payload);
} | [
"function",
"(",
"uri",
",",
"payload",
",",
"id",
")",
"{",
"if",
"(",
"!",
"id",
")",
"{",
"id",
"=",
"[",
"]",
";",
"}",
"if",
"(",
"!",
"payload",
")",
"{",
"payload",
"=",
"[",
"]",
";",
"}",
"return",
"ndef",
".",
"record",
"(",
"ndef... | Helper that creates a NDEF record containing an absolute URI.
An Absolute URI record means the URI describes the payload of the record.
For example a SOAP message could use "http://schemas.xmlsoap.org/soap/envelope/"
as the type and XML content for the payload.
Absolute URI can also be used to write LaunchApp record... | [
"Helper",
"that",
"creates",
"a",
"NDEF",
"record",
"containing",
"an",
"absolute",
"URI",
"."
] | 77ad9a17be20c89e0a45956870c4e9d732981dee | https://github.com/whitedogg13/react-native-nfc-manager/blob/77ad9a17be20c89e0a45956870c4e9d732981dee/ndef-lib/index.js#L138-L142 | |
11,086 | whitedogg13/react-native-nfc-manager | ndef-lib/index.js | function (mimeType, payload, id) {
if (!id) { id = []; }
return ndef.record(ndef.TNF_MIME_MEDIA, mimeType, id, payload);
} | javascript | function (mimeType, payload, id) {
if (!id) { id = []; }
return ndef.record(ndef.TNF_MIME_MEDIA, mimeType, id, payload);
} | [
"function",
"(",
"mimeType",
",",
"payload",
",",
"id",
")",
"{",
"if",
"(",
"!",
"id",
")",
"{",
"id",
"=",
"[",
"]",
";",
"}",
"return",
"ndef",
".",
"record",
"(",
"ndef",
".",
"TNF_MIME_MEDIA",
",",
"mimeType",
",",
"id",
",",
"payload",
")",... | Helper that creates a NDEF record containing an mimeMediaRecord.
@mimeType String
@payload byte[]
@id byte[] (optional) | [
"Helper",
"that",
"creates",
"a",
"NDEF",
"record",
"containing",
"an",
"mimeMediaRecord",
"."
] | 77ad9a17be20c89e0a45956870c4e9d732981dee | https://github.com/whitedogg13/react-native-nfc-manager/blob/77ad9a17be20c89e0a45956870c4e9d732981dee/ndef-lib/index.js#L151-L154 | |
11,087 | whitedogg13/react-native-nfc-manager | ndef-lib/index.js | function (ndefRecords, id) {
var payload = [];
if (!id) { id = []; }
if (ndefRecords)
{
// make sure we have an array of something like NDEF records before encoding
if (ndefRecords[0] instanceof Object && ndefRecords[0].hasOwnProperty('tnf')) {
p... | javascript | function (ndefRecords, id) {
var payload = [];
if (!id) { id = []; }
if (ndefRecords)
{
// make sure we have an array of something like NDEF records before encoding
if (ndefRecords[0] instanceof Object && ndefRecords[0].hasOwnProperty('tnf')) {
p... | [
"function",
"(",
"ndefRecords",
",",
"id",
")",
"{",
"var",
"payload",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"id",
")",
"{",
"id",
"=",
"[",
"]",
";",
"}",
"if",
"(",
"ndefRecords",
")",
"{",
"// make sure we have an array of something like NDEF records befo... | Helper that creates an NDEF record containing an Smart Poster.
@ndefRecords array of NDEF Records
@id byte[] (optional) | [
"Helper",
"that",
"creates",
"an",
"NDEF",
"record",
"containing",
"an",
"Smart",
"Poster",
"."
] | 77ad9a17be20c89e0a45956870c4e9d732981dee | https://github.com/whitedogg13/react-native-nfc-manager/blob/77ad9a17be20c89e0a45956870c4e9d732981dee/ndef-lib/index.js#L162-L181 | |
11,088 | whitedogg13/react-native-nfc-manager | ndef-lib/index.js | function (ndefRecords) {
var encoded = [],
tnf_byte,
record_type,
payload_length,
id_length,
i,
mb, me, // messageBegin, messageEnd
cf = false, // chunkFlag TODO implement
sr, // boolean shortRecord
il; ... | javascript | function (ndefRecords) {
var encoded = [],
tnf_byte,
record_type,
payload_length,
id_length,
i,
mb, me, // messageBegin, messageEnd
cf = false, // chunkFlag TODO implement
sr, // boolean shortRecord
il; ... | [
"function",
"(",
"ndefRecords",
")",
"{",
"var",
"encoded",
"=",
"[",
"]",
",",
"tnf_byte",
",",
"record_type",
",",
"payload_length",
",",
"id_length",
",",
"i",
",",
"mb",
",",
"me",
",",
"// messageBegin, messageEnd",
"cf",
"=",
"false",
",",
"// chunkF... | Encodes an NDEF Message into bytes that can be written to a NFC tag.
@ndefRecords an Array of NDEF Records
@returns byte array
@see NFC Data Exchange Format (NDEF) http://www.nfc-forum.org/specs/spec_list/ | [
"Encodes",
"an",
"NDEF",
"Message",
"into",
"bytes",
"that",
"can",
"be",
"written",
"to",
"a",
"NFC",
"tag",
"."
] | 77ad9a17be20c89e0a45956870c4e9d732981dee | https://github.com/whitedogg13/react-native-nfc-manager/blob/77ad9a17be20c89e0a45956870c4e9d732981dee/ndef-lib/index.js#L210-L263 | |
11,089 | whitedogg13/react-native-nfc-manager | ndef-lib/index.js | function (ndefBytes) {
// ndefBytes can be an array of bytes e.g. [0x03, 0x31, 0xd1] or a Buffer
var bytes;
// if (ndefBytes instanceof Buffer) {
// // get an array of bytes
// bytes = Array.prototype.slice.call(ndefBytes, 0);
// } else if (ndefBytes instanceof A... | javascript | function (ndefBytes) {
// ndefBytes can be an array of bytes e.g. [0x03, 0x31, 0xd1] or a Buffer
var bytes;
// if (ndefBytes instanceof Buffer) {
// // get an array of bytes
// bytes = Array.prototype.slice.call(ndefBytes, 0);
// } else if (ndefBytes instanceof A... | [
"function",
"(",
"ndefBytes",
")",
"{",
"// ndefBytes can be an array of bytes e.g. [0x03, 0x31, 0xd1] or a Buffer",
"var",
"bytes",
";",
"// if (ndefBytes instanceof Buffer) {",
"// // get an array of bytes",
"// bytes = Array.prototype.slice.call(ndefBytes, 0);",
"// } else if (nde... | Decodes an array bytes into an NDEF Message
@ndefBytes an array bytes or Buffer that was read from a NFC tag
@returns array of NDEF Records
@see NFC Data Exchange Format (NDEF) http://www.nfc-forum.org/specs/spec_list/ | [
"Decodes",
"an",
"array",
"bytes",
"into",
"an",
"NDEF",
"Message"
] | 77ad9a17be20c89e0a45956870c4e9d732981dee | https://github.com/whitedogg13/react-native-nfc-manager/blob/77ad9a17be20c89e0a45956870c4e9d732981dee/ndef-lib/index.js#L274-L330 | |
11,090 | whitedogg13/react-native-nfc-manager | ndef-lib/index.js | function (tnf_byte) {
return {
mb: (tnf_byte & 0x80) !== 0,
me: (tnf_byte & 0x40) !== 0,
cf: (tnf_byte & 0x20) !== 0,
sr: (tnf_byte & 0x10) !== 0,
il: (tnf_byte & 0x8) !== 0,
tnf: (tnf_byte & 0x7)
};
} | javascript | function (tnf_byte) {
return {
mb: (tnf_byte & 0x80) !== 0,
me: (tnf_byte & 0x40) !== 0,
cf: (tnf_byte & 0x20) !== 0,
sr: (tnf_byte & 0x10) !== 0,
il: (tnf_byte & 0x8) !== 0,
tnf: (tnf_byte & 0x7)
};
} | [
"function",
"(",
"tnf_byte",
")",
"{",
"return",
"{",
"mb",
":",
"(",
"tnf_byte",
"&",
"0x80",
")",
"!==",
"0",
",",
"me",
":",
"(",
"tnf_byte",
"&",
"0x40",
")",
"!==",
"0",
",",
"cf",
":",
"(",
"tnf_byte",
"&",
"0x20",
")",
"!==",
"0",
",",
... | Decode the bit flags from a TNF Byte.
@returns object with decoded data
See NFC Data Exchange Format (NDEF) Specification Section 3.2 RecordLayout | [
"Decode",
"the",
"bit",
"flags",
"from",
"a",
"TNF",
"Byte",
"."
] | 77ad9a17be20c89e0a45956870c4e9d732981dee | https://github.com/whitedogg13/react-native-nfc-manager/blob/77ad9a17be20c89e0a45956870c4e9d732981dee/ndef-lib/index.js#L339-L348 | |
11,091 | whitedogg13/react-native-nfc-manager | ndef-lib/index.js | function (mb, me, cf, sr, il, tnf) {
var value = tnf;
if (mb) {
value = value | 0x80;
}
if (me) {
value = value | 0x40;
}
// note if cf: me, mb, li must be false and tnf must be 0x6
if (cf) {
value = value | 0x20;
}
... | javascript | function (mb, me, cf, sr, il, tnf) {
var value = tnf;
if (mb) {
value = value | 0x80;
}
if (me) {
value = value | 0x40;
}
// note if cf: me, mb, li must be false and tnf must be 0x6
if (cf) {
value = value | 0x20;
}
... | [
"function",
"(",
"mb",
",",
"me",
",",
"cf",
",",
"sr",
",",
"il",
",",
"tnf",
")",
"{",
"var",
"value",
"=",
"tnf",
";",
"if",
"(",
"mb",
")",
"{",
"value",
"=",
"value",
"|",
"0x80",
";",
"}",
"if",
"(",
"me",
")",
"{",
"value",
"=",
"v... | Encode NDEF bit flags into a TNF Byte.
@returns tnf byte
See NFC Data Exchange Format (NDEF) Specification Section 3.2 RecordLayout | [
"Encode",
"NDEF",
"bit",
"flags",
"into",
"a",
"TNF",
"Byte",
"."
] | 77ad9a17be20c89e0a45956870c4e9d732981dee | https://github.com/whitedogg13/react-native-nfc-manager/blob/77ad9a17be20c89e0a45956870c4e9d732981dee/ndef-lib/index.js#L357-L383 | |
11,092 | whitedogg13/react-native-nfc-manager | ndef-lib/index.js | s | function s(bytes) {
if (typeof(bytes) === 'string') {
return bytes;
}
return bytes.reduce(function (acc, byte) {
return acc + String.fromCharCode(byte);
}, '')
// return new Buffer(bytes).toString();
} | javascript | function s(bytes) {
if (typeof(bytes) === 'string') {
return bytes;
}
return bytes.reduce(function (acc, byte) {
return acc + String.fromCharCode(byte);
}, '')
// return new Buffer(bytes).toString();
} | [
"function",
"s",
"(",
"bytes",
")",
"{",
"if",
"(",
"typeof",
"(",
"bytes",
")",
"===",
"'string'",
")",
"{",
"return",
"bytes",
";",
"}",
"return",
"bytes",
".",
"reduce",
"(",
"function",
"(",
"acc",
",",
"byte",
")",
"{",
"return",
"acc",
"+",
... | convert bytes to a String | [
"convert",
"bytes",
"to",
"a",
"String"
] | 77ad9a17be20c89e0a45956870c4e9d732981dee | https://github.com/whitedogg13/react-native-nfc-manager/blob/77ad9a17be20c89e0a45956870c4e9d732981dee/ndef-lib/index.js#L552-L561 |
11,093 | whitedogg13/react-native-nfc-manager | ndef-lib/ndef-uri.js | decode | function decode(data) {
var prefix = protocols[data[0]];
if (!prefix) { // 36 to 255 should be ""
prefix = "";
}
return prefix + util.bytesToString(data.slice(1));
} | javascript | function decode(data) {
var prefix = protocols[data[0]];
if (!prefix) { // 36 to 255 should be ""
prefix = "";
}
return prefix + util.bytesToString(data.slice(1));
} | [
"function",
"decode",
"(",
"data",
")",
"{",
"var",
"prefix",
"=",
"protocols",
"[",
"data",
"[",
"0",
"]",
"]",
";",
"if",
"(",
"!",
"prefix",
")",
"{",
"// 36 to 255 should be \"\"",
"prefix",
"=",
"\"\"",
";",
"}",
"return",
"prefix",
"+",
"util",
... | decode a URI payload bytes @returns a string | [
"decode",
"a",
"URI",
"payload",
"bytes"
] | 77ad9a17be20c89e0a45956870c4e9d732981dee | https://github.com/whitedogg13/react-native-nfc-manager/blob/77ad9a17be20c89e0a45956870c4e9d732981dee/ndef-lib/ndef-uri.js#L9-L15 |
11,094 | whitedogg13/react-native-nfc-manager | ndef-lib/ndef-uri.js | encode | function encode(uri) {
var prefix,
protocolCode,
encoded;
// check each protocol, unless we've found a match
// "urn:" is the one exception where we need to keep checking
// slice so we don't check ""
protocols.slice(1).forEach(function(protocol) {
... | javascript | function encode(uri) {
var prefix,
protocolCode,
encoded;
// check each protocol, unless we've found a match
// "urn:" is the one exception where we need to keep checking
// slice so we don't check ""
protocols.slice(1).forEach(function(protocol) {
... | [
"function",
"encode",
"(",
"uri",
")",
"{",
"var",
"prefix",
",",
"protocolCode",
",",
"encoded",
";",
"// check each protocol, unless we've found a match",
"// \"urn:\" is the one exception where we need to keep checking",
"// slice so we don't check \"\"",
"protocols",
".",
"sl... | shorten a URI with standard prefix @returns an array of bytes | [
"shorten",
"a",
"URI",
"with",
"standard",
"prefix"
] | 77ad9a17be20c89e0a45956870c4e9d732981dee | https://github.com/whitedogg13/react-native-nfc-manager/blob/77ad9a17be20c89e0a45956870c4e9d732981dee/ndef-lib/ndef-uri.js#L19-L44 |
11,095 | whitedogg13/react-native-nfc-manager | ndef-lib/ndef-util.js | bytesToHexString | function bytesToHexString(bytes) {
var dec, hexstring, bytesAsHexString = "";
for (var i = 0; i < bytes.length; i++) {
if (bytes[i] >= 0) {
dec = bytes[i];
} else {
dec = 256 + bytes[i];
}
hexstring = dec.toString(16);
// zero padding
if (hexstring... | javascript | function bytesToHexString(bytes) {
var dec, hexstring, bytesAsHexString = "";
for (var i = 0; i < bytes.length; i++) {
if (bytes[i] >= 0) {
dec = bytes[i];
} else {
dec = 256 + bytes[i];
}
hexstring = dec.toString(16);
// zero padding
if (hexstring... | [
"function",
"bytesToHexString",
"(",
"bytes",
")",
"{",
"var",
"dec",
",",
"hexstring",
",",
"bytesAsHexString",
"=",
"\"\"",
";",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"bytes",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"bytes"... | useful for readable version of Tag UID | [
"useful",
"for",
"readable",
"version",
"of",
"Tag",
"UID"
] | 77ad9a17be20c89e0a45956870c4e9d732981dee | https://github.com/whitedogg13/react-native-nfc-manager/blob/77ad9a17be20c89e0a45956870c4e9d732981dee/ndef-lib/ndef-util.js#L89-L105 |
11,096 | whitedogg13/react-native-nfc-manager | ndef-lib/ndef-util.js | toHex | function toHex(i) {
var hex;
if (i < 0) {
i += 256;
}
hex = i.toString(16);
// zero padding
if (hex.length == 1) {
hex = "0" + hex;
}
return hex;
} | javascript | function toHex(i) {
var hex;
if (i < 0) {
i += 256;
}
hex = i.toString(16);
// zero padding
if (hex.length == 1) {
hex = "0" + hex;
}
return hex;
} | [
"function",
"toHex",
"(",
"i",
")",
"{",
"var",
"hex",
";",
"if",
"(",
"i",
"<",
"0",
")",
"{",
"i",
"+=",
"256",
";",
"}",
"hex",
"=",
"i",
".",
"toString",
"(",
"16",
")",
";",
"// zero padding",
"if",
"(",
"hex",
".",
"length",
"==",
"1",
... | i must be <= 256 | [
"i",
"must",
"be",
"<",
"=",
"256"
] | 77ad9a17be20c89e0a45956870c4e9d732981dee | https://github.com/whitedogg13/react-native-nfc-manager/blob/77ad9a17be20c89e0a45956870c4e9d732981dee/ndef-lib/ndef-util.js#L108-L121 |
11,097 | auth0/auth0.js | src/authentication/index.js | Authentication | function Authentication(auth0, options) {
// If we have two arguments, the first one is a WebAuth instance, so we assign that
// if not, it's an options object and then we should use that as options instead
// this is here because we don't want to break people coming from v8
if (arguments.length === 2) {
th... | javascript | function Authentication(auth0, options) {
// If we have two arguments, the first one is a WebAuth instance, so we assign that
// if not, it's an options object and then we should use that as options instead
// this is here because we don't want to break people coming from v8
if (arguments.length === 2) {
th... | [
"function",
"Authentication",
"(",
"auth0",
",",
"options",
")",
"{",
"// If we have two arguments, the first one is a WebAuth instance, so we assign that",
"// if not, it's an options object and then we should use that as options instead",
"// this is here because we don't want to break people ... | Creates a new Auth0 Authentication API client
@constructor
@param {Object} options
@param {String} options.domain your Auth0 domain
@param {String} options.clientID the Client ID found on your Application settings page
@param {String} [options.redirectUri] url that the Auth0 will redirect after Auth with the Authorizat... | [
"Creates",
"a",
"new",
"Auth0",
"Authentication",
"API",
"client"
] | c9861c406946c22904250a69a0fddaa04c679850 | https://github.com/auth0/auth0.js/blob/c9861c406946c22904250a69a0fddaa04c679850/src/authentication/index.js#L29-L85 |
11,098 | fperucic/treant-js | vendor/perfect-scrollbar/perfect-scrollbar.js | function() {
var applyTouchMove = function(difference_x, difference_y) {
$this.scrollTop($this.scrollTop() - difference_y);
$this.scrollLeft($this.scrollLeft() - difference_x);
// update bar position
updateBarSizeAndPosition();
};
... | javascript | function() {
var applyTouchMove = function(difference_x, difference_y) {
$this.scrollTop($this.scrollTop() - difference_y);
$this.scrollLeft($this.scrollLeft() - difference_x);
// update bar position
updateBarSizeAndPosition();
};
... | [
"function",
"(",
")",
"{",
"var",
"applyTouchMove",
"=",
"function",
"(",
"difference_x",
",",
"difference_y",
")",
"{",
"$this",
".",
"scrollTop",
"(",
"$this",
".",
"scrollTop",
"(",
")",
"-",
"difference_y",
")",
";",
"$this",
".",
"scrollLeft",
"(",
... | bind mobile touch handler | [
"bind",
"mobile",
"touch",
"handler"
] | a5f95627baa265a891858678de47dff180848613 | https://github.com/fperucic/treant-js/blob/a5f95627baa265a891858678de47dff180848613/vendor/perfect-scrollbar/perfect-scrollbar.js#L220-L279 | |
11,099 | fperucic/treant-js | Treant.js | function( obj1, obj2 ) {
var newObj = {};
if ( obj1 ) {
this.inheritAttrs( newObj, this.cloneObj( obj1 ) );
}
if ( obj2 ) {
this.inheritAttrs( newObj, obj2 );
}
return newObj;
} | javascript | function( obj1, obj2 ) {
var newObj = {};
if ( obj1 ) {
this.inheritAttrs( newObj, this.cloneObj( obj1 ) );
}
if ( obj2 ) {
this.inheritAttrs( newObj, obj2 );
}
return newObj;
} | [
"function",
"(",
"obj1",
",",
"obj2",
")",
"{",
"var",
"newObj",
"=",
"{",
"}",
";",
"if",
"(",
"obj1",
")",
"{",
"this",
".",
"inheritAttrs",
"(",
"newObj",
",",
"this",
".",
"cloneObj",
"(",
"obj1",
")",
")",
";",
"}",
"if",
"(",
"obj2",
")",... | Returns a new object by merging the two supplied objects
@param {object} obj1
@param {object} obj2
@returns {object} | [
"Returns",
"a",
"new",
"object",
"by",
"merging",
"the",
"two",
"supplied",
"objects"
] | a5f95627baa265a891858678de47dff180848613 | https://github.com/fperucic/treant-js/blob/a5f95627baa265a891858678de47dff180848613/Treant.js#L58-L67 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.