1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
4
* Copyright (C) 2003-2007 Frederico Caldeira Knabben
8
* Licensed under the terms of any of the following licenses at your
11
* - GNU General Public License Version 2 or later (the "GPL")
12
* http://www.gnu.org/licenses/gpl.html
14
* - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
15
* http://www.gnu.org/licenses/lgpl.html
17
* - Mozilla Public License Version 1.1 or later (the "MPL")
18
* http://www.mozilla.org/MPL/MPL-1.1.html
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">
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 ;
38
document.write( '<script src="' + FCKConfig.BasePath + 'dialog/common/fck_dialog_common.js" type="text/javascript"><\/script>' ) ;
41
<script type="text/javascript">
43
// Get the selected flash embed (if available).
44
var oMathImage = FCK.Selection.GetSelectedElement() ;
48
if ( oMathImage.tagName != 'IMG' || !oMathImage.getAttribute('_fck_mw_math') )
52
window.onload = function()
54
// Translate the dialog box texts.
55
oEditor.FCKLanguageManager.TranslatePage(document) ;
57
// Load the selected link information (if any).
60
// Activate the "OK" button.
61
window.parent.SetOkButton( true ) ;
62
window.parent.SetAutoSize( true ) ;
63
GetE('xTemplateRaw').focus();
66
function LoadSelection()
68
if ( !oMathImage ) return ;
70
GetE('xTemplateRaw').value = oMathImage.getAttribute( '_fck_mw_math' ) ;
73
//#### The OK button was hit.
76
var formula = GetE('xTemplateRaw').value.Trim() ;
78
if ( formula.length == 0 )
80
alert( FCKLang.wikiTeXEmpty || 'Please type the formula' ) ;
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 ;
89
oEditor.window.parent.sajax_request_type = 'GET' ;
90
oEditor.window.parent.sajax_do_call( 'wfSajaxGetMathUrl', [formula], UpdateImageFromAjax ) ;
95
function UpdateImageFromAjax( response )
97
oEditor.FCKUndo.SaveUndoStep() ;
101
oMathImage = FCK.CreateElement( 'IMG' ) ;
102
oMathImage.className = 'FCK__MWMath' ;
103
oMathImage.src = FCKConfig.PluginsPath + 'mediawiki/images/icon_math.gif' ;
107
if ( response.responseText )
109
oMathImage.src = response.responseText ;
110
SetAttribute( oMathImage, "_fcksavedurl", response.responseText ) ;
114
oMathImage.src = FCKConfig.PluginsPath + 'mediawiki/images/icon_math.gif' ;
118
SetAttribute( oMathImage, "_fck_mw_math", GetE('xTemplateRaw').value.Trim() ) ;
119
SetAttribute( oMathImage, "_fckfakelement", 'true' ) ;
121
// Call it using setTimeout to avoid a strange behavior in Firefox.
122
window.setTimeout( window.parent.Cancel, 0 ) ;
127
<body style="overflow: hidden">
129
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
132
<span fcklang="wikiTeX">Formula (TeX markup)</span>
137
<textarea id="xTemplateRaw" style="width: 100%; height: 100%; font-family: Monospace"
138
cols="50" rows="10" wrap="off"></textarea>