~ubuntu-branches/ubuntu/precise/mediawiki-extensions/precise

« back to all changes in this revision

Viewing changes to dist/mediawiki-extensions-fckeditor/usr/share/mediawiki-extensions/fckeditor/plugins/mediawiki/dialogs/math.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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 
2
<!--
 
3
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 
4
 * Copyright (C) 2003-2007 Frederico Caldeira Knabben
 
5
 *
 
6
 * == BEGIN LICENSE ==
 
7
 *
 
8
 * Licensed under the terms of any of the following licenses at your
 
9
 * choice:
 
10
 *
 
11
 *  - GNU General Public License Version 2 or later (the "GPL")
 
12
 *    http://www.gnu.org/licenses/gpl.html
 
13
 *
 
14
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
 
15
 *    http://www.gnu.org/licenses/lgpl.html
 
16
 *
 
17
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
 
18
 *    http://www.mozilla.org/MPL/MPL-1.1.html
 
19
 *
 
20
 * == END LICENSE ==
 
21
 *
 
22
 * Link dialog window.
 
23
-->
 
24
<html>
 
25
<head>
 
26
        <title>Formula Editor</title>
 
27
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
28
        <meta name="robots" content="noindex, nofollow" />
 
29
        <script type="text/javascript">
 
30
 
 
31
var oEditor             = window.parent.InnerDialogLoaded() ;
 
32
var FCK                 = oEditor.FCK ;
 
33
var FCKLang             = oEditor.FCKLang ;
 
34
var FCKConfig   = oEditor.FCKConfig ;
 
35
var FCKRegexLib = oEditor.FCKRegexLib ;
 
36
var FCKTools    = oEditor.FCKTools ;
 
37
 
 
38
document.write( '<script src="' + FCKConfig.BasePath + 'dialog/common/fck_dialog_common.js" type="text/javascript"><\/script>' ) ;
 
39
 
 
40
        </script>
 
41
        <script type="text/javascript">
 
42
 
 
43
// Get the selected flash embed (if available).
 
44
var oMathImage = FCK.Selection.GetSelectedElement() ;
 
45
 
 
46
if ( oMathImage )
 
47
{
 
48
        if ( oMathImage.tagName != 'IMG' || !oMathImage.getAttribute('_fck_mw_math') )
 
49
                oMathImage = null ;
 
50
}
 
51
 
 
52
window.onload = function()
 
53
{
 
54
        // Translate the dialog box texts.
 
55
        oEditor.FCKLanguageManager.TranslatePage(document) ;
 
56
 
 
57
        // Load the selected link information (if any).
 
58
        LoadSelection() ;
 
59
 
 
60
        // Activate the "OK" button.
 
61
        window.parent.SetOkButton( true ) ;
 
62
        window.parent.SetAutoSize( true ) ;
 
63
        GetE('xTemplateRaw').focus();
 
64
}
 
65
 
 
66
function LoadSelection()
 
67
{
 
68
        if ( !oMathImage ) return ;
 
69
 
 
70
        GetE('xTemplateRaw').value = oMathImage.getAttribute( '_fck_mw_math' ) ;
 
71
}
 
72
 
 
73
//#### The OK button was hit.
 
74
function Ok()
 
75
{
 
76
        var formula = GetE('xTemplateRaw').value.Trim() ;
 
77
 
 
78
        if ( formula.length == 0 )
 
79
        {
 
80
                alert( FCKLang.wikiTeXEmpty || 'Please type the formula' ) ;
 
81
                return false ;
 
82
        }
 
83
 
 
84
        if ( oEditor.window.parent.FCKeditorAPI && oEditor.window.parent.FCKeditorAPI.Version.match( /^2\.5/ ) ) {
 
85
                window.parent.document.getElementById( 'btnOk' ).disabled = true ;
 
86
                window.parent.document.getElementById( 'btnCancel' ).disabled = true ;
 
87
        }
 
88
 
 
89
        oEditor.window.parent.sajax_request_type = 'GET' ;
 
90
        oEditor.window.parent.sajax_do_call( 'wfSajaxGetMathUrl', [formula], UpdateImageFromAjax ) ;
 
91
 
 
92
        return false ;
 
93
}
 
94
 
 
95
function UpdateImageFromAjax( response )
 
96
{
 
97
        oEditor.FCKUndo.SaveUndoStep() ;
 
98
 
 
99
        if ( !oMathImage )
 
100
        {
 
101
                oMathImage = FCK.CreateElement( 'IMG' ) ;
 
102
                oMathImage.className = 'FCK__MWMath' ;
 
103
                oMathImage.src = FCKConfig.PluginsPath + 'mediawiki/images/icon_math.gif' ;
 
104
        }
 
105
        else
 
106
        {
 
107
                if ( response.responseText )
 
108
                {
 
109
                        oMathImage.src = response.responseText ;
 
110
                        SetAttribute( oMathImage, "_fcksavedurl", response.responseText ) ;
 
111
                }
 
112
                else
 
113
                {
 
114
                        oMathImage.src = FCKConfig.PluginsPath + 'mediawiki/images/icon_math.gif' ;
 
115
                }
 
116
        }
 
117
 
 
118
        SetAttribute( oMathImage, "_fck_mw_math", GetE('xTemplateRaw').value.Trim() ) ;
 
119
        SetAttribute( oMathImage, "_fckfakelement", 'true' ) ;
 
120
 
 
121
        // Call it using setTimeout to avoid a strange behavior in Firefox.
 
122
        window.setTimeout( window.parent.Cancel, 0 ) ;
 
123
}
 
124
 
 
125
        </script>
 
126
</head>
 
127
<body style="overflow: hidden">
 
128
        <div id="divInfo">
 
129
                <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
 
130
                        <tr>
 
131
                                <td>
 
132
                                        <span fcklang="wikiTeX">Formula (TeX markup)</span>
 
133
                                </td>
 
134
                        </tr>
 
135
                        <tr>
 
136
                                <td height="100%">
 
137
                                        <textarea id="xTemplateRaw" style="width: 100%; height: 100%; font-family: Monospace"
 
138
                                                cols="50" rows="10" wrap="off"></textarea>
 
139
                                </td>
 
140
                        </tr>
 
141
                </table>
 
142
        </div>
 
143
</body>
 
144
</html>