Commit 4bf94351 authored by Sven Franck's avatar Sven Franck

jslint pass announcer.js

parent b4d3ba8e
var announcer = (function(spec, my) { /*jslint indent: 2, maxlen: 80, sloppy: true */
var that = {}; /*global announcement: true */
spec = spec || {}; var announcer = (function (spec, my) {
my = my || {}; var that = {},
// Attributes // announcement_o = {};
var announcement_o = {}; spec = spec || {};
// Methods // my = my || {};
that.register = function(name) {
if(!announcement_o[name]) {
announcement_o[name] = announcement();
}
};
that.unregister = function(name) { // Methods //
if (announcement_o[name]) { that.register = function (name) {
delete announcement_o[name]; if (!announcement_o[name]) {
} announcement_o[name] = announcement();
}; }
};
that.at = function(name) { that.unregister = function (name) {
return announcement_o[name]; if (announcement_o[name]) {
}; delete announcement_o[name];
}
};
that.on = function(name, callback) { that.at = function (name) {
that.register(name); return announcement_o[name];
that.at(name).add(callback); };
};
that.trigger = function(name, args) { that.on = function (name, callback) {
that.at(name).trigger(args); that.register(name);
}; that.at(name).add(callback);
};
return that; that.trigger = function (name, args) {
that.at(name).trigger(args);
};
return that;
}()); }());
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment