mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
Getting started on a DZI-JSONp test; currently disabled
This commit is contained in:
parent
4f13328609
commit
05c25fddcf
12
test/data/testpattern.js
Normal file
12
test/data/testpattern.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
testpattern({
|
||||||
|
Image: {
|
||||||
|
xmlns: 'http://schemas.microsoft.com/deepzoom/2008',
|
||||||
|
Format: 'jpg',
|
||||||
|
Overlap: 1,
|
||||||
|
TileSize: 254,
|
||||||
|
Size:{
|
||||||
|
Height: 1000,
|
||||||
|
Width: 1000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
51
test/dzi-jsonp.js
Normal file
51
test/dzi-jsonp.js
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
(function() {
|
||||||
|
|
||||||
|
// TODO: How to know if a tile has been drawn? The tile-drawn event used below
|
||||||
|
// is defunct.
|
||||||
|
|
||||||
|
module('DZI JSONp');
|
||||||
|
|
||||||
|
var viewer = null;
|
||||||
|
|
||||||
|
// ----------
|
||||||
|
asyncTest('Open', function() {
|
||||||
|
$(document).ready(function() {
|
||||||
|
viewer = OpenSeadragon({
|
||||||
|
id: 'example',
|
||||||
|
prefixUrl: '/build/openseadragon/images/',
|
||||||
|
tileSources: '/test/data/testpattern.js'
|
||||||
|
});
|
||||||
|
|
||||||
|
ok(viewer, 'Viewer exists');
|
||||||
|
|
||||||
|
var openHandler = function(eventSender, eventData) {
|
||||||
|
viewer.removeHandler('open', openHandler);
|
||||||
|
ok(true, 'Open event was sent');
|
||||||
|
viewer.drawer.viewer = viewer;
|
||||||
|
viewer.addHandler('tile-drawn', tileDrawnHandler);
|
||||||
|
};
|
||||||
|
|
||||||
|
var tileDrawnHandler = function(eventSender, eventData) {
|
||||||
|
viewer.removeHandler('tile-drawn', tileDrawnHandler);
|
||||||
|
ok(true, 'A tile has been drawn');
|
||||||
|
start();
|
||||||
|
};
|
||||||
|
|
||||||
|
viewer.addHandler('open', openHandler);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// ----------
|
||||||
|
// asyncTest('Close', function() {
|
||||||
|
// var closeHandler = function() {
|
||||||
|
// viewer.removeHandler('close', closeHandler);
|
||||||
|
// $('#example').empty();
|
||||||
|
// ok(true, 'Close event was sent');
|
||||||
|
// start();
|
||||||
|
// };
|
||||||
|
|
||||||
|
// viewer.addHandler('close', closeHandler);
|
||||||
|
// viewer.close();
|
||||||
|
// });
|
||||||
|
|
||||||
|
})();
|
@ -16,5 +16,6 @@
|
|||||||
<script src="/build/openseadragon/openseadragon.min.js"></script>
|
<script src="/build/openseadragon/openseadragon.min.js"></script>
|
||||||
<script src="/test/util.js"></script>
|
<script src="/test/util.js"></script>
|
||||||
<script src="/test/basic.js"></script>
|
<script src="/test/basic.js"></script>
|
||||||
|
<!-- <script src="/test/dzi-jsonp.js"></script> -->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue
Block a user