mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-16 14:53:14 +03:00
removed overlayplacement.js from the build
This commit is contained in:
parent
97d2f0c765
commit
d702810ae7
@ -24,7 +24,6 @@
|
|||||||
<file name="src/utils.js" />
|
<file name="src/utils.js" />
|
||||||
<file name="src/mousetracker.js" />
|
<file name="src/mousetracker.js" />
|
||||||
<file name="src/controlanchor.js" />
|
<file name="src/controlanchor.js" />
|
||||||
<file name="src/overlayplacement.js" />
|
|
||||||
<file name="src/navcontrol.js" />
|
<file name="src/navcontrol.js" />
|
||||||
<file name="src/control.js" />
|
<file name="src/control.js" />
|
||||||
<file name="src/viewer.js" />
|
<file name="src/viewer.js" />
|
||||||
|
244
openseadragon.js
244
openseadragon.js
@ -1218,26 +1218,6 @@ $.Utils = new $.Utils();
|
|||||||
}( OpenSeadragon ));
|
}( OpenSeadragon ));
|
||||||
|
|
||||||
|
|
||||||
(function( $ ){
|
|
||||||
|
|
||||||
$.OverlayPlacement = function() {
|
|
||||||
throw Error.invalidOperation();
|
|
||||||
};
|
|
||||||
|
|
||||||
$.OverlayPlacement = {
|
|
||||||
CENTER: 0,
|
|
||||||
TOP_LEFT: 1,
|
|
||||||
TOP: 2,
|
|
||||||
TOP_RIGHT: 3,
|
|
||||||
RIGHT: 4,
|
|
||||||
BOTTOM_RIGHT: 5,
|
|
||||||
BOTTOM: 6,
|
|
||||||
BOTTOM_LEFT: 7,
|
|
||||||
LEFT: 8
|
|
||||||
};
|
|
||||||
|
|
||||||
}( OpenSeadragon ));
|
|
||||||
|
|
||||||
(function( $ ){
|
(function( $ ){
|
||||||
|
|
||||||
$.NavControl = function(viewer) {
|
$.NavControl = function(viewer) {
|
||||||
@ -2595,14 +2575,18 @@ $.TileSource.prototype = {
|
|||||||
return new $.Rect(px * scale, py * scale, sx * scale, sy * scale);
|
return new $.Rect(px * scale, py * scale, sx * scale, sy * scale);
|
||||||
},
|
},
|
||||||
|
|
||||||
getTileUrl: function(level, x, y) {
|
getTileUrl: function( level, x, y ) {
|
||||||
throw new Error("Method not implemented.");
|
throw new Error("Method not implemented.");
|
||||||
},
|
},
|
||||||
|
|
||||||
tileExists: function(level, x, y) {
|
tileExists: function( level, x, y ) {
|
||||||
var numTiles = this.getNumTiles(level);
|
var numTiles = this.getNumTiles( level );
|
||||||
return level >= this.minLevel && level <= this.maxLevel &&
|
return level >= this.minLevel &&
|
||||||
x >= 0 && y >= 0 && x < numTiles.x && y < numTiles.y;
|
level <= this.maxLevel &&
|
||||||
|
x >= 0 &&
|
||||||
|
y >= 0 &&
|
||||||
|
x < numTiles.x &&
|
||||||
|
y < numTiles.y;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -3415,108 +3399,124 @@ $.Tile.prototype = {
|
|||||||
|
|
||||||
(function( $ ){
|
(function( $ ){
|
||||||
|
|
||||||
$.Overlay = function(elmt, loc, placement) {
|
|
||||||
this.elmt = elmt;
|
|
||||||
this.scales = (loc instanceof $.Rect);
|
|
||||||
this.bounds = new $.Rect(loc.x, loc.y, loc.width, loc.height);
|
|
||||||
this.placement = loc instanceof $.Point ? placement : $.OverlayPlacement.TOP_LEFT; // rects are always top-left
|
|
||||||
this.position = new $.Point(loc.x, loc.y);
|
|
||||||
this.size = new $.Point(loc.width, loc.height);
|
|
||||||
this.style = elmt.style;
|
|
||||||
};
|
|
||||||
|
|
||||||
$.Overlay.prototype = {
|
$.OverlayPlacement = {
|
||||||
|
CENTER: 0,
|
||||||
|
TOP_LEFT: 1,
|
||||||
|
TOP: 2,
|
||||||
|
TOP_RIGHT: 3,
|
||||||
|
RIGHT: 4,
|
||||||
|
BOTTOM_RIGHT: 5,
|
||||||
|
BOTTOM: 6,
|
||||||
|
BOTTOM_LEFT: 7,
|
||||||
|
LEFT: 8
|
||||||
|
};
|
||||||
|
|
||||||
adjust: function(position, size) {
|
$.Overlay = function(elmt, loc, placement) {
|
||||||
switch (this.placement) {
|
this.elmt = elmt;
|
||||||
case $.OverlayPlacement.TOP_LEFT:
|
this.scales = (loc instanceof $.Rect);
|
||||||
break;
|
this.bounds = new $.Rect(loc.x, loc.y, loc.width, loc.height);
|
||||||
case $.OverlayPlacement.TOP:
|
this.position = new $.Point(loc.x, loc.y);
|
||||||
position.x -= size.x / 2;
|
this.size = new $.Point(loc.width, loc.height);
|
||||||
break;
|
this.style = elmt.style;
|
||||||
case $.OverlayPlacement.TOP_RIGHT:
|
// rects are always top-left
|
||||||
position.x -= size.x;
|
this.placement = loc instanceof $.Point ?
|
||||||
break;
|
placement :
|
||||||
case $.OverlayPlacement.RIGHT:
|
$.OverlayPlacement.TOP_LEFT;
|
||||||
position.x -= size.x;
|
};
|
||||||
position.y -= size.y / 2;
|
|
||||||
break;
|
|
||||||
case $.OverlayPlacement.BOTTOM_RIGHT:
|
|
||||||
position.x -= size.x;
|
|
||||||
position.y -= size.y;
|
|
||||||
break;
|
|
||||||
case $.OverlayPlacement.BOTTOM:
|
|
||||||
position.x -= size.x / 2;
|
|
||||||
position.y -= size.y;
|
|
||||||
break;
|
|
||||||
case $.OverlayPlacement.BOTTOM_LEFT:
|
|
||||||
position.y -= size.y;
|
|
||||||
break;
|
|
||||||
case $.OverlayPlacement.LEFT:
|
|
||||||
position.y -= size.y / 2;
|
|
||||||
break;
|
|
||||||
case $.OverlayPlacement.CENTER:
|
|
||||||
default:
|
|
||||||
position.x -= size.x / 2;
|
|
||||||
position.y -= size.y / 2;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
destroy: function() {
|
|
||||||
var elmt = this.elmt;
|
|
||||||
var style = this.style;
|
|
||||||
|
|
||||||
if (elmt.parentNode) {
|
$.Overlay.prototype = {
|
||||||
elmt.parentNode.removeChild(elmt);
|
|
||||||
|
adjust: function(position, size) {
|
||||||
|
switch (this.placement) {
|
||||||
|
case $.OverlayPlacement.TOP_LEFT:
|
||||||
|
break;
|
||||||
|
case $.OverlayPlacement.TOP:
|
||||||
|
position.x -= size.x / 2;
|
||||||
|
break;
|
||||||
|
case $.OverlayPlacement.TOP_RIGHT:
|
||||||
|
position.x -= size.x;
|
||||||
|
break;
|
||||||
|
case $.OverlayPlacement.RIGHT:
|
||||||
|
position.x -= size.x;
|
||||||
|
position.y -= size.y / 2;
|
||||||
|
break;
|
||||||
|
case $.OverlayPlacement.BOTTOM_RIGHT:
|
||||||
|
position.x -= size.x;
|
||||||
|
position.y -= size.y;
|
||||||
|
break;
|
||||||
|
case $.OverlayPlacement.BOTTOM:
|
||||||
|
position.x -= size.x / 2;
|
||||||
|
position.y -= size.y;
|
||||||
|
break;
|
||||||
|
case $.OverlayPlacement.BOTTOM_LEFT:
|
||||||
|
position.y -= size.y;
|
||||||
|
break;
|
||||||
|
case $.OverlayPlacement.LEFT:
|
||||||
|
position.y -= size.y / 2;
|
||||||
|
break;
|
||||||
|
case $.OverlayPlacement.CENTER:
|
||||||
|
default:
|
||||||
|
position.x -= size.x / 2;
|
||||||
|
position.y -= size.y / 2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
destroy: function() {
|
||||||
|
var elmt = this.elmt;
|
||||||
|
var style = this.style;
|
||||||
|
|
||||||
|
if (elmt.parentNode) {
|
||||||
|
elmt.parentNode.removeChild(elmt);
|
||||||
|
}
|
||||||
|
|
||||||
|
style.top = "";
|
||||||
|
style.left = "";
|
||||||
|
style.position = "";
|
||||||
|
|
||||||
|
if (this.scales) {
|
||||||
|
style.width = "";
|
||||||
|
style.height = "";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
drawHTML: function(container) {
|
||||||
|
var elmt = this.elmt;
|
||||||
|
var style = this.style;
|
||||||
|
var scales = this.scales;
|
||||||
|
|
||||||
|
if (elmt.parentNode != container) {
|
||||||
|
container.appendChild(elmt);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!scales) {
|
||||||
|
this.size = $.Utils.getElementSize(elmt);
|
||||||
|
}
|
||||||
|
|
||||||
|
var position = this.position;
|
||||||
|
var size = this.size;
|
||||||
|
|
||||||
|
this.adjust(position, size);
|
||||||
|
|
||||||
|
position = position.apply(Math.floor);
|
||||||
|
size = size.apply(Math.ceil);
|
||||||
|
|
||||||
|
style.left = position.x + "px";
|
||||||
|
style.top = position.y + "px";
|
||||||
|
style.position = "absolute";
|
||||||
|
|
||||||
|
if (scales) {
|
||||||
|
style.width = size.x + "px";
|
||||||
|
style.height = size.y + "px";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
update: function(loc, placement) {
|
||||||
|
this.scales = (loc instanceof $.Rect);
|
||||||
|
this.bounds = new $.Rect(loc.x, loc.y, loc.width, loc.height);
|
||||||
|
this.placement = loc instanceof $.Point ?
|
||||||
|
placement : $.OverlayPlacement.TOP_LEFT; // rects are always top-left
|
||||||
}
|
}
|
||||||
|
|
||||||
style.top = "";
|
};
|
||||||
style.left = "";
|
|
||||||
style.position = "";
|
|
||||||
|
|
||||||
if (this.scales) {
|
|
||||||
style.width = "";
|
|
||||||
style.height = "";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
drawHTML: function(container) {
|
|
||||||
var elmt = this.elmt;
|
|
||||||
var style = this.style;
|
|
||||||
var scales = this.scales;
|
|
||||||
|
|
||||||
if (elmt.parentNode != container) {
|
|
||||||
container.appendChild(elmt);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!scales) {
|
|
||||||
this.size = $.Utils.getElementSize(elmt);
|
|
||||||
}
|
|
||||||
|
|
||||||
var position = this.position;
|
|
||||||
var size = this.size;
|
|
||||||
|
|
||||||
this.adjust(position, size);
|
|
||||||
|
|
||||||
position = position.apply(Math.floor);
|
|
||||||
size = size.apply(Math.ceil);
|
|
||||||
|
|
||||||
style.left = position.x + "px";
|
|
||||||
style.top = position.y + "px";
|
|
||||||
style.position = "absolute";
|
|
||||||
|
|
||||||
if (scales) {
|
|
||||||
style.width = size.x + "px";
|
|
||||||
style.height = size.y + "px";
|
|
||||||
}
|
|
||||||
},
|
|
||||||
update: function(loc, placement) {
|
|
||||||
this.scales = (loc instanceof $.Rect);
|
|
||||||
this.bounds = new $.Rect(loc.x, loc.y, loc.width, loc.height);
|
|
||||||
this.placement = loc instanceof $.Point ?
|
|
||||||
placement : $.OverlayPlacement.TOP_LEFT; // rects are always top-left
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}( OpenSeadragon ));
|
}( OpenSeadragon ));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user