温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:达达ASP.NET简单新闻发布源码
当前文件路径:DaDaNews/fckeditor/editor/fckdialog.html

1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 2
<!-- 3
* FCKeditor - The text editor for Internet - http://www.fckeditor.net 4
* Copyright (C) 2003-2007 Frederico Caldeira Knabben 5
* 6
* == BEGIN LICENSE == 7
* 8
* Licensed under the terms of any of the following licenses at your 9
* choice: 10
* 11
* - GNU General Public License Version 2 or later (the "GPL") 12
* http://www.gnu.org/licenses/gpl.html 13
* 14
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL") 15
* http://www.gnu.org/licenses/lgpl.html 16
* 17
* - Mozilla Public License Version 1.1 or later (the "MPL") 18
* http://www.mozilla.org/MPL/MPL-1.1.html 19
* 20
* == END LICENSE == 21
* 22
* This page is used by all dialog box as the container. 23
--> 24
<html xmlns="http://www.w3.org/1999/xhtml"> 25
<head> 26
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 27
<meta name="robots" content="noindex, nofollow" /> 28
<script type="text/javascript"> 29
30
// On some Gecko browsers (probably over slow connections) the 31
// "dialogArguments" are not set so we must get it from the opener window. 32
if ( !window.dialogArguments ) 33
window.dialogArguments = window.opener.FCKLastDialogInfo ; 34
35
// Sets the Skin CSS 36
document.write( '<link href="' + window.dialogArguments.Editor.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ; 37
38
// Sets the language direction. 39
window.document.dir = window.dialogArguments.Editor.FCKLang.Dir ; 40
41
var sTitle = window.dialogArguments.Title ; 42
document.write( '<title>' + sTitle + '<\/title>' ) ; 43
44
function LoadInnerDialog() 45
{ 46
if ( window.onresize ) 47
window.onresize() ; 48
49
// First of all, translate the dialog box contents. 50
window.dialogArguments.Editor.FCKLanguageManager.TranslatePage( document ) ; 51
52
window.frames["frmMain"].document.location.href = window.dialogArguments.Page ; 53
} 54
55
function InnerDialogLoaded() 56
{ 57
var oInnerDoc = document.getElementById('frmMain').contentWindow.document ; 58
59
// Set the language direction. 60
oInnerDoc.dir = window.dialogArguments.Editor.FCKLang.Dir ; 61
62
// Sets the Skin CSS. 63
oInnerDoc.write( '<link href="' + window.dialogArguments.Editor.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ; 64
65
SetOnKeyDown( oInnerDoc ) ; 66
DisableContextMenu( oInnerDoc ) ; 67
68
return window.dialogArguments.Editor ; 69
} 70
71
function SetOkButton( showIt ) 72
{ 73
document.getElementById('btnOk').style.visibility = ( showIt ? '' : 'hidden' ) ; 74
} 75
76
var bAutoSize = false ; 77
78
function SetAutoSize( autoSize ) 79
{ 80
bAutoSize = autoSize ; 81
RefreshSize() ; 82
} 83
84
function RefreshSize() 85
{ 86
if ( bAutoSize ) 87
{ 88
var oInnerDoc = document.getElementById('frmMain').contentWindow.document ; 89
90
var iFrameHeight ; 91
if ( document.all ) 92
iFrameHeight = oInnerDoc.body.offsetHeight ; 93
else 94
iFrameHeight = document.getElementById('frmMain').contentWindow.innerHeight ; 95
96
var iInnerHeight = oInnerDoc.body.scrollHeight ; 97
98
var iDiff = iInnerHeight - iFrameHeight ; 99
100
if ( iDiff > 0 ) 101
{ 102
if ( document.all ) 103
window.dialogHeight = ( parseInt( window.dialogHeight, 10 ) + iDiff ) + 'px' ; 104
else 105
window.resizeBy( 0, iDiff ) ; 106
} 107
} 108
} 109
110
function Ok() 111
{ 112
if ( window.frames["frmMain"].Ok && window.frames["frmMain"].Ok() ) 113
Cancel() ; 114
} 115
116
function Cancel( dontFireChange ) 117
{ 118
if ( !dontFireChange ) 119
{ 120
// All dialog windows, by default, will fire the "OnSelectionChange" 121
// event, no matter the Ok or Cancel button has been pressed. 122
window.dialogArguments.Editor.FCK.Events.FireEvent( 'OnSelectionChange' ) ; 123
} 124
window.close() ; 125
} 126
127
// Object that holds all available tabs. 128
var oTabs = new Object() ; 129
130
function TabDiv_OnClick() 131
{ 132
SetSelectedTab( this.TabCode ) ; 133
} 134
135
function AddTab( tabCode, tabText, startHidden ) 136
{ 137
if ( typeof( oTabs[ tabCode ] ) != 'undefined' ) 138
return ; 139
140
var eTabsRow = document.getElementById( 'Tabs' ) ; 141
142
var oCell = eTabsRow.insertCell( eTabsRow.cells.length - 1 ) ; 143
oCell.noWrap = true ; 144
145
var oDiv = document.createElement( 'DIV' ) ; 146
oDiv.className = 'PopupTab' ; 147
oDiv.innerHTML = tabText ; 148
oDiv.TabCode = tabCode ; 149
oDiv.onclick = TabDiv_OnClick ; 150
151
if ( startHidden ) 152
oDiv.style.display = 'none' ; 153
154
eTabsRow = document.getElementById( 'TabsRow' ) ; 155
156
oCell.appendChild( oDiv ) ; 157
158
if ( eTabsRow.style.display == 'none' ) 159
{ 160
var eTitleArea = document.getElementById( 'TitleArea' ) ; 161
eTitleArea.className = 'PopupTitle' ; 162
163
oDiv.className = 'PopupTabSelected' ; 164
eTabsRow.style.display = '' ; 165
166
if ( ! window.dialogArguments.Editor.FCKBrowserInfo.IsIE ) 167
window.onresize() ; 168
} 169
170
oTabs[ tabCode ] = oDiv ; 171
} 172
173
function SetSelectedTab( tabCode ) 174
{ 175
for ( var sCode in oTabs ) 176
{ 177
if ( sCode == tabCode ) 178
oTabs[sCode].className = 'PopupTabSelected' ; 179
else 180
oTabs[sCode].className = 'PopupTab' ; 181
} 182
183
if ( typeof( window.frames["frmMain"].OnDialogTabChange ) == 'function' ) 184
window.frames["frmMain"].OnDialogTabChange( tabCode ) ; 185
} 186
187
function SetTabVisibility( tabCode, isVisible ) 188
{ 189
var oTab = oTabs[ tabCode ] ; 190
oTab.style.display = isVisible ? '' : 'none' ; 191
192
if ( ! isVisible && oTab.className == 'PopupTabSelected' ) 193
{ 194
for ( var sCode in oTabs ) 195
{ 196
if ( oTabs[sCode].style.display != 'none' ) 197
{ 198
SetSelectedTab( sCode ) ; 199
break ; 200
} 201
} 202
} 203
} 204
205
function SetOnKeyDown( targetDocument ) 206
{ 207
targetDocument.onkeydown = function ( e ) 208
{ 209
e = e || event || this.parentWindow.event ; 210
switch ( e.keyCode ) 211
{ 212
case 13 : // ENTER 213
var oTarget = e.srcElement || e.target ; 214
if ( oTarget.tagName == 'TEXTAREA' ) 215
return true ; 216
Ok() ; 217
return false ; 218
case 27 : // ESC 219
Cancel() ; 220
return false ; 221
break ; 222
} 223
return true ; 224
} 225
} 226
SetOnKeyDown( document ) ; 227
228
function DisableContextMenu( targetDocument ) 229
{ 230
if ( window.dialogArguments.Editor.FCKBrowserInfo.IsIE ) return ; 231
232
// Disable Right-Click 233
var oOnContextMenu = function( e ) 234
{ 235
var sTagName = e.target.tagName ; 236
if ( ! ( ( sTagName == "INPUT" && e.target.type == "text" ) || sTagName == "TEXTAREA" ) ) 237
e.preventDefault() ; 238
} 239
targetDocument.addEventListener( 'contextmenu', oOnContextMenu, true ) ; 240
} 241
DisableContextMenu( document ) ; 242
243
if ( ! window.dialogArguments.Editor.FCKBrowserInfo.IsIE ) 244
{ 245
window.onresize = function() 246
{ 247
var oFrame = document.getElementById("frmMain") ; 248
249
if ( ! oFrame ) 250
return ; 251
252
oFrame.height = 0 ; 253
254
var oCell = document.getElementById("FrameCell") ; 255
var iHeight = oCell.offsetHeight ; 256
257
oFrame.height = iHeight - 2 ; 258
} 259
} 260
261
if ( window.dialogArguments.Editor.FCKBrowserInfo.IsIE ) 262
{ 263
function Window_OnBeforeUnload() 264
{ 265
for ( var t in oTabs ) 266
oTabs[t] = null ; 267
268
window.dialogArguments.Editor = null ; 269
} 270
window.attachEvent( "onbeforeunload", Window_OnBeforeUnload ) ; 271
} 272
273
function Window_OnClose() 274





}