From 12e1869f995eaf4e37a409b0b4c11c3571243d58 Mon Sep 17 00:00:00 2001 From: Rob Hicks Date: Wed, 25 Oct 2017 14:51:17 -0600 Subject: [PATCH 1/3] add clarifications to api docs for TiledImage --- src/tiledimage.js | 4 ++-- src/viewer.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/tiledimage.js b/src/tiledimage.js index bfc67fc8..56ae53db 100644 --- a/src/tiledimage.js +++ b/src/tiledimage.js @@ -35,8 +35,8 @@ (function( $ ){ /** - * You shouldn't have to create a TiledImage directly; use {@link OpenSeadragon.Viewer#open} - * or {@link OpenSeadragon.Viewer#addTiledImage} instead. + * You shouldn't have to create a TiledImage instance directly; get it asynchronously by + * use {@link OpenSeadragon.Viewer#open} or {@link OpenSeadragon.Viewer#addTiledImage} instead. * @class TiledImage * @memberof OpenSeadragon * @extends OpenSeadragon.EventSource diff --git a/src/viewer.js b/src/viewer.js index dc1d7438..6f96a897 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -487,7 +487,9 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, * is the same as the options parameter for {@link OpenSeadragon.Viewer#addTiledImage}, * except for the index property; images are added in sequence. * A TileSource specifier is anything you could pass as the tileSource property - * of the options parameter for {@link OpenSeadragon.Viewer#addTiledImage}. + * of the options parameter for {@link OpenSeadragon.Viewer#addTiledImage}. To get the TiledImage + * instance created by open, add an event listener for {@link OpenSeadragon.Viewer.html#.event:open}, which + * when fired can be used to get access, i.e., viewer.world.getItemAt(0). * @param {Number} initialPage - If sequenceMode is true, display this page initially * for the given tileSources. If specified, will overwrite the Viewer's existing initialPage property. * @return {OpenSeadragon.Viewer} Chainable. @@ -1263,7 +1265,7 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, * requests. * @param {Function} [options.success] A function that gets called when the image is * successfully added. It's passed the event object which contains a single property: - * "item", the resulting TiledImage. + * "item", which is the resulting instance of TiledImage. * @param {Function} [options.error] A function that gets called if the image is * unable to be added. It's passed the error event object, which contains "message" * and "source" properties. From d59e237ddaeee984d15f196dbb77236dc3ec2017 Mon Sep 17 00:00:00 2001 From: Rob Hicks Date: Wed, 25 Oct 2017 14:55:28 -0600 Subject: [PATCH 2/3] more doc tweaks --- src/tiledimage.js | 2 +- src/viewer.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tiledimage.js b/src/tiledimage.js index 56ae53db..aa4ca876 100644 --- a/src/tiledimage.js +++ b/src/tiledimage.js @@ -36,7 +36,7 @@ /** * You shouldn't have to create a TiledImage instance directly; get it asynchronously by - * use {@link OpenSeadragon.Viewer#open} or {@link OpenSeadragon.Viewer#addTiledImage} instead. + * using {@link OpenSeadragon.Viewer#open} or {@link OpenSeadragon.Viewer#addTiledImage} instead. * @class TiledImage * @memberof OpenSeadragon * @extends OpenSeadragon.EventSource diff --git a/src/viewer.js b/src/viewer.js index 6f96a897..272e5fe3 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -489,7 +489,7 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, * A TileSource specifier is anything you could pass as the tileSource property * of the options parameter for {@link OpenSeadragon.Viewer#addTiledImage}. To get the TiledImage * instance created by open, add an event listener for {@link OpenSeadragon.Viewer.html#.event:open}, which - * when fired can be used to get access, i.e., viewer.world.getItemAt(0). + * when fired can be used to get access to the instance, i.e., viewer.world.getItemAt(0). * @param {Number} initialPage - If sequenceMode is true, display this page initially * for the given tileSources. If specified, will overwrite the Viewer's existing initialPage property. * @return {OpenSeadragon.Viewer} Chainable. From 2db5cfeebd00dd903ac7a3bbb3bf6d6915321cf2 Mon Sep 17 00:00:00 2001 From: Rob Hicks Date: Thu, 26 Oct 2017 12:36:30 -0600 Subject: [PATCH 3/3] move TiledImage instance instructions to function description --- src/viewer.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/viewer.js b/src/viewer.js index 272e5fe3..a5c7365a 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -481,15 +481,16 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, /** * Open tiled images into the viewer, closing any others. + * To get the TiledImage instance created by open, add an event listener for + * {@link OpenSeadragon.Viewer.html#.event:open}, which when fired can be used to get access + * to the instance, i.e., viewer.world.getItemAt(0). * @function * @param {Array|String|Object|Function} tileSources - This can be a TiledImage * specifier, a TileSource specifier, or an array of either. A TiledImage specifier * is the same as the options parameter for {@link OpenSeadragon.Viewer#addTiledImage}, * except for the index property; images are added in sequence. * A TileSource specifier is anything you could pass as the tileSource property - * of the options parameter for {@link OpenSeadragon.Viewer#addTiledImage}. To get the TiledImage - * instance created by open, add an event listener for {@link OpenSeadragon.Viewer.html#.event:open}, which - * when fired can be used to get access to the instance, i.e., viewer.world.getItemAt(0). + * of the options parameter for {@link OpenSeadragon.Viewer#addTiledImage}. * @param {Number} initialPage - If sequenceMode is true, display this page initially * for the given tileSources. If specified, will overwrite the Viewer's existing initialPage property. * @return {OpenSeadragon.Viewer} Chainable.