Fix @lends for new JSDoc. Fix polymorphic functions doc (#824).

This commit is contained in:
Antoine Vandecreme 2016-01-24 16:09:18 -05:00
parent 8d453b5755
commit a12b74ec17
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

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.

View File

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

View File

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

View File

@ -53,7 +53,8 @@ $.EventSource = function() {
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.

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.

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.
@ -1117,7 +1118,9 @@
*/
this.captureCount = 0;
};
$.MouseTracker.GesturePointList.prototype = /** @lends OpenSeadragon.MouseTracker.GesturePointList.prototype */{
/** @lends OpenSeadragon.MouseTracker.GesturePointList.prototype */
$.MouseTracker.GesturePointList.prototype = {
/**
* @function
* @returns {Number} Number of gesture points in the list.

View File

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

View File

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

View File

@ -68,7 +68,8 @@ $.Profiler = function() {
this.maxIdleTime = 0;
};
$.Profiler.prototype = /** @lends OpenSeadragon.Profiler.prototype */{
/** @lends OpenSeadragon.Profiler.prototype */
$.Profiler.prototype = {
/**
* @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
* @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
* this rectangle.
* @returns {OpenSeadrayon.Rect}
* @returns {OpenSeadragon.Rect}
*/
getBoundingBox: function() {
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

View File

@ -180,7 +180,8 @@ $.Tile = function(level, x, y, bounds, exists, url, context2D) {
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)

View File

@ -122,7 +122,8 @@ $.TileCache = function( options ) {
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
* this TileCache.

View File

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

View File

@ -144,7 +144,8 @@ $.Viewport = function( options ) {
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.
* @function
@ -1076,13 +1077,13 @@ $.Viewport.prototype = /** @lends OpenSeadragon.Viewport.prototype */{
* OpenSeadragon.Point
* Note: not accurate with multi-image; use TiledImage.viewportToImageCoordinates instead.
* @function
* @param {OpenSeadragon.Point} viewerX the point in viewport coordinate system.
* @param {Number} viewerX X coordinate in viewport coordinate system.
* @param {Number} viewerY Y coordinate in viewport coordinate system.
* @param {(OpenSeadragon.Point|Number)} viewerX either a point or the X
* 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.
*/
viewportToImageCoordinates: function(viewerX, viewerY) {
if ( arguments.length == 1 ) {
if (viewerX instanceof $.Point) {
//they passed a point instead of individual components
return this.viewportToImageCoordinates(viewerX.x, viewerX.y);
}
@ -1107,13 +1108,13 @@ $.Viewport.prototype = /** @lends OpenSeadragon.Viewport.prototype */{
* OpenSeadragon.Point
* Note: not accurate with multi-image; use TiledImage.imageToViewportCoordinates instead.
* @function
* @param {OpenSeadragon.Point} imageX the point in image coordinate system.
* @param {Number} imageX X coordinate in image coordinate system.
* @param {Number} imageY Y coordinate in image coordinate system.
* @param {(OpenSeadragon.Point | Number)} imageX the point or the
* X 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.
*/
imageToViewportCoordinates: function(imageX, imageY) {
if ( arguments.length == 1 ) {
if (imageX instanceof $.Point) {
//they passed a point instead of individual components
return this.imageToViewportCoordinates(imageX.x, imageX.y);
}
@ -1135,13 +1136,12 @@ $.Viewport.prototype = /** @lends OpenSeadragon.Viewport.prototype */{
* OpenSeadragon.Rect
* Note: not accurate with multi-image; use TiledImage.imageToViewportRectangle instead.
* @function
* @param {OpenSeadragon.Rect} imageX the rectangle in image coordinate system.
* @param {Number} imageX the X coordinate of the top left corner of the rectangle
* @param {(OpenSeadragon.Rect | Number)} imageX the rectangle or the X
* 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.
* @param {Number} imageY the Y coordinate of the top left corner of the rectangle
* in image coordinate system.
* @param {Number} pixelWidth the width in pixel of the rectangle.
* @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) {
var rect = imageX;
@ -1168,13 +1168,13 @@ $.Viewport.prototype = /** @lends OpenSeadragon.Viewport.prototype */{
* OpenSeadragon.Rect
* Note: not accurate with multi-image; use TiledImage.viewportToImageRectangle instead.
* @function
* @param {OpenSeadragon.Rect} viewerX the rectangle in viewport coordinate system.
* @param {Number} viewerX the X coordinate of the top left corner of the rectangle
* @param {(OpenSeadragon.Rect | Number)} viewerX either a rectangle or
* 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.
* @param {Number} imageY the Y coordinate of the top left corner 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.
* @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) {
var rect = viewerX;