Browse Source

[svn r22284] FS#2867 - The online editor: Integration of the advanced file manager with the editor's dialog system, initial steps.

Ivan Tcholakov 15 years ago
parent
commit
f91ed6bb2e

+ 5 - 4
main/inc/lib/fckeditor/editor/dialog/common/fck_dialog_common.js

@@ -176,7 +176,7 @@ String.prototype.ReplaceAll = function( searchArray, replaceArray )
 
 function OpenFileBrowser( url, width, height )
 {
-	// oEditor must be defined.
+	// oEditor must be defined. Otherwise FCK, FCKConfig, FCKDialog and FCKLang must be defined.
 	if ( oEditor )
 	{
 		if ( !FCK )
@@ -197,10 +197,11 @@ function OpenFileBrowser( url, width, height )
 		}
 	}
 
-	// Otherwise FCK, FCKConfig, FCKDialog and FCKLang must be defined.
+	var open_in_a_new_window = ( FCKConfig.AdvancedFileManager && FCKConfig.AdvancedFileManager.toString() == 'true' )
+		? ( FCKConfig.OpenAdvancedFileManagerInANewWindow && FCKConfig.OpenAdvancedFileManagerInANewWindow.toString() == 'true' )
+		: ( FCKConfig.OpenSimpleFileManagerInANewWindow && FCKConfig.OpenSimpleFileManagerInANewWindow.toString() == 'true' ) ;
 
-	if ( ( FCKConfig.OpenSimpleFileManagerInANewWindow && FCKConfig.OpenSimpleFileManagerInANewWindow.toString() == 'true' ) ||
-		( FCKConfig.AdvancedFileManager && FCKConfig.AdvancedFileManager.toString() == 'true' ) )
+	if ( open_in_a_new_window )
 	{
 		var iLeft = ( FCKConfig.ScreenWidth  - width ) / 2 ;
 		var iTop  = ( FCKConfig.ScreenHeight - height ) / 2 ;

+ 9 - 0
main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/ajaxfilemanager.php

@@ -79,6 +79,15 @@
 <script type="text/javascript" src="jscripts/ajaxfileupload.js"></script>
 <script type="text/javascript" src="jscripts/ajaxfilemanager.js"></script>-->
 <script type="text/javascript">
+
+	// Added by Ivan Tcholakov, 22-JUL-2009.
+	// For integration with the editor's dialig system.
+	var oEditor = null ;
+	if ( !window.opener && window.parent ) {
+		// The file manager is inside a dialog.
+		oEditor = window.parent.InnerDialogLoaded() ;
+	}
+
 	var globalSettings = {'upload_init':false};
 	var queryString = '<?php echo makeQueryString(array('path')); ?>';
 	var paths = {'root':'<?php echo addTrailingSlash(backslashToSlash(CONFIG_SYS_ROOT_PATH)); ?>', 'root_title':'<?php echo LBL_FOLDER_ROOT; ?>'};

+ 2 - 2
main/inc/lib/fckeditor/editor/plugins/customizations/fckplugin.js

@@ -593,8 +593,8 @@ FCKToolbarItems.GetItem = function( itemName )
 		case 'UnorderedList'	: oItem = new FCKToolbarButton( 'InsertUnorderedList'	, FCKLang.BulletedListLbl, FCKLang.BulletedList, null, false, true, 27 ) ; break ;
 		case 'Outdent'			: oItem = new FCKToolbarButton( 'Outdent'	, FCKLang.DecreaseIndent, null, null, false, true, 28 ) ; break ;
 		case 'Indent'			: oItem = new FCKToolbarButton( 'Indent'	, FCKLang.IncreaseIndent, null, null, false, true, 29 ) ; break ;
-		case 'Blockquote'			: oItem = new FCKToolbarButton( 'Blockquote'	, FCKLang.Blockquote, null, null, false, true, 73 ) ; break ;
-		case 'CreateDiv'			: oItem = new FCKToolbarButton( 'CreateDiv'	, FCKLang.CreateDiv, null, null, false, true, 74 ) ; break ;
+		case 'Blockquote'		: oItem = new FCKToolbarButton( 'Blockquote'	, FCKLang.Blockquote, null, null, false, true, 73 ) ; break ;
+		case 'CreateDiv'		: oItem = new FCKToolbarButton( 'CreateDiv'	, FCKLang.CreateDiv, null, null, false, true, 74 ) ; break ;
 
 		case 'Link'				: oItem = new FCKToolbarButton( 'Link'		, FCKLang.InsertLinkLbl, FCKLang.InsertLink, null, false, true, 34 ) ; break ;
 		case 'Unlink'			: oItem = new FCKToolbarButton( 'Unlink'	, FCKLang.RemoveLink, null, null, false, true, 35 ) ; break ;

+ 12 - 12
main/inc/lib/fckeditor/myconfig.js

@@ -88,23 +88,23 @@ FCKConfig.GoogleMaps_Key = 'ABQIAAAAlXu5Pw6DFAUgqM2wQn01gxT2yXp_ZAY8_ufC3CFXhHIE
 
 // Window size of the file manager:
 // for any type of files;
-FCKConfig.LinkBrowserWindowWidth	= 782 ;
-FCKConfig.LinkBrowserWindowHeight	= 490 ;
+FCKConfig.LinkBrowserWindowWidth	= 800 ;
+FCKConfig.LinkBrowserWindowHeight	= 600 ;
 // for images;
-FCKConfig.ImageBrowserWindowWidth   = 782 ;
-FCKConfig.ImageBrowserWindowHeight  = 490 ;
+FCKConfig.ImageBrowserWindowWidth   = 800 ;
+FCKConfig.ImageBrowserWindowHeight  = 600 ;
 // for flash objects;
-FCKConfig.FlashBrowserWindowWidth   = 782 ;
-FCKConfig.FlashBrowserWindowHeight  = 490 ;
+FCKConfig.FlashBrowserWindowWidth   = 800 ;
+FCKConfig.FlashBrowserWindowHeight  = 600 ;
 // for audio files;
-FCKConfig.MP3BrowserWindowWidth     = 782 ;
-FCKConfig.MP3BrowserWindowHeight    = 490 ;
+FCKConfig.MP3BrowserWindowWidth     = 800 ;
+FCKConfig.MP3BrowserWindowHeight    = 600 ;
 // for video files;
-FCKConfig.VideoBrowserWindowWidth   = 782 ;
-FCKConfig.VideoBrowserWindowHeight  = 490 ;
+FCKConfig.VideoBrowserWindowWidth   = 800 ;
+FCKConfig.VideoBrowserWindowHeight  = 600 ;
 // for video (flv) files.
-FCKConfig.MediaBrowserWindowWidth   = 782 ;
-FCKConfig.MediaBrowserWindowHeight  = 490 ;
+FCKConfig.MediaBrowserWindowWidth   = 800 ;
+FCKConfig.MediaBrowserWindowHeight  = 600 ;
 
 //Upload path for the Image manager. Leave it empty.
 FCKConfig.IMUploadPath = '' ;