| Left: | ||
| Right: |
| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 Eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 Subscription.prototype = | 49 Subscription.prototype = |
| 50 { | 50 { |
| 51 /** | 51 /** |
| 52 * Download location of the subscription | 52 * Download location of the subscription |
| 53 * @type String | 53 * @type String |
| 54 */ | 54 */ |
| 55 url: null, | 55 url: null, |
| 56 | 56 |
| 57 /** | 57 /** |
| 58 * Filters contained in the filter subscription | 58 * Filters contained in the filter subscription |
| 59 * @type Array of Filter | 59 * @type Filter[] |
| 60 */ | 60 */ |
| 61 filters: null, | 61 filters: null, |
| 62 | 62 |
| 63 _title: null, | 63 _title: null, |
| 64 _fixedTitle: false, | 64 _fixedTitle: false, |
| 65 _disabled: false, | 65 _disabled: false, |
| 66 | 66 |
| 67 /** | 67 /** |
| 68 * Title of the filter subscription | 68 * Title of the filter subscription |
| 69 * @type String | 69 * @type String |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 { | 116 { |
| 117 let oldValue = this._disabled; | 117 let oldValue = this._disabled; |
| 118 this._disabled = value; | 118 this._disabled = value; |
| 119 FilterNotifier.triggerListeners("subscription.disabled", this, value, oldV alue); | 119 FilterNotifier.triggerListeners("subscription.disabled", this, value, oldV alue); |
| 120 } | 120 } |
| 121 return this._disabled; | 121 return this._disabled; |
| 122 }, | 122 }, |
| 123 | 123 |
| 124 /** | 124 /** |
| 125 * Serializes the subscription to an array of strings for writing out on the d isk. | 125 * Serializes the subscription to an array of strings for writing out on the d isk. |
| 126 * @param {Array of String} buffer buffer to push the serialization results i nto | 126 * @param {string[]} buffer to push the serialization results into |
|
Wladimir Palant
2015/03/30 18:58:05
Having "buffer" twice here wasn't a mistake - the
Sebastian Noack
2015/03/30 22:51:55
Oh, yeah. You're right.
| |
| 127 */ | 127 */ |
| 128 serialize: function(buffer) | 128 serialize: function(buffer) |
| 129 { | 129 { |
| 130 buffer.push("[Subscription]"); | 130 buffer.push("[Subscription]"); |
| 131 buffer.push("url=" + this.url); | 131 buffer.push("url=" + this.url); |
| 132 buffer.push("title=" + this._title); | 132 buffer.push("title=" + this._title); |
| 133 if (this._fixedTitle) | 133 if (this._fixedTitle) |
| 134 buffer.push("fixedTitle=true"); | 134 buffer.push("fixedTitle=true"); |
| 135 if (this._disabled) | 135 if (this._disabled) |
| 136 buffer.push("disabled=true"); | 136 buffer.push("disabled=true"); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 265 } | 265 } |
| 266 exports.SpecialSubscription = SpecialSubscription; | 266 exports.SpecialSubscription = SpecialSubscription; |
| 267 | 267 |
| 268 SpecialSubscription.prototype = | 268 SpecialSubscription.prototype = |
| 269 { | 269 { |
| 270 __proto__: Subscription.prototype, | 270 __proto__: Subscription.prototype, |
| 271 | 271 |
| 272 /** | 272 /** |
| 273 * Filter types that should be added to this subscription by default | 273 * Filter types that should be added to this subscription by default |
| 274 * (entries should correspond to keys in SpecialSubscription.defaultsMap). | 274 * (entries should correspond to keys in SpecialSubscription.defaultsMap). |
| 275 * @type Array of String | 275 * @type string[] |
| 276 */ | 276 */ |
| 277 defaults: null, | 277 defaults: null, |
| 278 | 278 |
| 279 /** | 279 /** |
| 280 * Tests whether a filter should be added to this group by default | 280 * Tests whether a filter should be added to this group by default |
| 281 * @param {Filter} filter filter to be tested | 281 * @param {Filter} filter filter to be tested |
| 282 * @return {Boolean} | 282 * @return {Boolean} |
| 283 */ | 283 */ |
| 284 isDefaultFor: function(filter) | 284 isDefaultFor: function(filter) |
| 285 { | 285 { |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 588 if (this.errors) | 588 if (this.errors) |
| 589 buffer.push("errors=" + this.errors); | 589 buffer.push("errors=" + this.errors); |
| 590 if (this.version) | 590 if (this.version) |
| 591 buffer.push("version=" + this.version); | 591 buffer.push("version=" + this.version); |
| 592 if (this.requiredVersion) | 592 if (this.requiredVersion) |
| 593 buffer.push("requiredVersion=" + this.requiredVersion); | 593 buffer.push("requiredVersion=" + this.requiredVersion); |
| 594 if (this.downloadCount) | 594 if (this.downloadCount) |
| 595 buffer.push("downloadCount=" + this.downloadCount); | 595 buffer.push("downloadCount=" + this.downloadCount); |
| 596 } | 596 } |
| 597 }; | 597 }; |
| OLD | NEW |