?? main.js
字號:
function playAni(Paction,Ptype,Fname,W,H){
var ofW,ofH,isAni;
isAni=true;
var scrol="no";
ofW=0;ofH=0;
switch(Ptype){
case("Shi-Painter"):{ofW=1;ofH=25;break;}
case("Shi-PainterPro"):{ofW=1;ofH=25;break;}
case("spchUpload"):{ofW=1;ofH=25;break;}
case("PaintBBS"):{ofW=1;ofH=25;break;}
case("pchUpload"):{ofW=1;ofH=25;break;}
case("OekakiBBS"):{ofW=2;ofH=37;break;}
case("oebUpload"):{ofW=2;ofH=37;break;}
default :
{
isAni=false;
break;
}
}
if(isAni){
var moveleft=parseInt((screen.availWidth-W-ofW)/2);
var movetop=parseInt((screen.availHeight-H-ofH)/2);
if(moveleft<0)moveleft=0;
if(movetop<0)movetop=0;
var ww=(parseInt(W)+ofW);
var wh=(parseInt(H)+ofH);
if(ww>screen.availWidth-28){ww=screen.availWidth;scrol="yes";}
if(wh>screen.availHeight-30){ww+=18;wh=screen.availHeight-30;scrol="yes";}
window.open('/plus/NicePaint/playAni.asp?action='+Paction+'&PicWidth='+W+'&PicHeight='+H+'&thisfile='+Fname+'&PlayType='+Ptype,'rAniPlay','left='+moveleft+',top='+movetop+',width='+ww+',height='+wh+',toolbar=no, status=no, menubar=no, resizable=yes, scrollbars='+scrol,'bReplace=true');
}
}
function getPaintPic(picName){
document.write("<img src=/plus/NicePaint/picdata/"+picName+">");
}
function bbimg(o){
var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';
return false;
}
function openScript(url, width, height){
var Win = window.open(url,"openScript",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=yes,menubar=no,status=yes' );
}
function chkdiv(divid){
var chkid=document.getElementById(divid);
if(chkid != null){return true; }
else {return false; }
}
function getpara(){
var str,pos,parastr
str = window.location.href;
pos = str.indexOf("?");
parastr = str.substring(pos+1);
return parastr;
}
function oblog_ViewCode(rnum)
{
var bodyTag="<html><head><style type=text/css>.quote{margin:5px 20px;border:1px solid #CCCCCC;padding:5px; background:#F3F3F3 }\nbody{boder:0px}.HtmlCode{margin:5px 20px;border:1px solid #CCCCCC;padding:5px;background:#FDFDDF;font-size:14px;font-family:Tahoma;font-style : oblique;line-height : normal ;font-weight:bold;}\nbody{boder:0px}</style></head><BODY bgcolor=\"#FFFFFF\" >";
bodyTag+=document.getElementById('scode'+rnum).value
bodyTag+="</body></html>"
preWin=window.open('preview','','left=0,top=0,width=550,height=400,resizable=1,scrollbars=1, status=1, toolbar=1, menubar=0');
preWin.document.open();
preWin.document.write(bodyTag);
preWin.document.close();
preWin.document.title="查看代碼內容";
preWin.document.charset="UTF-8";
}
function dialog(blogurl){
var titile = '';
var width = 300;
var height = 150;
var src = "";
var path = blogurl+"images/dialog/";
//alert(path);
var sFunc = '<input id="dialogOk" type="button" style="font-size:12px;width:71px;height:22px;line-height:24px;border-style:none;background:transparent url('+path+'button4.bmp);width: 71px;height: 22px;" onmouseover=BtnOver(this,"'+path+'") onmouseout=BtnOut(this,"'+path+'") value="確 認" onclick="new dialog(\''+blogurl+'\').reset();" /> <input id="dialogCancel" type="button" style="font-size:12px;width:71px;height:22px;line-height:24px;border-style:none;background:transparent url('+path+'button4.bmp);width: 71px;height: 22px;" value="取 消" onclick="new dialog(\''+blogurl+'\').reset();" />';
var sClose = '<input type="image" title="關閉當前窗口" id="dialogBoxClose" onclick="new dialog(\''+blogurl+'\').reset();" src="' + path + 'dialogClose0.gif" border="0" width="16" height="16" onmouseover="this.src=\'' + path + 'dialogCloseF.gif\';" onmouseout="this.src=\'' + path + 'dialogClose0.gif\';" align="absmiddle" />';
var sBody = '\
<table id="dialogBodyBox" style="border:1px solid #54B1F7;border-top:0;background:url('+path+'sBody_bg.png) repeat-x left bottom;" border="0" align="center" cellpadding="0" cellspacing="0" width="100%" height="100%" >\
<tr height="10"><td colspan="4"></td></tr>\
<tr>\
<td width="10"></td>\
<td width="80" align="center" valign="middle" id="ob_boxface"><img id="dialogBoxFace" src="' + path + '1.png" valign="absmiddle" style="behavior:url('+path+'png.htc);" /></td>\
<td id="dialogMsg" style="font-size:12px;color:#000;"></td>\
<td width="10"></td>\
</tr>\
<tr height="10"><td colspan="4" align="center"></td></tr>\
<tr><td id="dialogFunc" colspan="4" align="center">' + sFunc + '</td></tr>\
<tr height="10"><td colspan="4" align="center"></td></tr>\
</table>\
';
var sBox = '\
<table id="dialogBox" width="' + width + '" border="0" cellpadding="0" cellspacing="0" style="border:1px solid #1F3F94;display:none;z-index:10;">\
<tr height="18" bgcolor="#1577D2" >\
<td style="border:1px solid #91DEFA;border-bottom:0;">\
<table onselectstart="return false;" style="-moz-user-select:none;background: url('+path+'win_top.png) repeat-x;" width="100%" border="0" cellpadding="0" cellspacing="0">\
<tr>\
<td width="6" ></td>\
<td id="dialogBoxTitle" onmousedown="new dialog().moveStart(event, \'dialogBox\')" style="color:#fff;cursor:move;font-size:12px;font-weight:bold;">提示信息</td>\
<td id="dialogClose" width="27" align="right" valign="middle">\
' + sClose + '\
</td>\
<td width="6"></td>\
</tr>\
</table>\
</td>\
</tr>\
<tr id="dialogHeight" height="' + height + '">\
<td id="dialogBody" style="background:#fff;color:#000;border:1px solid #91DEFA;border-top:0;">' + sBody + '</td>\
</tr>\
</table>\
<div id="dialogBoxShadow" style="display:none;z-index:9;"></div>\
<iframe id="dialogBoxDivShim" scrolling="no" frameborder="0" style="position:absolute;top:0px; left:0px;display:none">\
';
function $(_sId){return document.getElementById(_sId)}
this.show = function(){$('dialogBodyBox') ? function(){} : this.init();this.middle('dialogBox');this.shadow();}
this.reset = function(){$('dialogBox').style.display='none';$('dialogBoxShadow').style.display = "none";$('dialogBoxDivShim').style.display = "none";$('dialogBody').innerHTML = sBody;}
this.html = function(_sHtml){$("dialogBody").innerHTML = _sHtml;this.show();}
this.init = function(){
$('dialogCase') ? $('dialogCase').parentNode.removeChild($('dialogCase')) : function(){};
var oDiv = document.createElement('span');
oDiv.id = "dialogCase";
oDiv.innerHTML = sBox;
document.body.appendChild(oDiv);
}
this.button = function(_sId, _sFuc){
if($(_sId)){
$(_sId).style.display = '';
if($(_sId).addEventListener){
if($(_sId).act){$(_sId).removeEventListener('click', function(){eval($(_sId).act)}, false);}
$(_sId).act = _sFuc;
$(_sId).addEventListener('click', function(){eval(_sFuc)}, false);
}else{
if($(_sId).act){$(_sId).detachEvent('onclick', function(){eval($(_sId).act)});}
$(_sId).act = _sFuc;
$(_sId).attachEvent('onclick', function(){eval(_sFuc)});
}
}
}
this.shadow = function(){
var oShadow = $('dialogBoxShadow');
var oDialog = $('dialogBox');
var IfrRef = $('dialogBoxDivShim');
oShadow.style.position = "absolute";
oShadow.style.background = "#000";
oShadow.style.display = "";
oShadow.style.opacity = "0.2";
oShadow.style.filter = "alpha(opacity=0)";
oShadow.style.top = oDialog.offsetTop + 6+"px";
oShadow.style.left = oDialog.offsetLeft + 6+"px";
oShadow.style.width = oDialog.offsetWidth+"px";
oShadow.style.height = oDialog.offsetHeight+"px";
IfrRef.style.width = oDialog.offsetWidth+6+"px";
IfrRef.style.height = oDialog.offsetHeight+6+"px";
IfrRef.style.top = oDialog.offsetTop+"px";
IfrRef.style.left = oDialog.offsetLeft+"px";
//IfrRef.style.zIndex = DivRef.style.zIndex - 1;
IfrRef.style.display = "block";
}
this.open = function(_sUrl, _sMode){
this.show();
if(!_sMode || _sMode == "no" || _sMode == "yes"){
$("dialogBody").innerHTML = "<iframe id='dialogFrame' width='100%' height='100%' frameborder='0' scrolling='" + _sMode + "'></iframe>";
$("dialogFrame").src = _sUrl;
}
}
this.event = function(_sMsg, _sOk, _sCancel, _sClose){
$('dialogFunc').innerHTML = sFunc;
$('dialogClose').innerHTML = sClose;
$('dialogBodyBox') == null ? $('dialogBody').innerHTML = sBody : function(){};
$('dialogMsg') ? $('dialogMsg').innerHTML = _sMsg : function(){};
this.show();
_sOk ? this.button('dialogOk', _sOk) | $('dialogOk').focus() : $('dialogOk').style.display = 'none';
_sCancel ? this.button('dialogCancel', _sCancel) : $('dialogCancel').style.display = 'none';
_sClose ? this.button('dialogBoxClose', _sClose) : function(){};
//_sOk ? this.button('dialogOk', _sOk) : _sOk == "" ? function(){} : $('dialogOk').style.display = 'none';
//_sCancel ? this.button('dialogCancel', _sCancel) : _sCancel == "" ? function(){} : $('dialogCancel').style.display = 'none';
}
this.set = function(_oAttr, _sVal){
var oShadow = $('dialogBoxShadow');
var oDialog = $('dialogBox');
var oHeight = $('dialogHeight');
if(_sVal != ''){
switch(_oAttr){
case 'title':
$('dialogBoxTitle').innerHTML = _sVal;
title = _sVal;
break;
case 'width':
oDialog.style.width = _sVal;
width = _sVal;
break;
case 'height':
oHeight.style.height = _sVal;
height = _sVal;
break;
case 'src':
if(parseInt(_sVal) > 0){
$('dialogBoxFace') ? $('dialogBoxFace').src = path + _sVal + '.png' : function(){};
}else{
$('dialogBoxFace') ? $('dialogBoxFace').src = _sVal : function(){};
}
src = _sVal;
break;
}
}
this.middle('dialogBox');
oShadow.style.top = oDialog.offsetTop + 6+"px";
oShadow.style.left = oDialog.offsetLeft + 6+"px";
oShadow.style.width = oDialog.offsetWidth+"px";
oShadow.style.height = oDialog.offsetHeight+"px";
}
this.moveStart = function (event, _sId){
var oObj = $(_sId);
oObj.onmousemove = mousemove;
oObj.onmouseup = mouseup;
oObj.setCapture ? oObj.setCapture() : function(){};
oEvent = window.event ? window.event : event;
var dragData = {x : oEvent.clientX, y : oEvent.clientY};
var backData = {x : parseInt(oObj.style.top), y : parseInt(oObj.style.left)};
function mousemove(){
var oEvent = window.event ? window.event : event;
var iLeft = oEvent.clientX - dragData["x"] + parseInt(oObj.style.left);
var iTop = oEvent.clientY - dragData["y"] + parseInt(oObj.style.top);
oObj.style.left = iLeft+"px";
oObj.style.top = iTop+"px";
$('dialogBoxShadow').style.left = iLeft + 6+"px";
$('dialogBoxShadow').style.top = iTop + 6+"px";
$('dialogBoxDivShim').style.left = iLeft+"px";
$('dialogBoxDivShim').style.top = iTop +"px";
dragData = {x: oEvent.clientX, y: oEvent.clientY};
}
function mouseup(){
var oEvent = window.event ? window.event : event;
oObj.onmousemove = null;
oObj.onmouseup = null;
if(oEvent.clientX < 1 || oEvent.clientY < 1 || oEvent.clientX > document.body.clientWidth || oEvent.clientY > document.body.clientHeight){
oObj.style.left = backData.y +"px";
oObj.style.top = backData.x +"px";
$('dialogBoxShadow').style.left = backData.y + 6+"px";
$('dialogBoxShadow').style.top = backData.x + 6+"px";
$('dialogBoxDivShim').style.left = backData.y +"px";
$('dialogBoxDivShim').style.top = backData.x +"px";
}
oObj.releaseCapture ? oObj.releaseCapture() : function(){};
}
}
this.middle = function(_sId){
var theWidth;
var theHeight;
if (document.documentElement && document.documentElement.clientWidth) {
theWidth = document.documentElement.clientWidth+document.documentElement.scrollLeft*2;;
theHeight = document.documentElement.clientHeight+document.documentElement.scrollTop*2;;
} else if (document.body) {
theWidth = document.body.clientWidth;
theHeight = document.body.clientHeight;
}else if(window.innerWidth){
theWidth = window.innerWidth;
theHeight = window.innerHeight;
}
document.getElementById(_sId).style.display = '';
document.getElementById(_sId).style.position = "absolute";
document.getElementById(_sId).style.left = (theWidth / 2) - (document.getElementById(_sId).offsetWidth / 2)+"px";
//alert(in_ob_useradmin);
if(document.all||document.getElementById("user_page_top")){
document.getElementById(_sId).style.top = (theHeight / 2 + document.body.scrollTop) - (document.getElementById(_sId).offsetHeight / 2)+"px";
}else{
var sClientHeight = parent ? parent.document.body.clientHeight : document.body.clientHeight;
var sScrollTop = parent ? parent.document.body.scrollTop : document.body.scrollTop;
var sTop = -80 + (sClientHeight / 2 + sScrollTop) - (document.getElementById(_sId).offsetHeight / 2);
document.getElementById(_sId).style.top = sTop > 0 ? sTop : (sClientHeight / 2 + sScrollTop) - (document.getElementById(_sId).offsetHeight / 2)+"px";
//document.getElementById(_sId).style.top = (theHeight / 2 + document.body.scrollTop) - (document.getElementById(_sId).offsetHeight / 2)+"px";
}
}
}
BtnOver=function(obj,path){obj.style.backgroundImage = "url("+path+"button3.bmp)";}
BtnOut=function(obj,path){ obj.style.backgroundImage = "url("+path+"button4.bmp)";}
function oAjax( url ,callback)
{
try{
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -