Merge pull request #826 from avandecreme/doc

Fix @lends for new JSDoc. Fix polymorphic functions doc (#824).
This commit is contained in:
Ian Gilman 2016-01-26 09:05:21 -08:00
commit a1b7a5414c
16 changed files with 59 additions and 43 deletions

View File

@ -108,7 +108,8 @@ $.ButtonGroup = function( options ) {
}); });
}; };
$.ButtonGroup.prototype = /** @lends OpenSeadragon.ButtonGroup.prototype */{ /** @lends OpenSeadragon.ButtonGroup.prototype */
$.ButtonGroup.prototype = {
/** /**
* TODO: Figure out why this is used on the public API and if a more useful * TODO: Figure out why this is used on the public API and if a more useful

View File

@ -152,7 +152,8 @@ $.Control = function ( element, options, container ) {
} }
}; };
$.Control.prototype = /** @lends OpenSeadragon.Control.prototype */{ /** @lends OpenSeadragon.Control.prototype */
$.Control.prototype = {
/** /**
* Removes the control from the container. * Removes the control from the container.

View File

@ -88,7 +88,8 @@
this.container.appendChild( this.controls.bottomleft ); this.container.appendChild( this.controls.bottomleft );
}; };
$.ControlDock.prototype = /** @lends OpenSeadragon.ControlDock.prototype */{ /** @lends OpenSeadragon.ControlDock.prototype */
$.ControlDock.prototype = {
/** /**
* @function * @function

View File

@ -132,7 +132,8 @@ $.Drawer = function( options ) {
this.container.appendChild( this.canvas ); this.container.appendChild( this.canvas );
}; };
$.Drawer.prototype = /** @lends OpenSeadragon.Drawer.prototype */{ /** @lends OpenSeadragon.Drawer.prototype */
$.Drawer.prototype = {
// deprecated // deprecated
addOverlay: function( element, location, placement, onDraw ) { addOverlay: function( element, location, placement, onDraw ) {
$.console.error("drawer.addOverlay is deprecated. Use viewer.addOverlay instead."); $.console.error("drawer.addOverlay is deprecated. Use viewer.addOverlay instead.");

View File

@ -53,7 +53,8 @@ $.EventSource = function() {
this.events = {}; this.events = {};
}; };
$.EventSource.prototype = /** @lends OpenSeadragon.EventSource.prototype */{ /** @lends OpenSeadragon.EventSource.prototype */
$.EventSource.prototype = {
// TODO: Add a method 'one' which automatically unbinds a listener after the first triggered event that matches. // TODO: Add a method 'one' which automatically unbinds a listener after the first triggered event that matches.

View File

@ -110,7 +110,8 @@ $.ImageLoader = function( options ) {
}; };
$.ImageLoader.prototype = /** @lends OpenSeadragon.ImageLoader.prototype */{ /** @lends OpenSeadragon.ImageLoader.prototype */
$.ImageLoader.prototype = {
/** /**
* Add an unloaded image to the loader queue. * Add an unloaded image to the loader queue.

View File

@ -265,7 +265,8 @@
} }
}; };
$.MouseTracker.prototype = /** @lends OpenSeadragon.MouseTracker.prototype */{ /** @lends OpenSeadragon.MouseTracker.prototype */
$.MouseTracker.prototype = {
/** /**
* Clean up any events or objects created by the tracker. * Clean up any events or objects created by the tracker.
@ -1117,7 +1118,9 @@
*/ */
this.captureCount = 0; this.captureCount = 0;
}; };
$.MouseTracker.GesturePointList.prototype = /** @lends OpenSeadragon.MouseTracker.GesturePointList.prototype */{
/** @lends OpenSeadragon.MouseTracker.GesturePointList.prototype */
$.MouseTracker.GesturePointList.prototype = {
/** /**
* @function * @function
* @returns {Number} Number of gesture points in the list. * @returns {Number} Number of gesture points in the list.

View File

@ -133,7 +133,8 @@
true : options.checkResize; true : options.checkResize;
}; };
$.Overlay.prototype = /** @lends OpenSeadragon.Overlay.prototype */{ /** @lends OpenSeadragon.Overlay.prototype */
$.Overlay.prototype = {
/** /**
* @function * @function

View File

@ -59,7 +59,8 @@ $.Point = function( x, y ) {
this.y = typeof ( y ) == "number" ? y : 0; this.y = typeof ( y ) == "number" ? y : 0;
}; };
$.Point.prototype = /** @lends OpenSeadragon.Point.prototype */{ /** @lends OpenSeadragon.Point.prototype */
$.Point.prototype = {
/** /**
* @function * @function
* @returns {OpenSeadragon.Point} a duplicate of this Point * @returns {OpenSeadragon.Point} a duplicate of this Point

View File

@ -68,7 +68,8 @@ $.Profiler = function() {
this.maxIdleTime = 0; this.maxIdleTime = 0;
}; };
$.Profiler.prototype = /** @lends OpenSeadragon.Profiler.prototype */{ /** @lends OpenSeadragon.Profiler.prototype */
$.Profiler.prototype = {
/** /**
* @function * @function

View File

@ -110,7 +110,8 @@ $.Rect = function(x, y, width, height, degrees) {
} }
}; };
$.Rect.prototype = /** @lends OpenSeadragon.Rect.prototype */{ /** @lends OpenSeadragon.Rect.prototype */
$.Rect.prototype = {
/** /**
* @function * @function
* @returns {OpenSeadragon.Rect} a duplicate of this Rect * @returns {OpenSeadragon.Rect} a duplicate of this Rect
@ -318,7 +319,7 @@ $.Rect.prototype = /** @lends OpenSeadragon.Rect.prototype */{
/** /**
* Retrieves the smallest horizontal (degrees=0) rectangle which contains * Retrieves the smallest horizontal (degrees=0) rectangle which contains
* this rectangle. * this rectangle.
* @returns {OpenSeadrayon.Rect} * @returns {OpenSeadragon.Rect}
*/ */
getBoundingBox: function() { getBoundingBox: function() {
if (this.degrees === 0) { if (this.degrees === 0) {

View File

@ -134,7 +134,8 @@ $.Spring = function( options ) {
} }
}; };
$.Spring.prototype = /** @lends OpenSeadragon.Spring.prototype */{ /** @lends OpenSeadragon.Spring.prototype */
$.Spring.prototype = {
/** /**
* @function * @function

View File

@ -180,7 +180,8 @@ $.Tile = function(level, x, y, bounds, exists, url, context2D) {
this.lastTouchTime = 0; this.lastTouchTime = 0;
}; };
$.Tile.prototype = /** @lends OpenSeadragon.Tile.prototype */{ /** @lends OpenSeadragon.Tile.prototype */
$.Tile.prototype = {
/** /**
* Provides a string representation of this tiles level and (x,y) * Provides a string representation of this tiles level and (x,y)

View File

@ -122,7 +122,8 @@ $.TileCache = function( options ) {
this._imagesLoadedCount = 0; this._imagesLoadedCount = 0;
}; };
$.TileCache.prototype = /** @lends OpenSeadragon.TileCache.prototype */{ /** @lends OpenSeadragon.TileCache.prototype */
$.TileCache.prototype = {
/** /**
* @returns {Number} The total number of tiles that have been loaded by * @returns {Number} The total number of tiles that have been loaded by
* this TileCache. * this TileCache.

View File

@ -230,8 +230,8 @@ $.TileSource = function( width, height, tileSize, tileOverlap, minLevel, maxLeve
}; };
/** @lends OpenSeadragon.TileSource.prototype */
$.TileSource.prototype = /** @lends OpenSeadragon.TileSource.prototype */{ $.TileSource.prototype = {
getTileSize: function( level ) { getTileSize: function( level ) {
$.console.error( $.console.error(

View File

@ -144,7 +144,8 @@ $.Viewport = function( options ) {
this.update(); this.update();
}; };
$.Viewport.prototype = /** @lends OpenSeadragon.Viewport.prototype */{ /** @lends OpenSeadragon.Viewport.prototype */
$.Viewport.prototype = {
/** /**
* Updates the viewport's home bounds and constraints for the given content size. * Updates the viewport's home bounds and constraints for the given content size.
* @function * @function
@ -1076,13 +1077,13 @@ $.Viewport.prototype = /** @lends OpenSeadragon.Viewport.prototype */{
* OpenSeadragon.Point * OpenSeadragon.Point
* Note: not accurate with multi-image; use TiledImage.viewportToImageCoordinates instead. * Note: not accurate with multi-image; use TiledImage.viewportToImageCoordinates instead.
* @function * @function
* @param {OpenSeadragon.Point} viewerX the point in viewport coordinate system. * @param {(OpenSeadragon.Point|Number)} viewerX either a point or the X
* @param {Number} viewerX X coordinate in viewport coordinate system. * coordinate in viewport coordinate system.
* @param {Number} viewerY Y coordinate in viewport coordinate system. * @param {Number} [viewerY] Y coordinate in viewport coordinate system.
* @return {OpenSeadragon.Point} a point representing the coordinates in the image. * @return {OpenSeadragon.Point} a point representing the coordinates in the image.
*/ */
viewportToImageCoordinates: function(viewerX, viewerY) { viewportToImageCoordinates: function(viewerX, viewerY) {
if ( arguments.length == 1 ) { if (viewerX instanceof $.Point) {
//they passed a point instead of individual components //they passed a point instead of individual components
return this.viewportToImageCoordinates(viewerX.x, viewerX.y); return this.viewportToImageCoordinates(viewerX.x, viewerX.y);
} }
@ -1107,13 +1108,13 @@ $.Viewport.prototype = /** @lends OpenSeadragon.Viewport.prototype */{
* OpenSeadragon.Point * OpenSeadragon.Point
* Note: not accurate with multi-image; use TiledImage.imageToViewportCoordinates instead. * Note: not accurate with multi-image; use TiledImage.imageToViewportCoordinates instead.
* @function * @function
* @param {OpenSeadragon.Point} imageX the point in image coordinate system. * @param {(OpenSeadragon.Point | Number)} imageX the point or the
* @param {Number} imageX X coordinate in image coordinate system. * X coordinate in image coordinate system.
* @param {Number} imageY Y coordinate in image coordinate system. * @param {Number} [imageY] Y coordinate in image coordinate system.
* @return {OpenSeadragon.Point} a point representing the coordinates in the viewport. * @return {OpenSeadragon.Point} a point representing the coordinates in the viewport.
*/ */
imageToViewportCoordinates: function(imageX, imageY) { imageToViewportCoordinates: function(imageX, imageY) {
if ( arguments.length == 1 ) { if (imageX instanceof $.Point) {
//they passed a point instead of individual components //they passed a point instead of individual components
return this.imageToViewportCoordinates(imageX.x, imageX.y); return this.imageToViewportCoordinates(imageX.x, imageX.y);
} }
@ -1135,13 +1136,12 @@ $.Viewport.prototype = /** @lends OpenSeadragon.Viewport.prototype */{
* OpenSeadragon.Rect * OpenSeadragon.Rect
* Note: not accurate with multi-image; use TiledImage.imageToViewportRectangle instead. * Note: not accurate with multi-image; use TiledImage.imageToViewportRectangle instead.
* @function * @function
* @param {OpenSeadragon.Rect} imageX the rectangle in image coordinate system. * @param {(OpenSeadragon.Rect | Number)} imageX the rectangle or the X
* @param {Number} imageX the X coordinate of the top left corner of the rectangle * coordinate of the top left corner of the rectangle in image coordinate system.
* @param {Number} [imageY] the Y coordinate of the top left corner of the rectangle
* in image coordinate system. * in image coordinate system.
* @param {Number} imageY the Y coordinate of the top left corner of the rectangle * @param {Number} [pixelWidth] the width in pixel of the rectangle.
* in image coordinate system. * @param {Number} [pixelHeight] the height in pixel of the rectangle.
* @param {Number} pixelWidth the width in pixel of the rectangle.
* @param {Number} pixelHeight the height in pixel of the rectangle.
*/ */
imageToViewportRectangle: function(imageX, imageY, pixelWidth, pixelHeight) { imageToViewportRectangle: function(imageX, imageY, pixelWidth, pixelHeight) {
var rect = imageX; var rect = imageX;
@ -1168,13 +1168,13 @@ $.Viewport.prototype = /** @lends OpenSeadragon.Viewport.prototype */{
* OpenSeadragon.Rect * OpenSeadragon.Rect
* Note: not accurate with multi-image; use TiledImage.viewportToImageRectangle instead. * Note: not accurate with multi-image; use TiledImage.viewportToImageRectangle instead.
* @function * @function
* @param {OpenSeadragon.Rect} viewerX the rectangle in viewport coordinate system. * @param {(OpenSeadragon.Rect | Number)} viewerX either a rectangle or
* @param {Number} viewerX the X coordinate of the top left corner of the rectangle * the X coordinate of the top left corner of the rectangle in viewport
* coordinate system.
* @param {Number} [viewerY] the Y coordinate of the top left corner of the rectangle
* in viewport coordinate system. * in viewport coordinate system.
* @param {Number} imageY the Y coordinate of the top left corner of the rectangle * @param {Number} [pointWidth] the width of the rectangle in viewport coordinate system.
* in viewport coordinate system. * @param {Number} [pointHeight] the height of the rectangle in viewport coordinate system.
* @param {Number} pointWidth the width of the rectangle in viewport coordinate system.
* @param {Number} pointHeight the height of the rectangle in viewport coordinate system.
*/ */
viewportToImageRectangle: function(viewerX, viewerY, pointWidth, pointHeight) { viewportToImageRectangle: function(viewerX, viewerY, pointWidth, pointHeight) {
var rect = viewerX; var rect = viewerX;