Skip to content

Commit

Permalink
upgrade deps, fix indenting (Leaflet#5743)
Browse files Browse the repository at this point in the history
  • Loading branch information
mourner authored and perliedman committed Aug 31, 2017
1 parent 4e8b30a commit 88dd22c
Show file tree
Hide file tree
Showing 23 changed files with 81 additions and 79 deletions.
2 changes: 1 addition & 1 deletion build/rollup-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const banner = `/* @preserve

export default {
format: 'umd',
moduleName: 'L',
name: 'L',
banner: banner,
entry: 'src/Leaflet.js',
dest: 'dist/leaflet-src.js',
Expand Down
2 changes: 1 addition & 1 deletion build/rollup-watch-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const banner = `

export default {
format: 'umd',
moduleName: 'L',
name: 'L',
banner,
entry: 'src/Leaflet.js',
dest: 'dist/leaflet-src.js',
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.2.0",
"description": "JavaScript library for mobile-friendly interactive maps",
"devDependencies": {
"eslint": "^3.5.0 <3.6.0",
"eslint": "^4.5.0",
"eslint-config-mourner": "^2.0.1",
"git-rev-sync": "^1.8.0",
"happen": "~0.3.1",
Expand All @@ -14,13 +14,13 @@
"karma-firefox-launcher": "~1.0.0",
"karma-mocha": "^1.2.0",
"karma-phantomjs-launcher": "^1.0.2",
"karma-rollup-preprocessor": "^4.0.1",
"karma-rollup-preprocessor": "^5.0.1",
"karma-safari-launcher": "~1.0.0",
"leafdoc": "^1.4.1",
"mocha": "^3.1.0",
"phantomjs-prebuilt": "^2.1.12",
"prosthetic-hand": "^1.3.1",
"rollup": "^0.45.2",
"rollup": "^0.49.2",
"rollup-plugin-git-version": "0.2.1",
"rollup-plugin-json": "^2.1.0",
"rollup-watch": "^4.3.1",
Expand Down Expand Up @@ -76,7 +76,8 @@
2,
"tab",
{
"VariableDeclarator": 0
"VariableDeclarator": 0,
"flatTernaryExpressions": true
}
],
"curly": 2,
Expand Down
2 changes: 1 addition & 1 deletion spec/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module.exports = function (config) {
json()
],
format: 'umd',
moduleName: 'L'
name: 'L'
},

// test results reporter to use
Expand Down
2 changes: 1 addition & 1 deletion spec/suites/dom/DomEventSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('DomEvent', function () {
if (document.createEvent) {
var e = document.createEvent('MouseEvents');
e.initMouseEvent('click', true, true, window,
0, 0, 0, 0, 0, false, false, false, false, 0, null);
0, 0, 0, 0, 0, false, false, false, false, 0, null);
return el.dispatchEvent(e);
} else if (el.fireEvent) {
return el.fireEvent('onclick');
Expand Down
2 changes: 1 addition & 1 deletion spec/suites/geo/ProjectionSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe("Projection.SphericalMercator", function () {

// from https://github.com/Leaflet/Leaflet/issues/1578
expect(p.project(new L.LatLng(51.9371170300465, 80.11230468750001)))
.near(new L.Point(8918060.96409, 6788763.38325));
.near(new L.Point(8918060.96409, 6788763.38325));
});
});

Expand Down
32 changes: 16 additions & 16 deletions spec/suites/layer/tile/GridLayerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,12 @@ describe('GridLayer', function () {
};

grid.on('tileload tileunload tileerror tileloadstart', function (ev) {
// console.log(ev.type);
// console.log(ev.type);
counts[ev.type]++;
});
// grid.on('tileunload', function (ev) {
// console.log(ev.type, ev.coords, counts);
// });
// grid.on('tileunload', function (ev) {
// console.log(ev.type, ev.coords, counts);
// });

map.options.fadeAnimation = false;
map.options.zoomAnimation = false;
Expand Down Expand Up @@ -545,15 +545,15 @@ describe('GridLayer', function () {
// browsers due to CSS animations!
it.skipInPhantom("Loads 32, unloads 16 tiles zooming in 10-11", function (done) {

// grid.on('tileload tileunload tileloadstart load', logTiles);
// grid.on('tileload tileunload tileloadstart load', logTiles);

grid.on('load', function () {
expect(counts.tileloadstart).to.be(16);
expect(counts.tileload).to.be(16);
expect(counts.tileunload).to.be(0);
grid.off('load');

// grid.on('load', logTiles);
// grid.on('load', logTiles);
grid.on('load', function () {

// We're one frame into the zoom animation, there are
Expand Down Expand Up @@ -618,19 +618,19 @@ describe('GridLayer', function () {
// browsers due to CSS animations!
it.skipInPhantom("Loads 32, unloads 16 tiles zooming out 11-10", function (done) {

// grid.on('tileload tileunload load', logTiles);
// grid.on('tileload tileunload load', logTiles);

grid.on('load', function () {
expect(counts.tileloadstart).to.be(16);
expect(counts.tileload).to.be(16);
expect(counts.tileunload).to.be(0);
grid.off('load');

// grid.on('load', logTiles);
// grid.on('load', logTiles);
grid.on('load', function () {

grid.off('load');
// grid.on('load', logTiles);
// grid.on('load', logTiles);

// We're one frame into the zoom animation, there are
// 16 tiles for z11 plus 4 tiles for z10 covering the
Expand Down Expand Up @@ -717,9 +717,9 @@ describe('GridLayer', function () {

map.flyTo(trd, 12, {animate: true});

// map.on('_frame', function () {
// console.log('frame', counts);
// });
// map.on('_frame', function () {
// console.log('frame', counts);
// });

runFrames(500);
});
Expand Down Expand Up @@ -756,12 +756,12 @@ describe('GridLayer', function () {
};

grid.on('tileload tileunload tileerror tileloadstart', function (ev) {
// console.log(ev.type);
// console.log(ev.type);
counts[ev.type]++;
});
// grid.on('tileunload', function (ev) {
// console.log(ev.type, ev.coords, counts);
// });
// grid.on('tileunload', function (ev) {
// console.log(ev.type, ev.coords, counts);
// });

map.options.fadeAnimation = false;
map.options.zoomAnimation = false;
Expand Down
14 changes: 7 additions & 7 deletions spec/suites/layer/tile/TileLayerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ describe('TileLayer', function () {
};

kittenLayer.on('tileload tileunload tileerror tileloadstart', function (ev) {
// console.log(ev.type);
// console.log(ev.type);
counts[ev.type]++;
});
// grid.on('tileunload', function (ev) {
// console.log(ev.type, ev.coords, counts);
// });
// grid.on('tileunload', function (ev) {
// console.log(ev.type, ev.coords, counts);
// });

map.options.fadeAnimation = false;
map.options.zoomAnimation = false;
Expand Down Expand Up @@ -274,9 +274,9 @@ describe('TileLayer', function () {

map.flyTo(trd, 12, {animate: true});

// map.on('_frame', function () {
// console.log('frame', counts);
// });
// map.on('_frame', function () {
// console.log('frame', counts);
// });

runFrames(500);
});
Expand Down
6 changes: 3 additions & 3 deletions spec/suites/layer/vector/PolylineGeometrySpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ describe('PolylineGeometry', function () {
var p1 = map.latLngToLayerPoint(new L.LatLng(55.8, 37.6));
var p2 = map.latLngToLayerPoint(new L.LatLng(57.123076977278, 44.861962891635));
var latlngs = [[56.485503424111, 35.545556640339], [55.972522915346, 36.116845702918], [55.502459116923, 34.930322265253], [55.31534617509, 38.973291015816]]
.map(function (ll) {
return new L.LatLng(ll[0], ll[1]);
});
.map(function (ll) {
return new L.LatLng(ll[0], ll[1]);
});
var polyline = new L.Polyline([], {
'noClip': true
});
Expand Down
16 changes: 8 additions & 8 deletions spec/suites/map/MapSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ describe("Map", function () {
var container = map.getContainer();
container.style.height = height;
document.body.appendChild(container);
// L.Browser.any3d = true; // L.Browser is frozen since ES6ication
// L.Browser.any3d = true; // L.Browser is frozen since ES6ication
map.options.zoomSnap = 0.5;
expect(map.getBoundsZoom(bounds, false, padding)).to.be.equal(19.5);
map.options.zoomSnap = 0.2;
Expand Down Expand Up @@ -787,7 +787,7 @@ describe("Map", function () {
});

it.skipInNonPhantom('zoomIn ignores the zoomDelta option on non-any3d browsers', function (done) {
// L.Browser.any3d = false; // L.Browser is frozen since ES6ication
L.Browser.any3d = false;
map.options.zoomSnap = 0.25;
map.options.zoomDelta = 0.25;
map.once('zoomend', function () {
Expand All @@ -799,7 +799,7 @@ describe("Map", function () {
});

it.skipInPhantom('zoomIn respects the zoomDelta option on any3d browsers', function (done) {
// L.Browser.any3d = true; // L.Browser is frozen since ES6ication
L.Browser.any3d = true;
map.options.zoomSnap = 0.25;
map.options.zoomDelta = 0.25;
map.setView(center, 10);
Expand All @@ -812,7 +812,7 @@ describe("Map", function () {
});

it.skipInPhantom('zoomOut respects the zoomDelta option on any3d browsers', function (done) {
// L.Browser.any3d = true; // L.Browser is frozen since ES6ication
L.Browser.any3d = true;
map.options.zoomSnap = 0.25;
map.options.zoomDelta = 0.25;
map.setView(center, 10);
Expand All @@ -832,7 +832,7 @@ describe("Map", function () {
expect(map.getCenter()).to.eql(center);
done();
});
// L.Browser.any3d = true; // L.Browser is frozen since ES6ication
L.Browser.any3d = true;
map.zoomIn(0.22, {animate: false});
});

Expand All @@ -844,7 +844,7 @@ describe("Map", function () {
expect(map.getCenter()).to.eql(center);
done();
});
// L.Browser.any3d = true; // L.Browser is frozen since ES6ication
L.Browser.any3d = true;
map.zoomOut(0.22, {animate: false});
});
});
Expand Down Expand Up @@ -888,7 +888,7 @@ describe("Map", function () {

it.skipInPhantom('Snaps zoom to zoomSnap on any3d browsers', function (done) {
map.options.zoomSnap = 0.25;
// L.Browser.any3d = true; // L.Browser is frozen since ES6ication
L.Browser.any3d = true;
map.once('zoomend', function () {
expect(map.getZoom()).to.eql(2.75);
expect(map.getCenter().equals(boundsCenter, 0.05)).to.eql(true);
Expand All @@ -899,7 +899,7 @@ describe("Map", function () {

it.skipInNonPhantom('Ignores zoomSnap on non-any3d browsers', function (done) {
map.options.zoomSnap = 0.25;
// L.Browser.any3d = false; // L.Browser is frozen since ES6ication
L.Browser.any3d = false;
map.once('zoomend', function () {
expect(map.getZoom()).to.eql(2);
expect(map.getCenter().equals(boundsCenter, 0.05)).to.eql(true);
Expand Down
2 changes: 1 addition & 1 deletion spec/suites/map/handler/Map.KeyboardSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ describe("Map.Keyboard", function () {
expect(popup.isOpen()).to.be(true);

happen.keydown(document, {keyCode: 27}); // 27 = Esc
// happen.keypress(document, {keyCode: 27});
// happen.keypress(document, {keyCode: 27});
happen.keyup(document, {keyCode: 27});

expect(popup.isOpen()).to.be(false);
Expand Down
4 changes: 2 additions & 2 deletions src/control/Control.Scale.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export var Scale = Control.extend({
y = map.getSize().y / 2;

var maxMeters = map.distance(
map.containerPointToLatLng([0, y]),
map.containerPointToLatLng([this.options.maxWidth, y]));
map.containerPointToLatLng([0, y]),
map.containerPointToLatLng([this.options.maxWidth, y]));

this._updateScales(maxMeters);
},
Expand Down
2 changes: 1 addition & 1 deletion src/core/Util.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export function getParamString(obj, existingUrl, uppercase) {
return ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&');
}

var templateRe = /\{ *([\w_\-]+) *\}/g;
var templateRe = /\{ *([\w_-]+) *\}/g;

// @function template(str: String, data: Object): String
// Simple templating facility, accepts a template string of the form `'Hello {a}, {b}'`
Expand Down
6 changes: 3 additions & 3 deletions src/dom/DomEvent.DoubleTap.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {_pointersCount} from './DomEvent.Pointer';
* Extends the event handling code with double tap support for mobile browsers.
*/

var _touchstart = Browser.msPointer ? 'MSPointerDown' : Browser.pointer ? 'pointerdown' : 'touchstart',
_touchend = Browser.msPointer ? 'MSPointerUp' : Browser.pointer ? 'pointerup' : 'touchend',
_pre = '_leaflet_';
var _touchstart = Browser.msPointer ? 'MSPointerDown' : Browser.pointer ? 'pointerdown' : 'touchstart';
var _touchend = Browser.msPointer ? 'MSPointerUp' : Browser.pointer ? 'pointerup' : 'touchend';
var _pre = '_leaflet_';

// inspired by Zepto touch code by Thomas Fuchs
export function addDoubleTapListener(obj, handler, id) {
Expand Down
16 changes: 8 additions & 8 deletions src/dom/DomEvent.Pointer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import * as Browser from '../core/Browser';
*/


var POINTER_DOWN = Browser.msPointer ? 'MSPointerDown' : 'pointerdown',
POINTER_MOVE = Browser.msPointer ? 'MSPointerMove' : 'pointermove',
POINTER_UP = Browser.msPointer ? 'MSPointerUp' : 'pointerup',
POINTER_CANCEL = Browser.msPointer ? 'MSPointerCancel' : 'pointercancel',
TAG_WHITE_LIST = ['INPUT', 'SELECT', 'OPTION'],

_pointers = {},
_pointerDocListener = false;
var POINTER_DOWN = Browser.msPointer ? 'MSPointerDown' : 'pointerdown';
var POINTER_MOVE = Browser.msPointer ? 'MSPointerMove' : 'pointermove';
var POINTER_UP = Browser.msPointer ? 'MSPointerUp' : 'pointerup';
var POINTER_CANCEL = Browser.msPointer ? 'MSPointerCancel' : 'pointercancel';
var TAG_WHITE_LIST = ['INPUT', 'SELECT', 'OPTION'];

var _pointers = {};
var _pointerDocListener = false;

// DomEvent.DoubleTap needs to know about this
export var _pointersCount = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/geo/projection/Projection.SphericalMercator.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export var SphericalMercator = {
sin = Math.sin(lat * d);

return new Point(
this.R * latlng.lng * d,
this.R * Math.log((1 + sin) / (1 - sin)) / 2);
this.R * latlng.lng * d,
this.R * Math.log((1 + sin) / (1 - sin)) / 2);
},

unproject: function (point) {
Expand Down
12 changes: 6 additions & 6 deletions src/layer/GeoJSON.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ export function coordsToLatLngs(coords, levelsDeep, _coordsToLatLng) {

for (var i = 0, len = coords.length, latlng; i < len; i++) {
latlng = levelsDeep ?
coordsToLatLngs(coords[i], levelsDeep - 1, _coordsToLatLng) :
(_coordsToLatLng || coordsToLatLng)(coords[i]);
coordsToLatLngs(coords[i], levelsDeep - 1, _coordsToLatLng) :
(_coordsToLatLng || coordsToLatLng)(coords[i]);

latlngs.push(latlng);
}
Expand All @@ -245,8 +245,8 @@ export function coordsToLatLngs(coords, levelsDeep, _coordsToLatLng) {
export function latLngToCoords(latlng, precision) {
precision = typeof precision === 'number' ? precision : 6;
return latlng.alt !== undefined ?
[Util.formatNum(latlng.lng, precision), Util.formatNum(latlng.lat, precision), Util.formatNum(latlng.alt, precision)] :
[Util.formatNum(latlng.lng, precision), Util.formatNum(latlng.lat, precision)];
[Util.formatNum(latlng.lng, precision), Util.formatNum(latlng.lat, precision), Util.formatNum(latlng.alt, precision)] :
[Util.formatNum(latlng.lng, precision), Util.formatNum(latlng.lat, precision)];
}

// @function latLngsToCoords(latlngs: Array, levelsDeep?: Number, closed?: Boolean): Array
Expand All @@ -270,8 +270,8 @@ export function latLngsToCoords(latlngs, levelsDeep, closed, precision) {

export function getFeature(layer, newGeometry) {
return layer.feature ?
Util.extend({}, layer.feature, {geometry: newGeometry}) :
asFeature(newGeometry);
Util.extend({}, layer.feature, {geometry: newGeometry}) :
asFeature(newGeometry);
}

// @function asFeature(geojson: Object): Object
Expand Down
Loading

0 comments on commit 88dd22c

Please sign in to comment.