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 */
var announcer = (function (spec, my) {
var that = {},
announcement_o = {};
spec = spec || {}; spec = spec || {};
my = my || {}; my = my || {};
// Attributes //
var announcement_o = {};
// Methods // // Methods //
that.register = function(name) { that.register = function (name) {
if(!announcement_o[name]) { if (!announcement_o[name]) {
announcement_o[name] = announcement(); announcement_o[name] = announcement();
} }
}; };
that.unregister = function(name) { that.unregister = function (name) {
if (announcement_o[name]) { if (announcement_o[name]) {
delete announcement_o[name]; delete announcement_o[name];
} }
}; };
that.at = function(name) { that.at = function (name) {
return announcement_o[name]; return announcement_o[name];
}; };
that.on = function(name, callback) { that.on = function (name, callback) {
that.register(name); that.register(name);
that.at(name).add(callback); that.at(name).add(callback);
}; };
that.trigger = function(name, args) { that.trigger = function (name, args) {
that.at(name).trigger(args); that.at(name).trigger(args);
}; };
......
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