📄 function.js
字号:
/*
--------------------------
Copyright by T.muqiao(39号天堂桥)
本程序仅供学习讨论使用,在未通知作者作为任何商业用途
视为中华人民共和国不道德公民
联系方式:442536278@qq.com
-------------------------*/
//兼容microsoft的IE和mozilla的FireFox(2月5日搞定)
//*****************右键菜单******************/
//
var y = null;
var x = null;
var z = null;
var w = null;
var type = 0;
var path = ".";
var ID = null;
var menu = null;
var ns6=(document.getElementById&&!document.all);
var ie=(document.all);
if (ns6){
window.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP);
document.releaseEvents(Event.MOUSEMOVE);
}
if (ie||document.getElementById){
document.onmousedown = down;
}
if(ie||ns6){
document.oncontextmenu = oncontext;
}
if(ie){
document.onmouseup = microie;
}
if(ns6){
document.onmouseup = mozilla;
}
function oncontext(){
return false;
}
function setvars(n,value,Idvalue){
type = n;
path = value;
ID = Idvalue;
}
function start(obj){
if (ie||ns6){
z = document.getElementById(obj).style;
}
ID = null;
}
function down(e){
for(i=1;i<Elements;i++){
if(i==ID){
document.getElementById("element_"+i).className = 'selected';
}else{
document.getElementById("element_"+i).className = 'default';
}
}
document.onmousemove = move;
if (ie){
y=window.event.offsetY;
x=window.event.offsetX;
}
if (ns6){
x=e.clientX - parseInt(z.left);
y=e.clientY - parseInt(z.top);
}
return false;
}
function move(e){
if(z){
if (ns6){
z.top = parseInt(e.clientY)-y;
z.left = parseInt(e.clientX)-x;
}
if (ie){
z.posLeft = window.event.clientX-x;
z.posTop = window.event.clientY-y;
}
}
return false;
}
function microie(e){
if(z){
document.onmousemove=null;
}
if(ie){
menu = document.getElementById("rightmenu");
if(event.button==2){
makemenu();
var rightedge = document.body.clientWidth-event.clientX;
var bottomedge = document.body.clientHeight-event.clientY;
if (rightedge < menu.offsetWidth){
menu.style.left = document.body.scrollLeft + event.clientX - menu.offsetWidth;
}else{
menu.style.left = document.body.scrollLeft + event.clientX;
}
if (bottomedge < menu.offsetHeight){
menu.style.top = document.body.scrollTop + event.clientY - menu.offsetHeight;
}else{
menu.style.top = document.body.scrollTop + event.clientY;
}
menu.style.visibility = "visible";
return false;
}
if(event.button==1){
hidemenu();
}
}
}
function mozilla(e){
if(z){
document.onmousemove=null;
}
if(ns6){
menu = document.getElementById("rightmenu");
if(e.which==3){
makemenu();
var rightedge = document.body.clientWidth-parseInt(e.clientX);
var bottomedge = document.body.clientHeight-parseInt(e.clientY);
if (rightedge < menu.offsetWidth){
menu.style.left = document.body.scrollLeft + parseInt(e.clientX) - menu.offsetWidth;
}else{
menu.style.left = document.body.scrollLeft + parseInt(e.clientX);
}
if (bottomedge < menu.offsetHeight){
menu.style.top = document.body.scrollTop + parseInt(e.clientY) - menu.offsetHeight;
}else{
menu.style.top = document.body.scrollTop + parseInt(e.clientY);
}
menu.style.visibility = "visible";
}
if(e.which==1){
hidemenu();
}
}
return false;
}
function hidemenu() {
menu.style.visibility = "hidden";
}
//
//******************浮动窗口*******************/
//
function Tclose(obj){
document.getElementById(obj).innerHTML = '';
document.getElementById(obj).style.visibility = 'hidden';
z=null;
}
function newwindow(title,content){
var str = '<table style="border: 1px solid #000000;width:100%;height:100%;" cellpadding="0" cellspacing="0">'
+'<tr class="divheader">'
+'<td style="padding-left:5px;width:400px;color:#FFFFFF" onMouseUp="z=null;" onMouseMove="if(window.event.button==1){start(\'float\');}">'+title+'</td>'
+'<td width="41px" onclick="Tclose(\'float\')" title="'+T_lang[0]+'" class="slow" onMouseMove="if(window.event.button==0){this.className=\'light\';}" onMouseOut="this.className=\'slow\'"></td>'
+'</tr>'
+'<tr ><td colspan="2" style="background:#666666;"><center>'+content+'</center></td></tr></table>';
document.getElementById("float").innerHTML = str;
document.getElementById("float").style.visibility = 'visible';
}
function editwindow(filename,content){
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -