diff --git a/js/functions.js b/js/functions.js
index 07b4fcbc71..d8c30bcbc8 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -87,7 +87,7 @@ function suggestPassword(passwd_form)
passwd.value = '';
for ( i = 0; i < passwordlength; i++ ) {
- passwd.value += pwchars.charAt( Math.floor( Math.random() * pwchars.length ) )
+ passwd.value += pwchars.charAt( Math.floor( Math.random() * pwchars.length ) );
}
passwd_form.text_pma_pw.value = passwd.value;
passwd_form.text_pma_pw2.value = passwd.value;
@@ -193,8 +193,8 @@ function PMA_addDatepicker($this_element, options)
// Fix wrong timepicker z-index, doesn't work without timeout
setTimeout(function() {
- $('#ui-timepicker-div').css('z-index',$('#ui-datepicker-div').css('z-index'))
- },0);
+ $('#ui-timepicker-div').css('z-index',$('#ui-datepicker-div').css('z-index'));
+ }, 0);
}
};
@@ -480,7 +480,7 @@ function checkTableEditForm(theForm, fieldsCnt)
{
id = "#field_" + i + "_2";
elm = $(id);
- val = elm.val()
+ val = elm.val();
if (val == 'VARCHAR' || val == 'CHAR' || val == 'BIT' || val == 'VARBINARY' || val == 'BINARY') {
elm2 = $("#field_" + i + "_3");
val = parseInt(elm2.val());
@@ -524,7 +524,7 @@ $(document).ready(function() {
* next pages reached via AJAX); a tr may have the class noclick to remove
* this behavior.
*/
- $('table:not(.noclick) tr.odd:not(.noclick), table:not(.noclick) tr.even:not(.noclick)').live('click',function(e) {
+ $('table:not(.noclick) tr.odd:not(.noclick), table:not(.noclick) tr.even:not(.noclick)').live('click', function(e) {
// do not trigger when clicked on anchor
if ($(e.target).is('a, img, a *')) {
return;
@@ -684,7 +684,7 @@ function unMarkAllRows( container_id )
function setCheckboxes( container_id, state )
{
- if(state) {
+ if (state) {
$("#"+container_id).find("input:checkbox").attr('checked', 'checked');
}
else {
@@ -763,7 +763,7 @@ function insertQuery(queryType)
query = "INSERT INTO `" + table + "`(" + chaineAj + ") VALUES (" + valDis + ")";
} else if (queryType == "update") {
query = "UPDATE `" + table + "` SET " + editDis + " WHERE 1";
- } else if(queryType == "delete") {
+ } else if (queryType == "delete") {
query = "DELETE FROM `" + table + "` WHERE 1";
}
setQuery(query);
@@ -781,7 +781,7 @@ function insertValueQuery()
var myQuery = document.sqlform.sql_query;
var myListBox = document.sqlform.dummy;
- if(myListBox.options.length > 0) {
+ if (myListBox.options.length > 0) {
sql_box_locked = true;
var chaineAj = "";
var NbSelect = 0;
@@ -844,9 +844,9 @@ function refreshDragOption(e)
*/
function refreshLayout()
{
- var elm = $('#pdflayout')
+ var elm = $('#pdflayout');
var orientation = $('#orientation_opt').val();
- if($('#paper_opt').length==1){
+ if ($('#paper_opt').length==1) {
var paper = $('#paper_opt').val();
}else{
var paper = 'A4';
@@ -872,11 +872,11 @@ function ToggleDragDrop(e)
PDFinit(); /* Defined in pdf_pages.php */
elm.css('visibility', 'visible');
elm.css('display', 'block');
- $('#showwysiwyg').val('1')
+ $('#showwysiwyg').val('1');
} else {
elm.css('visibility', 'hidden');
elm.css('display', 'none');
- $('#showwysiwyg').val('0')
+ $('#showwysiwyg').val('0');
}
}
@@ -1055,8 +1055,8 @@ function pdfPaperSize(format, axis)
/**
* Jquery Coding for inline editing SQL_QUERY
*/
-$(document).ready(function(){
- $(".inline_edit_sql").live('click', function(){
+$(document).ready(function() {
+ $(".inline_edit_sql").live('click', function() {
if ($('#sql_query_edit').length) {
// An inline query editor is already open,
// we don't want another copy of it
@@ -1085,7 +1085,7 @@ $(document).ready(function(){
codemirror_editor.getScrollerElement().style.height = height;
codemirror_editor.refresh();
- $(".btnSave").click(function(){
+ $(".btnSave").click(function() {
if (codemirror_editor !== undefined) {
var sql_query = codemirror_editor.getValue();
} else {
@@ -1097,19 +1097,19 @@ $(document).ready(function(){
.append($('', {type: 'hidden', name: 'sql_query', value: sql_query}));
$fake_form.appendTo($('body')).submit();
});
- $(".btnDiscard").click(function(){
+ $(".btnDiscard").click(function() {
$(this).closest(".sql").html("" + old_text + "");
});
return false;
});
- $('.sqlbutton').click(function(evt){
+ $('.sqlbutton').click(function(evt) {
insertQuery(evt.target.id);
return false;
});
- $("#export_type").change(function(){
- if($("#export_type").val()=='svg'){
+ $("#export_type").change(function() {
+ if ($("#export_type").val()=='svg') {
$("#show_grid_opt").attr("disabled","disabled");
$("#orientation_opt").attr("disabled","disabled");
$("#with_doc").attr("disabled","disabled");
@@ -1118,7 +1118,7 @@ $(document).ready(function(){
$("#paper_opt").removeAttr("disabled","disabled");
$("#show_color_opt").removeAttr("disabled","disabled");
//$(this).css("background-color","yellow");
- }else if($("#export_type").val()=='dia'){
+ } else if ($("#export_type").val()=='dia') {
$("#show_grid_opt").attr("disabled","disabled");
$("#with_doc").attr("disabled","disabled");
$("#show_table_dim_opt").attr("disabled","disabled");
@@ -1126,7 +1126,7 @@ $(document).ready(function(){
$("#paper_opt").removeAttr("disabled","disabled");
$("#show_color_opt").removeAttr("disabled","disabled");
$("#orientation_opt").removeAttr("disabled","disabled");
- }else if($("#export_type").val()=='eps'){
+ } else if ($("#export_type").val()=='eps') {
$("#show_grid_opt").attr("disabled","disabled");
$("#orientation_opt").removeAttr("disabled");
$("#with_doc").attr("disabled","disabled");
@@ -1135,7 +1135,7 @@ $(document).ready(function(){
$("#paper_opt").attr("disabled","disabled");
$("#show_color_opt").attr("disabled","disabled");
- }else if($("#export_type").val()=='pdf'){
+ } else if ($("#export_type").val()=='pdf') {
$("#show_grid_opt").removeAttr("disabled");
$("#orientation_opt").removeAttr("disabled");
$("#with_doc").removeAttr("disabled","disabled");
@@ -1143,7 +1143,7 @@ $(document).ready(function(){
$("#all_table_same_wide").removeAttr("disabled","disabled");
$("#paper_opt").removeAttr("disabled","disabled");
$("#show_color_opt").removeAttr("disabled","disabled");
- }else{
+ } else {
// nothing
}
});
@@ -1362,10 +1362,14 @@ function PMA_createTableDialog( $div, url , target)
*/
var button_options = {};
// in the following function we need to use $(this)
- button_options[PMA_messages['strCancel']] = function() {$(this).closest('.ui-dialog-content').dialog('close').remove();}
+ button_options[PMA_messages['strCancel']] = function() {
+ $(this).closest('.ui-dialog-content').dialog('close').remove();
+ };
var button_options_error = {};
- button_options_error[PMA_messages['strOK']] = function() {$(this).closest('.ui-dialog-content').dialog('close').remove();}
+ button_options_error[PMA_messages['strOK']] = function() {
+ $(this).closest('.ui-dialog-content').dialog('close').remove();
+ };
var $msgbox = PMA_ajaxShowMessage();
@@ -1479,7 +1483,7 @@ function PMA_createChart(passedSettings)
// No realtime updates for graphs that are being exported, and disabled when realtime is not set
// Also don't do live charting if we don't have the server time
- if(thisChart.options.chart.forExport == true ||
+ if (thisChart.options.chart.forExport == true ||
! thisChart.options.realtime ||
! thisChart.options.realtime.callback ||
! server_time_diff) return;
@@ -1492,7 +1496,7 @@ function PMA_createChart(passedSettings)
try {
curValue = jQuery.parseJSON(data);
} catch (err) {
- if(thisChart.options.realtime.error)
+ if (thisChart.options.realtime.error)
thisChart.options.realtime.error(err);
return;
}
@@ -1509,7 +1513,7 @@ function PMA_createChart(passedSettings)
false
);
- thisChart.options.realtime.callback(thisChart,curValue,lastValue,numLoadedPoints);
+ thisChart.options.realtime.callback(thisChart, curValue, lastValue, numLoadedPoints);
lastValue = curValue;
numLoadedPoints++;
@@ -1524,7 +1528,7 @@ function PMA_createChart(passedSettings)
thisChart.options.realtime.refreshRate
);
});
- }
+ };
chart_activeTimeouts[container] = setTimeout(thisChart.options.realtime.timeoutCallBack, 5);
}
@@ -1565,29 +1569,29 @@ function PMA_createChart(passedSettings)
enabled: true
},
series: []
- }
+ };
/* Set/Get realtime chart default values */
- if(passedSettings.realtime) {
- if(!passedSettings.realtime.refreshRate) {
+ if (passedSettings.realtime) {
+ if (!passedSettings.realtime.refreshRate) {
passedSettings.realtime.refreshRate = 5000;
}
- if(!passedSettings.realtime.numMaxPoints) {
+ if (!passedSettings.realtime.numMaxPoints) {
passedSettings.realtime.numMaxPoints = 30;
}
// Allow custom POST vars to be added
- passedSettings.realtime.postData = $.extend(false,{ ajax_request: true, chart_data: 1, type: passedSettings.realtime.type },passedSettings.realtime.postData);
+ passedSettings.realtime.postData = $.extend(false, { ajax_request: true, chart_data: 1, type: passedSettings.realtime.type }, passedSettings.realtime.postData);
- if(server_time_diff) {
+ if (server_time_diff) {
settings.xAxis.min = new Date().getTime() - server_time_diff - passedSettings.realtime.numMaxPoints * passedSettings.realtime.refreshRate;
settings.xAxis.max = new Date().getTime() - server_time_diff + passedSettings.realtime.refreshRate;
}
}
// Overwrite/Merge default settings with passedsettings
- $.extend(true,settings,passedSettings);
+ $.extend(true, settings, passedSettings);
return new Highcharts.Chart(settings);
}
@@ -1627,7 +1631,7 @@ function PMA_createProfilingChart(data, options)
return ''+ this.point.name +'
'+PMA_prettyProfilingNum(this.y)+'
('+Highcharts.numberFormat(this.percentage, 2) +' %)';
}
}
- },options));
+ }, options));
}
/**
@@ -1642,7 +1646,7 @@ function PMA_prettyProfilingNum(num, acc)
if (!acc) {
acc = 2;
}
- acc = Math.pow(10,acc);
+ acc = Math.pow(10, acc);
if (num * 1000 < 0.1) {
num = Math.round(acc * (num * 1000 * 1000)) / acc + 'ยต';
} else if (num < 0.1) {
@@ -1691,14 +1695,14 @@ function PMA_SQLPrettyPrint(string)
while (! stream.eol()) {
stream.start = stream.pos;
token = mode.token(stream, state);
- if(token != null) {
+ if (token != null) {
tokens.push([token, stream.current().toLowerCase()]);
}
}
var currentStatement = tokens[0][1];
- if(! statements[currentStatement]) {
+ if (! statements[currentStatement]) {
return string;
}
// Holds all currently opened code blocks (statement, function or generic)
@@ -1791,7 +1795,7 @@ function PMA_SQLPrettyPrint(string)
output += "\n" + tabs(indentLevel + 1);
}
// Todo: Also split and or blocks in newlines & identation++
- //if(blockStack[0] == 'generic')
+ //if (blockStack[0] == 'generic')
// output += ...
}
}
@@ -1818,16 +1822,16 @@ jQuery.fn.PMA_confirm = function(question, url, callbackFn) {
* dialog
*/
var button_options = {};
- button_options[PMA_messages['strOK']] = function(){
+ button_options[PMA_messages['strOK']] = function() {
$(this).dialog("close");
- if($.isFunction(callbackFn)) {
+ if ($.isFunction(callbackFn)) {
callbackFn.call(this, url);
}
};
button_options[PMA_messages['strCancel']] = function() {
$(this).dialog("close");
- }
+ };
$('