Changeset 1056
- Timestamp:
- 11/01/07 08:40:34 (6 years ago)
- Location:
- FCKeditor/branches/features/floating_dialog/editor
- Files:
-
- 2 added
- 4 edited
-
_source/internals/fck.js (modified) (3 diffs)
-
_source/internals/fckdialog.js (modified) (5 diffs)
-
_source/internals/fckdomtools.js (modified) (1 diff)
-
_source/internals/fcktools.js (modified) (1 diff)
-
skins/default/fck_background_blocker.html (added)
-
skins/default/fck_editor_blocker.html (added)
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/branches/features/floating_dialog/editor/_source/internals/fck.js
r1050 r1056 31 31 Toolbar : null, 32 32 HasFocus : false, 33 DataProcessor : new FCKDataProcessor(),34 Window : window,33 DataProcessor : new FCKDataProcessor(), 34 Window : window, 35 35 36 36 AttachToOnSelectionChange : function( functionPointer ) … … 734 734 735 735 return true ; 736 }, 737 738 SetDialogMode: function( yes ) 739 { 740 var doc = this.Window.parent.document ; 741 var editorFrame = this.Window.frameElement ; 742 var editorParentElement = editorFrame.parentNode ; 743 if ( !this.BackgroundBlocker ) 744 { 745 this.BackgroundBlocker = doc.createElement( 'iframe' ) ; 746 this.EditorBlocker = doc.createElement( 'iframe' ) ; 747 this.BackgroundBlocker.src = FCKConfig.SkinPath + 'fck_background_blocker.html' ; 748 this.EditorBlocker.src = FCKConfig.SkinPath + 'fck_editor_blocker.html' ; 749 750 this.BackgroundBlocker.frameBorder = 0 ; 751 this.EditorBlocker.frameBorder = 0 ; 752 FCKDomTools.SetElementStyles( this.BackgroundBlocker, 753 { 754 'left' : '0px', 755 'top' : '0px', 756 'position' : 'absolute', 757 'zIndex' : 0 758 } ) ; 759 FCKDomTools.SetElementStyles( this.EditorBlocker, 760 { 761 'position' : 'absolute', 762 'zIndex' : 200 763 } ) ; 764 FCKDomTools.SetOpacity( this.BackgroundBlocker, 0.5 ) ; 765 FCKDomTools.SetOpacity( this.EditorBlocker, 0.5 ) ; 766 editorParentElement.style.overflow = 'visible' ; 767 FCKDomTools.SetElementStyles( editorFrame, 768 { 769 'zIndex' : 100, 770 'width' : editorFrame.offsetWidth + 'px', 771 'height' : editorFrame.offsetHeight + 'px', 772 'position' : 'absolute' 773 } ) ; 774 FCKDomTools.SetElementStyles( editorParentElement, 775 { 776 'width' : editorFrame.offsetWidth + 'px', 777 'height' : editorFrame.offsetHeight + 'px' 778 } ) ; 779 editorParentElement.appendChild( this.BackgroundBlocker ) ; 780 editorParentElement.appendChild( this.EditorBlocker ) ; 781 } 782 783 if ( yes ) 784 { 785 var parentDivPosition = FCKTools.GetDocumentPosition( this.Window.parent, editorParentElement ) ; 786 FCKDomTools.SetElementStyles( this.EditorBlocker, 787 { 788 'width' : editorFrame.offsetWidth + 'px', 789 'height' : editorFrame.offsetHeight + 'px', 790 'left' : parentDivPosition.x + 'px', 791 'top' : parentDivPosition.y + 'px', 792 'display' : '' 793 } ) ; 794 FCKDomTools.SetElementStyles( this.BackgroundBlocker, 795 { 796 'width' : Math.max( doc.documentElement.scrollWidth, doc.documentElement.clientWidth ) + 'px', 797 'height' : Math.max( doc.documentElement.scrollHeight, doc.documentElement.clientHeight ) + 'px', 798 'left' : '0px', 799 'top' : '0px', 800 'display' : '' 801 } ) ; 802 this.EditorBlocker.focus() ; 803 } 804 else 805 { 806 // the top : -10000px statement is needed to circumvent an IE focus bug, don't delete. 807 FCKDomTools.SetElementStyles( this.EditorBlocker, 808 { 809 'display' : 'none', 810 'top' : '-10000px' 811 } ) ; 812 FCKDomTools.SetElementStyles( this.BackgroundBlocker, 813 { 814 'display' : 'none', 815 'top' : '-10000px' 816 } ) ; 817 } 736 818 } 737 819 } ; … … 865 947 return ; 866 948 949 // Popup a debug window if debug mode is set to true. 867 950 if ( FCKConfig.Debug ) 868 951 FCKDebug._GetWindow() ; 952 953 // Apply floating dialog blocker styles to the parent document if not already applied. 954 if ( ! window.parent.FCK_BLOCKER_STYLES_APPLIED ) 955 { 956 window.parent.FCK_BLOCKER_STYLES_APPLIED = true ; 957 } 869 958 870 959 FCK.SetStatus( FCK_STATUS_ACTIVE ) ; -
FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdialog.js
r1054 r1056 66 66 var sUrl = FCKConfig.BasePath + 'fckdialog.html' ; 67 67 this.Show( oDialogInfo, dialogName, sUrl, width, height, parentWindow, resizable ) ; 68 }69 70 FCKDialog._LoadPNG = function( element, url )71 {72 if ( FCKBrowserInfo.IsIE )73 element.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + url + '",sizingMethod="scale")' ;74 else75 {76 element.style.backgroundImage = 'url(' + url + ')' ;77 element.style.backgroundRepeat = 'repeat' ;78 }79 }80 81 FCKDialog._SetOpacity = function( element, opacity )82 {83 if ( FCKBrowserInfo.IsIE )84 element.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + parseInt( opacity * 100 ) + ')' ;85 else86 element.style.opacity = opacity ;87 68 } 88 69 … … 143 124 oWindow.focus() ; 144 125 this.Window = oWindow ; 126 FCK.SetDialogMode( true ) ; 145 127 } 146 128 … … 218 200 else 219 201 d.style.height = ( container.offsetHeight - 40 ) + 'px' ; 220 this._LoadPNG( d, FCKConfig.SkinPath + 'images/' + partUrl[i] ) ;202 FCKDomTools.LoadPNG( d, FCKConfig.SkinPath + 'images/' + partUrl[i] ) ; 221 203 var x = [ 0, 20, container.offsetWidth - 20 ] ; 222 204 var y = [ 0, 20, container.offsetHeight - 20 ] ; … … 230 212 } 231 213 232 this._SetOpacity( shadowBlock, 0.65 ) ;214 FCKDomTools.SetOpacity( shadowBlock, 0.65 ) ; 233 215 container.appendChild( shadowBlock ) ; 234 216 } … … 241 223 container.parentNode.removeChild( container ) ; 242 224 this.BaseZIndex -= 100 ; 243 } 225 FCK.SetDialogMode( false ) ; 226 } -
FCKeditor/branches/features/floating_dialog/editor/_source/internals/fckdomtools.js
r1048 r1056 895 895 for ( var styleName in styleDict ) 896 896 style[ styleName ] = styleDict[ styleName ] ; 897 }, 898 899 LoadPNG : function( element, url ) 900 { 901 if ( FCKBrowserInfo.IsIE ) 902 element.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + url + '",sizingMethod="scale")' ; 903 else 904 { 905 element.style.backgroundImage = 'url(' + url + ')' ; 906 element.style.backgroundRepeat = 'repeat' ; 907 } 908 }, 909 910 SetOpacity : function( element, opacity ) 911 { 912 if ( FCKBrowserInfo.IsIE ) 913 element.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + parseInt( opacity * 100 ) + ')' ; 914 else 915 element.style.opacity = opacity ; 897 916 } 898 917 } ; -
FCKeditor/branches/features/floating_dialog/editor/_source/internals/fcktools.js
r1017 r1056 424 424 var y = 0 ; 425 425 var curNode = node ; 426 while ( curNode && curNode != w.document. body)426 while ( curNode && curNode != w.document.documentElement ) 427 427 { 428 428 x += curNode.offsetLeft - curNode.scrollLeft ;
Note: See TracChangeset
for help on using the changeset viewer.
