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

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Thu Feb 8 12:15:47 MST 2007


Author: pari
Date: Thu Feb  8 13:15:46 2007
New Revision: 325

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=325
Log:
tweaks: some stupid changes to make IE happy. If you find any thing broken in Firefox becuase of this update please report in our bug tracker - http://bugs.digium.com 

Modified:
    trunk/config/incoming.html
    trunk/config/localexts.html
    trunk/config/numberplan.html
    trunk/config/numberplan_advanced.html
    trunk/config/record.html
    trunk/config/scripts/astman.js
    trunk/config/trunks.html

Modified: trunk/config/incoming.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/incoming.html?view=diff&rev=325&r1=324&r2=325
==============================================================================
--- trunk/config/incoming.html (original)
+++ trunk/config/incoming.html Thu Feb  8 13:15:46 2007
@@ -517,7 +517,7 @@
 			</TABLE>
 		</div>
 </div>
-<div id="bg_transparent" STYLE="display:none; position: absolute; left: 0; top: 24; width:100%; height:100%;  background-color:#FFFFFF; filter:alpha(opacity=50); -moz-opacity:.50;opacity:.50; border-width: 1px; border-color: #7E5538; border-style: solid; z-index:4">
+<div id="bg_transparent" STYLE="display:none; position: absolute; left: 0; top: 24; width:100%; height:100%;  background-color:#EFEFEF; -moz-opacity:.50;opacity:.50; border-width: 1px; border-color: #EFEFEF; border-style: solid; z-index:4">
 </div>
 <SCRIPT LANGUAGE="JavaScript">
 <!--

Modified: trunk/config/localexts.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/localexts.html?view=diff&rev=325&r1=324&r2=325
==============================================================================
--- trunk/config/localexts.html (original)
+++ trunk/config/localexts.html Thu Feb  8 13:15:46 2007
@@ -88,7 +88,13 @@
 				widgets[focus_fields[x]].onfocus = function(){this.className = 'input9_hilight';}
 				widgets[focus_fields[x]].onblur = function(){this.className = 'input9';}
 			}
-			$('localextenlength').addEventListener("change", update_spae, false);
+
+			if ($('localextenlength').addEventListener){
+				  $('localextenlength').addEventListener('change', update_spae, false); 
+			} else if (el.attachEvent){
+				  $('localextenlength').attachEvent('onchange', update_spae);
+			}
+
 			parent.astmanEngine.config2list("users.conf", $('devices'),widgets, usercallbacks);
 }
 

