Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: node_modules/filterClasses.js

Issue 29336753: Issue 3671 - Split out contentBlockerList API (Closed)
Patch Set: Created Feb. 20, 2016, 9:59 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: node_modules/filterClasses.js
diff --git a/adblockplus.js b/node_modules/filterClasses.js
similarity index 96%
rename from adblockplus.js
rename to node_modules/filterClasses.js
index adabd0451da58fd87fe047199fa624a85fd41dde..788d6f7240869135c621f60a6ec622c0ecb67a2f 100644
--- a/adblockplus.js
+++ b/node_modules/filterClasses.js
@@ -17,10 +17,12 @@
//
// This file has been generated automatically, relevant repositories:
-// * https://hg.adblockplus.org/adblockplus/
// * https://hg.adblockplus.org/jshydra/
//
+var FilterNotifier = require("filterNotifier").FilterNotifier;
+var Utils = require("utils").Utils;
+
function Filter(text)
{
this.text = text;
@@ -168,6 +170,7 @@ ActiveFilter.prototype = {
{
var oldValue = this._disabled;
this._disabled = value;
+ FilterNotifier.triggerListeners("filter.disabled", this, value, oldValue);
}
return this._disabled;
},
@@ -181,6 +184,7 @@ ActiveFilter.prototype = {
{
var oldValue = this._hitCount;
this._hitCount = value;
+ FilterNotifier.triggerListeners("filter.hitCount", this, value, oldValue);
}
return this._hitCount;
},
@@ -194,6 +198,7 @@ ActiveFilter.prototype = {
{
var oldValue = this._lastHit;
this._lastHit = value;
+ FilterNotifier.triggerListeners("filter.lastHit", this, value, oldValue);
}
return this._lastHit;
},
@@ -636,7 +641,7 @@ ElemHideBase.fromText = function(text, domain, isException, tagName, attrRules,
{
if (id)
{
- return new InvalidFilter(text);
+ return new InvalidFilter(text, Utils.getString("filter_elemhide_duplicate_id"));
}
id = rule;
}
@@ -652,7 +657,7 @@ ElemHideBase.fromText = function(text, domain, isException, tagName, attrRules,
}
else
{
- return new InvalidFilter(text);
+ return new InvalidFilter(text, Utils.getString("filter_elemhide_nocriteria"));
}
}
if (isException)
@@ -664,7 +669,7 @@ ElemHideBase.fromText = function(text, domain, isException, tagName, attrRules,
{
if (!/,[^~][^,.]*\.[^,]/.test("," + domain))
{
- return new InvalidFilter(text);
+ return new InvalidFilter(text, Utils.getString("filter_cssproperty_nodomain"));
}
return new CSSPropertyFilter(text, domain, selector, match[2], selector.substr(0, match.index), selector.substr(match.index + match[0].length));
}
@@ -720,3 +725,4 @@ CSSPropertyFilter.prototype = {
return regexp;
}
};
+

Powered by Google App Engine
This is Rietveld