Skip to content
Snippets Groups Projects
Commit 242b8645 authored by Henry Castro's avatar Henry Castro
Browse files

loleaflet: fixed js lint errors in js/global.js

Change-Id: I81d9371e6bfb8eec9e3290e863d89d3f1cb53c40
parent 4cc7e019
No related branches found
No related tags found
No related merge requests found
# We only directly edit toolbar.js in dist/
dist/**/*.js
!dist/toolbar/toolbar.js
**/js/w2ui-1.5.rc1.js
**/src/admin/Base.js
**/src/unocommands.js
......@@ -137,7 +137,7 @@ $(builddir)/dist/admin-bundle.js: $(LOLEAFLET_ADMIN_DST) $(BOOTSTRAP_DST) $(CURS
if ENABLE_DEBUG
$(LOLEAFLET_PREFIX)/dist/loleaflet-src.js: $(LOLEAFLET_JS_DST) $(LOLEAFLET_DRAW_JS_DST)
@echo "Checking loleaflet for JS errors..."
@NODE_PATH=$(abs_builddir)/node_modules $(NODE) node_modules/eslint/bin/eslint.js $(srcdir)/src --ignore-path $(srcdir)/.eslintignore --config $(srcdir)/.eslintrc
@NODE_PATH=$(abs_builddir)/node_modules $(NODE) node_modules/eslint/bin/eslint.js $(srcdir)/src $(srcdir)/js --ignore-path $(srcdir)/.eslintignore --config $(srcdir)/.eslintrc
@cp -a $(srcdir)/plugins/draw-$(DRAW_VERSION)/dist/images/* $(builddir)/dist/images/
# @$(NODE) node_modules/eslint/bin/eslint.js $(srcdir)/plugins/draw-$(DRAW_VERSION)/src --ignore-path $(srcdir)/.eslintignore --config $(srcdir)/.eslintrc
@touch $@
......@@ -156,7 +156,7 @@ else
$(LOLEAFLET_PREFIX)/dist/loleaflet-src.js: $(LOLEAFLET_JS_SRC)
@mkdir -p $(dir $@)
@echo "Checking loleaflet for JS errors..."
@NODE_PATH=$(abs_builddir)/node_modules $(NODE) node_modules/eslint/bin/eslint.js $(srcdir)/src --ignore-path $(srcdir)/.eslintignore --config $(srcdir)/.eslintrc
@NODE_PATH=$(abs_builddir)/node_modules $(NODE) node_modules/eslint/bin/eslint.js $(srcdir)/src $(srcdir)/js --ignore-path $(srcdir)/.eslintignore --config $(srcdir)/.eslintrc
@echo "Concatenating loleaflet files..."
@(cat $(srcdir)/src/copyright.js | sed 's/{VERSION}/$(LOLEAFLET_VERSION)/' - \
&& echo "(function (window, document, undefined) {" \
......
/* global loleafletLogging */
/*eslint indent: [error, "tab", { "outerIIFEBody": 0 }]*/
(function (global) {
// If not debug, don't print anything on the console
// except in tile debug mode (Ctrl-Shift-Alt-d)
console.log2 = console.log;
if (loleaflet_logging !== 'true') {
if (loleafletLogging !== 'true') {
var methods = ['warn', 'info', 'debug', 'trace', 'log', 'assert', 'time', 'timeEnd'];
for (var i = 0; i < methods.length; i++) {
console[methods[i]] = function() {};
......@@ -19,10 +21,10 @@ global.require = function (path) {
};
global.getParameterByName = function (name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : results[1].replace(/\+/g, " ");
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : results[1].replace(/\+/g, ' ');
};
global._ = function (string) {
......
......@@ -3,6 +3,7 @@
*/
/* global $ closebutton w2ui w2utils vex _ _UNO */
/*eslint indent: [error, "tab", { "outerIIFEBody": 0 }]*/
(function(global) {
var map;
......
......@@ -102,10 +102,10 @@ ifelse(DEBUG,[true],foreachq([fileCSS],[LOLEAFLET_CSS],[<link rel="stylesheet" h
<script>
window.host = '%HOST%';
window.access_token = '%ACCESS_TOKEN%';
window.access_token_ttl = '%ACCESS_TOKEN_TTL%';
window.access_header = '%ACCESS_HEADER%';
window.loleaflet_logging = '%LOLEAFLET_LOGGING%';
window.accessToken = '%ACCESS_TOKEN%';
window.accessTokenTTL = '%ACCESS_TOKEN_TTL%';
window.accessHeader = '%ACCESS_HEADER%';
window.loleafletLogging = '%LOLEAFLET_LOGGING%';
window.outOfFocusTimeoutSecs = %OUT_OF_FOCUS_TIMEOUT_SECS%;
window.idleTimeoutSecs = %IDLE_TIMEOUT_SECS%;
</script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment