Changeset 874
- Timestamp:
- 08/06/07 16:00:51 (6 years ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
XinhaCore.js (modified) (1 diff)
-
plugins/Equation/ASCIIMathML.js (modified) (7 diffs)
-
plugins/Equation/equation.js (modified) (3 diffs)
-
plugins/Equation/popups/dialog.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/XinhaCore.js
r873 r874 2326 2326 function() 2327 2327 { 2328 editor.firePluginEvent('onBeforeUnload'); 2328 2329 textarea.value = editor.outwardHtml(editor.getHTML()); 2329 2330 if (!Xinha.is_ie) -
trunk/plugins/Equation/ASCIIMathML.js
r873 r874 10 10 This is a convenient and inexpensive solution for authoring MathML. 11 11 12 Version 1.4.7 Aug 7, 2005, (c) Peter Jipsen http://www.chapman.edu/~jipsen12 Version 1.4.7 Dec 15, 2005, (c) Peter Jipsen http://www.chapman.edu/~jipsen 13 13 Latest version at http://www.chapman.edu/~jipsen/mathml/ASCIIMathML.js 14 14 For changes see http://www.chapman.edu/~jipsen/mathml/asciimathchanges.txt 15 15 If you use it on a webpage, please send the URL to jipsen@chapman.edu 16 16 17 This program is free software; you can redistribute it and/or modify 18 it under the terms of the GNU Lesser General Public License as published by 19 the Free Software Foundation; either version 2.1 of the License, or (at 20 your option) any later version. 21 22 This program is distributed in the hope that it will be useful, 23 but WITHOUT ANY WARRANTY; without even the implied warranty of 24 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 25 Lesser General Public License (at http://www.gnu.org/licenses/lgpl.html) 26 for more details. 27 28 NOTE: I have changed the license from GPL to LGPL according to a permission 29 from the author (see http://xinha.gogo.co.nz/punbb/viewtopic.php?pid=4150#p4150) 30 Raimund Meyer 11-29-2006 17 This program is free software; you can redistribute it and/or modify 18 it under the terms of the GNU General Public License as published by 19 the Free Software Foundation; either version 2 of the License, or (at 20 your option) any later version. 21 22 This program is distributed in the hope that it will be useful, 23 but WITHOUT ANY WARRANTY; without even the implied warranty of 24 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 25 General Public License (at http://www.gnu.org/copyleft/gpl.html) 26 for more details. 31 27 */ 32 28 33 29 var checkForMathML = true; // check if browser can display MathML 34 30 var notifyIfNoMathML = true; // put note at top of page if no MathML capability 35 31 var alertIfNoMathML = false; // show alert box if no MathML capability 36 32 if ( typeof mathcolor == "undefined" ) 37 33 { … … 194 190 {input:"-lt", tag:"mo", output:"\u227A", tex:null, ttype:CONST}, 195 191 {input:">-", tag:"mo", output:"\u227B", tex:"succ", ttype:CONST}, 192 {input:"-<=", tag:"mo", output:"\u2AAF", tex:"preceq", ttype:CONST}, 193 {input:">-=", tag:"mo", output:"\u2AB0", tex:"succeq", ttype:CONST}, 196 194 {input:"in", tag:"mo", output:"\u2208", tex:null, ttype:CONST}, 197 195 {input:"!in", tag:"mo", output:"\u2209", tex:"notin", ttype:CONST}, … … 449 447 tagst = (("A">st || st>"Z") && ("a">st || st>"z")?"mo":"mi"); 450 448 } 451 if (st=="-" && AMpreviousSymbol==INFIX) 449 if (st=="-" && AMpreviousSymbol==INFIX) { 450 AMcurrentSymbol = INFIX; //trick "/" into recognizing "-" on second parse 452 451 return {input:st, tag:tagst, output:st, ttype:UNARY, func:true}; 452 } 453 453 return {input:st, tag:tagst, output:st, ttype:CONST}; 454 454 } … … 540 540 if (typeof symbol.func == "boolean" && symbol.func) { // functions hack 541 541 st = str.charAt(0); 542 if (st=="^" || st=="_" || st=="/" || st=="|" ) {542 if (st=="^" || st=="_" || st=="/" || st=="|" || st==",") { 543 543 return [AMcreateMmlNode(symbol.tag, 544 544 document.createTextNode(symbol.output)),str]; … … 617 617 if (result[0].lastChild!=null) 618 618 st = result[0].lastChild.firstChild.nodeValue; 619 //alert(result[0].lastChild+"***"+st);620 619 if (st == "|") { // its an absolute value subterm 621 620 node = AMcreateMmlNode("mo",document.createTextNode(symbol.output)); … … 778 777 node.appendChild(AMparseExpr(str.replace(/^\s+/g,""),false)[0]); 779 778 node = AMcreateMmlNode("math",node); 780 if (showasciiformulaonhover) node.setAttribute("title",str); 779 if (showasciiformulaonhover) //fixed by djhsu so newline 780 node.setAttribute("title",str.replace(/\s+/g," "));//does not show in Gecko 781 781 if (mathfontfamily != "" && (isIE || mathfontfamily != "serif")) { 782 782 var fnode = AMcreateElementXHTML("font"); … … 839 839 checkForMathML = false; 840 840 var nd = AMisMathMLavailable(); 841 AMnoMathML = nd != null 841 AMnoMathML = nd != null; 842 842 if (AMnoMathML && notifyIfNoMathML) 843 AMbody.insertBefore(nd,AMbody.childNodes[0]); 843 if (alertIfNoMathML) 844 alert("To view the ASCIIMathML notation use Internet Explorer 6 +\nMathPlayer (free from www.dessci.com)\n\ 845 or Firefox/Mozilla/Netscape"); 846 else AMbody.insertBefore(nd,AMbody.childNodes[0]); 844 847 } 845 848 if (!AMnoMathML) { -
trunk/plugins/Equation/equation.js
r873 r874 56 56 } 57 57 ); 58 this.onBeforeSubmit = function () {debugger;self.unParse();self.reParse = true};58 this.onBeforeSubmit = this.onBeforeUnload = function () {self.unParse();self.reParse = true}; 59 59 } 60 60 … … 74 74 Equation._pluginInfo = { 75 75 name : "ASCIIMathML Formula Editor", 76 version : "2. 0",76 version : "2.1 (2007-08-06)", 77 77 developer : "Raimund Meyer", 78 78 developer_url : "http://rheinaufCMS.de", … … 95 95 if (!Xinha.is_ie && this.reParse) AMprocessNode(this.editor._doc.body, false); 96 96 }; 97 97 98 98 99 Equation.prototype.onModeChange = function( args ) -
trunk/plugins/Equation/popups/dialog.html
r859 r874 38 38 window.resizeTo(500, 300); 39 39 var showasciiformulaonhover = false; 40 Xinha = window.opener.Xinha; 40 if (typeof Xinha == "undefined") 41 Xinha = window.opener.Xinha; 41 42 42 43 function i18n(str) {
