// ==UserScript== // @name HackForums.net - MultiQuote // @namespace spafic/multiquote // @description Enables users to quote multiple posts at once, then incert them with a single click into their forum reply. // @author Spafic // @copyright Spafic 2012 (http://userscripts.org/users/Spafic) // @licence GNU General Public License // // @match *://*.hackforums.net/showthread.php* // @version 3.1.0 // // @icon http://cdn2.hackforums.net/uploads/ficons/hf-news.png // @icon64 http://cdn2.hackforums.net/uploads/ficons/hf-news.png // @history 1.0.0 - Script created // @history 1.1.0 - Fixed a few minor bugs // @history 2.0.0 - Recreated entire plugin to be compatible with other plugins // @history 3.0.0 - Recoded plugin from scratch as well as remove all reliance from the HackForums.net server. // @history 3.0.1 - Now cross-browser compatible // @history 3.0.2 - Compressed plugin // @history 3.0.3 - Fixed a small bug // @history 3.1.0 - Added support for classic view mode // @downloadURL none // ==/UserScript== (function(){var d,f,b,c,h,g,a,e,j,i;b=-1==document.body.innerHTML.indexOf(String.fromCharCode(60,33,45,45,32,101,110,100,58,32,112,111,115,116,98,105,116,95,99,108,97,115,115,105,99,32,45,45,62))?!1:!0;buttons=[];objshit={};e=d=a=0;if(!0==b){a=document.getElementById("posts");i=a.getElementsByClassName("bitButton");for(a=0;a-",this.title="Remove from quotes",c=this.getAttribute("mystuff"),var2_temp=document.createElement("div"),var2_temp.innerHTML=document.getElementById(c).innerHTML.toString().split(/<\/blockquote>/gim)[document.getElementById(c).innerHTML.split(/<\/blockquote>/gim).length-1],h=var2_temp.textContent.replace(/\t/gim,"").replace(/\n(.*?)\n/,"$1\n"),objshit[c]="[quote="+document.getElementById(c).parentNode.parentNode.parentNode.getElementsByClassName("post_author")[0].getElementsByTagName("a")[0].textContent+"]"+h+"[/quote]",h=c=""):(this.innerHTML="Q+",this.title="Add to quotes",c=this.getAttribute("mystuff"),delete objshit[c],c="")}),f[a].appendChild(b);else for(a=0;a-",this.title="Remove from quotes",c="pid_"+this.getAttribute("mystuff"),var2_temp=document.createElement("div"),var2_temp.innerHTML=document.getElementById(c).innerHTML.toString().split(/<\/blockquote>/gim)[document.getElementById(c).innerHTML.split(/<\/blockquote>/gim).length-1],h=var2_temp.textContent.replace(/\t/gim,"").replace(/\n(.*?)\n/,"$1\n"),objshit[c]="[quote="+document.getElementById(c).parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.getElementsByTagName("a")[1].textContent+"]"+h+"[/quote]",h=c=""):(this.innerHTML="Q+",this.title="Add to quotes",c=this.getAttribute("mystuff"),delete objshit[c],c="")}),buttons[a].appendChild(b);f=document.getElementById("quickreply_multiquote");f.setAttribute("style","display:block;width:100%;color:white;background-color:#333");f.innerHTML="";f.setAttribute("id","multiquotebar");a=document.createElement("a");a.innerHTML="Insert all quotes";a.setAttribute("class","bitButton");a.setAttribute("style","cursor:pointer");a.addEventListener("click",function(){for(j in objshit)document.getElementById("message").value=document.getElementById("message").value+"\n"+objshit[j]+"\n";objshit={};g=document.getElementsByClassName("multiquote_button");for(e=0;e+",g[e].title="Add to quotes";return!1});d=document.createElement("a");d.innerHTML="Clear all quotes";d.setAttribute("class","bitButton");d.setAttribute("style","cursor:pointer");d.addEventListener("click",function(){objshit={};g=document.getElementsByClassName("multiquote_button");for(e=0;e+",g[e].title="Add to quotes";return!1});f.appendChild(a);f.appendChild(d)})();