?? global.js
字號:
function imgzoom(o)
{
if(event.ctrlKey)
{
var zoom = parseInt(o.style.zoom, 10) || 100;
zoom -= event.wheelDelta / 12;
if(zoom > 0)
{
o.style.zoom = zoom + '%';
}
return false;
}
else
{
return true;
}
}
function CheckTablesParent(e)
{
//2005-10-24 by 武眉博,huobazi 防止table把文章內容頁面撐大
//但是要保證其他部分的table不受影響。
if(e.parentElement.id == ''||e.parentElement.id == null)
{
return false;
}
if(e.parentElement.id == 'content')
{
return true;
}
else
{
obj = e.parentElement;
CheckTablesParent(obj);
}
}
function Init()
{
//定義最大寬度
var maxWidth = 550;
var maxHeight = 350;
//2005-10-24 by 武眉博,huobazi 防止圖片把文章內容頁面撐大
//如增加了廣告代碼需要做類似table那樣的調整。
var imgs = document.getElementById("content").getElementsByTagName("img");
for(var i=0; i<imgs.length; i++)
{
var img = imgs[i];
if (img.width > maxWidth)
{
img.width = maxWidth;
if (img.parentElement.tagName != "A")
{
img.onclick = function(){window.open(this.src)}
img.style.cursor = "pointer";
img.style.cursor = "hand";
//img.onmousewheel=function(){imgzoom(this);}
//img.alt="點擊看大圖,或按住Ctrl鍵滾動鼠標滾輪放大或者縮小";
img.alt=">>-請點擊鼠標查看大圖-<<";
}
}
}
//2005-10-24 by 武眉博,huobazi 防止table把文章內容頁面撐大
var tables = document.getElementById("content").getElementsByTagName("table");
for(var i=0; i<tables.length; i++)
{
var table = tables[i];
if (table.offsetWidth > maxWidth && CheckTablesParent(table))
{
table.style.width = maxWidth;
}
}
}
//運行代碼
function runEx(cod1) {
cod=document.getElementById(cod1)
var code=cod.value;
if (code!=""){
var newwin=window.open('','','');
newwin.opener = null
newwin.document.write(code);
newwin.document.close();
}
}
//復制代碼
function doCopy(ID) {
if (document.all){
textRange = document.getElementById(ID).createTextRange();
textRange.execCommand("Copy");
}
else{
alert("此功能只能在IE上有效")
}
}
self.moveTo(0,0);
self.resizeTo(screen.availWidth,screen.availHeight);
window.status="歡迎訪問DotNet男孩社區,希望本站收集的資料對您有用!";
window.onload = Init;
/******************************************************************************
Crossday Discuz! Board - Common Modules for Discuz!
Modified by: Crossday Studio (http://crossday.com)
Based upon: http://www.cnzzz.com
*******************************************************************************/
var sPop = null;
var postSubmited = false;
function ctlent(obj) {
if (navigator.userAgent.indexOf('MSIE') > 0) {
if (obj.keyCode == 9) {
obj.returnValue = false;
var sel = document.selection.createRange();
sel.text = '\t';
sel.select();
}
}
if(postSubmited == false && (obj.ctrlKey && obj.keyCode == 13) || (obj.altKey && obj.keyCode == 83)) {
var Input = document.getElementsByName('input')[0];
if(Input.pmsubmit) {
postSubmited = true;
Input.pmsubmit.disabled = true;
Input.submit();
} else if(validate(Input)) {
postSubmited = true;
if(Input.topicsubmit) Input.topicsubmit.disabled = true;
if(Input.replysubmit) Input.replysubmit.disabled = true;
if(Input.editsubmit) Input.editsubmit.disabled = true;
Input.submit();
}
}
}
function checkall(form, prefix) {
for(var i = 0; i < form.elements.length; i++) {
var e = form.elements[i];
if(e.name != 'chkall' && (!prefix || (prefix && e.name.match(prefix)))) {
e.checked = form.chkall.checked;
}
}
}
function findobj(n, d) {
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0 && parent.frames.length) {
d=parent.frames[n.substring(p+1)].document;
n=n.substring(0,p);
}
if(!(x=d[n])&&d.all) x=d.all[n];
for(i=0;!x && i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x && d.layers&&i>d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
return x;
}
function copyCode(obj) {
var rng = document.body.createTextRange();
rng.moveToElementText(obj);
rng.scrollIntoView();
rng.select();
rng.execCommand("Copy");
rng.collapse(false);
}
function runCode(obj) {
var winname = window.open('', "_blank", '');
winname.document.open('text/html', 'replace');
winname.document.writeln(obj.value);
winname.document.close();
}
function saveCode(obj) {
var winname = window.open('', '_blank', 'top=10000');
winname.document.open('text/html', 'replace');
winname.document.writeln(obj.value);
winname.document.execCommand('saveas','','code.htm');
winname.close();
}
function dzconfirm(theURL, ConfirmMsg) {
if (confirm( ConfirmMsg )) {
window.location.href=theURL;
} else {
return;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -