26
26
this.throwLeft = 0;
28
28
this.onlyLegend = 0;
29
if (this.device == "iPhone" || this.device == "iPad"){
30
this.fader = new Animator().addSubject(new NumericalStyleSubject($('graph_image_div'), 'opacity', 1, 0.13));
31
this.fader = new Animator().addSubject(new NumericalStyleSubject($('graph_image_div'), 'opacity', 1, 0.13));
35
35
this.img = this.frame.getElementsByTagName('img')[0];
73
/** Checks if user is running on iPhone/iPod or iPad
74
* if running on safari with iPhone returns "iPhone" if with iPad returns "iPad"
76
GRAPH.prototype.getDevice = function() {
77
if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)))
81
else if (navigator.userAgent.match(/iPad/i))
86
return "other than iPad iPod iPhone";
92
73
GRAPH.prototype.onImageLoad = function(self) {
93
74
return function() {
94
75
adei.SetSuccessStatus(self.onload_message?self.onload_message:translate("Done"));
96
self.AnimatorEffects(self,2);
78
self.AnimatorEffects(self,2);
590
571
else if(self.onlyLegend === 1 && self.swiping === 0){
572
var iphone = isiPhone();
591
574
var x = adeiMathPreciseAdd(self.xmin, self.xsize*(self.startX - self.margins.left) / self.real_width);
592
575
var y = new Array();
593
576
for (var i = 0; i < self.axis.length; i++) {
594
577
y[i] = self.ymax[i] - (self.ymax[i] - self.ymin[i])*(self.startY - self.margins.top) / self.real_height;
598
581
xmin: self.xmin.toString(),
599
582
xmax: self.xmax.toString(),
653
635
gestureValues.x = adeiMathPreciseAdd(self.xmin, self.xsize*(self.startX - self.margins.left) / self.real_width);
654
636
// alert(self.margins.left);
655
637
gestureValues.marginsLeft = self.margins.left;
656
gestureValues.device = self.device;
638
gestureValues.device = self.idevice;
657
639
gestureValues.y = new Array();
658
640
for (var i = 0; i < self.axis.length; i++) {
659
641
gestureValues.y[i] = self.ymax[i] - (self.ymax[i] - self.ymin[i])*(self.startY - self.margins.top) / self.real_height;
661
643
if(self.fader != 0){self.AnimatorEffects(self,1);}
644
gestureValues.scale = scale;
662
645
gestureValues.startX = self.startX;
663
gestureValues.angle = angle;
664
gestureValues.scale = scale;
665
646
self.window.PinchZoom(gestureValues);
666
647
self.startValuesSet = 0;
672
652
GRAPH.prototype.onOrientationChange = function(self){
673
653
return function(e){
674
self.updateOrientation();
680
GRAPH.prototype.updateOrientation = function(self){
681
switch(window.orientation){
682
case 0: //normal portrait
685
case -90: //right landscape
688
case 90: //left landscape
691
case 180: //Upsidedown portrait
654
if(self.fader != 0){self.AnimatorEffects(self,1);}
700
660
/**Gets direction of Swipe gesture
701
661
* When user swipes the screen with 1 finger, calculates heading and return an integer.
836
796
onMouseScroll: this.onMouseScroll(this),
837
797
onMouseMove: this.onMouseMove(this),
839
//onOrientationChange: this.onOrientationChange(this),
799
onOrientationChange: this.onOrientationChange(this),
840
800
onTouchStart: this.onTouchStart(this),
841
801
onTouchMove:this.onTouchMove(this),
842
802
onTouchEnd:this.onTouchEnd(this),