Resolve merge conflicts and add tbl import and export in modular code

Signed-Off-By: Piyush Vijay <piyushvijay.1997@gmail.com>
This commit is contained in:
Piyush Vijay 2018-08-19 13:48:06 +05:30
parent 0ce9714c19
commit 5f4db91d71
No known key found for this signature in database
GPG Key ID: FC77A75558658D35
13 changed files with 15 additions and 217 deletions

View File

@ -87,128 +87,6 @@ $.ajaxPrefilter(function (options, originalOptions, jqXHR) {
}
});
// /*
// * Adds a date/time picker to an element
// *
// * @param object $this_element a jQuery object pointing to the element
// */
// function PMA_addDatepicker ($this_element, type, options) {
// var showTimepicker = true;
// if (type === 'date') {
// showTimepicker = false;
// }
// var defaultOptions = {
// showOn: 'button',
// buttonImage: themeCalendarImage, // defined in js/messages.php
// buttonImageOnly: true,
// stepMinutes: 1,
// stepHours: 1,
// showSecond: true,
// showMillisec: true,
// showMicrosec: true,
// showTimepicker: showTimepicker,
// showButtonPanel: false,
// dateFormat: 'yy-mm-dd', // yy means year with four digits
// timeFormat: 'HH:mm:ss.lc',
// constrainInput: false,
// altFieldTimeOnly: false,
// showAnim: '',
// beforeShow: function (input, inst) {
// // Remember that we came from the datepicker; this is used
// // in tbl_change.js by verificationsAfterFieldChange()
// $this_element.data('comes_from', 'datepicker');
// if ($(input).closest('.cEdit').length > 0) {
// setTimeout(function () {
// inst.dpDiv.css({
// top: 0,
// left: 0,
// position: 'relative'
// });
// }, 0);
// }
// setTimeout(function () {
// // Fix wrong timepicker z-index, doesn't work without timeout
// $('#ui-timepicker-div').css('z-index', $('#ui-datepicker-div').css('z-index'));
// // Integrate tooltip text into dialog
// var tooltip = $this_element.tooltip('instance');
// if (typeof tooltip !== 'undefined') {
// tooltip.disable();
// var $note = $('<p class="note"></div>');
// $note.text(tooltip.option('content'));
// $('div.ui-datepicker').append($note);
// }
// }, 0);
// },
// onSelect: function () {
// $this_element.data('datepicker').inline = true;
// },
// onClose: function (dateText, dp_inst) {
// // The value is no more from the date picker
// $this_element.data('comes_from', '');
// if (typeof $this_element.data('datepicker') !== 'undefined') {
// $this_element.data('datepicker').inline = false;
// }
// var tooltip = $this_element.tooltip('instance');
// if (typeof tooltip !== 'undefined') {
// tooltip.enable();
// }
// }
// };
// if (type === 'time') {
// $this_element.timepicker($.extend(defaultOptions, options));
// // Add a tip regarding entering MySQL allowed-values for TIME data-type
// PMA_tooltip($this_element, 'input', PMA_messages.strMysqlAllowedValuesTipTime);
// } else {
// $this_element.datetimepicker($.extend(defaultOptions, options));
// }
// }
// /**
// * Add a date/time picker to each element that needs it
// * (only when jquery-ui-timepicker-addon.js is loaded)
// */
// function addDateTimePicker () {
// if ($.timepicker !== undefined) {
// $('input.timefield, input.datefield, input.datetimefield').each(function () {
// var decimals = $(this).parent().attr('data-decimals');
// var type = $(this).parent().attr('data-type');
// var showMillisec = false;
// var showMicrosec = false;
// var timeFormat = 'HH:mm:ss';
// var hourMax = 23;
// // check for decimal places of seconds
// if (decimals > 0 && type.indexOf('time') !== -1) {
// if (decimals > 3) {
// showMillisec = true;
// showMicrosec = true;
// timeFormat = 'HH:mm:ss.lc';
// } else {
// showMillisec = true;
// timeFormat = 'HH:mm:ss.l';
// }
// }
// if (type === 'time') {
// hourMax = 99;
// }
// PMA_addDatepicker($(this), type, {
// showMillisec: showMillisec,
// showMicrosec: showMicrosec,
// timeFormat: timeFormat,
// hourMax: hourMax
// });
// // Add a tip regarding entering MySQL allowed-values
// // for TIME and DATE data-type
// if ($(this).hasClass('timefield')) {
// PMA_tooltip($(this), 'input', PMA_messages.strMysqlAllowedValuesTipTime);
// } else if ($(this).hasClass('datefield')) {
// PMA_tooltip($(this), 'input', PMA_messages.strMysqlAllowedValuesTipDate);
// }
// });
// }
// }
/**
* Handle redirect and reload flags sent as part of AJAX requests
*
@ -999,93 +877,6 @@ AJAX.registerOnload('functions.js', function () {
updateTimeout = window.setTimeout(UpdateIdleTime, interval);
}
});
// /**
// * Unbind all event handlers before tearing down a page
// */
// AJAX.registerTeardown('functions.js', function () {
// $(document).off('click', 'input:checkbox.checkall');
// });
// AJAX.registerOnload('functions.js', function () {
// /**
// * Row marking in horizontal mode (use "on" so that it works also for
// * next pages reached via AJAX); a tr may have the class noclick to remove
// * this behavior.
// */
// $(document).on('click', 'input:checkbox.checkall', function (e) {
// $this = $(this);
// var $tr = $this.closest('tr');
// var $table = $this.closest('table');
// if (!e.shiftKey || last_clicked_row === -1) {
// // usual click
// var $checkbox = $tr.find(':checkbox.checkall');
// var checked = $this.prop('checked');
// $checkbox.prop('checked', checked).trigger('change');
// if (checked) {
// $tr.addClass('marked');
// } else {
// $tr.removeClass('marked');
// }
// last_click_checked = checked;
// // remember the last clicked row
// last_clicked_row = last_click_checked ? $table.find('tr:not(.noclick)').index($tr) : -1;
// last_shift_clicked_row = -1;
// } else {
// // handle the shift click
// PMA_clearSelection();
// var start;
// var end;
// // clear last shift click result
// if (last_shift_clicked_row >= 0) {
// if (last_shift_clicked_row >= last_clicked_row) {
// start = last_clicked_row;
// end = last_shift_clicked_row;
// } else {
// start = last_shift_clicked_row;
// end = last_clicked_row;
// }
// $tr.parent().find('tr:not(.noclick)')
// .slice(start, end + 1)
// .removeClass('marked')
// .find(':checkbox')
// .prop('checked', false)
// .trigger('change');
// }
// // handle new shift click
// var curr_row = $table.find('tr:not(.noclick)').index($tr);
// if (curr_row >= last_clicked_row) {
// start = last_clicked_row;
// end = curr_row;
// } else {
// start = curr_row;
// end = last_clicked_row;
// }
// $tr.parent().find('tr:not(.noclick)')
// .slice(start, end)
// .addClass('marked')
// .find(':checkbox')
// .prop('checked', true)
// .trigger('change');
// // remember the last shift clicked row
// last_shift_clicked_row = curr_row;
// }
// });
// addDateTimePicker();
// /**
// * Add attribute to text boxes for iOS devices (based on bugID: 3508912)
// */
// if (navigator.userAgent.match(/(iphone|ipod|ipad)/i)) {
// $('input[type=text]').attr('autocapitalize', 'off').attr('autocorrect', 'off');
// }
// });
/**
* Checks/unchecks all options of a <select> element

View File

@ -43,7 +43,9 @@ const PhpToJsFileMapping = {
tbl_change: ['sql', 'tbl_change'],
tbl_select: ['sql', 'tbl_change', 'tbl_select'],
tbl_zoom_select: ['sql', 'tbl_change'],
tbl_find_replace: ['tbl_find_replace']
tbl_find_replace: ['tbl_find_replace'],
tbl_import: ['import'],
tbl_export: ['export']
};
const JsFileList = [

View File

@ -1,3 +1,4 @@
import { $ } from '../../utils/JqueryExtended';
import { escapeHtml } from '../../utils/Sanitise';
import PMA_commonParams from '../../variables/common_params';
import { PMA_ajaxShowMessage, PMA_ajaxRemoveMessage } from '../../utils/show_ajax_messages';

View File

@ -1,5 +1,5 @@
import { $ } from '../../utils/JqueryExtended';
import { PMA_Messages as PMA_messages } from '../../variables/export_variables';
import { $ } from '../../utils/extend_jquery';
/**
* Modify form controls when the "NULL" checkbox is checked

View File

@ -1,3 +1,4 @@
import { $ } from '../../utils/JqueryExtended';
import JQPlotChartFactory, { DataTable, ColumnType } from '../../classes/Chart';
import { escapeHtml } from '../../utils/Sanitise';
import { PMA_Messages as PMA_messages } from '../../variables/export_variables';

View File

@ -1,3 +1,4 @@
import { $ } from '../../utils/JqueryExtended';
/**
* Hides/shows the "Open in ENUM/SET editor" message, depending on the data type of the column currently selected
*/

