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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
10,800 | openseadragon/openseadragon | src/openseadragon.js | function( element, className ) {
var oldClasses,
newClasses = [],
i;
element = $.getElement( element );
oldClasses = element.className.split( /\s+/ );
for ( i = 0; i < oldClasses.length; i++ ) {
if ( oldClasses[ i ] && oldC... | javascript | function( element, className ) {
var oldClasses,
newClasses = [],
i;
element = $.getElement( element );
oldClasses = element.className.split( /\s+/ );
for ( i = 0; i < oldClasses.length; i++ ) {
if ( oldClasses[ i ] && oldC... | [
"function",
"(",
"element",
",",
"className",
")",
"{",
"var",
"oldClasses",
",",
"newClasses",
"=",
"[",
"]",
",",
"i",
";",
"element",
"=",
"$",
".",
"getElement",
"(",
"element",
")",
";",
"oldClasses",
"=",
"element",
".",
"className",
".",
"split"... | Remove the specified CSS class from the element.
@function
@param {Element|String} element
@param {String} className | [
"Remove",
"the",
"specified",
"CSS",
"class",
"from",
"the",
"element",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/openseadragon.js#L1966-L1979 | |
10,801 | openseadragon/openseadragon | src/openseadragon.js | function( event ) {
event = $.getEvent( event );
if ( event.preventDefault ) {
$.cancelEvent = function( event ){
// W3C for preventing default
event.preventDefault();
};
} else {
$.cancelEvent =... | javascript | function( event ) {
event = $.getEvent( event );
if ( event.preventDefault ) {
$.cancelEvent = function( event ){
// W3C for preventing default
event.preventDefault();
};
} else {
$.cancelEvent =... | [
"function",
"(",
"event",
")",
"{",
"event",
"=",
"$",
".",
"getEvent",
"(",
"event",
")",
";",
"if",
"(",
"event",
".",
"preventDefault",
")",
"{",
"$",
".",
"cancelEvent",
"=",
"function",
"(",
"event",
")",
"{",
"// W3C for preventing default",
"event... | Cancels the default browser behavior had the event propagated all
the way up the DOM to the window object.
@function
@param {Event} [event] | [
"Cancels",
"the",
"default",
"browser",
"behavior",
"had",
"the",
"event",
"propagated",
"all",
"the",
"way",
"up",
"the",
"DOM",
"to",
"the",
"window",
"object",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/openseadragon.js#L2039-L2057 | |
10,802 | openseadragon/openseadragon | src/openseadragon.js | function( event ) {
event = $.getEvent( event );
if ( event.stopPropagation ) {
// W3C for stopping propagation
$.stopEvent = function( event ){
event.stopPropagation();
};
} else {
// IE for stoppin... | javascript | function( event ) {
event = $.getEvent( event );
if ( event.stopPropagation ) {
// W3C for stopping propagation
$.stopEvent = function( event ){
event.stopPropagation();
};
} else {
// IE for stoppin... | [
"function",
"(",
"event",
")",
"{",
"event",
"=",
"$",
".",
"getEvent",
"(",
"event",
")",
";",
"if",
"(",
"event",
".",
"stopPropagation",
")",
"{",
"// W3C for stopping propagation",
"$",
".",
"stopEvent",
"=",
"function",
"(",
"event",
")",
"{",
"even... | Stops the propagation of the event up the DOM.
@function
@param {Event} [event] | [
"Stops",
"the",
"propagation",
"of",
"the",
"event",
"up",
"the",
"DOM",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/openseadragon.js#L2065-L2083 | |
10,803 | openseadragon/openseadragon | src/openseadragon.js | function( object, method ) {
//TODO: This pattern is painful to use and debug. It's much cleaner
// to use pinning plus anonymous functions. Get rid of this
// pattern!
var initialArgs = [],
i;
for ( i = 2; i < arguments.length; i++... | javascript | function( object, method ) {
//TODO: This pattern is painful to use and debug. It's much cleaner
// to use pinning plus anonymous functions. Get rid of this
// pattern!
var initialArgs = [],
i;
for ( i = 2; i < arguments.length; i++... | [
"function",
"(",
"object",
",",
"method",
")",
"{",
"//TODO: This pattern is painful to use and debug. It's much cleaner",
"// to use pinning plus anonymous functions. Get rid of this",
"// pattern!",
"var",
"initialArgs",
"=",
"[",
"]",
",",
"i",
";",
"for",
"(",
... | Similar to OpenSeadragon.delegate, but it does not immediately call
the method on the object, returning a function which can be called
repeatedly to delegate the method. It also allows additional arguments
to be passed during construction which will be added during each
invocation, and each invocation can add additiona... | [
"Similar",
"to",
"OpenSeadragon",
".",
"delegate",
"but",
"it",
"does",
"not",
"immediately",
"call",
"the",
"method",
"on",
"the",
"object",
"returning",
"a",
"function",
"which",
"can",
"be",
"called",
"repeatedly",
"to",
"delegate",
"the",
"method",
".",
... | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/openseadragon.js#L2100-L2119 | |
10,804 | openseadragon/openseadragon | src/openseadragon.js | function( url ) {
var match = url.match(/^([a-z]+:)\/\//i);
if ( match === null ) {
// Relative URL, retrive the protocol from window.location
return window.location.protocol;
}
return match[1].toLowerCase();
} | javascript | function( url ) {
var match = url.match(/^([a-z]+:)\/\//i);
if ( match === null ) {
// Relative URL, retrive the protocol from window.location
return window.location.protocol;
}
return match[1].toLowerCase();
} | [
"function",
"(",
"url",
")",
"{",
"var",
"match",
"=",
"url",
".",
"match",
"(",
"/",
"^([a-z]+:)\\/\\/",
"/",
"i",
")",
";",
"if",
"(",
"match",
"===",
"null",
")",
"{",
"// Relative URL, retrive the protocol from window.location",
"return",
"window",
".",
... | Retrieves the protocol used by the url. The url can either be absolute
or relative.
@function
@private
@param {String} url The url to retrieve the protocol from.
@return {String} The protocol (http:, https:, file:, ftp: ...) | [
"Retrieves",
"the",
"protocol",
"used",
"by",
"the",
"url",
".",
"The",
"url",
"can",
"either",
"be",
"absolute",
"or",
"relative",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/openseadragon.js#L2142-L2149 | |
10,805 | openseadragon/openseadragon | src/openseadragon.js | function( local ) {
// IE11 does not support window.ActiveXObject so we just try to
// create one to see if it is supported.
// See: http://msdn.microsoft.com/en-us/library/ie/dn423948%28v=vs.85%29.aspx
var supportActiveX;
try {
/* global Activ... | javascript | function( local ) {
// IE11 does not support window.ActiveXObject so we just try to
// create one to see if it is supported.
// See: http://msdn.microsoft.com/en-us/library/ie/dn423948%28v=vs.85%29.aspx
var supportActiveX;
try {
/* global Activ... | [
"function",
"(",
"local",
")",
"{",
"// IE11 does not support window.ActiveXObject so we just try to",
"// create one to see if it is supported.",
"// See: http://msdn.microsoft.com/en-us/library/ie/dn423948%28v=vs.85%29.aspx",
"var",
"supportActiveX",
";",
"try",
"{",
"/* global ActiveXOb... | Create an XHR object
@private
@param {type} [local] If set to true, the XHR will be file: protocol
compatible if possible (but may raise a warning in the browser).
@returns {XMLHttpRequest} | [
"Create",
"an",
"XHR",
"object"
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/openseadragon.js#L2158-L2191 | |
10,806 | openseadragon/openseadragon | src/openseadragon.js | function( options ){
var script,
url = options.url,
head = document.head ||
document.getElementsByTagName( "head" )[ 0 ] ||
document.documentElement,
jsonpCallback = options.callbackName || 'openseadragon' + $.now... | javascript | function( options ){
var script,
url = options.url,
head = document.head ||
document.getElementsByTagName( "head" )[ 0 ] ||
document.documentElement,
jsonpCallback = options.callbackName || 'openseadragon' + $.now... | [
"function",
"(",
"options",
")",
"{",
"var",
"script",
",",
"url",
"=",
"options",
".",
"url",
",",
"head",
"=",
"document",
".",
"head",
"||",
"document",
".",
"getElementsByTagName",
"(",
"\"head\"",
")",
"[",
"0",
"]",
"||",
"document",
".",
"docume... | Taken from jQuery 1.6.1
@function
@param {Object} options
@param {String} options.url
@param {Function} options.callback
@param {String} [options.param='callback'] The name of the url parameter
to request the jsonp provider with.
@param {String} [options.callbackName=] The name of the callback to
request the jsonp prov... | [
"Taken",
"from",
"jQuery",
"1",
".",
"6",
".",
"1"
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/openseadragon.js#L2344-L2410 | |
10,807 | openseadragon/openseadragon | src/openseadragon.js | function( string ) {
if ( window.DOMParser ) {
$.parseXml = function( string ) {
var xmlDoc = null,
parser;
parser = new DOMParser();
xmlDoc = parser.parseFromString( string, "text/xml" );
... | javascript | function( string ) {
if ( window.DOMParser ) {
$.parseXml = function( string ) {
var xmlDoc = null,
parser;
parser = new DOMParser();
xmlDoc = parser.parseFromString( string, "text/xml" );
... | [
"function",
"(",
"string",
")",
"{",
"if",
"(",
"window",
".",
"DOMParser",
")",
"{",
"$",
".",
"parseXml",
"=",
"function",
"(",
"string",
")",
"{",
"var",
"xmlDoc",
"=",
"null",
",",
"parser",
";",
"parser",
"=",
"new",
"DOMParser",
"(",
")",
";"... | Parses an XML string into a DOM Document.
@function
@param {String} string
@returns {Document} | [
"Parses",
"an",
"XML",
"string",
"into",
"a",
"DOM",
"Document",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/openseadragon.js#L2428-L2456 | |
10,808 | openseadragon/openseadragon | src/openseadragon.js | function(string) {
if (window.JSON && window.JSON.parse) {
$.parseJSON = window.JSON.parse;
} else {
// Should only be used by IE8 in non standards mode
$.parseJSON = function(string) {
/*jshint evil:true*/
/... | javascript | function(string) {
if (window.JSON && window.JSON.parse) {
$.parseJSON = window.JSON.parse;
} else {
// Should only be used by IE8 in non standards mode
$.parseJSON = function(string) {
/*jshint evil:true*/
/... | [
"function",
"(",
"string",
")",
"{",
"if",
"(",
"window",
".",
"JSON",
"&&",
"window",
".",
"JSON",
".",
"parse",
")",
"{",
"$",
".",
"parseJSON",
"=",
"window",
".",
"JSON",
".",
"parse",
";",
"}",
"else",
"{",
"// Should only be used by IE8 in non stan... | Parses a JSON string into a Javascript object.
@function
@param {String} string
@returns {Object} | [
"Parses",
"a",
"JSON",
"string",
"into",
"a",
"Javascript",
"object",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/openseadragon.js#L2464-L2476 | |
10,809 | openseadragon/openseadragon | src/rectangle.js | function(other) {
return (other instanceof $.Rect) &&
this.x === other.x &&
this.y === other.y &&
this.width === other.width &&
this.height === other.height &&
this.degrees === other.degrees;
} | javascript | function(other) {
return (other instanceof $.Rect) &&
this.x === other.x &&
this.y === other.y &&
this.width === other.width &&
this.height === other.height &&
this.degrees === other.degrees;
} | [
"function",
"(",
"other",
")",
"{",
"return",
"(",
"other",
"instanceof",
"$",
".",
"Rect",
")",
"&&",
"this",
".",
"x",
"===",
"other",
".",
"x",
"&&",
"this",
".",
"y",
"===",
"other",
".",
"y",
"&&",
"this",
".",
"width",
"===",
"other",
".",
... | Determines if two Rectangles have equivalent components.
@function
@param {OpenSeadragon.Rect} rectangle The Rectangle to compare to.
@return {Boolean} 'true' if all components are equal, otherwise 'false'. | [
"Determines",
"if",
"two",
"Rectangles",
"have",
"equivalent",
"components",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/rectangle.js#L240-L247 | |
10,810 | openseadragon/openseadragon | src/rectangle.js | function(rect) {
var thisBoundingBox = this.getBoundingBox();
var otherBoundingBox = rect.getBoundingBox();
var left = Math.min(thisBoundingBox.x, otherBoundingBox.x);
var top = Math.min(thisBoundingBox.y, otherBoundingBox.y);
var right = Math.max(
thisBoundingBox.x ... | javascript | function(rect) {
var thisBoundingBox = this.getBoundingBox();
var otherBoundingBox = rect.getBoundingBox();
var left = Math.min(thisBoundingBox.x, otherBoundingBox.x);
var top = Math.min(thisBoundingBox.y, otherBoundingBox.y);
var right = Math.max(
thisBoundingBox.x ... | [
"function",
"(",
"rect",
")",
"{",
"var",
"thisBoundingBox",
"=",
"this",
".",
"getBoundingBox",
"(",
")",
";",
"var",
"otherBoundingBox",
"=",
"rect",
".",
"getBoundingBox",
"(",
")",
";",
"var",
"left",
"=",
"Math",
".",
"min",
"(",
"thisBoundingBox",
... | Returns the smallest rectangle that will contain this and the given
rectangle bounding boxes.
@param {OpenSeadragon.Rect} rect
@return {OpenSeadragon.Rect} The new rectangle. | [
"Returns",
"the",
"smallest",
"rectangle",
"that",
"will",
"contain",
"this",
"and",
"the",
"given",
"rectangle",
"bounding",
"boxes",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/rectangle.js#L287-L305 | |
10,811 | openseadragon/openseadragon | src/rectangle.js | function(degrees, pivot) {
degrees = $.positiveModulo(degrees, 360);
if (degrees === 0) {
return this.clone();
}
pivot = pivot || this.getCenter();
var newTopLeft = this.getTopLeft().rotate(degrees, pivot);
var newTopRight = this.getTopRight().rotate(degrees,... | javascript | function(degrees, pivot) {
degrees = $.positiveModulo(degrees, 360);
if (degrees === 0) {
return this.clone();
}
pivot = pivot || this.getCenter();
var newTopLeft = this.getTopLeft().rotate(degrees, pivot);
var newTopRight = this.getTopRight().rotate(degrees,... | [
"function",
"(",
"degrees",
",",
"pivot",
")",
"{",
"degrees",
"=",
"$",
".",
"positiveModulo",
"(",
"degrees",
",",
"360",
")",
";",
"if",
"(",
"degrees",
"===",
"0",
")",
"{",
"return",
"this",
".",
"clone",
"(",
")",
";",
"}",
"pivot",
"=",
"p... | Rotates a rectangle around a point.
@function
@param {Number} degrees The angle in degrees to rotate.
@param {OpenSeadragon.Point} [pivot] The point about which to rotate.
Defaults to the center of the rectangle.
@return {OpenSeadragon.Rect} | [
"Rotates",
"a",
"rectangle",
"around",
"a",
"point",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/rectangle.js#L441-L469 | |
10,812 | openseadragon/openseadragon | src/rectangle.js | function() {
return "[" +
(Math.round(this.x * 100) / 100) + ", " +
(Math.round(this.y * 100) / 100) + ", " +
(Math.round(this.width * 100) / 100) + "x" +
(Math.round(this.height * 100) / 100) + ", " +
(Math.round(this.degrees * 100) / 100) + "deg" +
... | javascript | function() {
return "[" +
(Math.round(this.x * 100) / 100) + ", " +
(Math.round(this.y * 100) / 100) + ", " +
(Math.round(this.width * 100) / 100) + "x" +
(Math.round(this.height * 100) / 100) + ", " +
(Math.round(this.degrees * 100) / 100) + "deg" +
... | [
"function",
"(",
")",
"{",
"return",
"\"[\"",
"+",
"(",
"Math",
".",
"round",
"(",
"this",
".",
"x",
"*",
"100",
")",
"/",
"100",
")",
"+",
"\", \"",
"+",
"(",
"Math",
".",
"round",
"(",
"this",
".",
"y",
"*",
"100",
")",
"/",
"100",
")",
"... | Provides a string representation of the rectangle which is useful for
debugging.
@function
@returns {String} A string representation of the rectangle. | [
"Provides",
"a",
"string",
"representation",
"of",
"the",
"rectangle",
"which",
"is",
"useful",
"for",
"debugging",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/rectangle.js#L546-L554 | |
10,813 | openseadragon/openseadragon | src/legacytilesource.js | filterFiles | function filterFiles( files ){
var filtered = [],
file,
i;
for( i = 0; i < files.length; i++ ){
file = files[ i ];
if( file.height &&
file.width &&
file.url ){
//This is sufficient to serve as a level
filtered.push({
... | javascript | function filterFiles( files ){
var filtered = [],
file,
i;
for( i = 0; i < files.length; i++ ){
file = files[ i ];
if( file.height &&
file.width &&
file.url ){
//This is sufficient to serve as a level
filtered.push({
... | [
"function",
"filterFiles",
"(",
"files",
")",
"{",
"var",
"filtered",
"=",
"[",
"]",
",",
"file",
",",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"files",
".",
"length",
";",
"i",
"++",
")",
"{",
"file",
"=",
"files",
"[",
"i",
"]",
... | This method removes any files from the Array which don't conform to our
basic requirements for a 'level' in the LegacyTileSource.
@private
@inner
@function | [
"This",
"method",
"removes",
"any",
"files",
"from",
"the",
"Array",
"which",
"don",
"t",
"conform",
"to",
"our",
"basic",
"requirements",
"for",
"a",
"level",
"in",
"the",
"LegacyTileSource",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/legacytilesource.js#L199-L224 |
10,814 | openseadragon/openseadragon | src/viewer.js | function( ) {
if ( !THIS[ this.hash ] ) {
//this viewer has already been destroyed: returning immediately
return;
}
this.close();
this.clearOverlays();
this.overlaysContainer.innerHTML = "";
//TODO: implement this...
//this.unbindSequenc... | javascript | function( ) {
if ( !THIS[ this.hash ] ) {
//this viewer has already been destroyed: returning immediately
return;
}
this.close();
this.clearOverlays();
this.overlaysContainer.innerHTML = "";
//TODO: implement this...
//this.unbindSequenc... | [
"function",
"(",
")",
"{",
"if",
"(",
"!",
"THIS",
"[",
"this",
".",
"hash",
"]",
")",
"{",
"//this viewer has already been destroyed: returning immediately",
"return",
";",
"}",
"this",
".",
"close",
"(",
")",
";",
"this",
".",
"clearOverlays",
"(",
")",
... | Function to destroy the viewer and clean up everything created by OpenSeadragon.
Example:
var viewer = OpenSeadragon({
[...]
});
//when you are done with the viewer:
viewer.destroy();
viewer = null; //important
@function | [
"Function",
"to",
"destroy",
"the",
"viewer",
"and",
"clean",
"up",
"everything",
"created",
"by",
"OpenSeadragon",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewer.js#L739-L796 | |
10,815 | openseadragon/openseadragon | src/viewer.js | function(debugMode){
for (var i = 0; i < this.world.getItemCount(); i++) {
this.world.getItemAt(i).debugMode = debugMode;
}
this.debugMode = debugMode;
this.forceRedraw();
} | javascript | function(debugMode){
for (var i = 0; i < this.world.getItemCount(); i++) {
this.world.getItemAt(i).debugMode = debugMode;
}
this.debugMode = debugMode;
this.forceRedraw();
} | [
"function",
"(",
"debugMode",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"world",
".",
"getItemCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"this",
".",
"world",
".",
"getItemAt",
"(",
"i",
")",
".",
"debugMode",
"="... | Turns debugging mode on or off for this viewer.
@function
@param {Boolean} true to turn debug on, false to turn debug off. | [
"Turns",
"debugging",
"mode",
"on",
"or",
"off",
"for",
"this",
"viewer",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewer.js#L878-L886 | |
10,816 | openseadragon/openseadragon | src/viewer.js | function( fullScreen ) {
var _this = this;
if ( !$.supportsFullScreen ) {
return this.setFullPage( fullScreen );
}
if ( $.isFullScreen() === fullScreen ) {
return this;
}
var fullScreeEventArgs = {
fullScreen: fullScreen,
... | javascript | function( fullScreen ) {
var _this = this;
if ( !$.supportsFullScreen ) {
return this.setFullPage( fullScreen );
}
if ( $.isFullScreen() === fullScreen ) {
return this;
}
var fullScreeEventArgs = {
fullScreen: fullScreen,
... | [
"function",
"(",
"fullScreen",
")",
"{",
"var",
"_this",
"=",
"this",
";",
"if",
"(",
"!",
"$",
".",
"supportsFullScreen",
")",
"{",
"return",
"this",
".",
"setFullPage",
"(",
"fullScreen",
")",
";",
"}",
"if",
"(",
"$",
".",
"isFullScreen",
"(",
")"... | Toggle full screen mode if supported. Toggle full page mode otherwise.
@function
@param {Boolean} fullScreen
If true, enter full screen mode. If false, exit full screen mode.
@return {OpenSeadragon.Viewer} Chainable.
@fires OpenSeadragon.Viewer.event:pre-full-screen
@fires OpenSeadragon.Viewer.event:full-screen | [
"Toggle",
"full",
"screen",
"mode",
"if",
"supported",
".",
"Toggle",
"full",
"page",
"mode",
"otherwise",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewer.js#L1116-L1203 | |
10,817 | openseadragon/openseadragon | src/viewer.js | function( element, location, placement, onDraw ) {
var options;
if( $.isPlainObject( element ) ){
options = element;
} else {
options = {
element: element,
location: location,
placement: placement,
onDraw: on... | javascript | function( element, location, placement, onDraw ) {
var options;
if( $.isPlainObject( element ) ){
options = element;
} else {
options = {
element: element,
location: location,
placement: placement,
onDraw: on... | [
"function",
"(",
"element",
",",
"location",
",",
"placement",
",",
"onDraw",
")",
"{",
"var",
"options",
";",
"if",
"(",
"$",
".",
"isPlainObject",
"(",
"element",
")",
")",
"{",
"options",
"=",
"element",
";",
"}",
"else",
"{",
"options",
"=",
"{",... | Adds an html element as an overlay to the current viewport. Useful for
highlighting words or areas of interest on an image or other zoomable
interface. The overlays added via this method are removed when the viewport
is closed which include when changing page.
@method
@param {Element|String|Object} element - A referen... | [
"Adds",
"an",
"html",
"element",
"as",
"an",
"overlay",
"to",
"the",
"current",
"viewport",
".",
"Useful",
"for",
"highlighting",
"words",
"or",
"areas",
"of",
"interest",
"on",
"an",
"image",
"or",
"other",
"zoomable",
"interface",
".",
"The",
"overlays",
... | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewer.js#L1923-L1965 | |
10,818 | openseadragon/openseadragon | src/viewer.js | function( element, location, placement ) {
var i;
element = $.getElement( element );
i = getOverlayIndex( this.currentOverlays, element );
if ( i >= 0 ) {
this.currentOverlays[ i ].update( location, placement );
THIS[ this.hash ].forceRedraw = true;
... | javascript | function( element, location, placement ) {
var i;
element = $.getElement( element );
i = getOverlayIndex( this.currentOverlays, element );
if ( i >= 0 ) {
this.currentOverlays[ i ].update( location, placement );
THIS[ this.hash ].forceRedraw = true;
... | [
"function",
"(",
"element",
",",
"location",
",",
"placement",
")",
"{",
"var",
"i",
";",
"element",
"=",
"$",
".",
"getElement",
"(",
"element",
")",
";",
"i",
"=",
"getOverlayIndex",
"(",
"this",
".",
"currentOverlays",
",",
"element",
")",
";",
"if"... | Updates the overlay represented by the reference to the element or
element id moving it to the new location, relative to the new placement.
@method
@param {Element|String} element - A reference to an element or an id for
the element which is overlaid.
@param {OpenSeadragon.Point|OpenSeadragon.Rect} location - The point... | [
"Updates",
"the",
"overlay",
"represented",
"by",
"the",
"reference",
"to",
"the",
"element",
"or",
"element",
"id",
"moving",
"it",
"to",
"the",
"new",
"location",
"relative",
"to",
"the",
"new",
"placement",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewer.js#L1981-L2011 | |
10,819 | openseadragon/openseadragon | src/viewer.js | function( element ) {
var i;
element = $.getElement( element );
i = getOverlayIndex( this.currentOverlays, element );
if ( i >= 0 ) {
this.currentOverlays[ i ].destroy();
this.currentOverlays.splice( i, 1 );
THIS[ this.hash ].forceRedraw = true;
... | javascript | function( element ) {
var i;
element = $.getElement( element );
i = getOverlayIndex( this.currentOverlays, element );
if ( i >= 0 ) {
this.currentOverlays[ i ].destroy();
this.currentOverlays.splice( i, 1 );
THIS[ this.hash ].forceRedraw = true;
... | [
"function",
"(",
"element",
")",
"{",
"var",
"i",
";",
"element",
"=",
"$",
".",
"getElement",
"(",
"element",
")",
";",
"i",
"=",
"getOverlayIndex",
"(",
"this",
".",
"currentOverlays",
",",
"element",
")",
";",
"if",
"(",
"i",
">=",
"0",
")",
"{"... | Removes an overlay identified by the reference element or element id
and schedules an update.
@method
@param {Element|String} element - A reference to the element or an
element id which represent the ovelay content to be removed.
@return {OpenSeadragon.Viewer} Chainable.
@fires OpenSeadragon.Viewer.event:remove-overlay | [
"Removes",
"an",
"overlay",
"identified",
"by",
"the",
"reference",
"element",
"or",
"element",
"id",
"and",
"schedules",
"an",
"update",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewer.js#L2022-L2049 | |
10,820 | openseadragon/openseadragon | src/viewer.js | function() {
while ( this.currentOverlays.length > 0 ) {
this.currentOverlays.pop().destroy();
}
THIS[ this.hash ].forceRedraw = true;
/**
* Raised when all overlays are removed from the viewer (see {@link OpenSeadragon.Drawer#clearOverlays}).
*
* @... | javascript | function() {
while ( this.currentOverlays.length > 0 ) {
this.currentOverlays.pop().destroy();
}
THIS[ this.hash ].forceRedraw = true;
/**
* Raised when all overlays are removed from the viewer (see {@link OpenSeadragon.Drawer#clearOverlays}).
*
* @... | [
"function",
"(",
")",
"{",
"while",
"(",
"this",
".",
"currentOverlays",
".",
"length",
">",
"0",
")",
"{",
"this",
".",
"currentOverlays",
".",
"pop",
"(",
")",
".",
"destroy",
"(",
")",
";",
"}",
"THIS",
"[",
"this",
".",
"hash",
"]",
".",
"for... | Removes all currently configured Overlays from this Viewer and schedules
an update.
@method
@return {OpenSeadragon.Viewer} Chainable.
@fires OpenSeadragon.Viewer.event:clear-overlay | [
"Removes",
"all",
"currently",
"configured",
"Overlays",
"from",
"this",
"Viewer",
"and",
"schedules",
"an",
"update",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewer.js#L2058-L2074 | |
10,821 | openseadragon/openseadragon | src/viewer.js | function( element ) {
var i;
element = $.getElement( element );
i = getOverlayIndex( this.currentOverlays, element );
if (i >= 0) {
return this.currentOverlays[i];
} else {
return null;
}
} | javascript | function( element ) {
var i;
element = $.getElement( element );
i = getOverlayIndex( this.currentOverlays, element );
if (i >= 0) {
return this.currentOverlays[i];
} else {
return null;
}
} | [
"function",
"(",
"element",
")",
"{",
"var",
"i",
";",
"element",
"=",
"$",
".",
"getElement",
"(",
"element",
")",
";",
"i",
"=",
"getOverlayIndex",
"(",
"this",
".",
"currentOverlays",
",",
"element",
")",
";",
"if",
"(",
"i",
">=",
"0",
")",
"{"... | Finds an overlay identified by the reference element or element id
and returns it as an object, return null if not found.
@method
@param {Element|String} element - A reference to the element or an
element id which represents the overlay content.
@return {OpenSeadragon.Overlay} the matching overlay or null if none found... | [
"Finds",
"an",
"overlay",
"identified",
"by",
"the",
"reference",
"element",
"or",
"element",
"id",
"and",
"returns",
"it",
"as",
"an",
"object",
"return",
"null",
"if",
"not",
"found",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewer.js#L2084-L2095 | |
10,822 | openseadragon/openseadragon | src/viewer.js | function( page ) {
if ( this.nextButton ) {
if(!this.tileSources || this.tileSources.length - 1 === page) {
//Disable next button
if ( !this.navPrevNextWrap ) {
this.nextButton.disable();
}
}... | javascript | function( page ) {
if ( this.nextButton ) {
if(!this.tileSources || this.tileSources.length - 1 === page) {
//Disable next button
if ( !this.navPrevNextWrap ) {
this.nextButton.disable();
}
}... | [
"function",
"(",
"page",
")",
"{",
"if",
"(",
"this",
".",
"nextButton",
")",
"{",
"if",
"(",
"!",
"this",
".",
"tileSources",
"||",
"this",
".",
"tileSources",
".",
"length",
"-",
"1",
"===",
"page",
")",
"{",
"//Disable next button",
"if",
"(",
"!"... | Updates the sequence buttons.
@function OpenSeadragon.Viewer.prototype._updateSequenceButtons
@private
@param {Number} Sequence Value | [
"Updates",
"the",
"sequence",
"buttons",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewer.js#L2103-L2125 | |
10,823 | openseadragon/openseadragon | src/viewer.js | function ( message ) {
this._hideMessage();
var div = $.makeNeutralElement( "div" );
div.appendChild( document.createTextNode( message ) );
this.messageDiv = $.makeCenteredNode( div );
$.addClass(this.messageDiv, "openseadragon-message");
this.container.appendChild( t... | javascript | function ( message ) {
this._hideMessage();
var div = $.makeNeutralElement( "div" );
div.appendChild( document.createTextNode( message ) );
this.messageDiv = $.makeCenteredNode( div );
$.addClass(this.messageDiv, "openseadragon-message");
this.container.appendChild( t... | [
"function",
"(",
"message",
")",
"{",
"this",
".",
"_hideMessage",
"(",
")",
";",
"var",
"div",
"=",
"$",
".",
"makeNeutralElement",
"(",
"\"div\"",
")",
";",
"div",
".",
"appendChild",
"(",
"document",
".",
"createTextNode",
"(",
"message",
")",
")",
... | Display a message in the viewport
@function OpenSeadragon.Viewer.prototype._showMessage
@private
@param {String} text message | [
"Display",
"a",
"message",
"in",
"the",
"viewport"
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewer.js#L2133-L2144 | |
10,824 | openseadragon/openseadragon | src/viewer.js | function() {
this.showReferenceStrip = true;
if (this.sequenceMode) {
if (this.referenceStrip) {
return;
}
if (this.tileSources.length && this.tileSources.length > 1) {
this.referenceStrip = new $.ReferenceStrip({
... | javascript | function() {
this.showReferenceStrip = true;
if (this.sequenceMode) {
if (this.referenceStrip) {
return;
}
if (this.tileSources.length && this.tileSources.length > 1) {
this.referenceStrip = new $.ReferenceStrip({
... | [
"function",
"(",
")",
"{",
"this",
".",
"showReferenceStrip",
"=",
"true",
";",
"if",
"(",
"this",
".",
"sequenceMode",
")",
"{",
"if",
"(",
"this",
".",
"referenceStrip",
")",
"{",
"return",
";",
"}",
"if",
"(",
"this",
".",
"tileSources",
".",
"len... | Enables and displays the reference strip based on the currently set tileSources.
Works only when the Viewer has sequenceMode set to true.
@function | [
"Enables",
"and",
"displays",
"the",
"reference",
"strip",
"based",
"on",
"the",
"currently",
"set",
"tileSources",
".",
"Works",
"only",
"when",
"the",
"Viewer",
"has",
"sequenceMode",
"set",
"to",
"true",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewer.js#L2212-L2238 | |
10,825 | openseadragon/openseadragon | src/viewer.js | beginControlsAutoHide | function beginControlsAutoHide( viewer ) {
if ( !viewer.autoHideControls ) {
return;
}
viewer.controlsShouldFade = true;
viewer.controlsFadeBeginTime =
$.now() +
viewer.controlsFadeDelay;
window.setTimeout( function(){
scheduleControlsFade( viewer );
}, viewer.co... | javascript | function beginControlsAutoHide( viewer ) {
if ( !viewer.autoHideControls ) {
return;
}
viewer.controlsShouldFade = true;
viewer.controlsFadeBeginTime =
$.now() +
viewer.controlsFadeDelay;
window.setTimeout( function(){
scheduleControlsFade( viewer );
}, viewer.co... | [
"function",
"beginControlsAutoHide",
"(",
"viewer",
")",
"{",
"if",
"(",
"!",
"viewer",
".",
"autoHideControls",
")",
"{",
"return",
";",
"}",
"viewer",
".",
"controlsShouldFade",
"=",
"true",
";",
"viewer",
".",
"controlsFadeBeginTime",
"=",
"$",
".",
"now"... | initiates an animation to hide the controls | [
"initiates",
"an",
"animation",
"to",
"hide",
"the",
"controls"
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewer.js#L2451-L2463 |
10,826 | openseadragon/openseadragon | src/viewer.js | updateControlsFade | function updateControlsFade( viewer ) {
var currentTime,
deltaTime,
opacity,
i;
if ( viewer.controlsShouldFade ) {
currentTime = $.now();
deltaTime = currentTime - viewer.controlsFadeBeginTime;
opacity = 1.0 - deltaTime / viewer.controlsFadeLength;
opacit... | javascript | function updateControlsFade( viewer ) {
var currentTime,
deltaTime,
opacity,
i;
if ( viewer.controlsShouldFade ) {
currentTime = $.now();
deltaTime = currentTime - viewer.controlsFadeBeginTime;
opacity = 1.0 - deltaTime / viewer.controlsFadeLength;
opacit... | [
"function",
"updateControlsFade",
"(",
"viewer",
")",
"{",
"var",
"currentTime",
",",
"deltaTime",
",",
"opacity",
",",
"i",
";",
"if",
"(",
"viewer",
".",
"controlsShouldFade",
")",
"{",
"currentTime",
"=",
"$",
".",
"now",
"(",
")",
";",
"deltaTime",
"... | determines if fade animation is done or continues the animation | [
"determines",
"if",
"fade",
"animation",
"is",
"done",
"or",
"continues",
"the",
"animation"
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewer.js#L2467-L2491 |
10,827 | openseadragon/openseadragon | src/viewer.js | abortControlsAutoHide | function abortControlsAutoHide( viewer ) {
var i;
viewer.controlsShouldFade = false;
for ( i = viewer.controls.length - 1; i >= 0; i-- ) {
viewer.controls[ i ].setOpacity( 1.0 );
}
} | javascript | function abortControlsAutoHide( viewer ) {
var i;
viewer.controlsShouldFade = false;
for ( i = viewer.controls.length - 1; i >= 0; i-- ) {
viewer.controls[ i ].setOpacity( 1.0 );
}
} | [
"function",
"abortControlsAutoHide",
"(",
"viewer",
")",
"{",
"var",
"i",
";",
"viewer",
".",
"controlsShouldFade",
"=",
"false",
";",
"for",
"(",
"i",
"=",
"viewer",
".",
"controls",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",... | stop the fade animation on the controls and show them | [
"stop",
"the",
"fade",
"animation",
"on",
"the",
"controls",
"and",
"show",
"them"
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewer.js#L2495-L2501 |
10,828 | openseadragon/openseadragon | src/mousetracker.js | function () {
var i;
stopTracking( this );
this.element = null;
for ( i = 0; i < MOUSETRACKERS.length; i++ ) {
if ( MOUSETRACKERS[ i ] === this ) {
MOUSETRACKERS.splice( i, 1 );
break;
}
... | javascript | function () {
var i;
stopTracking( this );
this.element = null;
for ( i = 0; i < MOUSETRACKERS.length; i++ ) {
if ( MOUSETRACKERS[ i ] === this ) {
MOUSETRACKERS.splice( i, 1 );
break;
}
... | [
"function",
"(",
")",
"{",
"var",
"i",
";",
"stopTracking",
"(",
"this",
")",
";",
"this",
".",
"element",
"=",
"null",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"MOUSETRACKERS",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"MOUSETR... | Clean up any events or objects created by the tracker.
@function | [
"Clean",
"up",
"any",
"events",
"or",
"objects",
"created",
"by",
"the",
"tracker",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/mousetracker.js#L277-L292 | |
10,829 | openseadragon/openseadragon | src/mousetracker.js | function () {
var delegate = THIS[ this.hash ],
i,
len = delegate.activePointersLists.length,
count = 0;
for ( i = 0; i < len; i++ ) {
count += delegate.activePointersLists[ i ].getLength();
}
return count;... | javascript | function () {
var delegate = THIS[ this.hash ],
i,
len = delegate.activePointersLists.length,
count = 0;
for ( i = 0; i < len; i++ ) {
count += delegate.activePointersLists[ i ].getLength();
}
return count;... | [
"function",
"(",
")",
"{",
"var",
"delegate",
"=",
"THIS",
"[",
"this",
".",
"hash",
"]",
",",
"i",
",",
"len",
"=",
"delegate",
".",
"activePointersLists",
".",
"length",
",",
"count",
"=",
"0",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"... | Returns the total number of pointers currently active on the tracked element.
@function
@returns {Number} | [
"Returns",
"the",
"total",
"number",
"of",
"pointers",
"currently",
"active",
"on",
"the",
"tracked",
"element",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/mousetracker.js#L368-L379 | |
10,830 | openseadragon/openseadragon | src/mousetracker.js | function ( tracker, gPoint ) {
return tracker.hash.toString() + gPoint.type + gPoint.id.toString();
} | javascript | function ( tracker, gPoint ) {
return tracker.hash.toString() + gPoint.type + gPoint.id.toString();
} | [
"function",
"(",
"tracker",
",",
"gPoint",
")",
"{",
"return",
"tracker",
".",
"hash",
".",
"toString",
"(",
")",
"+",
"gPoint",
".",
"type",
"+",
"gPoint",
".",
"id",
".",
"toString",
"(",
")",
";",
"}"
] | Generates a unique identifier for a tracked gesture point | [
"Generates",
"a",
"unique",
"identifier",
"for",
"a",
"tracked",
"gesture",
"point"
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/mousetracker.js#L915-L917 | |
10,831 | openseadragon/openseadragon | src/mousetracker.js | function () {
var i,
len = trackerPoints.length,
trackPoint,
gPoint,
now = $.now(),
elapsedTime,
distance,
speed;
elapsedTime = now - lastTime;
lastTime = now;
... | javascript | function () {
var i,
len = trackerPoints.length,
trackPoint,
gPoint,
now = $.now(),
elapsedTime,
distance,
speed;
elapsedTime = now - lastTime;
lastTime = now;
... | [
"function",
"(",
")",
"{",
"var",
"i",
",",
"len",
"=",
"trackerPoints",
".",
"length",
",",
"trackPoint",
",",
"gPoint",
",",
"now",
"=",
"$",
".",
"now",
"(",
")",
",",
"elapsedTime",
",",
"distance",
",",
"speed",
";",
"elapsedTime",
"=",
"now",
... | Interval timer callback. Computes velocity for all tracked gesture points. | [
"Interval",
"timer",
"callback",
".",
"Computes",
"velocity",
"for",
"all",
"tracked",
"gesture",
"points",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/mousetracker.js#L920-L946 | |
10,832 | openseadragon/openseadragon | src/mousetracker.js | function ( tracker, gPoint ) {
var guid = _generateGuid( tracker, gPoint );
trackerPoints.push(
{
guid: guid,
gPoint: gPoint,
lastPos: gPoint.currentPos
} );
// Only fire up the interval tim... | javascript | function ( tracker, gPoint ) {
var guid = _generateGuid( tracker, gPoint );
trackerPoints.push(
{
guid: guid,
gPoint: gPoint,
lastPos: gPoint.currentPos
} );
// Only fire up the interval tim... | [
"function",
"(",
"tracker",
",",
"gPoint",
")",
"{",
"var",
"guid",
"=",
"_generateGuid",
"(",
"tracker",
",",
"gPoint",
")",
";",
"trackerPoints",
".",
"push",
"(",
"{",
"guid",
":",
"guid",
",",
"gPoint",
":",
"gPoint",
",",
"lastPos",
":",
"gPoint",... | Public. Add a gesture point to be tracked | [
"Public",
".",
"Add",
"a",
"gesture",
"point",
"to",
"be",
"tracked"
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/mousetracker.js#L949-L964 | |
10,833 | openseadragon/openseadragon | src/mousetracker.js | function ( tracker, gPoint ) {
var guid = _generateGuid( tracker, gPoint ),
i,
len = trackerPoints.length;
for ( i = 0; i < len; i++ ) {
if ( trackerPoints[ i ].guid === guid ) {
trackerPoints.splice( i, 1 );
... | javascript | function ( tracker, gPoint ) {
var guid = _generateGuid( tracker, gPoint ),
i,
len = trackerPoints.length;
for ( i = 0; i < len; i++ ) {
if ( trackerPoints[ i ].guid === guid ) {
trackerPoints.splice( i, 1 );
... | [
"function",
"(",
"tracker",
",",
"gPoint",
")",
"{",
"var",
"guid",
"=",
"_generateGuid",
"(",
"tracker",
",",
"gPoint",
")",
",",
"i",
",",
"len",
"=",
"trackerPoints",
".",
"length",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"len",
";",
"i... | Public. Stop tracking a gesture point | [
"Public",
".",
"Stop",
"tracking",
"a",
"gesture",
"point"
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/mousetracker.js#L967-L982 | |
10,834 | openseadragon/openseadragon | src/mousetracker.js | startTracking | function startTracking( tracker ) {
var delegate = THIS[ tracker.hash ],
event,
i;
if ( !delegate.tracking ) {
for ( i = 0; i < $.MouseTracker.subscribeEvents.length; i++ ) {
event = $.MouseTracker.subscribeEvents[ i ];
$.addEvent(
... | javascript | function startTracking( tracker ) {
var delegate = THIS[ tracker.hash ],
event,
i;
if ( !delegate.tracking ) {
for ( i = 0; i < $.MouseTracker.subscribeEvents.length; i++ ) {
event = $.MouseTracker.subscribeEvents[ i ];
$.addEvent(
... | [
"function",
"startTracking",
"(",
"tracker",
")",
"{",
"var",
"delegate",
"=",
"THIS",
"[",
"tracker",
".",
"hash",
"]",
",",
"event",
",",
"i",
";",
"if",
"(",
"!",
"delegate",
".",
"tracking",
")",
"{",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",... | Starts tracking pointer events on the tracked element.
@private
@inner | [
"Starts",
"tracking",
"pointer",
"events",
"on",
"the",
"tracked",
"element",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/mousetracker.js#L1335-L1355 |
10,835 | openseadragon/openseadragon | src/mousetracker.js | stopTracking | function stopTracking( tracker ) {
var delegate = THIS[ tracker.hash ],
event,
i;
if ( delegate.tracking ) {
for ( i = 0; i < $.MouseTracker.subscribeEvents.length; i++ ) {
event = $.MouseTracker.subscribeEvents[ i ];
$.removeEvent(
... | javascript | function stopTracking( tracker ) {
var delegate = THIS[ tracker.hash ],
event,
i;
if ( delegate.tracking ) {
for ( i = 0; i < $.MouseTracker.subscribeEvents.length; i++ ) {
event = $.MouseTracker.subscribeEvents[ i ];
$.removeEvent(
... | [
"function",
"stopTracking",
"(",
"tracker",
")",
"{",
"var",
"delegate",
"=",
"THIS",
"[",
"tracker",
".",
"hash",
"]",
",",
"event",
",",
"i",
";",
"if",
"(",
"delegate",
".",
"tracking",
")",
"{",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"$",
... | Stops tracking pointer events on the tracked element.
@private
@inner | [
"Stops",
"tracking",
"pointer",
"events",
"on",
"the",
"tracked",
"element",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/mousetracker.js#L1362-L1382 |
10,836 | openseadragon/openseadragon | src/mousetracker.js | capturePointer | function capturePointer( tracker, pointerType, pointerCount ) {
var pointsList = tracker.getActivePointersListByType( pointerType ),
eventParams;
pointsList.captureCount += (pointerCount || 1);
if ( pointsList.captureCount === 1 ) {
if ( $.Browser.vendor === $.BROWSERS.... | javascript | function capturePointer( tracker, pointerType, pointerCount ) {
var pointsList = tracker.getActivePointersListByType( pointerType ),
eventParams;
pointsList.captureCount += (pointerCount || 1);
if ( pointsList.captureCount === 1 ) {
if ( $.Browser.vendor === $.BROWSERS.... | [
"function",
"capturePointer",
"(",
"tracker",
",",
"pointerType",
",",
"pointerCount",
")",
"{",
"var",
"pointsList",
"=",
"tracker",
".",
"getActivePointersListByType",
"(",
"pointerType",
")",
",",
"eventParams",
";",
"pointsList",
".",
"captureCount",
"+=",
"("... | Begin capturing pointer events to the tracked element.
@private
@inner | [
"Begin",
"capturing",
"pointer",
"events",
"to",
"the",
"tracked",
"element",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/mousetracker.js#L1422-L1458 |
10,837 | openseadragon/openseadragon | src/mousetracker.js | onMouseWheel | function onMouseWheel( tracker, event ) {
event = $.getEvent( event );
// Simulate a 'wheel' event
var simulatedEvent = {
target: event.target || event.srcElement,
type: "wheel",
shiftKey: event.shiftKey || false,
clientX: event.cli... | javascript | function onMouseWheel( tracker, event ) {
event = $.getEvent( event );
// Simulate a 'wheel' event
var simulatedEvent = {
target: event.target || event.srcElement,
type: "wheel",
shiftKey: event.shiftKey || false,
clientX: event.cli... | [
"function",
"onMouseWheel",
"(",
"tracker",
",",
"event",
")",
"{",
"event",
"=",
"$",
".",
"getEvent",
"(",
"event",
")",
";",
"// Simulate a 'wheel' event",
"var",
"simulatedEvent",
"=",
"{",
"target",
":",
"event",
".",
"target",
"||",
"event",
".",
"sr... | Handler for 'mousewheel', 'DOMMouseScroll', and 'MozMousePixelScroll' events
@private
@inner | [
"Handler",
"for",
"mousewheel",
"DOMMouseScroll",
"and",
"MozMousePixelScroll",
"events"
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/mousetracker.js#L1751-L1776 |
10,838 | openseadragon/openseadragon | src/tile.js | function( container ) {
if (!this.cacheImageRecord) {
$.console.warn(
'[Tile.drawHTML] attempting to draw tile %s when it\'s not cached',
this.toString());
return;
}
if ( !this.loaded ) {
$.console.warn(
"Attemp... | javascript | function( container ) {
if (!this.cacheImageRecord) {
$.console.warn(
'[Tile.drawHTML] attempting to draw tile %s when it\'s not cached',
this.toString());
return;
}
if ( !this.loaded ) {
$.console.warn(
"Attemp... | [
"function",
"(",
"container",
")",
"{",
"if",
"(",
"!",
"this",
".",
"cacheImageRecord",
")",
"{",
"$",
".",
"console",
".",
"warn",
"(",
"'[Tile.drawHTML] attempting to draw tile %s when it\\'s not cached'",
",",
"this",
".",
"toString",
"(",
")",
")",
";",
"... | Renders the tile in an html container.
@function
@param {Element} container | [
"Renders",
"the",
"tile",
"in",
"an",
"html",
"container",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/tile.js#L258-L300 | |
10,839 | openseadragon/openseadragon | src/tile.js | function( context, drawingHandler, scale, translate ) {
var position = this.position.times($.pixelDensityRatio),
size = this.size.times($.pixelDensityRatio),
rendered;
if (!this.context2D && !this.cacheImageRecord) {
$.console.warn(
'[Tile.drawCa... | javascript | function( context, drawingHandler, scale, translate ) {
var position = this.position.times($.pixelDensityRatio),
size = this.size.times($.pixelDensityRatio),
rendered;
if (!this.context2D && !this.cacheImageRecord) {
$.console.warn(
'[Tile.drawCa... | [
"function",
"(",
"context",
",",
"drawingHandler",
",",
"scale",
",",
"translate",
")",
"{",
"var",
"position",
"=",
"this",
".",
"position",
".",
"times",
"(",
"$",
".",
"pixelDensityRatio",
")",
",",
"size",
"=",
"this",
".",
"size",
".",
"times",
"(... | Renders the tile in a canvas-based context.
@function
@param {Canvas} context
@param {Function} drawingHandler - Method for firing the drawing event.
drawingHandler({context, tile, rendered})
where <code>rendered</code> is the context with the pre-drawn image.
@param {Number} [scale=1] - Apply a scale to position and s... | [
"Renders",
"the",
"tile",
"in",
"a",
"canvas",
"-",
"based",
"context",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/tile.js#L312-L392 | |
10,840 | openseadragon/openseadragon | src/tile.js | function() {
var context;
if (this.cacheImageRecord) {
context = this.cacheImageRecord.getRenderedContext();
} else if (this.context2D) {
context = this.context2D;
} else {
$.console.warn(
'[Tile.drawCanvas] attempting to get tile scale... | javascript | function() {
var context;
if (this.cacheImageRecord) {
context = this.cacheImageRecord.getRenderedContext();
} else if (this.context2D) {
context = this.context2D;
} else {
$.console.warn(
'[Tile.drawCanvas] attempting to get tile scale... | [
"function",
"(",
")",
"{",
"var",
"context",
";",
"if",
"(",
"this",
".",
"cacheImageRecord",
")",
"{",
"context",
"=",
"this",
".",
"cacheImageRecord",
".",
"getRenderedContext",
"(",
")",
";",
"}",
"else",
"if",
"(",
"this",
".",
"context2D",
")",
"{... | Get the ratio between current and original size.
@function
@return {Float} | [
"Get",
"the",
"ratio",
"between",
"current",
"and",
"original",
"size",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/tile.js#L399-L412 | |
10,841 | openseadragon/openseadragon | src/tile.js | function(scale, canvasSize, sketchCanvasSize) {
// The translation vector must have positive values, otherwise the image goes a bit off
// the sketch canvas to the top and left and we must use negative coordinates to repaint it
// to the main canvas. In that case, some browsers throw:
//... | javascript | function(scale, canvasSize, sketchCanvasSize) {
// The translation vector must have positive values, otherwise the image goes a bit off
// the sketch canvas to the top and left and we must use negative coordinates to repaint it
// to the main canvas. In that case, some browsers throw:
//... | [
"function",
"(",
"scale",
",",
"canvasSize",
",",
"sketchCanvasSize",
")",
"{",
"// The translation vector must have positive values, otherwise the image goes a bit off",
"// the sketch canvas to the top and left and we must use negative coordinates to repaint it",
"// to the main canvas. In t... | Get a translation vector that when applied to the tile position produces integer coordinates.
Needed to avoid swimming and twitching.
@function
@param {Number} [scale=1] - Scale to be applied to position.
@return {OpenSeadragon.Point} | [
"Get",
"a",
"translation",
"vector",
"that",
"when",
"applied",
"to",
"the",
"tile",
"position",
"produces",
"integer",
"coordinates",
".",
"Needed",
"to",
"avoid",
"swimming",
"and",
"twitching",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/tile.js#L421-L436 | |
10,842 | openseadragon/openseadragon | src/tile.js | function() {
if ( this.imgElement && this.imgElement.parentNode ) {
this.imgElement.parentNode.removeChild( this.imgElement );
}
if ( this.element && this.element.parentNode ) {
this.element.parentNode.removeChild( this.element );
}
this.element = null... | javascript | function() {
if ( this.imgElement && this.imgElement.parentNode ) {
this.imgElement.parentNode.removeChild( this.imgElement );
}
if ( this.element && this.element.parentNode ) {
this.element.parentNode.removeChild( this.element );
}
this.element = null... | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"imgElement",
"&&",
"this",
".",
"imgElement",
".",
"parentNode",
")",
"{",
"this",
".",
"imgElement",
".",
"parentNode",
".",
"removeChild",
"(",
"this",
".",
"imgElement",
")",
";",
"}",
"if",
"(",
... | Removes tile from its container.
@function | [
"Removes",
"tile",
"from",
"its",
"container",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/tile.js#L442-L454 | |
10,843 | openseadragon/openseadragon | src/world.js | function( item, options ) {
$.console.assert(item, "[World.addItem] item is required");
$.console.assert(item instanceof $.TiledImage, "[World.addItem] only TiledImages supported at this time");
options = options || {};
if (options.index !== undefined) {
var index = Math.max... | javascript | function( item, options ) {
$.console.assert(item, "[World.addItem] item is required");
$.console.assert(item instanceof $.TiledImage, "[World.addItem] only TiledImages supported at this time");
options = options || {};
if (options.index !== undefined) {
var index = Math.max... | [
"function",
"(",
"item",
",",
"options",
")",
"{",
"$",
".",
"console",
".",
"assert",
"(",
"item",
",",
"\"[World.addItem] item is required\"",
")",
";",
"$",
".",
"console",
".",
"assert",
"(",
"item",
"instanceof",
"$",
".",
"TiledImage",
",",
"\"[World... | Add the specified item.
@param {OpenSeadragon.TiledImage} item - The item to add.
@param {Number} [options.index] - Index for the item. If not specified, goes at the top.
@fires OpenSeadragon.World.event:add-item
@fires OpenSeadragon.World.event:metrics-change | [
"Add",
"the",
"specified",
"item",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/world.js#L76-L111 | |
10,844 | openseadragon/openseadragon | src/world.js | function( item, index ) {
$.console.assert(item, "[World.setItemIndex] item is required");
$.console.assert(index !== undefined, "[World.setItemIndex] index is required");
var oldIndex = this.getIndexOfItem( item );
if ( index >= this._items.length ) {
throw new Error( "Ind... | javascript | function( item, index ) {
$.console.assert(item, "[World.setItemIndex] item is required");
$.console.assert(index !== undefined, "[World.setItemIndex] index is required");
var oldIndex = this.getIndexOfItem( item );
if ( index >= this._items.length ) {
throw new Error( "Ind... | [
"function",
"(",
"item",
",",
"index",
")",
"{",
"$",
".",
"console",
".",
"assert",
"(",
"item",
",",
"\"[World.setItemIndex] item is required\"",
")",
";",
"$",
".",
"console",
".",
"assert",
"(",
"index",
"!==",
"undefined",
",",
"\"[World.setItemIndex] ind... | Change the index of a item so that it appears over or under others.
@param {OpenSeadragon.TiledImage} item - The item to move.
@param {Number} index - The new index.
@fires OpenSeadragon.World.event:item-index-change | [
"Change",
"the",
"index",
"of",
"a",
"item",
"so",
"that",
"it",
"appears",
"over",
"or",
"under",
"others",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/world.js#L146-L181 | |
10,845 | openseadragon/openseadragon | src/world.js | function() {
// We need to make sure any pending images are canceled so the world items don't get messed up
this.viewer._cancelPendingImages();
var item;
var i;
for (i = 0; i < this._items.length; i++) {
item = this._items[i];
item.removeHandler('bounds-ch... | javascript | function() {
// We need to make sure any pending images are canceled so the world items don't get messed up
this.viewer._cancelPendingImages();
var item;
var i;
for (i = 0; i < this._items.length; i++) {
item = this._items[i];
item.removeHandler('bounds-ch... | [
"function",
"(",
")",
"{",
"// We need to make sure any pending images are canceled so the world items don't get messed up",
"this",
".",
"viewer",
".",
"_cancelPendingImages",
"(",
")",
";",
"var",
"item",
";",
"var",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
... | Remove all items.
@fires OpenSeadragon.World.event:remove-item
@fires OpenSeadragon.World.event:metrics-change | [
"Remove",
"all",
"items",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/world.js#L211-L232 | |
10,846 | openseadragon/openseadragon | src/world.js | function() {
for ( var i = 0; i < this._items.length; i++ ) {
this._items[i].draw();
}
this._needsDraw = false;
} | javascript | function() {
for ( var i = 0; i < this._items.length; i++ ) {
this._items[i].draw();
}
this._needsDraw = false;
} | [
"function",
"(",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"_items",
".",
"length",
";",
"i",
"++",
")",
"{",
"this",
".",
"_items",
"[",
"i",
"]",
".",
"draw",
"(",
")",
";",
"}",
"this",
".",
"_needsDraw",
"=... | Draws all items. | [
"Draws",
"all",
"items",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/world.js#L258-L264 | |
10,847 | openseadragon/openseadragon | src/world.js | function(options) {
options = options || {};
var immediately = options.immediately || false;
var layout = options.layout || $.DEFAULT_SETTINGS.collectionLayout;
var rows = options.rows || $.DEFAULT_SETTINGS.collectionRows;
var columns = options.columns || $.DEFAULT_SETTINGS.colle... | javascript | function(options) {
options = options || {};
var immediately = options.immediately || false;
var layout = options.layout || $.DEFAULT_SETTINGS.collectionLayout;
var rows = options.rows || $.DEFAULT_SETTINGS.collectionRows;
var columns = options.columns || $.DEFAULT_SETTINGS.colle... | [
"function",
"(",
"options",
")",
"{",
"options",
"=",
"options",
"||",
"{",
"}",
";",
"var",
"immediately",
"=",
"options",
".",
"immediately",
"||",
"false",
";",
"var",
"layout",
"=",
"options",
".",
"layout",
"||",
"$",
".",
"DEFAULT_SETTINGS",
".",
... | Arranges all of the TiledImages with the specified settings.
@param {Object} options - Specifies how to arrange.
@param {Boolean} [options.immediately=false] - Whether to animate to the new arrangement.
@param {String} [options.layout] - See collectionLayout in {@link OpenSeadragon.Options}.
@param {Number} [options.ro... | [
"Arranges",
"all",
"of",
"the",
"TiledImages",
"with",
"the",
"specified",
"settings",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/world.js#L321-L374 | |
10,848 | openseadragon/openseadragon | src/overlay.js | function(position, size) {
var properties = $.Placement.properties[this.placement];
if (!properties) {
return;
}
if (properties.isHorizontallyCentered) {
position.x -= size.x / 2;
} else if (properties.isRight) {
... | javascript | function(position, size) {
var properties = $.Placement.properties[this.placement];
if (!properties) {
return;
}
if (properties.isHorizontallyCentered) {
position.x -= size.x / 2;
} else if (properties.isRight) {
... | [
"function",
"(",
"position",
",",
"size",
")",
"{",
"var",
"properties",
"=",
"$",
".",
"Placement",
".",
"properties",
"[",
"this",
".",
"placement",
"]",
";",
"if",
"(",
"!",
"properties",
")",
"{",
"return",
";",
"}",
"if",
"(",
"properties",
".",... | Internal function to adjust the position of an overlay
depending on it size and placement.
@function
@param {OpenSeadragon.Point} position
@param {OpenSeadragon.Point} size | [
"Internal",
"function",
"to",
"adjust",
"the",
"position",
"of",
"an",
"overlay",
"depending",
"on",
"it",
"size",
"and",
"placement",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/overlay.js#L178-L193 | |
10,849 | openseadragon/openseadragon | src/overlay.js | function(location, placement) {
var options = $.isPlainObject(location) ? location : {
location: location,
placement: placement
};
this._init({
location: options.location || this.location,
placement: options.placement !=... | javascript | function(location, placement) {
var options = $.isPlainObject(location) ? location : {
location: location,
placement: placement
};
this._init({
location: options.location || this.location,
placement: options.placement !=... | [
"function",
"(",
"location",
",",
"placement",
")",
"{",
"var",
"options",
"=",
"$",
".",
"isPlainObject",
"(",
"location",
")",
"?",
"location",
":",
"{",
"location",
":",
"location",
",",
"placement",
":",
"placement",
"}",
";",
"this",
".",
"_init",
... | Changes the overlay settings.
@function
@param {OpenSeadragon.Point|OpenSeadragon.Rect|Object} location
If an object is specified, the options are the same than the constructor
except for the element which can not be changed.
@param {OpenSeadragon.Placement} placement | [
"Changes",
"the",
"overlay",
"settings",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/overlay.js#L407-L422 | |
10,850 | openseadragon/openseadragon | src/overlay.js | function(viewport) {
$.console.assert(viewport,
'A viewport must now be passed to Overlay.getBounds.');
var width = this.width;
var height = this.height;
if (width === null || height === null) {
var size = viewport.deltaPointsFromPixelsNoRo... | javascript | function(viewport) {
$.console.assert(viewport,
'A viewport must now be passed to Overlay.getBounds.');
var width = this.width;
var height = this.height;
if (width === null || height === null) {
var size = viewport.deltaPointsFromPixelsNoRo... | [
"function",
"(",
"viewport",
")",
"{",
"$",
".",
"console",
".",
"assert",
"(",
"viewport",
",",
"'A viewport must now be passed to Overlay.getBounds.'",
")",
";",
"var",
"width",
"=",
"this",
".",
"width",
";",
"var",
"height",
"=",
"this",
".",
"height",
"... | Returns the current bounds of the overlay in viewport coordinates
@function
@param {OpenSeadragon.Viewport} viewport the viewport
@returns {OpenSeadragon.Rect} overlay bounds | [
"Returns",
"the",
"current",
"bounds",
"of",
"the",
"overlay",
"in",
"viewport",
"coordinates"
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/overlay.js#L430-L448 | |
10,851 | openseadragon/openseadragon | src/referencestrip.js | function() {
if (this.miniViewers) {
for (var key in this.miniViewers) {
this.miniViewers[key].destroy();
}
}
if (this.element) {
this.element.parentNode.removeChild(this.element);
}
} | javascript | function() {
if (this.miniViewers) {
for (var key in this.miniViewers) {
this.miniViewers[key].destroy();
}
}
if (this.element) {
this.element.parentNode.removeChild(this.element);
}
} | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"miniViewers",
")",
"{",
"for",
"(",
"var",
"key",
"in",
"this",
".",
"miniViewers",
")",
"{",
"this",
".",
"miniViewers",
"[",
"key",
"]",
".",
"destroy",
"(",
")",
";",
"}",
"}",
"if",
"(",
"... | Overrides Viewer.destroy | [
"Overrides",
"Viewer",
".",
"destroy"
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/referencestrip.js#L296-L306 | |
10,852 | openseadragon/openseadragon | src/viewport.js | function(contentSize) {
$.console.assert(contentSize, "[Viewport.resetContentSize] contentSize is required");
$.console.assert(contentSize instanceof $.Point, "[Viewport.resetContentSize] contentSize must be an OpenSeadragon.Point");
$.console.assert(contentSize.x > 0, "[Viewport.resetContentSiz... | javascript | function(contentSize) {
$.console.assert(contentSize, "[Viewport.resetContentSize] contentSize is required");
$.console.assert(contentSize instanceof $.Point, "[Viewport.resetContentSize] contentSize must be an OpenSeadragon.Point");
$.console.assert(contentSize.x > 0, "[Viewport.resetContentSiz... | [
"function",
"(",
"contentSize",
")",
"{",
"$",
".",
"console",
".",
"assert",
"(",
"contentSize",
",",
"\"[Viewport.resetContentSize] contentSize is required\"",
")",
";",
"$",
".",
"console",
".",
"assert",
"(",
"contentSize",
"instanceof",
"$",
".",
"Point",
"... | Updates the viewport's home bounds and constraints for the given content size.
@function
@param {OpenSeadragon.Point} contentSize - size of the content in content units
@return {OpenSeadragon.Viewport} Chainable.
@fires OpenSeadragon.Viewer.event:reset-size | [
"Updates",
"the",
"viewport",
"s",
"home",
"bounds",
"and",
"constraints",
"for",
"the",
"given",
"content",
"size",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewport.js#L153-L161 | |
10,853 | openseadragon/openseadragon | src/viewport.js | function(bounds, contentFactor) {
$.console.assert(bounds, "[Viewport._setContentBounds] bounds is required");
$.console.assert(bounds instanceof $.Rect, "[Viewport._setContentBounds] bounds must be an OpenSeadragon.Rect");
$.console.assert(bounds.width > 0, "[Viewport._setContentBounds] bounds.... | javascript | function(bounds, contentFactor) {
$.console.assert(bounds, "[Viewport._setContentBounds] bounds is required");
$.console.assert(bounds instanceof $.Rect, "[Viewport._setContentBounds] bounds must be an OpenSeadragon.Rect");
$.console.assert(bounds.width > 0, "[Viewport._setContentBounds] bounds.... | [
"function",
"(",
"bounds",
",",
"contentFactor",
")",
"{",
"$",
".",
"console",
".",
"assert",
"(",
"bounds",
",",
"\"[Viewport._setContentBounds] bounds is required\"",
")",
";",
"$",
".",
"console",
".",
"assert",
"(",
"bounds",
"instanceof",
"$",
".",
"Rect... | Set the viewport's content bounds @param {OpenSeadragon.Rect} bounds - the new bounds in viewport coordinates without rotation @param {Number} contentFactor - how many content units per viewport unit @fires OpenSeadragon.Viewer.event:reset-size @private | [
"Set",
"the",
"viewport",
"s",
"content",
"bounds"
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewport.js#L175-L212 | |
10,854 | openseadragon/openseadragon | src/viewport.js | function() {
if (this.defaultZoomLevel) {
return this.defaultZoomLevel;
}
var aspectFactor = this._contentAspectRatio / this.getAspectRatio();
var output;
if (this.homeFillsViewer) { // fill the viewer and clip the image
output = aspectFactor >= 1 ? aspec... | javascript | function() {
if (this.defaultZoomLevel) {
return this.defaultZoomLevel;
}
var aspectFactor = this._contentAspectRatio / this.getAspectRatio();
var output;
if (this.homeFillsViewer) { // fill the viewer and clip the image
output = aspectFactor >= 1 ? aspec... | [
"function",
"(",
")",
"{",
"if",
"(",
"this",
".",
"defaultZoomLevel",
")",
"{",
"return",
"this",
".",
"defaultZoomLevel",
";",
"}",
"var",
"aspectFactor",
"=",
"this",
".",
"_contentAspectRatio",
"/",
"this",
".",
"getAspectRatio",
"(",
")",
";",
"var",
... | Returns the home zoom in "viewport zoom" value.
@function
@returns {Number} The home zoom in "viewport zoom". | [
"Returns",
"the",
"home",
"zoom",
"in",
"viewport",
"zoom",
"value",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewport.js#L219-L233 | |
10,855 | openseadragon/openseadragon | src/viewport.js | function(margins) {
$.console.assert($.type(margins) === 'object', '[Viewport.setMargins] margins must be an object');
this._margins = $.extend({
left: 0,
top: 0,
right: 0,
bottom: 0
}, margins);
this._updateContainerInnerSize();
... | javascript | function(margins) {
$.console.assert($.type(margins) === 'object', '[Viewport.setMargins] margins must be an object');
this._margins = $.extend({
left: 0,
top: 0,
right: 0,
bottom: 0
}, margins);
this._updateContainerInnerSize();
... | [
"function",
"(",
"margins",
")",
"{",
"$",
".",
"console",
".",
"assert",
"(",
"$",
".",
"type",
"(",
"margins",
")",
"===",
"'object'",
",",
"'[Viewport.setMargins] margins must be an object'",
")",
";",
"this",
".",
"_margins",
"=",
"$",
".",
"extend",
"... | The margins push the "home" region in from the sides by the specified amounts.
@function
@param {Object} margins - Properties (Numbers, in screen coordinates): left, top, right, bottom. | [
"The",
"margins",
"push",
"the",
"home",
"region",
"in",
"from",
"the",
"sides",
"by",
"the",
"specified",
"amounts",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewport.js#L345-L359 | |
10,856 | openseadragon/openseadragon | src/viewport.js | function(immediately) {
var actualZoom = this.getZoom();
var constrainedZoom = this._applyZoomConstraints(actualZoom);
if (actualZoom !== constrainedZoom) {
this.zoomTo(constrainedZoom, this.zoomPoint, immediately);
}
var bounds = this.getBoundsNoRotate();
v... | javascript | function(immediately) {
var actualZoom = this.getZoom();
var constrainedZoom = this._applyZoomConstraints(actualZoom);
if (actualZoom !== constrainedZoom) {
this.zoomTo(constrainedZoom, this.zoomPoint, immediately);
}
var bounds = this.getBoundsNoRotate();
v... | [
"function",
"(",
"immediately",
")",
"{",
"var",
"actualZoom",
"=",
"this",
".",
"getZoom",
"(",
")",
";",
"var",
"constrainedZoom",
"=",
"this",
".",
"_applyZoomConstraints",
"(",
"actualZoom",
")",
";",
"if",
"(",
"actualZoom",
"!==",
"constrainedZoom",
")... | Enforces the minZoom, maxZoom and visibilityRatio constraints by
zooming and panning to the closest acceptable zoom and location.
@function
@param {Boolean} [immediately=false]
@return {OpenSeadragon.Viewport} Chainable.
@fires OpenSeadragon.Viewer.event:constrain | [
"Enforces",
"the",
"minZoom",
"maxZoom",
"and",
"visibilityRatio",
"constraints",
"by",
"zooming",
"and",
"panning",
"to",
"the",
"closest",
"acceptable",
"zoom",
"and",
"location",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewport.js#L570-L590 | |
10,857 | openseadragon/openseadragon | src/viewport.js | function(immediately) {
var box = new $.Rect(
this._contentBounds.x,
this._contentBounds.y + (this._contentBounds.height / 2),
this._contentBounds.width,
0);
return this.fitBounds(box, immediately);
} | javascript | function(immediately) {
var box = new $.Rect(
this._contentBounds.x,
this._contentBounds.y + (this._contentBounds.height / 2),
this._contentBounds.width,
0);
return this.fitBounds(box, immediately);
} | [
"function",
"(",
"immediately",
")",
"{",
"var",
"box",
"=",
"new",
"$",
".",
"Rect",
"(",
"this",
".",
"_contentBounds",
".",
"x",
",",
"this",
".",
"_contentBounds",
".",
"y",
"+",
"(",
"this",
".",
"_contentBounds",
".",
"height",
"/",
"2",
")",
... | Zooms so the image just fills the viewer horizontally.
@param {Boolean} immediately
@return {OpenSeadragon.Viewport} Chainable. | [
"Zooms",
"so",
"the",
"image",
"just",
"fills",
"the",
"viewer",
"horizontally",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewport.js#L736-L743 | |
10,858 | openseadragon/openseadragon | src/viewport.js | function(current) {
var bounds,
constrainedBounds;
bounds = this.getBounds(current);
constrainedBounds = this._applyBoundaryConstraints(bounds);
return constrainedBounds;
} | javascript | function(current) {
var bounds,
constrainedBounds;
bounds = this.getBounds(current);
constrainedBounds = this._applyBoundaryConstraints(bounds);
return constrainedBounds;
} | [
"function",
"(",
"current",
")",
"{",
"var",
"bounds",
",",
"constrainedBounds",
";",
"bounds",
"=",
"this",
".",
"getBounds",
"(",
"current",
")",
";",
"constrainedBounds",
"=",
"this",
".",
"_applyBoundaryConstraints",
"(",
"bounds",
")",
";",
"return",
"c... | Returns bounds taking constraints into account
Added to improve constrained panning
@param {Boolean} current - Pass true for the current location; defaults to false (target location).
@return {OpenSeadragon.Viewport} Chainable. | [
"Returns",
"bounds",
"taking",
"constraints",
"into",
"account",
"Added",
"to",
"improve",
"constrained",
"panning"
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewport.js#L752-L761 | |
10,859 | openseadragon/openseadragon | src/viewport.js | function(zoom, refPoint, immediately) {
var _this = this;
this.zoomPoint = refPoint instanceof $.Point &&
!isNaN(refPoint.x) &&
!isNaN(refPoint.y) ?
refPoint :
null;
if (immediately) {
this._adjustCenterSpringsForZoomPoint(function() ... | javascript | function(zoom, refPoint, immediately) {
var _this = this;
this.zoomPoint = refPoint instanceof $.Point &&
!isNaN(refPoint.x) &&
!isNaN(refPoint.y) ?
refPoint :
null;
if (immediately) {
this._adjustCenterSpringsForZoomPoint(function() ... | [
"function",
"(",
"zoom",
",",
"refPoint",
",",
"immediately",
")",
"{",
"var",
"_this",
"=",
"this",
";",
"this",
".",
"zoomPoint",
"=",
"refPoint",
"instanceof",
"$",
".",
"Point",
"&&",
"!",
"isNaN",
"(",
"refPoint",
".",
"x",
")",
"&&",
"!",
"isNa... | Zooms to the specified zoom level
@function
@param {Number} zoom The zoom level to zoom to.
@param {OpenSeadragon.Point} [refPoint] The point which will stay at
the same screen location. Defaults to the viewport center.
@param {Boolean} [immediately=false]
@return {OpenSeadragon.Viewport} Chainable.
@fires OpenSeadrago... | [
"Zooms",
"to",
"the",
"specified",
"zoom",
"level"
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewport.js#L835-L873 | |
10,860 | openseadragon/openseadragon | src/viewport.js | function(degrees) {
if (!this.viewer || !this.viewer.drawer.canRotate()) {
return this;
}
this.degrees = $.positiveModulo(degrees, 360);
this._setContentBounds(
this.viewer.world.getHomeBounds(),
this.viewer.world.getContentFactor());
this.view... | javascript | function(degrees) {
if (!this.viewer || !this.viewer.drawer.canRotate()) {
return this;
}
this.degrees = $.positiveModulo(degrees, 360);
this._setContentBounds(
this.viewer.world.getHomeBounds(),
this.viewer.world.getContentFactor());
this.view... | [
"function",
"(",
"degrees",
")",
"{",
"if",
"(",
"!",
"this",
".",
"viewer",
"||",
"!",
"this",
".",
"viewer",
".",
"drawer",
".",
"canRotate",
"(",
")",
")",
"{",
"return",
"this",
";",
"}",
"this",
".",
"degrees",
"=",
"$",
".",
"positiveModulo",... | Rotates this viewport to the angle specified.
@function
@return {OpenSeadragon.Viewport} Chainable. | [
"Rotates",
"this",
"viewport",
"to",
"the",
"angle",
"specified",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewport.js#L880-L902 | |
10,861 | openseadragon/openseadragon | src/viewport.js | function(pixel, current) {
var bounds = this.getBoundsNoRotate(current);
return pixel.minus(
new $.Point(this._margins.left, this._margins.top)
).divide(
this._containerInnerSize.x / bounds.width
).plus(
bounds.getTopLeft()
);
} | javascript | function(pixel, current) {
var bounds = this.getBoundsNoRotate(current);
return pixel.minus(
new $.Point(this._margins.left, this._margins.top)
).divide(
this._containerInnerSize.x / bounds.width
).plus(
bounds.getTopLeft()
);
} | [
"function",
"(",
"pixel",
",",
"current",
")",
"{",
"var",
"bounds",
"=",
"this",
".",
"getBoundsNoRotate",
"(",
"current",
")",
";",
"return",
"pixel",
".",
"minus",
"(",
"new",
"$",
".",
"Point",
"(",
"this",
".",
"_margins",
".",
"left",
",",
"thi... | Convert pixel coordinates to viewport coordinates.
This method does not take rotation into account.
Consider using pointFromPixel if you need to account for rotation.
@param {OpenSeadragon.Point} pixel Pixel coordinates
@param {Boolean} [current=false] - Pass true for the current location;
defaults to false (target loc... | [
"Convert",
"pixel",
"coordinates",
"to",
"viewport",
"coordinates",
".",
"This",
"method",
"does",
"not",
"take",
"rotation",
"into",
"account",
".",
"Consider",
"using",
"pointFromPixel",
"if",
"you",
"need",
"to",
"account",
"for",
"rotation",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewport.js#L1119-L1128 | |
10,862 | openseadragon/openseadragon | src/viewport.js | function(rectangle) {
return $.Rect.fromSummits(
this.pointFromPixel(rectangle.getTopLeft(), true),
this.pointFromPixel(rectangle.getTopRight(), true),
this.pointFromPixel(rectangle.getBottomLeft(), true)
);
} | javascript | function(rectangle) {
return $.Rect.fromSummits(
this.pointFromPixel(rectangle.getTopLeft(), true),
this.pointFromPixel(rectangle.getTopRight(), true),
this.pointFromPixel(rectangle.getBottomLeft(), true)
);
} | [
"function",
"(",
"rectangle",
")",
"{",
"return",
"$",
".",
"Rect",
".",
"fromSummits",
"(",
"this",
".",
"pointFromPixel",
"(",
"rectangle",
".",
"getTopLeft",
"(",
")",
",",
"true",
")",
",",
"this",
".",
"pointFromPixel",
"(",
"rectangle",
".",
"getTo... | Convert a rectangle in pixel coordinates relative to the viewer element
to viewport coordinates.
@param {OpenSeadragon.Rect} rectangle the rectangle to convert
@returns {OpenSeadragon.Rect} the converted rectangle | [
"Convert",
"a",
"rectangle",
"in",
"pixel",
"coordinates",
"relative",
"to",
"the",
"viewer",
"element",
"to",
"viewport",
"coordinates",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewport.js#L1407-L1413 | |
10,863 | openseadragon/openseadragon | src/viewport.js | function(rectangle) {
return $.Rect.fromSummits(
this.pixelFromPoint(rectangle.getTopLeft(), true),
this.pixelFromPoint(rectangle.getTopRight(), true),
this.pixelFromPoint(rectangle.getBottomLeft(), true)
);
} | javascript | function(rectangle) {
return $.Rect.fromSummits(
this.pixelFromPoint(rectangle.getTopLeft(), true),
this.pixelFromPoint(rectangle.getTopRight(), true),
this.pixelFromPoint(rectangle.getBottomLeft(), true)
);
} | [
"function",
"(",
"rectangle",
")",
"{",
"return",
"$",
".",
"Rect",
".",
"fromSummits",
"(",
"this",
".",
"pixelFromPoint",
"(",
"rectangle",
".",
"getTopLeft",
"(",
")",
",",
"true",
")",
",",
"this",
".",
"pixelFromPoint",
"(",
"rectangle",
".",
"getTo... | Convert a rectangle in viewport coordinates to pixel coordinates relative
to the viewer element.
@param {OpenSeadragon.Rect} rectangle the rectangle to convert
@returns {OpenSeadragon.Rect} the converted rectangle | [
"Convert",
"a",
"rectangle",
"in",
"viewport",
"coordinates",
"to",
"pixel",
"coordinates",
"relative",
"to",
"the",
"viewer",
"element",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewport.js#L1421-L1427 | |
10,864 | openseadragon/openseadragon | src/viewport.js | function(point) {
$.console.assert(this.viewer,
"[Viewport.viewportToWindowCoordinates] the viewport must have a viewer.");
var viewerCoordinates = this.viewportToViewerElementCoordinates(point);
return viewerCoordinates.plus(
$.getElementPosition(this.viewer.element)... | javascript | function(point) {
$.console.assert(this.viewer,
"[Viewport.viewportToWindowCoordinates] the viewport must have a viewer.");
var viewerCoordinates = this.viewportToViewerElementCoordinates(point);
return viewerCoordinates.plus(
$.getElementPosition(this.viewer.element)... | [
"function",
"(",
"point",
")",
"{",
"$",
".",
"console",
".",
"assert",
"(",
"this",
".",
"viewer",
",",
"\"[Viewport.viewportToWindowCoordinates] the viewport must have a viewer.\"",
")",
";",
"var",
"viewerCoordinates",
"=",
"this",
".",
"viewportToViewerElementCoordi... | Convert viewport coordinates to pixel coordinates relative to the window.
@param {OpenSeadragon.Point} point
@returns {OpenSeadragon.Point} | [
"Convert",
"viewport",
"coordinates",
"to",
"pixel",
"coordinates",
"relative",
"to",
"the",
"window",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewport.js#L1447-L1453 | |
10,865 | openseadragon/openseadragon | src/viewport.js | function( state ) {
if ( this.flipped === state ) {
return this;
}
this.flipped = state;
if(this.viewer.navigator){
this.viewer.navigator.setFlip(this.getFlip());
}
this.viewer.forceRedraw();
/**
* Raised when flip state has been changed.
*
... | javascript | function( state ) {
if ( this.flipped === state ) {
return this;
}
this.flipped = state;
if(this.viewer.navigator){
this.viewer.navigator.setFlip(this.getFlip());
}
this.viewer.forceRedraw();
/**
* Raised when flip state has been changed.
*
... | [
"function",
"(",
"state",
")",
"{",
"if",
"(",
"this",
".",
"flipped",
"===",
"state",
")",
"{",
"return",
"this",
";",
"}",
"this",
".",
"flipped",
"=",
"state",
";",
"if",
"(",
"this",
".",
"viewer",
".",
"navigator",
")",
"{",
"this",
".",
"vi... | Sets flip state according to the state input argument.
@function
@param {Boolean} state - Flip state to set.
@return {OpenSeadragon.Viewport} Chainable. | [
"Sets",
"flip",
"state",
"according",
"to",
"the",
"state",
"input",
"argument",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/viewport.js#L1548-L1571 | |
10,866 | openseadragon/openseadragon | src/imagetilesource.js | function (level, x, y) {
var url = null;
if (level >= this.minLevel && level <= this.maxLevel) {
url = this.levels[level].url;
}
return url;
} | javascript | function (level, x, y) {
var url = null;
if (level >= this.minLevel && level <= this.maxLevel) {
url = this.levels[level].url;
}
return url;
} | [
"function",
"(",
"level",
",",
"x",
",",
"y",
")",
"{",
"var",
"url",
"=",
"null",
";",
"if",
"(",
"level",
">=",
"this",
".",
"minLevel",
"&&",
"level",
"<=",
"this",
".",
"maxLevel",
")",
"{",
"url",
"=",
"this",
".",
"levels",
"[",
"level",
... | Retrieves a tile url
@function
@param {Number} level Level of the tile
@param {Number} x x coordinate of the tile
@param {Number} y y coordinate of the tile | [
"Retrieves",
"a",
"tile",
"url"
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/imagetilesource.js#L177-L183 | |
10,867 | openseadragon/openseadragon | src/imagetilesource.js | function (level, x, y) {
var context = null;
if (level >= this.minLevel && level <= this.maxLevel) {
context = this.levels[level].context2D;
}
return context;
} | javascript | function (level, x, y) {
var context = null;
if (level >= this.minLevel && level <= this.maxLevel) {
context = this.levels[level].context2D;
}
return context;
} | [
"function",
"(",
"level",
",",
"x",
",",
"y",
")",
"{",
"var",
"context",
"=",
"null",
";",
"if",
"(",
"level",
">=",
"this",
".",
"minLevel",
"&&",
"level",
"<=",
"this",
".",
"maxLevel",
")",
"{",
"context",
"=",
"this",
".",
"levels",
"[",
"le... | Retrieves a tile context 2D
@function
@param {Number} level Level of the tile
@param {Number} x x coordinate of the tile
@param {Number} y y coordinate of the tile | [
"Retrieves",
"a",
"tile",
"context",
"2D"
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/imagetilesource.js#L191-L197 | |
10,868 | openseadragon/openseadragon | src/imageloader.js | function(){
var self = this;
var selfAbort = this.abort;
this.image = new Image();
this.image.onload = function(){
self.finish(true);
};
this.image.onabort = this.image.onerror = function() {
self.errorMsg = "Image load aborted";
self... | javascript | function(){
var self = this;
var selfAbort = this.abort;
this.image = new Image();
this.image.onload = function(){
self.finish(true);
};
this.image.onabort = this.image.onerror = function() {
self.errorMsg = "Image load aborted";
self... | [
"function",
"(",
")",
"{",
"var",
"self",
"=",
"this",
";",
"var",
"selfAbort",
"=",
"this",
".",
"abort",
";",
"this",
".",
"image",
"=",
"new",
"Image",
"(",
")",
";",
"this",
".",
"image",
".",
"onload",
"=",
"function",
"(",
")",
"{",
"self",... | Starts the image job.
@method | [
"Starts",
"the",
"image",
"job",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/imageloader.js#L72-L151 | |
10,869 | openseadragon/openseadragon | src/imageloader.js | function(options) {
var _this = this,
complete = function(job) {
completeJob(_this, job, options.callback);
},
jobOptions = {
src: options.src,
loadWithAjax: options.loadWithAjax,
ajaxHeaders: options.loadWithAja... | javascript | function(options) {
var _this = this,
complete = function(job) {
completeJob(_this, job, options.callback);
},
jobOptions = {
src: options.src,
loadWithAjax: options.loadWithAjax,
ajaxHeaders: options.loadWithAja... | [
"function",
"(",
"options",
")",
"{",
"var",
"_this",
"=",
"this",
",",
"complete",
"=",
"function",
"(",
"job",
")",
"{",
"completeJob",
"(",
"_this",
",",
"job",
",",
"options",
".",
"callback",
")",
";",
"}",
",",
"jobOptions",
"=",
"{",
"src",
... | Add an unloaded image to the loader queue.
@method
@param {Object} options - Options for this job.
@param {String} [options.src] - URL of image to download.
@param {String} [options.loadWithAjax] - Whether to load this image with AJAX.
@param {String} [options.ajaxHeaders] - Headers to add to the image request if using... | [
"Add",
"an",
"unloaded",
"image",
"to",
"the",
"loader",
"queue",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/imageloader.js#L204-L228 | |
10,870 | openseadragon/openseadragon | src/imageloader.js | function() {
for( var i = 0; i < this.jobQueue.length; i++ ) {
var job = this.jobQueue[i];
if ( typeof job.abort === "function" ) {
job.abort();
}
}
this.jobQueue = [];
} | javascript | function() {
for( var i = 0; i < this.jobQueue.length; i++ ) {
var job = this.jobQueue[i];
if ( typeof job.abort === "function" ) {
job.abort();
}
}
this.jobQueue = [];
} | [
"function",
"(",
")",
"{",
"for",
"(",
"var",
"i",
"=",
"0",
";",
"i",
"<",
"this",
".",
"jobQueue",
".",
"length",
";",
"i",
"++",
")",
"{",
"var",
"job",
"=",
"this",
".",
"jobQueue",
"[",
"i",
"]",
";",
"if",
"(",
"typeof",
"job",
".",
"... | Clear any unstarted image loading jobs from the queue.
@method | [
"Clear",
"any",
"unstarted",
"image",
"loading",
"jobs",
"from",
"the",
"queue",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/imageloader.js#L234-L243 | |
10,871 | openseadragon/openseadragon | src/imageloader.js | completeJob | function completeJob(loader, job, callback) {
var nextJob;
loader.jobsInProgress--;
if ((!loader.jobLimit || loader.jobsInProgress < loader.jobLimit) && loader.jobQueue.length > 0) {
nextJob = loader.jobQueue.shift();
nextJob.start();
loader.jobsInProgress++;
}
callback(jo... | javascript | function completeJob(loader, job, callback) {
var nextJob;
loader.jobsInProgress--;
if ((!loader.jobLimit || loader.jobsInProgress < loader.jobLimit) && loader.jobQueue.length > 0) {
nextJob = loader.jobQueue.shift();
nextJob.start();
loader.jobsInProgress++;
}
callback(jo... | [
"function",
"completeJob",
"(",
"loader",
",",
"job",
",",
"callback",
")",
"{",
"var",
"nextJob",
";",
"loader",
".",
"jobsInProgress",
"--",
";",
"if",
"(",
"(",
"!",
"loader",
".",
"jobLimit",
"||",
"loader",
".",
"jobsInProgress",
"<",
"loader",
".",... | Cleans up ImageJob once completed.
@method
@private
@param loader - ImageLoader used to start job.
@param job - The ImageJob that has completed.
@param callback - Called once cleanup is finished. | [
"Cleans",
"up",
"ImageJob",
"once",
"completed",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/imageloader.js#L254-L266 |
10,872 | openseadragon/openseadragon | src/iiiftilesource.js | function( level ) {
if(this.emulateLegacyImagePyramid) {
return $.TileSource.prototype.getTileWidth.call(this, level);
}
var scaleFactor = Math.pow(2, this.maxLevel - level);
if (this.tileSizePerScaleFactor && this.tileSizePerScaleFactor[scaleFactor]) {
return ... | javascript | function( level ) {
if(this.emulateLegacyImagePyramid) {
return $.TileSource.prototype.getTileWidth.call(this, level);
}
var scaleFactor = Math.pow(2, this.maxLevel - level);
if (this.tileSizePerScaleFactor && this.tileSizePerScaleFactor[scaleFactor]) {
return ... | [
"function",
"(",
"level",
")",
"{",
"if",
"(",
"this",
".",
"emulateLegacyImagePyramid",
")",
"{",
"return",
"$",
".",
"TileSource",
".",
"prototype",
".",
"getTileWidth",
".",
"call",
"(",
"this",
",",
"level",
")",
";",
"}",
"var",
"scaleFactor",
"=",
... | Return the tileWidth for the given level.
@function
@param {Number} level | [
"Return",
"the",
"tileWidth",
"for",
"the",
"given",
"level",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/iiiftilesource.js#L219-L231 | |
10,873 | openseadragon/openseadragon | src/iiiftilesource.js | function( level ) {
if(this.emulateLegacyImagePyramid) {
return $.TileSource.prototype.getTileHeight.call(this, level);
}
var scaleFactor = Math.pow(2, this.maxLevel - level);
if (this.tileSizePerScaleFactor && this.tileSizePerScaleFactor[scaleFactor]) {
return... | javascript | function( level ) {
if(this.emulateLegacyImagePyramid) {
return $.TileSource.prototype.getTileHeight.call(this, level);
}
var scaleFactor = Math.pow(2, this.maxLevel - level);
if (this.tileSizePerScaleFactor && this.tileSizePerScaleFactor[scaleFactor]) {
return... | [
"function",
"(",
"level",
")",
"{",
"if",
"(",
"this",
".",
"emulateLegacyImagePyramid",
")",
"{",
"return",
"$",
".",
"TileSource",
".",
"prototype",
".",
"getTileHeight",
".",
"call",
"(",
"this",
",",
"level",
")",
";",
"}",
"var",
"scaleFactor",
"=",... | Return the tileHeight for the given level.
@function
@param {Number} level | [
"Return",
"the",
"tileHeight",
"for",
"the",
"given",
"level",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/iiiftilesource.js#L238-L250 | |
10,874 | openseadragon/openseadragon | src/iiiftilesource.js | function( level, x, y ){
if(this.emulateLegacyImagePyramid) {
var url = null;
if ( this.levels.length > 0 && level >= this.minLevel && level <= this.maxLevel ) {
url = this.levels[ level ].url;
}
return url;
}
//# constants
... | javascript | function( level, x, y ){
if(this.emulateLegacyImagePyramid) {
var url = null;
if ( this.levels.length > 0 && level >= this.minLevel && level <= this.maxLevel ) {
url = this.levels[ level ].url;
}
return url;
}
//# constants
... | [
"function",
"(",
"level",
",",
"x",
",",
"y",
")",
"{",
"if",
"(",
"this",
".",
"emulateLegacyImagePyramid",
")",
"{",
"var",
"url",
"=",
"null",
";",
"if",
"(",
"this",
".",
"levels",
".",
"length",
">",
"0",
"&&",
"level",
">=",
"this",
".",
"m... | Responsible for retrieving the url which will return an image for the
region specified by the given x, y, and level components.
@function
@param {Number} level - z index
@param {Number} x
@param {Number} y
@throws {Error} | [
"Responsible",
"for",
"retrieving",
"the",
"url",
"which",
"will",
"return",
"an",
"image",
"for",
"the",
"region",
"specified",
"by",
"the",
"given",
"x",
"y",
"and",
"level",
"components",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/iiiftilesource.js#L314-L388 | |
10,875 | openseadragon/openseadragon | src/iiiftilesource.js | canBeTiled | function canBeTiled ( profile ) {
var level0Profiles = [
"http://library.stanford.edu/iiif/image-api/compliance.html#level0",
"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",
"http://iiif.io/api/image/2/level0.json"
];
var isLevel0 = (l... | javascript | function canBeTiled ( profile ) {
var level0Profiles = [
"http://library.stanford.edu/iiif/image-api/compliance.html#level0",
"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",
"http://iiif.io/api/image/2/level0.json"
];
var isLevel0 = (l... | [
"function",
"canBeTiled",
"(",
"profile",
")",
"{",
"var",
"level0Profiles",
"=",
"[",
"\"http://library.stanford.edu/iiif/image-api/compliance.html#level0\"",
",",
"\"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0\"",
",",
"\"http://iiif.io/api/image/2/level0.json... | Determine whether arbitrary tile requests can be made against a service with the given profile
@function
@param {array} profile - IIIF profile array
@throws {Error} | [
"Determine",
"whether",
"arbitrary",
"tile",
"requests",
"can",
"be",
"made",
"against",
"a",
"service",
"with",
"the",
"given",
"profile"
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/iiiftilesource.js#L398-L410 |
10,876 | openseadragon/openseadragon | src/eventsource.js | function ( eventName, handler, userData ) {
var events = this.events[ eventName ];
if ( !events ) {
this.events[ eventName ] = events = [];
}
if ( handler && $.isFunction( handler ) ) {
events[ events.length ] = { handler: handler, userData: userData || null };
... | javascript | function ( eventName, handler, userData ) {
var events = this.events[ eventName ];
if ( !events ) {
this.events[ eventName ] = events = [];
}
if ( handler && $.isFunction( handler ) ) {
events[ events.length ] = { handler: handler, userData: userData || null };
... | [
"function",
"(",
"eventName",
",",
"handler",
",",
"userData",
")",
"{",
"var",
"events",
"=",
"this",
".",
"events",
"[",
"eventName",
"]",
";",
"if",
"(",
"!",
"events",
")",
"{",
"this",
".",
"events",
"[",
"eventName",
"]",
"=",
"events",
"=",
... | Add an event handler for a given event.
@function
@param {String} eventName - Name of event to register.
@param {OpenSeadragon.EventHandler} handler - Function to call when event is triggered.
@param {Object} [userData=null] - Arbitrary object to be passed unchanged to the handler. | [
"Add",
"an",
"event",
"handler",
"for",
"a",
"given",
"event",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/eventsource.js#L92-L100 | |
10,877 | openseadragon/openseadragon | src/eventsource.js | function ( eventName, handler ) {
var events = this.events[ eventName ],
handlers = [],
i;
if ( !events ) {
return;
}
if ( $.isArray( events ) ) {
for ( i = 0; i < events.length; i++ ) {
if ( events[i].handler !== handler ) ... | javascript | function ( eventName, handler ) {
var events = this.events[ eventName ],
handlers = [],
i;
if ( !events ) {
return;
}
if ( $.isArray( events ) ) {
for ( i = 0; i < events.length; i++ ) {
if ( events[i].handler !== handler ) ... | [
"function",
"(",
"eventName",
",",
"handler",
")",
"{",
"var",
"events",
"=",
"this",
".",
"events",
"[",
"eventName",
"]",
",",
"handlers",
"=",
"[",
"]",
",",
"i",
";",
"if",
"(",
"!",
"events",
")",
"{",
"return",
";",
"}",
"if",
"(",
"$",
"... | Remove a specific event handler for a given event.
@function
@param {String} eventName - Name of event for which the handler is to be removed.
@param {OpenSeadragon.EventHandler} handler - Function to be removed. | [
"Remove",
"a",
"specific",
"event",
"handler",
"for",
"a",
"given",
"event",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/eventsource.js#L108-L123 | |
10,878 | openseadragon/openseadragon | src/eventsource.js | function ( eventName ) {
var events = this.events[ eventName ];
if ( !events || !events.length ) {
return null;
}
events = events.length === 1 ?
[ events[ 0 ] ] :
Array.apply( null, events );
return function ( source, args ) {
var i... | javascript | function ( eventName ) {
var events = this.events[ eventName ];
if ( !events || !events.length ) {
return null;
}
events = events.length === 1 ?
[ events[ 0 ] ] :
Array.apply( null, events );
return function ( source, args ) {
var i... | [
"function",
"(",
"eventName",
")",
"{",
"var",
"events",
"=",
"this",
".",
"events",
"[",
"eventName",
"]",
";",
"if",
"(",
"!",
"events",
"||",
"!",
"events",
".",
"length",
")",
"{",
"return",
"null",
";",
"}",
"events",
"=",
"events",
".",
"leng... | Get a function which iterates the list of all handlers registered for a given event, calling the handler for each.
@function
@param {String} eventName - Name of event to get handlers for. | [
"Get",
"a",
"function",
"which",
"iterates",
"the",
"list",
"of",
"all",
"handlers",
"registered",
"for",
"a",
"given",
"event",
"calling",
"the",
"handler",
"for",
"each",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/eventsource.js#L147-L166 | |
10,879 | openseadragon/openseadragon | src/eventsource.js | function( eventName, eventArgs ) {
//uncomment if you want to get a log of all events
//$.console.log( eventName );
var handler = this.getHandler( eventName );
if ( handler ) {
if ( !eventArgs ) {
eventArgs = {};
}
handler( this, even... | javascript | function( eventName, eventArgs ) {
//uncomment if you want to get a log of all events
//$.console.log( eventName );
var handler = this.getHandler( eventName );
if ( handler ) {
if ( !eventArgs ) {
eventArgs = {};
}
handler( this, even... | [
"function",
"(",
"eventName",
",",
"eventArgs",
")",
"{",
"//uncomment if you want to get a log of all events",
"//$.console.log( eventName );",
"var",
"handler",
"=",
"this",
".",
"getHandler",
"(",
"eventName",
")",
";",
"if",
"(",
"handler",
")",
"{",
"if",
"(",
... | Trigger an event, optionally passing additional information.
@function
@param {String} eventName - Name of event to register.
@param {Object} eventArgs - Event-specific data. | [
"Trigger",
"an",
"event",
"optionally",
"passing",
"additional",
"information",
"."
] | e7108f23602575fc6eb152d4b82a8b44b2ca698e | https://github.com/openseadragon/openseadragon/blob/e7108f23602575fc6eb152d4b82a8b44b2ca698e/src/eventsource.js#L174-L186 | |
10,880 | mlaursen/react-md | docs/src/scripts/createDocgen.js | createDocgen | async function createDocgen() {
const customPropTypes = await getCustomPropTypes();
const components = await getDocumentableComponents();
const propTypesDatabase = getPropTypeLinks(components);
const docgens = await Promise.all(components.map(c => createComponentsDocgen(c, customPropTypes)));
const database ... | javascript | async function createDocgen() {
const customPropTypes = await getCustomPropTypes();
const components = await getDocumentableComponents();
const propTypesDatabase = getPropTypeLinks(components);
const docgens = await Promise.all(components.map(c => createComponentsDocgen(c, customPropTypes)));
const database ... | [
"async",
"function",
"createDocgen",
"(",
")",
"{",
"const",
"customPropTypes",
"=",
"await",
"getCustomPropTypes",
"(",
")",
";",
"const",
"components",
"=",
"await",
"getDocumentableComponents",
"(",
")",
";",
"const",
"propTypesDatabase",
"=",
"getPropTypeLinks",... | Creates the "database" file of all the documentation for the components. | [
"Creates",
"the",
"database",
"file",
"of",
"all",
"the",
"documentation",
"for",
"the",
"components",
"."
] | 28c78cac8cdaa3d9832a05025bdf50050627e23b | https://github.com/mlaursen/react-md/blob/28c78cac8cdaa3d9832a05025bdf50050627e23b/docs/src/scripts/createDocgen.js#L19-L53 |
10,881 | mlaursen/react-md | docs/src/scripts/utils/getSassDocLinks.js | findLink | function findLink(ref) {
if (lastLink.indexOf(ref) !== -1) {
return lastLink;
}
lastLink = '';
routes.some((link) => {
if (link.indexOf(ref) !== -1) {
lastLink = link;
}
return lastLink;
});
return lastLink;
} | javascript | function findLink(ref) {
if (lastLink.indexOf(ref) !== -1) {
return lastLink;
}
lastLink = '';
routes.some((link) => {
if (link.indexOf(ref) !== -1) {
lastLink = link;
}
return lastLink;
});
return lastLink;
} | [
"function",
"findLink",
"(",
"ref",
")",
"{",
"if",
"(",
"lastLink",
".",
"indexOf",
"(",
"ref",
")",
"!==",
"-",
"1",
")",
"{",
"return",
"lastLink",
";",
"}",
"lastLink",
"=",
"''",
";",
"routes",
".",
"some",
"(",
"(",
"link",
")",
"=>",
"{",
... | "Lazily" finds the link to use for a sassdoc. It attempts to match the `lastLink`,
but otherwise searches the `LINKS` for a match.
@param {String} ref - the ref to match with
@return {String} link - the link to use for the ref. | [
"Lazily",
"finds",
"the",
"link",
"to",
"use",
"for",
"a",
"sassdoc",
".",
"It",
"attempts",
"to",
"match",
"the",
"lastLink",
"but",
"otherwise",
"searches",
"the",
"LINKS",
"for",
"a",
"match",
"."
] | 28c78cac8cdaa3d9832a05025bdf50050627e23b | https://github.com/mlaursen/react-md/blob/28c78cac8cdaa3d9832a05025bdf50050627e23b/docs/src/scripts/utils/getSassDocLinks.js#L21-L36 |
10,882 | mlaursen/react-md | docs/src/server/api/github.js | githubProxy | async function githubProxy(req, res) {
const response = await fetchGithub(req.url, { headers });
setHeader(RATE_LIMIT, res, response);
setHeader(RATE_REMAINING, res, response);
setHeader(RATE_RESET, res, response);
if (response.ok) {
const json = await response.json();
res.json(json);
} else if (res... | javascript | async function githubProxy(req, res) {
const response = await fetchGithub(req.url, { headers });
setHeader(RATE_LIMIT, res, response);
setHeader(RATE_REMAINING, res, response);
setHeader(RATE_RESET, res, response);
if (response.ok) {
const json = await response.json();
res.json(json);
} else if (res... | [
"async",
"function",
"githubProxy",
"(",
"req",
",",
"res",
")",
"{",
"const",
"response",
"=",
"await",
"fetchGithub",
"(",
"req",
".",
"url",
",",
"{",
"headers",
"}",
")",
";",
"setHeader",
"(",
"RATE_LIMIT",
",",
"res",
",",
"response",
")",
";",
... | Soo.. There's probably a better way to set up a proxy server, but that isn't
in my knowledge set. Anyways...
GitHub likes when you specify a custom User-Agent that contains your app name/username
when making api calls to help with debugging and other things. At the time of making
this server, the User-Agent header is ... | [
"Soo",
"..",
"There",
"s",
"probably",
"a",
"better",
"way",
"to",
"set",
"up",
"a",
"proxy",
"server",
"but",
"that",
"isn",
"t",
"in",
"my",
"knowledge",
"set",
".",
"Anyways",
"..."
] | 28c78cac8cdaa3d9832a05025bdf50050627e23b | https://github.com/mlaursen/react-md/blob/28c78cac8cdaa3d9832a05025bdf50050627e23b/docs/src/server/api/github.js#L32-L46 |
10,883 | mlaursen/react-md | docs/src/utils/formatMarkdown/postTransforms.js | headerQuickLinkReplacer | function headerQuickLinkReplacer(fullMatch, openingTag, headerId, remainingHtml, headerText) {
const link = makeLink(headerId, headerText);
return `${openingTag} class="quick-link quick-link__container">${link}${remainingHtml}`;
} | javascript | function headerQuickLinkReplacer(fullMatch, openingTag, headerId, remainingHtml, headerText) {
const link = makeLink(headerId, headerText);
return `${openingTag} class="quick-link quick-link__container">${link}${remainingHtml}`;
} | [
"function",
"headerQuickLinkReplacer",
"(",
"fullMatch",
",",
"openingTag",
",",
"headerId",
",",
"remainingHtml",
",",
"headerText",
")",
"{",
"const",
"link",
"=",
"makeLink",
"(",
"headerId",
",",
"headerText",
")",
";",
"return",
"`",
"${",
"openingTag",
"... | Inserts the accessible quick link before any header tag and updates the header tag
to be a quick link container.
@param {String} fullMatch - The full match of the quick link regex.
@param {String} openingTag - This will be everything in the match
up to the first '>'. So something like: '<h1 id="h1"'
@param {String} he... | [
"Inserts",
"the",
"accessible",
"quick",
"link",
"before",
"any",
"header",
"tag",
"and",
"updates",
"the",
"header",
"tag",
"to",
"be",
"a",
"quick",
"link",
"container",
"."
] | 28c78cac8cdaa3d9832a05025bdf50050627e23b | https://github.com/mlaursen/react-md/blob/28c78cac8cdaa3d9832a05025bdf50050627e23b/docs/src/utils/formatMarkdown/postTransforms.js#L44-L47 |
10,884 | mlaursen/react-md | src/js/SelectionControls/SelectionControlGroup.js | requiredByAllControls | function requiredByAllControls(validator) {
return function validate(props, propName, component, ...others) {
let err = validator(props, propName, component, ...others);
if (!err && typeof props[propName] === 'undefined') {
const invalids = props.controls.filter(c => !c[propName]).map((_, i) => i);
... | javascript | function requiredByAllControls(validator) {
return function validate(props, propName, component, ...others) {
let err = validator(props, propName, component, ...others);
if (!err && typeof props[propName] === 'undefined') {
const invalids = props.controls.filter(c => !c[propName]).map((_, i) => i);
... | [
"function",
"requiredByAllControls",
"(",
"validator",
")",
"{",
"return",
"function",
"validate",
"(",
"props",
",",
"propName",
",",
"component",
",",
"...",
"others",
")",
"{",
"let",
"err",
"=",
"validator",
"(",
"props",
",",
"propName",
",",
"component... | A custom PropTypes validator to make sure that each `control` in the `controls` prop
contains the given `propName`, or the `SelectionControlGroup` has defined that prop. | [
"A",
"custom",
"PropTypes",
"validator",
"to",
"make",
"sure",
"that",
"each",
"control",
"in",
"the",
"controls",
"prop",
"contains",
"the",
"given",
"propName",
"or",
"the",
"SelectionControlGroup",
"has",
"defined",
"that",
"prop",
"."
] | 28c78cac8cdaa3d9832a05025bdf50050627e23b | https://github.com/mlaursen/react-md/blob/28c78cac8cdaa3d9832a05025bdf50050627e23b/src/js/SelectionControls/SelectionControlGroup.js#L16-L38 |
10,885 | transistorsoft/react-native-background-geolocation | scripts/xcode-helpers.js | getBuildProperty | function getBuildProperty(project, property) {
const firstTarget = project.getFirstTarget().firstTarget;
const configurationList = project.pbxXCConfigurationList()[
firstTarget.buildConfigurationList
];
const defaultBuildConfiguration = configurationList.buildConfigurations.reduce(
(acc,... | javascript | function getBuildProperty(project, property) {
const firstTarget = project.getFirstTarget().firstTarget;
const configurationList = project.pbxXCConfigurationList()[
firstTarget.buildConfigurationList
];
const defaultBuildConfiguration = configurationList.buildConfigurations.reduce(
(acc,... | [
"function",
"getBuildProperty",
"(",
"project",
",",
"property",
")",
"{",
"const",
"firstTarget",
"=",
"project",
".",
"getFirstTarget",
"(",
")",
".",
"firstTarget",
";",
"const",
"configurationList",
"=",
"project",
".",
"pbxXCConfigurationList",
"(",
")",
"[... | The getBuildProperty method of the 'xcode' project is a bit naive in that it doesn't take a specific target but iterates over all of them and doesn't have an exit condition if a property has been found. Which in the case of react-native projects usually is the tvOS target because it comes last. | [
"The",
"getBuildProperty",
"method",
"of",
"the",
"xcode",
"project",
"is",
"a",
"bit",
"naive",
"in",
"that",
"it",
"doesn",
"t",
"take",
"a",
"specific",
"target",
"but",
"iterates",
"over",
"all",
"of",
"them",
"and",
"doesn",
"t",
"have",
"an",
"exit... | 7c0836653222ee1dd7b6cf6a7b7215f556e63f7c | https://github.com/transistorsoft/react-native-background-geolocation/blob/7c0836653222ee1dd7b6cf6a7b7215f556e63f7c/scripts/xcode-helpers.js#L16-L35 |
10,886 | transistorsoft/react-native-background-geolocation | scripts/xcode-helpers.js | getTargetAttributes | function getTargetAttributes(project, target) {
var attributes = project.getFirstProject()['firstProject']['attributes'];
target = target || project.getFirstTarget();
if (attributes['TargetAttributes'] === undefined) {
attributes['TargetAttributes'] = {};
}
if (attributes['TargetAttributes... | javascript | function getTargetAttributes(project, target) {
var attributes = project.getFirstProject()['firstProject']['attributes'];
target = target || project.getFirstTarget();
if (attributes['TargetAttributes'] === undefined) {
attributes['TargetAttributes'] = {};
}
if (attributes['TargetAttributes... | [
"function",
"getTargetAttributes",
"(",
"project",
",",
"target",
")",
"{",
"var",
"attributes",
"=",
"project",
".",
"getFirstProject",
"(",
")",
"[",
"'firstProject'",
"]",
"[",
"'attributes'",
"]",
";",
"target",
"=",
"target",
"||",
"project",
".",
"getF... | The node-xcode library doesn't offer a method to get all target attributes, so we'll have to implement it ourselves. | [
"The",
"node",
"-",
"xcode",
"library",
"doesn",
"t",
"offer",
"a",
"method",
"to",
"get",
"all",
"target",
"attributes",
"so",
"we",
"ll",
"have",
"to",
"implement",
"it",
"ourselves",
"."
] | 7c0836653222ee1dd7b6cf6a7b7215f556e63f7c | https://github.com/transistorsoft/react-native-background-geolocation/blob/7c0836653222ee1dd7b6cf6a7b7215f556e63f7c/scripts/xcode-helpers.js#L143-L156 |
10,887 | pegjs/pegjs | tools/benchmark/index.js | dup | function dup( text, count ) {
let result = "";
for ( let i = 1; i <= count; i++ ) result += text;
return result;
} | javascript | function dup( text, count ) {
let result = "";
for ( let i = 1; i <= count; i++ ) result += text;
return result;
} | [
"function",
"dup",
"(",
"text",
",",
"count",
")",
"{",
"let",
"result",
"=",
"\"\"",
";",
"for",
"(",
"let",
"i",
"=",
"1",
";",
"i",
"<=",
"count",
";",
"i",
"++",
")",
"result",
"+=",
"text",
";",
"return",
"result",
";",
"}"
] | Results Table Manipulation | [
"Results",
"Table",
"Manipulation"
] | 30f32600084d8da6a50b801edad49619e53e2a05 | https://github.com/pegjs/pegjs/blob/30f32600084d8da6a50b801edad49619e53e2a05/tools/benchmark/index.js#L10-L18 |
10,888 | pegjs/pegjs | packages/pegjs/lib/compiler/passes/report-undefined-rules.js | reportUndefinedRules | function reportUndefinedRules( ast, session, options ) {
const check = session.buildVisitor( {
rule_ref( node ) {
if ( ! ast.findRule( node.name ) ) {
session.error(
`Rule "${ node.name }" is not defined.`,
node.location
... | javascript | function reportUndefinedRules( ast, session, options ) {
const check = session.buildVisitor( {
rule_ref( node ) {
if ( ! ast.findRule( node.name ) ) {
session.error(
`Rule "${ node.name }" is not defined.`,
node.location
... | [
"function",
"reportUndefinedRules",
"(",
"ast",
",",
"session",
",",
"options",
")",
"{",
"const",
"check",
"=",
"session",
".",
"buildVisitor",
"(",
"{",
"rule_ref",
"(",
"node",
")",
"{",
"if",
"(",
"!",
"ast",
".",
"findRule",
"(",
"node",
".",
"nam... | Checks that all referenced rules exist. | [
"Checks",
"that",
"all",
"referenced",
"rules",
"exist",
"."
] | 30f32600084d8da6a50b801edad49619e53e2a05 | https://github.com/pegjs/pegjs/blob/30f32600084d8da6a50b801edad49619e53e2a05/packages/pegjs/lib/compiler/passes/report-undefined-rules.js#L4-L33 |
10,889 | pegjs/pegjs | packages/pegjs/lib/compiler/passes/calc-report-failures.js | calcReportFailures | function calcReportFailures( ast, session, options ) {
// By default, not report failures for rules...
ast.rules.forEach( rule => {
rule.reportFailures = false;
} );
// ...but report for start rules, because in that context report failures
// always enabled
const changedRules = optio... | javascript | function calcReportFailures( ast, session, options ) {
// By default, not report failures for rules...
ast.rules.forEach( rule => {
rule.reportFailures = false;
} );
// ...but report for start rules, because in that context report failures
// always enabled
const changedRules = optio... | [
"function",
"calcReportFailures",
"(",
"ast",
",",
"session",
",",
"options",
")",
"{",
"// By default, not report failures for rules...",
"ast",
".",
"rules",
".",
"forEach",
"(",
"rule",
"=>",
"{",
"rule",
".",
"reportFailures",
"=",
"false",
";",
"}",
")",
... | Determines if rule always used in disabled report failure context, that means, that any failures, reported within it, are never will be visible, so the no need to report it. | [
"Determines",
"if",
"rule",
"always",
"used",
"in",
"disabled",
"report",
"failure",
"context",
"that",
"means",
"that",
"any",
"failures",
"reported",
"within",
"it",
"are",
"never",
"will",
"be",
"visible",
"so",
"the",
"no",
"need",
"to",
"report",
"it",
... | 30f32600084d8da6a50b801edad49619e53e2a05 | https://github.com/pegjs/pegjs/blob/30f32600084d8da6a50b801edad49619e53e2a05/packages/pegjs/lib/compiler/passes/calc-report-failures.js#L6-L63 |
10,890 | pegjs/pegjs | packages/pegjs/lib/compiler/passes/report-duplicate-labels.js | reportDuplicateLabels | function reportDuplicateLabels( ast, session ) {
let check;
function checkExpressionWithClonedEnv( node, env ) {
check( node.expression, util.clone( env ) );
}
check = session.buildVisitor( {
rule( node ) {
check( node.expression, {} );
},
choice( node... | javascript | function reportDuplicateLabels( ast, session ) {
let check;
function checkExpressionWithClonedEnv( node, env ) {
check( node.expression, util.clone( env ) );
}
check = session.buildVisitor( {
rule( node ) {
check( node.expression, {} );
},
choice( node... | [
"function",
"reportDuplicateLabels",
"(",
"ast",
",",
"session",
")",
"{",
"let",
"check",
";",
"function",
"checkExpressionWithClonedEnv",
"(",
"node",
",",
"env",
")",
"{",
"check",
"(",
"node",
".",
"expression",
",",
"util",
".",
"clone",
"(",
"env",
"... | Checks that each label is defined only once within each scope. | [
"Checks",
"that",
"each",
"label",
"is",
"defined",
"only",
"once",
"within",
"each",
"scope",
"."
] | 30f32600084d8da6a50b801edad49619e53e2a05 | https://github.com/pegjs/pegjs/blob/30f32600084d8da6a50b801edad49619e53e2a05/packages/pegjs/lib/compiler/passes/report-duplicate-labels.js#L7-L68 |
10,891 | pegjs/pegjs | packages/pegjs/lib/util/vm.js | evalModule | function evalModule( source, context ) {
const argumentKeys = Object.keys( context );
const argumentValues = argumentKeys.map( argument => context[ argument ] );
const sandbox = { exports: {} };
argumentKeys.push( "module", "exports", source );
argumentValues.push( sandbox, sandbox.exports );
... | javascript | function evalModule( source, context ) {
const argumentKeys = Object.keys( context );
const argumentValues = argumentKeys.map( argument => context[ argument ] );
const sandbox = { exports: {} };
argumentKeys.push( "module", "exports", source );
argumentValues.push( sandbox, sandbox.exports );
... | [
"function",
"evalModule",
"(",
"source",
",",
"context",
")",
"{",
"const",
"argumentKeys",
"=",
"Object",
".",
"keys",
"(",
"context",
")",
";",
"const",
"argumentValues",
"=",
"argumentKeys",
".",
"map",
"(",
"argument",
"=>",
"context",
"[",
"argument",
... | `eval` the given source as a CommonJS module, using properties found in `context` as top-level variables.
Based on `vm.runInContext` found in Node.js, this is a cross-env solution. | [
"eval",
"the",
"given",
"source",
"as",
"a",
"CommonJS",
"module",
"using",
"properties",
"found",
"in",
"context",
"as",
"top",
"-",
"level",
"variables",
"."
] | 30f32600084d8da6a50b801edad49619e53e2a05 | https://github.com/pegjs/pegjs/blob/30f32600084d8da6a50b801edad49619e53e2a05/packages/pegjs/lib/util/vm.js#L8-L21 |
10,892 | pegjs/pegjs | packages/pegjs/lib/parser.js | createNode | function createNode( type, details ) {
const node = new ast.Node( type, location() );
if ( details === null ) return node;
util.extend( node, details );
return util.enforceFastProperties( node );
} | javascript | function createNode( type, details ) {
const node = new ast.Node( type, location() );
if ( details === null ) return node;
util.extend( node, details );
return util.enforceFastProperties( node );
} | [
"function",
"createNode",
"(",
"type",
",",
"details",
")",
"{",
"const",
"node",
"=",
"new",
"ast",
".",
"Node",
"(",
"type",
",",
"location",
"(",
")",
")",
";",
"if",
"(",
"details",
"===",
"null",
")",
"return",
"node",
";",
"util",
".",
"exten... | Helper to construct a new AST Node | [
"Helper",
"to",
"construct",
"a",
"new",
"AST",
"Node"
] | 30f32600084d8da6a50b801edad49619e53e2a05 | https://github.com/pegjs/pegjs/blob/30f32600084d8da6a50b801edad49619e53e2a05/packages/pegjs/lib/parser.js#L3424-L3432 |
10,893 | pegjs/pegjs | packages/pegjs/lib/parser.js | addComment | function addComment( text, multiline ) {
if ( options.extractComments ) {
const loc = location();
comments[ loc.start.offset ] = {
text: text,
multiline: multiline,
location: loc,
};
}
retu... | javascript | function addComment( text, multiline ) {
if ( options.extractComments ) {
const loc = location();
comments[ loc.start.offset ] = {
text: text,
multiline: multiline,
location: loc,
};
}
retu... | [
"function",
"addComment",
"(",
"text",
",",
"multiline",
")",
"{",
"if",
"(",
"options",
".",
"extractComments",
")",
"{",
"const",
"loc",
"=",
"location",
"(",
")",
";",
"comments",
"[",
"loc",
".",
"start",
".",
"offset",
"]",
"=",
"{",
"text",
":"... | Helper that collects all the comments to pass to the Grammar AST | [
"Helper",
"that",
"collects",
"all",
"the",
"comments",
"to",
"pass",
"to",
"the",
"Grammar",
"AST"
] | 30f32600084d8da6a50b801edad49619e53e2a05 | https://github.com/pegjs/pegjs/blob/30f32600084d8da6a50b801edad49619e53e2a05/packages/pegjs/lib/parser.js#L3438-L3454 |
10,894 | pegjs/pegjs | packages/pegjs/lib/compiler/passes/report-duplicate-rules.js | reportDuplicateRules | function reportDuplicateRules( ast, session ) {
const rules = {};
const check = session.buildVisitor( {
rule( node ) {
const name = node.name;
if ( __hasOwnProperty.call( rules, name ) ) {
const start = rules[ name ].start;
session.error(
... | javascript | function reportDuplicateRules( ast, session ) {
const rules = {};
const check = session.buildVisitor( {
rule( node ) {
const name = node.name;
if ( __hasOwnProperty.call( rules, name ) ) {
const start = rules[ name ].start;
session.error(
... | [
"function",
"reportDuplicateRules",
"(",
"ast",
",",
"session",
")",
"{",
"const",
"rules",
"=",
"{",
"}",
";",
"const",
"check",
"=",
"session",
".",
"buildVisitor",
"(",
"{",
"rule",
"(",
"node",
")",
"{",
"const",
"name",
"=",
"node",
".",
"name",
... | Checks that each rule is defined only once. | [
"Checks",
"that",
"each",
"rule",
"is",
"defined",
"only",
"once",
"."
] | 30f32600084d8da6a50b801edad49619e53e2a05 | https://github.com/pegjs/pegjs/blob/30f32600084d8da6a50b801edad49619e53e2a05/packages/pegjs/lib/compiler/passes/report-duplicate-rules.js#L6-L33 |
10,895 | pegjs/pegjs | packages/pegjs/lib/compiler/passes/report-unused-rules.js | reportUnusedRules | function reportUnusedRules( ast, session, options ) {
const used = {};
function yes( node ) {
used[ node.name || node ] = true;
}
options.allowedStartRules.forEach( yes );
session.buildVisitor( { rule_ref: yes } )( ast );
ast.rules.forEach( rule => {
if ( used[ rule.name ] ... | javascript | function reportUnusedRules( ast, session, options ) {
const used = {};
function yes( node ) {
used[ node.name || node ] = true;
}
options.allowedStartRules.forEach( yes );
session.buildVisitor( { rule_ref: yes } )( ast );
ast.rules.forEach( rule => {
if ( used[ rule.name ] ... | [
"function",
"reportUnusedRules",
"(",
"ast",
",",
"session",
",",
"options",
")",
"{",
"const",
"used",
"=",
"{",
"}",
";",
"function",
"yes",
"(",
"node",
")",
"{",
"used",
"[",
"node",
".",
"name",
"||",
"node",
"]",
"=",
"true",
";",
"}",
"optio... | Checks that all rules are used. | [
"Checks",
"that",
"all",
"rules",
"are",
"used",
"."
] | 30f32600084d8da6a50b801edad49619e53e2a05 | https://github.com/pegjs/pegjs/blob/30f32600084d8da6a50b801edad49619e53e2a05/packages/pegjs/lib/compiler/passes/report-unused-rules.js#L4-L29 |
10,896 | theturtle32/WebSocket-Node | lib/browser.js | W3CWebSocket | function W3CWebSocket(uri, protocols) {
var native_instance;
if (protocols) {
native_instance = new NativeWebSocket(uri, protocols);
}
else {
native_instance = new NativeWebSocket(uri);
}
/**
* 'native_instance' is an instance of nativeWebSocket (the browser's WebSocket
* class). Since it is an Object i... | javascript | function W3CWebSocket(uri, protocols) {
var native_instance;
if (protocols) {
native_instance = new NativeWebSocket(uri, protocols);
}
else {
native_instance = new NativeWebSocket(uri);
}
/**
* 'native_instance' is an instance of nativeWebSocket (the browser's WebSocket
* class). Since it is an Object i... | [
"function",
"W3CWebSocket",
"(",
"uri",
",",
"protocols",
")",
"{",
"var",
"native_instance",
";",
"if",
"(",
"protocols",
")",
"{",
"native_instance",
"=",
"new",
"NativeWebSocket",
"(",
"uri",
",",
"protocols",
")",
";",
"}",
"else",
"{",
"native_instance"... | Expose a W3C WebSocket class with just one or two arguments. | [
"Expose",
"a",
"W3C",
"WebSocket",
"class",
"with",
"just",
"one",
"or",
"two",
"arguments",
"."
] | e109ba6b2c4d2bcf4b0f4c0aa7a60855a3cf0c12 | https://github.com/theturtle32/WebSocket-Node/blob/e109ba6b2c4d2bcf4b0f4c0aa7a60855a3cf0c12/lib/browser.js#L9-L27 |
10,897 | theturtle32/WebSocket-Node | lib/WebSocketFrame.js | WebSocketFrame | function WebSocketFrame(maskBytes, frameHeader, config) {
this.maskBytes = maskBytes;
this.frameHeader = frameHeader;
this.config = config;
this.maxReceivedFrameSize = config.maxReceivedFrameSize;
this.protocolError = false;
this.frameTooLarge = false;
this.invalidCloseFrameLength = false;
... | javascript | function WebSocketFrame(maskBytes, frameHeader, config) {
this.maskBytes = maskBytes;
this.frameHeader = frameHeader;
this.config = config;
this.maxReceivedFrameSize = config.maxReceivedFrameSize;
this.protocolError = false;
this.frameTooLarge = false;
this.invalidCloseFrameLength = false;
... | [
"function",
"WebSocketFrame",
"(",
"maskBytes",
",",
"frameHeader",
",",
"config",
")",
"{",
"this",
".",
"maskBytes",
"=",
"maskBytes",
";",
"this",
".",
"frameHeader",
"=",
"frameHeader",
";",
"this",
".",
"config",
"=",
"config",
";",
"this",
".",
"maxR... | WebSocketConnection will pass shared buffer objects for maskBytes and frameHeader into the constructor to avoid tons of small memory allocations for each frame we have to parse. This is only used for parsing frames we receive off the wire. | [
"WebSocketConnection",
"will",
"pass",
"shared",
"buffer",
"objects",
"for",
"maskBytes",
"and",
"frameHeader",
"into",
"the",
"constructor",
"to",
"avoid",
"tons",
"of",
"small",
"memory",
"allocations",
"for",
"each",
"frame",
"we",
"have",
"to",
"parse",
".",... | e109ba6b2c4d2bcf4b0f4c0aa7a60855a3cf0c12 | https://github.com/theturtle32/WebSocket-Node/blob/e109ba6b2c4d2bcf4b0f4c0aa7a60855a3cf0c12/lib/WebSocketFrame.js#L31-L41 |
10,898 | AlloyTeam/AlloyTouch | example/threejs/asset/three.js | function() {
var EPS = 0.000001;
this.phi = Math.max( EPS, Math.min( Math.PI - EPS, this.phi ) );
return this;
} | javascript | function() {
var EPS = 0.000001;
this.phi = Math.max( EPS, Math.min( Math.PI - EPS, this.phi ) );
return this;
} | [
"function",
"(",
")",
"{",
"var",
"EPS",
"=",
"0.000001",
";",
"this",
".",
"phi",
"=",
"Math",
".",
"max",
"(",
"EPS",
",",
"Math",
".",
"min",
"(",
"Math",
".",
"PI",
"-",
"EPS",
",",
"this",
".",
"phi",
")",
")",
";",
"return",
"this",
";"... | restrict phi to be betwee EPS and PI-EPS | [
"restrict",
"phi",
"to",
"be",
"betwee",
"EPS",
"and",
"PI",
"-",
"EPS"
] | 4f93a9232a817bd2bfdcc67b46748dc423a2f3ed | https://github.com/AlloyTeam/AlloyTouch/blob/4f93a9232a817bd2bfdcc67b46748dc423a2f3ed/example/threejs/asset/three.js#L6926-L6933 | |
10,899 | AlloyTeam/AlloyTouch | example/threejs/asset/three.js | extractFromCache | function extractFromCache ( cache ) {
var values = [];
for ( var key in cache ) {
var data = cache[ key ];
delete data.metadata;
values.push( data );
}
return values;
} | javascript | function extractFromCache ( cache ) {
var values = [];
for ( var key in cache ) {
var data = cache[ key ];
delete data.metadata;
values.push( data );
}
return values;
} | [
"function",
"extractFromCache",
"(",
"cache",
")",
"{",
"var",
"values",
"=",
"[",
"]",
";",
"for",
"(",
"var",
"key",
"in",
"cache",
")",
"{",
"var",
"data",
"=",
"cache",
"[",
"key",
"]",
";",
"delete",
"data",
".",
"metadata",
";",
"values",
"."... | extract data from the cache hash remove metadata on each item and return as array | [
"extract",
"data",
"from",
"the",
"cache",
"hash",
"remove",
"metadata",
"on",
"each",
"item",
"and",
"return",
"as",
"array"
] | 4f93a9232a817bd2bfdcc67b46748dc423a2f3ed | https://github.com/AlloyTeam/AlloyTouch/blob/4f93a9232a817bd2bfdcc67b46748dc423a2f3ed/example/threejs/asset/three.js#L9101-L9113 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.