| 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 | } |
|---|
| 64 | |
|---|
| 65 | function LoadSelection() |
|---|
| 66 | { |
|---|
| 67 | if ( !oMathImage ) return ; |
|---|
| 68 | |
|---|
| 69 | GetE('xTemplateRaw').value = oMathImage.getAttribute( '_fck_mw_math' ) ; |
|---|
| 70 | } |
|---|
| 71 | |
|---|
| 72 | //#### The OK button was hit. |
|---|
| 73 | function Ok() |
|---|
| 74 | { |
|---|
| 75 | var formula = GetE('xTemplateRaw').value.Trim() ; |
|---|
| 76 | |
|---|
| 77 | if ( formula.length == 0 ) |
|---|
| 78 | { |
|---|
| 79 | alert( FCKLang.wikiTeXEmpty ) ; |
|---|
| 80 | return false ; |
|---|
| 81 | } |
|---|
| 82 | |
|---|
| 83 | window.parent.document.getElementById( 'btnOk' ).disabled = true ; |
|---|
| 84 | window.parent.document.getElementById( 'btnCancel' ).disabled = true ; |
|---|
| 85 | |
|---|
| 86 | oEditor.window.parent.sajax_request_type = 'GET' ; |
|---|
| 87 | oEditor.window.parent.sajax_do_call( 'wfSajaxGetMathUrl', [formula], UpdateImageFromAjax ) ; |
|---|
| 88 | |
|---|
| 89 | return false ; |
|---|
| 90 | } |
|---|
| 91 | |
|---|
| 92 | function UpdateImageFromAjax( response ) |
|---|
| 93 | { |
|---|
| 94 | if ( !oMathImage ) |
|---|
| 95 | oMathImage = FCK.CreateElement( 'IMG' ) ; |
|---|
| 96 | else |
|---|
| 97 | oEditor.FCKUndo.SaveUndoStep() ; |
|---|
| 98 | |
|---|
| 99 | SetAttribute( oMathImage, "_fck_mw_math", GetE('xTemplateRaw').value.Trim() ) ; |
|---|
| 100 | SetAttribute( oMathImage, "_fckfakelement", 'true' ) ; |
|---|
| 101 | |
|---|
| 102 | oMathImage.src = response.responseText ; |
|---|
| 103 | SetAttribute( oMathImage, "_fcksavedurl", response.responseText ) ; |
|---|
| 104 | |
|---|
| 105 | // Call it using setTimeout to avoid a strange behavior in Firefox. |
|---|
| 106 | window.setTimeout( window.parent.Cancel, 0 ) ; |
|---|
| 107 | } |
|---|
| 108 | |
|---|
| 109 | </script> |
|---|
| 110 | </head> |
|---|
| 111 | <body style="overflow: hidden"> |
|---|
| 112 | <div id="divInfo"> |
|---|
| 113 | <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%"> |
|---|
| 114 | <tr> |
|---|
| 115 | <td> |
|---|
| 116 | <span fcklang="wikiTeX"></span> |
|---|
| 117 | </td> |
|---|
| 118 | </tr> |
|---|
| 119 | <tr> |
|---|
| 120 | <td height="100%"> |
|---|
| 121 | <textarea id="xTemplateRaw" style="width: 100%; height: 100%; font-family: Monospace" |
|---|
| 122 | cols="50" rows="10" wrap="off"></textarea> |
|---|
| 123 | </td> |
|---|
| 124 | </tr> |
|---|
| 125 | </table> |
|---|
| 126 | </div> |
|---|
| 127 | </body> |
|---|
| 128 | </html> |
|---|