Index: branches/5.2.x/core/ckeditor/ckfinder/ckfinder.html
===================================================================
diff -u -N -r15042 -r15316
--- branches/5.2.x/core/ckeditor/ckfinder/ckfinder.html (.../ckfinder.html) (revision 15042)
+++ branches/5.2.x/core/ckeditor/ckfinder/ckfinder.html (.../ckfinder.html) (revision 15316)
@@ -1,7 +1,7 @@
- CKFinder 2
+ CKFinder
@@ -35,10 +35,25 @@
};
var tmp;
+ if ( tmp = get( 'configId' ) )
+ {
+ var win = window.opener || window;
+ try
+ {
+ while ( (!win.CKFinder || !win.CKFinder._.instanceConfig[tmp]) && win != window.top )
+ win = win.parent;
+
+ if ( win.CKFinder._.instanceConfig[tmp] ) {
+ config = win.CKFinder._.instanceConfig[tmp];
+ }
+ }
+ catch(e) {}
+ }
+
if ( tmp = get( 'basePath' ) )
CKFINDER.basePath = tmp;
- if ( tmp = get( 'startupPath' ) )
+ if ( tmp = get( 'startupPath' ) || get( 'start' ) )
config.startupPath = decodeURIComponent( tmp );
config.id = get( 'id' ) || '';
@@ -64,59 +79,59 @@
if ( tmp = get( 'langCode' ) )
config.language = tmp;
- // Try to get desired "File Select" action from the URL.
- var action;
- if ( tmp = get( 'CKEditor' ) )
+ if ( typeof( config.selectActionFunction ) == 'undefined' )
{
- if ( tmp.length )
- action = 'ckeditor';
- }
- if ( !action )
- action = get( 'action' );
+ // Try to get desired "File Select" action from the URL.
+ var action;
+ if ( tmp = get( 'CKEditor' ) )
+ {
+ if ( tmp.length )
+ action = 'ckeditor';
+ }
+ if ( !action )
+ action = get( 'action' );
- var parentWindow = ( window.parent == window )
- ? window.opener : window.parent;
+ var parentWindow = ( window.parent == window ) ? window.opener : window.parent;
+ switch ( action )
+ {
+ case 'js':
+ var actionFunction = get( 'func' );
+ if ( actionFunction && actionFunction.length > 0 )
+ config.selectActionFunction = parentWindow[ actionFunction ];
- switch ( action )
- {
- case 'js':
- var actionFunction = get( 'func' );
- if ( actionFunction && actionFunction.length > 0 )
- config.selectActionFunction = parentWindow[ actionFunction ];
+ actionFunction = get( 'thumbFunc' );
+ if ( actionFunction && actionFunction.length > 0 )
+ config.selectThumbnailActionFunction = parentWindow[ actionFunction ];
+ break ;
- actionFunction = get( 'thumbFunc' );
- if ( actionFunction && actionFunction.length > 0 )
- config.selectThumbnailActionFunction = parentWindow[ actionFunction ];
- break ;
-
- case 'ckeditor':
- var funcNum = get( 'CKEditorFuncNum' );
- if ( parentWindow['CKEDITOR'] )
- {
- config.selectActionFunction = function( fileUrl, data )
+ case 'ckeditor':
+ var funcNum = get( 'CKEditorFuncNum' );
+ if ( parentWindow['CKEDITOR'] )
{
- parentWindow['CKEDITOR'].tools.callFunction( funcNum, fileUrl, data );
- };
+ config.selectActionFunction = function( fileUrl, data )
+ {
+ parentWindow['CKEDITOR'].tools.callFunction( funcNum, fileUrl, data );
+ };
- config.selectThumbnailActionFunction = config.selectActionFunction;
- }
- break;
+ config.selectThumbnailActionFunction = config.selectActionFunction;
+ }
+ break;
- default:
- if ( parentWindow && parentWindow['FCK'] && parentWindow['SetUrl'] )
- {
- action = 'fckeditor' ;
- config.selectActionFunction = parentWindow['SetUrl'];
+ default:
+ if ( parentWindow && parentWindow['FCK'] && parentWindow['SetUrl'] )
+ {
+ action = 'fckeditor' ;
+ config.selectActionFunction = parentWindow['SetUrl'];
- if ( !config.disableThumbnailSelection )
- config.selectThumbnailActionFunction = parentWindow['SetUrl'];
- }
- else
- action = null ;
+ if ( !config.disableThumbnailSelection )
+ config.selectThumbnailActionFunction = parentWindow['SetUrl'];
+ }
+ else
+ action = null ;
+ }
+ config.action = action;
}
- config.action = action;
-
// Always use 100% width and height when nested using this middle page.
config.width = config.height = '100%';