Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
type: 'error',
timer: 10000
});
});
};
// event bindings
postal.subscribe({
channel: 'stories',
topic: 'create story',
callback: _onCreateStory
});
postal.subscribe({
channel: 'stories',
topic: 'edit story',
callback: _onEditStory
});
return {
/*
* Public
*/
};
}());
let deferred = Q.defer();
deferred.cookie = this.cookie;
this.pending.push(deferred);
//console.log("defer "+deferred.cookie+": ", deferred);
return deferred;
},
promise: function(cookie) {
for(let i=0,_i=this.pending.length; i<_i; i++)
if(this.pending[i] && this.pending[i].cookie === cookie ) {
let defer = this.pending[i];
this.pending[i] = null;
return defer;
}
return null;
},
response_handler: postal.subscribe({
channel: "system",
topic: "rpc.response",
callback: function (data, envelope) {
//console.log("rpc-response: ", envelope);
let defer = this._rpc.promise(data.cookie);
if(defer!==null) {
defer.resolve(data.response);
}
}.bind(this)
})
}
};
if(arguments.length <2)
return false;
let args = [];
constructor(sipProvider) {
this.storage = new ArrayList()
this.sipProvider = sipProvider
postal.subscribe({
channel: "processor",
topic: "transaction.terminated",
callback: data => this.removeContext(data.transactionId)
})
postal.subscribe({
channel: "processor",
topic: "transaction.cancel",
callback: data => this.cancelTransaction(data.transactionId)
})
}
componentDidMount(){
this.subscription = Postal.subscribe({
channel: 'editor',
topic: 'add-table-step',
callback: data => {
if (this.props.adder.active){
if (data.evt) data.evt.preventDefault();
this.props.addOnClick(data.evt);
}
}
});
},
subscribe(topic, callback){
this.subscriptions.push(Postal.subscribe({
channel: 'editor',
topic: topic,
callback: callback
}));
}
EventBus.prototype.subscribe = function (parameters) {
return {
unsubscribe: postal.subscribe(parameters).unsubscribe,
channel: parameters.channel,
topic: parameters.topic
};
};
static register(obj) {
obj.actions = {};
obj.subscription = postal.subscribe({
channel: "ui",
topic: "msg",
callback: (function (data) {
if (this.actions[data.name]) {
SseMsg.saveLastMsg(data.name, data.argument);
this.actions[data.name](data.argument);
}
}).bind(obj)
});
obj.sendMsg = (function (name, argument) {
postal.publish({
channel: "ui",
topic: "msg",
data: {
name: name,
callback: (data, envelope) => {
const aor = aorAsString(data.addressOfRecord)
this.removeEndpoint(aor, data.contactURI, data.isWildcard)
}
})
postal.subscribe({
channel: "locator",
topic: "endpoint.add",
callback: (data, envelope) => {
const aor = aorAsString(data.addressOfRecord)
this.addEndpoint(aor, data.route)
}
})
postal.subscribe({
channel: "locator",
topic: "endpoint.find",
callback: (data, envelope) => {
const response = this.findEndpoint(
aorAsString(data.addressOfRecord))
postal.publish({
channel: "locator",
topic: "endpoint.find.reply",
data: {
response: response,
requestId: data.requestId
}
})
}
})
}
componentDidMount(){
Postal.subscribe({
channel: 'explorer',
topic: 'shortcut-help',
callback: data => {
if (!this.state.isModalOpen){
this.handleToggle();
}
}
})
},
componentDidMount: function(){
var element = ReactDOM.findDOMNode(this);
element.focus();
if (this.state.value){
if (this.props.arg.changed){
element.setSelectionRange(this.state.value.length, this.state.value.length);
}
else {
element.setSelectionRange(0, this.state.value.length);
}
}
this.subscription = Postal.subscribe({
channel: 'editor',
topic: 'apply-changes',
callback: (data, envelope) => {
var value = ReactDOM.findDOMNode(this).value;
if (value != this.state.value){
this.publishChange(value);
}
}
});
},