diff --git a/Makefile b/Makefile
index 1f54c32..382b18b 100644
--- a/Makefile
+++ b/Makefile
@@ -56,7 +56,7 @@ distclean: clean
.PHONY: lint
lint:
$(MAKE) -C js/ lint
- #$(MAKE) -C js/mobile lint
+ $(MAKE) -C js/mobile lint
clean:
make -C js clean
diff --git a/js/mobile/Makefile b/js/mobile/Makefile
index 862dffe..eb39408 100644
--- a/js/mobile/Makefile
+++ b/js/mobile/Makefile
@@ -1,6 +1,7 @@
# caution: order is important
MOBILESRC= \
+ prelude.js \
component.js \
loginscreen.js \
mailview.js \
@@ -8,6 +9,9 @@ MOBILESRC= \
utils.js \
app.js \
+lint: pmgmanagerlib-mobile.js
+ eslint $^
+
pmgmanagerlib-mobile.js: ${MOBILESRC}
cat $^ >$@.tmp
mv $@.tmp $@
diff --git a/js/mobile/app.js b/js/mobile/app.js
index e2e13e4..4d00c12 100644
--- a/js/mobile/app.js
+++ b/js/mobile/app.js
@@ -1,5 +1,5 @@
-var $$ = Dom7;
-var app = new Framework7({
+$$ = Dom7;
+app = new Framework7({
root: '#app',
init: false,
name: 'Proxmox Mail Gateway',
@@ -73,6 +73,6 @@ var app = new Framework7({
],
});
-let quarlist = new QuarantineView();
+let _quarantine_view = new QuarantineView();
app.init();
diff --git a/js/mobile/mailview.js b/js/mobile/mailview.js
index 3645b81..bc2b035 100644
--- a/js/mobile/mailview.js
+++ b/js/mobile/mailview.js
@@ -52,7 +52,8 @@ class MailView extends Component {
-
+
`;
diff --git a/js/mobile/prelude.js b/js/mobile/prelude.js
new file mode 100644
index 0000000..4420f58
--- /dev/null
+++ b/js/mobile/prelude.js
@@ -0,0 +1,4 @@
+/* global Framework7, Template7, Dom7 */
+
+var $$ = Dom7;
+var app, PMG; // set in app.js
diff --git a/js/mobile/quarantineview.js b/js/mobile/quarantineview.js
index 721c28b..4a3ad54 100644
--- a/js/mobile/quarantineview.js
+++ b/js/mobile/quarantineview.js
@@ -6,7 +6,8 @@ class QuarantineView extends Component {
-

+
Mail Gateway
@@ -142,7 +143,7 @@ class QuarantineView extends Component {
});
// setup pull to refresh
- $$('.ptr-content').on('ptr:refresh', (e) => {
+ $$('.ptr-content').on('ptr:refresh', (ev) => {
me.setItems([
{ skel: true, divider: true },
{ skel: true },
@@ -167,7 +168,7 @@ class QuarantineView extends Component {
grouperFn: (val) => PMG.Utils.unixToIso(val.time),
});
}).catch(PMG.Utils.showError).then(() => {
- e.detail();
+ ev.detail();
});
});
@@ -220,8 +221,8 @@ class QuarantineView extends Component {
let date = starttime;
if (!(starttime instanceof Date)) {
// we assume an ISO string
- if (starttime == '') {
- return;
+ if (starttime === '') {
+ return null;
}
date = new Date(PMG.Utils.isoToUnix(starttime)*1000);
}
@@ -238,8 +239,8 @@ class QuarantineView extends Component {
var me = this;
let date = endtime;
if (!(endtime instanceof Date)) {
- if (endtime == '') {
- return;
+ if (endtime === '') {
+ return null;
}
// we assume an ISO string
date = new Date(PMG.Utils.isoToUnix(endtime)*1000);
@@ -323,7 +324,7 @@ class QuarantineView extends Component {
for (let i = 0; i+offset < items.length; i++) {
let item = items[i+offset];
let curgroup = options.grouperFn(item);
- if (curgroup != lastgroup) {
+ if (curgroup !== lastgroup) {
me.vList.insertItemBefore(i+offset++, {
divider: true,
group: curgroup,
diff --git a/js/mobile/utils.js b/js/mobile/utils.js
index f1acb08..9e6eb66 100644
--- a/js/mobile/utils.js
+++ b/js/mobile/utils.js
@@ -1,4 +1,4 @@
-var PMG = {
+PMG = {
Utils: {
getCookie(name) {
let cookies = document.cookie.split(/;\s*/);
@@ -73,7 +73,7 @@ var PMG = {
let mail, action, date, username, ticket;
if (queryObj.ticket) {
let tocheck = decodeURIComponent(queryObj.ticket);
- let match = tocheck.match(/^PMGQUAR:([^\s\:]+):/);
+ let match = tocheck.match(/^PMGQUAR:([^\s:]+):/);
if (match) {
ticket = tocheck;
username = match[1];