Browse Source

Updated dependencies and adjusted code to standard

gh-pages
Matthias Mohr 6 years ago
parent
commit
6ea4567fe8
4 changed files with 56 additions and 47 deletions
  1. 3
    5
      index.js
  2. 46
    35
      leaflet-side-by-side.js
  3. 1
    1
      leaflet-side-by-side.min.js
  4. 6
    6
      package.json

+ 3
- 5
index.js View File

45
   return (arg === 'undefined') ? [] : Array.isArray(arg) ? arg : [arg]
45
   return (arg === 'undefined') ? [] : Array.isArray(arg) ? arg : [arg]
46
 }
46
 }
47
 
47
 
48
-function noop () {
49
-  return
50
-}
48
+function noop () {}
51
 
49
 
52
 L.Control.SideBySide = L.Control.extend({
50
 L.Control.SideBySide = L.Control.extend({
53
   options: {
51
   options: {
95
       return this
93
       return this
96
     }
94
     }
97
     if (this._leftLayer) {
95
     if (this._leftLayer) {
98
-      this._leftLayer.getContainer().style.clip = ""
96
+      this._leftLayer.getContainer().style.clip = ''
99
     }
97
     }
100
     if (this._rightLayer) {
98
     if (this._rightLayer) {
101
-      this._rightLayer.getContainer().style.clip = ""
99
+      this._rightLayer.getContainer().style.clip = ''
102
     }
100
     }
103
     this._removeEvents()
101
     this._removeEvents()
104
     L.DomUtil.remove(this._container)
102
     L.DomUtil.remove(this._container)

+ 46
- 35
leaflet-side-by-side.js View File

47
   return (arg === 'undefined') ? [] : Array.isArray(arg) ? arg : [arg]
47
   return (arg === 'undefined') ? [] : Array.isArray(arg) ? arg : [arg]
48
 }
48
 }
49
 
49
 
50
-function noop () {
51
-  return
52
-}
50
+function noop () {}
53
 
51
 
54
 L.Control.SideBySide = L.Control.extend({
52
 L.Control.SideBySide = L.Control.extend({
55
   options: {
53
   options: {
97
       return this
95
       return this
98
     }
96
     }
99
     if (this._leftLayer) {
97
     if (this._leftLayer) {
100
-      this._leftLayer.getContainer().style.clip = ""
98
+      this._leftLayer.getContainer().style.clip = ''
101
     }
99
     }
102
     if (this._rightLayer) {
100
     if (this._rightLayer) {
103
-      this._rightLayer.getContainer().style.clip = ""
101
+      this._rightLayer.getContainer().style.clip = ''
104
     }
102
     }
105
     this._removeEvents()
103
     this._removeEvents()
106
     L.DomUtil.remove(this._container)
104
     L.DomUtil.remove(this._container)
203
 
201
 
204
 }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
202
 }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
205
 },{"./layout.css":2,"./range.css":4}],2:[function(require,module,exports){
203
 },{"./layout.css":2,"./range.css":4}],2:[function(require,module,exports){
206
-var css = ".leaflet-sbs-range {\r\n    position: absolute;\r\n    top: 50%;\r\n    width: 100%;\r\n    z-index: 999;\r\n}\r\n.leaflet-sbs-divider {\r\n    position: absolute;\r\n    top: 0;\r\n    bottom: 0;\r\n    left: 50%;\r\n    margin-left: -2px;\r\n    width: 4px;\r\n    background-color: #fff;\r\n    pointer-events: none;\r\n    z-index: 999;\r\n}\r\n"; (require("./node_modules\\cssify"))(css, undefined, 'c:\Dev\leaflet-side-by-side\layout.css'); module.exports = css;
207
-},{"./node_modules\\cssify":3}],3:[function(require,module,exports){
208
-function injectStyleTag(document, fileName, cb) {
209
-  var style = document.getElementById(fileName);
204
+var inject = require('./node_modules/cssify');
205
+var css = ".leaflet-sbs-range {\r\n    position: absolute;\r\n    top: 50%;\r\n    width: 100%;\r\n    z-index: 999;\r\n}\r\n.leaflet-sbs-divider {\r\n    position: absolute;\r\n    top: 0;\r\n    bottom: 0;\r\n    left: 50%;\r\n    margin-left: -2px;\r\n    width: 4px;\r\n    background-color: #fff;\r\n    pointer-events: none;\r\n    z-index: 999;\r\n}\r\n";
206
+inject(css, undefined, '_i6aomd');
207
+module.exports = css;
208
+
209
+},{"./node_modules/cssify":3}],3:[function(require,module,exports){
210
+'use strict'
211
+
212
+function injectStyleTag (document, fileName, cb) {
213
+  var style = document.getElementById(fileName)
210
 
214
 
211
   if (style) {
215
   if (style) {
212
-    cb(style);
216
+    cb(style)
213
   } else {
217
   } else {
214
-    var head = document.getElementsByTagName('head')[0];
218
+    var head = document.getElementsByTagName('head')[0]
215
 
219
 
216
-    style = document.createElement('style');
217
-    style.id = fileName;
218
-    cb(style);
219
-    head.appendChild(style);
220
+    style = document.createElement('style')
221
+    if (fileName != null) style.id = fileName
222
+    cb(style)
223
+    head.appendChild(style)
220
   }
224
   }
221
 
225
 
222
-  return style;
226
+  return style
223
 }
227
 }
224
 
228
 
225
 module.exports = function (css, customDocument, fileName) {
229
 module.exports = function (css, customDocument, fileName) {
226
-  var doc = customDocument || document;
230
+  var doc = customDocument || document
231
+  /* istanbul ignore if: not supported by Electron */
227
   if (doc.createStyleSheet) {
232
   if (doc.createStyleSheet) {
228
     var sheet = doc.createStyleSheet()
233
     var sheet = doc.createStyleSheet()
229
-    sheet.cssText = css;
230
-    return sheet.ownerNode;
234
+    sheet.cssText = css
235
+    return sheet.ownerNode
231
   } else {
236
   } else {
232
-    return injectStyleTag(doc, fileName, function(style) {
237
+    return injectStyleTag(doc, fileName, function (style) {
238
+      /* istanbul ignore if: not supported by Electron */
233
       if (style.styleSheet) {
239
       if (style.styleSheet) {
234
-        style.styleSheet.cssText = css;
240
+        style.styleSheet.cssText = css
235
       } else {
241
       } else {
236
-        style.innerHTML = css;
242
+        style.innerHTML = css
237
       }
243
       }
238
-    });
244
+    })
239
   }
245
   }
240
-};
246
+}
241
 
247
 
242
-module.exports.byUrl = function(url) {
248
+module.exports.byUrl = function (url) {
249
+  /* istanbul ignore if: not supported by Electron */
243
   if (document.createStyleSheet) {
250
   if (document.createStyleSheet) {
244
-    return document.createStyleSheet(url).ownerNode;
251
+    return document.createStyleSheet(url).ownerNode
245
   } else {
252
   } else {
246
-    var head = document.getElementsByTagName('head')[0],
247
-        link = document.createElement('link');
253
+    var head = document.getElementsByTagName('head')[0]
254
+    var link = document.createElement('link')
248
 
255
 
249
-    link.rel = 'stylesheet';
250
-    link.href = url;
256
+    link.rel = 'stylesheet'
257
+    link.href = url
251
 
258
 
252
-    head.appendChild(link);
253
-    return link;
259
+    head.appendChild(link)
260
+    return link
254
   }
261
   }
255
-};
262
+}
256
 
263
 
257
 },{}],4:[function(require,module,exports){
264
 },{}],4:[function(require,module,exports){
258
-var css = ".leaflet-sbs-range {\r\n    -webkit-appearance: none;\r\n    display: inline-block!important;\r\n    vertical-align: middle;\r\n    height: 0;\r\n    padding: 0;\r\n    margin: 0;\r\n    border: 0;\r\n    background: rgba(0, 0, 0, 0.25);\r\n    min-width: 100px;\r\n    cursor: pointer;\r\n    pointer-events: none;\r\n    z-index: 999;\r\n}\r\n.leaflet-sbs-range::-ms-fill-upper {\r\n    background: transparent;\r\n}\r\n.leaflet-sbs-range::-ms-fill-lower {\r\n    background: rgba(255, 255, 255, 0.25);\r\n}\r\n/* Browser thingies */\r\n\r\n.leaflet-sbs-range::-moz-range-track {\r\n    opacity: 0;\r\n}\r\n.leaflet-sbs-range::-ms-track {\r\n    opacity: 0;\r\n}\r\n.leaflet-sbs-range::-ms-tooltip {\r\n    display: none;\r\n}\r\n/* For whatever reason, these need to be defined\r\n * on their own so dont group them */\r\n\r\n.leaflet-sbs-range::-webkit-slider-thumb {\r\n    -webkit-appearance: none;\r\n    margin: 0;\r\n    padding: 0;\r\n    background: #fff;\r\n    height: 40px;\r\n    width: 40px;\r\n    border-radius: 20px;\r\n    cursor: ew-resize;\r\n    pointer-events: auto;\r\n    border: 1px solid #ddd;\r\n    background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAABlBMVEV9fX3///+Kct39AAAAAnRSTlP/AOW3MEoAAAA9SURBVFjD7dehDQAwDANBZ/+l2wmKoiqR7pHRcaeaCxAIBAL/g7k9JxAIBAKBQCAQCAQC14H+MhAIBE4CD3fOFvGVBzhZAAAAAElFTkSuQmCC\");\r\n    background-position: 50% 50%;\r\n    background-repeat: no-repeat;\r\n    background-size: 40px 40px;\r\n}\r\n.leaflet-sbs-range::-ms-thumb {\r\n    margin: 0;\r\n    padding: 0;\r\n    background: #fff;\r\n    height: 40px;\r\n    width: 40px;\r\n    border-radius: 20px;\r\n    cursor: ew-resize;\r\n    pointer-events: auto;\r\n    border: 1px solid #ddd;\r\n    background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAABlBMVEV9fX3///+Kct39AAAAAnRSTlP/AOW3MEoAAAA9SURBVFjD7dehDQAwDANBZ/+l2wmKoiqR7pHRcaeaCxAIBAL/g7k9JxAIBAKBQCAQCAQC14H+MhAIBE4CD3fOFvGVBzhZAAAAAElFTkSuQmCC\");\r\n    background-position: 50% 50%;\r\n    background-repeat: no-repeat;\r\n    background-size: 40px 40px;\r\n}\r\n.leaflet-sbs-range::-moz-range-thumb {\r\n    padding: 0;\r\n    right: 0    ;\r\n    background: #fff;\r\n    height: 40px;\r\n    width: 40px;\r\n    border-radius: 20px;\r\n    cursor: ew-resize;\r\n    pointer-events: auto;\r\n    border: 1px solid #ddd;\r\n    background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAABlBMVEV9fX3///+Kct39AAAAAnRSTlP/AOW3MEoAAAA9SURBVFjD7dehDQAwDANBZ/+l2wmKoiqR7pHRcaeaCxAIBAL/g7k9JxAIBAKBQCAQCAQC14H+MhAIBE4CD3fOFvGVBzhZAAAAAElFTkSuQmCC\");\r\n    background-position: 50% 50%;\r\n    background-repeat: no-repeat;\r\n    background-size: 40px 40px;\r\n}\r\n.leaflet-sbs-range:disabled::-moz-range-thumb {\r\n    cursor: default;\r\n}\r\n.leaflet-sbs-range:disabled::-ms-thumb {\r\n    cursor: default;\r\n}\r\n.leaflet-sbs-range:disabled::-webkit-slider-thumb {\r\n    cursor: default;\r\n}\r\n.leaflet-sbs-range:disabled {\r\n    cursor: default;\r\n}\r\n.leaflet-sbs-range:focus {\r\n    outline: none!important;\r\n}\r\n.leaflet-sbs-range::-moz-focus-outer {\r\n    border: 0;\r\n}\r\n\r\n"; (require("./node_modules\\cssify"))(css, undefined, 'c:\Dev\leaflet-side-by-side\range.css'); module.exports = css;
259
-},{"./node_modules\\cssify":3}]},{},[1]);
265
+var inject = require('./node_modules/cssify');
266
+var css = ".leaflet-sbs-range {\r\n    -webkit-appearance: none;\r\n    display: inline-block!important;\r\n    vertical-align: middle;\r\n    height: 0;\r\n    padding: 0;\r\n    margin: 0;\r\n    border: 0;\r\n    background: rgba(0, 0, 0, 0.25);\r\n    min-width: 100px;\r\n    cursor: pointer;\r\n    pointer-events: none;\r\n    z-index: 999;\r\n}\r\n.leaflet-sbs-range::-ms-fill-upper {\r\n    background: transparent;\r\n}\r\n.leaflet-sbs-range::-ms-fill-lower {\r\n    background: rgba(255, 255, 255, 0.25);\r\n}\r\n/* Browser thingies */\r\n\r\n.leaflet-sbs-range::-moz-range-track {\r\n    opacity: 0;\r\n}\r\n.leaflet-sbs-range::-ms-track {\r\n    opacity: 0;\r\n}\r\n.leaflet-sbs-range::-ms-tooltip {\r\n    display: none;\r\n}\r\n/* For whatever reason, these need to be defined\r\n * on their own so dont group them */\r\n\r\n.leaflet-sbs-range::-webkit-slider-thumb {\r\n    -webkit-appearance: none;\r\n    margin: 0;\r\n    padding: 0;\r\n    background: #fff;\r\n    height: 40px;\r\n    width: 40px;\r\n    border-radius: 20px;\r\n    cursor: ew-resize;\r\n    pointer-events: auto;\r\n    border: 1px solid #ddd;\r\n    background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAABlBMVEV9fX3///+Kct39AAAAAnRSTlP/AOW3MEoAAAA9SURBVFjD7dehDQAwDANBZ/+l2wmKoiqR7pHRcaeaCxAIBAL/g7k9JxAIBAKBQCAQCAQC14H+MhAIBE4CD3fOFvGVBzhZAAAAAElFTkSuQmCC\");\r\n    background-position: 50% 50%;\r\n    background-repeat: no-repeat;\r\n    background-size: 40px 40px;\r\n}\r\n.leaflet-sbs-range::-ms-thumb {\r\n    margin: 0;\r\n    padding: 0;\r\n    background: #fff;\r\n    height: 40px;\r\n    width: 40px;\r\n    border-radius: 20px;\r\n    cursor: ew-resize;\r\n    pointer-events: auto;\r\n    border: 1px solid #ddd;\r\n    background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAABlBMVEV9fX3///+Kct39AAAAAnRSTlP/AOW3MEoAAAA9SURBVFjD7dehDQAwDANBZ/+l2wmKoiqR7pHRcaeaCxAIBAL/g7k9JxAIBAKBQCAQCAQC14H+MhAIBE4CD3fOFvGVBzhZAAAAAElFTkSuQmCC\");\r\n    background-position: 50% 50%;\r\n    background-repeat: no-repeat;\r\n    background-size: 40px 40px;\r\n}\r\n.leaflet-sbs-range::-moz-range-thumb {\r\n    padding: 0;\r\n    right: 0    ;\r\n    background: #fff;\r\n    height: 40px;\r\n    width: 40px;\r\n    border-radius: 20px;\r\n    cursor: ew-resize;\r\n    pointer-events: auto;\r\n    border: 1px solid #ddd;\r\n    background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAABlBMVEV9fX3///+Kct39AAAAAnRSTlP/AOW3MEoAAAA9SURBVFjD7dehDQAwDANBZ/+l2wmKoiqR7pHRcaeaCxAIBAL/g7k9JxAIBAKBQCAQCAQC14H+MhAIBE4CD3fOFvGVBzhZAAAAAElFTkSuQmCC\");\r\n    background-position: 50% 50%;\r\n    background-repeat: no-repeat;\r\n    background-size: 40px 40px;\r\n}\r\n.leaflet-sbs-range:disabled::-moz-range-thumb {\r\n    cursor: default;\r\n}\r\n.leaflet-sbs-range:disabled::-ms-thumb {\r\n    cursor: default;\r\n}\r\n.leaflet-sbs-range:disabled::-webkit-slider-thumb {\r\n    cursor: default;\r\n}\r\n.leaflet-sbs-range:disabled {\r\n    cursor: default;\r\n}\r\n.leaflet-sbs-range:focus {\r\n    outline: none!important;\r\n}\r\n.leaflet-sbs-range::-moz-focus-outer {\r\n    border: 0;\r\n}\r\n\r\n";
267
+inject(css, undefined, '_1tlt668');
268
+module.exports = css;
269
+
270
+},{"./node_modules/cssify":3}]},{},[1]);

