?? common.js
字號:
//$("#divAjaxComment"+i).fadeTo("normal", 1);
//$("#divAjaxComment"+i).show("slow");
if(strFormAction){
document.getElementById("frmSumbit").action=strFormAction;
}
$("#txaArticle").val("");
}
if(document.getElementById("inpVerify")){
$("#inpVerify").val("");
var objImageValid=$("img[@src^='"+str00+"function/c_validcode.asp?name=commentvalid']");
objImageValid.attr("src",str00+"function/c_validcode.asp?name=commentvalid"+"&random="+Math.random());
}
}
);
return false;
//ajax comment end
}
//*********************************************************
//*********************************************************
// 目的: 加載信息
// 輸入: 無
// 返回: 無
//*********************************************************
function LoadRememberInfo() {
var strName=GetCookie("inpName");
var strEmail=GetCookie("inpEmail");
var strHomePage=GetCookie("inpHomePage");
var bolRemember=GetCookie("chkRemember");
if(bolRemember=="true"){
if(strName){document.getElementById("inpName").value=strName;};
if(strEmail){document.getElementById("inpEmail").value=strEmail;};
if(strHomePage){document.getElementById("inpHomePage").value=strHomePage;};
if(bolRemember){document.getElementById("chkRemember").checked=bolRemember;};
}
if(GetCookie("username")){
document.getElementById("inpName").value=unescape(GetCookie("username"));
}
}
//*********************************************************
//*********************************************************
// 目的: 保存信息
// 輸入: 無
// 返回: 無
//*********************************************************
function SaveRememberInfo() {
var strName=document.getElementById("inpName").value;
var strEmail=document.getElementById("inpEmail").value;
var strHomePage=document.getElementById("inpHomePage").value;
var bolRemember=document.getElementById("chkRemember").checked;
SetCookie("inpName",strName,365);
SetCookie("inpEmail",strEmail,365);
SetCookie("inpHomePage",strHomePage,365);
SetCookie("chkRemember",bolRemember,365);
}
//*********************************************************
//*********************************************************
// 目的: 輸出UBB
// 輸入: 無
// 返回: 無
//*********************************************************
function ExportUbbFrame() {
if(!objActive){objActive="txaArticle"};
document.write("<p id=\"UbbFrame\" style=\"display:none;\"></p>");
document.write("<p>");
document.write("<a alt=\"\" onmousedown=\"InsertText(objActive,ReplaceText(objActive,'[URL]','[/URL]'),true);\" style=\"padding:2px;cursor:pointer;\">[URL]</a> ");
document.write("<a alt=\"\" onmousedown=\"InsertText(objActive,ReplaceText(objActive,'[URL=http://]','[/URL]'),true);\" style=\"padding:2px;cursor:pointer;\">[URL2]</a> ");
document.write("<a alt=\"\" onmousedown=\"InsertText(objActive,ReplaceText(objActive,'[EMAIL]','[/EMAIL]'),true);\" style=\"padding:2px;cursor:pointer;\">[EMAIL]</a> ");
document.write("<a alt=\"\" onmousedown=\"InsertText(objActive,ReplaceText(objActive,'[EMAIL=@]','[/EMAIL]'),true);\" style=\"padding:2px;cursor:pointer;\">[EMAIL2]</a> ");
document.write("<a alt=\"\" onmousedown=\"InsertText(objActive,ReplaceText(objActive,'[B]','[/B]'),true);\" style=\"padding:2px;cursor:pointer;\">[B]</a> ");
document.write("<a alt=\"\" onmousedown=\"InsertText(objActive,ReplaceText(objActive,'[I]','[/I]'),true);\" style=\"padding:2px;cursor:pointer;\">[I]</a> ");
document.write("<a alt=\"\" onmousedown=\"InsertText(objActive,ReplaceText(objActive,'[U]','[/U]'),true);\" style=\"padding:2px;cursor:pointer;\">[U]</a> ");
document.write("<a alt=\"\" onmousedown=\"InsertText(objActive,ReplaceText(objActive,'[S]','[/S]'),true);\" style=\"padding:2px;cursor:pointer;\">[S]</a> ");
document.write("<a alt=\"\" onmousedown=\"InsertText(objActive,ReplaceText(objActive,'[QUOTE]','[/QUOTE]'),true);\" style=\"padding:2px;cursor:pointer;\">[QUOTE]</a> ");
document.write("<u><a style=\"cursor:pointer;text-align:right;\" onclick=\"InsertUbbFace();if(document.getElementById('UbbFrame').style.display=='none'){document.getElementById('UbbFrame').style.display='block';}else{document.getElementById('UbbFrame').style.display='none'};this.style.display='none'\">"+str06+"</a></u> ");
document.write("</p>");
}
//*********************************************************
//*********************************************************
// 目的: 插入表情圖片HTML代碼
// 輸入: 無
// 返回: 無
//*********************************************************
function InsertUbbFace() {
if(!document.getElementById("UbbFrame").innerHTML && strFaceName){
var aryFileName="";
var strFileName="";
var strFaceHtml="";
aryFileName = strFaceName.split("|");
for (var i=0;i<aryFileName.length;i++)
{
strFileName = aryFileName[i];
strFaceHtml=strFaceHtml + "<img src=\""+str00+"image/face/"+strFileName+".gif\" title=\""+strFileName+"\" alt=\""+strFileName+"\" width=\""+strFaceSize+"\" height=\""+strFaceSize+"\" onclick=\"InsertText(objActive,'[F]'+this.alt+'[/F]',false);\" style=\"padding:2px;cursor:pointer;\">";
}
document.getElementById("UbbFrame").innerHTML=strFaceHtml;
}
}
//*********************************************************
//*********************************************************
// 目的: 自動插入并替換
// 輸入: 無
// 返回: 無
//*********************************************************
var objActive;
function GetActiveText(objHTML) {
objActive=objHTML;
if(document.selection){
var obj=document.getElementById(objHTML);
obj.currPos = document.selection.createRange().duplicate();
}
}
function InsertText(objHTML,strText,bolReplace) {
if(strText==""){return("")}
var obj=document.getElementById(objHTML);
if(document.selection){
if (obj.currPos){
if(bolReplace && (obj.value=="")){
obj.currPos.text=strText;
}
else{
obj.currPos.text+=strText;
}
}
else{
obj.value+=strText;
}
}
else{
if(bolReplace){
obj.value=obj.value.slice(0,obj.selectionStart) + strText + obj.value.slice(obj.selectionEnd,obj.value.length);
}
else{
obj.value=obj.value.slice(0,obj.selectionStart) + strText + obj.value.slice(obj.selectionStart,obj.value.length);
}
}
//obj.focus();
}
function ReplaceText(objHTML,strPrevious,strNext) {
var obj=document.getElementById(objHTML);
var strText;
if(document.selection && document.selection.type == "Text"){
if (obj.currPos){
var range = document.selection.createRange();
range.text = strPrevious + range.text + strNext;
return("");
}
else{
strText=strPrevious + strNext;
return(strText);
}
}
else{
if(obj.selectionStart || obj.selectionEnd){
strText=strPrevious + obj.value.slice(obj.selectionStart,obj.selectionEnd) + strNext;
return(strText);
}
else{
strText=strPrevious + strNext;
return(strText);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -