Changeset 164

Show
Ignore:
Timestamp:
11/13/07 03:00:37 (14 months ago)
Author:
chris
Message:

Fixed some layout issues with the removed blocks
added removing of sponsored ads

Files:
1 modified

Legend:

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

    r159 r164  
    11// Facebook App Spam Remover 
    2 // Version 1.0-SVN 
     2// Version 1.01-SVN 
    33 
    44// This Greasemonkey script removes the application spam which has 
     
    4949 
    5050divs = document.getElementsByTagName('div'); 
    51 pattern = new RegExp("(^|\\s)app_story(\\s|$)"); 
     51pattern = new RegExp("(^|\\s)(ad_capsule|app_story)(\\s|$)"); 
    5252for (i = 0; divs && i < divs.length; i ++) { 
    53         if (pattern.test(divs[i].className)) { 
     53        classes = pattern.exec(divs[i].className) 
     54        if (classes) { 
    5455                divs[i].style.display = "none"; 
    55                 divs[i].previousSibling.lastChild.style.display = "none"; 
    56                 divs[i].nextSibling.style.padding = 0; 
    57                 divs[i].nextSibling.className="clearfix"; 
     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                        } 
     61                        divs[i].nextSibling.style.padding = 0; 
     62                        divs[i].nextSibling.className="clearfix"; 
     63                } 
    5864        } 
    5965}