+ 1
- 1
leaflet-side-by-side.min.js
File diff suppressed because it is too large
View File


+ 6
- 6
package.json View File

27
   "author": "Gregor MacLennan / Digital Democracy",
27
   "author": "Gregor MacLennan / Digital Democracy",
28
   "license": "MIT",
28
   "license": "MIT",
29
   "devDependencies": {
29
   "devDependencies": {
30
-    "browserify": "^12.0.1",
31
-    "budo": "^7.0.0",
32
-    "standard": "^5.4.1",
33
-    "uglify-js": "^2.6.1"
30
+    "browserify": "^16.2.2",
31
+    "budo": "^11.2.0",
32
+    "standard": "^11.0.1",
33
+    "uglify-js": "^3.3.24"
34
   },
34
   },
35
   "dependencies": {
35
   "dependencies": {
36
-    "browserify-shim": "^3.8.11",
36
+    "browserify-shim": "^3.8.14",
37
     "css-img-datauri-stream": "^0.1.5",
37
     "css-img-datauri-stream": "^0.1.5",
38
-    "cssify": "^0.8.0",
38
+    "cssify": "^1.0.3",
39
     "leaflet": ">=0.7.7 <2.0.0"
39
     "leaflet": ">=0.7.7 <2.0.0"
40
   },
40
   },
41
   "repository": {
41
   "repository": {

Loading…
Cancel
Save