pari: trunk r236 - /trunk/config/
asterisk-gui-commits at lists.digium.com
asterisk-gui-commits at lists.digium.com
Wed Jan 10 21:20:04 MST 2007
Author: pari
Date: Wed Jan 10 22:20:04 2007
New Revision: 236
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=236
Log:
Confirm on navigating to a different website while logged in, auto logout if confirmed
Modified:
trunk/config/cfgadvanced.html
trunk/config/cfgappliance.html
trunk/config/cfgbasic.html
trunk/config/localexts.html
trunk/config/options.html
Modified: trunk/config/cfgadvanced.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/cfgadvanced.html?view=diff&rev=236&r1=235&r2=236
==============================================================================
--- trunk/config/cfgadvanced.html (original)
+++ trunk/config/cfgadvanced.html Wed Jan 10 22:20:04 2007
@@ -159,6 +159,22 @@
}
function registerajax() {
+ window.onbeforeunload = function(){
+ if(loggedon == 1)
+ return "Doing so will terminate your Asterisk GUI session";
+ }
+
+ window.onunload = function(){
+ if(loggedon != 1) return true;
+ var opt2 = {
+ method: 'get',asynchronous: true,
+ onSuccess: function() {setLoggedOn(0);loggedon == -1;},
+ onFailure: function(t) {}
+ };
+ opt2.parameters ="action=logoff";
+ var tmp2 = new Ajax.Request("../../rawman", opt2);
+ }
+
var pnameheight = 22;
var pheight = (503 - (pnameheight*panels.length) ) ;
accordion = new Rico.Accordion( $('configpanel'), { panelHeight: pheight,onHideTab:fademainscreen,onShowTab:showmainscreen });
@@ -179,7 +195,7 @@
astmanEngine.setEventCallback(eventeater.eventcb);
function Logoff() {
- t=confirm("Are you sure ?")
+ var t=confirm("Are you sure ?");
if(t == false)
return true;
var opt2 = {
Modified: trunk/config/cfgappliance.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/cfgappliance.html?view=diff&rev=236&r1=235&r2=236
==============================================================================
--- trunk/config/cfgappliance.html (original)
+++ trunk/config/cfgappliance.html Wed Jan 10 22:20:04 2007
@@ -150,6 +150,22 @@
}
function registerajax() {
+ window.onbeforeunload = function(){
+ if(loggedon == 1)
+ return "Doing so will terminate your Asterisk GUI session";
+ }
+
+ window.onunload = function(){
+ if(loggedon != 1) return true;
+ var opt2 = {
+ method: 'get',asynchronous: true,
+ onSuccess: function() {setLoggedOn(0);loggedon == -1;},
+ onFailure: function(t) {}
+ };
+ opt2.parameters ="action=logoff";
+ var tmp2 = new Ajax.Request("../../rawman", opt2);
+ }
+
var pnameheight = 22;
var pheight = (503 - (pnameheight*panels.length) ) ;
accordion = new Rico.Accordion( $('configpanel'), { panelHeight: pheight,onHideTab:fademainscreen,onShowTab:showmainscreen });
@@ -170,7 +186,7 @@
astmanEngine.setEventCallback(eventeater.eventcb);
function Logoff() {
- t=confirm("Are you sure ?")
+ var t=confirm("Are you sure ?");
if(t == false)
return true;
var opt2 = {
Modified: trunk/config/cfgbasic.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/cfgbasic.html?view=diff&rev=236&r1=235&r2=236
==============================================================================
--- trunk/config/cfgbasic.html (original)
+++ trunk/config/cfgbasic.html Wed Jan 10 22:20:04 2007
@@ -152,7 +152,24 @@
$('tooltip').innerHTML = tip;
}
+
function registerajax() {
+ window.onbeforeunload = function(){
+ if(loggedon == 1)
+ return "Doing so will terminate your Asterisk GUI session";
+ }
+
+ window.onunload = function(){
+ if(loggedon != 1) return true;
+ var opt2 = {
+ method: 'get',asynchronous: true,
+ onSuccess: function() {setLoggedOn(0);loggedon == -1;},
+ onFailure: function(t) {}
+ };
+ opt2.parameters ="action=logoff";
+ var tmp2 = new Ajax.Request("../../rawman", opt2);
+ }
+
var pnameheight = 22;
var pheight = (503 - (pnameheight*panels.length) ) ;
accordion = new Rico.Accordion( $('configpanel'), { panelHeight: pheight,onHideTab:fademainscreen,onShowTab:showmainscreen });
@@ -174,7 +191,7 @@
function Logoff() {
- t=confirm("Are you sure ?")
+ var t=confirm("Are you sure ?");
if(t == false)
return true;
var opt2 = {
Modified: trunk/config/localexts.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/localexts.html?view=diff&rev=236&r1=235&r2=236
==============================================================================
--- trunk/config/localexts.html (original)
+++ trunk/config/localexts.html Wed Jan 10 22:20:04 2007
@@ -30,6 +30,8 @@
var widgets = new Array;
function tosetup(){
+ parent.window.onbeforeunload = function(){ }
+ parent.window.onunload = function(){ }
parent.window.location.href = "./setup/install.html";
}
Modified: trunk/config/options.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/options.html?view=diff&rev=236&r1=235&r2=236
==============================================================================
--- trunk/config/options.html (original)
+++ trunk/config/options.html Wed Jan 10 22:20:04 2007
@@ -210,6 +210,8 @@
function tosetup(){
+ parent.window.onbeforeunload = function(){ }
+ parent.window.onunload = function(){ }
parent.window.location.href = "./setup/install.html";
}
More information about the asterisk-gui-commits
mailing list