测试一下新功能,贴代码

<!--
*FCKeditor-Thetexteditorforinternet
*Copyright(C)2003-2005FredericoCaldeiraKnabben
*
*LicensedunderthetermsoftheGNULesserGeneralPublicLicense:
*http://www.opensource.org/licenses/lgpl-license.php
*
*Forfurtherinformationvisit:
*http://www.fckeditor.net/
*
*"SupportOpenSourcesoftware.Whataboutadonationtoday?"
*
*FileName:fckdialog.html
*Thispageisusedbyalldialogboxasthecontainer.
*
*FileAuthors:
*FredericoCaldeiraKnabben(fredck@fckeditor.net)
-->
<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.0Transitional//EN">
<html>
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/>
<metaname="robots"content="noindex,nofollow"/>
<scripttype="text/javascript">...

//OnsomeGeckobrowsers(probablyoverslowconnections)the
//
"dialogArguments"arenotsetsowemustgetitfromtheopenerwindow.
if(!window.dialogArguments)
window.dialogArguments
=window.opener.FCKLastDialogInfo;

//SetstheSkinCSS
document.write('<linkhref="'+window.dialogArguments.Editor.FCKConfig.SkinPath+'fck_dialog.css"type="text/css"rel="stylesheet">');

//Setsthelanguagedirection.
window.document.dir=window.dialogArguments.Editor.FCKLang.Dir;

varsTitle=window.dialogArguments.Title;
document.write(
'<title>'+sTitle+'</title>');

functionLoadInnerDialog()
...{
if(window.onresize)
window.onresize();

//Firstofall,translatethedialogboxcontents.
window.dialogArguments.Editor.FCKLanguageManager.TranslatePage(document);

window.frames[
"frmMain"].document.location.href=window.dialogArguments.Page;
}


functionInnerDialogLoaded()
...{
varoInnerDoc=document.getElementById('frmMain').contentWindow.document;

//Setthelanguagedirection.
oInnerDoc.dir=window.dialogArguments.Editor.FCKLang.Dir;

//SetstheSkinCSS.
oInnerDoc.write('<linkhref="'+window.dialogArguments.Editor.FCKConfig.SkinPath+'fck_dialog.css"type="text/css"rel="stylesheet">');

SetOnKeyDown(oInnerDoc);
DisableContextMenu(oInnerDoc);

returnwindow.dialogArguments.Editor;
}


functionSetOkButton(showIt)
...{
document.getElementById(
'btnOk').style.visibility=(showIt?'':'hidden');
}


varbAutoSize=false;

functionSetAutoSize(autoSize)
...{
bAutoSize
=autoSize;
RefreshSize();
}


functionRefreshSize()
...{
if(bAutoSize)
...{
varoInnerDoc=document.getElementById('frmMain').contentWindow.document;

variFrameHeight;
if(document.all)
iFrameHeight
=oInnerDoc.body.offsetHeight;
else
iFrameHeight
=document.getElementById('frmMain').contentWindow.innerHeight;

variInnerHeight=oInnerDoc.body.scrollHeight;

variDiff=iInnerHeight-iFrameHeight;

if(iDiff>0)
...{
if(document.all)
window.dialogHeight
=(parseInt(window.dialogHeight)+iDiff)+'px';
else
window.resizeBy(
0,iDiff);
}

}

}


functionOk()
...{
if(window.frames["frmMain"].Ok&&window.frames["frmMain"].Ok())
Cancel();
}


functionCancel()
...{
window.close();
}


//Objectthatholdsallavailabletabs.
varoTabs=newObject();

functionTabDiv_OnClick()
...{
SetSelectedTab(
this.TabCode);
}


functionAddTab(tabCode,tabText,startHidden)
...{
if(typeof(oTabs[tabCode])!='undefined')
return;

vareTabsRow=document.getElementById('Tabs');

varoCell=eTabsRow.insertCell(eTabsRow.cells.length-1);
oCell.noWrap
=true;

varoDiv=document.createElement('DIV');
oDiv.className
='PopupTab';
oDiv.innerHTML
=tabText;
oDiv.TabCode
=tabCode;
oDiv.onclick
=TabDiv_OnClick;

if(startHidden)
oDiv.style.display
='none';

eTabsRow
=document.getElementById('TabsRow');

oCell.appendChild(oDiv);

if(eTabsRow.style.display=='none')
...{
vareTitleArea=document.getElementById('TitleArea');
eTitleArea.className
='PopupTitle';

oDiv.className
='PopupTabSelected';
eTabsRow.style.display
='';

if(!window.dialogArguments.Editor.FCKBrowserInfo.IsIE)
window.onresize();
}


oTabs[tabCode]
=oDiv;
oTabs[tabCode].Index
=oTabs.length-1;
}


