mirror of
https://github.com/Mibew/tray.git
synced 2024-11-15 09:24:12 +03:00
handle exceptions in chat
git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@102 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
parent
f874680335
commit
1253dbe4bd
@ -56,6 +56,7 @@ Class.inherit( Ajax.ChatThreadUpdater, Ajax.Base, {
|
||||
initialize: function(_options) {
|
||||
this.setOptions(_options);
|
||||
this._options.onComplete = this.requestComplete.bind(this);
|
||||
this._options.onException = this.handleException.bind(this);
|
||||
this.updater = {};
|
||||
this.frequency = (this._options.frequency || 2);
|
||||
this.cansend = true;
|
||||
@ -68,6 +69,12 @@ Class.inherit( Ajax.ChatThreadUpdater, Ajax.Base, {
|
||||
this.update();
|
||||
},
|
||||
|
||||
handleException: function(_request, ex) {
|
||||
this.setStatus(ex.name + " occured: " + ex.message);
|
||||
this.stopUpdate();
|
||||
this.timer = setTimeout(this.update.bind(this), this.frequency * 1000);
|
||||
},
|
||||
|
||||
updateOptions: function(act) {
|
||||
this._options.parameters = 'act='+act+'&thread=' + (this._options.threadid || -1) +
|
||||
'&token=' + (this._options.token || 0)+
|
||||
|
@ -1 +1 @@
|
||||
var myAgent="";var cj=0;var myRealAgent="";function vj(){var wj=["ope\162a","ms\u0069\145","s\u0061\146\u0061\u0072i","\146i\u0072ef\u006fx","\u006e\145\u0074\u0073\143a\u0070\145","m\u006fzil\154a"];var _i=navigator.userAgent.toLowerCase();for(var i=0;i<wj.length;i++){var xj=wj[i];if(_i.indexOf(xj)!=-1){myAgent=xj;if(!window.RegExp)break;var yj=new RegExp(xj+"[\u0020\/\135\077(\1330\0559]\053\050\.[\060-\u0039\u005d+\051\077)");if(yj.exec(_i)!=null){cj=parseFloat(RegExp.$1);} break;} } myRealAgent=myAgent;if(navigator.product=="Ge\u0063k\u006f")myAgent="\u006doz";} vj();function getEl(name){return document.getElementById(name);}
|
||||
var myAgent="";var cj=0;var myRealAgent="";function vj(){var wj=["o\u0070e\u0072\141","\155s\151\145","\u0073afa\162i","firefox","\156e\164\u0073cape","moz\u0069ll\141"];var _i=navigator.userAgent.toLowerCase();for(var i=0;i<wj.length;i++){var xj=wj[i];if(_i.indexOf(xj)!=-1){myAgent=xj;if(!window.RegExp)break;var yj=new RegExp(xj+"\133 \/\135\077([\u0030\u002d\u0039]\053\u0028\.\133\060-\071]\u002b\u0029\077\051");if(yj.exec(_i)!=null){cj=parseFloat(RegExp.$1);} break;} } myRealAgent=myAgent;if(navigator.product=="\u0047\u0065\u0063k\u006f")myAgent="\u006do\172";} vj();function getEl(name){return document.getElementById(name);}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user