Created
January 3, 2014 16:16
-
-
Save coderaven/8240644 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Facebook Number Game Hider - By Raven D. | |
// @namespace http://facebook.com | |
// @description Will automatically hide number game posts on facebook | |
// @include http*://*.facebook.com/* | |
// @version 8 | |
// @grant GM_getValue | |
// @grant GM_setValue | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js | |
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js | |
// @grant unsafeWindow | |
// ==/UserScript== | |
function hideNumberGame (jNode) { | |
$(".showerhiddden").click(function() { | |
$(this).parent().prev().show(); | |
$(this).parent().hide(); | |
}); | |
$(".userContentWrapper").filter(function(index){ | |
var patt= new RegExp("([#]+\\s*\\W*[0-9]+)|(\\bno[\\.]+\\s*[0-9]+)","i"); | |
return patt.test($(this).text()) && !$(this).hasClass("numhide"); | |
}).addClass("numhide").hide().after(function(index){ | |
if (!$(this).next().hasClass("is-hidden")){ | |
return "<div class=is-hidden style='background:#405D9B;color:white'> Content is Hidden .. <button type=button class=showerhiddden style=background:white;float:right;>Show</button></div>"; | |
} | |
}); | |
} | |
waitForKeyElements (".userContentWrapper", hideNumberGame); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment