Skip to content

Commit

Permalink
Update jsrrd for IE11 and add dyn input refresh on zoom
Browse files Browse the repository at this point in the history
  • Loading branch information
Poil committed May 5, 2014
1 parent c57bfd3 commit 1435306
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
4 changes: 4 additions & 0 deletions lib/javascriptrrd/CGP.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ var mouse_move = function (e) {
this.rrdgraph.end += difffactor;
this.rrdgraph.start += difffactor;
}
$('#f_time_start').val(dateFormat(this.rrdgraph.start*1000,"yyyy-mm-dd HH:MM"));
$('#f_time_end').val(dateFormat(this.rrdgraph.end*1000,"yyyy-mm-dd HH:MM"));
this.rrdgraph.mousex = x;
try {
this.rrdgraph.graph_paint();
Expand Down Expand Up @@ -45,6 +47,8 @@ var mouse_scroll = function (e) {
this.rrdgraph.start = Math.round(middle - this.stime[this.stidx]/2);
this.rrdgraph.end = this.rrdgraph.start + this.stime[this.stidx];

$('#f_time_start').val(dateFormat(this.rrdgraph.start*1000,"yyyy-mm-dd HH:MM"));
$('#f_time_end').val(dateFormat(this.rrdgraph.end*1000,"yyyy-mm-dd HH:MM"));
try {
this.rrdgraph.graph_paint();
} catch (e) {
Expand Down
26 changes: 20 additions & 6 deletions lib/javascriptrrd/binaryXHR.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,17 @@ function FetchBinaryURL(url) {
}
request.send(null);

var response=request.responseBody;
if (response==undefined){ // responseBody is non standard, but the only way to make it work in IE
response=request.responseText;
var response=this.responseText;
try {
// for older IE versions, the value in responseText is not usable
if (IEBinary_getLength(this.responseBody)>0) {
// will get here only for older verson of IE
response=this.responseBody;
}
} catch (err) {
// not IE, do nothing
}

var bf=new BinaryFile(response);
return bf;
}
Expand All @@ -217,10 +224,17 @@ function FetchBinaryURL(url) {
function FetchBinaryURLAsync(url, callback, callback_arg) {
var callback_wrapper = function() {
if(this.readyState == 4) {
var response=this.responseBody;
if (response==undefined){ // responseBody is non standard, but the only way to make it work in IE
response=this.responseText;
var response=this.responseText;
try {
// for older IE versions, the value in responseText is not usable
if (IEBinary_getLength(this.responseBody)>0) {
// will get here only for older verson of IE
response=this.responseBody;
}
} catch (err) {
// not IE, do nothing
}

var bf=new BinaryFile(response);
if (callback_arg!=null) {
callback(bf,callback_arg);
Expand Down

0 comments on commit 1435306

Please sign in to comment.