Changeset 166

Show
Ignore:
Timestamp:
11/17/07 15:04:28 (14 months ago)
Author:
chris
Message:

Fixed removal of bumper line when multiple spam lines are together

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • facebook-app-spam/trunk/facebookappspamremover.user.js

    r164 r166  
    11// Facebook App Spam Remover 
    2 // Version 1.01-SVN 
     2// Version 1.02-SVN 
    33 
    44// This Greasemonkey script removes the application spam which has 
     
    4949 
    5050divs = document.getElementsByTagName('div'); 
    51 pattern = new RegExp("(^|\\s)(ad_capsule|app_story)(\\s|$)"); 
     51spampattern = new RegExp("(^|\\s)(ad_capsule|app_story)(\\s|$)"); 
     52bumperpattern = new RegExp("(^|\\s)bumper(\\s|$)"); 
     53classpattern = new RegExp("(^|\\s)(one_liner|one_liner_cluster)(\\s|$)"); 
    5254for (i = 0; divs && i < divs.length; i ++) { 
    53         classes = pattern.exec(divs[i].className) 
    54         if (classes) { 
     55        if (spampattern.test(divs[i].className)) { 
    5556                divs[i].style.display = "none"; 
    56                 linepattern = new RegExp("(^|\\s)(one_liner|one_liner_cluster)(\\s|$)"); 
    57                 if (linepattern.test(divs[i].nextSibling.className)) { 
    58                         if (classes[2] == 'app_story') { 
    59                                 divs[i].previousSibling.lastChild.style.display = "none"; 
    60                         } 
     57                if (bumperpattern.test(divs[i].previousSibling.lastChild.className)) { 
     58                        divs[i].previousSibling.lastChild.style.display = "none"; 
     59                } 
     60                if (classpattern.test(divs[i].nextSibling.className)) { 
    6161                        divs[i].nextSibling.style.padding = 0; 
    6262                        divs[i].nextSibling.className="clearfix";