1window.mediator = (function() { 2 return { 3 trackers: {}, 4 publish: function(tracker) { 5 if (!mediator.trackers[tracker]) { 6 return false; 7 } 8 var args = Array.prototype.slice.call(arguments, 1); 9 for (var i = 0, l = mediator.trackers[tracker].length; i < l; i++) { 10 var subscription = mediator.trackers[tracker][i]; 11 subscription.callback.apply(subscription.context, args); 12 } 13 return this; 14 }, 15 publishAll: function() { 16 if (Object.keys(mediator.trackers).length === 0) { 17 return false; 18 } 19 for (var tracker in mediator.trackers) { 20 if (mediator.trackers.hasOwnProperty(tracker)) { 21 var args = [tracker].concat(Array.prototype.slice.call(arguments)); 22 mediator.publish.apply(this, args); 23 } 24 } 25 return this; 26 }, 27 subscribe: function(tracker, fn) { 28 if (!mediator.trackers[tracker]) { 29 mediator.trackers[tracker] = []; 30 } 31 mediator.trackers[tracker].push({context: this, callback: fn}); 32 return this; 33 } 34 }; 35})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.