/* * q.js v2018.3-6.1 * http://anonsw.github.io/8chjs/ */ // User Settings var anonsw = { qflair: '', // Examples: REAL, → qcolor: '#ffc', youcolor: '#fcc', scrollcolor: 'rgba(153, 153, 153, 0.6)', scrollbackcolor: '#333', scrolltime: 400, // ms updateDelay: 200, // ms sidenavWidth: 30, // px rateHistoryLen: 50, // Data points on chart rateAvgLen: 10 // Number of data points to average for instantaneous rate // Suggestions from 589388.html#590283 // ...shill detection features, such as // easily knowing the proportion of posts from a user that don't link. // I'd want to know any ID that was posting > 1/3 posts targetting noone. // TODO: Behavior for post hover should be to show original post visual before all q.js mods // TODO: Add flags to turn on/off features // TODO: Custom-regex -> post color/fade (auto-filter by selecting text and choosing new menu item?) // Examples: daily reminder, guys, check this out, shill, get out, filtered, tell us more, archive everything // TODO: Manual shade // TODO: remove Q trip codes from post content? // TODO: remove Q from end of post content if not a Q post? // TODO: recognize all of known Q trip codes? (make to sure to exclude known comps) // TODO: Links to reset on current Q/(you) post // TODO: Link to go to latest post (end key doesn't always work, but try capturing that as well?) // TODO: Keyboard shortcuts for navigation // TODO: Current/Total overall post navigation // TODO: Remap end key to always go to end of page // TODO: Check box for each post to mark as "read", "spam", ? // TODO: Autocorrect all-caps posts (50% threshold)? // TODO: Correct broken links but remove referral when clicked? // TODO: Make flood post fading non-linear to give leniency to posters just passing flood threshold // TODO: Penalize reposts in flood detection (if id's different, merge?) ? // TODO: Scorecard of posters ordered by post count (post rate, reply count, ...)? // TODO: Color/shade posts where there are no references and no question marks // TODO: If Q or trip used in name field, strike them out or replace with Anonymous? // TODO: embedded posts in Q posts don't have background-color and inherit Q color, fix? }; !function(t,$,n){var e,s,r,h,l=[],o=[],a=-1,c=[],d=-1,f=[],p=[],v=[];function g(t){$("html, body").animate({scrollTop:$(t).offset().top-$("div.boardlist").height()},anonsw.scrolltime)}function u(){return $(c).each(function(){$(this).css("background-color",anonsw.youcolor)}),$.Deferred().resolve()}function w(){return $('div.body:icontains("(You)")').each(function(){$(this).find(":not(small)").contents().filter(function(){return 3==this.nodeType}).each(function(){this.textContent=this.textContent.replace(/\(+ *You *\)+/gi,"you")})}),$.Deferred().resolve()}function y(){return $(o).each(function(t,n){$(n).css("background-color")!==anonsw.qcolor&&(""!==anonsw.qflair&&$(n).find("p.intro > label > span.trip").first().prepend(anonsw.qflair+" "),$(n).css("background-color",anonsw.qcolor))}),$.Deferred().resolve()}function m(){var t,n=-1;for(a>l.length&&(a=l.length),d>c.length&&(d=c.length),i=0;i$(window).scrollTop()){a=i;break}}for(i=0;i$(window).scrollTop()){d=i;break}}$(".qcount").text("("+(a+1)+":"+l.length+")"),$(".youcount").text("("+(d+1)+":"+c.length+")")}function b(){var t=$("#sidenav");if(t.length){for($(t).css("height",$(window).height()-$("div.boardlist").height()),h=e.canvas.height/($(window).height()-$("div.boardlist").height()),e.clearRect(0,0,e.canvas.width,e.canvas.height),f=[],e.fillStyle=anonsw.qcolor,i=0;ianonsw.rateAvgLen){var s=Math.max.apply(null,v),r=Math.min.apply(null,v);s-.5 p.intro > label span.name > span.own_post, div.post:not(.post-hover) > div.body > p.body-line > small:icontains("(You)")'),function(t){return $(t).closest("div.post")}),$.Deferred().resolve()}function k(){(l=$.map($('div.post:not(.post-hover) > p.intro > label > span.trip:contains("!!Hs1Jq13jV6")'),function(t){return $(t).closest("div.post")}),o=$.map($('div.post:not(.post-hover) > p.intro > label > span.trip:contains("!!Hs1Jq13jV6")'),function(t){return $(t).closest("div.post")}),$.Deferred().resolve()).done(y).done(w).done(_).done(u).done(x)}!function($){var e,i=$.fn.on;$.fn.on=function(){var t=Array.apply(null,arguments),n=t[t.length-1];if(isNaN(n)||1===n&&t.pop())return i.apply(this,t);var o=t.pop(),a=t.pop();return t.push(function(){var t=this,n=arguments;clearTimeout(e),e=setTimeout(function(){a.apply(t,n)},o)}),i.apply(this,t)}}(this.jQuery||this.Zepto),$.expr[":"].icontains=jQuery.expr.createPseudo(function(n){return function(t){return 0<=jQuery(t).text().toUpperCase().indexOf(n.toUpperCase())}}),t.nextq=function(){0[ Q (?:?) ]'),$("div.boardlist").append('[ (You) (?:?) ]'),function(){var n=$("div.boardlist").height()-1;$("div.boardlist").append('[ Post Rate: 0 posts/min ]'),$(".postRate").css("color",$("div.boardlist a").css("color"));var t=$(".postRateChart");$(t).each(function(){$(this).css("width","100px"),$(this).css("height",n),$(this).css("vertical-align","middle");var t=$(this).get(0).getContext("2d");t.canvas.height=20,t.canvas.width=100})}(),function(){$("body").append('');var t=$("#sidenav");$(t).css("position","fixed"),$(t).css("top",$("div.boardlist").height()),$(t).css("right",0),$(t).css("width",anonsw.sidenavWidth),$(t).css("height",$(window).height()-$("div.boardlist").height()),$(t).css("background-color",anonsw.scrollbackcolor),$("body").css("margin-right",anonsw.sidenavWidth),(e=$("#sidenav").get(0).getContext("2d")).canvas.height=2048,e.canvas.width=anonsw.sidenavWidth,s=1,r=e.canvas.width/2}(),k();var t=$("div.thread")[0];new MutationObserver(function(t){for(var n in t)if("childList"==t[n].type){k();break}}).observe(t,{childList:!0})}}(window.anonsw_main=window.anonsw_main||{},jQuery),$(document).ready(anonsw_main.Q);