revert: do not lint public directory

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
This commit is contained in:
Vinayak Kulkarni 2022-09-20 13:19:50 +05:30
parent 58628faa19
commit 2835a5e1e5
No known key found for this signature in database
GPG key ID: 0FE8ABF8260A1552
8 changed files with 403 additions and 97293 deletions

View file

@ -28,11 +28,11 @@ L.TileLayer.include({
_onCreateLevel: function(level) {
if (this.options.dumpToCanvas) {
level.canvas = L.DomUtil.create(
'canvas',
'leaflet-tile-container leaflet-zoom-animated',
this._container,
"canvas",
"leaflet-tile-container leaflet-zoom-animated",
this._container
);
level.ctx = level.canvas.getContext('2d');
level.ctx = level.canvas.getContext("2d");
this._resetCanvasSize(level);
}
},
@ -67,7 +67,7 @@ L.TileLayer.include({
var pixelRange = L.bounds(
tileRange.min.scaleBy(tileSize),
tileRange.max.add([1, 1]).scaleBy(tileSize), // This prevents an off-by-one when checking if tiles are inside
tileRange.max.add([1, 1]).scaleBy(tileSize) // This prevents an off-by-one when checking if tiles are inside
),
mustRepositionCanvas = false,
neededSize = pixelRange.max.subtract(pixelRange.min);
@ -84,14 +84,14 @@ L.TileLayer.include({
var oldSize = { x: level.canvas.width, y: level.canvas.height };
// console.info('Resizing canvas from ', oldSize, 'to ', neededSize);
var tmpCanvas = L.DomUtil.create('canvas');
tmpCanvas.style.width = (tmpCanvas.width = oldSize.x) + 'px';
tmpCanvas.style.height = (tmpCanvas.height = oldSize.y) + 'px';
tmpCanvas.getContext('2d').drawImage(level.canvas, 0, 0);
var tmpCanvas = L.DomUtil.create("canvas");
tmpCanvas.style.width = (tmpCanvas.width = oldSize.x) + "px";
tmpCanvas.style.height = (tmpCanvas.height = oldSize.y) + "px";
tmpCanvas.getContext("2d").drawImage(level.canvas, 0, 0);
// var data = level.ctx.getImageData(0, 0, oldSize.x, oldSize.y);
level.canvas.style.width = (level.canvas.width = neededSize.x) + 'px';
level.canvas.style.height = (level.canvas.height = neededSize.y) + 'px';
level.canvas.style.width = (level.canvas.width = neededSize.x) + "px";
level.canvas.style.height = (level.canvas.height = neededSize.y) + "px";
level.ctx.drawImage(tmpCanvas, 0, 0);
// level.ctx.putImageData(data, 0, 0, 0, 0, oldSize.x, oldSize.y);
}
@ -109,22 +109,22 @@ L.TileLayer.include({
// this to *replace* the existing pixels when doing a drawImage() call.
// This will also clear the sides, so no clearRect() calls are needed to make room
// for the new tiles.
level.ctx.globalCompositeOperation = 'copy';
level.ctx.globalCompositeOperation = "copy";
level.ctx.drawImage(level.canvas, offset.x, offset.y);
level.ctx.globalCompositeOperation = 'source-over';
level.ctx.globalCompositeOperation = "source-over";
} else {
// Safari clears the canvas when copying from itself :-(
if (!this._tmpCanvas) {
var t = (this._tmpCanvas = L.DomUtil.create('canvas'));
var t = (this._tmpCanvas = L.DomUtil.create("canvas"));
t.width = level.canvas.width;
t.height = level.canvas.height;
this._tmpContext = t.getContext('2d');
this._tmpContext = t.getContext("2d");
}
this._tmpContext.clearRect(
0,
0,
level.canvas.width,
level.canvas.height,
level.canvas.height
);
this._tmpContext.drawImage(level.canvas, 0, 0);
level.ctx.clearRect(0, 0, level.canvas.width, level.canvas.height);
@ -146,7 +146,7 @@ L.TileLayer.include({
this._setCanvasZoomTransform(
level,
this._map.getCenter(),
this._map.getZoom(),
this._map.getZoom()
);
}
},
@ -192,8 +192,8 @@ L.TileLayer.include({
try {
this.dumpPixels(tile.coords, tile.el);
} catch (ex) {
return this.fire('tileerror', {
error: 'Could not copy tile pixels: ' + ex,
return this.fire("tileerror", {
error: "Could not copy tile pixels: " + ex,
tile: tile,
coods: tile.coords,
});
@ -202,7 +202,7 @@ L.TileLayer.include({
// If dumping the pixels was successful, then hide the tile.
// Do not remove the tile itself, as it is needed to check if the whole
// level (and its canvas) should be removed (via level.el.children.length)
tile.el.style.display = 'none';
tile.el.style.display = "none";
},
// @section Extension methods
@ -234,13 +234,7 @@ L.TileLayer.include({
.subtract(level.canvasRange.min)
.scaleBy(this.getTileSize());
level.ctx.drawImage(
imageSource,
offset.x,
offset.y,
tileSize.x,
tileSize.y,
);
level.ctx.drawImage(imageSource, offset.x, offset.y, tileSize.x, tileSize.y);
// TODO: Clear the pixels of other levels' canvases where they overlap
// this newly dumped tile.

View file

@ -1,7 +1,8 @@
(function(window) {
var HAS_HASHCHANGE = (function() {
var doc_mode = window.documentMode;
return 'onhashchange' in window && (doc_mode === undefined || doc_mode > 7);
return ('onhashchange' in window) &&
(doc_mode === undefined || doc_mode > 7);
})();
L.Hash = function(map) {
@ -16,7 +17,7 @@
if(hash.indexOf('#') === 0) {
hash = hash.substr(1);
}
var args = hash.split('/');
var args = hash.split("/");
if (args.length == 3) {
var zoom = parseInt(args[0], 10),
lat = parseFloat(args[1]),
@ -26,7 +27,7 @@
} else {
return {
center: new L.LatLng(lat, lon),
zoom: zoom,
zoom: zoom
};
}
} else {
@ -34,19 +35,18 @@
}
};
(L.Hash.formatHash = function (map) {
L.Hash.formatHash = function(map) {
var center = map.getCenter(),
zoom = map.getZoom(),
precision = Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2));
return (
'#' +
[zoom, center.lat.toFixed(precision), center.lng.toFixed(precision)].join(
'/',
)
);
}),
(L.Hash.prototype = {
return "#" + [zoom,
center.lat.toFixed(precision),
center.lng.toFixed(precision)
].join("/");
},
L.Hash.prototype = {
map: null,
lastHash: null,
@ -128,10 +128,10 @@
isListening: false,
hashChangeInterval: null,
startListening: function() {
this.map.on('moveend', this.onMapMove, this);
this.map.on("moveend", this.onMapMove, this);
if (HAS_HASHCHANGE) {
L.DomEvent.addListener(window, 'hashchange', this.onHashChange);
L.DomEvent.addListener(window, "hashchange", this.onHashChange);
} else {
clearInterval(this.hashChangeInterval);
this.hashChangeInterval = setInterval(this.onHashChange, 50);
@ -140,16 +140,16 @@
},
stopListening: function() {
this.map.off('moveend', this.onMapMove, this);
this.map.off("moveend", this.onMapMove, this);
if (HAS_HASHCHANGE) {
L.DomEvent.removeListener(window, 'hashchange', this.onHashChange);
L.DomEvent.removeListener(window, "hashchange", this.onHashChange);
} else {
clearInterval(this.hashChangeInterval);
}
this.isListening = false;
},
});
}
};
L.hash = function(map) {
return new L.Hash(map);
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long