123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- function ApplicationActionManager(){
-
- this.debug_flag = false;
-
-
- this.http_count = 0;
-
- this.is_blocked = false;
-
-
- this.unblock_id = 0;
- }
- ApplicationActionManager.prototype.httpStart = function(){
- this.http_count++;
-
- if(this.http_count >= 2){
- this.blockActions();
- }if(this.http_count < 0){
-
-
- }
- this.debug();
- }
- ApplicationActionManager.prototype.httpStop = function(ex){
- this.http_count--;
-
- if(this.http_count < 2){
- this.allowActions();
- }
-
- this.debug(ex);
- }
- ApplicationActionManager.prototype.isBlocked = function(){
-
- return this.is_blocked;
- }
- ApplicationActionManager.prototype.unBlock = function(id){
-
- if(id == this.unblock_id && id != 0){
- this.unblock_id = 0;
-
- this.is_blocked = false;
-
-
-
-
- }else{
-
-
-
- }
-
- this.debug();
- }
- ApplicationActionManager.prototype.debug = function(ex){
-
- if(this.debug_flag){
- window.defaultStatus = "http requests: " + this.http_count + ", " + (this.is_blocked ? "blocked" : "unblocked") + (ex ? " error: " + ex : "");
- }
- }
- ApplicationActionManager.prototype.blockActions = function(){
- this.is_blocked = true;
-
- this.debug();
-
- this.unblock_id = (new Date()).getTime();
-
-
- setTimeout("applicationActionManager.unBlock("+this.unblock_id+")", 12000);
-
- return this.unblock_id;
- }
- ApplicationActionManager.prototype.allowActions = function(){
- this.is_blocked = false;
-
- this.debug();
- }
- function setCursorStyle(style){
- getConfigFrame().document.body.style.cursor = style;
- getMessageIFrame().document.body.style.cursor = style;
- }
- function setStatus(message){
- window.defaultStatus = message;
- }
- function cDispatchErrorHandler(location_name, ex){
- applicationActionManager.httpStop(ex);
- }
- var applicationActionManager = new ApplicationActionManager();
|