Replace .change() with .on()
.change() event shorthand is deprecated Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
This commit is contained in:
parent
07591c963c
commit
f4fedc20ee
@ -742,7 +742,7 @@ AJAX.registerOnload('config.js', function () {
|
||||
if (ls_exists) {
|
||||
updatePrefsDate();
|
||||
}
|
||||
$('form.prefs-form').change(function () {
|
||||
$('form.prefs-form').on('change', function () {
|
||||
var $form = $(this);
|
||||
var disabled = false;
|
||||
if (!ls_supported) {
|
||||
|
||||
@ -152,7 +152,7 @@ var PMA_console = {
|
||||
PMA_console.hideCard($(this).closest('.card'));
|
||||
});
|
||||
|
||||
$('#pma_console_options').find('input[type=checkbox]').change(function () {
|
||||
$('#pma_console_options').find('input[type=checkbox]').on('change', function () {
|
||||
PMA_console.updateConfig();
|
||||
});
|
||||
|
||||
@ -165,7 +165,7 @@ var PMA_console = {
|
||||
PMA_console.updateConfig();
|
||||
});
|
||||
|
||||
$('#pma_console_options').find('input[name=enter_executes]').change(function () {
|
||||
$('#pma_console_options').find('input[name=enter_executes]').on('change', function () {
|
||||
PMA_consoleMessages.showInstructions(PMA_console.config.EnterExecutes);
|
||||
});
|
||||
|
||||
|
||||
@ -190,7 +190,7 @@ AJAX.registerOnload('db_central_columns.js', function () {
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#table-select').change(function (e) {
|
||||
$('#table-select').on('change', function (e) {
|
||||
var selectvalue = $(this).val();
|
||||
var default_column_select = $('#column-select').find('option:first');
|
||||
var href = 'db_central_columns.php';
|
||||
@ -228,7 +228,7 @@ AJAX.registerOnload('db_central_columns.js', function () {
|
||||
$('#add_new').submit(function (event) {
|
||||
$('#add_new').toggle();
|
||||
});
|
||||
$('#tableslistcontainer').find('select.default_type').change(function () {
|
||||
$('#tableslistcontainer').find('select.default_type').on('change', function () {
|
||||
if ($(this).val() === 'USER_DEFINED') {
|
||||
$(this).siblings('.default_value').attr('name','col_default');
|
||||
$(this).attr('name','col_default_sel');
|
||||
|
||||
@ -214,7 +214,7 @@ AJAX.registerOnload('db_structure.js', function () {
|
||||
/**
|
||||
* Event handler on select of "Make consistent with central list"
|
||||
*/
|
||||
$('select[name=submit_mult]').change(function (event) {
|
||||
$('select[name=submit_mult]').on('change', function (event) {
|
||||
if ($(this).val() === 'make_consistent_with_central_list') {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
@ -621,7 +621,7 @@ function Add_Other_db_tables () {
|
||||
}
|
||||
});
|
||||
|
||||
$('#add_table_from').change(function () {
|
||||
$('#add_table_from').on('change', function () {
|
||||
if ($(this).val()) {
|
||||
var db_name = $(this).val();
|
||||
var sql_query = 'SHOW tables;';
|
||||
@ -1093,7 +1093,7 @@ function Export_pages () {
|
||||
$form.append(input);
|
||||
});
|
||||
var $formatDropDown = $form.find('#plugins');
|
||||
$formatDropDown.change(function () {
|
||||
$formatDropDown.on('change', function () {
|
||||
var format = $formatDropDown.val();
|
||||
$form.find('.format_specific_options').hide();
|
||||
$form.find('#' + format + '_options').show();
|
||||
|
||||
30
js/export.js
30
js/export.js
@ -273,7 +273,7 @@ AJAX.registerOnload('export.js', function () {
|
||||
* Toggles the hiding and showing of each plugin's options
|
||||
* according to the currently selected plugin from the dropdown list
|
||||
*/
|
||||
$('#plugins').change(function () {
|
||||
$('#plugins').on('change', function () {
|
||||
$('#format_specific_opts').find('div.format_specific_options').hide();
|
||||
var selected_plugin_name = $('#plugins').find('option:selected').val();
|
||||
$('#' + selected_plugin_name + '_options').show();
|
||||
@ -282,7 +282,7 @@ AJAX.registerOnload('export.js', function () {
|
||||
/**
|
||||
* Toggles the enabling and disabling of the SQL plugin's comment options that apply only when exporting structure
|
||||
*/
|
||||
$('input[type=\'radio\'][name=\'sql_structure_or_data\']').change(function () {
|
||||
$('input[type=\'radio\'][name=\'sql_structure_or_data\']').on('change', function () {
|
||||
var comments_are_present = $('#checkbox_sql_include_comments').prop('checked');
|
||||
var show = $('input[type=\'radio\'][name=\'sql_structure_or_data\']:checked').val();
|
||||
if (show === 'data') {
|
||||
@ -309,13 +309,13 @@ AJAX.registerOnload('export.js', function () {
|
||||
});
|
||||
|
||||
// For separate-file exports only ZIP compression is allowed
|
||||
$('input[type="checkbox"][name="as_separate_files"]').change(function () {
|
||||
$('input[type="checkbox"][name="as_separate_files"]').on('change', function () {
|
||||
if ($(this).is(':checked')) {
|
||||
$('#compression').val('zip');
|
||||
}
|
||||
});
|
||||
|
||||
$('#compression').change(function () {
|
||||
$('#compression').on('change', function () {
|
||||
if ($('option:selected').val() !== 'zip') {
|
||||
$('input[type="checkbox"][name="as_separate_files"]').prop('checked', false);
|
||||
}
|
||||
@ -413,14 +413,14 @@ function toggle_save_to_file () {
|
||||
|
||||
AJAX.registerOnload('export.js', function () {
|
||||
toggle_save_to_file();
|
||||
$('input[type=\'radio\'][name=\'output_format\']').change(toggle_save_to_file);
|
||||
$('input[type=\'radio\'][name=\'output_format\']').on('change', toggle_save_to_file);
|
||||
});
|
||||
|
||||
/**
|
||||
* For SQL plugin, toggles the disabling of the "display comments" options
|
||||
*/
|
||||
function toggle_sql_include_comments () {
|
||||
$('#checkbox_sql_include_comments').change(function () {
|
||||
$('#checkbox_sql_include_comments').on('change', function () {
|
||||
var $ulIncludeComments = $('#ul_include_comments');
|
||||
if (!$('#checkbox_sql_include_comments').prop('checked')) {
|
||||
$ulIncludeComments.find('> li').fadeTo('fast', 0.4);
|
||||
@ -547,10 +547,10 @@ AJAX.registerOnload('export.js', function () {
|
||||
*/
|
||||
var $create = $('#checkbox_sql_create_table_statements');
|
||||
var $create_options = $('#ul_create_table_statements').find('input');
|
||||
$create.change(function () {
|
||||
$create.on('change', function () {
|
||||
$create_options.prop('checked', $(this).prop('checked'));
|
||||
});
|
||||
$create_options.change(function () {
|
||||
$create_options.on('change', function () {
|
||||
if ($create_options.is(':checked')) {
|
||||
$create.prop('checked', true);
|
||||
}
|
||||
@ -559,7 +559,7 @@ AJAX.registerOnload('export.js', function () {
|
||||
/**
|
||||
* Disables the view output as text option if the output must be saved as a file
|
||||
*/
|
||||
$('#plugins').change(function () {
|
||||
$('#plugins').on('change', function () {
|
||||
var active_plugin = $('#plugins').find('option:selected').val();
|
||||
var force_file = $('#force_file_' + active_plugin).val();
|
||||
if (force_file === 'true') {
|
||||
@ -648,7 +648,7 @@ AJAX.registerOnload('export.js', function () {
|
||||
/**
|
||||
* Handle force structure_or_data
|
||||
*/
|
||||
$('#plugins').change(setup_table_structure_or_data);
|
||||
$('#plugins').on('change', setup_table_structure_or_data);
|
||||
});
|
||||
|
||||
/**
|
||||
@ -731,7 +731,7 @@ function aliasSelectHandler (event) {
|
||||
$inputWrapper.replaceWith(newTag);
|
||||
}
|
||||
} else if (type === '_tables') {
|
||||
$('.table_alias_select:visible').change();
|
||||
$('.table_alias_select:visible').trigger('change');
|
||||
}
|
||||
$('#alias_modal').dialog('option', 'position', 'center');
|
||||
}
|
||||
@ -763,7 +763,7 @@ function createAliasModal (event) {
|
||||
var option = $('<option></option>');
|
||||
option.text(db);
|
||||
option.attr('value', db);
|
||||
$('#db_alias_select').append(option).val(db).change();
|
||||
$('#db_alias_select').append(option).val(db).trigger('change');
|
||||
} else {
|
||||
var params = {
|
||||
ajax_request : true,
|
||||
@ -833,7 +833,7 @@ function addAlias (type, name, field, value) {
|
||||
}
|
||||
|
||||
AJAX.registerOnload('export.js', function () {
|
||||
$('input[type=\'radio\'][name=\'quick_or_custom\']').change(toggle_quick_or_custom);
|
||||
$('input[type=\'radio\'][name=\'quick_or_custom\']').on('change', toggle_quick_or_custom);
|
||||
|
||||
$('#scroll_to_options_msg').hide();
|
||||
$('#format_specific_opts').find('div.format_specific_options')
|
||||
@ -859,7 +859,7 @@ AJAX.registerOnload('export.js', function () {
|
||||
/**
|
||||
* Disables the "Dump some row(s)" sub-options when it is not selected
|
||||
*/
|
||||
$('input[type=\'radio\'][name=\'allrows\']').change(function () {
|
||||
$('input[type=\'radio\'][name=\'allrows\']').on('change', function () {
|
||||
if ($('input[type=\'radio\'][name=\'allrows\']').prop('checked')) {
|
||||
enable_dump_some_rows_sub_options();
|
||||
} else {
|
||||
@ -880,7 +880,7 @@ AJAX.registerOnload('export.js', function () {
|
||||
var option = $('<option></option>');
|
||||
option.text(table);
|
||||
option.attr('value', table);
|
||||
$('#table_alias_select').append(option).val(table).change();
|
||||
$('#table_alias_select').append(option).val(table).trigger('change');
|
||||
} else {
|
||||
var params = {
|
||||
ajax_request : true,
|
||||
|
||||
@ -2985,7 +2985,7 @@ AJAX.registerOnload('functions.js', function () {
|
||||
col = col[0];
|
||||
var $selectFieldKey = $('select[name="field_key[' + col + ']"]');
|
||||
if ($selectFieldKey.val() === 'none_' + col) {
|
||||
$selectFieldKey.val('primary_' + col).change();
|
||||
$selectFieldKey.val('primary_' + col).trigger('change');
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -3306,7 +3306,7 @@ function autoPopulate (input_id, offset) {
|
||||
$input6.val(central_column_list[db + '_' + table][offset].col_extra);
|
||||
}
|
||||
if (central_column_list[db + '_' + table][offset].col_extra.toUpperCase() === 'AUTO_INCREMENT') {
|
||||
$('#' + input_id + '9').prop('checked',true).change();
|
||||
$('#' + input_id + '9').prop('checked',true).trigger('change');
|
||||
} else {
|
||||
$('#' + input_id + '9').prop('checked',false);
|
||||
}
|
||||
@ -3713,7 +3713,7 @@ AJAX.registerOnload('functions.js', function () {
|
||||
);
|
||||
$newrow.find(':input').each(tempEmptyVal);
|
||||
// focus index size input on column picked
|
||||
$newrow.find('select').change(tempSetFocus);
|
||||
$newrow.find('select').on('change', tempSetFocus);
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -3850,7 +3850,7 @@ function showIndexEditDialog ($outer) {
|
||||
});
|
||||
$('div.add_fields').removeClass('hide');
|
||||
// focus index size input on column picked
|
||||
$outer.find('table#index_columns select').change(function () {
|
||||
$outer.find('table#index_columns select').on('change', function () {
|
||||
if ($(this).find('option:selected').val() === '') {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -887,7 +887,7 @@ function PMA_makegrid (t, enableResize, enableReorder, enableVisib, enableGridEd
|
||||
// hide the value next to 'Browse foreign values' link
|
||||
$editArea.find('span.curr_value').hide();
|
||||
// handle update for new values selected from new window
|
||||
$editArea.find('span.curr_value').change(function () {
|
||||
$editArea.find('span.curr_value').on('change', function () {
|
||||
$(g.cEdit).find('.edit_box').val($(this).text());
|
||||
});
|
||||
}); // end $.post()
|
||||
|
||||
@ -46,8 +46,8 @@ AJAX.registerTeardown('replication.js', function () {
|
||||
|
||||
AJAX.registerOnload('replication.js', function () {
|
||||
$('#rep').text(conf_prefix);
|
||||
$('#db_type').change(update_config);
|
||||
$('#db_select').change(update_config);
|
||||
$('#db_type').on('change', update_config);
|
||||
$('#db_select').on('change', update_config);
|
||||
|
||||
$('#master_status_href').click(function () {
|
||||
$('#replication_master_section').toggle();
|
||||
|
||||
@ -400,7 +400,7 @@ AJAX.registerOnload('server_status_monitor.js', function () {
|
||||
});
|
||||
|
||||
// global settings
|
||||
$('div.popupContent select[name="chartColumns"]').change(function () {
|
||||
$('div.popupContent select[name="chartColumns"]').on('change', function () {
|
||||
monitorSettings.columns = parseInt(this.value, 10);
|
||||
|
||||
calculateChartSize();
|
||||
@ -466,7 +466,7 @@ AJAX.registerOnload('server_status_monitor.js', function () {
|
||||
saveMonitor(); // Save settings
|
||||
});
|
||||
|
||||
$('div.popupContent select[name="gridChartRefresh"]').change(function () {
|
||||
$('div.popupContent select[name="gridChartRefresh"]').on('change', function () {
|
||||
monitorSettings.gridRefresh = parseInt(this.value, 10) * 1000;
|
||||
clearTimeout(runtime.refreshTimeout);
|
||||
|
||||
@ -524,7 +524,7 @@ AJAX.registerOnload('server_status_monitor.js', function () {
|
||||
$.each(presetCharts, function (key, value) {
|
||||
$presetList.append('<option value="' + key + '">' + value.title + '</option>');
|
||||
});
|
||||
$presetList.change(function () {
|
||||
$presetList.on('change', function () {
|
||||
$('input[name="chartTitle"]').val(
|
||||
$presetList.find(':selected').text()
|
||||
);
|
||||
@ -540,7 +540,7 @@ AJAX.registerOnload('server_status_monitor.js', function () {
|
||||
$('#chartSeries').find(':selected').text().replace(/_/g, ' ')
|
||||
);
|
||||
});
|
||||
$('#chartSeries').change(function () {
|
||||
$('#chartSeries').on('change', function () {
|
||||
$('input[name="chartTitle"]').val(
|
||||
$('#chartSeries').find(':selected').text().replace(/_/g, ' ')
|
||||
);
|
||||
@ -809,7 +809,7 @@ AJAX.registerOnload('server_status_monitor.js', function () {
|
||||
return false;
|
||||
});
|
||||
|
||||
$('input[name="chartType"]').change(function () {
|
||||
$('input[name="chartType"]').on('change', function () {
|
||||
$('#chartVariableSettings').toggle(this.checked && this.value === 'variable');
|
||||
var title = $('input[name="chartTitle"]').val();
|
||||
if (title === PMA_messages.strChartTitle ||
|
||||
@ -821,15 +821,15 @@ AJAX.registerOnload('server_status_monitor.js', function () {
|
||||
}
|
||||
});
|
||||
|
||||
$('input[name="useDivisor"]').change(function () {
|
||||
$('input[name="useDivisor"]').on('change', function () {
|
||||
$('span.divisorInput').toggle(this.checked);
|
||||
});
|
||||
|
||||
$('input[name="useUnit"]').change(function () {
|
||||
$('input[name="useUnit"]').on('change', function () {
|
||||
$('span.unitInput').toggle(this.checked);
|
||||
});
|
||||
|
||||
$('select[name="varChartList"]').change(function () {
|
||||
$('select[name="varChartList"]').on('change', function () {
|
||||
if (this.selectedIndex !== 0) {
|
||||
$('#variableInput').val(this.value);
|
||||
}
|
||||
@ -1652,7 +1652,7 @@ AJAX.registerOnload('server_status_monitor.js', function () {
|
||||
'</fieldset>'
|
||||
);
|
||||
|
||||
$('#noWHEREData').change(function () {
|
||||
$('#noWHEREData').on('change', function () {
|
||||
filterQueries(true);
|
||||
});
|
||||
|
||||
|
||||
@ -23,17 +23,17 @@ AJAX.registerOnload('server_status_variables.js', function () {
|
||||
var text = ''; // Holds filter text
|
||||
|
||||
/* 3 Filtering functions */
|
||||
$('#filterAlert').change(function () {
|
||||
$('#filterAlert').on('change', function () {
|
||||
alertFilter = this.checked;
|
||||
filterVariables();
|
||||
});
|
||||
|
||||
$('#filterCategory').change(function () {
|
||||
$('#filterCategory').on('change', function () {
|
||||
categoryFilter = $(this).val();
|
||||
filterVariables();
|
||||
});
|
||||
|
||||
$('#dontFormat').change(function () {
|
||||
$('#dontFormat').on('change', function () {
|
||||
// Hiding the table while changing values speeds up the process a lot
|
||||
$('#serverstatusvariables').hide();
|
||||
$('#serverstatusvariables').find('td.value span.original').toggle(this.checked);
|
||||
|
||||
@ -228,7 +228,7 @@ AJAX.registerOnload('sql.js', function () {
|
||||
// If sql query with sort for current table is stored, change sort by key select value
|
||||
var sortStoredQuery = (isStorageSupported('localStorage') && typeof window.localStorage.auto_saved_sql_sort !== 'undefined') ? window.localStorage.auto_saved_sql_sort : Cookies.get('auto_saved_sql_sort');
|
||||
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).change();
|
||||
$('select[name="sql_query"]').val(sortStoredQuery).trigger('change');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -323,25 +323,25 @@ AJAX.registerOnload('tbl_chart.js', function () {
|
||||
});
|
||||
|
||||
// handle changing the x-axis
|
||||
$('select[name="chartXAxis"]').change(function () {
|
||||
$('select[name="chartXAxis"]').on('change', function () {
|
||||
onXAxisChange();
|
||||
drawChart();
|
||||
});
|
||||
|
||||
// handle changing the selected data series
|
||||
$('select[name="chartSeries"]').change(function () {
|
||||
$('select[name="chartSeries"]').on('change', function () {
|
||||
onDataSeriesChange();
|
||||
drawChart();
|
||||
});
|
||||
|
||||
// handle changing the series column
|
||||
$('select[name="chartSeriesColumn"]').change(function () {
|
||||
$('select[name="chartSeriesColumn"]').on('change', function () {
|
||||
currentSettings.seriesColumn = parseInt($(this).val(), 10);
|
||||
drawChart();
|
||||
});
|
||||
|
||||
// handle changing the value column
|
||||
$('select[name="chartValueColumn"]').change(function () {
|
||||
$('select[name="chartValueColumn"]').on('change', function () {
|
||||
currentSettings.valueColumn = parseInt($(this).val(), 10);
|
||||
drawChart();
|
||||
});
|
||||
|
||||
@ -35,7 +35,7 @@ function zoomAndPan () {
|
||||
$('circle.vector').each(function () {
|
||||
id = $(this).attr('id');
|
||||
circle = svg.getElementById(id);
|
||||
svg.change(circle, {
|
||||
svg.on('change', circle, {
|
||||
r : (3 / scale),
|
||||
'stroke-width' : (2 / scale)
|
||||
});
|
||||
@ -45,7 +45,7 @@ function zoomAndPan () {
|
||||
$('polyline.vector').each(function () {
|
||||
id = $(this).attr('id');
|
||||
line = svg.getElementById(id);
|
||||
svg.change(line, {
|
||||
svg.on('change', line, {
|
||||
'stroke-width' : (2 / scale)
|
||||
});
|
||||
});
|
||||
@ -54,7 +54,7 @@ function zoomAndPan () {
|
||||
$('path.vector').each(function () {
|
||||
id = $(this).attr('id');
|
||||
polygon = svg.getElementById(id);
|
||||
svg.change(polygon, {
|
||||
svg.on('change', polygon, {
|
||||
'stroke-width' : (0.5 / scale)
|
||||
});
|
||||
});
|
||||
|
||||
@ -147,7 +147,7 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function () {
|
||||
**/
|
||||
|
||||
// first column choice corresponds to the X axis
|
||||
$('#tableid_0').change(function () {
|
||||
$('#tableid_0').on('change', function () {
|
||||
// AJAX request for field type, collation, operators, and value field
|
||||
$.post('tbl_zoom_select.php', {
|
||||
'ajax_request' : true,
|
||||
@ -171,7 +171,7 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function () {
|
||||
});
|
||||
|
||||
// second column choice corresponds to the Y axis
|
||||
$('#tableid_1').change(function () {
|
||||
$('#tableid_1').on('change', function () {
|
||||
// AJAX request for field type, collation, operators, and value field
|
||||
$.post('tbl_zoom_select.php', {
|
||||
'ajax_request' : true,
|
||||
@ -194,7 +194,7 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function () {
|
||||
});
|
||||
});
|
||||
|
||||
$('#tableid_2').change(function () {
|
||||
$('#tableid_2').on('change', function () {
|
||||
// AJAX request for field type, collation, operators, and value field
|
||||
$.post('tbl_zoom_select.php', {
|
||||
'ajax_request' : true,
|
||||
@ -215,7 +215,7 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function () {
|
||||
});
|
||||
});
|
||||
|
||||
$('#tableid_3').change(function () {
|
||||
$('#tableid_3').on('change', function () {
|
||||
// AJAX request for field type, collation, operators, and value field
|
||||
$.post('tbl_zoom_select.php', {
|
||||
'ajax_request' : true,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user