Bladeren bron

fix keyword tallying

tags/v1.0.6^0
Jonathan Cobb 4 jaren geleden
bovenliggende
commit
bdbea4d3ec
2 gewijzigde bestanden met toevoegingen van 6 en 3 verwijderingen
  1. +5
    -2
      bubble-server/src/main/resources/bubble/rule/social/block/JsUserBlockerRuleDriver.js.hbs
  2. +1
    -1
      bubble-server/src/main/resources/bubble/rule/social/block/site/FB.js.hbs

+ 5
- 2
bubble-server/src/main/resources/bubble/rule/social/block/JsUserBlockerRuleDriver.js.hbs Bestand weergeven

@@ -217,7 +217,7 @@ function {{JS_PREFIX}}_mark_removed(node) {
if (notRemoved) {
node.className = node.className += ' {{JS_PREFIX}}_bub_removed_for_keyword';
}
return notRemoved === false;
return notRemoved;
}

function {{JS_PREFIX}}_includes_block_keyword (element, firstEval) {
@@ -230,13 +230,16 @@ function {{JS_PREFIX}}_includes_block_keyword (element, firstEval) {
let cskw = kw.substring(1);
if (html.indexOf(cskw) !== -1) {
// {{PAGE_PREFIX}}_log('>>> includes_block_keyword: blocking based on case-sensitive keyword: ' + cskw);
if ({{JS_PREFIX}}_mark_removed(element)) {{JS_PREFIX}}_tally_keyword_block(cskw);
if ({{JS_PREFIX}}_mark_removed(element)) {
{{JS_PREFIX}}_tally_keyword_block(cskw);
}
if (!firstEval) {{JS_PREFIX}}_untally_allow();
return true;
}
} else {
if (html.toLowerCase().indexOf(kw.toLowerCase()) !== -1) {
// {{PAGE_PREFIX}}_log('>>> includes_block_keyword: blocking based on case-insensitive keyword: ' + kw);
console.log('>>> includes_block_keyword: blocking based on case-insensitive keyword: ' + kw);
if ({{JS_PREFIX}}_mark_removed(element)) {{JS_PREFIX}}_tally_keyword_block(kw);
if (!firstEval) {{JS_PREFIX}}_untally_allow();
return true;


+ 1
- 1
bubble-server/src/main/resources/bubble/rule/social/block/site/FB.js.hbs Bestand weergeven

@@ -170,7 +170,7 @@ function {{JS_PREFIX}}_should_block(blocked_users, article) {
return authorName == null ? true : authorName;

} else if (authorName in blocked_users) {
// log('should_block returning blocked user: '+authorName);
// log('found blocked user: '+authorName);
{{JS_PREFIX}}_tally_author_block(authorName == null ? {{PAGE_PREFIX}}_msg_or_default({{JS_PREFIX}}_messages, 'web_advertOrOtherBlock', 'ad/other') : authorName);
if (!firstEval) {{JS_PREFIX}}_untally_allow();
return authorName == null ? true : authorName;


Laden…
Annuleren
Opslaan