diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6da0c1cca..0e63862ac 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,9 @@
### v1.14.6
+**v1.14.6.2** *(2019-03-31)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.6.2/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.6.2/builds/4chan-X-noupdate.crx)]
+- Support filters that apply to multiple post fields joined by newline characters.
+
**v1.14.6.1** *(2019-03-30)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.6.1/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.6.1/builds/4chan-X-noupdate.crx)]
- Fix errors in certain userscript managers introduced in v1.14.6.0. #2256
diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx
index ba35107fd..9096e1e87 100644
Binary files a/builds/4chan-X-beta.crx and b/builds/4chan-X-beta.crx differ
diff --git a/builds/4chan-X-beta.meta.js b/builds/4chan-X-beta.meta.js
index 007d7e459..c5debe96b 100644
--- a/builds/4chan-X-beta.meta.js
+++ b/builds/4chan-X-beta.meta.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X beta
-// @version 1.14.6.1
+// @version 1.14.6.2
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
diff --git a/builds/4chan-X-beta.user.js b/builds/4chan-X-beta.user.js
index 73703a470..105f70804 100644
--- a/builds/4chan-X-beta.user.js
+++ b/builds/4chan-X-beta.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X beta
-// @version 1.14.6.1
+// @version 1.14.6.2
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -198,7 +198,7 @@ docSet = function() {
};
g = {
- VERSION: '1.14.6.1',
+ VERSION: '1.14.6.2',
NAMESPACE: '4chan X.',
boards: {}
};
@@ -8119,7 +8119,7 @@ Filter = (function() {
filters: {},
results: {},
init: function() {
- var base, base1, board, boards, boardsRaw, err, excludes, excludesRaw, file, filter, hide, hl, i, isstring, j, k, key, l, len, len1, len2, len3, line, mask, noti, nsfwBoards, op, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9, regexp, sfwBoards, stub, top, type, types;
+ var base, base1, board, boards, boardsRaw, err, excludes, excludesRaw, file, filter, hide, hl, i, isstring, j, key, l, len, len1, len2, len3, line, m, mask, noti, nsfwBoards, op, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9, regexp, sfwBoards, stub, top, type, types;
if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Filter'])) {
return;
}
@@ -8154,8 +8154,8 @@ Filter = (function() {
if (excludesRaw) {
excludes = {};
ref5 = excludesRaw.replace('nsfw', nsfwBoards).replace('sfw', sfwBoards).split(',');
- for (k = 0, len2 = ref5.length; k < len2; k++) {
- board = ref5[k];
+ for (l = 0, len2 = ref5.length; l < len2; l++) {
+ board = ref5[l];
excludes[board] = true;
}
} else {
@@ -8201,9 +8201,7 @@ Filter = (function() {
}
if (key === 'general') {
if ((types = filter.match(/(?:^|;)\s*type:([^;]*)/))) {
- types = types[1].split(',').filter(function(x) {
- return x in Config.filter && x !== 'general';
- });
+ types = types[1].split(',');
} else {
types = ['subject', 'name', 'filename', 'comment'];
}
@@ -8222,8 +8220,8 @@ Filter = (function() {
noti: noti
};
if (key === 'general') {
- for (l = 0, len3 = types.length; l < len3; l++) {
- type = types[l];
+ for (m = 0, len3 = types.length; m < len3; m++) {
+ type = types[m];
((base = this.filters)[type] || (base[type] = [])).push(filter);
}
} else {
@@ -8258,7 +8256,7 @@ Filter = (function() {
mask = (post.isReply ? 2 : 1);
mask = mask | (post.file ? 4 : 8);
for (key in Filter.filters) {
- if (((value = Filter[key](post)) != null)) {
+ if (((value = Filter.value(key, post)) != null)) {
ref = Filter.filters[key];
for (i = 0, len = ref.length; i < len; i++) {
filter = ref[i];
@@ -8320,49 +8318,61 @@ Filter = (function() {
isHidden: function(post) {
return !!Filter.test(post).hide;
},
- postID: function(post) {
- return "" + post.ID;
+ valueF: {
+ postID: function(post) {
+ return "" + post.ID;
+ },
+ name: function(post) {
+ return post.info.name;
+ },
+ uniqueID: function(post) {
+ return post.info.uniqueID || '';
+ },
+ tripcode: function(post) {
+ return post.info.tripcode;
+ },
+ capcode: function(post) {
+ return post.info.capcode;
+ },
+ pass: function(post) {
+ return post.info.pass;
+ },
+ subject: function(post) {
+ return post.info.subject || (post.isReply ? void 0 : '');
+ },
+ comment: function(post) {
+ var base;
+ return (base = post.info).comment != null ? base.comment : base.comment = Build.parseComment(post.info.commentHTML.innerHTML);
+ },
+ flag: function(post) {
+ return post.info.flag;
+ },
+ filename: function(post) {
+ var ref;
+ return (ref = post.file) != null ? ref.name : void 0;
+ },
+ dimensions: function(post) {
+ var ref;
+ return (ref = post.file) != null ? ref.dimensions : void 0;
+ },
+ filesize: function(post) {
+ var ref;
+ return (ref = post.file) != null ? ref.size : void 0;
+ },
+ MD5: function(post) {
+ var ref;
+ return (ref = post.file) != null ? ref.MD5 : void 0;
+ }
},
- name: function(post) {
- return post.info.name;
- },
- uniqueID: function(post) {
- return post.info.uniqueID || '';
- },
- tripcode: function(post) {
- return post.info.tripcode;
- },
- capcode: function(post) {
- return post.info.capcode;
- },
- pass: function(post) {
- return post.info.pass;
- },
- subject: function(post) {
- return post.info.subject || (post.isReply ? void 0 : '');
- },
- comment: function(post) {
- var base;
- return (base = post.info).comment != null ? base.comment : base.comment = Build.parseComment(post.info.commentHTML.innerHTML);
- },
- flag: function(post) {
- return post.info.flag;
- },
- filename: function(post) {
- var ref;
- return (ref = post.file) != null ? ref.name : void 0;
- },
- dimensions: function(post) {
- var ref;
- return (ref = post.file) != null ? ref.dimensions : void 0;
- },
- filesize: function(post) {
- var ref;
- return (ref = post.file) != null ? ref.size : void 0;
- },
- MD5: function(post) {
- var ref;
- return (ref = post.file) != null ? ref.MD5 : void 0;
+ value: function(key, post) {
+ if (key in Filter.valueF) {
+ return Filter.valueF[key](post);
+ } else {
+ return key.split('+').map(function(k) {
+ var base;
+ return (typeof (base = Filter.valueF)[k] === "function" ? base[k](post) : void 0) || '';
+ }).join('\n');
+ }
},
addFilter: function(type, re, cb) {
return $.get(type, Conf[type], function(item) {
@@ -8437,7 +8447,7 @@ Filter = (function() {
el: el,
open: function(post) {
var value;
- value = Filter[type](post);
+ value = Filter.value(type, post);
return value != null;
}
};
@@ -8445,7 +8455,7 @@ Filter = (function() {
makeFilter: function() {
var re, type, value;
type = this.dataset.type;
- value = Filter[type](Filter.menu.post);
+ value = Filter.value(type, Filter.menu.post);
re = type === 'uniqueID' || type === 'MD5' ? value : Filter.escape(value);
re = type === 'uniqueID' || type === 'MD5' ? "/" + re + "/" : "/^" + re + "$/";
return Filter.addFilter(type, re, function() {
@@ -12525,7 +12535,7 @@ Settings = (function() {
};
});
$.extend(div, {
- innerHTML: "
Filter is disabled.
Use regular expressions, one per line.
Lines starting with a # will be ignored.
For example, /weeaboo/i will filter posts containing the string \`weeaboo\`, case-insensitive.
MD5 and Unique ID filtering use exact string matching, not regular expressions.
You can use these settings with each regular expression, separate them with semicolons:- Per boards, separate them with commas. It is global if not specified. Use
sfw and nsfw to reference all worksafe or not-worksafe boards.
For example: boards:a,jp;.
- In case of a global rule or one that uses
sfw/nsfw, select boards to be excluded from the filter.
For example: exclude:vg,v;. - Filter OPs only along with their threads (\`only\`) or replies only (\`no\`).
For example: op:only; or op:no;. - Filter only posts with files (\`only\`) or only posts without files (\`no\`).
For example: file:only; or file:no;. - Overrule the \`Show Stubs\` setting if specified: create a stub (\`yes\`) or not (\`no\`).
For example: stub:yes; or stub:no;. - Highlight instead of hiding. You can specify a class name to use with a userstyle.
For example: highlight; or highlight:wallpaper;. - Highlighted OPs will have their threads put on top of the board index by default.
For example: top:yes; or top:no;. - Show a desktop notification instead of hiding.
For example: notify;. - Filters in the \"General\" section apply to multiple fields, by default
subject,name,filename,comment.
The fields can be specified with the type option, separated by commas.
For example: type:" + E.cat(filterTypes) + ";.
Note: If you're using the native catalog rather than 4chan X's catalog, 4chan X's filters do not apply there.
The native catalog has its own separate filter list.
"
+ innerHTML: "Filter is disabled.
Use regular expressions, one per line.
Lines starting with a # will be ignored.
For example, /weeaboo/i will filter posts containing the string \`weeaboo\`, case-insensitive.
MD5 and Unique ID filtering use exact string matching, not regular expressions.
You can use these settings with each regular expression, separate them with semicolons:- Per boards, separate them with commas. It is global if not specified. Use
sfw and nsfw to reference all worksafe or not-worksafe boards.
For example: boards:a,jp;.
- In case of a global rule or one that uses
sfw/nsfw, select boards to be excluded from the filter.
For example: exclude:vg,v;. - Filter OPs only along with their threads (\`only\`) or replies only (\`no\`).
For example: op:only; or op:no;. - Filter only posts with files (\`only\`) or only posts without files (\`no\`).
For example: file:only; or file:no;. - Overrule the \`Show Stubs\` setting if specified: create a stub (\`yes\`) or not (\`no\`).
For example: stub:yes; or stub:no;. - Highlight instead of hiding. You can specify a class name to use with a userstyle.
For example: highlight; or highlight:wallpaper;. - Highlighted OPs will have their threads put on top of the board index by default.
For example: top:yes; or top:no;. - Show a desktop notification instead of hiding.
For example: notify;. - Filters in the \"General\" section apply to multiple fields, by default
subject,name,filename,comment.
The fields can be specified with the type option, separated by commas.
For example: type:" + E.cat(filterTypes) + ";.
Types can also be combined with a + sign; this indicates the filter applies to the given fields joined by newlines.
For example: type:filename+filesize+dimensions;.
Note: If you're using the native catalog rather than 4chan X's catalog, 4chan X's filters do not apply there.
The native catalog has its own separate filter list.
"
});
return $('.warning', div).hidden = Conf['Filter'];
},
@@ -16295,7 +16305,7 @@ ArchiveLink = (function() {
} : function(post) {
var typeParam, value;
typeParam = type === 'country' && post.info.flagCodeTroll ? 'tag' : type;
- value = type === 'country' ? post.info.flagCode || post.info.flagCodeTroll : Filter[type](post);
+ value = type === 'country' ? post.info.flagCode || post.info.flagCodeTroll : Filter.value(type, post);
if (!value) {
return false;
}
diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx
index 15b53e91e..7ad00a86b 100644
Binary files a/builds/4chan-X-noupdate.crx and b/builds/4chan-X-noupdate.crx differ
diff --git a/builds/4chan-X-noupdate.user.js b/builds/4chan-X-noupdate.user.js
index fdb87f338..3cad14873 100644
--- a/builds/4chan-X-noupdate.user.js
+++ b/builds/4chan-X-noupdate.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
-// @version 1.14.6.1
+// @version 1.14.6.2
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -198,7 +198,7 @@ docSet = function() {
};
g = {
- VERSION: '1.14.6.1',
+ VERSION: '1.14.6.2',
NAMESPACE: '4chan X.',
boards: {}
};
@@ -8119,7 +8119,7 @@ Filter = (function() {
filters: {},
results: {},
init: function() {
- var base, base1, board, boards, boardsRaw, err, excludes, excludesRaw, file, filter, hide, hl, i, isstring, j, k, key, l, len, len1, len2, len3, line, mask, noti, nsfwBoards, op, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9, regexp, sfwBoards, stub, top, type, types;
+ var base, base1, board, boards, boardsRaw, err, excludes, excludesRaw, file, filter, hide, hl, i, isstring, j, key, l, len, len1, len2, len3, line, m, mask, noti, nsfwBoards, op, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9, regexp, sfwBoards, stub, top, type, types;
if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Filter'])) {
return;
}
@@ -8154,8 +8154,8 @@ Filter = (function() {
if (excludesRaw) {
excludes = {};
ref5 = excludesRaw.replace('nsfw', nsfwBoards).replace('sfw', sfwBoards).split(',');
- for (k = 0, len2 = ref5.length; k < len2; k++) {
- board = ref5[k];
+ for (l = 0, len2 = ref5.length; l < len2; l++) {
+ board = ref5[l];
excludes[board] = true;
}
} else {
@@ -8201,9 +8201,7 @@ Filter = (function() {
}
if (key === 'general') {
if ((types = filter.match(/(?:^|;)\s*type:([^;]*)/))) {
- types = types[1].split(',').filter(function(x) {
- return x in Config.filter && x !== 'general';
- });
+ types = types[1].split(',');
} else {
types = ['subject', 'name', 'filename', 'comment'];
}
@@ -8222,8 +8220,8 @@ Filter = (function() {
noti: noti
};
if (key === 'general') {
- for (l = 0, len3 = types.length; l < len3; l++) {
- type = types[l];
+ for (m = 0, len3 = types.length; m < len3; m++) {
+ type = types[m];
((base = this.filters)[type] || (base[type] = [])).push(filter);
}
} else {
@@ -8258,7 +8256,7 @@ Filter = (function() {
mask = (post.isReply ? 2 : 1);
mask = mask | (post.file ? 4 : 8);
for (key in Filter.filters) {
- if (((value = Filter[key](post)) != null)) {
+ if (((value = Filter.value(key, post)) != null)) {
ref = Filter.filters[key];
for (i = 0, len = ref.length; i < len; i++) {
filter = ref[i];
@@ -8320,49 +8318,61 @@ Filter = (function() {
isHidden: function(post) {
return !!Filter.test(post).hide;
},
- postID: function(post) {
- return "" + post.ID;
+ valueF: {
+ postID: function(post) {
+ return "" + post.ID;
+ },
+ name: function(post) {
+ return post.info.name;
+ },
+ uniqueID: function(post) {
+ return post.info.uniqueID || '';
+ },
+ tripcode: function(post) {
+ return post.info.tripcode;
+ },
+ capcode: function(post) {
+ return post.info.capcode;
+ },
+ pass: function(post) {
+ return post.info.pass;
+ },
+ subject: function(post) {
+ return post.info.subject || (post.isReply ? void 0 : '');
+ },
+ comment: function(post) {
+ var base;
+ return (base = post.info).comment != null ? base.comment : base.comment = Build.parseComment(post.info.commentHTML.innerHTML);
+ },
+ flag: function(post) {
+ return post.info.flag;
+ },
+ filename: function(post) {
+ var ref;
+ return (ref = post.file) != null ? ref.name : void 0;
+ },
+ dimensions: function(post) {
+ var ref;
+ return (ref = post.file) != null ? ref.dimensions : void 0;
+ },
+ filesize: function(post) {
+ var ref;
+ return (ref = post.file) != null ? ref.size : void 0;
+ },
+ MD5: function(post) {
+ var ref;
+ return (ref = post.file) != null ? ref.MD5 : void 0;
+ }
},
- name: function(post) {
- return post.info.name;
- },
- uniqueID: function(post) {
- return post.info.uniqueID || '';
- },
- tripcode: function(post) {
- return post.info.tripcode;
- },
- capcode: function(post) {
- return post.info.capcode;
- },
- pass: function(post) {
- return post.info.pass;
- },
- subject: function(post) {
- return post.info.subject || (post.isReply ? void 0 : '');
- },
- comment: function(post) {
- var base;
- return (base = post.info).comment != null ? base.comment : base.comment = Build.parseComment(post.info.commentHTML.innerHTML);
- },
- flag: function(post) {
- return post.info.flag;
- },
- filename: function(post) {
- var ref;
- return (ref = post.file) != null ? ref.name : void 0;
- },
- dimensions: function(post) {
- var ref;
- return (ref = post.file) != null ? ref.dimensions : void 0;
- },
- filesize: function(post) {
- var ref;
- return (ref = post.file) != null ? ref.size : void 0;
- },
- MD5: function(post) {
- var ref;
- return (ref = post.file) != null ? ref.MD5 : void 0;
+ value: function(key, post) {
+ if (key in Filter.valueF) {
+ return Filter.valueF[key](post);
+ } else {
+ return key.split('+').map(function(k) {
+ var base;
+ return (typeof (base = Filter.valueF)[k] === "function" ? base[k](post) : void 0) || '';
+ }).join('\n');
+ }
},
addFilter: function(type, re, cb) {
return $.get(type, Conf[type], function(item) {
@@ -8437,7 +8447,7 @@ Filter = (function() {
el: el,
open: function(post) {
var value;
- value = Filter[type](post);
+ value = Filter.value(type, post);
return value != null;
}
};
@@ -8445,7 +8455,7 @@ Filter = (function() {
makeFilter: function() {
var re, type, value;
type = this.dataset.type;
- value = Filter[type](Filter.menu.post);
+ value = Filter.value(type, Filter.menu.post);
re = type === 'uniqueID' || type === 'MD5' ? value : Filter.escape(value);
re = type === 'uniqueID' || type === 'MD5' ? "/" + re + "/" : "/^" + re + "$/";
return Filter.addFilter(type, re, function() {
@@ -12525,7 +12535,7 @@ Settings = (function() {
};
});
$.extend(div, {
- innerHTML: "Filter is disabled.
Use regular expressions, one per line.
Lines starting with a # will be ignored.
For example, /weeaboo/i will filter posts containing the string \`weeaboo\`, case-insensitive.
MD5 and Unique ID filtering use exact string matching, not regular expressions.
You can use these settings with each regular expression, separate them with semicolons:- Per boards, separate them with commas. It is global if not specified. Use
sfw and nsfw to reference all worksafe or not-worksafe boards.
For example: boards:a,jp;.
- In case of a global rule or one that uses
sfw/nsfw, select boards to be excluded from the filter.
For example: exclude:vg,v;. - Filter OPs only along with their threads (\`only\`) or replies only (\`no\`).
For example: op:only; or op:no;. - Filter only posts with files (\`only\`) or only posts without files (\`no\`).
For example: file:only; or file:no;. - Overrule the \`Show Stubs\` setting if specified: create a stub (\`yes\`) or not (\`no\`).
For example: stub:yes; or stub:no;. - Highlight instead of hiding. You can specify a class name to use with a userstyle.
For example: highlight; or highlight:wallpaper;. - Highlighted OPs will have their threads put on top of the board index by default.
For example: top:yes; or top:no;. - Show a desktop notification instead of hiding.
For example: notify;. - Filters in the \"General\" section apply to multiple fields, by default
subject,name,filename,comment.
The fields can be specified with the type option, separated by commas.
For example: type:" + E.cat(filterTypes) + ";.
Note: If you're using the native catalog rather than 4chan X's catalog, 4chan X's filters do not apply there.
The native catalog has its own separate filter list.
"
+ innerHTML: "Filter is disabled.
Use regular expressions, one per line.
Lines starting with a # will be ignored.
For example, /weeaboo/i will filter posts containing the string \`weeaboo\`, case-insensitive.
MD5 and Unique ID filtering use exact string matching, not regular expressions.
You can use these settings with each regular expression, separate them with semicolons:- Per boards, separate them with commas. It is global if not specified. Use
sfw and nsfw to reference all worksafe or not-worksafe boards.
For example: boards:a,jp;.
- In case of a global rule or one that uses
sfw/nsfw, select boards to be excluded from the filter.
For example: exclude:vg,v;. - Filter OPs only along with their threads (\`only\`) or replies only (\`no\`).
For example: op:only; or op:no;. - Filter only posts with files (\`only\`) or only posts without files (\`no\`).
For example: file:only; or file:no;. - Overrule the \`Show Stubs\` setting if specified: create a stub (\`yes\`) or not (\`no\`).
For example: stub:yes; or stub:no;. - Highlight instead of hiding. You can specify a class name to use with a userstyle.
For example: highlight; or highlight:wallpaper;. - Highlighted OPs will have their threads put on top of the board index by default.
For example: top:yes; or top:no;. - Show a desktop notification instead of hiding.
For example: notify;. - Filters in the \"General\" section apply to multiple fields, by default
subject,name,filename,comment.
The fields can be specified with the type option, separated by commas.
For example: type:" + E.cat(filterTypes) + ";.
Types can also be combined with a + sign; this indicates the filter applies to the given fields joined by newlines.
For example: type:filename+filesize+dimensions;.
Note: If you're using the native catalog rather than 4chan X's catalog, 4chan X's filters do not apply there.
The native catalog has its own separate filter list.
"
});
return $('.warning', div).hidden = Conf['Filter'];
},
@@ -16295,7 +16305,7 @@ ArchiveLink = (function() {
} : function(post) {
var typeParam, value;
typeParam = type === 'country' && post.info.flagCodeTroll ? 'tag' : type;
- value = type === 'country' ? post.info.flagCode || post.info.flagCodeTroll : Filter[type](post);
+ value = type === 'country' ? post.info.flagCode || post.info.flagCodeTroll : Filter.value(type, post);
if (!value) {
return false;
}
diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx
index 97603c2a5..293135387 100644
Binary files a/builds/4chan-X.crx and b/builds/4chan-X.crx differ
diff --git a/builds/4chan-X.meta.js b/builds/4chan-X.meta.js
index 1205e1d78..6ca776f27 100644
--- a/builds/4chan-X.meta.js
+++ b/builds/4chan-X.meta.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
-// @version 1.14.6.1
+// @version 1.14.6.2
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js
index 45a33b681..9bebe5c1c 100644
--- a/builds/4chan-X.user.js
+++ b/builds/4chan-X.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
-// @version 1.14.6.1
+// @version 1.14.6.2
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -198,7 +198,7 @@ docSet = function() {
};
g = {
- VERSION: '1.14.6.1',
+ VERSION: '1.14.6.2',
NAMESPACE: '4chan X.',
boards: {}
};
@@ -8119,7 +8119,7 @@ Filter = (function() {
filters: {},
results: {},
init: function() {
- var base, base1, board, boards, boardsRaw, err, excludes, excludesRaw, file, filter, hide, hl, i, isstring, j, k, key, l, len, len1, len2, len3, line, mask, noti, nsfwBoards, op, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9, regexp, sfwBoards, stub, top, type, types;
+ var base, base1, board, boards, boardsRaw, err, excludes, excludesRaw, file, filter, hide, hl, i, isstring, j, key, l, len, len1, len2, len3, line, m, mask, noti, nsfwBoards, op, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9, regexp, sfwBoards, stub, top, type, types;
if (!(((ref = g.VIEW) === 'index' || ref === 'thread') && Conf['Filter'])) {
return;
}
@@ -8154,8 +8154,8 @@ Filter = (function() {
if (excludesRaw) {
excludes = {};
ref5 = excludesRaw.replace('nsfw', nsfwBoards).replace('sfw', sfwBoards).split(',');
- for (k = 0, len2 = ref5.length; k < len2; k++) {
- board = ref5[k];
+ for (l = 0, len2 = ref5.length; l < len2; l++) {
+ board = ref5[l];
excludes[board] = true;
}
} else {
@@ -8201,9 +8201,7 @@ Filter = (function() {
}
if (key === 'general') {
if ((types = filter.match(/(?:^|;)\s*type:([^;]*)/))) {
- types = types[1].split(',').filter(function(x) {
- return x in Config.filter && x !== 'general';
- });
+ types = types[1].split(',');
} else {
types = ['subject', 'name', 'filename', 'comment'];
}
@@ -8222,8 +8220,8 @@ Filter = (function() {
noti: noti
};
if (key === 'general') {
- for (l = 0, len3 = types.length; l < len3; l++) {
- type = types[l];
+ for (m = 0, len3 = types.length; m < len3; m++) {
+ type = types[m];
((base = this.filters)[type] || (base[type] = [])).push(filter);
}
} else {
@@ -8258,7 +8256,7 @@ Filter = (function() {
mask = (post.isReply ? 2 : 1);
mask = mask | (post.file ? 4 : 8);
for (key in Filter.filters) {
- if (((value = Filter[key](post)) != null)) {
+ if (((value = Filter.value(key, post)) != null)) {
ref = Filter.filters[key];
for (i = 0, len = ref.length; i < len; i++) {
filter = ref[i];
@@ -8320,49 +8318,61 @@ Filter = (function() {
isHidden: function(post) {
return !!Filter.test(post).hide;
},
- postID: function(post) {
- return "" + post.ID;
+ valueF: {
+ postID: function(post) {
+ return "" + post.ID;
+ },
+ name: function(post) {
+ return post.info.name;
+ },
+ uniqueID: function(post) {
+ return post.info.uniqueID || '';
+ },
+ tripcode: function(post) {
+ return post.info.tripcode;
+ },
+ capcode: function(post) {
+ return post.info.capcode;
+ },
+ pass: function(post) {
+ return post.info.pass;
+ },
+ subject: function(post) {
+ return post.info.subject || (post.isReply ? void 0 : '');
+ },
+ comment: function(post) {
+ var base;
+ return (base = post.info).comment != null ? base.comment : base.comment = Build.parseComment(post.info.commentHTML.innerHTML);
+ },
+ flag: function(post) {
+ return post.info.flag;
+ },
+ filename: function(post) {
+ var ref;
+ return (ref = post.file) != null ? ref.name : void 0;
+ },
+ dimensions: function(post) {
+ var ref;
+ return (ref = post.file) != null ? ref.dimensions : void 0;
+ },
+ filesize: function(post) {
+ var ref;
+ return (ref = post.file) != null ? ref.size : void 0;
+ },
+ MD5: function(post) {
+ var ref;
+ return (ref = post.file) != null ? ref.MD5 : void 0;
+ }
},
- name: function(post) {
- return post.info.name;
- },
- uniqueID: function(post) {
- return post.info.uniqueID || '';
- },
- tripcode: function(post) {
- return post.info.tripcode;
- },
- capcode: function(post) {
- return post.info.capcode;
- },
- pass: function(post) {
- return post.info.pass;
- },
- subject: function(post) {
- return post.info.subject || (post.isReply ? void 0 : '');
- },
- comment: function(post) {
- var base;
- return (base = post.info).comment != null ? base.comment : base.comment = Build.parseComment(post.info.commentHTML.innerHTML);
- },
- flag: function(post) {
- return post.info.flag;
- },
- filename: function(post) {
- var ref;
- return (ref = post.file) != null ? ref.name : void 0;
- },
- dimensions: function(post) {
- var ref;
- return (ref = post.file) != null ? ref.dimensions : void 0;
- },
- filesize: function(post) {
- var ref;
- return (ref = post.file) != null ? ref.size : void 0;
- },
- MD5: function(post) {
- var ref;
- return (ref = post.file) != null ? ref.MD5 : void 0;
+ value: function(key, post) {
+ if (key in Filter.valueF) {
+ return Filter.valueF[key](post);
+ } else {
+ return key.split('+').map(function(k) {
+ var base;
+ return (typeof (base = Filter.valueF)[k] === "function" ? base[k](post) : void 0) || '';
+ }).join('\n');
+ }
},
addFilter: function(type, re, cb) {
return $.get(type, Conf[type], function(item) {
@@ -8437,7 +8447,7 @@ Filter = (function() {
el: el,
open: function(post) {
var value;
- value = Filter[type](post);
+ value = Filter.value(type, post);
return value != null;
}
};
@@ -8445,7 +8455,7 @@ Filter = (function() {
makeFilter: function() {
var re, type, value;
type = this.dataset.type;
- value = Filter[type](Filter.menu.post);
+ value = Filter.value(type, Filter.menu.post);
re = type === 'uniqueID' || type === 'MD5' ? value : Filter.escape(value);
re = type === 'uniqueID' || type === 'MD5' ? "/" + re + "/" : "/^" + re + "$/";
return Filter.addFilter(type, re, function() {
@@ -12525,7 +12535,7 @@ Settings = (function() {
};
});
$.extend(div, {
- innerHTML: "Filter is disabled.
Use regular expressions, one per line.
Lines starting with a # will be ignored.
For example, /weeaboo/i will filter posts containing the string \`weeaboo\`, case-insensitive.
MD5 and Unique ID filtering use exact string matching, not regular expressions.
You can use these settings with each regular expression, separate them with semicolons:- Per boards, separate them with commas. It is global if not specified. Use
sfw and nsfw to reference all worksafe or not-worksafe boards.
For example: boards:a,jp;.
- In case of a global rule or one that uses
sfw/nsfw, select boards to be excluded from the filter.
For example: exclude:vg,v;. - Filter OPs only along with their threads (\`only\`) or replies only (\`no\`).
For example: op:only; or op:no;. - Filter only posts with files (\`only\`) or only posts without files (\`no\`).
For example: file:only; or file:no;. - Overrule the \`Show Stubs\` setting if specified: create a stub (\`yes\`) or not (\`no\`).
For example: stub:yes; or stub:no;. - Highlight instead of hiding. You can specify a class name to use with a userstyle.
For example: highlight; or highlight:wallpaper;. - Highlighted OPs will have their threads put on top of the board index by default.
For example: top:yes; or top:no;. - Show a desktop notification instead of hiding.
For example: notify;. - Filters in the \"General\" section apply to multiple fields, by default
subject,name,filename,comment.
The fields can be specified with the type option, separated by commas.
For example: type:" + E.cat(filterTypes) + ";.
Note: If you're using the native catalog rather than 4chan X's catalog, 4chan X's filters do not apply there.
The native catalog has its own separate filter list.
"
+ innerHTML: "Filter is disabled.
Use regular expressions, one per line.
Lines starting with a # will be ignored.
For example, /weeaboo/i will filter posts containing the string \`weeaboo\`, case-insensitive.
MD5 and Unique ID filtering use exact string matching, not regular expressions.
You can use these settings with each regular expression, separate them with semicolons:- Per boards, separate them with commas. It is global if not specified. Use
sfw and nsfw to reference all worksafe or not-worksafe boards.
For example: boards:a,jp;.
- In case of a global rule or one that uses
sfw/nsfw, select boards to be excluded from the filter.
For example: exclude:vg,v;. - Filter OPs only along with their threads (\`only\`) or replies only (\`no\`).
For example: op:only; or op:no;. - Filter only posts with files (\`only\`) or only posts without files (\`no\`).
For example: file:only; or file:no;. - Overrule the \`Show Stubs\` setting if specified: create a stub (\`yes\`) or not (\`no\`).
For example: stub:yes; or stub:no;. - Highlight instead of hiding. You can specify a class name to use with a userstyle.
For example: highlight; or highlight:wallpaper;. - Highlighted OPs will have their threads put on top of the board index by default.
For example: top:yes; or top:no;. - Show a desktop notification instead of hiding.
For example: notify;. - Filters in the \"General\" section apply to multiple fields, by default
subject,name,filename,comment.
The fields can be specified with the type option, separated by commas.
For example: type:" + E.cat(filterTypes) + ";.
Types can also be combined with a + sign; this indicates the filter applies to the given fields joined by newlines.
For example: type:filename+filesize+dimensions;.
Note: If you're using the native catalog rather than 4chan X's catalog, 4chan X's filters do not apply there.
The native catalog has its own separate filter list.
"
});
return $('.warning', div).hidden = Conf['Filter'];
},
@@ -16295,7 +16305,7 @@ ArchiveLink = (function() {
} : function(post) {
var typeParam, value;
typeParam = type === 'country' && post.info.flagCodeTroll ? 'tag' : type;
- value = type === 'country' ? post.info.flagCode || post.info.flagCodeTroll : Filter[type](post);
+ value = type === 'country' ? post.info.flagCode || post.info.flagCodeTroll : Filter.value(type, post);
if (!value) {
return false;
}
diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip
index be4147313..ea2a20419 100644
Binary files a/builds/4chan-X.zip and b/builds/4chan-X.zip differ
diff --git a/builds/updates-beta.json b/builds/updates-beta.json
index b3b9aabea..f17ba62b3 100644
--- a/builds/updates-beta.json
+++ b/builds/updates-beta.json
@@ -3,7 +3,7 @@
"4chan-x@4chan-x.net": {
"updates": [
{
- "version": "1.14.6.1",
+ "version": "1.14.6.2",
"update_link": "https://www.4chan-x.net/builds/4chan-X-beta.crx"
}
]
diff --git a/builds/updates-beta.xml b/builds/updates-beta.xml
index 956e6d915..d8e45c1bf 100644
--- a/builds/updates-beta.xml
+++ b/builds/updates-beta.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/builds/updates.json b/builds/updates.json
index 59d4cd42e..e434a0857 100644
--- a/builds/updates.json
+++ b/builds/updates.json
@@ -3,7 +3,7 @@
"4chan-x@4chan-x.net": {
"updates": [
{
- "version": "1.14.6.1",
+ "version": "1.14.6.2",
"update_link": "https://www.4chan-x.net/builds/4chan-X.crx"
}
]
diff --git a/builds/updates.xml b/builds/updates.xml
index 76352b539..8e3303f21 100644
--- a/builds/updates.xml
+++ b/builds/updates.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/version.json b/version.json
index 69bc31783..658a4b64e 100644
--- a/version.json
+++ b/version.json
@@ -1,4 +1,4 @@
{
- "version": "1.14.6.1",
- "date": "2019-03-30T19:33:42.126Z"
+ "version": "1.14.6.2",
+ "date": "2019-03-31T07:55:25.631Z"
}
\ No newline at end of file