Soulkeeper;697480 Wrote: > I found a Greasemonkey script 'on this page' > (http://forums.hardwarezone.com.sg/eat-drink-man-woman-16/hide-those-annoying-threads-3056566.html), > and made a single modification (the @include parameter) to make it work > on forums.slimdevices.com. > > With this script, every forum thread comes with an "Ignore" link, so if > it annoys you, you can simply hide it, and it won't come back. The > ability to ignore whole threads can come in handy if the forum's > inbuilt 'user ignore list' > (http://forums.slimdevices.com/profile.php?do=ignorelist) simply > doesn't cut the mustard as whole threads turn into bizarre sideshows of > mutual technical fantasies and wilful self delusion. As a bonus, you can > now also hide all those sticky threads that you never read anyway > because they haven't been edited for years, filling up the top of each > subforum to varying degrees. > > Unfortunately, the thread will still show on the index.php page if > recently edited (not a problem with the stickys, though), but when you > enter the subforum itself, the script kicks in and hides the thread > from the list. > > The script runs in 'Greasemonkey' > (https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/) which in > turn runs in 'Firefox' (http://www.mozilla.org/en-US/firefox/fx/). If > you have several computers (or Firefox user profiles), you'll need to > install the script (and block threads) separately on each one. > > > Code: -------------------- > > > // ==UserScript== > // @name Hide Forum Threads > // @namespace ThreadFilter > // @description Hides threads in Vbulletin boards. > // @include http://forums.slimdevices.com/* > // ==/UserScript== > > //*************global variables > var splitCh = String.fromCharCode(255); > var filterseperator= ","; > > unsafeWindow._blockThread = > function(threadid) > { > window.setTimeout(SetKillFile, 0, threadid); > } > > function updateKillFile(list) > { > data = list.join(splitCh); > window.setTimeout(GM_setValue, 0, "ThreadBlockerFilterFile", escape(data)); > GM_setValue("ThreadBlockerFilterFile", escape(data)); > } > > //adds a Thread to the Killfile > function SetKillFile(killspec) > { > //get thread element for immediate removal > var row = document.getElementById("td_threadtitle_"+killspec) > row.parentNode.parentNode.removeChild(row.parentNode); > var splitCh = String.fromCharCode(255); > var data = ""; > var list = new Array(); > data = unescape(GM_getValue("ThreadBlockerFilterFile", "-----")); > list = data.split(splitCh); > list.push(killspec); > updateKillFile(list); > } > > function addThreadIgnoreLink (thisElement) > { > // Adding the Ignore-Link > threadid = threadid.substring(15); > var link = document.createElement('a'); > link.setAttribute('href', 'javascript:_blockThread("'+threadid+'")'); > link.setAttribute('style', 'float:right;font-size:xx-small;'); > link.innerHTML = "Ignore"; > thisElement.childNodes[1].appendChild(link); > } > > function filterThreads() > { > allElements = document.evaluate( > '//*[@title]', > document, > null, > XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, > null); > > for (var i = 0; i < allElements.snapshotLength; i++) { > thisElement = allElements.snapshotItem(i); > if (thisElement.nodeName.toUpperCase() == 'TD') > { > for( var x = 0; x < thisElement.attributes.length; x++ ) > { > if( thisElement.attributes[x].nodeName.toLowerCase() == 'title' ) > { > threadid = thisElement.getAttribute('id'); > if(threadid != null) > { > addThreadIgnoreLink(thisElement); > > //Filtering Threads > var data = unescape(GM_getValue("ThreadBlockerFilterFile", "-----")); > var list = data.split(splitCh); > for (var j=0; j<list.length; j++) { > //var tid = threadid.substring(13); > if (list[j] == threadid && list[j] != "" && threadid != "") > { > node = thisElement.parentNode; > if (node.parentNode != null) > { > node.parentNode.removeChild(node); > //alert('Thread deleted' + node.innerHTML); > > } > } > } > } > } > } > } > } > } > > > filterThreads(); > -------------------- > >
I'm not finding the Ignore link -- where is it? -- TimT ------------------------------------------------------------------------ TimT's Profile: http://forums.slimdevices.com/member.php?userid=22971 View this thread: http://forums.slimdevices.com/showthread.php?t=94286 _______________________________________________ discuss mailing list [email protected] http://lists.slimdevices.com/mailman/listinfo/discuss
