📄 global.js
字号:
var uagent = navigator.userAgent.toLowerCase();var is_safari = ( (uagent.indexOf('safari') != -1) || (navigator.vendor == "Apple Computer, Inc.") );var is_ie = ( (uagent.indexOf('msie') != -1) && (!is_opera) && (!is_safari) && (!is_webtv) );var is_ie4 = ( (is_ie) && (uagent.indexOf("msie 4.") != -1) );var is_moz = (navigator.product == 'Gecko');var is_ns = ( (uagent.indexOf('compatible') == -1) && (uagent.indexOf('mozilla') != -1) && (!is_opera) && (!is_webtv) && (!is_safari) );var is_ns4 = ( (is_ns) && (parseInt(navigator.appVersion) == 4) );var is_opera = (uagent.indexOf('opera') != -1);var is_kon = (uagent.indexOf('konqueror') != -1);var is_webtv = (uagent.indexOf('webtv') != -1);var is_win = ( (uagent.indexOf("win") != -1) || (uagent.indexOf("16bit") !=- 1) );var is_mac = ( (uagent.indexOf("mac") != -1) || (navigator.vendor == "Apple Computer, Inc.") );var ua_vers = parseInt(navigator.appVersion);function get_cookie( name ) { cname = cookie_id + name + '='; cpos = document.cookie.indexOf( cname ); if ( cpos != -1 ) { cstart = cpos + cname.length; cend = document.cookie.indexOf(";", cstart); if (cend == -1) { cend = document.cookie.length; } return unescape( document.cookie.substring(cstart, cend) ); } return null;}function set_cookie( name, value, cookiedate ) { expire = ""; domain = ""; path = "/"; if ( cookiedate ) { expire = "; expires=Wed, 1 Jan 2020 00:00:00 GMT"; } if ( cookie_domain ) { domain = '; domain=' + cookie_domain; } if ( cookie_path ) { path = cookie_path; } document.cookie = cookie_id + name + "=" + value + "; path=" + path + expire + domain + ';';}function multi_page_jump( url_bit, totalposts, perpage ) { pages = 1; cur_pp = current_page; curpage = 1; if ( totalposts % perpage == 0 ) { pages = totalposts / perpage; } else { pages = Math.ceil( totalposts / perpage ); } msg = showpage + pages; if ( cur_pp > 0 ) { curpage = cur_pp / perpage; curpage = curpage -1; } show_page = 1; if ( curpage < pages ) { show_page = curpage + 1; } if ( curpage >= pages ) { show_page = curpage - 1; } else { show_page = curpage + 1; } userPage = prompt( msg, show_page ); if ( userPage > 0 ) { if ( userPage < 1 ) { userPage = 1; } if ( userPage > pages ) { userPage = pages; } if ( userPage == 1 ) { start = 0; } else { start = (userPage - 1) * perpage; } window.location = url_bit + "&pp=" + start; }}function showHide(id1, id2) { if (id1 != '') toggleview(id1); if (id2 != '') toggleview(id2);}function my_getbyid(id) { itm = null; if (document.getElementById) { itm = document.getElementById(id); } else if (document.all) { itm = document.all[id]; } else if (document.layers) { itm = document.layers[id]; } return itm;}function toggleview(id) { if ( ! id ) return; if ( itm = my_getbyid(id) ) { if (itm.style.display == "none") { my_show_div(itm); } else { my_hide_div(itm); } }}function my_hide_div(id) { if ( ! id ) return; id.style.display = "none";}function my_show_div(id) { if ( ! id ) return; id.style.display = "";}function change_cell_color( id, cl ) { itm = my_getbyid(id); if ( itm ) { itm.className = cl; }}function PopUp(url, name, width,height,center,resize,scroll,posleft,postop) { showx = ""; showy = ""; if (posleft != 0) { X = posleft } if (postop != 0) { Y = postop } if (!scroll) { scroll = 1 } if (!resize) { resize = 1 } if ((parseInt (navigator.appVersion) >= 4 ) && (center)) { X = (screen.width - width ) / 2; Y = (screen.height - height) / 2; } if ( X > 0 ) { showx = ',left='+X; } if ( Y > 0 ) { showy = ',top='+Y; } if (scroll != 0) { scroll = 1 } var Win = window.open( url, name, 'width='+width+',height='+height+ showx + showy + ',resizable='+resize+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no');}function stacksize(thearray) { for (i = 0 ; i < thearray.length; i++ ) { if ( (thearray[i] == "") || (thearray[i] == null) || (thearray == 'undefined') ) return i; } return thearray.length;}function pushstack(thearray, newval) { arraysize = stacksize(thearray); thearray[arraysize] = newval;}function popstack(thearray) { arraysize = stacksize(thearray); theval = thearray[arraysize - 1]; delete thearray[arraysize - 1]; return theval;}function CheckAll(fmobj) { for (var i=0;i<fmobj.elements.length;i++) { var e = fmobj.elements[i]; if ((e.name != 'allbox') && (e.type=='checkbox') && (!e.disabled)) { e.checked = fmobj.allbox.checked; } }}function HighlightAll(str) { if (document.all){ var rng = document.body.createTextRange(); rng.moveToElementText(str); rng.scrollIntoView(); rng.select(); rng.execCommand("Copy"); rng.collapse(false); setTimeout("window.status=''",1800) }}function redirlocate(object) { if(object.options[object.selectedIndex].value != '') { window.location = (object.options[object.selectedIndex].value); }}function ctlent() { if(event.ctrlKey && window.event.keyCode == 13) { if(document.mxbform.submitform) { if(submit_form()) document.mxbform.submit(); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -