?? dialog.js
字號:
// 載入頁面
function LoadInnerDialog()
{
if ( window.onresize )
window.onresize() ;
window.frames["frmMain"].document.location.href = window.dialogArguments.Page ;
document.getElementById("frmMain").onreadystatechange = function(){
if( this.readyState == "complete" && !this.__State){
this.__State = true;
SetAutoSize( true );
}
}
}
function SetOkButton( showIt )
{
document.getElementById('btnOk').style.visibility = ( showIt ? '' : 'hidden' ) ;
}
var bAutoSize = false ;
function SetAutoSize( autoSize )
{
bAutoSize = autoSize ;
RefreshSize() ;
}
function RefreshSize()
{
if ( bAutoSize )
{
var oInnerDoc = document.getElementById('frmMain').contentWindow.document ;
var iFrameHeight ;
if ( document.all )
iFrameHeight = oInnerDoc.body.offsetHeight ;
else
iFrameHeight = document.getElementById('frmMain').contentWindow.innerHeight ;
var iInnerHeight = oInnerDoc.body.scrollHeight ;
var iDiff = iInnerHeight - iFrameHeight ;
if ( iDiff > 0 )
{
if ( document.all )
window.dialogHeight = ( parseInt( window.dialogHeight ) + iDiff ) + 'px' ;
else
window.resizeBy( 0, iDiff ) ;
}
// winder 2006-5-15 增加 實際高度小于頁面大小
else{
if ( document.all )
window.dialogHeight = ( parseInt( window.dialogHeight ) + iDiff ) + 'px' ;
else
window.resizeBy( 0, iDiff ) ;
}
}
}
function Ok()
{
if ( window.frames["frmMain"].Ok && window.frames["frmMain"].Ok() )
Cancel() ;
}
function Cancel()
{
window.close() ;
}
// 選項卡對象
var oTabs = new Object() ;
function TabDiv_OnClick()
{
SetSelectedTab( this.TabCode ) ;
}
function AddTab( tabCode, tabText, startHidden )
{
if ( typeof( oTabs[ tabCode ] ) != 'undefined' )
return ;
var eTabsRow = document.getElementById( 'Tabs' ) ;
var oCell = eTabsRow.insertCell( eTabsRow.cells.length - 1 ) ;
oCell.noWrap = true ;
var oDiv = 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' )
{
var eTitleArea = 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 ;
}
function SetSelectedTab( tabCode )
{
for ( var sCode in oTabs )
{
if ( sCode == tabCode )
oTabs[sCode].className = 'PopupTabSelected' ;
else
oTabs[sCode].className = 'PopupTab' ;
}
if ( typeof( window.frames["frmMain"].OnDialogTabChange ) == 'function' )
window.frames["frmMain"].OnDialogTabChange( tabCode ) ;
}
function SetTabVisibility( tabCode, isVisible )
{
var oTab = oTabs[ tabCode ] ;
oTab.style.display = isVisible ? '' : 'none' ;
if ( ! isVisible && oTab.className == 'PopupTabSelected' )
{
for ( var sCode in oTabs )
{
if ( oTabs[sCode].style.display != 'none' )
{
SetSelectedTab( sCode ) ;
break ;
}
}
}
}
// 按鍵事件
function SetOnKeyDown( targetDocument )
{
targetDocument.onkeydown = function ( e )
{
e = e || event || this.parentWindow.event ;
switch ( e.keyCode )
{
case 13 : // ENTER
var oTarget = e.srcElement || e.target ;
if ( oTarget.tagName == 'TEXTAREA' ) return ;
Ok() ;
return false ;
case 27 : // ESC
Cancel() ;
return false ;
break ;
}
return true ;
}
}
function Window_OnBeforeUnload()
{
for ( var t in oTabs )
oTabs[t] = null ;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -