Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurício Meneghini Fauth <mauricio@fauth.dev>2022-06-30 21:37:44 +0300
committerMaurício Meneghini Fauth <mauricio@fauth.dev>2022-06-30 21:37:44 +0300
commit4ea8a2fb34382312417d9a16da5cc7c3b6bfbe67 (patch)
treeca30cc7a876b6b013673e68dc5c00d8ad23861dd
parentbffe4a89c2eb4926f6eb6621afe7529a6944d609 (diff)
Assign indexes global vars to the window object
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
-rw-r--r--js/src/functions.js15
-rw-r--r--js/src/indexes.js22
-rw-r--r--js/src/table/structure.js10
3 files changed, 19 insertions, 28 deletions
diff --git a/js/src/functions.js b/js/src/functions.js
index 669f4b8b18..1cb8758325 100644
--- a/js/src/functions.js
+++ b/js/src/functions.js
@@ -59,36 +59,31 @@ window.centralColumnList = [];
* Array to hold 'Primary' index columns.
* @type {array}
*/
-// eslint-disable-next-line no-unused-vars
-var primaryIndexes = [];
+window.primaryIndexes = [];
/**
* Array to hold 'Unique' index columns.
* @type {array}
*/
-// eslint-disable-next-line no-unused-vars
-var uniqueIndexes = [];
+window.uniqueIndexes = [];
/**
* Array to hold 'Index' columns.
* @type {array}
*/
-// eslint-disable-next-line no-unused-vars
-var indexes = [];
+window.indexes = [];
/**
* Array to hold 'Fulltext' columns.
* @type {array}
*/
-// eslint-disable-next-line no-unused-vars
-var fulltextIndexes = [];
+window.fulltextIndexes = [];
/**
* Array to hold 'Spatial' columns.
* @type {array}
*/
-// eslint-disable-next-line no-unused-vars
-var spatialIndexes = [];
+window.spatialIndexes = [];
/**
* Make sure that ajax requests will not be cached by appending a random variable to their parameters.
diff --git a/js/src/indexes.js b/js/src/indexes.js
index 6befac9ae0..beeadaeb46 100644
--- a/js/src/indexes.js
+++ b/js/src/indexes.js
@@ -7,8 +7,6 @@
* @required js/functions.js
*/
-/* global fulltextIndexes:writable, indexes:writable, primaryIndexes:writable, spatialIndexes:writable, uniqueIndexes:writable */ // js/functions.js
-
var Indexes = {};
/**
@@ -23,19 +21,19 @@ Indexes.getIndexArray = function (indexChoice) {
switch (indexChoice.toLowerCase()) {
case 'primary':
- sourceArray = primaryIndexes;
+ sourceArray = window.primaryIndexes;
break;
case 'unique':
- sourceArray = uniqueIndexes;
+ sourceArray = window.uniqueIndexes;
break;
case 'index':
- sourceArray = indexes;
+ sourceArray = window.indexes;
break;
case 'fulltext':
- sourceArray = fulltextIndexes;
+ sourceArray = window.fulltextIndexes;
break;
case 'spatial':
- sourceArray = spatialIndexes;
+ sourceArray = window.spatialIndexes;
break;
default:
return null;
@@ -568,11 +566,11 @@ Indexes.off = () => function () {
*/
Indexes.on = () => function () {
// Re-initialize variables.
- primaryIndexes = [];
- uniqueIndexes = [];
- indexes = [];
- fulltextIndexes = [];
- spatialIndexes = [];
+ window.primaryIndexes = [];
+ window.uniqueIndexes = [];
+ window.indexes = [];
+ window.fulltextIndexes = [];
+ window.spatialIndexes = [];
// for table creation form
var $engineSelector = $('.create_table_form select[name=tbl_storage_engine]');
diff --git a/js/src/table/structure.js b/js/src/table/structure.js
index 81e48c24be..526b5ec2e1 100644
--- a/js/src/table/structure.js
+++ b/js/src/table/structure.js
@@ -7,8 +7,6 @@
* @required js/functions.js
*/
-// eslint-disable-next-line no-unused-vars
-/* global primaryIndexes:writable, indexes:writable, fulltextIndexes:writable, spatialIndexes:writable */ // js/functions.js
/* global sprintf */ // js/vendor/sprintf.js
/**
@@ -57,10 +55,10 @@ window.AJAX.registerTeardown('table/structure.js', function () {
window.AJAX.registerOnload('table/structure.js', function () {
// Re-initialize variables.
- primaryIndexes = [];
- indexes = [];
- fulltextIndexes = [];
- spatialIndexes = [];
+ window.primaryIndexes = [];
+ window.indexes = [];
+ window.fulltextIndexes = [];
+ window.spatialIndexes = [];
/**
*Ajax action for submitting the "Column Change" and "Add Column" form