');
}
} else {
- $('head').append('');
+ head.append('');
}
};
diff --git a/js/gis_data_editor.js b/js/gis_data_editor.js
index 2808fc407e..86cae9e870 100644
--- a/js/gis_data_editor.js
+++ b/js/gis_data_editor.js
@@ -25,7 +25,7 @@ function prepareJSVersion() {
// Change the text on the submit button
$("input[name='gis_data[save]']")
- .attr('value', PMA_messages['strCopy'])
+ .val(PMA_messages['strCopy'])
.insertAfter($('#gis_data_textarea'))
.before('
');
@@ -44,7 +44,7 @@ function prepareJSVersion() {
var classes = $button.attr('class');
$button
.after('+ ' + $button.attr('value') + '')
+ + '">+ ' + $button.val() + '')
.remove();
});
}
@@ -276,11 +276,11 @@ $(document).ready(function() {
var prefix = name.substr(0, name.length - 11);
// Find the number of points
var $noOfPointsInput = $("input[name='" + prefix + "[no_of_points]" + "']");
- var noOfPoints = parseInt($noOfPointsInput.attr('value'));
+ var noOfPoints = parseInt($noOfPointsInput.val());
// Add the new data point
var html = addDataPoint(noOfPoints, prefix);
$a.before(html);
- $noOfPointsInput.attr('value', noOfPoints + 1);
+ $noOfPointsInput.val(noOfPoints + 1);
});
/**
@@ -296,7 +296,7 @@ $(document).ready(function() {
// Find the number of lines
var $noOfLinesInput = $("input[name='" + prefix + "[no_of_lines]" + "']");
- var noOfLines = parseInt($noOfLinesInput.attr('value'));
+ var noOfLines = parseInt($noOfLinesInput.val());
// Add the new linesting of inner ring based on the type
var html = '
';
@@ -315,7 +315,7 @@ $(document).ready(function() {
+ PMA_messages['strAddPoint'] + '
';
$a.before(html);
- $noOfLinesInput.attr('value', noOfLines + 1);
+ $noOfLinesInput.val(noOfLines + 1);
});
/**
@@ -328,7 +328,7 @@ $(document).ready(function() {
var prefix = name.substr(0, name.length - 13);
// Find the number of polygons
var $noOfPolygonsInput = $("input[name='" + prefix + "[no_of_polygons]" + "']");
- var noOfPolygons = parseInt($noOfPolygonsInput.attr('value'));
+ var noOfPolygons = parseInt($noOfPolygonsInput.val());
// Add the new polygon
var html = PMA_messages['strPolygon'] + (noOfPolygons + 1) + ':
';
@@ -344,7 +344,7 @@ $(document).ready(function() {
+ PMA_messages['strAddInnerRing'] + '
';
$a.before(html);
- $noOfPolygonsInput.attr('value', noOfPolygons + 1);
+ $noOfPolygonsInput.val(noOfPolygons + 1);
});
/**
@@ -355,7 +355,7 @@ $(document).ready(function() {
var prefix = 'gis_data[GEOMETRYCOLLECTION]';
// Find the number of geoms
var $noOfGeomsInput = $("input[name='" + prefix + "[geom_count]" + "']");
- var noOfGeoms = parseInt($noOfGeomsInput.attr('value'));
+ var noOfGeoms = parseInt($noOfGeomsInput.val());
var html1 = PMA_messages['strGeometry'] + (noOfGeoms + 1) + ':
';
var $geomType = $("select[name='gis_data[" + (noOfGeoms - 1) + "][gis_type]']").clone();
@@ -368,6 +368,6 @@ $(document).ready(function() {
+ '
';
$a.before(html1); $geomType.insertBefore($a); $a.before(html2);
- $noOfGeomsInput.attr('value', noOfGeoms + 1);
+ $noOfGeomsInput.val(noOfGeoms + 1);
});
});
diff --git a/js/import.js b/js/import.js
index f1ab31bfe0..ec5fc9b5da 100644
--- a/js/import.js
+++ b/js/import.js
@@ -14,7 +14,7 @@ function changePluginOpts()
$(".format_specific_options").each(function() {
$(this).hide();
});
- var selected_plugin_name = $("#plugins option:selected").attr("value");
+ var selected_plugin_name = $("#plugins option:selected").val();
$("#" + selected_plugin_name + "_options").fadeIn('slow');
if(selected_plugin_name == "csv") {
$("#import_notification").text(PMA_messages['strImportCSV']);
@@ -38,8 +38,8 @@ function matchFile(fname)
}
// Only toggle if the format of the file can be imported
if($("select[name='format'] option").filterByValue(fname_array[len - 1]).length == 1) {
- $("#plugins option:selected").removeAttr("selected");
- $("select[name='format'] option").filterByValue(fname_array[len - 1]).attr('selected', 'selected');
+ $("#plugins option:selected").removeProp("selected");
+ $("select[name='format'] option").filterByValue(fname_array[len - 1]).prop('selected', true);
changePluginOpts();
}
}
@@ -54,11 +54,11 @@ $(document).ready(function() {
});
$("#input_import_file").change(function() {
- matchFile($(this).attr("value"));
+ matchFile($(this).val());
});
$("#select_local_import_file").change(function() {
- matchFile($(this).attr("value"));
+ matchFile($(this).val());
});
/*
@@ -66,12 +66,12 @@ $(document).ready(function() {
* form is clicked, the radio button beside it becomes selected and the other form becomes disabled.
*/
$("#input_import_file").focus(function() {
- $("#radio_import_file").attr('checked', 'checked');
- $("#radio_local_import_file").removeAttr('checked');
+ $("#radio_import_file").prop('checked', true);
+ $("#radio_local_import_file").removeProp('checked');
});
$("#select_local_import_file").focus(function() {
- $("#radio_local_import_file").attr('checked', 'checked');
- $("#radio_import_file").removeAttr('checked');
+ $("#radio_local_import_file").prop('checked', true);
+ $("#radio_import_file").removeProp('checked');
});
/**
diff --git a/js/indexes.js b/js/indexes.js
index 8099056913..af6c990729 100644
--- a/js/indexes.js
+++ b/js/indexes.js
@@ -36,7 +36,7 @@ function checkIndexType()
$size_header.hide();
$size_inputs.each(function(){
$(this)
- .attr('disabled', true)
+ .prop('disabled', true)
.parent('td').hide();
});
@@ -46,7 +46,7 @@ function checkIndexType()
$column_input = $(this);
if (! initial) {
$column_input
- .attr('disabled', true)
+ .prop('disabled', true)
.parent('td').hide();
} else {
initial = false;
@@ -60,14 +60,14 @@ function checkIndexType()
$size_header.show();
$size_inputs.each(function() {
$(this)
- .attr('disabled', false)
+ .prop('disabled', false)
.parent('td').show();
});
// Enable and show the columns of the index
$column_inputs.each(function() {
$(this)
- .attr('disabled', false)
+ .prop('disabled', false)
.parent('td').show();
});
diff --git a/js/makegrid.js b/js/makegrid.js
index 8bd4aa95ac..73764fadcf 100644
--- a/js/makegrid.js
+++ b/js/makegrid.js
@@ -478,10 +478,10 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
.hide();
});
g.colVisib[n] = 0;
- $(g.cList).find('.lDiv div:eq(' + n + ') input').removeAttr('checked');
+ $(g.cList).find('.lDiv div:eq(' + n + ') input').removeProp('checked');
} else {
// cannot hide, force the checkbox to stay checked
- $(g.cList).find('.lDiv div:eq(' + n + ') input').attr('checked', 'checked');
+ $(g.cList).find('.lDiv div:eq(' + n + ') input').prop('checked', true);
return false;
}
} else { // column n is not visible
@@ -491,7 +491,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
.show();
});
g.colVisib[n] = 1;
- $(g.cList).find('.lDiv div:eq(' + n + ') input').attr('checked', 'checked');
+ $(g.cList).find('.lDiv div:eq(' + n + ') input').prop('checked', true);
}
return true;
},
@@ -600,7 +600,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
g.currentEditCell = cell;
$(g.cEdit).find('.edit_box').focus();
- $(g.cEdit).find('*').removeAttr('disabled');
+ $(g.cEdit).find('*').removeProp('disabled');
}
}
},
@@ -748,44 +748,44 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
var $checkbox = $editArea.find('.null_div input');
// check if current is NULL
if ($td.is('.null')) {
- $checkbox.attr('checked', true);
+ $checkbox.prop('checked', true);
g.wasEditedCellNull = true;
}
// if the select/editor is changed un-check the 'checkbox_null__'.
if ($td.is('.enum, .set')) {
$editArea.find('select').live('change', function(e) {
- $checkbox.attr('checked', false);
+ $checkbox.prop('checked', false);
});
} else if ($td.is('.relation')) {
$editArea.find('select').live('change', function(e) {
- $checkbox.attr('checked', false);
+ $checkbox.prop('checked', false);
});
$editArea.find('.browse_foreign').live('click', function(e) {
- $checkbox.attr('checked', false);
+ $checkbox.prop('checked', false);
});
} else {
$(g.cEdit).find('.edit_box').live('keypress change', function(e) {
- $checkbox.attr('checked', false);
+ $checkbox.prop('checked', false);
});
$editArea.find('textarea').live('keydown', function(e) {
- $checkbox.attr('checked', false);
+ $checkbox.prop('checked', false);
});
}
// if null checkbox is clicked empty the corresponding select/editor.
$checkbox.click(function(e) {
if ($td.is('.enum')) {
- $editArea.find('select').attr('value', '');
+ $editArea.find('select').val('');
} else if ($td.is('.set')) {
$editArea.find('select').find('option').each(function() {
var $option = $(this);
- $option.attr('selected', false);
+ $option.prop('selected', false);
});
} else if ($td.is('.relation')) {
// if the dropdown is there to select the foreign value
if ($editArea.find('select').length > 0) {
- $editArea.find('select').attr('value', '');
+ $editArea.find('select').val('');
}
} else {
$editArea.find('textarea').val('');
@@ -974,7 +974,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
showTimepicker: showTimeOption,
onSelect: function(dateText, inst) {
// remove null checkbox if it exists
- $(g.cEdit).find('.null_div input[type=checkbox]').attr('checked', false);
+ $(g.cEdit).find('.null_div input[type=checkbox]').prop('checked', false);
}
});
@@ -1020,7 +1020,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
/**
* @var relational_display string 'K' if relational key, 'D' if relational display column
*/
- var relational_display = $("#relational_display_K").attr('checked') ? 'K' : 'D';
+ var relational_display = $("#relational_display_K").prop('checked') ? 'K' : 'D';
/**
* @var transform_fields Array containing the name/value pairs for transformed fields
*/
@@ -1181,12 +1181,12 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
};
if (!g.saveCellsAtOnce) {
- $(g.cEdit).find('*').attr('disabled', 'disabled');
+ $(g.cEdit).find('*').prop('disabled', true);
var $editArea = $(g.cEdit).find('.edit_area');
$(g.cEdit).find('.edit_box').addClass('edit_box_posting');
} else {
$('.save_edited').addClass('saving_edited_data')
- .find('input').attr('disabled', 'disabled'); // disable the save button
+ .find('input').prop('disabled', true); // disable the save button
}
$.ajax({
@@ -1197,11 +1197,11 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
function(data) {
g.isSaving = false;
if (!g.saveCellsAtOnce) {
- $(g.cEdit).find('*').removeAttr('disabled');
+ $(g.cEdit).find('*').removeProp('disabled');
$(g.cEdit).find('.edit_box').removeClass('edit_box_posting');
} else {
$('.save_edited').removeClass('saving_edited_data')
- .find('input').removeAttr('disabled'); // enable the save button back
+ .find('input').removeProp('disabled'); // enable the save button back
}
if(data.success == true) {
PMA_ajaxShowMessage(data.message);
@@ -1209,11 +1209,11 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
$('.to_be_saved').parents('tr').each(function() {
var new_clause = $(this).data('new_clause');
var $where_clause = $(this).find('.where_clause');
- var old_clause = $where_clause.attr('value');
+ var old_clause = $where_clause.val();
var decoded_old_clause = PMA_urldecode(old_clause);
var decoded_new_clause = PMA_urldecode(new_clause);
- $where_clause.attr('value', new_clause);
+ $where_clause.val(new_clause);
// update Edit, Copy, and Delete links also
$(this).find('a').each(function() {
$(this).attr('href', $(this).attr('href').replace(old_clause, new_clause));
@@ -1231,10 +1231,10 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
$(this).find('input[type=checkbox]').each(function() {
var $checkbox = $(this);
var checkbox_name = $checkbox.attr('name');
- var checkbox_value = $checkbox.attr('value');
+ var checkbox_value = $checkbox.val();
$checkbox.attr('name', checkbox_name.replace(old_clause, new_clause));
- $checkbox.attr('value', checkbox_value.replace(decoded_old_clause, decoded_new_clause));
+ $checkbox.val(checkbox_value.replace(decoded_old_clause, decoded_new_clause));
});
});
// update the display of executed SQL query command
diff --git a/js/querywindow.js b/js/querywindow.js
index 55c895a061..8551fd5fd5 100644
--- a/js/querywindow.js
+++ b/js/querywindow.js
@@ -1,14 +1,16 @@
function PMA_queryAutoCommit()
{
- document.getElementById('sqlqueryform').target = window.opener.frame_content.name;
- document.getElementById('sqlqueryform').submit();
+ var sqlqueryform = document.getElementById('sqlqueryform');
+ sqlqueryform.target = window.opener.frame_content.name;
+ sqlqueryform.submit();
return;
}
function PMA_querywindowCommit(tab)
{
- $('#hiddenqueryform').find("input[name='querydisplay_tab']").attr("value" ,tab);
- $('#hiddenqueryform').submit();
+ var hiddenqueryform = $('#hiddenqueryform');
+ hiddenqueryform.find("input[name='querydisplay_tab']").val(tab);
+ hiddenqueryform.submit();
return false;
}
@@ -19,23 +21,26 @@ function PMA_querywindowSetFocus()
function PMA_querywindowResize()
{
+ var el = $(this)[0];
+ var querywindowcontainer = $('#querywindowcontainer');
+
// for Gecko
- if (typeof($(this)[0].sizeToContent) == 'function') {
- $(this)[0].sizeToContent();
+ if (typeof(el.sizeToContent) == 'function') {
+ el.sizeToContent();
//self.scrollbars.visible = false;
// give some more space ... to prevent 'fli(pp/ck)ing'
- $(this)[0].resizeBy(10, 50);
+ el.resizeBy(10, 50);
return;
}
// for IE, Opera
- if ($('#querywindowcontainer') != 'undefined') {
+ if (querywindowcontainer.length) {
// get content size
- var newWidth = $("#querywindowcontainer")[0].offsetWidth;
- var newHeight = $("#querywindowcontainer")[0].offsetHeight;
+ var newWidth = querywindowcontainer.width();
+ var newHeight = querywindowcontainer.height();
// set size to contentsize
// plus some offset for scrollbars, borders, statusbar, menus ...
- $(this)[0].resizeTo(newWidth + 45, newHeight + 75);
+ el.resizeTo(newWidth + 45, newHeight + 75);
}
}
diff --git a/js/replication.js b/js/replication.js
index f3fdb1e931..2137217259 100644
--- a/js/replication.js
+++ b/js/replication.js
@@ -49,6 +49,6 @@ $(document).ready(function() {
$('#slave_synchronization_gui').toggle();
});
$('#db_reset_href').click(function() {
- $('#db_select option:selected').attr('selected', false);
+ $('#db_select option:selected').prop('selected', false);
});
});
diff --git a/js/server_privileges.js b/js/server_privileges.js
index 65feb11cf4..4eb7a4e434 100644
--- a/js/server_privileges.js
+++ b/js/server_privileges.js
@@ -172,7 +172,7 @@ $(document).ready(function() {
}
//We also need to post the value of the submit button in order to get this to work correctly
- $.post($form.attr('action'), $form.serialize() + "&adduser_submit=" + $(this).find("input[name=adduser_submit]").attr('value'), function(data) {
+ $.post($form.attr('action'), $form.serialize() + "&adduser_submit=" + $(this).find("input[name=adduser_submit]").val(), function(data) {
if (data.success == true) {
// Refresh navigation, if we created a database with the name
// that is the same as the username of the new user
@@ -204,7 +204,7 @@ $(document).ready(function() {
url = url + "&ajax_request=true&db_specific=true";
/* post request for get the updated userForm table */
- $.post($form.attr('action' ), url, function(priv_data) {
+ $.post($form.attr('action'), url, function(priv_data) {
/*Remove the old userForm table*/
if ($('#userFormDiv').length != 0) {
@@ -307,7 +307,7 @@ $(document).ready(function() {
$form = $("#usersForm");
- $.post($form.attr('action'), $form.serialize() + "&delete=" + $(this).attr('value') + "&ajax_request=true", function(data) {
+ $.post($form.attr('action'), $form.serialize() + "&delete=" + $(this).val() + "&ajax_request=true", function(data) {
if(data.success == true) {
PMA_ajaxShowMessage(data.message);
// Refresh navigation, if we droppped some databases with the name
@@ -594,7 +594,7 @@ $(document).ready(function() {
if ($this_checkbox.is(':checked')) {
var is_confirmed = confirm(PMA_messages['strDropDatabaseStrongWarning'] + '\n' + PMA_messages['strDoYouReally'] + '\nDROP DATABASE');
if (! is_confirmed) {
- $this_checkbox.attr('checked', false);
+ $this_checkbox.prop('checked', false);
}
}
});
diff --git a/js/server_status_monitor.js b/js/server_status_monitor.js
index d0ec47a7de..cfaa88c1e5 100644
--- a/js/server_status_monitor.js
+++ b/js/server_status_monitor.js
@@ -443,7 +443,7 @@ $(function() {
}
}
- newChart.title = $('input[name="chartTitle"]').attr('value');
+ newChart.title = $('input[name="chartTitle"]').val();
// Add a cloned object to the chart grid
addChart($.extend(true, {}, newChart));
@@ -468,7 +468,7 @@ $(function() {
});
$presetList.change(function() {
$('input#chartPreset').trigger('click');
- $('input[name="chartTitle"]').attr('value', presetCharts[$(this).prop('value')].title);
+ $('input[name="chartTitle"]').val(presetCharts[$(this).val()].title);
});
}
@@ -729,13 +729,13 @@ $(function() {
$('input[name="chartType"]').change(function() {
$('#chartVariableSettings').toggle(this.checked && this.value == 'variable');
- var title = $('input[name="chartTitle"]').attr('value');
+ var title = $('input[name="chartTitle"]').val();
if (title == PMA_messages['strChartTitle']
|| title == $('label[for="' + $('input[name="chartTitle"]').data('lastRadio') + '"]').text()
) {
$('input[name="chartTitle"]')
.data('lastRadio', $(this).attr('id'))
- .attr('value', $('label[for="' + $(this).attr('id') + '"]').text());
+ .val($('label[for="' + $(this).attr('id') + '"]').text());
}
});
@@ -749,21 +749,21 @@ $(function() {
$('select[name="varChartList"]').change(function () {
if (this.selectedIndex != 0) {
- $('#variableInput').attr('value', this.value);
+ $('#variableInput').val(this.value);
}
});
$('a[href="#kibDivisor"]').click(function() {
- $('input[name="valueDivisor"]').attr('value', 1024);
- $('input[name="valueUnit"]').attr('value', PMA_messages['strKiB']);
+ $('input[name="valueDivisor"]').val(1024);
+ $('input[name="valueUnit"]').val(PMA_messages['strKiB']);
$('span.unitInput').toggle(true);
$('input[name="useUnit"]').prop('checked', true);
return false;
});
$('a[href="#mibDivisor"]').click(function() {
- $('input[name="valueDivisor"]').attr('value', 1024*1024);
- $('input[name="valueUnit"]').attr('value', PMA_messages['strMiB']);
+ $('input[name="valueDivisor"]').val(1024*1024);
+ $('input[name="valueUnit"]').val(PMA_messages['strMiB']);
$('span.unitInput').toggle(true);
$('input[name="useUnit"]').prop('checked', true);
return false;
@@ -776,7 +776,7 @@ $(function() {
});
$('a[href="#submitAddSeries"]').click(function() {
- if ($('input#variableInput').attr('value').length == 0) {
+ if ($('input#variableInput').val() == "") {
return false;
}
@@ -784,27 +784,27 @@ $(function() {
$('#seriesPreview').html('');
newChart = {
- title: $('input[name="chartTitle"]').attr('value'),
+ title: $('input[name="chartTitle"]').val(),
nodes: []
};
}
var serie = {
- dataPoints: [{ type: 'statusvar', name: $('input#variableInput').attr('value') }],
- name: $('input#variableInput').attr('value'),
- display: $('input[name="differentialValue"]').attr('checked') ? 'differential' : ''
+ dataPoints: [{ type: 'statusvar', name: $('input#variableInput').val() }],
+ name: $('input#variableInput').val(),
+ display: $('input[name="differentialValue"]').prop('checked') ? 'differential' : ''
};
if (serie.dataPoint == 'Processes') {
serie.dataType='proc';
}
- if ($('input[name="useDivisor"]').attr('checked')) {
- serie.valueDivisor = parseInt($('input[name="valueDivisor"]').attr('value'));
+ if ($('input[name="useDivisor"]').prop('checked')) {
+ serie.valueDivisor = parseInt($('input[name="valueDivisor"]').val());
}
- if ($('input[name="useUnit"]').attr('checked')) {
- serie.unit = $('input[name="valueUnit"]').attr('value');
+ if ($('input[name="useUnit"]').prop('checked')) {
+ serie.unit = $('input[name="valueUnit"]').val();
}
var str = serie.display == 'differential' ? ', ' + PMA_messages['strDifferential'] : '';
@@ -815,10 +815,10 @@ $(function() {
newChart.nodes.push(serie);
- $('input#variableInput').attr('value', '');
- $('input[name="differentialValue"]').attr('checked', true);
- $('input[name="useDivisor"]').attr('checked', false);
- $('input[name="useUnit"]').attr('checked', false);
+ $('input#variableInput').val('');
+ $('input[name="differentialValue"]').prop('checked', true);
+ $('input[name="useDivisor"]').prop('checked', false);
+ $('input[name="useUnit"]').prop('checked', false);
$('input[name="useDivisor"]').trigger('change');
$('input[name="useUnit"]').trigger('change');
$('select[name="varChartList"]').get(0).selectedIndex = 0;
@@ -849,7 +849,7 @@ $(function() {
$('a[href="#clearMonitorConfig"]').toggle(runtime.charts != null);
if (runtime.charts != null && monitorProtocolVersion != window.localStorage['monitorVersion']) {
- $('div#emptyDialog').attr('title',PMA_messages['strIncompatibleMonitorConfig']);
+ $('div#emptyDialog').attr('title', PMA_messages['strIncompatibleMonitorConfig']);
$('div#emptyDialog').html(PMA_messages['strIncompatibleMonitorConfigDescription']);
var dlgBtns = {};
@@ -869,8 +869,8 @@ $(function() {
monitorSettings = defaultMonitorSettings;
}
- $('select[name="gridChartRefresh"]').attr('value', monitorSettings.gridRefresh / 1000);
- $('select[name="chartColumns"]').attr('value', monitorSettings.columns);
+ $('select[name="gridChartRefresh"]').val(monitorSettings.gridRefresh / 1000);
+ $('select[name="chartColumns"]').val(monitorSettings.columns);
if (monitorSettings.gridMaxPoints == 'auto') {
runtime.gridMaxPoints = Math.round((monitorSettings.chartSize.width - 40) / 12);
@@ -945,9 +945,9 @@ $(function() {
if (runtime.charts) {
oldData = {};
$.each(runtime.charts, function(key, chartObj) {
- for (var i = 0; i < chartObj.nodes.length; i++) {
+ for (var i = 0, l = chartObj.nodes.length; i < l; i++) {
oldData[chartObj.nodes[i].dataPoint] = [];
- for (var j = 0; j < chartObj.chart.series[i].data.length; j++)
+ for (var j = 0, ll = chartObj.chart.series[i].data.length; j < ll; j++)
oldData[chartObj.nodes[i].dataPoint].push([chartObj.chart.series[i].data[j].x, chartObj.chart.series[i].data[j].y]);
}
});
@@ -958,7 +958,7 @@ $(function() {
if (oldData) {
$.each(runtime.charts, function(key, chartObj) {
- for (var j = 0; j < chartObj.nodes.length; j++) {
+ for (var j = 0, l = chartObj.nodes.length; j < l; j++) {
if (oldData[chartObj.nodes[j].dataPoint]) {
chartObj.chart.series[j].setData(oldData[chartObj.nodes[j].dataPoint]);
}
@@ -979,7 +979,7 @@ $(function() {
/* Adds a chart to the chart grid */
function addChart(chartObj, initialize) {
series = [];
- for (var j = 0; j Sum up identical columns, and hide all but 1
- q = $(this).text().replace(equalsFilter, '$1=...$6').trim();
+ q = $t.text().replace(equalsFilter, '$1=...$6').trim();
q = q.replace(functionFilter, ' $1(...)');
// Js does not specify a limit on property name length, so we can abuse it as index :-)
if (filteredQueries[q]) {
- filteredQueries[q] += parseInt($(this).next().text());
- totalSum += parseInt($(this).next().text());
+ filteredQueries[q] += parseInt($t.next().text());
+ totalSum += parseInt($t.next().text());
hide = true;
} else {
- filteredQueries[q] = parseInt($(this).next().text());;
+ filteredQueries[q] = parseInt($t.next().text());
filteredQueriesLines[q] = i;
- $(this).text(q);
+ $t.text(q);
}
if (isSlowLog) {
- countRow(q, $(this).parent().html());
+ countRow(q, $t.parent().html());
}
} else {
// Group off: Restore original columns
- rowData = $(this).parent().data('query');
+ rowData = $t.parent().data('query');
// Restore SQL text
- $(this).text(rowData[queryColumnName]);
+ $t.text(rowData[queryColumnName]);
// Restore total count
- $(this).next().text(rowData[sumColumnName]);
+ $t.next().text(rowData[sumColumnName]);
// Restore slow log columns
if (isSlowLog) {
- $(this).parent().children('td:nth-child(3)').text(rowData['query_time']);
- $(this).parent().children('td:nth-child(4)').text(rowData['lock_time']);
- $(this).parent().children('td:nth-child(5)').text(rowData['rows_sent']);
- $(this).parent().children('td:nth-child(6)').text(rowData['rows_examined']);
+ $t.parent().children('td:nth-child(3)').text(rowData['query_time']);
+ $t.parent().children('td:nth-child(4)').text(rowData['lock_time']);
+ $t.parent().children('td:nth-child(5)').text(rowData['rows_sent']);
+ $t.parent().children('td:nth-child(6)').text(rowData['rows_examined']);
}
}
}
// If not required to be hidden, do we need to hide because of a not matching text filter?
- if (! hide && (textFilter != null && ! textFilter.exec($(this).text()))) {
+ if (! hide && (textFilter != null && ! textFilter.exec($t.text()))) {
hide = true;
}
// Now display or hide this column
if (hide) {
- $(this).parent().css('display', 'none');
+ $t.parent().css('display', 'none');
} else {
- totalSum += parseInt($(this).next().text());
+ totalSum += parseInt($t.next().text());
rowSum++;
odd_row = ! odd_row;
- $(this).parent().css('display', '');
+ $t.parent().css('display', '');
if (odd_row) {
- $(this).parent().addClass('odd');
- $(this).parent().removeClass('even');
+ $t.parent().addClass('odd');
+ $t.parent().removeClass('even');
} else {
- $(this).parent().addClass('even');
- $(this).parent().removeClass('odd');
+ $t.parent().addClass('even');
+ $t.parent().removeClass('odd');
}
}
@@ -1593,9 +1596,9 @@ $(function() {
/* Turns a number into a timespan (100 into 00:01:40) */
function secToTime(timeInt) {
- hours = Math.floor(timeInt / 3600);
+ var hours = Math.floor(timeInt / 3600);
timeInt -= hours*3600;
- minutes = Math.floor(timeInt / 60);
+ var minutes = Math.floor(timeInt / 60);
timeInt -= minutes*60;
if (hours < 10) {
@@ -1628,7 +1631,7 @@ $(function() {
return value;
};
- for (var i = 0; i < rows.length; i++) {
+ for (var i = 0, l = rows.length; i < l; i++) {
if (i == 0) {
$.each(rows[0], function(key, value) {
cols.push(key);
@@ -1642,7 +1645,7 @@ $(function() {
$tBody.append($tRow = $(' '));
var cl = '';
- for (var j = 0; j < cols.length; j++) {
+ for (var j = 0, ll = cols.length; j < ll; j++) {
// Assuming the query column is the second last
if (j == cols.length - 2 && rows[i][cols[j]].match(/^SELECT/i)) {
$tRow.append($tCell = $('' + formatValue(cols[j], rows[i][cols[j]]) + ' | '));
@@ -1766,7 +1769,7 @@ $(function() {
explain += ')';
}
explain += '';
- for (var i = 0; i < data.explain.length; i++) {
+ for (var i = 0, l = data.explain.length; i < l; i++) {
explain += '0? 'style="display:none;"' : '' ) + '>';
$.each(data.explain[i], function(key, value) {
value = (value == null)?'null':value;
@@ -1797,7 +1800,7 @@ $(function() {
var numberTable = ' | ' + PMA_messages['strStatus'] + ' | ' + PMA_messages['strTime'] + ' | ';
var duration;
- for (var i = 0; i < data.profiling.length; i++) {
+ for (var i = 0, l = data.profiling.length; i < l; i++) {
duration = parseFloat(data.profiling[i].duration);
chartData.push([data.profiling[i].state, duration]);
diff --git a/js/server_synchronize.js b/js/server_synchronize.js
index 4a4b1c1288..0c2adc4890 100644
--- a/js/server_synchronize.js
+++ b/js/server_synchronize.js
@@ -63,7 +63,7 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem
newRow.setAttribute("class", row_class);
newRow.className = row_class;
// Id assigned to this row element is same as the index of this table name in the matching_tables/source_tables_uncommon array
- newRow.setAttribute("id" , i);
+ newRow.setAttribute("id", i);
var table_name_cell = document.createElement("td");
table_name_cell.align = "center";
@@ -207,10 +207,10 @@ function showDetails(i, update_size, insert_size, remove_size, insert_index, rem
{
row_class_element = table_rows[index].getAttribute('class');
if (row_class_element == "even") {
- table_rows[index].setAttribute("class","odd"); // for Mozilla firefox
+ table_rows[index].setAttribute("class", "odd"); // for Mozilla firefox
table_rows[index].className = "odd"; // for IE browser
} else {
- table_rows[index].setAttribute("class","even"); // for Mozilla firefox
+ table_rows[index].setAttribute("class", "even"); // for Mozilla firefox
table_rows[index].className = "even"; // for IE browser
}
}
diff --git a/js/server_variables.js b/js/server_variables.js
index ef453f02d4..691e6677b9 100644
--- a/js/server_variables.js
+++ b/js/server_variables.js
@@ -39,7 +39,7 @@ $(function() {
var name = location.hash.substr(1).split('=')[1];
// Only allow variable names
if (! name.match(/[^0-9a-zA-Z_]+/)) {
- $('#filterText').attr('value',name).trigger('keyup');
+ $('#filterText').val(name).trigger('keyup');
}
}
@@ -141,7 +141,7 @@ function editVariable(link)
ajax_request: true,
type: 'setval',
varName: varName,
- varValue: $cell.find('input').attr('value')
+ varValue: $cell.find('input').val()
}, function(data) {
if (data.success) {
$cell.html(data.variable);
diff --git a/js/sql.js b/js/sql.js
index 6f00c75b0b..b6332beca8 100644
--- a/js/sql.js
+++ b/js/sql.js
@@ -76,7 +76,7 @@ $(document).ready(function() {
$('input#bkm_label').keyup(function() {
$('input#id_bkm_all_users, input#id_bkm_replace')
.parent()
- .toggle($(this).attr('value').length > 0);
+ .toggle($(this).val().length > 0);
}).trigger('keyup');
/**
@@ -133,7 +133,7 @@ $(document).ready(function() {
// instead of the one related to Bookmarks, so empty the
// id_bookmark selector to avoid misinterpretation in
// import.php about what needs to be done
- $form.find("select[name=id_bookmark]").attr("value","");
+ $form.find("select[name=id_bookmark]").val("");
// let normal event propagation happen
});
@@ -386,7 +386,7 @@ $(document).ready(function() {
var $form = $("#resultsForm");
var $msgbox = PMA_ajaxShowMessage();
- $.get( $form.attr('action'), $form.serialize()+"&ajax_request=true&submit_mult=row_edit", function(data) {
+ $.get($form.attr('action'), $form.serialize()+"&ajax_request=true&submit_mult=row_edit", function(data) {
//in the case of an error, show the error message returned.
if (data.success != undefined && data.success == false) {
div
@@ -476,9 +476,8 @@ $(document).ready(function() {
* @var the_form object referring to the insert form
*/
var $form = $("#insertForm");
- /**Get the submit type and the after insert type in the form*/
- var selected_submit_type = $("#insertForm").find("#actions_panel .control_at_footer option:selected").attr('value');
- var selected_after_insert = $("#insertForm").find("#actions_panel select[name=after_insert] option:selected").attr('value');
+ /**Get the submit type in the form*/
+ var selected_submit_type = $("#insertForm").find("#actions_panel .control_at_footer option:selected").val();
$("#result_query").remove();
PMA_prepareForAjaxRequest($form);
//User wants to submit the form
diff --git a/js/tbl_change.js b/js/tbl_change.js
index d70662ea8e..e537c36189 100644
--- a/js/tbl_change.js
+++ b/js/tbl_change.js
@@ -157,10 +157,10 @@ function verificationsAfterFieldChange(urlField, multi_edit, theType)
var target = evt.target || evt.srcElement;
// Unchecks the corresponding "NULL" control
- $("input[name='fields_null[multi_edit][" + multi_edit + "][" + urlField + "]']").attr('checked', false);
+ $("input[name='fields_null[multi_edit][" + multi_edit + "][" + urlField + "]']").prop('checked', false);
// Unchecks the Ignore checkbox for the current row
- $("input[name='insert_ignore_" + multi_edit + "']").attr('checked', false);
+ $("input[name='insert_ignore_" + multi_edit + "']").prop('checked', false);
var $this_input = $("input[name='fields[multi_edit][" + multi_edit + "][" + urlField + "]']");
// Does this field come from datepicker?
@@ -259,7 +259,7 @@ $(document).ready(function() {
$("input[name='gis_data[save]']").live('click', function(event) {
var input_name = $('form#gis_data_editor_form').find("input[name='input_name']").val();
var $null_checkbox = $("input[name='" + input_name + "']").parents('tr').find('.checkbox_null');
- $null_checkbox.attr('checked', false);
+ $null_checkbox.prop('checked', false);
});
// these were hidden via the "hide" class
@@ -441,7 +441,7 @@ $(document).ready(function() {
if ($this_element.is('.textfield')) {
// do not remove the 'value' attribute for ENUM columns
if ($this_element.closest('tr').find('span.column_type').html() != 'enum') {
- $this_element.attr('value', $this_element.closest('tr').find('span.default_value').html());
+ $this_element.val($this_element.closest('tr').find('span.default_value').html());
}
$this_element
.unbind('change')
@@ -515,7 +515,8 @@ $(document).ready(function() {
$(last_checkbox)
.clone()
- .attr({'id':new_name, 'name': new_name, 'checked': true})
+ .attr({'id':new_name, 'name': new_name})
+ .prop('checked', true)
.add('label[for^=insert_ignore]:last')
.clone()
.attr('for', new_name)
diff --git a/js/tbl_chart.js b/js/tbl_chart.js
index 97bb92ace7..7bacc1e4dc 100644
--- a/js/tbl_chart.js
+++ b/js/tbl_chart.js
@@ -6,7 +6,7 @@ $(document).ready(function() {
var currentChart = null;
var chart_data = jQuery.parseJSON($('#querychart').html());
chart_series = 'columns';
- chart_xaxis_idx = $('select[name="chartXAxis"]').attr('value');
+ chart_xaxis_idx = $('select[name="chartXAxis"]').val();
$('#resizer').resizable({
minHeight:240,
@@ -31,13 +31,13 @@ $(document).ready(function() {
height: $('#resizer').height() - 20
},
xAxis: {
- title: { text: $('input[name="xaxis_label"]').attr('value') }
+ title: { text: $('input[name="xaxis_label"]').val() }
},
yAxis: {
- title: { text: $('input[name="yaxis_label"]').attr('value') }
+ title: { text: $('input[name="yaxis_label"]').val() }
},
title: {
- text: $('input[name="chartTitle"]').attr('value'),
+ text: $('input[name="chartTitle"]').val(),
margin:20
},
plotOptions: {
@@ -48,11 +48,11 @@ $(document).ready(function() {
$('#querychart').html('');
$('input[name="chartType"]').click(function() {
- currentSettings.chart.type = $(this).attr('value');
+ currentSettings.chart.type = $(this).val();
drawChart();
- if ($(this).attr('value') == 'bar' || $(this).attr('value') == 'column') {
+ if ($(this).val() == 'bar' || $(this).val() == 'column') {
$('span.barStacked').show();
} else {
$('span.barStacked').hide();
@@ -69,7 +69,7 @@ $(document).ready(function() {
});
$('input[name="chartTitle"]').keyup(function() {
- var title = $(this).attr('value');
+ var title = $(this).val();
if (title.length == 0) {
title = ' ';
}
@@ -88,11 +88,11 @@ $(document).ready(function() {
/* Sucks, we cannot just set axis labels, we have to redraw the chart completely */
$('input[name="xaxis_label"]').keyup(function() {
- currentSettings.xAxis.title.text = $(this).attr('value');
+ currentSettings.xAxis.title.text = $(this).val();
drawChart(true);
});
$('input[name="yaxis_label"]').keyup(function() {
- currentSettings.yAxis.title.text = $(this).attr('value');
+ currentSettings.yAxis.title.text = $(this).val();
drawChart(true);
});
@@ -119,7 +119,7 @@ $(document).ready(function() {
function in_array(element, array)
{
- for (var i = 0; i < array.length; i++) {
+ for (var i = 0, l = array.length; i < l; i++) {
if (array[i] == element) {
return true;
}
@@ -133,7 +133,7 @@ function PMA_queryChart(data, passedSettings)
return;
}
- var columnNames = Array();
+ var columnNames = [];
var series = new Array();
var xaxis = { type: 'linear' };
@@ -152,7 +152,7 @@ function PMA_queryChart(data, passedSettings)
if (chart_series == 'columns') {
var j = 0;
- for (var i = 0; i 0) {
- var pmaThemeImage = $('#pmaThemeImage').attr('value');
+ var pmaThemeImage = $('#pmaThemeImage').val();
// add panning arrows
$(' ').appendTo($placeholder);
$(' ').appendTo($placeholder);
diff --git a/js/tbl_select.js b/js/tbl_select.js
index f782bf50da..87dee553a0 100644
--- a/js/tbl_select.js
+++ b/js/tbl_select.js
@@ -130,9 +130,9 @@ $(document).ready(function() {
// If the chosen function takes two geomerty objects as parameters
var $operator = $geomFuncSelector.parents('tr').find('td:nth-child(5)').find('select');
if ($.inArray($geomFuncSelector.val(), binaryFunctions) >= 0){
- $operator.attr('readonly', true);
+ $operator.prop('readonly', true);
} else {
- $operator.attr('readonly', false);
+ $operator.prop('readonly', false);
}
// if the chosen function's output is a geometry, enable GIS editor
diff --git a/js/tbl_structure.js b/js/tbl_structure.js
index 2bf841cf24..7cb05f0792 100644
--- a/js/tbl_structure.js
+++ b/js/tbl_structure.js
@@ -395,7 +395,7 @@ $(document).ready(function() {
};
var $msgbox = PMA_ajaxShowMessage();
- $.get( $form.attr('action') , $form.serialize()+"&ajax_request=true" , function(data) {
+ $.get($form.attr('action') , $form.serialize()+"&ajax_request=true" , function(data) {
//in the case of an error, show the error message returned.
if (data.success != undefined && data.success == false) {
$div
diff --git a/js/tbl_zoom_plot.js b/js/tbl_zoom_plot.js
index c7b6968e00..16dee21b11 100644
--- a/js/tbl_zoom_plot.js
+++ b/js/tbl_zoom_plot.js
@@ -318,7 +318,7 @@ $(document).ready(function() {
var yChange = false;
for (key in selectedRow) {
var oldVal = selectedRow[key];
- var newVal = ($('#fields_null_id_' + it).attr('checked')) ? null : $('#fieldID_' + it).val();
+ var newVal = ($('#fields_null_id_' + it).prop('checked')) ? null : $('#fieldID_' + it).val();
if (newVal instanceof Array) { // when the column is of type SET
newVal = $('#fieldID_' + it).map(function(){
return $(this).val();
@@ -602,11 +602,11 @@ $(document).ready(function() {
$field = $('#fieldID_' + fid);
$field_null = $('#fields_null_id_' + fid);
if (data.row_info[key] == null) {
- $field_null.attr('checked', true);
+ $field_null.prop('checked', true);
$field.val('');
} else {
- $field_null.attr('checked', false);
- if ($field.attr('multiple')) { // when the column is of type SET
+ $field_null.prop('checked', false);
+ if ($field.prop('multiple')) { // when the column is of type SET
$field.val(data.row_info[key].split(','));
} else {
$field.val(data.row_info[key]);
|