From 70e52953c169ead6854c281c871902fca5d36513 Mon Sep 17 00:00:00 2001 From: Tyron Madlener Date: Mon, 20 Jun 2011 21:31:50 +0200 Subject: [PATCH 01/50] - Awesome: Set the graph background to transparent - now you can embedd you exported graphs everywhere \o/ - Some better formatting for tbl_chart.js --- js/functions.js | 1 + js/tbl_chart.js | 86 ++++++++++++++++++++++++++----------------------- 2 files changed, 46 insertions(+), 41 deletions(-) diff --git a/js/functions.js b/js/functions.js index 095f3a4ef2..9f56168d0c 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1407,6 +1407,7 @@ function PMA_createChart(passedSettings) { chart: { type: 'spline', marginRight: 10, + backgroundColor: 'transparent', events: { load: function() { var thisChart = this; diff --git a/js/tbl_chart.js b/js/tbl_chart.js index 7c870d0a24..3c406d9342 100644 --- a/js/tbl_chart.js +++ b/js/tbl_chart.js @@ -3,7 +3,7 @@ var chart_series; var chart_series_index = -1; $(document).ready(function() { - var currentChart=null; + var currentChart = null; var chart_data = jQuery.parseJSON($('#querychart').html()); chart_series = 'columns'; chart_xaxis_idx = $('select[name="chartXAxis"]').attr('value'); @@ -26,9 +26,9 @@ $(document).ready(function() { var currentSettings = { chart: { - type:'line', - width:$('#resizer').width()-20, - height:$('#resizer').height()-20 + type: 'line', + width: $('#resizer').width() - 20, + height: $('#resizer').height() - 20 }, xAxis: { title: { text: $('input[name="xaxis_label"]').attr('value') } @@ -36,7 +36,10 @@ $(document).ready(function() { yAxis: { title: { text: $('input[name="yaxis_label"]').attr('value') } }, - title: { text: $('input[name="chartTitle"]').attr('value'), margin:20 }, + title: { + text: $('input[name="chartTitle"]').attr('value'), + margin:20 + }, plotOptions: { series: {} } @@ -45,11 +48,11 @@ $(document).ready(function() { $('#querychart').html(''); $('input[name="chartType"]').click(function() { - currentSettings.chart.type=$(this).attr('value'); + currentSettings.chart.type = $(this).attr('value'); drawChart(); - if($(this).attr('value')=='bar' || $(this).attr('value')=='column') + if($(this).attr('value') == 'bar' || $(this).attr('value') == 'column') $('span.barStacked').show(); else $('span.barStacked').hide(); @@ -64,9 +67,9 @@ $(document).ready(function() { }); $('input[name="chartTitle"]').keyup(function() { - var title=$(this).attr('value'); - if(title.length==0) title=' '; - currentChart.setTitle({text: title}); + var title = $(this).attr('value'); + if(title.length == 0) title = ' '; + currentChart.setTitle({ text: title }); }); $('select[name="chartXAxis"]').change(function() { @@ -90,10 +93,10 @@ $(document).ready(function() { }); function drawChart(noAnimation) { - currentSettings.chart.width=$('#resizer').width()-20; - currentSettings.chart.height=$('#resizer').height()-20; + currentSettings.chart.width = $('#resizer').width() - 20; + currentSettings.chart.height = $('#resizer').height() - 20; - if(currentChart!=null) currentChart.destroy(); + if(currentChart != null) currentChart.destroy(); if(noAnimation) currentSettings.plotOptions.series.animation = false; currentChart = PMA_queryChart(chart_data,currentSettings); @@ -101,22 +104,22 @@ $(document).ready(function() { } drawChart(); - $('#querychart').show(); + $('#querychart').show(); }); function in_array(element,array) { - for(var i=0; i'+this.series.name+'
'+this.point.name+'
'+this.y; @@ -226,11 +230,11 @@ function PMA_queryChart(data,passedSettings) { } }; - if(passedSettings.chart.type=='pie') + if(passedSettings.chart.type == 'pie') settings.tooltip.formatter = function() { return ''+columnNames[0]+'
'+this.y; } // Overwrite/Merge default settings with passedsettings $.extend(true,settings,passedSettings); - return new Highcharts.Chart(settings); + return PMA_createChart(settings); } From 3e4744df45757e25dc4c0de191cf9d9f638aeb6a Mon Sep 17 00:00:00 2001 From: Tyron Madlener Date: Tue, 21 Jun 2011 15:05:21 +0200 Subject: [PATCH 02/50] - Removes horizontal row hover js code, as this is already working with the CSS :hover alone - Working checkbox selection for vertical display mode --- js/functions.js | 46 ++++++++++++++++++++++++++--------- libraries/display_tbl.lib.php | 2 +- 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/js/functions.js b/js/functions.js index 9f56168d0c..9163d1bba3 100644 --- a/js/functions.js +++ b/js/functions.js @@ -640,7 +640,7 @@ $(document).ready(function() { $tr.removeClass('marked'); } } else { - // normaln data table, just toggle class + // normal data table, just toggle class $tr.toggleClass('marked'); } }); @@ -657,13 +657,13 @@ $(document).ready(function() { * Row highlighting in horizontal mode (use "live" * so that it works also for pages reached via AJAX) */ -$(document).ready(function() { +/*$(document).ready(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'); }); -}) +})*/ /** * This array is used to remember mark status of rows in browse mode @@ -1499,7 +1499,7 @@ function PMA_createChart(passedSettings) { passedSettings.realtime.numMaxPoints = 30; settings.xAxis.min = new Date().getTime() - passedSettings.realtime.numMaxPoints * passedSettings.realtime.refreshRate; - settings.xAxis.max = new Date().getTime() + passedSettings.realtime.refreshRate / 4; + settings.xAxis.max = new Date().getTime(); } // Overwrite/Merge default settings with passedsettings @@ -2367,10 +2367,10 @@ $(document).ready(function() { $('.vpointer').live('hover', //handlerInOut 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 - $('.vpointer').filter('.row_' + row_num).toggleClass('hover'); + var $this_td = $(this); + var row_num = PMA_getRowNumber($this_td.attr('class')); + // for all td of the same vertical row, toggle hover + $('.vpointer').filter('.row_' + row_num).toggleClass('hover'); } ); }) // end of $(document).ready() for vertical pointer @@ -2380,11 +2380,35 @@ $(document).ready(function() { * Vertical marker */ $('.vmarker').live('click', function(e) { + // do not trigger when clicked on anchor + if ($(e.target).is('a, img, a *')) { + return; + } + var $this_td = $(this); var row_num = PMA_getRowNumber($this_td.attr('class')); - // for all td of the same vertical row, toggle the marked class - $('.vmarker').filter('.row_' + row_num).toggleClass('marked'); - }); + + // XXX: FF fires two click events for