1 <html xmlns="http://www.w3.org/1999/xhtml">
3 <title>FCKeditor</title>
5 <script type="text/javascript">
7 // #### URLParams: holds all URL passed parameters (like ?Param1=Value1&Param2=Value2)
8 var FCKURLParams = new Object() ;
10 var aParams = document.location.search.substr(1).split('&') ;
11 for ( var i = 0 ; i < aParams.length ; i++ )
13 var aParam = aParams[i].split('=') ;
14 var sParamName = aParam[0] ;
15 var sParamValue = aParam[1] ;
17 FCKURLParams[ sParamName ] = sParamValue ;
20 // It is preferable to have the oFCKeditor object defined in the opener window,
21 // so all the configurations will be there. In this way the popup doesn't need
22 // to take care of the configurations "clonning".
23 var oFCKeditor = window.opener[ FCKURLParams[ 'var' ] ] ;
24 oFCKeditor.Width = '100%' ;
25 oFCKeditor.Height = '100%' ;
26 oFCKeditor.Value = window.opener.document.getElementById( FCKURLParams[ 'el' ] ).value ;
30 var oEditor = FCKeditorAPI.GetInstance( oFCKeditor.InstanceName ) ;
32 window.opener.document.getElementById( FCKURLParams[ 'el' ] ).value = oEditor.GetXHTML( true ) ; // "true" means you want it formatted.
34 window.opener.focus() ;
40 var oEditor = FCKeditorAPI.GetInstance( oFCKeditor.InstanceName ) ;
42 if ( oEditor.IsDirty() )
44 if ( !confirm( 'Are you sure you want to cancel? Your changes will be lost.' ) )
54 <table width="100%" height="100%">
57 <script type="text/javascript">
59 // For now, it is not possible to retrieve the output HTML, so we must do it by
60 // hand. Future implementations of FCKeditor could bring a
61 // oFCKeditor.CreateHtml() function.
62 document.write( '<input type="hidden" id="' + oFCKeditor.InstanceName + '" name="' + oFCKeditor.InstanceName + '" value="' + oFCKeditor._HTMLEncode( oFCKeditor.Value ) + '" style="display:none" />' ) ;
63 document.write( oFCKeditor._GetConfigHtml() ) ;
64 document.write( oFCKeditor._GetIFrameHtml() ) ;
71 <input type="button" value="Ok" onclick="Ok();" style="width:120px" />
72 <input type="button" value="Cancel" onclick="Cancel();" />