-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathWebWorkerManager.min.js
1 lines (1 loc) · 1.08 KB
/
WebWorkerManager.min.js
1
Ext.define("Ext.ux.WebWorkerManager",{singleton:!0,wwList:Ext.create("Ext.util.HashMap"),register:function(a){var b=this;Ext.isObject(a)&&(a=[a]),Ext.each(a,function(a){b.wwList.add(a.id,a)})},unregister:function(a){var b=this;Ext.isObject(a)&&(a=[a]),Ext.each(a,function(a){b.wwList.containsKey(a.id)&&b.wwList.removeAtKey(a.id)})},contains:function(a){return this.wwList.containsKey(a.id)},get:function(a){return this.wwList.get(a)},getExcept:function(a){Ext.isObject(a)&&(a=[a]);var b=this.wwList.clone();return Ext.each(a,function(a){b.removeAtKey(a.id)}),b},each:function(a){this.wwList.each(function(b,c){a(c)})},stopAll:function(){var a=this;a.wwList.each(function(b,c){c.stop(),a.unregister(c)})},listen:function(a,b){Ext.isString(a)&&(a=[a]),this.wwList.each(function(c,d){Ext.each(a,function(a){d.on(a,b)})})},listenExcept:function(a,b,c){Ext.isString(a)&&(a=[a]),this.getExcept(b).each(function(b,d){Ext.each(a,function(a){d.on(a,c)})})},multicast:function(a,b,c){this.getExcept(a).each(function(a,d){Ext.isEmpty(c)?d.send(b):d.send(b,c)})},broadcast:function(a,b){this.multicast([],a,b)}});