- Timestamp:
- 2007-12-15 19:44:28 (9 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/branches/features/floating_dialog/editor/fckdialog.html
r1210 r1213 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 2 <!-- 3 3 * FCKeditor - The text editor for Internet - http://www.fckeditor.net … … 27 27 <meta name="robots" content="noindex, nofollow" /> 28 28 <script type="text/javascript"> 29 29 30 // Get the dialog arguments and the dialog frame from parent window 31 var dialogFrame = window.frameElement ; 32 var args = window.dialogArguments = dialogFrame._DialogArguments ; 33 var editor = args.Editor ; 34 30 35 // Automatically detect the correct document.domain (#123). 31 36 (function() … … 38 43 try 39 44 { 40 var parentDomain = window.parent ? window.parent.document.domain : args.Editor.document.domain ;41 45 var parentDomain = window.parent ? window.parent.document.domain : editor.document.domain ; 46 42 47 if ( document.domain != parentDomain ) 43 48 document.domain = parentDomain ; … … 45 50 } 46 51 catch( e ) {} 47 52 48 53 // Remove a domain part: www.mytest.example.com => mytest.example.com => example.com ... 49 54 d = d.replace( /.*?(?:\.|$)/, '' ) ; … … 51 56 if ( d.length == 0 ) 52 57 break ; // It was not able to detect the domain. 53 58 54 59 document.domain = d ; 55 60 } 56 })() ; 57 58 // Get the dialog arguments and the dialog frame from parent window 59 var dialogId = document.location.href.match( /dialogId=([^&]*)(&|$)/ )[1] ; 60 window.dialogArguments = parent.FCKDialogArguments[dialogId] ; 61 var dialogFrame = parent.document.getElementById(dialogId) ; 62 var oEditor = window.dialogArguments.Editor ; 63 64 var args = window.dialogArguments ; 65 66 var FCKBrowserInfo = args.Editor.FCKBrowserInfo ; 67 var FCKConfig = args.Editor.FCKConfig ; 61 })() ; 62 63 var FCKBrowserInfo = editor.FCKBrowserInfo ; 64 var FCKConfig = editor.FCKConfig ; 68 65 69 66 // Sets the Skin CSS 70 67 document.write( '<link href="' + FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ; 71 document.write( '<link href="' + FCKConfig.SkinPath + 'fck_dialog_floating.css" type="text/css" rel="stylesheet">' ) ;72 68 73 69 // Sets the language direction. 74 window.document.dir = args.Editor.FCKLang.Dir ;70 window.document.dir = editor.FCKLang.Dir ; 75 71 76 72 if ( FCKBrowserInfo.IsIE ) … … 87 83 document.write( '<title>' + sTitle + '<\/title>' ) ; 88 84 89 90 85 function Init() 91 86 { … … 93 88 LoadInnerDialog() ; 94 89 ShowThrobberTimer = setTimeout( ShowThrobber, 5000 ) ; 90 95 91 var titleElement = document.getElementById( 'TitleArea' ) ; 96 titleElement.onmousedown = oEditor.FCKDialog._DragMouseDownHandler ;97 98 if ( oEditor.FCKBrowserInfo.IsIE )92 titleElement.onmousedown = editor.FCKDialog._DragMouseDownHandler ; 93 94 if ( FCKBrowserInfo.IsIE ) 99 95 titleElement.setAttribute( 'unselectable', 'on' ) ; 100 else if ( oEditor.FCKBrowserInfo.IsGecko )96 else if ( FCKBrowserInfo.IsGecko ) 101 97 titleElement.style.MozUserSelect = 'none' ; 102 else if ( oEditor.FCKBrowserInfo.IsSafari )98 else if ( FCKBrowserInfo.IsSafari ) 103 99 titleElement.style.KhtmlUserSelect = 'none' ; 104 100 else 105 101 titleElement.style.userSelect = 'none' ; 106 oEditor.FCKDialog.RegisterDragHandlers( window ) ;102 editor.FCKDialog.RegisterDragHandlers( window ) ; 107 103 } 108 104 … … 113 109 114 110 // First of all, translate the dialog box contents. 115 args.Editor.FCKLanguageManager.TranslatePage( document ) ;111 editor.FCKLanguageManager.TranslatePage( document ) ; 116 112 document.getElementById( 'FrameCell' ).innerHTML = '<iframe id="frmMain" src="' + args.Page + '" name="frmMain" frameborder="0" width="100%" scrolling="auto"></iframe>' ; 117 113 } … … 120 116 { 121 117 var throbberParent = document.getElementById( 'throbberBlock' ) ; 122 var frm = document.getElementById( 'frmMain' ) ; 123 var html = '<img src="%%" width="28" height="28" border="0" /> <br />Loading...'.replace( '%%', oEditor.FCKConfig.SkinPath + 'images/dialog.loading.gif' ) ;118 var frm = document.getElementById( 'frmMain' ) ; 119 var html = '<img src="%%" width="28" height="28" border="0" />'.replace( '%%', FCKConfig.SkinPath + 'images/loading.gif' ) ; 124 120 throbberParent.innerHTML = html ; 125 121 126 var frmCoords = oEditor.FCKTools.GetDocumentPosition( window, frm ) ;122 var frmCoords = editor.FCKTools.GetDocumentPosition( window, frm ) ; 127 123 var x = frmCoords.x + ( frm.offsetWidth - throbberParent.offsetWidth ) / 2 ; 128 124 var y = frmCoords.y + ( frm.offsetHeight - throbberParent.offsetHeight ) / 2 ; … … 145 141 { 146 142 HideThrobber() ; 143 147 144 var oInnerDoc = document.getElementById('frmMain').contentWindow.document ; 148 145 149 146 // Set the language direction. 150 oInnerDoc.dir = args.Editor.FCKLang.Dir ;147 oInnerDoc.dir = editor.FCKLang.Dir ; 151 148 152 149 // Sets the Skin CSS. 153 oInnerDoc.write( '<link href="' + args.Editor.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;150 oInnerDoc.write( '<link href="' + FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ; 154 151 155 152 SetOnKeyDown( oInnerDoc ) ; 156 153 DisableContextMenu( oInnerDoc ) ; 157 154 158 155 RefreshContainerSize(); 159 156 160 args.Editor.FCKDialog.RegisterDragHandlers( document.getElementById('frmMain').contentWindow ) ; 161 return args.Editor ; 162 } 163 157 editor.FCKDialog.RegisterDragHandlers( document.getElementById('frmMain').contentWindow ) ; 158 return editor ; 159 } 164 160 165 161 function SetOkButton( showIt ) … … 211 207 212 208 if ( iDiff > 0 ) 213 oEditor.FCKDialog.ResizeDialog( window.frameElement, dialogFrame.offsetWidth, dialogFrame.offsetHeight + iDiff ) ;209 editor.FCKDialog.ResizeDialog( window.frameElement, dialogFrame.offsetWidth, dialogFrame.offsetHeight + iDiff ) ; 214 210 } 215 211 RefreshContainerSize() ; 216 212 } 217 213 218 // Kludge for #1316: Safari seems to have a bug with the time when RefreshSize() is executed - it thinks frmMain's innerHeight 214 // Kludge for #1316: Safari seems to have a bug with the time when RefreshSize() is executed - it thinks frmMain's innerHeight 219 215 // is 0 if we query the value too soon after the page is loaded in some circumstances. 220 if ( args.Editor.FCKBrowserInfo.IsSafari )216 if ( FCKBrowserInfo.IsSafari ) 221 217 { 222 218 window.OriginalRefreshSize = RefreshSize ; … … 247 243 function CloseDialog( dontFireChange ) 248 244 { 249 if ( !dontFireChange && ! args.Editor.FCK.EditMode )245 if ( !dontFireChange && !editor.FCK.EditMode ) 250 246 { 251 247 // All dialog windows, by default, will fire the "OnSelectionChange" 252 248 // event, no matter the Ok or Cancel button has been pressed. 253 args.Editor.FCK.Events.FireEvent( 'OnSelectionChange' ) ;254 } 255 oEditor.FCKDialog.CloseDialog( window.frameElement ) ;249 editor.FCK.Events.FireEvent( 'OnSelectionChange' ) ; 250 } 251 editor.FCKDialog.CloseDialog( window.frameElement ) ; 256 252 } 257 253 … … 359 355 function DisableContextMenu( targetDocument ) 360 356 { 361 if ( args.Editor.FCKBrowserInfo.IsIE ) return ;357 if ( FCKBrowserInfo.IsIE ) return ; 362 358 363 359 // Disable Right-Click … … 377 373 } 378 374 379 if ( args.Editor.FCKBrowserInfo.IsIE )375 if ( FCKBrowserInfo.IsIE ) 380 376 { 381 377 function Window_OnBeforeUnload() … … 384 380 oTabs[t] = null ; 385 381 386 args.Editor = null ;382 editor = null ; 387 383 } 388 384 window.attachEvent( "onbeforeunload", Window_OnBeforeUnload ) ; … … 391 387 function Window_OnClose() 392 388 { 393 args.Editor.FCKFocusManager.Unlock() ;389 editor.FCKFocusManager.Unlock() ; 394 390 } 395 391 … … 406 402 <script type="text/javascript"> 407 403 document.write( sTitle ) ; 408 var closeImgHtml = '<img src="' + oEditor.FCKConfig.SkinPath + 'images/dialog.close.png' + '" id="closeButton" onclick="Cancel();" />' ;409 document.write( closeImgHtml ) ;410 404 </script> 405 <div id="closeButton" onclick="Cancel();"></div> 411 406 </td> 412 407 </tr> … … 433 428 <td nowrap="nowrap"> 434 429 <input id="btnOk" style="VISIBILITY: hidden;" type="button" value="Ok" class="Button" onclick="Ok();" fckLang="DlgBtnOK" /> 435 430 436 431 <input id="btnCancel" type="button" value="Cancel" class="Button" onclick="Cancel();" fckLang="DlgBtnCancel" /> 437 432 </td> … … 452 447 <div class="cover" id="cover" style="display:none"></div> 453 448 <div id="throbberBlock" style="position: absolute; z-index: 10; text-align: center; font-size: 9px;"></div> 449 <script type="text/javascript"> 450 // Set the class name for language direction. 451 document.body.className += ' ' + editor.FCKLang.Dir ; 452 453 var cover = document.getElementById( 'cover' ) ; 454 cover.style.backgroundColor = FCKConfig.BackgroundBlockerColor ; 455 editor.FCKDomTools.SetOpacity( cover, FCKConfig.BackgroundBlockerOpacity ) ; 456 </script> 454 457 </body> 455 458 </html>