You've already forked phpmyadmin
mirror of
https://github.com/phpmyadmin/phpmyadmin.git
synced 2026-10-23 18:29:15 +03:00
Remove ajax_request
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
@@ -39,7 +39,6 @@ window.CodeMirror.sqlLint = function (text, updateLinting, options, cm) {
|
||||
'server': CommonParams.get('server'),
|
||||
'options': options.lintOptions,
|
||||
'no_history': true,
|
||||
'ajax_request': true,
|
||||
},
|
||||
success: handleResponse
|
||||
});
|
||||
|
||||
@@ -75,7 +75,7 @@ AJAX.registerOnload('database/central_columns.js', function () {
|
||||
}
|
||||
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
const editColumnData = editColumnList + '' + argsep + 'edit_central_columns_page=true' + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true' + argsep + 'db=' + encodeURIComponent(CommonParams.get('db')) + argsep + 'server=' + CommonParams.get('server');
|
||||
const editColumnData = editColumnList + '' + argsep + 'edit_central_columns_page=true' + argsep + 'ajax_page_request=true' + argsep + 'db=' + encodeURIComponent(CommonParams.get('db')) + argsep + 'server=' + CommonParams.get('server');
|
||||
ajaxShowMessage();
|
||||
AJAX.source = $(this);
|
||||
$.post('index.php?route=/database/central-columns', editColumnData, AJAX.responseHandler);
|
||||
@@ -85,7 +85,7 @@ AJAX.registerOnload('database/central_columns.js', function () {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
const multiColumnEditData = $('#multi_edit_central_columns').serialize() + argsep + 'multi_edit_central_column_save=true' + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true' + argsep + 'db=' + encodeURIComponent(CommonParams.get('db')) + argsep + 'server=' + CommonParams.get('server');
|
||||
const multiColumnEditData = $('#multi_edit_central_columns').serialize() + argsep + 'multi_edit_central_column_save=true' + argsep + 'ajax_page_request=true' + argsep + 'db=' + encodeURIComponent(CommonParams.get('db')) + argsep + 'server=' + CommonParams.get('server');
|
||||
ajaxShowMessage();
|
||||
AJAX.source = $(this);
|
||||
$.post('index.php?route=/database/central-columns', multiColumnEditData, AJAX.responseHandler);
|
||||
@@ -172,7 +172,7 @@ AJAX.registerOnload('database/central_columns.js', function () {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'index.php?route=/database/central-columns',
|
||||
data: datastring + CommonParams.get('arg_separator') + 'ajax_request=true',
|
||||
data: datastring,
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data.message !== '1') {
|
||||
@@ -206,7 +206,6 @@ AJAX.registerOnload('database/central_columns.js', function () {
|
||||
const defaultColumnSelect = $('#column-select').find('option').first();
|
||||
const href = 'index.php?route=/database/central-columns/populate';
|
||||
const params = {
|
||||
'ajax_request': true,
|
||||
'server': CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'selectedTable': selectValue,
|
||||
|
||||
@@ -98,7 +98,6 @@ AJAX.registerOnload('database/multi_table_query.js', function () {
|
||||
'server': sessionStorage.server,
|
||||
'db': $('#db_name').val(),
|
||||
'tables': Object.keys(tableAliases),
|
||||
'ajax_request': '1',
|
||||
'token': CommonParams.get('token')
|
||||
},
|
||||
success: function (response) {
|
||||
@@ -156,7 +155,6 @@ AJAX.registerOnload('database/multi_table_query.js', function () {
|
||||
const data = {
|
||||
'db': $('#db_name').val(),
|
||||
'sql_query': query,
|
||||
'ajax_request': '1',
|
||||
'server': CommonParams.get('server'),
|
||||
'token': CommonParams.get('token'),
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import $ from 'jquery';
|
||||
import { AJAX } from '../modules/ajax.ts';
|
||||
import { emptyCheckTheField, prepareForAjaxRequest } from '../modules/functions.ts';
|
||||
import { emptyCheckTheField } from '../modules/functions.ts';
|
||||
import { Navigation } from '../modules/navigation.ts';
|
||||
import { CommonParams } from '../modules/common.ts';
|
||||
import { ajaxShowMessage } from '../modules/ajax-message.ts';
|
||||
@@ -62,8 +62,6 @@ AJAX.registerOnload('database/operations.js', function () {
|
||||
|
||||
const question = escapeHtml('CREATE DATABASE ' + newDbName + ' / DROP DATABASE ' + oldDbName);
|
||||
|
||||
prepareForAjaxRequest($form);
|
||||
|
||||
$form.confirm(question, $form.attr('action'), function (url) {
|
||||
ajaxShowMessage(window.Messages.strRenamingDatabases, false);
|
||||
$.post(url, $('#rename_db_form').serialize() + CommonParams.get('arg_separator') + 'is_js_confirmed=1', function (data) {
|
||||
@@ -103,7 +101,6 @@ AJAX.registerOnload('database/operations.js', function () {
|
||||
|
||||
ajaxShowMessage(window.Messages.strCopyingDatabase, false);
|
||||
const $form = $(this);
|
||||
prepareForAjaxRequest($form);
|
||||
$.post($form.attr('action'), $form.serialize(), function (data) {
|
||||
// use messages that stay on screen
|
||||
$('.alert-success, .alert-danger').fadeOut();
|
||||
@@ -140,7 +137,6 @@ AJAX.registerOnload('database/operations.js', function () {
|
||||
$(document).on('submit', '#change_db_charset_form.ajax', function (event) {
|
||||
event.preventDefault();
|
||||
const $form = $(this);
|
||||
prepareForAjaxRequest($form);
|
||||
ajaxShowMessage(window.Messages.strChangingCharset);
|
||||
$.post($form.attr('action'), $form.serialize(), function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
|
||||
@@ -92,7 +92,7 @@ const DatabaseRoutines = {
|
||||
exportAnchors.each(function () {
|
||||
const h = $(this).attr('href');
|
||||
p = p.then(function () {
|
||||
return $.get(h, { 'ajax_request': true }, function (data) {
|
||||
return $.get(h, function (data) {
|
||||
returnCount++;
|
||||
if (data.success === true) {
|
||||
combined.message += '\n' + data.message + '\n';
|
||||
@@ -111,7 +111,7 @@ const DatabaseRoutines = {
|
||||
});
|
||||
});
|
||||
} else {
|
||||
$.get($this.attr('href'), { 'ajax_request': true }, showExport);
|
||||
$.get($this.attr('href'), showExport);
|
||||
}
|
||||
|
||||
ajaxRemoveMessage($msg);
|
||||
@@ -161,7 +161,7 @@ const DatabaseRoutines = {
|
||||
* the AJAX message shown to the user
|
||||
*/
|
||||
let $msg = ajaxShowMessage();
|
||||
$.get($this.attr('href'), { 'ajax_request': true }, function (data) {
|
||||
$.get($this.attr('href'), function (data) {
|
||||
if (data.success !== true) {
|
||||
ajaxShowMessage(data.error, false);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import $ from 'jquery';
|
||||
import { AJAX } from '../modules/ajax.ts';
|
||||
import { prepareForAjaxRequest, setSelectOptions } from '../modules/functions.ts';
|
||||
import { setSelectOptions } from '../modules/functions.ts';
|
||||
import { CommonParams } from '../modules/common.ts';
|
||||
import highlightSql from '../modules/sql-highlight.ts';
|
||||
import { ajaxRemoveMessage, ajaxShowMessage } from '../modules/ajax-message.ts';
|
||||
@@ -138,7 +138,6 @@ AJAX.registerOnload('database/search.js', function () {
|
||||
const url = $(this).data('href') + '#searchresults';
|
||||
const browseSql = $(this).data('browse-sql');
|
||||
const params = {
|
||||
'ajax_request': true,
|
||||
'is_js_confirmed': true,
|
||||
'sql_query': browseSql,
|
||||
};
|
||||
@@ -181,7 +180,6 @@ AJAX.registerOnload('database/search.js', function () {
|
||||
/** Load the deleted option to the page*/
|
||||
$('#sqlqueryform').html('');
|
||||
const params = {
|
||||
'ajax_request': true,
|
||||
'is_js_confirmed': true,
|
||||
'sql_query': $(this).data('delete-sql'),
|
||||
};
|
||||
@@ -227,8 +225,6 @@ AJAX.registerOnload('database/search.js', function () {
|
||||
// jQuery object to reuse
|
||||
const $form = $(this);
|
||||
|
||||
prepareForAjaxRequest($form);
|
||||
|
||||
const url = $form.serialize() + CommonParams.get('arg_separator') + 'submit_search=' + $('#buttonGo').val();
|
||||
$.post($form.attr('action'), url, function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
@@ -245,7 +241,6 @@ AJAX.registerOnload('database/search.js', function () {
|
||||
|
||||
$('#searchresults').show();
|
||||
|
||||
|
||||
$('#db_search_form')
|
||||
// workaround for Chrome problem (bug #3168569)
|
||||
.slideToggle()
|
||||
|
||||
@@ -108,7 +108,7 @@ AJAX.registerOnload('database/structure.js', function () {
|
||||
$('#makeConsistentWithCentralListContinue').on('click', function () {
|
||||
const $form = $('#tablesForm');
|
||||
const argSep = CommonParams.get('arg_separator');
|
||||
const data = $form.serialize() + argSep + 'ajax_request=true' + argSep + 'ajax_page_request=true';
|
||||
const data = $form.serialize() + argSep + 'ajax_page_request=true';
|
||||
|
||||
ajaxShowMessage();
|
||||
AJAX.source = $form;
|
||||
@@ -206,7 +206,7 @@ AJAX.registerOnload('database/structure.js', function () {
|
||||
|
||||
const $form = $(this).parents('form');
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
const data = $form.serialize() + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true';
|
||||
const data = $form.serialize() + argsep + 'ajax_page_request=true';
|
||||
|
||||
ajaxShowMessage();
|
||||
AJAX.source = $form;
|
||||
|
||||
@@ -50,7 +50,7 @@ AJAX.registerOnload('database/tracking.js', function () {
|
||||
const $button = $(this);
|
||||
const $form = $button.parent('form');
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
const submitData = $form.serialize() + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true' + argsep + 'submit_mult=' + $button.val();
|
||||
const submitData = $form.serialize() + argsep + 'ajax_page_request=true' + argsep + 'submit_mult=' + $button.val();
|
||||
|
||||
if ($button.val() === 'delete_tracking') {
|
||||
const question = window.Messages.strDeleteTrackingDataMultiple;
|
||||
@@ -74,7 +74,7 @@ AJAX.registerOnload('database/tracking.js', function () {
|
||||
const $button = $(this);
|
||||
const $form = $button.parent('form');
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
const submitData = $form.serialize() + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true' + argsep + 'submit_mult=' + $button.val();
|
||||
const submitData = $form.serialize() + argsep + 'ajax_page_request=true' + argsep + 'submit_mult=' + $button.val();
|
||||
ajaxShowMessage();
|
||||
AJAX.source = $form;
|
||||
$.post($form.attr('action'), submitData, AJAX.responseHandler);
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import $ from 'jquery';
|
||||
import { prepareForAjaxRequest } from '../modules/functions.ts';
|
||||
import { CommonParams } from '../modules/common.ts';
|
||||
import { ajaxRemoveMessage, ajaxShowMessage } from '../modules/ajax-message.ts';
|
||||
import refreshMainContent from '../modules/functions/refreshMainContent.ts';
|
||||
@@ -338,7 +337,6 @@ const reload = function () {
|
||||
rowOffsetTop +
|
||||
heightField;
|
||||
|
||||
|
||||
rowOffsetTop = 0;
|
||||
tabHideButton = document.getElementById('id_hide_tbody_' + DesignerConfig.contr[K][key][key2][key3][0]);
|
||||
if (tabHideButton.innerHTML === 'v') {
|
||||
@@ -655,7 +653,6 @@ const addOtherDbTables = function () {
|
||||
$selectTable.append('<option value="">' + window.Messages.strNone + '</option>');
|
||||
|
||||
$.post('index.php?route=/sql', {
|
||||
'ajax_request': true,
|
||||
'sql_query': 'SHOW databases;',
|
||||
'server': CommonParams.get('server')
|
||||
}, function (data) {
|
||||
@@ -685,7 +682,6 @@ const addOtherDbTables = function () {
|
||||
}
|
||||
|
||||
$.post('index.php?route=/database/designer', {
|
||||
'ajax_request': true,
|
||||
'dialog': 'add_table',
|
||||
'db': db,
|
||||
'table': table,
|
||||
@@ -714,7 +710,6 @@ const addOtherDbTables = function () {
|
||||
const dbName = $(this).val();
|
||||
const sqlQuery = 'SHOW tables;';
|
||||
$.post('index.php?route=/sql', {
|
||||
'ajax_request': true,
|
||||
'sql_query': sqlQuery,
|
||||
'db': dbName,
|
||||
'server': CommonParams.get('server')
|
||||
@@ -793,7 +788,7 @@ const getUrlPos = function (forceString = undefined) {
|
||||
const save2 = function (callback) {
|
||||
if (DesignerConfig.designerTablesEnabled) {
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
let poststr = 'operation=savePage' + argsep + 'save_page=same' + argsep + 'ajax_request=true';
|
||||
let poststr = 'operation=savePage' + argsep + 'save_page=same';
|
||||
poststr += argsep + 'server=' + DesignerConfig.server + argsep + 'db=' + encodeURIComponent(DesignerConfig.db) + argsep + 'selected_page=' + DesignerConfig.selectedPage;
|
||||
poststr += DesignerMove.getUrlPos();
|
||||
|
||||
@@ -834,7 +829,6 @@ const submitSaveDialogAndClose = function (callback, modal) {
|
||||
|
||||
if (DesignerConfig.designerTablesEnabled) {
|
||||
const $msgbox = ajaxShowMessage(window.Messages.strProcessingRequest);
|
||||
prepareForAjaxRequest($form);
|
||||
$.post($form.attr('action'), $form.serialize() + DesignerMove.getUrlPos(), function (data) {
|
||||
if (data.success === false) {
|
||||
ajaxShowMessage(data.error, false);
|
||||
@@ -897,7 +891,6 @@ const editPages = function () {
|
||||
DesignerMove.promptToSaveCurrentPage(function () {
|
||||
const $msgbox = ajaxShowMessage();
|
||||
$.post('index.php?route=/database/designer', {
|
||||
'ajax_request': true,
|
||||
'server': DesignerConfig.server,
|
||||
'db': DesignerConfig.db,
|
||||
'dialog': 'edit'
|
||||
@@ -935,7 +928,6 @@ const editPages = function () {
|
||||
const deletePages = function () {
|
||||
const $msgbox = ajaxShowMessage();
|
||||
$.post('index.php?route=/database/designer', {
|
||||
'ajax_request': true,
|
||||
'server': DesignerConfig.server,
|
||||
'db': DesignerConfig.db,
|
||||
'dialog': 'delete'
|
||||
@@ -963,7 +955,6 @@ const deletePages = function () {
|
||||
|
||||
const $messageBox = ajaxShowMessage(window.Messages.strProcessingRequest);
|
||||
const deletingCurrentPage = parseInt(selected) === DesignerConfig.selectedPage;
|
||||
prepareForAjaxRequest($form);
|
||||
|
||||
if (DesignerConfig.designerTablesEnabled) {
|
||||
$.post($form.attr('action'), $form.serialize(), function (data) {
|
||||
@@ -1003,7 +994,6 @@ const deletePages = function () {
|
||||
const saveAs = function () {
|
||||
const $msgbox = ajaxShowMessage();
|
||||
$.post('index.php?route=/database/designer', {
|
||||
'ajax_request': true,
|
||||
'server': DesignerConfig.server,
|
||||
'db': DesignerConfig.db,
|
||||
'dialog': 'save_as'
|
||||
@@ -1048,7 +1038,6 @@ const saveAs = function () {
|
||||
|
||||
const $msgbox = ajaxShowMessage(window.Messages.strProcessingRequest);
|
||||
if (DesignerConfig.designerTablesEnabled) {
|
||||
prepareForAjaxRequest($form);
|
||||
$.post($form.attr('action'), $form.serialize() + DesignerMove.getUrlPos(), function (data) {
|
||||
if (data.success === false) {
|
||||
ajaxShowMessage(data.error, false);
|
||||
@@ -1126,7 +1115,6 @@ const exportPages = function () {
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
|
||||
$.post('index.php?route=/database/designer', {
|
||||
'ajax_request': true,
|
||||
'server': DesignerConfig.server,
|
||||
'db': DesignerConfig.db,
|
||||
'dialog': 'export',
|
||||
@@ -1226,7 +1214,6 @@ const saveValueInConfig = function (indexSent, valueSent) {
|
||||
{
|
||||
'operation': 'save_setting_value',
|
||||
'index': indexSent,
|
||||
'ajax_request': true,
|
||||
'server': DesignerConfig.server,
|
||||
'value': valueSent
|
||||
},
|
||||
@@ -1336,7 +1323,6 @@ const clickTableField = function (db, T, f, pk) {
|
||||
$.post('index.php?route=/database/designer',
|
||||
{
|
||||
'operation': 'setDisplayField',
|
||||
'ajax_request': true,
|
||||
'server': DesignerConfig.server,
|
||||
'db': db,
|
||||
'table': T,
|
||||
@@ -1358,7 +1344,7 @@ const newRelation = function () {
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
linkRelation += argsep + 'server=' + DesignerConfig.server + argsep + 'db=' + DesignerConfig.db + argsep + 'db2=p';
|
||||
linkRelation += argsep + 'on_delete=' + (document.getElementById('on_delete') as HTMLSelectElement).value + argsep + 'on_update=' + (document.getElementById('on_update') as HTMLSelectElement).value;
|
||||
linkRelation += argsep + 'operation=addNewRelation' + argsep + 'ajax_request=true';
|
||||
linkRelation += argsep + 'operation=addNewRelation';
|
||||
|
||||
const $msgbox = ajaxShowMessage(window.Messages.strProcessingRequest);
|
||||
$.post('index.php?route=/database/designer', linkRelation, function (data) {
|
||||
@@ -1594,7 +1580,7 @@ const updRelation = function () {
|
||||
document.getElementById('layer_upd_relation').style.display = 'none';
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
linkRelation += argsep + 'server=' + DesignerConfig.server + argsep + 'db=' + DesignerConfig.db;
|
||||
linkRelation += argsep + 'operation=removeRelation' + argsep + 'ajax_request=true';
|
||||
linkRelation += argsep + 'operation=removeRelation';
|
||||
|
||||
const $msgbox = ajaxShowMessage(window.Messages.strProcessingRequest);
|
||||
$.post('index.php?route=/database/designer', linkRelation, function (data) {
|
||||
|
||||
@@ -406,7 +406,6 @@ const DragDropImport = {
|
||||
fd.append('format', ext);
|
||||
fd.append('sql_compatibility', 'NONE');
|
||||
fd.append('sql_no_auto_value_on_zero', 'something');
|
||||
fd.append('ajax_request', 'true');
|
||||
fd.append('hash', hash.toString());
|
||||
|
||||
// init uploading
|
||||
|
||||
@@ -72,7 +72,6 @@ const ErrorReport = {
|
||||
ErrorReport.lastException = exception;
|
||||
if (ErrorReport.errorReportData === null) {
|
||||
$.post('index.php?route=/error-report', {
|
||||
'ajax_request': true,
|
||||
'server': CommonParams.get('server'),
|
||||
'get_settings': true,
|
||||
'exception_type': 'js',
|
||||
@@ -231,13 +230,11 @@ const ErrorReport = {
|
||||
const reportData: {
|
||||
exception: any;
|
||||
server: any;
|
||||
ajax_request: boolean;
|
||||
exception_type: string;
|
||||
url: string,
|
||||
scripts?: any[]
|
||||
} = {
|
||||
'server': CommonParams.get('server'),
|
||||
'ajax_request': true,
|
||||
'exception': exception,
|
||||
'url': window.location.href,
|
||||
'exception_type': 'js',
|
||||
|
||||
@@ -76,7 +76,7 @@ const DatabaseEvents = {
|
||||
exportAnchors.each(function () {
|
||||
const h = $(this).attr('href');
|
||||
p = p.then(function () {
|
||||
return $.get(h, { 'ajax_request': true }, function (data) {
|
||||
return $.get(h, function (data) {
|
||||
returnCount++;
|
||||
if (data.success === true) {
|
||||
combined.message += '\n' + data.message + '\n';
|
||||
@@ -95,7 +95,7 @@ const DatabaseEvents = {
|
||||
});
|
||||
});
|
||||
} else {
|
||||
$.get($this.attr('href'), { 'ajax_request': true }, showExport);
|
||||
$.get($this.attr('href'), showExport);
|
||||
}
|
||||
|
||||
ajaxRemoveMessage($msg);
|
||||
@@ -145,7 +145,7 @@ const DatabaseEvents = {
|
||||
* the AJAX message shown to the user
|
||||
*/
|
||||
let $msg = ajaxShowMessage();
|
||||
$.get($this.attr('href'), { 'ajax_request': true }, function (data) {
|
||||
$.get($this.attr('href'), function (data) {
|
||||
if (data.success !== true) {
|
||||
ajaxShowMessage(data.error, false);
|
||||
|
||||
|
||||
@@ -91,7 +91,6 @@ function createTemplate (name) {
|
||||
const templateData = Export.getTemplateData();
|
||||
|
||||
const params = {
|
||||
'ajax_request': true,
|
||||
'server': CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
@@ -125,7 +124,6 @@ function createTemplate (name) {
|
||||
*/
|
||||
function loadTemplate (id) {
|
||||
const params = {
|
||||
'ajax_request': true,
|
||||
'server': CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
@@ -182,7 +180,6 @@ function updateTemplate (id) {
|
||||
const templateData = Export.getTemplateData();
|
||||
|
||||
const params = {
|
||||
'ajax_request': true,
|
||||
'server': CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
@@ -208,7 +205,6 @@ function updateTemplate (id) {
|
||||
*/
|
||||
function deleteTemplate (id) {
|
||||
const params = {
|
||||
'ajax_request': true,
|
||||
'server': CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
@@ -784,7 +780,6 @@ function checkTimeOut (timeLimit) {
|
||||
timeOut = setTimeout(function () {
|
||||
$.get('index.php?route=/export/check-time-out',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'server': CommonParams.get('server')
|
||||
},
|
||||
function (data) {
|
||||
@@ -818,7 +813,6 @@ function createAliasModal (event): void {
|
||||
$('#db_alias_select').append(option).val(db).trigger('change');
|
||||
} else {
|
||||
const params = {
|
||||
'ajax_request': true,
|
||||
'server': CommonParams.get('server'),
|
||||
};
|
||||
$.post('index.php?route=/databases', params, function (response) {
|
||||
@@ -965,7 +959,6 @@ AJAX.registerOnload('export.js', function () {
|
||||
} else {
|
||||
const database = $(this).val();
|
||||
const params = {
|
||||
'ajax_request': true,
|
||||
'server': CommonParams.get('server'),
|
||||
'db': database,
|
||||
};
|
||||
@@ -990,7 +983,6 @@ AJAX.registerOnload('export.js', function () {
|
||||
const database = $('#db_alias_select').val();
|
||||
const table = $(this).val();
|
||||
const params = {
|
||||
'ajax_request': true,
|
||||
'server': CommonParams.get('server'),
|
||||
'db': database,
|
||||
'table': table,
|
||||
|
||||
@@ -291,7 +291,6 @@ function loadGISEditor (value, field, type, inputName) {
|
||||
'value': value,
|
||||
'type': type,
|
||||
'input_name': inputName,
|
||||
'ajax_request': true,
|
||||
'server': CommonParams.get('server'),
|
||||
};
|
||||
$.post('index.php?route=/gis-data-editor', data, function (data) {
|
||||
@@ -347,7 +346,7 @@ function insertDataAndClose () {
|
||||
const inputName = $form.find('input[name=\'input_name\']').val();
|
||||
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
const params = $form.serialize() + argsep + 'generate=true' + argsep + 'ajax_request=true';
|
||||
const params = $form.serialize() + argsep + 'generate=true';
|
||||
$.post('index.php?route=/gis-data-editor', params, function (data) {
|
||||
if (typeof data === 'undefined' || data.success !== true) {
|
||||
ajaxShowMessage(data.error, false);
|
||||
@@ -467,7 +466,7 @@ function onGeometryTypeChange () {
|
||||
function updateResult () {
|
||||
const $form = $('form#gis_data_editor_form');
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
const data = $form.serialize() + argsep + 'generate=true' + argsep + 'ajax_request=true';
|
||||
const data = $form.serialize() + argsep + 'generate=true';
|
||||
$.post('index.php?route=/gis-data-editor', data, onCoordinateEdit, 'json');
|
||||
}
|
||||
|
||||
|
||||
@@ -430,7 +430,6 @@ const makeGrid = function (t, enableResize = undefined, enableReorder = undefine
|
||||
}
|
||||
|
||||
const postParams = {
|
||||
'ajax_request': true,
|
||||
'db': g.db,
|
||||
'table': g.table,
|
||||
'token': g.token,
|
||||
@@ -976,7 +975,6 @@ const makeGrid = function (t, enableResize = undefined, enableReorder = undefine
|
||||
* @var postParams Object containing parameters for the POST request
|
||||
*/
|
||||
postParams = {
|
||||
'ajax_request': true,
|
||||
'server': g.server,
|
||||
'db': g.db,
|
||||
'table': g.table,
|
||||
@@ -1022,7 +1020,6 @@ const makeGrid = function (t, enableResize = undefined, enableReorder = undefine
|
||||
* @var postParams Object containing parameters for the POST request
|
||||
*/
|
||||
postParams = {
|
||||
'ajax_request': true,
|
||||
'server': g.server,
|
||||
'db': g.db,
|
||||
'table': g.table,
|
||||
@@ -1054,7 +1051,6 @@ const makeGrid = function (t, enableResize = undefined, enableReorder = undefine
|
||||
// if the data is truncated, get the full data
|
||||
if ($td.is('.truncated')) {
|
||||
postParams = {
|
||||
'ajax_request': true,
|
||||
'server': g.server,
|
||||
'db': g.db,
|
||||
'table': g.table,
|
||||
@@ -1065,7 +1061,6 @@ const makeGrid = function (t, enableResize = undefined, enableReorder = undefine
|
||||
};
|
||||
} else {
|
||||
postParams = {
|
||||
'ajax_request': true,
|
||||
'server': g.server,
|
||||
'db': g.db,
|
||||
'table': g.table,
|
||||
@@ -1122,7 +1117,6 @@ const makeGrid = function (t, enableResize = undefined, enableReorder = undefine
|
||||
g.lastXHR = $.post('index.php?route=/sql', {
|
||||
'server': g.server,
|
||||
'db': g.db,
|
||||
'ajax_request': true,
|
||||
'sql_query': sqlQuery,
|
||||
'grid_edit': true,
|
||||
}, function (data) {
|
||||
@@ -1418,7 +1412,6 @@ const makeGrid = function (t, enableResize = undefined, enableReorder = undefine
|
||||
* @var postParams Object containing parameters for the POST request
|
||||
*/
|
||||
const postParams = {
|
||||
'ajax_request': true,
|
||||
'sql_query': fullSqlQuery,
|
||||
'server': g.server,
|
||||
'db': g.db,
|
||||
|
||||
@@ -313,7 +313,7 @@ const AJAX = {
|
||||
|
||||
const url = isLink ? href : $(this).attr('action');
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
let params = 'ajax_request=true' + argsep + 'ajax_page_request=true';
|
||||
let params = 'ajax_page_request=true';
|
||||
const dataPost = AJAX.source.getPostData();
|
||||
if (! isLink) {
|
||||
params += argsep + $(this).serialize();
|
||||
@@ -915,7 +915,7 @@ const AJAX = {
|
||||
const state = event.originalEvent.state;
|
||||
if (state && state.menu) {
|
||||
AJAX.$msgbox = ajaxShowMessage();
|
||||
const params = 'ajax_request=true' + CommonParams.get('arg_separator') + 'ajax_page_request=true';
|
||||
const params = 'ajax_page_request=true';
|
||||
const url = state.url || location.href;
|
||||
$.get(url, params, AJAX.responseHandler);
|
||||
// TODO: Check if sometimes menu is not retrieved from server,
|
||||
|
||||
@@ -686,7 +686,6 @@ function savePrefsToLocalStorage (form) {
|
||||
cache: false,
|
||||
type: 'POST',
|
||||
data: {
|
||||
'ajax_request': true,
|
||||
'server': CommonParams.get('server'),
|
||||
'submit_get_json': true
|
||||
},
|
||||
|
||||
@@ -956,7 +956,6 @@ const ConsoleMessages = {
|
||||
{
|
||||
'server': CommonParams.get('server'),
|
||||
'action_bookmark': 2,
|
||||
'ajax_request': true,
|
||||
'id_bookmark': $message.attr('bookmarkid')
|
||||
},
|
||||
function () {
|
||||
@@ -1111,7 +1110,6 @@ const ConsoleBookmarks = {
|
||||
refresh: function () {
|
||||
$.get('index.php?route=/console/bookmark/refresh',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'server': CommonParams.get('server'),
|
||||
},
|
||||
function (data) {
|
||||
@@ -1149,7 +1147,6 @@ const ConsoleBookmarks = {
|
||||
$(this).prop('disabled', true);
|
||||
$.post('index.php?route=/console/bookmark/add',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'label': $('#pma_bookmarks').find('.card.add [name=label]').val(),
|
||||
'server': CommonParams.get('server'),
|
||||
'db': $('#pma_bookmarks').find('.card.add [name=targetdb]').val(),
|
||||
|
||||
@@ -127,7 +127,6 @@ function setConfigValue (key: string, value: boolean|number|string): void {
|
||||
$.post(
|
||||
'index.php?route=/console/update-config',
|
||||
{
|
||||
'ajax_request': true,
|
||||
server: CommonParams.get('server'),
|
||||
key: key,
|
||||
value: value,
|
||||
|
||||
@@ -359,18 +359,6 @@ function verifyColumnsProperties () {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a hidden field to the form to indicate that this will be an
|
||||
* Ajax request (only if this hidden field does not exist)
|
||||
*
|
||||
* @param {object} $form the form
|
||||
*/
|
||||
export function prepareForAjaxRequest ($form) {
|
||||
if (! $form.find('input:hidden').is('#ajax_request_hidden')) {
|
||||
$form.append('<input type="hidden" id="ajax_request_hidden" name="ajax_request" value="true">');
|
||||
}
|
||||
}
|
||||
|
||||
export function checkPasswordStrength (value, meterObject, meterObjectLabel, username) {
|
||||
// List of words we don't want to appear in the password
|
||||
const customDict = [
|
||||
@@ -856,7 +844,6 @@ export function onloadIdleEvent () {
|
||||
}
|
||||
|
||||
const params = {
|
||||
'ajax_request': true,
|
||||
'server': CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'guid': guid,
|
||||
@@ -1017,7 +1004,6 @@ export function setSelectOptions (theForm, theSelect, doCheck) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Updates the input fields for the parameters based on the query
|
||||
*/
|
||||
@@ -1081,7 +1067,6 @@ export function getForeignKeyCheckboxLoader () {
|
||||
export function loadForeignKeyCheckbox () {
|
||||
// Load default foreign key check value
|
||||
const params = {
|
||||
'ajax_request': true,
|
||||
'server': CommonParams.get('server'),
|
||||
};
|
||||
$.get('index.php?route=/sql/get-default-fk-check-value', params, function (data) {
|
||||
@@ -1215,7 +1200,6 @@ export function codeMirrorAutoCompleteOnInputRead (instance) {
|
||||
sqlAutoCompleteInProgress = true;
|
||||
|
||||
const params = {
|
||||
'ajax_request': true,
|
||||
'server': CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'no_debug': true,
|
||||
@@ -1393,8 +1377,7 @@ export function previewSql ($form): void {
|
||||
const sep = CommonParams.get('arg_separator');
|
||||
const formData = $form.serialize() +
|
||||
sep + 'do_save_data=1' +
|
||||
sep + 'preview_sql=1' +
|
||||
sep + 'ajax_request=1';
|
||||
sep + 'preview_sql=1';
|
||||
const $messageBox = ajaxShowMessage();
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
@@ -1825,7 +1808,6 @@ export function onloadCreateTableEvents (): void {
|
||||
*/
|
||||
|
||||
if (checkTableEditForm($form[0], $form.find('input[name=orig_num_fields]').val())) {
|
||||
prepareForAjaxRequest($form);
|
||||
if (! checkReservedWordColumns($form)) {
|
||||
return;
|
||||
}
|
||||
@@ -1892,7 +1874,7 @@ export function onloadCreateTableEvents (): void {
|
||||
Navigation.reload();
|
||||
// Redirect to table structure page on creation of new table
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
const params12 = 'ajax_request=true' + argsep + 'ajax_page_request=true';
|
||||
const params12 = 'ajax_page_request=true';
|
||||
const tableStructureUrl = 'index.php?route=/table/structure' + argsep + 'server=' + data.params.server +
|
||||
argsep + 'db=' + data.params.db + argsep + 'token=' + data.params.token +
|
||||
argsep + 'goto=' + encodeURIComponent('index.php?route=/database/structure') + argsep + 'table=' + data.params.table + '';
|
||||
@@ -1914,7 +1896,6 @@ export function onloadCreateTableEvents (): void {
|
||||
const $form = $('form.create_table_form.ajax');
|
||||
|
||||
const $msgbox = ajaxShowMessage(window.Messages.strProcessingRequest);
|
||||
prepareForAjaxRequest($form);
|
||||
|
||||
// User wants to add more fields to the table
|
||||
$.post($form.attr('action'), $form.serialize() + '&' + actionParam, function (data) {
|
||||
@@ -2128,7 +2109,6 @@ export function onloadChangePasswordEvents (): void {
|
||||
|
||||
const submitForm = function () {
|
||||
const $msgbox = ajaxShowMessage(window.Messages.strProcessingRequest);
|
||||
$theForm.append('<input type="hidden" name="ajax_request" value="true">');
|
||||
|
||||
$.post($theForm.attr('action'), $theForm.serialize() + CommonParams.get('arg_separator') + 'change_pw=' + thisValue, function (data) {
|
||||
if (typeof data === 'undefined' || data.success !== true) {
|
||||
@@ -2155,7 +2135,7 @@ export function onloadChangePasswordEvents (): void {
|
||||
}
|
||||
});
|
||||
|
||||
$.get($(this).attr('href'), { 'ajax_request': true }, function (data) {
|
||||
$.get($(this).attr('href'), function (data) {
|
||||
if (typeof data === 'undefined' || ! data.success) {
|
||||
ajaxShowMessage(data.error, false);
|
||||
|
||||
@@ -2494,7 +2474,6 @@ export function onloadEnumSetEditor (): void {
|
||||
}
|
||||
|
||||
const params = {
|
||||
'ajax_request': true,
|
||||
'server': CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'cur_table': CommonParams.get('table'),
|
||||
@@ -2726,8 +2705,7 @@ function indexDialogModal (routeUrl, url, title, callbackSuccess, callbackFailur
|
||||
const sep = CommonParams.get('arg_separator');
|
||||
const formData = $form.serialize() +
|
||||
sep + 'do_save_data=1' +
|
||||
sep + 'preview_sql=1' +
|
||||
sep + 'ajax_request=1';
|
||||
sep + 'preview_sql=1';
|
||||
$.post({
|
||||
url: formUrl,
|
||||
data: formData,
|
||||
@@ -2760,7 +2738,6 @@ function indexDialogModal (routeUrl, url, title, callbackSuccess, callbackFailur
|
||||
*/
|
||||
const $form = $('#index_frm');
|
||||
ajaxShowMessage(window.Messages.strProcessingRequest);
|
||||
prepareForAjaxRequest($form);
|
||||
// User wants to submit the form
|
||||
$.post($form.attr('action'), $form.serialize() + CommonParams.get('arg_separator') + 'do_save_data=1', function (data) {
|
||||
const $sqlqueryresults = $('.sqlqueryresults');
|
||||
@@ -3054,7 +3031,7 @@ function toggleButton ($obj) {
|
||||
}
|
||||
|
||||
const parts = url.split('?');
|
||||
$.post(parts[0], parts[1] + '&ajax_request=true', function (data) {
|
||||
$.post(parts[0], parts[1], function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
ajaxRemoveMessage($msg);
|
||||
$container
|
||||
|
||||
@@ -21,7 +21,7 @@ export default function getJsConfirmCommonParam (elem, parameters) {
|
||||
params = '';
|
||||
}
|
||||
|
||||
params += 'is_js_confirmed=1' + sep + 'ajax_request=true' + sep + 'fk_checks=' + ($elem.find('#fk_checks').is(':checked') ? 1 : 0);
|
||||
params += 'is_js_confirmed=1' + sep + 'fk_checks=' + ($elem.find('#fk_checks').is(':checked') ? 1 : 0);
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
@@ -124,7 +124,6 @@ const GitInfo = {
|
||||
'index.php?route=/git-revision',
|
||||
{
|
||||
'server': CommonParams.get('server'),
|
||||
'ajax_request': true,
|
||||
'no_debug': true
|
||||
}
|
||||
).done(function (data): void {
|
||||
|
||||
@@ -316,7 +316,6 @@ function showAddIndexDialog (sourceArray, arrayIndex, targetColumns, colIndex, i
|
||||
'server': CommonParams.get('server'),
|
||||
'db': $('input[name="db"]').val(),
|
||||
'table': table,
|
||||
'ajax_request': 1,
|
||||
'create_edit_table': 1,
|
||||
'index': index,
|
||||
'columns': '',
|
||||
@@ -601,7 +600,7 @@ function on () {
|
||||
event.preventDefault();
|
||||
const $form = $('#index_frm');
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
const submitData = $form.serialize() + argsep + 'do_save_data=1' + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true';
|
||||
const submitData = $form.serialize() + argsep + 'do_save_data=1' + argsep + 'ajax_page_request=true';
|
||||
ajaxShowMessage(window.Messages.strProcessingRequest);
|
||||
AJAX.source = $form;
|
||||
$.post($form.attr('action'), submitData, AJAX.responseHandler);
|
||||
@@ -711,7 +710,6 @@ function on () {
|
||||
title = window.Messages.strEditIndex;
|
||||
}
|
||||
|
||||
url += CommonParams.get('arg_separator') + 'ajax_request=true';
|
||||
indexEditorDialog(url, title, function (data) {
|
||||
Navigation.update(CommonParams.set('db', data.params.db));
|
||||
Navigation.update(CommonParams.set('table', data.params.table));
|
||||
@@ -724,9 +722,8 @@ function on () {
|
||||
**/
|
||||
$(document).on('click', '#table_index tbody tr td.rename_index.ajax', function (event) {
|
||||
event.preventDefault();
|
||||
let url = $(this).find('a').getPostData();
|
||||
const url = $(this).find('a').getPostData();
|
||||
const title = window.Messages.strRenameIndex;
|
||||
url += CommonParams.get('arg_separator') + 'ajax_request=true';
|
||||
indexRenameDialog(url, title, function (data) {
|
||||
Navigation.update(CommonParams.set('db', data.params.db));
|
||||
Navigation.update(CommonParams.set('table', data.params.table));
|
||||
|
||||
@@ -164,7 +164,7 @@ function loadChildNodes (isNode, $expandElem, callback): void {
|
||||
};
|
||||
}
|
||||
|
||||
$.post('index.php?route=/navigation&ajax_request=1', params, function (data) {
|
||||
$.post('index.php?route=/navigation', params, function (data) {
|
||||
if (typeof data === 'undefined') {
|
||||
return;
|
||||
}
|
||||
@@ -621,7 +621,7 @@ function ensureSettings (selflink): void {
|
||||
getNaviSettings: true,
|
||||
server: CommonParams.get('server'),
|
||||
};
|
||||
$.post('index.php?route=/navigation&ajax_request=1', params, function (data) {
|
||||
$.post('index.php?route=/navigation', params, function (data) {
|
||||
if (typeof data !== 'undefined' && data.success) {
|
||||
$('#pma_navi_settings_container').html(data.message);
|
||||
Config.setupRestoreField();
|
||||
@@ -660,7 +660,7 @@ function reload (callback = null, paths = null): void {
|
||||
requestNaviReload(params);
|
||||
|
||||
function requestNaviReload (params) {
|
||||
$.post('index.php?route=/navigation&ajax_request=1', params, function (data) {
|
||||
$.post('index.php?route=/navigation', params, function (data) {
|
||||
if (typeof data === 'undefined') {
|
||||
return;
|
||||
}
|
||||
@@ -713,11 +713,11 @@ function treePagination ($this): void {
|
||||
const $msgbox = ajaxShowMessage();
|
||||
const isDbSelector = $this.closest('div.pageselector').is('.dbselector');
|
||||
const url = 'index.php?route=/navigation';
|
||||
let params = 'ajax_request=true';
|
||||
let params: string;
|
||||
if ($this[0].tagName === 'A') {
|
||||
params += CommonParams.get('arg_separator') + $this.getPostData();
|
||||
params = $this.getPostData();
|
||||
} else { // tagName === 'SELECT'
|
||||
params += CommonParams.get('arg_separator') + $this.closest('form').serialize();
|
||||
params = $this.closest('form').serialize();
|
||||
}
|
||||
|
||||
const searchClause = Navigation.FastFilter.getSearchClause();
|
||||
@@ -1296,7 +1296,7 @@ FastFilter.Filter.prototype.request = function (): void {
|
||||
}
|
||||
|
||||
self.xhr = $.ajax({
|
||||
url: 'index.php?route=/navigation&ajax_request=1&server=' + CommonParams.get('server'),
|
||||
url: 'index.php?route=/navigation&server=' + CommonParams.get('server'),
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: params,
|
||||
|
||||
@@ -202,7 +202,7 @@ export default function onloadNavigation () {
|
||||
event.preventDefault();
|
||||
const argSep = CommonParams.get('arg_separator');
|
||||
let params = $(this).getPostData();
|
||||
params += argSep + 'ajax_request=true' + argSep + 'server=' + CommonParams.get('server');
|
||||
params += argSep + 'server=' + CommonParams.get('server');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: params,
|
||||
@@ -222,8 +222,7 @@ export default function onloadNavigation () {
|
||||
event.preventDefault();
|
||||
const $msg = ajaxShowMessage();
|
||||
const argSep = CommonParams.get('arg_separator');
|
||||
let params = $(this).getPostData();
|
||||
params += argSep + 'ajax_request=true';
|
||||
const params = $(this).getPostData();
|
||||
$.post($(this).attr('href'), params, function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
ajaxRemoveMessage($msg);
|
||||
@@ -242,7 +241,7 @@ export default function onloadNavigation () {
|
||||
const $msg = ajaxShowMessage();
|
||||
const argSep = CommonParams.get('arg_separator');
|
||||
let params = $(this).getPostData();
|
||||
params += argSep + 'ajax_request=true' + argSep + 'server=' + CommonParams.get('server');
|
||||
params += argSep + 'server=' + CommonParams.get('server');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: params,
|
||||
|
||||
@@ -8,7 +8,6 @@ export default function updateNavigationWidthConfig (value: number): void {
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
'ajax_request': true,
|
||||
server: CommonParams.get('server'),
|
||||
value: value,
|
||||
},
|
||||
|
||||
@@ -6,7 +6,7 @@ import { CommonParams } from './common.ts';
|
||||
*/
|
||||
export const ThemesManager = {
|
||||
handleEvent: () => {
|
||||
$.get('index.php?route=/themes', { 'server': CommonParams.get('server'), 'ajax_request': true }, data => {
|
||||
$.get('index.php?route=/themes', { 'server': CommonParams.get('server') }, data => {
|
||||
$('#themesModal .modal-body').html(data.themes);
|
||||
});
|
||||
}
|
||||
@@ -23,7 +23,6 @@ export const ThemeColorModeToggle: EventListenerObject = {
|
||||
setColorModeToHtmlTag(toggleSelect.options.item(toggleSelect.selectedIndex).value);
|
||||
const toggleForm = toggleSelect.form;
|
||||
const formData = new FormData(toggleForm);
|
||||
formData.set('ajax_request', '1');
|
||||
$.post(toggleForm.action, Object.fromEntries(formData.entries())).done(function (data): void {
|
||||
setColorModeToHtmlTag(data.themeColorMode);
|
||||
});
|
||||
|
||||
@@ -20,13 +20,13 @@ AJAX.registerOnload('multi_column_sort.js', function () {
|
||||
event.preventDefault();
|
||||
AJAX.source = $(this);
|
||||
ajaxShowMessage();
|
||||
orderUrlRemove += argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true';
|
||||
orderUrlRemove += argsep + 'ajax_page_request=true';
|
||||
$.post('index.php?route=/sql', orderUrlRemove, AJAX.responseHandler);
|
||||
} else if (event.shiftKey) {
|
||||
event.preventDefault();
|
||||
AJAX.source = $(this);
|
||||
ajaxShowMessage();
|
||||
orderUrlAdd += argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true';
|
||||
orderUrlAdd += argsep + 'ajax_page_request=true';
|
||||
$.post('index.php?route=/sql', orderUrlAdd, AJAX.responseHandler);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -25,7 +25,6 @@ function appendHtmlColumnsList () {
|
||||
$.post(
|
||||
'index.php?route=/normalization/get-columns',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
@@ -47,7 +46,6 @@ function goTo3NFStep1 (newTables) {
|
||||
$.post(
|
||||
'index.php?route=/normalization/3nf/step1',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'db': CommonParams.get('db'),
|
||||
'server': CommonParams.get('server'),
|
||||
'tables': tables,
|
||||
@@ -87,7 +85,6 @@ function goTo2NFStep1 () {
|
||||
$.post(
|
||||
'index.php?route=/normalization/2nf/step1',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
@@ -142,7 +139,6 @@ function goToStep4 () {
|
||||
$.post(
|
||||
'index.php?route=/normalization/1nf/step4',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
@@ -174,7 +170,6 @@ function goToStep3 () {
|
||||
$.post(
|
||||
'index.php?route=/normalization/1nf/step3',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
@@ -197,7 +192,6 @@ function goToStep2 (extra = undefined) {
|
||||
$.post(
|
||||
'index.php?route=/normalization/1nf/step2',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server')
|
||||
@@ -235,7 +229,6 @@ function goTo2NFFinish (pd) {
|
||||
}
|
||||
|
||||
const datastring = {
|
||||
'ajax_request': true,
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
@@ -286,7 +279,6 @@ function goTo3NFFinish (newTables) {
|
||||
}
|
||||
|
||||
const datastring = {
|
||||
'ajax_request': true,
|
||||
'db': CommonParams.get('db'),
|
||||
'server': CommonParams.get('server'),
|
||||
'newTables': JSON.stringify(newTables),
|
||||
@@ -338,7 +330,6 @@ function goTo2NFStep2 (pd, primaryKey) {
|
||||
} else {
|
||||
extra += '</div>';
|
||||
const datastring = {
|
||||
'ajax_request': true,
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
@@ -389,7 +380,6 @@ function goTo3NFStep2 (pd, tablesTds) {
|
||||
} else {
|
||||
extra += '</div>';
|
||||
const datastring = {
|
||||
'ajax_request': true,
|
||||
'db': CommonParams.get('db'),
|
||||
'tables': JSON.stringify(tablesTds),
|
||||
'server': CommonParams.get('server'),
|
||||
@@ -496,7 +486,6 @@ function moveRepeatingGroup (repeatingCols) {
|
||||
}
|
||||
|
||||
const datastring = {
|
||||
'ajax_request': true,
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
@@ -560,7 +549,6 @@ AJAX.registerOnload('normalization.js', function () {
|
||||
$.post(
|
||||
'index.php?route=/normalization/create-new-column',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
@@ -610,13 +598,12 @@ AJAX.registerOnload('normalization.js', function () {
|
||||
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
let datastring = $('#newCols :input').serialize();
|
||||
datastring += argsep + 'ajax_request=1' + argsep + 'do_save_data=1' + argsep + 'field_where=last';
|
||||
datastring += argsep + 'do_save_data=1' + argsep + 'field_where=last';
|
||||
$.post('index.php?route=/table/add-field', datastring, function (data) {
|
||||
if (data.success) {
|
||||
$.post(
|
||||
'index.php?route=/sql',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
@@ -647,7 +634,6 @@ AJAX.registerOnload('normalization.js', function () {
|
||||
$.post(
|
||||
'index.php?route=/normalization/add-new-primary',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
@@ -691,7 +677,7 @@ AJAX.registerOnload('normalization.js', function () {
|
||||
$('#mainContent .card-footer').on('click', '#saveNewPrimary', function () {
|
||||
let datastring = $('#newCols :input').serialize();
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
datastring += argsep + 'field_key[0]=primary_0' + argsep + 'ajax_request=1' + argsep + 'do_save_data=1' + argsep + 'field_where=last';
|
||||
datastring += argsep + 'field_key[0]=primary_0' + argsep + 'do_save_data=1' + argsep + 'field_where=last';
|
||||
$.post('index.php?route=/table/add-field', datastring, function (data) {
|
||||
if (data.success === true) {
|
||||
$('#mainContent h4').html(window.Messages.strPrimaryKeyAdded);
|
||||
@@ -718,7 +704,6 @@ AJAX.registerOnload('normalization.js', function () {
|
||||
$.post(
|
||||
'index.php?route=/sql',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
@@ -786,7 +771,6 @@ AJAX.registerOnload('normalization.js', function () {
|
||||
'added_fields': 1,
|
||||
'add_fields': 1,
|
||||
'index': { 'Key_name': 'PRIMARY' },
|
||||
'ajax_request': true,
|
||||
};
|
||||
const title = window.Messages.strAddPrimaryKey;
|
||||
indexEditorDialog(url, title, function () {
|
||||
@@ -826,7 +810,6 @@ AJAX.registerOnload('normalization.js', function () {
|
||||
$.post(
|
||||
'index.php?route=/normalization/partial-dependencies',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
|
||||
@@ -100,7 +100,6 @@ AJAX.registerOnload('replication.js', function () {
|
||||
AJAX.source = $anchor;
|
||||
const params = getJsConfirmCommonParam({
|
||||
'ajax_page_request': true,
|
||||
'ajax_request': true,
|
||||
}, $anchor.getPostData());
|
||||
$.post(url, params, AJAX.responseHandler);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { AJAX } from '../modules/ajax.ts';
|
||||
import { prepareForAjaxRequest } from '../modules/functions.ts';
|
||||
import { Navigation } from '../modules/navigation.ts';
|
||||
import { CommonParams } from '../modules/common.ts';
|
||||
import { ajaxShowMessage } from '../modules/ajax-message.ts';
|
||||
@@ -111,7 +110,6 @@ const CreateDatabase = {
|
||||
// end remove
|
||||
|
||||
ajaxShowMessage(window.Messages.strProcessingRequest);
|
||||
prepareForAjaxRequest($form);
|
||||
|
||||
$.post($form.attr('action'), $form.serialize(), function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
@@ -125,7 +123,7 @@ const CreateDatabase = {
|
||||
// make ajax request to load db structure page - taken from ajax.js
|
||||
let dbStructUrl = data.url;
|
||||
dbStructUrl = dbStructUrl.replace(/amp;/ig, '');
|
||||
const params = 'ajax_request=true' + CommonParams.get('arg_separator') + 'ajax_page_request=true';
|
||||
const params = 'ajax_page_request=true';
|
||||
$.get(dbStructUrl, params, AJAX.responseHandler);
|
||||
} else {
|
||||
ajaxShowMessage(data.error, false);
|
||||
|
||||
@@ -59,7 +59,6 @@ const EditUserGroup = {
|
||||
$.get(
|
||||
'index.php?route=/server/user-groups/edit-form',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'username': username,
|
||||
'server': CommonParams.get('server')
|
||||
},
|
||||
@@ -81,7 +80,7 @@ const EditUserGroup = {
|
||||
|
||||
$.post(
|
||||
'index.php?route=/server/privileges',
|
||||
form.serialize() + CommonParams.get('arg_separator') + 'ajax_request=1',
|
||||
form.serialize(),
|
||||
data => {
|
||||
if (typeof data === 'undefined' || data.success !== true) {
|
||||
ajaxShowMessage(data.error, false, 'error');
|
||||
@@ -116,7 +115,6 @@ const AccountLocking = {
|
||||
const params = {
|
||||
'username': button.dataset.userName,
|
||||
'hostname': button.dataset.hostName,
|
||||
'ajax_request': true,
|
||||
'server': CommonParams.get('server'),
|
||||
};
|
||||
|
||||
@@ -156,7 +154,6 @@ const AddUserLoginCheckUsername = {
|
||||
if ($('#select_pred_username').val() === 'userdefined' && username !== '') {
|
||||
const href = $('form[name=\'usersForm\']').attr('action');
|
||||
const params = {
|
||||
'ajax_request': true,
|
||||
'server': CommonParams.get('server'),
|
||||
'validate_username': true,
|
||||
'username': username,
|
||||
@@ -254,7 +251,7 @@ const RevokeUser = {
|
||||
ajaxShowMessage(window.Messages.strRemovingSelectedUsers);
|
||||
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
$.post(url, $form.serialize() + argsep + 'delete=' + $thisButton.val() + argsep + 'ajax_request=true', function (data) {
|
||||
$.post(url, $form.serialize() + argsep + 'delete=' + $thisButton.val(), function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
ajaxShowMessage(data.message);
|
||||
// Refresh navigation, if we dropped some databases with the name
|
||||
@@ -318,7 +315,7 @@ const ExportPrivileges = {
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
const serverId = CommonParams.get('server');
|
||||
const selectedUsers = $('#usersForm input[name*=\'selected_usr\']:checkbox').serialize();
|
||||
const postStr = selectedUsers + '&submit_mult=export' + argsep + 'ajax_request=true&server=' + serverId;
|
||||
const postStr = selectedUsers + '&submit_mult=export' + argsep + 'server=' + serverId;
|
||||
|
||||
$.post($(this.form).prop('action'), postStr, function (data) {
|
||||
exportPrivilegesModalHandler(data, msgbox);
|
||||
@@ -336,7 +333,7 @@ const ExportUser = {
|
||||
handleEvent: function (event) {
|
||||
event.preventDefault();
|
||||
const msgbox = ajaxShowMessage();
|
||||
$.get($(this).attr('href'), { 'ajax_request': true }, function (data) {
|
||||
$.get($(this).attr('href'), function (data) {
|
||||
exportPrivilegesModalHandler(data, msgbox);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -752,7 +752,6 @@ AJAX.registerOnload('server/status/monitor.js', function () {
|
||||
|
||||
function loadLogVars (getvars = undefined) {
|
||||
const vars = {
|
||||
'ajax_request': true,
|
||||
'server': CommonParams.get('server'),
|
||||
};
|
||||
if (getvars) {
|
||||
@@ -1443,7 +1442,6 @@ AJAX.registerOnload('server/status/monitor.js', function () {
|
||||
function refreshChartGrid () {
|
||||
/* Send to server */
|
||||
runtime.refreshRequest = $.post('index.php?route=/server/status/monitor/chart', {
|
||||
'ajax_request': true,
|
||||
'requiredData': JSON.stringify(runtime.dataList),
|
||||
'server': CommonParams.get('server')
|
||||
}, function (data) {
|
||||
@@ -1708,7 +1706,6 @@ AJAX.registerOnload('server/status/monitor.js', function () {
|
||||
logRequest = $.post(
|
||||
url,
|
||||
{
|
||||
'ajax_request': true,
|
||||
'time_start': Math.round(opts.start / 1000),
|
||||
'time_end': Math.round(opts.end / 1000),
|
||||
'removeVariables': opts.removeVariables,
|
||||
@@ -2122,7 +2119,6 @@ AJAX.registerOnload('server/status/monitor.js', function () {
|
||||
window.themeImagePath + 'ajax_clock_small.gif" alt="">');
|
||||
|
||||
$.post('index.php?route=/server/status/monitor/query', {
|
||||
'ajax_request': true,
|
||||
'query': window.codeMirrorEditor ? window.codeMirrorEditor.getValue() : $('#sqlquery').val(),
|
||||
'database': db,
|
||||
'server': CommonParams.get('server')
|
||||
|
||||
@@ -52,7 +52,7 @@ const processList = {
|
||||
event.preventDefault();
|
||||
const argSep = CommonParams.get('arg_separator');
|
||||
let params = $(this).getPostData();
|
||||
params += argSep + 'ajax_request=1' + argSep + 'server=' + CommonParams.get('server');
|
||||
params += argSep + 'server=' + CommonParams.get('server');
|
||||
// Get row element of the process to be killed.
|
||||
const $tr = $(this).closest('tr');
|
||||
$.post($(this).attr('href'), params, function (data) {
|
||||
@@ -150,7 +150,6 @@ const processList = {
|
||||
getUrlParams: function () {
|
||||
const urlParams: { [k: string]: any } = {
|
||||
'server': CommonParams.get('server'),
|
||||
'ajax_request': true,
|
||||
'refresh': true,
|
||||
'full': $('input[name="full"]').val(),
|
||||
'order_by_field': $('input[name="order_by_field"]').val(),
|
||||
|
||||
@@ -39,7 +39,6 @@ AJAX.registerOnload('server/user_groups.js', function () {
|
||||
{
|
||||
'deleteUserGroup': true,
|
||||
'userGroup': userGroupName,
|
||||
'ajax_request': true,
|
||||
},
|
||||
AJAX.responseHandler
|
||||
);
|
||||
|
||||
@@ -48,7 +48,6 @@ AJAX.registerOnload('server/variables.js', function () {
|
||||
$mySaveLink.on('click', function () {
|
||||
const $msgbox = ajaxShowMessage(window.Messages.strProcessingRequest);
|
||||
$.post('index.php?route=/server/variables/set/' + encodeURIComponent(varName), {
|
||||
'ajax_request': true,
|
||||
'server': CommonParams.get('server'),
|
||||
'varValue': $valueCell.find('input').val()
|
||||
}, function (data) {
|
||||
@@ -86,7 +85,6 @@ AJAX.registerOnload('server/variables.js', function () {
|
||||
});
|
||||
|
||||
$.get('index.php?route=/server/variables/get/' + encodeURIComponent(varName), {
|
||||
'ajax_request': true,
|
||||
'server': CommonParams.get('server')
|
||||
}, function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import $ from 'jquery';
|
||||
import * as bootstrap from 'bootstrap';
|
||||
import { AJAX } from './modules/ajax.ts';
|
||||
import { checkFormElementInRange, checkSqlQuery, emptyCheckTheField, prepareForAjaxRequest } from './modules/functions.ts';
|
||||
import { checkFormElementInRange, checkSqlQuery, emptyCheckTheField } from './modules/functions.ts';
|
||||
import { Navigation } from './modules/navigation.ts';
|
||||
import { CommonParams } from './modules/common.ts';
|
||||
import createProfilingChart from './modules/functions/createProfilingChart.ts';
|
||||
@@ -284,7 +284,6 @@ const insertQuery = function (queryType) {
|
||||
window.themeImagePath + 'ajax_clock_small.gif" alt="">');
|
||||
|
||||
const params = {
|
||||
'ajax_request': true,
|
||||
'sql': window.codeMirrorEditor.getValue(),
|
||||
'server': CommonParams.get('server'),
|
||||
'formatSingleLine': queryType === 'formatSingleLine',
|
||||
@@ -533,7 +532,7 @@ AJAX.registerOnload('sql.js', function () {
|
||||
$link.confirm(question, $link.attr('href'), function (url) {
|
||||
ajaxShowMessage();
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
let params = 'ajax_request=1' + argsep + 'is_js_confirmed=1';
|
||||
let params = 'is_js_confirmed=1';
|
||||
const postData = $link.getPostData();
|
||||
if (postData) {
|
||||
params += argsep + postData;
|
||||
@@ -562,7 +561,7 @@ AJAX.registerOnload('sql.js', function () {
|
||||
|
||||
ajaxShowMessage();
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
$.post($(this).attr('action'), 'ajax_request=1' + argsep + $(this).serialize(), function (data) {
|
||||
$.post($(this).attr('action'), $(this).serialize(), function (data) {
|
||||
if (data.success) {
|
||||
ajaxShowMessage(data.message);
|
||||
} else {
|
||||
@@ -720,7 +719,6 @@ AJAX.registerOnload('sql.js', function () {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Event handler for sqlqueryform.ajax button_submit_query
|
||||
*
|
||||
@@ -830,8 +828,6 @@ AJAX.registerOnload('sql.js', function () {
|
||||
const $msgbox = ajaxShowMessage();
|
||||
const $sqlqueryresultsouter = $('#sqlqueryresultsouter');
|
||||
|
||||
prepareForAjaxRequest($form);
|
||||
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
$.post($form.attr('action'), $form.serialize() + argsep + 'ajax_page_request=true', function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
@@ -949,7 +945,7 @@ AJAX.registerOnload('sql.js', function () {
|
||||
|
||||
const $msgbox = ajaxShowMessage();
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
$.post($form.attr('action'), $form.serialize() + argsep + 'ajax_request=true', function (data) {
|
||||
$.post($form.attr('action'), $form.serialize(), function (data) {
|
||||
ajaxRemoveMessage($msgbox);
|
||||
const $sqlqueryresults = $form.parents('.sqlqueryresults');
|
||||
$sqlqueryresults
|
||||
@@ -994,7 +990,7 @@ AJAX.registerOnload('sql.js', function () {
|
||||
|
||||
const submitShowAllForm = function () {
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
const submitData = $form.serialize() + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true';
|
||||
const submitData = $form.serialize() + argsep + 'ajax_page_request=true';
|
||||
ajaxShowMessage();
|
||||
AJAX.source = $form;
|
||||
$.post($form.attr('action'), submitData, AJAX.responseHandler);
|
||||
@@ -1042,7 +1038,6 @@ AJAX.registerOnload('sql.js', function () {
|
||||
data: {
|
||||
'server': CommonParams.get('server'),
|
||||
'db': dbName,
|
||||
'ajax_request': '1',
|
||||
'sql_query': query,
|
||||
'sql_delimiter': delimiter
|
||||
},
|
||||
@@ -1097,7 +1092,7 @@ AJAX.registerOnload('sql.js', function () {
|
||||
const action = $button.val();
|
||||
const $form = $button.closest('form');
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
let submitData = $form.serialize() + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true' + argsep;
|
||||
let submitData = $form.serialize() + argsep + 'ajax_page_request=true' + argsep;
|
||||
ajaxShowMessage();
|
||||
AJAX.source = $form;
|
||||
|
||||
@@ -1206,8 +1201,7 @@ function browseForeignDialog ($thisA) {
|
||||
const tableId = '#browse_foreign_table';
|
||||
const filterId = '#input_foreign_filter';
|
||||
const argSep = CommonParams.get('arg_separator');
|
||||
let params = $thisA.getPostData();
|
||||
params += argSep + 'ajax_request=true';
|
||||
const params = $thisA.getPostData();
|
||||
|
||||
let browseForeignModal = document.getElementById('browseForeignModal');
|
||||
if (browseForeignModal === null) {
|
||||
@@ -1286,7 +1280,7 @@ function browseForeignDialog ($thisA) {
|
||||
}
|
||||
|
||||
// updates values in dialog
|
||||
$.post($(this).attr('action') + '&ajax_request=1', postParams, function (data) {
|
||||
$.post($(this).attr('action'), postParams, function (data) {
|
||||
const $obj = $('<div>').html(data.message);
|
||||
$(formId).html($obj.find(formId).html());
|
||||
$(tableId).html($obj.find(tableId).html());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import $ from 'jquery';
|
||||
import { AJAX } from '../modules/ajax.ts';
|
||||
import { checkSqlQuery, prepareForAjaxRequest } from '../modules/functions.ts';
|
||||
import { checkSqlQuery } from '../modules/functions.ts';
|
||||
import { ajaxRemoveMessage, ajaxShowMessage } from '../modules/ajax-message.ts';
|
||||
import { escapeHtml } from '../modules/functions/escape.ts';
|
||||
import { ColumnType, DataTable } from '../modules/chart.ts';
|
||||
@@ -441,7 +441,6 @@ AJAX.registerOnload('table/chart.js', function () {
|
||||
}
|
||||
|
||||
const $msgbox = ajaxShowMessage();
|
||||
prepareForAjaxRequest($form);
|
||||
$.post($form.attr('action'), $form.serialize(), function (data) {
|
||||
if (typeof data !== 'undefined' &&
|
||||
data.success === true &&
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { AJAX } from '../modules/ajax.ts';
|
||||
import { prepareForAjaxRequest } from '../modules/functions.ts';
|
||||
import { ajaxRemoveMessage, ajaxShowMessage } from '../modules/ajax-message.ts';
|
||||
|
||||
/**
|
||||
@@ -36,7 +35,6 @@ AJAX.registerOnload('table/find_replace.js', function () {
|
||||
$('#find_replace_form').on('submit', function (e) {
|
||||
e.preventDefault();
|
||||
const findReplaceForm = $('#find_replace_form');
|
||||
prepareForAjaxRequest(findReplaceForm);
|
||||
const $msgbox = ajaxShowMessage();
|
||||
$.post(findReplaceForm.attr('action'), findReplaceForm.serialize(), function (data) {
|
||||
ajaxRemoveMessage($msgbox);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import $ from 'jquery';
|
||||
import { AJAX } from '../modules/ajax.ts';
|
||||
import { getForeignKeyCheckboxLoader, loadForeignKeyCheckbox, prepareForAjaxRequest } from '../modules/functions.ts';
|
||||
import { getForeignKeyCheckboxLoader, loadForeignKeyCheckbox } from '../modules/functions.ts';
|
||||
import { Navigation } from '../modules/navigation.ts';
|
||||
import { CommonParams } from '../modules/common.ts';
|
||||
import highlightSql from '../modules/sql-highlight.ts';
|
||||
@@ -81,7 +81,6 @@ AJAX.registerOnload('table/operations.js', function () {
|
||||
$(document).on('submit', '#copyTable.ajax', function (event) {
|
||||
event.preventDefault();
|
||||
const $form = $(this);
|
||||
prepareForAjaxRequest($form);
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
$.post($form.attr('action'), $form.serialize() + argsep + 'submit_copy=Go', function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
@@ -118,7 +117,6 @@ AJAX.registerOnload('table/operations.js', function () {
|
||||
$(document).on('submit', '#moveTableForm', function (event) {
|
||||
event.preventDefault();
|
||||
const $form = $(this);
|
||||
prepareForAjaxRequest($form);
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
$.post($form.attr('action'), $form.serialize() + argsep + 'submit_move=1', function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
@@ -152,7 +150,6 @@ AJAX.registerOnload('table/operations.js', function () {
|
||||
|
||||
if ($tblNameField.val() !== $tblNameField[0].defaultValue) {
|
||||
// reload page and navigation if the table has been renamed
|
||||
prepareForAjaxRequest($form);
|
||||
|
||||
if ($tblCollationField.val() !== collationOrigValue && $changeAllColumnCollationsCheckBox.is(':checked')) {
|
||||
$form.confirm(question, $form.attr('action'), function () {
|
||||
@@ -207,7 +204,6 @@ AJAX.registerOnload('table/operations.js', function () {
|
||||
|
||||
// variables which stores the common attributes
|
||||
let params = $.param({
|
||||
'ajax_request': 1,
|
||||
'server': CommonParams.get('server'),
|
||||
});
|
||||
const postData = $link.getPostData();
|
||||
@@ -263,7 +259,7 @@ AJAX.registerOnload('table/operations.js', function () {
|
||||
|
||||
function submitPartitionMaintenance () {
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
const submitData = $form.serialize() + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true';
|
||||
const submitData = $form.serialize() + argsep + 'ajax_page_request=true';
|
||||
ajaxShowMessage(window.Messages.strProcessingRequest);
|
||||
AJAX.source = $form;
|
||||
$.post($form.attr('action'), submitData, AJAX.responseHandler);
|
||||
|
||||
@@ -89,7 +89,7 @@ const getDropdownValues = function ($dropdown): void {
|
||||
const $db = $form.find('input[name="db"]').val();
|
||||
const $table = $form.find('input[name="table"]').val();
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
let params = 'getDropdownValues=true' + argsep + 'ajax_request=true' +
|
||||
let params = 'getDropdownValues=true' +
|
||||
argsep + 'db=' + encodeURIComponent($db) +
|
||||
argsep + 'table=' + encodeURIComponent($table) +
|
||||
argsep + 'foreign=' + (foreign !== '') +
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import $ from 'jquery';
|
||||
import * as bootstrap from 'bootstrap';
|
||||
import { AJAX } from '../modules/ajax.ts';
|
||||
import { addDatepicker, prepareForAjaxRequest } from '../modules/functions.ts';
|
||||
import { addDatepicker } from '../modules/functions.ts';
|
||||
import { CommonParams } from '../modules/common.ts';
|
||||
import highlightSql from '../modules/sql-highlight.ts';
|
||||
import { ajaxRemoveMessage, ajaxShowMessage } from '../modules/ajax-message.ts';
|
||||
@@ -129,8 +129,6 @@ AJAX.registerOnload('table/select.js', function () {
|
||||
$('#sqlqueryresultsouter').empty();
|
||||
const $msgbox = ajaxShowMessage(window.Messages.strSearching, false);
|
||||
|
||||
prepareForAjaxRequest($searchForm);
|
||||
|
||||
const values: { [k: string]: any } = {};
|
||||
($searchForm.find(':input') as JQuery<HTMLInputElement>).each(function () {
|
||||
const $input = $(this);
|
||||
@@ -325,7 +323,6 @@ AJAX.registerOnload('table/select.js', function () {
|
||||
type: 'POST',
|
||||
data: {
|
||||
'server': CommonParams.get('server'),
|
||||
'ajax_request': 1,
|
||||
'db': $('input[name="db"]').val(),
|
||||
'table': $('input[name="table"]').val(),
|
||||
'column': columnName,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import $ from 'jquery';
|
||||
import { AJAX } from '../modules/ajax.ts';
|
||||
import { checkReservedWordColumns, checkTableEditForm, prepareForAjaxRequest } from '../modules/functions.ts';
|
||||
import { checkReservedWordColumns, checkTableEditForm } from '../modules/functions.ts';
|
||||
import { Navigation } from '../modules/navigation.ts';
|
||||
import { CommonParams } from '../modules/common.ts';
|
||||
import highlightSql from '../modules/sql-highlight.ts';
|
||||
@@ -32,7 +32,7 @@ import { sprintf } from 'locutus/php/strings/sprintf';
|
||||
* Reload fields table
|
||||
*/
|
||||
function reloadFieldForm () {
|
||||
$.post($('#fieldsForm').attr('action'), $('#fieldsForm').serialize() + CommonParams.get('arg_separator') + 'ajax_request=true', function (formData) {
|
||||
$.post($('#fieldsForm').attr('action'), $('#fieldsForm').serialize(), function (formData) {
|
||||
const $tempDiv = $('<div id=\'temp_div\'><div>').append(formData.message);
|
||||
$('#fieldsForm').replaceWith($tempDiv.find('#fieldsForm'));
|
||||
$('#addColumns').replaceWith($tempDiv.find('#addColumns'));
|
||||
@@ -156,7 +156,6 @@ AJAX.registerOnload('table/structure.js', function () {
|
||||
if (checkTableEditForm($form[0], fieldCnt)) {
|
||||
// OK, form passed validation step
|
||||
|
||||
prepareForAjaxRequest($form);
|
||||
if (checkReservedWordColumns($form)) {
|
||||
// User wants to submit the form
|
||||
|
||||
@@ -344,8 +343,7 @@ AJAX.registerOnload('table/structure.js', function () {
|
||||
const formUrl = $form.attr('action');
|
||||
const sep = CommonParams.get('arg_separator');
|
||||
const formData = serialized +
|
||||
sep + 'preview_sql=1' +
|
||||
sep + 'ajax_request=1';
|
||||
sep + 'preview_sql=1';
|
||||
$.post({
|
||||
url: formUrl,
|
||||
data: formData,
|
||||
@@ -386,7 +384,7 @@ AJAX.registerOnload('table/structure.js', function () {
|
||||
return;
|
||||
}
|
||||
|
||||
$.post($form.prop('action'), serialized + CommonParams.get('arg_separator') + 'ajax_request=true', function (data) {
|
||||
$.post($form.prop('action'), serialized, function (data) {
|
||||
if (data.success === false) {
|
||||
ajaxRemoveMessage($msgbox);
|
||||
const errorModal = $('#moveColumnsErrorModal');
|
||||
@@ -431,7 +429,7 @@ AJAX.registerOnload('table/structure.js', function () {
|
||||
e.preventDefault();
|
||||
const $form = $(this).parents('form');
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
const submitData = $form.serialize() + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true';
|
||||
const submitData = $form.serialize() + argsep + 'ajax_page_request=true';
|
||||
|
||||
ajaxShowMessage();
|
||||
AJAX.source = $form;
|
||||
@@ -447,7 +445,7 @@ AJAX.registerOnload('table/structure.js', function () {
|
||||
const $link = $(this);
|
||||
|
||||
function submitPartitionAction (url) {
|
||||
const params = 'ajax_request=true&ajax_page_request=true&' + $link.getPostData();
|
||||
const params = 'ajax_page_request=true&' + $link.getPostData();
|
||||
ajaxShowMessage();
|
||||
AJAX.source = $link;
|
||||
$.post(url, params, AJAX.responseHandler);
|
||||
@@ -475,7 +473,6 @@ AJAX.registerOnload('table/structure.js', function () {
|
||||
const question = window.Messages.strRemovePartitioningWarning;
|
||||
$link.confirm(question, $link.attr('href'), function (url) {
|
||||
const params = getJsConfirmCommonParam({
|
||||
'ajax_request': true,
|
||||
'ajax_page_request': true,
|
||||
}, $link.getPostData());
|
||||
ajaxShowMessage();
|
||||
|
||||
@@ -60,7 +60,7 @@ AJAX.registerOnload('table/tracking.js', function () {
|
||||
const $button = $(this);
|
||||
const $form = $button.parent('form');
|
||||
const argsep = CommonParams.get('arg_separator');
|
||||
const submitData = $form.serialize() + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true' + argsep + 'submit_mult=' + $button.val();
|
||||
const submitData = $form.serialize() + argsep + 'ajax_page_request=true' + argsep + 'submit_mult=' + $button.val();
|
||||
|
||||
if ($button.val() === 'delete_version') {
|
||||
const question = window.Messages.strDeleteTrackingVersionMultiple;
|
||||
|
||||
@@ -157,7 +157,6 @@ AJAX.registerOnload('table/zoom_search.js', function () {
|
||||
$('#tableid_0').on('change', function () {
|
||||
// AJAX request for field type, collation, operators, and value field
|
||||
$.post('index.php?route=/table/zoom-search', {
|
||||
'ajax_request': true,
|
||||
'change_tbl_info': true,
|
||||
'server': CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
@@ -182,7 +181,6 @@ AJAX.registerOnload('table/zoom_search.js', function () {
|
||||
$('#tableid_1').on('change', function () {
|
||||
// AJAX request for field type, collation, operators, and value field
|
||||
$.post('index.php?route=/table/zoom-search', {
|
||||
'ajax_request': true,
|
||||
'change_tbl_info': true,
|
||||
'server': CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
@@ -206,7 +204,6 @@ AJAX.registerOnload('table/zoom_search.js', function () {
|
||||
$('#tableid_2').on('change', function () {
|
||||
// AJAX request for field type, collation, operators, and value field
|
||||
$.post('index.php?route=/table/zoom-search', {
|
||||
'ajax_request': true,
|
||||
'change_tbl_info': true,
|
||||
'server': CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
@@ -228,7 +225,6 @@ AJAX.registerOnload('table/zoom_search.js', function () {
|
||||
$('#tableid_3').on('change', function () {
|
||||
// AJAX request for field type, collation, operators, and value field
|
||||
$.post('index.php?route=/table/zoom-search', {
|
||||
'ajax_request': true,
|
||||
'change_tbl_info': true,
|
||||
'server': CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
@@ -425,7 +421,6 @@ AJAX.registerOnload('table/zoom_search.js', function () {
|
||||
$.post('index.php?route=/sql', {
|
||||
'server': CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'ajax_request': true,
|
||||
'sql_query': sqlQuery,
|
||||
'inline_edit': false,
|
||||
}, function (data) {
|
||||
@@ -649,7 +644,6 @@ AJAX.registerOnload('table/zoom_search.js', function () {
|
||||
searchedDataKey = data[4]; // key from searchedData (global)
|
||||
let fieldId = 0;
|
||||
const postParams = {
|
||||
'ajax_request': true,
|
||||
'get_data_row': true,
|
||||
'server': CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
|
||||
@@ -85,7 +85,7 @@ const DatabaseTriggers = {
|
||||
exportAnchors.each(function () {
|
||||
const h = $(this).attr('href');
|
||||
p = p.then(function () {
|
||||
return $.get(h, { 'ajax_request': true }, function (data) {
|
||||
return $.get(h, function (data) {
|
||||
returnCount++;
|
||||
if (data.success === true) {
|
||||
combined.message += '\n' + data.message + '\n';
|
||||
@@ -104,7 +104,7 @@ const DatabaseTriggers = {
|
||||
});
|
||||
});
|
||||
} else {
|
||||
$.get($this.attr('href'), { 'ajax_request': true }, showExport);
|
||||
$.get($this.attr('href'), showExport);
|
||||
}
|
||||
|
||||
function showExport (data) {
|
||||
@@ -152,7 +152,7 @@ const DatabaseTriggers = {
|
||||
* the AJAX message shown to the user
|
||||
*/
|
||||
let $msg = ajaxShowMessage();
|
||||
$.get($this.attr('href'), { 'ajax_request': true }, function (data) {
|
||||
$.get($this.attr('href'), function (data) {
|
||||
if (data.success !== true) {
|
||||
ajaxShowMessage(data.error, false);
|
||||
|
||||
|
||||
@@ -180,7 +180,6 @@
|
||||
|
||||
{% if is_ajax %}
|
||||
<input type="hidden" name="{{ is_edit_mode ? 'editor_process_edit' : 'editor_process_add' }}" value="true">
|
||||
<input type="hidden" name="ajax_request" value="true">
|
||||
{% else %}
|
||||
<div class="card-footer">
|
||||
<input class="btn btn-primary" type="submit" name="{{ is_edit_mode ? 'editor_process_edit' : 'editor_process_add' }}" value="{{ t('Go') }}">
|
||||
|
||||
@@ -64,6 +64,5 @@
|
||||
</div>
|
||||
{% else %}
|
||||
<input type="hidden" name="execute_routine" value="true">
|
||||
<input type="hidden" name="ajax_request" value="true">
|
||||
{% endif %}
|
||||
</form>
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
{% set row_sum_url = [] %}
|
||||
{% if approx_rows is defined %}
|
||||
{% set row_sum_url = {
|
||||
'ajax_request': true,
|
||||
'db': db,
|
||||
'real_row_count_all': 'true'
|
||||
} %}
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
{# Check if current table is already in favorite list #}
|
||||
{% set fav_params = {
|
||||
'db': db,
|
||||
'ajax_request': true,
|
||||
'favorite_table': current_table['TABLE_NAME'],
|
||||
((already_favorite ? 'remove' : 'add') ~ '_favorite'): true
|
||||
} %}
|
||||
@@ -100,7 +99,6 @@
|
||||
data-table="{{ current_table['TABLE_NAME'] }}">
|
||||
{% if approx_rows %}
|
||||
<a href="{{ url('/database/structure/real-row-count', {
|
||||
'ajax_request': true,
|
||||
'db': db,
|
||||
'table': current_table['TABLE_NAME']
|
||||
}) }}" class="ajax real_row_count">
|
||||
|
||||
@@ -115,7 +115,6 @@
|
||||
|
||||
{% if is_ajax %}
|
||||
<input type="hidden" name="editor_process_{{ mode }}" value="true">
|
||||
<input type="hidden" name="ajax_request" value="true">
|
||||
{% else %}
|
||||
<div class="card-footer">
|
||||
<input class="btn btn-primary" type="submit" name="editor_process_{{ mode }}" value="{{ t('Go') }}">
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
{% endif %}
|
||||
{% if is_ajax %}
|
||||
<input type="hidden" name="{{ is_edit ? 'editor_process_edit' : 'editor_process_add' }}" value="true">
|
||||
<input type="hidden" name="ajax_request" value="true">
|
||||
{% endif %}
|
||||
|
||||
<div class="card">
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<div id="div_view_options">
|
||||
<form method="post" action="{{ url('/view/create') }}" class="card">
|
||||
{{ get_hidden_inputs(url_params) }}
|
||||
<input type="hidden" name="ajax_request" value="1">
|
||||
<input type="hidden" name="{{ (view['operation'] == 'create') ? 'createview' : 'alterview' }}" value="1">
|
||||
<input type="hidden" name="ajax_dialog" value="1">
|
||||
|
||||
|
||||
@@ -433,7 +433,6 @@ final readonly class RoutinesController implements InvocableController
|
||||
'reload' => 1,
|
||||
];
|
||||
if ($this->response->isAjax()) {
|
||||
$redirParams['ajax_request'] = 'true';
|
||||
$redirParams['ajax_page_request'] = 'true';
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,6 @@ final readonly class FavoriteTableController implements InvocableController
|
||||
// Check if current table is already in favorite list.
|
||||
$favoriteParams = [
|
||||
'db' => Current::$database,
|
||||
'ajax_request' => true,
|
||||
'favorite_table' => $favoriteTableName,
|
||||
($alreadyFavorite ? 'remove' : 'add') . '_favorite' => true,
|
||||
];
|
||||
|
||||
@@ -48,7 +48,6 @@ final class ProcessesController extends AbstractController implements InvocableC
|
||||
));
|
||||
|
||||
$urlParams = [
|
||||
'ajax_request' => true,
|
||||
'full' => $full,
|
||||
'column_name' => $request->getParsedBodyParam('column_name', ''),
|
||||
'order_by_field' => $orderByField,
|
||||
|
||||
@@ -147,7 +147,6 @@ final readonly class AddFieldController implements InvocableController
|
||||
Url::getFromRoute('/table/structure', [
|
||||
'db' => Current::$database,
|
||||
'table' => Current::$table,
|
||||
'ajax_request' => '1',
|
||||
]),
|
||||
);
|
||||
|
||||
|
||||
@@ -201,7 +201,6 @@ class RecentFavoriteTables
|
||||
$removeParameters = [
|
||||
'db' => $table->db->getName(),
|
||||
'favorite_table' => $table->table->getName(),
|
||||
'ajax_request' => true,
|
||||
'remove_favorite' => true,
|
||||
];
|
||||
$tableParameters = [
|
||||
@@ -304,7 +303,7 @@ class RecentFavoriteTables
|
||||
$relationParameters->favoriteTablesFeature !== null
|
||||
&& ! isset($_SESSION['tmpval']['favorites_synced'][Current::$server])
|
||||
) {
|
||||
$url = Url::getFromRoute('/sync-favorite-tables', ['ajax_request' => true]);
|
||||
$url = Url::getFromRoute('/sync-favorite-tables');
|
||||
|
||||
return '<a class="hide" id="sync_favorite_tables" href="' . $url . '"></a>';
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ final class ServerRequestFactory implements ServerRequestFactoryInterface
|
||||
);
|
||||
|
||||
foreach ($this->getAllHeaders() as $name => $value) {
|
||||
$serverRequest = $serverRequest->withAddedHeader($name, $value);
|
||||
$serverRequest = $serverRequest->withHeader($name, $value);
|
||||
}
|
||||
|
||||
$serverRequest = $serverRequest->withQueryParams($_GET);
|
||||
|
||||
@@ -296,8 +296,7 @@ class ServerRequest implements ServerRequestInterface
|
||||
|
||||
public function isAjax(): bool
|
||||
{
|
||||
return $this->serverRequest->getHeaderLine('X-Requested-With') === 'XMLHttpRequest'
|
||||
|| $this->has('ajax_request');
|
||||
return $this->serverRequest->getHeaderLine('X-Requested-With') === 'XMLHttpRequest';
|
||||
}
|
||||
|
||||
public function getParsedBodyParamAsString(string $param, string|null $default = null): string
|
||||
|
||||
@@ -23,7 +23,7 @@ describe('ThemeColorModeToggle event listener', () => {
|
||||
|
||||
expect($.post).toHaveBeenCalledWith(
|
||||
'https://example.com/index.php?route=/themes/set',
|
||||
{ 'ajax_request': '1', 'themeColorMode': 'color3' }
|
||||
{ 'themeColorMode': 'color3' }
|
||||
);
|
||||
|
||||
expect(document.querySelector('html').dataset.bsTheme).toEqual('color3');
|
||||
|
||||
@@ -218,7 +218,7 @@
|
||||
<td class="text-center d-print-none">
|
||||
<a id="e1aa88c07d60f7472d1e27463e533c89_favorite_anchor"
|
||||
class="ajax favorite_table_anchor"
|
||||
href="index.php?route=/database/structure/favorite-table&db=test_db&ajax_request=1&favorite_table=test_table&add_favorite=1&lang=en"
|
||||
href="index.php?route=/database/structure/favorite-table&db=test_db&favorite_table=test_table&add_favorite=1&lang=en"
|
||||
title="Add to Favorites"
|
||||
data-favtargets="b383d6fb8e32135d258f2667459fab76">
|
||||
<span class="text-nowrap"><img src="themes/dot.gif" title="" alt="" class="icon ic_b_no_favorite"> </span>
|
||||
|
||||
@@ -32,7 +32,8 @@ class RealRowCountControllerTest extends AbstractTestCase
|
||||
$response = new ResponseStub();
|
||||
|
||||
$request = ServerRequestFactory::create()->createServerRequest('GET', 'http://example.com/')
|
||||
->withQueryParams(['db' => 'world', 'table' => 'City', 'ajax_request' => '1']);
|
||||
->withHeader('X-Requested-With', 'XMLHttpRequest')
|
||||
->withQueryParams(['db' => 'world', 'table' => 'City']);
|
||||
|
||||
(new RealRowCountController($response, $dbi, new DbTableExists($dbi)))($request);
|
||||
|
||||
|
||||
@@ -98,8 +98,8 @@ final class LintControllerTest extends AbstractTestCase
|
||||
self::assertNotFalse($expectedJson);
|
||||
|
||||
$request = ServerRequestFactory::create()->createServerRequest('POST', 'https://example.com/')
|
||||
->withHeader('X-Requested-With', 'XMLHttpRequest')
|
||||
->withParsedBody([
|
||||
'ajax_request' => '1',
|
||||
'sql_query' => 'SELECT * FROM `actor` WHEREE `actor_id` = 1',
|
||||
'options' => null,
|
||||
]);
|
||||
|
||||
@@ -59,8 +59,8 @@ final class CreateControllerTest extends AbstractTestCase
|
||||
$controller = new CreateController($response, $this->dbi, $config);
|
||||
|
||||
$request = ServerRequestFactory::create()->createServerRequest('POST', 'https://example.com/')
|
||||
->withHeader('X-Requested-With', 'XMLHttpRequest')
|
||||
->withParsedBody([
|
||||
'ajax_request' => 'true',
|
||||
'new_db' => 'test_db',
|
||||
'db_collation' => 'utf8_general_ci',
|
||||
]);
|
||||
|
||||
@@ -37,8 +37,8 @@ class AccountLockControllerTest extends AbstractTestCase
|
||||
$this->dbiStub->method('isMariaDB')->willReturn(true);
|
||||
|
||||
$this->requestStub = ServerRequestFactory::create()->createServerRequest('POST', 'https://example.com/')
|
||||
->withHeader('X-Requested-With', 'XMLHttpRequest')
|
||||
->withParsedBody([
|
||||
'ajax_request' => 'true',
|
||||
'username' => 'test.user',
|
||||
'hostname' => 'test.host',
|
||||
]);
|
||||
|
||||
@@ -37,8 +37,8 @@ class AccountUnlockControllerTest extends AbstractTestCase
|
||||
$this->dbiStub->method('isMariaDB')->willReturn(true);
|
||||
|
||||
$this->requestStub = ServerRequestFactory::create()->createServerRequest('POST', 'https://example.com/')
|
||||
->withHeader('X-Requested-With', 'XMLHttpRequest')
|
||||
->withParsedBody([
|
||||
'ajax_request' => 'true',
|
||||
'username' => 'test.user',
|
||||
'hostname' => 'test.host',
|
||||
]);
|
||||
|
||||
@@ -61,8 +61,8 @@ class GeneralLogControllerTest extends AbstractTestCase
|
||||
);
|
||||
|
||||
$request = ServerRequestFactory::create()->createServerRequest('POST', 'https://example.com/')
|
||||
->withHeader('X-Requested-With', 'XMLHttpRequest')
|
||||
->withParsedBody([
|
||||
'ajax_request' => 'true',
|
||||
'time_start' => '0',
|
||||
'time_end' => '10',
|
||||
'limitTypes' => '1',
|
||||
|
||||
@@ -53,8 +53,8 @@ class QueryAnalyzerControllerTest extends AbstractTestCase
|
||||
);
|
||||
|
||||
$request = ServerRequestFactory::create()->createServerRequest('POST', 'https://example.com/')
|
||||
->withHeader('X-Requested-With', 'XMLHttpRequest')
|
||||
->withParsedBody([
|
||||
'ajax_request' => 'true',
|
||||
'database' => 'database',
|
||||
'query' => 'query',
|
||||
]);
|
||||
|
||||
@@ -57,8 +57,8 @@ class SlowLogControllerTest extends AbstractTestCase
|
||||
);
|
||||
|
||||
$request = ServerRequestFactory::create()->createServerRequest('POST', 'https://example.com/')
|
||||
->withHeader('X-Requested-With', 'XMLHttpRequest')
|
||||
->withParsedBody([
|
||||
'ajax_request' => 'true',
|
||||
'time_start' => '0',
|
||||
'time_end' => '10',
|
||||
]);
|
||||
|
||||
@@ -64,8 +64,8 @@ class RefreshControllerTest extends AbstractTestCase
|
||||
);
|
||||
|
||||
$request = ServerRequestFactory::create()->createServerRequest('POST', 'https://example.com/')
|
||||
->withHeader('X-Requested-With', 'XMLHttpRequest')
|
||||
->withParsedBody([
|
||||
'ajax_request' => 'true',
|
||||
'column_name' => '',
|
||||
'order_by_field' => 'process',
|
||||
'sort_order' => 'DESC',
|
||||
|
||||
@@ -76,7 +76,6 @@ class ReplaceControllerTest extends AbstractTestCase
|
||||
UrlParams::$params = [];
|
||||
$_POST['db'] = Current::$database;
|
||||
$_POST['table'] = Current::$table;
|
||||
$_POST['ajax_request'] = 'true';
|
||||
$_POST['relational_display'] = 'K';
|
||||
|
||||
$request = self::createStub(ServerRequest::class);
|
||||
|
||||
@@ -334,7 +334,6 @@ class CreateAddFieldTest extends AbstractTestCase
|
||||
'field_input_transformation_options' => [''],
|
||||
'do_save_data' => '1',
|
||||
'preview_sql' => '1',
|
||||
'ajax_request' => '1',
|
||||
],
|
||||
],
|
||||
[
|
||||
@@ -371,7 +370,6 @@ class CreateAddFieldTest extends AbstractTestCase
|
||||
'field_input_transformation_options' => [''],
|
||||
'do_save_data' => '1',
|
||||
'preview_sql' => '1',
|
||||
'ajax_request' => '1',
|
||||
'online_transaction' => 'ONLINE_TRANSACTION_ENABLED',
|
||||
],
|
||||
],
|
||||
@@ -450,7 +448,6 @@ class CreateAddFieldTest extends AbstractTestCase
|
||||
'field_input_transformation_options' => [''],
|
||||
'do_save_data' => '1',
|
||||
'preview_sql' => '1',
|
||||
'ajax_request' => '1',
|
||||
'online_transaction' => 'ONLINE_TRANSACTION_ENABLED',
|
||||
],
|
||||
],
|
||||
@@ -503,7 +500,6 @@ class CreateAddFieldTest extends AbstractTestCase
|
||||
'field_input_transformation_options' => [''],
|
||||
'do_save_data' => '1',
|
||||
'preview_sql' => '1',
|
||||
'ajax_request' => '1',
|
||||
];
|
||||
|
||||
$sqlQuery = $this->createAddField->getColumnCreationQuery('my_table');
|
||||
|
||||
@@ -58,7 +58,8 @@ final class TokenRequestParamCheckingTest extends TestCase
|
||||
$responseRenderer->setAjax(true);
|
||||
|
||||
$request = ServerRequestFactory::create()->createServerRequest('POST', 'http://example.com/')
|
||||
->withParsedBody(['token' => 'token', 'ajax_request' => 'true']);
|
||||
->withHeader('X-Requested-With', 'XMLHttpRequest')
|
||||
->withParsedBody(['token' => 'token']);
|
||||
$response = $middleware->checkTokenRequestParam($request);
|
||||
self::assertInstanceOf(ResponseInterface::class, $response);
|
||||
}
|
||||
|
||||
@@ -111,44 +111,14 @@ class ServerRequestTest extends TestCase
|
||||
public static function isAjaxProvider(): iterable
|
||||
{
|
||||
return [
|
||||
[true, 'GET', 'http://example.com/index.php?route=/&ajax_request=1', [], null],
|
||||
[true, 'GET', 'http://example.com/index.php?route=/&ajax_request=0', [], null],
|
||||
[true, 'GET', 'http://example.com/index.php?route=/&ajax_request=true', [], null],
|
||||
[true, 'GET', 'http://example.com/index.php?route=/', ['X-Requested-With' => 'XMLHttpRequest'], null],
|
||||
[
|
||||
true,
|
||||
'GET',
|
||||
'http://example.com/index.php?route=/&ajax_request=1',
|
||||
['X-Requested-With' => 'XMLHttpRequest'],
|
||||
null,
|
||||
],
|
||||
[false, 'GET', 'http://example.com/index.php?route=/', [], null],
|
||||
[true, 'POST', 'http://example.com/index.php?route=/&ajax_request=1', [], []],
|
||||
[false, 'GET', 'http://example.com/index.php?route=/&ajax_request=1', [], null],
|
||||
[false, 'GET', 'http://example.com/index.php?route=/', ['X-Requested-With' => 'other'], null],
|
||||
[true, 'POST', 'http://example.com/index.php?route=/', ['X-Requested-With' => 'XMLHttpRequest'], []],
|
||||
[
|
||||
true,
|
||||
'POST',
|
||||
'http://example.com/index.php?route=/&ajax_request=1',
|
||||
['X-Requested-With' => 'XMLHttpRequest'],
|
||||
[],
|
||||
],
|
||||
[true, 'POST', 'http://example.com/index.php?route=/&ajax_request=1', [], ['ajax_request' => '1']],
|
||||
[
|
||||
true,
|
||||
'POST',
|
||||
'http://example.com/index.php?route=/&ajax_request=1',
|
||||
['X-Requested-With' => 'XMLHttpRequest'],
|
||||
['ajax_request' => '1'],
|
||||
],
|
||||
[
|
||||
true,
|
||||
'POST',
|
||||
'http://example.com/index.php?route=/',
|
||||
['X-Requested-With' => 'XMLHttpRequest'],
|
||||
['ajax_request' => '1'],
|
||||
],
|
||||
[true, 'POST', 'http://example.com/index.php?route=/', [], ['ajax_request' => '1']],
|
||||
[false, 'POST', 'http://example.com/index.php?route=/', [], []],
|
||||
[false, 'POST', 'http://example.com/index.php?route=/&ajax_request=1', [], []],
|
||||
[false, 'POST', 'http://example.com/index.php?route=/', [], ['ajax_request' => '1']],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,7 +197,6 @@ class SearchTest extends AbstractTestCase
|
||||
$_POST['orderByColumn'] = '--nil--';
|
||||
$_POST['order'] = 'ASC';
|
||||
$_POST['submit'] = 'Go';
|
||||
$_POST['ajax_request'] = 'true';
|
||||
$_POST['displayAllColumns'] = 'true';
|
||||
|
||||
self::assertSame('SELECT * FROM `world_cities`', $this->search->buildSqlQuery());
|
||||
|
||||
Reference in New Issue
Block a user