📄 js.js
字号:
//防止错误出现
function killErrors() {
return true;}
window.onerror = killErrors;
function Flash(Path,Width,Height,Transparent){
var Temp,T=""
Temp='<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="FlashH" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="'+Width+'" height="'+Height+'">'
Temp+='<param name="movie" value="'+Path+'"/>'
Temp+='<param name="quality" value="High"/>'
Temp+='<param name="scale" value="ExactFit"/>'
if (Transparent) {Temp+=' <param name="wmode" value="transparent"/>';T='wmode="transparent"'}
Temp+='<embed src="'+Path+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="FlashH" width="'+Width+'" height="'+Height+'" quality="High"'+T+' scale="ExactFit"/>'
Temp+='</object>'
document.getElementById("Flash").innerHTML=Temp
}
var MediaTemp=new Array()
function YCMS_DjShow(strType,strID,strURL,intWidth,intHeight)
{
var tmpstr
if (MediaTemp[strID]==undefined) MediaTemp[strID]=false; else MediaTemp[strID]=!MediaTemp[strID];
if(MediaTemp[strID]){
if ( document.all ) {
document.getElementById(strID).outerHTML = '<div id="'+strID+'"></div>'
}
else
{
document.getElementById(strID).innerHTML = ''
}
document.getElementById(strID+"_text").innerHTML="在线播放"
}else{
document.getElementById(strID+"_text").innerHTML="关闭在线播放"
switch(strType){
case "swf":tmpstr='<div style="height:6px;overflow:hidden"></div><object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+intWidth+'" height="'+intHeight+'"><param name="movie" value="'+strURL+'" /><param name="quality" value="high" /><param name="AllowScriptAccess" value="never" /><embed src="'+strURL+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+intWidth+'" height="'+intHeight+'" /></object>';break;
case "wma":tmpstr='<div style="height:6px;overflow:hidden"></div><object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" id="MediaPlayer" width="450" height="70"><param name=""howStatusBar" value="-1"><param name="AutoStart" value="False"><param name="Filename" value="'+strURL+'"></object>';break;
case "wmv":tmpstr='<div style="height:6px;overflow:hidden"></div><object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902" type="application/x-oleobject" standby="Loading..." width="'+intWidth+'" height="'+intHeight+'"><param name="FileName" VALUE="'+strURL+'" /><param name="ShowStatusBar" value="-1" /><param name="AutoStart" value="true" /><embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="'+strURL+'" autostart="true" width="'+intWidth+'" height="'+intHeight+'" /></object>';break;
case "rm":tmpstr='<div style="height:6px;overflow:hidden"></div><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="'+intWidth+'" height="'+intHeight+'"><param name="SRC" value="'+strURL+'" /><param name="CONTROLS" VALUE="ImageWindow" /><param name="CONSOLE" value="one" /><param name="AUTOSTART" value="true" /><embed src="'+strURL+'" nojava="true" controls="ImageWindow" console="one" width="'+intWidth+'" height="'+intHeight+'"></object><br/><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="'+intWidth+'" height="32" /><param name="CONTROLS" value="StatusBar" /><param name="AUTOSTART" value="true" /><param name="CONSOLE" value="one" /><embed src="'+strURL+'" nojava="true" controls="StatusBar" console="one" width="'+intWidth+'" height="24" /></object>'+'<br /><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="'+intWidth+'" height="32" /><param name="CONTROLS" value="ControlPanel" /><param name="AUTOSTART" value="true" /><param name="CONSOLE" value="one" /><embed src="'+strURL+'" nojava="true" controls="ControlPanel" console="one" width="'+intWidth+'" height="24" autostart="true" loop="false" /></object>';break;
case "qt":tmpstr='<div style="height:6px;overflow:hidden"></div><embed src="'+strURL+'" autoplay="true" loop="false" controller="true" playeveryframe="false" cache="false" scale="TOFIT" bgcolor="#000000" kioskmode="false" targetcache="false" pluginspage="http://www.apple.com/quicktime/" />';break;
}
document.getElementById(strID).innerHTML=tmpstr;
}
document.getElementById(strID+"_href").blur()
}
function display(objID)
{
if (document.getElementById(objID).style.display == "none") {
document.getElementById(objID).style.display = "";
}else{
document.getElementById(objID).style.display = "none";
}
}
function toTop()
{
var sr=document.getElementById("toTop").offsetTop;
for (var i=sr; i>1; i-=Math.ceil(i/6))
{
//window.scroll(0,i);
window.scrollTo(0,i);
}
window.scroll(0,0);
return false;
}
//缩放图片大小
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 ContentSize(size){var obj=document.getElementById("size");obj.style.fontSize=size+"px";}
function copyText(obj)
{
var rng = document.body.createTextRange();rng.moveToElementText(obj);rng.scrollIntoView();rng.select();rng.execCommand("Copy");rng.collapse(false);
}
//UBB使用
function bookcount(message,total,used,remain)
{
var max;
max = total.value;
if (message.value.length > max) {
message.value = message.value.substring(0,max);
used.value = max;
remain.value = 0;
alert("内容不能超过" +max+ "个字!");
}
else {
used.value = message.value.length;
remain.value = max - used.value;
}
}
function bookshowLen(obj){document.getElementById("wordsLen").value=obj.value.length;}
function bookcount(message,total,used,remain)
{
var max;
max = total.value;
if (message.value.length > max) {
message.value = message.value.substring(0,max);
used.value = max;
remain.value = 0;
alert("内容不能超过" +max+ "个字!");
}
else {
used.value = message.value.length;
remain.value = max - used.value;
}
}
function savecode(obj){
var winname=window.open('',obj,'');
winname.document.open("text/html", "replace");
winname.document.write(obj.value);
winname.document.execCommand('saveas','','YCMSCODE.html');
winname.close();
}
function runcode(ID)
{
var code=document.getElementById(ID).value;
if (code!=""){
var newwin=window.open('','','');
newwin.opener=null
newwin.document.write(code);
newwin.document.close();
}
}
function copycode(ID) {
if (document.all)
{
textRange = document.getElementById(ID).createTextRange();
textRange.execCommand("Copy");
}
else
{
alert("此功能只能在IE上有效")
}
}
var oTRG;
function calLeftBytes(oTA,oNum)
{
if(oTA.value.length > oNum)
alert("你输入的内容已超出允许范围,请适当删减或分多帖发布。");
else
alert("还可输入 " + (oNum - oTA.value.length) + " 个字符。");
}
function storeRng(oTA){
if(document.all){
if(oTRG = document.selection.createRange().duplicate())
{
return true;
}
}
}
function insertToRng(oTA,text,n){
var oRng=oTA.createTextRange();
if(oRng){
if(!oTRG){
oTRG=oRng;
oTRG.moveStart('character',oTRG.text.length);
oTRG.collapse(true);
oTRG.select();
}
if(n>0){
oTRG.text = text.substr(0,text.length-n) + oTRG.text + text.substr(text.length-n);
}
else{
oTRG.text = oTRG.text + text;
}
oTRG.moveStart('character',-n);
oTRG.collapse(true);
oTRG.select();
} else {
oTA.value += text;
}
}
function ubbAdd(str,n)
{
if(document.all && document.w && document.w.content){
insertToRng(document.w.content,str,n);
document.w.content.focus();
}else{
document.w.content.value += str;
document.w.content.focus();
}
}
//改变图片大小
function resizepic(thispic)
{if(thispic.width>700) thispic.width=700;}
//翻页
function showPageLink(sUrl,iPage,iCount){
var i;
i=Math.max(1,iPage-1);
document.write("<a href=\"" + sUrl + "1\" title='第 1 页'>首页</a> ");
document.write("<a href=\"" + sUrl + i + "\" title='上一页(第 " + i + " 页)'>上一页</a> ");
for(i=Math.max(1,iPage-5);i<iPage;i++){
document.write("<a href=\""+sUrl + i + "\" title='第 " + i + " 页'><b>"+i+"</b></a> ");
}
document.write("<font color='#ff3333'><b>" + iPage + "</b></font> ");
for(i=iPage+1;i<=Math.min(iCount,iPage+5);i++){
document.write("<a href=\""+sUrl + i + "\" title='第 " + i + " 页'><b>"+i+"</b></a> ");
}
i=Math.min(iCount,iPage+1);
if(iCount>iPage+5) document.write("<span style='font-size:8px;'>···</span> ");
document.write("<a href=\"" + sUrl + i + "\" title='下一页(第 " + i + " 页)'>下一页</a> ");
document.write("<a href=\"" + sUrl + iCount + "\" title='最后一页(第 " + iCount + " 页)'>尾页</a> ");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -