X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=tools%2Fhtdocs%2Fmkws.js;h=1c19b2c98e6f2d39b9b70479e8faadef34a1216f;hb=f002c09b599b883add53eda5da0436072ab2b3ee;hp=ee055204fbfaa84cecc95cf82fc5d22eaba7c2df;hpb=75a31106246500cc5ca1445fcf337a329d6865b0;p=mkws-moved-to-github.git diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index ee05520..1c19b2c 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -142,29 +142,6 @@ var mkws = { }; -// The following PubSub code is modified from the jQuery manual: -// https://api.jquery.com/jQuery.Callbacks/ -// -// Use as: -// mkws.queue("eventName").subscribe(function(param1, param2 ...) { ... }); -// mkws.queue("eventName").publish(arg1, arg2, ...); - -(function() { - var queues = {}; - mkws.queue = function(id) { - if (!queues[id]) { - var callbacks = $.Callbacks(); - queues[id] = { - publish: callbacks.fire, - subscribe: callbacks.add, - unsubscribe: callbacks.remove - }; - } - return queues[id]; - } -}()); - - // Define empty mkws_config for simple applications that don't define it. if (mkws_config == null || typeof mkws_config != 'object') { var mkws_config = {}; @@ -194,7 +171,7 @@ function widget($, team, type, node) { function promoteTargets() { - mkws.queue("targets." + team.name()).subscribe(function(data) { + team.queue("targets").subscribe(function(data) { if (node.length === 0) alert("huh?!"); var table ='