Resources/ui/tablet/usageView.js
//creates the popup window for all of the graphs
creates the popup window for all of the graphs
creates the popup window for all of the graphs
function popupGraph(url, eventString1, eventString2, eventMessage1, eventMessage2){
	usageLanguage();
	var w = Titanium.UI.createView({
		backgroundColor:'#336699',
		borderWidth:8,
		borderColor:'#999',
		height:'30%',
		width:'50%',
		left: '51.5%',
		borderRadius:10,
		opacity:0.92,
		visible: false
	}); 	
		var t = Titanium.UI.create2DMatrix();
		t = t.scale(0);
		w.setTransform(t);
		var t1 = Titanium.UI.create2DMatrix();
		t1 = t1.scale(1.1);
		var a = Titanium.UI.createAnimation();
		a.transform = t1;
		a.duration = 200;
		a.addEventListener('complete', function()
		{
			Titanium.API.info('Animation Complete');
			var t2 = Titanium.UI.create2DMatrix();
			t2 = t2.scale(1.0);
			w.animate({transform:t2, duration:200});
		});
		graphView = Ti.UI.createWebView({
			url: url,
			DisableBounce: true,
			showScrollbars: false,	
		});
		w.add(graphView);
		if(eventString1 != null)
			graphView.addEventListener('load', function(e) {
    		Ti.App.fireEvent(eventString1, { message: eventMessage1});
    		Ti.App.fireEvent(eventString2, { message: eventMessage2});
			});
		win.add(w);
		  setTimeout(function(){
            graphView.reload();
            graphView.setUrl(url);
          },20);
}
function popupGraph ( url , eventString1 , eventString2 , eventMessage1 , eventMessage2 ) { usageLanguage ( ) ; var w = Titanium . UI . createView ( { backgroundColor : '#336699' , borderWidth : 8 , borderColor : '#999' , height : '30%' , width : '50%' , left : '51.5%' , borderRadius : 10 , opacity : 0.92 , visible : false } ) ; var t = Titanium . UI . create2DMatrix ( ) ; t = t . scale ( 0 ) ; w . setTransform ( t ) ; var t1 = Titanium . UI . create2DMatrix ( ) ; t1 = t1 . scale ( 1.1 ) ; var a = Titanium . UI . createAnimation ( ) ; a . transform = t1 ; a . duration = 200 ; a . addEventListener ( 'complete' , function ( ) { Titanium . API . info ( 'Animation Complete' ) ; var t2 = Titanium . UI . create2DMatrix ( ) ; t2 = t2 . scale ( 1.0 ) ; w . animate ( { transform : t2 , duration : 200 } ) ; } ) ; graphView = Ti . UI . createWebView ( { url : url , DisableBounce : true , showScrollbars : false , } ) ; w . add ( graphView ) ; if ( eventString1 != null ) graphView . addEventListener ( 'load' , function ( e ) { Ti . App . fireEvent ( eventString1 , { message : eventMessage1 } ) ; Ti . App . fireEvent ( eventString2 , { message : eventMessage2 } ) ; } ) ; win . add ( w ) ; setTimeout ( function ( ) { graphView . reload ( ) ; graphView . setUrl ( url ) ; } , 20 ) ; }
creates the popup window for all of the graphs
creates the popup window for all of the graphs
//popup window // create first transform to go beyond normal size // when this animation completes, scale to normal size //Webview of the graph //wait a sec for the webview to recieve the data //reload the webview //sets the webviews url