Changeset 1213
- Timestamp:
- 2007-12-15 19:44:28 (7 months ago)
- Location:
- FCKeditor/branches/features/floating_dialog
- Files:
-
- 3 added
- 7 removed
- 7 modified
-
editor/fckdialog.html (modified) (19 diffs)
-
editor/skins/default/fck_dialog.css (modified) (5 diffs)
-
editor/skins/default/fck_dialog_floating.css (deleted)
-
editor/skins/default/fck_dialog_ie6.js (modified) (1 diff)
-
editor/skins/default/images/dialog.close.png (deleted)
-
editor/skins/default/images/dialog.loading.gif (deleted)
-
editor/skins/default/images/dialog.shadow.xcf (deleted)
-
editor/skins/default/images/dialog.sprites.gif (deleted)
-
editor/skins/default/images/dialog.sprites.png (deleted)
-
editor/skins/default/images/loading.gif (added)
-
editor/skins/default/images/sprites.gif (added)
-
editor/skins/default/images/sprites.png (added)
-
editor/skins/default/images/WindowCover.png (deleted)
-
editor/_source/internals/fckdialog.js (modified) (6 diffs)
-
editor/_source/internals/fckdomtools.js (modified) (1 diff)
-
editor/_source/internals/fcktools.js (modified) (1 diff)
-
fckconfig.js (modified) (1 diff)
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> -
FCKeditor/branches/features/floating_dialog/editor/skins/default/fck_dialog.css
r1207 r1213 22 22 */ 23 23 24 html, body 25 { 26 background-color: transparent; 27 margin: 0px; 28 padding: 0px; 29 } 30 24 31 body 25 32 { 26 margin: 0px;27 33 padding: 10px; 28 34 } … … 37 43 { 38 44 background-color: #f1f1e3; 45 } 46 47 .DialogBody 48 { 49 height: 100%; 50 width: 100%; 51 overflow: hidden; 52 background-color: transparent; 53 padding: 0px; 39 54 } 40 55 … … 95 110 .DialogTabEmptyArea 96 111 { 97 padding-left: 10px ;112 padding-left: 10px; 98 113 border-bottom: #d5d59d 1px solid; 99 114 } … … 118 133 .DialogTabSelected 119 134 { 120 font-weight: bold;135 font-weight: bold; 121 136 cursor: default; 122 137 padding-top: 4px; … … 133 148 } 134 149 135 #tdBrowse 150 #tdBrowse 136 151 { 137 152 vertical-align: bottom; 138 153 } 139 154 155 /** 156 * Dialog frame related styles. 157 */ 158 159 .contents 160 { 161 position: absolute; 162 top: 2px; 163 left: 16px; 164 right: 16px; 165 bottom: 20px; 166 background-color: #e3e3c7; 167 overflow: hidden; 168 z-index: 1; 169 } 170 171 .tl, .tr, .tc, .bl, .br, .bc 172 { 173 position: absolute; 174 background-image: url(images/sprites.png); 175 background-repeat: no-repeat; 176 } 177 178 * html .tl, * html .tr, * html .tc, * html .bl, * html .br, * html .bc 179 { 180 background-image: url(images/sprites.gif); 181 } 182 183 .ml, .mr 184 { 185 position: absolute; 186 background-image: url(images/dialog.sides.png); 187 background-repeat: repeat-y; 188 } 189 190 * html .ml, * html .mr 191 { 192 background-image: url(images/dialog.sides.gif); 193 } 194 195 .rtl .ml, .rtl .mr 196 { 197 position: absolute; 198 background-image: url(images/dialog.sides.rtl.png); 199 background-repeat: repeat-y; 200 } 201 202 * html .rtl .ml, * html .rtl .mr 203 { 204 background-image: url(images/dialog.sides.gif); 205 } 206 207 .tl 208 { 209 top: 0px; 210 left: 0px; 211 width: 16px; 212 height: 16px; 213 background-position: -16px -16px; 214 } 215 216 .rtl .tl 217 { 218 background-position: -16px -397px; 219 } 220 221 .tr 222 { 223 top: 0px; 224 right: 0px; 225 width: 16px; 226 height: 16px; 227 background-position: -16px -76px; 228 } 229 230 .rtl .tr 231 { 232 background-position: -16px -457px; 233 } 234 235 .tc 236 { 237 top: 0px; 238 right: 16px; 239 left: 16px; 240 height: 16px; 241 background-position: 0px -136px; 242 background-repeat: repeat-x; 243 } 244 245 .ml 246 { 247 top: 16px; 248 left: 0px; 249 width: 16px; 250 bottom: 51px; 251 background-position: 0px 0px; 252 } 253 254 .mr 255 { 256 top: 16px; 257 right: 0px; 258 width: 16px; 259 bottom: 51px; 260 background-position: -16px 0px; 261 } 262 263 .bl 264 { 265 bottom: 0px; 266 left: 0px; 267 width: 30px; 268 height: 51px; 269 background-position: -16px -196px; 270 } 271 272 .rtl .bl 273 { 274 background-position: -16px -517px; 275 } 276 277 .br 278 { 279 bottom: 0px; 280 right: 0px; 281 width: 30px; 282 height: 51px; 283 background-position: -16px -263px; 284 } 285 286 .rtl .br 287 { 288 background-position: -16px -584px; 289 } 290 291 .bc 292 { 293 bottom: 0px; 294 right: 30px; 295 left: 30px; 296 height: 51px; 297 background-position: 0px -330px; 298 background-repeat: repeat-x; 299 } 300 301 /* For IE6. Do not change it. */ 302 * html .blocker 303 { 304 position: absolute; 305 width: 100%; 306 height: 100%; 307 z-index: 12; 308 filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0); 309 } 310 311 /* The layer used to cover the dialog when opening a child dialog. */ 312 .cover 313 { 314 position: absolute; 315 top: 0px; 316 left: 14px; 317 right: 14px; 318 bottom: 18px; 319 z-index: 11; 320 } 321 140 322 #closeButton 141 323 { 142 position: absolute ; 143 right: 0px ; 144 top: 0px ; 145 margin-top : 8px ; 146 margin-right: 10px ; 147 cursor: pointer ; 148 } 149 324 position: absolute; 325 right: 0px; 326 top: 0px; 327 margin-top: 5px; 328 margin-right: 10px; 329 width: 20px; 330 height: 20px; 331 cursor: pointer; 332 background-image: url(images/sprites.png); 333 background-repeat: no-repeat; 334 background-position: -16px -651px; 335 } 336 337 * html #closeButton 338 { 339 cursor: hand; 340 background-image: url(images/sprites.gif); 341 } 342 343 .rtl #closeButton 344 { 345 right: auto; 346 left: 0px; 347 margin-left: 10px; 348 } 349 350 #closeButton:hover 351 { 352 background-position: -16px -687px; 353 } 354 -
FCKeditor/branches/features/floating_dialog/editor/skins/default/fck_dialog_ie6.js
r1208 r1213 79 79 } 80 80 81 var closeButtonOver = function() 82 { 83 this.style.backgroundPosition = '-16px -687px' ; 84 } ; 85 86 var closeButtonOut = function() 87 { 88 this.style.backgroundPosition = '-16px -651px' ; 89 } ; 90 91 var fixCloseButton = function() 92 { 93 var closeButton = document.getElementById ( 'closeButton' ) ; 94 95 closeButton.onmouseover = closeButtonOver ; 96 closeButton.onmouseout = closeButtonOut ; 97 } 98 81 99 var onLoad = function() 82 100 { 83 101 fixSizes() ; 102 fixCloseButton() ; 84 103 85 104 window.attachEvent( 'onresize', fixSizes ) ; -
FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdialog.js
r1209 r1213 22 22 */ 23 23 24 var FCKDialog = 25 { 26 BaseZIndex : 10000,27 LastSelectionData : null,28 DialogStack : []24 var FCKDialog = 25 { 26 _BaseZIndex : FCKConfig.FloatingPanelsZIndex + 1, 27 _DialogStack : [], 28 LastSelectionData : null 29 29 } ; 30 30 … … 33 33 { 34 34 // Setup the dialog info. 35 var oDialogInfo = new Object() ; 36 oDialogInfo.Title = dialogTitle ; 37 oDialogInfo.Page = dialogPage ; 38 oDialogInfo.Editor = window ; 39 oDialogInfo.CustomValue = customValue ; // Optional 40 oDialogInfo.SelectionData = null ; 35 var dialogInfo = 36 { 37 Title : dialogTitle, 38 Page : dialogPage, 39 Editor : window, 40 CustomValue : customValue, // Optional 41 SelectionData : null 42 } 41 43 42 44 if ( FCKBrowserInfo.IsIE ) … … 57 59 58 60 if ( bInvalidRange ) 59 oDialogInfo.SelectionData = this.LastSelectionData ;60 else 61 { 62 oDialogInfo.SelectionData = oRange ;61 dialogInfo.SelectionData = this.LastSelectionData ; 62 else 63 { 64 dialogInfo.SelectionData = oRange ; 63 65 this.LastSelectionData = oRange ; 64 66 } 65 67 } 66 68 67 var sUrl = FCKConfig.BasePath + 'fckdialog.html' ;68 this.Show( oDialogInfo, dialogName, sUrl, width, height, parentWindow, resizable ) ;69 var url = FCKConfig.BasePath + 'fckdialog.html' ; 70 this.Show( dialogInfo, dialogName, url, width, height, parentWindow, resizable ) ; 69 71 } 70 72 … … 73 75 var ownerWindow = FCK.ToolbarSet.CurrentInstance.Window.parent ; 74 76 var ownerDocument = ownerWindow.document ; 75 var scrollTop = ownerDocument.body.scrollTop ; 76 var scrollLeft = ownerDocument.body.scrollLeft ; 77 var innerWidth = FCKBrowserInfo.IsIE ? ownerDocument.documentElement.offsetWidth : ownerWindow.innerWidth ; 78 var innerHeight = FCKBrowserInfo.IsIE ? ownerDocument.documentElement.offsetHeight : ownerWindow.innerHeight ; 79 var iTop = Math.max( scrollTop + ( innerHeight - dialogHeight - 20 ) / 2, 0 ) ; 80 var iLeft = Math.max( scrollLeft + ( innerWidth - dialogWidth - 20 ) / 2, 0 ) ; 81 if ( ! ownerWindow.FCKDialogArguments ) 82 ownerWindow.FCKDialogArguments = {} ; 83 var dialogId = parseInt( Math.random() * 0x10000000, 10 ) ; 84 ownerWindow.FCKDialogArguments[dialogId] = dialogInfo ; 85 77 78 var viewSize = FCKTools.GetViewPaneSize( ownerWindow ) ; 79 var scrollPosition = FCKTools.GetScrollPosition( ownerWindow ) ; 80 81 // Calculate the dialog position, centering it on the screen. 82 var iTop = Math.max( scrollPosition.Y + ( viewSize.Height - dialogHeight - 20 ) / 2, 0 ) ; 83 var iLeft = Math.max( scrollPosition.X + ( viewSize.Width - dialogWidth - 20 ) / 2, 0 ) ; 84