//--------------Information----------------------------------
//1.只适用于无验证码贴吧百度帖吧。
//2.使用期间,请勿关闭标签页或窗口。
//3.火狐浏览器,自行修改使用
//GUI
var insert=document.querySelector(".new_tiezi_tip");
var qrDiv=document.createElement("div");
var newDiv=document.createElement("div");
qrDiv.innerHTML='<div><b>快捷回复</b> <select id="caonima" style="width:530px" name="fuck">\
<option value="0" selected="selected"></option><option value="1"></option><option value="2" ></option>\
<option value="3"></option><option value="4"></option></option><option value="5"></option></option>\
<option value="6"></option></option><option value="7"></option></option><option value="8"></option></option>\
<option value="9"></option></select>\
<button id="qrBtn" style="float:right;margin-right:35px" type="button" >快捷回复</button></div>';
newDiv.innerHTML='<b>自动回复 </b><input id="reTxt" type="text" value="人工置顶" style="width:430px">\
频率:<input id="rate" value="60" type="text" name="firstname" style="width:32px">秒\
<button id="stBtn" style="color:red;display:none;float:right;margin-right:35px">停止回复</button>\
<button id="reBtn" style="float:right;margin-right:35px" type="button" >自动回复</button>';
insert.insertBefore(qrDiv,insert.firstChild);
insert.insertBefore(newDiv,insert.firstChild);
//addEventListener
var the_reBtn=document.querySelector("#reBtn");
the_reBtn.addEventListener("click",start);
var the_qrBtn=document.querySelector("#qrBtn");
the_qrBtn.addEventListener("click",qr_Post);
var the_stBtn=document.querySelector("#stBtn");
the_stBtn.addEventListener("click",stop);
var the_fuck=document.querySelector("#caonima");
the_fuck.addEventListener("change",qr_Post);
//--------------------缺省值-------------------------------------
GM_getValue("gmSwitch",0);
var the_reTxt=document.getElementById("reTxt");
the_reTxt.setAttribute("value",GM_getValue("replayTxt","人工置顶"));
var the_pinLv=document.getElementById("rate");
the_pinLv.setAttribute("value",GM_getValue("timeOut",60000)/1000);
//alert(the_pinLv.value);
var the_fuck=document.getElementById("caonima");
var quickRe = new Array()
quickRe[0] = "顶"
quickRe[1] = "挽"
quickRe[2] = "Mark"
quickRe[3] = "火前留名"
quickRe[4] = "笑而不语"
quickRe[5] = "瞎了我的狗眼"
quickRe[7] = "神马都是浮云"
quickRe[8] = "你知道得太多了"
quickRe[6] = "虽不明,但觉厉"
quickRe[9] = "楼主好人,http://tefee.net/"
for(var i=0;i<=9;i++){
the_fuck.options[i].text=GM_getValue("quickR_"+i,quickRe[i]);
}
function post(post_Data){
var the_Content=unsafeWindow.rich_postor._getData();
the_Content.content=post_Data;
unsafeWindow.PostHandler.post(unsafeWindow.rich_postor._option.url,the_Content,function(to_Post){unsafeWindow.rich_postor.showAddResult(to_Post)},function(to_Post){});
}
//Start
function start(){
the_reBtn.style.display="none";
the_stBtn.style.display="";
GM_setValue("gmSwitch",1);
var post_Vlue=the_reTxt.value;
GM_setValue("replayTxt",post_Vlue);
var theTime=document.getElementById("rate");
var time_Vlue=theTime.value*1000;
GM_setValue("timeOut",time_Vlue);
post(post_Vlue);
}
//Stop
function stop(){
GM_setValue("gmSwitch",0)
the_reBtn.style.display="";
the_stBtn.style.display="none";
window.location.reload();
}
//Quick
function qr_Post(){
var quick_Vlue=the_fuck.options[the_fuck.selectedIndex].text;
post(quick_Vlue);
}
//缺省60s
if(GM_getValue("gmSwitch")){
the_reBtn.style.display="none";
the_stBtn.style.display="";
window.setTimeout(function(){start()},GM_getValue("timeOut",60000));
}