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 */
spec = spec || {}; var announcement = function (spec, my) {
my = my || {}; var that = {},
// Attributes // callback_a = [],
var callback_a = []; announcer = spec.announcer || {};
var name = spec.name || '';
var announcer = spec.announcer || {};
// Methods //
that.add = function(callback) {
callback_a.push(callback);
};
that.remove = function(callback) { spec = spec || {};
var i, tmp_callback_a = []; my = my || {};
for (i = 0; i < callback_a.length; i+= 1) {
if (callback_a[i] !== callback) {
tmp_callback_a.push(callback_a[i]);
}
}
callback_a = tmp_callback_a;
};
that.register = function() { // Methods //
announcer.register(that); that.add = function (callback) {
}; callback_a.push(callback);
};
that.unregister = function() { that.remove = function (callback) {
announcer.unregister(that); var i, tmp_callback_a = [];
}; for (i = 0; i < callback_a.length; i += 1) {
if (callback_a[i] !== callback) {
tmp_callback_a.push(callback_a[i]);
}
}
callback_a = tmp_callback_a;
};
that.trigger = function(args) { that.register = function () {
var i; announcer.register(that);
for(i = 0; i < callback_a.length; i++) { };
callback_a[i].apply(null, args);
}
};
return that; that.unregister = function () {
announcer.unregister(that);
};
that.trigger = function (args) {
var i;
for (i = 0; i < callback_a.length; i += 1) {
callback_a[i].apply(null, 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