1
<html xmlns="http://www.w3.org/1999/xhtml">
3
<title>FCKeditor</title>
4
<script type="text/javascript">
5
// #### URLParams: holds all URL passed parameters (like ?Param1=Value1&Param2=Value2)
6
var FCKURLParams = new Object() ;
8
var aParams = document.location.search.substr(1).split('&') ;
9
for ( var i = 0 ; i < aParams.length ; i++ )
11
var aParam = aParams[i].split('=') ;
12
var sParamName = aParam[0] ;
13
var sParamValue = aParam[1] ;
15
FCKURLParams[ sParamName ] = sParamValue ;
18
// It is preferable to have the oFCKeditor object defined in the opener window,
19
// so all the configurations will be there. In this way the popup doesn't need
20
// to take care of the configurations "clonning".
21
var popup = window.opener;
22
var oFCKeditor = window.opener[ FCKURLParams[ 'var' ] ] ;
23
oFCKeditor.Width = '100%' ;
24
oFCKeditor.Height = '100%' ;
25
oFCKeditor.Value = popup.document.getElementById( FCKURLParams[ 'el' ] ).value ;
29
var oEditor = FCKeditorAPI.GetInstance( oFCKeditor.InstanceName ) ;
30
if ( oEditor.IsDirty() )
32
if ((window.opener.firstLoad == false) && (popup.FCKeditorAPI)) { //already loaded
33
var parentOEditor = popup.FCKeditorAPI.GetInstance(FCKURLParams[ 'el' ]);
34
var parentIsWysiwyg = ( parentOEditor.EditMode == FCK_EDITMODE_WYSIWYG ) ;
35
var IsWysiwyg = ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG ) ;
36
if ( !IsWysiwyg && parentIsWysiwyg ) //copy from PLAIN (popup) to WYSIWIG (parent)
38
parentOEditor.SwitchEditMode(); //switch to plain
39
var text = oEditor.GetData(parentOEditor.Config.FormatSource);
40
parentOEditor.SetHTML( text );
42
else if ( parentIsWysiwyg )
44
var text = oEditor.EditorDocument.documentElement.innerHTML;
45
parentOEditor.EditingArea.Start( text );
49
var text = oEditor.GetData(parentOEditor.Config.FormatSource);
50
parentOEditor.SetHTML( text );
53
window.opener.document.getElementById( FCKURLParams[ 'el' ] ).value = oEditor.GetData( true ) ; // "true" means you want it formatted.
55
window.opener.focus() ;
62
var oEditor = FCKeditorAPI.GetInstance( oFCKeditor.InstanceName ) ;
63
if ( oEditor.IsDirty() )
65
if ( !confirm( 'Are you sure you want to cancel? Your changes will be lost.' ) )
75
<body style="margin:0px 0px 10px;">
76
<table width="100%" cellspacing=0 cellpadding=0 height="100%">
79
<div id="FCKdiv" style='width:100%;height:100%'></div>
80
<script type="text/javascript">
81
document.write( '<input type="hidden" id="' + oFCKeditor.InstanceName + '" name="' + oFCKeditor.InstanceName + '" value="' + oFCKeditor._HTMLEncode( 'nic' ) + '" style="width:100%;display:none" />' ) ;
83
popup.window.parent.FCK_sajax('wfSajaxWikiToHTML', [oFCKeditor.Value], function ( result ){
84
var FCKinput = document.getElementById( oFCKeditor.InstanceName );
85
FCKinput.value = (result.responseText);
86
document.getElementById( 'FCKdiv' ).innerHTML = oFCKeditor._GetConfigHtml() + oFCKeditor._GetIFrameHtml();
91
<tr valign="middle" height="40">
93
<input type="button" value="Ok" onclick="Ok();" style="width:120px" />
94
<input type="button" value="Cancel" onclick="Cancel();" />