removed super class prototype extension patterns from DziTileSource in favor of more concise $.extend

This commit is contained in:
thatcher 2011-12-13 18:29:25 -05:00
parent f1882259e2
commit a7050af619
2 changed files with 90 additions and 94 deletions

View File

@ -2595,11 +2595,9 @@ $.DziTileSource = function(width, height, tileSize, tileOverlap, tilesUrl, fileF
this.initialize();
};
$.DziTileSource.prototype = new $.TileSource();
$.extend( $.DziTileSource.prototype, $.TileSource.prototype, {
$.DziTileSource.prototype.constructor = $.DziTileSource;
$.DziTileSource.prototype.initialize = function() {
initialize: function() {
if (!this.displayRects) {
return;
}
@ -2613,13 +2611,13 @@ $.DziTileSource.prototype.initialize = function() {
this._levelRects[level].push(rect);
}
}
};
},
$.DziTileSource.prototype.getTileUrl = function(level, x, y) {
getTileUrl: function(level, x, y) {
return [this.tilesUrl, level, '/', x, '_', y, '.', this.fileFormat].join('');
};
},
$.DziTileSource.prototype.tileExists = function(level, x, y) {
tileExists: function(level, x, y) {
var rects = this._levelRects[level];
if (!rects || !rects.length) {
@ -2650,8 +2648,8 @@ $.DziTileSource.prototype.tileExists = function(level, x, y) {
}
return false;
};
}
});
$.DziTileSourceHelper = {
createFromXml: function(xmlUrl, xmlString, callback) {

View File

@ -13,11 +13,9 @@ $.DziTileSource = function(width, height, tileSize, tileOverlap, tilesUrl, fileF
this.initialize();
};
$.DziTileSource.prototype = new $.TileSource();
$.extend( $.DziTileSource.prototype, $.TileSource.prototype, {
$.DziTileSource.prototype.constructor = $.DziTileSource;
$.DziTileSource.prototype.initialize = function() {
initialize: function() {
if (!this.displayRects) {
return;
}
@ -31,13 +29,13 @@ $.DziTileSource.prototype.initialize = function() {
this._levelRects[level].push(rect);
}
}
};
},
$.DziTileSource.prototype.getTileUrl = function(level, x, y) {
getTileUrl: function(level, x, y) {
return [this.tilesUrl, level, '/', x, '_', y, '.', this.fileFormat].join('');
};
},
$.DziTileSource.prototype.tileExists = function(level, x, y) {
tileExists: function(level, x, y) {
var rects = this._levelRects[level];
if (!rects || !rects.length) {
@ -68,8 +66,8 @@ $.DziTileSource.prototype.tileExists = function(level, x, y) {
}
return false;
};
}
});
$.DziTileSourceHelper = {
createFromXml: function(xmlUrl, xmlString, callback) {