[Libreoffice-commits] online.git: loleaflet/.eslintignore loleaflet/js loleaflet/loleaflet.html.m4 loleaflet/Makefile.am
Henry Castro
hcastro at collabora.com
Thu May 24 14:46:15 UTC 2018
loleaflet/.eslintignore | 3 +--
loleaflet/Makefile.am | 4 ++--
loleaflet/js/global.js | 12 +++++++-----
loleaflet/js/toolbar.js | 1 +
loleaflet/loleaflet.html.m4 | 8 ++++----
5 files changed, 15 insertions(+), 13 deletions(-)
New commits:
commit 242b86454d1b6e3c1195833cfdc43b272b4fc650
Author: Henry Castro <hcastro at collabora.com>
Date: Thu May 24 10:43:43 2018 -0400
loleaflet: fixed js lint errors in js/global.js
Change-Id: I81d9371e6bfb8eec9e3290e863d89d3f1cb53c40
diff --git a/loleaflet/.eslintignore b/loleaflet/.eslintignore
index 4ddb46e95..2da73fac2 100644
--- a/loleaflet/.eslintignore
+++ b/loleaflet/.eslintignore
@@ -1,6 +1,5 @@
# 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
diff --git a/loleaflet/Makefile.am b/loleaflet/Makefile.am
index 26f4a85cb..980ff833f 100644
--- a/loleaflet/Makefile.am
+++ b/loleaflet/Makefile.am
@@ -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) {" \
diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js
index 2b259ce2c..c0e85d235 100644
--- a/loleaflet/js/global.js
+++ b/loleaflet/js/global.js
@@ -1,9 +1,11 @@
+/* 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) {
diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 174cc6ed6..77a08c152 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -3,6 +3,7 @@
*/
/* global $ closebutton w2ui w2utils vex _ _UNO */
+/*eslint indent: [error, "tab", { "outerIIFEBody": 0 }]*/
(function(global) {
var map;
diff --git a/loleaflet/loleaflet.html.m4 b/loleaflet/loleaflet.html.m4
index 1a590d273..ed7286615 100644
--- a/loleaflet/loleaflet.html.m4
+++ b/loleaflet/loleaflet.html.m4
@@ -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>
More information about the Libreoffice-commits
mailing list