pari: trunk r1013 - in /trunk/config: ./ scripts/

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Thu May 31 11:41:22 MST 2007


Author: pari
Date: Thu May 31 13:41:22 2007
New Revision: 1013

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=1013
Log:
cross browser function for window.innerHeight

Modified:
    trunk/config/cfgbasic.html
    trunk/config/cli.html
    trunk/config/feditor.html
    trunk/config/scripts/astman.js
    trunk/config/syslog.html

Modified: trunk/config/cfgbasic.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/cfgbasic.html?view=diff&rev=1013&r1=1012&r2=1013
==============================================================================
--- trunk/config/cfgbasic.html (original)
+++ trunk/config/cfgbasic.html Thu May 31 13:41:22 2007
@@ -37,22 +37,27 @@
 
 
 function fit_toScreen(){
-	var t = window.innerHeight;
+	var t = ASTGUI.displayHeight();
 	var c =_$('configpanel'); 
-	c.WIH = t; 
+	c.WIH = t;
 	_$('mainscreen').style.height = (t - 70);
 	_$('TOP_MAINTABLE').rows[1].cells[0].height = (t - 70) ;
 	var pnameheight = 22;
 	var panels = returnpanels();
 	var pheight = (( t - 70)  - (pnameheight*panels.length) ) ;
-	c.pheight = pheight;
+	if(pheight > 0){
+		c.pheight = pheight;
+	}else{
+		pheight = 0;
+		c.pheight = 0 ;
+	}
 
 	if( c.childNodes.length ){
 		var s;
 		for( var r=0; r < panels.length; r++ ){
 			s = panels[r].page.split(".html")[0];
 			if( _$(s+"_U").style.display == "" ){
-				_$(s+"_U").style.height = pheight + "px";
+				_$(s+"_U").style.height = pheight;
 			}
 		}
 	}
@@ -101,7 +106,7 @@
 
 	_$( "home" ).style.display = "";
 	_$( "home_U" ).style.display = "";
-	_$( "home_U" ).style.height = a.pheight +"px";
+	_$( "home_U" ).style.height = a.pheight;
 }
 
 function my_tooltip(event){
@@ -136,7 +141,7 @@
 		_$( t + "_U" ).style.height = "1px";
 		_$( t + "_U" ).style.display = "none";
 	}
-	_$( s.id + "_U" ).style.height = _$('configpanel').pheight + "px";
+	_$( s.id + "_U" ).style.height = _$('configpanel').pheight;
 	_$( s.id + "_U" ).style.display = "";
 
 	_$('AdvancedOptionsSelect').selectedIndex=-1;
@@ -205,7 +210,7 @@
 		_$( t ).style.display = "";
 	}
 	_$("home").style.display = "";
-	_$("home_U").style.height = _$('configpanel').pheight + "px";
+	_$("home_U").style.height = _$('configpanel').pheight;
 	_$("home_U").style.display = "";
 }
 
@@ -288,7 +293,7 @@
 		_$( t + "_U" ).style.height = "1px";
 		_$( t + "_U" ).style.display = "none";
 	}
-	_$( "localexts_U" ).style.height = _$('configpanel').pheight + "px";
+	_$( "localexts_U" ).style.height = _$('configpanel').pheight;
 	_$( "localexts_U" ).style.display = "";
 
 	_$('mainscreen').src = _$('AdvancedOptionsSelect').value ;

Modified: trunk/config/cli.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/cli.html?view=diff&rev=1013&r1=1012&r2=1013
==============================================================================
--- trunk/config/cli.html (original)
+++ trunk/config/cli.html Thu May 31 13:41:22 2007
@@ -30,7 +30,8 @@
 
 function localajaxinit() {
 	var adjust_toScreen = function(){
-		_$('cli_output').style.height = (window.innerHeight -60) + 'px';
+		var i = ASTGUI.displayHeight();
+		_$('cli_output').style.height = (i -60);
 	}
 	top._$('mainscreen').width= 798;
 	add_event( window , 'resize', adjust_toScreen);

Modified: trunk/config/feditor.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/feditor.html?view=diff&rev=1013&r1=1012&r2=1013
==============================================================================
--- trunk/config/feditor.html (original)
+++ trunk/config/feditor.html Thu May 31 13:41:22 2007
@@ -106,7 +106,10 @@
 }
 
 function localajaxinit() {
-	var adjust_toScreen = function(){ _$('file_output').style.height = (window.innerHeight -75) + 'px'; }
+	var adjust_toScreen = function(){
+		var i = ASTGUI.displayHeight(); 
+		_$('file_output').style.height = (i -75); 
+	}
 	add_event( window , 'resize', adjust_toScreen);
 	top._$('mainscreen').width= 798;
 	setWindowTitle("File Editor");

Modified: trunk/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/scripts/astman.js?view=diff&rev=1013&r1=1012&r2=1013
==============================================================================
--- trunk/config/scripts/astman.js (original)
+++ trunk/config/scripts/astman.js Thu May 31 13:41:22 2007
@@ -46,6 +46,10 @@
 if(document.attachEvent){ var isIE = true; }else{ var isIE = false; }
 
 var ASTGUI = { // the idea is to eventually move all the global variables and functions into this one object so that the global name space is not as cluttered as it is now.
+	displayHeight: function(){
+		if(isIE){return document.body.clientHeight;}else{return window.innerHeight;}
+	},
+
 	parseContextLine: {
 		read: function(q){
 			var v = q.indexOf("=");

Modified: trunk/config/syslog.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/syslog.html?view=diff&rev=1013&r1=1012&r2=1013
==============================================================================
--- trunk/config/syslog.html (original)
+++ trunk/config/syslog.html Thu May 31 13:41:22 2007
@@ -58,7 +58,10 @@
 
 
 function localajaxinit(){
-	var adjust_toScreen = function(){ _$('todaylog').style.height = (window.innerHeight -35) + 'px'; }
+	var adjust_toScreen = function(){
+		var i = ASTGUI.displayHeight();
+		_$('todaylog').style.height = (i - 35); 
+	}
 	add_event( window , 'resize', adjust_toScreen);
 	top._$('mainscreen').width= 798;
 	setWindowTitle("System Log");



More information about the asterisk-gui-commits mailing list