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-present eyeo GmbH | 3 * Copyright (C) 2006-present 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 if ("fixedTitle" in obj) | 223 if ("fixedTitle" in obj) |
224 result._fixedTitle = (obj.fixedTitle == "true"); | 224 result._fixedTitle = (obj.fixedTitle == "true"); |
225 if ("disabled" in obj) | 225 if ("disabled" in obj) |
226 result._disabled = (obj.disabled == "true"); | 226 result._disabled = (obj.disabled == "true"); |
227 | 227 |
228 return result; | 228 return result; |
229 }; | 229 }; |
230 | 230 |
231 /** | 231 /** |
232 * Class for special filter subscriptions (user's filters) | 232 * Class for special filter subscriptions (user's filters) |
233 * @param {string} url see Subscription() | 233 * @param {string} url see {@link Subscription Subscription()} |
234 * @param {string} [title] see Subscription() | 234 * @param {string} [title] see {@link Subscription Subscription()} |
235 * @constructor | 235 * @constructor |
236 * @augments Subscription | 236 * @augments Subscription |
237 */ | 237 */ |
238 function SpecialSubscription(url, title) | 238 function SpecialSubscription(url, title) |
239 { | 239 { |
240 Subscription.call(this, url, title); | 240 Subscription.call(this, url, title); |
241 } | 241 } |
242 exports.SpecialSubscription = SpecialSubscription; | 242 exports.SpecialSubscription = SpecialSubscription; |
243 | 243 |
244 SpecialSubscription.prototype = extend(Subscription, { | 244 SpecialSubscription.prototype = extend(Subscription, { |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 subscription.defaults = [type]; | 327 subscription.defaults = [type]; |
328 } | 328 } |
329 if (!subscription.defaults) | 329 if (!subscription.defaults) |
330 subscription.defaults = ["blocking"]; | 330 subscription.defaults = ["blocking"]; |
331 return subscription; | 331 return subscription; |
332 }; | 332 }; |
333 | 333 |
334 /** | 334 /** |
335 * Abstract base class for regular filter subscriptions (both | 335 * Abstract base class for regular filter subscriptions (both |
336 * internally and externally updated) | 336 * internally and externally updated) |
337 * @param {string} url see Subscription() | 337 * @param {string} url see {@link Subscription Subscription()} |
338 * @param {string} [title] see Subscription() | 338 * @param {string} [title] see {@link Subscription Subscription()} |
339 * @constructor | 339 * @constructor |
340 * @augments Subscription | 340 * @augments Subscription |
341 */ | 341 */ |
342 function RegularSubscription(url, title) | 342 function RegularSubscription(url, title) |
343 { | 343 { |
344 Subscription.call(this, url, title || url); | 344 Subscription.call(this, url, title || url); |
345 } | 345 } |
346 exports.RegularSubscription = RegularSubscription; | 346 exports.RegularSubscription = RegularSubscription; |
347 | 347 |
348 RegularSubscription.prototype = extend(Subscription, { | 348 RegularSubscription.prototype = extend(Subscription, { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 Subscription.prototype.serialize.call(this, buffer); | 399 Subscription.prototype.serialize.call(this, buffer); |
400 if (this._homepage) | 400 if (this._homepage) |
401 buffer.push("homepage=" + this._homepage); | 401 buffer.push("homepage=" + this._homepage); |
402 if (this._lastDownload) | 402 if (this._lastDownload) |
403 buffer.push("lastDownload=" + this._lastDownload); | 403 buffer.push("lastDownload=" + this._lastDownload); |
404 } | 404 } |
405 }); | 405 }); |
406 | 406 |
407 /** | 407 /** |
408 * Class for filter subscriptions updated externally (by other extension) | 408 * Class for filter subscriptions updated externally (by other extension) |
409 * @param {string} url see Subscription() | 409 * @param {string} url see {@link Subscription Subscription()} |
410 * @param {string} [title] see Subscription() | 410 * @param {string} [title] see {@link Subscription Subscription()} |
411 * @constructor | 411 * @constructor |
412 * @augments RegularSubscription | 412 * @augments RegularSubscription |
413 */ | 413 */ |
414 function ExternalSubscription(url, title) | 414 function ExternalSubscription(url, title) |
415 { | 415 { |
416 RegularSubscription.call(this, url, title); | 416 RegularSubscription.call(this, url, title); |
417 } | 417 } |
418 exports.ExternalSubscription = ExternalSubscription; | 418 exports.ExternalSubscription = ExternalSubscription; |
419 | 419 |
420 ExternalSubscription.prototype = extend(RegularSubscription, { | 420 ExternalSubscription.prototype = extend(RegularSubscription, { |
421 /** | 421 /** |
422 * See Subscription.serialize() | 422 * See Subscription.serialize() |
423 * @inheritdoc | 423 * @inheritdoc |
424 */ | 424 */ |
425 serialize(buffer) | 425 serialize(buffer) |
426 { | 426 { |
427 throw new Error( | 427 throw new Error( |
428 "Unexpected call, external subscriptions should not be serialized" | 428 "Unexpected call, external subscriptions should not be serialized" |
429 ); | 429 ); |
430 } | 430 } |
431 }); | 431 }); |
432 | 432 |
433 /** | 433 /** |
434 * Class for filter subscriptions updated externally (by other extension) | 434 * Class for filter subscriptions updated externally (by other extension) |
435 * @param {string} url see Subscription() | 435 * @param {string} url see {@link Subscription Subscription()} |
436 * @param {string} [title] see Subscription() | 436 * @param {string} [title] see {@link Subscription Subscription()} |
437 * @constructor | 437 * @constructor |
438 * @augments RegularSubscription | 438 * @augments RegularSubscription |
439 */ | 439 */ |
440 function DownloadableSubscription(url, title) | 440 function DownloadableSubscription(url, title) |
441 { | 441 { |
442 RegularSubscription.call(this, url, title); | 442 RegularSubscription.call(this, url, title); |
443 } | 443 } |
444 exports.DownloadableSubscription = DownloadableSubscription; | 444 exports.DownloadableSubscription = DownloadableSubscription; |
445 | 445 |
446 DownloadableSubscription.prototype = extend(RegularSubscription, { | 446 DownloadableSubscription.prototype = extend(RegularSubscription, { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 if (this.errors) | 566 if (this.errors) |
567 buffer.push("errors=" + this.errors); | 567 buffer.push("errors=" + this.errors); |
568 if (this.version) | 568 if (this.version) |
569 buffer.push("version=" + this.version); | 569 buffer.push("version=" + this.version); |
570 if (this.requiredVersion) | 570 if (this.requiredVersion) |
571 buffer.push("requiredVersion=" + this.requiredVersion); | 571 buffer.push("requiredVersion=" + this.requiredVersion); |
572 if (this.downloadCount) | 572 if (this.downloadCount) |
573 buffer.push("downloadCount=" + this.downloadCount); | 573 buffer.push("downloadCount=" + this.downloadCount); |
574 } | 574 } |
575 }); | 575 }); |
OLD | NEW |