functionSetSelectedTab(tabCode)
...{
for(varsCodeinoTabs)
...{
if(sCode==tabCode)
oTabs[sCode].className
='PopupTabSelected';
else
oTabs[sCode].className
='PopupTab';
}


if(typeof(window.frames["frmMain"].OnDialogTabChange)=='function')
window.frames[
"frmMain"].OnDialogTabChange(tabCode);
}


functionSetTabVisibility(tabCode,isVisible)
...{
varoTab=oTabs[tabCode];
oTab.style.display
=isVisible?'':'none';

if(!isVisible&&oTab.className=='PopupTabSelected')
...{
for(varsCodeinoTabs)
...{
if(oTabs[sCode].style.display!='none')
...{
SetSelectedTab(sCode);
break;
}

}

}

}


functionSetOnKeyDown(targetDocument)
...{
targetDocument.onkeydown
=function(e)
...{
e
=e||event||this.parentWindow.event;
switch(e.keyCode)
...{
case13://ENTER
varoTarget=e.srcElement||e.target;
if(oTarget.tagName=='TEXTAREA')return;
Ok();
returnfalse;
case27://ESC
Cancel();
returnfalse;
break;
}

returntrue;
}

}

SetOnKeyDown(document);

functionDisableContextMenu(targetDocument)
...{
if(window.dialogArguments.Editor.FCKBrowserInfo.IsIE)return;

//DisableRight-Click
varoOnContextMenu=function(e)
...{
varsTagName=e.target.tagName;
if(!((sTagName=="INPUT"&&e.target.type=="text")||sTagName=="TEXTAREA"))
e.preventDefault();
}

targetDocument.addEventListener(
'contextmenu',oOnContextMenu,true);
}

DisableContextMenu(document);

if(!window.dialogArguments.Editor.FCKBrowserInfo.IsIE)
...{
window.onresize
=function()
...{
varoFrame=document.getElementById("frmMain");

if(!oFrame)
return;

oFrame.height
=0;

varoCell=document.getElementById("FrameCell");
variHeight=oCell.offsetHeight;

oFrame.height
=iHeight-2;
}

}


if(window.dialogArguments.Editor.FCKBrowserInfo.IsIE)
...{
functionWindow_OnBeforeUnload()
...{
for(vartinoTabs)
oTabs[t]
=null;

window.dialogArguments.Editor
=null;
}

window.attachEvent(
"onbeforeunload",Window_OnBeforeUnload);
}


</script>
</head>
<bodyonload="LoadInnerDialog();"class="PopupBody">
<tableheight="100%"cellspacing="0"cellpadding="0"width="100%"border="0">
<tr>
<tdid="TitleArea"class="PopupTitlePopupTitleBorder">
<scripttype="text/javascript">...
document.write(sTitle);
</script>
</td>
</tr>
<trid="TabsRow"style="DISPLAY:none">
<tdclass="PopupTabArea">
<tableborder="0"cellpadding="0"cellspacing="0"width="100%">
<trid="Tabs"onselectstart="returnfalse;">
<tdclass="PopupTabEmptyArea">&nbsp;</td>
<tdclass="PopupTabEmptyArea"width="100%">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<tdid="FrameCell"height="100%"valign="top">
<iframeid="frmMain"src="fckblank.html"name="frmMain"frameborder="0"height="100%"width="100%"scrolling="auto">
</iframe>
</td>
</tr>
<tr>
<tdclass="PopupButtons">
<tableborder="0"cellpadding="0"cellspacing="0">
<tr>
<tdwidth="100%">&nbsp;</td>
<tdnowrap="nowrap">
<inputid="btnOk"style="VISIBILITY:hidden;WIDTH:100px"type="button"value="Ok"class="Button"
onclick
="Ok();"fckLang="DlgBtnOK"/>&nbsp;<inputtype="button"value="Cancel"class="Button"onclick="Cancel();"fckLang="DlgBtnCancel"/>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值