From dcdabe79d10c07d8a3b89cfafcf4b6b1814cb463 Mon Sep 17 00:00:00 2001 From: azivner Date: Sat, 21 Oct 2017 21:10:33 -0400 Subject: [PATCH] use strict in all JS files --- app.js | 2 ++ routes/api/audit.js | 2 ++ routes/api/migration.js | 2 ++ routes/api/note_history.js | 2 ++ routes/api/notes.js | 2 ++ routes/api/notes_move.js | 2 ++ routes/api/password.js | 2 ++ routes/api/recent_changes.js | 2 ++ routes/api/settings.js | 2 ++ routes/api/tree.js | 2 ++ routes/index.js | 4 +++- routes/login.js | 2 ++ routes/logout.js | 2 ++ routes/migration.js | 4 +++- services/audit_category.js | 2 ++ services/auth.js | 2 ++ services/backup.js | 2 ++ services/change_password.js | 2 ++ services/config.js | 2 ++ services/my_scrypt.js | 2 ++ services/sql.js | 2 ++ services/sync.js | 3 +++ services/utils.js | 2 ++ 23 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 services/sync.js diff --git a/app.js b/app.js index 293a5bf25..1511491e0 100644 --- a/app.js +++ b/app.js @@ -92,4 +92,6 @@ app.use(function (err, req, res, next) { res.render('error'); }); +require('./services/sync'); + module.exports = app; \ No newline at end of file diff --git a/routes/api/audit.js b/routes/api/audit.js index 7552cd50b..f05b46762 100644 --- a/routes/api/audit.js +++ b/routes/api/audit.js @@ -1,3 +1,5 @@ +"use strict"; + const express = require('express'); const router = express.Router(); const sql = require('../../services/sql'); diff --git a/routes/api/migration.js b/routes/api/migration.js index a33967415..ee88f9a97 100644 --- a/routes/api/migration.js +++ b/routes/api/migration.js @@ -1,3 +1,5 @@ +"use strict"; + const express = require('express'); const router = express.Router(); const auth = require('../../services/auth'); diff --git a/routes/api/note_history.js b/routes/api/note_history.js index 99244ba76..b4a34b644 100644 --- a/routes/api/note_history.js +++ b/routes/api/note_history.js @@ -1,3 +1,5 @@ +"use strict"; + const express = require('express'); const router = express.Router(); const sql = require('../../services/sql'); diff --git a/routes/api/notes.js b/routes/api/notes.js index 7374fefb2..5e548c88e 100644 --- a/routes/api/notes.js +++ b/routes/api/notes.js @@ -1,3 +1,5 @@ +"use strict"; + const express = require('express'); const router = express.Router(); const sql = require('../../services/sql'); diff --git a/routes/api/notes_move.js b/routes/api/notes_move.js index 1912607fd..bf540a12f 100644 --- a/routes/api/notes_move.js +++ b/routes/api/notes_move.js @@ -1,3 +1,5 @@ +"use strict"; + const express = require('express'); const router = express.Router(); const sql = require('../../services/sql'); diff --git a/routes/api/password.js b/routes/api/password.js index c66f8778c..6bddb114a 100644 --- a/routes/api/password.js +++ b/routes/api/password.js @@ -1,3 +1,5 @@ +"use strict"; + const express = require('express'); const router = express.Router(); const sql = require('../../services/sql'); diff --git a/routes/api/recent_changes.js b/routes/api/recent_changes.js index f7b02cc07..79375f210 100644 --- a/routes/api/recent_changes.js +++ b/routes/api/recent_changes.js @@ -1,3 +1,5 @@ +"use strict"; + const express = require('express'); const router = express.Router(); const sql = require('../../services/sql'); diff --git a/routes/api/settings.js b/routes/api/settings.js index 19d6c6bea..2c9af0654 100644 --- a/routes/api/settings.js +++ b/routes/api/settings.js @@ -1,3 +1,5 @@ +"use strict"; + const express = require('express'); const router = express.Router(); const sql = require('../../services/sql'); diff --git a/routes/api/tree.js b/routes/api/tree.js index 85cae7e01..5e5508663 100644 --- a/routes/api/tree.js +++ b/routes/api/tree.js @@ -1,3 +1,5 @@ +"use strict"; + const express = require('express'); const router = express.Router(); const sql = require('../../services/sql'); diff --git a/routes/index.js b/routes/index.js index 92fa77f9a..daab5ce07 100644 --- a/routes/index.js +++ b/routes/index.js @@ -1,9 +1,11 @@ +"use strict"; + const express = require('express'); const router = express.Router(); const auth = require('../services/auth'); router.get('', auth.checkAuth, (req, res, next) => { - res.render('index', {}); + res.render('index', {}); }); module.exports = router; diff --git a/routes/login.js b/routes/login.js index 4625ac3d9..e1ca605d0 100644 --- a/routes/login.js +++ b/routes/login.js @@ -1,3 +1,5 @@ +"use strict"; + const express = require('express'); const router = express.Router(); const utils = require('../services/utils'); diff --git a/routes/logout.js b/routes/logout.js index bc1b73700..c93b98a93 100644 --- a/routes/logout.js +++ b/routes/logout.js @@ -1,3 +1,5 @@ +"use strict"; + const express = require('express'); const router = express.Router(); diff --git a/routes/migration.js b/routes/migration.js index 8edb82481..60acbc708 100644 --- a/routes/migration.js +++ b/routes/migration.js @@ -1,9 +1,11 @@ +"use strict"; + const express = require('express'); const router = express.Router(); const auth = require('../services/auth'); router.get('', auth.checkAuth, (req, res, next) => { - res.render('migration', {}); + res.render('migration', {}); }); module.exports = router; diff --git a/services/audit_category.js b/services/audit_category.js index 81f81fa41..5f191f08c 100644 --- a/services/audit_category.js +++ b/services/audit_category.js @@ -1,3 +1,5 @@ +"use strict"; + module.exports = { UPDATE_CONTENT: 'CONTENT', UPDATE_TITLE: 'TITLE', diff --git a/services/auth.js b/services/auth.js index e0fa34aa7..3371e19bf 100644 --- a/services/auth.js +++ b/services/auth.js @@ -1,3 +1,5 @@ +"use strict"; + function checkAuth(req, res, next) { if (!req.session.loggedIn) { res.redirect("login"); diff --git a/services/backup.js b/services/backup.js index e78575b2d..9a93c554b 100644 --- a/services/backup.js +++ b/services/backup.js @@ -1,3 +1,5 @@ +"use strict"; + const utils = require('./utils'); const sql = require('./sql'); const config = require('./config'); diff --git a/services/change_password.js b/services/change_password.js index 73188e384..6eb1e6bc3 100644 --- a/services/change_password.js +++ b/services/change_password.js @@ -1,3 +1,5 @@ +"use strict"; + const sql = require('./sql'); const my_scrypt = require('./my_scrypt'); const utils = require('./utils'); diff --git a/services/config.js b/services/config.js index c0ec0e8fd..ce3c0a99b 100644 --- a/services/config.js +++ b/services/config.js @@ -1,3 +1,5 @@ +"use strict"; + const ini = require('ini'); const fs = require('fs'); diff --git a/services/my_scrypt.js b/services/my_scrypt.js index 520888fd2..83799f534 100644 --- a/services/my_scrypt.js +++ b/services/my_scrypt.js @@ -1,3 +1,5 @@ +"use strict"; + const sql = require('./sql'); const scrypt = require('scrypt'); diff --git a/services/sql.js b/services/sql.js index e61f72e7d..edd5b1f3d 100644 --- a/services/sql.js +++ b/services/sql.js @@ -1,3 +1,5 @@ +"use strict"; + const db = require('sqlite'); const utils = require('./utils'); diff --git a/services/sync.js b/services/sync.js new file mode 100644 index 000000000..1ad726f86 --- /dev/null +++ b/services/sync.js @@ -0,0 +1,3 @@ +"use strict"; + +//setInterval(); \ No newline at end of file diff --git a/services/utils.js b/services/utils.js index 31f05ff95..1a72cee21 100644 --- a/services/utils.js +++ b/services/utils.js @@ -1,3 +1,5 @@ +"use strict"; + const crypto = require('crypto'); function randomToken(length) {