Some code structuring for table related files.
Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
This commit is contained in:
parent
181bfb5849
commit
bb72bc2ddc
@ -1,5 +1,11 @@
|
||||
import PMA_commonParams from '../../variables/common_params';
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
|
||||
/**
|
||||
* Module import
|
||||
*/
|
||||
import CommonParams from '../../variables/common_params';
|
||||
import { PMA_Messages as PMA_messages } from '../../variables/export_variables';
|
||||
|
||||
/**
|
||||
* Check if a form's element is empty.
|
||||
* An element containing only spaces is also considered empty
|
||||
@ -81,7 +87,7 @@ export function PMA_checkReservedWordColumns ($form) {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'tbl_structure.php',
|
||||
data: $form.serialize() + PMA_commonParams.get('arg_separator') + 'reserved_word_check=1',
|
||||
data: $form.serialize() + CommonParams.get('arg_separator') + 'reserved_word_check=1',
|
||||
success: function (data) {
|
||||
if (typeof data.success !== 'undefined' && data.success === true) {
|
||||
is_confirmed = confirm(data.message);
|
||||
|
||||
@ -1,7 +1,13 @@
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
|
||||
/**
|
||||
* Module import
|
||||
*/
|
||||
import { $ } from '../../utils/JqueryExtended';
|
||||
import CommonParams from '../../variables/common_params';
|
||||
import { escapeHtml } from '../../utils/Sanitise';
|
||||
import PMA_commonParams from '../../variables/common_params';
|
||||
import { PMA_ajaxShowMessage, PMA_ajaxRemoveMessage } from '../../utils/show_ajax_messages';
|
||||
|
||||
/**
|
||||
* for tbl_relation.php
|
||||
*
|
||||
@ -74,7 +80,7 @@ export function getDropdownValues ($dropdown) {
|
||||
}
|
||||
var $msgbox = PMA_ajaxShowMessage();
|
||||
var $form = $dropdown.parents('form');
|
||||
var argsep = PMA_commonParams.get('arg_separator');
|
||||
var argsep = CommonParams.get('arg_separator');
|
||||
var url = 'tbl_relation.php?getDropdownValues=true' + argsep + 'ajax_request=true' +
|
||||
argsep + 'db=' + $form.find('input[name="db"]').val() +
|
||||
argsep + 'table=' + $form.find('input[name="table"]').val() +
|
||||
|
||||
@ -1,3 +1,8 @@
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
|
||||
/**
|
||||
* Module import
|
||||
*/
|
||||
import { $ } from '../../utils/JqueryExtended';
|
||||
import { PMA_Messages as PMA_messages } from '../../variables/export_variables';
|
||||
|
||||
@ -65,13 +70,13 @@ function fractionReplace (num) {
|
||||
return num >= 1 && num <= 9 ? '0' + num : '00';
|
||||
}
|
||||
|
||||
/* function to check the validity of date
|
||||
* The following patterns are accepted in this validation (accepted in mysql as well)
|
||||
* 1) 2001-12-23
|
||||
* 2) 2001-1-2
|
||||
* 3) 02-12-23
|
||||
* 4) And instead of using '-' the following punctuations can be used (+,.,*,^,@,/) All these are accepted by mysql as well. Therefore no issues
|
||||
*/
|
||||
/** function to check the validity of date
|
||||
* The following patterns are accepted in this validation (accepted in mysql as well)
|
||||
* 1) 2001-12-23
|
||||
* 2) 2001-1-2
|
||||
* 3) 02-12-23
|
||||
* 4) And instead of using '-' the following punctuations can be used (+,.,*,^,@,/) All these are accepted by mysql as well. Therefore no issues
|
||||
*/
|
||||
export function isDate (val, tmstmp) {
|
||||
val = val.replace(/[.|*|^|+|//|@]/g, '-');
|
||||
var arrayVal = val.split('-');
|
||||
@ -110,12 +115,12 @@ export function isDate (val, tmstmp) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* function to check the validity of time
|
||||
* The following patterns are accepted in this validation (accepted in mysql as well)
|
||||
* 1) 2:3:4
|
||||
* 2) 2:23:43
|
||||
* 3) 2:23:43.123456
|
||||
*/
|
||||
/** function to check the validity of time
|
||||
* The following patterns are accepted in this validation (accepted in mysql as well)
|
||||
* 1) 2:3:4
|
||||
* 2) 2:23:43
|
||||
* 3) 2:23:43.123456
|
||||
*/
|
||||
export function isTime (val) {
|
||||
var arrayVal = val.split(':');
|
||||
for (var a = 0, l = arrayVal.length; a < l; a++) {
|
||||
|
||||
@ -1,3 +1,8 @@
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
|
||||
/**
|
||||
* Module import
|
||||
*/
|
||||
import { $ } from '../../utils/JqueryExtended';
|
||||
import JQPlotChartFactory, { DataTable, ColumnType } from '../../classes/Chart';
|
||||
import { escapeHtml } from '../../utils/Sanitise';
|
||||
|
||||
@ -1,4 +1,10 @@
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
|
||||
/**
|
||||
* Module import
|
||||
*/
|
||||
import { $ } from '../../utils/JqueryExtended';
|
||||
|
||||
/**
|
||||
* Hides/shows the "Open in ENUM/SET editor" message, depending on the data type of the column currently selected
|
||||
*/
|
||||
|
||||
@ -1,3 +1,8 @@
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
|
||||
/**
|
||||
* Module import
|
||||
*/
|
||||
import { $ } from '../../utils/JqueryExtended';
|
||||
|
||||
export function changeValueFieldType (elem, searchIndex) {
|
||||
|
||||
28
js/src/functions/Table/TableStructure.js
Normal file
28
js/src/functions/Table/TableStructure.js
Normal file
@ -0,0 +1,28 @@
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
|
||||
/**
|
||||
* Module import
|
||||
*/
|
||||
import CommonParams from '../../variables/common_params';
|
||||
|
||||
/**
|
||||
* Reload fields table
|
||||
*/
|
||||
export function reloadFieldForm () {
|
||||
$.post($('#fieldsForm').attr('action'), $('#fieldsForm').serialize() + CommonParams.get('arg_separator') + 'ajax_request=true', function (form_data) {
|
||||
var $temp_div = $('<div id=\'temp_div\'><div>').append(form_data.message);
|
||||
$('#fieldsForm').replaceWith($temp_div.find('#fieldsForm'));
|
||||
$('#addColumns').replaceWith($temp_div.find('#addColumns'));
|
||||
$('#move_columns_dialog').find('ul').replaceWith($temp_div.find('#move_columns_dialog ul'));
|
||||
$('#moveColumns').removeClass('move-active');
|
||||
});
|
||||
$('#page_content').show();
|
||||
}
|
||||
|
||||
export function checkFirst () {
|
||||
if ($('select[name=after_field] option:selected').data('pos') === 'first') {
|
||||
$('input[name=field_where]').val('first');
|
||||
} else {
|
||||
$('input[name=field_where]').val('after');
|
||||
}
|
||||
}
|
||||
@ -1,14 +1,13 @@
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
|
||||
/**
|
||||
* Module import
|
||||
*/
|
||||
import { $, extendingValidatorMessages } from './utils/JqueryExtended';
|
||||
import {
|
||||
isDate,
|
||||
isTime,
|
||||
nullify,
|
||||
verificationsAfterFieldChange
|
||||
} from './functions/Table/TableChange';
|
||||
import { AJAX } from './ajax';
|
||||
import * as TableChange from './functions/Table/TableChange';
|
||||
import { PMA_Messages as PMA_messages } from './variables/export_variables';
|
||||
import { addDateTimePicker } from './utils/DateTime';
|
||||
import { AJAX } from './ajax';
|
||||
|
||||
/**
|
||||
* @fileoverview function used in table data manipulation pages
|
||||
@ -60,9 +59,9 @@ export function onloadTblChange () {
|
||||
var dt_value = value;
|
||||
var theType = options;
|
||||
if (theType === 'date') {
|
||||
return isDate(dt_value);
|
||||
return TableChange.isDate(dt_value);
|
||||
} else if (theType === 'time') {
|
||||
return isTime(dt_value);
|
||||
return TableChange.isTime(dt_value);
|
||||
} else if (theType === 'datetime' || theType === 'timestamp') {
|
||||
var tmstmp = false;
|
||||
dt_value = dt_value.trim();
|
||||
@ -77,11 +76,11 @@ export function onloadTblChange () {
|
||||
}
|
||||
var dv = dt_value.indexOf(' ');
|
||||
if (dv === -1) { // Only the date component, which is valid
|
||||
return isDate(dt_value, tmstmp);
|
||||
return TableChange.isDate(dt_value, tmstmp);
|
||||
}
|
||||
|
||||
return isDate(dt_value.substring(0, dv), tmstmp) &&
|
||||
isTime(dt_value.substring(dv + 1));
|
||||
return TableChange.isDate(dt_value.substring(0, dv), tmstmp) &&
|
||||
TableChange.isTime(dt_value.substring(dv + 1));
|
||||
}
|
||||
});
|
||||
/*
|
||||
@ -137,7 +136,7 @@ export function onloadTblChange () {
|
||||
*
|
||||
*/
|
||||
$(document).on('click', 'input.checkbox_null', function () {
|
||||
nullify(
|
||||
TableChange.nullify(
|
||||
// use hidden fields populated by tbl_change.php
|
||||
$(this).siblings('.nullify_code').val(),
|
||||
$(this).closest('tr').find('input:hidden').first().val(),
|
||||
@ -264,7 +263,7 @@ export function onloadTblChange () {
|
||||
.data('new_row_index', new_row_index)
|
||||
.on('change', function () {
|
||||
var $changed_element = $(this);
|
||||
verificationsAfterFieldChange(
|
||||
TableChange.verificationsAfterFieldChange(
|
||||
$changed_element.data('hashed_field'),
|
||||
$changed_element.data('new_row_index'),
|
||||
$changed_element.closest('tr').find('span.column_type').html()
|
||||
@ -283,7 +282,7 @@ export function onloadTblChange () {
|
||||
.data('new_row_index', new_row_index)
|
||||
.on('click', function () {
|
||||
var $changed_element = $(this);
|
||||
nullify(
|
||||
TableChange.nullify(
|
||||
$changed_element.siblings('.nullify_code').val(),
|
||||
$this_element.closest('tr').find('input:hidden').first().val(),
|
||||
$changed_element.data('hashed_field'),
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
|
||||
/**
|
||||
* Module import
|
||||
*/
|
||||
import { TableChartEnum,
|
||||
drawChart,
|
||||
onDataSeriesChange,
|
||||
|
||||
@ -1,4 +1,9 @@
|
||||
import { PMA_Messages as PMA_messages } from './variables/export_variables';
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
|
||||
/**
|
||||
* Module import
|
||||
*/
|
||||
import { PMA_Messages as messages } from './variables/export_variables';
|
||||
import { PMA_prepareForAjaxRequest } from './functions/AjaxRequest';
|
||||
import { PMA_ajaxRemoveMessage, PMA_ajaxShowMessage } from './utils/show_ajax_messages';
|
||||
|
||||
@ -19,14 +24,14 @@ export function onloadTblFindReplace () {
|
||||
.hide();
|
||||
|
||||
$('#toggle_find')
|
||||
.html(PMA_messages.strHideFindNReplaceCriteria)
|
||||
.html(messages.strHideFindNReplaceCriteria)
|
||||
.on('click', function () {
|
||||
var $link = $(this);
|
||||
$('#find_replace_form').slideToggle();
|
||||
if ($link.text() === PMA_messages.strHideFindNReplaceCriteria) {
|
||||
$link.text(PMA_messages.strShowFindNReplaceCriteria);
|
||||
if ($link.text() === messages.strHideFindNReplaceCriteria) {
|
||||
$link.text(messages.strShowFindNReplaceCriteria);
|
||||
} else {
|
||||
$link.text(PMA_messages.strHideFindNReplaceCriteria);
|
||||
$link.text(messages.strHideFindNReplaceCriteria);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
@ -1,4 +1,9 @@
|
||||
import { PMA_Messages as PMA_messages } from './variables/export_variables';
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
|
||||
/**
|
||||
* Module import
|
||||
*/
|
||||
import { PMA_Messages as messages } from './variables/export_variables';
|
||||
import PMA_commonParams from './variables/common_params';
|
||||
import { PMA_commonActions } from './classes/CommonActions';
|
||||
import { PMA_ajaxShowMessage, PMA_ajaxRemoveMessage } from './utils/show_ajax_messages';
|
||||
@ -98,7 +103,7 @@ export function onloadTblOperations () {
|
||||
var $tblCollationField = $form.find('select[name=tbl_collation]');
|
||||
var collationOrigValue = $('select[name="tbl_collation"] option[selected]').val();
|
||||
var $changeAllColumnCollationsCheckBox = $('#checkbox_change_all_collations');
|
||||
var question = PMA_messages.strChangeAllColumnCollationsWarning;
|
||||
var question = messages.strChangeAllColumnCollationsWarning;
|
||||
|
||||
if ($tblNameField.val() !== $tblNameField[0].defaultValue) {
|
||||
// reload page and navigation if the table has been renamed
|
||||
@ -210,18 +215,18 @@ export function onloadTblOperations () {
|
||||
function submitPartitionMaintenance () {
|
||||
var argsep = PMA_commonParams.get('arg_separator');
|
||||
var submitData = $form.serialize() + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true';
|
||||
PMA_ajaxShowMessage(PMA_messages.strProcessingRequest);
|
||||
PMA_ajaxShowMessage(messages.strProcessingRequest);
|
||||
AJAX.source = $form;
|
||||
$.post($form.attr('action'), submitData, AJAX.responseHandler);
|
||||
}
|
||||
|
||||
if ($('#partition_operation_DROP').is(':checked')) {
|
||||
let question = PMA_messages.strDropPartitionWarning;
|
||||
let question = messages.strDropPartitionWarning;
|
||||
$form.PMA_confirm(question, $form.attr('action'), function () {
|
||||
submitPartitionMaintenance();
|
||||
});
|
||||
} else if ($('#partition_operation_TRUNCATE').is(':checked')) {
|
||||
let question = PMA_messages.strTruncatePartitionWarning;
|
||||
let question = messages.strTruncatePartitionWarning;
|
||||
$form.PMA_confirm(question, $form.attr('action'), function () {
|
||||
submitPartitionMaintenance();
|
||||
});
|
||||
@ -236,14 +241,14 @@ export function onloadTblOperations () {
|
||||
/**
|
||||
* @var question String containing the question to be asked for confirmation
|
||||
*/
|
||||
var question = PMA_messages.strDropTableStrongWarning + ' ';
|
||||
var question = messages.strDropTableStrongWarning + ' ';
|
||||
question += PMA_sprintf(
|
||||
PMA_messages.strDoYouReally,
|
||||
messages.strDoYouReally,
|
||||
'DROP TABLE `' + escapeHtml(PMA_commonParams.get('db')) + '`.`' + escapeHtml(PMA_commonParams.get('table') + '`')
|
||||
) + getForeignKeyCheckboxLoader();
|
||||
|
||||
$(this).PMA_confirm(question, $(this).attr('href'), function (url) {
|
||||
var $msgbox = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest);
|
||||
var $msgbox = PMA_ajaxShowMessage(messages.strProcessingRequest);
|
||||
|
||||
var params = getJSConfirmCommonParam(this, $link.getPostData());
|
||||
|
||||
@ -271,14 +276,14 @@ export function onloadTblOperations () {
|
||||
/**
|
||||
* @var question String containing the question to be asked for confirmation
|
||||
*/
|
||||
var question = PMA_messages.strDropTableStrongWarning + ' ';
|
||||
var question = messages.strDropTableStrongWarning + ' ';
|
||||
question += PMA_sprintf(
|
||||
PMA_messages.strDoYouReally,
|
||||
messages.strDoYouReally,
|
||||
'DROP VIEW `' + escapeHtml(PMA_commonParams.get('table') + '`')
|
||||
);
|
||||
|
||||
$(this).PMA_confirm(question, $(this).attr('href'), function (url) {
|
||||
var $msgbox = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest);
|
||||
var $msgbox = PMA_ajaxShowMessage(messages.strProcessingRequest);
|
||||
var params = {
|
||||
'is_js_confirmed': '1',
|
||||
'ajax_request': true
|
||||
@ -308,13 +313,13 @@ export function onloadTblOperations () {
|
||||
/**
|
||||
* @var question String containing the question to be asked for confirmation
|
||||
*/
|
||||
var question = PMA_messages.strTruncateTableStrongWarning + ' ';
|
||||
var question = messages.strTruncateTableStrongWarning + ' ';
|
||||
question += PMA_sprintf(
|
||||
PMA_messages.strDoYouReally,
|
||||
messages.strDoYouReally,
|
||||
'TRUNCATE `' + escapeHtml(PMA_commonParams.get('db')) + '`.`' + escapeHtml(PMA_commonParams.get('table') + '`')
|
||||
) + getForeignKeyCheckboxLoader();
|
||||
$(this).PMA_confirm(question, $(this).attr('href'), function (url) {
|
||||
PMA_ajaxShowMessage(PMA_messages.strProcessingRequest);
|
||||
PMA_ajaxShowMessage(messages.strProcessingRequest);
|
||||
|
||||
var params = getJSConfirmCommonParam(this, $link.getPostData());
|
||||
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
import { PMA_Messages as PMA_messages } from './variables/export_variables';
|
||||
|
||||
/**
|
||||
* Module import
|
||||
*/
|
||||
import { PMA_Messages as messages } from './variables/export_variables';
|
||||
import { PMA_ajaxShowMessage, PMA_ajaxRemoveMessage } from './utils/show_ajax_messages';
|
||||
import { escapeHtml } from './utils/Sanitise';
|
||||
import { PMA_commonActions } from './classes/CommonActions';
|
||||
@ -112,10 +116,10 @@ export function onloadTblRelation () {
|
||||
.val()
|
||||
);
|
||||
|
||||
var question = PMA_sprintf(PMA_messages.strDoYouReally, drop_query);
|
||||
var question = PMA_sprintf(messages.strDoYouReally, drop_query);
|
||||
|
||||
$anchor.PMA_confirm(question, $anchor.attr('href'), function (url) {
|
||||
var $msg = PMA_ajaxShowMessage(PMA_messages.strDroppingForeignKey, false);
|
||||
var $msg = PMA_ajaxShowMessage(messages.strDroppingForeignKey, false);
|
||||
var params = getJSConfirmCommonParam(this, $anchor.getPostData());
|
||||
$.post(url, params, function (data) {
|
||||
if (data.success === true) {
|
||||
@ -124,7 +128,7 @@ export function onloadTblRelation () {
|
||||
// Do nothing
|
||||
});
|
||||
} else {
|
||||
PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest + ' : ' + data.error, false);
|
||||
PMA_ajaxShowMessage(messages.strErrorProcessingRequest + ' : ' + data.error, false);
|
||||
}
|
||||
}); // end $.post()
|
||||
}); // end $.PMA_confirm()
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
|
||||
/**
|
||||
* Module import
|
||||
*/
|
||||
import { $ } from './utils/JqueryExtended';
|
||||
import { PMA_Messages as PMA_messages } from './variables/export_variables';
|
||||
import { PMA_Messages as messages } from './variables/export_variables';
|
||||
import {
|
||||
changeValueFieldType,
|
||||
PMA_checkIfDataTypeNumericOrDate
|
||||
@ -10,7 +14,7 @@ import { PMA_prepareForAjaxRequest } from './functions/AjaxRequest';
|
||||
import { PMA_init_slider } from './utils/Slider';
|
||||
import { PMA_highlightSQL } from './utils/sql';
|
||||
import { PMA_addDatepicker } from './utils/DateTime';
|
||||
import { PMA_commonParams } from './variables/common_params';
|
||||
import CommonParams from './variables/common_params';
|
||||
|
||||
/**
|
||||
* @fileoverview JavaScript functions used on tbl_select.php
|
||||
@ -48,14 +52,14 @@ export function onloadTblSelect () {
|
||||
.hide();
|
||||
|
||||
$('#togglesearchformlink')
|
||||
.html(PMA_messages.strShowSearchCriteria)
|
||||
.html(messages.strShowSearchCriteria)
|
||||
.on('click', function () {
|
||||
var $link = $(this);
|
||||
$('#tbl_search_form').slideToggle();
|
||||
if ($link.text() === PMA_messages.strHideSearchCriteria) {
|
||||
$link.text(PMA_messages.strShowSearchCriteria);
|
||||
if ($link.text() === messages.strHideSearchCriteria) {
|
||||
$link.text(messages.strShowSearchCriteria);
|
||||
} else {
|
||||
$link.text(PMA_messages.strHideSearchCriteria);
|
||||
$link.text(messages.strHideSearchCriteria);
|
||||
}
|
||||
// avoid default click action
|
||||
return false;
|
||||
@ -92,7 +96,7 @@ export function onloadTblSelect () {
|
||||
|
||||
// empty previous search results while we are waiting for new results
|
||||
$('#sqlqueryresultsouter').empty();
|
||||
var $msgbox = PMA_ajaxShowMessage(PMA_messages.strSearching, false);
|
||||
var $msgbox = PMA_ajaxShowMessage(messages.strSearching, false);
|
||||
|
||||
PMA_prepareForAjaxRequest($search_form);
|
||||
|
||||
@ -152,7 +156,7 @@ export function onloadTblSelect () {
|
||||
.hide();
|
||||
$('#togglesearchformlink')
|
||||
// always start with the Show message
|
||||
.text(PMA_messages.strShowSearchCriteria);
|
||||
.text(messages.strShowSearchCriteria);
|
||||
$('#togglesearchformdiv')
|
||||
// now it's time to show the div containing the link
|
||||
.show();
|
||||
@ -285,7 +289,7 @@ export function onloadTblSelect () {
|
||||
url: 'tbl_select.php',
|
||||
type: 'POST',
|
||||
data: {
|
||||
server: PMA_commonParams.get('server'),
|
||||
server: CommonParams.get('server'),
|
||||
ajax_request: 1,
|
||||
db: $('input[name="db"]').val(),
|
||||
table: $('input[name="table"]').val(),
|
||||
@ -297,16 +301,16 @@ export function onloadTblSelect () {
|
||||
if (response.success) {
|
||||
// Get the column min value.
|
||||
var min = response.column_data.min
|
||||
? '(' + PMA_messages.strColumnMin +
|
||||
? '(' + messages.strColumnMin +
|
||||
' ' + response.column_data.min + ')'
|
||||
: '';
|
||||
// Get the column max value.
|
||||
var max = response.column_data.max
|
||||
? '(' + PMA_messages.strColumnMax +
|
||||
? '(' + messages.strColumnMax +
|
||||
' ' + response.column_data.max + ')'
|
||||
: '';
|
||||
var button_options = {};
|
||||
button_options[PMA_messages.strGo] = function () {
|
||||
button_options[messages.strGo] = function () {
|
||||
var min_value = $('#min_value').val();
|
||||
var max_value = $('#max_value').val();
|
||||
var final_value = '';
|
||||
@ -347,7 +351,7 @@ export function onloadTblSelect () {
|
||||
}
|
||||
$(this).dialog('close');
|
||||
};
|
||||
button_options[PMA_messages.strCancel] = function () {
|
||||
button_options[messages.strCancel] = function () {
|
||||
$(this).dialog('close');
|
||||
};
|
||||
|
||||
@ -355,11 +359,11 @@ export function onloadTblSelect () {
|
||||
$('<div/>').append(
|
||||
'<fieldset>' +
|
||||
'<legend>' + operator + '</legend>' +
|
||||
'<label for="min_value">' + PMA_messages.strMinValue +
|
||||
'<label for="min_value">' + messages.strMinValue +
|
||||
'</label>' +
|
||||
'<input type="text" id="min_value" />' + '<br>' +
|
||||
'<span class="small_font">' + min + '</span>' + '<br>' +
|
||||
'<label for="max_value">' + PMA_messages.strMaxValue +
|
||||
'<label for="max_value">' + messages.strMaxValue +
|
||||
'</label>' +
|
||||
'<input type="text" id="max_value" />' + '<br>' +
|
||||
'<span class="small_font">' + max + '</span>' +
|
||||
@ -369,7 +373,7 @@ export function onloadTblSelect () {
|
||||
maxHeight: 400,
|
||||
modal: true,
|
||||
buttons: button_options,
|
||||
title: PMA_messages.strRangeSearch,
|
||||
title: messages.strRangeSearch,
|
||||
open: function () {
|
||||
// Add datepicker wherever required.
|
||||
PMA_addDatepicker($('#min_value'), data_type);
|
||||
@ -384,7 +388,7 @@ export function onloadTblSelect () {
|
||||
}
|
||||
},
|
||||
error: function (response) {
|
||||
PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest);
|
||||
PMA_ajaxShowMessage(messages.strErrorProcessingRequest);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
|
||||
/**
|
||||
* Module import
|
||||
*/
|
||||
import { PMA_Messages as PMA_messages } from './variables/export_variables';
|
||||
import Indexes from './utils/IndexEnum';
|
||||
import PMA_commonParams from './variables/common_params';
|
||||
import CommonParams from './variables/common_params';
|
||||
import { PMA_ajaxShowMessage, PMA_ajaxRemoveMessage } from './utils/show_ajax_messages';
|
||||
import { PMA_highlightSQL } from './utils/sql';
|
||||
import { PMA_prepareForAjaxRequest } from './functions/AjaxRequest';
|
||||
@ -13,6 +17,8 @@ import { escapeHtml } from './utils/Sanitise';
|
||||
import { AJAX } from './ajax';
|
||||
import { PMA_previewSQL } from './functions/Sql/PreviewSql';
|
||||
import { printPreview } from './functions/Print';
|
||||
import { reloadFieldForm, checkFirst } from './functions/Table/TableStructure';
|
||||
|
||||
/**
|
||||
* @fileoverview functions used on the table structure page
|
||||
* @name Table Structure
|
||||
@ -32,27 +38,7 @@ import { printPreview } from './functions/Print';
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Reload fields table
|
||||
*/
|
||||
function reloadFieldForm () {
|
||||
$.post($('#fieldsForm').attr('action'), $('#fieldsForm').serialize() + PMA_commonParams.get('arg_separator') + 'ajax_request=true', function (form_data) {
|
||||
var $temp_div = $('<div id=\'temp_div\'><div>').append(form_data.message);
|
||||
$('#fieldsForm').replaceWith($temp_div.find('#fieldsForm'));
|
||||
$('#addColumns').replaceWith($temp_div.find('#addColumns'));
|
||||
$('#move_columns_dialog').find('ul').replaceWith($temp_div.find('#move_columns_dialog ul'));
|
||||
$('#moveColumns').removeClass('move-active');
|
||||
});
|
||||
$('#page_content').show();
|
||||
}
|
||||
|
||||
function checkFirst () {
|
||||
if ($('select[name=after_field] option:selected').data('pos') === 'first') {
|
||||
$('input[name=field_where]').val('first');
|
||||
} else {
|
||||
$('input[name=field_where]').val('after');
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
@ -89,7 +75,7 @@ export function onloadTblStructure () {
|
||||
|
||||
function submitForm () {
|
||||
var $msg = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest);
|
||||
$.post($form.attr('action'), $form.serialize() + PMA_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) {
|
||||
@ -198,7 +184,7 @@ export function onloadTblStructure () {
|
||||
$this_anchor.PMA_confirm(question, $this_anchor.attr('href'), function (url) {
|
||||
var $msg = PMA_ajaxShowMessage(PMA_messages.strDroppingColumn, false);
|
||||
var params = getJSConfirmCommonParam(this, $this_anchor.getPostData());
|
||||
params += PMA_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) {
|
||||
PMA_ajaxRemoveMessage($msg);
|
||||
@ -284,7 +270,7 @@ export function onloadTblStructure () {
|
||||
AJAX.source = $this;
|
||||
|
||||
var params = getJSConfirmCommonParam(this, $this_anchor.getPostData());
|
||||
params += PMA_commonParams.get('arg_separator') + 'ajax_page_request=1';
|
||||
params += CommonParams.get('arg_separator') + 'ajax_page_request=1';
|
||||
$.post(url, params, AJAX.responseHandler);
|
||||
}); // end $.PMA_confirm()
|
||||
}); // end Add key
|
||||
@ -317,7 +303,7 @@ export function onloadTblStructure () {
|
||||
$this.dialog('close');
|
||||
return;
|
||||
}
|
||||
$.post($form.prop('action'), serialized + PMA_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) {
|
||||
PMA_ajaxRemoveMessage($msgbox);
|
||||
$this
|
||||
@ -423,7 +409,7 @@ export function onloadTblStructure () {
|
||||
e.preventDefault();
|
||||
var $button = $(this);
|
||||
var $form = $button.parents('form');
|
||||
var argsep = PMA_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();
|
||||
PMA_ajaxShowMessage();
|
||||
AJAX.source = $form;
|
||||
|
||||
@ -1,7 +1,12 @@
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
|
||||
/**
|
||||
* Module import
|
||||
*/
|
||||
import { $ } from './utils/JqueryExtended';
|
||||
import './plugins/jquery/jquery.tablesorter';
|
||||
import { PMA_Messages as PMA_messages } from './variables/export_variables';
|
||||
import PMA_commonParams from './variables/common_params';
|
||||
import CommonParams from './variables/common_params';
|
||||
import { PMA_ajaxShowMessage } from './utils/show_ajax_messages';
|
||||
import { AJAX } from './ajax';
|
||||
|
||||
@ -60,7 +65,7 @@ export function onloadTblTracking () {
|
||||
e.preventDefault();
|
||||
var $button = $(this);
|
||||
var $form = $button.parent('form');
|
||||
var argsep = PMA_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') {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user