aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.jshintignore4
-rw-r--r--.jshintrc8
-rw-r--r--.travis.yml9
-rw-r--r--p/scripts/install.js14
4 files changed, 28 insertions, 7 deletions
diff --git a/.jshintignore b/.jshintignore
new file mode 100644
index 000000000..80bbc5b89
--- /dev/null
+++ b/.jshintignore
@@ -0,0 +1,4 @@
+node_modules
+p/scripts/bcrypt.min.js
+p/scripts/flotr2.min.js
+p/scripts/jquery.min.js
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 000000000..07d282b1c
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,8 @@
+{
+ "esversion" : 6,
+ "browser" : true,
+ "globals": {
+ "confirm": true,
+ "console": true
+ }
+}
diff --git a/.travis.yml b/.travis.yml
index 44bc59e3f..1ec2aeb65 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -34,6 +34,15 @@ matrix:
dist: precise
- php: "7.2"
env: CHECK_TRANSLATION=yes VALIDATE_STANDARD=no
+ - language: node_js
+ node_js:
+ - "node"
+ php:
+ # none
+ install:
+ - npm install jshint
+ script:
+ - node_modules/jshint/bin/jshint .
allow_failures:
- env: CHECK_TRANSLATION=yes VALIDATE_STANDARD=no
- dist: precise
diff --git a/p/scripts/install.js b/p/scripts/install.js
index b7975fd6e..967d27627 100644
--- a/p/scripts/install.js
+++ b/p/scripts/install.js
@@ -1,15 +1,15 @@
"use strict";
/* jshint globalstrict: true */
-function show_password() {
- var button = this;
+function show_password(ev) {
+ var button = ev.target;
var passwordField = document.getElementById(button.getAttribute('data-toggle'));
passwordField.setAttribute('type', 'text');
button.className += ' active';
return false;
}
-function hide_password() {
- var button = this;
+function hide_password(ev) {
+ var button = ev.target;
var passwordField = document.getElementById(button.getAttribute('data-toggle'));
passwordField.setAttribute('type', 'password');
button.className = button.className.replace(/(?:^|\s)active(?!\S)/g , '');
@@ -61,10 +61,10 @@ if (bd_type) {
bd_type.addEventListener('change', mySqlShowHide);
}
-function ask_confirmation(e) {
- var str_confirmation = this.getAttribute('data-str-confirm');
+function ask_confirmation(ev) {
+ var str_confirmation = ev.target.getAttribute('data-str-confirm');
if (!confirm(str_confirmation)) {
- e.preventDefault();
+ ev.preventDefault();
}
}
var confirms = document.getElementsByClassName('confirm');