diff options
-rw-r--r-- | .eslintrc.json | 6 | ||||
-rw-r--r-- | js/src/ajax.js | 2 | ||||
-rw-r--r-- | js/src/common.js | 2 | ||||
-rw-r--r-- | js/src/database/events.js | 2 | ||||
-rw-r--r-- | js/src/database/operations.js | 2 | ||||
-rw-r--r-- | js/src/database/routines.js | 2 | ||||
-rw-r--r-- | js/src/database/structure.js | 2 | ||||
-rw-r--r-- | js/src/database/triggers.js | 2 | ||||
-rw-r--r-- | js/src/functions.js | 1 | ||||
-rw-r--r-- | js/src/indexes.js | 2 | ||||
-rw-r--r-- | js/src/main.js | 1 | ||||
-rw-r--r-- | js/src/makegrid.js | 1 | ||||
-rw-r--r-- | js/src/server/databases.js | 2 | ||||
-rw-r--r-- | js/src/server/privileges.js | 2 | ||||
-rw-r--r-- | js/src/sql.js | 19 | ||||
-rw-r--r-- | js/src/table/operations.js | 2 | ||||
-rw-r--r-- | js/src/table/structure.js | 1 | ||||
-rw-r--r-- | js/src/table/zoom_plot_jqplot.js | 1 |
18 files changed, 38 insertions, 14 deletions
diff --git a/.eslintrc.json b/.eslintrc.json index c332f7b613..f69d501621 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -15,12 +15,8 @@ "jquery": true }, "globals": { - "Cookies": "readonly", "Functions": "readonly", - "Messages": "readonly", - "Navigation": "readonly", - "OpenLayers": "readonly", - "Sql": "readonly" + "Messages": "readonly" }, "rules": { "valid-jsdoc": ["error", { diff --git a/js/src/ajax.js b/js/src/ajax.js index 7df310511c..6a54781ed0 100644 --- a/js/src/ajax.js +++ b/js/src/ajax.js @@ -1,3 +1,5 @@ +/* global Navigation */ + /** * This object handles ajax requests for pages. It also * handles the reloading of the main menu and scripts. diff --git a/js/src/common.js b/js/src/common.js index c79d780258..ca651f7b7a 100644 --- a/js/src/common.js +++ b/js/src/common.js @@ -1,3 +1,5 @@ +/* global Navigation */ + /** * Holds common parameters such as server, db, table, etc * diff --git a/js/src/database/events.js b/js/src/database/events.js index f303d2bf37..f54e1b2dca 100644 --- a/js/src/database/events.js +++ b/js/src/database/events.js @@ -1,3 +1,5 @@ +/* global Navigation */ + window.AJAX.registerTeardown('database/events.js', function () { $(document).off('click', 'a.ajax.add_anchor, a.ajax.edit_anchor'); $(document).off('click', 'a.ajax.export_anchor'); diff --git a/js/src/database/operations.js b/js/src/database/operations.js index 0c323711f2..e13e8fd76f 100644 --- a/js/src/database/operations.js +++ b/js/src/database/operations.js @@ -1,3 +1,5 @@ +/* global Navigation */ + /** * @fileoverview function used in server privilege pages * @name Database Operations diff --git a/js/src/database/routines.js b/js/src/database/routines.js index 229d104411..e2e6c4de23 100644 --- a/js/src/database/routines.js +++ b/js/src/database/routines.js @@ -1,3 +1,5 @@ +/* global Navigation */ + window.AJAX.registerTeardown('database/routines.js', function () { $(document).off('click', 'a.ajax.add_anchor'); $(document).off('click', 'a.ajax.edit_anchor'); diff --git a/js/src/database/structure.js b/js/src/database/structure.js index 2634f32db7..cb83d95f87 100644 --- a/js/src/database/structure.js +++ b/js/src/database/structure.js @@ -1,3 +1,5 @@ +/* global Navigation */ + /** * @fileoverview functions used on the database structure page * @name Database Structure diff --git a/js/src/database/triggers.js b/js/src/database/triggers.js index f63ec44048..8c8c486a6c 100644 --- a/js/src/database/triggers.js +++ b/js/src/database/triggers.js @@ -1,3 +1,5 @@ +/* global Navigation */ + window.AJAX.registerTeardown('database/triggers.js', function () { $(document).off('click', 'a.ajax.add_anchor, a.ajax.edit_anchor'); $(document).off('click', 'a.ajax.export_anchor'); diff --git a/js/src/functions.js b/js/src/functions.js index 737a16321a..8f8307fadc 100644 --- a/js/src/functions.js +++ b/js/src/functions.js @@ -1,3 +1,4 @@ +/* global Navigation */ /* global isStorageSupported */ // js/config.js /* global ChartType, ColumnType, DataTable, JQPlotChartFactory */ // js/chart.js /* global DatabaseStructure */ // js/database/structure.js diff --git a/js/src/indexes.js b/js/src/indexes.js index beeadaeb46..a0852b7da3 100644 --- a/js/src/indexes.js +++ b/js/src/indexes.js @@ -1,3 +1,5 @@ +/* global Navigation */ + /** * @fileoverview function used for index manipulation pages * @name Table Structure diff --git a/js/src/main.js b/js/src/main.js index c199a67fc7..db123c94ba 100644 --- a/js/src/main.js +++ b/js/src/main.js @@ -1,4 +1,5 @@ /* global Indexes */ +/* global Navigation */ window.AJAX.registerOnload('functions.js', () => window.AJAX.removeSubmitEvents()); $(window.AJAX.loadEventHandler()); diff --git a/js/src/makegrid.js b/js/src/makegrid.js index 8d8f1ffcf2..4b6de341a7 100644 --- a/js/src/makegrid.js +++ b/js/src/makegrid.js @@ -1,3 +1,4 @@ +/* global Sql */ /* global firstDayOfCalendar */ // templates/javascript/variables.twig /** diff --git a/js/src/server/databases.js b/js/src/server/databases.js index 209ad96092..21cdce87fb 100644 --- a/js/src/server/databases.js +++ b/js/src/server/databases.js @@ -1,3 +1,5 @@ +/* global Navigation */ + /** * @implements EventListener */ diff --git a/js/src/server/privileges.js b/js/src/server/privileges.js index 0c8f6d03f9..4522ef4065 100644 --- a/js/src/server/privileges.js +++ b/js/src/server/privileges.js @@ -1,3 +1,5 @@ +/* global Navigation */ + /** * Export privileges modal handler * diff --git a/js/src/sql.js b/js/src/sql.js index df7ca19f8d..661ba78cc3 100644 --- a/js/src/sql.js +++ b/js/src/sql.js @@ -7,6 +7,7 @@ * @test-module Sql */ +/* global Navigation */ /* global isStorageSupported */ // js/config.js /* global makeGrid */ // js/makegrid.js /* global themeImagePath */ // templates/javascript/variables.twig @@ -49,7 +50,7 @@ Sql.autoSave = function (query) { if (isStorageSupported('localStorage')) { window.localStorage.setItem(key, query); } else { - Cookies.set(key, query, { path: window.CommonParams.get('rootPath') }); + window.Cookies.set(key, query, { path: window.CommonParams.get('rootPath') }); } } }; @@ -72,8 +73,8 @@ Sql.showThisQuery = function (db, table, query) { window.localStorage.showThisQuery = 1; window.localStorage.showThisQueryObject = JSON.stringify(showThisQueryObject); } else { - Cookies.set('showThisQuery', 1, { path: window.CommonParams.get('rootPath') }); - Cookies.set('showThisQueryObject', JSON.stringify(showThisQueryObject), { path: window.CommonParams.get('rootPath') }); + window.Cookies.set('showThisQuery', 1, { path: window.CommonParams.get('rootPath') }); + window.Cookies.set('showThisQueryObject', JSON.stringify(showThisQueryObject), { path: window.CommonParams.get('rootPath') }); } }; @@ -117,7 +118,7 @@ Sql.autoSaveWithSort = function (query) { if (isStorageSupported('localStorage')) { window.localStorage.setItem('autoSavedSqlSort', query); } else { - Cookies.set('autoSavedSqlSort', query, { path: window.CommonParams.get('rootPath') }); + window.Cookies.set('autoSavedSqlSort', query, { path: window.CommonParams.get('rootPath') }); } } }; @@ -131,7 +132,7 @@ Sql.clearAutoSavedSort = function () { if (isStorageSupported('localStorage')) { window.localStorage.removeItem('autoSavedSqlSort'); } else { - Cookies.set('autoSavedSqlSort', '', { path: window.CommonParams.get('rootPath') }); + window.Cookies.set('autoSavedSqlSort', '', { path: window.CommonParams.get('rootPath') }); } }; @@ -304,8 +305,8 @@ const insertQuery = function (queryType) { if (isStorageSupported('localStorage') && typeof window.localStorage.getItem(key) === 'string') { setQuery(window.localStorage.getItem(key)); - } else if (Cookies.get(key, { path: window.CommonParams.get('rootPath') })) { - setQuery(Cookies.get(key, { path: window.CommonParams.get('rootPath') })); + } else if (window.Cookies.get(key, { path: window.CommonParams.get('rootPath') })) { + setQuery(window.Cookies.get(key, { path: window.CommonParams.get('rootPath') })); } else { Functions.ajaxShowMessage(Messages.strNoAutoSavedQuery); } @@ -476,7 +477,7 @@ window.AJAX.registerOnload('sql.js', function () { Sql.clearAutoSavedSort(); } // If sql query with sort for current table is stored, change sort by key select value - var sortStoredQuery = useLocalStorageValue ? window.localStorage.autoSavedSqlSort : Cookies.get('autoSavedSqlSort', { path: window.CommonParams.get('rootPath') }); + var sortStoredQuery = useLocalStorageValue ? window.localStorage.autoSavedSqlSort : window.Cookies.get('autoSavedSqlSort', { path: window.CommonParams.get('rootPath') }); if (typeof sortStoredQuery !== 'undefined' && sortStoredQuery !== $('select[name="sql_query"]').val() && $('select[name="sql_query"] option[value="' + sortStoredQuery + '"]').length !== 0) { $('select[name="sql_query"]').val(sortStoredQuery).trigger('change'); } @@ -1206,7 +1207,7 @@ Sql.checkSavedQuery = function () { if (isStorageSupported('localStorage') && typeof window.localStorage.getItem(key) === 'string') { Functions.ajaxShowMessage(Messages.strPreviousSaveQuery); - } else if (Cookies.get(key, { path: window.CommonParams.get('rootPath') })) { + } else if (window.Cookies.get(key, { path: window.CommonParams.get('rootPath') })) { Functions.ajaxShowMessage(Messages.strPreviousSaveQuery); } }; diff --git a/js/src/table/operations.js b/js/src/table/operations.js index ea8f381c28..a164e59f32 100644 --- a/js/src/table/operations.js +++ b/js/src/table/operations.js @@ -1,3 +1,5 @@ +/* global Navigation */ + /** * Unbind all event handlers before tearing down a page */ diff --git a/js/src/table/structure.js b/js/src/table/structure.js index 526b5ec2e1..ee6c1b5691 100644 --- a/js/src/table/structure.js +++ b/js/src/table/structure.js @@ -7,6 +7,7 @@ * @required js/functions.js */ +/* global Navigation */ /* global sprintf */ // js/vendor/sprintf.js /** diff --git a/js/src/table/zoom_plot_jqplot.js b/js/src/table/zoom_plot_jqplot.js index 2e364f68c3..a67d9b6807 100644 --- a/js/src/table/zoom_plot_jqplot.js +++ b/js/src/table/zoom_plot_jqplot.js @@ -6,6 +6,7 @@ * @requires js/functions.js **/ +/* global Sql */ /* global changeValueFieldType, verifyAfterSearchFieldChange */ // js/table/change.js /** |