Changeset 699
- Timestamp:
- 03/28/08 05:10:23 (8 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/manage-ui2/src/chrome/chromeFiles/content/config.js
r695 r699 14 14 15 15 Config.prototype = { 16 addObserver: function(observer, script) { 17 var observers = script ? script._observers : this._observers; 18 observers.push(observer); 19 }, 20 21 removeObserver: function(observer, script) { 22 var observers = script ? script._observers : this._observers; 23 var index = observers.indexOf(observer); 16 addObserver: function(observer) { 17 this._observers.push(observer); 18 }, 19 20 removeObserver: function(observer) { 21 var index = this._observers.indexOf(observer); 24 22 if (index == -1) throw new Error("Observer not found"); 25 observers.splice(index, 1);23 this._observers.splice(index, 1); 26 24 }, 27 25 … … 399 397 400 398 Script.prototype = { 399 addObserver: Config.prototype.addObserver, 400 removeObserver: Config.prototype.removeObserver, 401 401 402 matchesURL: function(url) { 402 403 function test(page) { branches/manage-ui2/src/chrome/chromeFiles/content/pages-overlay.js
r695 r699 18 18 excludesBox.populate(script, "excludes", script.excludes); 19 19 this.script = script; 20 GM_getConfig().addObserver(this, this.script);20 this.script.addObserver(this); 21 21 }; 22 22 23 23 this.clear = function() { 24 24 if (this.script == null) return; 25 GM_getConfig().removeObserver(this, this.script);25 this.script.removeObserver(this); 26 26 includesBox.clear(); 27 27 excludesBox.clear();
