pixmicat - Rev 311

Subversion Repositories:
Rev:
var preset_sensor=0;var previous_replyhlno=0;var msgs=['在沒有附加檔案的情況下,請寫入內文','附加檔案為系統不支援的格式','偵測到您有輸入櫻花日文假名的可能性,將自動為您轉換'];var arrtbl_1=[63223,12353,82],arrtbl_2=[63306,12449,85],arrtbl_3=[63486,12535,4],arrtbl_4=[[63216,63219],[12293,12540],1],arrtbl_5=[[63210,63212],[12541,12445],1];function $(i){return document.getElementById(i);}function l1(){var N=getCookie("namec"),E=getCookie("emailc"),obj;if((obj=$("fname"))){obj.value=N;}if((obj=$("femail"))){obj.value=E;}}function l2(){var P=getCookie("pwdc"),d=document,forms_length=d.forms.length;for(var i=0;i<forms_length;i++){if(d.forms[i].pwd){d.forms[i].pwd.value=P;}}}function getCookie(key){var tmp1,tmp2,xx1=0,xx2=0,xx3;tmp1=' '+document.cookie+';';var len=tmp1.length;while(xx1<len){xx2=tmp1.indexOf(';',xx1);tmp2=tmp1.substring(xx1+1,xx2);xx3=tmp2.indexOf('=');if(tmp2.substring(0,xx3)==key){return unescape(tmp2.substring(xx3+1,xx2-xx1-1));}xx1=xx2+1;}return'';}function setCookie(name,value){var exp=new Date();exp.setTime(exp.getTime()+1000*60*60*24*7);document.cookie=name+"="+escape(value)+"; expires="+exp.toGMTString();}function c(){try{if(!$("fupfile")){return true;}var upfilevalue=$("fupfile").value;if(!upfilevalue&&!$("fcom").value){alert(msgs[0]);return false;}if(upfilevalue){var ext_allowed=0,ext_length=ext.length;for(var j=0;j<ext_length;j++){if(upfilevalue.substr(upfilevalue.length-3,3).toUpperCase()==ext[j]){ext_allowed=1;break;}}if(!ext_allowed){alert(msgs[1]);return false;}}check_sakura('fcom');check_sakura('fname');check_sakura('fsub');if(window.clipboardData){document.forms[0].upfile_path.value=upfilevalue;}document.forms[0].sendbtn.disabled=true;}catch(e){}if($("fname").value){setCookie("namec",$("fname").value);}}function fixalllinks(){if(!document.getElementsByTagName){return;}var anchors=document.getElementsByTagName("a");var anchors_length=anchors.length;for(var i=0;i<anchors_length;i++){var anchor=anchors[i];if(anchor.getAttribute("href")&&anchor.getAttribute("rel")=="_blank"){anchor.target="_blank";}if(anchor.getAttribute("href")&&anchor.getAttribute("rel")=="_top"){anchor.target="_top";}}}function showform(){var d=document;d.getElementById("postform").className="";d.getElementById("postform_tbl").className="";d.getElementById("hide").className="show";d.getElementById("show").className="hide";}function hideform(){var d=document;d.getElementById("postform").className="hide_btn";d.getElementById("postform_tbl").className="hide";d.getElementById("hide").className="hide";d.getElementById("show").className="show";}function quote(text){try{$("fcom").focus();}catch(e){}$("fcom").value+='>>No.'+text+"\r\n";}function replyhl(id,isrecover){var rpydiv=$('r'+id);if(rpydiv){if(isrecover){rpydiv.className=rpydiv.className.replace(' reply_hl','');}else{if(previous_replyhlno){replyhl(previous_replyhlno,true);}previous_replyhlno=id;rpydiv.className+=' reply_hl';}}}function check_sakura(field){var tar_obj=$(field);var checktext=escape(tar_obj.value).toLowerCase();var regular_exp=/%uf(6[ef]|7[0-9a-f]|80)[0-9a-f]/;if(checktext.match(regular_exp)!==null){alert(msgs[2]);replace_sakura(tar_obj);}}function replace_sakura(tar_obj){var temp=tar_obj.value,i=0;for(i=0;i<=arrtbl_1[2];i++){temp=replaceDX(temp,arrtbl_1[0]+i,arrtbl_1[1]+i);}for(i=0;i<=arrtbl_2[2];i++){temp=replaceDX(temp,arrtbl_2[0]+i,arrtbl_2[1]+i);}for(i=0;i<=arrtbl_3[2];i++){temp=replaceDX(temp,arrtbl_3[0]+i,arrtbl_3[1]+i);}for(i=0;i<=arrtbl_4[2];i++){temp=replaceDX(temp,arrtbl_4[0][i],arrtbl_4[1][i]);}for(i=0;i<=arrtbl_5[2];i++){temp=replaceDX(temp,arrtbl_5[0][0]+i,arrtbl_5[1][0]+i);temp=replaceDX(temp,arrtbl_5[0][1]+i,arrtbl_5[1][1]+i);}tar_obj.value=temp;}function replaceDX(txt,target,retxt){if(txt.indexOf(String.fromCharCode(target))!=-1){txt=txt.split(String.fromCharCode(target));txt=txt.join(String.fromCharCode(retxt));}return txt;}function preset(){if(preset_sensor){return;}preset_sensor++;fixalllinks();var url=location.href;if(url.indexOf('?res=')){if(url.match(/#[rq]([0-9]+)$/)){replyhl(RegExp.$1);}if(url.match(/#q([0-9]+)$/)){quote(RegExp.$1);}}}window.onload=preset;