Changeset 627
- Timestamp:
- 12/30/06 17:18:02 (6 years ago)
- Location:
- trunk/plugins/Equation
- Files:
-
- 1 added
- 5 modified
-
ASCIIMathML.js (modified) (1 diff)
-
equation.js (modified) (2 diffs)
-
example.html (added)
-
lang/de.js (modified) (1 diff)
-
popups/dialog.html (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/Equation/ASCIIMathML.js
r613 r627 33 33 var checkForMathML = true; // check if browser can display MathML 34 34 var notifyIfNoMathML = true; // put note at top of page if no MathML capability 35 var mathcolor = "red"; // change it to "" (to inherit) or any other color 36 var mathfontfamily = "serif"; // change to "" to inherit (works in IE) 37 // or another family (e.g. "arial") 35 36 if ( typeof mathcolor == "undefined" ) 37 { 38 var mathcolor = "red"; // change it to "" (to inherit) or any other color 39 } 40 if ( typeof mathfontfamily == "undefined" ) 41 { 42 var mathfontfamily = "serif"; // change to "" to inherit (works in IE) or another family (e.g. "arial") 43 } 38 44 var displaystyle = true; // puts limits above and below large operators 39 var showasciiformulaonhover = true; // helps students learn ASCIIMath 45 46 if ( typeof showasciiformulaonhover == "undefined" ) 47 { 48 var showasciiformulaonhover = true; // helps students learn ASCIIMath 49 } 50 40 51 var decimalsign = "."; // change to "," if you like, beware of `(1,2)`! 41 52 var AMdelimiter1 = "`", AMescape1 = "\\\\`"; // can use other characters -
trunk/plugins/Equation/equation.js
r613 r627 149 149 args['editor'] = editor; 150 150 151 var parent = editor._getFirstAncestor(editor._getSelection(),['span' ,'math']);151 var parent = editor._getFirstAncestor(editor._getSelection(),['span']); 152 152 if (parent) 153 153 { … … 161 161 Equation.prototype.insert = function (param) 162 162 { 163 if ( param["formula"])163 if (typeof param["formula"] != "undefined") 164 164 { 165 var formula = param["formula"].replace(/^`?(.*)`?$/m,"`$1`");165 var formula = (param["formula"] != '') ? param["formula"].replace(/^`?(.*)`?$/m,"`$1`") : ''; 166 166 167 if (param["editedNode"] && (param["editedNode"].tagName.toLowerCase() == ' math'))167 if (param["editedNode"] && (param["editedNode"].tagName.toLowerCase() == 'span')) 168 168 { 169 var parent = param["editedNode"].parentNode;170 if ( parent.tagName.toLowerCase() == 'span')169 var span = param["editedNode"]; 170 if (formula != '') 171 171 { 172 parent.innerHTML = formula; 173 parent.title = formula; 174 172 span.innerHTML = formula; 173 span.title = formula; 175 174 } 176 175 else 177 176 { 178 parent.removeChild(param["editedNode"]); 179 param["editedNode"] = null; 177 span.parentNode.removeChild(span); 180 178 } 179 181 180 } 182 183 if (param["editedNode"] && (param["editedNode"].tagName.toLowerCase() == 'span')) 184 { 185 var span = param["editedNode"]; 186 span.innerHTML = formula; 187 span.title = formula; 188 } 189 else if (!param["editedNode"]) 181 else if (!param["editedNode"] && formula != '') 190 182 { 191 183 if (!HTMLArea.is_ie) -
trunk/plugins/Equation/lang/de.js
r613 r627 17 17 "Input":"Eingabe", 18 18 "Preview":"Vorschau", 19 "Based on ASCIIMathML by": "Basiert auf ASCIIMathML von", 20 "For more information on AsciiMathML visit this page:":"FÌr weitere Informationen besuchen Sie bitte diese Seite:" 19 "Based on ASCIIMathML by ": "Basiert auf ASCIIMathML von ", 20 "For more information on AsciiMathML visit this page: ":"FÌr weitere Informationen besuchen Sie bitte diese Seite: ", 21 "Attention: Editing the formula in the editor is not possible, please use this dialog!" : "Achtung, Àndern der Formel im Editor ist nicht möglich. Bitte benutzen Sie diesen Dialog!" 21 22 } -
trunk/plugins/Equation/popups/dialog.html
r613 r627 76 76 77 77 var inputField = document.getElementById("inputText"); 78 if (param["editedNode"] && param["editedNode"].tagName.toLowerCase() == 'math') 78 79 if (param["editedNode"] && param["editedNode"].tagName.toLowerCase() == 'span') 79 80 { 80 var formula = param["editedNode"].getAttribute("title") ;81 inputField.value = formula; 81 var formula = param["editedNode"].getAttribute("title").replace(/^`*(.*?)`*$/m,"$1");; 82 inputField.value = formula; 82 83 preview(); 83 }84 else if (param["editedNode"] && param["editedNode"].tagName.toLowerCase() == 'span')85 {86 var formula = param["editedNode"].innerHTML.replace(/^`?(.*?)`?$/m,"$1");;87 inputField.value = formula;88 84 } 89 85 else inputField.value = ''; … … 292 288 </tr> 293 289 <tr><td colspan="2"> 294 Based on ASCIIMathML by<a href="http://www.chapman.edu/~jipsen" target="new">Peter Jipsen</a>,290 <span>Based on ASCIIMathML by </span><a href="http://www.chapman.edu/~jipsen" target="new">Peter Jipsen</a>, 295 291 <a href="http://www.chapman.edu" target="new">Chapman University</a><br /> 296 For more information on AsciiMathML visit this page:<a href="http://www1.chapman.edu/~jipsen/mathml/asciimath.html" onclick="window.open(this.href,'_blank','');return false;">http://www1.chapman.edu/~jipsen/mathml/asciimath.html</a></td></tr>292 <span>For more information on AsciiMathML visit this page: </span><a href="http://www1.chapman.edu/~jipsen/mathml/asciimath.html" onclick="window.open(this.href,'_blank','');return false;">http://www1.chapman.edu/~jipsen/mathml/asciimath.html</a></td></tr> 297 293 </table> 298 294 299 295 <div id="buttons"> 296 <span style="color:red">Attention: Editing the formula in the editor is not possible, please use this dialog!</span> 300 297 <button type="submit" name="ok" onclick="return onOK();">OK</button> 301 298 <button type="button" name="cancel" onclick="return onCancel();">Cancel</button> -
trunk/plugins/Equation/readme.txt
r613 r627 10 10 The formmulae are stored in their ASCII representation, so you have to include the 11 11 ASCIIMathML library which can be found in the plugin folder in order render the MathML output in your pages. 12 Example: 13 <script type="text/javascript" src="/xinha/plugins/AsciiMath/ASCIIMathML.js" 12 13 Example (also see example.html): 14 var mathcolor = "black"; // You may change the color of the formulae (default: red) 15 var mathfontfamily = "Arial"; //and the font (default: serif, which is good I think) 16 var showasciiformulaonhover = false; // if true helps students learn ASCIIMath (default:true) 17 <script type="text/javascript" src="/xinha/plugins/AsciiMath/ASCIIMathML.js"></script> 14 18 15 The recommended browser for using this plugin is Mozilla/Firefox. 19 20 The recommended browser for using this plugin is Mozilla/Firefox. At the moment showing the MathML output 21 inside the editor is not supported in Internet Explorer. 22 16 23 17 24 License information