View File

@ -1,3 +1,5 @@
import { $ } from '../../utils/JqueryExtended';
export function changeValueFieldType (elem, searchIndex) {
var fieldsValue = $('select#fieldID_' + searchIndex);
if (0 === fieldsValue.size()) {

View File

@ -1,4 +1,5 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
import { $, extendingValidatorMessages } from './utils/JqueryExtended';
import {
isDate,
isTime,
@ -8,7 +9,6 @@ import {
import { PMA_Messages as PMA_messages } from './variables/export_variables';
import { addDateTimePicker } from './utils/DateTime';
import { AJAX } from './ajax';
import { $, extendingValidatorMessages } from './utils/extend_jquery';
/**
* @fileoverview function used in table data manipulation pages

View File

@ -1,4 +1,5 @@
/* vim: set expandtab sw=4 ts=4 sts=4: */
import { $ } from './utils/JqueryExtended';
import { PMA_Messages as PMA_messages } from './variables/export_variables';
import {
changeValueFieldType,
@ -9,7 +10,6 @@ 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 { $ } from './utils/extend_jquery';
import { PMA_commonParams } from './variables/common_params';
/**

View File

@ -1,4 +1,4 @@
import { $ } from './utils/extend_jquery';
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';

View File

@ -1,6 +1,6 @@
import { $ } from './JqueryExtended';
import { PMA_Messages as PMA_messages } from '../variables/export_variables';
import { PMA_tooltip } from './show_ajax_messages';
import { $ } from './extend_jquery';
/*
* Adds a date/time picker to an element
*

View File

@ -22,7 +22,7 @@ PageSettings::showGroup('Export');
$response = Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('export.js');
$scripts->addFile('export');
// Get the relation settings
$relation = new Relation();

View File

@ -21,7 +21,7 @@ PageSettings::showGroup('Import');
$response = Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
$scripts->addFile('import.js');
$scripts->addFile('import');
$import = new Import();