diff --git a/js/src/database/query_generator.js b/js/src/database/query_generator.js index 1dd99fd429..b09ef5fae7 100644 --- a/js/src/database/query_generator.js +++ b/js/src/database/query_generator.js @@ -8,8 +8,6 @@ * */ -/* global sprintf */ // js/vendor/sprintf.js - function getFormatsText () { return { '=': ' = \'%s\'', @@ -37,7 +35,7 @@ function generateCondition (criteriaDiv, table) { query += '`' + Functions.escapeBacktick(table.siblings('.columnNameSelect').first().val()) + '`'; if (criteriaDiv.find('.criteria_rhs').first().val() === 'text') { var formatsText = getFormatsText(); - query += sprintf(formatsText[criteriaDiv.find('.criteria_op').first().val()], Functions.escapeSingleQuote(criteriaDiv.find('.rhs_text_val').first().val())); + query += window.sprintf(formatsText[criteriaDiv.find('.criteria_op').first().val()], Functions.escapeSingleQuote(criteriaDiv.find('.rhs_text_val').first().val())); } else { query += ' ' + criteriaDiv.find('.criteria_op').first().val(); query += ' `' + Functions.escapeBacktick(criteriaDiv.find('.tableNameSelect').first().val()) + '`.'; diff --git a/js/src/error_report.js b/js/src/error_report.js index d8043b3de7..d91c8f108e 100644 --- a/js/src/error_report.js +++ b/js/src/error_report.js @@ -1,6 +1,3 @@ - -/* global TraceKit */ // js/vendor/tracekit.js - /** * general function, usually for data manipulation pages * @@ -246,7 +243,7 @@ var ErrorReport = { try { return func.apply(this, arguments); } catch (x) { - TraceKit.report(x); + window.TraceKit.report(x); } }; newFunc.wrapped = true; @@ -299,6 +296,6 @@ var ErrorReport = { }; window.AJAX.registerOnload('error_report.js', function () { - TraceKit.report.subscribe(ErrorReport.errorHandler); + window.TraceKit.report.subscribe(ErrorReport.errorHandler); ErrorReport.setUpErrorReporting(); }); diff --git a/js/src/functions.js b/js/src/functions.js index 8f8307fadc..ea219b7f1c 100644 --- a/js/src/functions.js +++ b/js/src/functions.js @@ -5,8 +5,6 @@ /* global mysqlDocBuiltin, mysqlDocKeyword */ // js/doclinks.js /* global Indexes */ // js/indexes.js /* global firstDayOfCalendar, maxInputVars, mysqlDocTemplate, themeImagePath */ // templates/javascript/variables.twig -/* global sprintf */ // js/vendor/sprintf.js -/* global zxcvbnts */ // js/vendor/zxcvbn-ts.js /** * General functions, usually for data manipulation pages. @@ -449,7 +447,7 @@ Functions.escapeSingleQuote = function (s) { }; Functions.sprintf = function () { - return sprintf.apply(this, arguments); + return window.sprintf.apply(this, arguments); }; /** @@ -527,8 +525,8 @@ Functions.checkPasswordStrength = function (value, meterObject, meterObjectLabel customDict.push(username); } - zxcvbnts.core.zxcvbnOptions.setOptions({ dictionary: { userInputs: customDict } }); - var zxcvbnObject = zxcvbnts.core.zxcvbn(value); + window.zxcvbnts.core.zxcvbnOptions.setOptions({ dictionary: { userInputs: customDict } }); + var zxcvbnObject = window.zxcvbnts.core.zxcvbn(value); var strength = zxcvbnObject.score; strength = parseInt(strength); meterObject.val(strength); diff --git a/js/src/table/structure.js b/js/src/table/structure.js index ee6c1b5691..e7b79e8dd5 100644 --- a/js/src/table/structure.js +++ b/js/src/table/structure.js @@ -8,7 +8,6 @@ */ /* global Navigation */ -/* global sprintf */ // js/vendor/sprintf.js /** * AJAX scripts for /table/structure @@ -154,7 +153,7 @@ window.AJAX.registerOnload('table/structure.js', function () { // If Collation is changed, Warn and Confirm if (checkIfConfirmRequired($form)) { - var question = sprintf( + var question = window.sprintf( Messages.strChangeColumnCollation, 'https://wiki.phpmyadmin.net/pma/Garbled_data' ); $form.confirm(question, $form.attr('action'), function () { diff --git a/js/src/u2f.js b/js/src/u2f.js index 44655b14f6..b80decc70c 100644 --- a/js/src/u2f.js +++ b/js/src/u2f.js @@ -1,5 +1,3 @@ -/* global u2f */ // js/vendor/u2f-api-polyfill.js - window.AJAX.registerOnload('u2f.js', function () { var $inputReg = $('#u2f_registration_response'); if ($inputReg.length > 0) { @@ -8,7 +6,7 @@ window.AJAX.registerOnload('u2f.js', function () { setTimeout(function () { // A magic JS function that talks to the USB device. This function will keep polling for the USB device until it finds one. var request = JSON.parse($inputReg.attr('data-request')); - u2f.register(request.appId, [request], JSON.parse($inputReg.attr('data-signatures')), function (data) { + window.u2f.register(request.appId, [request], JSON.parse($inputReg.attr('data-signatures')), function (data) { // Handle returning error data if (data.errorCode && data.errorCode !== 0) { switch (data.errorCode) { @@ -45,7 +43,7 @@ window.AJAX.registerOnload('u2f.js', function () { // Magic JavaScript talking to your HID // appid, challenge, authenticateRequests var request = JSON.parse($inputAuth.attr('data-request')); - u2f.sign(request[0].appId, request[0].challenge, request, function (data) { + window.u2f.sign(request[0].appId, request[0].challenge, request, function (data) { // Handle returning error data if (data.errorCode && data.errorCode !== 0) { switch (data.errorCode) {