~ubuntu-branches/ubuntu/saucy/mediawiki-extensions/saucy

« back to all changes in this revision

Viewing changes to dist/mediawiki-extensions-fckeditor/usr/share/mediawiki-extensions/fckeditor/FCKeditor.popup.html

  • Committer: Bazaar Package Importer
  • Author(s): Romain Beauxis
  • Date: 2010-05-04 15:13:35 UTC
  • mfrom: (0.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20100504151335-54qeucg3ec108q28
Tags: 2.2
* Added Replaces:/Conflicts: to allow a proper upgrade.
Closes: #580066
* Fixed package descriptions.
Closes: #579667
* Patched mediawiki-extensions-fckeditor to make it work with
  php 5.3. The fix may not be perfect but at least it work.
  Not closing the bug (#579822) for now..

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html xmlns="http://www.w3.org/1999/xhtml">
 
2
<head>
 
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() ;
 
7
 
 
8
var aParams = document.location.search.substr(1).split('&') ;
 
9
for ( var i = 0 ; i < aParams.length ; i++ )
 
10
{
 
11
        var aParam = aParams[i].split('=') ;
 
12
        var sParamName  = aParam[0] ;
 
13
        var sParamValue = aParam[1] ;
 
14
 
 
15
        FCKURLParams[ sParamName ] = sParamValue ;
 
16
}
 
17
 
 
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 ;
 
26
 
 
27
function Ok()
 
28
{
 
29
        var oEditor = FCKeditorAPI.GetInstance( oFCKeditor.InstanceName ) ;
 
30
        if ( oEditor.IsDirty() )
 
31
        {
 
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)
 
37
                        {
 
38
                                parentOEditor.SwitchEditMode(); //switch to plain
 
39
                                var text = oEditor.GetData(parentOEditor.Config.FormatSource);
 
40
                                parentOEditor.SetHTML( text );
 
41
                        }
 
42
                        else if ( parentIsWysiwyg )
 
43
                        {
 
44
                                var text = oEditor.EditorDocument.documentElement.innerHTML;
 
45
                                parentOEditor.EditingArea.Start( text );
 
46
                        }
 
47
                        else
 
48
                        {
 
49
                                var text = oEditor.GetData(parentOEditor.Config.FormatSource);
 
50
                                parentOEditor.SetHTML( text );
 
51
                        }
 
52
                }
 
53
                window.opener.document.getElementById( FCKURLParams[ 'el' ] ).value = oEditor.GetData( true ) ;         // "true" means you want it formatted.
 
54
        }
 
55
        window.opener.focus() ;
 
56
        window.close() ;
 
57
        return true;
 
58
}
 
59
 
 
60
function Cancel()
 
61
{
 
62
        var oEditor = FCKeditorAPI.GetInstance( oFCKeditor.InstanceName ) ;
 
63
        if ( oEditor.IsDirty() )
 
64
        {
 
65
                if ( !confirm( 'Are you sure you want to cancel? Your changes will be lost.' ) )
 
66
                        return ;
 
67
        }
 
68
 
 
69
        window.close() ;
 
70
        return true;
 
71
}
 
72
 
 
73
        </script>
 
74
</head>
 
75
<body style="margin:0px 0px 10px;">
 
76
        <table width="100%" cellspacing=0 cellpadding=0 height="100%">
 
77
                <tr>
 
78
                        <td 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" />' ) ;
 
82
 
 
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();
 
87
});
 
88
                                </script>
 
89
                        </td>
 
90
                </tr>
 
91
                <tr valign="middle" height="40">
 
92
                        <td align="center" >
 
93
                                <input type="button" value="Ok" onclick="Ok();" style="width:120px" />
 
94
                                <input type="button" value="Cancel" onclick="Cancel();" />
 
95
                        </td>
 
96
                </tr>
 
97
        </table>
 
98
</body>
 
99
</html>