Skip to content

Commit 94206e9

Browse files
Merge pull request #17625 from MauricioFauth/js-module-import-jquery
Use JavaScript module to import jQuery
2 parents 0056236 + 2a4c582 commit 94206e9

82 files changed

Lines changed: 178 additions & 59 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ js/vendor/
22
js/dist/
33
tmp/
44
vendor/
5-
webpack.config.js
5+
webpack.config.cjs

.eslintrc.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
},
1212
"env": {
1313
"browser": true,
14-
"es6": true,
15-
"jquery": true
14+
"es6": true
1615
},
1716
"globals": {
1817
"Functions": "readonly"

jest.config.js renamed to jest.config.cjs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@ module.exports = {
66
projects: [
77
{
88
verbose: true,
9-
setupFiles: ['<rootDir>/test/jest/test-env.js'],
109
coveragePathIgnorePatterns: [
1110
'<rootDir>/node_modules/',
1211
'<rootDir>/js/vendor/',
1312
],
1413
displayName: 'phpMyAdmin',
1514
testMatch: ['<rootDir>/test/javascript/**/*.js'],
16-
transform: {
17-
'^.+\\.js$': '<rootDir>/test/jest/file-transformer.js'
18-
},
15+
transform: {},
1916
moduleNameMapper: {
2017
'^phpmyadmin/(.*)$': '<rootDir>/js/src/$1',
2118
'^@vendor/(.*)$': '<rootDir>/js/vendor/$1',

js/src/ajax.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import $ from 'jquery';
2+
13
/* global Navigation */
24

35
/**
@@ -196,7 +198,7 @@ window.AJAX = {
196198
}
197199
// Show lock icon if locked targets is not empty.
198200
// otherwise remove lock icon
199-
if (!jQuery.isEmptyObject(window.AJAX.lockedTargets)) {
201+
if (! $.isEmptyObject(window.AJAX.lockedTargets)) {
200202
$('#lock_page_icon').html(Functions.getImage('s_lock', window.Messages.strLockToolTip).toString());
201203
} else {
202204
$('#lock_page_icon').html('');
@@ -261,7 +263,7 @@ window.AJAX = {
261263
// the click event is not triggered by script
262264
if (typeof event !== 'undefined' && event.type === 'click' &&
263265
event.isTrigger !== true &&
264-
!jQuery.isEmptyObject(window.AJAX.lockedTargets) &&
266+
! $.isEmptyObject(window.AJAX.lockedTargets) &&
265267
confirm(window.Messages.strConfirmNavigation) === false
266268
) {
267269
return false;

js/src/chart.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import $ from 'jquery';
2+
13
/**
24
* Chart type enumerations
35
*/

js/src/codemirror/addon/lint/sql-lint.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import $ from 'jquery';
2+
13
window.CodeMirror.sqlLint = function (text, updateLinting, options, cm) {
24
// Skipping check if text box is empty.
35
if (text.trim() === '') {

js/src/common.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import $ from 'jquery';
2+
13
/* global Navigation */
24

35
/**

js/src/config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import $ from 'jquery';
2+
13
/**
24
* Functions used in configuration forms and on user preferences pages
35
*/

js/src/database/central_columns.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import $ from 'jquery';
2+
13
/**
24
* @fileoverview events handling from central columns page
35
* @name Central columns

js/src/database/events.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import $ from 'jquery';
2+
13
/* global Navigation */
24

35
window.AJAX.registerTeardown('database/events.js', function () {

0 commit comments

Comments
 (0)