📄 my_functions.js
字号:
var IE = (document.all) ? 1 : 0;
var NS = (document.layers) ? 1 : 0;
// WINDOW STATUS FUNCTIONS
window.defaultStatus = "";
function winStatus( msg )
{
window.status = msg;
}
function goThere( node,loc ) {
//Only perform folder opening, don't close anything
if( parent.nav.indexOfEntries[node].isOpen == false )
parent.nav.clickOnNode(node);
window.location = loc;
}
function closeMe() {
//self.close();
parent.close();
}
function formSubmit() {
parent.frames[0].document.forms[0].submit();
}
function openerReload() {
if( parent.opener.name != null )
parent.opener.location.reload();
}
function r() {
self.setTimeout("rl()", 2000);
}
function rl(){
self.location.reload();
}
// NAV TREE FUNCTIONS
function navRefresh() {
top.nav.location.reload();
}
// STRING FUNCTIONS
function trim( str ) {
// Immediately return if no trimming is needed
if( (str.charAt(0) != ' ') && (str.charAt(str.length-1) != ' ') ) { return str; }
// Trim leading spaces
while( str.charAt(0) == ' ' ) {
str = '' + str.substring(1,str.length);
}
// Trim trailing spaces
while( str.charAt(str.length-1) == ' ' ) {
str = '' + str.substring(0,str.length-1);
}
return str;
}
function strReplace( entry, bad, good ) {
temp = "" + entry; // temporary holder
while( temp.indexOf(bad) > -1 ) {
pos= temp.indexOf( bad );
temp = "" + ( temp.substring(0, pos) + good +
temp.substring( (pos + bad.length), temp.length) );
}
return temp;
}
//Remove html Language mark such as "<" and ">"
function strRemoveHtml(strIn){
if (strIn == null ) return "";
temp = strIn ;
find1 = temp.indexOf("<") ;
while(find1 > -1){
find2 = temp.indexOf(">",find1 + 1);
if (find2 == -1) find2 = find1 ;
find2 = find2 + 1 ;
temp = temp.substring(0, find1) + temp.substring(find2,temp.length);
find1 = temp.indexOf("<") ;
}
return temp;
}
function openWindow(wurl,wname)
{
var wx=466;
var wy=400;
var x = window.screen.availWidth;
var y = window.screen.availHeight;
var wtop =(x-wx)/2-4;
var wleft =(y-wy)/2-14;
//alert(wtop);
//alert(wleft);
window.open(wurl,wname,'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width='+wx+',height='+wy+';,resizable=false');
}
function openClassWindow(wurl,wname)
{
var wx=290;
var wy=320;
var x = window.screen.availWidth;
var y = window.screen.availHeight;
var wtop =(x-wx)/2-4;
var wleft =(y-wy)/2-14;
//alert(wtop);
//alert(wleft);
window.open(wurl,wname,'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width='+wx+',height='+wy+';,resizable=false');
}
function CheckInputNo(inNoStr,noStr)
{
var resultStr = "";
if(noStr == "" || noStr == null)
{
return "";
}
var tmpArr=new Array();
tmpArr = noStr.split(",");
var inNo = "," + inNoStr + ",";
if(noStr.indexOf(",,") != -1)
{
resultStr = "输入不正确,存在多余的\",\"号,工号";
return resultStr;
}
if(noStr != "")
{
if(noStr.charAt(0) == ',' || noStr.charAt(noStr.length-1) == ',')
{
resultStr = "不正确,不能以\",\"号开始或结束,工号";
return resultStr;
}
}
for(var i=0; i<tmpArr.length;i++)
{
var tmpNo = "," + tmpArr[i] + ",";
if(inNo.indexOf(tmpNo) == -1)
{
if(resultStr == "")
{
resultStr = tmpArr[i];
}
else
{
resultStr = resultStr + "," + tmpArr[i];
}
}
}
return resultStr;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -