mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-21 20:56:09 +03:00
clean up tests
This commit is contained in:
parent
f3a90159c1
commit
58f918aaa1
@ -101,6 +101,24 @@ class CanvasDrawer extends $.DrawerBase{
|
||||
this._drawTiles(tiledImage);
|
||||
}
|
||||
}
|
||||
|
||||
// // Fire the frame-drawn event.
|
||||
// if( this.viewer ){
|
||||
// /**
|
||||
// * Raised when a tiled image is drawn to the canvas. Only valid
|
||||
// * for webgl and canvas drawers.
|
||||
// *
|
||||
// * @event tiled-image-drawn
|
||||
// * @memberof OpenSeadragon.Viewer
|
||||
// * @type {object}
|
||||
// * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.
|
||||
// * @property {HTMLElement} canvas - The canvas which has been drawn onto
|
||||
// * @property {?Object} userData - Arbitrary subscriber-defined object.
|
||||
// */
|
||||
// this.viewer.raiseEvent( 'frame-drawn', {
|
||||
// canvas: this.canvas
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -380,6 +380,24 @@
|
||||
this._outputContext.drawImage(this._renderingCanvas, 0, 0);
|
||||
}
|
||||
|
||||
// // Fire the frame-drawn event.
|
||||
// if( this.viewer ){
|
||||
// /**
|
||||
// * Raised when a tiled image is drawn to the canvas. Only valid
|
||||
// * for webgl and canvas drawers.
|
||||
// *
|
||||
// * @event tiled-image-drawn
|
||||
// * @memberof OpenSeadragon.Viewer
|
||||
// * @type {object}
|
||||
// * @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.
|
||||
// * @property {HTMLElement} canvas - The canvas which has been drawn onto
|
||||
// * @property {?Object} userData - Arbitrary subscriber-defined object.
|
||||
// */
|
||||
// this.viewer.raiseEvent( 'frame-drawn', {
|
||||
// canvas: this.canvas
|
||||
// });
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
// Public API required by all Drawer implementations
|
||||
|
@ -20,16 +20,6 @@
|
||||
<div id="contentDiv" class="openseadragon1"></div>
|
||||
<script type="text/javascript">
|
||||
|
||||
const url = new URL(window.location.href);
|
||||
let drawer = url.searchParams.get("drawer");
|
||||
if (!drawer) {
|
||||
drawer = 'canvas';
|
||||
url.searchParams.set('drawer', drawer);
|
||||
if ("undefined" !== typeof history.replaceState) {
|
||||
history.replaceState(null, window.location.title, url.toString());
|
||||
}
|
||||
}
|
||||
|
||||
var viewer = OpenSeadragon({
|
||||
// debugMode: true,
|
||||
id: "contentDiv",
|
||||
|
@ -131,7 +131,8 @@
|
||||
var box = new OpenSeadragon.Rect(margins.left, margins.top,
|
||||
$('#contentDiv').width() - (margins.left + margins.right),
|
||||
$('#contentDiv').height() - (margins.top + margins.bottom));
|
||||
// if drawDebuggingRect is implemented, use it to show the box
|
||||
// If drawDebuggingRect is implemented, use it to show the box.
|
||||
// This is not implemented by all drawers however.
|
||||
self.viewer.drawer.drawDebuggingRect(box);
|
||||
});
|
||||
}
|
||||
|
@ -80,12 +80,12 @@
|
||||
// The changeover will look better if we wait for the first tile to be drawn.
|
||||
var tileDrawnHandler = function(event) {
|
||||
if (event.tiledImage === fullImage) {
|
||||
viewer.removeHandler('tiled-image-drawn', tileDrawnHandler);
|
||||
viewer.removeHandler('update-viewport', tileDrawnHandler);
|
||||
viewer.world.removeItem(standin);
|
||||
}
|
||||
};
|
||||
|
||||
viewer.addHandler('tiled-image-drawn', tileDrawnHandler);
|
||||
viewer.addHandler('update-viewport', tileDrawnHandler);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -53,10 +53,7 @@
|
||||
});
|
||||
},
|
||||
afterEach: function() {
|
||||
if (viewer && viewer.close) {
|
||||
viewer.close();
|
||||
}
|
||||
if (viewer && viewer.destroy){
|
||||
if (viewer){
|
||||
viewer.destroy();
|
||||
}
|
||||
|
||||
|
@ -16,10 +16,7 @@
|
||||
});
|
||||
},
|
||||
afterEach: function () {
|
||||
if (viewer && viewer.close) {
|
||||
viewer.close();
|
||||
}
|
||||
if (viewer && viewer.destroy){
|
||||
if (viewer){
|
||||
viewer.destroy();
|
||||
}
|
||||
|
||||
|
3
test/modules/controls.js
vendored
3
test/modules/controls.js
vendored
@ -19,9 +19,6 @@
|
||||
if (viewer && viewer.close) {
|
||||
viewer.close();
|
||||
}
|
||||
// if (viewer && viewer.destroy){
|
||||
// viewer.destroy();
|
||||
// }
|
||||
|
||||
viewer = null;
|
||||
}
|
||||
|
@ -10,10 +10,7 @@
|
||||
testLog.reset();
|
||||
},
|
||||
afterEach: function () {
|
||||
if (viewer && viewer.close) {
|
||||
viewer.close();
|
||||
}
|
||||
if (viewer && viewer.destroy){
|
||||
if (viewer){
|
||||
viewer.destroy();
|
||||
}
|
||||
viewer = null;
|
||||
|
@ -17,10 +17,7 @@
|
||||
} );
|
||||
},
|
||||
afterEach: function () {
|
||||
if ( viewer && viewer.close ) {
|
||||
viewer.close();
|
||||
}
|
||||
if (viewer && viewer.destroy){
|
||||
if (viewer){
|
||||
viewer.destroy();
|
||||
}
|
||||
|
||||
|
@ -14,10 +14,7 @@
|
||||
document.getElementById("qunit-fixture").appendChild(example);
|
||||
},
|
||||
afterEach: function () {
|
||||
if ( viewer && viewer.close ) {
|
||||
viewer.close();
|
||||
}
|
||||
if (viewer && viewer.destroy){
|
||||
if (viewer){
|
||||
viewer.destroy();
|
||||
}
|
||||
|
||||
|
@ -15,10 +15,7 @@
|
||||
testLog.reset();
|
||||
},
|
||||
afterEach: function () {
|
||||
if (viewer && viewer.close) {
|
||||
viewer.close();
|
||||
}
|
||||
if (viewer && viewer.destroy){
|
||||
if (viewer){
|
||||
viewer.destroy();
|
||||
}
|
||||
|
||||
|
@ -16,10 +16,7 @@
|
||||
});
|
||||
},
|
||||
afterEach: function() {
|
||||
if ( viewer && viewer.close ) {
|
||||
viewer.close();
|
||||
}
|
||||
if (viewer && viewer.destroy){
|
||||
if (viewer){
|
||||
viewer.destroy();
|
||||
}
|
||||
|
||||
|
@ -42,10 +42,7 @@
|
||||
|
||||
resetTestVariables();
|
||||
|
||||
// if ( viewer && viewer.close ) {
|
||||
// viewer.close();
|
||||
// }
|
||||
if (viewer && viewer.destroy){
|
||||
if (viewer){
|
||||
viewer.destroy();
|
||||
}
|
||||
|
||||
|
@ -16,10 +16,8 @@
|
||||
},
|
||||
afterEach: function() {
|
||||
resetTestVariables();
|
||||
if ( viewer && viewer.close ) {
|
||||
viewer.close();
|
||||
}
|
||||
if (viewer && viewer.destroy){
|
||||
|
||||
if (viewer){
|
||||
viewer.destroy();
|
||||
}
|
||||
|
||||
|
@ -10,10 +10,7 @@
|
||||
testLog.reset();
|
||||
},
|
||||
afterEach: function () {
|
||||
if (viewer && viewer.close) {
|
||||
viewer.close();
|
||||
}
|
||||
if (viewer && viewer.destroy){
|
||||
if (viewer){
|
||||
viewer.destroy();
|
||||
}
|
||||
|
||||
|
@ -17,10 +17,7 @@
|
||||
});
|
||||
},
|
||||
afterEach: function() {
|
||||
if (viewer && viewer.close) {
|
||||
viewer.close();
|
||||
}
|
||||
if (viewer && viewer.destroy){
|
||||
if (viewer){
|
||||
viewer.destroy();
|
||||
}
|
||||
|
||||
|
@ -130,10 +130,7 @@
|
||||
afterEach: function () {
|
||||
ASSERT = null;
|
||||
|
||||
if (viewer && viewer.close) {
|
||||
viewer.close();
|
||||
}
|
||||
if (viewer && viewer.destroy){
|
||||
if (viewer){
|
||||
viewer.destroy();
|
||||
}
|
||||
|
||||
|
@ -19,10 +19,7 @@
|
||||
});
|
||||
},
|
||||
afterEach: function () {
|
||||
if (viewer && viewer.close) {
|
||||
viewer.close();
|
||||
}
|
||||
if (viewer && viewer.destroy){
|
||||
if (viewer){
|
||||
viewer.destroy();
|
||||
}
|
||||
|
||||
|
@ -21,10 +21,7 @@
|
||||
});
|
||||
},
|
||||
afterEach: function () {
|
||||
if (viewer && viewer.close) {
|
||||
viewer.close();
|
||||
}
|
||||
if (viewer && viewer.destroy){
|
||||
if (viewer){
|
||||
viewer.destroy();
|
||||
}
|
||||
|
||||
|
@ -16,10 +16,7 @@
|
||||
});
|
||||
},
|
||||
afterEach: function () {
|
||||
if (viewer && viewer.close) {
|
||||
viewer.close();
|
||||
}
|
||||
if (viewer && viewer.destroy){
|
||||
if (viewer){
|
||||
viewer.destroy();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user