6 lines
No EOL
178 KiB
JavaScript
6 lines
No EOL
178 KiB
JavaScript
var $={};$.id=function(e){return document.getElementById(e)},$.cls=function(e,t){return(t||document).getElementsByClassName(e)},$.byName=function(e){return document.getElementsByName(e)},$.tag=function(e,t){return(t||document).getElementsByTagName(e)},$.el=function(e){return document.createElement(e)},$.qs=function(e,t){return(t||document).querySelector(e)},$.qsa=function(e,t){return(t||document).querySelectorAll(e)},$.extend=function(e,t){for(var a in t)e[a]=t[a]},$.on=function(e,t,a){e.addEventListener(t,a,!1)},$.off=function(e,t,a){e.removeEventListener(t,a,!1)},document.documentElement.classList?($.hasClass=function(e,t){return e.classList.contains(t)},$.addClass=function(e,t){e.classList.add(t)},$.removeClass=function(e,t){e.classList.remove(t)}):($.hasClass=function(e,t){return-1!=(" "+e.className+" ").indexOf(" "+t+" ")},$.addClass=function(e,t){e.className=""===e.className?t:e.className+" "+t},$.removeClass=function(e,t){e.className=(" "+e.className+" ").replace(" "+t+" ","")}),$.get=function(e,t,a){var i,n;if((n=new XMLHttpRequest).open("GET",e,!0),t)for(i in t)n[i]=t[i];if(a)for(i in a)n.setRequestHeader(i,a[i]);return n.send(null),n},$.xhr=function(e,t,a,i){var n,o,r;if((o=new XMLHttpRequest).open(e,t,!0),a)for(n in a)o[n]=a[n];if(i){r=new FormData;for(n in i)r.append(n,i[n]);i=r}else i=null;return o.send(i),o},$.fit=function(e,t,a,i){var n,o,r;return n=e/t,e>a?(o=a,(r=Math.round(o/n))>i&&(r=i,o=Math.round(r*n))):t>i?(r=i,(o=Math.round(r*n))>a&&(o=a,r=Math.round(o/n))):(o=e,r=t),[o,r]},$.ago=function(e){var t,a,i,n;return(t=Date.now()/1e3-e)<1?"moments ago":t<60?(0|t)+" seconds ago":t<3600?(a=0|t/60)>1?a+" minutes ago":"one minute ago":t<86400?(i=(a=0|t/3600)>1?a+" hours":"one hour",(n=0|t/60-60*a)>1&&(i+=" and "+n+" minutes"),i+" ago"):(i=(a=0|t/86400)>1?a+" days":"one day",(n=0|t/3600-24*a)>1&&(i+=" and "+n+" hours"),i+" ago")},$.hash=function(e){var t,a,i=0;for(t=0,a=e.length;t<a;++t)i=(i<<5)-i+e.charCodeAt(t);return i},$.prettySeconds=function(e){var t;return[t=Math.floor(e/60),Math.round(e-60*t)]},$.docEl=document.documentElement,$.cache={};var Parser={tipTimeout:null};Parser.init=function(){var e,t,a,i,n,o;(Config.filter||Config.linkify||Config.embedSoundCloud||Config.embedYouTube||Main.hasMobileLayout)&&(this.needMsg=!0),o="//s.4cdn.org/image/",n=window.devicePixelRatio>=2?"@2x.gif":".gif",this.icons={admin:o+"adminicon"+n,founder:o+"foundericon"+n,mod:o+"modicon"+n,dev:o+"developericon"+n,manager:o+"managericon"+n,del:o+"filedeleted-res"+n},this.prettify="function"==typeof prettyPrint,this.customSpoiler={},Config.localTime&&((e=(new Date).getTimezoneOffset())?(a=0|(t=Math.abs(e))/60,this.utcOffset="Timezone: UTC"+(e<0?"+":"-")+a+((i=t-60*a)?":"+i:"")):this.utcOffset="Timezone: UTC",this.weekdays=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]),Main.tid&&(this.trackedReplies=this.getTrackedReplies(Main.board,Main.tid),this.trackedReplies?this.touchTrackedReplies(Main.tid):this.trackedReplies={},this.pruneTrackedReplies()),this.postMenuIcon=Main.hasMobileLayout?"...":"\u25b6"},Parser.getTrackedReplies=function(e,t){var a=null;return(a=localStorage.getItem("4chan-track-"+e+"-"+t))&&(a=JSON.parse(a)),a},Parser.saveTrackedReplies=function(e,t){var a="4chan-track-"+Main.board+"-"+e;localStorage.setItem(a,JSON.stringify(t))},Parser.touchTrackedReplies=function(e){var t,a;a="4chan-track-"+Main.board+"-ts",(t=(t=localStorage.getItem(a))?JSON.parse(t):{})[e]=0|Date.now()/1e3,localStorage.setItem(a,JSON.stringify(t))},Parser.pruneTrackedReplies=function(){var e,t,a,i,n,o,r;if(o="4chan-track-"+Main.board+"-",t=localStorage.getItem(o+"ts")){n=259200,i=(a=0|Date.now()/1e3)-n,r=!1,t=JSON.parse(t),Main.tid&&t[Main.tid]&&(t[Main.tid]=a,r=!0);for(e in t)t[e]<=i&&(r=!0,delete t[e],localStorage.removeItem(o+e));if(r){localStorage.removeItem(o+"ts");for(e in t){localStorage.setItem(o+"ts",JSON.stringify(t));break}}}},Parser.parseThreadJSON=function(e){var t;try{t=JSON.parse(e).posts}catch(a){console.log(a),t=[]}return t},Parser.parseCatalogJSON=function(e){var t;try{t=JSON.parse(e)}catch(a){console.log(a),t=[]}return t},Parser.setCustomSpoiler=function(e,t){var a;!this.customSpoiler[e]&&(t=parseInt(t))&&(e==Main.board&&(a=$.cls("imgspoiler")[0])?this.customSpoiler[e]=a.firstChild.src.match(/spoiler(-[a-z0-9]+)\.png$/)[1]:this.customSpoiler[e]="-"+e+(Math.floor(Math.random()*t)+1))},Parser.buildPost=function(e,t,a){var i,n,o,r=null;for(i=0;n=e[i];++i)n.no==a&&(!Config.revealSpoilers&&e[0].custom_spoiler&&Parser.setCustomSpoiler(t,e[0].custom_spoiler),r=Parser.buildHTMLFromJSON(n,t,!1,!0).lastElementChild,Config.IDColor&&(o=$.cls("posteruid",r)[Main.hasMobileLayout?0:1])&&IDColor.applyRemote(o.firstElementChild));return r},Parser.decodeSpecialChars=function(e){return e.replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")},Parser.encodeSpecialChars=function(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")},Parser.onDateMouseOver=function(e){Parser.tipTimeout&&(clearTimeout(Parser.tipTimeout),Parser.tipTimeout=null),Parser.tipTimeout=setTimeout(Tip.show,500,e,$.ago(+e.getAttribute("data-utc")))},Parser.onTipMouseOut=function(){Parser.tipTimeout&&(clearTimeout(Parser.tipTimeout),Parser.tipTimeout=null)},Parser.onUIDMouseOver=function(e){var t;$.hasClass(e.parentNode,"posteruid")&&(Main.tid||(t=e.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode,$.hasClass(t,"tExpanded")))&&(Parser.tipTimeout&&(clearTimeout(Parser.tipTimeout),Parser.tipTimeout=null),Parser.tipTimeout=setTimeout(Parser.showUIDCount,500,e,e.textContent))},Parser.showUIDCount=function(e,t){var a,i,n,o,r;for(o=0,n=$.qsa(".postInfo .hand"),a=0;i=n[a];++a)i.textContent===t&&++o;r=o+" post"+(1!=o?"s":"")+" by this ID",Tip.show(e,r)},Parser.buildHTMLFromJSON=function(e,t,a,i){var n,o,r,s,d,l,c,p,h,u,g,m,f,b,v,C,w,y,x,k=document.createElement("div"),M=!1,T="",S="",R="",E="",N='"',$="",P="",L="",Q="",H="",D="",A="",I="",F="",q="",B="",_="",W="",O="reply",U="",z="",j="",J="",Y=!1;switch(x="//i.4cdn.org/"+t,e.resto?f=e.resto:(M=!0,a&&(e.replies>0?(y=e.replies+" Repl"+(e.replies>1?"ies":"y"),e.images>0&&(y+=" / "+e.images+" Image"+(e.images>1?"s":""))):y="",W='<div class="postLink mobile"><span class="info">'+y+'</span><a href="//boards.'+$L.d(t)+"/"+t+"/thread/"+e.no+'" class="button">View Thread</a></div>',O="op",_=' <span>[<a href="//boards.'+$L.d(t)+"/"+t+"/thread/"+e.no+(e.semantic_url?"/"+e.semantic_url:"")+'" class="replylink" rel="canonical">Reply</a>]</span>'),t!=Main.board&&(J='<span class="boardBlock">/'+t+"/</span> "),f=e.no),Main.tid&&t==Main.board?(h="#p"+e.no,u="javascript:quote('"+e.no+"')"):(h="//boards."+$L.d(t)+"/"+t+"/thread/"+f+"#p"+e.no,u="//boards."+$L.d(t)+"/"+t+"/thread/"+f+"#q"+e.no),n=!e.capcode&&e.id?' <span class="posteruid id_'+e.id+'">(ID: <span class="hand" title="Highlight posts by this ID">'+e.id+"</span>)</span> ":"",e.capcode){case"admin_highlight":F=" highlightPost";case"admin":D=' <strong class="capcode hand id_admin" title="Highlight posts by Administrators">## Admin</strong>',A=" capcodeAdmin",I=' <img src="'+Parser.icons.admin+'" alt="This user is a 4chan Administrator." title="This user is a 4chan Administrator." class="identityIcon">';break;case"mod":D=' <strong class="capcode hand id_mod" title="Highlight posts by Moderators">## Mod</strong>',A=" capcodeMod",I=' <img src="'+Parser.icons.mod+'" alt="This user is a 4chan Moderator." title="This user is a 4chan Moderator." class="identityIcon">';break;case"developer":D=' <strong class="capcode hand id_developer" title="Highlight posts by Developers">## Developer</strong>',A=" capcodeDeveloper",I=' <img src="'+Parser.icons.dev+'" alt="This user is a 4chan Developer." title="This user is a 4chan Developer." class="identityIcon">';break;case"manager":D=' <strong class="capcode hand id_manager" title="Highlight posts by Managers">## Manager</strong>',A=" capcodeManager",I=' <img src="'+Parser.icons.manager+'" alt="This user is a 4chan Manager." title="This user is a 4chan Manager." class="identityIcon">';break;case"founder":D=' <strong class="capcode hand id_admin" title="Highlight posts by the Founder">## Founder</strong>',A=" capcodeAdmin",I=' <img src="'+Parser.icons.founder+'" alt="This user is 4chan\'s Founder." title="This user is 4chan\'s Founder." class="identityIcon">';break;case"verified":D=' <strong class="capcode hand id_verified" title="Highlight posts by Verified Users">## Verified</strong>',A=" capcodeVerified",I=""}if(e.email&&(q='<a href="mailto:'+e.email.replace(/ /g,"%20")+'" class="useremail">',B="</a>"),d=e.flag_name?' <span title="'+e.flag_name+'" class="bfl bfl-'+e.board_flag.toLowerCase()+'"></span>':e.country_name?' <span title="'+e.country_name+'" class="flag flag-'+e.country.toLowerCase()+'"></span>':"",e.filedeleted?E='<div id="f'+e.no+'" class="file"><span class="fileThumb"><img src="'+Parser.icons.del+'" class="fileDeletedRes" alt="File deleted."></span></div>':e.ext&&(g=Parser.decodeSpecialChars(e.filename),L=Q=e.filename+e.ext,g.length>(M?40:30)&&(L=Parser.encodeSpecialChars(g.slice(0,M?35:25))+"(...)"+e.ext,Y=!0),e.tn_w||e.tn_h||".gif"!=e.ext||(e.tn_w=e.w,e.tn_h=e.h),$=e.fsize>=1048576?(0|e.fsize/1048576*100+.5)/100+" M":e.fsize>1024?(0|e.fsize/1024+.5)+" K":e.fsize+" ",e.spoiler?Config.revealSpoilers?s=L:(s="Spoiler Image",N='" title="'+Q+'"',P=" imgspoiler",o="//s.4cdn.org/image/spoiler"+(Parser.customSpoiler[t]||"")+".png",e.tn_w=100,e.tn_h=100,!0):s=L,o||(o="//i.4cdn.org/"+t+"/"+e.tim+"s.jpg"),T=".pdf"==e.ext?"PDF":e.w+"x"+e.h,"f"!=t?(S='<a class="fileThumb'+P+'" href="'+(r=x+"/"+e.tim+e.ext)+'" target="_blank"'+(e.m_img?" data-m":"")+'><img src="'+o+'" alt="'+$+'B" data-md5="'+e.md5+'" style="height: '+e.tn_h+"px; width: "+e.tn_w+'px;"><div data-tip data-tip-cb="mShowFull" class="mFileInfo mobile">'+$+"B "+e.ext.slice(1).toUpperCase()+"</div></a>",R='<div class="fileText" id="fT'+e.no+N+">File: <a"+(Y?' title="'+Q+'"':"")+' href="'+r+'" target="_blank">'+s+"</a> ("+$+"B, "+T+")</div>"):(r=x+"/"+e.filename+e.ext,T+=", "+e.tag,R='<div class="fileText" id="fT'+e.no+'">File: <a href="'+r+'" target="_blank">'+e.filename+".swf</a> ("+$+"B, "+T+")</div>"),E='<div id="f'+e.no+'" class="file">'+R+S+"</div>"),e.trip&&(H=' <span class="postertrip">'+e.trip+"</span>"),l=e.name||"",c=Main.hasMobileLayout&&l.length>30?'<span class="name" data-tip data-tip-cb="mShowFull">'+Parser.truncate(l,30)+"(...)</span> ":'<span class="name">'+l+"</span> ",M?(e.capcode_replies&&(z=Parser.buildCapcodeReplies(e.capcode_replies,t,e.no)),i&&e.replies&&(m=e.replies+" repl"+(e.replies>1?"ies":"y"),e.images&&(m+=" and "+e.images+" image"+(e.images>1?"s":"")),U='<span class="summary preview-summary">'+m+".</span>"),e.sticky&&(j+='<img class="stickyIcon retina" title="Sticky" alt="Sticky" src="'+Main.icons2.sticky+'"> '),e.closed&&(e.archived?j+='<img class="archivedIcon retina" title="Archived" alt="Archived" src="'+Main.icons2.archived+'"> ':j+='<img class="closedIcon retina" title="Closed" alt="Closed" src="'+Main.icons2.closed+'"> '),p=e.sub===undefined?'<span class="subject"></span> ':Main.hasMobileLayout&&e.sub.length>30?'<span class="subject" data-tip data-tip-cb="mShowFull">'+Parser.truncate(e.sub,30)+"(...)</span> ":'<span class="subject">'+e.sub+"</span> "):p="",k.className="postContainer "+O+"Container",k.id="pc"+e.no,e.xa24&&(k.className+=" p-xa24-"+e.xa24),k.innerHTML=(M?"":'<div class="sideArrows" id="sa'+e.no+'">>></div>')+'<div id="p'+e.no+'" class="post '+O+F+'"><div class="postInfoM mobile" id="pim'+e.no+'"><span class="nameBlock'+A+'">'+J+c+H+D+I+n+d+"<br>"+p+'</span><span class="dateTime postNum" data-utc="'+e.time+'">'+e.now+' <a href="'+h+'" title="Link to this post">No.</a><a href="'+u+'" title="Reply to this post">'+e.no+"</a></span></div>"+(M?E:"")+'<div class="postInfo desktop" id="pi'+e.no+'"'+(t!=Main.board?' data-board="'+t+'"':"")+'><input type="checkbox" name="'+e.no+'" value="delete"> '+J+p+'<span class="nameBlock'+A+'">'+q+'<span class="name">'+l+"</span>"+H+(e.since4pass?' <span title="Pass user since '+e.since4pass+'" class="n-pu"></span>':"")+(e.xa24?' <span data-tip="'+e.xa24+'" class="n-xa24 n-xa24-'+e.xa24+'"></span>':"")+D+B+I+n+d+' </span> <span class="dateTime" data-utc="'+e.time+'">'+e.now+'</span> <span class="postNum desktop"><a href="'+h+'" title="Link to this post">No.</a><a href="'+u+'" title="Reply to this post">'+e.no+"</a>"+j+_+"</span></div>"+(M?"":E)+'<blockquote class="postMessage" id="m'+e.no+'">'+(e.com||"")+z+U+"</blockquote> </div>"+W,!Main.tid||t!=Main.board)for(w=k.getElementsByClassName("quotelink"),b=0;v=w[b];++b)"/"!=(C=v.getAttribute("href")).charAt(0)&&(v.href="//boards."+$L.d(t)+"/"+t+"/thread/"+f+C);return k},Parser.truncate=function(e,t){return e=e.replace(",",","),e=(e=Parser.decodeSpecialChars(e)).slice(0,t),e=Parser.encodeSpecialChars(e)},Parser.buildCapcodeReplies=function(e,t,a){var i,n,o,r,s,d,l,c;s={admin:"Administrator",mod:"Moderator",developer:"Developer",manager:"Manager"},t!=Main.board?(l="/"+t+"/thread/",c=">>>/"+t+"/"):(l="",c=">>"),r='<br><br><span class="capcodeReplies"><span class="smaller">';for(n in e)for(r+='<span class="bold">'+s[n]+" Replies:</span> ",d=e[n],i=0;o=d[i];++i)r+='<a class="quotelink" href="'+l+a+"#p"+o+'">'+c+o+"</a> ";return r+"</span></span>"},Parser.parseBoard=function(){var e,t=document.getElementsByClassName("thread");for(e=0;t[e];++e)Parser.parseThread(t[e].id.slice(1))},Parser.parseThread=function(e,t,a){var i,n,o,r,s,d,l,c,p,h,u,g;if(r=(o=$.id("t"+e)).getElementsByClassName("post"),!t&&(s=document.getElementById("pi"+e),Main.tid||(Config.filter&&(u=Filter.exec(o,s,document.getElementById("m"+e),e)),Config.threadHiding&&!u&&(Main.hasMobileLayout||((d=document.createElement("span")).innerHTML='<img alt="H" class="extButton threadHideButton"data-cmd="hide" data-id="'+e+'" src="'+Main.icons.minus+'" title="Hide thread">',r[0].insertBefore(d,r[0].firstChild),d.id="sa"+e),ThreadHiding.hidden[e]&&(ThreadHiding.hidden[e]=Main.now,ThreadHiding.hide(e))),ThreadExpansion.enabled&&(c=$.cls("summary",o)[0])&&(l=document.createDocumentFragment(),(p=c.cloneNode(!0)).className="",c.textContent="",(d=document.createElement("img")).className="extButton expbtn",d.title="Expand thread",d.alt="+",d.setAttribute("data-cmd","expand"),d.setAttribute("data-id",e),d.src=Main.icons.plus,l.appendChild(d),l.appendChild(p),(d=document.createElement("span")).style.display="none",d.textContent="Showing all replies.",l.appendChild(d),c.appendChild(l))),Main.tid&&Config.threadWatcher))for(d=document.createElement("img"),ThreadWatcher.watched[h=e+"-"+Main.board]?(d.src=Main.icons.watched,d.setAttribute("data-active","1")):d.src=Main.icons.notwatched,d.className="extButton wbtn wbtn-"+h,d.setAttribute("data-cmd","watch"),d.setAttribute("data-id",e),d.alt="W",d.title="Add to watch list",g=$.cls("navLinks"),i=1;i<3&&(n=g[i]);++i)(l=document.createDocumentFragment()).appendChild(document.createTextNode("[")),l.appendChild(d.cloneNode(!0)),l.appendChild(document.createTextNode("] ")),n.insertBefore(l,n.firstChild);if(n=t?t<0?r.length+t:t:0,a=a?n+a:r.length,Main.isMobileDevice&&Config.quotePreview)for(i=n;i<a;++i)Parser.parseMobileQuotelinks(r[i]);if(Parser.trackedReplies)for(i=n;i<a;++i)Parser.parseTrackedReplies(r[i]);for(i=n;i<a;++i)Parser.parsePost(r[i].id.slice(1),e);if(t){if(Parser.prettify)for(i=n;i<a;++i)Parser.parseMarkup(r[i]);if(window.math_tags)if(window.MathJax)for(i=n;i<a;++i)Parser.postHasMath(r[i])&&window.cleanWbr(r[i]),MathJax.Hub.Queue(["Typeset",MathJax.Hub,r[i]]);else for(i=n;i<a;++i)Parser.postHasMath(r[i])&&window.loadMathJax()}UA.dispatchEvent("4chanParsingDone",{threadId:e,offset:n,limit:a})},Parser.postHasMath=function(e){return/\[(?:eqn|math)\]/.test(e.innerHTML)},Parser.parseMathOne=function(e){window.MathJax?MathJax.Hub.Queue(["Typeset",MathJax.Hub,e]):Parser.postHasMath(e)&&window.loadMathJax()},Parser.parseTrackedReplies=function(e){var t,a,i;for(i=$.cls("quotelink",e),t=0;a=i[t];++t)Parser.trackedReplies[a.textContent]&&(a.className+=" ql-tracked",a.textContent+=" (You)",Parser.hasYouMarkers=!0)},Parser.parseMobileQuotelinks=function(e){var t,a,i,n;for(i=$.cls("quotelink",e),t=0;a=i[t];++t)a.getAttribute("href").match(/(?:\/([a-z0-9]+)\/thread\/)?([0-9]+)?#p([0-9]+)$/)&&((n=document.createElement("a")).href=a.href,n.textContent=" #",n.className="quoteLink",a.parentNode.insertBefore(n,a.nextSibling))},Parser.parseMarkup=function(e){var t,a,i;if((a=e.getElementsByClassName("prettyprint"))[0])for(t=0;i=a[t];++t)i.innerHTML=window.prettyPrintOne(i.innerHTML)},Parser.revealImageSpoiler=function(e){var t,a,i,n,o;t=e.firstElementChild,e.removeChild(t),t.removeAttribute("style"),a=$.hasClass(e.parentNode.parentNode,"op"),t.style.maxWidth=t.style.maxHeight=a?"250px":"125px",t.src="//i.4cdn.org"+e.pathname.replace(/\/([0-9]+).+$/,"/$1s.jpg"),(n=(i=e.previousElementSibling).title.split("."))[0].length>(a?40:30)?o=n[0].slice(0,a?35:25)+"(...)"+n[1]:(o=i.title,i.removeAttribute("title")),i.firstElementChild.innerHTML=o,e.insertBefore(t,e.firstElementChild)},Parser.parsePost=function(e,t){var a,i,n,o,r,s,d,l;a=Main.hasMobileLayout,t?o=document.getElementById("pi"+e):e=(o=e.getElementsByClassName("postInfo")[0]).id.slice(2),Parser.needMsg&&(s=document.getElementById("m"+e)),(n=document.createElement("a")).href="#",n.className="postMenuBtn",n.title="Post menu",n.setAttribute("data-cmd","post-menu"),n.textContent=Parser.postMenuIcon,a?(i=document.getElementById("pim"+e)).insertBefore(n,i.firstElementChild):o.appendChild(n),t&&(e!=t&&(Config.filter&&(d=Filter.exec(o.parentNode,o,s)),!d&&ReplyHiding.hidden[e]&&(ReplyHiding.hidden[e]=Main.now,ReplyHiding.hide(e))),Config.backlinks&&Parser.parseBacklinks(e,t),Main.isOekakiBoard&&Main.tid&&Parser.addOekakiEditLink(e,t)),IDColor.enabled&&(l=$.cls("posteruid",o.parentNode)[a?0:1])&&IDColor.apply(l.firstElementChild),Config.linkify&&Linkify.exec(s),Config.embedSoundCloud&&Media.parseSoundCloud(s),(Config.embedYouTube||a)&&Media.parseYouTube(s),Config.revealSpoilers&&(r=document.getElementById("f"+e))&&(r=r.children[1])&&$.hasClass(r,"imgspoiler")&&Parser.revealImageSpoiler(r),Config.localTime&&(a?(n=o.parentNode.getElementsByClassName("dateTime")[0]).firstChild.nodeValue=Parser.getLocaleDate(new Date(1e3*n.getAttribute("data-utc")))+" ":(n=o.getElementsByClassName("dateTime")[0]).textContent=Parser.getLocaleDate(new Date(1e3*n.getAttribute("data-utc"))))},Parser.addOekakiEditLink=function(e,t){var a,i,n;(a=$.id("fT"+e))&&(n=a.firstElementChild).href&&/\.(png|jpg)$/.test(n.href)&&((i=$.el("small")).innerHTML=' <a href="#" data-pid="'+e+'" data-tid="'+t+'" data-tip="Open in Tegaki" data-cmd="qr-painter-edit">Edit</a>',a.appendChild(i))},Parser.getLocaleDate=function(e){return("0"+(1+e.getMonth())).slice(-2)+"/"+("0"+e.getDate()).slice(-2)+"/"+("0"+e.getFullYear()).slice(-2)+"("+this.weekdays[e.getDay()]+")"+("0"+e.getHours()).slice(-2)+":"+("0"+e.getMinutes()).slice(-2)+":"+("0"+e.getSeconds()).slice(-2)},Parser.parseBacklinks=function(e,t){var a,i,n,o,r,s,d,l,c;if(n=document.getElementById("m"+e).getElementsByClassName("quotelink"))for(o={},a=0;i=n[a];++a)(r=i.getAttribute("href").split("#p"))[1]&&(r[1]==t&&(i.textContent+=" (OP)"),(s=document.getElementById("pi"+r[1]))?o[r[1]]||(o[r[1]]=!0,d=document.createElement("span"),c=Main.tid?"#p"+e:"thread/"+t+"#p"+e,Main.hasMobileLayout?d.innerHTML='<a href="'+c+'" class="quotelink">>>'+e+'</a><a href="'+c+'" class="quoteLink"> #</a> ':d.innerHTML='<a href="'+c+'" class="quotelink">>>'+e+"</a> ",(l=document.getElementById("bl_"+r[1]))||((l=document.createElement("div")).id="bl_"+r[1],l.className="backlink",Main.hasMobileLayout&&(l.className="backlink mobile",s=document.getElementById("p"+r[1])),s.appendChild(l)),l.appendChild(d)):Main.tid&&">"!=i.textContent.charAt(2)&&(i.textContent+=" \u2192"))},Parser.buildSummary=function(e,t,a){var i;return t?(t=t+" repl"+(t>1?"ies":"y"),a=a?" and "+a+" image"+(a>1?"s":""):"",(i=document.createElement("span")).className="summary desktop",i.innerHTML=t+a+' omitted. <a href="thread/'+e+'" class="replylink">Click here</a> to view.',i):null};var OgvCtrl={ogv:null,cnt:null,ctrl:{},seeking:!1,visible:!1,tick:null,attach:function(e){this.detach(),e.parentNode.appendChild(this.cnt),$.on(e,"mouseup",this.toggleCtrl),this.ogv=e},detach:function(){this.ogv&&(this.ogv.stop(),$.off(this.ogv,"mouseup",this.toggleCtrl),this.ctrl.play.classList.remove("ogv-toggled"),this.ctrl.mute.classList.remove("ogv-toggled"),this.hideCtrl(),this.ogv=null,this.seeking=!1,this.cnt.remove())},init:function(){if(this.cnt)return;let e=$.el("div");e.className="ogv-ctrl";let t=$.el("div");t.className="ogv-btn",t.innerHTML='<svg width="28" height="28" fill="currentColor" viewBox="0 0 16 16"><path d="M5.5 3.5A1.5 1.5 0 0 1 7 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5zm5 0A1.5 1.5 0 0 1 12 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5z"/></svg><svg width="28" height="28" fill="currentColor" viewBox="0 0 16 16"><path d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z"/></svg>',$.on(t,"click",this.togglePlay,!1),this.ctrl.play=t,e.appendChild(t),(t=$.el("input")).className="ogv-seek",t.type="range",t.min=0,t.value=0,t.max=100,t.step=.1,$.on(t,"change",this.onSeek,!1),$.on(t,"mousedown",this.toggleSeek,!1),$.on(t,"mouseup",this.toggleSeek,!1),this.ctrl.seek=t,e.appendChild(t),(t=$.el("div")).className="ogv-ts",t.textContent="0:00 / 0:00",this.ctrl.ts=t,e.appendChild(t),(t=$.el("div")).className="ogv-btn",t.innerHTML='<svg width="28" height="28" fill="currentColor" viewBox="0 0 16 16"><path d="M11.536 14.01A8.473 8.473 0 0 0 14.026 8a8.473 8.473 0 0 0-2.49-6.01l-.708.707A7.476 7.476 0 0 1 13.025 8c0 2.071-.84 3.946-2.197 5.303l.708.707z"/><path d="M10.121 12.596A6.48 6.48 0 0 0 12.025 8a6.48 6.48 0 0 0-1.904-4.596l-.707.707A5.483 5.483 0 0 1 11.025 8a5.483 5.483 0 0 1-1.61 3.89l.706.706z"/><path d="M8.707 11.182A4.486 4.486 0 0 0 10.025 8a4.486 4.486 0 0 0-1.318-3.182L8 5.525A3.489 3.489 0 0 1 9.025 8 3.49 3.49 0 0 1 8 10.475l.707.707zM6.717 3.55A.5.5 0 0 1 7 4v8a.5.5 0 0 1-.812.39L3.825 10.5H1.5A.5.5 0 0 1 1 10V6a.5.5 0 0 1 .5-.5h2.325l2.363-1.89a.5.5 0 0 1 .529-.06z"/></svg><svg width="28" height="28" fill="currentColor" viewBox="0 0 16 16"><path d="M6.717 3.55A.5.5 0 0 1 7 4v8a.5.5 0 0 1-.812.39L3.825 10.5H1.5A.5.5 0 0 1 1 10V6a.5.5 0 0 1 .5-.5h2.325l2.363-1.89a.5.5 0 0 1 .529-.06zm7.137 2.096a.5.5 0 0 1 0 .708L12.207 8l1.647 1.646a.5.5 0 0 1-.708.708L11.5 8.707l-1.646 1.647a.5.5 0 0 1-.708-.708L10.793 8 9.146 6.354a.5.5 0 1 1 .708-.708L11.5 7.293l1.646-1.647a.5.5 0 0 1 .708 0z"/></svg>',$.on(t,"click",this.toggleMute,!1),this.ctrl.mute=t,e.appendChild(t),(t=$.el("input")).className="ogv-vol",t.type="range",t.min=0,t.value=50,t.step=.1,t.max=100,$.on(t,"input",this.onVolInput,!1),this.ctrl.vol=t,e.appendChild(t),(t=$.el("div")).className="ogv-btn",t.innerHTML='<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M5.828 10.172a.5.5 0 0 0-.707 0l-4.096 4.096V11.5a.5.5 0 0 0-1 0v3.975a.5.5 0 0 0 .5.5H4.5a.5.5 0 0 0 0-1H1.732l4.096-4.096a.5.5 0 0 0 0-.707zm4.344 0a.5.5 0 0 1 .707 0l4.096 4.096V11.5a.5.5 0 1 1 1 0v3.975a.5.5 0 0 1-.5.5H11.5a.5.5 0 0 1 0-1h2.768l-4.096-4.096a.5.5 0 0 1 0-.707zm0-4.344a.5.5 0 0 0 .707 0l4.096-4.096V4.5a.5.5 0 1 0 1 0V.525a.5.5 0 0 0-.5-.5H11.5a.5.5 0 0 0 0 1h2.768l-4.096 4.096a.5.5 0 0 0 0 .707zm-4.344 0a.5.5 0 0 1-.707 0L1.025 1.732V4.5a.5.5 0 0 1-1 0V.525a.5.5 0 0 1 .5-.5H4.5a.5.5 0 0 1 0 1H1.732l4.096 4.096a.5.5 0 0 1 0 .707z"/></svg><svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path d="M5.5 0a.5.5 0 0 1 .5.5v4A1.5 1.5 0 0 1 4.5 6h-4a.5.5 0 0 1 0-1h4a.5.5 0 0 0 .5-.5v-4a.5.5 0 0 1 .5-.5zm5 0a.5.5 0 0 1 .5.5v4a.5.5 0 0 0 .5.5h4a.5.5 0 0 1 0 1h-4A1.5 1.5 0 0 1 10 4.5v-4a.5.5 0 0 1 .5-.5zM0 10.5a.5.5 0 0 1 .5-.5h4A1.5 1.5 0 0 1 6 11.5v4a.5.5 0 0 1-1 0v-4a.5.5 0 0 0-.5-.5h-4a.5.5 0 0 1-.5-.5zm10 1a1.5 1.5 0 0 1 1.5-1.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 0-.5.5v4a.5.5 0 0 1-1 0v-4z"/></svg>',$.on(t,"click",this.toggleFullscreen,!1),this.ctrl.fs=t,e.appendChild(t),this.cnt=e},onPlayEnd:function(){OgvCtrl.ogv.seekable.length?OgvCtrl.ogv.currentTime=0:OgvCtrl.ogv.stop(),OgvCtrl.ogv.play()},toggleCtrl:function(){OgvCtrl.visible?OgvCtrl.hideCtrl():(OgvCtrl.cnt.style.display="flex",OgvCtrl.setTickTimeout(),OgvCtrl.updateTimes(),OgvCtrl.visible=!0)},hideCtrl:function(){OgvCtrl.cnt.style.display="none",OgvCtrl.clearTickTimeout(),OgvCtrl.visible=!1},toggleSeek:function(){OgvCtrl.seeking=!OgvCtrl.seeking},seekTick:function(){OgvCtrl.setTickTimeout(),OgvCtrl.updateTimes()},setTickTimeout:function(){OgvCtrl.tick=setTimeout(OgvCtrl.seekTick,500)},clearTickTimeout:function(){clearTimeout(OgvCtrl.tick),OgvCtrl.tick=null},updateTimes:function(){if(!OgvCtrl.ogv.duration)return;OgvCtrl.seeking||(OgvCtrl.ctrl.seek.value=(OgvCtrl.ogv.currentTime/OgvCtrl.ogv.duration*100).toFixed(2));let e=Math.floor(OgvCtrl.ogv.duration/60),t=Math.floor(OgvCtrl.ogv.duration-60*e),a=Math.floor(OgvCtrl.ogv.currentTime/60),i=Math.floor(OgvCtrl.ogv.currentTime-60*a);OgvCtrl.ctrl.ts.textContent=`${a}:${i.toString().padStart(2,"0")} / ${e}:${t.toString().padStart(2,"0")}`},togglePlay:function(){OgvCtrl.ogv.paused?OgvCtrl.ogv.play():OgvCtrl.ogv.pause(),OgvCtrl.ctrl.play.classList.toggle("ogv-toggled")},onSeek:function(){OgvCtrl.ogv.currentTime=this.value/100*OgvCtrl.ogv.duration},toggleMute:function(){OgvCtrl.ogv.muted=!OgvCtrl.ogv.muted,OgvCtrl.ctrl.mute.classList.toggle("ogv-toggled")},onVolInput:function(){OgvCtrl.ogv.volume=this.value/100},toggleFullscreen:function(){document.fullscreenElement?document.exitFullscreen():OgvCtrl.ogv.parentNode.requestFullscreen(),OgvCtrl.ctrl.fs.classList.toggle("ogv-toggled")}},PostMenu={activeBtn:null};PostMenu.open=function(e){var t,a,i,n,o,r,s,d,l,c,p;PostMenu.activeBtn!=e?(PostMenu.close(),i=e.parentNode.id.replace(/^[0-9]*[^0-9]+/,""),c=!(n=e.parentNode.getAttribute("data-board"))&&!!$.id("t"+i),a='<ul><li data-cmd="report" data-id="'+i+(n?'" data-board="'+n+'"':'"')+'">Report post</li>',c?(Config.threadHiding&&!Main.tid&&(a+='<li data-cmd="hide" data-id="'+i+'">'+($.hasClass($.id("t"+i),"post-hidden")?"Unhide":"Hide")+" thread</li>"),Config.threadWatcher&&(a+='<li data-cmd="watch" data-id="'+i+'">'+(ThreadWatcher.watched[i+"-"+Main.board]?"Remove from":"Add to")+" watch list</li>")):(r=$.id("pc"+i))&&(a+='<li data-cmd="hide-r" data-id="'+i+'">'+($.hasClass(r,"post-hidden")?"Unhide":"Hide")+" post</li>"),Main.hasMobileLayout&&(a+='<li><a href="#" data-id="'+i+'" data-cmd="del-post">Delete post</a></li>'),(p=$.id("fT"+i))&&(r=$.cls("fileThumb",p.parentNode)[0])&&(s=/(gif|jpg|png)$/.test(r.href)?r.href:"http://i.4cdn.org/"+Main.board+"/"+r.href.match(/\/([0-9]+)m?\..+$/)[1]+"s.jpg",Main.hasMobileLayout?a+='<li><a href="#" data-id="'+i+'" data-cmd="del-file">Delete file</a></li><li><a href="'+(r.getAttribute("data-orig")||r.href)+'" target="_blank">Open original file</a></li><li><a href="https://lens.google.com/uploadbyurl?url='+s+'" target="_blank">Search image on Google</a></li><li><a href="https://www.yandex.com/images/search?img_url='+s+'&rpt=imageview" target="_blank">Search image on Yandex</a></li><li><a href="https://saucenao.com/search.php?url='+s+'" target="_blank">Search image on SauceNAO</a></li>':a+='<li><ul><li><a href="https://lens.google.com/uploadbyurl?url='+s+'" target="_blank">Google</a></li><li><a href="https://www.yandex.com/images/search?img_url='+s+'&rpt=imageview" target="_blank">Yandex</a></li><li><a href="https://saucenao.com/search.php?url='+s+'" target="_blank">SauceNAO</a></li></ul>Image search »</li>'),Config.filter&&(a+='<li><a href="#" data-cmd="filter-sel">Filter selected text</a></li>'),(t=document.createElement("div")).id="post-menu",t.className="dd-menu",t.innerHTML=a+"</ul>",o=e.getBoundingClientRect(),t.style.top=o.bottom+3+window.pageYOffset+"px",document.addEventListener("click",PostMenu.close,!1),$.addClass(e,"menuOpen"),PostMenu.activeBtn=e,UA.dispatchEvent("4chanPostMenuReady",{postId:i,isOP:c,node:t.firstElementChild}),document.body.appendChild(t),(d=o.left+window.pageXOffset)>(l=$.docEl.clientWidth-t.offsetWidth)-75&&(t.className+=" dd-menu-left"),d>l&&(d=l),t.style.left=d+"px"):PostMenu.close()},PostMenu.close=function(){var e;(e=$.id("post-menu"))&&(e.parentNode.removeChild(e),document.removeEventListener("click",PostMenu.close,!1),$.removeClass(PostMenu.activeBtn,"menuOpen"),PostMenu.activeBtn=null)};var Search={xhr:null,pageSize:10,maxPages:10,init:function(){var e;(e=$.id("g-search-form"))&&($.on(e,"submit",Search.onSearch),$.on(window,"hashchange",Search.onHashChanged),"boards.4channel.org"==location.host&&Search.initSelector(),Search.initFromURL(!0))},initSelector:function(){var e,t,a,i;for(e=(a=(i=$.id("js-sf-bf")).options).length-1;e>=0;e--)""!==(t=a[e]).value&&"4chan.org"!==$L.d(t.value)||i.removeChild(t)},initFromURL:function(e){var t,a,i,n,o,r;if((t=Search).query="",t.board="",t.offset=0,""!==(a=window.location.hash)&&a.length<=512&&((a=a.split("/").slice(1))[0]?t.query=decodeURIComponent(a[0]):t.query="",t.board=a[1]||"",a[1]&&("all"===a[1]?t.board="":t.board=a[1]),t.offset=t.pageToOffset(0|a[2])),!e||""!==t.query){for($.id("js-sf-qf").value=t.query,(n=$.id("js-sf-bf")).selectedIndex=0,i=0,o=n.options;r=o[i];++i)if(r.value===t.board){n.selectedIndex=i;break}0===n.selectedIndex&&""!==t.board&&(t.board=""),Search.exec(t.query,t.board,t.offset)}},onHashChanged:function(){Search.initFromURL()},pageToOffset:function(e){return(e<1||e>Search.maxPages)&&(e=1),(e-1)*Search.pageSize},offsetToPage:function(e){var t=e/Search.pageSize+1;return(t<1||t>Search.maxPages)&&(t=1),t},updateURL:function(){var e,t=[];""!==(e=Search).query&&(t.push(encodeURIComponent(e.query)),e.offset>0?(e.board&&""!==e.board?t.push(e.board):t.push("all"),t.push(Search.offsetToPage(e.offset))):e.board&&t.push(e.board)),t.length?window.history.replaceState(null,"","#/"+t.join("/")):window.history.replaceState(null,"",window.location.href.replace(/#.*$/,""))},onSearch:function(e){var t,a;e&&e.preventDefault(),Search.query=t=$.id("js-sf-qf").value,Search.board=a=$.id("js-sf-bf").value,Search.exec(t,a,0)},exec:function(e,t,a){var i,n=[];(i=Search).toggleSpinner(!1),i.updateCtrl(!1),i.xhr&&(i.xhr.abort(),i.xhr=null),""!==e&&(n.push("q="+encodeURIComponent(e)),""!==t&&n.push("b="+t),a&&n.push("o="+(0|a)),n=n.join("&"),i.query=e,i.board=t,i.offset=a,i.updateURL(),i.toggleSpinner(!0),i.xhr=$.get("https://find."+location.host.replace(/^boards\./,"")+"/api?"+n,{onload:i.onLoad,onerror:i.onError,withCredentials:!0}))},onPageClick:function(){var e;e=+this.getAttribute("data-o"),Search.exec(Search.query,Search.board,e)},onLoad:function(){var e;Search.toggleSpinner(!1);try{e=JSON.parse(this.responseText)}catch(t){return Search.showError("Something went wrong."),void console.log(t)}Search.buildResults(e)},onError:function(){Search.toggleSpinner(!1),Search.showError("Connection error.")},updateCtrl:function(e,t){var a,i,n,o,r;!1!==e?((a=$.id("js-sf-pl"))&&a.parentNode.removeChild(a),(a=$.el("div")).id="js-sf-pl",Main.hasMobileLayout?a.className="mPagelist mobile":a.className="pagelist desktop",t=+t,e=+e,(o=Math.ceil(t/Search.pageSize))>Search.maxPages&&(o=Search.maxPages),(r=e/Search.pageSize+1)>1&&((i=$.el("div")).className="prev",Main.hasMobileLayout?((n=$.el("a")).className="button",n.textContent="Previous"):((n=$.el("input")).type="button",n.value="Previous"),n.setAttribute("data-o",e-Search.pageSize),$.on(n,"click",Search.onPageClick),i.appendChild(n),a.appendChild(i)),(i=$.el("div")).className="pages",i.textContent="Page "+r+" / "+o,a.appendChild(i),r<o&&((i=$.el("div")).className="next",Main.hasMobileLayout?((n=$.el("a")).className="button",n.textContent="Next"):((n=$.el("input")).type="button",n.value="Next"),n.setAttribute("data-o",e+Search.pageSize),$.on(n,"click",Search.onPageClick),i.appendChild(n),a.appendChild(i)),(i=$.id("delform")).parentNode.insertBefore(a,i.nextElementSibling)):(i=$.id("js-sf-pl"))&&i.parentNode.removeChild(i)},showStatus:function(e,t){$.cls("board")[0].innerHTML=e?'<div id="js-sf-status" class="js-sf-'+t+'">'+e+"</div>":""},showError:function(e){Search.showStatus(e,"error")},toggleSpinner:function(e){var t=$.id("js-sf-btn");e?(t.disabled=!0,Search.showStatus("Searching\u2026","spnr")):(t.disabled=!1,Search.showStatus(!1))},buildResults:function(e){var t,a,i,n,o,r,s,d;if((o=e.threads).length<1)return Search.showError("Nothing found."),void Search.updateCtrl(!1);for((s=$.cls("board")[0]).textContent="",t=0;r=o[t];++t){for(i=r.posts[0],
|
|
(n=$.el("div")).id="t"+i.no,n.className="thread",n.appendChild(Parser.buildHTMLFromJSON(i,r.board,!0)),a=1;d=r.posts[a];++a)n.appendChild(Parser.buildHTMLFromJSON(d,r.board));s.appendChild(n),s.appendChild($.el("hr"))}Search.updateCtrl(e.offset,e.nhits)}},Depager={};Depager.init=function(){var e,t,a;if(this.isLoading=!1,this.isEnabled=!1,this.isComplete=!1,this.threadsLoaded=!1,this.threadQueue=[],this.debounce=100,this.threshold=350,this.adId="azk53379",this.adZones=[16258,16260],this.boardHasAds=!!$.id(this.adId),this.boardHasAds&&(e=$.cls("ad-plea"),this.adPlea=e[e.length-1]),Main.hasMobileLayout){if(!(e=$.cls("next")[1]))return;(e=e.firstElementChild).textContent="Load More",e.className+=" m-depagelink",e.setAttribute("data-cmd","depage")}else{if(!(e=$.cls("prev")[0]))return;e.innerHTML='[<a title="Toggle infinite scroll" class="depagelink" href="" data-cmd="depage">All</a>]',e=e.firstElementChild}Config.alwaysDepage?(this.isEnabled=!0,e.parentNode.parentNode.className+=" depagerEnabled",Depager.bindHandlers(),!Main.hasMobileLayout&&(a=$.cls("board")[0])&&((t=document.createElement("span")).className="depageNumber",t.textContent="Page 1",a.insertBefore(t,a.firstElementChild))):e.setAttribute("data-cmd","depage")},Depager.onScroll=function(){document.documentElement.scrollHeight<=Math.ceil(window.innerHeight+window.pageYOffset)+Depager.threshold&&(Depager.threadsLoaded?Depager.renderNext():Depager.depage())},Depager.trackPageview=function(e){var t;try{window._gat&&(t="/"+Main.board+"/"+e,window._gat._getTrackerByName()._trackPageview(t)),window.__qc&&(window.__qc.qpixelsent=[],window._qevents.push({qacct:window.__qc.qopts.qacct}),window.__qc.firepixels())}catch(a){console.log(a)}},Depager.insertAd=function(e,t,a,i){var n,o,r;Depager.boardHasAds&&window.ados_add_placement&&(i&&(n=(r=$.cls("bottomad"))[r.length-1],(o=document.createElement("div")).id="azkDepage"+(e+1),n.appendChild(o),window.ados_add_placement(3536,18130,o.id,4).setZone(a)),(n=document.createElement("div")).className="bottomad center depaged-ad",2==e?o=$.id(Depager.adId):(o=document.createElement("div")).id="azkDepage"+e,n.appendChild(o),t.appendChild(n),Depager.adPlea&&t.appendChild(Depager.adPlea.cloneNode(!0)),t.appendChild(document.createElement("hr")),2!=e&&window.ados_add_placement(3536,18130,o.id,4).setZone(a))},Depager.loadAds=function(){Depager.boardHasAds&&window.ados_load&&window.ados_load()},Depager.renderNext=function(){var e,t,a,i,n,o,r,s,d,l,c,p,h,u,g,m,f;if(c=[],p=window.pageYOffset,t=document.createDocumentFragment(),m=Depager.threadQueue.shift()){for(o=m.threads,g=m.page,f=!Depager.threadQueue.length,Depager.insertAd(g,t,m.adZone,f),(e=document.createElement("span")).className="depageNumber",e.textContent="Page "+g,t.appendChild(e),i=0;r=o[i];++i)if(!$.id("t"+r.no)){if((d=document.createElement("div")).id="t"+r.no,d.className="thread",d.appendChild(Parser.buildHTMLFromJSON(r,Main.board,!0)),(s=Parser.buildSummary(r.no,r.omitted_posts,r.omitted_images))&&d.appendChild(s),r.replies)for(h=r.last_replies,n=0;l=h[n];++n)d.appendChild(Parser.buildHTMLFromJSON(l,Main.board));t.appendChild(d),t.appendChild(document.createElement("hr")),c.push(r.no)}for(f&&(Depager.unbindHandlers(),Depager.isComplete=!0,Depager.setStatus("disabled")),(u=$.cls("board")[0]).insertBefore(t,u.lastElementChild),Depager.trackPageview(g),Depager.loadAds(),a=0;r=c[a];++a)Parser.parseThread(r);window.scrollTo(0,p)}},Depager.bindHandlers=function(){window.addEventListener("scroll",Depager.onScroll,!1),window.addEventListener("resize",Depager.onScroll,!1)},Depager.unbindHandlers=function(){window.removeEventListener("scroll",Depager.onScroll,!1),window.removeEventListener("resize",Depager.onScroll,!1)},Depager.setStatus=function(e){var t,a,i,n,o;if(Main.hasMobileLayout?(i=$.cls("m-depagelink"),o="Load More"):(i=$.cls("depagelink"),o="All"),i.length)if("enabled"==e)for(t=0;a=i[t];++t)a.textContent=o,n=a.parentNode.parentNode,$.hasClass(n,"depagerEnabled")||$.addClass(n,"depagerEnabled");else if("loading"==e)for(t=0;a=i[t];++t)a.textContent="Loading\u2026";else if("disabled"==e)for(t=0;a=i[t];++t)Main.hasMobileLayout?a.parentNode.parentNode.removeChild(a.parentNode):(a.textContent=o,$.removeClass(a.parentNode.parentNode,"depagerEnabled"));else if("error"==e)for(t=0;a=i[t];++t)a.textContent="Error",a.removeAttribute("title"),a.removeAttribute("data-cmd"),$.removeClass(a.parentNode.parentNode,"depagerEnabled")},Depager.toggle=function(){Depager.isLoading||Depager.isComplete||(Depager.isEnabled?Depager.disable():Depager.enable(),Depager.isEnabled=!Depager.isEnabled)},Depager.enable=function(){Depager.bindHandlers(),Depager.setStatus("enabled"),Depager.onScroll()},Depager.disable=function(){Depager.unbindHandlers(),Depager.setStatus("disabled")},Depager.depage=function(){Depager.isLoading||(Depager.isLoading=!0,$.get("//a.4cdn.org/"+Main.board+"/catalog.json",{onload:Depager.onLoad,onerror:Depager.onError}),Depager.setStatus("loading"))},Depager.onLoad=function(){var e,t,a,i,n;if(Depager.isLoading=!1,Depager.threadsLoaded=!0,200==this.status){for(Depager.setStatus("enabled"),Config.alwaysDepage||Depager.bindHandlers(),e=Parser.parseCatalogJSON(this.responseText),i=Depager.threadQueue,n=0,t=1;a=e[t];++t)a.adZone=Depager.adZones[n],i.push(a),n=n?0:1;Depager.renderNext()}else 404==this.status?(Depager.unbindHandlers(),Depager.setStatus("error")):(Depager.unbindHandlers(),console.log("Error: "+this.status),Depager.setStatus("error"))},Depager.onError=function(){Depager.isLoading=!1,Depager.unbindHandlers(),console.log("Error: "+this.status),Depager.setStatus("error")};var QuoteInline={};QuoteInline.isSelfQuote=function(e,t,a){return(!a||a==Main.board)&&("BLOCKQUOTE"==(e=e.parentNode).nodeName&&e.id.split("m")[1]==t||e.parentNode.id.split("_")[1]==t)},QuoteInline.toggle=function(e,t){var a,i,n,o,r,s,d,l;if((n=e.getAttribute("href").match(/(?:\/([a-z0-9]+)\/thread\/)?([0-9]+)?#p([0-9]+)$/))&&!QuoteInline.isSelfQuote(e,n[3],n[1])){if(t&&t.preventDefault(),o=e.getAttribute("data-pfx")){for(e.removeAttribute("data-pfx"),$.removeClass(e,"linkfade"),s=$.id(o+"p"+n[3]),l=$.cls("expandedWebm",s),a=0;i=l[a];++a)i.pause();return s.parentNode.removeChild(s),void("backlink"==e.parentNode.parentNode.className&&(0===(d=+(s=$.id("pc"+n[3])).getAttribute("data-inline-count")-1)?(s.style.display="",s.removeAttribute("data-inline-count")):s.setAttribute("data-inline-count",d)))}(r=$.id("p"+n[3]))?QuoteInline.inline(e,r,n[3]):QuoteInline.inlineRemote(e,n[1]||Main.board,n[2],n[3])}},QuoteInline.inlineRemote=function(e,t,a,i){var n,o,r,s,d,l;if(!e.hasAttribute("data-loading")){if(s=t+"-"+a,(r=$.cache[s])&&(d=Parser.buildPost(r,t,i)))return Parser.parsePost(d),void QuoteInline.inline(e,d);(l=e.nextElementSibling)&&$.hasClass(l,"spinner")?l.parentNode.removeChild(l):((l=document.createElement("div")).className="preview spinner inlined",l.textContent="Loading...",e.parentNode.insertBefore(l,e.nextSibling),n=function(){var a,n;e.removeAttribute("data-loading"),200===this.status||304===this.status||0===this.status?(n=Parser.parseThreadJSON(this.responseText),$.cache[s]=n,(a=Parser.buildPost(n,t,i))?(l.parentNode&&l.parentNode.removeChild(l),Parser.parsePost(a),QuoteInline.inline(e,a)):($.addClass(e,"deadlink"),l.textContent="This post doesn't exist anymore")):404===this.status?($.addClass(e,"deadlink"),l.textContent="This thread doesn't exist anymore"):this.onerror()},o=function(){l.textContent="Error: "+this.statusText+" ("+this.status+")",e.removeAttribute("data-loading")},e.setAttribute("data-loading","1"),$.get("//a.4cdn.org/"+t+"/thread/"+a+".json",{onload:n,onerror:o}))}},QuoteInline.inline=function(e,t,a){var i,n,o,r,s,d,l,c,p,h,u,g;if(o=Date.now(),a)for("backlink"==(s=e.parentNode.parentNode).className?(r=s.parentNode.parentNode.parentNode,d=!0):r=s.parentNode;r.parentNode!==document;){if(r.id.split("m")[1]==a)return;r=r.parentNode}if(e.className+=" linkfade",e.setAttribute("data-pfx",o),QuotePreview.stopMedia(t),(r=t.cloneNode(!0)).id=o+r.id,r.setAttribute("data-pfx",o),r.className+=" preview inlined",$.removeClass(r,"highlight"),$.removeClass(r,"highlight-anti"),(l=$.cls("inlined",r))[0]){for(;n=l[0];)n.parentNode.removeChild(n);for(l=$.cls("quotelink",r),i=0;n=l[i];++i)n.removeAttribute("data-pfx"),$.removeClass(n,"linkfade")}for(i=0;n=r.children[i];++i)n.id=o+n.id;if((c=$.cls("backlink",r)[0])&&(c.id=o+c.id),d)p=s.parentNode.parentNode.getAttribute("data-pfx")||"",(h=$.id(p+"m"+s.id.split("_")[1])).insertBefore(r,h.firstChild),(u=t.parentNode.getAttribute("data-inline-count"))?u=+u+1:(u=1,t.parentNode.style.display="none"),t.parentNode.setAttribute("data-inline-count",u);else{for(g=$.hasClass(e.parentNode,"quote")?(e=e.parentNode).parentNode:e.parentNode;"S"===g.nodeName;)e=g,g=g.parentNode;g.insertBefore(r,e.nextSibling)}};var QuotePreview={};QuotePreview.init=function(){this.regex=/(?:\/([a-z0-9]+)\/thread\/)?([0-9]+)?#p([0-9]+)$/,this.highlight=null,this.highlightAnti=null,this.cur=null},QuotePreview.resolve=function(e){var t,a,i,n,o;if((t=QuotePreview).cur=null,a=e.getAttribute("href").match(t.regex))if(o=e.getAttribute("data-pfx")||"",i=document.getElementById(o+"p"+a[3])){if((n=i.getBoundingClientRect()).top>0&&n.bottom<document.documentElement.clientHeight&&!$.hasClass(i.parentNode,"post-hidden"))return void($.hasClass(i,"highlight")||location.hash.slice(1)==i.id?$.hasClass(i,"op")||(t.highlightAnti=i,$.addClass(i,"highlight-anti")):(t.highlight=i,$.addClass(i,"highlight")));t.show(e,i)}else{if(!UA.hasCORS)return;t.showRemote(e,a[1]||Main.board,a[2],a[3])}},QuotePreview.showRemote=function(e,t,a,i){var n,o,r,s,d;d=t+"-"+a,QuotePreview.cur=d,(s=$.cache[d])&&(r=Parser.buildPost(s,t,i))?QuotePreview.show(e,r):(e.style.cursor="wait",n=function(){var a,n;if(e.style.cursor="",200===this.status||304===this.status||0===this.status){if(n=Parser.parseThreadJSON(this.responseText),$.cache[d]=n,$.id("quote-preview")||QuotePreview.cur!=d)return;(a=Parser.buildPost(n,t,i))?(a.className="post preview",a.style.display="none",a.id="quote-preview",document.body.appendChild(a),QuotePreview.show(e,a,!0)):$.addClass(e,"deadlink")}else 404===this.status&&$.addClass(e,"deadlink")},o=function(){e.style.cursor=""},$.get("//a.4cdn.org/"+t+"/thread/"+a+".json",{onload:n,onerror:o}))},QuotePreview.show=function(e,t,a){var i,n,o,r,s,d,l,c,p,h,u,g,m,f;if(QuotePreview.stopMedia(t),a?(Parser.parsePost(t),t.style.display=""):(t=t.cloneNode(!0),location.hash&&location.hash=="#"+t.id&&(t.className+=" highlight"),t.id="quote-preview",t.className+=" preview"+($.hasClass(e.parentNode.parentNode,"backlink")?"":" reveal-spoilers"),Config.imageExpansion&&(m=$.cls("expanded-thumb",t)[0])&&ImageExpansion.contract(m)),(f=$.cls("expandedWebm",t)[0])&&(f.controls=!1,f.autoplay=!1),!e.parentNode.className&&(l=$.qsa("#"+$.cls("postMessage",t)[0].id+" > .quotelink",t))[1])for(h=">>"+e.parentNode.parentNode.id.split("_")[1],c=0;p=l[c];++c)if(p.textContent==h){$.addClass(p,"dotted");break}i=e.getBoundingClientRect(),r=(o=document.documentElement).offsetWidth,s=t.style,document.body.appendChild(t),Main.isMobileDevice?(s.top=i.top+e.offsetHeight+window.pageYOffset+"px",r-i.right<(0|.3*r)?s.right=r-i.right+"px":s.left=i.left+"px"):(r-i.right<(0|.3*r)?(d=r-i.left,s.right=d+5+"px"):(d=i.left+i.width,s.left=d+5+"px"),u=i.top+e.offsetHeight+window.pageYOffset-t.offsetHeight/2-i.height/2,n=t.getBoundingClientRect().height,u<(g=o.scrollTop!=document.body.scrollTop?o.scrollTop+document.body.scrollTop:document.body.scrollTop)?s.top=g+"px":u+n>g+o.clientHeight?s.top=g+o.clientHeight-n+"px":s.top=u+"px")},QuotePreview.remove=function(e){var t,a;(t=QuotePreview).cur=null,t.highlight?($.removeClass(t.highlight,"highlight"),t.highlight=null):t.highlightAnti&&($.removeClass(t.highlightAnti,"highlight-anti"),t.highlightAnti=null),e&&(e.style.cursor=""),(a=$.id("quote-preview"))&&document.body.removeChild(a)},QuotePreview.stopMedia=function(e){var t,a;if((a=$.tag("VIDEO",e))[0])for(t=0;e=a[t];++t)e.autoplay=!1;if((a=$.tag("AUDIO",e))[0])for(t=0;e=a[t];++t)e.autoplay=!1};var ImageExpansion={activeVideos:[],timeout:null,pendingTarget:null};ImageExpansion.loadOgv=function(e){if(ImageExpansion.pendingTarget=e,$.id("js-ogv-scr"))return;let t=$.el("script");t.id="js-ogv-scr",t.onload=ImageExpansion.onOgvLoaded,t.src="https://s.4cdn.org/js/ogv/ogv.js",document.body.appendChild(t)},ImageExpansion.onOgvLoaded=function(){let e=ImageExpansion;e.pendingTarget&&e.expandWebm(e.pendingTarget)},ImageExpansion.expand=function(e){var t,a,i,n;return Config.imageHover&&ImageHover.hide(),(i=(a=(n=e.parentNode).getAttribute("href")).match(/\.(?:webm|mp4|pdf)$/))?(".webm"==i[0]||".mp4"==i[0])&&ImageExpansion.expandWebm(e):(Main.hasMobileLayout&&n.hasAttribute("data-m")&&(a=ImageExpansion.setMobileSrc(n)),e.setAttribute("data-expanding","1"),(t=document.createElement("img")).alt="Image",t.setAttribute("src",a),t.className="expanded-thumb",t.style.display="none",t.onerror=this.onError,e.parentNode.insertBefore(t,e.nextElementSibling),UA.hasCORS?(e.style.opacity="0.75",this.timeout=this.checkLoadStart(t,e)):this.onLoadStart(t,e),!0)},ImageExpansion.contract=function(e){var t,a;clearTimeout(this.timeout),t=(a=e.parentNode).parentNode.parentNode,$.removeClass(a.parentNode,"image-expanded"),Config.centeredThreads&&($.removeClass(t.parentNode,"centre-exp"),t.parentNode.style.marginLeft=""),!Main.tid&&Config.threadHiding&&$.removeClass(a,"image-expanded-anti"),a.firstChild.style.display="",a.removeChild(e),t.offsetTop<window.pageYOffset&&t.scrollIntoView()},ImageExpansion.toggle=function(e){if(e.hasAttribute("data-md5")){if(!e.hasAttribute("data-expanding"))return ImageExpansion.expand(e)}else ImageExpansion.contract(e);return!0},ImageExpansion.setMobileSrc=function(e){var t;return e.removeAttribute("data-m"),t=e.getAttribute("href"),e.setAttribute("data-orig",t),t=t.replace(/\/([0-9]+).+$/,"/$1m.jpg"),e.setAttribute("href",t),t},ImageExpansion.expandWebm=function(e){var t,a,i,n,o,r,s;if(r=ImageExpansion,(t=document.getElementById("image-hover"))&&document.body.removeChild(t),o=(a=e.parentNode).getAttribute("href"),n=a.getBoundingClientRect().left,document.documentElement.clientWidth-n-25,a.style.display="none",o.match(/\.webm$/)&&/iPhone|iPad/.test(navigator.userAgent)){if(!window.OGVPlayer)return OgvCtrl.init(),r.loadOgv(e),!0;OgvCtrl.ogv&&r.detachOgv(OgvCtrl.ogv),(s=document.createElement("div")).className="ogv-cnt expandedWebm",(t=new OGVPlayer({wasm:!0,threading:!1,simd:!1})).onloadedmetadata=r.fitWebm,t.onvolumechange=Main.getWebmVolumeChangeCb(),$.on(t,"ended",OgvCtrl.onPlayEnd),s.appendChild(t),a.parentNode.appendChild(s),t.src=o.replace(/\/\/.+\.4chan\.org\//,"//i.4cdn.org/"),OgvCtrl.attach(t),Config.unmuteWebm||OgvCtrl.toggleMute(),OgvCtrl.togglePlay()}else(t=document.createElement("video")).muted=!Config.unmuteWebm,t.controls=!0,t.loop=!0,t.autoplay=!0,t.className="expandedWebm",t.onloadedmetadata=r.fitWebm,t.onvolumechange=Main.getWebmVolumeChangeCb(),t.onplay=r.onWebmPlay,a.parentNode.appendChild(t),t.src=o;return Config.unmuteWebm&&(t.volume=Main.getWebmVolume()),Main.hasMobileLayout?((t=document.createElement("div")).className="collapseWebm",t.innerHTML='<span class="button">Close</span>',a.parentNode.appendChild(t)):(i=e.parentNode.previousElementSibling,(t=document.createElement("span")).className="collapseWebm",t.innerHTML='-[<a href="#">Close</a>]',i.appendChild(t)),$.addClass(a.parentNode,"image-expanded"),t.firstElementChild.addEventListener("click",r.collapseWebm,!1),!0},ImageExpansion.fitWebm=function(){var e,t,a,i,n,o,r,s,d,l,c;l=this,OgvCtrl.ogv?(c=l.parentNode,$.addClass(c,"ogv-loaded")):c=l,Config.centeredThreads&&(s=$.cls("opContainer")[0].offsetWidth,r=c.parentNode.parentNode.parentNode,$.addClass(r,"centre-exp")),o=l.getBoundingClientRect().left,a=document.documentElement.clientWidth-o,i=document.documentElement.clientHeight,Main.hasMobileLayout||(a-=25),e=l.videoWidth,t=l.videoHeight,e>a&&(n=a/e,e=a,t*=n),Config.fitToScreenExpansion&&t>i&&(n=i/t,t=i,e*=n),c.style.width=(0|e)+"px",c.style.height=(0|t)+"px",l!==c&&(l.style.width=c.style.width,l.style.height=c.style.height),Config.centeredThreads&&(o=c.getBoundingClientRect().left,(d=c.offsetWidth+2*o)>s?(o=Math.floor(($.docEl.clientWidth-d)/2))>0&&(r.style.marginLeft=o+"px"):$.removeClass(r,"centre-exp"))},ImageExpansion.onWebmPlay=function(){var e=ImageExpansion;e.activeVideos.length||document.addEventListener("scroll",e.onScroll,!1),e.activeVideos.push(this)},ImageExpansion.collapseWebm=function(e){var t,a,i;e.preventDefault(),this.removeEventListener("click",ImageExpansion.collapseWebm,!1),t=this.parentNode,$.removeClass(t.parentNode,"image-expanded"),(a=Main.hasMobileLayout?t.previousElementSibling:t.parentNode.parentNode.getElementsByClassName("expandedWebm")[0]).classList.contains("ogv-cnt")?a.classList.contains("ogv-detached")||(a.firstElementChild.stop(),OgvCtrl.detach()):a.pause(),Config.centeredThreads&&(i=a.parentNode.parentNode.parentNode,$.removeClass(i,"centre-exp"),i.style.marginLeft=""),a.previousElementSibling.style.display="",a.parentNode.removeChild(a),t.parentNode.removeChild(t)},ImageExpansion.detachOgv=function(e){let t=e.parentNode;t.style.width=e.style.width,t.style.height=e.style.height,t.classList.add("ogv-detached"),e.remove()},ImageExpansion.onScroll=function(){clearTimeout(ImageExpansion.timeout),ImageExpansion.timeout=setTimeout(ImageExpansion.pauseVideos,500)},ImageExpansion.pauseVideos=function(){var e,t,a,i,n,o,r;for(e=ImageExpansion,r=[],n=window.pageYOffset,o=window.pageYOffset+$.docEl.clientHeight,t=0;a=e.activeVideos[t];++t)(i=a.getBoundingClientRect()).top+window.pageYOffset>o||i.bottom+window.pageYOffset<n?a.pause():a.paused||r.push(a);r.length||document.removeEventListener("scroll",e.onScroll,!1),e.activeVideos=r},ImageExpansion.onError=function(e){var t,a;Feedback.error("File no longer exists (404).",2e3),a=e.target,t=$.qs("img[data-expanding]",a.parentNode),a.parentNode.removeChild(a),t.style.opacity="",t.removeAttribute("data-expanding")},ImageExpansion.onLoadStart=function(e,t){var a,i,n,o,r,s,d,l,c,p,h;t.removeAttribute("data-expanding"),d=t.parentNode.parentNode,Config.centeredThreads&&(l=d.parentNode.parentNode,c=$.cls("opContainer")[0].offsetWidth,$.addClass(l,"centre-exp")),s=t.getBoundingClientRect().left,n=$.docEl.clientWidth-s-25,o=$.docEl.clientHeight,a=e.naturalWidth,i=e.naturalHeight,a>n&&(r=n/a,a=n,i*=r),Config.fitToScreenExpansion&&i>o&&(r=o/i,i=o,a*=r),e.style.maxWidth=a+"px",e.style.maxHeight=i+"px",$.addClass(d,"image-expanded"),!Main.tid&&Config.threadHiding&&$.addClass(t.parentNode,"image-expanded-anti"),e.style.display="",t.style.display="none",Config.centeredThreads?(s=e.getBoundingClientRect().left,(p=e.offsetWidth+2*s)>c?(s=Math.floor(($.docEl.clientWidth-p)/2))>0&&(l.style.marginLeft=s+"px"):$.removeClass(l,"centre-exp")):Main.hasMobileLayout&&((l=t.parentNode.lastElementChild).firstElementChild||((d=document.createElement("div")).className="mFileName",(h=t.parentNode.parentNode.getElementsByClassName("fileText")[0])&&(h=h.firstElementChild,d.innerHTML=h.getAttribute("title")||h.innerHTML),l.insertBefore(d,l.firstChild)))},ImageExpansion.checkLoadStart=function(e,t){if(!e.naturalWidth)return setTimeout(ImageExpansion.checkLoadStart,15,e,t);ImageExpansion.onLoadStart(e,t),t.style.opacity=""};var ImageHover={};ImageHover.show=function(e){var t,a,i;(i=(a="A"!==e.nodeName?e.parentNode.getAttribute("href"):e.getAttribute("href")).match(/\.(?:webm|mp4|pdf)$/))?".webm"!=i[0]&&".mp4"!=i[0]||ImageHover.showWebm(e):((t=document.createElement("img")).id="image-hover",t.alt="Image",t.onerror=ImageHover.onLoadError,t.src=a,Config.imageHoverBg&&(t.style.backgroundColor="inherit"),document.body.appendChild(t),UA.hasCORS?(t.style.display="none",this.timeout=ImageHover.checkLoadStart(t,e)):t.style.left=e.getBoundingClientRect().right+10+"px")},ImageHover.hide=function(){var e;clearTimeout(this.timeout),(e=$.id("image-hover"))&&(e.play&&(e.pause(),Tip.hide()),document.body.removeChild(e))},ImageHover.showWebm=function(e){var t;(t=document.createElement("video")).id="image-hover",Config.imageHoverBg&&(t.style.backgroundColor="inherit"),"A"!==e.nodeName?t.src=e.parentNode.getAttribute("href"):t.src=e.getAttribute("href"),t.loop=!0,t.muted=!Config.unmuteWebm,t.autoplay=!0,t.onerror=ImageHover.onLoadError,t.onloadedmetadata=function(){ImageHover.showWebMDuration(this,e)},t.onvolumechange=Main.getWebmVolumeChangeCb(),document.body.appendChild(t),Config.unmuteWebm&&(t.volume=Main.getWebmVolume())},ImageHover.showWebMDuration=function(e,t){var a,i,n;if(e.parentNode){var o,r=$.prettySeconds(e.duration);o=!0===e.mozHasAudio||e.webkitAudioDecodedByteCount>0||e.audioTracks&&e.audioTracks.length?" (audio)":"",n=t.getBoundingClientRect(),[a,i]=$.fit(e.videoWidth,e.videoHeight,window.innerWidth-n.right-20,window.innerHeight),e.style.width=a+"px",e.style.height=i+"px",Tip.show(t,r[0]+":"+("0"+r[1]).slice(-2)+o)}},ImageHover.onLoadError=function(){Feedback.error("File no longer exists (404).",2e3)},ImageHover.onLoadStart=function(e,t){var a,i;a=t.getBoundingClientRect(),i=window.innerWidth-a.right-20,e.naturalWidth>i&&(e.style.maxWidth=i+"px"),e.style.display=""},ImageHover.checkLoadStart=function(e,t){if(!e.naturalWidth)return setTimeout(ImageHover.checkLoadStart,15,e,t);ImageHover.onLoadStart(e,t)};var QR={};QR.init=function(){var e;if(UA.hasFormData){this.enabled=!!document.forms.post,this.currentTid=null,this.cooldown=null,this.timestamp=null,this.auto=!1,this.btn=null,this.comField=null,this.comLength=window.comlen,this.comCheckTimeout=null,this.cdElapsed=0,this.activeDelay=0,this.ctTTL=290,this.ctTimeout=null,this.cooldowns={};for(e in window.cooldowns)this.cooldowns[e]=1e3*window.cooldowns[e];if(this.noCaptcha)for(e in this.cooldowns)this.cooldowns[e]=Math.ceil(this.cooldowns[e]/2);this.painterTime=0,this.painterData=null,this.painterSrc=null,this.replayBlob=null,this.canvasLoading=!1,this.captchaWidgetCnt=null,this.captchaWidgetId=null,this.pulse=null,this.xhr=null,this.fileDisabled=!!window.imagelimit,this.tracked={},!Main.tid||Main.hasMobileLayout||Main.threadClosed||QR.addReplyLink(),window.addEventListener("storage",this.syncStorage,!1)}},QR.openTeXPreview=function(){var e;QR.closeTeXPreview(),window.MathJax||window.loadMathJax(),(e=document.createElement("div")).id="tex-preview-cnt",e.className="UIPanel",e.setAttribute("data-cmd","close-tex-preview"),e.innerHTML='<div class="extPanel reply"><div class="panelHeader"><span class="tex-logo">T<sub>e</sub>X</span> Preview<span class="panelCtrl"><img alt="Close" title="Close" class="pointer" data-cmd="close-tex-preview" src="'+Main.icons.cross+'"></span></div><div id="tex-protip">Use [math][/math] tags for inline, and [eqn][/eqn] tags for block equations.</div><textarea id="input-tex-preview"></textarea><div id="output-tex-preview"></div></div>',document.body.appendChild(e),e=$.id("input-tex-preview"),$.on(e,"keyup",QR.onTeXChanged)},QR.closeTeXPreview=function(){var e;(e=$.id("input-tex-preview"))&&($.off(e,"keyup",QR.onTeXChanged),(e=$.id("tex-preview-cnt")).parentNode.removeChild(e))},QR.onTeXChanged=function(){clearTimeout(QR.timeoutTeX),QR.timeoutTeX=setTimeout(QR.processTeX,50)},QR.processTeX=function(){var e,t;!QR.processingTeX&&window.MathJax&&(e=$.id("input-tex-preview"))&&((t=$.id("output-tex-preview")).textContent=e.value,QR.processingTeX=!0,MathJax.Hub.Queue(["Typeset",MathJax.Hub,t],["onTeXReady",QR]))},QR.onTeXReady=function(){QR.processingTeX=!1},QR.validateCT=function(){var e,t;QR.captchaWidgetCnt&&((e=Main.getCookie("_ct"))?QR.ctTimeout||(e=e.split(".")[1],(t=(0|Date.now()/1e3)-e)>=QR.ctTTL?QR.setCTTag():QR.setCTTag(QR.ctTTL-t)):QR.ctTimeout&&QR.setCTTag())},QR.setCTTag=function(e){if(!window.t_captcha){var t=QR.captchaWidgetCnt;QR.clearCTTimeout(),e&&e>0?(QR.ctTimeout=setTimeout(QR.setCTTag,1e3*e),t.style.opacity="0.25",$.on(t,"mouseover",QR.onCTMouseOver),$.on(t,"mouseout",QR.onCTMouseOut)):(t.style.opacity="",$.off(t,"mouseover",QR.onCTMouseOver),$.off(t,"mouseout",QR.onCTMouseOut))}},QR.onCTMouseOver=function(){QR.onCTMouseOut(),QR.ctTipTimeout=setTimeout(Tip.show,Tip.delay,QR.captchaWidgetCnt,"Verification not required for your next post.")},QR.onCTMouseOut=function(){clearTimeout(QR.ctTipTimeout),Tip.hide()},QR.clearCTTimeout=function(){clearTimeout(QR.ctTimeout),QR.ctTimeout=null},QR.addReplyLink=function(){var e,t;e=$.cls("navLinks")[2],(t=document.createElement("div")).className="open-qr-wrap",t.innerHTML='[<a href="#" class="open-qr-link" data-cmd="open-qr">Post a Reply</a>]',e.insertBefore(t,e.firstChild)},QR.lock=function(){QR.showPostError("This thread is closed.","closed",!0)},QR.unlock=function(){QR.hidePostError("closed")},QR.syncStorage=function(e){var t;e.key&&"4chan"==(t=e.key.split("-"))[0]&&"cd"==t[1]&&e.newValue&&Main.board==t[2]&&QR.startCooldown()},QR.onOpenInPainterClick=function(e){var t,a,i,n;if(QR.canvasLoading)Feedback.error("An image is already being loaded.");else{if(n=+e.getAttribute("data-pid"),i=+e.getAttribute("data-tid"),!n||!i)return!1;if(!(a=$.qs("#f"+n+' a[class="fileThumb"]')))return!1;if(!1===/\.(png|jpg)$/.test(a.href))return!1;QR.canvasLoading=!0,(t=new Image).crossOrigin="Anonymous",t.onload=QR.onPainterCanvasLoaded,t.onerror=QR.onPainterCanvasError,t._pid=n,Feedback.notify("Loading\u2026",0),t.src=a.href.replace("is2.4chan.org","i.4cdn.org"),QR.show(i)}},QR.onPainterCanvasError=function(){QR.canvasLoading=!1,Feedback.error("Couldn't load the image.",5e3)},QR.onPainterCanvasLoaded=function(){Feedback.hideMessage(),QR.canvasLoading=!1,QR.currentTid&&(this.naturalWidth<1||this.naturalHeight<1||(Tegaki.startTimeStamp&&Tegaki.destroy(),Keybinds.enabled=!1,QR.painterSrc=this._pid,Tegaki.open({onDone:QR.onPainterDone,onCancel:QR.onPainterCancel,saveReplay:!1,width:1,height:1}),Tegaki.onOpenImageLoaded.call(this)))},QR.openPainter=function(){var e,t,a,i;e=+(a=$.tag("input",$.id("qr-painter-ctrl")))[0].value,t=+a[1].value,e<1||t<1||(i=$.cls("oe-r-cb",$.id("qr-painter-ctrl"))[0],Keybinds.enabled=!1,window.Tegaki.open({onDone:QR.onPainterDone,onCancel:QR.onPainterCancel,saveReplay:i&&i.checked,width:e,height:t}))},QR.onPainterDone=function(){var e,t;Keybinds.enabled=!0,QR.painterData=Tegaki.flatten().toDataURL("image/png"),Tegaki.saveReplay&&(QR.replayBlob=Tegaki.replayRecorder.toBlob()),QR.painterTime=0,Tegaki.startTimeStamp&&(Tegaki.hasCustomCanvas&&!QR.painterSrc||(QR.painterTime=Math.round((Date.now()-Tegaki.startTimeStamp)/1e3))),(e=$.id("qrFile"))&&(e.style.visibility="hidden"),t=$.id("qr-painter-ctrl"),(e=$.tag("button",t)[0])&&(e.textContent="Edit"),(e=$.tag("button",t)[1])&&(e.disabled=!1);for(e of $.tag("input",t))e.disabled=!0},QR.onPainterCancel=function(){var e,t;Keybinds.enabled=!0,QR.painterData=null,QR.painterSrc=null,QR.replayBlob=null,QR.painterTime=0,(e=$.id("qrFile"))&&(e.style.visibility=""),t=$.id("qr-painter-ctrl"),(e=$.tag("button",t)[0])&&(e.textContent="Draw"),(e=$.tag("button",t)[1])&&(e.disabled=!0);for(e of $.tag("input",t))e.disabled=!1},QR.quotePost=function(e,t){QR.noCooldown||!(Main.threadClosed||!Main.tid&&Main.isThreadClosed(e))?(QR.show(e),QR.addQuote(t)):alert("This thread is closed")},QR.addQuote=function(e){var t,a,i,n;a=(n=$.tag("textarea",document.forms.qrPost)[0]).selectionStart,i=UA.getSelection(),t=e?">>"+e+"\n":"",i&&(t+=">"+i.trim().replace(/[\r\n]+/g,"\n>")+"\n"),n.value?n.value=n.value.slice(0,a)+t+n.value.slice(n.selectionEnd):n.value=t,UA.isOpera&&(a+=t.split("\n").length),n.selectionStart=n.selectionEnd=a+t.length,n.selectionStart==n.value.length&&(n.scrollTop=n.scrollHeight),n.focus()},QR.show=function(e){var t,a,i,n,o,r,s,d,l,c,p,h,u,g,m,f;if(window.checkIncognito&&window.checkIncognito(),QR.currentTid)return Main.tid||QR.currentTid==e||($.id("qrTid").textContent=$.id("qrResto").value=QR.currentTid=e,$.byName("com")[1].value="",QR.startCooldown()),void(Main.hasMobileLayout&&($.id("quickReply").style.top=window.pageYOffset+25+"px"));for(QR.currentTid=e,n=$.id("postForm"),(i=document.createElement("div")).id="quickReply",i.className="extPanel reply",i.setAttribute("data-trackpos","QR-position"),Main.hasMobileLayout?i.style.top=window.pageYOffset+28+"px":Config["QR-position"]?i.style.cssText=Config["QR-position"]:(i.style.right="0px",i.style.top="10%"),i.innerHTML='<div id="qrHeader" class="drag postblock">'+(window.math_tags?'<a data-cmd="open-tex-preview" class="desktop pointer left tex-logo" data-tip="Preview TeX equations">T<sub>e</sub>X</a>':"")+'Reply to Thread No.<span id="qrTid">'+e+'</span><img alt="X" src="'+Main.icons.cross+'" id="qrClose" class="extButton" title="Close Window"></div>',(o=n.parentNode.cloneNode(!1)).setAttribute("name","qrPost"),o.innerHTML=((f=$.byName("MAX_FILE_SIZE")[0])?'<input type="hidden" value="'+f.value+'" name="MAX_FILE_SIZE">':"")+'<input type="hidden" value="regist" name="mode"><input id="qrResto" type="hidden" value="'+e+'" name="resto">',(r=document.createElement("div")).id="qrForm",this.btn=null,t=0,a=(s=n.firstElementChild.children).length-1;t<a;++t){if(d=document.createElement("div"),"captchaFormPart"==s[t].id){if(QR.noCaptcha)continue;d.id="qrCaptchaContainer",d.classList.add("t-qr-root"),QR.captchaWidgetCnt=d}else{if("Password"==(u=s[t].getAttribute("data-type"))||"Spoilers"==u)continue;if("File"==u)(c=s[t].children[1].firstChild.cloneNode(!1)).tabIndex="",c.id="qrFile",c.size="19",c.addEventListener("change",QR.onFileChange,!1),d.appendChild(c),c.title="Shift + Click to remove the file";else if("Painter"==u)d.innerHTML=s[t].children[1].innerHTML,d.id="qr-painter-ctrl",d.className="desktop",(p=d.getElementsByTagName("button"))[0].setAttribute("data-cmd","qr-painter-draw"),p[1].setAttribute("data-cmd","qr-painter-clear");else if(d.innerHTML=s[t].children[1].innerHTML,(p="hidden"==d.firstChild.type?d.lastChild.previousSibling:d.firstChild).tabIndex="","INPUT"==p.nodeName||"TEXTAREA"==p.nodeName){if("name"==p.name)(m=Main.getCookie("4chan_name"))&&(p.value=m);else if("email"==p.name)p.id="qrEmail",(m=Main.getCookie("options"))&&(p.value=m),p.nextElementSibling&&p.parentNode.removeChild(p.nextElementSibling);else if("com"==p.name)QR.comField=p,p.addEventListener("keydown",QR.onKeyDown,!1),p.addEventListener("paste",QR.onKeyDown,!1),p.addEventListener("cut",QR.onKeyDown,!1),d.children[1]&&d.removeChild(p.nextSibling);else if("sub"==p.name)continue;null!==u&&p.setAttribute("placeholder",u)}else"flag"==p.name&&((h=$.qs("option[selected]",p))&&h.removeAttribute("selected"),(m=localStorage.getItem("4chan_flag_"+Main.board))&&(h=$.qs('option[value="'+m+'"]',p))&&h.setAttribute("selected","selected"),$.on(p,"change",window.onBoardFlagChanged))}r.appendChild(d)}this.btn||(this.btn=$.qs('input[type="submit"]',n).cloneNode(!1),this.btn.tabIndex="",c?c.parentNode.appendChild(this.btn):(r.appendChild(document.createElement("div")),r.lastElementChild.appendChild(this.btn))),(p=$.qs('.desktop > label > input[name="spoiler"]',n))&&((l=document.createElement("span")).id="qrSpoiler",l.innerHTML='<label>[<input type="checkbox" value="on" name="spoiler">Spoiler?]</label>',c.parentNode.insertBefore(l,c.nextSibling)),o.appendChild(r),i.appendChild(o),(g=document.createElement("div")).id="qrError",i.appendChild(g),i.addEventListener("click",QR.onClick,!1),document.body.appendChild(i),QR.startCooldown(),Main.threadClosed&&QR.lock(),window.passEnabled||QR.renderCaptcha(),Main.hasMobileLayout||Draggable.set($.id("qrHeader"))},QR.renderCaptcha=function(){if(window.grecaptcha)return QR.captchaWidgetId=grecaptcha.render(QR.captchaWidgetCnt,{sitekey:window.recaptchaKey,theme:"tomorrow"===Main.stylesheet||window.dark_captcha?"dark":"light"}),void QR.validateCT();window.t_captcha&&(TCaptcha.init(QR.captchaWidgetCnt,Main.board,QR.currentTid),TCaptcha.setErrorCb(QR.showPostError))},QR.resetCaptcha=function(){window.grecaptcha?null!==QR.captchaWidgetId&&(grecaptcha.reset(QR.captchaWidgetId),QR.validateCT()):window.t_captcha&&TCaptcha.clearChallenge()},QR.onPassError=function(){var e,t;QR.captchaWidgetCnt||(window.passEnabled=QR.noCaptcha=!1,(e=document.createElement("div")).id="qrCaptchaContainer",(t=$.id("qrForm")).insertBefore(e,t.lastElementChild),QR.captchaWidgetCnt=e,QR.renderCaptcha())},QR.onFileChange=function(){var e,t;this.value?(t=window.maxFilesize,this.files?(e=this.files[0].size,"video/webm"==this.files[0].type&&window.maxWebmFilesize&&(t=window.maxWebmFilesize)):e=0,QR.fileDisabled?QR.showPostError("Image limit reached.","imagelimit",!0):e>t?QR.showPostError("Error: Maximum file size allowed is "+Math.floor(t/1048576)+" MB","filesize",!0):QR.hidePostError()):QR.hidePostError(),QR.painterData=null,QR.replayBlob=null,QR.startCooldown()},QR.onKeyDown=function(e){var t,a,i,n
|
|
;if(e.ctrlKey&&83==e.keyCode)e.stopPropagation(),e.preventDefault(),a=(t=e.target).selectionStart,i=t.selectionEnd,t.value?(n="[spoiler]"+t.value.slice(a,i)+"[/spoiler]",t.value=t.value.slice(0,a)+n+t.value.slice(i),t.setSelectionRange(i+19,i+19)):(t.value="[spoiler][/spoiler]",t.setSelectionRange(9,9));else if(!(27!=e.keyCode||e.ctrlKey||e.altKey||e.shiftKey||e.metaKey))return void QR.close();clearTimeout(QR.comCheckTimeout),QR.comCheckTimeout=setTimeout(QR.checkCommentField,500)},QR.checkCommentField=function(){var e;QR.comLength&&((e=encodeURIComponent(QR.comField.value).split(/%..|./).length-1)>QR.comLength?QR.showPostError("Error: Comment too long ("+e+"/"+QR.comLength+").","length",!0):QR.hidePostError("length")),window.sjis_tags&&(/\[sjis\]/.test(QR.comField.value)?$.hasClass(QR.comField,"sjis")||$.addClass(QR.comField,"sjis"):$.hasClass(QR.comField,"sjis")&&$.removeClass(QR.comField,"sjis"))},QR.close=function(){var e,t=$.id("quickReply");QR.comField=null,QR.currentTid=null,QR.painterTime=0,QR.painterData=null,QR.painterSrc=null,QR.replayBlob=null,QR.canvasLoading=!1,clearInterval(QR.pulse),QR.xhr&&(QR.xhr.abort(),QR.xhr=null),t.removeEventListener("click",QR.onClick,!1),(e=$.id("qrFile"))&&e.removeEventListener("change",QR.startCooldown,!1),(e=$.id("qrEmail"))&&e.removeEventListener("change",QR.startCooldown,!1),$.tag("textarea",t)[0].removeEventListener("keydown",QR.onKeyDown,!1),Draggable.unset($.id("qrHeader")),QR.noCaptcha||QR.setCTTag(),window.t_captcha&&TCaptcha.node===QR.captchaWidgetCnt&&TCaptcha.destroy(),document.body.removeChild(t)},QR.onClick=function(e){var t=e.target;if("submit"==t.type)e.preventDefault(),QR.submit(e.shiftKey);else switch(t.id){case"qrFile":e.shiftKey&&(e.preventDefault(),QR.resetFile());break;case"qrDummyFile":case"qrDummyFileButton":case"qrDummyFileLabel":e.preventDefault(),e.shiftKey?QR.resetFile():$.id("qrFile").click();break;case"qrClose":QR.close()}},QR.showPostError=function(e,t,a){var i;(i=$.id("qrError"))&&(e?(i.innerHTML=e,i.style.display="block",i.setAttribute("data-type",t||""),!a&&(document.hidden||document.mozHidden||document.webkitHidden||document.msHidden)&&alert("Posting Error")):QR.hidePostError())},QR.hidePostError=function(e){var t=$.id("qrError");t.hasAttribute("style")&&(e&&t.getAttribute("data-type")!=e||t.removeAttribute("style"))},QR.resetFile=function(){var e,t;QR.painterData=null,QR.replayBlob=null,(t=document.createElement("input")).id="qrFile",t.type="file",t.size="19",t.name="upfile",t.addEventListener("change",QR.onFileChange,!1),(e=$.id("qrFile")).removeEventListener("change",QR.onFileChange,!1),e.parentNode.replaceChild(t,e),QR.hidePostError("imagelimit"),QR.needPreuploadCaptcha=!1,QR.startCooldown()},QR.submit=function(e){var t;QR.hidePostError(),QR.presubmitChecks(e)&&(QR.auto=!1,QR.xhr=new XMLHttpRequest,QR.xhr.open("POST",document.forms.qrPost.action,!0),QR.xhr.withCredentials=!0,QR.xhr.setRequestHeader("Accept","application/json"),QR.xhr.upload.onprogress=function(e){e.loaded>=e.total?QR.btn.value="100%":QR.btn.value=(0|e.loaded/e.total*100)+"%"},QR.xhr.onerror=function(){QR.xhr=null,QR.showPostError("Connection error.")},QR.xhr.onload=function(){var e,t,a,i,n,o,r;if(QR.xhr=null,QR.btn.value="Post",200==this.status){if("application/json"==this.getResponseHeader("Content-Type")){try{e=JSON.parse(this.responseText)}catch(s){console.log("QR resp",s),e={error:"Something went wrong."}}if(e.error)return window.passEnabled&&/4chan Pass/.test(e.error)?QR.onPassError():QR.resetCaptcha(),void QR.showPostError(e.error);e.pid&&(n=e.tid,o=e.pid)}else{if(e=this.responseText.match(/"errmsg"[^>]*>(.*?)<\/span/))return window.passEnabled&&/4chan Pass/.test(e)?QR.onPassError():QR.resetCaptcha(),void QR.showPostError(e[1]);(i=this.responseText.match(/<!-- thread:([0-9]+),no:([0-9]+) -->/))&&(n=i[1],o=i[2])}o&&(a=(t=$.id("qrFile"))&&t.value,QR.setPostTime(),Config.persistentQR?($.byName("com")[1].value="",(t=$.byName("spoiler")[2])&&(t.checked=!1),QR.resetCaptcha(),(a||QR.painterData)&&QR.resetFile(),QR.startCooldown()):QR.close(),Main.tid?(Config.threadWatcher&&ThreadWatcher.setLastRead(o,n),QR.lastReplyId=+o,Parser.trackedReplies[">>"+o]=1,Parser.saveTrackedReplies(n,Parser.trackedReplies)):((r=Parser.getTrackedReplies(Main.board,n)||{})[">>"+o]=1,Parser.saveTrackedReplies(n,r)),Parser.touchTrackedReplies(n),UA.dispatchEvent("4chanQRPostSuccess",{threadId:n,postId:o})),ThreadUpdater.enabled&&setTimeout(ThreadUpdater.forceUpdate,500)}else QR.showPostError("Error: "+this.status+" "+this.statusText)},!(t=new FormData(document.forms.qrPost)).entries||!t["delete"]||t.get("upfile")&&t.get("upfile").size||t["delete"]("upfile"),QR.painterData&&(QR.appendPainter(t),QR.replayBlob&&t.append("oe_replay",QR.replayBlob,"tegaki.tgkr"),t.append("oe_time",QR.painterTime),QR.painterSrc&&t.append("oe_src",QR.painterSrc)),clearInterval(QR.pulse),QR.btn.value="Sending",QR.xhr.send(t))},QR.appendPainter=function(e){var t;if(t=QR.b64toBlob(QR.painterData.slice(QR.painterData.indexOf(",")+1))){if(t.size>window.maxFilesize)return void QR.showPostError("Error: Maximum file size allowed is "+Math.floor(window.maxFilesize/1048576)+" MB","filesize",!0);e.append("upfile",t,"tegaki.png")}},QR.b64toBlob=function(e){var t,a,i,n,o;for(o=(a=atob(e)).length,i=new Array(o),t=0;t<o;++t)i[t]=a.charCodeAt(t);return n=new Uint8Array(i),new Blob([n])},QR.presubmitChecks=function(e){if(QR.xhr)return QR.xhr.abort(),QR.xhr=null,QR.showPostError("Aborted."),QR.btn.value="Post",!1;if(!e&&QR.cooldown)return(QR.auto=!QR.auto)?QR.btn.value=QR.cooldown+"s (auto)":QR.btn.value=QR.cooldown+"s",!1;if(window.isIncognito){let e=$.id("qrFile");if(e&&e.value&&!QR.painterData)return QR.showPostError("Uploading files in incognito mode is not allowed.<br>The File field has been cleared."),QR.resetFile(),!1}return!0},QR.getCooldown=function(e){return QR.cooldowns[e]},QR.setPostTime=function(){return localStorage.setItem("4chan-cd-"+Main.board,Date.now())},QR.getPostTime=function(){return localStorage.getItem("4chan-cd-"+Main.board)},QR.removePostTime=function(){return localStorage.removeItem("4chan-cd-"+Main.board)},QR.startCooldown=function(){var e,t,a;if(!QR.noCooldown&&$.id("quickReply")&&!QR.xhr)if(clearInterval(QR.pulse),e=(t=$.id("qrFile"))&&t.value?"image":"reply",a=QR.getPostTime(e)){if(QR.timestamp=parseInt(a,10),QR.activeDelay=QR.getCooldown(e),QR.cdElapsed=Date.now()-QR.timestamp,QR.cooldown=Math.ceil((QR.activeDelay-QR.cdElapsed)/1e3),QR.cooldown<=0||QR.cdElapsed<0)return QR.cooldown=!1,void(QR.btn.value="Post");QR.btn.value=QR.cooldown+"s",QR.pulse=setInterval(QR.onPulse,1e3)}else QR.btn.value="Post"},QR.onPulse=function(){QR.cdElapsed=Date.now()-QR.timestamp,QR.cooldown=Math.ceil((QR.activeDelay-QR.cdElapsed)/1e3),QR.cooldown<=0?(clearInterval(QR.pulse),QR.btn.value="Post",QR.cooldown=!1,QR.auto&&QR.submit()):QR.btn.value=QR.cooldown+(QR.auto?"s (auto)":"s")};var ThreadHiding={};ThreadHiding.init=function(){this.threshold=432e5,this.hidden={},this.load(),this.purge()},ThreadHiding.clear=function(e){var t,a,i,n;this.load(),t=0;for(a in this.hidden)++t;if(i="4chan-hide-t-"+Main.board,e)localStorage.removeItem(i);else{if(!t)return void alert("You don't have any hidden threads on /"+Main.board+"/");if(n="This will unhide "+t+" thread"+(t>1?"s":"")+" on /"+Main.board+"/",!confirm(n))return;localStorage.removeItem(i)}},ThreadHiding.isHidden=function(e){return!!ThreadHiding.hidden[e]},ThreadHiding.toggle=function(e){this.isHidden(e)?this.show(e):this.hide(e),this.save()},ThreadHiding.show=function(e){var t,a;a=$.id("t"+e),t=$.id("sa"+e),Main.hasMobileLayout?(t.parentNode.removeChild(t),a.style.display=null,$.removeClass(a.nextElementSibling,"mobile-hr-hidden")):(t.removeAttribute("data-hidden"),t.firstChild.src=Main.icons.minus,$.removeClass(a,"post-hidden")),delete this.hidden[e]},ThreadHiding.hide=function(e){var t,a;a=$.id("t"+e),Main.hasMobileLayout?(a.style.display="none",$.addClass(a.nextElementSibling,"mobile-hr-hidden"),(t=document.createElement("span")).id="sa"+e,t.setAttribute("data-cmd","hide"),t.setAttribute("data-id",e),t.textContent="Show Hidden Thread",t.className="mobileHideButton button mobile-tu-show",a.parentNode.insertBefore(t,a)):Config.hideStubs&&!$.cls("stickyIcon",a)[0]?a.style.display=a.nextElementSibling.style.display="none":((t=$.id("sa"+e)).setAttribute("data-hidden",e),t.firstChild.src=Main.icons.plus,a.className+=" post-hidden"),this.hidden[e]=Date.now()},ThreadHiding.load=function(){var e;(e=localStorage.getItem("4chan-hide-t-"+Main.board))&&(this.hidden=JSON.parse(e))},ThreadHiding.purge=function(){var e,t,a,i;i="4chan-purge-t-"+Main.board,a=localStorage.getItem(i);for(e in this.hidden){t=!0;break}t&&(!a||a<Date.now()-this.threshold)&&$.get("//a.4cdn.org/"+Main.board+"/threads.json",{onload:function(){var e,t,a,n,o,r,s;if(200==this.status){for(s={},o=JSON.parse(this.responseText),e=0;n=o[e];++e)for(r=n.threads,t=0;a=r[t];++t)ThreadHiding.hidden[a.no]&&(s[a.no]=1);ThreadHiding.hidden=s,ThreadHiding.save(),localStorage.setItem(i,Date.now())}else console.log("Bad status code while purging threads")},onerror:function(){console.log("Error while purging hidden threads")}})},ThreadHiding.save=function(){var e;for(e in this.hidden)return void localStorage.setItem("4chan-hide-t-"+Main.board,JSON.stringify(this.hidden));localStorage.removeItem("4chan-hide-t-"+Main.board)};var ReplyHiding={};ReplyHiding.init=function(){this.threshold=6048e5,this.hidden={},this.hiddenR={},this.hiddenRMap={},this.hasR=!1,this.load()},ReplyHiding.isHidden=function(e){var t=$.id("sa"+e);return!t||t.hasAttribute("data-hidden")},ReplyHiding.toggle=function(e){this.load(),this.isHidden(e)?this.show(e):this.hide(e),this.save()},ReplyHiding.toggleR=function(e){var t,a,i,n,o,r;if(this.load(),r=this.hiddenRMap[">>"+e]){this.showR(r,r);for(t in this.hiddenRMap)this.hiddenRMap[t]==r&&this.showR(t.slice(2))}else{for(this.hideR(e,e),i=$.id("m"+e),n=$.cls("postMessage"),t=1;n[t]!==i;++t);for(;a=n[t];++t)ReplyHiding.shouldToggleR(a)&&(o=a.id.slice(1),this.hideR(o,e))}this.hasR=!1;for(t in this.hiddenRMap){this.hasR=!0;break}this.save()},ReplyHiding.shouldToggleR=function(e){var t,a,i,n;if(e.parentNode.hasAttribute("data-pfx"))return!1;if(!(n=$.qsa("#"+e.id+" > .quotelink",e))[0])return!1;if(i=this.hiddenRMap[n[0].textContent],1===n.length&&i)return i;for(t=0;a=n[t];++t)if(!this.hiddenRMap[a.textContent])return!1;return i},ReplyHiding.show=function(e){$.removeClass($.id("pc"+e),"post-hidden"),$.id("sa"+e).removeAttribute("data-hidden"),delete ReplyHiding.hidden[e]},ReplyHiding.showR=function(e,t){$.removeClass($.id("pc"+e),"post-hidden"),$.id("sa"+e).removeAttribute("data-hidden"),delete ReplyHiding.hiddenRMap[">>"+e],t&&delete ReplyHiding.hiddenR[t]},ReplyHiding.hide=function(e){$.addClass($.id("pc"+e),"post-hidden"),$.id("sa"+e).setAttribute("data-hidden",e),ReplyHiding.hidden[e]=Date.now()},ReplyHiding.hideR=function(e,t){$.addClass($.id("pc"+e),"post-hidden"),$.id("sa"+e).setAttribute("data-hidden",e),ReplyHiding.hiddenRMap[">>"+e]=t,e===t&&(ReplyHiding.hiddenR[e]=Date.now()),ReplyHiding.hasR=!0},ReplyHiding.load=function(){var e;this.hasHiddenR=!1,(e=localStorage.getItem("4chan-hide-r-"+Main.board))&&(this.hidden=JSON.parse(e)),(e=localStorage.getItem("4chan-hide-rr-"+Main.board))&&(this.hiddenR=JSON.parse(e))},ReplyHiding.purge=function(){var e,t;t=Date.now();for(e in this.hidden)t-this.hidden[e]>this.threshold&&delete this.hidden[e];for(e in this.hiddenR)t-this.hiddenR[e]>this.threshold&&delete this.hiddenR[e];this.save()},ReplyHiding.save=function(){var e,t;t=!0;for(e in this.hidden){localStorage.setItem("4chan-hide-r-"+Main.board,JSON.stringify(this.hidden)),t=!1;break}t&&localStorage.removeItem("4chan-hide-r-"+Main.board),t=!0;for(e in this.hiddenR){localStorage.setItem("4chan-hide-rr-"+Main.board,JSON.stringify(this.hiddenR)),t=!1;break}t&&localStorage.removeItem("4chan-hide-rr-"+Main.board)};var ThreadWatcher={};ThreadWatcher.init=function(){var e,t,a,i,n;this.listNode=null,this.charLimit=45,this.watched={},this.blacklisted={},this.isRefreshing=!1,Main.hasMobileLayout&&((i=document.createElement("a")).href="#",i.textContent="TW",i.addEventListener("click",ThreadWatcher.toggleList,!1),(e=$.id("settingsWindowLinkMobile")).parentNode.insertBefore(i,e),e.parentNode.insertBefore(document.createTextNode(" "),e)),location.hash&&(t=location.hash.split("lr")[1])&&((t=$.id("pc"+t))&&(t.nextElementSibling&&(t=t.nextElementSibling,(i=$.id("p"+t.id.slice(2)))&&$.addClass(i,"highlight")),((a=t.getBoundingClientRect()).top<0||a.bottom>document.documentElement.clientHeight)&&window.scrollBy(0,a.top)),window.history&&history.replaceState&&history.replaceState(null,"",location.href.split("#",1)[0])),(e=document.createElement("div")).id="threadWatcher",e.className="extPanel reply",e.setAttribute("data-trackpos","TW-position"),Main.hasMobileLayout?e.style.display="none":(Config["TW-position"]?e.style.cssText=Config["TW-position"]:(e.style.left="10px",e.style.top="380px"),Config.fixedThreadWatcher?e.style.position="fixed":e.style.position=""),e.innerHTML='<div class="drag" id="twHeader">'+(Main.hasMobileLayout?'<img id="twClose" class="pointer" src="'+Main.icons.cross+'" alt="X">':"")+"Thread Watcher"+(UA.hasCORS?'<img id="twPrune" class="pointer right" src="'+Main.icons.refresh+'" alt="R" title="Refresh"></div>':"</div>"),this.listNode=document.createElement("ul"),this.listNode.id="watchList",this.load(),Config.threadAutoWatcher&&((n=Main.getCookie("4chan_awt"))&&(Main.removeCookie("4chan_awt","."+$L.d(Main.board),"/"+Main.board+"/"),this.add(+n,Main.board),this.save()),document.forms.post&&((i=$.el("input")).type="hidden",i.name="awt",i.value="1",document.forms.post.appendChild(i))),Main.tid&&this.refreshCurrent(),this.build(),e.appendChild(this.listNode),document.body.appendChild(e),e.addEventListener("mouseup",this.onClick,!1),Draggable.set($.id("twHeader")),window.addEventListener("storage",this.syncStorage,!1),Main.hasMobileLayout?Main.tid&&ThreadWatcher.initMobileButtons():!Main.tid&&this.canAutoRefresh()&&this.refresh()},ThreadWatcher.toggleList=function(e){var t=$.id("threadWatcher");e&&e.preventDefault(),!Main.tid&&ThreadWatcher.canAutoRefresh()&&ThreadWatcher.refresh(),"none"==t.style.display?(t.style.top=window.pageYOffset+30+"px",t.style.display=""):t.style.display="none"},ThreadWatcher.syncStorage=function(e){var t;e.key&&("4chan"!=(t=e.key.split("-"))[0]||"watch"!=t[1]||t[2]||e.newValue==e.oldValue||(ThreadWatcher.load(),ThreadWatcher.build(!0)))},ThreadWatcher.load=function(){var e;(e=localStorage.getItem("4chan-watch"))&&(this.watched=JSON.parse(e)),(e=localStorage.getItem("4chan-watch-bl"))&&(this.blacklisted=JSON.parse(e))},ThreadWatcher.build=function(e){var t,a,i,n;t="";for(i in this.watched)t+='<li id="watch-'+i+'"><span class="pointer" data-cmd="unwatch" data-id="'+(a=i.split("-"))[0]+'" data-board="'+a[1]+'">×</span> <a href="'+Main.linkToThread(a[0],a[1])+"#lr"+this.watched[i][1]+'"',-1==this.watched[i][1]?t+=' class="deadlink">':(n=[],this.watched[i][3]&&n.push("archivelink"),this.watched[i][4]&&(n.push("hasYouReplies"),t+=' title="This thread has replies to your posts"'),this.watched[i][2]?t+=' class="'+(n[0]?n.join(" ")+" ":"")+'hasNewReplies">('+this.watched[i][2]+") ":t+=(n[0]?'class="'+n.join(" ")+'"':"")+">"),t+="/"+a[1]+"/ - "+this.watched[i][0]+"</a></li>";e&&ThreadWatcher.rebuildButtons(),ThreadWatcher.listNode.innerHTML=t},ThreadWatcher.rebuildButtons=function(){var e,t,a,i;for(t=$.cls("wbtn"),e=0;i=t[e];++e)a=i.getAttribute("data-id")+"-"+Main.board,ThreadWatcher.watched[a]?i.hasAttribute("data-active")||(i.src=Main.icons.watched,i.setAttribute("data-active","1")):i.hasAttribute("data-active")&&(i.src=Main.icons.notwatched,i.removeAttribute("data-active"))},ThreadWatcher.initMobileButtons=function(){var e,t,a,i;e=document.createElement("img"),a=Main.tid+"-"+Main.board,ThreadWatcher.watched[a]?(e.src=Main.icons.watched,e.setAttribute("data-active","1")):e.src=Main.icons.notwatched,e.className="extButton wbtn wbtn-"+a,e.setAttribute("data-cmd","watch"),e.setAttribute("data-id",Main.tid),e.alt="W",(t=document.createElement("span")).className="mobileib button",t.appendChild(e),(i=$.cls("navLinks")[0])&&(i.appendChild(document.createTextNode(" ")),i.appendChild(t)),(i=$.cls("navLinks")[3])&&(i.appendChild(document.createTextNode(" ")),i.appendChild(t.cloneNode(!0)))},ThreadWatcher.onClick=function(e){var t=e.target;t.hasAttribute("data-id")?ThreadWatcher.toggle(t.getAttribute("data-id"),t.getAttribute("data-board")):"twPrune"!=t.id||ThreadWatcher.isRefreshing?"twClose"==t.id&&ThreadWatcher.toggleList():ThreadWatcher.refreshWithAutoWatch()},ThreadWatcher.generateLabel=function(e,t,a){var i;return i=(i=e)?i.slice(0,this.charLimit):(i=t)?i.replace(/(?:<br>)+/g," ").replace(/<[^>]*?>/g,"").slice(0,this.charLimit):"No."+a},ThreadWatcher.toggle=function(e,t){var a;a=e+"-"+(t||Main.board),this.watched[a]?(this.blacklisted[a]=1,delete this.watched[a]):this.add(e,t,a),this.save(),this.load(),this.build(!0)},ThreadWatcher.add=function(e,t){var a,i,n,o,r,s;a=e+"-"+(t||Main.board),n=$.cls("subject",$.id("pi"+e))[0].textContent,o=$.id("m"+e).innerHTML,i=this.generateLabel(n,o,e),r=(s=$.id("t"+e)).children[1]?s.lastElementChild.id.slice(2):e,this.watched[a]=[i,r,0]},ThreadWatcher.addRaw=function(e,t){var a,i;a=e.no+"-"+(t||Main.board),this.watched[a]||(i=ThreadWatcher.generateLabel(e.sub,e.com,e.no),this.watched[a]=[i,0,0])},ThreadWatcher.save=function(){var e;ThreadWatcher.sortByBoard(),localStorage.setItem("4chan-watch",JSON.stringify(ThreadWatcher.watched));for(e in ThreadWatcher.blacklisted){localStorage.setItem("4chan-watch-bl",JSON.stringify(ThreadWatcher.blacklisted));break}},ThreadWatcher.sortByBoard=function(){var e,t,a,i,n;t=ThreadWatcher,i={},n=[];for(a in t.watched)n.push(a);for(n.sort(function(e,t){return(e=e.split("-")[1])<(t=t.split("-")[1])?-1:e>t?1:0}),e=0;a=n[e];++e)i[a]=t.watched[a];t.watched=i},ThreadWatcher.canAutoRefresh=function(){var e;return!(e=localStorage.getItem("4chan-tw-timestamp"))||Date.now()-+e>=6e4},ThreadWatcher.setRefreshTimestamp=function(){localStorage.setItem("4chan-tw-timestamp",Date.now())},ThreadWatcher.refreshWithAutoWatch=function(){var e,t,a,i,n;if(Config.filter){for(Filter.load(),n={},a=0,e=0;t=Filter.activeFilters[e];++e)if(t.auto&&t.boards)for(i in t.boards)n[i]||(n[i]=!0,++a);a?($.id("twPrune").src=Main.icons.rotate,this.isRefreshing=!0,this.fetchCatalogs(n,a)):this.refresh()}else this.refresh()},ThreadWatcher.fetchCatalogs=function(e,t){var a,i,n,o;n={},o={count:t},a=0;for(i in e)setTimeout(ThreadWatcher.fetchCatalog,a,i,n,o),a+=200},ThreadWatcher.fetchCatalog=function(e,t,a){var i;(i=new XMLHttpRequest).open("GET","//a.4cdn.org/"+e+"/catalog.json"),i.onload=function(){a.count--,t[e]=Parser.parseCatalogJSON(this.responseText),a.count||ThreadWatcher.onCatalogsLoaded(t)},i.onerror=function(){a.count--,a.count||ThreadWatcher.onCatalogsLoaded(t)},i.send(null)},ThreadWatcher.onCatalogsLoaded=function(e){var t,a,i,n,o,r,s,d,l;$.id("twPrune").src=Main.icons.refresh,this.isRefreshing=!1,l={};for(i in e)for(o=e[i],t=0;n=o[t];++t)for(r=n.threads,a=0;s=r[a];++a)d=s.no+"-"+i,this.blacklisted[d]?l[d]=1:Filter.match(s,i)&&this.addRaw(s,i);this.blacklisted=l,this.build(!0),this.refresh()},ThreadWatcher.refresh=function(){var e,t,a,i,n;if(i=$.id("watchList").children.length){e=t=0,(n=$.id("twPrune")).src=Main.icons.rotate,ThreadWatcher.isRefreshing=!0,ThreadWatcher.setRefreshTimestamp();for(a in ThreadWatcher.watched)setTimeout(ThreadWatcher.fetch,t,a,++e==i?n:null),t+=200}},ThreadWatcher.refreshCurrent=function(e){var t,a,i;t=Main.tid+"-"+Main.board,this.watched[t]&&(i=(a=$.id("t"+Main.tid)).children[1]?a.lastElementChild.id.slice(2):Main.tid,this.watched[t][1]<i&&(this.watched[t][1]=i),this.watched[t][2]=0,this.watched[t][4]=0,this.save(),e&&this.build())},ThreadWatcher.setLastRead=function(e,t){var a=t+"-"+Main.board;this.watched[a]&&(this.watched[a][1]=e,this.watched[a][2]=0,this.watched[a][4]=0,this.save(),this.build())},ThreadWatcher.onRefreshEnd=function(e){e.src=Main.icons.refresh,this.isRefreshing=!1,this.save(),this.load(),this.build()},ThreadWatcher.fetch=function(e,t){var a,i,n;if(n=$.id("watch-"+e),-1==ThreadWatcher.watched[e][1])return delete ThreadWatcher.watched[e],n.parentNode.removeChild(n),void(t&&ThreadWatcher.onRefreshEnd(t));a=e.split("-"),(i=new XMLHttpRequest).onload=function(){var i,n,o,r,s,d,l,c,p;if(200==this.status){for(o=Parser.parseThreadJSON(this.responseText),r=ThreadWatcher.watched[e][1],n=0,ThreadWatcher.watched[e][4]?s=null:(s=Parser.getTrackedReplies(a[1],a[0]))&&(d=document.createElement("div")),i=o.length-1;i>=1&&!(o[i].no<=r);i--)if(++n,s){if(d.innerHTML=o[i].com,!(l=$.cls("quotelink",d))[0])continue;for(p=0;c=l[p];++p)if(s[c.textContent]){ThreadWatcher.watched[e][4]=1,s=null;break}}n>ThreadWatcher.watched[e][2]&&(ThreadWatcher.watched[e][2]=n),o[0].archived&&(ThreadWatcher.watched[e][3]=1)}else 404==this.status&&(ThreadWatcher.watched[e][1]=-1);t&&ThreadWatcher.onRefreshEnd(t)},t&&(i.onerror=i.onload),i.open("GET","//a.4cdn.org/"+a[1]+"/thread/"+a[0]+".json"),i.send(null)};var ThreadExpansion={};ThreadExpansion.init=function(){this.enabled=UA.hasCORS,this.fetchXhr=null},ThreadExpansion.expandComment=function(e){var t,a,i,n;(t=e.getAttribute("href").match(/^(?:thread\/)([0-9]+)#p([0-9]+)$/))&&(a=t[1],i=t[2],(n=e.parentNode).textContent="Loading...",$.get("//a.4cdn.org/"+Main.board+"/thread/"+a+".json",{onload:function(){var e,t,o,r;if(200==this.status){if(t=$.id("m"+i),r=Parser.parseThreadJSON(this.responseText),a==i)o=r[0];else for(e=r.length-1;e>0;e--)if(r[e].no==i){o=r[e];break}o?(o=Parser.buildHTMLFromJSON(o,Main.board),t.innerHTML=$.cls("postMessage",o)[0].innerHTML,Parser.prettify&&Parser.parseMarkup(t),window.math_tags&&Parser.parseMathOne(t)):n.textContent="This post doesn't exist anymore."}else 404==this.status?n.textContent="This thread doesn't exist anymore.":(n.textContent="Connection Error",console.log("ThreadExpansion: "+this.status+" "+this.statusText))},onerror:function(){n.textContent="Connection Error",console.log("ThreadExpansion: xhr failed")}}))},ThreadExpansion.toggle=function(e){var t,a,i,n,o;n=(t=$.id("t"+e)).children[1],t.hasAttribute("data-truncated")&&(i=(a=$.id("m"+e)).nextSibling),$.hasClass(t,"tExpanded")?(t.className=t.className.replace(" tExpanded"," tCollapsed"),n.children[0].src=Main.icons.plus,n.children[1].style.display="inline",n.children[2].style.display="none",a&&(o=a.innerHTML,a.innerHTML=i.textContent,i.textContent=o)):$.hasClass(t,"tCollapsed")?(t.className=t.className.replace(" tCollapsed"," tExpanded"),n.children[0].src=Main.icons.minus,n.children[1].style.display="none",n.children[2].style.display="inline",a&&(o=a.innerHTML,a.innerHTML=i.textContent,i.textContent=o)):(n.children[0].src=Main.icons.rotate,ThreadExpansion.fetchXhr||ThreadExpansion.fetch(e))},ThreadExpansion.fetch=function(e){ThreadExpansion.fetchXhr=$.get("//a.4cdn.org/"+Main.board+"/thread/"+e+".json",{onload:function(){var t,a,i,n,o,r,s,d,l,c,p,h;if(ThreadExpansion.fetchXhr=null,p=(o=$.id("t"+e)).children[1],200==this.status){if(r=$.cls("reply",o),s=Parser.parseThreadJSON(this.responseText),!Config.revealSpoilers&&s[0].custom_spoiler&&Parser.setCustomSpoiler(Main.board,s[0].custom_spoiler),n=document.createDocumentFragment(),r[0])for(r=+r[0].id.slice(1),t=1;(a=s[t])&&a.no<r;++t)(i=Parser.buildHTMLFromJSON(a,Main.board)).className+=" rExpanded",n.appendChild(i);else for(t=1;a=s[t];++t)(i=Parser.buildHTMLFromJSON(a,Main.board)).className+=" rExpanded",n.appendChild(i);d=$.id("m"+e),(h=$.cls("abbr",d)[0])&&/^Comment/.test(h.textContent)&&(o.setAttribute("data-truncated","1"),(c=document.createElement("div")).style.display="none",c.textContent=d.innerHTML,d.parentNode.insertBefore(c,d.nextSibling),(l=$.cls("capcodeReplies",d)[0])?(d.innerHTML=s[0].com+"<br><br>",d.appendChild(l)):d.innerHTML=s[0].com,Parser.prettify&&Parser.parseMarkup(d),window.math_tags&&Parser.parseMathOne(d)),o.insertBefore(n,p.nextSibling),Parser.parseThread(e,1,t-1),o.className+=" tExpanded",p.children[0].src=Main.icons.minus,p.children[1].style.display="none",p.children[2].style.display="inline"}else 404==this.status?(p.children[0].src=Main.icons.plus,p.children[0].display="none",p.children[1].textContent="This thread doesn't exist anymore."):(p.children[0].src=Main.icons.plus,console.log("ThreadExpansion: "+this.status+" "+this.statusText))},onerror:function(){ThreadExpansion.fetchXhr=null,$.id("t"+e).children[1].children[0].src=Main.icons.plus,console.log("ThreadExpansion: xhr failed")}})};var ThreadUpdater={};ThreadUpdater.init=function(){UA.hasCORS&&!window.thread_archived&&(this.enabled=!0,this.pageTitle=document.title,this.unreadCount=0,this.auto=this.hadAuto=!1,this.delayId=0,this.delayIdHidden=4,this.delayRange=[10,15,20,30,60,90,120,180,240,300],this.timeLeft=0,this.interval=null,this.tailSize=window.tailSize||0,this.lastUpdated=Date.now(),this.lastModified="0",this.lastModifiedTail="0",this.lastReply=null,this.currentIcon=null,this.iconPath="//s.4cdn.org/image/",this.iconNode=$.qs('link[rel="shortcut icon"]',document.head),this.iconNode.type="image/x-icon",this.defaultIcon=this.iconNode.getAttribute("href").replace(this.iconPath,""),this.deletionQueue={},Config.updaterSound&&(this.audioEnabled=!1,this.audio=document.createElement("audio"),this.audio.src="//s.4cdn.org/media/beep.ogg"),this.hidden="hidden",this.visibilitychange="visibilitychange",this.adsTTL=9e5,this.adsReloadTs=0,"undefined"==typeof document.hidden&&("mozHidden"in document?(this.hidden="mozHidden",this.visibilitychange="mozvisibilitychange"):"webkitHidden"in document?(this.hidden="webkitHidden",this.visibilitychange="webkitvisibilitychange"):"msHidden"in document&&(this.hidden="msHidden",this.visibilitychange="msvisibilitychange")),this.initControls(),document.addEventListener("scroll",this.onScroll,!1),(Config.alwaysAutoUpdate||sessionStorage.getItem("4chan-auto-"+Main.tid))&&this.start())},ThreadUpdater.apiUrlFilter=null,ThreadUpdater.buildMobileControl=function(e,t){var a,i,n,o,r,s,d;t=t?"Bot":"",(a=document.createElement("div")).className="btn-row",(d=(s=e.parentNode).cloneNode(!0)).innerHTML='<label data-cmd="update">Update</label>',a.appendChild(d),i=e.parentNode.parentNode,(n=document.createElement("span")).className="mobileib button",r=document.createElement("label"),(o=document.createElement("input")).type="checkbox",o.setAttribute("data-cmd","auto"),this["autoNode"+t]=o,r.appendChild(o),r.appendChild(document.createTextNode("Auto")),n.appendChild(r),a.appendChild(document.createTextNode(" ")),a.appendChild(n),(r=document.createElement("div")).className="mobile-tu-status",a.appendChild(this["statusNode"+t]=r),i.appendChild(a),s.parentNode.removeChild(s),(i=$.id("mpostform"))&&(i.parentNode.style.marginTop="")},ThreadUpdater.buildDesktopControl=function(e){var t,a,i,n;e=e?"Bot":"",(t=document.createDocumentFragment()).appendChild(document.createTextNode(" [")),(a=document.createElement("a")).href="",a.textContent="Update",a.setAttribute("data-cmd","update"),t.appendChild(a),t.appendChild(document.createTextNode("]")),t.appendChild(document.createTextNode(" [")),i=document.createElement("label"),(a=document.createElement("input")).type="checkbox",a.title="Fetch new replies automatically",a.setAttribute("data-cmd","auto"),this["autoNode"+e]=a,i.appendChild(a),i.appendChild(document.createTextNode("Auto")),t.appendChild(i),t.appendChild(document.createTextNode("] ")),Config.updaterSound&&(t.appendChild(document.createTextNode(" [")),i=document.createElement("label"),(a=document.createElement("input")).type="checkbox",a.title="Play a sound on new replies to your posts",a.setAttribute("data-cmd","sound"),this["soundNode"+e]=a,i.appendChild(a),i.appendChild(document.createTextNode("Sound")),t.appendChild(i),t.appendChild(document.createTextNode("] "))),t.appendChild(this["statusNode"+e]=document.createElement("span")),(n=e?$.cls("navLinks"+e)[0]:$.cls("navLinks")[1])&&n.appendChild(t)},ThreadUpdater.initControls=function(){Main.hasMobileLayout?(this.buildMobileControl($.id("refresh_top")),this.buildMobileControl($.id("refresh_bottom"),!0)):(this.buildDesktopControl(),this.buildDesktopControl(!0))},ThreadUpdater.start=function(){this.dead||(this.auto=this.hadAuto=!0,this.autoNode.checked=this.autoNodeBot.checked=!0,this.force=this.updating=!1,this.hidden&&document.addEventListener(this.visibilitychange,this.onVisibilityChange,!1),this.delayId=0,this.timeLeft=this.delayRange[0],this.pulse(),sessionStorage.setItem("4chan-auto-"+Main.tid,1))},ThreadUpdater.stop=function(e){clearTimeout(this.interval),this.auto=this.updating=this.force=!1,this.autoNode.checked=this.autoNodeBot.checked=!1,this.hidden&&document.removeEventListener(this.visibilitychange,this.onVisibilityChange,!1),e&&(this.setStatus(""),this.setIcon(null)),sessionStorage.removeItem("4chan-auto-"+Main.tid)},ThreadUpdater.pulse=function(){var e=ThreadUpdater;0===e.timeLeft?e.update():(e.setStatus(e.timeLeft--),e.interval=setTimeout(e.pulse,1e3))},ThreadUpdater.adjustDelay=function(e){0===e?this.force||this.delayId<this.delayRange.length-1&&++this.delayId:this.delayId=document[this.hidden]?this.delayIdHidden:0,this.timeLeft=this.delayRange[this.delayId],this.auto&&this.pulse()},ThreadUpdater.onVisibilityChange=function(){var e=ThreadUpdater;document[e.hidden]&&e.delayId<e.delayIdHidden?e.delayId=e.delayIdHidden:e.delayId=0,e.timeLeft=e.delayRange[0],clearTimeout(e.interval),e.pulse()},ThreadUpdater.onScroll=function(){ThreadUpdater.hadAuto&&document.documentElement.scrollHeight<=Math.ceil(window.innerHeight+window.pageYOffset)&&!document[ThreadUpdater.hidden]&&ThreadUpdater.clearUnread()},ThreadUpdater.clearUnread=function(){this.dead||this.setIcon(null),this.lastReply&&(this.unreadCount=0,document.title=this.pageTitle,$.removeClass(this.lastReply,"newPostsMarker"),this.lastReply=null)},ThreadUpdater.forceUpdate=function(){ThreadUpdater.force=!0,ThreadUpdater.update()},ThreadUpdater.toggleAuto=function(){this.updating||(this.auto?this.stop(!0):this.start())},ThreadUpdater.toggleSound=function(){this.soundNode.checked=this.soundNodeBot.checked=this.audioEnabled=!this.audioEnabled},ThreadUpdater.update=function(e){var t,a,i;(t=ThreadUpdater).updating||t.dead||(clearTimeout(t.interval),t.updating=!0,t.setStatus("Updating..."),a=!e&&t.checkTailUpdate(),i="//a.4cdn.org/"+Main.board+"/thread/"+Main.tid+(a?"-tail":"")+".json",t.apiUrlFilter&&(i=t.apiUrlFilter(i)),$.get(i,{onload:t.onload,onerror:t.onerror,istail:a},{"If-Modified-Since":a?t.lastModifiedTail:t.lastModified}))},ThreadUpdater.checkTailUpdate=function(){var e,t,a;return!!(e=ThreadUpdater).tailSize&&(!(a=(t=$.cls("replyContainer"))[t.length-e.tailSize])||(a=$.cls("dateTime",a)[0],(0|e.lastUpdated/1e3)-+a.getAttribute("data-utc")>(0|(Date.now()-e.lastUpdated)/1e3)))},ThreadUpdater.checkTailValid=function(e){var t=e[0];return t&&t.tail_id?!!$.id("p"+t.tail_id):(ThreadUpdater.tailSize=0,!1)},ThreadUpdater.reloadAds=function(){if(!window.Danbo||!window.reloadAdsDanbo)return;let e=ThreadUpdater,t=Date.now();e.adsReloadTs?t-e.adsReloadTs<e.adsTTL||(e.adsReloadTs=t,window.reloadAdsDanbo()):e.adsReloadTs=t},ThreadUpdater.onload=function(){var e,t,a,i,n,o,r,s,d,l,c,p,h,u,g;if(i=[],(a=ThreadUpdater).setStatus(""),200==this.status){if(o=Parser.parseThreadJSON(this.responseText),this.istail){if(!a.checkTailValid(o))return a.updating=!1,void a.update(!0);a.lastModifiedTail=this.getResponseHeader("Last-Modified")}else o[0].tail_size!==a.tailSize&&(a.tailSize=o[0].tail_size||0),a.lastModified=this.getResponseHeader("Last-Modified");for(d=+(s=(n=$.id("t"+Main.tid)).children[n.childElementCount-1]).id.slice(2),t=!!o[0].archived,window.thread_archived!==undefined&&t!=window.thread_archived&&(QR.enabled&&$.id("quickReply")&&QR.lock(),Main.setThreadState("archived",t)),(t=!!o[0].closed)!=Main.threadClosed&&(o[0].archived?t=!1:QR.enabled&&$.id("quickReply")&&(t?QR.lock():QR.unlock()),Main.setThreadState("closed",t)),(t=!!o[0].sticky)!=Main.threadSticky&&Main.setThreadState("sticky",t),t=!!o[0].imagelimit,QR.enabled&&t!=QR.fileDisabled&&(QR.fileDisabled=t),!Config.revealSpoilers&&o[0].custom_spoiler&&Parser.setCustomSpoiler(Main.board,o[0].custom_spoiler),e=o.length-1;e>=0&&!(o[e].no<=d);e--)i.push(o[e]);if(1==(h=i.length)&&QR.lastReplyId==i[0].no&&(u=!0,QR.lastReplyId=null),h){for(c=document.documentElement,p=Config.autoScroll&&document[a.hidden]&&c.scrollHeight==Math.ceil(window.innerHeight+window.pageYOffset),window.chrome&&document.activeElement&&(document.activeElement.href||"checkbox"===document.activeElement.type)&&document.activeElement.blur(),r=document.createDocumentFragment(),
|
|
e=i.length-1;e>=0;e--)r.appendChild(Parser.buildHTMLFromJSON(i[e],Main.board));n.appendChild(r),g=s.offsetTop,Parser.hasYouMarkers=!1,Parser.hasHighlightedPosts=!1,Parser.parseThread(n.id.slice(1),-i.length),g!=s.offsetTop&&window.scrollBy(0,s.offsetTop-g),u||(!a.force&&c.scrollHeight>window.innerHeight?(a.lastReply||d==Main.tid||((a.lastReply=s.lastChild).className+=" newPostsMarker"),Parser.hasYouMarkers?(a.setIcon("rep"),a.audioEnabled&&document[a.hidden]&&a.audio.play()):Parser.hasHighlightedPosts&&"rep"!==a.currentIcon?a.setIcon("hl"):0===a.unreadCount&&a.setIcon("new"),a.unreadCount+=h,document.title="("+a.unreadCount+") "+a.pageTitle):a.setStatus(h+" new post"+(h>1?"s":""))),p&&window.scrollTo(0,document.documentElement.scrollHeight),Config.threadWatcher&&ThreadWatcher.refreshCurrent(!0),Config.threadStats&&(l=o[0],ThreadStats.update(l.replies,l.images,l.unique_ips,l.bumplimit,l.imagelimit)),a.force&&a.reloadAds(),UA.dispatchEvent("4chanThreadUpdated",{count:h})}else a.setStatus("No new posts");o[0].archived&&(a.setError("This thread is archived"),a.dead||(a.setIcon("dead"),window.thread_archived=!0,a.dead=!0,a.stop()))}else if(304===this.status||0===this.status)a.setStatus("No new posts");else if(404===this.status)return this.istail?(a.updating=!1,void a.update(!0)):(a.setIcon("dead"),a.setError("This thread has been pruned or deleted"),a.dead=!0,void a.stop());a.lastUpdated=Date.now(),a.adjustDelay(i.length),a.updating=a.force=!1},ThreadUpdater.onerror=function(){var e=ThreadUpdater;UA.isOpera&&!this.statusText&&0===this.status?e.setStatus("No new posts"):e.setError("Connection Error"),e.lastUpdated=Date.now(),e.adjustDelay(0),e.updating=e.force=!1},ThreadUpdater.setStatus=function(e){this.statusNode.textContent=this.statusNodeBot.textContent=e},ThreadUpdater.setError=function(e){this.statusNode.innerHTML=this.statusNodeBot.innerHTML='<span class="tu-error">'+e+"</span>"},ThreadUpdater.setIcon=function(e){var t;t=null===e?this.defaultIcon:this.icons[Main.type+e],this.currentIcon=e,this.iconNode.href=this.iconPath+t,document.head.appendChild(this.iconNode)},ThreadUpdater.icons={wsnew:"favicon-ws-newposts.ico",nwsnew:"favicon-nws-newposts.ico",wsrep:"favicon-ws-newreplies.ico",nwsrep:"favicon-nws-newreplies.ico",wsdead:"favicon-ws-deadthread.ico",nwsdead:"favicon-nws-deadthread.ico",wshl:"favicon-ws-newfilters.ico",nwshl:"favicon-nws-newfilters.ico"};var ThreadStats={};ThreadStats.init=function(){var e;this.nodeTop=document.createElement("div"),this.nodeTop.className="thread-stats",Main.hasMobileLayout?(this.nodeBot={},(e=$.cls("navLinks"))[0]&&(e=e[e.length-1].nextElementSibling).parentNode.insertBefore(this.nodeTop,e)):(this.nodeBot=this.nodeTop.cloneNode(!1),(e=$.cls("navLinks"))[1]&&e[1].appendChild(this.nodeTop),e[2]&&e[2].appendChild(this.nodeBot)),this.pageNumber=null,this.update(null,null,null,window.bumplimit,window.imagelimit),window.thread_archived||(this.updatePageNumber(),this.pageInterval=setInterval(this.updatePageNumber,18e4))},ThreadStats.update=function(e,t,a,i,n){var o;null===e&&(e=$.cls("replyContainer").length,t=$.cls("fileText").length-($.id("fT"+Main.tid)?1:0)),o=[],Main.threadSticky&&o.push("Sticky"),window.thread_archived?o.push("Archived"):Main.threadClosed&&o.push("Closed"),i?o.push('<em class="ts-replies" data-tip="Replies (bump limit reached)">'+e+"</em>"):o.push('<span class="ts-replies" data-tip="Replies">'+e+"</span>"),n?o.push('<em class="ts-images" data-tip="Images (limit reached)">'+t+"</em>"):o.push('<span class="ts-images" data-tip="Images">'+t+"</span>"),window.thread_archived||(window.unique_ips&&o.push('<span data-tip="Posters" class="ts-ips">'+(a||window.unique_ips)+"</span>"),o.push('<span data-tip="Page" class="ts-page">'+(this.pageNumber||"?")+"</span>")),this.nodeTop.innerHTML=this.nodeBot.innerHTML=o.join(" / ")},ThreadStats.updatePageNumber=function(){$.get("//a.4cdn.org/"+Main.board+"/threads.json",{onload:ThreadStats.onCatalogLoad,onerror:ThreadStats.onCatalogError})},ThreadStats.onCatalogLoad=function(){var e,t,a,i,n,o,r,s,d,l,c;if(e=ThreadStats,200==this.status){for(l=+Main.tid,d=JSON.parse(this.responseText),t=0;o=d[t];++t)for(s=o.threads,a=0;r=s[a];++a)if(r.no==l){for(c=$.cls("ts-page"),i=0;n=c[i];++i)n.textContent=o.page;return void(e.pageNumber=o.page)}clearInterval(e.pageInterval)}else ThreadStats.onCatalogError()},ThreadStats.onCatalogError=function(){console.log("ThreadStats: couldn't get the catalog ("+this.status+")")};var Filter={};Filter.init=function(){this.entities=document.createElement("div"),Filter.load()},Filter.onClick=function(e){var t;if(t=e.target.getAttribute("data-cmd"))switch(t){case"filters-add":Filter.add();break;case"filters-save":Filter.save(),Filter.close();break;case"filters-close":Filter.close();break;case"filters-palette":Filter.openPalette(e.target);break;case"filters-palette-close":Filter.closePalette();break;case"filters-palette-clear":Filter.clearPalette();break;case"filters-up":Filter.moveUp(e.target.parentNode.parentNode);break;case"filters-del":Filter.remove(e.target.parentNode.parentNode);break;case"filters-help-open":Filter.openHelp();break;case"filters-help-close":Filter.closeHelp()}},Filter.onPaletteClick=function(e){var t;if(t=e.target.getAttribute("data-cmd"))switch(t){case"palette-pick":Filter.pickColor(e.target);break;case"palette-clear":Filter.pickColor(e.target,!0);break;case"palette-close":Filter.closePalette()}},Filter.match=function(e,t){var a,i,n,o,r;for(r=!1,o=Filter.activeFilters,a=0;n=o[a];++a)if(n.boards[t])if(0===n.type){if(n.pattern===e.trip){r=!0;break}}else if(1===n.type){if(n.pattern===e.name){r=!0;break}}else if(2===n.type&&e.com){if(i===undefined&&(this.entities.innerHTML=e.com.replace(/<br>/g,"\n").replace(/[<[^>]+>/g,""),i=this.entities.textContent),n.pattern.test(i)){r=!0;break}}else if(4===n.type){if(n.pattern===e.id){r=!0;break}}else if(5===n.type){if(n.pattern.test(e.sub)){r=!0;break}}else if(6===n.type&&n.pattern.test(e.filename)){r=!0;break}return r},Filter.exec=function(e,t,a,i){var n,o,r,s,d,l,c,p,h,u,g,m;if(Parser.trackedReplies&&Parser.trackedReplies[">>"+t.id.slice(2)])return!1;for(m=Main.board,u=Filter.activeFilters,g=!1,n=0;h=u[n];++n)if(!h.boards||h.boards[m])if(0===h.type){if((r!==undefined||(r=t.getElementsByClassName("postertrip")[0]))&&h.pattern==r.textContent){g=!0;break}}else if(1===h.type){if((s||(s=t.getElementsByClassName("name")[0]))&&h.pattern==s.textContent){g=!0;break}}else if(2===h.type){if(d===undefined&&(this.entities.innerHTML=a.innerHTML.replace(/<br>/g,"\n").replace(/[<[^>]+>/g,""),d=this.entities.textContent),h.pattern.test(d)){g=!0;break}}else if(4===h.type){if((l||(l=t.getElementsByClassName("posteruid")[0])&&(l=l.firstElementChild.textContent))&&h.pattern==l){g=!0;break}}else if(Main.tid||5!==h.type){if(6===h.type&&(p===undefined&&(p=(p=t.parentNode.getElementsByClassName("fileText")[0])?p.firstElementChild.textContent:""),h.pattern.test(p))){g=!0;break}}else if((c||(c=t.getElementsByClassName("subject")[0])&&(c=c.textContent))&&h.pattern.test(c)){g=!0;break}if(g){if(h.hide)return i&&Config.hideStubs&&!$.cls("stickyIcon",e)[0]?e.style.display=e.nextElementSibling.style.display="none":(e.className+=" post-hidden",o=document.createElement("span"),i?o.innerHTML='[<a data-cmd="unfilter" data-filtered="1" href="thread/'+i+'">View</a>]':(o.textContent="[View]",o.setAttribute("data-filtered","1"),o.setAttribute("data-cmd","unfilter")),o.className="filter-preview",t.appendChild(o)),!0;e.className+=" filter-hl",e.style.boxShadow="-3px 0 "+h.color,Parser.hasHighlightedPosts=!0}return!1},Filter.unfilter=function(e){var t=e.parentNode.parentNode;QuotePreview.remove(),$.removeClass(t,"post-hidden"),e.parentNode.removeChild(e)},Filter.load=function(){var e,t,a,i,n,o,r,s,d,l,c,p,h,u,g,m,f;if(this.activeFilters=[],i=localStorage.getItem("4chan-filters")){i=JSON.parse(i),r=new RegExp("(\\"+["/",".","*","+","?","(",")","[","]","{","}","\\","^","$"].join("|\\")+")","g"),s=/^\/(.*)\/(i?)$/,d="(?=.*\\b",l="\\b)",p=/\\\*/g,h="[^\\s]*";try{for(o=0;a=i[o];++o)if(a.active&&""!==a.pattern){if(a.boards)for(u=a.boards.split(/[^a-z0-9]+/i),g={},e=0;t=u[e];++e)g[t]=!0;else g=!1;if(n=a.pattern,a.type&&1!=a.type&&4!=a.type)if(f=n.match(s))m=new RegExp(f[1],f[2]);else if('"'==n[0]&&'"'==n[n.length-1])m=new RegExp(n.slice(1,-1).replace(r,"\\$1"));else{for(m="",e=0,t=(c=n.split(" ")).length;e<t;++e)m+=d+c[e].replace(r,"\\$1").replace(p,h)+l;m=new RegExp("^"+m,"im")}else m=n;this.activeFilters.push({type:a.type,pattern:m,boards:g,color:a.color,hide:a.hide,auto:a.auto})}}catch(b){alert("There was an error processing one of the filters: "+b+" in: "+n)}}},Filter.addSelection=function(){var e,t,a,i=UA.getSelection(!0);!1!==Filter.open()&&("string"==typeof i?e=i.trim():(a=i.anchorNode.parentNode,e=i.toString().trim(),t=$.hasClass(a,"name")?1:$.hasClass(a,"postertrip")?0:$.hasClass(a,"subject")?5:$.hasClass(a,"posteruid")||$.hasClass(a,"hand")?4:$.hasClass(a,"fileText")?6:2),Filter.add(e,t))},Filter.openHelp=function(){var e;$.id("filtersHelp")||((e=document.createElement("div")).id="filtersHelp",e.className="UIPanel",e.setAttribute("data-cmd","filters-help-close"),e.innerHTML='<div class="extPanel reply"><div class="panelHeader">Filters & Highlights Help<span class="panelCtrl"><img alt="Close" title="Close" class="pointer" data-cmd="filters-help-close" src="'+Main.icons.cross+'"></span></div><h4>Tripcode, Name and ID filters:</h4><ul><li>Those use simple string comparison.</li><li>Type them exactly as they appear on 4chan, including the exclamation mark for tripcode filters.</li><li>Example: <code>!Ep8pui8Vw2</code></li></ul><h4>Comment, Subject and E-mail filters:</h4><ul><li><strong>Matching whole words:</strong></li><li><code>feel</code> — will match <em>"feel"</em> but not <em>"feeling"</em>. This search is case-insensitive.</li></ul><ul><li><strong>AND operator:</strong></li><li><code>feel girlfriend</code> — will match <em>"feel"</em> AND <em>"girlfriend"</em> in any order.</li></ul><ul><li><strong>Exact match:</strong></li><li><code>"that feel when"</code> — place double quotes around the pattern to search for an exact string</li></ul><ul><li><strong>Wildcards:</strong></li><li><code>feel*</code> — matches expressions such as <em>"feel"</em>, <em>"feels"</em>, <em>"feeling"</em>, <em>"feeler"</em>, etc\u2026</li><li><code>idolm*ster</code> — this can match <em>"idolmaster"</em> or <em>"idolm@ster"</em>, etc\u2026</li></ul><ul><li><strong>Regular expressions:</strong></li><li><code>/feel when no (girl|boy)friend/i</code></li><li><code>/^(?!.*touhou).*$/i</code> — NOT operator.</li><li><code>/^>/</code> — comments starting with a quote.</li><li><code>/^$/</code> — comments with no text.</li></ul><h4>Colors:</h4><ul><li>The color field can accept any valid CSS color:</li><li><code>red</code>, <code>#0f0</code>, <code>#00ff00</code>, <code>rgba( 34, 12, 64, 0.3)</code>, etc\u2026</li></ul><h4>Boards:</h4><ul><li>A space separated list of boards on which the filter will be active. Leave blank to apply to all boards.</li></ul><h4>Auto-watching:</h4><ul><li>Enabling the "Auto" option will automatically add matched threads to the Thread Watcher when it is manually refreshed. This only works when the "Boards" field is not empty, and searches catalog JSON for the selected boards(s).</li></ul><h4>Shortcut:</h4><ul><li>If you have <code>Keyboard shortcuts</code> enabled, pressing <kbd>F</kbd> will add the selected text to your filters.</li></ul>',document.body.appendChild(e),e.addEventListener("click",this.onClick,!1))},Filter.closeHelp=function(){var e;(e=$.id("filtersHelp"))&&(e.removeEventListener("click",this.onClick,!1),document.body.removeChild(e))},Filter.open=function(){var e,t,a,i,n;if($.id("filtersMenu"))return!1;if((a=document.createElement("div")).id="filtersMenu",a.className="UIPanel",a.style.display="none",a.setAttribute("data-cmd","filters-close"),a.innerHTML='<div class="extPanel reply"><div class="panelHeader">Filters & Highlights<span class="panelCtrl"><img alt="Help" class="pointer" title="Help" data-cmd="filters-help-open" src="'+Main.icons.help+'"><img alt="Close" title="Close" class="pointer" data-cmd="filters-close" src="'+Main.icons.cross+'"></span></div><table><thead><tr><th></th><th>On</th><th>Pattern</th><th>Boards</th><th>Type</th><th>Color</th><th>Auto</th><th>Hide</th><th>Del</th></tr></thead><tbody id="filter-list"></tbody><tfoot><tr><td colspan="9"><button data-cmd="filters-add">Add</button><button class="right" data-cmd="filters-save">Save</button></td></tr></tfoot></table></div>',document.body.appendChild(a),a.addEventListener("click",this.onClick,!1),n=$.id("filter-list"),i=localStorage.getItem("4chan-filters"))for(i=JSON.parse(i),e=0;t=i[e];++e)n.appendChild(this.buildEntry(t,e));a.style.display=""},Filter.close=function(){var e;(e=$.id("filtersMenu"))&&(this.closePalette(),e.removeEventListener("click",this.onClick,!1),document.body.removeChild(e))},Filter.moveUp=function(e){var t;(t=e.previousElementSibling)&&e.parentNode.insertBefore(e,t)},Filter.add=function(e,t,a){var i,n,o;i={active:!0,type:t||0,pattern:e||"",boards:a||"",color:"",auto:!1,hide:!1},n=this.getNextFilterId(),o=this.buildEntry(i,n),$.id("filter-list").appendChild(o),$.cls("fPattern",o)[0].focus()},Filter.remove=function(e){$.id("filter-list").removeChild(e)},Filter.save=function(){var e,t,a,i,n,o,r;for(t=[],a=$.id("filter-list").children,e=0;i=a[e];++e)r=i.children[4].firstChild,n={active:i.children[1].firstChild.checked,pattern:i.children[2].firstChild.value,boards:i.children[3].firstChild.value,type:+r.options[r.selectedIndex].value,auto:i.children[6].firstChild.checked,hide:i.children[7].firstChild.checked},(o=i.children[5].firstChild).hasAttribute("data-nocolor")||(n.color=o.style.backgroundColor),t.push(n);t[0]?localStorage.setItem("4chan-filters",JSON.stringify(t)):localStorage.removeItem("4chan-filters")},Filter.getNextFilterId=function(){var e,t,a,i=$.id("filter-list").children;if(i.length){for(a=0,e=0;t=i[e];++e)(t=+t.id.slice(7))>a&&(a=t);return a+1}return 0},Filter.buildEntry=function(e,t){var a,i,n;return(a=document.createElement("tr")).id="filter-"+t,i="",i+='<td><span data-tip="Move Up" data-cmd="filters-up" class="pointer">↑</span></td>',i+='<td><input type="checkbox"'+(e.active?' checked="checked"></td>':"></td>"),i+='<td><input class="fPattern" type="text" value="'+e.pattern.replace(/"/g,""")+'"></td>',i+='<td><input class="fBoards" type="text" value="'+(e.boards!==undefined?e.boards:"")+'"></td>',3===e.type&&(e.type=4),(n=["","","","","","",""])[e.type]=' selected="selected"',i+='<td><select size="1"><option value="0"'+n[0]+'>Tripcode</option><option value="1"'+n[1]+'>Name</option><option value="2"'+n[2]+'>Comment</option><option value="4"'+n[4]+'>ID</option><option value="5"'+n[5]+'>Subject</option><option value="6"'+n[6]+">Filename</option></select></td>",i+='<td><span data-cmd="filters-palette" title="Change Color" class="colorbox fColor" ',e.color?i+=' style="background-color:'+e.color+'">':i+=' data-nocolor="1">∕',i+="</span></td>",i+='<td><input type="checkbox"'+(e.auto?' checked="checked"></td>':"></td>"),i+='<td><input type="checkbox"'+(e.hide?' checked="checked"></td>':"></td>"),i+='<td><span data-cmd="filters-del" class="pointer fDel">×</span></td>',a.innerHTML=i,a},Filter.buildPalette=function(e){var t,a,i,n,o,r,s;for(r=(o=[["#E0B0FF","#F2F3F4","#7DF9FF","#FFFF00"],["#FBCEB1","#FFBF00","#ADFF2F","#0047AB"],["#00A550","#007FFF","#AF0A0F","#B5BD68"]]).length,s=o[0].length,n='<div id="colorpicker" class="reply extPanel"><table><tbody>',t=0;t<r;++t){for(n+="<tr>",a=0;a<s;++a)n+='<td><div data-cmd="palette-pick" class="colorbox" style="background:'+o[t][a]+'"></div></td>';n+="</tr>"}return n+='</tbody></table>Custom<div id="palette-custom"><input id="palette-custom-input" type="text"><div id="palette-custom-ok" data-cmd="palette-pick" title="Select Color" class="colorbox"></div></div>[<a href="javascript:;" data-cmd="palette-close">Close</a>][<a href="javascript:;" data-cmd="palette-clear">Clear</a>]</div>',(i=document.createElement("div")).id="filter-palette",i.setAttribute("data-target",e),i.setAttribute("data-cmd","palette-close"),i.className="UIMenu",i.innerHTML=n,i},Filter.openPalette=function(e){var t,a,i,n;Filter.closePalette(),a=e.getBoundingClientRect(),i=e.parentNode.parentNode.id.slice(7),t=Filter.buildPalette(i),document.body.appendChild(t),$.id("filter-palette").addEventListener("click",Filter.onPaletteClick,!1),$.id("palette-custom-input").addEventListener("keyup",Filter.setCustomColor,!1),(n=t.firstElementChild).style.cssText="top:"+a.top+"px;left:"+(a.left-n.clientWidth-10)+"px;"},Filter.closePalette=function(){var e;(e=$.id("filter-palette"))&&($.id("filter-palette").removeEventListener("click",Filter.onPaletteClick,!1),$.id("palette-custom-input").removeEventListener("keyup",Filter.setCustomColor,!1),e.parentNode.removeChild(e))},Filter.pickColor=function(e,t){var a,i;a=$.id("filter-palette").getAttribute("data-target"),(i=$.id("filter-"+a))&&(i=$.cls("colorbox",i)[0],!0===t?(i.setAttribute("data-nocolor","1"),i.innerHTML="∕",i.style.background=""):(i.removeAttribute("data-nocolor"),i.innerHTML="",i.style.background=e.style.backgroundColor),Filter.closePalette())},Filter.setCustomColor=function(){var e;e=$.id("palette-custom-input"),$.id("palette-custom-ok").style.backgroundColor=e.value};var IDColor={css:"padding: 0 5px; border-radius: 6px; font-size: 0.8em;",ids:{}};IDColor.init=function(){var e;window.user_ids&&(this.enabled=!0,(e=document.createElement("style")).setAttribute("type","text/css"),e.textContent=".posteruid .hand {"+this.css+"}",document.head.appendChild(e))},IDColor.compute=function(e){var t,a;return t=[],a=$.hash(e),t[0]=a>>24&255,t[1]=a>>16&255,t[2]=a>>8&255,t[3]=.299*t[0]+.587*t[1]+.114*t[2]>125,this.ids[e]=t,t},IDColor.apply=function(e){var t;t=IDColor.ids[e.textContent]||IDColor.compute(e.textContent),e.style.cssText=" background-color: rgb("+t[0]+","+t[1]+","+t[2]+"); color: "+(t[3]?"black;":"white;")},IDColor.applyRemote=function(e){this.apply(e),e.style.cssText+=this.css};var SWFEmbed={};SWFEmbed.init=function(){Main.tid?this.processThread():Main.hasMobileLayout||this.processIndex()},SWFEmbed.processThread=function(){var e,t;(e=$.id("fT"+Main.tid))&&((t=document.createElement("a")).href="javascript:;",t.textContent="Embed",t.addEventListener("click",SWFEmbed.toggleThread,!1),e.appendChild(document.createTextNode("-[")),e.appendChild(t),e.appendChild(document.createTextNode("]")))},SWFEmbed.processIndex=function(){var e,t,a,i,n,o,r;if(o=2,(i=$.cls("postblock")[0])&&(t=i.parentNode,(a=document.createElement("td")).className="postblock",t.insertBefore(a,t.children[o].nextElementSibling),i=$.cls("flashListing")[0]))for(n=$.tag("tr",i),e=1;t=n[e];++e)r=t.children[o].firstElementChild,(a=document.createElement("td")).innerHTML='[<a href="'+r.href+'">Embed</a>]',a.firstElementChild.addEventListener("click",SWFEmbed.embedIndex,!1),t.insertBefore(a,t.children[o].nextElementSibling)},SWFEmbed.toggleThread=function(e){var t,a,i,n,o,r,s,d;if(t=$.id("swf-embed"))return t.parentNode.removeChild(t),void(e.target.textContent="Embed");a=$.tag("a",e.target.parentNode)[0],o=document.documentElement.clientWidth-(Main.hasMobileLayout?30:100),s=+a.getAttribute("data-width"),d=+a.getAttribute("data-height"),s>o&&(r=s/d,s=o,d=Math.round(o/r)),(t=document.createElement("div")).id="swf-embed",i=SWFEmbed.getFrameNode(a.href,s,d),t.appendChild(i),(n=$.id("m"+Main.tid)).insertBefore(t,n.firstChild),$.cls("thread")[0].scrollIntoView(!0),e.target.textContent="Remove"},SWFEmbed.embedIndex=function(e){var t,a,i,n,o,r,s,d,l,c,p,h,u,g,m,f;e.preventDefault(),u=10,g=20,m=(t=e.target.parentNode.parentNode.children[2].firstElementChild).getAttribute("title")||t.textContent,d=r=+t.getAttribute("data-width"),l=s=+t.getAttribute("data-height"),h=document.documentElement.clientWidth,p=document.documentElement.clientHeight-u-g,f=r/s,d>(c=h-u)&&(d=c,l=Math.round(c/f)),l>p&&(l=p,d=Math.round(p*f)),t=SWFEmbed.getFrameNode(e.target.href,d,l),(a=document.createElement("div")).style.position="fixed",a.style.width=d+"px",a.style.height=l+"px",a.style.top="50%",a.style.left="50%",a.style.marginTop=-l/2-g/2+"px",a.style.marginLeft=-d/2+"px",a.style.background="white",(i=document.createElement("div")).id="swf-embed-header",i.className="postblock",i.textContent=m+", "+r+"x"+s,(n=document.createElement("img")).id="swf-embed-close",n.className="pointer",n.src=Main.icons.cross,i.appendChild(n),a.appendChild(i),a.appendChild(t),(o=document.createElement("div")).id="swf-embed",o.style.cssText="width: 100%; height: 100%; position: fixed; top: 0; left: 0; background: rgba(128, 128, 128, 0.5)",o.appendChild(a),o.addEventListener("click",SWFEmbed.onBackdropClick,!1),document.body.appendChild(o)},SWFEmbed.getFrameNode=function(e,t,a){var i,n;return n=e.replace(/^https:\/\/i\.4cdn\.org\/f\//,""),(i=document.createElement("iframe")).setAttribute("allow","autoplay; fullscreen"),i.setAttribute("sandbox","allow-scripts allow-same-origin"),i.setAttribute("scrolling","no"),i.setAttribute("frameborder","0"),i.setAttribute("width",+t),i.setAttribute("height",+a),i.src=`//s.4cdn.org/media/flash/embed.html?4#${+t},${+a},${n},1`,i},SWFEmbed.onBackdropClick=function(e){var t=$.id("swf-embed");e.target!==t&&"swf-embed-close"!=e.target.id||(t.removeEventListener("click",SWFEmbed.onBackdropClick,!1),t.parentNode.removeChild(t))};var Linkify={init:function(){this.probeRe=/(?:^|[^\B"])https?:\/\/[-.a-z0-9]+\.[a-z]{2,4}/,this.linkRe=/(^|[^\B"])(https?:\/\/[-.a-z0-9\u200b]+\.[a-z\u200b]{2,15}(?:\/[^\s<>]*)?)/gi,this.punct=/[:!?,.'"]+$/g,this.derefer="//sys."+$L.d(Main.board)+"/derefer?url="},exec:function(e){this.probeRe.test(e.innerHTML)&&(e.innerHTML=e.innerHTML.replace(/<wbr>/g,"\u200b").replace(this.linkRe,this.funk).replace(/\u200b/g,"<wbr>"))},funk:function(e,t,a,i,n){var o,r,s,d,l;return o=i+e.length,"</a>"===n.slice(o,o+4)?e:(s=d=a.length,(o=a.match(Linkify.punct))&&(s-=o[0].length),(o=a.match(/\)+$/g))&&(r=o[0].length,(o=a.match(/\(/g))?(r-=o.length)>0&&(s-=r):s-=r),s<d?(l=a.slice(s),a=a.slice(0,s)):l="",t+'<a href="'+Linkify.derefer+encodeURIComponent(a.replace(/\u200b/g,""))+'" target="_blank" class="linkified" rel="noreferrer nofollow">'+a+"</a>"+l)}},Media={};Media.init=function(){this.matchSC=/(?:soundcloud\.com|snd\.sc)\/[^\s<]+(?:<wbr>)?[^\s<]*/g,this.matchYT=/(?:youtube\.com\/watch\?[^\s]*?v=|youtu\.be\/)[^\s<]+(?:<wbr>)?[^\s<]*(?:<wbr>)?[^\s<]*(?:<wbr>)?[^\s<]*/g,this.toggleYT=/(?:v=|\.be\/)([a-zA-Z0-9_-]{11})/,this.timeYT=/[\?#&]t=([ms0-9]+)/,this.map={yt:this.toggleYouTube,sc:this.toggleSoundCloud}},Media.parseSoundCloud=function(e){e.innerHTML=e.innerHTML.replace(this.matchSC,this.replaceSoundCloud)},Media.replaceSoundCloud=function(e,t,a){var i;if(Config.linkify){if('"'===a[t+e.length-1])return e;i=e+"</a>"}else i="<span>"+e+"</span>";return i+' [<a href="javascript:;" data-cmd="embed" data-type="sc">Embed</a>]'},Media.toggleSoundCloud=function(e){var t,a;"Remove"==e.textContent?(e.parentNode.removeChild(e.nextElementSibling),e.textContent="Embed"):"Embed"==e.textContent&&(a=e.previousElementSibling.textContent,(t=new XMLHttpRequest).open("GET","//soundcloud.com/oembed?show_artwork=false&maxwidth=500px&show_comments=false&format=json&url=http://"+a.replace(/^https?:\/\//i,"")),t.onload=function(){var t;200==this.status||304==this.status?((t=document.createElement("div")).className="media-embed",t.innerHTML=JSON.parse(this.responseText).html,e.parentNode.insertBefore(t,e.nextElementSibling),e.textContent="Remove"):(e.textContent="Error",console.log("SoundCloud Error (HTTP "+this.status+")"))},e.textContent="Loading...",t.send(null))},Media.parseYouTube=function(e){e.innerHTML=e.innerHTML.replace(this.matchYT,this.replaceYouTube)},Media.replaceYouTube=function(e,t,a){var i;if(Config.linkify){if('"'===a[t+e.length-1])return e;i=e+"</a>"}else i="<span>"+e+"</span>";return i+' [<a href="javascript:;" data-cmd="embed" data-type="yt">'+(Main.hasMobileLayout?"Open":"Embed")+"</a>]"},Media.showYTPreview=function(e){var t,a,i,n,o,r,s,d,l;s=320,d=180,l=5,n=e.getBoundingClientRect(),i=e.previousElementSibling.textContent.match(this.toggleYT)[1],o=n.right+s+l>$.docEl.clientWidth?n.left-s-l:n.right+l,r=n.top-d/2+n.height/2,(a=document.createElement("img")).width=s,a.height=d,a.alt="",a.src="//i1.ytimg.com/vi/"+encodeURIComponent(i)+"/mqdefault.jpg",(t=document.createElement("div")).id="yt-preview",t.className="reply",t.style.left=o+window.pageXOffset+"px",t.style.top=r+window.pageYOffset+"px",t.appendChild(a),document.body.appendChild(t)},Media.removeYTPreview=function(){var e;(e=$.id("yt-preview"))&&document.body.removeChild(e)},Media.toggleYouTube=function(e){var t,a,i,n;if("Remove"==e.textContent)e.parentNode.removeChild(e.nextElementSibling),e.textContent="Embed";else if(t=(n=e.previousElementSibling.textContent).match(this.toggleYT),a=n.match(this.timeYT),t&&(t=t[1])){if(t=encodeURIComponent(t),a&&(a=a[1])&&(t+="?start="+encodeURIComponent(a)),Main.hasMobileLayout)return void window.open("//www.youtube.com/watch?v="+t);(i=document.createElement("div")).className="media-embed",i.innerHTML='<iframe src="//www.youtube.com/embed/'+t+'" width="640" height="360" frameborder="0" allowfullscreen></iframe>',e.parentNode.insertBefore(i,e.nextElementSibling),e.textContent="Remove"}else e.textContent="Error"},Media.toggleEmbed=function(e){var t,a=e.getAttribute("data-type");a&&(t=Media.map[a])&&t.call(this,e)};var StickyNav={thres:5,pos:0,timeout:null,el:null,init:function(){this.el=Config.classicNav?$.id("boardNavDesktop"):$.id("boardNavMobile"),$.addClass(this.el,"autohide-nav"),window.addEventListener("scroll",this.onScroll,!1)},onScroll:function(){clearTimeout(StickyNav.timeout),StickyNav.timeout=setTimeout(StickyNav.checkScroll,50)},checkScroll:function(){var e;e=window.pageYOffset,Math.abs(StickyNav.pos-e)<=StickyNav.thres||(e<StickyNav.pos?StickyNav.el.style.top="":StickyNav.el.style.top="-"+StickyNav.el.offsetHeight+"px",StickyNav.pos=e)}},CustomCSS={};CustomCSS.init=function(){var e,t;(t=localStorage.getItem("4chan-css"))&&((e=document.createElement("style")).id="customCSS",e.setAttribute("type","text/css"),e.textContent=t,document.head.appendChild(e))},CustomCSS.open=function(){var e,t,a;$.id("customCSSMenu")||((e=document.createElement("div")).id="customCSSMenu",e.className="UIPanel",e.setAttribute("data-cmd","css-close"),e.innerHTML='<div class="extPanel reply"><div class="panelHeader">Custom CSS<span class="panelCtrl"><img alt="Close" title="Close" class="pointer" data-cmd="css-close" src="'+Main.icons.cross+'"></span></div><textarea id="customCSSBox"></textarea><div class="center"><button data-cmd="css-save">Save CSS</button></div></td></tr></tfoot></table></div>',document.body.appendChild(e),e.addEventListener("click",this.onClick,!1),t=$.id("customCSSBox"),(a=localStorage.getItem("4chan-css"))&&(t.textContent=a),t.focus())},CustomCSS.save=function(){var e,t;(e=$.id("customCSSBox"))&&(localStorage.setItem("4chan-css",e.value),Config.customCSS&&(t=$.id("customCSS"))&&(document.head.removeChild(t),CustomCSS.init()))},CustomCSS.close=function(){var e;(e=$.id("customCSSMenu"))&&(e.removeEventListener("click",this.onClick,!1),document.body.removeChild(e))},CustomCSS.onClick=function(e){var t;if(t=e.target.getAttribute("data-cmd"))switch(t){case"css-close":CustomCSS.close();break;case"css-save":CustomCSS.save(),CustomCSS.close()}};var Keybinds={enabled:!1};Keybinds.init=function(){this.enabled=!0,this.map={65:function(){ThreadUpdater.enabled&&ThreadUpdater.toggleAuto()},70:function(){Config.filter&&Filter.addSelection()},81:function(){QR.enabled&&Main.tid&&QR.quotePost(Main.tid)},82:function(){ThreadUpdater.enabled&&ThreadUpdater.forceUpdate()},87:function(){Config.threadWatcher&&Main.tid&&ThreadWatcher.toggle(Main.tid)},66:function(){var e;(e=$.cls("prev")[0])&&(e=$.tag("form",e)[0])&&e.submit()},67:function(){location.href="/"+Main.board+"/catalog"},78:function(){var e;(e=$.cls("next")[0])&&(e=$.tag("form",e)[0])&&e.submit()},73:function(){location.href="/"+Main.board+"/"}},document.addEventListener("keydown",this.resolve,!1)},Keybinds.resolve=function(e){var t,a=e.target;Keybinds.enabled&&"TEXTAREA"!=a.nodeName&&"INPUT"!=a.nodeName&&(!(t=Keybinds.map[e.keyCode])||e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.preventDefault(),e.stopPropagation(),t()))},Keybinds.open=function(){var e;$.id("keybindsHelp")||((e=document.createElement("div")).id="keybindsHelp",e.className="UIPanel",e.setAttribute("data-cmd","keybinds-close"),e.innerHTML='<div class="extPanel reply"><div class="panelHeader">Keyboard Shortcuts<span class="panelCtrl"><img data-cmd="keybinds-close" class="pointer" alt="Close" title="Close" src="'+Main.icons.cross+'"></span></div><ul><li><strong>Global</strong></li><li><kbd>A</kbd> — Toggle auto-updater</li><li><kbd>Q</kbd> — Open Quick Reply</li><li><kbd>R</kbd> — Update thread</li><li><kbd>W</kbd> — Watch/Unwatch thread</li><li><kbd>B</kbd> — Previous page</li><li><kbd>N</kbd> — Next page</li><li><kbd>I</kbd> — Return to index</li><li><kbd>C</kbd> — Open catalog</li><li><kbd>F</kbd> — Filter selected text</li></ul><ul><li><strong>Quick Reply (always enabled)</strong></li><li><kbd>Ctrl + Click</kbd> the post number — Quote without linking</li><li><kbd>Ctrl + S</kbd> — Spoiler tags</li><li><kbd>Esc</kbd> — Close the Quick Reply</li></ul>',document.body.appendChild(e),e.addEventListener("click",this.onClick,!1))},Keybinds.close=function(){var e;(e=$.id("keybindsHelp"))&&(e.removeEventListener("click",this.onClick,!1),document.body.removeChild(e))},Keybinds.onClick=function(e){var t;(t=e.target.getAttribute("data-cmd"))&&"keybinds-close"==t&&Keybinds.close()};var Del={deletePost:function(e,t){var a;confirm("Delete "+(t?"file":"post")+"?")&&((a={mode:window.thread_archived?"arcdel":"usrdel"})[e]="delete",t&&(a.onlyimgdel="on"),$.xhr("POST","https://sys."+$L.d(Main.board)+"/"+Main.board+"/imgboard.php",{onload:Del.onPostDeleted,onerror:Del.onError,withCredentials:!0,pid:e,file_only:t},a))},onPostDeleted:function(){var e;if(this.file_only){if((e=$.id("f"+this.pid))&&!(e=$.tag("img",e)[0]).hasAttribute("data-md5"))return}else e=$.id("pc"+this.pid);e&&(/Updating index|Can't find the post/.test(this.responseText)?$.hasClass(e,"deleted")||$.addClass(e,"deleted"):Del.onError())},onError:function(){Feedback.error("Something went wrong.")}},Report={init:function(){window.addEventListener("message",Report.onMessage,!1)}};Report.onMessage=function(e){var t;if(e.origin==="https://sys."+$L.d(Main.board)&&/^done-report/.test(e.data)){if(t=e.data.split("-")[2],Config.threadHiding&&$.id("t"+t))return void(ThreadHiding.isHidden(t)||(ThreadHiding.hide(t),ThreadHiding.save()));if($.id("p"+t))return void(ReplyHiding.isHidden(t)||(ReplyHiding.hide(t),ReplyHiding.save()))}},Report.open=function(e,t){var a,i;QR.noCaptcha?(a=205,i=""):(a=510,i=""),window.open("https://sys."+$L.d(Main.board)+"/"+(t||Main.board)+"/imgboard.php?mode=report&no="+e+i,Date.now(),"toolbar=0,scrollbars=1,location=0,status=1,menubar=0,resizable=1,width=380,height="+a)};var CustomMenu={};CustomMenu.initCtrl=function(){var e,t;(e=document.createElement("span")).className="custom-menu-ctrl",e.innerHTML='[<a data-cmd="custom-menu-edit" title="Edit Menu" href="#">Edit</a>]',!Config.dropDownNav||Config.classicNav||Main.hasMobileLayout?((t=$.cls("boardList"))[0]&&t[0].appendChild(e),t[1]&&t[1].appendChild(e.cloneNode(!0))):(t=$.id("boardSelectMobile").parentNode).insertBefore(e,t.lastChild)},CustomMenu.reset=function(){var e,t,a,i,n;for(a=$.cls("boardList"),i=$.cls("customBoardList"),n=$.cls("show-all-boards"),e=0;t=n[e];++e)t.removeEventListener("click",CustomMenu.reset,!1);for(e=i.length-1;t=i[e];e--)a[e].style.display=null,t.parentNode.removeChild(t)},CustomMenu.apply=function(e){var t,a,i,n,o,r,s;if(e){for(r=e.split(/[^0-9a-z]/i),(s=document.createElement("span")).className="customBoardList",t=0;n=r[t];++t)t?s.appendChild(document.createTextNode(" / ")):s.appendChild(document.createTextNode("[")),(a=document.createElement("a")).textContent=n,a.href="//boards."+$L.d(n)+"/"+n+"/",s.appendChild(a);if(s.appendChild(document.createTextNode("]")),!Config.dropDownNav||Config.classicNav||Main.hasMobileLayout){for(s.appendChild(document.createTextNode(" [")),(a=document.createElement("a")).textContent="\u2026",a.title="Show all",a.className="show-all-boards pointer",s.appendChild(a),s.appendChild(document.createTextNode("] ")),i=s.cloneNode(!0),o=$.cls("boardList"),t=0;a=o[t];++t)a.style.display="none",
|
|
a.parentNode.insertBefore(t?i:s,a);for(o=$.cls("show-all-boards"),t=0;a=o[t];++t)a.addEventListener("click",CustomMenu.reset,!1)}else(a=$.cls("customBoardList")[0])&&a.parentNode.removeChild(a),(o=$.id("boardSelectMobile"))&&o.parentNode.insertBefore(s,o.nextSibling)}else!Config.dropDownNav||Config.classicNav||Main.hasMobileLayout||(a=$.cls("customBoardList")[0])&&a.parentNode.removeChild(a)},CustomMenu.onClick=function(e){var t;(t=e.target)!=document&&(t.hasAttribute("data-close")?CustomMenu.closeEditor():t.hasAttribute("data-save")&&CustomMenu.save($.id("customMenu").hasAttribute("data-standalone")))},CustomMenu.showEditor=function(e){var t;(t=document.createElement("div")).id="customMenu",t.className="UIPanel",t.setAttribute("data-close","1"),!0===e&&t.setAttribute("data-standalone","1"),t.innerHTML='<div class="extPanel reply"><div class="panelHeader">Custom Board List<span class="panelCtrl"><img alt="Close" title="Close" class="pointer" data-close="1" src="'+Main.icons.cross+'"></span></div><input placeholder="Example: jp tg mu" id="customMenuBox" type="text" value=""><div class="center"><button data-save="1">Save</button></div></div>',document.body.appendChild(t),Config.customMenuList&&($.id("customMenuBox").value=Config.customMenuList),t.addEventListener("click",CustomMenu.onClick,!1)},CustomMenu.closeEditor=function(){var e;(e=$.id("customMenu"))&&(e.removeEventListener("click",CustomMenu.onClick,!1),document.body.removeChild(e))},CustomMenu.save=function(e){var t;(t=$.id("customMenuBox"))&&(Config.customMenuList=t.value,!0===e&&(CustomMenu.apply(Config.customMenuList),Config.customMenu=!0,Config.save())),CustomMenu.closeEditor()};var Draggable={el:null,key:null,scrollX:null,scrollY:null,dx:null,dy:null,right:null,bottom:null,offsetTop:null,set:function(e){e.addEventListener("mousedown",Draggable.startDrag,!1)},unset:function(e){e.removeEventListener("mousedown",Draggable.startDrag,!1)},startDrag:function(e){var t,a,i;this.parentNode.hasAttribute("data-shiftkey")&&!e.shiftKey||(e.preventDefault(),t=Draggable,a=document.documentElement,t.el=this.parentNode,t.key=t.el.getAttribute("data-trackpos"),i=t.el.getBoundingClientRect(),t.dx=e.clientX-i.left,t.dy=e.clientY-i.top,t.right=a.clientWidth-i.width,t.bottom=a.clientHeight-i.height,"fixed"!=getComputedStyle(t.el,null).position?(t.scrollX=window.pageXOffset,t.scrollY=window.pageYOffset):t.scrollX=t.scrollY=0,t.offsetTop=Main.getDocTopOffset(),document.addEventListener("mouseup",t.endDrag,!1),document.addEventListener("mousemove",t.onDrag,!1))},endDrag:function(){document.removeEventListener("mouseup",Draggable.endDrag,!1),document.removeEventListener("mousemove",Draggable.onDrag,!1),Draggable.key&&(Config[Draggable.key]=Draggable.el.style.cssText,Config.save()),delete Draggable.el},onDrag:function(e){var t,a,i;t=e.clientX-Draggable.dx+Draggable.scrollX,a=e.clientY-Draggable.dy+Draggable.scrollY,i=Draggable.el.style,t<1?(i.left="0",i.right=""):Draggable.right<t?(i.left="",i.right="0"):(i.left=t/document.documentElement.clientWidth*100+"%",i.right=""),a<=Draggable.offsetTop?(i.top=Draggable.offsetTop+"px",i.bottom=""):Draggable.bottom<a&&Draggable.el.clientHeight<document.documentElement.clientHeight?(i.bottom="0",i.top=""):(i.top=a/document.documentElement.clientHeight*100+"%",i.bottom="")}},UA={};UA.init=function(){document.head=document.head||$.tag("head")[0],this.isOpera="[object Opera]"==Object.prototype.toString.call(window.opera),this.hasCORS="withCredentials"in new XMLHttpRequest,this.hasFormData="FormData"in window},UA.dispatchEvent=function(e,t){var a=document.createEvent("Event");a.initEvent(e,!1,!1),t&&(a.detail=t),document.dispatchEvent(a)},UA.getSelection=function(e){var t;return UA.isOpera&&"string"==typeof(t=document.getSelection())||(t=window.getSelection(),e||(t=t.toString())),t};var Config={quotePreview:!0,backlinks:!0,quickReply:!0,threadUpdater:!0,threadHiding:!0,alwaysAutoUpdate:!1,topPageNav:!1,threadWatcher:!1,threadAutoWatcher:!1,imageExpansion:!0,fitToScreenExpansion:!1,threadExpansion:!0,alwaysDepage:!1,localTime:!0,stickyNav:!1,keyBinds:!1,inlineQuotes:!1,filter:!1,revealSpoilers:!1,imageHover:!1,threadStats:!0,IDColor:!0,noPictures:!1,embedYouTube:!0,embedSoundCloud:!1,updaterSound:!1,customCSS:!1,autoScroll:!1,hideStubs:!1,compactThreads:!1,centeredThreads:!1,dropDownNav:!1,autoHideNav:!1,classicNav:!1,fixedThreadWatcher:!1,persistentQR:!1,forceHTTPS:!1,darkTheme:!1,linkify:!1,unmuteWebm:!1,disableAll:!1},ConfigMobile={embedYouTube:!1,compactThreads:!1,linkify:!0};Config.load=function(){var e;(e=localStorage.getItem("4chan-settings"))?(e=JSON.parse(e),$.extend(Config,e),"1"===Main.getCookie("https")?Config.forceHTTPS=!0:Config.forceHTTPS=!1):Main.firstRun=!0},Config.loadFromURL=function(){var e,t;if(e=location.href.split("=",2),/#cfg$/.test(e[0]))try{return t=JSON.parse(decodeURIComponent(e[1])),history.replaceState(null,"",location.href.split("#",1)[0]),$.extend(Config,JSON.parse(t.settings)),Config.save(),t.filters&&localStorage.setItem("4chan-filters",t.filters),t.css&&localStorage.setItem("4chan-css",t.css),t.catalogFilters&&localStorage.setItem("catalog-filters",t.catalogFilters),t.catalogSettings&&localStorage.setItem("catalog-settings",t.catalogSettings),!0}catch(a){console.log(a)}return!1},Config.toURL=function(){var e,t={};return t.settings=localStorage.getItem("4chan-settings"),(e=localStorage.getItem("4chan-filters"))&&(t.filters=e),(e=localStorage.getItem("4chan-css"))&&(t.css=e),(e=localStorage.getItem("catalog-filters"))&&(t.catalogFilters=e),(e=localStorage.getItem("catalog-settings"))&&(t.catalogSettings=e),encodeURIComponent(JSON.stringify(t))},Config.save=function(e){localStorage.setItem("4chan-settings",JSON.stringify(Config)),e&&(Config.forceHTTPS?Main.setCookie("https",1):Main.removeCookie("https"),e.darkTheme!=Config.darkTheme&&(Config.darkTheme?(Main.setCookie("nws_style","Tomorrow","."+$L.d(Main.board)),Main.setCookie("ws_style","Tomorrow","."+$L.d(Main.board))):(Main.removeCookie("nws_style","."+$L.d(Main.board)),Main.removeCookie("ws_style","."+$L.d(Main.board)))))};var SettingsMenu={};SettingsMenu.options={"Quotes & Replying":{quotePreview:["Quote preview","Show post when mousing over post links",!0],backlinks:["Backlinks","Show who has replied to a post",!0],inlineQuotes:["Inline quote links","Clicking quote links will inline expand the quoted post, Shift-click to bypass inlining"],quickReply:["Quick Reply","Quickly respond to a post by clicking its post number",!0],persistentQR:["Persistent Quick Reply","Keep Quick Reply window open after posting"]},Monitoring:{threadUpdater:["Thread updater","Append new posts to bottom of thread without refreshing the page",!0],alwaysAutoUpdate:["Auto-update by default","Always auto-update threads",!0],threadWatcher:["Thread Watcher","Keep track of threads you're watching and see when they receive new posts",!0],threadAutoWatcher:["Automatically watch threads you create","",!0,!0],autoScroll:["Auto-scroll with auto-updated posts","Automatically scroll the page as new posts are added"],updaterSound:["Sound notification","Play a sound when somebody replies to your post(s)"],fixedThreadWatcher:["Pin Thread Watcher to the page","Thread Watcher will scroll with you"],threadStats:["Thread statistics","Display post and image counts on the right of the page, <em>italics</em> signify bump/image limit has been met",!0]},"Filters & Post Hiding":{filter:['Filter and highlight specific threads/posts [<a href="javascript:;" data-cmd="filters-open">Edit</a>]',"Enable pattern-based filters"],threadHiding:['Thread hiding [<a href="javascript:;" data-cmd="thread-hiding-clear">Clear History</a>]',"Hide entire threads by clicking the minus button",!0],hideStubs:["Hide thread stubs","Don't display stubs of hidden threads"]},Navigation:{threadExpansion:["Thread expansion","Expand threads inline on board indexes",!0],dropDownNav:["Use persistent drop-down navigation bar",""],classicNav:["Use traditional board list","",!1,!0],autoHideNav:["Auto-hide on scroll","",!1,!0],customMenu:['Custom board list [<a href="javascript:;" data-cmd="custom-menu-edit">Edit</a>]',"Only show selected boards in top and bottom board lists"],alwaysDepage:["Always use infinite scroll","Enable infinite scroll by default, so reaching the bottom of the board index will load subsequent pages",!0],topPageNav:["Page navigation at top of page","Show the page switcher at the top of the page, hold Shift and drag to move"],stickyNav:["Navigation arrows","Show top and bottom navigation arrows, hold Shift and drag to move"],keyBinds:['Use keyboard shortcuts [<a href="javascript:;" data-cmd="keybinds-open">Show</a>]',"Enable handy keyboard shortcuts for common actions"]},"Images & Media":{imageExpansion:["Image expansion","Enable inline image expansion, limited to browser width",!0],fitToScreenExpansion:["Fit expanded images to screen","Limit expanded images to both browser width and height"],imageHover:["Image hover","Mouse over images to view full size, limited to browser size"],imageHoverBg:["Set a background color for transparent images","",!1,!0],revealSpoilers:["Don't spoiler images","Show image thumbnail and original filename instead of spoiler placeholders",!0],unmuteWebm:["Un-mute WebM audio","Un-mute sound automatically for WebM playback",!0],noPictures:["Hide thumbnails","Don't display thumbnails while browsing",!0],embedYouTube:["Embed YouTube links","Embed YouTube player into replies"],embedSoundCloud:["Embed SoundCloud links","Embed SoundCloud player into replies"]},Miscellaneous:{linkify:["Linkify URLs","Make user-posted links clickable",!0],darkTheme:["Use a dark theme","Use the Tomorrow theme for nighttime browsing",!0,!1,!0],customCSS:['Custom CSS [<a href="javascript:;" data-cmd="css-open">Edit</a>]',"Include your own CSS rules",!0],IDColor:["Color user IDs","Assign unique colors to user IDs on boards that use them",!0],compactThreads:["Force long posts to wrap","Long posts will wrap at 75% browser width"],centeredThreads:["Center threads","Align threads to the center of page",!1],localTime:["Convert dates to local time","Convert 4chan server time (US Eastern Time) to your local time",!0],forceHTTPS:["Always use HTTPS","Rewrite 4chan URLs to always use HTTPS",!0]}},SettingsMenu.save=function(){var e,t,a,i,n;for(n={},$.extend(n,Config),t=$.id("settingsMenu").getElementsByClassName("menuOption"),e=0;a=t[e];++e)i=a.getAttribute("data-option"),Config[i]="checkbox"==a.type?a.checked:a.value;Config.save(n),UA.dispatchEvent("4chanSettingsSaved"),SettingsMenu.close(),location.href=location.href.replace(/#.+$/,"")},SettingsMenu.toggle=function(){$.id("settingsMenu")?SettingsMenu.close():SettingsMenu.open()},SettingsMenu.open=function(){var e,t,a,i,n,o,r,s,d;if(Main.firstRun&&((d=$.id("settingsTip"))&&d.parentNode.removeChild(d),(d=$.id("settingsTipBottom"))&&d.parentNode.removeChild(d),Config.save()),(o=document.createElement("div")).id="settingsMenu",o.className="UIPanel",n='<div class="extPanel reply"><div class="panelHeader">Settings<span class="panelCtrl"><img alt="Close" title="Close" class="pointer" data-cmd="settings-toggle" src="'+Main.icons.cross+'"></a></span></div><ul>',n+='<ul><li id="settings-exp-all">[<a href="#" data-cmd="settings-exp-all">Expand All Settings</a>]</li></ul>',Main.hasMobileLayout){a={};for(t in SettingsMenu.options){s={},r=SettingsMenu.options[t];for(i in r)r[i][2]&&(s[i]=r[i]);for(e in s){a[t]=s;break}}}else a=SettingsMenu.options;for(t in a){r=a[t],n+='<ul><li class="settings-cat-lbl"><img alt="" class="settings-expand" src="'+Main.icons.plus+'"><span class="settings-expand pointer">'+t+'</span></li><ul class="settings-cat">';for(i in r)r[i][4]&&!Main.hasMobileLayout||(n+="<li"+(r[i][3]?' class="settings-sub">':">")+'<label><input type="checkbox" class="menuOption" data-option="'+i+'"'+(Config[i]?' checked="checked">':">")+r[i][0]+"</label>"+(!1!==r[i][1]?'</li><li class="settings-tip'+(r[i][3]?' settings-sub">':'">')+r[i][1]:"")+"</li>");n+="</ul></ul>"}n+='</ul><ul><li class="settings-off"><label title="Completely disable the native extension (overrides any checked boxes)"><input type="checkbox" class="menuOption" data-option="disableAll"'+(Config.disableAll?' checked="checked">':">")+'Disable the native extension</label></li></ul><div class="center"><button data-cmd="settings-export">Export Settings</button><button data-cmd="settings-save">Save Settings</button></div>',o.innerHTML=n,o.addEventListener("click",SettingsMenu.onClick,!1),document.body.appendChild(o),Main.firstRun&&SettingsMenu.expandAll(),(d=$.cls("menuOption",o)[0])&&d.focus()},SettingsMenu.showExport=function(){var e,t,a;$.id("exportSettings")||(t=location.href.replace(location.hash,"").replace(/^http:/,"https:")+"#cfg="+Config.toURL(),(e=document.createElement("div")).id="exportSettings",e.className="UIPanel",e.setAttribute("data-cmd","export-close"),e.innerHTML='<div class="extPanel reply"><div class="panelHeader">Export Settings<span class="panelCtrl"><img data-cmd="export-close" class="pointer" alt="Close" title="Close" src="'+Main.icons.cross+'"></span></div><p class="center">Copy and save the URL below, and visit it from another browser or computer to restore your extension and catalog settings.</p><p class="center"><input class="export-field" type="text" readonly="readonly" value="'+t+'"></p><p style="margin-top:15px" class="center">Alternatively, you can drag the link below into your bookmarks bar and click it to restore.</p><p class="center">[<a target="_blank" href="'+t+'">Restore 4chan Settings</a>]</p>',document.body.appendChild(e),e.addEventListener("click",this.onExportClick,!1),(a=$.cls("export-field",e)[0]).focus(),a.select())},SettingsMenu.closeExport=function(){var e;(e=$.id("exportSettings"))&&(e.removeEventListener("click",this.onExportClick,!1),document.body.removeChild(e))},SettingsMenu.onExportClick=function(e){"exportSettings"==e.target.id&&(e.preventDefault(),e.stopPropagation(),SettingsMenu.closeExport())},SettingsMenu.expandAll=function(){var e,t,a=$.cls("settings-expand");for(e=0;t=a[e];++e)t.src=Main.icons.minus,t.parentNode.nextElementSibling.style.display="block"},SettingsMenu.toggleCat=function(e){var t,a,i=e.parentNode.nextElementSibling;i.style.display?(a="",t="plus"):(a="block",t="minus"),i.style.display=a,e.parentNode.firstElementChild.src=Main.icons[t]},SettingsMenu.onClick=function(e){var t,a;a=e.target,$.hasClass(a,"settings-expand")?SettingsMenu.toggleCat(a):"settings-exp-all"==a.getAttribute("data-cmd")?(e.preventDefault(),SettingsMenu.expandAll()):"settingsMenu"==a.id&&(t=$.id("settingsMenu"))&&(e.preventDefault(),SettingsMenu.close(t))},SettingsMenu.close=function(e){(e=e||$.id("settingsMenu"))&&(e.removeEventListener("click",SettingsMenu.onClick,!1),document.body.removeChild(e))};var Feedback={messageTimeout:null,showMessage:function(e,t,a,i){var n;Feedback.hideMessage(),(n=document.createElement("div")).id="feedback",n.title="Dismiss",n.innerHTML='<span class="feedback-'+t+'">'+e+"</span>",$.on(n,"click",i||Feedback.hideMessage),document.body.appendChild(n),a&&(Feedback.messageTimeout=setTimeout(Feedback.hideMessage,a))},hideMessage:function(){var e=$.id("feedback");e&&(Feedback.messageTimeout&&(clearTimeout(Feedback.messageTimeout),Feedback.messageTimeout=null),$.off(e,"click",Feedback.hideMessage),document.body.removeChild(e))},error:function(e,t){t===undefined&&(t=5e3),Feedback.showMessage(e||"Something went wrong","error",t)},notify:function(e,t){t===undefined&&(t=3e3),Feedback.showMessage(e,"notify",t)}},Main={};Main.addTooltip=function(e,t,a){var i,n;return(i=document.createElement("div")).className="click-me",a&&(i.id=a),i.innerHTML=t||"Change your settings",e.parentNode.appendChild(i),n=(e.offsetWidth-i.offsetWidth+e.offsetLeft-i.offsetLeft)/2,i.style.marginLeft=n+"px",i},Main.getDocTopOffset=function(){return Config.dropDownNav&&!Config.autoHideNav?$.id(Config.classicNav?"boardNavDesktop":"boardNavMobile").offsetHeight:0},Main.init=function(){var e;document.addEventListener("DOMContentLoaded",Main.run,!1),Main.now=Date.now(),Main.is_4channel="boards.4channel.org"===location.host,UA.init(),Config.load(),Config.forceHTTPS&&"https:"!=location.protocol?location.href=location.href.replace(/^http:/,"https:"):(Main.firstRun&&Config.loadFromURL()&&(Main.firstRun=!1),(Main.stylesheet=Main.getCookie(style_group))?Main.stylesheet=Main.stylesheet.toLowerCase().replace(/ /g,"_"):Main.stylesheet="nws_style"==style_group?"yotsuba_new":"yotsuba_b_new",QR.noCaptcha=QR.noCaptcha||window.passEnabled,Main.initIcons(),Main.addCSS(),Main.type=style_group.split("_")[0],e=location.pathname.split(/\//),Main.board=e[1],Main.page=e[2],Main.tid=e[3],UA.dispatchEvent("4chanMainInit"))},Main.initPersistentNav=function(){var e,t,a;t=$.id("boardNavDesktop"),a=$.id("boardNavDesktopFoot"),Config.classicNav?((e=document.createElement("div")).className="pageJump",e.innerHTML='<a href="#bottom">▼</a><a href="javascript:void(0);" id="settingsWindowLinkClassic">Settings</a><a href="//www.'+$L.d(Main.board)+'" target="_top">Home</a></div>',t.appendChild(e),$.id("settingsWindowLinkClassic").addEventListener("click",SettingsMenu.toggle,!1),$.addClass(t,"persistentNav")):(t.style.display="none",$.removeClass($.id("boardNavMobile"),"mobile")),a.style.display="none",$.addClass(document.body,"hasDropDownNav")},Main.checkMobileLayout=function(){var e,t;return window.matchMedia?window.matchMedia("(max-width: 480px)").matches&&"true"!=localStorage.getItem("4chan_never_show_mobile"):(e=$.id("boardNavMobile"),t=$.id("boardNavDesktop"),e&&t&&e.offsetWidth>0&&0===t.offsetWidth)},Main.disableDarkTheme=function(){Config.darkTheme=!1,localStorage.setItem("4chan-settings",JSON.stringify(Config))},Main.run=function(){var e,t;document.removeEventListener("DOMContentLoaded",Main.run,!1),document.addEventListener("click",Main.onclick,!1),$.id("settingsWindowLink").addEventListener("click",SettingsMenu.toggle,!1),$.id("settingsWindowLinkBot").addEventListener("click",SettingsMenu.toggle,!1),$.id("settingsWindowLinkMobile").addEventListener("click",SettingsMenu.toggle,!1),Main.isOekakiBoard="i"===Main.board,Main.hasMobileLayout=Main.checkMobileLayout(),Main.isMobileDevice=/Mobile|Android|Dolfin|Opera Mobi|PlayStation Vita|Nintendo DS/.test(navigator.userAgent),Search.init(),Config.disableAll||(Report.init(),Main.hasMobileLayout?$.extend(Config,ConfigMobile):((e=$.id("bottomReportBtn"))&&(e.style.display="none"),Main.isMobileDevice&&$.addClass(document.body,"isMobileDevice")),Config.linkify&&Linkify.init(),Config.IDColor&&IDColor.init(),Config.customCSS&&CustomCSS.init(),Config.keyBinds&&Keybinds.init(),Main.firstRun&&Main.isMobileDevice&&(Config.topPageNav=!1,Config.dropDownNav=!0),Config.dropDownNav&&!Main.hasMobileLayout&&Main.initPersistentNav(),$.addClass(document.body,Main.stylesheet),$.addClass(document.body,Main.type),Config.darkTheme&&($.addClass(document.body,"m-dark"),Main.hasMobileLayout||$.cls("stylechanger")[0].addEventListener("change",Main.disableDarkTheme,!1)),Config.compactThreads?$.addClass(document.body,"compact"):Config.centeredThreads&&$.addClass(document.body,"centeredThreads"),Config.noPictures&&$.addClass(document.body,"noPictures"),Config.customMenu&&CustomMenu.apply(Config.customMenuList),CustomMenu.initCtrl(),(Config.quotePreview||Config.imageHover||Config.filter)&&((t=$.id("delform")||$.id("arc-list")).addEventListener("mouseover",Main.onThreadMouseOver,!1),t.addEventListener("mouseout",Main.onThreadMouseOut,!1)),Config.stickyNav&&Main.setStickyNav(),Main.hasMobileLayout?StickyNav.init():(Main.initGlobalMessage(),Config.autoHideNav&&StickyNav.init()),Config.threadExpansion&&ThreadExpansion.init(),Config.filter&&Filter.init(),Config.threadWatcher&&ThreadWatcher.init(),(Main.hasMobileLayout||Config.embedSoundCloud||Config.embedYouTube)&&Media.init(),ReplyHiding.init(),Config.quotePreview&&QuotePreview.init(),Parser.init(),Main.tid?(Main.threadClosed=!document.forms.post||!!$.cls("closedIcon")[0],Main.threadSticky=!!$.cls("stickyIcon",$.id("pi"+Main.tid))[0],Config.threadStats&&ThreadStats.init(),Parser.parseThread(Main.tid),Config.threadUpdater&&ThreadUpdater.init()):(Main.page||Depager.init(),Config.topPageNav&&Main.setPageNav(),Config.threadHiding?(ThreadHiding.init(),Parser.parseBoard()):Parser.parseBoard()),"f"===Main.board&&SWFEmbed.init(),Config.quickReply&&QR.init(),ReplyHiding.purge(),Config.alwaysDepage&&!Main.hasMobileLayout&&$.docEl.scrollHeight<=$.docEl.clientHeight&&Depager.depage())},Main.isThreadClosed=function(e){var t;return window.thread_archived||(t=$.id("pi"+e))&&$.cls("closedIcon",t)[0]},Main.setThreadState=function(e,t){var a,i,n,o;o=e.charAt(0).toUpperCase()+e.slice(1),t?(a=$.cls("postNum",$.id("pi"+Main.tid))[0],(i=document.createElement("img")).className=e+"Icon retina",i.title=o,i.src=Main.icons2[e],"sticky"==e&&(n=$.cls("closedIcon",a)[0])?(a.insertBefore(i,n),a.insertBefore(document.createTextNode(" "),n)):(a.appendChild(document.createTextNode(" ")),a.appendChild(i))):(i=$.cls(e+"Icon",$.id("pi"+Main.tid))[0])&&(i.parentNode.removeChild(i.previousSibling),i.parentNode.removeChild(i)),Main["thread"+o]=t},Main.icons={up:"arrow_up.png",down:"arrow_down.png",right:"arrow_right.png",download:"arrow_down2.png",refresh:"refresh.png",cross:"cross.png",gis:"gis.png",iqdb:"iqdb.png",minus:"post_expand_minus.png",plus:"post_expand_plus.png",rotate:"post_expand_rotate.gif",quote:"quote.png",report:"report.png",notwatched:"watch_thread_off.png",watched:"watch_thread_on.png",help:"question.png"},Main.icons2={archived:"archived.gif",closed:"closed.gif",sticky:"sticky.gif",trash:"trash.gif"},Main.initIcons=function(){var e,t,a;if(t={yotsuba_new:"futaba/",futaba_new:"futaba/",yotsuba_b_new:"burichan/",burichan_new:"burichan/",tomorrow:"tomorrow/",photon:"photon/"},a="//s.4cdn.org/image/",window.devicePixelRatio>=2){for(e in Main.icons)Main.icons[e]=Main.icons[e].replace(".","@2x.");for(e in Main.icons2)Main.icons2[e]=Main.icons2[e].replace(".","@2x.")}for(e in Main.icons2)Main.icons2[e]=a+Main.icons2[e];a+="buttons/"+t[Main.stylesheet];for(e in Main.icons)Main.icons[e]=a+Main.icons[e]},Main.setPageNav=function(){var e,t;(t=document.createElement("div")).setAttribute("data-shiftkey","1"),t.setAttribute("data-trackpos","TN-position"),t.className="topPageNav",Config["TN-position"]?t.style.cssText=Config["TN-position"]:(t.style.left="10px",t.style.top="50px"),(e=$.cls("pagelist")[0])&&(e=e.cloneNode(!0),t.appendChild(e),Draggable.set(e),document.body.appendChild(t))},Main.getWebmVolume=function(){let e=parseFloat(localStorage.getItem("4chan-volume"));return isNaN(e)?.5:e},Main.getWebmVolumeChangeCb=function(){let e;return t=>{clearTimeout(e),e=setTimeout(()=>{localStorage.setItem("4chan-volume",t.target.volume)},200)}},Main.initGlobalMessage=function(){var e,t,a,i;(e=$.id("globalMessage"))&&e.textContent&&(e.nextElementSibling.style.clear="both",(t=document.createElement("img")).id="toggleMsgBtn",t.className="extButton",t.setAttribute("data-cmd","toggleMsg"),t.alt="Toggle",t.title="Toggle announcement",i=localStorage.getItem("4chan-global-msg"),a=e.getAttribute("data-utc"),i&&a<=i?(e.style.display="none",t.style.opacity="0.5",t.src=Main.icons.plus):t.src=Main.icons.minus,e.parentNode.insertBefore(t,e))},Main.toggleGlobalMessage=function(){var e,t;e=$.id("globalMessage"),t=$.id("toggleMsgBtn"),"none"==e.style.display?(e.style.display="",t.src=Main.icons.minus,t.style.opacity="1",localStorage.removeItem("4chan-global-msg")):(e.style.display="none",t.src=Main.icons.plus,t.style.opacity="0.5",localStorage.setItem("4chan-global-msg",e.getAttribute("data-utc")))},Main.setStickyNav=function(){var e,t;(e=document.createElement("div")).id="stickyNav",e.className="extPanel reply",e.setAttribute("data-shiftkey","1"),e.setAttribute("data-trackpos","SN-position"),Config["SN-position"]?e.style.cssText=Config["SN-position"]:(e.style.right="10px",e.style.top="50px"),(t=document.createElement("div")).innerHTML='<img class="pointer" src="'+Main.icons.up+'" data-cmd="totop" alt="\u25b2" title="Top"><img class="pointer" src="'+Main.icons.down+'" data-cmd="tobottom" alt="\u25bc" title="Bottom">',Draggable.set(t),e.appendChild(t),document.body.appendChild(e)},Main.getCookie=function(e){var t,a,i,n;for(n=e+"=",i=document.cookie.split(";"),t=0;a=i[t];++t){for(;" "==a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(n))return decodeURIComponent(a.substring(n.length,a.length))}return null},Main.setCookie=function(e,t,a){var i=new Date;i.setTime(i.getTime()+31536e6),a||(a=location.host),document.cookie=e+"="+t+"; expires="+i.toGMTString()+"; path=/; domain="+a},Main.removeCookie=function(e,t,a){t||(t=location.host),a||(a="/"),document.cookie=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;; path="+a+"; domain="+t},Main.onclick=function(e){var t,a,i,n;if((t=e.target)!=document){if(a=t.getAttribute("data-cmd"))switch(n=t.getAttribute("data-id"),a){case"update":e.preventDefault(),ThreadUpdater.forceUpdate();break;case"post-menu":e.preventDefault(),PostMenu.open(t);break;case"auto":ThreadUpdater.toggleAuto();break;case"totop":case"tobottom":e.shiftKey||(location.href="#"+a.slice(2));break;case"hide":ThreadHiding.toggle(n);break;case"watch":ThreadWatcher.toggle(n);break;case"hide-r":t.hasAttribute("data-recurse")?ReplyHiding.toggleR(n):ReplyHiding.toggle(n);break;case"expand":ThreadExpansion.toggle(n);break;case"open-qr":e.preventDefault(),QR.show(Main.tid),$.tag("textarea",document.forms.qrPost)[0].focus();break;case"qr-painter-draw":QR.openPainter();break;case"qr-painter-clear":QR.onPainterCancel();break;case"qr-painter-edit":e.preventDefault(),QR.onOpenInPainterClick(t);break;case"unfilter":Filter.unfilter(t);break;case"depage":e.preventDefault(),Depager.toggle();break;case"report":Report.open(n,t.getAttribute("data-board"));break;case"filter-sel":e.preventDefault(),Filter.addSelection();break;case"embed":Media.toggleEmbed(t);break;case"sound":ThreadUpdater.toggleSound();break;case"toggleMsg":Main.toggleGlobalMessage();break;case"settings-toggle":SettingsMenu.toggle();break;case"settings-save":SettingsMenu.save();break;case"keybinds-open":Keybinds.open();break;case"filters-open":Filter.open();break;case"thread-hiding-clear":ThreadHiding.clear();break;case"css-open":CustomCSS.open();break;case"settings-export":SettingsMenu.showExport();break;case"export-close":SettingsMenu.closeExport();break;case"custom-menu-edit":e.preventDefault(),CustomMenu.showEditor($.hasClass(t.parentNode,"custom-menu-ctrl"));break;case"del-post":case"del-file":e.preventDefault(),Del.deletePost(n,"del-file"===a);break;case"open-tex-preview":QR.openTeXPreview();break;case"close-tex-preview":QR.closeTeXPreview()}else if(!Config.disableAll)if(QR.enabled&&"Reply to this post"==t.title)e.preventDefault(),i=Main.tid||t.previousElementSibling.getAttribute("href").split("#")[0].split("/").slice(-1)[0],QR.quotePost(i,!e.ctrlKey&&t.textContent);else{if(Config.imageExpansion&&1==e.which&&t.parentNode&&$.hasClass(t.parentNode,"fileThumb")&&"A"==t.parentNode.nodeName&&!$.hasClass(t.parentNode,"deleted")&&!$.hasClass(t,"mFileInfo"))return void(ImageExpansion.toggle(t)&&e.preventDefault());Config.inlineQuotes&&1==e.which&&$.hasClass(t,"quotelink")&&"archive"!==Main.page?e.shiftKey?(e.preventDefault(),window.location=t.href):QuoteInline.toggle(t,e):Config.threadExpansion&&t.parentNode&&$.hasClass(t.parentNode,"abbr")?(e.preventDefault(),ThreadExpansion.expandComment(t)):Main.isMobileDevice&&Config.quotePreview&&$.hasClass(t,"quotelink")&&t.getAttribute("href").match(QuotePreview.regex)?e.preventDefault():$.hasClass(t,"mFileInfo")&&(e.preventDefault(),e.stopPropagation())}!Main.hasMobileLayout||!Config.disableAll&&Config.imageExpansion||t.parentNode&&t.parentNode.hasAttribute("data-m")&&ImageExpansion.setMobileSrc(t.parentNode)}},Main.onThreadMouseOver=function(e){var t=e.target;Config.quotePreview&&$.hasClass(t,"quotelink")&&!$.hasClass(t,"deadlink")&&!$.hasClass(t,"linkfade")?QuotePreview.resolve(e.target):Config.imageHover&&(t.hasAttribute("data-md5")&&!$.hasClass(t.parentNode,"deleted")||t.href&&!$.hasClass(t.parentNode,"fileText")&&/(i\.4cdn|is\.4chan)\.org\/[a-z0-9]+\/[0-9]+\.(gif|jpg|png|webm)$/.test(t.href))?ImageHover.show(t):$.hasClass(t,"dateTime")?Parser.onDateMouseOver(t):$.hasClass(t,"hand")?Parser.onUIDMouseOver(t):Config.embedYouTube&&"yt"===t.getAttribute("data-type")&&!Main.hasMobileLayout?Media.showYTPreview(t):Config.filter&&t.hasAttribute("data-filtered")&&QuotePreview.show(t,t.href?t.parentNode.parentNode.parentNode:t.parentNode.parentNode)},Main.onThreadMouseOut=function(e){var t=e.target;Config.quotePreview&&$.hasClass(t,"quotelink")?QuotePreview.remove(t):Config.imageHover&&(t.hasAttribute("data-md5")||t.href&&!$.hasClass(t.parentNode,"fileText")&&/(i\.4cdn|is\.4chan)\.org\/[a-z0-9]+\/[0-9]+\.(gif|jpg|png|webm)$/.test(t.href))?ImageHover.hide():$.hasClass(t,"dateTime")||$.hasClass(t,"hand")?Parser.onTipMouseOut(t):Config.embedYouTube&&"yt"===t.getAttribute("data-type")&&!Main.hasMobileLayout?Media.removeYTPreview():Config.filter&&t.hasAttribute("data-filtered")&&QuotePreview.remove(t)},Main.linkToThread=function(e,t,a){return"//"+location.host+"/"+(t||Main.board)+"/thread/"+e+(a>0?"#p"+a:"")},Main.addCSS=function(){
|
|
var e,t='body.hasDropDownNav { margin-top: 45px;}.extButton.threadHideButton { float: left; margin-right: 5px; margin-top: -1px;}.extButton.replyHideButton { margin-top: 1px;}div.op > span .postHideButtonCollapsed { margin-right: 1px;}.dropDownNav #boardNavMobile, { display: block !important;}.extPanel { border: 1px solid rgba(0, 0, 0, 0.20);}.tomorrow .extPanel { border: 1px solid #111;}.extButton,img.pointer { width: 18px; height: 18px;}.extControls { display: inline; margin-left: 5px;}.extButton { cursor: pointer; margin-bottom: -4px;}.trashIcon { width: 16px; height: 16px; margin-bottom: -2px; margin-left: 5px;}.threadUpdateStatus { margin-left: 0.5ex;}.futaba_new .stub,.burichan_new .stub { line-height: 1; padding-bottom: 1px;}.stub .extControls,.stub .wbtn,.stub input { display: none;}.stub .threadHideButton { float: none; margin-right: 2px;}.right { float: right;}.center { display: block; margin: auto;}.pointer { cursor: pointer;}.drag { cursor: move !important; user-select: none !important; -moz-user-select: none !important; -webkit-user-select: none !important;}#quickReply { display: block; position: fixed; padding: 2px; font-size: 10pt;}#qrepHeader,#qrHeader { font-size: 10pt; text-align: center; margin-bottom: 1px; padding: 0; height: 18px; line-height: 18px;}#qrHeader .left { float: left; margin-left: 3px; }#qrepClose,#qrClose { float: right;}#qrCaptchaContainer { width: 300px; background-color: #eee; overflow: hidden; margin-bottom: 3px }.tomorrow #qrCaptchaContainer.t-qr-root { background-color: #323232; }.tomorrow #qrCaptchaContainer #t-cnt { filter: invert(85%); }#qrForm > div { clear: both;}#quickReply input[type="text"],#quickReply textarea,#quickReply #recaptcha_response_field { border: 1px solid #aaa; font-family: arial,helvetica,sans-serif; font-size: 10pt; outline: medium none; width: 296px; padding: 2px; margin: 0 0 1px 0;}.tomorrow #quickReply input[type="text"],.tomorrow #quickReply textarea,.tomorrow #quickReply #recaptcha_response_field { border: 1px solid #515151; background-color: #282a2e; color: #c5c8c6;}.tomorrow #quickReply input[type="text"]:focus,.tomorrow #quickReply textarea:focus { border: 1px solid #757575;}#quickReply textarea { min-width: 296px; float: left;}.tomorrow #quickReply input::placeholder { color: 919191 !important;}#quickReply input[type="submit"] { width: 75px; margin: 0; float: right;}#quickReply #qrCapField { display: block; margin-top: 1px;}#quickReply input.presubmit { margin-right: 1px; width: 212px; float: left;}#qrFile { width: 130px; margin-right: 5px;}.yotsuba_new #qrFile { color:black;}#qrSpoiler { display: inline;}#qrError { width: 292px; display: none; font-family: monospace; background-color: #E62020; font-size: 12px; color: white; padding: 3px 5px; text-shadow: 0 1px rgba(0, 0, 0, 0.20); clear: both;}#qrError a:hover,#qrError a { color: white !important; text-decoration: underline;}#twHeader { font-weight: bold; text-align: center; height: 17px;}.futaba_new #twHeader,.burichan_new #twHeader { line-height: 1;}#twPrune { margin-left: 3px; margin-top: -1px;}#twClose { float: left; margin-top: -1px;}#threadWatcher { max-width: 265px; display: block; position: absolute; padding: 3px;}#watchList { margin: 0; padding: 0; user-select: none; -moz-user-select: none; -webkit-user-select: none;}#watchList li:first-child { margin-top: 3px; padding-top: 2px; border-top: 1px solid rgba(0, 0, 0, 0.20);}.photon #watchList li:first-child { border-top: 1px solid #ccc;}.yotsuba_new #watchList li:first-child { border-top: 1px solid #d9bfb7;}.yotsuba_b_new #watchList li:first-child { border-top: 1px solid #b7c5d9;}.tomorrow #watchList li:first-child { border-top: 1px solid #111;}#watchList a { text-decoration: none;}#watchList li { overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}div.post div.image-expanded { display: table;}div.op div.file .image-expanded-anti { margin-left: -3px;}#quote-preview { display: block; position: absolute; top: 0; padding: 3px 6px 6px 3px; margin: 0;}#quote-preview .dateTime { white-space: nowrap;}#quote-preview.reveal-spoilers s { background-color: #aaa !important; color: inherit !important; text-decoration: none !important;}#quote-preview.reveal-spoilers s a { background: transparent !important; text-decoration: underline;}.yotsuba_b_new #quote-preview.reveal-spoilers s a,.burichan_new #quote-preview.reveal-spoilers s a { color: #D00 !important;}.yotsuba_new #quote-preview.reveal-spoilers s a,.futaba_new #quote-preview.reveal-spoilers s a { color: #000080 !important;}.tomorrow #quote-preview.reveal-spoilers s { color: #000 !important; }.tomorrow #quote-preview.reveal-spoilers s a { color: #5F89AC !important; }.photon #quote-preview.reveal-spoilers s a { color: #FF6600 !important;}.yotsuba_new #quote-preview.highlight,.yotsuba_b_new #quote-preview.highlight { border-width: 1px 2px 2px 1px !important; border-style: solid !important;}.yotsuba_new #quote-preview.highlight { border-color: #D99F91 !important;}.yotsuba_b_new #quote-preview.highlight { border-color: #BA9DBF !important;}.yotsuba_b_new .highlight-anti,.burichan_new .highlight-anti { border-width: 1px !important; background-color: #bfa6ba !important;}.yotsuba_new .highlight-anti,.futaba_new .highlight-anti { background-color: #e8a690 !important;}.tomorrow .highlight-anti { background-color: #111 !important; border-color: #111;}.photon .highlight-anti { background-color: #bbb !important;}.op.inlined { display: block;}#quote-preview .inlined,#quote-preview .postMenuBtn,#quote-preview .extButton,#quote-preview .extControls { display: none;}.hasNewReplies { font-weight: bold; }.hasYouReplies { font-style: italic; }.archivelink { opacity: 0.5;}.deadlink { text-decoration: line-through !important;}div.backlink { font-size: 0.8em !important; display: inline; padding: 0; padding-left: 5px;}.backlink.mobile { padding: 3px 5px; display: block; clear: both !important; line-height: 2;}.op .backlink.mobile,#quote-preview .backlink.mobile { display: none !important;}.backlink.mobile .quoteLink { padding-right: 2px;}.backlink span { padding: 0;}.burichan_new .backlink a,.yotsuba_b_new .backlink a { color: #34345C !important;}.burichan_new .backlink a:hover,.yotsuba_b_new .backlink a:hover { color: #dd0000 !important;}.expbtn { margin-right: 3px; margin-left: 2px;}.tCollapsed .rExpanded { display: none;}#stickyNav { position: fixed; font-size: 0;}#stickyNav img { vertical-align: middle;}.tu-error { color: red;}.topPageNav { position: absolute;}.yotsuba_b_new .topPageNav { border-top: 1px solid rgba(255, 255, 255, 0.25); border-left: 1px solid rgba(255, 255, 255, 0.25);}.newPostsMarker:not(#quote-preview) { box-shadow: 0 3px red;}#toggleMsgBtn { float: left; margin-bottom: 6px;}.panelHeader { font-weight: bold; font-size: 16px; text-align: center; margin-bottom: 5px; margin-top: 5px; padding-bottom: 5px; border-bottom: 1px solid rgba(0, 0, 0, 0.20);}.yotsuba_new .panelHeader { border-bottom: 1px solid #d9bfb7;}.yotsuba_b_new .panelHeader { border-bottom: 1px solid #b7c5d9;}.tomorrow .panelHeader { border-bottom: 1px solid #111;}.panelHeader .panelCtrl { position: absolute; right: 5px; top: 5px;}.UIMenu,.UIPanel { position: fixed; width: 100%; height: 100%; top: 0; left: 0; z-index: 100002;}.UIPanel { line-height: 14px; font-size: 14px; background-color: rgba(0, 0, 0, 0.25);}.UIPanel:after { display: inline-block; height: 100%; vertical-align: middle; content: "";}.UIPanel > div { -moz-box-sizing: border-box; box-sizing: border-box; display: inline-block; height: auto; max-height: 100%; position: relative; width: 400px; left: 50%; margin-left: -200px; overflow: auto; box-shadow: 0 0 5px rgba(0, 0, 0, 0.25); vertical-align: middle;}#settingsMenu > div { top: 25px;; vertical-align: top; max-height: 85%;}.extPanel input[type="text"],.extPanel textarea { border: 1px solid #AAA; outline: none;}.UIPanel .center { margin-bottom: 5px;}.UIPanel button { display: inline-block; margin-right: 5px;}.UIPanel code { background-color: #eee; color: #000000; padding: 1px 4px; font-size: 12px;}.UIPanel ul { list-style: none; padding: 0; margin: 0 0 10px;}.UIPanel .export-field { width: 385px;}#settingsMenu label input { margin-right: 5px;}.tomorrow #settingsMenu ul { border-bottom: 1px solid #282a2e;}.settings-off { padding-left: 3px;}.settings-cat-lbl { font-weight: bold; margin: 10px 0 5px; padding-left: 5px;}.settings-cat-lbl img { vertical-align: text-bottom; margin-right: 5px; cursor: pointer; width: 18px; height: 18px;}.settings-tip { font-size: 0.85em; margin: 2px 0 5px 0; padding-left: 23px;}#settings-exp-all { padding-left: 7px; text-align: center;}#settingsMenu .settings-cat { display: none; margin-left: 3px;}#tex-preview-cnt .extPanel { width: 600px; margin-left: -300px; }#tex-preview-cnt textarea,#customCSSMenu textarea { display: block; max-width: 100%; min-width: 100%; -moz-box-sizing: border-box; box-sizing: border-box; height: 200px; margin: 0 0 5px; font-family: monospace;}#tex-preview-cnt textarea { height: 75px; }#output-tex-preview { min-height: 75px; white-space: pre; padding: 0 3px; -moz-box-sizing: border-box; box-sizing: border-box;}#tex-protip { font-size: 11px; margin: 5px 0; text-align: center; }a.tex-logo sub { pointer-events: none; }#customCSSMenu .right,#settingsMenu .right { margin-top: 2px;}#settingsMenu label { display: inline-block; user-select: none; -moz-user-select: none; -webkit-user-select: none;}#filtersHelp > div { width: 600px; left: 50%; margin-left: -300px;}#filtersHelp h4 { font-size: 15px; margin: 20px 0 0 10px;}#filtersHelp h4:before { content: "\xbb"; margin-right: 3px;}#filtersHelp ul { padding: 0; margin: 10px;}#filtersHelp li { padding: 3px 0; list-style: none;}#filtersMenu table { width: 100%;}#filtersMenu th { font-size: 12px;}#filtersMenu tbody { text-align: center;}#filtersMenu select,#filtersMenu .fPattern,#filtersMenu .fBoards,#palette-custom-input { padding: 1px; font-size: 11px;}#filtersMenu select { width: 75px;}#filtersMenu tfoot td { padding-top: 10px;}#keybindsHelp li { padding: 3px 5px;}.fPattern { width: 110px;}.fBoards { width: 25px;}.fColor { width: 60px;}.fDel { font-size: 16px;}.filter-preview { cursor: pointer; margin-left: 3px;}#quote-preview iframe,#quote-preview .filter-preview { display: none;}.post-hidden .extButton,.post-hidden:not(#quote-preview) .postInfo { opacity: 0.5;}.post-hidden:not(.thread) .postInfo { padding-left: 5px;}.post-hidden:not(#quote-preview) input,.post-hidden:not(#quote-preview) .replyContainer,.post-hidden:not(#quote-preview) .summary,.post-hidden:not(#quote-preview) .op .file,.post-hidden:not(#quote-preview) .file,.post-hidden .wbtn,.post-hidden .postNum span,.post-hidden:not(#quote-preview) .backlink,div.post-hidden:not(#quote-preview) div.file,div.post-hidden:not(#quote-preview) blockquote.postMessage { display: none;}.click-me { border-radius: 5px; margin-top: 5px; padding: 2px 5px; position: absolute; font-weight: bold; z-index: 2; white-space: nowrap;}.yotsuba_new .click-me,.futaba_new .click-me { color: #800000; background-color: #F0E0D6; border: 2px solid #D9BFB7;}.yotsuba_b_new .click-me,.burichan_new .click-me { color: #000; background-color: #D6DAF0; border: 2px solid #B7C5D9;}.tomorrow .click-me { color: #C5C8C6; background-color: #282A2E; border: 2px solid #111;}.photon .click-me { color: #333; background-color: #ddd; border: 2px solid #ccc;}.click-me:before { content: ""; border-width: 0 6px 6px; border-style: solid; left: 50%; margin-left: -6px; position: absolute; width: 0; height: 0; top: -6px;}.yotsuba_new .click-me:before,.futaba_new .click-me:before { border-color: #D9BFB7 transparent;}.yotsuba_b_new .click-me:before,.burichan_new .click-me:before { border-color: #B7C5D9 transparent;}.tomorrow .click-me:before { border-color: #111 transparent;}.photon .click-me:before { border-color: #ccc transparent;}.click-me:after { content: ""; border-width: 0 4px 4px; top: -4px; display: block; left: 50%; margin-left: -4px; position: absolute; width: 0; height: 0;}.yotsuba_new .click-me:after,.futaba_new .click-me:after { border-color: #F0E0D6 transparent; border-style: solid;}.yotsuba_b_new .click-me:after,.burichan_new .click-me:after { border-color: #D6DAF0 transparent; border-style: solid;}.tomorrow .click-me:after { border-color: #282A2E transparent; border-style: solid;}.photon .click-me:after { border-color: #DDD transparent; border-style: solid;}#image-hover { position: fixed; max-width: 100%; max-height: 100%; top: 0px; right: 0px; z-index: 9002;}.thread-stats { float: right; margin-right: 5px; cursor: default;}.compact .thread { max-width: 75%;}.dotted { text-decoration: none; border-bottom: 1px dashed;}.linkfade { opacity: 0.5;}#quote-preview .linkfade { opacity: 1.0;}kbd { background-color: #f7f7f7; color: black; border: 1px solid #ccc; border-radius: 3px 3px 3px 3px; box-shadow: 0 1px 0 #ccc, 0 0 0 2px #fff inset; font-family: monospace; font-size: 11px; line-height: 1.4; padding: 0 5px;}.deleted { opacity: 0.66;}div.collapseWebm { text-align: center; margin-top: 10px; }.noPictures a.fileThumb img:not(.expanded-thumb) { opacity: 0;}.noPictures.futaba_new a.fileThumb,.noPictures.yotsuba_new a.fileThumb { border: 1px solid #800;}.noPictures.burichan_new a.fileThumb,.noPictures.yotsuba_b_new a.fileThumb { border: 1px solid #34345C;}.noPictures.tomorrow a.fileThumb:not(.expanded-thumb) { border: 1px solid #C5C8C6;}.noPictures.photon a.fileThumb:not(.expanded-thumb) { border: 1px solid #004A99;}.spinner { margin-top: 2px; padding: 3px; display: table;}#settings-presets { position: relative; top: -1px;}#colorpicker { position: fixed; text-align: center;}.colorbox { font-size: 10px; width: 16px; height: 16px; line-height: 17px; display: inline-block; text-align: center; background-color: #fff; border: 1px solid #aaa; text-decoration: none; color: #000; cursor: pointer; vertical-align: top;}#palette-custom-input { vertical-align: top; width: 45px; margin-right: 2px;}#qrDummyFile { float: left; margin-right: 5px; width: 220px; cursor: default; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;}#qrDummyFileLabel { margin-left: 3px;}.depageNumber { position: absolute; right: 5px;}.depagerEnabled .depagelink { font-weight: bold;}.depagerEnabled strong { font-weight: normal;}.depagelink { display: inline-block; padding: 4px 0; cursor: pointer; text-decoration: none;}.burichan_new .depagelink,.futaba_new .depagelink { text-decoration: underline;}#customMenuBox { margin: 0 auto 5px auto; width: 385px; display: block;}.preview-summary { display: block;}#swf-embed-header { padding: 0 0 0 3px; font-weight: normal; height: 20px; line-height: 20px;}.yotsuba_new #swf-embed-header,.yotsuba_b_new #swf-embed-header { height: 18px; line-height: 18px;}#swf-embed-close { position: absolute; right: 0; top: 1px;}#qr-painter-ctrl { text-align: center; }#qr-painter-ctrl label { margin-right: 4px; }.open-qr-wrap { text-align: center; width: 200px; position: absolute; margin-left: 50%; left: -100px;}.postMenuBtn { margin-left: 5px; text-decoration: none; line-height: 1em; display: inline-block; -webkit-transition: -webkit-transform 0.1s; -moz-transition: -moz-transform 0.1s; transition: transform 0.1s; width: 1em; height: 1em; text-align: center; outline: none; opacity: 0.8;}.postMenuBtn:hover{ opacity: 1;}.yotsuba_new .postMenuBtn,.futaba_new .postMenuBtn { color: #000080;}.tomorrow .postMenuBtn { color: #5F89AC;}.tomorrow .postMenuBtn:hover { color: #81a2be;}.photon .postMenuBtn { color: #FF6600;}.photon .postMenuBtn:hover { color: #FF3300;}.menuOpen { -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotate(90deg);}.settings-sub label:before { border-bottom: 1px solid; border-left: 1px solid; content: " "; display: inline-block; height: 8px; margin-bottom: 5px; width: 8px;}.settings-sub { margin-left: 25px;}.settings-tip.settings-sub { padding-left: 32px;}.centeredThreads .opContainer { display: block;}.centeredThreads .postContainer { margin: auto; width: 75%;}.centeredThreads .sideArrows { display: none;}.centre-exp { width: auto !important; clear: both;}.centeredThreads .summary { margin-left: 12.5%; display: block;}.centre-exp div.op{ display: table;}#yt-preview { position: absolute; }#yt-preview img { display: block; }.autohide-nav { transition: top 0.2s ease-in-out }#feedback { position: fixed; top: 10px; text-align: center; width: 100%; z-index: 9999;}.feedback-notify,.feedback-error { border-radius: 5px; cursor: pointer; color: #fff; padding: 3px 6px; font-size: 16px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); text-shadow: 0 1px rgba(0, 0, 0, 0.2);}.feedback-error { background-color: #C41E3A; }.feedback-notify { background-color: #00A550; }.boardSelect .custom-menu-ctrl, .boardSelect .customBoardList { margin-left: 10px; }.boardSelect .custom-menu-ctrl { display: none; }.boardSelect:hover .custom-menu-ctrl { display: inline; }.persistentNav .boardList a, .persistentNav .customBoardList a, #boardNavMobile .boardSelect a { text-decoration: none; }@media only screen and (max-width: 480px) {.thread-stats { float: none; text-align: center; }.ts-replies:before { content: "Replies: "; }.ts-images:before { content: "Images: "; }.ts-ips:before { content: "Posters: "; }.ts-page:before { content: "Page: "; }#threadWatcher { max-width: none; padding: 3px 0; left: 0; width: 100%; border-left: none; border-right: none;}#watchList { padding: 0 10px;}div.post div.postInfoM span.nameBlock { clear: none }.btn-row { margin-top: 5px;}.image-expanded .mFileName { display: block; margin-bottom: 2px;}.mFileName { display: none }.mobile-report { float: right; font-size: 11px; margin-bottom: 3px; margin-left: 10px;}.mobile-report:after { content: "]";}.mobile-report:before { content: "[";}.nws .mobile-report:after { color: #800000;}.nws .mobile-report:before { color: #800000;}.ws .mobile-report { color: #34345C;}.nws .mobile-report { color:#0000EE;}.reply .mobile-report { margin-right:5px;}.postLink .mobileHideButton { margin-right: 3px;}.board .mobile-hr-hidden { margin-top: 10px !important;}.board > .mobileHideButton { margin-top: -20px !important;}.board > .mobileHideButton:first-child { margin-top: 10px !important;}.extButton.threadHideButton { float: none; margin: 0; margin-bottom: 5px;}.mobile-post-hidden { display: none;}#toggleMsgBtn { display: none;}.mobile-tu-status { height: 20px; line-height: 20px;}.mobile-tu-show { width: 150px; margin: auto; display: block; text-align: center;}.button input { margin: 0 3px 0 0; position: relative; top: -2px; border-radius: 0; height: 10px; width: 10px;}.UIPanel > div { width: 320px; margin-left: -160px;}.UIPanel .export-field { width: 300px;}.yotsuba_new #quote-preview.highlight,#quote-preview { border-width: 1px !important;}.yotsuba_new #quote-preview.highlight { border-color: #D9BFB7 !important;}#quickReply input[type="text"],#quickReply textarea,.extPanel input[type="text"],.extPanel textarea { font-size: 16px;}#quickReply { position: absolute; left: 50%; margin-left: -154px;}.m-dark .button { background-color: rgb(27,28,30); background-image: url("//s.4cdn.org/image/buttonfade-dark.png"); background-repeat: repeat-x; border: 1px solid #282A2E;}.depaged-ad { margin-top: -25px; margin-bottom: -25px; }.depageNumber { font-size: 10px; margin-top: -21px; }.m-dark a, .m-dark div#absbot a { color: #81A2BE !important; }.m-dark a:hover { color: #5F89AC !important; }.m-dark .button a, .m-dark .button:hover, .m-dark .button { color: #707070 !important; }.m-dark #boardNavMobile { background-color: #1D1F21; border-bottom: 2px solid #282A2E; }body.m-dark { background: #1D1F21 none; color: #C5C8C6; }.m-dark #globalToggle { background-color: #FFADAD; background-image: url("//s.4cdn.org/image/buttonfade-red.png"); border: 1px solid #C45858; color: #880000 !important;}.m-dark .boardTitle { color: #C5C8C6; }.m-dark .mobile-report { color: #81a2be !important; }.m-dark .mobile-report:after,.m-dark .mobile-report:before { color: #1d1f21 !important; }.m-dark hr, .m-dark div.board > hr { border-top: 1px solid #282A2E; }.m-dark div.opContainer,.m-dark div.reply { background-color: #282A2E; }.m-dark .preview { background-color: #282A2E; border: 1px solid #333 !important; }.m-dark div.post div.postInfoM { background-color: #212326; border-bottom: 1px solid #2D2F33; }.m-dark div.postLink,.m-dark .backlink.mobile { background-color: #212326; border-top: 1px solid #2D2F33; }.m-dark div.post div.postInfoM span.dateTime,.m-dark div.postLink span.info,.m-dark div.post div.postInfoM span.dateTime a { color: #707070 !important; }.m-dark span.subject { color: #B294BB !important; }.m-dark .highlightPost:not(.op) { background: #3A171C !important; }.m-dark .reply:target, .m-dark .reply.highlight { background: #1D1D21 !important; padding: 2px; }.m-dark .reply:target, .m-dark .reply.highlight { background: #1D1D21 !important; padding: 2px; }}';(e=document.createElement("style")).setAttribute("type","text/css"),e.textContent=t,document.head.appendChild(e)},Main.init(); |