Merge pull request #17918 from MauricioFauth/import-common-js
Import CommonParams and CommonActions as modules
This commit is contained in:
commit
d5fed1e989
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from './common.js';
|
||||
|
||||
/* global Navigation */
|
||||
|
||||
@ -28,7 +29,7 @@ window.AJAX = {
|
||||
// eslint-disable-next-line valid-jsdoc
|
||||
/**
|
||||
* @var {Function} callback Callback to execute after a successful request
|
||||
* Used by window.CommonActions from common.js
|
||||
* Used by CommonActions from common.js
|
||||
*/
|
||||
callback: function () {},
|
||||
/**
|
||||
@ -300,7 +301,7 @@ window.AJAX = {
|
||||
$('html, body').animate({ scrollTop: 0 }, 'fast');
|
||||
|
||||
var url = isLink ? href : $(this).attr('action');
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
var params = 'ajax_request=true' + argsep + 'ajax_page_request=true';
|
||||
var dataPost = window.AJAX.source.getPostData();
|
||||
if (! isLink) {
|
||||
@ -366,7 +367,7 @@ window.AJAX = {
|
||||
}
|
||||
Functions.ajaxRemoveMessage(window.AJAX.$msgbox);
|
||||
|
||||
window.CommonParams.set('token', data.new_token);
|
||||
CommonParams.set('token', data.new_token);
|
||||
|
||||
window.AJAX.scriptHandler.load([]);
|
||||
|
||||
@ -421,7 +422,7 @@ window.AJAX = {
|
||||
|
||||
if (typeof data.success !== 'undefined' && data.success) {
|
||||
// reload page if user trying to login has changed
|
||||
if (window.CommonParams.get('user') !== data.params.user) {
|
||||
if (CommonParams.get('user') !== data.params.user) {
|
||||
window.location = 'index.php';
|
||||
Functions.ajaxShowMessage(window.Messages.strLoading, false);
|
||||
window.AJAX.active = false;
|
||||
@ -548,7 +549,7 @@ window.AJAX = {
|
||||
$('#selflink').find('> a').attr('href', data.selflink);
|
||||
}
|
||||
if (data.params) {
|
||||
window.CommonParams.setAll(data.params);
|
||||
CommonParams.setAll(data.params);
|
||||
}
|
||||
if (data.scripts) {
|
||||
window.AJAX.scriptHandler.load(data.scripts);
|
||||
@ -681,10 +682,10 @@ window.AJAX = {
|
||||
// Clear loaded scripts if they are from another version of phpMyAdmin.
|
||||
// Depends on common params being set before loading scripts in responseHandler
|
||||
if (self.scriptsVersion === null) {
|
||||
self.scriptsVersion = window.CommonParams.get('version');
|
||||
} else if (self.scriptsVersion !== window.CommonParams.get('version')) {
|
||||
self.scriptsVersion = CommonParams.get('version');
|
||||
} else if (self.scriptsVersion !== CommonParams.get('version')) {
|
||||
self.scripts = [];
|
||||
self.scriptsVersion = window.CommonParams.get('version');
|
||||
self.scriptsVersion = CommonParams.get('version');
|
||||
}
|
||||
self.scriptsCompleted = false;
|
||||
self.scriptsToBeFired = [];
|
||||
@ -751,7 +752,7 @@ window.AJAX = {
|
||||
|
||||
script.type = 'text/javascript';
|
||||
var file = name.indexOf('vendor/') !== -1 ? name : 'dist/' + name;
|
||||
script.src = 'js/' + file + '?' + 'v=' + encodeURIComponent(window.CommonParams.get('version'));
|
||||
script.src = 'js/' + file + '?' + 'v=' + encodeURIComponent(CommonParams.get('version'));
|
||||
script.async = false;
|
||||
script.onload = function () {
|
||||
self.done(name, callback);
|
||||
@ -875,7 +876,7 @@ window.AJAX = {
|
||||
var state = event.originalEvent.state;
|
||||
if (state && state.menu) {
|
||||
window.AJAX.$msgbox = Functions.ajaxShowMessage();
|
||||
var params = 'ajax_request=true' + window.CommonParams.get('arg_separator') + 'ajax_page_request=true';
|
||||
var params = 'ajax_request=true' + CommonParams.get('arg_separator') + 'ajax_page_request=true';
|
||||
var url = state.url || location.href;
|
||||
$.get(url, params, window.AJAX.responseHandler);
|
||||
// TODO: Check if sometimes menu is not retrieved from server,
|
||||
|
||||
3
js/src/codemirror/addon/lint/sql-lint.js
vendored
3
js/src/codemirror/addon/lint/sql-lint.js
vendored
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from '../../../common.js';
|
||||
|
||||
window.CodeMirror.sqlLint = function (text, updateLinting, options, cm) {
|
||||
// Skipping check if text box is empty.
|
||||
@ -33,7 +34,7 @@ window.CodeMirror.sqlLint = function (text, updateLinting, options, cm) {
|
||||
dataType: 'json',
|
||||
data: {
|
||||
'sql_query': text,
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
'options': options.lintOptions,
|
||||
'no_history': true,
|
||||
},
|
||||
|
||||
@ -10,7 +10,7 @@ import $ from 'jquery';
|
||||
*
|
||||
* @test-module CommonParams
|
||||
*/
|
||||
window.CommonParams = (function () {
|
||||
const CommonParams = (function () {
|
||||
/**
|
||||
* @var {Object} params An associative array of key value pairs
|
||||
* @access private
|
||||
@ -86,7 +86,7 @@ window.CommonParams = (function () {
|
||||
getUrlQuery: function (separator) {
|
||||
var sep = (typeof separator !== 'undefined') ? separator : '?';
|
||||
var common = this.get('common_query');
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
if (typeof common === 'string' && common.length > 0) {
|
||||
// If the last char is the separator, do not add it
|
||||
// Else add it
|
||||
@ -111,7 +111,7 @@ window.CommonParams = (function () {
|
||||
* The content for this is normally loaded from Header.php or
|
||||
* Response.php and executed by ajax.js
|
||||
*/
|
||||
window.CommonActions = {
|
||||
const CommonActions = {
|
||||
/**
|
||||
* Saves the database name when it's changed
|
||||
* and reloads the query window, if necessary
|
||||
@ -121,8 +121,8 @@ window.CommonActions = {
|
||||
* @return {void}
|
||||
*/
|
||||
setDb: function (newDb) {
|
||||
if (newDb !== window.CommonParams.get('db')) {
|
||||
window.CommonParams.setAll({ 'db': newDb, 'table': '' });
|
||||
if (newDb !== CommonParams.get('db')) {
|
||||
CommonParams.setAll({ 'db': newDb, 'table': '' });
|
||||
}
|
||||
},
|
||||
/**
|
||||
@ -133,11 +133,11 @@ window.CommonActions = {
|
||||
* @return {void}
|
||||
*/
|
||||
openDb: function (newDb) {
|
||||
window.CommonParams
|
||||
CommonParams
|
||||
.set('db', newDb)
|
||||
.set('table', '');
|
||||
this.refreshMain(
|
||||
window.CommonParams.get('opendb_url')
|
||||
CommonParams.get('opendb_url')
|
||||
);
|
||||
},
|
||||
/**
|
||||
@ -156,9 +156,9 @@ window.CommonActions = {
|
||||
newUrl = newUrl.substring(0, newUrl.indexOf('?'));
|
||||
}
|
||||
if (newUrl.indexOf('?') !== -1) {
|
||||
newUrl += window.CommonParams.getUrlQuery(window.CommonParams.get('arg_separator'));
|
||||
newUrl += CommonParams.getUrlQuery(CommonParams.get('arg_separator'));
|
||||
} else {
|
||||
newUrl += window.CommonParams.getUrlQuery('?');
|
||||
newUrl += CommonParams.getUrlQuery('?');
|
||||
}
|
||||
$('<a></a>', { href: newUrl })
|
||||
.appendTo('body')
|
||||
@ -169,3 +169,7 @@ window.CommonActions = {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
window.CommonParams = CommonParams;
|
||||
|
||||
export { CommonActions, CommonParams };
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from './common.js';
|
||||
|
||||
/**
|
||||
* Functions used in configuration forms and on user preferences pages
|
||||
@ -650,7 +651,7 @@ function savePrefsToLocalStorage (form) {
|
||||
type: 'POST',
|
||||
data: {
|
||||
'ajax_request': true,
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
'submit_get_json': true
|
||||
},
|
||||
success: function (data) {
|
||||
@ -702,7 +703,7 @@ function offerPrefsAutoimport () {
|
||||
if ($a.attr('href') === '#no') {
|
||||
$cnt.remove();
|
||||
$.post('index.php', {
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
'prefs_autoload': 'hide'
|
||||
}, null, 'html');
|
||||
return;
|
||||
@ -710,7 +711,7 @@ function offerPrefsAutoimport () {
|
||||
$cnt.remove();
|
||||
localStorage.clear();
|
||||
$.post('index.php', {
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
'prefs_autoload': 'hide'
|
||||
}, null, 'html');
|
||||
return;
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from '../common.js';
|
||||
|
||||
/**
|
||||
* @fileoverview events handling from central columns page
|
||||
@ -65,8 +66,8 @@ window.AJAX.registerOnload('database/central_columns.js', function () {
|
||||
Functions.ajaxShowMessage(window.Messages.strRadioUnchecked);
|
||||
return false;
|
||||
}
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var editColumnData = editColumnList + '' + argsep + 'edit_central_columns_page=true' + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true' + argsep + 'db=' + encodeURIComponent(window.CommonParams.get('db')) + argsep + 'server=' + window.CommonParams.get('server');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
var 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');
|
||||
Functions.ajaxShowMessage();
|
||||
window.AJAX.source = $(this);
|
||||
$.post('index.php?route=/database/central-columns', editColumnData, window.AJAX.responseHandler);
|
||||
@ -74,8 +75,8 @@ window.AJAX.registerOnload('database/central_columns.js', function () {
|
||||
$('#multi_edit_central_columns').on('submit', function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var 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(window.CommonParams.get('db')) + argsep + 'server=' + window.CommonParams.get('server');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
var 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');
|
||||
Functions.ajaxShowMessage();
|
||||
window.AJAX.source = $(this);
|
||||
$.post('index.php?route=/database/central-columns', multiColumnEditData, window.AJAX.responseHandler);
|
||||
@ -155,7 +156,7 @@ window.AJAX.registerOnload('database/central_columns.js', function () {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'index.php?route=/database/central-columns',
|
||||
data: datastring + window.CommonParams.get('arg_separator') + 'ajax_request=true',
|
||||
data: datastring + CommonParams.get('arg_separator') + 'ajax_request=true',
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
if (data.message !== '1') {
|
||||
@ -198,8 +199,8 @@ window.AJAX.registerOnload('database/central_columns.js', function () {
|
||||
var href = 'index.php?route=/database/central-columns/populate';
|
||||
var params = {
|
||||
'ajax_request' : true,
|
||||
'server' : window.CommonParams.get('server'),
|
||||
'db' : window.CommonParams.get('db'),
|
||||
'server' : CommonParams.get('server'),
|
||||
'db' : CommonParams.get('db'),
|
||||
'selectedTable' : selectValue
|
||||
};
|
||||
$('#column-select').html('<option value="">' + window.Messages.strLoading + '</option>');
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from '../common.js';
|
||||
|
||||
/**
|
||||
* @fileoverview function used in QBE for DB
|
||||
@ -75,7 +76,7 @@ window.AJAX.registerOnload('database/multi_table_query.js', function () {
|
||||
'db': $('#db_name').val(),
|
||||
'tables': Object.keys(tableAliases),
|
||||
'ajax_request': '1',
|
||||
'token': window.CommonParams.get('token')
|
||||
'token': CommonParams.get('token')
|
||||
},
|
||||
success: function (response) {
|
||||
foreignKeys = response.foreignKeyConstrains;
|
||||
@ -127,8 +128,8 @@ window.AJAX.registerOnload('database/multi_table_query.js', function () {
|
||||
'db': $('#db_name').val(),
|
||||
'sql_query': query,
|
||||
'ajax_request': '1',
|
||||
'server': window.CommonParams.get('server'),
|
||||
'token': window.CommonParams.get('token')
|
||||
'server': CommonParams.get('server'),
|
||||
'token': CommonParams.get('token')
|
||||
};
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonActions, CommonParams } from '../common.js';
|
||||
|
||||
/* global Navigation */
|
||||
|
||||
@ -44,7 +45,7 @@ window.AJAX.registerOnload('database/operations.js', function () {
|
||||
return false;
|
||||
}
|
||||
|
||||
var oldDbName = window.CommonParams.get('db');
|
||||
var oldDbName = CommonParams.get('db');
|
||||
var newDbName = $('#new_db_name').val();
|
||||
|
||||
if (newDbName === oldDbName) {
|
||||
@ -60,10 +61,10 @@ window.AJAX.registerOnload('database/operations.js', function () {
|
||||
|
||||
$form.confirm(question, $form.attr('action'), function (url) {
|
||||
Functions.ajaxShowMessage(window.Messages.strRenamingDatabases, false);
|
||||
$.post(url, $('#rename_db_form').serialize() + window.CommonParams.get('arg_separator') + 'is_js_confirmed=1', function (data) {
|
||||
$.post(url, $('#rename_db_form').serialize() + CommonParams.get('arg_separator') + 'is_js_confirmed=1', function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
Functions.ajaxShowMessage(data.message);
|
||||
window.CommonParams.set('db', data.newname);
|
||||
CommonParams.set('db', data.newname);
|
||||
|
||||
Navigation.reload(function () {
|
||||
$('#pma_navigation_tree')
|
||||
@ -103,12 +104,12 @@ window.AJAX.registerOnload('database/operations.js', function () {
|
||||
$('.alert-success, .alert-danger').fadeOut();
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
if ($('#checkbox_switch').is(':checked')) {
|
||||
window.CommonParams.set('db', data.newname);
|
||||
window.CommonActions.refreshMain(false, function () {
|
||||
CommonParams.set('db', data.newname);
|
||||
CommonActions.refreshMain(false, function () {
|
||||
Functions.ajaxShowMessage(data.message);
|
||||
});
|
||||
} else {
|
||||
window.CommonParams.set('db', data.db);
|
||||
CommonParams.set('db', data.db);
|
||||
Functions.ajaxShowMessage(data.message);
|
||||
}
|
||||
Navigation.reload();
|
||||
@ -155,7 +156,7 @@ window.AJAX.registerOnload('database/operations.js', function () {
|
||||
var question = window.Messages.strDropDatabaseStrongWarning + ' ';
|
||||
question += Functions.sprintf(
|
||||
window.Messages.strDoYouReally,
|
||||
'DROP DATABASE `' + Functions.escapeHtml(window.CommonParams.get('db') + '`')
|
||||
'DROP DATABASE `' + Functions.escapeHtml(CommonParams.get('db') + '`')
|
||||
);
|
||||
var params = Functions.getJsConfirmCommonParam(this, $link.getPostData());
|
||||
|
||||
@ -165,8 +166,8 @@ window.AJAX.registerOnload('database/operations.js', function () {
|
||||
if (typeof data !== 'undefined' && data.success) {
|
||||
// Database deleted successfully, refresh both the frames
|
||||
Navigation.reload();
|
||||
window.CommonParams.set('db', '');
|
||||
window.CommonActions.refreshMain(
|
||||
CommonParams.set('db', '');
|
||||
CommonActions.refreshMain(
|
||||
'index.php?route=/server/databases',
|
||||
function () {
|
||||
Functions.ajaxShowMessage(data.message);
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from '../common.js';
|
||||
|
||||
/**
|
||||
* JavaScript functions used on Database Search page
|
||||
@ -216,7 +217,7 @@ window.AJAX.registerOnload('database/search.js', function () {
|
||||
|
||||
Functions.prepareForAjaxRequest($form);
|
||||
|
||||
var url = $form.serialize() + window.CommonParams.get('arg_separator') + 'submit_search=' + $('#buttonGo').val();
|
||||
var 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) {
|
||||
// found results
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from '../common.js';
|
||||
|
||||
/* global Navigation */
|
||||
|
||||
@ -203,7 +204,7 @@ window.AJAX.registerOnload('database/structure.js', function () {
|
||||
$('#makeConsistentWithCentralListModal').modal('show').on('shown.bs.modal', function () {
|
||||
$('#makeConsistentWithCentralListContinue').on('click', function () {
|
||||
const $form = $('#tablesForm');
|
||||
const argSep = window.CommonParams.get('arg_separator');
|
||||
const argSep = CommonParams.get('arg_separator');
|
||||
const data = $form.serialize() + argSep + 'ajax_request=true' + argSep + 'ajax_page_request=true';
|
||||
|
||||
Functions.ajaxShowMessage();
|
||||
@ -298,7 +299,7 @@ window.AJAX.registerOnload('database/structure.js', function () {
|
||||
}
|
||||
|
||||
var $form = $(this).parents('form');
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
var data = $form.serialize() + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true';
|
||||
|
||||
Functions.ajaxShowMessage();
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from '../common.js';
|
||||
|
||||
/**
|
||||
* Unbind all event handlers before tearing down the page
|
||||
@ -45,7 +46,7 @@ window.AJAX.registerOnload('database/tracking.js', function () {
|
||||
e.preventDefault();
|
||||
var $button = $(this);
|
||||
var $form = $button.parent('form');
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
var submitData = $form.serialize() + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true' + argsep + 'submit_mult=' + $button.val();
|
||||
|
||||
if ($button.val() === 'delete_tracking') {
|
||||
@ -69,7 +70,7 @@ window.AJAX.registerOnload('database/tracking.js', function () {
|
||||
e.preventDefault();
|
||||
var $button = $(this);
|
||||
var $form = $button.parent('form');
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
var submitData = $form.serialize() + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true' + argsep + 'submit_mult=' + $button.val();
|
||||
Functions.ajaxShowMessage();
|
||||
window.AJAX.source = $form;
|
||||
@ -86,7 +87,7 @@ window.AJAX.registerOnload('database/tracking.js', function () {
|
||||
$anchor.confirm(question, $anchor.attr('href'), function (url) {
|
||||
Functions.ajaxShowMessage(window.Messages.strDeletingTrackingData);
|
||||
window.AJAX.source = $anchor;
|
||||
var argSep = window.CommonParams.get('arg_separator');
|
||||
var argSep = CommonParams.get('arg_separator');
|
||||
var params = Functions.getJsConfirmCommonParam(this, $anchor.getPostData());
|
||||
params += argSep + 'ajax_page_request=1';
|
||||
$.post(url, params, window.AJAX.responseHandler);
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonActions, CommonParams } from '../common.js';
|
||||
|
||||
/**
|
||||
* @package PhpMyAdmin-Designer
|
||||
@ -654,7 +655,7 @@ DesignerMove.addOtherDbTables = function () {
|
||||
$.post('index.php?route=/sql', {
|
||||
'ajax_request' : true,
|
||||
'sql_query' : 'SHOW databases;',
|
||||
'server': window.CommonParams.get('server')
|
||||
'server': CommonParams.get('server')
|
||||
}, function (data) {
|
||||
$(data.message).find('table.table_results.data.ajax').find('td.data').each(function () {
|
||||
var val = $(this)[0].innerText;
|
||||
@ -685,7 +686,7 @@ DesignerMove.addOtherDbTables = function () {
|
||||
'dialog' : 'add_table',
|
||||
'db' : db,
|
||||
'table' : table,
|
||||
'server': window.CommonParams.get('server')
|
||||
'server': CommonParams.get('server')
|
||||
}, function (data) {
|
||||
var $newTableDom = $(data.message);
|
||||
$newTableDom.find('a').first().remove();
|
||||
@ -713,7 +714,7 @@ DesignerMove.addOtherDbTables = function () {
|
||||
'ajax_request' : true,
|
||||
'sql_query': sqlQuery,
|
||||
'db' : dbName,
|
||||
'server': window.CommonParams.get('server')
|
||||
'server': CommonParams.get('server')
|
||||
}, function (data) {
|
||||
$selectTable.html('');
|
||||
var rows = $(data.message).find('table.table_results.data.ajax').find('td.data');
|
||||
@ -753,7 +754,7 @@ DesignerMove.getUrlPos = function (forceString) {
|
||||
var key;
|
||||
if (window.designerTablesEnabled || forceString) {
|
||||
var poststr = '';
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
var i = 1;
|
||||
for (key in window.jTabs) {
|
||||
poststr += argsep + 't_x[' + i + ']=' + parseInt(document.getElementById(key).style.left, 10);
|
||||
@ -784,7 +785,7 @@ DesignerMove.getUrlPos = function (forceString) {
|
||||
|
||||
DesignerMove.save2 = function (callback) {
|
||||
if (window.designerTablesEnabled) {
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
var poststr = 'operation=savePage' + argsep + 'save_page=same' + argsep + 'ajax_request=true';
|
||||
poststr += argsep + 'server=' + window.server + argsep + 'db=' + encodeURIComponent(window.db) + argsep + 'selected_page=' + window.selectedPage;
|
||||
poststr += DesignerMove.getUrlPos();
|
||||
@ -1097,7 +1098,7 @@ DesignerMove.promptToSaveCurrentPage = function (callback) {
|
||||
// ------------------------------ EXPORT PAGES ---------------------------------------
|
||||
DesignerMove.exportPages = function () {
|
||||
var $msgbox = Functions.ajaxShowMessage();
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
|
||||
$.post('index.php?route=/database/designer', {
|
||||
'ajax_request': true,
|
||||
@ -1142,7 +1143,7 @@ DesignerMove.exportPages = function () {
|
||||
DesignerMove.loadPage = function (page) {
|
||||
if (window.designerTablesEnabled) {
|
||||
var paramPage = '';
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
if (page !== null) {
|
||||
paramPage = argsep + 'page=' + page;
|
||||
}
|
||||
@ -1230,7 +1231,7 @@ DesignerMove.startRelation = function () {
|
||||
// table field
|
||||
DesignerMove.clickField = function (db, T, f, pk) {
|
||||
var pkLocal = parseInt(pk);
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
if (onRelation) {
|
||||
if (!clickField) {
|
||||
// .style.display=='none' .style.display = 'none'
|
||||
@ -1316,7 +1317,7 @@ DesignerMove.clickField = function (db, T, f, pk) {
|
||||
|
||||
DesignerMove.newRelation = function () {
|
||||
document.getElementById('layer_new_relation').style.display = 'none';
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
linkRelation += argsep + 'server=' + window.server + argsep + 'db=' + window.db + argsep + 'db2=p';
|
||||
linkRelation += argsep + 'on_delete=' + document.getElementById('on_delete').value + argsep + 'on_update=' + document.getElementById('on_update').value;
|
||||
linkRelation += argsep + 'operation=addNewRelation' + argsep + 'ajax_request=true';
|
||||
@ -1335,14 +1336,14 @@ DesignerMove.newRelation = function () {
|
||||
|
||||
// -------------------------- create tables -------------------------------------
|
||||
DesignerMove.startTableNew = function () {
|
||||
window.CommonParams.set('table', '');
|
||||
window.CommonActions.refreshMain('index.php?route=/table/create');
|
||||
CommonParams.set('table', '');
|
||||
CommonActions.refreshMain('index.php?route=/table/create');
|
||||
};
|
||||
|
||||
DesignerMove.startTabUpd = function (db, table) {
|
||||
window.CommonParams.set('db', db);
|
||||
window.CommonParams.set('table', table);
|
||||
window.CommonActions.refreshMain('index.php?route=/table/structure');
|
||||
CommonParams.set('db', db);
|
||||
CommonParams.set('table', table);
|
||||
CommonActions.refreshMain('index.php?route=/table/structure');
|
||||
};
|
||||
|
||||
// --------------------------- hide tables --------------------------------------
|
||||
@ -1536,14 +1537,14 @@ DesignerMove.canvasClick = function (id, event) {
|
||||
var top = globY - document.getElementById('layer_upd_relation').offsetHeight - 10;
|
||||
document.getElementById('layer_upd_relation').style.top = top + 'px';
|
||||
document.getElementById('layer_upd_relation').style.display = 'block';
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
linkRelation = 'T1=' + Key0 + argsep + 'F1=' + Key1 + argsep + 'T2=' + Key2 + argsep + 'F2=' + Key3 + argsep + 'K=' + Key;
|
||||
}
|
||||
};
|
||||
|
||||
DesignerMove.updRelation = function () {
|
||||
document.getElementById('layer_upd_relation').style.display = 'none';
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
linkRelation += argsep + 'server=' + window.server + argsep + 'db=' + window.db;
|
||||
linkRelation += argsep + 'operation=removeRelation' + argsep + 'ajax_request=true';
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from './common.js';
|
||||
|
||||
/* This script handles PMA Drag Drop Import, loaded only when configuration is enabled.*/
|
||||
|
||||
@ -157,7 +158,7 @@ var DragDropImport = {
|
||||
if (!DragDropImport.hasFiles(event)) {
|
||||
return;
|
||||
}
|
||||
if (window.CommonParams.get('db') === '') {
|
||||
if (CommonParams.get('db') === '') {
|
||||
$('.pma_drop_handler').html(window.Messages.dropImportSelectDB);
|
||||
} else {
|
||||
$('.pma_drop_handler').html(window.Messages.dropImportDropFiles);
|
||||
@ -279,8 +280,8 @@ var DragDropImport = {
|
||||
return;
|
||||
}
|
||||
|
||||
var dbname = window.CommonParams.get('db');
|
||||
var server = window.CommonParams.get('server');
|
||||
var dbname = CommonParams.get('db');
|
||||
var server = CommonParams.get('server');
|
||||
|
||||
// if no database is selected -- no
|
||||
if (dbname !== '') {
|
||||
@ -323,7 +324,7 @@ var DragDropImport = {
|
||||
fd.append('noplugin', Math.random().toString(36).substring(2, 12));
|
||||
fd.append('db', dbname);
|
||||
fd.append('server', server);
|
||||
fd.append('token', window.CommonParams.get('token'));
|
||||
fd.append('token', CommonParams.get('token'));
|
||||
fd.append('import_type', 'database');
|
||||
// todo: method to find the value below
|
||||
fd.append('MAX_FILE_SIZE', '4194304');
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from './common.js';
|
||||
|
||||
/**
|
||||
* general function, usually for data manipulation pages
|
||||
@ -59,7 +60,7 @@ var ErrorReport = {
|
||||
if (ErrorReport.errorReportData === null) {
|
||||
$.post('index.php?route=/error-report', {
|
||||
'ajax_request': true,
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
'get_settings': true,
|
||||
'exception_type': 'js'
|
||||
}, function (data) {
|
||||
@ -136,7 +137,7 @@ var ErrorReport = {
|
||||
buttonHtml += window.Messages.strShowReportDetails;
|
||||
buttonHtml += '</button>';
|
||||
|
||||
var settingsUrl = 'index.php?route=/preferences/features&server=' + window.CommonParams.get('server');
|
||||
var settingsUrl = 'index.php?route=/preferences/features&server=' + CommonParams.get('server');
|
||||
buttonHtml += '<a class="ajax" href="' + settingsUrl + '">';
|
||||
buttonHtml += Functions.getImage('s_cog', window.Messages.strChangeReportSettings);
|
||||
buttonHtml += '</a>';
|
||||
@ -217,7 +218,7 @@ var ErrorReport = {
|
||||
}
|
||||
}
|
||||
var reportData = {
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
'ajax_request': true,
|
||||
'exception': exception,
|
||||
'url': window.location.href,
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from './common.js';
|
||||
|
||||
/**
|
||||
* Functions used in the export tab
|
||||
@ -76,9 +77,9 @@ Export.createTemplate = function (name) {
|
||||
|
||||
var params = {
|
||||
'ajax_request': true,
|
||||
'server': window.CommonParams.get('server'),
|
||||
'db': window.CommonParams.get('db'),
|
||||
'table': window.CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'exportType': $('input[name="export_type"]').val(),
|
||||
'templateName': name,
|
||||
'templateData': JSON.stringify(templateData)
|
||||
@ -109,9 +110,9 @@ Export.createTemplate = function (name) {
|
||||
Export.loadTemplate = function (id) {
|
||||
var params = {
|
||||
'ajax_request': true,
|
||||
'server': window.CommonParams.get('server'),
|
||||
'db': window.CommonParams.get('db'),
|
||||
'table': window.CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'exportType': $('input[name="export_type"]').val(),
|
||||
'templateId': id,
|
||||
};
|
||||
@ -158,9 +159,9 @@ Export.updateTemplate = function (id) {
|
||||
|
||||
var params = {
|
||||
'ajax_request': true,
|
||||
'server': window.CommonParams.get('server'),
|
||||
'db': window.CommonParams.get('db'),
|
||||
'table': window.CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'exportType': $('input[name="export_type"]').val(),
|
||||
'templateId': id,
|
||||
'templateData': JSON.stringify(templateData)
|
||||
@ -184,9 +185,9 @@ Export.updateTemplate = function (id) {
|
||||
Export.deleteTemplate = function (id) {
|
||||
var params = {
|
||||
'ajax_request': true,
|
||||
'server': window.CommonParams.get('server'),
|
||||
'db': window.CommonParams.get('db'),
|
||||
'table': window.CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'exportType': $('input[name="export_type"]').val(),
|
||||
'templateId': id,
|
||||
};
|
||||
@ -785,7 +786,7 @@ Export.createAliasModal = function (event) {
|
||||
modal.modal('show');
|
||||
modal.on('shown.bs.modal', function () {
|
||||
modal.closest('.ui-dialog').find('.ui-button').addClass('btn btn-secondary');
|
||||
var db = window.CommonParams.get('db');
|
||||
var db = CommonParams.get('db');
|
||||
if (db) {
|
||||
var option = $('<option></option>');
|
||||
option.text(db);
|
||||
@ -794,7 +795,7 @@ Export.createAliasModal = function (event) {
|
||||
} else {
|
||||
var params = {
|
||||
'ajax_request': true,
|
||||
'server': window.CommonParams.get('server')
|
||||
'server': CommonParams.get('server')
|
||||
};
|
||||
$.post('index.php?route=/databases', params, function (response) {
|
||||
if (response.success === true) {
|
||||
@ -900,7 +901,7 @@ window.AJAX.registerOnload('export.js', function () {
|
||||
});
|
||||
$('#db_alias_select').on('change', function () {
|
||||
Export.aliasToggleRow($(this));
|
||||
var table = window.CommonParams.get('table');
|
||||
var table = CommonParams.get('table');
|
||||
if (table) {
|
||||
var option = $('<option></option>');
|
||||
option.text(table);
|
||||
@ -910,7 +911,7 @@ window.AJAX.registerOnload('export.js', function () {
|
||||
var database = $(this).val();
|
||||
var params = {
|
||||
'ajax_request': true,
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
'db': database,
|
||||
};
|
||||
var url = 'index.php?route=/tables';
|
||||
@ -934,7 +935,7 @@ window.AJAX.registerOnload('export.js', function () {
|
||||
var table = $(this).val();
|
||||
var params = {
|
||||
'ajax_request': true,
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
'db': database,
|
||||
'table': table,
|
||||
};
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonActions, CommonParams } from './common.js';
|
||||
import { mysqlDocKeyword, mysqlDocBuiltin } from './modules/doc-links.js';
|
||||
|
||||
/* global Navigation */
|
||||
@ -93,11 +94,11 @@ window.spatialIndexes = [];
|
||||
Functions.addNoCacheToAjaxRequests = () => function (options, originalOptions) {
|
||||
var nocache = new Date().getTime() + '' + Math.floor(Math.random() * 1000000);
|
||||
if (typeof options.data === 'string') {
|
||||
options.data += '&_nocache=' + nocache + '&token=' + encodeURIComponent(window.CommonParams.get('token'));
|
||||
options.data += '&_nocache=' + nocache + '&token=' + encodeURIComponent(CommonParams.get('token'));
|
||||
} else if (typeof options.data === 'object') {
|
||||
options.data = $.extend(originalOptions.data, {
|
||||
'_nocache': nocache,
|
||||
'token': window.CommonParams.get('token')
|
||||
'token': CommonParams.get('token')
|
||||
});
|
||||
}
|
||||
};
|
||||
@ -257,7 +258,7 @@ Functions.handleRedirectAndReload = function (data) {
|
||||
if (window.location.href.indexOf('?') === -1) {
|
||||
window.location.href += '?session_expired=1';
|
||||
} else {
|
||||
window.location.href += window.CommonParams.get('arg_separator') + 'session_expired=1';
|
||||
window.location.href += CommonParams.get('arg_separator') + 'session_expired=1';
|
||||
}
|
||||
window.location.reload();
|
||||
} else if (parseInt(data.reload_flag) === 1) {
|
||||
@ -651,7 +652,7 @@ Functions.confirmLink = function (theLink, theSqlQuery) {
|
||||
var isConfirmed = confirm(Functions.sprintf(window.Messages.strDoYouReally, theSqlQuery));
|
||||
if (isConfirmed) {
|
||||
if (typeof (theLink.href) !== 'undefined') {
|
||||
theLink.href += window.CommonParams.get('arg_separator') + 'is_js_confirmed=1';
|
||||
theLink.href += CommonParams.get('arg_separator') + 'is_js_confirmed=1';
|
||||
} else if (typeof (theLink.form) !== 'undefined') {
|
||||
theLink.form.action += '?is_js_confirmed=1';
|
||||
}
|
||||
@ -937,8 +938,8 @@ Functions.onloadIdleEvent = function () {
|
||||
}
|
||||
var params = {
|
||||
'ajax_request': true,
|
||||
'server': window.CommonParams.get('server'),
|
||||
'db': window.CommonParams.get('db'),
|
||||
'server': CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'guid': guid,
|
||||
'access_time': idleSecondsCounter,
|
||||
'check_timeout': 1
|
||||
@ -949,15 +950,15 @@ Functions.onloadIdleEvent = function () {
|
||||
data: params,
|
||||
success: function (data) {
|
||||
if (data.success) {
|
||||
if (window.CommonParams.get('LoginCookieValidity') - idleSecondsCounter < 0) {
|
||||
if (CommonParams.get('LoginCookieValidity') - idleSecondsCounter < 0) {
|
||||
/* There is other active window, let's reset counter */
|
||||
idleSecondsCounter = 0;
|
||||
}
|
||||
var remaining = Math.min(
|
||||
/* Remaining login validity */
|
||||
window.CommonParams.get('LoginCookieValidity') - idleSecondsCounter,
|
||||
CommonParams.get('LoginCookieValidity') - idleSecondsCounter,
|
||||
/* Remaining time till session GC */
|
||||
window.CommonParams.get('session_gc_maxlifetime')
|
||||
CommonParams.get('session_gc_maxlifetime')
|
||||
);
|
||||
var interval = 1000;
|
||||
if (remaining > 5) {
|
||||
@ -979,7 +980,7 @@ Functions.onloadIdleEvent = function () {
|
||||
});
|
||||
$('#input_username').trigger('focus');
|
||||
} else {
|
||||
window.CommonParams.set('token', data.new_token);
|
||||
CommonParams.set('token', data.new_token);
|
||||
$('input[name=token]').val(data.new_token);
|
||||
}
|
||||
idleSecondsCounter = 0;
|
||||
@ -989,11 +990,11 @@ Functions.onloadIdleEvent = function () {
|
||||
});
|
||||
}
|
||||
|
||||
if (window.CommonParams.get('logged_in')) {
|
||||
if (CommonParams.get('logged_in')) {
|
||||
incInterval = window.setInterval(SetIdleTime, 1000);
|
||||
var sessionTimeout = Math.min(
|
||||
window.CommonParams.get('LoginCookieValidity'),
|
||||
window.CommonParams.get('session_gc_maxlifetime')
|
||||
CommonParams.get('LoginCookieValidity'),
|
||||
CommonParams.get('session_gc_maxlifetime')
|
||||
);
|
||||
if (window.Config.isStorageSupported('sessionStorage')) {
|
||||
window.sessionStorage.setItem('guid', guid());
|
||||
@ -1149,7 +1150,7 @@ Functions.loadForeignKeyCheckbox = function () {
|
||||
// Load default foreign key check value
|
||||
var params = {
|
||||
'ajax_request': true,
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
};
|
||||
$.get('index.php?route=/sql/get-default-fk-check-value', params, function (data) {
|
||||
var html = '<input type="hidden" name="fk_checks" value="0">' +
|
||||
@ -1163,7 +1164,7 @@ Functions.loadForeignKeyCheckbox = function () {
|
||||
Functions.getJsConfirmCommonParam = function (elem, parameters) {
|
||||
var $elem = $(elem);
|
||||
var params = parameters;
|
||||
var sep = window.CommonParams.get('arg_separator');
|
||||
var sep = CommonParams.get('arg_separator');
|
||||
if (params) {
|
||||
// Strip possible leading ?
|
||||
if (params.startsWith('?')) {
|
||||
@ -1293,8 +1294,8 @@ Functions.codeMirrorAutoCompleteOnInputRead = function (instance) {
|
||||
|
||||
var params = {
|
||||
'ajax_request': true,
|
||||
'server': window.CommonParams.get('server'),
|
||||
'db': window.CommonParams.get('db'),
|
||||
'server': CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'no_debug': true
|
||||
};
|
||||
|
||||
@ -1314,7 +1315,7 @@ Functions.codeMirrorAutoCompleteOnInputRead = function (instance) {
|
||||
success: function (data) {
|
||||
if (data.success) {
|
||||
var tables = data.tables;
|
||||
sqlAutoCompleteDefaultTable = window.CommonParams.get('table');
|
||||
sqlAutoCompleteDefaultTable = CommonParams.get('table');
|
||||
sqlAutoComplete = [];
|
||||
for (var table in tables) {
|
||||
if (tables.hasOwnProperty(table)) {
|
||||
@ -1719,7 +1720,7 @@ Functions.ajaxRemoveMessage = function ($thisMessageBox) {
|
||||
*/
|
||||
Functions.previewSql = function ($form) {
|
||||
var formUrl = $form.attr('action');
|
||||
var sep = window.CommonParams.get('arg_separator');
|
||||
var sep = CommonParams.get('arg_separator');
|
||||
var formData = $form.serialize() +
|
||||
sep + 'do_save_data=1' +
|
||||
sep + 'preview_sql=1' +
|
||||
@ -2167,7 +2168,7 @@ Functions.sqlPrettyPrint = function (string) {
|
||||
* @return {bool}
|
||||
*/
|
||||
Functions.confirm = function (question, url, callbackFn, openCallback) {
|
||||
var confirmState = window.CommonParams.get('confirm');
|
||||
var confirmState = CommonParams.get('confirm');
|
||||
if (! confirmState) {
|
||||
// user does not want to confirm
|
||||
if (typeof callbackFn === 'function') {
|
||||
@ -2274,7 +2275,7 @@ Functions.onloadCreateTableEvents = function () {
|
||||
if (Functions.checkReservedWordColumns($form)) {
|
||||
Functions.ajaxShowMessage(window.Messages.strProcessingRequest);
|
||||
// User wants to submit the form
|
||||
$.post($form.attr('action'), $form.serialize() + window.CommonParams.get('arg_separator') + 'do_save_data=1', function (data) {
|
||||
$.post($form.attr('action'), $form.serialize() + CommonParams.get('arg_separator') + 'do_save_data=1', function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
$('#properties_message')
|
||||
.removeClass('alert-danger')
|
||||
@ -2293,8 +2294,8 @@ Functions.onloadCreateTableEvents = function () {
|
||||
var tablesTable = $('#tablesForm').find('tbody').not('#tbl_summary_row');
|
||||
// this is the first table created in this db
|
||||
if (tablesTable.length === 0) {
|
||||
window.CommonActions.refreshMain(
|
||||
window.CommonParams.get('opendb_url')
|
||||
CommonActions.refreshMain(
|
||||
CommonParams.get('opendb_url')
|
||||
);
|
||||
} else {
|
||||
/**
|
||||
@ -2333,7 +2334,7 @@ Functions.onloadCreateTableEvents = function () {
|
||||
// Refresh navigation as a new table has been added
|
||||
Navigation.reload();
|
||||
// Redirect to table structure page on creation of new table
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
var params12 = 'ajax_request=true' + argsep + 'ajax_page_request=true';
|
||||
var tableStructureUrl = 'index.php?route=/table/structure' + argsep + 'server=' + data.params.server +
|
||||
argsep + 'db=' + data.params.db + argsep + 'token=' + data.params.token +
|
||||
@ -2568,7 +2569,7 @@ Functions.onloadChangePasswordEvents = function () {
|
||||
var $msgbox = Functions.ajaxShowMessage(window.Messages.strProcessingRequest);
|
||||
$theForm.append('<input type="hidden" name="ajax_request" value="true">');
|
||||
|
||||
$.post($theForm.attr('action'), $theForm.serialize() + window.CommonParams.get('arg_separator') + 'change_pw=' + thisValue, function (data) {
|
||||
$.post($theForm.attr('action'), $theForm.serialize() + CommonParams.get('arg_separator') + 'change_pw=' + thisValue, function (data) {
|
||||
if (typeof data === 'undefined' || data.success !== true) {
|
||||
Functions.ajaxShowMessage(data.error, false);
|
||||
return;
|
||||
@ -2698,8 +2699,8 @@ Functions.validateDefaultValue = function ($nullCheckbox) {
|
||||
* @param {number} offset of the selected column in central list of columns
|
||||
*/
|
||||
Functions.autoPopulate = function (inputId, offset) {
|
||||
var db = window.CommonParams.get('db');
|
||||
var table = window.CommonParams.get('table');
|
||||
var db = CommonParams.get('db');
|
||||
var table = CommonParams.get('table');
|
||||
var newInputId = inputId.substring(0, inputId.length - 1);
|
||||
$('#' + newInputId + '1').val(window.centralColumnList[db + '_' + table][offset].col_name);
|
||||
var colType = window.centralColumnList[db + '_' + table][offset].col_type.toUpperCase();
|
||||
@ -2892,8 +2893,8 @@ Functions.onloadEnumSetEditor = function () {
|
||||
|
||||
$(document).on('click', 'a.central_columns_dialog', function () {
|
||||
var href = 'index.php?route=/database/central-columns';
|
||||
var db = window.CommonParams.get('db');
|
||||
var table = window.CommonParams.get('table');
|
||||
var db = CommonParams.get('db');
|
||||
var table = CommonParams.get('table');
|
||||
var maxRows = $(this).data('maxrows');
|
||||
var pick = $(this).data('pick');
|
||||
if (pick !== false) {
|
||||
@ -2901,9 +2902,9 @@ Functions.onloadEnumSetEditor = function () {
|
||||
}
|
||||
var params = {
|
||||
'ajax_request': true,
|
||||
'server': window.CommonParams.get('server'),
|
||||
'db': window.CommonParams.get('db'),
|
||||
'cur_table': window.CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'cur_table': CommonParams.get('table'),
|
||||
'getColumnList': true
|
||||
};
|
||||
var colid = $(this).closest('td').find('input').attr('id');
|
||||
@ -3132,7 +3133,7 @@ Functions.indexDialogModal = function (routeUrl, url, title, callbackSuccess, ca
|
||||
const modalBody = indexDialogPreviewModal.querySelector('.modal-body');
|
||||
const $form = $('#index_frm');
|
||||
const formUrl = $form.attr('action');
|
||||
const sep = window.CommonParams.get('arg_separator');
|
||||
const sep = CommonParams.get('arg_separator');
|
||||
const formData = $form.serialize() +
|
||||
sep + 'do_save_data=1' +
|
||||
sep + 'preview_sql=1' +
|
||||
@ -3169,7 +3170,7 @@ Functions.indexDialogModal = function (routeUrl, url, title, callbackSuccess, ca
|
||||
Functions.ajaxShowMessage(window.Messages.strProcessingRequest);
|
||||
Functions.prepareForAjaxRequest($form);
|
||||
// User wants to submit the form
|
||||
$.post($form.attr('action'), $form.serialize() + window.CommonParams.get('arg_separator') + 'do_save_data=1', function (data) {
|
||||
$.post($form.attr('action'), $form.serialize() + CommonParams.get('arg_separator') + 'do_save_data=1', function (data) {
|
||||
var $sqlqueryresults = $('.sqlqueryresults');
|
||||
if ($sqlqueryresults.length !== 0) {
|
||||
$sqlqueryresults.remove();
|
||||
@ -3518,7 +3519,7 @@ Functions.onloadRecentFavoriteTables = () => {
|
||||
'favoriteTables': (window.Config.isStorageSupported('localStorage') && typeof window.localStorage.favoriteTables !== 'undefined')
|
||||
? window.localStorage.favoriteTables
|
||||
: '',
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
'no_debug': true
|
||||
},
|
||||
success: function (data) {
|
||||
@ -3740,7 +3741,7 @@ Functions.onloadCreateView = function () {
|
||||
$('.logout').on('click', function () {
|
||||
var form = $(
|
||||
'<form method="POST" action="' + $(this).attr('href') + '" class="disableAjax">' +
|
||||
'<input type="hidden" name="token" value="' + Functions.escapeHtml(window.CommonParams.get('token')) + '">' +
|
||||
'<input type="hidden" name="token" value="' + Functions.escapeHtml(CommonParams.get('token')) + '">' +
|
||||
'</form>'
|
||||
);
|
||||
$('body').append(form);
|
||||
@ -3780,7 +3781,7 @@ Functions.onloadCreateView = function () {
|
||||
|
||||
Functions.createViewModal = function ($this) {
|
||||
var $msg = Functions.ajaxShowMessage();
|
||||
var sep = window.CommonParams.get('arg_separator');
|
||||
var sep = CommonParams.get('arg_separator');
|
||||
var params = Functions.getJsConfirmCommonParam(this, $this.getPostData());
|
||||
params += sep + 'ajax_dialog=1';
|
||||
$.post($this.attr('href'), params, function (data) {
|
||||
@ -4013,7 +4014,7 @@ Functions.onloadLoginForm = () => {
|
||||
}
|
||||
var $httpsWarning = $('#js-https-mismatch');
|
||||
if ($httpsWarning.length) {
|
||||
if ((window.location.protocol === 'https:') !== window.CommonParams.get('is_https')) {
|
||||
if ((window.location.protocol === 'https:') !== CommonParams.get('is_https')) {
|
||||
$httpsWarning.show();
|
||||
}
|
||||
}
|
||||
@ -4283,7 +4284,7 @@ Functions.configSet = function (key, value) {
|
||||
data: {
|
||||
'ajax_request': true,
|
||||
key: key,
|
||||
server: window.CommonParams.get('server'),
|
||||
server: CommonParams.get('server'),
|
||||
value: serialized,
|
||||
},
|
||||
success: function (data) {
|
||||
@ -4327,7 +4328,7 @@ Functions.configGet = function (key, cached, successCallback, failureCallback) {
|
||||
dataType: 'json',
|
||||
data: {
|
||||
'ajax_request': true,
|
||||
server: window.CommonParams.get('server'),
|
||||
server: CommonParams.get('server'),
|
||||
key: key
|
||||
},
|
||||
success: function (data) {
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from './common.js';
|
||||
|
||||
/**
|
||||
* @fileoverview functions used in GIS data editor
|
||||
@ -142,7 +143,7 @@ function loadGISEditor (value, field, type, inputName) {
|
||||
'input_name' : inputName,
|
||||
'get_gis_editor' : true,
|
||||
'ajax_request': true,
|
||||
'server': window.CommonParams.get('server')
|
||||
'server': CommonParams.get('server')
|
||||
}, function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
$gisEditor.html(data.gis_editor);
|
||||
@ -194,7 +195,7 @@ function insertDataAndClose () {
|
||||
var $form = $('form#gis_data_editor_form');
|
||||
var inputName = $form.find('input[name=\'input_name\']').val();
|
||||
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
$.post('index.php?route=/gis-data-editor', $form.serialize() + argsep + 'generate=true' + argsep + 'ajax_request=true', function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
$('input[name=\'' + inputName + '\']').val(data.result);
|
||||
@ -242,7 +243,7 @@ window.AJAX.registerOnload('gis_data_editor.js', function () {
|
||||
*/
|
||||
$(document).on('change', '#gis_editor input[type=\'text\']', function () {
|
||||
var $form = $('form#gis_data_editor_form');
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
$.post('index.php?route=/gis-data-editor', $form.serialize() + argsep + 'generate=true' + argsep + 'ajax_request=true', function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
$('#gis_data_textarea').val(data.result);
|
||||
@ -265,7 +266,7 @@ window.AJAX.registerOnload('gis_data_editor.js', function () {
|
||||
var $gisEditor = $('#gis_editor');
|
||||
var $form = $('form#gis_data_editor_form');
|
||||
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
$.post('index.php?route=/gis-data-editor', $form.serialize() + argsep + 'get_gis_editor=true' + argsep + 'ajax_request=true', function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
$gisEditor.html(data.gis_editor);
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonActions, CommonParams } from './common.js';
|
||||
|
||||
/* global Navigation */
|
||||
|
||||
@ -349,7 +350,7 @@ Indexes.showAddIndexDialog = function (sourceArray, arrayIndex, targetColumns, c
|
||||
var $table = $('input[name="table"]');
|
||||
var table = $table.length > 0 ? $table.val() : '';
|
||||
var postData = {
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
'db': $('input[name="db"]').val(),
|
||||
'table': table,
|
||||
'ajax_request': 1,
|
||||
@ -591,7 +592,7 @@ Indexes.on = () => function () {
|
||||
$(document).on('click', '#save_index_frm', function (event) {
|
||||
event.preventDefault();
|
||||
var $form = $('#index_frm');
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
var submitData = $form.serialize() + argsep + 'do_save_data=1' + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true';
|
||||
Functions.ajaxShowMessage(window.Messages.strProcessingRequest);
|
||||
window.AJAX.source = $form;
|
||||
@ -661,7 +662,7 @@ Indexes.on = () => function () {
|
||||
Functions.highlightSql($('#page_content'));
|
||||
}
|
||||
Navigation.reload();
|
||||
window.CommonActions.refreshMain('index.php?route=/table/structure');
|
||||
CommonActions.refreshMain('index.php?route=/table/structure');
|
||||
} else {
|
||||
Functions.ajaxShowMessage(window.Messages.strErrorProcessingRequest + ' : ' + data.error, false);
|
||||
}
|
||||
@ -693,11 +694,11 @@ Indexes.on = () => function () {
|
||||
url = $(this).find('a').getPostData();
|
||||
title = window.Messages.strEditIndex;
|
||||
}
|
||||
url += window.CommonParams.get('arg_separator') + 'ajax_request=true';
|
||||
url += CommonParams.get('arg_separator') + 'ajax_request=true';
|
||||
Functions.indexEditorDialog(url, title, function (data) {
|
||||
window.CommonParams.set('db', data.params.db);
|
||||
window.CommonParams.set('table', data.params.table);
|
||||
window.CommonActions.refreshMain('index.php?route=/table/structure');
|
||||
CommonParams.set('db', data.params.db);
|
||||
CommonParams.set('table', data.params.table);
|
||||
CommonActions.refreshMain('index.php?route=/table/structure');
|
||||
});
|
||||
});
|
||||
|
||||
@ -708,11 +709,11 @@ Indexes.on = () => function () {
|
||||
event.preventDefault();
|
||||
var url = $(this).find('a').getPostData();
|
||||
var title = window.Messages.strRenameIndex;
|
||||
url += window.CommonParams.get('arg_separator') + 'ajax_request=true';
|
||||
url += CommonParams.get('arg_separator') + 'ajax_request=true';
|
||||
Functions.indexRenameDialog(url, title, function (data) {
|
||||
window.CommonParams.set('db', data.params.db);
|
||||
window.CommonParams.set('table', data.params.table);
|
||||
window.CommonActions.refreshMain('index.php?route=/table/structure');
|
||||
CommonParams.set('db', data.params.db);
|
||||
CommonParams.set('table', data.params.table);
|
||||
CommonActions.refreshMain('index.php?route=/table/structure');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from './common.js';
|
||||
|
||||
/* global Sql */
|
||||
/* global firstDayOfCalendar */ // templates/javascript/variables.twig
|
||||
@ -701,7 +702,7 @@ window.makeGrid = function (t, enableResize, enableReorder, enableVisib, enableG
|
||||
|
||||
// Truncates the text.
|
||||
$thisField.removeClass('truncated');
|
||||
if (window.CommonParams.get('pftext') === 'P' && value.length > g.maxTruncatedLen) {
|
||||
if (CommonParams.get('pftext') === 'P' && value.length > g.maxTruncatedLen) {
|
||||
$thisField.addClass('truncated');
|
||||
value = value.substring(0, g.maxTruncatedLen) + '...';
|
||||
}
|
||||
@ -2037,7 +2038,7 @@ window.makeGrid = function (t, enableResize, enableReorder, enableVisib, enableG
|
||||
|
||||
// initialize cell editing configuration
|
||||
g.saveCellsAtOnce = $(g.o).find('.save_cells_at_once').val();
|
||||
g.maxTruncatedLen = window.CommonParams.get('LimitChars');
|
||||
g.maxTruncatedLen = CommonParams.get('LimitChars');
|
||||
|
||||
// register events
|
||||
$(g.t).find('td.data.click1')
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import $ from 'jquery';
|
||||
import CodeMirror from 'codemirror';
|
||||
import { CommonParams } from '../common.js';
|
||||
import { Config } from './console/config.js';
|
||||
|
||||
/* global Functions, Navigation */
|
||||
@ -93,7 +94,7 @@ var Console = {
|
||||
'<input name="token" value="">' +
|
||||
'</form>'
|
||||
);
|
||||
Console.$requestForm.children('[name=token]').val(window.CommonParams.get('token'));
|
||||
Console.$requestForm.children('[name=token]').val(CommonParams.get('token'));
|
||||
Console.$requestForm.on('submit', window.AJAX.requestHandler);
|
||||
|
||||
// Event binds shouldn't run again
|
||||
@ -233,7 +234,7 @@ var Console = {
|
||||
return;
|
||||
}
|
||||
Console.$requestForm.children('textarea').val(queryString);
|
||||
Console.$requestForm.children('[name=server]').attr('value', window.CommonParams.get('server'));
|
||||
Console.$requestForm.children('[name=server]').attr('value', CommonParams.get('server'));
|
||||
if (options && options.db) {
|
||||
Console.$requestForm.children('[name=db]').val(options.db);
|
||||
if (options.table) {
|
||||
@ -243,7 +244,7 @@ var Console = {
|
||||
}
|
||||
} else {
|
||||
Console.$requestForm.children('[name=db]').val(
|
||||
(window.CommonParams.get('db').length > 0 ? window.CommonParams.get('db') : ''));
|
||||
(CommonParams.get('db').length > 0 ? CommonParams.get('db') : ''));
|
||||
}
|
||||
Console.$requestForm.find('[name=profiling]').remove();
|
||||
if (options && options.profiling === true) {
|
||||
@ -920,7 +921,7 @@ var ConsoleMessages = {
|
||||
if (confirm(window.Messages.strConsoleDeleteBookmarkConfirm + '\n' + $message.find('.bookmark_label').text())) {
|
||||
$.post('index.php?route=/import',
|
||||
{
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
'action_bookmark': 2,
|
||||
'ajax_request': true,
|
||||
'id_bookmark': $message.attr('bookmarkid')
|
||||
@ -1056,7 +1057,7 @@ var ConsoleBookmarks = {
|
||||
$.get('index.php?route=/console/bookmark/refresh',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
},
|
||||
function (data) {
|
||||
if (data.console_message_bookmark) {
|
||||
@ -1092,7 +1093,7 @@ var ConsoleBookmarks = {
|
||||
{
|
||||
'ajax_request': true,
|
||||
'label': $('#pma_bookmarks').find('.card.add [name=label]').val(),
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
'db': $('#pma_bookmarks').find('.card.add [name=targetdb]').val(),
|
||||
'bookmark_query': ConsoleInput.getText('bookmark'),
|
||||
'shared': $('#pma_bookmarks').find('.card.add [name=shared]').prop('checked')
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from '../common.js';
|
||||
|
||||
const GitInfo = {
|
||||
/**
|
||||
@ -104,7 +105,7 @@ const GitInfo = {
|
||||
$.get(
|
||||
'index.php?route=/git-revision',
|
||||
{
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
'ajax_request': true,
|
||||
'no_debug': true
|
||||
},
|
||||
@ -129,7 +130,7 @@ const GitInfo = {
|
||||
url: 'index.php?route=/version-check',
|
||||
method: 'POST',
|
||||
data: {
|
||||
'server': window.CommonParams.get('server')
|
||||
'server': CommonParams.get('server')
|
||||
},
|
||||
success: GitInfo.currentVersion
|
||||
});
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from './common.js';
|
||||
|
||||
/**
|
||||
* @fileoverview Implements the shiftkey + click remove column
|
||||
@ -12,7 +13,7 @@ window.AJAX.registerOnload('keyhandler.js', function () {
|
||||
$('th.draggable.column_heading.pointer.marker a').on('click', function (event) {
|
||||
var orderUrlRemove = $(this).parent().find('input[name="url-remove-order"]').val();
|
||||
var orderUrlAdd = $(this).parent().find('input[name="url-add-order"]').val();
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
if (event.ctrlKey || event.altKey) {
|
||||
event.preventDefault();
|
||||
window.AJAX.source = $(this);
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from './common.js';
|
||||
|
||||
/**
|
||||
* function used in or for navigation panel
|
||||
@ -22,8 +23,8 @@ Navigation.treeStateUpdate = function () {
|
||||
// content to be stored exceeds storage capacity
|
||||
try {
|
||||
storage.setItem('navTreePaths', JSON.stringify(Navigation.traverseForPaths()));
|
||||
storage.setItem('server', window.CommonParams.get('server'));
|
||||
storage.setItem('token', window.CommonParams.get('token'));
|
||||
storage.setItem('server', CommonParams.get('server'));
|
||||
storage.setItem('token', CommonParams.get('token'));
|
||||
} catch (error) {
|
||||
// storage capacity exceeded & old navigation tree
|
||||
// state is no more valid, so remove it
|
||||
@ -139,7 +140,7 @@ Navigation.loadChildNodes = function (isNode, $expandElem, callback) {
|
||||
var pos2Name = $expandElem.find('span.pos2_nav');
|
||||
var pathsNav = $expandElem.find('span.paths_nav');
|
||||
params = {
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
'aPath': pathsNav.attr('data-apath'),
|
||||
'vPath': pathsNav.attr('data-vpath'),
|
||||
'pos': pathsNav.attr('data-pos'),
|
||||
@ -155,7 +156,7 @@ Navigation.loadChildNodes = function (isNode, $expandElem, callback) {
|
||||
} else {
|
||||
$destination = $('#pma_navigation_tree_content');
|
||||
params = {
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
'aPath': $expandElem.attr('data-apath'),
|
||||
'vPath': $expandElem.attr('data-vpath'),
|
||||
'pos': $expandElem.attr('data-pos'),
|
||||
@ -196,7 +197,7 @@ Navigation.loadChildNodes = function (isNode, $expandElem, callback) {
|
||||
if (window.location.href.indexOf('?') === -1) {
|
||||
window.location.href += '?session_expired=1';
|
||||
} else {
|
||||
window.location.href += window.CommonParams.get('arg_separator') + 'session_expired=1';
|
||||
window.location.href += CommonParams.get('arg_separator') + 'session_expired=1';
|
||||
}
|
||||
window.location.reload();
|
||||
} else {
|
||||
@ -330,7 +331,7 @@ Navigation.onload = () => function () {
|
||||
|
||||
$(document).on('change', '#navi_db_select', function () {
|
||||
if (! $(this).val()) {
|
||||
window.CommonParams.set('db', '');
|
||||
CommonParams.set('db', '');
|
||||
Navigation.reload();
|
||||
}
|
||||
$(this).closest('form').trigger('submit');
|
||||
@ -454,9 +455,9 @@ Navigation.onload = () => function () {
|
||||
/** Hide navigation tree item */
|
||||
$(document).on('click', 'a.hideNavItem.ajax', function (event) {
|
||||
event.preventDefault();
|
||||
var argSep = window.CommonParams.get('arg_separator');
|
||||
var argSep = CommonParams.get('arg_separator');
|
||||
var params = $(this).getPostData();
|
||||
params += argSep + 'ajax_request=true' + argSep + 'server=' + window.CommonParams.get('server');
|
||||
params += argSep + 'ajax_request=true' + argSep + 'server=' + CommonParams.get('server');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: params,
|
||||
@ -475,7 +476,7 @@ Navigation.onload = () => function () {
|
||||
$(document).on('click', 'a.showUnhide.ajax', function (event) {
|
||||
event.preventDefault();
|
||||
var $msg = Functions.ajaxShowMessage();
|
||||
var argSep = window.CommonParams.get('arg_separator');
|
||||
var argSep = CommonParams.get('arg_separator');
|
||||
var params = $(this).getPostData();
|
||||
params += argSep + 'ajax_request=true';
|
||||
$.post($(this).attr('href'), params, function (data) {
|
||||
@ -496,9 +497,9 @@ Navigation.onload = () => function () {
|
||||
var $hiddenTableCount = $tr.parents('tbody').children().length;
|
||||
var $hideDialogBox = $tr.closest('div.ui-dialog');
|
||||
var $msg = Functions.ajaxShowMessage();
|
||||
var argSep = window.CommonParams.get('arg_separator');
|
||||
var argSep = CommonParams.get('arg_separator');
|
||||
var params = $(this).getPostData();
|
||||
params += argSep + 'ajax_request=true' + argSep + 'server=' + window.CommonParams.get('server');
|
||||
params += argSep + 'ajax_request=true' + argSep + 'server=' + CommonParams.get('server');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: params,
|
||||
@ -539,7 +540,7 @@ Navigation.onload = () => function () {
|
||||
type: 'POST',
|
||||
data: {
|
||||
'favoriteTables': hasLocalStorage ? window.localStorage.favoriteTables : '',
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
},
|
||||
success: function (data) {
|
||||
if (data.changes) {
|
||||
@ -572,8 +573,8 @@ Navigation.onload = () => function () {
|
||||
typeof storage.navTreePaths === 'undefined'
|
||||
) {
|
||||
Navigation.reload();
|
||||
} else if (window.CommonParams.get('server') === storage.server &&
|
||||
window.CommonParams.get('token') === storage.token
|
||||
} else if (CommonParams.get('server') === storage.server &&
|
||||
CommonParams.get('token') === storage.token
|
||||
) {
|
||||
// Reload the tree to the state before page refresh
|
||||
Navigation.reload(Navigation.filterStateRestore, JSON.parse(storage.navTreePaths));
|
||||
@ -670,8 +671,8 @@ Navigation.scrollToView = function ($element, $forceToTop) {
|
||||
* @return {void}
|
||||
*/
|
||||
Navigation.showCurrent = function () {
|
||||
var db = window.CommonParams.get('db');
|
||||
var table = window.CommonParams.get('table');
|
||||
var db = CommonParams.get('db');
|
||||
var table = CommonParams.get('table');
|
||||
|
||||
var autoexpand = $('#pma_navigation_tree').hasClass('autoexpand');
|
||||
|
||||
@ -898,7 +899,7 @@ Navigation.ensureSettings = function (selflink) {
|
||||
if (!$('#pma_navigation_settings').length) {
|
||||
var params = {
|
||||
getNaviSettings: true,
|
||||
server: window.CommonParams.get('server'),
|
||||
server: CommonParams.get('server'),
|
||||
};
|
||||
$.post('index.php?route=/navigation&ajax_request=1', params, function (data) {
|
||||
if (typeof data !== 'undefined' && data.success) {
|
||||
@ -927,12 +928,12 @@ Navigation.reload = function (callback, paths) {
|
||||
var params = {
|
||||
'reload': true,
|
||||
'no_debug': true,
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
};
|
||||
var pathsLocal = paths || Navigation.traverseForPaths();
|
||||
$.extend(params, pathsLocal);
|
||||
if ($('#navi_db_select').length) {
|
||||
params.db = window.CommonParams.get('db');
|
||||
params.db = CommonParams.get('db');
|
||||
requestNaviReload(params);
|
||||
return;
|
||||
}
|
||||
@ -965,12 +966,12 @@ Navigation.selectCurrentDatabase = function () {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (window.CommonParams.get('db')) { // db selected
|
||||
if (CommonParams.get('db')) { // db selected
|
||||
$naviDbSelect.show();
|
||||
}
|
||||
|
||||
$naviDbSelect.val(window.CommonParams.get('db'));
|
||||
return $naviDbSelect.val() === window.CommonParams.get('db');
|
||||
$naviDbSelect.val(CommonParams.get('db'));
|
||||
return $naviDbSelect.val() === CommonParams.get('db');
|
||||
};
|
||||
|
||||
/**
|
||||
@ -989,20 +990,20 @@ Navigation.treePagination = function ($this) {
|
||||
var url = 'index.php?route=/navigation';
|
||||
var params = 'ajax_request=true';
|
||||
if ($this[0].tagName === 'A') {
|
||||
params += window.CommonParams.get('arg_separator') + $this.getPostData();
|
||||
params += CommonParams.get('arg_separator') + $this.getPostData();
|
||||
} else { // tagName === 'SELECT'
|
||||
params += window.CommonParams.get('arg_separator') + $this.closest('form').serialize();
|
||||
params += CommonParams.get('arg_separator') + $this.closest('form').serialize();
|
||||
}
|
||||
var searchClause = Navigation.FastFilter.getSearchClause();
|
||||
if (searchClause) {
|
||||
params += window.CommonParams.get('arg_separator') + 'searchClause=' + encodeURIComponent(searchClause);
|
||||
params += CommonParams.get('arg_separator') + 'searchClause=' + encodeURIComponent(searchClause);
|
||||
}
|
||||
if (isDbSelector) {
|
||||
params += window.CommonParams.get('arg_separator') + 'full=true';
|
||||
params += CommonParams.get('arg_separator') + 'full=true';
|
||||
} else {
|
||||
var searchClause2 = Navigation.FastFilter.getSearchClause2($this);
|
||||
if (searchClause2) {
|
||||
params += window.CommonParams.get('arg_separator') + 'searchClause2=' + encodeURIComponent(searchClause2);
|
||||
params += CommonParams.get('arg_separator') + 'searchClause2=' + encodeURIComponent(searchClause2);
|
||||
}
|
||||
}
|
||||
$.post(url, params, function (data) {
|
||||
@ -1549,11 +1550,11 @@ Navigation.FastFilter.Filter.prototype.request = function () {
|
||||
if (self.$this.find('> ul > li > form.fast_filter').first().find('input[name=searchClause]').length === 0) {
|
||||
var $input = $('#pma_navigation_tree').find('li.fast_filter.db_fast_filter input.searchClause');
|
||||
if ($input.length && $input.val() !== $input[0].defaultValue) {
|
||||
params += window.CommonParams.get('arg_separator') + 'searchClause=' + encodeURIComponent($input.val());
|
||||
params += CommonParams.get('arg_separator') + 'searchClause=' + encodeURIComponent($input.val());
|
||||
}
|
||||
}
|
||||
self.xhr = $.ajax({
|
||||
url: 'index.php?route=/navigation&ajax_request=1&server=' + window.CommonParams.get('server'),
|
||||
url: 'index.php?route=/navigation&ajax_request=1&server=' + CommonParams.get('server'),
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: params,
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from './common.js';
|
||||
|
||||
/**
|
||||
* @fileoverview events handling from normalization page
|
||||
@ -21,9 +22,9 @@ function appendHtmlColumnsList () {
|
||||
'index.php?route=/normalization/get-columns',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'db': window.CommonParams.get('db'),
|
||||
'table': window.CommonParams.get('table'),
|
||||
'server': window.CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
},
|
||||
function (data) {
|
||||
if (data.success === true) {
|
||||
@ -36,14 +37,14 @@ function appendHtmlColumnsList () {
|
||||
function goTo3NFStep1 (newTables) {
|
||||
var tables = newTables;
|
||||
if (Object.keys(tables).length === 1) {
|
||||
tables = [window.CommonParams.get('table')];
|
||||
tables = [CommonParams.get('table')];
|
||||
}
|
||||
$.post(
|
||||
'index.php?route=/normalization/3nf/step1',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'db': window.CommonParams.get('db'),
|
||||
'server': window.CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'server': CommonParams.get('server'),
|
||||
'tables': tables,
|
||||
}, function (data) {
|
||||
$('#page_content').find('h3').html(window.Messages.str3NFNormalization);
|
||||
@ -81,9 +82,9 @@ function goTo2NFStep1 () {
|
||||
'index.php?route=/normalization/2nf/step1',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'db': window.CommonParams.get('db'),
|
||||
'table': window.CommonParams.get('table'),
|
||||
'server': window.CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
}, function (data) {
|
||||
$('#page_content h3').html(window.Messages.str2NFNormalization);
|
||||
$('#mainContent legend').html(data.legendText);
|
||||
@ -106,7 +107,7 @@ function goTo2NFStep1 () {
|
||||
if (normalizeto === '3nf') {
|
||||
$('#mainContent #newCols').html(window.Messages.strToNextStep);
|
||||
setTimeout(function () {
|
||||
goTo3NFStep1([window.CommonParams.get('table')]);
|
||||
goTo3NFStep1([CommonParams.get('table')]);
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
@ -120,7 +121,7 @@ function goToFinish1NF () {
|
||||
}
|
||||
$('#mainContent legend').html(window.Messages.strEndStep);
|
||||
$('#mainContent h4').html(
|
||||
'<h3>' + Functions.sprintf(window.Messages.strFinishMsg, Functions.escapeHtml(window.CommonParams.get('table'))) + '</h3>'
|
||||
'<h3>' + Functions.sprintf(window.Messages.strFinishMsg, Functions.escapeHtml(CommonParams.get('table'))) + '</h3>'
|
||||
);
|
||||
$('#mainContent p').html('');
|
||||
$('#mainContent #extra').html('');
|
||||
@ -133,9 +134,9 @@ function goToStep4 () {
|
||||
'index.php?route=/normalization/1nf/step4',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'db': window.CommonParams.get('db'),
|
||||
'table': window.CommonParams.get('table'),
|
||||
'server': window.CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
}, function (data) {
|
||||
$('#mainContent legend').html(data.legendText);
|
||||
$('#mainContent h4').html(data.headText);
|
||||
@ -156,9 +157,9 @@ function goToStep3 () {
|
||||
'index.php?route=/normalization/1nf/step3',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'db': window.CommonParams.get('db'),
|
||||
'table': window.CommonParams.get('table'),
|
||||
'server': window.CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
}, function (data) {
|
||||
$('#mainContent legend').html(data.legendText);
|
||||
$('#mainContent h4').html(data.headText);
|
||||
@ -179,9 +180,9 @@ function goToStep2 (extra) {
|
||||
'index.php?route=/normalization/1nf/step2',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'db': window.CommonParams.get('db'),
|
||||
'table': window.CommonParams.get('table'),
|
||||
'server': window.CommonParams.get('server')
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server')
|
||||
}, function (data) {
|
||||
$('#mainContent legend').html(data.legendText);
|
||||
$('#mainContent h4').html(data.headText);
|
||||
@ -215,9 +216,9 @@ function goTo2NFFinish (pd) {
|
||||
}
|
||||
var datastring = {
|
||||
'ajax_request': true,
|
||||
'db': window.CommonParams.get('db'),
|
||||
'table': window.CommonParams.get('table'),
|
||||
'server': window.CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
'pd': JSON.stringify(pd),
|
||||
'newTablesName': JSON.stringify(tables),
|
||||
};
|
||||
@ -262,8 +263,8 @@ function goTo3NFFinish (newTables) {
|
||||
}
|
||||
var datastring = {
|
||||
'ajax_request': true,
|
||||
'db': window.CommonParams.get('db'),
|
||||
'server': window.CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'server': CommonParams.get('server'),
|
||||
'newTables': JSON.stringify(newTables),
|
||||
};
|
||||
$.ajax({
|
||||
@ -312,9 +313,9 @@ function goTo2NFStep2 (pd, primaryKey) {
|
||||
extra += '</div>';
|
||||
var datastring = {
|
||||
'ajax_request': true,
|
||||
'db': window.CommonParams.get('db'),
|
||||
'table': window.CommonParams.get('table'),
|
||||
'server': window.CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
'pd': JSON.stringify(pd),
|
||||
};
|
||||
$.ajax({
|
||||
@ -361,9 +362,9 @@ function goTo3NFStep2 (pd, tablesTds) {
|
||||
extra += '</div>';
|
||||
var datastring = {
|
||||
'ajax_request': true,
|
||||
'db': window.CommonParams.get('db'),
|
||||
'db': CommonParams.get('db'),
|
||||
'tables': JSON.stringify(tablesTds),
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
'pd': JSON.stringify(pd),
|
||||
};
|
||||
$.ajax({
|
||||
@ -454,9 +455,9 @@ function moveRepeatingGroup (repeatingCols) {
|
||||
}
|
||||
var datastring = {
|
||||
'ajax_request': true,
|
||||
'db': window.CommonParams.get('db'),
|
||||
'table': window.CommonParams.get('table'),
|
||||
'server': window.CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
'repeatingColumns': repeatingCols,
|
||||
'newTable':newTable,
|
||||
'newColumn':newColumn,
|
||||
@ -513,9 +514,9 @@ window.AJAX.registerOnload('normalization.js', function () {
|
||||
'index.php?route=/normalization/create-new-column',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'db': window.CommonParams.get('db'),
|
||||
'table': window.CommonParams.get('table'),
|
||||
'server': window.CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
'numFields': numField
|
||||
},
|
||||
function (data) {
|
||||
@ -556,7 +557,7 @@ window.AJAX.registerOnload('normalization.js', function () {
|
||||
$('#newCols #field_0_1').trigger('focus');
|
||||
return false;
|
||||
}
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
var datastring = $('#newCols :input').serialize();
|
||||
datastring += argsep + 'ajax_request=1' + argsep + 'do_save_data=1' + argsep + 'field_where=last';
|
||||
$.post('index.php?route=/table/add-field', datastring, function (data) {
|
||||
@ -565,12 +566,12 @@ window.AJAX.registerOnload('normalization.js', function () {
|
||||
'index.php?route=/sql',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'db': window.CommonParams.get('db'),
|
||||
'table': window.CommonParams.get('table'),
|
||||
'server': window.CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
'dropped_column': selectedCol,
|
||||
'purge' : 1,
|
||||
'sql_query': 'ALTER TABLE `' + window.CommonParams.get('table') + '` DROP `' + selectedCol + '`;',
|
||||
'sql_query': 'ALTER TABLE `' + CommonParams.get('table') + '` DROP `' + selectedCol + '`;',
|
||||
'is_js_confirmed': 1
|
||||
},
|
||||
function (data) {
|
||||
@ -595,9 +596,9 @@ window.AJAX.registerOnload('normalization.js', function () {
|
||||
'index.php?route=/normalization/add-new-primary',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'db': window.CommonParams.get('db'),
|
||||
'table': window.CommonParams.get('table'),
|
||||
'server': window.CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
},
|
||||
function (data) {
|
||||
if (data.success === true) {
|
||||
@ -634,7 +635,7 @@ window.AJAX.registerOnload('normalization.js', function () {
|
||||
});
|
||||
$('.tblFooters').on('click', '#saveNewPrimary', function () {
|
||||
var datastring = $('#newCols :input').serialize();
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var 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';
|
||||
$.post('index.php?route=/table/add-field', datastring, function (data) {
|
||||
if (data.success === true) {
|
||||
@ -652,7 +653,7 @@ window.AJAX.registerOnload('normalization.js', function () {
|
||||
});
|
||||
});
|
||||
$('#extra').on('click', '#removeRedundant', function () {
|
||||
var dropQuery = 'ALTER TABLE `' + window.CommonParams.get('table') + '` ';
|
||||
var dropQuery = 'ALTER TABLE `' + CommonParams.get('table') + '` ';
|
||||
$('#extra input[type=checkbox]:checked').each(function () {
|
||||
dropQuery += 'DROP `' + $(this).val() + '`, ';
|
||||
});
|
||||
@ -661,9 +662,9 @@ window.AJAX.registerOnload('normalization.js', function () {
|
||||
'index.php?route=/sql',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'db': window.CommonParams.get('db'),
|
||||
'table': window.CommonParams.get('table'),
|
||||
'server': window.CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
'sql_query': dropQuery,
|
||||
'is_js_confirmed': 1
|
||||
},
|
||||
@ -685,7 +686,7 @@ window.AJAX.registerOnload('normalization.js', function () {
|
||||
if (repeatingCols !== '') {
|
||||
var newColName = $('#extra input[type=checkbox]:checked').first().val();
|
||||
repeatingCols = repeatingCols.slice(0, -2);
|
||||
var confirmStr = Functions.sprintf(window.Messages.strMoveRepeatingGroup, Functions.escapeHtml(repeatingCols), Functions.escapeHtml(window.CommonParams.get('table')));
|
||||
var confirmStr = Functions.sprintf(window.Messages.strMoveRepeatingGroup, Functions.escapeHtml(repeatingCols), Functions.escapeHtml(CommonParams.get('table')));
|
||||
confirmStr += '<input type="text" name="repeatGroupTable" placeholder="' + window.Messages.strNewTablePlaceholder + '">' +
|
||||
'( ' + Functions.escapeHtml(primaryKey.toString()) + ', <input type="text" name="repeatGroupColumn" placeholder="' + window.Messages.strNewColumnPlaceholder + '" value="' + Functions.escapeHtml(newColName) + '">)' +
|
||||
'</ol>';
|
||||
@ -718,9 +719,9 @@ window.AJAX.registerOnload('normalization.js', function () {
|
||||
event.preventDefault();
|
||||
var url = {
|
||||
'create_index': 1,
|
||||
'server': window.CommonParams.get('server'),
|
||||
'db': window.CommonParams.get('db'),
|
||||
'table': window.CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'added_fields': 1,
|
||||
'add_fields':1,
|
||||
'index': { 'Key_name':'PRIMARY' },
|
||||
@ -758,9 +759,9 @@ window.AJAX.registerOnload('normalization.js', function () {
|
||||
'index.php?route=/normalization/partial-dependencies',
|
||||
{
|
||||
'ajax_request': true,
|
||||
'db': window.CommonParams.get('db'),
|
||||
'table': window.CommonParams.get('table'),
|
||||
'server': window.CommonParams.get('server'),
|
||||
'db': CommonParams.get('db'),
|
||||
'table': CommonParams.get('table'),
|
||||
'server': CommonParams.get('server'),
|
||||
}, function (data) {
|
||||
$('#showPossiblePd').html('- ' + window.Messages.strHidePd);
|
||||
$('#showPossiblePd').addClass('hideList');
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonActions, CommonParams } from '../common.js';
|
||||
|
||||
/* global Navigation */
|
||||
|
||||
@ -63,7 +64,7 @@ const DropDatabases = {
|
||||
$form.find('tbody').sortTable('.name');
|
||||
if ($form.find('tbody').find('tr').length === 0) {
|
||||
// user just dropped the last db on this page
|
||||
window.CommonActions.refreshMain();
|
||||
CommonActions.refreshMain();
|
||||
}
|
||||
Navigation.reload();
|
||||
} else {
|
||||
@ -114,7 +115,7 @@ const CreateDatabase = {
|
||||
// make ajax request to load db structure page - taken from ajax.js
|
||||
var dbStructUrl = data.url;
|
||||
dbStructUrl = dbStructUrl.replace(/amp;/ig, '');
|
||||
var params = 'ajax_request=true' + window.CommonParams.get('arg_separator') + 'ajax_page_request=true';
|
||||
var params = 'ajax_request=true' + CommonParams.get('arg_separator') + 'ajax_page_request=true';
|
||||
$.get(dbStructUrl, params, window.AJAX.responseHandler);
|
||||
} else {
|
||||
Functions.ajaxShowMessage(data.error, false);
|
||||
@ -127,7 +128,7 @@ function checkPrivilegesForDatabase () {
|
||||
var tableRows = $('.server_databases');
|
||||
$.each(tableRows, function () {
|
||||
$(this).on('click', function () {
|
||||
window.CommonActions.setDb($(this).attr('data'));
|
||||
CommonActions.setDb($(this).attr('data'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from '../common.js';
|
||||
|
||||
/* global Navigation */
|
||||
|
||||
@ -45,7 +46,7 @@ const EditUserGroup = {
|
||||
'index.php?route=/server/user-groups/edit-form',
|
||||
{
|
||||
'username': username,
|
||||
'server': window.CommonParams.get('server')
|
||||
'server': CommonParams.get('server')
|
||||
},
|
||||
data => {
|
||||
if (typeof data === 'undefined' || data.success !== true) {
|
||||
@ -65,7 +66,7 @@ const EditUserGroup = {
|
||||
|
||||
$.post(
|
||||
'index.php?route=/server/privileges',
|
||||
form.serialize() + window.CommonParams.get('arg_separator') + 'ajax_request=1',
|
||||
form.serialize() + CommonParams.get('arg_separator') + 'ajax_request=1',
|
||||
data => {
|
||||
if (typeof data === 'undefined' || data.success !== true) {
|
||||
Functions.ajaxShowMessage(data.error, false, 'error');
|
||||
@ -101,7 +102,7 @@ const AccountLocking = {
|
||||
'username': button.dataset.userName,
|
||||
'hostname': button.dataset.hostName,
|
||||
'ajax_request': true,
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
};
|
||||
|
||||
$.post(url, params, data => {
|
||||
@ -140,7 +141,7 @@ const AddUserLoginCheckUsername = {
|
||||
var href = $('form[name=\'usersForm\']').attr('action');
|
||||
var params = {
|
||||
'ajax_request' : true,
|
||||
'server' : window.CommonParams.get('server'),
|
||||
'server' : CommonParams.get('server'),
|
||||
'validate_username' : true,
|
||||
'username' : username
|
||||
};
|
||||
@ -192,7 +193,7 @@ const ChangePasswordStrength = {
|
||||
handleEvent: function () {
|
||||
var meterObj = $('#change_password_strength_meter');
|
||||
var meterObjLabel = $('#change_password_strength');
|
||||
Functions.checkPasswordStrength($(this).val(), meterObj, meterObjLabel, window.CommonParams.get('user'));
|
||||
Functions.checkPasswordStrength($(this).val(), meterObj, meterObjLabel, CommonParams.get('user'));
|
||||
}
|
||||
};
|
||||
|
||||
@ -237,7 +238,7 @@ const RevokeUser = {
|
||||
|
||||
Functions.ajaxShowMessage(window.Messages.strRemovingSelectedUsers);
|
||||
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
$.post(url, $form.serialize() + argsep + 'delete=' + $thisButton.val() + argsep + 'ajax_request=true', function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
Functions.ajaxShowMessage(data.message);
|
||||
@ -295,8 +296,8 @@ const ExportPrivileges = {
|
||||
return;
|
||||
}
|
||||
var msgbox = Functions.ajaxShowMessage();
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var serverId = window.CommonParams.get('server');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
var serverId = CommonParams.get('server');
|
||||
var selectedUsers = $('#usersForm input[name*=\'selected_usr\']:checkbox').serialize();
|
||||
var postStr = selectedUsers + '&submit_mult=export' + argsep + 'ajax_request=true&server=' + serverId;
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from '../../common.js';
|
||||
|
||||
/**
|
||||
* @fileoverview Javascript functions used in server status monitor page
|
||||
@ -784,7 +785,7 @@ window.AJAX.registerOnload('server/status/monitor.js', function () {
|
||||
var loadLogVars = function (getvars) {
|
||||
var vars = {
|
||||
'ajax_request': true,
|
||||
'server': window.CommonParams.get('server')
|
||||
'server': CommonParams.get('server')
|
||||
};
|
||||
if (getvars) {
|
||||
$.extend(vars, getvars);
|
||||
@ -1489,7 +1490,7 @@ window.AJAX.registerOnload('server/status/monitor.js', function () {
|
||||
runtime.refreshRequest = $.post('index.php?route=/server/status/monitor/chart', {
|
||||
'ajax_request': true,
|
||||
'requiredData': JSON.stringify(runtime.dataList),
|
||||
'server': window.CommonParams.get('server')
|
||||
'server': CommonParams.get('server')
|
||||
}, function (data) {
|
||||
var chartData;
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
@ -1748,7 +1749,7 @@ window.AJAX.registerOnload('server/status/monitor.js', function () {
|
||||
'time_end': Math.round(opts.end / 1000),
|
||||
'removeVariables': opts.removeVariables,
|
||||
'limitTypes': opts.limitTypes,
|
||||
'server': window.CommonParams.get('server')
|
||||
'server': CommonParams.get('server')
|
||||
},
|
||||
function (data) {
|
||||
var logData;
|
||||
@ -2177,7 +2178,7 @@ window.AJAX.registerOnload('server/status/monitor.js', function () {
|
||||
'ajax_request': true,
|
||||
'query': window.codeMirrorEditor ? window.codeMirrorEditor.getValue() : $('#sqlquery').val(),
|
||||
'database': db,
|
||||
'server': window.CommonParams.get('server')
|
||||
'server': CommonParams.get('server')
|
||||
}, function (responseData) {
|
||||
var data = responseData;
|
||||
var i;
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from '../../common.js';
|
||||
|
||||
/**
|
||||
* Server Status Processes
|
||||
@ -47,9 +48,9 @@ var processList = {
|
||||
*/
|
||||
killProcessHandler: function (event) {
|
||||
event.preventDefault();
|
||||
var argSep = window.CommonParams.get('arg_separator');
|
||||
var argSep = CommonParams.get('arg_separator');
|
||||
var params = $(this).getPostData();
|
||||
params += argSep + 'ajax_request=1' + argSep + 'server=' + window.CommonParams.get('server');
|
||||
params += argSep + 'ajax_request=1' + argSep + 'server=' + CommonParams.get('server');
|
||||
// Get row element of the process to be killed.
|
||||
var $tr = $(this).closest('tr');
|
||||
$.post($(this).attr('href'), params, function (data) {
|
||||
@ -147,7 +148,7 @@ var processList = {
|
||||
*/
|
||||
getUrlParams: function () {
|
||||
var urlParams = {
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
'ajax_request': true,
|
||||
'refresh': true,
|
||||
'full': $('input[name="full"]').val(),
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from '../common.js';
|
||||
|
||||
/**
|
||||
* @fileoverview Javascript functions used in server variables page
|
||||
@ -48,7 +49,7 @@ window.AJAX.registerOnload('server/variables.js', function () {
|
||||
var $msgbox = Functions.ajaxShowMessage(window.Messages.strProcessingRequest);
|
||||
$.post('index.php?route=/server/variables/set/' + encodeURIComponent(varName), {
|
||||
'ajax_request': true,
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
'varValue': $valueCell.find('input').val()
|
||||
}, function (data) {
|
||||
if (data.success) {
|
||||
@ -77,7 +78,7 @@ window.AJAX.registerOnload('server/variables.js', function () {
|
||||
|
||||
$.get('index.php?route=/server/variables/get/' + encodeURIComponent(varName), {
|
||||
'ajax_request': true,
|
||||
'server': window.CommonParams.get('server')
|
||||
'server': CommonParams.get('server')
|
||||
}, function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
var $links = $('<div></div>')
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from './common.js';
|
||||
|
||||
/**
|
||||
* @fileoverview Handle shortcuts in various pages
|
||||
@ -75,14 +76,14 @@ $(function () {
|
||||
window.Console.toggle();
|
||||
} else if (e.keyCode === keyS) {
|
||||
if (databaseOp === true) {
|
||||
isTable = window.CommonParams.get('table');
|
||||
isDb = window.CommonParams.get('db');
|
||||
isTable = CommonParams.get('table');
|
||||
isDb = CommonParams.get('db');
|
||||
if (isDb && ! isTable) {
|
||||
$('.nav-link .ic_b_props').first().trigger('click');
|
||||
}
|
||||
} else if (tableOp === true) {
|
||||
isTable = window.CommonParams.get('table');
|
||||
isDb = window.CommonParams.get('db');
|
||||
isTable = CommonParams.get('table');
|
||||
isDb = CommonParams.get('db');
|
||||
if (isDb && isTable) {
|
||||
$('.nav-link .ic_b_props').first().trigger('click');
|
||||
}
|
||||
@ -91,14 +92,14 @@ $(function () {
|
||||
}
|
||||
} else if (e.keyCode === keyF) {
|
||||
if (databaseOp === true) {
|
||||
isTable = window.CommonParams.get('table');
|
||||
isDb = window.CommonParams.get('db');
|
||||
isTable = CommonParams.get('table');
|
||||
isDb = CommonParams.get('db');
|
||||
if (isDb && ! isTable) {
|
||||
$('.nav-link .ic_b_search').first().trigger('click');
|
||||
}
|
||||
} else if (tableOp === true) {
|
||||
isTable = window.CommonParams.get('table');
|
||||
isDb = window.CommonParams.get('db');
|
||||
isTable = CommonParams.get('table');
|
||||
isDb = CommonParams.get('db');
|
||||
if (isDb && isTable) {
|
||||
$('.nav-link .ic_b_search').first().trigger('click');
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonActions, CommonParams } from './common.js';
|
||||
|
||||
/**
|
||||
* @fileoverview functions used wherever an sql query form is used
|
||||
@ -51,7 +52,7 @@ Sql.autoSave = function (query) {
|
||||
if (window.Config.isStorageSupported('localStorage')) {
|
||||
window.localStorage.setItem(key, query);
|
||||
} else {
|
||||
window.Cookies.set(key, query, { path: window.CommonParams.get('rootPath') });
|
||||
window.Cookies.set(key, query, { path: CommonParams.get('rootPath') });
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -74,8 +75,8 @@ Sql.showThisQuery = function (db, table, query) {
|
||||
window.localStorage.showThisQuery = 1;
|
||||
window.localStorage.showThisQueryObject = JSON.stringify(showThisQueryObject);
|
||||
} else {
|
||||
window.Cookies.set('showThisQuery', 1, { path: window.CommonParams.get('rootPath') });
|
||||
window.Cookies.set('showThisQueryObject', JSON.stringify(showThisQueryObject), { path: window.CommonParams.get('rootPath') });
|
||||
window.Cookies.set('showThisQuery', 1, { path: CommonParams.get('rootPath') });
|
||||
window.Cookies.set('showThisQueryObject', JSON.stringify(showThisQueryObject), { path: CommonParams.get('rootPath') });
|
||||
}
|
||||
};
|
||||
|
||||
@ -119,7 +120,7 @@ Sql.autoSaveWithSort = function (query) {
|
||||
if (window.Config.isStorageSupported('localStorage')) {
|
||||
window.localStorage.setItem('autoSavedSqlSort', query);
|
||||
} else {
|
||||
window.Cookies.set('autoSavedSqlSort', query, { path: window.CommonParams.get('rootPath') });
|
||||
window.Cookies.set('autoSavedSqlSort', query, { path: CommonParams.get('rootPath') });
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -133,7 +134,7 @@ Sql.clearAutoSavedSort = function () {
|
||||
if (window.Config.isStorageSupported('localStorage')) {
|
||||
window.localStorage.removeItem('autoSavedSqlSort');
|
||||
} else {
|
||||
window.Cookies.set('autoSavedSqlSort', '', { path: window.CommonParams.get('rootPath') });
|
||||
window.Cookies.set('autoSavedSqlSort', '', { path: CommonParams.get('rootPath') });
|
||||
}
|
||||
};
|
||||
|
||||
@ -277,7 +278,7 @@ const insertQuery = function (queryType) {
|
||||
var params = {
|
||||
'ajax_request': true,
|
||||
'sql': window.codeMirrorEditor.getValue(),
|
||||
'server': window.CommonParams.get('server')
|
||||
'server': CommonParams.get('server')
|
||||
};
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
@ -306,8 +307,8 @@ const insertQuery = function (queryType) {
|
||||
if (window.Config.isStorageSupported('localStorage') &&
|
||||
typeof window.localStorage.getItem(key) === 'string') {
|
||||
setQuery(window.localStorage.getItem(key));
|
||||
} else if (window.Cookies.get(key, { path: window.CommonParams.get('rootPath') })) {
|
||||
setQuery(window.Cookies.get(key, { path: window.CommonParams.get('rootPath') }));
|
||||
} else if (window.Cookies.get(key, { path: CommonParams.get('rootPath') })) {
|
||||
setQuery(window.Cookies.get(key, { path: CommonParams.get('rootPath') }));
|
||||
} else {
|
||||
Functions.ajaxShowMessage(window.Messages.strNoAutoSavedQuery);
|
||||
}
|
||||
@ -478,7 +479,7 @@ window.AJAX.registerOnload('sql.js', function () {
|
||||
Sql.clearAutoSavedSort();
|
||||
}
|
||||
// If sql query with sort for current table is stored, change sort by key select value
|
||||
var sortStoredQuery = useLocalStorageValue ? window.localStorage.autoSavedSqlSort : window.Cookies.get('autoSavedSqlSort', { path: window.CommonParams.get('rootPath') });
|
||||
var sortStoredQuery = useLocalStorageValue ? window.localStorage.autoSavedSqlSort : window.Cookies.get('autoSavedSqlSort', { path: CommonParams.get('rootPath') });
|
||||
if (typeof sortStoredQuery !== 'undefined' && sortStoredQuery !== $('select[name="sql_query"]').val() && $('select[name="sql_query"] option[value="' + sortStoredQuery + '"]').length !== 0) {
|
||||
$('select[name="sql_query"]').val(sortStoredQuery).trigger('change');
|
||||
}
|
||||
@ -492,7 +493,7 @@ window.AJAX.registerOnload('sql.js', function () {
|
||||
var $link = $(this);
|
||||
$link.confirm(question, $link.attr('href'), function (url) {
|
||||
Functions.ajaxShowMessage();
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
var params = 'ajax_request=1' + argsep + 'is_js_confirmed=1';
|
||||
var postData = $link.getPostData();
|
||||
if (postData) {
|
||||
@ -513,7 +514,7 @@ window.AJAX.registerOnload('sql.js', function () {
|
||||
$(document).on('submit', '.bookmarkQueryForm', function (e) {
|
||||
e.preventDefault();
|
||||
Functions.ajaxShowMessage();
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
$.post($(this).attr('action'), 'ajax_request=1' + argsep + $(this).serialize(), function (data) {
|
||||
if (data.success) {
|
||||
Functions.ajaxShowMessage(data.message);
|
||||
@ -772,7 +773,7 @@ window.AJAX.registerOnload('sql.js', function () {
|
||||
|
||||
Functions.prepareForAjaxRequest($form);
|
||||
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var 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) {
|
||||
// success happens if the query returns rows or not
|
||||
@ -811,21 +812,21 @@ window.AJAX.registerOnload('sql.js', function () {
|
||||
}
|
||||
|
||||
if (data.params) {
|
||||
window.CommonParams.setAll(data.params);
|
||||
CommonParams.setAll(data.params);
|
||||
}
|
||||
|
||||
if (typeof data.ajax_reload !== 'undefined') {
|
||||
if (data.ajax_reload.reload) {
|
||||
if (data.ajax_reload.table_name) {
|
||||
window.CommonParams.set('table', data.ajax_reload.table_name);
|
||||
window.CommonActions.refreshMain();
|
||||
CommonParams.set('table', data.ajax_reload.table_name);
|
||||
CommonActions.refreshMain();
|
||||
} else {
|
||||
Navigation.reload();
|
||||
}
|
||||
}
|
||||
} else if (typeof data.reload !== 'undefined') {
|
||||
// this happens if a USE or DROP command was typed
|
||||
window.CommonActions.setDb(data.db);
|
||||
CommonActions.setDb(data.db);
|
||||
var url;
|
||||
if (data.db) {
|
||||
if (data.table) {
|
||||
@ -836,7 +837,7 @@ window.AJAX.registerOnload('sql.js', function () {
|
||||
} else {
|
||||
url = 'index.php?route=/server/sql';
|
||||
}
|
||||
window.CommonActions.refreshMain(url, function () {
|
||||
CommonActions.refreshMain(url, function () {
|
||||
$('#sqlqueryresultsouter')
|
||||
.show()
|
||||
.html(data.message);
|
||||
@ -876,7 +877,7 @@ window.AJAX.registerOnload('sql.js', function () {
|
||||
var $form = $(this);
|
||||
|
||||
var $msgbox = Functions.ajaxShowMessage();
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
$.post($form.attr('action'), $form.serialize() + argsep + 'ajax_request=true', function (data) {
|
||||
Functions.ajaxRemoveMessage($msgbox);
|
||||
var $sqlqueryresults = $form.parents('.sqlqueryresults');
|
||||
@ -919,7 +920,7 @@ window.AJAX.registerOnload('sql.js', function () {
|
||||
var $form = $(this).parents('form');
|
||||
|
||||
Sql.submitShowAllForm = function () {
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
var submitData = $form.serialize() + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true';
|
||||
Functions.ajaxShowMessage();
|
||||
window.AJAX.source = $form;
|
||||
@ -965,7 +966,7 @@ window.AJAX.registerOnload('sql.js', function () {
|
||||
type: 'POST',
|
||||
url: 'index.php?route=/import/simulate-dml',
|
||||
data: {
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
'db': dbName,
|
||||
'ajax_request': '1',
|
||||
'sql_query': query,
|
||||
@ -1016,7 +1017,7 @@ window.AJAX.registerOnload('sql.js', function () {
|
||||
var $button = $(this);
|
||||
var action = $button.val();
|
||||
var $form = $button.closest('form');
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
var submitData = $form.serialize() + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true' + argsep;
|
||||
Functions.ajaxShowMessage();
|
||||
window.AJAX.source = $form;
|
||||
@ -1123,7 +1124,7 @@ Sql.browseForeignDialog = function ($thisA) {
|
||||
var tableId = '#browse_foreign_table';
|
||||
var filterId = '#input_foreign_filter';
|
||||
var $dialog = null;
|
||||
var argSep = window.CommonParams.get('arg_separator');
|
||||
var argSep = CommonParams.get('arg_separator');
|
||||
var params = $thisA.getPostData();
|
||||
params += argSep + 'ajax_request=true';
|
||||
$.post($thisA.attr('href'), params, function (data) {
|
||||
@ -1212,7 +1213,7 @@ Sql.checkSavedQuery = function () {
|
||||
if (window.Config.isStorageSupported('localStorage') &&
|
||||
typeof window.localStorage.getItem(key) === 'string') {
|
||||
Functions.ajaxShowMessage(window.Messages.strPreviousSaveQuery);
|
||||
} else if (window.Cookies.get(key, { path: window.CommonParams.get('rootPath') })) {
|
||||
} else if (window.Cookies.get(key, { path: CommonParams.get('rootPath') })) {
|
||||
Functions.ajaxShowMessage(window.Messages.strPreviousSaveQuery);
|
||||
}
|
||||
};
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonActions, CommonParams } from '../common.js';
|
||||
|
||||
/* global Navigation */
|
||||
|
||||
@ -73,19 +74,19 @@ window.AJAX.registerOnload('table/operations.js', function () {
|
||||
event.preventDefault();
|
||||
var $form = $(this);
|
||||
Functions.prepareForAjaxRequest($form);
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
$.post($form.attr('action'), $form.serialize() + argsep + 'submit_copy=Go', function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
if ($form.find('input[name=\'switch_to_new\']').prop('checked')) {
|
||||
window.CommonParams.set(
|
||||
CommonParams.set(
|
||||
'db',
|
||||
$form.find('select[name=\'target_db\'],input[name=\'target_db\']').val()
|
||||
);
|
||||
window.CommonParams.set(
|
||||
CommonParams.set(
|
||||
'table',
|
||||
$form.find('input[name=\'new_name\']').val()
|
||||
);
|
||||
window.CommonActions.refreshMain(false, function () {
|
||||
CommonActions.refreshMain(false, function () {
|
||||
Functions.ajaxShowMessage(data.message);
|
||||
});
|
||||
} else {
|
||||
@ -106,12 +107,12 @@ window.AJAX.registerOnload('table/operations.js', function () {
|
||||
event.preventDefault();
|
||||
var $form = $(this);
|
||||
Functions.prepareForAjaxRequest($form);
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
$.post($form.attr('action'), $form.serialize() + argsep + 'submit_move=1', function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
window.CommonParams.set('db', data.params.db);
|
||||
window.CommonParams.set('table', data.params.table);
|
||||
window.CommonActions.refreshMain('index.php?route=/table/sql', function () {
|
||||
CommonParams.set('db', data.params.db);
|
||||
CommonParams.set('table', data.params.table);
|
||||
CommonActions.refreshMain('index.php?route=/table/sql', function () {
|
||||
Functions.ajaxShowMessage(data.message);
|
||||
});
|
||||
// Refresh navigation when the table is copied
|
||||
@ -159,8 +160,8 @@ window.AJAX.registerOnload('table/operations.js', function () {
|
||||
function submitOptionsForm () {
|
||||
$.post($form.attr('action'), $form.serialize(), function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
window.CommonParams.set('table', data.params.table);
|
||||
window.CommonActions.refreshMain(false, function () {
|
||||
CommonParams.set('table', data.params.table);
|
||||
CommonActions.refreshMain(false, function () {
|
||||
$('#page_content').html(data.message);
|
||||
Functions.highlightSql($('#page_content'));
|
||||
});
|
||||
@ -189,11 +190,11 @@ window.AJAX.registerOnload('table/operations.js', function () {
|
||||
// variables which stores the common attributes
|
||||
var params = $.param({
|
||||
'ajax_request': 1,
|
||||
'server': window.CommonParams.get('server')
|
||||
'server': CommonParams.get('server')
|
||||
});
|
||||
var postData = $link.getPostData();
|
||||
if (postData) {
|
||||
params += window.CommonParams.get('arg_separator') + postData;
|
||||
params += CommonParams.get('arg_separator') + postData;
|
||||
}
|
||||
|
||||
$.post($link.attr('href'), params, function (data) {
|
||||
@ -242,7 +243,7 @@ window.AJAX.registerOnload('table/operations.js', function () {
|
||||
var $form = $(this);
|
||||
|
||||
function submitPartitionMaintenance () {
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
var submitData = $form.serialize() + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true';
|
||||
Functions.ajaxShowMessage(window.Messages.strProcessingRequest);
|
||||
window.AJAX.source = $form;
|
||||
@ -282,9 +283,9 @@ window.AJAX.registerOnload('table/operations.js', function () {
|
||||
Functions.ajaxRemoveMessage($msgbox);
|
||||
// Table deleted successfully, refresh both the frames
|
||||
Navigation.reload();
|
||||
window.CommonParams.set('table', '');
|
||||
window.CommonActions.refreshMain(
|
||||
window.CommonParams.get('opendb_url'),
|
||||
CommonParams.set('table', '');
|
||||
CommonActions.refreshMain(
|
||||
CommonParams.get('opendb_url'),
|
||||
function () {
|
||||
Functions.ajaxShowMessage(data.message);
|
||||
}
|
||||
@ -305,7 +306,7 @@ window.AJAX.registerOnload('table/operations.js', function () {
|
||||
var question = window.Messages.strDropTableStrongWarning + ' ';
|
||||
question += Functions.sprintf(
|
||||
window.Messages.strDoYouReally,
|
||||
'DROP VIEW `' + Functions.escapeHtml(window.CommonParams.get('table') + '`')
|
||||
'DROP VIEW `' + Functions.escapeHtml(CommonParams.get('table') + '`')
|
||||
);
|
||||
|
||||
$(this).confirm(question, $(this).attr('href'), function (url) {
|
||||
@ -316,9 +317,9 @@ window.AJAX.registerOnload('table/operations.js', function () {
|
||||
Functions.ajaxRemoveMessage($msgbox);
|
||||
// Table deleted successfully, refresh both the frames
|
||||
Navigation.reload();
|
||||
window.CommonParams.set('table', '');
|
||||
window.CommonActions.refreshMain(
|
||||
window.CommonParams.get('opendb_url'),
|
||||
CommonParams.set('table', '');
|
||||
CommonActions.refreshMain(
|
||||
CommonParams.get('opendb_url'),
|
||||
function () {
|
||||
Functions.ajaxShowMessage(data.message);
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonActions, CommonParams } from '../common.js';
|
||||
|
||||
/**
|
||||
* for table relation
|
||||
@ -81,7 +82,7 @@ TableRelation.getDropdownValues = function ($dropdown) {
|
||||
var $form = $dropdown.parents('form');
|
||||
var $db = $form.find('input[name="db"]').val();
|
||||
var $table = $form.find('input[name="table"]').val();
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
var params = 'getDropdownValues=true' + argsep + 'ajax_request=true' +
|
||||
argsep + 'db=' + encodeURIComponent($db) +
|
||||
argsep + 'table=' + encodeURIComponent($table) +
|
||||
@ -242,7 +243,7 @@ window.AJAX.registerOnload('table/relation.js', function () {
|
||||
$.post(url, params, function (data) {
|
||||
if (data.success === true) {
|
||||
Functions.ajaxRemoveMessage($msg);
|
||||
window.CommonActions.refreshMain(false, function () {
|
||||
CommonActions.refreshMain(false, function () {
|
||||
// Do nothing
|
||||
});
|
||||
} else {
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from '../common.js';
|
||||
|
||||
/**
|
||||
* @fileoverview JavaScript functions used on /table/search
|
||||
@ -301,7 +302,7 @@ window.AJAX.registerOnload('table/select.js', function () {
|
||||
url: 'index.php?route=/table/search',
|
||||
type: 'POST',
|
||||
data: {
|
||||
'server': window.CommonParams.get('server'),
|
||||
'server': CommonParams.get('server'),
|
||||
'ajax_request': 1,
|
||||
'db': $('input[name="db"]').val(),
|
||||
'table': $('input[name="table"]').val(),
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonActions, CommonParams } from '../common.js';
|
||||
|
||||
/**
|
||||
* @fileoverview functions used on the table structure page
|
||||
@ -25,7 +26,7 @@ import $ from 'jquery';
|
||||
* Reload fields table
|
||||
*/
|
||||
function reloadFieldForm () {
|
||||
$.post($('#fieldsForm').attr('action'), $('#fieldsForm').serialize() + window.CommonParams.get('arg_separator') + 'ajax_request=true', function (formData) {
|
||||
$.post($('#fieldsForm').attr('action'), $('#fieldsForm').serialize() + CommonParams.get('arg_separator') + 'ajax_request=true', function (formData) {
|
||||
var $tempDiv = $('<div id=\'temp_div\'><div>').append(formData.message);
|
||||
$('#fieldsForm').replaceWith($tempDiv.find('#fieldsForm'));
|
||||
$('#addColumns').replaceWith($tempDiv.find('#addColumns'));
|
||||
@ -77,7 +78,7 @@ window.AJAX.registerOnload('table/structure.js', function () {
|
||||
|
||||
function submitForm () {
|
||||
var $msg = Functions.ajaxShowMessage(window.Messages.strProcessingRequest);
|
||||
$.post($form.attr('action'), $form.serialize() + window.CommonParams.get('arg_separator') + 'do_save_data=1', function (data) {
|
||||
$.post($form.attr('action'), $form.serialize() + CommonParams.get('arg_separator') + 'do_save_data=1', function (data) {
|
||||
if ($('.sqlqueryresults').length !== 0) {
|
||||
$('.sqlqueryresults').remove();
|
||||
} else if ($('.error:not(.tab)').length !== 0) {
|
||||
@ -105,7 +106,7 @@ window.AJAX.registerOnload('table/structure.js', function () {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
window.CommonActions.refreshMain('index.php?route=/table/structure');
|
||||
CommonActions.refreshMain('index.php?route=/table/structure');
|
||||
}
|
||||
} else {
|
||||
Functions.ajaxShowMessage(data.error, false);
|
||||
@ -198,7 +199,7 @@ window.AJAX.registerOnload('table/structure.js', function () {
|
||||
$thisAnchor.confirm(question, $thisAnchor.attr('href'), function (url) {
|
||||
var $msg = Functions.ajaxShowMessage(window.Messages.strDroppingColumn, false);
|
||||
var params = Functions.getJsConfirmCommonParam(this, $thisAnchor.getPostData());
|
||||
params += window.CommonParams.get('arg_separator') + 'ajax_page_request=1';
|
||||
params += CommonParams.get('arg_separator') + 'ajax_page_request=1';
|
||||
$.post(url, params, function (data) {
|
||||
if (typeof data !== 'undefined' && data.success === true) {
|
||||
Functions.ajaxRemoveMessage($msg);
|
||||
@ -274,7 +275,7 @@ window.AJAX.registerOnload('table/structure.js', function () {
|
||||
window.AJAX.source = $this;
|
||||
|
||||
var params = Functions.getJsConfirmCommonParam(this, $thisAnchor.getPostData());
|
||||
params += window.CommonParams.get('arg_separator') + 'ajax_page_request=1';
|
||||
params += CommonParams.get('arg_separator') + 'ajax_page_request=1';
|
||||
$.post(url, params, window.AJAX.responseHandler);
|
||||
});
|
||||
}); // end Add key
|
||||
@ -338,7 +339,7 @@ window.AJAX.registerOnload('table/structure.js', function () {
|
||||
Functions.ajaxRemoveMessage($msgbox);
|
||||
return;
|
||||
}
|
||||
$.post($form.prop('action'), serialized + window.CommonParams.get('arg_separator') + 'ajax_request=true', function (data) {
|
||||
$.post($form.prop('action'), serialized + CommonParams.get('arg_separator') + 'ajax_request=true', function (data) {
|
||||
if (data.success === false) {
|
||||
Functions.ajaxRemoveMessage($msgbox);
|
||||
var errorModal = $('#moveColumnsErrorModal');
|
||||
@ -395,7 +396,7 @@ window.AJAX.registerOnload('table/structure.js', function () {
|
||||
$('body').on('click', '#fieldsForm button.mult_submit', function (e) {
|
||||
e.preventDefault();
|
||||
var $form = $(this).parents('form');
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
var submitData = $form.serialize() + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true';
|
||||
|
||||
Functions.ajaxShowMessage();
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from '../common.js';
|
||||
|
||||
/**
|
||||
* Unbind all event handlers before tearing down the page
|
||||
@ -55,7 +56,7 @@ window.AJAX.registerOnload('table/tracking.js', function () {
|
||||
e.preventDefault();
|
||||
var $button = $(this);
|
||||
var $form = $button.parent('form');
|
||||
var argsep = window.CommonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
var submitData = $form.serialize() + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true' + argsep + 'submit_mult=' + $button.val();
|
||||
|
||||
if ($button.val() === 'delete_version') {
|
||||
@ -82,7 +83,7 @@ window.AJAX.registerOnload('table/tracking.js', function () {
|
||||
$anchor.confirm(question, $anchor.attr('href'), function (url) {
|
||||
Functions.ajaxShowMessage();
|
||||
window.AJAX.source = $anchor;
|
||||
var argSep = window.CommonParams.get('arg_separator');
|
||||
var argSep = CommonParams.get('arg_separator');
|
||||
var params = Functions.getJsConfirmCommonParam(this, $anchor.getPostData());
|
||||
params += argSep + 'ajax_page_request=1';
|
||||
$.post(url, params, window.AJAX.responseHandler);
|
||||
@ -99,7 +100,7 @@ window.AJAX.registerOnload('table/tracking.js', function () {
|
||||
$anchor.confirm(question, $anchor.attr('href'), function (url) {
|
||||
Functions.ajaxShowMessage();
|
||||
window.AJAX.source = $anchor;
|
||||
var argSep = window.CommonParams.get('arg_separator');
|
||||
var argSep = CommonParams.get('arg_separator');
|
||||
var params = Functions.getJsConfirmCommonParam(this, $anchor.getPostData());
|
||||
params += argSep + 'ajax_page_request=1';
|
||||
$.post(url, params, window.AJAX.responseHandler);
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import $ from 'jquery';
|
||||
import { CommonParams } from '../common.js';
|
||||
|
||||
// TODO: change the axis
|
||||
/**
|
||||
@ -156,9 +157,9 @@ window.AJAX.registerOnload('table/zoom_plot_jqplot.js', function () {
|
||||
$.post('index.php?route=/table/zoom-search', {
|
||||
'ajax_request' : true,
|
||||
'change_tbl_info' : true,
|
||||
'server' : window.CommonParams.get('server'),
|
||||
'db' : window.CommonParams.get('db'),
|
||||
'table' : window.CommonParams.get('table'),
|
||||
'server' : CommonParams.get('server'),
|
||||
'db' : CommonParams.get('db'),
|
||||
'table' : CommonParams.get('table'),
|
||||
'field' : $('#tableid_0').val(),
|
||||
'it' : 0
|
||||
}, function (data) {
|
||||
@ -181,9 +182,9 @@ window.AJAX.registerOnload('table/zoom_plot_jqplot.js', function () {
|
||||
$.post('index.php?route=/table/zoom-search', {
|
||||
'ajax_request' : true,
|
||||
'change_tbl_info' : true,
|
||||
'server' : window.CommonParams.get('server'),
|
||||
'db' : window.CommonParams.get('db'),
|
||||
'table' : window.CommonParams.get('table'),
|
||||
'server' : CommonParams.get('server'),
|
||||
'db' : CommonParams.get('db'),
|
||||
'table' : CommonParams.get('table'),
|
||||
'field' : $('#tableid_1').val(),
|
||||
'it' : 1
|
||||
}, function (data) {
|
||||
@ -205,9 +206,9 @@ window.AJAX.registerOnload('table/zoom_plot_jqplot.js', function () {
|
||||
$.post('index.php?route=/table/zoom-search', {
|
||||
'ajax_request' : true,
|
||||
'change_tbl_info' : true,
|
||||
'server' : window.CommonParams.get('server'),
|
||||
'db' : window.CommonParams.get('db'),
|
||||
'table' : window.CommonParams.get('table'),
|
||||
'server' : CommonParams.get('server'),
|
||||
'db' : CommonParams.get('db'),
|
||||
'table' : CommonParams.get('table'),
|
||||
'field' : $('#tableid_2').val(),
|
||||
'it' : 2
|
||||
}, function (data) {
|
||||
@ -227,9 +228,9 @@ window.AJAX.registerOnload('table/zoom_plot_jqplot.js', function () {
|
||||
$.post('index.php?route=/table/zoom-search', {
|
||||
'ajax_request' : true,
|
||||
'change_tbl_info' : true,
|
||||
'server' : window.CommonParams.get('server'),
|
||||
'db' : window.CommonParams.get('db'),
|
||||
'table' : window.CommonParams.get('table'),
|
||||
'server' : CommonParams.get('server'),
|
||||
'db' : CommonParams.get('db'),
|
||||
'table' : CommonParams.get('table'),
|
||||
'field' : $('#tableid_3').val(),
|
||||
'it' : 3
|
||||
}, function (data) {
|
||||
@ -358,7 +359,7 @@ window.AJAX.registerOnload('table/zoom_plot_jqplot.js', function () {
|
||||
|
||||
// Generate SQL query for update
|
||||
if (!isEmpty(newValues)) {
|
||||
var sqlQuery = 'UPDATE `' + window.CommonParams.get('table') + '` SET ';
|
||||
var sqlQuery = 'UPDATE `' + CommonParams.get('table') + '` SET ';
|
||||
for (key in newValues) {
|
||||
sqlQuery += '`' + key + '`=';
|
||||
var value = newValues[key];
|
||||
@ -393,8 +394,8 @@ window.AJAX.registerOnload('table/zoom_plot_jqplot.js', function () {
|
||||
sqlQuery += ' WHERE ' + Sql.urlDecode(searchedData[searchedDataKey].where_clause);
|
||||
|
||||
$.post('index.php?route=/sql', {
|
||||
'server' : window.CommonParams.get('server'),
|
||||
'db' : window.CommonParams.get('db'),
|
||||
'server' : CommonParams.get('server'),
|
||||
'db' : CommonParams.get('db'),
|
||||
'ajax_request' : true,
|
||||
'sql_query' : sqlQuery,
|
||||
'inline_edit' : false
|
||||
@ -577,9 +578,9 @@ window.AJAX.registerOnload('table/zoom_plot_jqplot.js', function () {
|
||||
var postParams = {
|
||||
'ajax_request' : true,
|
||||
'get_data_row' : true,
|
||||
'server' : window.CommonParams.get('server'),
|
||||
'db' : window.CommonParams.get('db'),
|
||||
'table' : window.CommonParams.get('table'),
|
||||
'server' : CommonParams.get('server'),
|
||||
'db' : CommonParams.get('db'),
|
||||
'table' : CommonParams.get('table'),
|
||||
'where_clause' : data[3],
|
||||
'where_clause_sign' : data[5]
|
||||
};
|
||||
|
||||
@ -11,76 +11,76 @@ module.exports = [
|
||||
mode: 'none',
|
||||
devtool: 'source-map',
|
||||
entry: {
|
||||
'ajax': './js/src/ajax.js',
|
||||
'ajax': { import: './js/src/ajax.js', dependOn: 'common' },
|
||||
'chart': './js/src/chart.js',
|
||||
'codemirror/addon/lint/sql-lint': './js/src/codemirror/addon/lint/sql-lint.js',
|
||||
'codemirror/addon/lint/sql-lint': { import: './js/src/codemirror/addon/lint/sql-lint.js', dependOn: 'common' },
|
||||
'common': './js/src/common.js',
|
||||
'config': './js/src/config.js',
|
||||
'console': { import: './js/src/console.js', library: { name: 'Console', type: 'window', export: 'Console' } },
|
||||
'config': { import: './js/src/config.js', dependOn: 'common' },
|
||||
'console': { import: './js/src/console.js', library: { name: 'Console', type: 'window', export: 'Console' }, dependOn: 'common' },
|
||||
'cross_framing_protection': './js/src/cross_framing_protection.js',
|
||||
'datetimepicker': './js/src/datetimepicker.js',
|
||||
'database/central_columns': './js/src/database/central_columns.js',
|
||||
'database/central_columns': { import: './js/src/database/central_columns.js', dependOn: 'common' },
|
||||
'database/events': './js/src/database/events.js',
|
||||
'database/multi_table_query': './js/src/database/multi_table_query.js',
|
||||
'database/operations': './js/src/database/operations.js',
|
||||
'database/multi_table_query': { import: './js/src/database/multi_table_query.js', dependOn: 'common' },
|
||||
'database/operations': { import: './js/src/database/operations.js', dependOn: 'common' },
|
||||
'database/qbe': './js/src/database/qbe.js',
|
||||
'database/query_generator': './js/src/database/query_generator.js',
|
||||
'database/routines': './js/src/database/routines.js',
|
||||
'database/search': './js/src/database/search.js',
|
||||
'database/structure': './js/src/database/structure.js',
|
||||
'database/tracking': './js/src/database/tracking.js',
|
||||
'database/search': { import: './js/src/database/search.js', dependOn: 'common' },
|
||||
'database/structure': { import: './js/src/database/structure.js', dependOn: 'common' },
|
||||
'database/tracking': { import: './js/src/database/tracking.js', dependOn: 'common' },
|
||||
'database/triggers': './js/src/database/triggers.js',
|
||||
'designer/database': './js/src/designer/database.js',
|
||||
'designer/history': './js/src/designer/history.js',
|
||||
'designer/init': './js/src/designer/init.js',
|
||||
'designer/move': './js/src/designer/move.js',
|
||||
'designer/move': { import: './js/src/designer/move.js', dependOn: 'common' },
|
||||
'designer/objects': './js/src/designer/objects.js',
|
||||
'designer/page': './js/src/designer/page.js',
|
||||
'drag_drop_import': './js/src/drag_drop_import.js',
|
||||
'error_report': './js/src/error_report.js',
|
||||
'export': './js/src/export.js',
|
||||
'drag_drop_import': { import: './js/src/drag_drop_import.js', dependOn: 'common' },
|
||||
'error_report': { import: './js/src/error_report.js', dependOn: 'common' },
|
||||
'export': { import: './js/src/export.js', dependOn: 'common' },
|
||||
'export_output': './js/src/export_output.js',
|
||||
'functions': './js/src/functions.js',
|
||||
'gis_data_editor': './js/src/gis_data_editor.js',
|
||||
'home': './js/src/home.js',
|
||||
'functions': { import: './js/src/functions.js', dependOn: 'common' },
|
||||
'gis_data_editor': { import: './js/src/gis_data_editor.js', dependOn: 'common' },
|
||||
'home': { import: './js/src/home.js', dependOn: 'common' },
|
||||
'import': './js/src/import.js',
|
||||
'indexes': './js/src/indexes.js',
|
||||
'indexes': { import: './js/src/indexes.js', dependOn: 'common' },
|
||||
'jqplot/plugins/jqplot.byteFormatter': './js/src/jqplot/plugins/jqplot.byteFormatter.js',
|
||||
'jquery.sortable-table': './js/src/jquery.sortable-table.js',
|
||||
'keyhandler': './js/src/keyhandler.js',
|
||||
'main': './js/src/main.js',
|
||||
'makegrid': './js/src/makegrid.js',
|
||||
'makegrid': { import: './js/src/makegrid.js', dependOn: 'common' },
|
||||
'menu_resizer': './js/src/menu_resizer.js',
|
||||
'multi_column_sort': './js/src/multi_column_sort.js',
|
||||
'multi_column_sort': { import: './js/src/multi_column_sort.js', dependOn: 'common' },
|
||||
'name-conflict-fixes': './js/src/name-conflict-fixes.js',
|
||||
'navigation': './js/src/navigation.js',
|
||||
'normalization': './js/src/normalization.js',
|
||||
'navigation': { import: './js/src/navigation.js', dependOn: 'common' },
|
||||
'normalization': { import: './js/src/normalization.js', dependOn: 'common' },
|
||||
'page_settings': './js/src/page_settings.js',
|
||||
'replication': './js/src/replication.js',
|
||||
'server/databases': './js/src/server/databases.js',
|
||||
'server/databases': { import: './js/src/server/databases.js', dependOn: 'common' },
|
||||
'server/plugins': './js/src/server/plugins.js',
|
||||
'server/privileges': './js/src/server/privileges.js',
|
||||
'server/status/monitor': './js/src/server/status/monitor.js',
|
||||
'server/status/processes': './js/src/server/status/processes.js',
|
||||
'server/privileges': { import: './js/src/server/privileges.js', dependOn: 'common' },
|
||||
'server/status/monitor': { import: './js/src/server/status/monitor.js', dependOn: 'common' },
|
||||
'server/status/processes': { import: './js/src/server/status/processes.js', dependOn: 'common' },
|
||||
'server/status/queries': './js/src/server/status/queries.js',
|
||||
'server/status/sorter': './js/src/server/status/sorter.js',
|
||||
'server/status/variables': './js/src/server/status/variables.js',
|
||||
'server/user_groups': './js/src/server/user_groups.js',
|
||||
'server/variables': './js/src/server/variables.js',
|
||||
'server/variables': { import: './js/src/server/variables.js', dependOn: 'common' },
|
||||
'setup/ajax': './js/src/setup/ajax.js',
|
||||
'setup/scripts': './js/src/setup/scripts.js',
|
||||
'shortcuts_handler': './js/src/shortcuts_handler.js',
|
||||
'sql': './js/src/sql.js',
|
||||
'shortcuts_handler': { import: './js/src/shortcuts_handler.js', dependOn: 'common' },
|
||||
'sql': { import: './js/src/sql.js', dependOn: 'common' },
|
||||
'table/change': './js/src/table/change.js',
|
||||
'table/chart': './js/src/table/chart.js',
|
||||
'table/find_replace': './js/src/table/find_replace.js',
|
||||
'table/gis_visualization': './js/src/table/gis_visualization.js',
|
||||
'table/operations': './js/src/table/operations.js',
|
||||
'table/relation': './js/src/table/relation.js',
|
||||
'table/select': './js/src/table/select.js',
|
||||
'table/structure': './js/src/table/structure.js',
|
||||
'table/tracking': './js/src/table/tracking.js',
|
||||
'table/zoom_plot_jqplot': './js/src/table/zoom_plot_jqplot.js',
|
||||
'table/operations': { import: './js/src/table/operations.js', dependOn: 'common' },
|
||||
'table/relation': { import: './js/src/table/relation.js', dependOn: 'common' },
|
||||
'table/select': { import: './js/src/table/select.js', dependOn: 'common' },
|
||||
'table/structure': { import: './js/src/table/structure.js', dependOn: 'common' },
|
||||
'table/tracking': { import: './js/src/table/tracking.js', dependOn: 'common' },
|
||||
'table/zoom_plot_jqplot': { import: './js/src/table/zoom_plot_jqplot.js', dependOn: 'common' },
|
||||
'transformations/image_upload': './js/src/transformations/image_upload.js',
|
||||
'transformations/json': './js/src/transformations/json.js',
|
||||
'transformations/json_editor': './js/src/transformations/json_editor.js',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user