Various spacing and identation fixes
This commit is contained in:
parent
b9aa5280b1
commit
a1b6f206b2
@ -19,7 +19,7 @@ OpenLayers.Util.OSM.originalOnImageLoadError = OpenLayers.Util.onImageLoadError;
|
||||
/**
|
||||
* Function: onImageLoadError
|
||||
*/
|
||||
OpenLayers.Util.onImageLoadError = function() {
|
||||
OpenLayers.Util.onImageLoadError = function () {
|
||||
if (this.src.match(/^http:\/\/[abc]\.[a-z]+\.openstreetmap\.org\//)) {
|
||||
this.src = OpenLayers.Util.OSM.MISSING_TILE_URL;
|
||||
} else if (this.src.match(/^http:\/\/[def]\.tah\.openstreetmap\.org\//)) {
|
||||
@ -43,7 +43,7 @@ OpenLayers.Layer.OSM.Mapnik = OpenLayers.Class(OpenLayers.Layer.OSM, {
|
||||
* name - {String}
|
||||
* options - {Object} Hashtable of extra options to tag onto the layer
|
||||
*/
|
||||
initialize: function(name, options) {
|
||||
initialize: function (name, options) {
|
||||
var url = [
|
||||
"http://a.tile.openstreetmap.org/${z}/${x}/${y}.png",
|
||||
"http://b.tile.openstreetmap.org/${z}/${x}/${y}.png",
|
||||
@ -75,7 +75,7 @@ OpenLayers.Layer.OSM.Osmarender = OpenLayers.Class(OpenLayers.Layer.OSM, {
|
||||
* name - {String}
|
||||
* options - {Object} Hashtable of extra options to tag onto the layer
|
||||
*/
|
||||
initialize: function(name, options) {
|
||||
initialize: function (name, options) {
|
||||
var url = [
|
||||
"http://a.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png",
|
||||
"http://b.tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png",
|
||||
@ -107,7 +107,7 @@ OpenLayers.Layer.OSM.CycleMap = OpenLayers.Class(OpenLayers.Layer.OSM, {
|
||||
* name - {String}
|
||||
* options - {Object} Hashtable of extra options to tag onto the layer
|
||||
*/
|
||||
initialize: function(name, options) {
|
||||
initialize: function (name, options) {
|
||||
var url = [
|
||||
"http://a.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png",
|
||||
"http://b.tile.opencyclemap.org/cycle/${z}/${x}/${y}.png",
|
||||
|
||||
@ -553,7 +553,7 @@ AJAX.cache = {
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
size: function(obj) {
|
||||
size: function (obj) {
|
||||
var size = 0, key;
|
||||
for (key in obj) {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
@ -714,7 +714,7 @@ AJAX.setUrlHash = (function (jQuery, window) {
|
||||
} else {
|
||||
// We don't have a valid hash, so we'll set it up
|
||||
// when the page finishes loading
|
||||
jQuery(function(){
|
||||
jQuery(function (){
|
||||
/* Check if we should set URL */
|
||||
if (savedHash !== "") {
|
||||
window.location.hash = savedHash;
|
||||
@ -728,7 +728,7 @@ AJAX.setUrlHash = (function (jQuery, window) {
|
||||
/**
|
||||
* Register an event handler for when the url hash changes
|
||||
*/
|
||||
jQuery(function(){
|
||||
jQuery(function (){
|
||||
jQuery(window).hashchange(function () {
|
||||
if (userChange === false) {
|
||||
// Ignore internally triggered hash changes
|
||||
@ -788,7 +788,7 @@ $('form').live('submit', AJAX.requestHandler);
|
||||
* Gracefully handle fatal server errors
|
||||
* (e.g: 500 - Internal server error)
|
||||
*/
|
||||
$(document).ajaxError(function(event, request, settings){
|
||||
$(document).ajaxError(function (event, request, settings){
|
||||
if (request.status !== 0) { // Don't handle aborted requests
|
||||
var errorCode = $.sprintf(PMA_messages['strErrorCode'], request.status);
|
||||
var errorText = $.sprintf(PMA_messages['strErrorText'], request.statusText);
|
||||
|
||||
86
js/chart.js
86
js/chart.js
@ -14,10 +14,10 @@ var ChartType = {
|
||||
/**
|
||||
* Abstract chart factory which defines the contract for chart factories
|
||||
*/
|
||||
var ChartFactory = function() {
|
||||
var ChartFactory = function () {
|
||||
};
|
||||
ChartFactory.prototype = {
|
||||
createChart : function(type, options) {
|
||||
createChart : function (type, options) {
|
||||
throw new Error("createChart must be implemented by a subclass");
|
||||
}
|
||||
};
|
||||
@ -28,17 +28,17 @@ ChartFactory.prototype = {
|
||||
* @param elementId
|
||||
* id of the div element the chart is drawn in
|
||||
*/
|
||||
var Chart = function(elementId) {
|
||||
var Chart = function (elementId) {
|
||||
this.elementId = elementId;
|
||||
};
|
||||
Chart.prototype = {
|
||||
draw : function(data, options) {
|
||||
draw : function (data, options) {
|
||||
throw new Error("draw must be implemented by a subclass");
|
||||
},
|
||||
redraw : function(options) {
|
||||
redraw : function (options) {
|
||||
throw new Error("redraw must be implemented by a subclass");
|
||||
},
|
||||
destroy : function() {
|
||||
destroy : function () {
|
||||
throw new Error("destroy must be implemented by a subclass");
|
||||
}
|
||||
};
|
||||
@ -55,12 +55,12 @@ Chart.prototype = {
|
||||
* @param elementId
|
||||
* id of the div element the chart is drawn in
|
||||
*/
|
||||
var BaseChart = function(elementId) {
|
||||
var BaseChart = function (elementId) {
|
||||
Chart.call(this, elementId);
|
||||
};
|
||||
BaseChart.prototype = new Chart();
|
||||
BaseChart.prototype.constructor = BaseChart;
|
||||
BaseChart.prototype.validateColumns = function(dataTable) {
|
||||
BaseChart.prototype.validateColumns = function (dataTable) {
|
||||
var columns = dataTable.getColumns();
|
||||
if (columns.length < 2) {
|
||||
throw new Error("Minimum of two columns are required for this chart");
|
||||
@ -79,12 +79,12 @@ BaseChart.prototype.validateColumns = function(dataTable) {
|
||||
* @param elementId
|
||||
* id of the div element the chart is drawn in
|
||||
*/
|
||||
var PieChart = function(elementId) {
|
||||
var PieChart = function (elementId) {
|
||||
BaseChart.call(this, elementId);
|
||||
};
|
||||
PieChart.prototype = new BaseChart();
|
||||
PieChart.prototype.constructor = PieChart;
|
||||
PieChart.prototype.validateColumns = function(dataTable) {
|
||||
PieChart.prototype.validateColumns = function (dataTable) {
|
||||
var columns = dataTable.getColumns();
|
||||
if (columns.length > 2) {
|
||||
throw new Error("Pie charts can draw only one series");
|
||||
@ -98,12 +98,12 @@ PieChart.prototype.validateColumns = function(dataTable) {
|
||||
* @param elementId
|
||||
* id of the div element the chart is drawn in
|
||||
*/
|
||||
var TimelineChart = function(elementId) {
|
||||
var TimelineChart = function (elementId) {
|
||||
BaseChart.call(this, elementId);
|
||||
};
|
||||
TimelineChart.prototype = new BaseChart();
|
||||
TimelineChart.prototype.constructor = TimelineChart;
|
||||
TimelineChart.prototype.validateColumns = function(dataTable) {
|
||||
TimelineChart.prototype.validateColumns = function (dataTable) {
|
||||
var result = BaseChart.prototype.validateColumns.call(this, dataTable);
|
||||
if (result) {
|
||||
var columns = dataTable.getColumns();
|
||||
@ -117,31 +117,31 @@ TimelineChart.prototype.validateColumns = function(dataTable) {
|
||||
/**
|
||||
* The data table contains column information and data for the chart.
|
||||
*/
|
||||
var DataTable = function() {
|
||||
var DataTable = function () {
|
||||
var columns = [];
|
||||
var data;
|
||||
|
||||
this.addColumn = function(type, name) {
|
||||
this.addColumn = function (type, name) {
|
||||
columns.push({
|
||||
'type' : type,
|
||||
'name' : name
|
||||
});
|
||||
};
|
||||
|
||||
this.getColumns = function() {
|
||||
this.getColumns = function () {
|
||||
return columns;
|
||||
};
|
||||
|
||||
this.setData = function(rows) {
|
||||
this.setData = function (rows) {
|
||||
data = rows;
|
||||
fillMissingValues();
|
||||
};
|
||||
|
||||
this.getData = function() {
|
||||
this.getData = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
var fillMissingValues = function() {
|
||||
var fillMissingValues = function () {
|
||||
if (columns.length === 0) {
|
||||
throw new Error("Set columns first");
|
||||
}
|
||||
@ -176,10 +176,10 @@ var ColumnType = {
|
||||
/**
|
||||
* Chart factory that returns JQPlotCharts
|
||||
*/
|
||||
var JQPlotChartFactory = function() {
|
||||
var JQPlotChartFactory = function () {
|
||||
};
|
||||
JQPlotChartFactory.prototype = new ChartFactory();
|
||||
JQPlotChartFactory.prototype.createChart = function(type, elementId) {
|
||||
JQPlotChartFactory.prototype.createChart = function (type, elementId) {
|
||||
var chart;
|
||||
switch (type) {
|
||||
case ChartType.LINE:
|
||||
@ -214,33 +214,33 @@ JQPlotChartFactory.prototype.createChart = function(type, elementId) {
|
||||
* @param elementId
|
||||
* id of the div element the chart is drawn in
|
||||
*/
|
||||
var JQPlotChart = function(elementId) {
|
||||
var JQPlotChart = function (elementId) {
|
||||
Chart.call(this, elementId);
|
||||
this.plot;
|
||||
this.validator;
|
||||
};
|
||||
JQPlotChart.prototype = new Chart();
|
||||
JQPlotChart.prototype.constructor = JQPlotChart;
|
||||
JQPlotChart.prototype.draw = function(data, options) {
|
||||
JQPlotChart.prototype.draw = function (data, options) {
|
||||
if (this.validator.validateColumns(data)) {
|
||||
this.plot = $.jqplot(this.elementId, this.prepareData(data), this
|
||||
.populateOptions(data, options));
|
||||
}
|
||||
};
|
||||
JQPlotChart.prototype.destroy = function() {
|
||||
JQPlotChart.prototype.destroy = function () {
|
||||
if (this.plot !== null) {
|
||||
this.plot.destroy();
|
||||
}
|
||||
};
|
||||
JQPlotChart.prototype.redraw = function(options) {
|
||||
JQPlotChart.prototype.redraw = function (options) {
|
||||
if (this.plot !== null) {
|
||||
this.plot.replot(options);
|
||||
}
|
||||
};
|
||||
JQPlotChart.prototype.populateOptions = function(dataTable, options) {
|
||||
JQPlotChart.prototype.populateOptions = function (dataTable, options) {
|
||||
throw new Error("populateOptions must be implemented by a subclass");
|
||||
};
|
||||
JQPlotChart.prototype.prepareData = function(dataTable) {
|
||||
JQPlotChart.prototype.prepareData = function (dataTable) {
|
||||
throw new Error("prepareData must be implemented by a subclass");
|
||||
};
|
||||
|
||||
@ -250,14 +250,14 @@ JQPlotChart.prototype.prepareData = function(dataTable) {
|
||||
* @param elementId
|
||||
* id of the div element the chart is drawn in
|
||||
*/
|
||||
var JQPlotLineChart = function(elementId) {
|
||||
var JQPlotLineChart = function (elementId) {
|
||||
JQPlotChart.call(this, elementId);
|
||||
this.validator = BaseChart.prototype;
|
||||
};
|
||||
JQPlotLineChart.prototype = new JQPlotChart();
|
||||
JQPlotLineChart.prototype.constructor = JQPlotLineChart;
|
||||
|
||||
JQPlotLineChart.prototype.populateOptions = function(dataTable, options) {
|
||||
JQPlotLineChart.prototype.populateOptions = function (dataTable, options) {
|
||||
var columns = dataTable.getColumns();
|
||||
var optional = {
|
||||
axes : {
|
||||
@ -291,7 +291,7 @@ JQPlotLineChart.prototype.populateOptions = function(dataTable, options) {
|
||||
return optional;
|
||||
};
|
||||
|
||||
JQPlotLineChart.prototype.prepareData = function(dataTable) {
|
||||
JQPlotLineChart.prototype.prepareData = function (dataTable) {
|
||||
var data = dataTable.getData(), row;
|
||||
var retData = [], retRow;
|
||||
for ( var i = 0; i < data.length; i++) {
|
||||
@ -314,13 +314,13 @@ JQPlotLineChart.prototype.prepareData = function(dataTable) {
|
||||
* @param elementId
|
||||
* id of the div element the chart is drawn in
|
||||
*/
|
||||
var JQPlotSplineChart = function(elementId) {
|
||||
var JQPlotSplineChart = function (elementId) {
|
||||
JQPlotLineChart.call(this, elementId);
|
||||
};
|
||||
JQPlotSplineChart.prototype = new JQPlotLineChart();
|
||||
JQPlotSplineChart.prototype.constructor = JQPlotSplineChart;
|
||||
|
||||
JQPlotSplineChart.prototype.populateOptions = function(dataTable, options) {
|
||||
JQPlotSplineChart.prototype.populateOptions = function (dataTable, options) {
|
||||
var optional = {};
|
||||
var opt = JQPlotLineChart.prototype.populateOptions.call(this, dataTable,
|
||||
options);
|
||||
@ -341,14 +341,14 @@ JQPlotSplineChart.prototype.populateOptions = function(dataTable, options) {
|
||||
* @param elementId
|
||||
* id of the div element the chart is drawn in
|
||||
*/
|
||||
var JQPlotTimelineChart = function(elementId) {
|
||||
var JQPlotTimelineChart = function (elementId) {
|
||||
JQPlotLineChart.call(this, elementId);
|
||||
this.validator = TimelineChart.prototype;
|
||||
};
|
||||
JQPlotTimelineChart.prototype = new JQPlotLineChart();
|
||||
JQPlotTimelineChart.prototype.constructor = JQPlotAreaChart;
|
||||
|
||||
JQPlotTimelineChart.prototype.populateOptions = function(dataTable, options) {
|
||||
JQPlotTimelineChart.prototype.populateOptions = function (dataTable, options) {
|
||||
var optional = {
|
||||
axes : {
|
||||
xaxis : {
|
||||
@ -370,7 +370,7 @@ JQPlotTimelineChart.prototype.populateOptions = function(dataTable, options) {
|
||||
return optional;
|
||||
};
|
||||
|
||||
JQPlotTimelineChart.prototype.prepareData = function(dataTable) {
|
||||
JQPlotTimelineChart.prototype.prepareData = function (dataTable) {
|
||||
var data = dataTable.getData(), row, d;
|
||||
var retData = [], retRow;
|
||||
for ( var i = 0; i < data.length; i++) {
|
||||
@ -396,13 +396,13 @@ JQPlotTimelineChart.prototype.prepareData = function(dataTable) {
|
||||
* @param elementId
|
||||
* id of the div element the chart is drawn in
|
||||
*/
|
||||
var JQPlotAreaChart = function(elementId) {
|
||||
var JQPlotAreaChart = function (elementId) {
|
||||
JQPlotLineChart.call(this, elementId);
|
||||
};
|
||||
JQPlotAreaChart.prototype = new JQPlotLineChart();
|
||||
JQPlotAreaChart.prototype.constructor = JQPlotAreaChart;
|
||||
|
||||
JQPlotAreaChart.prototype.populateOptions = function(dataTable, options) {
|
||||
JQPlotAreaChart.prototype.populateOptions = function (dataTable, options) {
|
||||
var optional = {
|
||||
seriesDefaults : {
|
||||
fillToZero : true
|
||||
@ -425,13 +425,13 @@ JQPlotAreaChart.prototype.populateOptions = function(dataTable, options) {
|
||||
* @param elementId
|
||||
* id of the div element the chart is drawn in
|
||||
*/
|
||||
var JQPlotColumnChart = function(elementId) {
|
||||
var JQPlotColumnChart = function (elementId) {
|
||||
JQPlotLineChart.call(this, elementId);
|
||||
};
|
||||
JQPlotColumnChart.prototype = new JQPlotLineChart();
|
||||
JQPlotColumnChart.prototype.constructor = JQPlotColumnChart;
|
||||
|
||||
JQPlotColumnChart.prototype.populateOptions = function(dataTable, options) {
|
||||
JQPlotColumnChart.prototype.populateOptions = function (dataTable, options) {
|
||||
var optional = {
|
||||
seriesDefaults : {
|
||||
fillToZero : true
|
||||
@ -454,13 +454,13 @@ JQPlotColumnChart.prototype.populateOptions = function(dataTable, options) {
|
||||
* @param elementId
|
||||
* id of the div element the chart is drawn in
|
||||
*/
|
||||
var JQPlotBarChart = function(elementId) {
|
||||
var JQPlotBarChart = function (elementId) {
|
||||
JQPlotLineChart.call(this, elementId);
|
||||
};
|
||||
JQPlotBarChart.prototype = new JQPlotLineChart();
|
||||
JQPlotBarChart.prototype.constructor = JQPlotBarChart;
|
||||
|
||||
JQPlotBarChart.prototype.populateOptions = function(dataTable, options) {
|
||||
JQPlotBarChart.prototype.populateOptions = function (dataTable, options) {
|
||||
var columns = dataTable.getColumns();
|
||||
var optional = {
|
||||
axes : {
|
||||
@ -512,14 +512,14 @@ JQPlotBarChart.prototype.populateOptions = function(dataTable, options) {
|
||||
* @param elementId
|
||||
* id of the div element the chart is drawn in
|
||||
*/
|
||||
var JQPlotPieChart = function(elementId) {
|
||||
var JQPlotPieChart = function (elementId) {
|
||||
JQPlotChart.call(this, elementId);
|
||||
this.validator = PieChart.prototype;
|
||||
};
|
||||
JQPlotPieChart.prototype = new JQPlotChart();
|
||||
JQPlotPieChart.prototype.constructor = JQPlotPieChart;
|
||||
|
||||
JQPlotPieChart.prototype.populateOptions = function(dataTable, options) {
|
||||
JQPlotPieChart.prototype.populateOptions = function (dataTable, options) {
|
||||
var optional = {};
|
||||
var compulsory = {
|
||||
seriesDefaults : {
|
||||
@ -530,7 +530,7 @@ JQPlotPieChart.prototype.populateOptions = function(dataTable, options) {
|
||||
return optional;
|
||||
};
|
||||
|
||||
JQPlotPieChart.prototype.prepareData = function(dataTable) {
|
||||
JQPlotPieChart.prototype.prepareData = function (dataTable) {
|
||||
var data = dataTable.getData(), row;
|
||||
var retData = [];
|
||||
for ( var i = 0; i < data.length; i++) {
|
||||
|
||||
@ -207,7 +207,7 @@ var PMA_querywindow = (function ($, window) {
|
||||
);
|
||||
}
|
||||
if (! querywindow.opener) {
|
||||
querywindow.opener = window.window;
|
||||
querywindow.opener = window.window;
|
||||
}
|
||||
if (window.focus) {
|
||||
querywindow.focus();
|
||||
|
||||
122
js/config.js
122
js/config.js
@ -6,7 +6,7 @@
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('config.js', function() {
|
||||
AJAX.registerTeardown('config.js', function () {
|
||||
$('input[id], select[id], textarea[id]').unbind('change').unbind('keyup');
|
||||
$('input[type=button][name=submit_reset]').unbind('click');
|
||||
$('div.tabs_contents').undelegate();
|
||||
@ -16,7 +16,7 @@ AJAX.registerTeardown('config.js', function() {
|
||||
$('#prefs_autoload').find('a').unbind('click');
|
||||
});
|
||||
|
||||
AJAX.registerOnload('config.js', function() {
|
||||
AJAX.registerOnload('config.js', function () {
|
||||
$('#topmenu2').find('li.active a').attr('rel', 'samepage');
|
||||
$('#topmenu2').find('li:not(.active) a').attr('rel', 'newpage');
|
||||
});
|
||||
@ -60,27 +60,27 @@ function setFieldValue(field, field_type, value)
|
||||
{
|
||||
field = $(field);
|
||||
switch (field_type) {
|
||||
case 'text':
|
||||
//TODO: replace to .val()
|
||||
field.attr('value', (value !== undefined ? value : field.attr('defaultValue')));
|
||||
break;
|
||||
case 'checkbox':
|
||||
//TODO: replace to .prop()
|
||||
field.attr('checked', (value !== undefined ? value : field.attr('defaultChecked')));
|
||||
break;
|
||||
case 'select':
|
||||
var options = field.prop('options');
|
||||
var i, imax = options.length;
|
||||
if (value === undefined) {
|
||||
for (i = 0; i < imax; i++) {
|
||||
options[i].selected = options[i].defaultSelected;
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < imax; i++) {
|
||||
options[i].selected = (value.indexOf(options[i].value) != -1);
|
||||
}
|
||||
case 'text':
|
||||
//TODO: replace to .val()
|
||||
field.attr('value', (value !== undefined ? value : field.attr('defaultValue')));
|
||||
break;
|
||||
case 'checkbox':
|
||||
//TODO: replace to .prop()
|
||||
field.attr('checked', (value !== undefined ? value : field.attr('defaultChecked')));
|
||||
break;
|
||||
case 'select':
|
||||
var options = field.prop('options');
|
||||
var i, imax = options.length;
|
||||
if (value === undefined) {
|
||||
for (i = 0; i < imax; i++) {
|
||||
options[i].selected = options[i].defaultSelected;
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
for (i = 0; i < imax; i++) {
|
||||
options[i].selected = (value.indexOf(options[i].value) != -1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
markField(field);
|
||||
}
|
||||
@ -101,19 +101,19 @@ function getFieldValue(field, field_type)
|
||||
{
|
||||
field = $(field);
|
||||
switch (field_type) {
|
||||
case 'text':
|
||||
return field.prop('value');
|
||||
case 'checkbox':
|
||||
return field.prop('checked');
|
||||
case 'select':
|
||||
var options = field.prop('options');
|
||||
var i, imax = options.length, items = [];
|
||||
for (i = 0; i < imax; i++) {
|
||||
if (options[i].selected) {
|
||||
items.push(options[i].value);
|
||||
}
|
||||
case 'text':
|
||||
return field.prop('value');
|
||||
case 'checkbox':
|
||||
return field.prop('checked');
|
||||
case 'select':
|
||||
var options = field.prop('options');
|
||||
var i, imax = options.length, items = [];
|
||||
for (i = 0; i < imax; i++) {
|
||||
if (options[i].selected) {
|
||||
items.push(options[i].value);
|
||||
}
|
||||
return items;
|
||||
}
|
||||
return items;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -226,7 +226,7 @@ var validators = {
|
||||
*
|
||||
* @param {boolean} isKeyUp
|
||||
*/
|
||||
validate_port_number: function(isKeyUp) {
|
||||
validate_port_number: function (isKeyUp) {
|
||||
if (this.value === '') {
|
||||
return true;
|
||||
}
|
||||
@ -239,7 +239,7 @@ var validators = {
|
||||
* @param {boolean} isKeyUp
|
||||
* @param {string} regexp
|
||||
*/
|
||||
validate_by_regex: function(isKeyUp, regexp) {
|
||||
validate_by_regex: function (isKeyUp, regexp) {
|
||||
if (isKeyUp && this.value === '') {
|
||||
return true;
|
||||
}
|
||||
@ -254,7 +254,7 @@ var validators = {
|
||||
* @param {boolean} isKeyUp
|
||||
* @param {int} max_value
|
||||
*/
|
||||
validate_upper_bound: function(isKeyUp, max_value) {
|
||||
validate_upper_bound: function (isKeyUp, max_value) {
|
||||
var val = parseInt(this.value, 10);
|
||||
if (isNaN(val)) {
|
||||
return true;
|
||||
@ -338,7 +338,7 @@ function displayErrors(error_list)
|
||||
: field.siblings('.inline_errors');
|
||||
|
||||
// remove empty errors (used to clear error list)
|
||||
errors = $.grep(errors, function(item) {
|
||||
errors = $.grep(errors, function (item) {
|
||||
return item !== '';
|
||||
});
|
||||
|
||||
@ -469,27 +469,27 @@ function setRestoreDefaultBtn(field, display)
|
||||
el[display ? 'show' : 'hide']();
|
||||
}
|
||||
|
||||
AJAX.registerOnload('config.js', function() {
|
||||
AJAX.registerOnload('config.js', function () {
|
||||
// register validators and mark custom values
|
||||
var elements = $('input[id], select[id], textarea[id]');
|
||||
$('input[id], select[id], textarea[id]').each(function(){
|
||||
$('input[id], select[id], textarea[id]').each(function (){
|
||||
markField(this);
|
||||
var el = $(this);
|
||||
el.bind('change', function() {
|
||||
el.bind('change', function () {
|
||||
validate_field_and_fieldset(this, false);
|
||||
markField(this);
|
||||
});
|
||||
var tagName = el.attr('tagName');
|
||||
// text fields can be validated after each change
|
||||
if (tagName == 'INPUT' && el.attr('type') == 'text') {
|
||||
el.keyup(function() {
|
||||
el.keyup(function () {
|
||||
validate_field_and_fieldset(el, true);
|
||||
markField(el);
|
||||
});
|
||||
}
|
||||
// disable textarea spellcheck
|
||||
if (tagName == 'TEXTAREA') {
|
||||
el.attr('spellcheck', false);
|
||||
el.attr('spellcheck', false);
|
||||
}
|
||||
});
|
||||
|
||||
@ -503,7 +503,7 @@ AJAX.registerOnload('config.js', function() {
|
||||
validate_field(elements[i], false, errors);
|
||||
}
|
||||
// run all fieldset validators
|
||||
$('fieldset').each(function(){
|
||||
$('fieldset').each(function (){
|
||||
validate_fieldset(this, false, errors);
|
||||
});
|
||||
|
||||
@ -534,14 +534,14 @@ function setTab(tab_id)
|
||||
$('form.config-form input[name=tab_hash]').val(location.hash);
|
||||
}
|
||||
|
||||
AJAX.registerOnload('config.js', function() {
|
||||
AJAX.registerOnload('config.js', function () {
|
||||
var tabs = $('ul.tabs');
|
||||
if (!tabs.length) {
|
||||
return;
|
||||
}
|
||||
// add tabs events and activate one tab (the first one or indicated by location hash)
|
||||
tabs.find('a')
|
||||
.click(function(e) {
|
||||
.click(function (e) {
|
||||
e.preventDefault();
|
||||
setTab($(this).attr('href').substr(1));
|
||||
})
|
||||
@ -553,7 +553,7 @@ AJAX.registerOnload('config.js', function() {
|
||||
// tab links handling, check each 200ms
|
||||
// (works with history in FF, further browser support here would be an overkill)
|
||||
var prev_hash;
|
||||
var tab_check_fnc = function() {
|
||||
var tab_check_fnc = function () {
|
||||
if (location.hash != prev_hash) {
|
||||
prev_hash = location.hash;
|
||||
if (location.hash.match(/^#tab_.+/) && $('#' + location.hash.substr(5)).length) {
|
||||
@ -573,8 +573,8 @@ AJAX.registerOnload('config.js', function() {
|
||||
// Form reset buttons
|
||||
//
|
||||
|
||||
AJAX.registerOnload('config.js', function() {
|
||||
$('input[type=button][name=submit_reset]').click(function() {
|
||||
AJAX.registerOnload('config.js', function () {
|
||||
$('input[type=button][name=submit_reset]').click(function () {
|
||||
var fields = $(this).closest('fieldset').find('input, select, textarea');
|
||||
for (var i = 0, imax = fields.length; i < imax; i++) {
|
||||
setFieldValue(fields[i], getFieldType(fields[i]));
|
||||
@ -604,11 +604,11 @@ function restoreField(field_id)
|
||||
setFieldValue(field, getFieldType(field), defaultValues[field_id]);
|
||||
}
|
||||
|
||||
AJAX.registerOnload('config.js', function() {
|
||||
AJAX.registerOnload('config.js', function () {
|
||||
$('div.tabs_contents')
|
||||
.delegate('.restore-default, .set-value', 'mouseenter', function(){$(this).css('opacity', 1);})
|
||||
.delegate('.restore-default, .set-value', 'mouseleave', function(){$(this).css('opacity', 0.25);})
|
||||
.delegate('.restore-default, .set-value', 'click', function(e) {
|
||||
.delegate('.restore-default, .set-value', 'mouseenter', function (){$(this).css('opacity', 1);})
|
||||
.delegate('.restore-default, .set-value', 'mouseleave', function (){$(this).css('opacity', 0.25);})
|
||||
.delegate('.restore-default, .set-value', 'click', function (e) {
|
||||
e.preventDefault();
|
||||
var href = $(this).attr('href');
|
||||
var field_sel;
|
||||
@ -635,7 +635,7 @@ AJAX.registerOnload('config.js', function() {
|
||||
// User preferences import/export
|
||||
//
|
||||
|
||||
AJAX.registerOnload('config.js', function() {
|
||||
AJAX.registerOnload('config.js', function () {
|
||||
offerPrefsAutoimport();
|
||||
var radios = $('#import_local_storage, #export_local_storage');
|
||||
if (!radios.length) {
|
||||
@ -646,7 +646,7 @@ AJAX.registerOnload('config.js', function() {
|
||||
radios
|
||||
.prop('disabled', false)
|
||||
.add('#export_text_file, #import_text_file')
|
||||
.click(function(){
|
||||
.click(function (){
|
||||
var enable_id = $(this).attr('id');
|
||||
var disable_id = enable_id.match(/local_storage$/)
|
||||
? enable_id.replace(/local_storage$/, 'text_file')
|
||||
@ -663,7 +663,7 @@ AJAX.registerOnload('config.js', function() {
|
||||
if (ls_exists) {
|
||||
updatePrefsDate();
|
||||
}
|
||||
$('form.prefs-form').change(function(){
|
||||
$('form.prefs-form').change(function (){
|
||||
var form = $(this);
|
||||
var disabled = false;
|
||||
if (!ls_supported) {
|
||||
@ -673,7 +673,7 @@ AJAX.registerOnload('config.js', function() {
|
||||
disabled = true;
|
||||
}
|
||||
form.find('input[type=submit]').prop('disabled', disabled);
|
||||
}).submit(function(e) {
|
||||
}).submit(function (e) {
|
||||
var form = $(this);
|
||||
if (form.attr('name') == 'prefs_export' && $('#export_local_storage')[0].checked) {
|
||||
e.preventDefault();
|
||||
@ -685,7 +685,7 @@ AJAX.registerOnload('config.js', function() {
|
||||
}
|
||||
});
|
||||
|
||||
$('div.click-hide-message').live('click', function(){
|
||||
$('div.click-hide-message').live('click', function (){
|
||||
$(this)
|
||||
.hide()
|
||||
.parent('.group')
|
||||
@ -714,7 +714,7 @@ function savePrefsToLocalStorage(form)
|
||||
token: form.find('input[name=token]').val(),
|
||||
submit_get_json: true
|
||||
},
|
||||
success: function(response) {
|
||||
success: function (response) {
|
||||
window.localStorage['config'] = response.prefs;
|
||||
window.localStorage['config_mtime'] = response.mtime;
|
||||
window.localStorage['config_mtime_local'] = (new Date()).toUTCString();
|
||||
@ -726,7 +726,7 @@ function savePrefsToLocalStorage(form)
|
||||
form.hide('fast');
|
||||
form.prev('.click-hide-message').show('fast');
|
||||
},
|
||||
complete: function() {
|
||||
complete: function () {
|
||||
submit.prop('disabled', false);
|
||||
}
|
||||
});
|
||||
@ -766,7 +766,7 @@ function offerPrefsAutoimport()
|
||||
if (!cnt.length || !has_config) {
|
||||
return;
|
||||
}
|
||||
cnt.find('a').click(function(e) {
|
||||
cnt.find('a').click(function (e) {
|
||||
e.preventDefault();
|
||||
var a = $(this);
|
||||
if (a.attr('href') == '#no') {
|
||||
|
||||
@ -21,18 +21,18 @@
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('db_operations.js', function() {
|
||||
AJAX.registerTeardown('db_operations.js', function () {
|
||||
$("#rename_db_form.ajax").die('submit');
|
||||
$("#copy_db_form.ajax").die('submit');
|
||||
$("#change_db_charset_form.ajax").die('submit');
|
||||
});
|
||||
|
||||
AJAX.registerOnload('db_operations.js', function() {
|
||||
AJAX.registerOnload('db_operations.js', function () {
|
||||
|
||||
/**
|
||||
* Ajax event handlers for 'Rename Database'
|
||||
*/
|
||||
$("#rename_db_form.ajax").live('submit', function(event) {
|
||||
$("#rename_db_form.ajax").live('submit', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
var $form = $(this);
|
||||
@ -41,17 +41,17 @@ AJAX.registerOnload('db_operations.js', function() {
|
||||
|
||||
PMA_prepareForAjaxRequest($form);
|
||||
|
||||
$form.PMA_confirm(question, $form.attr('action'), function(url) {
|
||||
$form.PMA_confirm(question, $form.attr('action'), function (url) {
|
||||
PMA_ajaxShowMessage(PMA_messages['strRenamingDatabases'], false);
|
||||
$.get(url, $("#rename_db_form").serialize() + '&is_js_confirmed=1', function(data) {
|
||||
$.get(url, $("#rename_db_form").serialize() + '&is_js_confirmed=1', function (data) {
|
||||
if (data.success === true) {
|
||||
PMA_ajaxShowMessage(data.message);
|
||||
PMA_commonParams.set('db', data.newname);
|
||||
|
||||
PMA_reloadNavigation(function() {
|
||||
PMA_reloadNavigation(function () {
|
||||
$('#pma_navigation_tree')
|
||||
.find("a:not('.expander')")
|
||||
.each(function(index) {
|
||||
.each(function (index) {
|
||||
var $thisAnchor = $(this);
|
||||
if ($thisAnchor.text() == data.newname) {
|
||||
// simulate a click on the new db name
|
||||
@ -70,12 +70,12 @@ AJAX.registerOnload('db_operations.js', function() {
|
||||
/**
|
||||
* Ajax Event Handler for 'Copy Database'
|
||||
*/
|
||||
$("#copy_db_form.ajax").live('submit', function(event) {
|
||||
$("#copy_db_form.ajax").live('submit', function (event) {
|
||||
event.preventDefault();
|
||||
PMA_ajaxShowMessage(PMA_messages['strCopyingDatabase'], false);
|
||||
var $form = $(this);
|
||||
PMA_prepareForAjaxRequest($form);
|
||||
$.get($form.attr('action'), $form.serialize(), function(data) {
|
||||
$.get($form.attr('action'), $form.serialize(), function (data) {
|
||||
// use messages that stay on screen
|
||||
$('div.success, div.error').fadeOut();
|
||||
if (data.success === true) {
|
||||
@ -98,12 +98,12 @@ AJAX.registerOnload('db_operations.js', function() {
|
||||
/**
|
||||
* Ajax Event handler for 'Change Charset' of the database
|
||||
*/
|
||||
$("#change_db_charset_form.ajax").live('submit', function(event) {
|
||||
$("#change_db_charset_form.ajax").live('submit', function (event) {
|
||||
event.preventDefault();
|
||||
var $form = $(this);
|
||||
PMA_prepareForAjaxRequest($form);
|
||||
PMA_ajaxShowMessage(PMA_messages['strChangingCharset']);
|
||||
$.get($form.attr('action'), $form.serialize() + "&submitcollation=1", function(data) {
|
||||
$.get($form.attr('action'), $form.serialize() + "&submitcollation=1", function (data) {
|
||||
if (data.success === true) {
|
||||
PMA_ajaxShowMessage(data.message);
|
||||
} else {
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('db_search.js', function() {
|
||||
AJAX.registerTeardown('db_search.js', function () {
|
||||
$('#buttonGo').unbind('click');
|
||||
$('#togglesearchresultlink').unbind('click');
|
||||
$("#togglequerybox").unbind('click');
|
||||
@ -36,7 +36,7 @@ AJAX.registerTeardown('db_search.js', function() {
|
||||
*/
|
||||
function loadResult(result_path, table_name, link)
|
||||
{
|
||||
$(function() {
|
||||
$(function () {
|
||||
/** Hides the results shown by the delete criteria */
|
||||
var $msg = PMA_ajaxShowMessage(PMA_messages['strBrowsing'], false);
|
||||
$('#sqlqueryform').hide();
|
||||
@ -45,7 +45,7 @@ function loadResult(result_path, table_name, link)
|
||||
$("#table-info").show();
|
||||
$('#table-link').attr({"href" : 'sql.php?'+link }).text(table_name);
|
||||
var url = result_path + " #sqlqueryresults";
|
||||
$('#browse-results').load(url, null, function() {
|
||||
$('#browse-results').load(url, null, function () {
|
||||
$('html, body')
|
||||
.animate({
|
||||
scrollTop: $("#browse-results").offset().top
|
||||
@ -66,7 +66,7 @@ function loadResult(result_path, table_name, link)
|
||||
*/
|
||||
function deleteResult(result_path, msg)
|
||||
{
|
||||
$(function() {
|
||||
$(function () {
|
||||
/** Hides the results shown by the browse criteria */
|
||||
$("#table-info").hide();
|
||||
$('#browse-results').hide();
|
||||
@ -92,17 +92,17 @@ function deleteResult(result_path, msg)
|
||||
}, 1000);
|
||||
PMA_ajaxRemoveMessage($msg);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
AJAX.registerOnload('db_search.js', function() {
|
||||
AJAX.registerOnload('db_search.js', function () {
|
||||
/** Hide the table link in the initial search result */
|
||||
var icon = PMA_getImage('s_tbl.png', '', {'id': 'table-image'}).toString();
|
||||
$("#table-info").prepend(icon).hide();
|
||||
|
||||
/** Hide the browse and deleted results in the new search criteria */
|
||||
$('#buttonGo').click(function(){
|
||||
$('#buttonGo').click(function (){
|
||||
$("#table-info").hide();
|
||||
$('#browse-results').hide();
|
||||
$('#sqlqueryform').hide();
|
||||
@ -123,16 +123,16 @@ AJAX.registerOnload('db_search.js', function() {
|
||||
*/
|
||||
$('#togglesearchresultlink')
|
||||
.html(PMA_messages['strHideSearchResults'])
|
||||
.bind('click', function() {
|
||||
var $link = $(this);
|
||||
$('#searchresults').slideToggle();
|
||||
if ($link.text() == PMA_messages['strHideSearchResults']) {
|
||||
$link.text(PMA_messages['strShowSearchResults']);
|
||||
} else {
|
||||
$link.text(PMA_messages['strHideSearchResults']);
|
||||
}
|
||||
/** avoid default click action */
|
||||
return false;
|
||||
.bind('click', function () {
|
||||
var $link = $(this);
|
||||
$('#searchresults').slideToggle();
|
||||
if ($link.text() == PMA_messages['strHideSearchResults']) {
|
||||
$link.text(PMA_messages['strShowSearchResults']);
|
||||
} else {
|
||||
$link.text(PMA_messages['strHideSearchResults']);
|
||||
}
|
||||
/** avoid default click action */
|
||||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
@ -149,7 +149,7 @@ AJAX.registerOnload('db_search.js', function() {
|
||||
*/
|
||||
$("#togglequerybox")
|
||||
.hide()
|
||||
.bind('click', function() {
|
||||
.bind('click', function () {
|
||||
var $link = $(this);
|
||||
$('#sqlqueryform').slideToggle("medium");
|
||||
if ($link.text() == PMA_messages['strHideQueryBox']) {
|
||||
@ -163,13 +163,13 @@ AJAX.registerOnload('db_search.js', function() {
|
||||
|
||||
/** don't show it until we have results on-screen */
|
||||
|
||||
/**
|
||||
* Changing the displayed text according to
|
||||
* the hide/show criteria in search criteria form
|
||||
*/
|
||||
$('#togglesearchformlink')
|
||||
/**
|
||||
* Changing the displayed text according to
|
||||
* the hide/show criteria in search criteria form
|
||||
*/
|
||||
$('#togglesearchformlink')
|
||||
.html(PMA_messages['strShowSearchCriteria'])
|
||||
.bind('click', function() {
|
||||
.bind('click', function () {
|
||||
var $link = $(this);
|
||||
$('#db_search_form').slideToggle();
|
||||
if ($link.text() == PMA_messages['strHideSearchCriteria']) {
|
||||
@ -179,11 +179,11 @@ AJAX.registerOnload('db_search.js', function() {
|
||||
}
|
||||
/** avoid default click action */
|
||||
return false;
|
||||
});
|
||||
});
|
||||
/**
|
||||
* Ajax Event handler for retrieving the result of an SQL Query
|
||||
*/
|
||||
$("#db_search_form.ajax").live('submit', function(event) {
|
||||
$("#db_search_form.ajax").live('submit', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
var $msgbox = PMA_ajaxShowMessage(PMA_messages['strSearching'], false);
|
||||
@ -193,7 +193,7 @@ AJAX.registerOnload('db_search.js', function() {
|
||||
PMA_prepareForAjaxRequest($form);
|
||||
|
||||
var url = $form.serialize() + "&submit_search=" + $("#buttonGo").val();
|
||||
$.post($form.attr('action'), url, function(data) {
|
||||
$.post($form.attr('action'), url, function (data) {
|
||||
if (data.success === true) {
|
||||
// found results
|
||||
$("#searchresults").html(data.message);
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('db_structure.js', function() {
|
||||
AJAX.registerTeardown('db_structure.js', function () {
|
||||
$("span.fkc_switch").unbind('click');
|
||||
$('#fkc_checkbox').unbind('change');
|
||||
$("a.truncate_table_anchor.ajax").die('click');
|
||||
@ -129,7 +129,7 @@ function PMA_adjustTotals() {
|
||||
$summary.find('.tbl_overhead').text(overheadSum + " " + byteUnits[overhead_magnitude]);
|
||||
}
|
||||
|
||||
AJAX.registerOnload('db_structure.js', function() {
|
||||
AJAX.registerOnload('db_structure.js', function () {
|
||||
/**
|
||||
* Handler for the print view multisubmit.
|
||||
* All other multi submits can be handled via ajax, but this one needs
|
||||
@ -159,14 +159,14 @@ AJAX.registerOnload('db_structure.js', function() {
|
||||
* Event handler for 'Foreign Key Checks' disabling option
|
||||
* in the drop table confirmation form
|
||||
*/
|
||||
$("span.fkc_switch").click(function(event){
|
||||
if ($("#fkc_checkbox").prop('checked')) {
|
||||
$("#fkc_checkbox").prop('checked', false);
|
||||
$("#fkc_status").html(PMA_messages['strForeignKeyCheckDisabled']);
|
||||
return;
|
||||
}
|
||||
$("#fkc_checkbox").prop('checked', true);
|
||||
$("#fkc_status").html(PMA_messages['strForeignKeyCheckEnabled']);
|
||||
$("span.fkc_switch").click(function (event){
|
||||
if ($("#fkc_checkbox").prop('checked')) {
|
||||
$("#fkc_checkbox").prop('checked', false);
|
||||
$("#fkc_status").html(PMA_messages['strForeignKeyCheckDisabled']);
|
||||
return;
|
||||
}
|
||||
$("#fkc_checkbox").prop('checked', true);
|
||||
$("#fkc_status").html(PMA_messages['strForeignKeyCheckEnabled']);
|
||||
});
|
||||
|
||||
$('#fkc_checkbox').change(function () {
|
||||
@ -180,7 +180,7 @@ AJAX.registerOnload('db_structure.js', function() {
|
||||
/**
|
||||
* Ajax Event handler for 'Truncate Table'
|
||||
*/
|
||||
$("a.truncate_table_anchor.ajax").live('click', function(event) {
|
||||
$("a.truncate_table_anchor.ajax").live('click', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
/**
|
||||
@ -200,11 +200,11 @@ AJAX.registerOnload('db_structure.js', function() {
|
||||
PMA_messages.strTruncateTableStrongWarning + ' '
|
||||
+ $.sprintf(PMA_messages.strDoYouReally, 'TRUNCATE ' + escapeHtml(curr_table_name));
|
||||
|
||||
$this_anchor.PMA_confirm(question, $this_anchor.attr('href'), function(url) {
|
||||
$this_anchor.PMA_confirm(question, $this_anchor.attr('href'), function (url) {
|
||||
|
||||
PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']);
|
||||
|
||||
$.get(url, {'is_js_confirmed' : 1, 'ajax_request' : true}, function(data) {
|
||||
$.get(url, {'is_js_confirmed' : 1, 'ajax_request' : true}, function (data) {
|
||||
if (data.success === true) {
|
||||
PMA_ajaxShowMessage(data.message);
|
||||
// Adjust table statistics
|
||||
@ -230,7 +230,7 @@ AJAX.registerOnload('db_structure.js', function() {
|
||||
/**
|
||||
* Ajax Event handler for 'Drop Table' or 'Drop View'
|
||||
*/
|
||||
$("a.drop_table_anchor.ajax").live('click', function(event) {
|
||||
$("a.drop_table_anchor.ajax").live('click', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
var $this_anchor = $(this);
|
||||
@ -261,11 +261,11 @@ AJAX.registerOnload('db_structure.js', function() {
|
||||
$.sprintf(PMA_messages.strDoYouReally, 'DROP VIEW ' + escapeHtml(curr_table_name));
|
||||
}
|
||||
|
||||
$this_anchor.PMA_confirm(question, $this_anchor.attr('href'), function(url) {
|
||||
$this_anchor.PMA_confirm(question, $this_anchor.attr('href'), function (url) {
|
||||
|
||||
var $msg = PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']);
|
||||
|
||||
$.get(url, {'is_js_confirmed' : 1, 'ajax_request' : true}, function(data) {
|
||||
$.get(url, {'is_js_confirmed' : 1, 'ajax_request' : true}, function (data) {
|
||||
if (data.success === true) {
|
||||
PMA_ajaxShowMessage(data.message);
|
||||
toggleRowColors($curr_row.next());
|
||||
@ -283,7 +283,7 @@ AJAX.registerOnload('db_structure.js', function() {
|
||||
/**
|
||||
* Ajax Event handler for 'Drop tracking'
|
||||
*/
|
||||
$('a.drop_tracking_anchor.ajax').live('click', function(event) {
|
||||
$('a.drop_tracking_anchor.ajax').live('click', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
var $anchor = $(this);
|
||||
@ -297,11 +297,11 @@ AJAX.registerOnload('db_structure.js', function() {
|
||||
*/
|
||||
var question = PMA_messages['strDeleteTrackingData'];
|
||||
|
||||
$anchor.PMA_confirm(question, $anchor.attr('href'), function(url) {
|
||||
$anchor.PMA_confirm(question, $anchor.attr('href'), function (url) {
|
||||
|
||||
PMA_ajaxShowMessage(PMA_messages['strDeletingTrackingData']);
|
||||
|
||||
$.get(url, {'is_js_confirmed': 1, 'ajax_request': true}, function(data) {
|
||||
$.get(url, {'is_js_confirmed': 1, 'ajax_request': true}, function (data) {
|
||||
if (data.success === true) {
|
||||
var $tracked_table = $curr_tracking_row.parents('table');
|
||||
var table_name = $curr_tracking_row.find('td:nth-child(2)').text();
|
||||
@ -313,7 +313,7 @@ AJAX.registerOnload('db_structure.js', function() {
|
||||
} else {
|
||||
// There are more rows left after the deletion
|
||||
toggleRowColors($curr_tracking_row.next());
|
||||
$curr_tracking_row.hide("slow", function() {
|
||||
$curr_tracking_row.hide("slow", function () {
|
||||
$(this).remove();
|
||||
});
|
||||
}
|
||||
@ -325,7 +325,7 @@ AJAX.registerOnload('db_structure.js', function() {
|
||||
if ($untracked_table.length > 0) {
|
||||
var $rows = $untracked_table.find('tbody tr');
|
||||
|
||||
$rows.each(function(index) {
|
||||
$rows.each(function (index) {
|
||||
var $row = $(this);
|
||||
var tmp_tbl_name = $row.find('td:first-child').text();
|
||||
var is_last_iteration = (index == ($rows.length - 1));
|
||||
@ -369,7 +369,7 @@ AJAX.registerOnload('db_structure.js', function() {
|
||||
* Ajax Event handler for calculatig the real end for a InnoDB table
|
||||
*
|
||||
*/
|
||||
$('#real_end_input').live('click', function(event) {
|
||||
$('#real_end_input').live('click', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
/**
|
||||
@ -377,7 +377,7 @@ AJAX.registerOnload('db_structure.js', function() {
|
||||
*/
|
||||
var question = PMA_messages['strOperationTakesLongTime'];
|
||||
|
||||
$(this).PMA_confirm(question, '', function() {
|
||||
$(this).PMA_confirm(question, '', function () {
|
||||
return true;
|
||||
});
|
||||
return false;
|
||||
|
||||
30
js/export.js
30
js/export.js
@ -7,7 +7,7 @@
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('export.js', function() {
|
||||
AJAX.registerTeardown('export.js', function () {
|
||||
$("#plugins").unbind('change');
|
||||
$("input[type='radio'][name='sql_structure_or_data']").unbind('change');
|
||||
$("input[type='radio'][name='latex_structure_or_data']").unbind('change');
|
||||
@ -27,16 +27,16 @@ 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").change(function () {
|
||||
$("#format_specific_opts div.format_specific_options").hide();
|
||||
var selected_plugin_name = $("#plugins option:selected").val();
|
||||
$("#" + selected_plugin_name + "_options").show();
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* 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']").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') {
|
||||
@ -54,7 +54,7 @@ AJAX.registerOnload('export.js', function () {
|
||||
$("#checkbox_sql_relation").removeProp('disabled').parent().fadeTo('fast', 1);
|
||||
$("#checkbox_sql_mime").removeProp('disabled').parent().fadeTo('fast', 1);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -82,19 +82,19 @@ function toggle_structure_data_opts(pluginName)
|
||||
}
|
||||
|
||||
AJAX.registerOnload('export.js', function () {
|
||||
$("input[type='radio'][name='latex_structure_or_data']").change(function() {
|
||||
$("input[type='radio'][name='latex_structure_or_data']").change(function () {
|
||||
toggle_structure_data_opts("latex");
|
||||
});
|
||||
$("input[type='radio'][name='odt_structure_or_data']").change(function() {
|
||||
$("input[type='radio'][name='odt_structure_or_data']").change(function () {
|
||||
toggle_structure_data_opts("odt");
|
||||
});
|
||||
$("input[type='radio'][name='texytext_structure_or_data']").change(function() {
|
||||
$("input[type='radio'][name='texytext_structure_or_data']").change(function () {
|
||||
toggle_structure_data_opts("texytext");
|
||||
});
|
||||
$("input[type='radio'][name='htmlword_structure_or_data']").change(function() {
|
||||
$("input[type='radio'][name='htmlword_structure_or_data']").change(function () {
|
||||
toggle_structure_data_opts("htmlword");
|
||||
});
|
||||
$("input[type='radio'][name='sql_structure_or_data']").change(function() {
|
||||
$("input[type='radio'][name='sql_structure_or_data']").change(function () {
|
||||
toggle_structure_data_opts("sql");
|
||||
});
|
||||
});
|
||||
@ -125,7 +125,7 @@ AJAX.registerOnload('export.js', function () {
|
||||
*/
|
||||
function toggle_sql_include_comments()
|
||||
{
|
||||
$("#checkbox_sql_include_comments").change(function() {
|
||||
$("#checkbox_sql_include_comments").change(function () {
|
||||
if (!$("#checkbox_sql_include_comments").prop("checked")) {
|
||||
$("#ul_include_comments > li").fadeTo('fast', 0.4);
|
||||
$("#ul_include_comments > li > input").prop('disabled', true);
|
||||
@ -147,10 +147,10 @@ AJAX.registerOnload('export.js', function () {
|
||||
*/
|
||||
var $create = $("#checkbox_sql_create_table_statements");
|
||||
var $create_options = $("#ul_create_table_statements input");
|
||||
$create.change(function() {
|
||||
$create.change(function () {
|
||||
$create_options.prop('checked', $(this).prop("checked"));
|
||||
});
|
||||
$create_options.change(function() {
|
||||
$create_options.change(function () {
|
||||
if ($create_options.is(":checked")) {
|
||||
$create.prop('checked', true);
|
||||
}
|
||||
@ -159,7 +159,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").change(function () {
|
||||
var active_plugin = $("#plugins option:selected").val();
|
||||
var force_file = $("#force_file_" + active_plugin).val();
|
||||
if (force_file == "true") {
|
||||
@ -220,7 +220,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']").change(function () {
|
||||
if ($("input[type='radio'][name='allrows']").prop("checked")) {
|
||||
$("label[for='limit_to']").fadeTo('fast', 0.4);
|
||||
$("label[for='limit_from']").fadeTo('fast', 0.4);
|
||||
|
||||
242
js/functions.js
242
js/functions.js
@ -209,17 +209,17 @@ function PMA_addDatepicker($this_element, options)
|
||||
timeFormat: 'HH:mm:ss',
|
||||
altFieldTimeOnly: false,
|
||||
showAnim: '',
|
||||
beforeShow: function(input, inst) {
|
||||
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');
|
||||
|
||||
// Fix wrong timepicker z-index, doesn't work without timeout
|
||||
setTimeout(function() {
|
||||
setTimeout(function () {
|
||||
$('#ui-timepicker-div').css('z-index',$('#ui-datepicker-div').css('z-index'));
|
||||
}, 0);
|
||||
},
|
||||
onClose: function(dateText, dp_inst) {
|
||||
onClose: function (dateText, dp_inst) {
|
||||
// The value is no more from the date picker
|
||||
$this_element.data('comes_from', '');
|
||||
}
|
||||
@ -551,17 +551,17 @@ function checkTableEditForm(theForm, fieldsCnt)
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('functions.js', function() {
|
||||
AJAX.registerTeardown('functions.js', function () {
|
||||
$('input:checkbox.checkall').die('click');
|
||||
});
|
||||
AJAX.registerOnload('functions.js', function() {
|
||||
AJAX.registerOnload('functions.js', function () {
|
||||
/**
|
||||
* Row marking in horizontal mode (use "live" so that it works also for
|
||||
* next pages reached via AJAX); a tr may have the class noclick to remove
|
||||
* this behavior.
|
||||
*/
|
||||
|
||||
$('input:checkbox.checkall').live('click', function(e) {
|
||||
$('input:checkbox.checkall').live('click', function (e) {
|
||||
var $tr = $(this).closest('tr');
|
||||
|
||||
// make the table unselectable (to prevent default highlighting when shift+click)
|
||||
@ -667,8 +667,8 @@ var last_shift_clicked_row = -1;
|
||||
* Row highlighting in horizontal mode (use "live"
|
||||
* so that it works also for pages reached via AJAX)
|
||||
*/
|
||||
/*AJAX.registerOnload('functions.js', function() {
|
||||
$('tr.odd, tr.even').live('hover',function(event) {
|
||||
/*AJAX.registerOnload('functions.js', function () {
|
||||
$('tr.odd, tr.even').live('hover',function (event) {
|
||||
var $tr = $(this);
|
||||
$tr.toggleClass('hover',event.type=='mouseover');
|
||||
$tr.children().toggleClass('hover',event.type=='mouseover');
|
||||
@ -856,7 +856,7 @@ function insertValueQuery()
|
||||
*/
|
||||
function addDateTimePicker() {
|
||||
if ($.timepicker !== undefined) {
|
||||
$('input.datefield, input.datetimefield').each(function() {
|
||||
$('input.datefield, input.datetimefield').each(function () {
|
||||
PMA_addDatepicker($(this));
|
||||
});
|
||||
}
|
||||
@ -1315,7 +1315,7 @@ function pdfPaperSize(format, axis)
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('functions.js', function() {
|
||||
AJAX.registerTeardown('functions.js', function () {
|
||||
$("a.inline_edit_sql").die('click');
|
||||
$("input#sql_query_edit_save").die('click');
|
||||
$("input#sql_query_edit_discard").die('click');
|
||||
@ -1339,11 +1339,11 @@ AJAX.registerTeardown('functions.js', function() {
|
||||
/**
|
||||
* Jquery Coding for inline editing SQL_QUERY
|
||||
*/
|
||||
AJAX.registerOnload('functions.js', function() {
|
||||
AJAX.registerOnload('functions.js', function () {
|
||||
// If we are coming back to the page by clicking forward button
|
||||
// of the browser, bind the code mirror to inline query editor.
|
||||
bindCodeMirrorToInlineEditor();
|
||||
$("a.inline_edit_sql").live('click', function() {
|
||||
$("a.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
|
||||
@ -1370,7 +1370,7 @@ AJAX.registerOnload('functions.js', function() {
|
||||
return false;
|
||||
});
|
||||
|
||||
$("input#sql_query_edit_save").live('click', function() {
|
||||
$("input#sql_query_edit_save").live('click', function () {
|
||||
if (codemirror_inline_editor) {
|
||||
var sql_query = codemirror_inline_editor.getValue();
|
||||
} else {
|
||||
@ -1385,18 +1385,18 @@ AJAX.registerOnload('functions.js', function() {
|
||||
$fake_form.appendTo($('body')).submit();
|
||||
});
|
||||
|
||||
$("input#sql_query_edit_discard").live('click', function() {
|
||||
$("input#sql_query_edit_discard").live('click', function () {
|
||||
$('div#inline_editor_outer')
|
||||
.empty()
|
||||
.siblings('.inner_sql').show();
|
||||
});
|
||||
|
||||
$('input.sqlbutton').click(function(evt) {
|
||||
$('input.sqlbutton').click(function (evt) {
|
||||
insertQuery(evt.target.id);
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#export_type").change(function() {
|
||||
$("#export_type").change(function () {
|
||||
if ($("#export_type").val()=='svg') {
|
||||
$("#show_grid_opt").prop("disabled",true);
|
||||
$("#orientation_opt").prop("disabled",true);
|
||||
@ -1575,7 +1575,7 @@ function PMA_ajaxShowMessage(message, timeout)
|
||||
if (self_closing) {
|
||||
$retval
|
||||
.delay(timeout)
|
||||
.fadeOut('medium', function() {
|
||||
.fadeOut('medium', function () {
|
||||
if ($(this).is('.dismissable')) {
|
||||
$(this).tooltip('destroy');
|
||||
}
|
||||
@ -1625,7 +1625,7 @@ function PMA_ajaxRemoveMessage($this_msgbox)
|
||||
}
|
||||
|
||||
// This event only need to be fired once after the initial page load
|
||||
$(function() {
|
||||
$(function () {
|
||||
/**
|
||||
* Allows the user to dismiss a notification
|
||||
* created with PMA_ajaxShowMessage()
|
||||
@ -1746,7 +1746,7 @@ function PMA_SQLPrettyPrint(string)
|
||||
var state = mode.startState();
|
||||
var token, tokens = [];
|
||||
var output = '';
|
||||
var tabs = function(cnt) {
|
||||
var tabs = function (cnt) {
|
||||
var ret = '';
|
||||
for (var i=0; i<4*cnt; i++) {
|
||||
ret += " ";
|
||||
@ -1889,7 +1889,7 @@ function PMA_SQLPrettyPrint(string)
|
||||
* @param function callbackFn callback to execute after user clicks on OK
|
||||
*/
|
||||
|
||||
jQuery.fn.PMA_confirm = function(question, url, callbackFn) {
|
||||
jQuery.fn.PMA_confirm = function (question, url, callbackFn) {
|
||||
var confirmState = PMA_commonParams.get('confirm');
|
||||
// when the Confirm directive is set to false in config.inc.php
|
||||
// and not changed in user prefs, confirmState is ""
|
||||
@ -1910,14 +1910,14 @@ 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)) {
|
||||
callbackFn.call(this, url);
|
||||
}
|
||||
};
|
||||
button_options[PMA_messages['strCancel']] = function() {
|
||||
button_options[PMA_messages['strCancel']] = function () {
|
||||
$(this).dialog("close");
|
||||
};
|
||||
|
||||
@ -1940,8 +1940,8 @@ jQuery.fn.PMA_confirm = function(question, url, callbackFn) {
|
||||
*
|
||||
* @return jQuery Object for chaining purposes
|
||||
*/
|
||||
jQuery.fn.PMA_sort_table = function(text_selector) {
|
||||
return this.each(function() {
|
||||
jQuery.fn.PMA_sort_table = function (text_selector) {
|
||||
return this.each(function () {
|
||||
|
||||
/**
|
||||
* @var table_body Object referring to the table's <tbody> element
|
||||
@ -1953,12 +1953,12 @@ jQuery.fn.PMA_sort_table = function(text_selector) {
|
||||
var rows = $(this).find('tr').get();
|
||||
|
||||
//get the text of the field that we will sort by
|
||||
$.each(rows, function(index, row) {
|
||||
$.each(rows, function (index, row) {
|
||||
row.sortKey = $.trim($(row).find(text_selector).text().toLowerCase());
|
||||
});
|
||||
|
||||
//get the sorted order
|
||||
rows.sort(function(a, b) {
|
||||
rows.sort(function (a, b) {
|
||||
if (a.sortKey < b.sortKey) {
|
||||
return -1;
|
||||
}
|
||||
@ -1969,7 +1969,7 @@ jQuery.fn.PMA_sort_table = function(text_selector) {
|
||||
});
|
||||
|
||||
//pull out each row from the table and then append it according to it's order
|
||||
$.each(rows, function(index, row) {
|
||||
$.each(rows, function (index, row) {
|
||||
$(table_body).append(row);
|
||||
row.sortKey = null;
|
||||
});
|
||||
@ -1986,7 +1986,7 @@ jQuery.fn.PMA_sort_table = function(text_selector) {
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('functions.js', function() {
|
||||
AJAX.registerTeardown('functions.js', function () {
|
||||
$("#create_table_form_minimal.ajax").die('submit');
|
||||
$("form.create_table_form.ajax").die('submit');
|
||||
$("form.create_table_form.ajax input[name=submit_num_fields]").die('click');
|
||||
@ -2000,11 +2000,11 @@ AJAX.registerTeardown('functions.js', function() {
|
||||
*
|
||||
* Attach Ajax Event handlers for Create Table
|
||||
*/
|
||||
AJAX.registerOnload('functions.js', function() {
|
||||
AJAX.registerOnload('functions.js', function () {
|
||||
/**
|
||||
* Attach event handler for submission of create table form (save)
|
||||
*/
|
||||
$("form.create_table_form.ajax").live('submit', function(event) {
|
||||
$("form.create_table_form.ajax").live('submit', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
/**
|
||||
@ -2024,7 +2024,7 @@ AJAX.registerOnload('functions.js', function() {
|
||||
PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']);
|
||||
PMA_prepareForAjaxRequest($form);
|
||||
//User wants to submit the form
|
||||
$.post($form.attr('action'), $form.serialize() + "&do_save_data=1", function(data) {
|
||||
$.post($form.attr('action'), $form.serialize() + "&do_save_data=1", function (data) {
|
||||
if (data.success === true) {
|
||||
$('#properties_message')
|
||||
.removeClass('error')
|
||||
@ -2094,7 +2094,7 @@ AJAX.registerOnload('functions.js', function() {
|
||||
/**
|
||||
* Attach event handler for create table form (add fields)
|
||||
*/
|
||||
$("form.create_table_form.ajax input[name=submit_num_fields]").live('click', function(event) {
|
||||
$("form.create_table_form.ajax input[name=submit_num_fields]").live('click', function (event) {
|
||||
event.preventDefault();
|
||||
/**
|
||||
* @var the_form object referring to the create table form
|
||||
@ -2105,7 +2105,7 @@ AJAX.registerOnload('functions.js', function() {
|
||||
PMA_prepareForAjaxRequest($form);
|
||||
|
||||
//User wants to add more fields to the table
|
||||
$.post($form.attr('action'), $form.serialize() + "&submit_num_fields=1", function(data) {
|
||||
$.post($form.attr('action'), $form.serialize() + "&submit_num_fields=1", function (data) {
|
||||
if (data.success) {
|
||||
$("#page_content").html(data.message);
|
||||
PMA_verifyColumnsProperties();
|
||||
@ -2132,7 +2132,7 @@ AJAX.registerOnload('functions.js', function() {
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('functions.js', function() {
|
||||
AJAX.registerTeardown('functions.js', function () {
|
||||
$("#copyTable.ajax").die('submit');
|
||||
$("#moveTableForm").die('submit');
|
||||
$("#tableOptionsForm").die('submit');
|
||||
@ -2142,15 +2142,15 @@ AJAX.registerTeardown('functions.js', function() {
|
||||
* jQuery coding for 'Table operations'. Used on tbl_operations.php
|
||||
* Attach Ajax Event handlers for Table operations
|
||||
*/
|
||||
AJAX.registerOnload('functions.js', function() {
|
||||
AJAX.registerOnload('functions.js', function () {
|
||||
/**
|
||||
*Ajax action for submitting the "Copy table"
|
||||
**/
|
||||
$("#copyTable.ajax").live('submit', function(event) {
|
||||
$("#copyTable.ajax").live('submit', function (event) {
|
||||
event.preventDefault();
|
||||
var $form = $(this);
|
||||
PMA_prepareForAjaxRequest($form);
|
||||
$.post($form.attr('action'), $form.serialize()+"&submit_copy=Go", function(data) {
|
||||
$.post($form.attr('action'), $form.serialize()+"&submit_copy=Go", function (data) {
|
||||
if (data.success === true) {
|
||||
if ($form.find("input[name='switch_to_new']").prop('checked')) {
|
||||
PMA_commonParams.set(
|
||||
@ -2178,13 +2178,13 @@ AJAX.registerOnload('functions.js', function() {
|
||||
/**
|
||||
*Ajax action for submitting the "Move table"
|
||||
*/
|
||||
$("#moveTableForm").live('submit', function(event) {
|
||||
$("#moveTableForm").live('submit', function (event) {
|
||||
event.preventDefault();
|
||||
var $form = $(this);
|
||||
var db = $form.find('select[name=target_db]').val();
|
||||
var tbl = $form.find('input[name=new_name]').val();
|
||||
PMA_prepareForAjaxRequest($form);
|
||||
$.post($form.attr('action'), $form.serialize()+"&submit_move=1", function(data) {
|
||||
$.post($form.attr('action'), $form.serialize()+"&submit_move=1", function (data) {
|
||||
if (data.success === true) {
|
||||
PMA_commonParams.set('db', db);
|
||||
PMA_commonParams.set('table', tbl);
|
||||
@ -2202,7 +2202,7 @@ AJAX.registerOnload('functions.js', function() {
|
||||
/**
|
||||
* Ajax action for submitting the "Table options"
|
||||
*/
|
||||
$("#tableOptionsForm").live('submit', function(event) {
|
||||
$("#tableOptionsForm").live('submit', function (event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
var $form = $(this);
|
||||
@ -2211,10 +2211,10 @@ AJAX.registerOnload('functions.js', function() {
|
||||
// reload page and navigation if the table has been renamed
|
||||
PMA_prepareForAjaxRequest($form);
|
||||
var tbl = $tblNameField.val();
|
||||
$.post($form.attr('action'), $form.serialize(), function(data) {
|
||||
$.post($form.attr('action'), $form.serialize(), function (data) {
|
||||
if (data.success === true) {
|
||||
PMA_commonParams.set('table', tbl);
|
||||
PMA_commonActions.refreshMain(false, function() {
|
||||
PMA_commonActions.refreshMain(false, function () {
|
||||
$('#page_content').html(data.message);
|
||||
});
|
||||
} else {
|
||||
@ -2229,7 +2229,7 @@ AJAX.registerOnload('functions.js', function() {
|
||||
/**
|
||||
*Ajax events for actions in the "Table maintenance"
|
||||
**/
|
||||
$("#tbl_maintenance li a.maintain_action.ajax").live('click', function(event) {
|
||||
$("#tbl_maintenance li a.maintain_action.ajax").live('click', function (event) {
|
||||
event.preventDefault();
|
||||
if ($("#sqlqueryresults").length !== 0) {
|
||||
$("#sqlqueryresults").remove();
|
||||
@ -2238,7 +2238,7 @@ AJAX.registerOnload('functions.js', function() {
|
||||
$("#result_query").remove();
|
||||
}
|
||||
//variables which stores the common attributes
|
||||
$.post($(this).attr('href'), { ajax_request: 1 }, function(data) {
|
||||
$.post($(this).attr('href'), { ajax_request: 1 }, function (data) {
|
||||
function scrollToTop() {
|
||||
$('html, body').animate({ scrollTop: 0 });
|
||||
}
|
||||
@ -2270,15 +2270,15 @@ AJAX.registerOnload('functions.js', function() {
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('functions.js', function() {
|
||||
AJAX.registerTeardown('functions.js', function () {
|
||||
$("#drop_db_anchor.ajax").die('click');
|
||||
});
|
||||
/**
|
||||
* Attach Ajax event handlers for Drop Database. Moved here from db_structure.js
|
||||
* as it was also required on db_create.php
|
||||
*/
|
||||
AJAX.registerOnload('functions.js', function() {
|
||||
$("#drop_db_anchor.ajax").live('click', function(event) {
|
||||
AJAX.registerOnload('functions.js', function () {
|
||||
$("#drop_db_anchor.ajax").live('click', function (event) {
|
||||
event.preventDefault();
|
||||
/**
|
||||
* @var question String containing the question to be asked for confirmation
|
||||
@ -2288,9 +2288,9 @@ AJAX.registerOnload('functions.js', function() {
|
||||
PMA_messages.strDoYouReally,
|
||||
'DROP DATABASE ' + escapeHtml(PMA_commonParams.get('db'))
|
||||
);
|
||||
$(this).PMA_confirm(question, $(this).attr('href'), function(url) {
|
||||
$(this).PMA_confirm(question, $(this).attr('href'), function (url) {
|
||||
PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']);
|
||||
$.get(url, {'is_js_confirmed': '1', 'ajax_request': true}, function(data) {
|
||||
$.get(url, {'is_js_confirmed': '1', 'ajax_request': true}, function (data) {
|
||||
if (data.success) {
|
||||
//Database deleted successfully, refresh both the frames
|
||||
PMA_reloadNavigation();
|
||||
@ -2352,18 +2352,18 @@ function PMA_checkPassword($the_form)
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('functions.js', function() {
|
||||
AJAX.registerTeardown('functions.js', function () {
|
||||
$('#change_password_anchor.ajax').die('click');
|
||||
});
|
||||
/**
|
||||
* Attach Ajax event handlers for 'Change Password' on index.php
|
||||
*/
|
||||
AJAX.registerOnload('functions.js', function() {
|
||||
AJAX.registerOnload('functions.js', function () {
|
||||
|
||||
/**
|
||||
* Attach Ajax event handler on the change password anchor
|
||||
*/
|
||||
$('#change_password_anchor.ajax').live('click', function(event) {
|
||||
$('#change_password_anchor.ajax').live('click', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
var $msgbox = PMA_ajaxShowMessage();
|
||||
@ -2372,7 +2372,7 @@ AJAX.registerOnload('functions.js', function() {
|
||||
* @var button_options Object containing options to be passed to jQueryUI's dialog
|
||||
*/
|
||||
var button_options = {};
|
||||
button_options[PMA_messages['strGo']] = function() {
|
||||
button_options[PMA_messages['strGo']] = function () {
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
@ -2395,7 +2395,7 @@ AJAX.registerOnload('functions.js', function() {
|
||||
var $msgbox = PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']);
|
||||
$the_form.append('<input type="hidden" name="ajax_request" value="true" />');
|
||||
|
||||
$.post($the_form.attr('action'), $the_form.serialize() + '&change_pw='+ this_value, function(data) {
|
||||
$.post($the_form.attr('action'), $the_form.serialize() + '&change_pw='+ this_value, function (data) {
|
||||
if (data.success === true) {
|
||||
$("#page_content").prepend(data.message);
|
||||
$("#change_password_dialog").hide().remove();
|
||||
@ -2408,16 +2408,16 @@ AJAX.registerOnload('functions.js', function() {
|
||||
}); // end $.post()
|
||||
};
|
||||
|
||||
button_options[PMA_messages['strCancel']] = function() {
|
||||
button_options[PMA_messages['strCancel']] = function () {
|
||||
$(this).dialog('close');
|
||||
};
|
||||
$.get($(this).attr('href'), {'ajax_request': true}, function(data) {
|
||||
$.get($(this).attr('href'), {'ajax_request': true}, function (data) {
|
||||
if (data.success) {
|
||||
$('<div id="change_password_dialog"></div>')
|
||||
.dialog({
|
||||
title: PMA_messages['strChangePassword'],
|
||||
width: 600,
|
||||
close: function(ev, ui) {
|
||||
close: function (ev, ui) {
|
||||
$(this).remove();
|
||||
},
|
||||
buttons : button_options,
|
||||
@ -2450,7 +2450,7 @@ AJAX.registerOnload('functions.js', function() {
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('functions.js', function() {
|
||||
AJAX.registerTeardown('functions.js', function () {
|
||||
$("select.column_type").die('change');
|
||||
$("select.default_type").die('change');
|
||||
$('input.allow_null').die('change');
|
||||
@ -2459,29 +2459,29 @@ AJAX.registerTeardown('functions.js', function() {
|
||||
* Toggle the hiding/showing of the "Open in ENUM/SET editor" message when
|
||||
* the page loads and when the selected data type changes
|
||||
*/
|
||||
AJAX.registerOnload('functions.js', function() {
|
||||
AJAX.registerOnload('functions.js', function () {
|
||||
// is called here for normal page loads and also when opening
|
||||
// the Create table dialog
|
||||
PMA_verifyColumnsProperties();
|
||||
//
|
||||
// needs live() to work also in the Create Table dialog
|
||||
$("select.column_type").live('change', function() {
|
||||
$("select.column_type").live('change', function () {
|
||||
PMA_showNoticeForEnum($(this));
|
||||
});
|
||||
$("select.default_type").live('change', function() {
|
||||
$("select.default_type").live('change', function () {
|
||||
PMA_hideShowDefaultValue($(this));
|
||||
});
|
||||
$('input.allow_null').live('change', function() {
|
||||
$('input.allow_null').live('change', function () {
|
||||
PMA_validateDefaultValue($(this));
|
||||
});
|
||||
});
|
||||
|
||||
function PMA_verifyColumnsProperties()
|
||||
{
|
||||
$("select.column_type").each(function() {
|
||||
$("select.column_type").each(function () {
|
||||
PMA_showNoticeForEnum($(this));
|
||||
});
|
||||
$("select.default_type").each(function() {
|
||||
$("select.default_type").each(function () {
|
||||
PMA_hideShowDefaultValue($(this));
|
||||
});
|
||||
}
|
||||
@ -2520,7 +2520,7 @@ function PMA_validateDefaultValue($null_checkbox)
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('functions.js', function() {
|
||||
AJAX.registerTeardown('functions.js', function () {
|
||||
$("a.open_enum_editor").die('click');
|
||||
$("input.add_value").die('click');
|
||||
$("#enum_editor td.drop").die('click');
|
||||
@ -2533,8 +2533,8 @@ var $enum_editor_dialog = null;
|
||||
/**
|
||||
* Opens the ENUM/SET editor and controls its functions
|
||||
*/
|
||||
AJAX.registerOnload('functions.js', function() {
|
||||
$("a.open_enum_editor").live('click', function() {
|
||||
AJAX.registerOnload('functions.js', function () {
|
||||
$("a.open_enum_editor").live('click', function () {
|
||||
// Get the name of the column that is being edited
|
||||
var colname = $(this).closest('tr').find('input:first').val();
|
||||
// And use it to make up a title for the page
|
||||
@ -2629,7 +2629,7 @@ AJAX.registerOnload('functions.js', function() {
|
||||
// When the submit button is clicked,
|
||||
// put the data back into the original form
|
||||
var value_array = [];
|
||||
$(this).find(".values input").each(function(index, elm) {
|
||||
$(this).find(".values input").each(function (index, elm) {
|
||||
var val = elm.value.replace(/\\/g, '\\\\').replace(/'/g, "''");
|
||||
value_array.push("'" + val + "'");
|
||||
});
|
||||
@ -2654,11 +2654,11 @@ AJAX.registerOnload('functions.js', function() {
|
||||
modal: true,
|
||||
title: PMA_messages['enum_editor'],
|
||||
buttons: buttonOptions,
|
||||
open: function() {
|
||||
open: function () {
|
||||
// Focus the "Go" button after opening the dialog
|
||||
$(this).closest('.ui-dialog').find('.ui-dialog-buttonpane button:first').focus();
|
||||
},
|
||||
close: function() {
|
||||
close: function () {
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
@ -2669,7 +2669,7 @@ AJAX.registerOnload('functions.js', function() {
|
||||
value: 1,
|
||||
min: 1,
|
||||
max: 9,
|
||||
slide: function( event, ui ) {
|
||||
slide: function ( event, ui ) {
|
||||
$(this).closest('table').find('input[type=submit]').val(
|
||||
$.sprintf(PMA_messages['enum_addValue'], ui.value)
|
||||
);
|
||||
@ -2681,7 +2681,7 @@ AJAX.registerOnload('functions.js', function() {
|
||||
});
|
||||
|
||||
// When "add a new value" is clicked, append an empty text field
|
||||
$("input.add_value").live('click', function(e) {
|
||||
$("input.add_value").live('click', function (e) {
|
||||
e.preventDefault();
|
||||
var num_new_rows = $enum_editor_dialog.find("div.slider").slider('value');
|
||||
while (num_new_rows--) {
|
||||
@ -2699,7 +2699,7 @@ AJAX.registerOnload('functions.js', function() {
|
||||
});
|
||||
|
||||
// Removes the specified row from the enum editor
|
||||
$("#enum_editor td.drop").live('click', function() {
|
||||
$("#enum_editor td.drop").live('click', function () {
|
||||
$(this).closest('tr').hide('fast', function () {
|
||||
$(this).remove();
|
||||
});
|
||||
@ -2740,14 +2740,14 @@ function checkIndexName(form_id)
|
||||
return true;
|
||||
} // end of the 'checkIndexName()' function
|
||||
|
||||
AJAX.registerTeardown('functions.js', function() {
|
||||
AJAX.registerTeardown('functions.js', function () {
|
||||
$('#index_frm input[type=submit]').die('click');
|
||||
});
|
||||
AJAX.registerOnload('functions.js', function() {
|
||||
AJAX.registerOnload('functions.js', function () {
|
||||
/**
|
||||
* Handler for adding more columns to an index in the editor
|
||||
*/
|
||||
$('#index_frm input[type=submit]').live('click', function(event) {
|
||||
$('#index_frm input[type=submit]').live('click', function (event) {
|
||||
event.preventDefault();
|
||||
var rows_to_add = $(this)
|
||||
.closest('fieldset')
|
||||
@ -2760,11 +2760,11 @@ AJAX.registerOnload('functions.js', function() {
|
||||
.appendTo(
|
||||
$('#index_columns').find('tbody')
|
||||
);
|
||||
$newrow.find(':input').each(function() {
|
||||
$newrow.find(':input').each(function () {
|
||||
$(this).val('');
|
||||
});
|
||||
// focus index size input on column picked
|
||||
$newrow.find('select').change(function() {
|
||||
$newrow.find('select').change(function () {
|
||||
if ($(this).find("option:selected").val() === '') {
|
||||
return true;
|
||||
}
|
||||
@ -2787,14 +2787,14 @@ function indexEditorDialog(url, title, callback_success, callback_failure)
|
||||
* passed to jQueryUI dialog
|
||||
*/
|
||||
var button_options = {};
|
||||
button_options[PMA_messages['strGo']] = function() {
|
||||
button_options[PMA_messages['strGo']] = function () {
|
||||
/**
|
||||
* @var the_form object referring to the export form
|
||||
*/
|
||||
var $form = $("#index_frm");
|
||||
PMA_prepareForAjaxRequest($form);
|
||||
//User wants to submit the form
|
||||
$.post($form.attr('action'), $form.serialize()+"&do_save_data=1", function(data) {
|
||||
$.post($form.attr('action'), $form.serialize()+"&do_save_data=1", function (data) {
|
||||
if ($("#sqlqueryresults").length !== 0) {
|
||||
$("#sqlqueryresults").remove();
|
||||
}
|
||||
@ -2836,11 +2836,11 @@ function indexEditorDialog(url, title, callback_success, callback_failure)
|
||||
}
|
||||
}); // end $.post()
|
||||
};
|
||||
button_options[PMA_messages['strCancel']] = function() {
|
||||
button_options[PMA_messages['strCancel']] = function () {
|
||||
$(this).dialog('close');
|
||||
};
|
||||
var $msgbox = PMA_ajaxShowMessage();
|
||||
$.get("tbl_indexes.php", url, function(data) {
|
||||
$.get("tbl_indexes.php", url, function (data) {
|
||||
if (data.success === false) {
|
||||
//in the case of an error, show the error message returned.
|
||||
PMA_ajaxShowMessage(data.error, false);
|
||||
@ -2868,14 +2868,14 @@ function indexEditorDialog(url, title, callback_success, callback_failure)
|
||||
value: 1,
|
||||
min: 1,
|
||||
max: 16,
|
||||
slide: function( event, ui ) {
|
||||
slide: function ( event, ui ) {
|
||||
$(this).closest('fieldset').find('input[type=submit]').val(
|
||||
$.sprintf(PMA_messages['strAddToIndex'], ui.value)
|
||||
);
|
||||
}
|
||||
});
|
||||
// focus index size input on column picked
|
||||
$div.find('table#index_columns select').change(function() {
|
||||
$div.find('table#index_columns select').change(function () {
|
||||
if ($(this).find("option:selected").val() === '') {
|
||||
return true;
|
||||
}
|
||||
@ -2913,7 +2913,7 @@ function PMA_showHints($div)
|
||||
});
|
||||
}
|
||||
|
||||
AJAX.registerOnload('functions.js', function() {
|
||||
AJAX.registerOnload('functions.js', function () {
|
||||
PMA_showHints();
|
||||
});
|
||||
|
||||
@ -2922,7 +2922,7 @@ function PMA_mainMenuResizerCallback() {
|
||||
return $(document.body).width() - 5;
|
||||
}
|
||||
// This must be fired only once after the inital page load
|
||||
$(function() {
|
||||
$(function () {
|
||||
// Initialise the menu resize plugin
|
||||
$('#topmenu').menuResizer(PMA_mainMenuResizerCallback);
|
||||
// register resize event
|
||||
@ -3051,7 +3051,7 @@ var toggleButton = function ($obj) {
|
||||
var removeClass = 'off';
|
||||
var addClass = 'on';
|
||||
}
|
||||
$.post(url, {'ajax_request': true}, function(data) {
|
||||
$.post(url, {'ajax_request': true}, function (data) {
|
||||
if (data.success === true) {
|
||||
PMA_ajaxRemoveMessage($msg);
|
||||
$container
|
||||
@ -3072,7 +3072,7 @@ var toggleButton = function ($obj) {
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('functions.js', function() {
|
||||
AJAX.registerTeardown('functions.js', function () {
|
||||
$('div.container').unbind('click');
|
||||
});
|
||||
/**
|
||||
@ -3081,7 +3081,7 @@ AJAX.registerTeardown('functions.js', function() {
|
||||
AJAX.registerOnload('functions.js', function () {
|
||||
$('div.toggleAjax').each(function () {
|
||||
var $button = $(this).show();
|
||||
$button.find('img').each(function() {
|
||||
$button.find('img').each(function () {
|
||||
if (this.complete) {
|
||||
toggleButton($button);
|
||||
} else {
|
||||
@ -3096,7 +3096,7 @@ AJAX.registerOnload('functions.js', function () {
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('functions.js', function() {
|
||||
AJAX.registerTeardown('functions.js', function () {
|
||||
$('.vpointer').die('hover');
|
||||
$('.vmarker').die('click');
|
||||
$('#pageselector').die('change');
|
||||
@ -3106,10 +3106,10 @@ AJAX.registerTeardown('functions.js', function() {
|
||||
/**
|
||||
* Vertical pointer
|
||||
*/
|
||||
AJAX.registerOnload('functions.js', function() {
|
||||
AJAX.registerOnload('functions.js', function () {
|
||||
$('.vpointer').live('hover',
|
||||
//handlerInOut
|
||||
function(e) {
|
||||
function (e) {
|
||||
var $this_td = $(this);
|
||||
var row_num = PMA_getRowNumber($this_td.attr('class'));
|
||||
// for all td of the same vertical row, toggle hover
|
||||
@ -3121,7 +3121,7 @@ AJAX.registerOnload('functions.js', function() {
|
||||
/**
|
||||
* Vertical marker
|
||||
*/
|
||||
$('.vmarker').live('click', function(e) {
|
||||
$('.vmarker').live('click', function (e) {
|
||||
// do not trigger when clicked on anchor
|
||||
if ($(e.target).is('a, img, a *')) {
|
||||
return;
|
||||
@ -3154,7 +3154,7 @@ AJAX.registerOnload('functions.js', function() {
|
||||
/**
|
||||
* Autosubmit page selector
|
||||
*/
|
||||
$('select.pageselector').live('change', function(event) {
|
||||
$('select.pageselector').live('change', function (event) {
|
||||
event.stopPropagation();
|
||||
// Check where to load the new content
|
||||
if ($(this).closest("#pma_navigation").length === 0) {
|
||||
@ -3185,7 +3185,7 @@ AJAX.registerOnload('functions.js', function() {
|
||||
/**
|
||||
* Enables the text generated by PMA_Util::linkOrButton() to be clickable
|
||||
*/
|
||||
$('a.formLinkSubmit').live('click', function(e) {
|
||||
$('a.formLinkSubmit').live('click', function (e) {
|
||||
|
||||
if ($(this).attr('href').indexOf('=') != -1) {
|
||||
var data = $(this).attr('href').substr($(this).attr('href').indexOf('#')+1).split('=', 2);
|
||||
@ -3214,7 +3214,7 @@ AJAX.registerOnload('functions.js', function() {
|
||||
*/
|
||||
function PMA_init_slider()
|
||||
{
|
||||
$('div.pma_auto_slider').each(function() {
|
||||
$('div.pma_auto_slider').each(function () {
|
||||
var $this = $(this);
|
||||
if ($this.data('slider_init_done')) {
|
||||
return;
|
||||
@ -3225,13 +3225,13 @@ function PMA_init_slider()
|
||||
.text(this.title)
|
||||
.prepend($('<span>'))
|
||||
.insertBefore($this)
|
||||
.click(function() {
|
||||
.click(function () {
|
||||
var $wrapper = $this.closest('.slide-wrapper');
|
||||
var visible = $this.is(':visible');
|
||||
if (!visible) {
|
||||
$wrapper.show();
|
||||
}
|
||||
$this[visible ? 'hide' : 'show']('blind', function() {
|
||||
$this[visible ? 'hide' : 'show']('blind', function () {
|
||||
$wrapper.toggle(!visible);
|
||||
PMA_set_status_label($this);
|
||||
});
|
||||
@ -3246,15 +3246,15 @@ function PMA_init_slider()
|
||||
/**
|
||||
* Initializes slider effect.
|
||||
*/
|
||||
AJAX.registerOnload('functions.js', function() {
|
||||
AJAX.registerOnload('functions.js', function () {
|
||||
PMA_init_slider();
|
||||
});
|
||||
|
||||
/**
|
||||
* Restores sliders to the state they were in before initialisation.
|
||||
*/
|
||||
AJAX.registerTeardown('functions.js', function() {
|
||||
$('div.pma_auto_slider').each(function() {
|
||||
AJAX.registerTeardown('functions.js', function () {
|
||||
$('div.pma_auto_slider').each(function () {
|
||||
var $this = $(this);
|
||||
$this.removeData();
|
||||
$this.parent().replaceWith($this);
|
||||
@ -3326,7 +3326,7 @@ function PMA_slidingMessage(msg, $obj)
|
||||
.show()
|
||||
.animate({
|
||||
height: h
|
||||
}, function() {
|
||||
}, function () {
|
||||
// Set the height of the parent
|
||||
// to the height of the child
|
||||
$obj
|
||||
@ -3344,15 +3344,15 @@ function PMA_slidingMessage(msg, $obj)
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('functions.js', function() {
|
||||
AJAX.registerTeardown('functions.js', function () {
|
||||
$("#drop_tbl_anchor.ajax").die('click');
|
||||
$("#truncate_tbl_anchor.ajax").die('click');
|
||||
});
|
||||
/**
|
||||
* Attach Ajax event handlers for Drop Table.
|
||||
*/
|
||||
AJAX.registerOnload('functions.js', function() {
|
||||
$("#drop_tbl_anchor.ajax").live('click', function(event) {
|
||||
AJAX.registerOnload('functions.js', function () {
|
||||
$("#drop_tbl_anchor.ajax").live('click', function (event) {
|
||||
event.preventDefault();
|
||||
/**
|
||||
* @var question String containing the question to be asked for confirmation
|
||||
@ -3363,10 +3363,10 @@ AJAX.registerOnload('functions.js', function() {
|
||||
'DROP TABLE ' + PMA_commonParams.get('table')
|
||||
);
|
||||
|
||||
$(this).PMA_confirm(question, $(this).attr('href'), function(url) {
|
||||
$(this).PMA_confirm(question, $(this).attr('href'), function (url) {
|
||||
|
||||
var $msgbox = PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']);
|
||||
$.get(url, {'is_js_confirmed': '1', 'ajax_request': true}, function(data) {
|
||||
$.get(url, {'is_js_confirmed': '1', 'ajax_request': true}, function (data) {
|
||||
if (data.success === true) {
|
||||
PMA_ajaxRemoveMessage($msgbox);
|
||||
// Table deleted successfully, refresh both the frames
|
||||
@ -3385,7 +3385,7 @@ AJAX.registerOnload('functions.js', function() {
|
||||
}); // end $.PMA_confirm()
|
||||
}); //end of Drop Table Ajax action
|
||||
|
||||
$("#truncate_tbl_anchor.ajax").live('click', function(event) {
|
||||
$("#truncate_tbl_anchor.ajax").live('click', function (event) {
|
||||
event.preventDefault();
|
||||
/**
|
||||
* @var question String containing the question to be asked for confirmation
|
||||
@ -3395,9 +3395,9 @@ AJAX.registerOnload('functions.js', function() {
|
||||
PMA_messages.strDoYouReally,
|
||||
'TRUNCATE ' + PMA_commonParams.get('table')
|
||||
);
|
||||
$(this).PMA_confirm(question, $(this).attr('href'), function(url) {
|
||||
$(this).PMA_confirm(question, $(this).attr('href'), function (url) {
|
||||
PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']);
|
||||
$.get(url, {'is_js_confirmed': '1', 'ajax_request': true}, function(data) {
|
||||
$.get(url, {'is_js_confirmed': '1', 'ajax_request': true}, function (data) {
|
||||
if ($("#sqlqueryresults").length !== 0) {
|
||||
$("#sqlqueryresults").remove();
|
||||
}
|
||||
@ -3419,7 +3419,7 @@ AJAX.registerOnload('functions.js', function() {
|
||||
/**
|
||||
* Attach CodeMirror2 editor to SQL edit area.
|
||||
*/
|
||||
AJAX.registerOnload('functions.js', function() {
|
||||
AJAX.registerOnload('functions.js', function () {
|
||||
var $elm = $('#sqlquery');
|
||||
if ($elm.length > 0) {
|
||||
if (typeof CodeMirror != 'undefined') {
|
||||
@ -3442,7 +3442,7 @@ AJAX.registerOnload('functions.js', function() {
|
||||
}
|
||||
}
|
||||
});
|
||||
AJAX.registerTeardown('functions.js', function() {
|
||||
AJAX.registerTeardown('functions.js', function () {
|
||||
if (codemirror_editor) {
|
||||
$('#sqlquery').text(codemirror_editor.getValue());
|
||||
codemirror_editor.toTextArea();
|
||||
@ -3546,17 +3546,17 @@ function PMA_getCellValue(td) {
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('functions.js', function() {
|
||||
AJAX.registerTeardown('functions.js', function () {
|
||||
$('a.themeselect').die('click');
|
||||
$('.autosubmit').unbind('change');
|
||||
$('a.take_theme').unbind('click');
|
||||
});
|
||||
|
||||
AJAX.registerOnload('functions.js', function() {
|
||||
AJAX.registerOnload('functions.js', function () {
|
||||
/**
|
||||
* Theme selector.
|
||||
*/
|
||||
$('a.themeselect').live('click', function(e) {
|
||||
$('a.themeselect').live('click', function (e) {
|
||||
window.open(
|
||||
e.target,
|
||||
'themes',
|
||||
@ -3568,14 +3568,14 @@ AJAX.registerOnload('functions.js', function() {
|
||||
/**
|
||||
* Automatic form submission on change.
|
||||
*/
|
||||
$('.autosubmit').change(function(e) {
|
||||
$('.autosubmit').change(function (e) {
|
||||
$(this).closest('form').submit();
|
||||
});
|
||||
|
||||
/**
|
||||
* Theme changer.
|
||||
*/
|
||||
$('a.take_theme').click(function(e) {
|
||||
$('a.take_theme').click(function (e) {
|
||||
var what = this.name;
|
||||
if (window.opener && window.opener.document.forms['setTheme'].elements['set_theme']) {
|
||||
window.opener.document.forms['setTheme'].elements['set_theme'].value = what;
|
||||
@ -3630,13 +3630,13 @@ function printPage()
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('functions.js', function() {
|
||||
AJAX.registerTeardown('functions.js', function () {
|
||||
$('input#print').unbind('click');
|
||||
$('span a.create_view.ajax').die('click');
|
||||
$('#createViewDialog').find('input, select').die('keydown');
|
||||
});
|
||||
|
||||
AJAX.registerOnload('functions.js', function() {
|
||||
AJAX.registerOnload('functions.js', function () {
|
||||
$('input#print').click(printPage);
|
||||
/**
|
||||
* Ajaxification for the "Create View" action
|
||||
@ -3768,7 +3768,7 @@ $(checkboxes_sel).live("change", function () {
|
||||
$checkall.prop({checked: false, indeterminate: false});
|
||||
}
|
||||
});
|
||||
$("input#checkall").live("change", function() {
|
||||
$("input#checkall").live("change", function () {
|
||||
var is_checked = $(this).is(":checked");
|
||||
$(this.form).find(checkboxes_sel).prop("checked", is_checked)
|
||||
.parents("tr").toggleClass("marked", is_checked);
|
||||
@ -3838,7 +3838,7 @@ AJAX.registerOnload('functions.js', function () {
|
||||
/**
|
||||
* When user gets an ajax session expiry message, we show a login link
|
||||
*/
|
||||
$('a.login-link').live('click', function(e) {
|
||||
$('a.login-link').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
window.location.reload(true);
|
||||
});
|
||||
|
||||
@ -37,7 +37,7 @@ function prepareJSVersion() {
|
||||
$('div#gis_data_output p').remove();
|
||||
|
||||
// Remove 'add' buttons and add links
|
||||
$('#gis_editor input.add').each(function(e) {
|
||||
$('#gis_editor input.add').each(function (e) {
|
||||
var $button = $(this);
|
||||
$button.addClass('addJs').removeClass('add');
|
||||
var classes = $button.attr('class');
|
||||
@ -109,12 +109,12 @@ function loadJSAndGISEditor(value, field, type, input_name, token) {
|
||||
script = document.createElement('script');
|
||||
script.type = 'text/javascript';
|
||||
|
||||
script.onreadystatechange = function() {
|
||||
script.onreadystatechange = function () {
|
||||
if (this.readyState == 'complete') {
|
||||
loadGISEditor(value, field, type, input_name, token);
|
||||
}
|
||||
};
|
||||
script.onload = function() {
|
||||
script.onload = function () {
|
||||
loadGISEditor(value, field, type, input_name, token);
|
||||
};
|
||||
|
||||
@ -144,7 +144,7 @@ function loadGISEditor(value, field, type, input_name, token) {
|
||||
'get_gis_editor' : true,
|
||||
'token' : token,
|
||||
'ajax_request': true
|
||||
}, function(data) {
|
||||
}, function (data) {
|
||||
if (data.success === true) {
|
||||
$gis_editor.html(data.gis_editor);
|
||||
initGISEditorVisualization();
|
||||
@ -191,7 +191,7 @@ function insertDataAndClose() {
|
||||
var $form = $('form#gis_data_editor_form');
|
||||
var input_name = $form.find("input[name='input_name']").val();
|
||||
|
||||
$.post('gis_data_editor.php', $form.serialize() + "&generate=true&ajax_request=true", function(data) {
|
||||
$.post('gis_data_editor.php', $form.serialize() + "&generate=true&ajax_request=true", function (data) {
|
||||
if (data.success === true) {
|
||||
$("input[name='" + input_name + "']").val(data.result);
|
||||
} else {
|
||||
@ -204,7 +204,7 @@ function insertDataAndClose() {
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('gis_data_editor.js', function() {
|
||||
AJAX.registerTeardown('gis_data_editor.js', function () {
|
||||
$("#gis_editor input[name='gis_data[save]']").die('click');
|
||||
$('#gis_editor').die('submit');
|
||||
$('#gis_editor').find("input[type='text']").die('change');
|
||||
@ -216,7 +216,7 @@ AJAX.registerTeardown('gis_data_editor.js', function() {
|
||||
$('#gis_editor a.addJs.addGeom').die('click');
|
||||
});
|
||||
|
||||
AJAX.registerOnload('gis_data_editor.js', function() {
|
||||
AJAX.registerOnload('gis_data_editor.js', function () {
|
||||
|
||||
// Remove the class that is added due to the URL being too long.
|
||||
$('span.open_gis_editor a').removeClass('formLinkSubmit');
|
||||
@ -224,7 +224,7 @@ AJAX.registerOnload('gis_data_editor.js', function() {
|
||||
/**
|
||||
* Prepares and insert the GIS data to the input field on clicking 'copy'.
|
||||
*/
|
||||
$("#gis_editor input[name='gis_data[save]']").live('click', function(event) {
|
||||
$("#gis_editor input[name='gis_data[save]']").live('click', function (event) {
|
||||
event.preventDefault();
|
||||
insertDataAndClose();
|
||||
});
|
||||
@ -232,7 +232,7 @@ AJAX.registerOnload('gis_data_editor.js', function() {
|
||||
/**
|
||||
* Prepares and insert the GIS data to the input field on pressing 'enter'.
|
||||
*/
|
||||
$('#gis_editor').live('submit', function(event) {
|
||||
$('#gis_editor').live('submit', function (event) {
|
||||
event.preventDefault();
|
||||
insertDataAndClose();
|
||||
});
|
||||
@ -240,9 +240,9 @@ AJAX.registerOnload('gis_data_editor.js', function() {
|
||||
/**
|
||||
* Trigger asynchronous calls on data change and update the output.
|
||||
*/
|
||||
$('#gis_editor').find("input[type='text']").live('change', function() {
|
||||
$('#gis_editor').find("input[type='text']").live('change', function () {
|
||||
var $form = $('form#gis_data_editor_form');
|
||||
$.post('gis_data_editor.php', $form.serialize() + "&generate=true&ajax_request=true", function(data) {
|
||||
$.post('gis_data_editor.php', $form.serialize() + "&generate=true&ajax_request=true", function (data) {
|
||||
if (data.success === true) {
|
||||
$('#gis_data_textarea').val(data.result);
|
||||
$('#placeholder').empty().removeClass('hasSVG').html(data.visualization);
|
||||
@ -258,11 +258,11 @@ AJAX.registerOnload('gis_data_editor.js', function() {
|
||||
/**
|
||||
* Update the form on change of the GIS type.
|
||||
*/
|
||||
$("#gis_editor select.gis_type").live('change', function(event) {
|
||||
$("#gis_editor select.gis_type").live('change', function (event) {
|
||||
var $gis_editor = $("#gis_editor");
|
||||
var $form = $('form#gis_data_editor_form');
|
||||
|
||||
$.post('gis_data_editor.php', $form.serialize() + "&get_gis_editor=true&ajax_request=true", function(data) {
|
||||
$.post('gis_data_editor.php', $form.serialize() + "&get_gis_editor=true&ajax_request=true", function (data) {
|
||||
if (data.success === true) {
|
||||
$gis_editor.html(data.gis_editor);
|
||||
initGISEditorVisualization();
|
||||
@ -276,14 +276,14 @@ AJAX.registerOnload('gis_data_editor.js', function() {
|
||||
/**
|
||||
* Handles closing of the GIS data editor.
|
||||
*/
|
||||
$('#gis_editor a.close_gis_editor, #gis_editor a.cancel_gis_editor').live('click', function() {
|
||||
$('#gis_editor a.close_gis_editor, #gis_editor a.cancel_gis_editor').live('click', function () {
|
||||
closeGISEditor();
|
||||
});
|
||||
|
||||
/**
|
||||
* Handles adding data points
|
||||
*/
|
||||
$('#gis_editor a.addJs.addPoint').live('click', function() {
|
||||
$('#gis_editor a.addJs.addPoint').live('click', function () {
|
||||
var $a = $(this);
|
||||
var name = $a.attr('name');
|
||||
// Eg. name = gis_data[0][MULTIPOINT][add_point] => prefix = gis_data[0][MULTIPOINT]
|
||||
@ -300,7 +300,7 @@ AJAX.registerOnload('gis_data_editor.js', function() {
|
||||
/**
|
||||
* Handles adding linestrings and inner rings
|
||||
*/
|
||||
$('#gis_editor a.addLine.addJs').live('click', function() {
|
||||
$('#gis_editor a.addLine.addJs').live('click', function () {
|
||||
var $a = $(this);
|
||||
var name = $a.attr('name');
|
||||
|
||||
@ -335,7 +335,7 @@ AJAX.registerOnload('gis_data_editor.js', function() {
|
||||
/**
|
||||
* Handles adding polygons
|
||||
*/
|
||||
$('#gis_editor a.addJs.addPolygon').live('click', function() {
|
||||
$('#gis_editor a.addJs.addPolygon').live('click', function () {
|
||||
var $a = $(this);
|
||||
var name = $a.attr('name');
|
||||
// Eg. name = gis_data[0][MULTIPOLYGON][add_polygon] => prefix = gis_data[0][MULTIPOLYGON]
|
||||
@ -364,7 +364,7 @@ AJAX.registerOnload('gis_data_editor.js', function() {
|
||||
/**
|
||||
* Handles adding geoms
|
||||
*/
|
||||
$('#gis_editor a.addJs.addGeom').live('click', function() {
|
||||
$('#gis_editor a.addJs.addGeom').live('click', function () {
|
||||
var $a = $(this);
|
||||
var prefix = 'gis_data[GEOMETRYCOLLECTION]';
|
||||
// Find the number of geoms
|
||||
@ -381,7 +381,9 @@ AJAX.registerOnload('gis_data_editor.js', function() {
|
||||
+ '<input type="text" name="gis_data[' + noOfGeoms + '][POINT][y]" value=""/>'
|
||||
+ '<br/><br/>';
|
||||
|
||||
$a.before(html1); $geomType.insertBefore($a); $a.before(html2);
|
||||
$a.before(html1);
|
||||
$geomType.insertBefore($a);
|
||||
$a.before(html2);
|
||||
$noOfGeomsInput.val(noOfGeoms + 1);
|
||||
});
|
||||
});
|
||||
|
||||
24
js/import.js
24
js/import.js
@ -11,7 +11,7 @@
|
||||
*/
|
||||
function changePluginOpts()
|
||||
{
|
||||
$("#format_specific_opts div.format_specific_options").each(function() {
|
||||
$("#format_specific_opts div.format_specific_options").each(function () {
|
||||
$(this).hide();
|
||||
});
|
||||
var selected_plugin_name = $("#plugins option:selected").val();
|
||||
@ -47,7 +47,7 @@ function matchFile(fname)
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('import.js', function() {
|
||||
AJAX.registerTeardown('import.js', function () {
|
||||
$("#plugins").unbind('change');
|
||||
$("#input_import_file").unbind('change');
|
||||
$("#select_local_import_file").unbind('change');
|
||||
@ -55,20 +55,20 @@ AJAX.registerTeardown('import.js', function() {
|
||||
$("#select_local_import_file").unbind('focus');
|
||||
});
|
||||
|
||||
AJAX.registerOnload('import.js', function() {
|
||||
AJAX.registerOnload('import.js', function () {
|
||||
// Initially display the options for the selected plugin
|
||||
changePluginOpts();
|
||||
|
||||
// Whenever the selected plugin changes, change the options displayed
|
||||
$("#plugins").change(function() {
|
||||
$("#plugins").change(function () {
|
||||
changePluginOpts();
|
||||
});
|
||||
|
||||
$("#input_import_file").change(function() {
|
||||
$("#input_import_file").change(function () {
|
||||
matchFile($(this).val());
|
||||
});
|
||||
|
||||
$("#select_local_import_file").change(function() {
|
||||
$("#select_local_import_file").change(function () {
|
||||
matchFile($(this).val());
|
||||
});
|
||||
|
||||
@ -76,13 +76,13 @@ AJAX.registerOnload('import.js', function() {
|
||||
* When the "Browse the server" form is clicked or the "Select from the web server upload directory"
|
||||
* form is clicked, the radio button beside it becomes selected and the other form becomes disabled.
|
||||
*/
|
||||
$("#input_import_file").bind("focus change", function() {
|
||||
$("#radio_import_file").prop('checked', true);
|
||||
$("#radio_local_import_file").prop('checked', false);
|
||||
$("#input_import_file").bind("focus change", function () {
|
||||
$("#radio_import_file").prop('checked', true);
|
||||
$("#radio_local_import_file").prop('checked', false);
|
||||
});
|
||||
$("#select_local_import_file").focus(function() {
|
||||
$("#radio_local_import_file").prop('checked', true);
|
||||
$("#radio_import_file").prop('checked', false);
|
||||
$("#select_local_import_file").focus(function () {
|
||||
$("#radio_local_import_file").prop('checked', true);
|
||||
$("#radio_import_file").prop('checked', false);
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@ -38,7 +38,7 @@ function checkIndexType()
|
||||
if ($select_index_type.val() == 'SPATIAL') {
|
||||
// Disable and hide the size column
|
||||
$size_header.hide();
|
||||
$size_inputs.each(function(){
|
||||
$size_inputs.each(function (){
|
||||
$(this)
|
||||
.prop('disabled', true)
|
||||
.parent('td').hide();
|
||||
@ -46,7 +46,7 @@ function checkIndexType()
|
||||
|
||||
// Disable and hide the columns of the index other than the first one
|
||||
var initial = true;
|
||||
$column_inputs.each(function() {
|
||||
$column_inputs.each(function () {
|
||||
$column_input = $(this);
|
||||
if (! initial) {
|
||||
$column_input
|
||||
@ -62,14 +62,14 @@ function checkIndexType()
|
||||
} else {
|
||||
// Enable and show the size column
|
||||
$size_header.show();
|
||||
$size_inputs.each(function() {
|
||||
$size_inputs.each(function () {
|
||||
$(this)
|
||||
.prop('disabled', false)
|
||||
.parent('td').show();
|
||||
});
|
||||
|
||||
// Enable and show the columns of the index
|
||||
$column_inputs.each(function() {
|
||||
$column_inputs.each(function () {
|
||||
$(this)
|
||||
.prop('disabled', false)
|
||||
.parent('td').show();
|
||||
@ -83,7 +83,7 @@ function checkIndexType()
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('indexes.js', function() {
|
||||
AJAX.registerTeardown('indexes.js', function () {
|
||||
$('#select_index_type').die('change');
|
||||
$('a.drop_primary_key_index_anchor.ajax').die('click');
|
||||
$("#table_index tbody tr td.edit_index.ajax, #indexes .add_index.ajax").die('click');
|
||||
@ -99,10 +99,10 @@ AJAX.registerTeardown('indexes.js', function() {
|
||||
* <li>create/edit/drop indexes</li>
|
||||
* </ul>
|
||||
*/
|
||||
AJAX.registerOnload('indexes.js', function() {
|
||||
AJAX.registerOnload('indexes.js', function () {
|
||||
checkIndexType();
|
||||
checkIndexName("index_frm");
|
||||
$('#select_index_type').live('change', function(event){
|
||||
$('#select_index_type').live('change', function (event){
|
||||
event.preventDefault();
|
||||
checkIndexType();
|
||||
checkIndexName("index_frm");
|
||||
@ -111,7 +111,7 @@ AJAX.registerOnload('indexes.js', function() {
|
||||
/**
|
||||
* Ajax Event handler for 'Drop Index'
|
||||
*/
|
||||
$('a.drop_primary_key_index_anchor.ajax').live('click', function(event) {
|
||||
$('a.drop_primary_key_index_anchor.ajax').live('click', function (event) {
|
||||
event.preventDefault();
|
||||
var $anchor = $(this);
|
||||
/**
|
||||
@ -132,15 +132,15 @@ AJAX.registerOnload('indexes.js', function() {
|
||||
.val()
|
||||
);
|
||||
|
||||
$anchor.PMA_confirm(question, $anchor.attr('href'), function(url) {
|
||||
$anchor.PMA_confirm(question, $anchor.attr('href'), function (url) {
|
||||
var $msg = PMA_ajaxShowMessage(PMA_messages['strDroppingPrimaryKeyIndex'], false);
|
||||
$.get(url, {'is_js_confirmed': 1, 'ajax_request': true}, function(data) {
|
||||
$.get(url, {'is_js_confirmed': 1, 'ajax_request': true}, function (data) {
|
||||
if (data.success === true) {
|
||||
PMA_ajaxRemoveMessage($msg);
|
||||
var $table_ref = $rows_to_hide.closest('table');
|
||||
if ($rows_to_hide.length == $table_ref.find('tbody > tr').length) {
|
||||
// We are about to remove all rows from the table
|
||||
$table_ref.hide('medium', function() {
|
||||
$table_ref.hide('medium', function () {
|
||||
$('div.no_indexes_defined').show('medium');
|
||||
$rows_to_hide.remove();
|
||||
});
|
||||
@ -151,8 +151,8 @@ AJAX.registerOnload('indexes.js', function() {
|
||||
$rows_to_hide.hide("medium", function () {
|
||||
$(this).remove();
|
||||
});
|
||||
}
|
||||
if ($('#result_query').length) {
|
||||
}
|
||||
if ($('#result_query').length) {
|
||||
$('#result_query').remove();
|
||||
}
|
||||
if (data.sql_query) {
|
||||
@ -160,7 +160,7 @@ AJAX.registerOnload('indexes.js', function() {
|
||||
.html(data.sql_query)
|
||||
.prependTo('#page_content');
|
||||
}
|
||||
PMA_commonActions.refreshMain(false, function() {
|
||||
PMA_commonActions.refreshMain(false, function () {
|
||||
$("a.ajax[href^=#indexes]").click();
|
||||
});
|
||||
PMA_reloadNavigation();
|
||||
@ -174,7 +174,7 @@ AJAX.registerOnload('indexes.js', function() {
|
||||
/**
|
||||
*Ajax event handler for index edit
|
||||
**/
|
||||
$("#table_index tbody tr td.edit_index.ajax, #indexes .add_index.ajax").live('click', function(event) {
|
||||
$("#table_index tbody tr td.edit_index.ajax, #indexes .add_index.ajax").live('click', function (event) {
|
||||
event.preventDefault();
|
||||
if ($(this).find("a").length === 0) {
|
||||
// Add index
|
||||
@ -197,9 +197,9 @@ AJAX.registerOnload('indexes.js', function() {
|
||||
var title = PMA_messages['strEditIndex'];
|
||||
}
|
||||
url += "&ajax_request=true";
|
||||
indexEditorDialog(url, title, function() {
|
||||
indexEditorDialog(url, title, function () {
|
||||
// refresh the page using ajax
|
||||
PMA_commonActions.refreshMain(false, function() {
|
||||
PMA_commonActions.refreshMain(false, function () {
|
||||
$("a.ajax[href^=#indexes]").click();
|
||||
});
|
||||
});
|
||||
|
||||
@ -5,16 +5,16 @@
|
||||
* @param object event data
|
||||
*/
|
||||
|
||||
AJAX.registerTeardown('keyhandler.js', function() {
|
||||
AJAX.registerTeardown('keyhandler.js', function () {
|
||||
$('#table_columns').die('keydown');
|
||||
$('table.insertRowTable').die('keydown');
|
||||
});
|
||||
|
||||
AJAX.registerOnload('keyhandler.js', function() {
|
||||
$('#table_columns').live('keydown', function(event) {
|
||||
AJAX.registerOnload('keyhandler.js', function () {
|
||||
$('#table_columns').live('keydown', function (event) {
|
||||
onKeyDownArrowsHandler(event.originalEvent);
|
||||
});
|
||||
$('table.insertRowTable').live('keydown', function(event) {
|
||||
$('table.insertRowTable').live('keydown', function (event) {
|
||||
onKeyDownArrowsHandler(event.originalEvent);
|
||||
});
|
||||
});
|
||||
@ -52,24 +52,24 @@ function onKeyDownArrowsHandler(e)
|
||||
var nO = null;
|
||||
|
||||
switch(e.keyCode) {
|
||||
case 38:
|
||||
// up
|
||||
y--;
|
||||
break;
|
||||
case 40:
|
||||
// down
|
||||
y++;
|
||||
break;
|
||||
case 37:
|
||||
// left
|
||||
x--;
|
||||
break;
|
||||
case 39:
|
||||
// right
|
||||
x++;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
case 38:
|
||||
// up
|
||||
y--;
|
||||
break;
|
||||
case 40:
|
||||
// down
|
||||
y++;
|
||||
break;
|
||||
case 37:
|
||||
// left
|
||||
x--;
|
||||
break;
|
||||
case 39:
|
||||
// right
|
||||
x++;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
var id = "field_" + y + "_" + x;
|
||||
|
||||
224
js/makegrid.js
224
js/makegrid.js
@ -77,7 +77,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
* @param e event
|
||||
* @param obj dragged div object
|
||||
*/
|
||||
dragStartRsz: function(e, obj) {
|
||||
dragStartRsz: function (e, obj) {
|
||||
var n = $(g.cRsz).find('div').index(obj); // get the index of separator (i.e., column index)
|
||||
$(obj).addClass('colborder_active');
|
||||
g.colRsz = {
|
||||
@ -99,7 +99,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
* @param e event
|
||||
* @param obj table header object
|
||||
*/
|
||||
dragStartReorder: function(e, obj) {
|
||||
dragStartReorder: function (e, obj) {
|
||||
// prepare the cCpy (column copy) and cPointer (column pointer) from the dragged column
|
||||
$(g.cCpy).text($(obj).text());
|
||||
var objPos = $(obj).position();
|
||||
@ -137,7 +137,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
*
|
||||
* @param e event
|
||||
*/
|
||||
dragMove: function(e) {
|
||||
dragMove: function (e) {
|
||||
if (g.colRsz) {
|
||||
var dx = e.pageX - g.colRsz.x0;
|
||||
if (g.colRsz.objWidth + dx > g.minColWidth) {
|
||||
@ -179,7 +179,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
*
|
||||
* @param e event
|
||||
*/
|
||||
dragEnd: function(e) {
|
||||
dragEnd: function (e) {
|
||||
if (g.colRsz) {
|
||||
var dx = e.pageX - g.colRsz.x0;
|
||||
var nw = g.colRsz.objWidth + dx;
|
||||
@ -230,8 +230,8 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
* @param n zero-based column index
|
||||
* @param nw new width of the column in pixel
|
||||
*/
|
||||
resize: function(n, nw) {
|
||||
$(g.t).find('tr').each(function() {
|
||||
resize: function (n, nw) {
|
||||
$(g.t).find('tr').each(function () {
|
||||
$(this).find('th.draggable:visible:eq(' + n + ') span,' +
|
||||
'td:visible:eq(' + (g.actionSpan + n) + ') span')
|
||||
.css('width', nw);
|
||||
@ -241,7 +241,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
/**
|
||||
* Reposition column resize bars.
|
||||
*/
|
||||
reposRsz: function() {
|
||||
reposRsz: function () {
|
||||
$(g.cRsz).find('div').hide();
|
||||
var $firstRowCols = $(g.t).find('tr:first th.draggable:visible');
|
||||
var $resizeHandles = $(g.cRsz).find('div').removeClass('condition');
|
||||
@ -269,8 +269,8 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
* @param oldn old zero-based column index
|
||||
* @param newn new zero-based column index
|
||||
*/
|
||||
shiftCol: function(oldn, newn) {
|
||||
$(g.t).find('tr').each(function() {
|
||||
shiftCol: function (oldn, newn) {
|
||||
$(g.t).find('tr').each(function () {
|
||||
if (newn < oldn) {
|
||||
$(this).find('th.draggable:eq(' + newn + '),' +
|
||||
'td:eq(' + (g.actionSpan + newn) + ')')
|
||||
@ -312,10 +312,10 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
* @param e event
|
||||
* @return the hovered column's th object or undefined if no hovered column found.
|
||||
*/
|
||||
getHoveredCol: function(e) {
|
||||
getHoveredCol: function (e) {
|
||||
var hoveredCol;
|
||||
$headers = $(g.t).find('th.draggable:visible');
|
||||
$headers.each(function() {
|
||||
$headers.each(function () {
|
||||
var left = $(this).offset().left;
|
||||
var right = left + $(this).outerWidth();
|
||||
if (left <= e.pageX && e.pageX <= right) {
|
||||
@ -331,14 +331,14 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
* @param obj table header <th> object
|
||||
* @return zero-based index of the specified table header in the set of table headers (visible or not)
|
||||
*/
|
||||
getHeaderIdx: function(obj) {
|
||||
getHeaderIdx: function (obj) {
|
||||
return $(obj).parents('tr').find('th.draggable').index(obj);
|
||||
},
|
||||
|
||||
/**
|
||||
* Reposition the columns back to normal order.
|
||||
*/
|
||||
restoreColOrder: function() {
|
||||
restoreColOrder: function () {
|
||||
// use insertion sort, since we already have shiftCol function
|
||||
for (var i = 1; i < g.colOrder.length; i++) {
|
||||
var x = g.colOrder[i];
|
||||
@ -360,7 +360,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
/**
|
||||
* Send column preferences (column order and visibility) to the server.
|
||||
*/
|
||||
sendColPrefs: function() {
|
||||
sendColPrefs: function () {
|
||||
if ($(g.t).is('.ajax')) { // only send preferences if ajax class
|
||||
var post_params = {
|
||||
ajax_request: true,
|
||||
@ -377,7 +377,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
if (g.colVisib.length > 0) {
|
||||
$.extend(post_params, {col_visib: g.colVisib.toString()});
|
||||
}
|
||||
$.post('sql.php', post_params, function(data) {
|
||||
$.post('sql.php', post_params, function (data) {
|
||||
if (data.success !== true) {
|
||||
var $temp_div = $(document.createElement('div'));
|
||||
$temp_div.html(data.error);
|
||||
@ -392,7 +392,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
* Refresh restore button state.
|
||||
* Make restore button disabled if the table is similar with initial state.
|
||||
*/
|
||||
refreshRestoreButton: function() {
|
||||
refreshRestoreButton: function () {
|
||||
// check if table state is as initial state
|
||||
var isInitial = true;
|
||||
for (var i = 0; i < g.colOrder.length; i++) {
|
||||
@ -415,7 +415,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
* Update current hint using the boolean values (showReorderHint, showSortHint, etc.).
|
||||
*
|
||||
*/
|
||||
updateHint: function() {
|
||||
updateHint: function () {
|
||||
var text = '';
|
||||
if (!g.colRsz && !g.colReorder) { // if not resizing or dragging
|
||||
if (g.visibleHeadersCount > 1) {
|
||||
@ -450,11 +450,11 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
*
|
||||
* @return boolean True if the column is toggled successfully.
|
||||
*/
|
||||
toggleCol: function(n) {
|
||||
toggleCol: function (n) {
|
||||
if (g.colVisib[n]) {
|
||||
// can hide if more than one column is visible
|
||||
if (g.visibleHeadersCount > 1) {
|
||||
$(g.t).find('tr').each(function() {
|
||||
$(g.t).find('tr').each(function () {
|
||||
$(this).find('th.draggable:eq(' + n + '),' +
|
||||
'td:eq(' + (g.actionSpan + n) + ')')
|
||||
.hide();
|
||||
@ -467,7 +467,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
return false;
|
||||
}
|
||||
} else { // column n is not visible
|
||||
$(g.t).find('tr').each(function() {
|
||||
$(g.t).find('tr').each(function () {
|
||||
$(this).find('th.draggable:eq(' + n + '),' +
|
||||
'td:eq(' + (g.actionSpan + n) + ')')
|
||||
.show();
|
||||
@ -484,7 +484,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
* This function is separated from toggleCol because, sometimes, we want to toggle
|
||||
* some columns together at one time and do just one adjustment after it, e.g. in showAllColumns().
|
||||
*/
|
||||
afterToggleCol: function() {
|
||||
afterToggleCol: function () {
|
||||
// some adjustments after hiding column
|
||||
g.reposRsz();
|
||||
g.reposDrop();
|
||||
@ -500,7 +500,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
*
|
||||
* @param obj The drop down arrow of column visibility list
|
||||
*/
|
||||
showColList: function(obj) {
|
||||
showColList: function (obj) {
|
||||
// only show when not resizing or reordering
|
||||
if (!g.colRsz && !g.colReorder) {
|
||||
var pos = $(obj).position();
|
||||
@ -520,7 +520,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
/**
|
||||
* Hide columns' visibility list.
|
||||
*/
|
||||
hideColList: function() {
|
||||
hideColList: function () {
|
||||
$(g.cList).hide();
|
||||
$(g.cDrop).find('.coldrop-hover').removeClass('coldrop-hover');
|
||||
},
|
||||
@ -528,7 +528,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
/**
|
||||
* Reposition the column visibility drop-down arrow.
|
||||
*/
|
||||
reposDrop: function() {
|
||||
reposDrop: function () {
|
||||
var $th = $(t).find('th:not(.draggable)');
|
||||
for (var i = 0; i < $th.length; i++) {
|
||||
var $cd = $(g.cDrop).find('div:eq(' + i + ')'); // column drop-down arrow
|
||||
@ -543,7 +543,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
/**
|
||||
* Show all hidden columns.
|
||||
*/
|
||||
showAllColumns: function() {
|
||||
showAllColumns: function () {
|
||||
for (var i = 0; i < g.colVisib.length; i++) {
|
||||
if (!g.colVisib[i]) {
|
||||
g.toggleCol(i);
|
||||
@ -557,7 +557,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
*
|
||||
* @param cell <td> element to be edited
|
||||
*/
|
||||
showEditCell: function(cell) {
|
||||
showEditCell: function (cell) {
|
||||
if ($(cell).is('.grid_edit') &&
|
||||
!g.colRsz && !g.colReorder)
|
||||
{
|
||||
@ -596,7 +596,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
* @param field Optional, the edited <td>. If not specified, the function will
|
||||
* use currently edited <td> from g.currentEditCell.
|
||||
*/
|
||||
hideEditCell: function(force, data, field) {
|
||||
hideEditCell: function (force, data, field) {
|
||||
if (g.isCellEditActive && !force) {
|
||||
// cell is being edited, save or post the edited data
|
||||
g.saveOrPostEditedCell();
|
||||
@ -631,13 +631,13 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
}
|
||||
}
|
||||
if (data.transformations !== undefined) {
|
||||
$.each(data.transformations, function(cell_index, value) {
|
||||
$.each(data.transformations, function (cell_index, value) {
|
||||
var $this_field = $(g.t).find('.to_be_saved:eq(' + cell_index + ')');
|
||||
$this_field.find('span').html(value);
|
||||
});
|
||||
}
|
||||
if (data.relations !== undefined) {
|
||||
$.each(data.relations, function(cell_index, value) {
|
||||
$.each(data.relations, function (cell_index, value) {
|
||||
var $this_field = $(g.t).find('.to_be_saved:eq(' + cell_index + ')');
|
||||
$this_field.find('span').html(value);
|
||||
});
|
||||
@ -666,7 +666,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
/**
|
||||
* Show drop-down edit area when edit cell is focused.
|
||||
*/
|
||||
showEditArea: function() {
|
||||
showEditArea: function () {
|
||||
if (!g.isCellEditActive) { // make sure the edit area has not been shown
|
||||
g.isCellEditActive = true;
|
||||
g.isEditCellTextEditable = false;
|
||||
@ -738,37 +738,37 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
|
||||
// if the select/editor is changed un-check the 'checkbox_null_<field_name>_<row_index>'.
|
||||
if ($td.is('.enum, .set')) {
|
||||
$editArea.find('select').live('change', function(e) {
|
||||
$editArea.find('select').live('change', function (e) {
|
||||
$checkbox.prop('checked', false);
|
||||
});
|
||||
} else if ($td.is('.relation')) {
|
||||
$editArea.find('select').live('change', function(e) {
|
||||
$editArea.find('select').live('change', function (e) {
|
||||
$checkbox.prop('checked', false);
|
||||
});
|
||||
$editArea.find('.browse_foreign').live('click', function(e) {
|
||||
$editArea.find('.browse_foreign').live('click', function (e) {
|
||||
$checkbox.prop('checked', false);
|
||||
});
|
||||
} else {
|
||||
$(g.cEdit).find('.edit_box').live('keypress change', function(e) {
|
||||
$(g.cEdit).find('.edit_box').live('keypress change', function (e) {
|
||||
$checkbox.prop('checked', false);
|
||||
});
|
||||
// Capture ctrl+v (on IE and Chrome)
|
||||
$(g.cEdit).find('.edit_box').live('keydown', function(e) {
|
||||
$(g.cEdit).find('.edit_box').live('keydown', function (e) {
|
||||
if (e.ctrlKey && e.which == 86) {
|
||||
$checkbox.prop('checked', false);
|
||||
}
|
||||
});
|
||||
$editArea.find('textarea').live('keydown', function(e) {
|
||||
$editArea.find('textarea').live('keydown', function (e) {
|
||||
$checkbox.prop('checked', false);
|
||||
});
|
||||
}
|
||||
|
||||
// if null checkbox is clicked empty the corresponding select/editor.
|
||||
$checkbox.click(function(e) {
|
||||
$checkbox.click(function (e) {
|
||||
if ($td.is('.enum')) {
|
||||
$editArea.find('select').val('');
|
||||
} else if ($td.is('.set')) {
|
||||
$editArea.find('select').find('option').each(function() {
|
||||
$editArea.find('select').find('option').each(function () {
|
||||
var $option = $(this);
|
||||
$option.prop('selected', false);
|
||||
});
|
||||
@ -806,7 +806,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
'relation_key_or_display_column' : relation_key_or_display_column
|
||||
};
|
||||
|
||||
g.lastXHR = $.post('sql.php', post_params, function(data) {
|
||||
g.lastXHR = $.post('sql.php', post_params, function (data) {
|
||||
g.lastXHR = null;
|
||||
$editArea.removeClass('edit_area_loading');
|
||||
if ($(data.dropdown).is('select')) {
|
||||
@ -824,13 +824,13 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
// 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').change(function () {
|
||||
$(g.cEdit).find('.edit_box').val($(this).text());
|
||||
});
|
||||
}); // end $.post()
|
||||
|
||||
$editArea.show();
|
||||
$editArea.find('select').live('change', function(e) {
|
||||
$editArea.find('select').live('change', function (e) {
|
||||
$(g.cEdit).find('.edit_box').val($(this).val());
|
||||
});
|
||||
g.isEditCellTextEditable = true;
|
||||
@ -843,16 +843,16 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
* @var post_params Object containing parameters for the POST request
|
||||
*/
|
||||
var post_params = {
|
||||
'ajax_request' : true,
|
||||
'get_enum_values' : true,
|
||||
'server' : g.server,
|
||||
'db' : g.db,
|
||||
'table' : g.table,
|
||||
'column' : field_name,
|
||||
'token' : g.token,
|
||||
'curr_value' : curr_value
|
||||
'ajax_request' : true,
|
||||
'get_enum_values' : true,
|
||||
'server' : g.server,
|
||||
'db' : g.db,
|
||||
'table' : g.table,
|
||||
'column' : field_name,
|
||||
'token' : g.token,
|
||||
'curr_value' : curr_value
|
||||
};
|
||||
g.lastXHR = $.post('sql.php', post_params, function(data) {
|
||||
g.lastXHR = $.post('sql.php', post_params, function (data) {
|
||||
g.lastXHR = null;
|
||||
$editArea.removeClass('edit_area_loading');
|
||||
$editArea.append(data.dropdown);
|
||||
@ -860,7 +860,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
}); // end $.post()
|
||||
|
||||
$editArea.show();
|
||||
$editArea.find('select').live('change', function(e) {
|
||||
$editArea.find('select').live('change', function (e) {
|
||||
$(g.cEdit).find('.edit_box').val($(this).val());
|
||||
});
|
||||
}
|
||||
@ -872,17 +872,17 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
* @var post_params Object containing parameters for the POST request
|
||||
*/
|
||||
var post_params = {
|
||||
'ajax_request' : true,
|
||||
'get_set_values' : true,
|
||||
'server' : g.server,
|
||||
'db' : g.db,
|
||||
'table' : g.table,
|
||||
'column' : field_name,
|
||||
'token' : g.token,
|
||||
'curr_value' : curr_value
|
||||
'ajax_request' : true,
|
||||
'get_set_values' : true,
|
||||
'server' : g.server,
|
||||
'db' : g.db,
|
||||
'table' : g.table,
|
||||
'column' : field_name,
|
||||
'token' : g.token,
|
||||
'curr_value' : curr_value
|
||||
};
|
||||
|
||||
g.lastXHR = $.post('sql.php', post_params, function(data) {
|
||||
g.lastXHR = $.post('sql.php', post_params, function (data) {
|
||||
g.lastXHR = null;
|
||||
$editArea.removeClass('edit_area_loading');
|
||||
$editArea.append(data.select);
|
||||
@ -890,7 +890,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
}); // end $.post()
|
||||
|
||||
$editArea.show();
|
||||
$editArea.find('select').live('change', function(e) {
|
||||
$editArea.find('select').live('change', function (e) {
|
||||
$(g.cEdit).find('.edit_box').val($(this).val());
|
||||
});
|
||||
}
|
||||
@ -901,10 +901,10 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
$editArea.append('<textarea></textarea>');
|
||||
$editArea.find('textarea')
|
||||
.val(value)
|
||||
.live('keyup', function(e) {
|
||||
.live('keyup', function (e) {
|
||||
$(g.cEdit).find('.edit_box').val($(this).val());
|
||||
});
|
||||
$(g.cEdit).find('.edit_box').live('keyup', function(e) {
|
||||
$(g.cEdit).find('.edit_box').live('keyup', function (e) {
|
||||
$editArea.find('textarea').val($(this).val());
|
||||
});
|
||||
$editArea.append('<div class="cell_edit_hint">' + g.cellEditHint + '</div>');
|
||||
@ -928,7 +928,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
'ajax_request' : true,
|
||||
'sql_query' : sql_query,
|
||||
'grid_edit' : true
|
||||
}, function(data) {
|
||||
}, function (data) {
|
||||
g.lastXHR = null;
|
||||
$editArea.removeClass('edit_area_loading');
|
||||
if (data.success === true) {
|
||||
@ -942,10 +942,10 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
$editArea.append('<textarea></textarea>');
|
||||
$editArea.find('textarea')
|
||||
.val(data.value)
|
||||
.live('keyup', function(e) {
|
||||
.live('keyup', function (e) {
|
||||
$(g.cEdit).find('.edit_box').val($(this).val());
|
||||
});
|
||||
$(g.cEdit).find('.edit_box').live('keyup', function(e) {
|
||||
$(g.cEdit).find('.edit_box').live('keyup', function (e) {
|
||||
$editArea.find('textarea').val($(this).val());
|
||||
});
|
||||
$editArea.append('<div class="cell_edit_hint">' + g.cellEditHint + '</div>');
|
||||
@ -970,14 +970,14 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
PMA_addDatepicker($editArea, {
|
||||
altField: $input_field,
|
||||
showTimepicker: showTimeOption,
|
||||
onSelect: function(dateText, inst) {
|
||||
onSelect: function (dateText, inst) {
|
||||
// remove null checkbox if it exists
|
||||
$(g.cEdit).find('.null_div input[type=checkbox]').prop('checked', false);
|
||||
}
|
||||
});
|
||||
|
||||
// cancel any click on the datepicker element
|
||||
$editArea.find('> *').click(function(e) {
|
||||
$editArea.find('> *').click(function (e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
@ -1015,7 +1015,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
/**
|
||||
* Post the content of edited cell.
|
||||
*/
|
||||
postEditedCell: function() {
|
||||
postEditedCell: function () {
|
||||
if (g.isSaving) {
|
||||
return;
|
||||
}
|
||||
@ -1070,7 +1070,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
}
|
||||
|
||||
// loop each edited row
|
||||
$('td.to_be_saved').parents('tr').each(function() {
|
||||
$('td.to_be_saved').parents('tr').each(function () {
|
||||
var $tr = $(this);
|
||||
var where_clause = $tr.find('.where_clause').val();
|
||||
full_where_clause.push(PMA_urldecode(where_clause));
|
||||
@ -1085,7 +1085,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
var fields_null = [];
|
||||
|
||||
// loop each edited cell in a row
|
||||
$tr.find('.to_be_saved').each(function() {
|
||||
$tr.find('.to_be_saved').each(function () {
|
||||
/**
|
||||
* @var $this_field Object referring to the td that is being edited
|
||||
*/
|
||||
@ -1201,7 +1201,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
url: 'tbl_replace.php',
|
||||
data: post_params,
|
||||
success:
|
||||
function(data) {
|
||||
function (data) {
|
||||
g.isSaving = false;
|
||||
if (!g.saveCellsAtOnce) {
|
||||
$(g.cEdit).find('*').removeProp('disabled');
|
||||
@ -1214,7 +1214,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
PMA_ajaxShowMessage(data.message);
|
||||
|
||||
// update where_clause related data in each edited row
|
||||
$('td.to_be_saved').parents('tr').each(function() {
|
||||
$('td.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.val();
|
||||
@ -1223,20 +1223,20 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
|
||||
$where_clause.val(new_clause);
|
||||
// update Edit, Copy, and Delete links also
|
||||
$(this).find('a').each(function() {
|
||||
$(this).find('a').each(function () {
|
||||
$(this).attr('href', $(this).attr('href').replace(old_clause, new_clause));
|
||||
// update delete confirmation in Delete link
|
||||
if ($(this).attr('href').indexOf('DELETE') > -1) {
|
||||
$(this).removeAttr('onclick')
|
||||
.unbind('click')
|
||||
.bind('click', function() {
|
||||
.bind('click', function () {
|
||||
return confirmLink(this, 'DELETE FROM `' + g.db + '`.`' + g.table + '` WHERE ' +
|
||||
decoded_new_clause + (is_unique ? '' : ' LIMIT 1'));
|
||||
});
|
||||
}
|
||||
});
|
||||
// update the multi edit checkboxes
|
||||
$(this).find('input[type=checkbox]').each(function() {
|
||||
$(this).find('input[type=checkbox]').each(function () {
|
||||
var $checkbox = $(this);
|
||||
var checkbox_name = $checkbox.attr('name');
|
||||
var checkbox_value = $checkbox.val();
|
||||
@ -1273,7 +1273,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
/**
|
||||
* Save edited cell, so it can be posted later.
|
||||
*/
|
||||
saveEditedCell: function() {
|
||||
saveEditedCell: function () {
|
||||
/**
|
||||
* @var $this_field Object referring to the td that is being edited
|
||||
*/
|
||||
@ -1312,7 +1312,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
this_field_params[field_name] = '0b' + $(g.cEdit).find('.edit_box').val();
|
||||
} else if ($this_field.is('.set')) {
|
||||
$test_element = $(g.cEdit).find('select');
|
||||
this_field_params[field_name] = $test_element.map(function(){
|
||||
this_field_params[field_name] = $test_element.map(function (){
|
||||
return $(this).val();
|
||||
}).get().join(",");
|
||||
} else if ($this_field.is('.relation, .enum')) {
|
||||
@ -1343,7 +1343,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
/**
|
||||
* Save or post currently edited cell, depending on the "saveCellsAtOnce" configuration.
|
||||
*/
|
||||
saveOrPostEditedCell: function() {
|
||||
saveOrPostEditedCell: function () {
|
||||
var saved = g.saveEditedCell();
|
||||
if (!g.saveCellsAtOnce) {
|
||||
if (saved) {
|
||||
@ -1363,7 +1363,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
/**
|
||||
* Initialize column resize feature.
|
||||
*/
|
||||
initColResize: function() {
|
||||
initColResize: function () {
|
||||
// create column resizer div
|
||||
g.cRsz = document.createElement('div');
|
||||
g.cRsz.className = 'cRsz';
|
||||
@ -1372,10 +1372,10 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
var $firstRowCols = $(g.t).find('tr:first th.draggable');
|
||||
|
||||
// create column borders
|
||||
$firstRowCols.each(function() {
|
||||
$firstRowCols.each(function () {
|
||||
var cb = document.createElement('div'); // column border
|
||||
$(cb).addClass('colborder')
|
||||
.mousedown(function(e) {
|
||||
.mousedown(function (e) {
|
||||
g.dragStartRsz(e, this);
|
||||
});
|
||||
$(g.cRsz).append(cb);
|
||||
@ -1389,7 +1389,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
/**
|
||||
* Initialize column reordering feature.
|
||||
*/
|
||||
initColReorder: function() {
|
||||
initColReorder: function () {
|
||||
g.cCpy = document.createElement('div'); // column copy, to store copy of dragged column header
|
||||
g.cPointer = document.createElement('div'); // column pointer, used when reordering column
|
||||
|
||||
@ -1423,25 +1423,25 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
|
||||
// register events
|
||||
$(t).find('th.draggable')
|
||||
.mousedown(function(e) {
|
||||
.mousedown(function (e) {
|
||||
if (g.visibleHeadersCount > 1) {
|
||||
g.dragStartReorder(e, this);
|
||||
}
|
||||
})
|
||||
.mouseenter(function(e) {
|
||||
.mouseenter(function (e) {
|
||||
if (g.visibleHeadersCount > 1) {
|
||||
$(this).css('cursor', 'move');
|
||||
} else {
|
||||
$(this).css('cursor', 'inherit');
|
||||
}
|
||||
})
|
||||
.mouseleave(function(e) {
|
||||
.mouseleave(function (e) {
|
||||
g.showReorderHint = false;
|
||||
$(this).tooltip("option", {
|
||||
content: g.updateHint()
|
||||
}) ;
|
||||
})
|
||||
.dblclick(function(e) {
|
||||
.dblclick(function (e) {
|
||||
e.preventDefault();
|
||||
$("<div/>")
|
||||
.prop("title", PMA_messages["strColNameCopyTitle"])
|
||||
@ -1459,7 +1459,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
.find("input").focus().select();
|
||||
});
|
||||
// restore column order when the restore button is clicked
|
||||
$('div.restore_column').click(function() {
|
||||
$('div.restore_column').click(function () {
|
||||
g.restoreColOrder();
|
||||
});
|
||||
|
||||
@ -1468,7 +1468,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
$(g.gDiv).append(g.cCpy);
|
||||
|
||||
// prevent default "dragstart" event when dragging a link
|
||||
$(t).find('th a').bind('dragstart', function() {
|
||||
$(t).find('th a').bind('dragstart', function () {
|
||||
return false;
|
||||
});
|
||||
|
||||
@ -1479,7 +1479,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
/**
|
||||
* Initialize column visibility feature.
|
||||
*/
|
||||
initColVisib: function() {
|
||||
initColVisib: function () {
|
||||
g.cDrop = document.createElement('div'); // column drop-down arrows
|
||||
g.cList = document.createElement('div'); // column visibility list
|
||||
|
||||
@ -1520,12 +1520,12 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
);
|
||||
|
||||
// create column visibility drop-down arrow(s)
|
||||
$colVisibTh.each(function() {
|
||||
$colVisibTh.each(function () {
|
||||
var $th = $(this);
|
||||
var cd = document.createElement('div'); // column drop-down arrow
|
||||
var pos = $th.position();
|
||||
$(cd).addClass('coldrop')
|
||||
.click(function() {
|
||||
.click(function () {
|
||||
if (g.cList.style.display == 'none') {
|
||||
g.showColList(this);
|
||||
} else {
|
||||
@ -1545,7 +1545,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
.prepend('<input type="checkbox" ' + (g.colVisib[i] ? 'checked="checked" ' : '') + '/>');
|
||||
$listDiv.append(listElmt);
|
||||
// add event on click
|
||||
$(listElmt).click(function() {
|
||||
$(listElmt).click(function () {
|
||||
if ( g.toggleCol($(this).index()) ) {
|
||||
g.afterToggleCol();
|
||||
}
|
||||
@ -1556,21 +1556,21 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
$(showAll).addClass('showAllColBtn')
|
||||
.text(g.showAllColText);
|
||||
$(g.cList).append(showAll);
|
||||
$(showAll).click(function() {
|
||||
$(showAll).click(function () {
|
||||
g.showAllColumns();
|
||||
});
|
||||
// prepend "show all column" button at top if the list is too long
|
||||
if ($firstRowCols.length > 10) {
|
||||
var clone = showAll.cloneNode(true);
|
||||
$(g.cList).prepend(clone);
|
||||
$(clone).click(function() {
|
||||
$(clone).click(function () {
|
||||
g.showAllColumns();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// hide column visibility list if we move outside the list
|
||||
$(t).find('td, th.draggable').mouseenter(function() {
|
||||
$(t).find('td, th.draggable').mouseenter(function () {
|
||||
g.hideColList();
|
||||
});
|
||||
|
||||
@ -1585,7 +1585,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
/**
|
||||
* Initialize grid editing feature.
|
||||
*/
|
||||
initGridEdit: function() {
|
||||
initGridEdit: function () {
|
||||
|
||||
function startGridEditing(e, cell) {
|
||||
if (g.isCellEditActive) {
|
||||
@ -1616,7 +1616,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
|
||||
// register events
|
||||
$(t).find('td.data.click1')
|
||||
.click(function(e) {
|
||||
.click(function (e) {
|
||||
startGridEditing(e, this);
|
||||
// prevent default action when clicking on "link" in a table
|
||||
if ($(e.target).is('.grid_edit a')) {
|
||||
@ -1625,7 +1625,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
});
|
||||
|
||||
$(t).find('td.data.click2')
|
||||
.click(function(e) {
|
||||
.click(function (e) {
|
||||
$cell = $(this);
|
||||
// In the case of relational link, We want single click on the link
|
||||
// to goto the link and double click to start grid-editing.
|
||||
@ -1639,7 +1639,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
if (clicks == 1) {
|
||||
// if there are no previous clicks,
|
||||
// start the single click timer
|
||||
timer = setTimeout(function() {
|
||||
timer = setTimeout(function () {
|
||||
// temporarily remove ajax class so the page loader will not handle it,
|
||||
// submit and then add it back
|
||||
$link.removeClass('ajax');
|
||||
@ -1659,7 +1659,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
}
|
||||
}
|
||||
})
|
||||
.dblclick(function(e) {
|
||||
.dblclick(function (e) {
|
||||
if ($(e.target).is('.grid_edit a')) {
|
||||
e.preventDefault();
|
||||
} else {
|
||||
@ -1667,39 +1667,39 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
}
|
||||
});
|
||||
|
||||
$(g.cEdit).find('.edit_box').focus(function(e) {
|
||||
$(g.cEdit).find('.edit_box').focus(function (e) {
|
||||
g.showEditArea();
|
||||
});
|
||||
$(g.cEdit).find('.edit_box, select').live('keydown', function(e) {
|
||||
$(g.cEdit).find('.edit_box, select').live('keydown', function (e) {
|
||||
if (e.which == 13) {
|
||||
// post on pressing "Enter"
|
||||
e.preventDefault();
|
||||
g.saveOrPostEditedCell();
|
||||
}
|
||||
});
|
||||
$(g.cEdit).keydown(function(e) {
|
||||
$(g.cEdit).keydown(function (e) {
|
||||
if (!g.isEditCellTextEditable) {
|
||||
// prevent text editing
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
$('html').click(function(e) {
|
||||
$('html').click(function (e) {
|
||||
// hide edit cell if the click is not from g.cEdit
|
||||
if ($(e.target).parents().index(g.cEdit) == -1) {
|
||||
g.hideEditCell();
|
||||
}
|
||||
}).keydown(function(e) {
|
||||
}).keydown(function (e) {
|
||||
if (e.which == 27 && g.isCellEditActive) {
|
||||
|
||||
// cancel on pressing "Esc"
|
||||
g.hideEditCell(true);
|
||||
}
|
||||
});
|
||||
$('div.save_edited').click(function() {
|
||||
$('div.save_edited').click(function () {
|
||||
g.hideEditCell();
|
||||
g.postEditedCell();
|
||||
});
|
||||
$(window).bind('beforeunload', function(e) {
|
||||
$(window).bind('beforeunload', function (e) {
|
||||
if (g.isCellEdited) {
|
||||
return g.saveCellWarning;
|
||||
}
|
||||
@ -1803,13 +1803,13 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
|
||||
// register events for hint tooltip (anchors inside draggable th)
|
||||
$(t).find('th.draggable a')
|
||||
.mouseenter(function(e) {
|
||||
.mouseenter(function (e) {
|
||||
g.showSortHint = true;
|
||||
$(t).find("th.draggable").tooltip("option", {
|
||||
content: g.updateHint()
|
||||
});
|
||||
})
|
||||
.mouseleave(function(e) {
|
||||
.mouseleave(function (e) {
|
||||
g.showSortHint = false;
|
||||
$(t).find("th.draggable").tooltip("option", {
|
||||
content: g.updateHint()
|
||||
@ -1818,10 +1818,10 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi
|
||||
|
||||
// register events for dragging-related feature
|
||||
if (enableResize || enableReorder) {
|
||||
$(document).mousemove(function(e) {
|
||||
$(document).mousemove(function (e) {
|
||||
g.dragMove(e);
|
||||
});
|
||||
$(document).mouseup(function(e) {
|
||||
$(document).mouseup(function (e) {
|
||||
g.dragEnd(e);
|
||||
});
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
/**
|
||||
* Executed on page load
|
||||
*/
|
||||
$(function() {
|
||||
$(function () {
|
||||
if (! $('#pma_navigation').length) {
|
||||
// Don't bother running any code if the navigation is not even on the page
|
||||
return;
|
||||
@ -21,7 +21,7 @@ $(function() {
|
||||
* opens/closes (hides/shows) tree elements
|
||||
* loads data via ajax
|
||||
*/
|
||||
$('#pma_navigation_tree a.expander').live('click', function(event) {
|
||||
$('#pma_navigation_tree a.expander').live('click', function (event) {
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
var $this = $(this);
|
||||
@ -129,7 +129,7 @@ $(function() {
|
||||
/**
|
||||
* Jump to recent table
|
||||
*/
|
||||
$('#recentTable').live('change', function() {
|
||||
$('#recentTable').live('change', function () {
|
||||
if (this.value !== '') {
|
||||
var arr = jQuery.parseJSON(this.value);
|
||||
var $form = $(this).closest('form');
|
||||
|
||||
@ -22,8 +22,8 @@ function panel(index)
|
||||
if (!index) {
|
||||
$(".toggle_container").hide();
|
||||
}
|
||||
$("h2.tiger").click(function() {
|
||||
$(this).toggleClass("active").next().slideToggle("slow");
|
||||
$("h2.tiger").click(function () {
|
||||
$(this).toggleClass("active").next().slideToggle("slow");
|
||||
});
|
||||
}
|
||||
|
||||
@ -67,19 +67,19 @@ function display(init,finit)
|
||||
if (history_array[i].get_and_or()) {
|
||||
str +='<img src="' + pmaThemeImage + 'pmd/or_icon.png" onclick="and_or('+i+')" title="OR"/></td>';
|
||||
} else {
|
||||
str +='<img src="' + pmaThemeImage + 'pmd/and_icon.png" onclick="and_or('+i+')" title="AND"/></td>';
|
||||
str +='<img src="' + pmaThemeImage + 'pmd/and_icon.png" onclick="and_or('+i+')" title="AND"/></td>';
|
||||
}
|
||||
str +='<td style="padding-left: 5px;" class="right">' + PMA_getImage('b_sbrowse.png', 'column name') + '</td><td width="175" style="padding-left: 5px">' + history_array[i].get_column_name();
|
||||
if (history_array[i].get_type() == "GroupBy" || history_array[i].get_type() == "OrderBy") {
|
||||
str += '</td><td class="center">' + PMA_getImage('b_info.png', detail(i)) + '<td title="' + detail(i) +'">' + history_array[i].get_type() + '</td></td><td onmouseover="this.className=\'history_table\';" onmouseout="this.className=\'history_table2\'" onclick=history_delete('+ i +')>' + PMA_getImage('b_drop.png', 'Delete') + '</td></tr></thead>';
|
||||
} else {
|
||||
str += '</td><td class="center">' + PMA_getImage('b_info.png', detail(i)) + '</td><td title="' + detail(i) +'">' + history_array[i]. get_type() + '</td><td <td onmouseover="this.className=\'history_table\';" onmouseout="this.className=\'history_table2\'" onclick=history_edit('+ i +')>' + PMA_getImage('b_edit.png', PMA_messages['strEdit']) + '</td><td onmouseover="this.className=\'history_table\';" onmouseout="this.className=\'history_table2\'" onclick=history_delete('+ i +')><img src="themes/original/img/b_drop.png" title="Delete"></td></tr></thead>';
|
||||
}
|
||||
i++;
|
||||
if (i >= history_array.length) {
|
||||
break;
|
||||
}
|
||||
str += '</table></div><br/>';
|
||||
} else {
|
||||
str += '</td><td class="center">' + PMA_getImage('b_info.png', detail(i)) + '</td><td title="' + detail(i) +'">' + history_array[i]. get_type() + '</td><td <td onmouseover="this.className=\'history_table\';" onmouseout="this.className=\'history_table2\'" onclick=history_edit('+ i +')>' + PMA_getImage('b_edit.png', PMA_messages['strEdit']) + '</td><td onmouseover="this.className=\'history_table\';" onmouseout="this.className=\'history_table2\'" onclick=history_delete('+ i +')><img src="themes/original/img/b_drop.png" title="Delete"></td></tr></thead>';
|
||||
}
|
||||
i++;
|
||||
if (i >= history_array.length) {
|
||||
break;
|
||||
}
|
||||
str += '</table></div><br/>';
|
||||
}
|
||||
i--;
|
||||
str += '</div><br/>';
|
||||
@ -237,8 +237,8 @@ function edit(type)
|
||||
}
|
||||
if (type == "Where") {
|
||||
if (document.getElementById('erel_opt').value != '--' && document.getElementById('eQuery').value !== "") {
|
||||
history_array[g_index].get_obj().setquery(document.getElementById('eQuery').value);
|
||||
history_array[g_index].get_obj().setrelation_operator(document.getElementById('erel_opt').value);
|
||||
history_array[g_index].get_obj().setquery(document.getElementById('eQuery').value);
|
||||
history_array[g_index].get_obj().setrelation_operator(document.getElementById('erel_opt').value);
|
||||
}
|
||||
document.getElementById('query_where').style.visibility = 'hidden';
|
||||
}
|
||||
@ -277,40 +277,40 @@ function history(ncolumn_name,nobj,ntab,nobj_no,ntype)
|
||||
this.set_column_name = function (ncolumn_name) {
|
||||
column_name = ncolumn_name;
|
||||
};
|
||||
this.get_column_name = function() {
|
||||
this.get_column_name = function () {
|
||||
return column_name;
|
||||
};
|
||||
this.set_and_or = function(nand_or) {
|
||||
this.set_and_or = function (nand_or) {
|
||||
and_or = nand_or;
|
||||
};
|
||||
this.get_and_or = function() {
|
||||
this.get_and_or = function () {
|
||||
return and_or;
|
||||
};
|
||||
this.get_relation = function() {
|
||||
this.get_relation = function () {
|
||||
return and_or;
|
||||
};
|
||||
this.set_obj = function(nobj) {
|
||||
this.set_obj = function (nobj) {
|
||||
obj = nobj;
|
||||
};
|
||||
this.get_obj = function() {
|
||||
this.get_obj = function () {
|
||||
return obj;
|
||||
};
|
||||
this.set_tab = function(ntab) {
|
||||
this.set_tab = function (ntab) {
|
||||
tab = ntab;
|
||||
};
|
||||
this.get_tab = function() {
|
||||
this.get_tab = function () {
|
||||
return tab;
|
||||
};
|
||||
this.set_obj_no = function(nobj_no) {
|
||||
this.set_obj_no = function (nobj_no) {
|
||||
obj_no = nobj_no;
|
||||
};
|
||||
this.get_obj_no = function() {
|
||||
this.get_obj_no = function () {
|
||||
return obj_no;
|
||||
};
|
||||
this.set_type = function(ntype) {
|
||||
this.set_type = function (ntype) {
|
||||
type = ntype;
|
||||
};
|
||||
this.get_type = function() {
|
||||
this.get_type = function () {
|
||||
return type;
|
||||
};
|
||||
this.set_obj_no(nobj_no);
|
||||
@ -333,16 +333,16 @@ function history(ncolumn_name,nobj,ntab,nobj_no,ntype)
|
||||
var where = function (nrelation_operator,nquery) {
|
||||
var relation_operator;
|
||||
var query;
|
||||
this.setrelation_operator = function(nrelation_operator) {
|
||||
this.setrelation_operator = function (nrelation_operator) {
|
||||
relation_operator = nrelation_operator;
|
||||
};
|
||||
this.setquery = function(nquery) {
|
||||
this.setquery = function (nquery) {
|
||||
query = nquery;
|
||||
};
|
||||
this.getquery = function() {
|
||||
this.getquery = function () {
|
||||
return query;
|
||||
};
|
||||
this.getrelation_operator = function() {
|
||||
this.getrelation_operator = function () {
|
||||
return relation_operator;
|
||||
};
|
||||
this.setquery(nquery);
|
||||
@ -362,22 +362,22 @@ var having = function (nrelation_operator,nquery,noperator) {
|
||||
var relation_operator;
|
||||
var query;
|
||||
var operator;
|
||||
this.set_operator = function(noperator) {
|
||||
this.set_operator = function (noperator) {
|
||||
operator = noperator;
|
||||
};
|
||||
this.setrelation_operator = function(nrelation_operator) {
|
||||
this.setrelation_operator = function (nrelation_operator) {
|
||||
relation_operator = nrelation_operator;
|
||||
};
|
||||
this.setquery = function(nquery) {
|
||||
this.setquery = function (nquery) {
|
||||
query = nquery;
|
||||
};
|
||||
this.getquery = function() {
|
||||
this.getquery = function () {
|
||||
return query;
|
||||
};
|
||||
this.getrelation_operator = function() {
|
||||
this.getrelation_operator = function () {
|
||||
return relation_operator;
|
||||
};
|
||||
this.get_operator = function() {
|
||||
this.get_operator = function () {
|
||||
return operator;
|
||||
};
|
||||
this.setquery(nquery);
|
||||
@ -392,12 +392,12 @@ var having = function (nrelation_operator,nquery,noperator) {
|
||||
*
|
||||
**/
|
||||
|
||||
var rename = function(nrename_to) {
|
||||
var rename = function (nrename_to) {
|
||||
var rename_to;
|
||||
this.setrename_to = function(nrename_to) {
|
||||
this.setrename_to = function (nrename_to) {
|
||||
rename_to = nrename_to;
|
||||
};
|
||||
this.getrename_to =function() {
|
||||
this.getrename_to =function () {
|
||||
return rename_to;
|
||||
};
|
||||
this.setrename_to(nrename_to);
|
||||
@ -410,12 +410,12 @@ var rename = function(nrename_to) {
|
||||
*
|
||||
**/
|
||||
|
||||
var aggregate = function(noperator) {
|
||||
var aggregate = function (noperator) {
|
||||
var operator;
|
||||
this.set_operator = function(noperator) {
|
||||
this.set_operator = function (noperator) {
|
||||
operator = noperator;
|
||||
};
|
||||
this.get_operator = function() {
|
||||
this.get_operator = function () {
|
||||
return operator;
|
||||
};
|
||||
this.set_operator(noperator);
|
||||
|
||||
@ -48,28 +48,28 @@ if (!window.all) // if IE
|
||||
this.fillStyle;
|
||||
this.lineWidth;
|
||||
|
||||
this.closePath = function() {
|
||||
this.closePath = function () {
|
||||
this.pmd_arr.push({type: "close"});
|
||||
};
|
||||
|
||||
this.clearRect = function() {
|
||||
this.clearRect = function () {
|
||||
this.element_.innerHTML = "";
|
||||
this.pmd_arr = [];
|
||||
};
|
||||
|
||||
this.beginPath = function() {
|
||||
this.beginPath = function () {
|
||||
this.pmd_arr = [];
|
||||
};
|
||||
|
||||
this.moveTo = function(aX, aY) {
|
||||
this.moveTo = function (aX, aY) {
|
||||
this.pmd_arr.push({type: "moveTo", x: aX, y: aY});
|
||||
};
|
||||
|
||||
this.lineTo = function(aX, aY) {
|
||||
this.lineTo = function (aX, aY) {
|
||||
this.pmd_arr.push({type: "lineTo", x: aX, y: aY});
|
||||
};
|
||||
|
||||
this.arc = function(aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise) {
|
||||
this.arc = function (aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise) {
|
||||
if (!aClockwise) {
|
||||
var t = aStartAngle;
|
||||
aStartAngle = aEndAngle;
|
||||
@ -86,7 +86,7 @@ if (!window.all) // if IE
|
||||
radius: aRadius, xStart: xStart, yStart: yStart, xEnd: xEnd, yEnd: yEnd});
|
||||
};
|
||||
|
||||
this.rect = function(aX, aY, aW, aH) {
|
||||
this.rect = function (aX, aY, aW, aH) {
|
||||
this.moveTo(aX, aY);
|
||||
this.lineTo(aX + aW, aY);
|
||||
this.lineTo(aX + aW, aY + aH);
|
||||
@ -94,7 +94,7 @@ if (!window.all) // if IE
|
||||
this.closePath();
|
||||
};
|
||||
|
||||
this.fillRect = function(aX, aY, aW, aH) {
|
||||
this.fillRect = function (aX, aY, aW, aH) {
|
||||
this.beginPath();
|
||||
this.moveTo(aX, aY);
|
||||
this.lineTo(aX + aW, aY);
|
||||
@ -104,7 +104,7 @@ if (!window.all) // if IE
|
||||
this.stroke(true);
|
||||
};
|
||||
|
||||
this.stroke = function(aFill) {
|
||||
this.stroke = function (aFill) {
|
||||
var Str = [];
|
||||
var a = convert_style(aFill ? this.fillStyle : this.strokeStyle);
|
||||
var color = a[0];
|
||||
|
||||
@ -5,12 +5,12 @@
|
||||
|
||||
var j_tabs, h_tabs, contr, server, db, token;
|
||||
|
||||
AJAX.registerTeardown('pmd/init.js', function() {
|
||||
AJAX.registerTeardown('pmd/init.js', function () {
|
||||
$(".trigger").unbind('click');
|
||||
});
|
||||
|
||||
AJAX.registerOnload('pmd/init.js', function() {
|
||||
$(".trigger").click(function() {
|
||||
AJAX.registerOnload('pmd/init.js', function () {
|
||||
$(".trigger").click(function () {
|
||||
$(".panel").toggle("fast");
|
||||
$(this).toggleClass("active");
|
||||
return false;
|
||||
|
||||
@ -8,21 +8,21 @@
|
||||
*/
|
||||
|
||||
|
||||
var _change = 0; // variable to track any change in designer layout.
|
||||
var _staying = 0; // variable to check if the user stayed after seeing the confirmation prompt.
|
||||
var show_relation_lines = true;
|
||||
var _change = 0; // variable to track any change in designer layout.
|
||||
var _staying = 0; // variable to check if the user stayed after seeing the confirmation prompt.
|
||||
var show_relation_lines = true;
|
||||
|
||||
AJAX.registerTeardown('pmd/move.js', function() {
|
||||
AJAX.registerTeardown('pmd/move.js', function () {
|
||||
if ($.FullScreen.supported) {
|
||||
$(document).unbind($.FullScreen.prefix + 'fullscreenchange');
|
||||
}
|
||||
});
|
||||
|
||||
AJAX.registerOnload('pmd/move.js', function() {
|
||||
AJAX.registerOnload('pmd/move.js', function () {
|
||||
$('#page_content').css({'margin-left': '3px'});
|
||||
$('#exitFullscreen').hide();
|
||||
if ($.FullScreen.supported) {
|
||||
$(document).fullScreenChange(function() {
|
||||
$(document).fullScreenChange(function () {
|
||||
if (! $.FullScreen.isFullScreen()) {
|
||||
$('#page_content').removeClass('content_fullscreen')
|
||||
.css({'width': 'auto', 'height': 'auto'});
|
||||
@ -41,18 +41,18 @@ AJAX.registerOnload('pmd/move.js', function() {
|
||||
/*
|
||||
FIXME: we can't register the beforeonload event because it will persist between pageloads
|
||||
|
||||
AJAX.registerOnload('pmd/move.js', function(){
|
||||
$(window).bind('beforeunload', function() { // onbeforeunload for the frame window.
|
||||
AJAX.registerOnload('pmd/move.js', function (){
|
||||
$(window).bind('beforeunload', function () { // onbeforeunload for the frame window.
|
||||
if (_change == 1 && _staying === 0) {
|
||||
return PMA_messages['strLeavingDesigner'];
|
||||
} else if (_change == 1 && _staying == 1) {
|
||||
_staying = 0;
|
||||
}
|
||||
});
|
||||
$(window).unload(function() {
|
||||
$(window).unload(function () {
|
||||
_change = 0;
|
||||
});
|
||||
window.top.onbeforeunload = function() { // onbeforeunload for the browser main window.
|
||||
window.top.onbeforeunload = function () { // onbeforeunload for the browser main window.
|
||||
if (_change == 1 && _staying === 0) {
|
||||
_staying = 1; // Helps if the user stays on the page as there
|
||||
setTimeout('make_zero();', 100); // is no other way of knowing whether the user stayed or not.
|
||||
@ -115,7 +115,7 @@ if (isIE) {
|
||||
document.onselectstart = function () {return false;};
|
||||
}
|
||||
|
||||
//document.onmouseup = function(){General_scroll_end();}
|
||||
//document.onmouseup = function (){General_scroll_end();}
|
||||
function MouseDown(e)
|
||||
{
|
||||
var offsetx, offsety;
|
||||
@ -706,12 +706,12 @@ function Relation_lines_invert()
|
||||
|
||||
function Small_tab_refresh()
|
||||
{
|
||||
for (var key in j_tabs) {
|
||||
if(document.getElementById('id_hide_tbody_'+key).innerHTML != "v") {
|
||||
Small_tab(key, 0);
|
||||
Small_tab(key, 0);
|
||||
}
|
||||
}
|
||||
for (var key in j_tabs) {
|
||||
if(document.getElementById('id_hide_tbody_'+key).innerHTML != "v") {
|
||||
Small_tab(key, 0);
|
||||
Small_tab(key, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Small_tab(t, re_load)
|
||||
@ -744,7 +744,7 @@ function Select_tab(t)
|
||||
//----------
|
||||
var id_t = document.getElementById(t);
|
||||
window.scrollTo(parseInt(id_t.style.left, 10) - 300, parseInt(id_t.style.top, 10) - 300);
|
||||
setTimeout(function(){document.getElementById('id_zag_' + t).className = 'tab_zag';}, 800);
|
||||
setTimeout(function (){document.getElementById('id_zag_' + t).className = 'tab_zag';}, 800);
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@ -950,7 +950,7 @@ function General_scroll()
|
||||
clearTimeout(timeoutID);
|
||||
timeoutID = setTimeout
|
||||
(
|
||||
function()
|
||||
function ()
|
||||
{
|
||||
document.getElementById('top_menu').style.left = document.body.scrollLeft + 'px';
|
||||
document.getElementById('top_menu').style.top = document.body.scrollTop + 'px';
|
||||
|
||||
@ -16,12 +16,12 @@ function update_config()
|
||||
if ($('#db_select option:selected').size() === 0) {
|
||||
$('#rep').text(conf_prefix);
|
||||
} else if ($('#db_type option:selected').val() == 'all') {
|
||||
$('#db_select option:selected').each(function() {
|
||||
$('#db_select option:selected').each(function () {
|
||||
database_list += conf_ignore + $(this).val() + "\n";
|
||||
});
|
||||
$('#rep').text(conf_prefix + database_list);
|
||||
} else {
|
||||
$('#db_select option:selected').each(function() {
|
||||
$('#db_select option:selected').each(function () {
|
||||
database_list += conf_do + $(this).val() + "\n";
|
||||
});
|
||||
$('#rep').text(conf_prefix + database_list);
|
||||
@ -31,7 +31,7 @@ function update_config()
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('replication.js', function() {
|
||||
AJAX.registerTeardown('replication.js', function () {
|
||||
$('#db_type').unbind('change');
|
||||
$('#db_select').unbind('change');
|
||||
$('#master_status_href').unbind('click');
|
||||
@ -43,30 +43,30 @@ AJAX.registerTeardown('replication.js', function() {
|
||||
$('#db_reset_href').unbind('click');
|
||||
});
|
||||
|
||||
AJAX.registerOnload('replication.js', function() {
|
||||
AJAX.registerOnload('replication.js', function () {
|
||||
$('#rep').text(conf_prefix);
|
||||
$('#db_type').change(update_config);
|
||||
$('#db_select').change(update_config);
|
||||
|
||||
$('#master_status_href').click(function() {
|
||||
$('#master_status_href').click(function () {
|
||||
$('#replication_master_section').toggle();
|
||||
});
|
||||
$('#master_slaves_href').click(function() {
|
||||
});
|
||||
$('#master_slaves_href').click(function () {
|
||||
$('#replication_slaves_section').toggle();
|
||||
});
|
||||
$('#slave_status_href').click(function() {
|
||||
});
|
||||
$('#slave_status_href').click(function () {
|
||||
$('#replication_slave_section').toggle();
|
||||
});
|
||||
$('#slave_control_href').click(function() {
|
||||
});
|
||||
$('#slave_control_href').click(function () {
|
||||
$('#slave_control_gui').toggle();
|
||||
});
|
||||
$('#slave_errormanagement_href').click(function() {
|
||||
});
|
||||
$('#slave_errormanagement_href').click(function () {
|
||||
$('#slave_errormanagement_gui').toggle();
|
||||
});
|
||||
$('#slave_synchronization_href').click(function() {
|
||||
});
|
||||
$('#slave_synchronization_href').click(function () {
|
||||
$('#slave_synchronization_gui').toggle();
|
||||
});
|
||||
$('#db_reset_href').click(function() {
|
||||
});
|
||||
$('#db_reset_href').click(function () {
|
||||
$('#db_select option:selected').prop('selected', false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
50
js/rte.js
50
js/rte.js
@ -16,17 +16,17 @@ var RTE = {
|
||||
object: function (type) {
|
||||
$.extend(this, RTE.COMMON);
|
||||
switch (type) {
|
||||
case 'routine':
|
||||
$.extend(this, RTE.ROUTINE);
|
||||
break;
|
||||
case 'trigger':
|
||||
// nothing extra yet for triggers
|
||||
break;
|
||||
case 'event':
|
||||
$.extend(this, RTE.EVENT);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case 'routine':
|
||||
$.extend(this, RTE.ROUTINE);
|
||||
break;
|
||||
case 'trigger':
|
||||
// nothing extra yet for triggers
|
||||
break;
|
||||
case 'event':
|
||||
$.extend(this, RTE.EVENT);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
/**
|
||||
@ -126,10 +126,10 @@ RTE.COMMON = {
|
||||
* Display the dialog to the user
|
||||
*/
|
||||
var $ajaxDialog = $('<div>' + data.message + '</div>').dialog({
|
||||
width: 500,
|
||||
buttons: button_options,
|
||||
title: data.title
|
||||
});
|
||||
width: 500,
|
||||
buttons: button_options,
|
||||
title: data.title
|
||||
});
|
||||
// Attach syntax highlited editor to export dialog
|
||||
/**
|
||||
* @var $elm jQuery object containing the reference
|
||||
@ -297,15 +297,15 @@ RTE.COMMON = {
|
||||
* Display the dialog to the user
|
||||
*/
|
||||
that.$ajaxDialog = $('<div>' + data.message + '</div>').dialog({
|
||||
width: 700,
|
||||
minWidth: 500,
|
||||
buttons: that.buttonOptions,
|
||||
title: data.title,
|
||||
modal: true,
|
||||
close: function () {
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
width: 700,
|
||||
minWidth: 500,
|
||||
buttons: that.buttonOptions,
|
||||
title: data.title,
|
||||
modal: true,
|
||||
close: function () {
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
that.$ajaxDialog.find('input[name=item_name]').focus();
|
||||
that.$ajaxDialog.find('input.datefield, input.datetimefield').each(function () {
|
||||
PMA_addDatepicker($(this).css('width', '95%'));
|
||||
@ -766,7 +766,7 @@ $(function () {
|
||||
*/
|
||||
$('a.ajax.drop_anchor').live('click', function (event) {
|
||||
event.preventDefault();
|
||||
var dialog = new RTE.object();
|
||||
var dialog = new RTE.object();
|
||||
dialog.dropDialog($(this));
|
||||
}); // end $.live()
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('server_databases.js', function() {
|
||||
AJAX.registerTeardown('server_databases.js', function () {
|
||||
$("#dbStatsForm").die('submit');
|
||||
$('#create_database_form.ajax').die('submit');
|
||||
});
|
||||
@ -23,11 +23,11 @@ AJAX.registerTeardown('server_databases.js', function() {
|
||||
* Drop Databases
|
||||
*
|
||||
*/
|
||||
AJAX.registerOnload('server_databases.js', function() {
|
||||
AJAX.registerOnload('server_databases.js', function () {
|
||||
/**
|
||||
* Attach Event Handler for 'Drop Databases'
|
||||
*/
|
||||
$("#dbStatsForm").live('submit', function(event) {
|
||||
$("#dbStatsForm").live('submit', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
var $form = $(this);
|
||||
@ -62,10 +62,10 @@ AJAX.registerOnload('server_databases.js', function() {
|
||||
$form.prop('action')
|
||||
+ '?' + $(this).serialize()
|
||||
+ '&drop_selected_dbs=1&is_js_confirmed=1&ajax_request=true',
|
||||
function(url) {
|
||||
function (url) {
|
||||
PMA_ajaxShowMessage(PMA_messages.strProcessingRequest, false);
|
||||
|
||||
$.post(url, function(data) {
|
||||
$.post(url, function (data) {
|
||||
if (data.success === true) {
|
||||
PMA_ajaxShowMessage(data.message);
|
||||
|
||||
@ -82,13 +82,14 @@ AJAX.registerOnload('server_databases.js', function() {
|
||||
PMA_ajaxShowMessage(data.error, false);
|
||||
}
|
||||
}); // end $.post()
|
||||
}); // end $.PMA_confirm()
|
||||
}
|
||||
); // end $.PMA_confirm()
|
||||
}) ; //end of Drop Database action
|
||||
|
||||
/**
|
||||
* Attach Ajax event handlers for 'Create Database'.
|
||||
*/
|
||||
$('#create_database_form.ajax').live('submit', function(event) {
|
||||
$('#create_database_form.ajax').live('submit', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
$form = $(this);
|
||||
@ -103,7 +104,7 @@ AJAX.registerOnload('server_databases.js', function() {
|
||||
PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']);
|
||||
PMA_prepareForAjaxRequest($form);
|
||||
|
||||
$.post($form.attr('action'), $form.serialize(), function(data) {
|
||||
$.post($form.attr('action'), $form.serialize(), function (data) {
|
||||
if (data.success === true) {
|
||||
PMA_ajaxShowMessage(data.message);
|
||||
|
||||
|
||||
@ -4,12 +4,12 @@
|
||||
*/
|
||||
var pma_theme_image; // filled in server_plugins.php
|
||||
|
||||
AJAX.registerOnload('server_plugins.js', function() {
|
||||
AJAX.registerOnload('server_plugins.js', function () {
|
||||
// Add tabs
|
||||
$('#pluginsTabs').tabs({
|
||||
// Tab persistence
|
||||
cookie: { name: 'pma_serverStatusTabs', expires: 1 },
|
||||
show: function(event, ui) {
|
||||
show: function (event, ui) {
|
||||
// Fixes line break in the menu bar when the page overflows and scrollbar appears
|
||||
$('#topmenu').menuResizer('resize');
|
||||
// 'Plugins' tab is too high due to hiding of 'Modules' by negative left position,
|
||||
|
||||
@ -60,7 +60,7 @@ function appendNewUser(new_user_string, new_user_initial, new_user_initial_strin
|
||||
.insertAfter($curr_last_row)
|
||||
.find('input:checkbox')
|
||||
.attr('id', new_last_row_id)
|
||||
.val(function() {
|
||||
.val(function () {
|
||||
//the insert messes up the &27; part. let's fix it
|
||||
return $(this).val().replace(/&/,'&');
|
||||
})
|
||||
@ -87,7 +87,7 @@ function addUser($form)
|
||||
}
|
||||
|
||||
//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=" + $("input[name=adduser_submit]").val(), function(data) {
|
||||
$.post($form.attr('action'), $form.serialize() + "&adduser_submit=" + $("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
|
||||
@ -121,7 +121,7 @@ function addUser($form)
|
||||
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) {
|
||||
@ -165,7 +165,7 @@ function addUser($form)
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('server_privileges.js', function() {
|
||||
AJAX.registerTeardown('server_privileges.js', function () {
|
||||
$("#fieldset_add_user a.ajax").die("click");
|
||||
$('form[name=usersForm]').unbind('submit');
|
||||
$("#reload_privileges_anchor.ajax").die("click");
|
||||
@ -178,7 +178,7 @@ AJAX.registerTeardown('server_privileges.js', function() {
|
||||
$('#checkbox_drop_users_db').unbind('click');
|
||||
});
|
||||
|
||||
AJAX.registerOnload('server_privileges.js', function() {
|
||||
AJAX.registerOnload('server_privileges.js', function () {
|
||||
/**
|
||||
* AJAX event handler for 'Add a New User'
|
||||
*
|
||||
@ -188,12 +188,12 @@ AJAX.registerOnload('server_privileges.js', function() {
|
||||
* @name add_user_click
|
||||
*
|
||||
*/
|
||||
$("#fieldset_add_user a.ajax").live("click", function(event) {
|
||||
$("#fieldset_add_user a.ajax").live("click", function (event) {
|
||||
/** @lends jQuery */
|
||||
event.preventDefault();
|
||||
var $msgbox = PMA_ajaxShowMessage();
|
||||
|
||||
$.get($(this).attr("href"), {'ajax_request':true}, function(data) {
|
||||
$.get($(this).attr("href"), {'ajax_request':true}, function (data) {
|
||||
if (data.success === true) {
|
||||
$('#page_content').hide();
|
||||
var $div = $('#add_user_dialog');
|
||||
@ -231,12 +231,12 @@ AJAX.registerOnload('server_privileges.js', function() {
|
||||
* @memberOf jQuery
|
||||
* @name reload_privileges_click
|
||||
*/
|
||||
$("#reload_privileges_anchor.ajax").live("click", function(event) {
|
||||
$("#reload_privileges_anchor.ajax").live("click", function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
var $msgbox = PMA_ajaxShowMessage(PMA_messages['strReloadingPrivileges']);
|
||||
|
||||
$.get($(this).attr("href"), {'ajax_request': true}, function(data) {
|
||||
$.get($(this).attr("href"), {'ajax_request': true}, function (data) {
|
||||
if (data.success === true) {
|
||||
PMA_ajaxRemoveMessage($msgbox);
|
||||
} else {
|
||||
@ -253,14 +253,14 @@ AJAX.registerOnload('server_privileges.js', function() {
|
||||
* @memberOf jQuery
|
||||
* @name revoke_user_click
|
||||
*/
|
||||
$("#fieldset_delete_user_footer #buttonGo.ajax").live('click', function(event) {
|
||||
$("#fieldset_delete_user_footer #buttonGo.ajax").live('click', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
PMA_ajaxShowMessage(PMA_messages['strRemovingSelectedUsers']);
|
||||
|
||||
var $form = $("#usersForm");
|
||||
|
||||
$.post($form.attr('action'), $form.serialize() + "&delete=" + $(this).val() + "&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
|
||||
@ -269,7 +269,7 @@ AJAX.registerOnload('server_privileges.js', function() {
|
||||
PMA_reloadNavigation();
|
||||
}
|
||||
//Remove the revoked user from the users list
|
||||
$form.find("input:checkbox:checked").parents("tr").slideUp("medium", function() {
|
||||
$form.find("input:checkbox:checked").parents("tr").slideUp("medium", function () {
|
||||
var this_user_initial = $(this).find('input:checkbox').val().charAt(0).toUpperCase();
|
||||
$(this).remove();
|
||||
|
||||
@ -307,7 +307,7 @@ AJAX.registerOnload('server_privileges.js', function() {
|
||||
* @memberOf jQuery
|
||||
* @name edit_user_click
|
||||
*/
|
||||
$("a.edit_user_anchor.ajax").live('click', function(event) {
|
||||
$("a.edit_user_anchor.ajax").live('click', function (event) {
|
||||
/** @lends jQuery */
|
||||
event.preventDefault();
|
||||
|
||||
@ -323,7 +323,7 @@ AJAX.registerOnload('server_privileges.js', function() {
|
||||
'edit_user_dialog': true,
|
||||
'token': token
|
||||
},
|
||||
function(data) {
|
||||
function (data) {
|
||||
if (data.success === true) {
|
||||
$('#page_content').hide();
|
||||
var $div = $('#edit_user_dialog');
|
||||
@ -351,7 +351,7 @@ AJAX.registerOnload('server_privileges.js', function() {
|
||||
* @memberOf jQuery
|
||||
* @name edit_user_submit
|
||||
*/
|
||||
$("#edit_user_dialog").find("form.ajax").live('submit', function(event) {
|
||||
$("#edit_user_dialog").find("form.ajax").live('submit', function (event) {
|
||||
/** @lends jQuery */
|
||||
event.preventDefault();
|
||||
|
||||
@ -382,7 +382,7 @@ AJAX.registerOnload('server_privileges.js', function() {
|
||||
&& $('input[name=mode]:checked', '#fieldset_mode').val() != '4') {
|
||||
var old_username = $t.find('input[name="old_username"]').val();
|
||||
var old_hostname = $t.find('input[name="old_hostname"]').val();
|
||||
$('#usersForm tbody tr').each(function() {
|
||||
$('#usersForm tbody tr').each(function () {
|
||||
var $tr = $(this);
|
||||
if ($tr.find('td:nth-child(2) label').text() == old_username
|
||||
&& $tr.find('td:nth-child(3)').text() == old_hostname) {
|
||||
@ -392,7 +392,7 @@ AJAX.registerOnload('server_privileges.js', function() {
|
||||
});
|
||||
}
|
||||
|
||||
$.post($t.attr('action'), $t.serialize() + '&' + curr_submit_name + '=' + curr_submit_value, function(data) {
|
||||
$.post($t.attr('action'), $t.serialize() + '&' + curr_submit_name + '=' + curr_submit_value, function (data) {
|
||||
if (data.success === true) {
|
||||
$('#page_content').show();
|
||||
$("#edit_user_dialog").remove();
|
||||
@ -459,7 +459,7 @@ AJAX.registerOnload('server_privileges.js', function() {
|
||||
* @memberOf jQuery
|
||||
* @name export_user_click
|
||||
*/
|
||||
$("button.mult_submit[value=export]").live('click', function(event) {
|
||||
$("button.mult_submit[value=export]").live('click', function (event) {
|
||||
event.preventDefault();
|
||||
// can't export if no users checked
|
||||
if ($(this.form).find("input:checked").length === 0) {
|
||||
@ -467,13 +467,13 @@ AJAX.registerOnload('server_privileges.js', function() {
|
||||
}
|
||||
var $msgbox = PMA_ajaxShowMessage();
|
||||
var button_options = {};
|
||||
button_options[PMA_messages['strClose']] = function() {
|
||||
button_options[PMA_messages['strClose']] = function () {
|
||||
$(this).dialog("close");
|
||||
};
|
||||
$.post(
|
||||
$(this.form).prop('action'),
|
||||
$(this.form).serialize() + '&submit_mult=export&ajax_request=true',
|
||||
function(data) {
|
||||
function (data) {
|
||||
if (data.success === true) {
|
||||
var $ajaxDialog = $('<div />')
|
||||
.append(data.message)
|
||||
@ -519,17 +519,17 @@ AJAX.registerOnload('server_privileges.js', function() {
|
||||
);
|
||||
}
|
||||
|
||||
$("a.export_user_anchor.ajax").live('click', function(event) {
|
||||
$("a.export_user_anchor.ajax").live('click', function (event) {
|
||||
event.preventDefault();
|
||||
var $msgbox = PMA_ajaxShowMessage();
|
||||
/**
|
||||
* @var button_options Object containing options for jQueryUI dialog buttons
|
||||
*/
|
||||
var button_options = {};
|
||||
button_options[PMA_messages['strClose']] = function() {
|
||||
button_options[PMA_messages['strClose']] = function () {
|
||||
$(this).dialog("close");
|
||||
};
|
||||
$.get($(this).attr('href'), {'ajax_request': true}, function(data) {
|
||||
$.get($(this).attr('href'), {'ajax_request': true}, function (data) {
|
||||
if (data.success === true) {
|
||||
var $ajaxDialog = $('<div />')
|
||||
.append(data.message)
|
||||
@ -567,10 +567,10 @@ AJAX.registerOnload('server_privileges.js', function() {
|
||||
* @name paginate_users_table_click
|
||||
* @memberOf jQuery
|
||||
*/
|
||||
$("#initials_table").find("a.ajax").live('click', function(event) {
|
||||
$("#initials_table").find("a.ajax").live('click', function (event) {
|
||||
event.preventDefault();
|
||||
var $msgbox = PMA_ajaxShowMessage();
|
||||
$.get($(this).attr('href'), {'ajax_request' : true}, function(data) {
|
||||
$.get($(this).attr('href'), {'ajax_request' : true}, function (data) {
|
||||
if (data.success === true) {
|
||||
PMA_ajaxRemoveMessage($msgbox);
|
||||
// This form is not on screen when first entering Privileges
|
||||
@ -591,7 +591,7 @@ AJAX.registerOnload('server_privileges.js', function() {
|
||||
* Additional confirmation dialog after clicking
|
||||
* 'Drop the databases...'
|
||||
*/
|
||||
$('#checkbox_drop_users_db').click(function() {
|
||||
$('#checkbox_drop_users_db').click(function () {
|
||||
var $this_checkbox = $(this);
|
||||
if ($this_checkbox.is(':checked')) {
|
||||
var is_confirmed = confirm(PMA_messages['strDropDatabaseStrongWarning'] + '\n' + $.sprintf(PMA_messages['strDoYouReally'], 'DROP DATABASE'));
|
||||
|
||||
@ -12,7 +12,7 @@ var pma_token,
|
||||
server_db_isLocal;
|
||||
|
||||
// Add a tablesorter parser to properly handle thousands seperated numbers and SI prefixes
|
||||
AJAX.registerOnload('server_status.js', function() {
|
||||
AJAX.registerOnload('server_status.js', function () {
|
||||
|
||||
var $js_data_form = $('#js_data');
|
||||
pma_token = $js_data_form.find("input[name=pma_token]").val();
|
||||
|
||||
@ -8,23 +8,23 @@
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('server_status_advisor.js', function() {
|
||||
AJAX.registerTeardown('server_status_advisor.js', function () {
|
||||
$('a[href="#openAdvisorInstructions"]').unbind('click');
|
||||
$('#statustabs_advisor').html('');
|
||||
$('#advisorDialog').remove();
|
||||
$('#instructionsDialog').remove();
|
||||
});
|
||||
|
||||
AJAX.registerOnload('server_status_advisor.js', function() {
|
||||
AJAX.registerOnload('server_status_advisor.js', function () {
|
||||
/**** Server config advisor ****/
|
||||
var $dialog = $('<div />').attr('id', 'advisorDialog');
|
||||
var $instructionsDialog = $('<div />')
|
||||
.attr('id', 'instructionsDialog')
|
||||
.html($('#advisorInstructionsDialog').html());
|
||||
|
||||
$('a[href="#openAdvisorInstructions"]').click(function() {
|
||||
$('a[href="#openAdvisorInstructions"]').click(function () {
|
||||
var dlgBtns = {};
|
||||
dlgBtns[PMA_messages['strClose']] = function() {
|
||||
dlgBtns[PMA_messages['strClose']] = function () {
|
||||
$(this).dialog('close');
|
||||
};
|
||||
$instructionsDialog.dialog({
|
||||
@ -61,7 +61,7 @@ AJAX.registerOnload('server_status_advisor.js', function() {
|
||||
|
||||
var rc_stripped;
|
||||
|
||||
$.each(data.run.fired, function(key, value) {
|
||||
$.each(data.run.fired, function (key, value) {
|
||||
// recommendation may contain links, don't show those in overview table (clicking on them redirects the user)
|
||||
rc_stripped = $.trim($('<div>').html(value.recommendation).text());
|
||||
$tbody.append($tr = $('<tr class="linkElem noclick ' + (even ? 'even' : 'odd') + '"><td>' +
|
||||
@ -69,7 +69,7 @@ AJAX.registerOnload('server_status_advisor.js', function() {
|
||||
even = !even;
|
||||
$tr.data('rule', value);
|
||||
|
||||
$tr.click(function() {
|
||||
$tr.click(function () {
|
||||
var rule = $(this).data('rule');
|
||||
$dialog
|
||||
.dialog({title: PMA_messages['strRuleDetails']})
|
||||
@ -82,7 +82,7 @@ AJAX.registerOnload('server_status_advisor.js', function() {
|
||||
);
|
||||
|
||||
var dlgBtns = {};
|
||||
dlgBtns[PMA_messages['strClose']] = function() {
|
||||
dlgBtns[PMA_messages['strClose']] = function () {
|
||||
$(this).dialog('close');
|
||||
};
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ var runtime = {},
|
||||
server_os,
|
||||
is_superuser,
|
||||
server_db_isLocal;
|
||||
AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
AJAX.registerOnload('server_status_monitor.js', function () {
|
||||
var $js_data_form = $('#js_data');
|
||||
server_time_diff = new Date().getTime() - $js_data_form.find("input[name=server_time]").val();
|
||||
server_os = $js_data_form.find("input[name=server_os]").val();
|
||||
@ -15,7 +15,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('server_status_monitor.js', function() {
|
||||
AJAX.registerTeardown('server_status_monitor.js', function () {
|
||||
$('#emptyDialog').remove();
|
||||
$('#addChartDialog').remove();
|
||||
$('a.popupLink').unbind('click');
|
||||
@ -24,14 +24,14 @@ AJAX.registerTeardown('server_status_monitor.js', function() {
|
||||
/**
|
||||
* Popup behaviour
|
||||
*/
|
||||
AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
AJAX.registerOnload('server_status_monitor.js', function () {
|
||||
$('<div />')
|
||||
.attr('id', 'emptyDialog')
|
||||
.appendTo('#page_content');
|
||||
$('#addChartDialog')
|
||||
.appendTo('#page_content');
|
||||
|
||||
$('a.popupLink').click( function() {
|
||||
$('a.popupLink').click( function () {
|
||||
var $link = $(this);
|
||||
$('div.' + $link.attr('href').substr(1))
|
||||
.show()
|
||||
@ -40,8 +40,8 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
|
||||
return false;
|
||||
});
|
||||
$('body').click( function(event) {
|
||||
$('div.openedPopup').each(function() {
|
||||
$('body').click( function (event) {
|
||||
$('div.openedPopup').each(function () {
|
||||
var $cnt = $(this);
|
||||
var pos = $cnt.offset();
|
||||
// Hide if the mouseclick is outside the popupcontent
|
||||
@ -56,7 +56,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
});
|
||||
});
|
||||
|
||||
AJAX.registerTeardown('server_status_monitor.js', function() {
|
||||
AJAX.registerTeardown('server_status_monitor.js', function () {
|
||||
$('a[href="#rearrangeCharts"], a[href="#endChartEditMode"]').unbind('click');
|
||||
$('div.popupContent select[name="chartColumns"]').unbind('change');
|
||||
$('div.popupContent select[name="gridChartRefresh"]').unbind('change');
|
||||
@ -80,7 +80,7 @@ AJAX.registerTeardown('server_status_monitor.js', function() {
|
||||
destroyGrid();
|
||||
});
|
||||
|
||||
AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
AJAX.registerOnload('server_status_monitor.js', function () {
|
||||
// Show tab links
|
||||
$('div.tabLinks').show();
|
||||
$('#loadingMonitorIcon').remove();
|
||||
@ -101,7 +101,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
}
|
||||
// Timepicker is loaded on demand so we need to initialize
|
||||
// datetime fields from the 'load log' dialog
|
||||
$('#logAnalyseDialog .datetimefield').each(function() {
|
||||
$('#logAnalyseDialog .datetimefield').each(function () {
|
||||
PMA_addDatepicker($(this));
|
||||
});
|
||||
|
||||
@ -165,7 +165,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
nodes: [ {
|
||||
dataPoints: [{type: 'statusvar', name: 'Qcache_hits'}, {type: 'statusvar', name: 'Com_select'}],
|
||||
transformFn: 'qce'
|
||||
} ],
|
||||
} ],
|
||||
maxYLabel: 0
|
||||
},
|
||||
// Query cache usage
|
||||
@ -177,7 +177,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
nodes: [ {
|
||||
dataPoints: [{type: 'statusvar', name: 'Qcache_free_memory'}, {type: 'servervar', name: 'query_cache_size'}],
|
||||
transformFn: 'qcu'
|
||||
} ],
|
||||
} ],
|
||||
maxYLabel: 0
|
||||
}
|
||||
};
|
||||
@ -201,7 +201,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
} ],
|
||||
nodes: [ {
|
||||
dataPoints: [{ type: 'cpu', name: 'loadavg'}]
|
||||
} ],
|
||||
} ],
|
||||
maxYLabel: 100
|
||||
},
|
||||
|
||||
@ -263,7 +263,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
{ dataPoints: [{ type: 'memory', name: 'MemFree' }], valueDivisor: 1024 }
|
||||
],
|
||||
maxYLabel: 0
|
||||
},
|
||||
},
|
||||
'swap': {
|
||||
title: PMA_messages['strSystemSwap'],
|
||||
series: [
|
||||
@ -290,7 +290,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
} ],
|
||||
nodes: [ {
|
||||
dataPoints: [{ type: 'cpu', name: 'loadavg'}]
|
||||
} ],
|
||||
} ],
|
||||
maxYLabel: 0
|
||||
},
|
||||
'memory': {
|
||||
@ -304,7 +304,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
{ dataPoints: [{ type: 'memory', name: 'MemFree' }], valueDivisor: 1024 }
|
||||
],
|
||||
maxYLabel: 0
|
||||
},
|
||||
},
|
||||
'swap': {
|
||||
title: PMA_messages['strSystemSwap'],
|
||||
series: [
|
||||
@ -370,19 +370,19 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
menuName: 'gridsettings',
|
||||
menuItems: [{
|
||||
textKey: 'editChart',
|
||||
onclick: function() {
|
||||
onclick: function () {
|
||||
editChart(this);
|
||||
}
|
||||
}, {
|
||||
textKey: 'removeChart',
|
||||
onclick: function() {
|
||||
onclick: function () {
|
||||
removeChart(this);
|
||||
}
|
||||
}]
|
||||
}
|
||||
};
|
||||
|
||||
$('a[href="#rearrangeCharts"], a[href="#endChartEditMode"]').click(function(event) {
|
||||
$('a[href="#rearrangeCharts"], a[href="#endChartEditMode"]').click(function (event) {
|
||||
event.preventDefault();
|
||||
editMode = !editMode;
|
||||
if ($(this).attr('href') == '#endChartEditMode') {
|
||||
@ -409,7 +409,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
events: {
|
||||
// Drop event. The drag child element is moved into the drop element
|
||||
// and vice versa. So the parameters are switched.
|
||||
drop: function(drag, drop, pos) {
|
||||
drop: function (drag, drop, pos) {
|
||||
var dragKey, dropKey, dropRender;
|
||||
var dragRender = $(drag).children().first().attr('id');
|
||||
|
||||
@ -418,7 +418,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
}
|
||||
|
||||
// Find the charts in the array
|
||||
$.each(runtime.charts, function(key, value) {
|
||||
$.each(runtime.charts, function (key, value) {
|
||||
if (value.chart.options.chart.renderTo == dragRender) {
|
||||
dragKey = key;
|
||||
}
|
||||
@ -442,7 +442,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
var newChartList = {};
|
||||
var c = 0;
|
||||
|
||||
$.each(runtime.charts, function(key, value) {
|
||||
$.each(runtime.charts, function (key, value) {
|
||||
if (key != dropKey) {
|
||||
keys.push(key);
|
||||
}
|
||||
@ -482,7 +482,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
});
|
||||
|
||||
// global settings
|
||||
$('div.popupContent select[name="chartColumns"]').change(function() {
|
||||
$('div.popupContent select[name="chartColumns"]').change(function () {
|
||||
monitorSettings.columns = parseInt(this.value, 10);
|
||||
|
||||
var newSize = chartSize();
|
||||
@ -497,7 +497,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
while($tr.length !== 0) {
|
||||
numColumns = 1;
|
||||
// To many cells in one row => put into next row
|
||||
$tr.find('td').each(function() {
|
||||
$tr.find('td').each(function () {
|
||||
if (numColumns > monitorSettings.columns) {
|
||||
if ($tr.next().length === 0) {
|
||||
$tr.after('<tr></tr>');
|
||||
@ -513,7 +513,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
var cnt = monitorSettings.columns - $tr.find('td').length;
|
||||
for (var i = 0; i < cnt; i++) {
|
||||
$tr.append($tr.next().find('td:first'));
|
||||
$tr.nextAll().each(function() {
|
||||
$tr.nextAll().each(function () {
|
||||
if ($(this).next().length !== 0) {
|
||||
$(this).append($(this).next().find('td:first'));
|
||||
}
|
||||
@ -526,7 +526,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
}
|
||||
|
||||
/* Apply new chart size to all charts */
|
||||
$.each(runtime.charts, function(key, value) {
|
||||
$.each(runtime.charts, function (key, value) {
|
||||
value.chart.setSize(
|
||||
newSize.width,
|
||||
newSize.height,
|
||||
@ -548,7 +548,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
saveMonitor(); // Save settings
|
||||
});
|
||||
|
||||
$('div.popupContent select[name="gridChartRefresh"]').change(function() {
|
||||
$('div.popupContent select[name="gridChartRefresh"]').change(function () {
|
||||
monitorSettings.gridRefresh = parseInt(this.value, 10) * 1000;
|
||||
clearTimeout(runtime.refreshTimeout);
|
||||
|
||||
@ -564,11 +564,11 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
saveMonitor(); // Save settings
|
||||
});
|
||||
|
||||
$('a[href="#addNewChart"]').click(function(event) {
|
||||
$('a[href="#addNewChart"]').click(function (event) {
|
||||
event.preventDefault();
|
||||
var dlgButtons = { };
|
||||
|
||||
dlgButtons[PMA_messages['strAddChart']] = function() {
|
||||
dlgButtons[PMA_messages['strAddChart']] = function () {
|
||||
var type = $('input[name="chartType"]:checked').val();
|
||||
|
||||
if (type == 'preset') {
|
||||
@ -594,7 +594,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
$(this).dialog("close");
|
||||
};
|
||||
|
||||
dlgButtons[PMA_messages['strClose']] = function() {
|
||||
dlgButtons[PMA_messages['strClose']] = function () {
|
||||
newChart = null;
|
||||
$('span#clearSeriesLink').hide();
|
||||
$('#seriesPreview').html('');
|
||||
@ -603,10 +603,10 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
|
||||
var $presetList = $('#addChartDialog select[name="presetCharts"]');
|
||||
if ($presetList.html().length === 0) {
|
||||
$.each(presetCharts, function(key, value) {
|
||||
$.each(presetCharts, function (key, value) {
|
||||
$presetList.append('<option value="' + key + '">' + value.title + '</option>');
|
||||
});
|
||||
$presetList.change(function() {
|
||||
$presetList.change(function () {
|
||||
$('input[name="chartTitle"]').val(
|
||||
$presetList.find(':selected').text()
|
||||
);
|
||||
@ -640,10 +640,10 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
return false;
|
||||
});
|
||||
|
||||
$('a[href="#exportMonitorConfig"]').click(function(event) {
|
||||
$('a[href="#exportMonitorConfig"]').click(function (event) {
|
||||
event.preventDefault();
|
||||
var gridCopy = {};
|
||||
$.each(runtime.charts, function(key, elem) {
|
||||
$.each(runtime.charts, function (key, elem) {
|
||||
gridCopy[key] = {};
|
||||
gridCopy[key].nodes = elem.nodes;
|
||||
gridCopy[key].settings = elem.settings;
|
||||
@ -671,7 +671,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
.remove();
|
||||
});
|
||||
|
||||
$('a[href="#importMonitorConfig"]').click(function(event) {
|
||||
$('a[href="#importMonitorConfig"]').click(function (event) {
|
||||
event.preventDefault();
|
||||
$('#emptyDialog').dialog({title: PMA_messages['strImportDialogTitle']});
|
||||
$('#emptyDialog').html(PMA_messages['strImportDialogMessage'] + ':<br/><form action="file_echo.php?' + PMA_commonParams.get('common_query') + '&import=1" method="post" enctype="multipart/form-data">' +
|
||||
@ -679,14 +679,14 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
|
||||
var dlgBtns = {};
|
||||
|
||||
dlgBtns[PMA_messages['strImport']] = function() {
|
||||
dlgBtns[PMA_messages['strImport']] = function () {
|
||||
var $iframe, $form;
|
||||
$('body').append($iframe = $('<iframe id="monitorConfigUpload" style="display:none;"></iframe>'));
|
||||
var d = $iframe[0].contentWindow.document;
|
||||
d.open(); d.close();
|
||||
mew = d;
|
||||
|
||||
$iframe.load(function() {
|
||||
$iframe.load(function () {
|
||||
var json;
|
||||
|
||||
// Try loading config
|
||||
@ -728,7 +728,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
$('#emptyDialog').append('<img class="ajaxIcon" src="' + pmaThemeImage + 'ajax_clock_small.gif" alt="">');
|
||||
};
|
||||
|
||||
dlgBtns[PMA_messages['strCancel']] = function() {
|
||||
dlgBtns[PMA_messages['strCancel']] = function () {
|
||||
$(this).dialog('close');
|
||||
};
|
||||
|
||||
@ -740,7 +740,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
});
|
||||
});
|
||||
|
||||
$('a[href="#clearMonitorConfig"]').click(function(event) {
|
||||
$('a[href="#clearMonitorConfig"]').click(function (event) {
|
||||
event.preventDefault();
|
||||
window.localStorage.removeItem('monitorCharts');
|
||||
window.localStorage.removeItem('monitorSettings');
|
||||
@ -749,7 +749,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
rebuildGrid();
|
||||
});
|
||||
|
||||
$('a[href="#pauseCharts"]').click(function(event) {
|
||||
$('a[href="#pauseCharts"]').click(function (event) {
|
||||
event.preventDefault();
|
||||
runtime.redrawCharts = ! runtime.redrawCharts;
|
||||
if (! runtime.redrawCharts) {
|
||||
@ -764,7 +764,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
return false;
|
||||
});
|
||||
|
||||
$('a[href="#monitorInstructionsDialog"]').click(function(event) {
|
||||
$('a[href="#monitorInstructionsDialog"]').click(function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
var $dialog = $('#monitorInstructionsDialog');
|
||||
@ -774,14 +774,14 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
height: 'auto'
|
||||
}).find('img.ajaxIcon').show();
|
||||
|
||||
var loadLogVars = function(getvars) {
|
||||
var loadLogVars = function (getvars) {
|
||||
var vars = { ajax_request: true, logging_vars: true };
|
||||
if (getvars) {
|
||||
$.extend(vars, getvars);
|
||||
}
|
||||
|
||||
$.get('server_status_monitor.php?' + PMA_commonParams.get('common_query'), vars,
|
||||
function(data) {
|
||||
function (data) {
|
||||
var logVars;
|
||||
if (data.success === true) {
|
||||
logVars = data.message;
|
||||
@ -887,7 +887,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
|
||||
$dialog.find('div.ajaxContent').html(str);
|
||||
$dialog.find('img.ajaxIcon').hide();
|
||||
$dialog.find('a.set').click(function() {
|
||||
$dialog.find('a.set').click(function () {
|
||||
var nameValue = $(this).attr('href').split('-');
|
||||
loadLogVars({ varName: nameValue[0].substr(1), varValue: nameValue[1]});
|
||||
$dialog.find('img.ajaxIcon').show();
|
||||
@ -902,7 +902,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
return false;
|
||||
});
|
||||
|
||||
$('input[name="chartType"]').change(function() {
|
||||
$('input[name="chartType"]').change(function () {
|
||||
$('#chartVariableSettings').toggle(this.checked && this.value == 'variable');
|
||||
var title = $('input[name="chartTitle"]').val();
|
||||
if (title == PMA_messages['strChartTitle']
|
||||
@ -915,11 +915,11 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
|
||||
});
|
||||
|
||||
$('input[name="useDivisor"]').change(function() {
|
||||
$('input[name="useDivisor"]').change(function () {
|
||||
$('span.divisorInput').toggle(this.checked);
|
||||
});
|
||||
|
||||
$('input[name="useUnit"]').change(function() {
|
||||
$('input[name="useUnit"]').change(function () {
|
||||
$('span.unitInput').toggle(this.checked);
|
||||
});
|
||||
|
||||
@ -929,7 +929,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
}
|
||||
});
|
||||
|
||||
$('a[href="#kibDivisor"]').click(function(event) {
|
||||
$('a[href="#kibDivisor"]').click(function (event) {
|
||||
event.preventDefault();
|
||||
$('input[name="valueDivisor"]').val(1024);
|
||||
$('input[name="valueUnit"]').val(PMA_messages['strKiB']);
|
||||
@ -938,7 +938,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
return false;
|
||||
});
|
||||
|
||||
$('a[href="#mibDivisor"]').click(function(event) {
|
||||
$('a[href="#mibDivisor"]').click(function (event) {
|
||||
event.preventDefault();
|
||||
$('input[name="valueDivisor"]').val(1024*1024);
|
||||
$('input[name="valueUnit"]').val(PMA_messages['strMiB']);
|
||||
@ -947,14 +947,14 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
return false;
|
||||
});
|
||||
|
||||
$('a[href="#submitClearSeries"]').click(function(event) {
|
||||
$('a[href="#submitClearSeries"]').click(function (event) {
|
||||
event.preventDefault();
|
||||
$('#seriesPreview').html('<i>' + PMA_messages['strNone'] + '</i>');
|
||||
newChart = null;
|
||||
$('#clearSeriesLink').hide();
|
||||
});
|
||||
|
||||
$('a[href="#submitAddSeries"]').click(function(event) {
|
||||
$('a[href="#submitAddSeries"]').click(function (event) {
|
||||
event.preventDefault();
|
||||
if ($('#variableInput').val() === "") {
|
||||
return false;
|
||||
@ -1034,7 +1034,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
$('#emptyDialog').html(PMA_messages['strIncompatibleMonitorConfigDescription']);
|
||||
|
||||
var dlgBtns = {};
|
||||
dlgBtns[PMA_messages['strClose']] = function() { $(this).dialog('close'); };
|
||||
dlgBtns[PMA_messages['strClose']] = function () { $(this).dialog('close'); };
|
||||
|
||||
$('#emptyDialog').dialog({
|
||||
width: 400,
|
||||
@ -1074,7 +1074,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
|
||||
/* Add all charts - in correct order */
|
||||
var keys = [];
|
||||
$.each(runtime.charts, function(key, value) {
|
||||
$.each(runtime.charts, function (key, value) {
|
||||
keys.push(key);
|
||||
});
|
||||
keys.sort();
|
||||
@ -1102,7 +1102,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
var oldData = null;
|
||||
if (runtime.charts) {
|
||||
oldData = {};
|
||||
$.each(runtime.charts, function(key, chartObj) {
|
||||
$.each(runtime.charts, function (key, chartObj) {
|
||||
for (var i = 0, l = chartObj.nodes.length; i < l; i++) {
|
||||
oldData[chartObj.nodes[i].dataPoint] = [];
|
||||
for (var j = 0, ll = chartObj.chart.series[i].data.length; j < ll; j++) {
|
||||
@ -1116,7 +1116,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
initGrid();
|
||||
|
||||
if (oldData) {
|
||||
$.each(runtime.charts, function(key, chartObj) {
|
||||
$.each(runtime.charts, function (key, chartObj) {
|
||||
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]);
|
||||
@ -1247,7 +1247,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
}
|
||||
|
||||
// time span selection
|
||||
$('#gridchart' + runtime.chartAI).bind('jqplotMouseDown', function(ev, gridpos, datapos, neighbor, plot) {
|
||||
$('#gridchart' + runtime.chartAI).bind('jqplotMouseDown', function (ev, gridpos, datapos, neighbor, plot) {
|
||||
drawTimeSpan = true;
|
||||
selectionTimeDiff.push(datapos.xaxis);
|
||||
if ($('#selection_box').length) {
|
||||
@ -1266,7 +1266,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
.fadeIn();
|
||||
});
|
||||
|
||||
$('#gridchart' + runtime.chartAI).bind('jqplotMouseUp', function(ev, gridpos, datapos, neighbor, plot) {
|
||||
$('#gridchart' + runtime.chartAI).bind('jqplotMouseUp', function (ev, gridpos, datapos, neighbor, plot) {
|
||||
if (! drawTimeSpan) {
|
||||
return;
|
||||
}
|
||||
@ -1285,7 +1285,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
drawTimeSpan = false;
|
||||
});
|
||||
|
||||
$('#gridchart' + runtime.chartAI).bind('jqplotMouseMove', function(ev, gridpos, datapos, neighbor, plot) {
|
||||
$('#gridchart' + runtime.chartAI).bind('jqplotMouseMove', function (ev, gridpos, datapos, neighbor, plot) {
|
||||
if (! drawTimeSpan) {
|
||||
return;
|
||||
}
|
||||
@ -1298,11 +1298,11 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
}
|
||||
});
|
||||
|
||||
$('#gridchart' + runtime.chartAI).bind('jqplotMouseLeave', function(ev, gridpos, datapos, neighbor, plot) {
|
||||
$('#gridchart' + runtime.chartAI).bind('jqplotMouseLeave', function (ev, gridpos, datapos, neighbor, plot) {
|
||||
drawTimeSpan = false;
|
||||
});
|
||||
|
||||
$(document.body).mouseup(function() {
|
||||
$(document.body).mouseup(function () {
|
||||
if ($('#selection_box').length) {
|
||||
selectionBox.remove();
|
||||
}
|
||||
@ -1323,7 +1323,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
|
||||
var chart = null;
|
||||
var chartKey = null;
|
||||
$.each(runtime.charts, function(key, value) {
|
||||
$.each(runtime.charts, function (key, value) {
|
||||
if (value.chart.options.chart.renderTo == htmlnode) {
|
||||
chart = value;
|
||||
chartKey = key;
|
||||
@ -1342,11 +1342,11 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
}
|
||||
|
||||
dlgBtns = {};
|
||||
dlgBtns[PMA_messages['strSave']] = function() {
|
||||
dlgBtns[PMA_messages['strSave']] = function () {
|
||||
runtime.charts[chartKey].title = $('#emptyDialog input[name="chartTitle"]').val();
|
||||
runtime.charts[chartKey].chart.setTitle({ text: runtime.charts[chartKey].title });
|
||||
|
||||
$('#emptyDialog input[name*="chartSerie"]').each(function() {
|
||||
$('#emptyDialog input[name*="chartSerie"]').each(function () {
|
||||
var $t = $(this);
|
||||
var idx = $t.attr('name').split('-')[1];
|
||||
runtime.charts[chartKey].nodes[idx].name = $t.val();
|
||||
@ -1356,7 +1356,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
$(this).dialog('close');
|
||||
saveMonitor();
|
||||
};
|
||||
dlgBtns[PMA_messages['strCancel']] = function() {
|
||||
dlgBtns[PMA_messages['strCancel']] = function () {
|
||||
$(this).dialog('close');
|
||||
};
|
||||
|
||||
@ -1377,12 +1377,12 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
|
||||
var dlgBtns = { };
|
||||
|
||||
dlgBtns[PMA_messages['strFromSlowLog']] = function() {
|
||||
dlgBtns[PMA_messages['strFromSlowLog']] = function () {
|
||||
loadLog('slow', min, max);
|
||||
$(this).dialog("close");
|
||||
};
|
||||
|
||||
dlgBtns[PMA_messages['strFromGeneralLog']] = function() {
|
||||
dlgBtns[PMA_messages['strFromGeneralLog']] = function () {
|
||||
loadLog('general', min, max);
|
||||
$(this).dialog("close");
|
||||
};
|
||||
@ -1414,7 +1414,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
return;
|
||||
}
|
||||
|
||||
$.each(runtime.charts, function(key, value) {
|
||||
$.each(runtime.charts, function (key, value) {
|
||||
if (value.chart.options.chart.renderTo == htmlnode) {
|
||||
delete runtime.charts[key];
|
||||
return false;
|
||||
@ -1425,7 +1425,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
|
||||
// Using settimeout() because clicking the remove link fires an onclick event
|
||||
// which throws an error when the chart is destroyed
|
||||
setTimeout(function() {
|
||||
setTimeout(function () {
|
||||
chartObj.destroy();
|
||||
$('#' + htmlnode).remove();
|
||||
}, 10);
|
||||
@ -1441,7 +1441,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
chart_data: 1,
|
||||
type: 'chartgrid',
|
||||
requiredData: $.toJSON(runtime.dataList)
|
||||
}, function(data) {
|
||||
}, function (data) {
|
||||
var chartData;
|
||||
if (data.success === true) {
|
||||
chartData = data.message;
|
||||
@ -1453,7 +1453,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
var total;
|
||||
|
||||
/* Update values in each graph */
|
||||
$.each(runtime.charts, function(orderKey, elem) {
|
||||
$.each(runtime.charts, function (orderKey, elem) {
|
||||
var key = elem.chartID;
|
||||
// If newly added chart, we have no data for it yet
|
||||
if (! chartData[key]) {
|
||||
@ -1568,7 +1568,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
*/
|
||||
function getMaxYLabel(dataValues) {
|
||||
var maxY = dataValues[0][1];
|
||||
$.each(dataValues,function(k,v){
|
||||
$.each(dataValues,function (k,v){
|
||||
maxY = (v[1]>maxY) ? v[1] : maxY;
|
||||
});
|
||||
return maxY;
|
||||
@ -1624,7 +1624,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
// Store an own id, because the property name is subject of reordering,
|
||||
// thus destroying our mapping with runtime.charts <=> runtime.dataList
|
||||
var chartID = 0;
|
||||
$.each(runtime.charts, function(key, chart) {
|
||||
$.each(runtime.charts, function (key, chart) {
|
||||
runtime.dataList[chartID] = [];
|
||||
for (var i=0, l=chart.nodes.length; i < l; i++) {
|
||||
runtime.dataList[chartID][i] = chart.nodes[i].dataPoints;
|
||||
@ -1652,7 +1652,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
'ajax_clock_small.gif" alt="">');
|
||||
var dlgBtns = {};
|
||||
|
||||
dlgBtns[PMA_messages['strCancelRequest']] = function() {
|
||||
dlgBtns[PMA_messages['strCancelRequest']] = function () {
|
||||
if (logRequest !== null) {
|
||||
logRequest.abort();
|
||||
}
|
||||
@ -1676,7 +1676,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
removeVariables: opts.removeVariables,
|
||||
limitTypes: opts.limitTypes
|
||||
},
|
||||
function(data) {
|
||||
function (data) {
|
||||
var logData;
|
||||
if (data.success === true) {
|
||||
logData = data.message;
|
||||
@ -1690,7 +1690,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
/* Show some stats in the dialog */
|
||||
$('#emptyDialog').dialog({title: PMA_messages['strLoadingLogs']});
|
||||
$('#emptyDialog').html('<p>' + PMA_messages['strLogDataLoaded'] + '</p>');
|
||||
$.each(logData.sum, function(key, value) {
|
||||
$.each(logData.sum, function (key, value) {
|
||||
key = key.charAt(0).toUpperCase() + key.slice(1).toLowerCase();
|
||||
if (key == 'Total') {
|
||||
key = '<b>' + key + '</b>';
|
||||
@ -1715,7 +1715,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
'</fieldset>'
|
||||
);
|
||||
|
||||
$('#logTable #noWHEREData').change(function() {
|
||||
$('#logTable #noWHEREData').change(function () {
|
||||
filterQueries(true);
|
||||
});
|
||||
|
||||
@ -1728,7 +1728,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
}
|
||||
|
||||
var dlgBtns = {};
|
||||
dlgBtns[PMA_messages['strJumpToTable']] = function() {
|
||||
dlgBtns[PMA_messages['strJumpToTable']] = function () {
|
||||
$(this).dialog("close");
|
||||
$(document).scrollTop($('#logTable').offset().top);
|
||||
};
|
||||
@ -1740,7 +1740,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
$('#emptyDialog').html('<p>' + PMA_messages['strNoDataFound'] + '</p>');
|
||||
|
||||
var dlgBtns = {};
|
||||
dlgBtns[PMA_messages['strClose']] = function() {
|
||||
dlgBtns[PMA_messages['strClose']] = function () {
|
||||
$(this).dialog("close");
|
||||
};
|
||||
|
||||
@ -1778,7 +1778,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
var columnSums = {};
|
||||
|
||||
// For the slow log we have to count many columns (query_time, lock_time, rows_examined, rows_sent, etc.)
|
||||
var countRow = function(query, row) {
|
||||
var countRow = function (query, row) {
|
||||
var cells = row.match(/<td>(.*?)<\/td>/gi);
|
||||
if (!columnSums[query]) {
|
||||
columnSums[query] = [0, 0, 0, 0];
|
||||
@ -1793,7 +1793,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
};
|
||||
|
||||
// We just assume the sql text is always in the second last column, and that the total count is right of it
|
||||
$('#logTable table tbody tr td:nth-child(' + (runtime.logDataCols.length - 1) + ')').each(function() {
|
||||
$('#logTable table tbody tr td:nth-child(' + (runtime.logDataCols.length - 1) + ')').each(function () {
|
||||
var $t = $(this);
|
||||
// If query is a SELECT and user enabled or disabled to group
|
||||
// queries ignoring data in where statements, we
|
||||
@ -1870,7 +1870,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
if (varFilterChange) {
|
||||
if (noVars) {
|
||||
var numCol, row, $table = $('#logTable table tbody');
|
||||
$.each(filteredQueriesLines, function(key, value) {
|
||||
$.each(filteredQueriesLines, function (key, value) {
|
||||
if (filteredQueries[key] <= 1) {
|
||||
return;
|
||||
}
|
||||
@ -1889,7 +1889,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
}
|
||||
|
||||
$('#logTable table').trigger("update");
|
||||
setTimeout(function() {
|
||||
setTimeout(function () {
|
||||
$('#logTable table').trigger('sorton', [[[runtime.logDataCols.length - 1, 1]]]);
|
||||
}, 0);
|
||||
}
|
||||
@ -1937,7 +1937,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
|
||||
$('#logTable').html($table);
|
||||
|
||||
var formatValue = function(name, value) {
|
||||
var formatValue = function (name, value) {
|
||||
switch(name) {
|
||||
case 'user_host':
|
||||
return value.replace(/(\[.*?\])+/g, '');
|
||||
@ -1947,7 +1947,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
|
||||
for (var i = 0, l = rows.length; i < l; i++) {
|
||||
if (i === 0) {
|
||||
$.each(rows[0], function(key, value) {
|
||||
$.each(rows[0], function (key, value) {
|
||||
cols.push(key);
|
||||
});
|
||||
$table.append( '<thead>' +
|
||||
@ -2014,7 +2014,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
codemirror_editor.setValue(query);
|
||||
// Codemirror is bugged, it doesn't refresh properly sometimes.
|
||||
// Following lines seem to fix that
|
||||
setTimeout(function() {
|
||||
setTimeout(function () {
|
||||
codemirror_editor.refresh();
|
||||
},50);
|
||||
}
|
||||
@ -2025,7 +2025,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
var profilingChart = null;
|
||||
var dlgBtns = {};
|
||||
|
||||
dlgBtns[PMA_messages['strAnalyzeQuery']] = function() {
|
||||
dlgBtns[PMA_messages['strAnalyzeQuery']] = function () {
|
||||
loadQueryAnalysis(rowData);
|
||||
};
|
||||
dlgBtns[PMA_messages['strClose']] = function () {
|
||||
@ -2037,7 +2037,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
height: 'auto',
|
||||
resizable: false,
|
||||
buttons: dlgBtns,
|
||||
close: function() {
|
||||
close: function () {
|
||||
if (profilingChart !== null) {
|
||||
profilingChart.destroy();
|
||||
}
|
||||
@ -2064,7 +2064,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
query_analyzer: true,
|
||||
query: codemirror_editor ? codemirror_editor.getValue() : $('#sqlquery').val(),
|
||||
database: db
|
||||
}, function(data) {
|
||||
}, function (data) {
|
||||
if (data.success === true) {
|
||||
data = data.message;
|
||||
} else {
|
||||
@ -2090,7 +2090,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
explain += '<p></p>';
|
||||
for (var i = 0, l = data.explain.length; i < l; i++) {
|
||||
explain += '<div class="explain-' + i + '"' + (i>0? 'style="display:none;"' : '' ) + '>';
|
||||
$.each(data.explain[i], function(key, value) {
|
||||
$.each(data.explain[i], function (key, value) {
|
||||
value = (value === null)?'null':value;
|
||||
|
||||
if (key == 'type' && value.toLowerCase() == 'all') {
|
||||
@ -2108,7 +2108,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
|
||||
$('#queryAnalyzerDialog div.placeHolder td.explain').append(explain);
|
||||
|
||||
$('#queryAnalyzerDialog div.placeHolder a[href*="#showExplain"]').click(function() {
|
||||
$('#queryAnalyzerDialog div.placeHolder a[href*="#showExplain"]').click(function () {
|
||||
var id = $(this).attr('href').split('-')[1];
|
||||
$(this).parent().find('div[class*="explain"]').hide();
|
||||
$(this).parent().find('div[class*="explain-' + id + '"]').show();
|
||||
@ -2151,13 +2151,13 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
'(<a href="#showNums">' + PMA_messages['strTable'] + '</a>, <a href="#showChart">' + PMA_messages['strChart'] + '</a>)<br/>' +
|
||||
numberTable + ' <div id="queryProfiling"></div>');
|
||||
|
||||
$('#queryAnalyzerDialog div.placeHolder a[href="#showNums"]').click(function() {
|
||||
$('#queryAnalyzerDialog div.placeHolder a[href="#showNums"]').click(function () {
|
||||
$('#queryAnalyzerDialog #queryProfiling').hide();
|
||||
$('#queryAnalyzerDialog table.queryNums').show();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#queryAnalyzerDialog div.placeHolder a[href="#showChart"]').click(function() {
|
||||
$('#queryAnalyzerDialog div.placeHolder a[href="#showChart"]').click(function () {
|
||||
$('#queryAnalyzerDialog #queryProfiling').show();
|
||||
$('#queryAnalyzerDialog table.queryNums').hide();
|
||||
return false;
|
||||
@ -2177,7 +2177,7 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
function saveMonitor() {
|
||||
var gridCopy = {};
|
||||
|
||||
$.each(runtime.charts, function(key, elem) {
|
||||
$.each(runtime.charts, function (key, elem) {
|
||||
gridCopy[key] = {};
|
||||
gridCopy[key].nodes = elem.nodes;
|
||||
gridCopy[key].settings = elem.settings;
|
||||
@ -2197,13 +2197,13 @@ AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
});
|
||||
|
||||
// Run the monitor once loaded
|
||||
AJAX.registerOnload('server_status_monitor.js', function() {
|
||||
AJAX.registerOnload('server_status_monitor.js', function () {
|
||||
$('a[href="#pauseCharts"]').trigger('click');
|
||||
});
|
||||
|
||||
function serverResponseError() {
|
||||
var btns = {};
|
||||
btns[PMA_messages['strReloadPage']] = function() {
|
||||
btns[PMA_messages['strReloadPage']] = function () {
|
||||
window.location.reload();
|
||||
};
|
||||
$('#emptyDialog').dialog({title: PMA_messages['strRefreshFailed']});
|
||||
@ -2217,7 +2217,7 @@ function serverResponseError() {
|
||||
/* Destroys all monitor related resources */
|
||||
function destroyGrid() {
|
||||
if (runtime.charts) {
|
||||
$.each(runtime.charts, function(key, value) {
|
||||
$.each(runtime.charts, function (key, value) {
|
||||
try {
|
||||
value.chart.destroy();
|
||||
} catch(err) {}
|
||||
|
||||
@ -5,18 +5,18 @@
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('server_status_queries.js', function() {
|
||||
AJAX.registerTeardown('server_status_queries.js', function () {
|
||||
var queryPieChart = $('#serverstatusquerieschart').data('queryPieChart');
|
||||
if (queryPieChart) {
|
||||
queryPieChart.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
AJAX.registerOnload('server_status_queries.js', function() {
|
||||
AJAX.registerOnload('server_status_queries.js', function () {
|
||||
// Build query statistics chart
|
||||
var cdata = [];
|
||||
try {
|
||||
$.each(jQuery.parseJSON($('#serverstatusquerieschart_data').text()), function(key, value) {
|
||||
$.each(jQuery.parseJSON($('#serverstatusquerieschart_data').text()), function (key, value) {
|
||||
cdata.push([key, parseInt(value, 10)]);
|
||||
});
|
||||
$('#serverstatusquerieschart').data(
|
||||
|
||||
@ -2,27 +2,27 @@
|
||||
function initTableSorter(tabid) {
|
||||
var $table, opts;
|
||||
switch(tabid) {
|
||||
case 'statustabs_queries':
|
||||
$table = $('#serverstatusqueriesdetails');
|
||||
opts = {
|
||||
sortList: [[3, 1]],
|
||||
widgets: ['fast-zebra'],
|
||||
headers: {
|
||||
1: { sorter: 'fancyNumber' },
|
||||
2: { sorter: 'fancyNumber' }
|
||||
}
|
||||
};
|
||||
break;
|
||||
case 'statustabs_allvars':
|
||||
$table = $('#serverstatusvariables');
|
||||
opts = {
|
||||
sortList: [[0, 0]],
|
||||
widgets: ['fast-zebra'],
|
||||
headers: {
|
||||
1: { sorter: 'withinSpanNumber' }
|
||||
}
|
||||
};
|
||||
break;
|
||||
case 'statustabs_queries':
|
||||
$table = $('#serverstatusqueriesdetails');
|
||||
opts = {
|
||||
sortList: [[3, 1]],
|
||||
widgets: ['fast-zebra'],
|
||||
headers: {
|
||||
1: { sorter: 'fancyNumber' },
|
||||
2: { sorter: 'fancyNumber' }
|
||||
}
|
||||
};
|
||||
break;
|
||||
case 'statustabs_allvars':
|
||||
$table = $('#serverstatusvariables');
|
||||
opts = {
|
||||
sortList: [[0, 0]],
|
||||
widgets: ['fast-zebra'],
|
||||
headers: {
|
||||
1: { sorter: 'withinSpanNumber' }
|
||||
}
|
||||
};
|
||||
break;
|
||||
}
|
||||
$table.tablesorter(opts);
|
||||
$table.find('tr:first th')
|
||||
@ -32,10 +32,10 @@ function initTableSorter(tabid) {
|
||||
$(function () {
|
||||
$.tablesorter.addParser({
|
||||
id: "fancyNumber",
|
||||
is: function(s) {
|
||||
is: function (s) {
|
||||
return (/^[0-9]?[0-9,\.]*\s?(k|M|G|T|%)?$/).test(s);
|
||||
},
|
||||
format: function(s) {
|
||||
format: function (s) {
|
||||
var num = jQuery.tablesorter.formatFloat(
|
||||
s.replace(PMA_messages['strThousandsSeparator'], '')
|
||||
.replace(PMA_messages['strDecimalSeparator'], '.')
|
||||
@ -43,12 +43,22 @@ $(function () {
|
||||
|
||||
var factor = 1;
|
||||
switch (s.charAt(s.length - 1)) {
|
||||
case '%': factor = -2; break;
|
||||
// Todo: Complete this list (as well as in the regexp a few lines up)
|
||||
case 'k': factor = 3; break;
|
||||
case 'M': factor = 6; break;
|
||||
case 'G': factor = 9; break;
|
||||
case 'T': factor = 12; break;
|
||||
case '%':
|
||||
factor = -2;
|
||||
break;
|
||||
// Todo: Complete this list (as well as in the regexp a few lines up)
|
||||
case 'k':
|
||||
factor = 3;
|
||||
break;
|
||||
case 'M':
|
||||
factor = 6;
|
||||
break;
|
||||
case 'G':
|
||||
factor = 9;
|
||||
break;
|
||||
case 'T':
|
||||
factor = 12;
|
||||
break;
|
||||
}
|
||||
|
||||
return num * Math.pow(10, factor);
|
||||
@ -58,10 +68,10 @@ $(function () {
|
||||
|
||||
$.tablesorter.addParser({
|
||||
id: "withinSpanNumber",
|
||||
is: function(s) {
|
||||
is: function (s) {
|
||||
return (/<span class="original"/).test(s);
|
||||
},
|
||||
format: function(s, table, html) {
|
||||
format: function (s, table, html) {
|
||||
var res = html.innerHTML.match(/<span(\s*style="display:none;"\s*)?\s*class="original">(.*)?<\/span>/);
|
||||
return (res && res.length >= 3) ? res[2] : 0;
|
||||
},
|
||||
|
||||
@ -8,14 +8,14 @@
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('server_status_variables.js', function() {
|
||||
AJAX.registerTeardown('server_status_variables.js', function () {
|
||||
$('#filterAlert').unbind('change');
|
||||
$('#filterText').unbind('keyup');
|
||||
$('#filterCategory').unbind('change');
|
||||
$('#dontFormat').unbind('change');
|
||||
});
|
||||
|
||||
AJAX.registerOnload('server_status_variables.js', function() {
|
||||
AJAX.registerOnload('server_status_variables.js', function () {
|
||||
/*** Table sort tooltip ***/
|
||||
PMA_tooltip(
|
||||
$('table.sortable>thead>tr:first').find('th'),
|
||||
@ -32,17 +32,17 @@ AJAX.registerOnload('server_status_variables.js', function() {
|
||||
var text = ''; // Holds filter text
|
||||
|
||||
/* 3 Filtering functions */
|
||||
$('#filterAlert').change(function() {
|
||||
$('#filterAlert').change(function () {
|
||||
alertFilter = this.checked;
|
||||
filterVariables();
|
||||
});
|
||||
|
||||
$('#filterCategory').change(function() {
|
||||
$('#filterCategory').change(function () {
|
||||
categoryFilter = $(this).val();
|
||||
filterVariables();
|
||||
});
|
||||
|
||||
$('#dontFormat').change(function() {
|
||||
$('#dontFormat').change(function () {
|
||||
// Hiding the table while changing values speeds up the process a lot
|
||||
$('#serverstatusvariables').hide();
|
||||
$('#serverstatusvariables td.value span.original').toggle(this.checked);
|
||||
@ -50,7 +50,7 @@ AJAX.registerOnload('server_status_variables.js', function() {
|
||||
$('#serverstatusvariables').show();
|
||||
}).trigger('change');
|
||||
|
||||
$('#filterText').keyup(function(e) {
|
||||
$('#filterText').keyup(function (e) {
|
||||
var word = $(this).val().replace(/_/g, ' ');
|
||||
if (word.length === 0) {
|
||||
textFilter = null;
|
||||
@ -71,7 +71,7 @@ AJAX.registerOnload('server_status_variables.js', function() {
|
||||
}
|
||||
|
||||
if (section.length > 1) {
|
||||
$('#linkSuggestions span').each(function() {
|
||||
$('#linkSuggestions span').each(function () {
|
||||
if ($(this).attr('class').indexOf('status_' + section) != -1) {
|
||||
useful_links++;
|
||||
$(this).css('display', '');
|
||||
@ -88,7 +88,7 @@ AJAX.registerOnload('server_status_variables.js', function() {
|
||||
}
|
||||
|
||||
odd_row = false;
|
||||
$('#serverstatusvariables th.name').each(function() {
|
||||
$('#serverstatusvariables th.name').each(function () {
|
||||
if ((textFilter === null || textFilter.exec($(this).text()))
|
||||
&& (! alertFilter || $(this).next().find('span.attention').length>0)
|
||||
&& (categoryFilter.length === 0 || $(this).parent().hasClass('s_' + categoryFilter))
|
||||
|
||||
@ -3,21 +3,21 @@
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('server_variables.js', function() {
|
||||
AJAX.registerTeardown('server_variables.js', function () {
|
||||
$('#serverVariables .var-row').unbind('hover');
|
||||
$('#filterText').unbind('keyup');
|
||||
$('a.editLink').die('click');
|
||||
$('#serverVariables').find('.var-name').find('a img').remove();
|
||||
});
|
||||
|
||||
AJAX.registerOnload('server_variables.js', function() {
|
||||
AJAX.registerOnload('server_variables.js', function () {
|
||||
var $editLink = $('a.editLink');
|
||||
var $saveLink = $('a.saveLink');
|
||||
var $cancelLink = $('a.cancelLink');
|
||||
var $filterField = $('#filterText');
|
||||
|
||||
/* Show edit link on hover */
|
||||
$('#serverVariables').delegate('.var-row', 'hover', function(event) {
|
||||
$('#serverVariables').delegate('.var-row', 'hover', function (event) {
|
||||
if (event.type === 'mouseenter') {
|
||||
var $elm = $(this).find('.var-value');
|
||||
// Only add edit element if the element is not being edited
|
||||
@ -38,7 +38,7 @@ AJAX.registerOnload('server_variables.js', function() {
|
||||
});
|
||||
|
||||
/* Event handler for variables filter */
|
||||
$filterField.keyup(function() {
|
||||
$filterField.keyup(function () {
|
||||
var textFilter = null, val = $(this).val();
|
||||
if (val.length !== 0) {
|
||||
textFilter = new RegExp("(^| )"+val.replace(/_/g,' '),'i');
|
||||
@ -54,7 +54,7 @@ AJAX.registerOnload('server_variables.js', function() {
|
||||
/* Filters the rows by the user given regexp */
|
||||
function filterVariables(textFilter) {
|
||||
var mark_next = false, $row, odd_row = false;
|
||||
$('#serverVariables .var-row').not('.var-header').each(function() {
|
||||
$('#serverVariables .var-row').not('.var-header').each(function () {
|
||||
$row = $(this);
|
||||
if ( mark_next
|
||||
|| textFilter === null
|
||||
@ -90,14 +90,14 @@ AJAX.registerOnload('server_variables.js', function() {
|
||||
.find('a.editLink')
|
||||
.remove(); // remove edit link
|
||||
|
||||
$mySaveLink.click(function() {
|
||||
$mySaveLink.click(function () {
|
||||
var $msgbox = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest);
|
||||
$.get($(this).attr('href'), {
|
||||
ajax_request: true,
|
||||
type: 'setval',
|
||||
varName: varName,
|
||||
varValue: $cell.find('input').val()
|
||||
}, function(data) {
|
||||
}, function (data) {
|
||||
if (data.success) {
|
||||
$cell
|
||||
.html(data.variable)
|
||||
@ -112,7 +112,7 @@ AJAX.registerOnload('server_variables.js', function() {
|
||||
return false;
|
||||
});
|
||||
|
||||
$myCancelLink.click(function() {
|
||||
$myCancelLink.click(function () {
|
||||
$cell
|
||||
.html($cell.data('content'))
|
||||
.removeClass('edit');
|
||||
@ -123,7 +123,7 @@ AJAX.registerOnload('server_variables.js', function() {
|
||||
ajax_request: true,
|
||||
type: 'getval',
|
||||
varName: varName
|
||||
}, function(data) {
|
||||
}, function (data) {
|
||||
if (data.success === true) {
|
||||
var $editor = $('<div />', {'class':'serverVariableEditor'})
|
||||
.append($myCancelLink)
|
||||
@ -141,7 +141,7 @@ AJAX.registerOnload('server_variables.js', function() {
|
||||
.html($editor)
|
||||
.find('input')
|
||||
.focus()
|
||||
.keydown(function(event) { // Keyboard shortcuts
|
||||
.keydown(function (event) { // Keyboard shortcuts
|
||||
if (event.keyCode === 13) { // Enter key
|
||||
$mySaveLink.trigger('click');
|
||||
} else if (event.keyCode === 27) { // Escape key
|
||||
|
||||
62
js/sql.js
62
js/sql.js
@ -65,7 +65,7 @@ function getFieldName($this_field)
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('sql.js', function() {
|
||||
AJAX.registerTeardown('sql.js', function () {
|
||||
$('a.delete_row.ajax').unbind('click');
|
||||
$('#bookmarkQueryForm').die('submit');
|
||||
$('input#bkm_label').unbind('keyup');
|
||||
@ -102,7 +102,7 @@ AJAX.registerTeardown('sql.js', function() {
|
||||
* @name document.ready
|
||||
* @memberOf jQuery
|
||||
*/
|
||||
AJAX.registerOnload('sql.js', function() {
|
||||
AJAX.registerOnload('sql.js', function () {
|
||||
// Delete row from SQL results
|
||||
$('a.delete_row.ajax').click(function (e) {
|
||||
e.preventDefault();
|
||||
@ -135,7 +135,7 @@ AJAX.registerOnload('sql.js', function() {
|
||||
});
|
||||
|
||||
/* Hides the bookmarkoptions checkboxes when the bookmark label is empty */
|
||||
$('input#bkm_label').keyup(function() {
|
||||
$('input#bkm_label').keyup(function () {
|
||||
$('input#id_bkm_all_users, input#id_bkm_replace')
|
||||
.parent()
|
||||
.toggle($(this).val().length > 0);
|
||||
@ -146,7 +146,7 @@ AJAX.registerOnload('sql.js', function() {
|
||||
* triggered manually everytime the table of results is reloaded
|
||||
* @memberOf jQuery
|
||||
*/
|
||||
$("#sqlqueryresults").live('makegrid', function() {
|
||||
$("#sqlqueryresults").live('makegrid', function () {
|
||||
PMA_makegrid($('#table_results')[0]);
|
||||
});
|
||||
|
||||
@ -166,7 +166,7 @@ AJAX.registerOnload('sql.js', function() {
|
||||
.hide();
|
||||
|
||||
// Attach the toggling of the query box visibility to a click
|
||||
$("#togglequerybox").bind('click', function() {
|
||||
$("#togglequerybox").bind('click', function () {
|
||||
var $link = $(this);
|
||||
$link.siblings().slideToggle("fast");
|
||||
if ($link.text() == PMA_messages['strHideQueryBox']) {
|
||||
@ -189,7 +189,7 @@ AJAX.registerOnload('sql.js', function() {
|
||||
*
|
||||
* @memberOf jQuery
|
||||
*/
|
||||
$("#button_submit_query").live('click', function(event) {
|
||||
$("#button_submit_query").live('click', function (event) {
|
||||
var $form = $(this).closest("form");
|
||||
// the Go button related to query submission was clicked,
|
||||
// instead of the one related to Bookmarks, so empty the
|
||||
@ -205,7 +205,7 @@ AJAX.registerOnload('sql.js', function() {
|
||||
*
|
||||
* @memberOf jQuery
|
||||
*/
|
||||
$("input[name=bookmark_variable]").bind("keypress", function(event) {
|
||||
$("input[name=bookmark_variable]").bind("keypress", function (event) {
|
||||
// force the 'Enter Key' to implicitly click the #button_submit_bookmark
|
||||
var keycode = (event.keyCode ? event.keyCode : (event.which ? event.which : event.charCode));
|
||||
if (keycode == 13) { // keycode for enter key
|
||||
@ -218,9 +218,9 @@ AJAX.registerOnload('sql.js', function() {
|
||||
// section and hit enter, you expect it to do the
|
||||
// same action as the Go button in that section.
|
||||
$("#button_submit_bookmark").click();
|
||||
return false;
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@ -231,7 +231,7 @@ AJAX.registerOnload('sql.js', function() {
|
||||
* @memberOf jQuery
|
||||
* @name sqlqueryform_submit
|
||||
*/
|
||||
$("#sqlqueryform.ajax").live('submit', function(event) {
|
||||
$("#sqlqueryform.ajax").live('submit', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
var $form = $(this);
|
||||
@ -247,7 +247,7 @@ AJAX.registerOnload('sql.js', function() {
|
||||
|
||||
PMA_prepareForAjaxRequest($form);
|
||||
|
||||
$.post($form.attr('action'), $form.serialize() , function(data) {
|
||||
$.post($form.attr('action'), $form.serialize() , function (data) {
|
||||
if (data.success === true) {
|
||||
// success happens if the query returns rows or not
|
||||
//
|
||||
@ -334,7 +334,7 @@ AJAX.registerOnload('sql.js', function() {
|
||||
* @memberOf jQuery
|
||||
* @name paginate_dropdown_change
|
||||
*/
|
||||
$("#pageselector").live('change', function(event) {
|
||||
$("#pageselector").live('change', function (event) {
|
||||
var $form = $(this).parent("form");
|
||||
$form.submit();
|
||||
}); // end Paginate results with Page Selector
|
||||
@ -344,12 +344,12 @@ AJAX.registerOnload('sql.js', function() {
|
||||
* @memberOf jQuery
|
||||
* @name displayOptionsForm_submit
|
||||
*/
|
||||
$("#displayOptionsForm.ajax").live('submit', function(event) {
|
||||
$("#displayOptionsForm.ajax").live('submit', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
$form = $(this);
|
||||
|
||||
$.post($form.attr('action'), $form.serialize() + '&ajax_request=true' , function(data) {
|
||||
$.post($form.attr('action'), $form.serialize() + '&ajax_request=true' , function (data) {
|
||||
$("#sqlqueryresults")
|
||||
.html(data.message)
|
||||
.trigger('makegrid');
|
||||
@ -360,7 +360,7 @@ AJAX.registerOnload('sql.js', function() {
|
||||
/**
|
||||
* Ajax Event for table row change
|
||||
* */
|
||||
$("#resultsForm.ajax .mult_submit[value=edit]").live('click', function(event){
|
||||
$("#resultsForm.ajax .mult_submit[value=edit]").live('click', function (event){
|
||||
event.preventDefault();
|
||||
|
||||
/*Check whether atleast one row is selected for change*/
|
||||
@ -373,18 +373,18 @@ AJAX.registerOnload('sql.js', function() {
|
||||
*/
|
||||
var button_options = {};
|
||||
// in the following function we need to use $(this)
|
||||
button_options[PMA_messages['strCancel']] = function() {
|
||||
button_options[PMA_messages['strCancel']] = function () {
|
||||
$(this).dialog('close');
|
||||
};
|
||||
|
||||
var button_options_error = {};
|
||||
button_options_error[PMA_messages['strOK']] = function() {
|
||||
button_options_error[PMA_messages['strOK']] = function () {
|
||||
$(this).dialog('close');
|
||||
};
|
||||
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
|
||||
@ -394,7 +394,7 @@ AJAX.registerOnload('sql.js', function() {
|
||||
height: 230,
|
||||
width: 900,
|
||||
open: PMA_verifyColumnsProperties,
|
||||
close: function(event, ui) {
|
||||
close: function (event, ui) {
|
||||
$(this).remove();
|
||||
},
|
||||
buttons : button_options_error
|
||||
@ -407,7 +407,7 @@ AJAX.registerOnload('sql.js', function() {
|
||||
height: 600,
|
||||
width: 900,
|
||||
open: PMA_verifyColumnsProperties,
|
||||
close: function(event, ui) {
|
||||
close: function (event, ui) {
|
||||
$(this).remove();
|
||||
},
|
||||
buttons : button_options
|
||||
@ -428,7 +428,7 @@ AJAX.registerOnload('sql.js', function() {
|
||||
/**
|
||||
* Click action for "Go" button in ajax dialog insertForm -> insertRowTable
|
||||
*/
|
||||
$("#insertForm .insertRowTable.ajax input[type=submit]").live('click', function(event) {
|
||||
$("#insertForm .insertRowTable.ajax input[type=submit]").live('click', function (event) {
|
||||
event.preventDefault();
|
||||
/**
|
||||
* @var the_form object referring to the insert form
|
||||
@ -436,7 +436,7 @@ AJAX.registerOnload('sql.js', function() {
|
||||
var $form = $("#insertForm");
|
||||
PMA_prepareForAjaxRequest($form);
|
||||
//User wants to submit the form
|
||||
$.post($form.attr('action'), $form.serialize(), function(data) {
|
||||
$.post($form.attr('action'), $form.serialize(), function (data) {
|
||||
if (data.success === true) {
|
||||
PMA_ajaxShowMessage(data.message);
|
||||
if ($("#pageselector").length !== 0) {
|
||||
@ -469,7 +469,7 @@ AJAX.registerOnload('sql.js', function() {
|
||||
* Click action for #buttonYes button in ajax dialog insertForm
|
||||
*/
|
||||
|
||||
$("#buttonYes.ajax").live('click', function(event){
|
||||
$("#buttonYes.ajax").live('click', function (event){
|
||||
event.preventDefault();
|
||||
/**
|
||||
* @var the_form object referring to the insert form
|
||||
@ -480,7 +480,7 @@ AJAX.registerOnload('sql.js', function() {
|
||||
$("#result_query").remove();
|
||||
PMA_prepareForAjaxRequest($form);
|
||||
//User wants to submit the form
|
||||
$.post($form.attr('action'), $form.serialize() , function(data) {
|
||||
$.post($form.attr('action'), $form.serialize() , function (data) {
|
||||
if (data.success === true) {
|
||||
PMA_ajaxShowMessage(data.message);
|
||||
if (selected_submit_type == "showinsert") {
|
||||
@ -543,9 +543,9 @@ function PMA_changeClassForColumn($this_th, newclass, isAddClass)
|
||||
}
|
||||
}
|
||||
|
||||
AJAX.registerOnload('sql.js', function() {
|
||||
AJAX.registerOnload('sql.js', function () {
|
||||
|
||||
$('a.browse_foreign').live('click', function(e) {
|
||||
$('a.browse_foreign').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
window.open(this.href, 'foreigners', 'width=640,height=240,scrollbars=yes,resizable=yes');
|
||||
$anchor = $(this);
|
||||
@ -555,16 +555,16 @@ AJAX.registerOnload('sql.js', function() {
|
||||
/**
|
||||
* vertical column highlighting in horizontal mode when hovering over the column header
|
||||
*/
|
||||
$('th.column_heading.pointer').live('hover', function(e) {
|
||||
$('th.column_heading.pointer').live('hover', function (e) {
|
||||
PMA_changeClassForColumn($(this), 'hover', e.type == 'mouseenter');
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* vertical column marking in horizontal mode when clicking the column header
|
||||
*/
|
||||
$('th.column_heading.marker').live('click', function() {
|
||||
$('th.column_heading.marker').live('click', function () {
|
||||
PMA_changeClassForColumn($(this), 'marked');
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* create resizable table
|
||||
@ -584,7 +584,7 @@ function makeProfilingChart()
|
||||
}
|
||||
|
||||
var data = [];
|
||||
$.each(jQuery.parseJSON($('#profilingChartData').html()),function(key,value) {
|
||||
$.each(jQuery.parseJSON($('#profilingChartData').html()),function (key,value) {
|
||||
data.push([key,parseFloat(value)]);
|
||||
});
|
||||
|
||||
|
||||
@ -93,9 +93,9 @@ function isDate(val,tmstmp)
|
||||
{
|
||||
val = val.replace(/[.|*|^|+|//|@]/g,'-');
|
||||
var arrayVal = val.split("-");
|
||||
for (var a=0;a<arrayVal.length;a++) {
|
||||
if (arrayVal[a].length==1) {
|
||||
arrayVal[a]=fractionReplace(arrayVal[a]);
|
||||
for (var a = 0; a < arrayVal.length; a++) {
|
||||
if (arrayVal[a].length == 1) {
|
||||
arrayVal[a] = fractionReplace(arrayVal[a]);
|
||||
}
|
||||
}
|
||||
val=arrayVal.join("-");
|
||||
@ -220,7 +220,7 @@ function verificationsAfterFieldChange(urlField, multi_edit, theType)
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('tbl_change.js', function() {
|
||||
AJAX.registerTeardown('tbl_change.js', function () {
|
||||
$('span.open_gis_editor').die('click');
|
||||
$("input[name='gis_data[save]']").die('click');
|
||||
$('input.checkbox_null').unbind('click');
|
||||
@ -235,10 +235,10 @@ AJAX.registerTeardown('tbl_change.js', function() {
|
||||
* Submit Data to be inserted into the table.
|
||||
* Restart insertion with 'N' rows.
|
||||
*/
|
||||
AJAX.registerOnload('tbl_change.js', function() {
|
||||
AJAX.registerOnload('tbl_change.js', function () {
|
||||
$.datepicker.initialized = false;
|
||||
|
||||
$('span.open_gis_editor').live('click', function(event) {
|
||||
$('span.open_gis_editor').live('click', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
var $span = $(this);
|
||||
@ -264,7 +264,7 @@ AJAX.registerOnload('tbl_change.js', function() {
|
||||
/**
|
||||
* Uncheck the null checkbox as geometry data is placed on the input field
|
||||
*/
|
||||
$("input[name='gis_data[save]']").live('click', function(event) {
|
||||
$("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.prop('checked', false);
|
||||
@ -276,7 +276,7 @@ AJAX.registerOnload('tbl_change.js', function() {
|
||||
* "Continue insertion" are handled in the "Continue insertion" code
|
||||
*
|
||||
*/
|
||||
$('input.checkbox_null').bind('click', function(e) {
|
||||
$('input.checkbox_null').bind('click', function (e) {
|
||||
nullify(
|
||||
// use hidden fields populated by tbl_change.php
|
||||
$(this).siblings('.nullify_code').val(),
|
||||
@ -313,7 +313,7 @@ AJAX.registerOnload('tbl_change.js', function() {
|
||||
/**
|
||||
* Continue Insertion form
|
||||
*/
|
||||
$("#insert_rows").live('change', function(event) {
|
||||
$("#insert_rows").live('change', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
/**
|
||||
@ -326,7 +326,7 @@ AJAX.registerOnload('tbl_change.js', function() {
|
||||
var target_rows = $("#insert_rows").val();
|
||||
|
||||
// remove all datepickers
|
||||
$('input.datefield, input.datetimefield').each(function(){
|
||||
$('input.datefield, input.datetimefield').each(function (){
|
||||
$(this).datepicker('destroy');
|
||||
});
|
||||
|
||||
@ -348,7 +348,7 @@ AJAX.registerOnload('tbl_change.js', function() {
|
||||
.clone()
|
||||
.insertBefore("#actions_panel")
|
||||
.find('input[name*=multi_edit],select[name*=multi_edit],textarea[name*=multi_edit]')
|
||||
.each(function() {
|
||||
.each(function () {
|
||||
|
||||
var $this_element = $(this);
|
||||
/**
|
||||
@ -389,7 +389,7 @@ AJAX.registerOnload('tbl_change.js', function() {
|
||||
// will change
|
||||
.data('hashed_field', hashed_field)
|
||||
.data('new_row_index', new_row_index)
|
||||
.bind('change', function(e) {
|
||||
.bind('change', function (e) {
|
||||
var $changed_element = $(this);
|
||||
verificationsAfterFieldChange(
|
||||
$changed_element.data('hashed_field'),
|
||||
@ -408,7 +408,7 @@ AJAX.registerOnload('tbl_change.js', function() {
|
||||
// will be clicked
|
||||
.data('hashed_field', hashed_field)
|
||||
.data('new_row_index', new_row_index)
|
||||
.bind('click', function(e) {
|
||||
.bind('click', function (e) {
|
||||
var $changed_element = $(this);
|
||||
nullify(
|
||||
$changed_element.siblings('.nullify_code').val(),
|
||||
@ -421,7 +421,7 @@ AJAX.registerOnload('tbl_change.js', function() {
|
||||
}) // end each
|
||||
.end()
|
||||
.find('.foreign_values_anchor')
|
||||
.each(function() {
|
||||
.each(function () {
|
||||
var $anchor = $(this);
|
||||
var new_value = 'rownumber=' + new_row_index;
|
||||
// needs improvement in case something else inside
|
||||
@ -467,19 +467,19 @@ AJAX.registerOnload('tbl_change.js', function() {
|
||||
// function and Null
|
||||
var tabindex = 0;
|
||||
$('.textfield')
|
||||
.each(function() {
|
||||
.each(function () {
|
||||
tabindex++;
|
||||
$(this).attr('tabindex', tabindex);
|
||||
// update the IDs of textfields to ensure that they are unique
|
||||
$(this).attr('id', "field_" + tabindex + "_3");
|
||||
});
|
||||
$('select.control_at_footer')
|
||||
.each(function() {
|
||||
.each(function () {
|
||||
tabindex++;
|
||||
$(this).attr('tabindex', tabindex);
|
||||
});
|
||||
// Add all the required datepickers back
|
||||
$('input.datefield, input.datetimefield').each(function(){
|
||||
$('input.datefield, input.datetimefield').each(function (){
|
||||
PMA_addDatepicker($(this));
|
||||
});
|
||||
} else if ( curr_rows > target_rows) {
|
||||
|
||||
@ -9,7 +9,7 @@ var currentSettings = null;
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('tbl_chart.js', function() {
|
||||
AJAX.registerTeardown('tbl_chart.js', function () {
|
||||
$('input[name="chartType"]').unbind('click');
|
||||
$('input[name="barStacked"]').unbind('click');
|
||||
$('input[name="chartTitle"]').unbind('focus').unbind('keyup').unbind('blur');
|
||||
@ -20,7 +20,7 @@ AJAX.registerTeardown('tbl_chart.js', function() {
|
||||
$('#resizer').unbind('resizestop');
|
||||
});
|
||||
|
||||
AJAX.registerOnload('tbl_chart.js', function() {
|
||||
AJAX.registerOnload('tbl_chart.js', function () {
|
||||
|
||||
// from jQuery UI
|
||||
$('#resizer').resizable({
|
||||
@ -29,7 +29,7 @@ AJAX.registerOnload('tbl_chart.js', function() {
|
||||
})
|
||||
.width($('#div_view_options').width() - 50);
|
||||
|
||||
$('#resizer').bind('resizestop', function(event, ui) {
|
||||
$('#resizer').bind('resizestop', function (event, ui) {
|
||||
// make room so that the handle will still appear
|
||||
$('#querychart').height($('#resizer').height() * 0.96);
|
||||
$('#querychart').width($('#resizer').width() * 0.96);
|
||||
@ -51,7 +51,7 @@ AJAX.registerOnload('tbl_chart.js', function() {
|
||||
};
|
||||
|
||||
// handle chart type changes
|
||||
$('input[name="chartType"]').click(function() {
|
||||
$('input[name="chartType"]').click(function () {
|
||||
currentSettings.type = $(this).val();
|
||||
drawChart();
|
||||
if ($(this).val() == 'bar' || $(this).val() == 'column'
|
||||
@ -64,7 +64,7 @@ AJAX.registerOnload('tbl_chart.js', function() {
|
||||
});
|
||||
|
||||
// handle stacking for bar, column and area charts
|
||||
$('input[name="barStacked"]').click(function() {
|
||||
$('input[name="barStacked"]').click(function () {
|
||||
if (this.checked) {
|
||||
$.extend(true, currentSettings, {stackSeries : true});
|
||||
} else {
|
||||
@ -74,16 +74,16 @@ AJAX.registerOnload('tbl_chart.js', function() {
|
||||
});
|
||||
|
||||
// handle changes in chart title
|
||||
$('input[name="chartTitle"]').focus(function() {
|
||||
$('input[name="chartTitle"]').focus(function () {
|
||||
temp_chart_title = $(this).val();
|
||||
}).keyup(function() {
|
||||
}).keyup(function () {
|
||||
var title = $(this).val();
|
||||
if (title.length === 0) {
|
||||
title = ' ';
|
||||
}
|
||||
currentSettings.title = $('input[name="chartTitle"]').val();
|
||||
drawChart();
|
||||
}).blur(function() {
|
||||
}).blur(function () {
|
||||
if ($(this).val() != temp_chart_title) {
|
||||
drawChart();
|
||||
}
|
||||
@ -91,12 +91,12 @@ AJAX.registerOnload('tbl_chart.js', function() {
|
||||
|
||||
var dateTimeCols = [];
|
||||
var vals = $('input[name="dateTimeCols"]').val().split(' ');
|
||||
$.each(vals, function(i, v) {
|
||||
$.each(vals, function (i, v) {
|
||||
dateTimeCols.push(parseInt(v, 10));
|
||||
});
|
||||
|
||||
// handle changing the x-axis
|
||||
$('select[name="chartXAxis"]').change(function() {
|
||||
$('select[name="chartXAxis"]').change(function () {
|
||||
currentSettings.mainAxis = parseInt($(this).val(), 10);
|
||||
if (dateTimeCols.indexOf(currentSettings.mainAxis) != -1) {
|
||||
$('span.span_timeline').show();
|
||||
@ -114,7 +114,7 @@ AJAX.registerOnload('tbl_chart.js', function() {
|
||||
});
|
||||
|
||||
// handle changing the selected data series
|
||||
$('select[name="chartSeries"]').change(function() {
|
||||
$('select[name="chartSeries"]').change(function () {
|
||||
currentSettings.selectedSeries = getSelectedSeries();
|
||||
var yaxis_title;
|
||||
if (currentSettings.selectedSeries.length == 1) {
|
||||
@ -134,11 +134,11 @@ AJAX.registerOnload('tbl_chart.js', function() {
|
||||
});
|
||||
|
||||
// handle manual changes to the chart axis labels
|
||||
$('input[name="xaxis_label"]').keyup(function() {
|
||||
$('input[name="xaxis_label"]').keyup(function () {
|
||||
currentSettings.xaxisLabel = $(this).val();
|
||||
drawChart();
|
||||
});
|
||||
$('input[name="yaxis_label"]').keyup(function() {
|
||||
$('input[name="yaxis_label"]').keyup(function () {
|
||||
currentSettings.yaxisLabel = $(this).val();
|
||||
drawChart();
|
||||
});
|
||||
@ -150,7 +150,7 @@ AJAX.registerOnload('tbl_chart.js', function() {
|
||||
* Ajax Event handler for 'Go' button click
|
||||
*
|
||||
*/
|
||||
$("#tblchartform").live('submit', function(event) {
|
||||
$("#tblchartform").live('submit', function (event) {
|
||||
if (!checkFormElementInRange(this, 'session_max_rows', PMA_messages['strNotValidRowNumber'], 1)
|
||||
|| !checkFormElementInRange(this, 'pos', PMA_messages['strNotValidRowNumber'], 0 - 1)) {
|
||||
return false;
|
||||
@ -165,7 +165,7 @@ $("#tblchartform").live('submit', function(event) {
|
||||
var $msgbox = PMA_ajaxShowMessage();
|
||||
PMA_prepareForAjaxRequest($form);
|
||||
|
||||
$.post($form.attr('action'), $form.serialize(), function(data) {
|
||||
$.post($form.attr('action'), $form.serialize(), function (data) {
|
||||
if (data.success === true) {
|
||||
$('.success').fadeOut();
|
||||
if (typeof data.chartData != 'undefined') {
|
||||
@ -200,7 +200,7 @@ function drawChart() {
|
||||
}
|
||||
|
||||
var columnNames = [];
|
||||
$('select[name="chartXAxis"] option').each(function() {
|
||||
$('select[name="chartXAxis"] option').each(function () {
|
||||
columnNames.push($(this).text());
|
||||
});
|
||||
try {
|
||||
@ -213,7 +213,7 @@ function drawChart() {
|
||||
function getSelectedSeries() {
|
||||
var val = $('select[name="chartSeries"]').val() || [];
|
||||
var ret = [];
|
||||
$.each(val, function(i, v) {
|
||||
$.each(val, function (i, v) {
|
||||
ret.push(parseInt(v, 10));
|
||||
});
|
||||
return ret;
|
||||
@ -285,13 +285,13 @@ function PMA_queryChart(data, columnNames, settings) {
|
||||
} else {
|
||||
dataTable.addColumn(ColumnType.STRING, columnNames[settings.mainAxis]);
|
||||
}
|
||||
$.each(settings.selectedSeries, function(index, element) {
|
||||
$.each(settings.selectedSeries, function (index, element) {
|
||||
dataTable.addColumn(ColumnType.NUMBER, columnNames[element]);
|
||||
});
|
||||
|
||||
// set data to the data table
|
||||
var columnsToExtract = [ settings.mainAxis ];
|
||||
$.each(settings.selectedSeries, function(index, element) {
|
||||
$.each(settings.selectedSeries, function (index, element) {
|
||||
columnsToExtract.push(element);
|
||||
});
|
||||
var values = [], newRow, row, col;
|
||||
|
||||
@ -30,7 +30,7 @@ function zoomAndPan()
|
||||
g.setAttribute('transform', 'translate(' + x + ', ' + y + ') scale(' + scale + ')');
|
||||
var id;
|
||||
var circle;
|
||||
$('circle.vector').each(function() {
|
||||
$('circle.vector').each(function () {
|
||||
id = $(this).attr('id');
|
||||
circle = svg.getElementById(id);
|
||||
svg.change(circle, {
|
||||
@ -40,7 +40,7 @@ function zoomAndPan()
|
||||
});
|
||||
|
||||
var line;
|
||||
$('polyline.vector').each(function() {
|
||||
$('polyline.vector').each(function () {
|
||||
id = $(this).attr('id');
|
||||
line = svg.getElementById(id);
|
||||
svg.change(line, {
|
||||
@ -49,7 +49,7 @@ function zoomAndPan()
|
||||
});
|
||||
|
||||
var polygon;
|
||||
$('path.vector').each(function() {
|
||||
$('path.vector').each(function () {
|
||||
id = $(this).attr('id');
|
||||
polygon = svg.getElementById(id);
|
||||
svg.change(polygon, {
|
||||
@ -90,7 +90,7 @@ function loadSVG() {
|
||||
var $placeholder = $('#placeholder');
|
||||
|
||||
$placeholder.svg({
|
||||
onLoad: function(svg_ref) {
|
||||
onLoad: function (svg_ref) {
|
||||
svg = svg_ref;
|
||||
}
|
||||
});
|
||||
@ -180,7 +180,7 @@ function getRelativeCoords(e) {
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('tbl_gis_visualization.js', function() {
|
||||
AJAX.registerTeardown('tbl_gis_visualization.js', function () {
|
||||
$('#choice').die('click');
|
||||
$('#placeholder').die('mousewheel');
|
||||
$('svg').die('dragstart');
|
||||
@ -197,14 +197,14 @@ AJAX.registerTeardown('tbl_gis_visualization.js', function() {
|
||||
$('.vector').unbind('mousemove').unbind('mouseout');
|
||||
});
|
||||
|
||||
AJAX.registerOnload('tbl_gis_visualization.js', function() {
|
||||
AJAX.registerOnload('tbl_gis_visualization.js', function () {
|
||||
|
||||
// If we are in GIS visualization, initialize it
|
||||
if ($('table.gis_table').length > 0) {
|
||||
initGISVisualization();
|
||||
}
|
||||
|
||||
$('#choice').live('click', function() {
|
||||
$('#choice').live('click', function () {
|
||||
if ($(this).prop('checked') === false) {
|
||||
$('#placeholder').show();
|
||||
$('#openlayersmap').hide();
|
||||
@ -214,7 +214,7 @@ AJAX.registerOnload('tbl_gis_visualization.js', function() {
|
||||
}
|
||||
});
|
||||
|
||||
$('#placeholder').live('mousewheel', function(event, delta) {
|
||||
$('#placeholder').live('mousewheel', function (event, delta) {
|
||||
var relCoords = getRelativeCoords(event);
|
||||
if (delta > 0) {
|
||||
//zoom in
|
||||
@ -234,18 +234,20 @@ AJAX.registerOnload('tbl_gis_visualization.js', function() {
|
||||
return true;
|
||||
});
|
||||
|
||||
var dragX = 0; var dragY = 0;
|
||||
$('svg').live('dragstart', function(event, dd) {
|
||||
var dragX = 0;
|
||||
var dragY = 0;
|
||||
|
||||
$('svg').live('dragstart', function (event, dd) {
|
||||
$('#placeholder').addClass('placeholderDrag');
|
||||
dragX = Math.round(dd.offsetX);
|
||||
dragY = Math.round(dd.offsetY);
|
||||
});
|
||||
|
||||
$('svg').live('mouseup', function(event) {
|
||||
$('svg').live('mouseup', function (event) {
|
||||
$('#placeholder').removeClass('placeholderDrag');
|
||||
});
|
||||
|
||||
$('svg').live('drag', function(event, dd) {
|
||||
$('svg').live('drag', function (event, dd) {
|
||||
newX = Math.round(dd.offsetX);
|
||||
x += newX - dragX;
|
||||
dragX = newX;
|
||||
@ -255,7 +257,7 @@ AJAX.registerOnload('tbl_gis_visualization.js', function() {
|
||||
zoomAndPan();
|
||||
});
|
||||
|
||||
$('#placeholder').live('dblclick', function(event) {
|
||||
$('#placeholder').live('dblclick', function (event) {
|
||||
scale *= zoomFactor;
|
||||
// zooming in keeping the position under mouse pointer unmoved.
|
||||
var relCoords = getRelativeCoords(event);
|
||||
@ -264,7 +266,7 @@ AJAX.registerOnload('tbl_gis_visualization.js', function() {
|
||||
zoomAndPan();
|
||||
});
|
||||
|
||||
$('#zoom_in').live('click', function(e) {
|
||||
$('#zoom_in').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
//zoom in
|
||||
scale *= zoomFactor;
|
||||
@ -277,7 +279,7 @@ AJAX.registerOnload('tbl_gis_visualization.js', function() {
|
||||
zoomAndPan();
|
||||
});
|
||||
|
||||
$('#zoom_world').live('click', function(e) {
|
||||
$('#zoom_world').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
scale = 1;
|
||||
x = defaultX;
|
||||
@ -285,7 +287,7 @@ AJAX.registerOnload('tbl_gis_visualization.js', function() {
|
||||
zoomAndPan();
|
||||
});
|
||||
|
||||
$('#zoom_out').live('click', function(e) {
|
||||
$('#zoom_out').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
//zoom out
|
||||
scale /= zoomFactor;
|
||||
@ -298,25 +300,25 @@ AJAX.registerOnload('tbl_gis_visualization.js', function() {
|
||||
zoomAndPan();
|
||||
});
|
||||
|
||||
$('#left_arrow').live('click', function(e) {
|
||||
$('#left_arrow').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
x += 100;
|
||||
zoomAndPan();
|
||||
});
|
||||
|
||||
$('#right_arrow').live('click', function(e) {
|
||||
$('#right_arrow').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
x -= 100;
|
||||
zoomAndPan();
|
||||
});
|
||||
|
||||
$('#up_arrow').live('click', function(e) {
|
||||
$('#up_arrow').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
y += 100;
|
||||
zoomAndPan();
|
||||
});
|
||||
|
||||
$('#down_arrow').live('click', function(e) {
|
||||
$('#down_arrow').live('click', function (e) {
|
||||
e.preventDefault();
|
||||
y -= 100;
|
||||
zoomAndPan();
|
||||
@ -325,7 +327,7 @@ AJAX.registerOnload('tbl_gis_visualization.js', function() {
|
||||
/**
|
||||
* Detect the mousemove event and show tooltips.
|
||||
*/
|
||||
$('.vector').bind('mousemove', function(event) {
|
||||
$('.vector').bind('mousemove', function (event) {
|
||||
var contents = $.trim(escapeHtml($(this).attr('name')));
|
||||
$("#tooltip").remove();
|
||||
if (contents !== '') {
|
||||
@ -344,7 +346,7 @@ AJAX.registerOnload('tbl_gis_visualization.js', function() {
|
||||
/**
|
||||
* Detect the mouseout event and hide tooltips.
|
||||
*/
|
||||
$('.vector').bind('mouseout', function(event) {
|
||||
$('.vector').bind('mouseout', function (event) {
|
||||
$("#tooltip").remove();
|
||||
});
|
||||
});
|
||||
|
||||
@ -18,17 +18,17 @@ function show_hide_clauses($thisDropdown)
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('tbl_relation.js', function() {
|
||||
AJAX.registerTeardown('tbl_relation.js', function () {
|
||||
$('select.referenced_column_dropdown').unbind('change');
|
||||
});
|
||||
|
||||
AJAX.registerOnload('tbl_relation.js', function() {
|
||||
AJAX.registerOnload('tbl_relation.js', function () {
|
||||
// initial display
|
||||
$('select.referenced_column_dropdown').each(function(index, one_dropdown) {
|
||||
$('select.referenced_column_dropdown').each(function (index, one_dropdown) {
|
||||
show_hide_clauses($(one_dropdown));
|
||||
});
|
||||
// change
|
||||
$('select.referenced_column_dropdown').change(function() {
|
||||
$('select.referenced_column_dropdown').change(function () {
|
||||
show_hide_clauses($(this));
|
||||
});
|
||||
});
|
||||
|
||||
@ -16,14 +16,14 @@
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('tbl_select.js', function() {
|
||||
AJAX.registerTeardown('tbl_select.js', function () {
|
||||
$('#togglesearchformlink').unbind('click');
|
||||
$("#tbl_search_form.ajax").die('submit');
|
||||
$('select.geom_func').unbind('change');
|
||||
$('span.open_search_gis_editor').die('click');
|
||||
});
|
||||
|
||||
AJAX.registerOnload('tbl_select.js', function() {
|
||||
AJAX.registerOnload('tbl_select.js', function () {
|
||||
/**
|
||||
* Prepare a div containing a link, otherwise it's incorrectly displayed
|
||||
* after a couple of clicks
|
||||
@ -35,7 +35,7 @@ AJAX.registerOnload('tbl_select.js', function() {
|
||||
|
||||
$('#togglesearchformlink')
|
||||
.html(PMA_messages['strShowSearchCriteria'])
|
||||
.bind('click', function() {
|
||||
.bind('click', function () {
|
||||
var $link = $(this);
|
||||
$('#tbl_search_form').slideToggle();
|
||||
if ($link.text() == PMA_messages['strHideSearchCriteria']) {
|
||||
@ -50,12 +50,13 @@ AJAX.registerOnload('tbl_select.js', function() {
|
||||
/**
|
||||
* Ajax event handler for Table Search
|
||||
*/
|
||||
$("#tbl_search_form.ajax").live('submit', function(event) {
|
||||
$("#tbl_search_form.ajax").live('submit', function (event) {
|
||||
var unaryFunctions = [
|
||||
'IS NULL',
|
||||
'IS NOT NULL',
|
||||
"= ''",
|
||||
"!= ''"];
|
||||
"!= ''"
|
||||
];
|
||||
|
||||
// jQuery object to reuse
|
||||
$search_form = $(this);
|
||||
@ -68,7 +69,7 @@ AJAX.registerOnload('tbl_select.js', function() {
|
||||
PMA_prepareForAjaxRequest($search_form);
|
||||
|
||||
var values = {};
|
||||
$search_form.find(':input').each(function() {
|
||||
$search_form.find(':input').each(function () {
|
||||
var $input = $(this);
|
||||
if ($input.attr('type') == 'checkbox' || $input.attr('type') == 'radio') {
|
||||
if ($input.is(':checked')) {
|
||||
@ -103,7 +104,7 @@ AJAX.registerOnload('tbl_select.js', function() {
|
||||
values['displayAllColumns'] = true;
|
||||
}
|
||||
|
||||
$.post($search_form.attr('action'), values, function(data) {
|
||||
$.post($search_form.attr('action'), values, function (data) {
|
||||
PMA_ajaxRemoveMessage($msgbox);
|
||||
if (data.success === true) {
|
||||
if (data.sql_query !== null) { // zero rows
|
||||
@ -123,7 +124,7 @@ AJAX.registerOnload('tbl_select.js', function() {
|
||||
// now it's time to show the div containing the link
|
||||
.show();
|
||||
// needed for the display options slider in the results
|
||||
PMA_init_slider();
|
||||
PMA_init_slider();
|
||||
} else {
|
||||
$("#sqlqueryresults").html(data.error);
|
||||
}
|
||||
@ -134,42 +135,42 @@ AJAX.registerOnload('tbl_select.js', function() {
|
||||
// Initialy hide all the open_gis_editor spans
|
||||
$('span.open_search_gis_editor').hide();
|
||||
|
||||
$('select.geom_func').bind('change', function() {
|
||||
$('select.geom_func').bind('change', function () {
|
||||
var $geomFuncSelector = $(this);
|
||||
|
||||
var binaryFunctions = [
|
||||
'Contains',
|
||||
'Crosses',
|
||||
'Disjoint',
|
||||
'Equals',
|
||||
'Intersects',
|
||||
'Overlaps',
|
||||
'Touches',
|
||||
'Within',
|
||||
'MBRContains',
|
||||
'MBRDisjoint',
|
||||
'MBREquals',
|
||||
'MBRIntersects',
|
||||
'MBROverlaps',
|
||||
'MBRTouches',
|
||||
'MBRWithin',
|
||||
'ST_Contains',
|
||||
'ST_Crosses',
|
||||
'ST_Disjoint',
|
||||
'ST_Equals',
|
||||
'ST_Intersects',
|
||||
'ST_Overlaps',
|
||||
'ST_Touches',
|
||||
'ST_Within'
|
||||
'Contains',
|
||||
'Crosses',
|
||||
'Disjoint',
|
||||
'Equals',
|
||||
'Intersects',
|
||||
'Overlaps',
|
||||
'Touches',
|
||||
'Within',
|
||||
'MBRContains',
|
||||
'MBRDisjoint',
|
||||
'MBREquals',
|
||||
'MBRIntersects',
|
||||
'MBROverlaps',
|
||||
'MBRTouches',
|
||||
'MBRWithin',
|
||||
'ST_Contains',
|
||||
'ST_Crosses',
|
||||
'ST_Disjoint',
|
||||
'ST_Equals',
|
||||
'ST_Intersects',
|
||||
'ST_Overlaps',
|
||||
'ST_Touches',
|
||||
'ST_Within'
|
||||
];
|
||||
|
||||
var tempArray = [
|
||||
'Envelope',
|
||||
'EndPoint',
|
||||
'StartPoint',
|
||||
'ExteriorRing',
|
||||
'Centroid',
|
||||
'PointOnSurface'
|
||||
'Envelope',
|
||||
'EndPoint',
|
||||
'StartPoint',
|
||||
'ExteriorRing',
|
||||
'Centroid',
|
||||
'PointOnSurface'
|
||||
];
|
||||
var outputGeomFunctions = binaryFunctions.concat(tempArray);
|
||||
|
||||
@ -191,7 +192,7 @@ AJAX.registerOnload('tbl_select.js', function() {
|
||||
|
||||
});
|
||||
|
||||
$('span.open_search_gis_editor').live('click', function(event) {
|
||||
$('span.open_search_gis_editor').live('click', function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
var $span = $(this);
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('tbl_structure.js', function() {
|
||||
AJAX.registerTeardown('tbl_structure.js', function () {
|
||||
$("a.change_column_anchor.ajax").die('click');
|
||||
$("button.change_columns_anchor.ajax, input.change_columns_anchor.ajax").die('click');
|
||||
$("a.drop_column_anchor.ajax").die('click');
|
||||
@ -30,12 +30,12 @@ AJAX.registerTeardown('tbl_structure.js', function() {
|
||||
$(".append_fields_form.ajax").unbind('submit');
|
||||
});
|
||||
|
||||
AJAX.registerOnload('tbl_structure.js', function() {
|
||||
AJAX.registerOnload('tbl_structure.js', function () {
|
||||
|
||||
/**
|
||||
*Ajax action for submitting the "Column Change" and "Add Column" form
|
||||
*/
|
||||
$(".append_fields_form.ajax").bind('submit', function(event) {
|
||||
$(".append_fields_form.ajax").bind('submit', function (event) {
|
||||
event.preventDefault();
|
||||
/**
|
||||
* @var the_form object referring to the export form
|
||||
@ -54,7 +54,7 @@ AJAX.registerOnload('tbl_structure.js', function() {
|
||||
PMA_prepareForAjaxRequest($form);
|
||||
//User wants to submit the form
|
||||
PMA_ajaxShowMessage();
|
||||
$.post($form.attr('action'), $form.serialize() + '&do_save_data=1', function(data) {
|
||||
$.post($form.attr('action'), $form.serialize() + '&do_save_data=1', function (data) {
|
||||
if ($("#sqlqueryresults").length !== 0) {
|
||||
$("#sqlqueryresults").remove();
|
||||
} else if ($(".error").length !== 0) {
|
||||
@ -82,10 +82,10 @@ AJAX.registerOnload('tbl_structure.js', function() {
|
||||
/**
|
||||
* Attach Event Handler for 'Change Column'
|
||||
*/
|
||||
$("a.change_column_anchor.ajax").live('click', function(event) {
|
||||
$("a.change_column_anchor.ajax").live('click', function (event) {
|
||||
event.preventDefault();
|
||||
$('#page_content').hide();
|
||||
$.get($(this).attr('href'), {'ajax_request': true}, function(data) {
|
||||
$.get($(this).attr('href'), {'ajax_request': true}, function (data) {
|
||||
if (data.success) {
|
||||
$('<div id="change_column_dialog"></div>')
|
||||
.html(data.message)
|
||||
@ -100,7 +100,7 @@ AJAX.registerOnload('tbl_structure.js', function() {
|
||||
/**
|
||||
* Attach Event Handler for 'Change multiple columns'
|
||||
*/
|
||||
$("button.change_columns_anchor.ajax, input.change_columns_anchor.ajax").live('click', function(event) {
|
||||
$("button.change_columns_anchor.ajax, input.change_columns_anchor.ajax").live('click', function (event) {
|
||||
event.preventDefault();
|
||||
$('#page_content').hide();
|
||||
var $form = $(this).closest('form');
|
||||
@ -120,7 +120,7 @@ AJAX.registerOnload('tbl_structure.js', function() {
|
||||
/**
|
||||
* Attach Event Handler for 'Drop Column'
|
||||
*/
|
||||
$("a.drop_column_anchor.ajax").live('click', function(event) {
|
||||
$("a.drop_column_anchor.ajax").live('click', function (event) {
|
||||
event.preventDefault();
|
||||
/**
|
||||
* @var curr_table_name String containing the name of the current table
|
||||
@ -142,9 +142,9 @@ AJAX.registerOnload('tbl_structure.js', function() {
|
||||
* @var question String containing the question to be asked for confirmation
|
||||
*/
|
||||
var question = $.sprintf(PMA_messages['strDoYouReally'], 'ALTER TABLE `' + escapeHtml(curr_table_name) + '` DROP `' + escapeHtml(curr_column_name) + '`;');
|
||||
$(this).PMA_confirm(question, $(this).attr('href'), function(url) {
|
||||
$(this).PMA_confirm(question, $(this).attr('href'), function (url) {
|
||||
var $msg = PMA_ajaxShowMessage(PMA_messages['strDroppingColumn'], false);
|
||||
$.get(url, {'is_js_confirmed' : 1, 'ajax_request' : true}, function(data) {
|
||||
$.get(url, {'is_js_confirmed' : 1, 'ajax_request' : true}, function (data) {
|
||||
if (data.success === true) {
|
||||
PMA_ajaxRemoveMessage($msg);
|
||||
if ($('#result_query').length) {
|
||||
@ -176,7 +176,7 @@ AJAX.registerOnload('tbl_structure.js', function() {
|
||||
/**
|
||||
* Ajax Event handler for 'Add Primary Key'
|
||||
*/
|
||||
$("a.add_primary_key_anchor.ajax").live('click', function(event) {
|
||||
$("a.add_primary_key_anchor.ajax").live('click', function (event) {
|
||||
event.preventDefault();
|
||||
/**
|
||||
* @var curr_table_name String containing the name of the current table
|
||||
@ -190,9 +190,9 @@ AJAX.registerOnload('tbl_structure.js', function() {
|
||||
* @var question String containing the question to be asked for confirmation
|
||||
*/
|
||||
var question = $.sprintf(PMA_messages['strDoYouReally'], 'ALTER TABLE `' + escapeHtml(curr_table_name) + '` ADD PRIMARY KEY(`' + escapeHtml(curr_column_name) + '`);');
|
||||
$(this).PMA_confirm(question, $(this).attr('href'), function(url) {
|
||||
$(this).PMA_confirm(question, $(this).attr('href'), function (url) {
|
||||
var $msg = PMA_ajaxShowMessage(PMA_messages['strAddingPrimaryKey'], false);
|
||||
$.get(url, {'is_js_confirmed' : 1, 'ajax_request' : true}, function(data) {
|
||||
$.get(url, {'is_js_confirmed' : 1, 'ajax_request' : true}, function (data) {
|
||||
if (data.success === true) {
|
||||
PMA_ajaxRemoveMessage($msg);
|
||||
$(this).remove();
|
||||
@ -219,7 +219,7 @@ AJAX.registerOnload('tbl_structure.js', function() {
|
||||
/**
|
||||
* Inline move columns
|
||||
**/
|
||||
$("#move_columns_anchor").live('click', function(e) {
|
||||
$("#move_columns_anchor").live('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
if ($(this).hasClass("move-active")) {
|
||||
@ -232,7 +232,7 @@ AJAX.registerOnload('tbl_structure.js', function() {
|
||||
*/
|
||||
var button_options = {};
|
||||
|
||||
button_options[PMA_messages['strGo']] = function(event) {
|
||||
button_options[PMA_messages['strGo']] = function (event) {
|
||||
event.preventDefault();
|
||||
var $msgbox = PMA_ajaxShowMessage();
|
||||
var $this = $(this);
|
||||
@ -290,12 +290,12 @@ AJAX.registerOnload('tbl_structure.js', function() {
|
||||
}
|
||||
});
|
||||
};
|
||||
button_options[PMA_messages['strCancel']] = function() {
|
||||
button_options[PMA_messages['strCancel']] = function () {
|
||||
$(this).dialog('close');
|
||||
};
|
||||
|
||||
var button_options_error = {};
|
||||
button_options_error[PMA_messages['strOK']] = function() {
|
||||
button_options_error[PMA_messages['strOK']] = function () {
|
||||
$(this).dialog('close').remove();
|
||||
};
|
||||
|
||||
@ -341,7 +341,7 @@ AJAX.registerOnload('tbl_structure.js', function() {
|
||||
* Reload fields table
|
||||
*/
|
||||
function reloadFieldForm(message) {
|
||||
$.post($("#fieldsForm").attr('action'), $("#fieldsForm").serialize()+"&ajax_request=true", function(form_data) {
|
||||
$.post($("#fieldsForm").attr('action'), $("#fieldsForm").serialize()+"&ajax_request=true", function (form_data) {
|
||||
var $temp_div = $("<div id='temp_div'><div>").append(form_data.message);
|
||||
$("#fieldsForm").replaceWith($temp_div.find("#fieldsForm"));
|
||||
$("#addColumns").replaceWith($temp_div.find("#addColumns"));
|
||||
@ -349,7 +349,7 @@ function reloadFieldForm(message) {
|
||||
$("#moveColumns").removeClass("move-active");
|
||||
/* reinitialise the more options in table */
|
||||
$('#fieldsForm ul.table-structure-actions').menuResizer(PMA_tbl_structure_menu_resizer_callback);
|
||||
setTimeout(function() {
|
||||
setTimeout(function () {
|
||||
PMA_ajaxShowMessage(message);
|
||||
}, 500);
|
||||
});
|
||||
@ -389,12 +389,12 @@ function PMA_tbl_structure_menu_resizer_callback() {
|
||||
}
|
||||
|
||||
/** Handler for "More" dropdown in structure table rows */
|
||||
AJAX.registerOnload('tbl_structure.js', function() {
|
||||
AJAX.registerOnload('tbl_structure.js', function () {
|
||||
if ($('#fieldsForm').hasClass('HideStructureActions')) {
|
||||
$('#fieldsForm ul.table-structure-actions').menuResizer(PMA_tbl_structure_menu_resizer_callback);
|
||||
}
|
||||
});
|
||||
AJAX.registerTeardown('tbl_structure.js', function() {
|
||||
AJAX.registerTeardown('tbl_structure.js', function () {
|
||||
$('#fieldsForm ul.table-structure-actions').menuResizer('destroy');
|
||||
});
|
||||
$(function () {
|
||||
|
||||
@ -90,7 +90,7 @@ function getCord(arr) {
|
||||
var newCord = [];
|
||||
var original = $.extend(true, [], arr);
|
||||
var arr = jQuery.unique(arr).sort();
|
||||
$.each(original, function(index, value) {
|
||||
$.each(original, function (index, value) {
|
||||
newCord.push(jQuery.inArray(value, arr));
|
||||
});
|
||||
return [newCord, arr, original];
|
||||
@ -100,14 +100,14 @@ function getCord(arr) {
|
||||
** Scrolls the view to the display section
|
||||
**/
|
||||
function scrollToChart() {
|
||||
var x = $('#dataDisplay').offset().top - 100; // 100 provides buffer in viewport
|
||||
$('html,body').animate({scrollTop: x}, 500);
|
||||
var x = $('#dataDisplay').offset().top - 100; // 100 provides buffer in viewport
|
||||
$('html,body').animate({scrollTop: x}, 500);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unbind all event handlers before tearing down a page
|
||||
*/
|
||||
AJAX.registerTeardown('tbl_zoom_plot_jqplot.js', function() {
|
||||
AJAX.registerTeardown('tbl_zoom_plot_jqplot.js', function () {
|
||||
$('#tableid_0').unbind('change');
|
||||
$('#tableid_1').unbind('change');
|
||||
$('#tableid_2').unbind('change');
|
||||
@ -120,7 +120,7 @@ AJAX.registerTeardown('tbl_zoom_plot_jqplot.js', function() {
|
||||
$('div#querychart').unbind('jqplotDataClick');
|
||||
});
|
||||
|
||||
AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function() {
|
||||
AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function () {
|
||||
var cursorMode = ($("input[name='mode']:checked").val() == 'edit') ? 'crosshair' : 'pointer';
|
||||
var currentChart = null;
|
||||
var searchedDataKey = null;
|
||||
@ -143,7 +143,7 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function() {
|
||||
**/
|
||||
|
||||
// first column choice corresponds to the X axis
|
||||
$('#tableid_0').change(function() {
|
||||
$('#tableid_0').change(function () {
|
||||
//AJAX request for field type, collation, operators, and value field
|
||||
$.post('tbl_zoom_select.php',{
|
||||
'ajax_request' : true,
|
||||
@ -153,23 +153,23 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function() {
|
||||
'field' : $('#tableid_0').val(),
|
||||
'it' : 0,
|
||||
'token' : PMA_commonParams.get('token')
|
||||
},function(data) {
|
||||
},function (data) {
|
||||
$('#tableFieldsId tr:eq(1) td:eq(0)').html(data.field_type);
|
||||
$('#tableFieldsId tr:eq(1) td:eq(1)').html(data.field_collation);
|
||||
$('#tableFieldsId tr:eq(1) td:eq(2)').html(data.field_operators);
|
||||
$('#tableFieldsId tr:eq(1) td:eq(3)').html(data.field_value);
|
||||
xLabel = $('#tableid_0').val();
|
||||
$('#types_0').val(data.field_type);
|
||||
xType = data.field_type;
|
||||
$('#collations_0').val(data.field_collations);
|
||||
addDateTimePicker();
|
||||
xLabel = $('#tableid_0').val();
|
||||
$('#types_0').val(data.field_type);
|
||||
xType = data.field_type;
|
||||
$('#collations_0').val(data.field_collations);
|
||||
addDateTimePicker();
|
||||
});
|
||||
});
|
||||
|
||||
// second column choice corresponds to the Y axis
|
||||
$('#tableid_1').change(function() {
|
||||
$('#tableid_1').change(function () {
|
||||
//AJAX request for field type, collation, operators, and value field
|
||||
$.post('tbl_zoom_select.php',{
|
||||
$.post('tbl_zoom_select.php',{
|
||||
'ajax_request' : true,
|
||||
'change_tbl_info' : true,
|
||||
'db' : PMA_commonParams.get('db'),
|
||||
@ -177,22 +177,22 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function() {
|
||||
'field' : $('#tableid_1').val(),
|
||||
'it' : 1,
|
||||
'token' : PMA_commonParams.get('token')
|
||||
},function(data) {
|
||||
},function (data) {
|
||||
$('#tableFieldsId tr:eq(3) td:eq(0)').html(data.field_type);
|
||||
$('#tableFieldsId tr:eq(3) td:eq(1)').html(data.field_collation);
|
||||
$('#tableFieldsId tr:eq(3) td:eq(2)').html(data.field_operators);
|
||||
$('#tableFieldsId tr:eq(3) td:eq(3)').html(data.field_value);
|
||||
yLabel = $('#tableid_1').val();
|
||||
$('#types_1').val(data.field_type);
|
||||
yType = data.field_type;
|
||||
$('#collations_1').val(data.field_collations);
|
||||
addDateTimePicker();
|
||||
yLabel = $('#tableid_1').val();
|
||||
$('#types_1').val(data.field_type);
|
||||
yType = data.field_type;
|
||||
$('#collations_1').val(data.field_collations);
|
||||
addDateTimePicker();
|
||||
});
|
||||
});
|
||||
|
||||
$('#tableid_2').change(function() {
|
||||
$('#tableid_2').change(function () {
|
||||
//AJAX request for field type, collation, operators, and value field
|
||||
$.post('tbl_zoom_select.php',{
|
||||
$.post('tbl_zoom_select.php',{
|
||||
'ajax_request' : true,
|
||||
'change_tbl_info' : true,
|
||||
'db' : PMA_commonParams.get('db'),
|
||||
@ -200,20 +200,20 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function() {
|
||||
'field' : $('#tableid_2').val(),
|
||||
'it' : 2,
|
||||
'token' : PMA_commonParams.get('token')
|
||||
},function(data) {
|
||||
},function (data) {
|
||||
$('#tableFieldsId tr:eq(6) td:eq(0)').html(data.field_type);
|
||||
$('#tableFieldsId tr:eq(6) td:eq(1)').html(data.field_collation);
|
||||
$('#tableFieldsId tr:eq(6) td:eq(2)').html(data.field_operators);
|
||||
$('#tableFieldsId tr:eq(6) td:eq(3)').html(data.field_value);
|
||||
$('#types_2').val(data.field_type);
|
||||
$('#collations_2').val(data.field_collations);
|
||||
addDateTimePicker();
|
||||
$('#types_2').val(data.field_type);
|
||||
$('#collations_2').val(data.field_collations);
|
||||
addDateTimePicker();
|
||||
});
|
||||
});
|
||||
|
||||
$('#tableid_3').change(function() {
|
||||
$('#tableid_3').change(function () {
|
||||
//AJAX request for field type, collation, operators, and value field
|
||||
$.post('tbl_zoom_select.php',{
|
||||
$.post('tbl_zoom_select.php',{
|
||||
'ajax_request' : true,
|
||||
'change_tbl_info' : true,
|
||||
'db' : PMA_commonParams.get('db'),
|
||||
@ -221,21 +221,21 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function() {
|
||||
'field' : $('#tableid_3').val(),
|
||||
'it' : 3,
|
||||
'token' : PMA_commonParams.get('token')
|
||||
},function(data) {
|
||||
},function (data) {
|
||||
$('#tableFieldsId tr:eq(8) td:eq(0)').html(data.field_type);
|
||||
$('#tableFieldsId tr:eq(8) td:eq(1)').html(data.field_collation);
|
||||
$('#tableFieldsId tr:eq(8) td:eq(2)').html(data.field_operators);
|
||||
$('#tableFieldsId tr:eq(8) td:eq(3)').html(data.field_value);
|
||||
$('#types_3').val(data.field_type);
|
||||
$('#collations_3').val(data.field_collations);
|
||||
addDateTimePicker();
|
||||
$('#types_3').val(data.field_type);
|
||||
$('#collations_3').val(data.field_collations);
|
||||
addDateTimePicker();
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Input form validation
|
||||
**/
|
||||
$('#inputFormSubmitId').click(function() {
|
||||
$('#inputFormSubmitId').click(function () {
|
||||
if ($('#tableid_0').get(0).selectedIndex === 0 || $('#tableid_1').get(0).selectedIndex === 0) {
|
||||
PMA_ajaxShowMessage(PMA_messages['strInputNull']);
|
||||
} else if (xLabel == yLabel) {
|
||||
@ -254,7 +254,7 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function() {
|
||||
|
||||
$('#togglesearchformlink')
|
||||
.html(PMA_messages['strShowSearchCriteria'])
|
||||
.bind('click', function() {
|
||||
.bind('click', function () {
|
||||
var $link = $(this);
|
||||
$('#zoom_search_form').slideToggle();
|
||||
if ($link.text() == PMA_messages['strHideSearchCriteria']) {
|
||||
@ -262,9 +262,9 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function() {
|
||||
} else {
|
||||
$link.text(PMA_messages['strHideSearchCriteria']);
|
||||
}
|
||||
// avoid default click action
|
||||
return false;
|
||||
});
|
||||
// avoid default click action
|
||||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
** Set dialog properties for the data display form
|
||||
@ -285,7 +285,7 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function() {
|
||||
var oldVal = selectedRow[key];
|
||||
var newVal = ($('#edit_fields_null_id_' + it).prop('checked')) ? null : $('#edit_fieldID_' + it).val();
|
||||
if (newVal instanceof Array) { // when the column is of type SET
|
||||
newVal = $('#edit_fieldID_' + it).map(function(){
|
||||
newVal = $('#edit_fieldID_' + it).map(function (){
|
||||
return $(this).val();
|
||||
}).get().join(",");
|
||||
}
|
||||
@ -386,14 +386,14 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function() {
|
||||
'ajax_request' : true,
|
||||
'sql_query' : sql_query,
|
||||
'inline_edit' : false
|
||||
}, function(data) {
|
||||
}, function (data) {
|
||||
if (data.success === true) {
|
||||
$('#sqlqueryresults').html(data.sql_query);
|
||||
$("#sqlqueryresults").trigger('appendAnchor');
|
||||
} else {
|
||||
PMA_ajaxShowMessage(data.error, false);
|
||||
}
|
||||
}); //End $.post
|
||||
}); //End $.post
|
||||
}//End database update
|
||||
$("#dataDisplay").dialog('close');
|
||||
};
|
||||
@ -527,7 +527,7 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function() {
|
||||
});
|
||||
}
|
||||
|
||||
$.each(searchedData, function(key, value) {
|
||||
$.each(searchedData, function (key, value) {
|
||||
if (xType == 'numeric') {
|
||||
var xVal = parseFloat(value[xLabel]);
|
||||
}
|
||||
@ -557,13 +557,13 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function() {
|
||||
currentChart = $.jqplot('querychart', series, options);
|
||||
currentChart.resetZoom();
|
||||
|
||||
$('button.button-reset').click(function(event) {
|
||||
$('button.button-reset').click(function (event) {
|
||||
event.preventDefault();
|
||||
currentChart.resetZoom();
|
||||
});
|
||||
|
||||
$('div#resizer').resizable();
|
||||
$('div#resizer').bind('resizestop', function(event, ui) {
|
||||
$('div#resizer').bind('resizestop', function (event, ui) {
|
||||
// make room so that the handle will still appear
|
||||
$('div#querychart').height($('div#resizer').height() * 0.96);
|
||||
$('div#querychart').width($('div#resizer').width() * 0.96);
|
||||
@ -571,7 +571,7 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function() {
|
||||
});
|
||||
|
||||
$('div#querychart').bind('jqplotDataClick',
|
||||
function(event, seriesIndex, pointIndex, data) {
|
||||
function (event, seriesIndex, pointIndex, data) {
|
||||
searchedDataKey = data[4]; // key from searchedData (global)
|
||||
var field_id = 0;
|
||||
var post_params = {
|
||||
@ -583,7 +583,7 @@ AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function() {
|
||||
'token' : PMA_commonParams.get('token')
|
||||
};
|
||||
|
||||
$.post('tbl_zoom_select.php', post_params, function(data) {
|
||||
$.post('tbl_zoom_select.php', post_params, function (data) {
|
||||
// Row is contained in data.row_info,
|
||||
// now fill the displayResultForm with row values
|
||||
var key;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user