Commit c4165e2a authored by Sven Franck's avatar Sven Franck

jslint pass announcement.js

parent 4bf94351
var announcement = function(spec, my) { /*jslint indent: 2, maxlen: 80, sloppy: true */
var that = {}; /*global announcement: true */
var announcement = function (spec, my) {
var that = {},
callback_a = [],
announcer = spec.announcer || {};
spec = spec || {}; spec = spec || {};
my = my || {}; my = my || {};
// Attributes //
var callback_a = [];
var name = spec.name || '';
var announcer = spec.announcer || {};
// Methods // // Methods //
that.add = function(callback) { that.add = function (callback) {
callback_a.push(callback); callback_a.push(callback);
}; };
that.remove = function(callback) { that.remove = function (callback) {
var i, tmp_callback_a = []; var i, tmp_callback_a = [];
for (i = 0; i < callback_a.length; i+= 1) { for (i = 0; i < callback_a.length; i += 1) {
if (callback_a[i] !== callback) { if (callback_a[i] !== callback) {
tmp_callback_a.push(callback_a[i]); tmp_callback_a.push(callback_a[i]);
} }
...@@ -21,17 +23,17 @@ var announcement = function(spec, my) { ...@@ -21,17 +23,17 @@ var announcement = function(spec, my) {
callback_a = tmp_callback_a; callback_a = tmp_callback_a;
}; };
that.register = function() { that.register = function () {
announcer.register(that); announcer.register(that);
}; };
that.unregister = function() { that.unregister = function () {
announcer.unregister(that); announcer.unregister(that);
}; };
that.trigger = function(args) { that.trigger = function (args) {
var i; var i;
for(i = 0; i < callback_a.length; i++) { for (i = 0; i < callback_a.length; i += 1) {
callback_a[i].apply(null, args); callback_a[i].apply(null, 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