This commit is contained in:
jonasengelmann 2022-04-01 11:14:55 +02:00
commit eca51850e2
10 changed files with 1015 additions and 1008 deletions

View File

@ -13,6 +13,8 @@ OPENSEADRAGON CHANGELOG
* Fixed: Setting useCanvas to false would break the viewer (#2116 @rvv-bouvet)
* Allow silencing multi-image warnings on viewport coordinate conversion functions (#2120 @claycoleman)
* Fixed: Swiping fast multiple times made contact points in MouseTracker out of sync for touch events (#2121 @ronnymikalsen)
* Made MouseTracker more robust in certain scenarios (#2134 @Aiosa)
* Exposed TiledImage's private functions for better maintainability (#2134 @Aiosa)
3.0.0:

View File

@ -43,7 +43,8 @@
* @param {String} [options.loadWithAjax] - Whether to load this image with AJAX.
* @param {String} [options.ajaxHeaders] - Headers to add to the image request if using AJAX.
* @param {String} [options.crossOriginPolicy] - CORS policy to use for downloads
* @param {String} [options.postData] - HTTP POST data in k=v&k2=v2... form or null
* @param {String} [options.postData] - HTTP POST data (usually but not necessarily in k=v&k2=v2... form,
* see TileSrouce::getPostData) or null
* @param {Function} [options.callback] - Called once image has been downloaded.
* @param {Function} [options.abort] - Called when this image job is aborted.
* @param {Number} [options.timeout] - The max number of milliseconds that this image job may take to complete.
@ -198,7 +199,8 @@ $.ImageLoader.prototype = {
* @param {String} [options.loadWithAjax] - Whether to load this image with AJAX.
* @param {String} [options.ajaxHeaders] - Headers to add to the image request if using AJAX.
* @param {String|Boolean} [options.crossOriginPolicy] - CORS policy to use for downloads
* @param {String} [options.postData] - POST parameters in k=v&k2=v2... form or null
* @param {String} [options.postData] - POST parameters (usually but not necessarily in k=v&k2=v2... form,
* see TileSrouce::getPostData) or null
* @param {Boolean} [options.ajaxWithCredentials] - Whether to set withCredentials on AJAX
* requests.
* @param {Function} [options.callback] - Called once image has been downloaded.

View File

@ -3286,13 +3286,12 @@
gPoint = updateGPoint;
} else {
// Initialize for tracking and add to the tracking list (no pointerenter event occurred before this)
$.console.warn('pointerdown event on untracked pointer');
// NOTE: pointerdown event on untracked pointer
gPoint.captured = false; // Handled by updatePointerCaptured()
gPoint.insideElementPressed = true;
gPoint.insideElement = true;
gPoint.originalTarget = eventInfo.originalEvent.target;
startTrackingPointer( pointsList, gPoint );
return;
}
pointsList.addContact();
@ -3436,8 +3435,8 @@
releasePoint = updateGPoint.currentPos;
releaseTime = updateGPoint.currentTime;
} else {
// should never get here...we'll start to track pointer anyway
$.console.warn('updatePointerUp(): pointerup on untracked gPoint');
// NOTE: updatePointerUp(): pointerup on untracked gPoint
// ...we'll start to track pointer again
gPoint.captured = false; // Handled by updatePointerCaptured()
gPoint.insideElementPressed = false;
gPoint.insideElement = true;
@ -3460,7 +3459,7 @@
if ( pointsList.contacts === 0 ) {
// Release (pressed in our element)
if ( tracker.releaseHandler ) {
if ( tracker.releaseHandler && releasePoint ) {
tracker.releaseHandler(
{
eventSource: tracker,

View File

@ -665,13 +665,18 @@
*
* @property {Boolean} [splitHashDataForPost=false]
* Allows to treat _first_ hash ('#') symbol as a separator for POST data:
* URL to be opened by a {@link OpenSeadragon.TileSource} can thus look like: http://some.url#postdata=here .
* The URL is split to 'http://some.url' and 'postdata=here'; post data is given to the
* {@link OpenSeadragon.TileSource} of the choice and can be further used within tile requests
* (see TileSource methods). {@link OpenSeadragon.TileSource.prototype.configure} return value
* should contain the post data so that it is given to its subclass in the constructor.
* NOTE: post data is expected to be ampersand-separated (just like GET parameters), and is not used
* to fetch tile image data if loadTilesWithAjax=false (but it is still used for the initial request).
* URL to be opened by a {@link OpenSeadragon.TileSource} can thus look like: http://some.url#postdata=here.
* The whole URL is used to fetch image info metadata and it is then split to 'http://some.url' and
* 'postdata=here'; post data is given to the {@link OpenSeadragon.TileSource} of the choice and can be further
* used within tile requests (see TileSource methods).
* NOTE: {@link OpenSeadragon.TileSource.prototype.configure} return value should contain the post data
* if you want to use it later - so that it is given to your constructor later.
* NOTE: usually, post data is expected to be ampersand-separated (just like GET parameters), and is NOT USED
* to fetch tile image data unless explicitly programmed, or if loadTilesWithAjax=false 4
* (but it is still used for the initial image info request).
* NOTE: passing POST data from URL by this feature only supports string values, however,
* TileSource can send any data using POST as long as the header is correct
* (@see OpenSeadragon.TileSource.prototype.getTilePostData)
*/
/**
@ -2315,7 +2320,8 @@ function OpenSeadragon( options ){
* @param {Function} options.error - a function to call on when an error occurs
* @param {Object} options.headers - headers to add to the AJAX request
* @param {String} options.responseType - the response type of the the AJAX request
* @param {String} options.postData - HTTP POST data in k=v&k2=v2... form, GET method used if null
* @param {String} options.postData - HTTP POST data (usually but not necessarily in k=v&k2=v2... form,
* see TileSrouce::getPostData), GET method used if null
* @param {Boolean} [options.withCredentials=false] - whether to set the XHR's withCredentials
* @throws {Error}
* @returns {XMLHttpRequest}

View File

@ -50,9 +50,10 @@
* @param {Boolean} loadWithAjax Whether this tile image should be loaded with an AJAX request .
* @param {Object} ajaxHeaders The headers to send with this tile's AJAX request (if applicable).
* @param {OpenSeadragon.Rect} sourceBounds The portion of the tile to use as the source of the
* @param {String} postData HTTP POST data in k=v&k2=v2... form or null
* drawing operation, in pixels. Note that this only works when drawing with canvas; when drawing
* with HTML the entire tile is always used.
* @param {String} postData HTTP POST data (usually but not necessarily in k=v&k2=v2... form,
* see TileSrouce::getPostData) or null
*/
$.Tile = function(level, x, y, bounds, exists, url, context2D, loadWithAjax, ajaxHeaders, sourceBounds, postData) {
/**
@ -101,7 +102,8 @@ $.Tile = function(level, x, y, bounds, exists, url, context2D, loadWithAjax, aja
/**
* Post parameters for this tile. Either it is an URL-encoded string
* in k1=v1&k2=v2... format or null
* @member {String} postData HTTP POST data in k=v&k2=v2... form or null
* @member {String} postData HTTP POST data (usually but not necessarily in k=v&k2=v2... form,
* see TileSrouce::getPostData) or null
* @memberof OpenSeadragon.Tile#
*/
this.postData = postData;

File diff suppressed because it is too large Load Diff

View File

@ -550,7 +550,8 @@ $.TileSource.prototype = {
* @property {OpenSeadragon.TileSource} eventSource - A reference to the TileSource which raised the event.
* @property {String} message
* @property {String} source
* @property {String} postData - HTTP POST data in k=v&k2=v2... form or null
* @property {String} postData - HTTP POST data (usually but not necessarily in k=v&k2=v2... form,
* see TileSrouce::getPostData) or null
* @property {?Object} userData - Arbitrary subscriber-defined object.
*/
_this.raiseEvent( 'open-failed', {
@ -623,13 +624,26 @@ $.TileSource.prototype = {
/**
* Must use AJAX in order to work, i.e. loadTilesWithAjax = true is set.
* It should return url-encoded string with the following structure:
* key=value&key2=value2...
* or null in case GET is used instead.
* If a value is returned, ajax issues POST request to the tile url.
* If null is returned, ajax issues GET request.
* The return value must comply to the header 'content type'.
*
* Examples (USED HEADER --> getTilePostData CODE):
* 'Content-type': 'application/x-www-form-urlencoded' -->
* return "key1=value=1&key2=value2";
*
* 'Content-type': 'application/x-www-form-urlencoded' -->
* return JSON.stringify({key: "value", number: 5});
*
* 'Content-type': 'multipart/form-data' -->
* let result = new FormData();
* result.append("data", myData);
* return result;
* @param level
* @param x
* @param y
* @return {string || null} post data to send with tile configuration request
* @return {* || null} post data to send with tile configuration request
*/
getTilePostData: function( level, x, y ) {
return null;

View File

@ -58,7 +58,7 @@
assert.equal($(".openseadragon-message").length, 1, "Open failures should display a message");
assert.ok(testLog.log.contains('["AJAX request returned %d: %s",404,"/test/data/not-a-real-file"]'),
assert.ok(testLog.error.contains('["AJAX request returned %d: %s",404,"/test/data/not-a-real-file"]'),
"AJAX failures should be logged to the console");
done();

View File

@ -425,7 +425,7 @@
clickCount: 2,
dblClickCount: 1,
dragCount: 0,
dragEndCount: 2, // v2.5.0+ drag-end event now fired even if pointer didn't move (#1459)
dragEndCount: 0, // drag-end event no longer fired if pointer didn't move (#2064)
insideElementPressed: true,
insideElementReleased: true,
contacts: 0,
@ -453,7 +453,7 @@
clickCount: 1,
dblClickCount: 0,
dragCount: 0,
dragEndCount: 1, // v2.5.0+ drag-end event now fired even if pointer didn't move (#1459)
dragEndCount: 0, // drag-end event no longer fired if pointer didn't move (#2064)
insideElementPressed: true,
insideElementReleased: true,
contacts: 0,

View File

@ -22,11 +22,11 @@
QUnit.test("getInvalidString", function(assert) {
assert.equal(OpenSeadragon.getString("Greeting"), "", "Handled unset string key");
assert.ok(testLog.log.contains('["Untranslated source string:","Greeting"]'),
assert.ok(testLog.error.contains('["Untranslated source string:","Greeting"]'),
'Invalid string keys are logged');
assert.equal(OpenSeadragon.getString("Errors"), "", "Handled requesting parent key");
assert.ok(testLog.log.contains('["Untranslated source string:","Errors"]'),
assert.ok(testLog.error.contains('["Untranslated source string:","Errors"]'),
'Invalid string parent keys are logged');
});