Modified: trunk/config/numberplan.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/numberplan.html?view=diff&rev=325&r1=324&r2=325
==============================================================================
--- trunk/config/numberplan.html (original)
+++ trunk/config/numberplan.html Thu Feb  8 13:15:46 2007
@@ -464,7 +464,11 @@
 }
 
 numplan_callbacks.loaded = function() {
-	document.addEventListener("change", select_differentplan, false);
+	if (document.addEventListener){
+		document.addEventListener("change", select_differentplan, false);
+	} else if (document.attachEvent){
+		document.attachEvent('onchange', select_differentplan);
+	}
 	if($('extensions').options.length ==0 ){
 			parent.loadscreen(this);
 			addthe_default_callingplan();
@@ -539,7 +543,11 @@
 }
 
 trunkcallbacks.loaded = function(){
-	$('trunks').addEventListener('click',hackenablesave,false);
+	if ($('trunks').addEventListener){
+		$('trunks').addEventListener('click',hackenablesave,false);
+	} else if ($('trunks').attachEvent){
+		$('trunks').attachEvent('onclick', hackenablesave );
+	}
 	parent.astmanEngine.config2list("extensions.conf", $('extensions'), widgets , numplan_callbacks);
 }
 
@@ -579,7 +587,7 @@
 	t=confirm("A default Dial Plan is not found. \n" + " Do you want to create a default Dial Plan ");
 	if(t == false){ 
 		$('message_text').innerHTML = "A default DialPlan is not found !! "
-		+ "<BR> <A href=\"#\" class=\"splbutton\" onclick=\"addthe_default_callingplan()\">click here</A> to create a default DialPlan";
+		+ "<BR><BR> <A href=\"#\" class=\"splbutton\" onclick=\"addthe_default_callingplan()\">click here</A> to create a default DialPlan";
 		$('bg_transparent').style.display = '' ;
 		$('status_message').style.left = 120 ;
 		$('status_message').style.display = "block" ;
@@ -611,7 +619,7 @@
 	<center>
 	<fieldset style="width: 500px" id="fieldset1">
 		<legend>&nbsp;List of DialPlans:&nbsp;</legend>
-		<CENTER><select id="extensions" class="input9"></select>&nbsp;&nbsp;<a href="#" class="splbutton" onclick="newnumberplan()">new</a>&nbsp;&nbsp;<a href="#" class="splbutton" onclick="delete_numberplan()">delete</a>
+		<CENTER><select id="extensions" class="input9" style="z-index:2"></select>&nbsp;&nbsp;<a href="#" class="splbutton" onclick="newnumberplan()">new</a>&nbsp;&nbsp;<a href="#" class="splbutton" onclick="delete_numberplan()">delete</a>
 			<input id='new' value='New' type="button"  style="display:none">
 			<input id='delete' value='Delete' type="button"  style="display:none">
 			<div id="npcontent" STYLE="display:none; position: absolute; left: 110; top: 40; width:320; height:110;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid; z-index:6">
@@ -711,7 +719,7 @@
 		</TABLE>
 		</div>
 </div>
-<div id="bg_transparent" STYLE="display:none; position: absolute; left: 0; top: 24; width:100%; height:100%;  background-color:#FFFFFF; filter:alpha(opacity=50); -moz-opacity:.50;opacity:.50; border-width: 1px; border-color: #7E5538; border-style: solid; z-index:4">
+<div id="bg_transparent" STYLE="display:none; position: absolute; left: 0; top: 24; width:100%; height:100%;  background-color:#EFEFEF; -moz-opacity:.50;opacity:.50; border-width: 1px; border-color: #EFEFEF; border-style: solid; z-index:4">
 </div>
 <SCRIPT LANGUAGE="JavaScript">
 <!--

Modified: trunk/config/numberplan_advanced.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/numberplan_advanced.html?view=diff&rev=325&r1=324&r2=325
==============================================================================
--- trunk/config/numberplan_advanced.html (original)
+++ trunk/config/numberplan_advanced.html Thu Feb  8 13:15:46 2007
@@ -98,7 +98,11 @@
 
 
 numplan_callbacks.loaded = function(){
-	$('new').addEventListener("click", showNPdetails, false); 
+	if ($('new').addEventListener){
+		$('new').addEventListener("click", showNPdetails, false); 
+	} else if ($('new').attachEvent){
+		$('new').attachEvent('onclick', showNPdetails );
+	}
 	loadNumberPlansintotable();
 	parent.loadscreen(this);
 }

Modified: trunk/config/record.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/record.html?view=diff&rev=325&r1=324&r2=325
==============================================================================
--- trunk/config/record.html (original)
+++ trunk/config/record.html Thu Feb  8 13:15:46 2007
@@ -337,7 +337,7 @@
 	</tr>
 </table>
 </div>
-<div id="bg_transparent" STYLE="display:none; position: absolute; left: 0; top: 24; width:100%; height:100%;  background-color:#FFFFFF; filter:alpha(opacity=50); -moz-opacity:.50;opacity:.50; border-width: 1px; border-color: #7E5538; border-style: solid; z-index:4">
+<div id="bg_transparent" STYLE="display:none; position: absolute; left: 0; top: 24; width:100%; height:100%;  background-color:#EFEFEF; -moz-opacity:.50;opacity:.50; border-width: 1px; border-color: #EFEFEF; border-style: solid; z-index:4">
 </div>
 <SCRIPT LANGUAGE="JavaScript">
 <!--

Modified: trunk/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/scripts/astman.js?view=diff&rev=325&r1=324&r2=325
==============================================================================
--- trunk/config/scripts/astman.js (original)
+++ trunk/config/scripts/astman.js Thu Feb  8 13:15:46 2007
@@ -29,29 +29,55 @@
 
 function startDrag(event, movethis ){
 	dragdata.movethis = movethis ;
-	dragdata.initialcursorX = event.clientX + window.scrollX;
-	dragdata.initialcursorY = event.clientY + window.scrollY;
+	if(typeof window.scrollX != "undefined"){
+		dragdata.initialcursorX = event.clientX + window.scrollX;
+		dragdata.initialcursorY = event.clientY + window.scrollY;
+	}else{
+		dragdata.initialcursorX =  window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
+		dragdata.initialcursorY = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
+	}
 	dragdata.initialwindowleft = parseInt( $(dragdata.movethis).style.left) ;
 	dragdata.initialwindowtop = parseInt($(dragdata.movethis).style.top) ;
-	dragdata.maxleft = window.innerWidth - parseInt($(dragdata.movethis).style.width) ;
-	dragdata.maxtop = window.innerHeight - parseInt($(dragdata.movethis).style.height) ;
-	document.addEventListener("mousemove", movewindow, false);
-	document.addEventListener("mouseup", stopDrag, false);
+	if(typeof window.innerWidth != "undefined"){
+		dragdata.maxleft = window.innerWidth - parseInt($(dragdata.movethis).style.width) ;
+		dragdata.maxtop = window.innerHeight - parseInt($(dragdata.movethis).style.height) ;
+	}else{
+		dragdata.maxleft = document.body.offsetWidth - parseInt($(dragdata.movethis).style.width) ;
+		dragdata.maxtop = document.body.offsetWidth- parseInt($(dragdata.movethis).style.height) ;
+	}
+
+	if (document.addEventListener){
+		document.addEventListener("mousemove", movewindow, false);
+		document.addEventListener("mouseup", stopDrag, false);
+	} else if (document.attachEvent){
+		document.attachEvent('onmousemove', movewindow);
+		document.attachEvent('onmouseup', stopDrag);
+	}
 }
 
 
 function stopDrag(){
-	document.removeEventListener("mousemove", movewindow, false);
-	document.removeEventListener("mouseup", stopDrag, false);
+	if(document.removeEventListener){
+		document.removeEventListener("mousemove", movewindow, false);
+		document.removeEventListener("mouseup", stopDrag, false);
+	}else if(document.detachEvent){
+		document.detachEvent("onmousemove", movewindow);
+		document.detachEvent("onmouseup", stopDrag);
+	}
 }
 
 function movewindow(event){
-  x = event.clientX + window.scrollX;
-  y = event.clientY + window.scrollY;
-  var tmp_top = dragdata.initialwindowtop  + y - dragdata.initialcursorY ; 
-  var tmp_left = dragdata.initialwindowleft + x - dragdata.initialcursorX;
-  if( tmp_left > 0 && tmp_left < dragdata.maxleft ){ $(dragdata.movethis).style.left = tmp_left  + "px"; }
-  if( tmp_top > 0 && tmp_top < dragdata.maxtop ){ $(dragdata.movethis).style.top  = tmp_top + "px"; }
+	if(typeof window.scrollX != "undefined"){
+	  x = event.clientX + window.scrollX;
+	  y = event.clientY + window.scrollY;
+	}else{
+		x =  window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
+		y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
+	}
+	  var tmp_top = dragdata.initialwindowtop  + y - dragdata.initialcursorY ; 
+	  var tmp_left = dragdata.initialwindowleft + x - dragdata.initialcursorX;
+	  if( tmp_left > 0 && tmp_left < dragdata.maxleft ){ $(dragdata.movethis).style.left = tmp_left  + "px"; }
+	  if( tmp_top > 0 && tmp_top < dragdata.maxtop ){ $(dragdata.movethis).style.top  = tmp_top + "px"; }
 }
 
 
@@ -92,65 +118,79 @@
 		var KEYUP = 38;
 		var KEYDN = 40;
 		var BKSPACE = 8;
+
+		function xyz(event){
+					if( event.keyCode == ENTER || event.keyCode == ESC || event.keyCode == TAB){
+							combo_selectdiv.style.display = "none";
+							return false;
+					}else if( event.keyCode == KEYDN ||  event.keyCode == KEYUP ){
+							combo_selectbox.focus();
+							return false;
+					}else if( event.keyCode == BKSPACE && combo_text.value.length ==0 ){
+							combo_selectdiv.style.display = "none";
+							return false;
+					}else{
+							combo_selectdiv.style.display = "";
+							return true;
+					}
+		}
+		
+		function	abcd(event){
+				if( event.keyCode == ENTER || event.keyCode == ESC || event.keyCode == TAB){
+				return false;
+				}
+				for (var i=0; i < combo_selectbox.options.length; i++){
+						if(	combo_selectbox.options[i].value.toLowerCase().match(combo_text.value.toLowerCase()) ){
+							combo_selectbox.selectedIndex = i;
+							return true;
+						}
+				}
+				combo_selectdiv.style.display = "none";				
+		}
+
+
+		function	efgh(event) {
+				if( event.keyCode == ENTER ){
+						combo_text.value = combo_selectbox.value;
+						combo_text.focus();
+						combo_selectdiv.style.display = "none";
+						return false;
+				}else if( event.keyCode == ESC ){
+						combo_text.focus();
+						combo_selectdiv.style.display = "none";
+				}else{
+						return true;
+				}
+		}
+		function	ijkl(event) {
+			combo_text.value = combo_selectbox.value;
+			combo_text.focus();
+			combo_selectdiv.style.display = "none";
+		}
+
 		combo_selectdiv.style.position ="absolute";
 		combo_selectdiv.style.top = "0px";
 		combo_selectdiv.style.left = "0px";
 //		combo_selectdiv.style.z-index = 10000;
 		combo_selectdiv.style.display = "none";
 
-		combo_text.addEventListener('keychange',combobox_activate,false);
-		combo_text.addEventListener('focus',combobox_activate,false);
-		combo_text.addEventListener('focusout', function(){ combo_selectdiv.style.display ='none'; } ,false);
-		combo_text.addEventListener('keypress',  function(event){
-							if( event.keyCode == ENTER || event.keyCode == ESC || event.keyCode == TAB){
-									combo_selectdiv.style.display = "none";
-									return false;
-							}else if( event.keyCode == KEYDN ||  event.keyCode == KEYUP ){
-									combo_selectbox.focus();
-									return false;
-							}else if( event.keyCode == BKSPACE && combo_text.value.length ==0 ){
-									combo_selectdiv.style.display = "none";
-									return false;
-							}else{
-									combo_selectdiv.style.display = "";
-									return true;
-							}
-				}, false);
-		combo_text.addEventListener('keyup', function(event){
-						if( event.keyCode == ENTER || event.keyCode == ESC || event.keyCode == TAB){
-						return false;
-						}
-						for (var i=0; i < combo_selectbox.options.length; i++){
-								if(	combo_selectbox.options[i].value.toLowerCase().match(combo_text.value.toLowerCase()) ){
-									combo_selectbox.selectedIndex = i;
-									return true;
-								}
-						}
-						combo_selectdiv.style.display = "none";				
-				},false);
-
-
-
-		combo_selectbox.addEventListener('keypress', function(event) {
-					if( event.keyCode == ENTER ){
-							combo_text.value = combo_selectbox.value;
-							combo_text.focus();
-							combo_selectdiv.style.display = "none";
-							return false;
-					}else if( event.keyCode == ESC ){
-							combo_text.focus();
-							combo_selectdiv.style.display = "none";
-					}else{
-							return true;
-					}
-			},false);
-
-
-		combo_selectbox.addEventListener('click', function(event) {
-						combo_text.value = combo_selectbox.value;
-						combo_text.focus();
-						combo_selectdiv.style.display = "none";
-			},false);
+		if (combo_text.addEventListener){
+				combo_text.addEventListener('keychange',combobox_activate,false);
+				combo_text.addEventListener('focus',combobox_activate,false);
+				combo_text.addEventListener('focusout', function(){ combo_selectdiv.style.display ='none'; } ,false);
+				combo_text.addEventListener('keypress',  xyz , false);
+				combo_text.addEventListener('keyup', abcd ,false);
+				combo_selectbox.addEventListener('keypress', efgh ,false);
+				combo_selectbox.addEventListener('click', ijkl ,false);
+		} else if (combo_text.attachEvent){
+				combo_text.attachEvent('onkeychange',combobox_activate);
+				combo_text.attachEvent('onfocus',combobox_activate);
+				combo_text.attachEvent('onfocusout', function(){ combo_selectdiv.style.display ='none'; } );
+				combo_text.attachEvent('onkeypress',  xyz );
+				combo_text.attachEvent('onkeyup', abcd );
+				combo_selectbox.attachEvent('onkeypress', efgh );
+				combo_selectbox.attachEvent('onclick', ijkl );
+		}
 
 		function combobox_activate(){
 				var tmp_left = combo_text.offsetLeft;

Modified: trunk/config/trunks.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/trunks.html?view=diff&rev=325&r1=324&r2=325
==============================================================================
--- trunk/config/trunks.html (original)
+++ trunk/config/trunks.html Thu Feb  8 13:15:46 2007
@@ -148,7 +148,11 @@
 	callbacks.loaded = function() {
 		$('devices').contentEditable = 'true';
 		$('devices').disabled = 0;
-		$('new').addEventListener("click", showSPdetails, false); 
+		if ($('new').addEventListener){
+				$('new').addEventListener("click", showSPdetails, false); 
+		} else if ($('new').attachEvent){
+		  $('new').attachEvent('onclick', showSPdetails);
+		}
 		loadServiceProvidersintotable();
 		parent.loadscreen(this);
 	}
@@ -797,6 +801,6 @@
 <tr><td></td><td align="center"><input type='button' id='save' value='Save' class="buttonbold">&nbsp;<input type='button' id='cancel' value='Cancel' class="buttonbold"></td></tr>
 </table>
 </div>
-<div id="bg_transparent" STYLE="display:none; position: absolute; left: 0; top: 24; width:100%; height:100%;  background-color:#FFFFFF; filter:alpha(opacity=50); -moz-opacity:.50;opacity:.50; border-width: 1px; border-color: #7E5538; border-style: solid; z-index:4">
+<div id="bg_transparent" STYLE="display:none; position: absolute; left: 0; top: 24; width:100%; height:100%;  background-color:#EFEFEF; -moz-opacity:.50;opacity:.50; border-width: 1px; border-color: #EFEFEF; border-style: solid; z-index:4">
 </div>
 </body>



More information about the asterisk-gui-commits mailing list