From 5f4db91d71502b8f4971e12cb69baeb686b45ff1 Mon Sep 17 00:00:00 2001 From: Piyush Vijay Date: Sun, 19 Aug 2018 13:48:06 +0530 Subject: [PATCH] Resolve merge conflicts and add tbl import and export in modular code Signed-Off-By: Piyush Vijay --- js/functions.js | 209 ------------------------- js/src/consts/files.js | 4 +- js/src/functions/Table/Relation.js | 1 + js/src/functions/Table/TableChange.js | 2 +- js/src/functions/Table/TableChart.js | 1 + js/src/functions/Table/TableColumns.js | 1 + js/src/functions/Table/TableSelect.js | 2 + js/src/tbl_change.js | 2 +- js/src/tbl_select.js | 2 +- js/src/tbl_tracking.js | 2 +- js/src/utils/DateTime.js | 2 +- tbl_export.php | 2 +- tbl_import.php | 2 +- 13 files changed, 15 insertions(+), 217 deletions(-) diff --git a/js/functions.js b/js/functions.js index f677ddc58e..be524b83b4 100644 --- a/js/functions.js +++ b/js/functions.js @@ -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 = $('

'); -// $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