The branch, master has been updated via f79a619326dea60ffd8bab3a3b22791143c65df9 (commit) via 14cacc70acc6582244a7e08203999adb6497f445 (commit) via efc9f6ddc40d8b4bc41aae1b66c14aa62040c736 (commit) from a10e1e070f6aa8300cc98bdda71bcdaa518c44af (commit)
- Log ----------------------------------------------------------------- commit f79a619326dea60ffd8bab3a3b22791143c65df9 Merge: a10e1e070f6aa8300cc98bdda71bcdaa518c44af 14cacc70acc6582244a7e08203999adb6497f445 Author: Michal Čihař mcihar@suse.cz Date: Wed Jun 15 15:46:11 2011 +0200
Merge remote-tracking branch 'tyron/master'
Conflicts: server_status.php
commit 14cacc70acc6582244a7e08203999adb6497f445 Author: Tyron Madlener tyronx@gmail.com Date: Wed Jun 15 14:37:08 2011 +0200
Send correct charset header with ajax responses
commit efc9f6ddc40d8b4bc41aae1b66c14aa62040c736 Author: Tyron Madlener tyronx@gmail.com Date: Wed Jun 15 13:17:19 2011 +0200
Chart export now works with IE8
-----------------------------------------------------------------------
Summary of changes: js/highcharts/exporting.js | 17 +++++++++++------ server_status.php | 12 +++++++----- 2 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/js/highcharts/exporting.js b/js/highcharts/exporting.js index 036c6ae..171ea50 100644 --- a/js/highcharts/exporting.js +++ b/js/highcharts/exporting.js @@ -308,12 +308,9 @@ extend(Chart.prototype, { chart = this, canvas=createElement('canvas');
- if (typeof FlashCanvas != "undefined") { - FlashCanvas.initElement(canvas); - } - $('body').append(canvas); - $(canvas).hide(); + $(canvas).css('position','absolute'); + $(canvas).css('left','-10000px');
var submitData = function(chartData) { // merge the options @@ -352,11 +349,19 @@ extend(Chart.prototype, { if(options && options.type=='image/svg+xml') { submitData(chart.getSVG(chartOptions)); } else { + if (typeof FlashCanvas != "undefined") { + FlashCanvas.initElement(canvas); + } + // Generate data uri and submit once done canvg(canvas, chart.getSVG(chartOptions),{ ignoreAnimation:true, ignoreMouse:true, - renderCallback:function() { submitData(canvas.toDataURL()); } + renderCallback:function() { + // IE8 fix: flashcanvas doesn't update the canvas immediately, thus requiring setTimeout. + // See also http://groups.google.com/group/flashcanvas/browse_thread/thread/e36ff7a03e1b... + setTimeout(function() { submitData(canvas.toDataURL()); }, 100); + } }); } }, diff --git a/server_status.php b/server_status.php index c56eb70..7db187b 100644 --- a/server_status.php +++ b/server_status.php @@ -21,11 +21,13 @@ require_once './libraries/common.inc.php'; * Ajax request */
-// Prevent ajax requests from being cached if (isset($_REQUEST['ajax_request'])) { - header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 - header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past + // Prevent ajax requests from being cached + header('Cache-Control: no-cache, must-revalidate'); // HTTP/1.1 + header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past header_remove('Last-Modified'); + // Send correct charset + header('Content-Type: text/javascript; charset=UTF-8');
if (isset($_REQUEST["query_chart"])) { exit(createQueryChart()); @@ -50,10 +52,10 @@ if (isset($_REQUEST['ajax_request'])) { exit(json_encode($ret)); case 'traffic': $traffic = PMA_DBI_fetch_result('SHOW GLOBAL STATUS WHERE Variable_name="Bytes_received" OR Variable_name="Bytes_sent"', 0, 1); - + $ret = Array('x'=>(microtime(true)*1000),'y_sent'=>$traffic['Bytes_sent'],'y_received'=>$traffic['Bytes_received']); exit(json_encode($ret)); - + } } }
hooks/post-receive