pari: trunk r1034 - /trunk/config/setup/

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Mon Jun 4 16:23:56 MST 2007


Author: pari
Date: Mon Jun  4 18:23:55 2007
New Revision: 1034

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=1034
Log:
Setup Wizard updates :: (1) Introduce the Ping_every_x seconds thing (2) update the add_event, remove_event to ASTGUI.events.add etc

Modified:
    trunk/config/setup/1.html
    trunk/config/setup/3.html
    trunk/config/setup/4.html
    trunk/config/setup/5.html
    trunk/config/setup/6.html
    trunk/config/setup/7.html
    trunk/config/setup/install.html

Modified: trunk/config/setup/1.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/setup/1.html?view=diff&rev=1034&r1=1033&r2=1034
==============================================================================
--- trunk/config/setup/1.html (original)
+++ trunk/config/setup/1.html Mon Jun  4 18:23:55 2007
@@ -39,7 +39,6 @@
 	parent.$('next').disabled = true;
 	parent.$('back').disabled = true;
 	rawman_url = parent.rawman_url ;
-	parent.astmanEngine.setURL(rawman_url);
 	ping();
 }
 
@@ -54,12 +53,18 @@
 }
 
 function isloggedin(originalRequest){
+	if(!parent.started_pinging){
+		parent.started_pinging = 1;
+		parent.pingevery(60);
+	}
+
 	if ( originalRequest.responseText.match("Error") ) {
 		// User is not logged in , show him the login screen
 		_$('loginform').style.display = "";
 		_$('username').focus();
 		return true;
 	}
+
 	if ( originalRequest.responseText.match("Pong") ) {
 		// install [asterisk_guitools] if not installed
 		getextconf();
@@ -68,8 +73,7 @@
 
 function getextconf(){
 	parent.loggedon = 1;
-	parent.astmanEngine.pollEvents();
-
+	//parent.astmanEngine.pollEvents();
 	var opt = {
 		method: 'get',
 		asynchronous: true,

Modified: trunk/config/setup/3.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/setup/3.html?view=diff&rev=1034&r1=1033&r2=1034
==============================================================================
--- trunk/config/setup/3.html (original)
+++ trunk/config/setup/3.html Mon Jun  4 18:23:55 2007
@@ -26,7 +26,7 @@
 </HEAD>
 <script src="../scripts/prototype.js"></script>
 <SCRIPT>
-add_event = parent.add_event;
+add_event = parent.ASTGUI.events.add;
 var rawman_url;
 var usercallbacks = new Object;
 var fieldnames = new Array( 'save','userbase','localextenlength','allow_aliasextns');
@@ -109,7 +109,6 @@
 usercallbacks.loaded = function(){
 	//_$('localextenlength').addEventListener("change", store_extlength, false);
 	add_event( _$('localextenlength') , "change", store_extlength );
-	parent.astmanEngine.pollEvents();
 	_$('devices').selectitem(0);
 	parent._$('next').disabled = false;	
 	parent._$('back').disabled = false;

Modified: trunk/config/setup/4.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/setup/4.html?view=diff&rev=1034&r1=1033&r2=1034
==============================================================================
--- trunk/config/setup/4.html (original)
+++ trunk/config/setup/4.html Mon Jun  4 18:23:55 2007
@@ -150,9 +150,9 @@
 }
 
 callbacks.cancelnewcategory = function(){
-	remove_event( _$('trunkstyleanalog') , 'click' , activateanalogvoip );
-	remove_event( _$('trunkstylevoip') , 'click' , activateanalogvoip );
-	remove_event( _$('trunkstylecustomvoip') , 'click' , activateanalogvoip );
+	ASTGUI.events.remove( _$('trunkstyleanalog') , 'click' , activateanalogvoip );
+	ASTGUI.events.remove( _$('trunkstylevoip') , 'click' , activateanalogvoip );
+	ASTGUI.events.remove( _$('trunkstylecustomvoip') , 'click' , activateanalogvoip );
 	hideSPdetails();
 }
 
@@ -164,11 +164,10 @@
 	var _devices = _$('devices');
 	_devices.contentEditable = 'true';
 	_devices.disabled = 0;
-	add_event( _$('new') , "click", showSPdetails ) ;
+	ASTGUI.events.add( _$('new') , "click", showSPdetails ) ;
 	loadServiceProvidersintotable();
 	//preparemenus();
 	//parent.loadscreen(this);
-	parent.astmanEngine.pollEvents();
 }
 
 callbacks.postselect = function(){
@@ -463,9 +462,9 @@
 	_$('userscontent_title').innerHTML = "Add Service Provider";
 	isnewtrunk = 1;
 
-	add_event( _$('trunkstyleanalog') , 'click' , activateanalogvoip );
-	add_event( _$('trunkstylevoip') , 'click' , activateanalogvoip );
-	add_event( _$('trunkstylecustomvoip') , 'click' , activateanalogvoip );
+	ASTGUI.events.add( _$('trunkstyleanalog') , 'click' , activateanalogvoip );
+	ASTGUI.events.add( _$('trunkstylevoip') , 'click' , activateanalogvoip );
+	ASTGUI.events.add( _$('trunkstylecustomvoip') , 'click' , activateanalogvoip );
 
 	return tmp;
 }
@@ -548,7 +547,7 @@
 	var _trunkstylecustomvoip = _$('trunkstylecustomvoip');
 	_trunkstylecustomvoip.onclick = null;
 
-	add_event( _$('custom_trunkname') , 'change' , function(){ 
+	ASTGUI.events.add( _$('custom_trunkname') , 'change' , function(){ 
 		_$('name').value = _$('custom_trunkname').value;
 			_$('save').disabled = false; 
 		}
@@ -658,7 +657,7 @@
 	var menu_div = document.getElementById('mymenu') ;
 	menu_div.style.width="80";
 	menu_div.style.borderColor = "#eee #bbb #bbb #ddd";
-	add_event( document.body , "click", function(){ _$('mymenu').style.display="none"; } );
+	ASTGUI.events.add( document.body , "click", function(){ _$('mymenu').style.display="none"; } );
 
 	var menuitem1 = document.createElement('div');
 	menuitem1.innerHTML = "Edit" ;

Modified: trunk/config/setup/5.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/setup/5.html?view=diff&rev=1034&r1=1033&r2=1034
==============================================================================
--- trunk/config/setup/5.html (original)
+++ trunk/config/setup/5.html Mon Jun  4 18:23:55 2007
@@ -123,7 +123,7 @@
 
 trunkcallbacks.loaded = function(){
 	//_$('trunks').addEventListener('click',hackenablesave,false);
-	add_event( _$('trunks') , "click", hackenablesave );
+	ASTGUI.events.add( _$('trunks') , "click", hackenablesave );
 	parent.astmanEngine.config2list("extensions.conf", _$('extensions'), new Object(), numplan_callbacks);
 }
 
@@ -150,7 +150,7 @@
 }
 
 numplan_callbacks.loaded = function() {
-	parent.astmanEngine.pollEvents();
+	//parent.astmanEngine.pollEvents();
 	if(!default_numberplan){
 		// Redirect To creating a default Number Plan
 		addthe_default_callingplan();

Modified: trunk/config/setup/6.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/setup/6.html?view=diff&rev=1034&r1=1033&r2=1034
==============================================================================
--- trunk/config/setup/6.html (original)
+++ trunk/config/setup/6.html Mon Jun  4 18:23:55 2007
@@ -173,7 +173,7 @@
 callbacks.usesubfields = true;	
 
 callbacks.loaded = function() {
-	parent.astmanEngine.pollEvents();
+	//parent.astmanEngine.pollEvents();
 	var whichexten = "";
 	for (x=0;x<_$('extensions').options.length;x++) {
 		var tmp;

Modified: trunk/config/setup/7.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/setup/7.html?view=diff&rev=1034&r1=1033&r2=1034
==============================================================================
--- trunk/config/setup/7.html (original)
+++ trunk/config/setup/7.html Mon Jun  4 18:23:55 2007
@@ -73,8 +73,8 @@
 	_$('devices').contentEditable = 'true';
 	_$('devices').disabled = 0;
 	//_$('new').addEventListener("click", showuserdetails, false);
-	add_event( _$('new') , "click", showuserdetails );
-	parent.astmanEngine.pollEvents();
+	ASTGUI.events.add( _$('new') , "click", showuserdetails );
+	//parent.astmanEngine.pollEvents();
 	loadusersintotable();
 }
 

Modified: trunk/config/setup/install.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/setup/install.html?view=diff&rev=1034&r1=1033&r2=1034
==============================================================================
--- trunk/config/setup/install.html (original)
+++ trunk/config/setup/install.html Mon Jun  4 18:23:55 2007
@@ -28,26 +28,31 @@
 <script src="../scripts/prototype.js"></script>
 <script src="../scripts/astman.js"></script>
 <script>
-var rawman_url = "../" + asterisk_rawmanPath;
+var rawman_url;
 var fxoports = new Array();
 var fxsports = new Array();
 var numberofsteps = 7;
 var loggedon = 0;
-var eventeater = {};
 var localextenlength;
+var keepPinging;
+var started_pinging = 0;
+
+function pingevery(a){
+	keepPinging = setInterval( makeping, a*250 );
+}
+
+function makeping(){
+	makerequest("","","action=ping", function(t){ if( t.match(asterisk_guipingerror) ){ window.location.href=window.location.href;} } );
+}
 
 function localinit(){
+	rawman_url = "../" + asterisk_rawmanPath;
+	asterisk_rawmanPath = "../" + asterisk_rawmanPath;
 	astmanEngine = new Astman();
-	astmanEngine.setURL(rawman_url);
-	astmanEngine.setEventCallback(eventeater.eventcb);
+	astmanEngine.setURL(asterisk_rawmanPath);
 	_$('mainscreen').src="1.html";
 }
 
-eventeater.eventcb = function(msgs) {
-	if (loggedon == 1){
-		astmanEngine.pollEvents();
-	}
-}
 
 </script>
 <body onload="localinit()" topmargin=0  bgcolor="FFFFFF">



More information about the asterisk-gui-commits mailing list