3 Implements: APE.Events,
5 initialize: function(ape, options){
6 this.pipe = options.pipe;
7 this.properties = options.pipe.properties;
11 this.initRequestMethod();
13 this.ape.addPipe(this.pipe.pubid, this);
16 initRequestMethod: function() {
20 var args = this.parsePipeCmd.apply(this, arguments);
21 this.ape.request.send.apply(this.ape.request, args);
25 var args = this.parsePipeCmd.apply(this, arguments);
26 this.ape.request.cycledStack.add.apply(this.ape.request.cycledStack, args);
28 send: this.ape.request.send,
29 setTime: this.ape.request.cycledStack.setTime.bind(this.ape.request.cycledStack)
33 var args = this.parsePipeCmd.apply(this, arguments);
34 this.ape.request.stack.add.apply(this.ape.request.stack, args);
36 send: this.ape.request.stack.send.bind(this.ape.request.stack)
41 parsePipeCmd: function() {
42 //convert arguments to a real array to avoid a bug with firefox see bug #292215 https://bugzilla.mozilla.org/show_bug.cgi?id=292215
43 var args = Array.prototype.slice.call(arguments);
44 if ($type(arguments[0]) == 'array') {
45 for (var i = 0; i < args[0].length; i++) {
46 if (!args[0][i].params) args[0][i].params = {};
47 if (this.pipe) args[0][i].pipe = this.pipe.pubid;
50 if (!args[1]) args[1] = {};
51 if (this.pipe) args[1].pipe = this.pipe.pubid;
57 this.request.send('SEND', {'msg': data});
61 return this.pipe.pubid;
64 fireGlobalEvent: function(type, fn, internal) {
65 this.fireEvent(type, fn, internal);
66 this.ape.fireEvent(type, fn, internal);
69 fireInTheHall: this.fireGlobalEvent