OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
3 * Copyright (C) 2006-2014 Eyeo GmbH | 3 * Copyright (C) 2006-2014 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 */ | 42 */ |
43 text: null, | 43 text: null, |
44 | 44 |
45 /** | 45 /** |
46 * Filter subscriptions the filter belongs to | 46 * Filter subscriptions the filter belongs to |
47 * @type Array of Subscription | 47 * @type Array of Subscription |
48 */ | 48 */ |
49 subscriptions: null, | 49 subscriptions: null, |
50 | 50 |
51 /** | 51 /** |
| 52 * Whether this is a user-defined filter |
| 53 * @type Boolean |
| 54 */ |
| 55 get isUserDefined() |
| 56 { |
| 57 let {SpecialSubscription} = require("subscriptionClasses"); |
| 58 let isUserDefined = this.subscriptions.some(s => s instanceof SpecialSubscri
ption); |
| 59 |
| 60 Object.defineProperty(this, "isUserDefined", {value: isUserDefined}); |
| 61 return isUserDefined; |
| 62 }, |
| 63 |
| 64 /** |
52 * Serializes the filter to an array of strings for writing out on the disk. | 65 * Serializes the filter to an array of strings for writing out on the disk. |
53 * @param {Array of String} buffer buffer to push the serialization results i
nto | 66 * @param {Array of String} buffer buffer to push the serialization results i
nto |
54 */ | 67 */ |
55 serialize: function(buffer) | 68 serialize: function(buffer) |
56 { | 69 { |
57 buffer.push("[Filter]"); | 70 buffer.push("[Filter]"); |
58 buffer.push("text=" + this.text); | 71 buffer.push("text=" + this.text); |
59 }, | 72 }, |
60 | 73 |
61 toString: function() | 74 toString: function() |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
940 function ElemHideException(text, domains, selector) | 953 function ElemHideException(text, domains, selector) |
941 { | 954 { |
942 ElemHideBase.call(this, text, domains, selector); | 955 ElemHideBase.call(this, text, domains, selector); |
943 } | 956 } |
944 exports.ElemHideException = ElemHideException; | 957 exports.ElemHideException = ElemHideException; |
945 | 958 |
946 ElemHideException.prototype = | 959 ElemHideException.prototype = |
947 { | 960 { |
948 __proto__: ElemHideBase.prototype | 961 __proto__: ElemHideBase.prototype |
949 }; | 962 }; |
OLD | NEW |