[LON-CAPA-cvs] cvs: loncom /html/adm/LC_math_editor/dist LC_math_editor.min.js /html/adm/LC_math_editor/src enode.js
damieng
damieng at source.lon-capa.org
Fri Jan 27 15:31:09 EST 2017
damieng Fri Jan 27 20:31:09 2017 EDT
Modified files:
/loncom/html/adm/LC_math_editor/dist LC_math_editor.min.js
/loncom/html/adm/LC_math_editor/src enode.js
Log:
using definitions' argument separator to display sets
-------------- next part --------------
Index: loncom/html/adm/LC_math_editor/dist/LC_math_editor.min.js
diff -u loncom/html/adm/LC_math_editor/dist/LC_math_editor.min.js:1.6 loncom/html/adm/LC_math_editor/dist/LC_math_editor.min.js:1.7
--- loncom/html/adm/LC_math_editor/dist/LC_math_editor.min.js:1.6 Thu Jan 5 13:55:26 2017
+++ loncom/html/adm/LC_math_editor/dist/LC_math_editor.min.js Fri Jan 27 20:31:02 2017
@@ -1,14 +1,14 @@
-'use strict';var LCMATH=function(){function l(){this.operators=[]}function e(b,a,c,g,f){this.type=b;this.op=a;this.value=c;this.children=g;this.interval_type="undefined"==typeof f?e.NOT_AN_INTERVAL:f}function p(b,a,c,g,f,e){this.id=b;this.arity=a;this.lbp=c;this.rbp=g;this.nud=f;this.led=e}function n(b,a,c){this.msg=b;this.from=a;this.to=c?c:this.from}function r(b,a,c){this.implicit_operators="undefined"==typeof b?!1:b;this.unit_mode="undefined"==typeof a?!1:a;this.constants="undefined"==typeof c||
-null==c?[]:c;this.defs=new l;this.defs.define();this.operators=this.defs.operators;this.oph={};for(b=0;b<this.operators.length;b++)this.oph[this.operators[b].id]=this.operators[b]}function t(b,a){this.defs=b;this.text=a}function k(b,a,c,g,f){this.type=b;this.from=a;this.to=c;this.value=g;this.op=f}l.ARG_SEPARATOR=",";l.DECIMAL_SIGN_1=".";l.DECIMAL_SIGN_2=".";l.INTERVAL_SEPARATOR=":";l.prototype.operator=function(b,a,c,g,f,e){this.operators.push(new p(b,a,c,g,f,e))};l.prototype.separator=function(b){this.operator(b,
-p.BINARY,0,0,null,null)};l.prototype.infix=function(b,a,c,g){var f;f=p.BINARY;g=g||function(a,d){var f=[d,a.expression(c)];return new e(e.OPERATOR,this,b,f)};this.operator(b,f,a,c,null,g)};l.prototype.prefix=function(b,a,c){var g;g=p.UNARY;c=c||function(c){c=[c.expression(a)];return new e(e.OPERATOR,this,b,c)};this.operator(b,g,0,a,c,null)};l.prototype.suffix=function(b,a,c){var g;g=p.UNARY;c=c||function(a,c){return new e(e.OPERATOR,this,b,[c])};this.operator(b,g,a,0,null,c)};l.prototype.findOperator=
-function(b){for(var a=0;a<this.operators.length;a++)if(this.operators[a].id==b)return this.operators[a];return null};l.prototype.buildInterval=function(b,a,c,g){g.advance(l.INTERVAL_SEPARATOR);var f=g.expression(0);if(null==g.current_token||null==g.current_token.op||")"!==g.current_token.op.id&&"]"!==g.current_token.op.id)throw new n("Wrong interval syntax.",g.tokens[g.token_nr-1].from);")"==g.current_token.op.id?(g.advance(")"),b=b?e.CLOSED_OPEN:e.OPEN_OPEN):(g.advance("]"),b=b?e.CLOSED_CLOSED:e.OPEN_CLOSED);
-return new e(e.INTERVAL,c,null,[a,f],b)};l.prototype.define=function(){this.suffix("!",160);this.infix("^",140,139);this.infix(".",130,129);this.infix("`",125,125,function(a,b){for(var g=a.expression(125);null!=a.current_token&&-1!="*/".indexOf(a.current_token.value);){var f=a.tokens[a.token_nr];if(null==f)break;if(f.type!=k.NAME&&"("!=f.value)break;f=a.tokens[a.token_nr+1];if(null!=f&&("("==f.value||f.type==k.NUMBER))break;if(a.unit_mode&&a.tokens[a.token_nr].type==k.NAME){for(var f=a.tokens[a.token_nr].value,
+'use strict';var LCMATH=function(){function k(){this.operators=[]}function e(b,a,c,g,f){this.type=b;this.op=a;this.value=c;this.children=g;this.interval_type="undefined"==typeof f?e.NOT_AN_INTERVAL:f}function p(b,a,c,g,f,e){this.id=b;this.arity=a;this.lbp=c;this.rbp=g;this.nud=f;this.led=e}function n(b,a,c){this.msg=b;this.from=a;this.to=c?c:this.from}function r(b,a,c){this.implicit_operators="undefined"==typeof b?!1:b;this.unit_mode="undefined"==typeof a?!1:a;this.constants="undefined"==typeof c||
+null==c?[]:c;this.defs=new k;this.defs.define();this.operators=this.defs.operators;this.oph={};for(b=0;b<this.operators.length;b++)this.oph[this.operators[b].id]=this.operators[b]}function t(b,a){this.defs=b;this.text=a}function l(b,a,c,g,f){this.type=b;this.from=a;this.to=c;this.value=g;this.op=f}k.ARG_SEPARATOR=",";k.DECIMAL_SIGN_1=".";k.DECIMAL_SIGN_2=".";k.INTERVAL_SEPARATOR=":";k.prototype.operator=function(b,a,c,g,f,e){this.operators.push(new p(b,a,c,g,f,e))};k.prototype.separator=function(b){this.operator(b,
+p.BINARY,0,0,null,null)};k.prototype.infix=function(b,a,c,g){var f;f=p.BINARY;g=g||function(a,d){var f=[d,a.expression(c)];return new e(e.OPERATOR,this,b,f)};this.operator(b,f,a,c,null,g)};k.prototype.prefix=function(b,a,c){var g;g=p.UNARY;c=c||function(c){c=[c.expression(a)];return new e(e.OPERATOR,this,b,c)};this.operator(b,g,0,a,c,null)};k.prototype.suffix=function(b,a,c){var g;g=p.UNARY;c=c||function(a,c){return new e(e.OPERATOR,this,b,[c])};this.operator(b,g,a,0,null,c)};k.prototype.findOperator=
+function(b){for(var a=0;a<this.operators.length;a++)if(this.operators[a].id==b)return this.operators[a];return null};k.prototype.buildInterval=function(b,a,c,g){g.advance(k.INTERVAL_SEPARATOR);var f=g.expression(0);if(null==g.current_token||null==g.current_token.op||")"!==g.current_token.op.id&&"]"!==g.current_token.op.id)throw new n("Wrong interval syntax.",g.tokens[g.token_nr-1].from);")"==g.current_token.op.id?(g.advance(")"),b=b?e.CLOSED_OPEN:e.OPEN_OPEN):(g.advance("]"),b=b?e.CLOSED_CLOSED:e.OPEN_CLOSED);
+return new e(e.INTERVAL,c,null,[a,f],b)};k.prototype.define=function(){this.suffix("!",160);this.infix("^",140,139);this.infix(".",130,129);this.infix("`",125,125,function(a,b){for(var g=a.expression(125);null!=a.current_token&&-1!="*/".indexOf(a.current_token.value);){var f=a.tokens[a.token_nr];if(null==f)break;if(f.type!=l.NAME&&"("!=f.value)break;f=a.tokens[a.token_nr+1];if(null!=f&&("("==f.value||f.type==l.NUMBER))break;if(a.unit_mode&&a.tokens[a.token_nr].type==l.NAME){for(var f=a.tokens[a.token_nr].value,
m=!1,d=0;d<a.constants.length;d++)if(f==a.constants[d]){m=!0;break}if(m)break}f=a.current_token;a.advance();g=f.op.led(a,g)}return new e(e.OPERATOR,this,"`",[b,g])});this.infix("*",120,120);this.infix("/",120,120);this.infix("%",120,120);this.infix("+",100,100);this.operator("-",p.BINARY,100,134,function(a){a=[a.expression(134)];return new e(e.OPERATOR,this,"-",a)},function(a,b){var g=[b,a.expression(100)];return new e(e.OPERATOR,this,"-",g)});this.infix("=",80,80);this.infix("#",80,80);this.infix("<=",
-80,80);this.infix(">=",80,80);this.infix("<",80,80);this.infix(">",80,80);this.separator(")");this.separator(l.ARG_SEPARATOR);this.separator(l.INTERVAL_SEPARATOR);var b=this;this.operator("(",p.BINARY,200,200,function(a){var c=a.expression(0);if(null!=a.current_token&&null!=a.current_token.op&&a.current_token.op.id==l.INTERVAL_SEPARATOR)return b.buildInterval(!1,c,this,a);a.advance(")");return c},function(a,b){if(b.type!=e.NAME&&b.type!=e.SUBSCRIPT)throw new n("Function name expected before a parenthesis.",
-a.tokens[a.token_nr-1].from);var g=[b];if(null==a.current_token||null==a.current_token.op||")"!==a.current_token.op.id)for(;;){g.push(a.expression(0));if(null==a.current_token||null==a.current_token.op||a.current_token.op.id!==l.ARG_SEPARATOR)break;a.advance(l.ARG_SEPARATOR)}a.advance(")");return new e(e.FUNCTION,this,"(",g)});this.separator("]");this.operator("[",p.BINARY,200,70,function(a){var c=[];if(null==a.current_token||null==a.current_token.op||"]"!==a.current_token.op.id){var g=a.expression(0);
-if(null!=a.current_token&&null!=a.current_token.op&&a.current_token.op.id==l.INTERVAL_SEPARATOR)return b.buildInterval(!0,g,this,a);for(;;){c.push(g);if(null==a.current_token||null==a.current_token.op||a.current_token.op.id!==l.ARG_SEPARATOR)break;a.advance(l.ARG_SEPARATOR);g=a.expression(0)}}a.advance("]");return new e(e.VECTOR,this,null,c)},function(a,b){if(b.type!=e.NAME&&b.type!=e.SUBSCRIPT)throw new n("Name expected before a square bracket.",a.tokens[a.token_nr-1].from);var g=[b];if(null==a.current_token||
-null==a.current_token.op||"]"!==a.current_token.op.id)for(;;){g.push(a.expression(0));if(null==a.current_token||null==a.current_token.op||a.current_token.op.id!==l.ARG_SEPARATOR)break;a.advance(l.ARG_SEPARATOR)}a.advance("]");return new e(e.SUBSCRIPT,this,"[",g)});this.separator("}");this.prefix("{",200,function(a){var b=[];if(null==a.current_token||null==a.current_token.op||"}"!==a.current_token.op.id)for(;;){b.push(a.expression(0));if(null==a.current_token||null==a.current_token.op||a.current_token.op.id!==
-l.ARG_SEPARATOR)break;a.advance(l.ARG_SEPARATOR)}a.advance("}");return new e(e.SET,this,null,b)});this.prefix("$",300,function(a){var b=a.expression(300);if(b.type!=e.NAME)throw new n("Variable name expected after a $.",a.tokens[a.token_nr-1].from);b.value="$"+b.value;return b})};"use strict";e.UNKNOWN=0;e.NAME=1;e.NUMBER=2;e.OPERATOR=3;e.FUNCTION=4;e.VECTOR=5;e.INTERVAL=6;e.SET=7;e.SUBSCRIPT=8;e.COLORS="#E01010 #0010FF #009000 #FF00FF #00B0B0 #F09000 #800080 #F080A0 #6090F0 #902000 #70A050 #A07060 #5000FF #E06050 #008080 #808000".split(" ");
+80,80);this.infix(">=",80,80);this.infix("<",80,80);this.infix(">",80,80);this.separator(")");this.separator(k.ARG_SEPARATOR);this.separator(k.INTERVAL_SEPARATOR);var b=this;this.operator("(",p.BINARY,200,200,function(a){var c=a.expression(0);if(null!=a.current_token&&null!=a.current_token.op&&a.current_token.op.id==k.INTERVAL_SEPARATOR)return b.buildInterval(!1,c,this,a);a.advance(")");return c},function(a,b){if(b.type!=e.NAME&&b.type!=e.SUBSCRIPT)throw new n("Function name expected before a parenthesis.",
+a.tokens[a.token_nr-1].from);var g=[b];if(null==a.current_token||null==a.current_token.op||")"!==a.current_token.op.id)for(;;){g.push(a.expression(0));if(null==a.current_token||null==a.current_token.op||a.current_token.op.id!==k.ARG_SEPARATOR)break;a.advance(k.ARG_SEPARATOR)}a.advance(")");return new e(e.FUNCTION,this,"(",g)});this.separator("]");this.operator("[",p.BINARY,200,70,function(a){var c=[];if(null==a.current_token||null==a.current_token.op||"]"!==a.current_token.op.id){var g=a.expression(0);
+if(null!=a.current_token&&null!=a.current_token.op&&a.current_token.op.id==k.INTERVAL_SEPARATOR)return b.buildInterval(!0,g,this,a);for(;;){c.push(g);if(null==a.current_token||null==a.current_token.op||a.current_token.op.id!==k.ARG_SEPARATOR)break;a.advance(k.ARG_SEPARATOR);g=a.expression(0)}}a.advance("]");return new e(e.VECTOR,this,null,c)},function(a,b){if(b.type!=e.NAME&&b.type!=e.SUBSCRIPT)throw new n("Name expected before a square bracket.",a.tokens[a.token_nr-1].from);var g=[b];if(null==a.current_token||
+null==a.current_token.op||"]"!==a.current_token.op.id)for(;;){g.push(a.expression(0));if(null==a.current_token||null==a.current_token.op||a.current_token.op.id!==k.ARG_SEPARATOR)break;a.advance(k.ARG_SEPARATOR)}a.advance("]");return new e(e.SUBSCRIPT,this,"[",g)});this.separator("}");this.prefix("{",200,function(a){var b=[];if(null==a.current_token||null==a.current_token.op||"}"!==a.current_token.op.id)for(;;){b.push(a.expression(0));if(null==a.current_token||null==a.current_token.op||a.current_token.op.id!==
+k.ARG_SEPARATOR)break;a.advance(k.ARG_SEPARATOR)}a.advance("}");return new e(e.SET,this,null,b)});this.prefix("$",300,function(a){var b=a.expression(300);if(b.type!=e.NAME)throw new n("Variable name expected after a $.",a.tokens[a.token_nr-1].from);b.value="$"+b.value;return b})};"use strict";e.UNKNOWN=0;e.NAME=1;e.NUMBER=2;e.OPERATOR=3;e.FUNCTION=4;e.VECTOR=5;e.INTERVAL=6;e.SET=7;e.SUBSCRIPT=8;e.COLORS="#E01010 #0010FF #009000 #FF00FF #00B0B0 #F09000 #800080 #F080A0 #6090F0 #902000 #70A050 #A07060 #5000FF #E06050 #008080 #808000".split(" ");
e.NOT_AN_INTERVAL=0;e.OPEN_OPEN=1;e.OPEN_CLOSED=2;e.CLOSED_OPEN=3;e.CLOSED_CLOSED=4;e.prototype.toString=function(){var b="(";switch(this.type){case e.UNKNOWN:b+="UNKNOWN";break;case e.NAME:b+="NAME";break;case e.NUMBER:b+="NUMBER";break;case e.OPERATOR:b+="OPERATOR";break;case e.FUNCTION:b+="FUNCTION";break;case e.VECTOR:b+="VECTOR";break;case e.INTERVAL:b+="INTERVAL";break;case e.SET:b+="SET";break;case e.SUBSCRIPT:b+="SUBSCRIPT"}this.op&&(b+=" '"+this.op.id+"'");this.value&&(b+=" '"+this.value+
"'");if(this.children){for(var b=b+" [",a=0;a<this.children.length;a++)b+=this.children[a].toString(),a!=this.children.length-1&&(b+=",");b+="]"}this.interval_type&&(b+=" "+this.interval_type);return b+")"};e.prototype.getColorForIdentifier=function(b,a){var c=a.hcolors[b];c||(c=a.colors?a.colors:e.COLORS,c=c[Object.keys(a.hcolors).length%c.length],a.hcolors[b]=c);return c};e.prototype.toMathML=function(b){return this._toMathML({hcolors:{},depth:0,colors:b})};e.prototype._toMathML=function(b){var a,
c,g,f,m,d,h;a=null!=this.children&&0<this.children.length?this.children[0]:null;c=null!=this.children&&1<this.children.length?this.children[1]:null;g=null!=this.children&&2<this.children.length?this.children[2]:null;f=null!=this.children&&3<this.children.length?this.children[3]:null;m=null!=this.children&&4<this.children.length?this.children[4]:null;switch(this.type){case e.UNKNOWN:return d=document.createElement("mtext"),d.appendChild(document.createTextNode("???")),d;case e.NAME:return 0<=this.value.search(/^[a-zA-Z]+[0-9]+$/)?
@@ -23,33 +23,33 @@
h=document.createElement("mrow"),h.appendChild(this.mi("d")),h.appendChild(this.mi(g.value)),m.appendChild(h),d.appendChild(m),c.type!=e.OPERATOR||"+"!=c.value&&"-"!=c.value?d.appendChild(c._toMathML(b)):d.appendChild(this.addP(c,b));else if("diff"==a.value&&null!=this.children&&4==this.children.length)d=document.createElement("mrow"),m=document.createElement("mfrac"),a=document.createElement("msup"),a.appendChild(this.mi("d")),a.appendChild(f._toMathML(b)),m.appendChild(a),h=document.createElement("mrow"),
h.appendChild(this.mi("d")),a=document.createElement("msup"),a.appendChild(g._toMathML(b)),a.appendChild(f._toMathML(b)),h.appendChild(a),m.appendChild(h),d.appendChild(m),c.type!=e.OPERATOR||"+"!=c.value&&"-"!=c.value?d.appendChild(c._toMathML(b)):d.appendChild(this.addP(c,b));else if("integrate"==a.value&&null!=this.children&&3==this.children.length)d=document.createElement("mrow"),h=this.mo("\u222b"),h.setAttribute("stretchy","true"),d.appendChild(h),g.type!=e.OPERATOR||"+"!=g.value&&"-"!=g.value?
d.appendChild(c._toMathML(b)):d.appendChild(this.addP(c,b)),d.appendChild(this.mi("d")),d.appendChild(g._toMathML(b));else if("integrate"==a.value&&null!=this.children&&5==this.children.length)d=document.createElement("mrow"),a=document.createElement("msubsup"),h=this.mo("\u222b"),h.setAttribute("stretchy","true"),a.appendChild(h),a.appendChild(f._toMathML(b)),a.appendChild(m._toMathML(b)),d.appendChild(a),g.type!=e.OPERATOR||"+"!=g.value&&"-"!=g.value?d.appendChild(c._toMathML(b)):d.appendChild(this.addP(c,
-b)),d.appendChild(this.mi("d")),d.appendChild(g._toMathML(b));else if("sum"==a.value&&null!=this.children&&5==this.children.length){d=document.createElement("mrow");var k=document.createElement("munderover");h=this.mo("\u2211");h.setAttribute("stretchy","true");k.appendChild(h);a=document.createElement("mrow");a.appendChild(g._toMathML(b));a.appendChild(this.mo("="));a.appendChild(f._toMathML(b));k.appendChild(a);k.appendChild(m._toMathML(b));d.appendChild(k);g.type!=e.OPERATOR||"+"!=g.value&&"-"!=
-g.value?d.appendChild(c._toMathML(b)):d.appendChild(this.addP(c,b))}else if("product"==a.value&&null!=this.children&&5==this.children.length)d=document.createElement("mrow"),k=document.createElement("munderover"),h=this.mo("\u220f"),h.setAttribute("stretchy","true"),k.appendChild(h),a=document.createElement("mrow"),a.appendChild(g._toMathML(b)),a.appendChild(this.mo("=")),a.appendChild(f._toMathML(b)),k.appendChild(a),k.appendChild(m._toMathML(b)),d.appendChild(k),g.type!=e.OPERATOR||"+"!=g.value&&
+b)),d.appendChild(this.mi("d")),d.appendChild(g._toMathML(b));else if("sum"==a.value&&null!=this.children&&5==this.children.length){d=document.createElement("mrow");var l=document.createElement("munderover");h=this.mo("\u2211");h.setAttribute("stretchy","true");l.appendChild(h);a=document.createElement("mrow");a.appendChild(g._toMathML(b));a.appendChild(this.mo("="));a.appendChild(f._toMathML(b));l.appendChild(a);l.appendChild(m._toMathML(b));d.appendChild(l);g.type!=e.OPERATOR||"+"!=g.value&&"-"!=
+g.value?d.appendChild(c._toMathML(b)):d.appendChild(this.addP(c,b))}else if("product"==a.value&&null!=this.children&&5==this.children.length)d=document.createElement("mrow"),l=document.createElement("munderover"),h=this.mo("\u220f"),h.setAttribute("stretchy","true"),l.appendChild(h),a=document.createElement("mrow"),a.appendChild(g._toMathML(b)),a.appendChild(this.mo("=")),a.appendChild(f._toMathML(b)),l.appendChild(a),l.appendChild(m._toMathML(b)),d.appendChild(l),g.type!=e.OPERATOR||"+"!=g.value&&
"-"!=g.value?d.appendChild(c._toMathML(b)):d.appendChild(this.addP(c,b));else if("limit"==a.value)d=document.createElement("mrow"),4>this.children.length?d.appendChild(this.mo("lim")):(a=document.createElement("munder"),a.appendChild(this.mo("lim")),h=document.createElement("mrow"),h.appendChild(g._toMathML(b)),h.appendChild(this.mo("\u2192")),h.appendChild(f._toMathML(b)),null!=m&&("plus"==m.value?h.appendChild(this.mo("+")):"minus"==m.value&&h.appendChild(this.mo("-"))),a.appendChild(h),d.appendChild(a)),
d.appendChild(c._toMathML(b));else if("binomial"==a.value){d=document.createElement("mrow");d.appendChild(this.mo("("));g=document.createElement("mtable");for(f=1;f<this.children.length;f++)a=document.createElement("mtr"),a.appendChild(this.children[f]._toMathML(b)),g.appendChild(a);d.appendChild(g);d.appendChild(this.mo(")"))}else if("matrix"==a.value){for(f=1;f<this.children.length;f++)if(this.children[f].type!==e.VECTOR)return d=document.createElement("mtext"),d.appendChild(document.createTextNode("???")),
d;d=document.createElement("mrow");d.appendChild(this.mo("("));g=document.createElement("mtable");for(f=1;f<this.children.length;f++){a=document.createElement("mtr");for(c=0;c<this.children[f].children.length;c++)a.appendChild(this.children[f].children[c]._toMathML(b));g.appendChild(a)}d.appendChild(g);d.appendChild(this.mo(")"))}else if("union"==a.value&&3==this.children.length){for(f=1;f<this.children.length;f++)if(this.children[f].type!==e.INTERVAL&&this.children[f].type!==e.SET)return d=document.createElement("mtext"),
d.appendChild(document.createTextNode("???")),d;d=document.createElement("mrow");d.appendChild(c._toMathML(b));d.appendChild(this.mo("\u222a"));d.appendChild(g._toMathML(b))}else if("intersection"==a.value&&3==this.children.length){for(f=1;f<this.children.length;f++)if(this.children[f].type!==e.INTERVAL&&this.children[f].type!==e.SET)return d=document.createElement("mtext"),d.appendChild(document.createTextNode("???")),d;d=document.createElement("mrow");d.appendChild(c._toMathML(b));d.appendChild(this.mo("\u2229"));
-d.appendChild(g._toMathML(b))}else{d=document.createElement("mrow");d.appendChild(a._toMathML(b));d.appendChild(this.mo("("));for(f=1;f<this.children.length;f++)d.appendChild(this.children[f]._toMathML(b)),f<this.children.length-1&&d.appendChild(this.mo(l.ARG_SEPARATOR));d.appendChild(this.mo(")"))}return d;case e.VECTOR:m=!0;for(f=0;f<this.children.length;f++)this.children[f].type!==e.VECTOR&&(m=!1);d=document.createElement("mrow");d.appendChild(this.mo("("));g=document.createElement("mtable");for(f=
+d.appendChild(g._toMathML(b))}else{d=document.createElement("mrow");d.appendChild(a._toMathML(b));d.appendChild(this.mo("("));for(f=1;f<this.children.length;f++)d.appendChild(this.children[f]._toMathML(b)),f<this.children.length-1&&d.appendChild(this.mo(k.ARG_SEPARATOR));d.appendChild(this.mo(")"))}return d;case e.VECTOR:m=!0;for(f=0;f<this.children.length;f++)this.children[f].type!==e.VECTOR&&(m=!1);d=document.createElement("mrow");d.appendChild(this.mo("("));g=document.createElement("mtable");for(f=
0;f<this.children.length;f++){a=document.createElement("mtr");if(m)for(c=0;c<this.children[f].children.length;c++)a.appendChild(this.children[f].children[c]._toMathML(b));else a.appendChild(this.children[f]._toMathML(b));g.appendChild(a)}d.appendChild(g);d.appendChild(this.mo(")"));return d;case e.INTERVAL:return d=document.createElement("mrow"),h=this.interval_type==e.OPEN_OPEN||this.interval_type==e.OPEN_CLOSED?this.mo("("):this.mo("["),d.appendChild(h),a=document.createElement("mrow"),a.appendChild(this.children[0]._toMathML(b)),
-a.appendChild(this.mo(":")),a.appendChild(this.children[1]._toMathML(b)),d.appendChild(a),h=this.interval_type==e.OPEN_OPEN||this.interval_type==e.CLOSED_OPEN?this.mo(")"):this.mo("]"),d.appendChild(h),d;case e.SET:d=document.createElement("mrow");d.appendChild(this.mo("{"));a=document.createElement("mrow");for(f=0;f<this.children.length;f++)0<f&&a.appendChild(this.mo(";")),a.appendChild(this.children[f]._toMathML(b));d.appendChild(a);d.appendChild(this.mo("}"));return d;case e.SUBSCRIPT:g=document.createElement("msub");
-g.appendChild(a._toMathML(b));if(2<this.children.length){d=document.createElement("mrow");for(f=1;f<this.children.length;f++)d.appendChild(this.children[f]._toMathML(b)),f<this.children.length-1&&d.appendChild(this.mo(l.ARG_SEPARATOR));g.appendChild(d)}else g.appendChild(c._toMathML(b));return g}};e.prototype.mi=function(b){var a=document.createElement("mi");e.symbols[b]&&(b=e.symbols[b]);a.appendChild(document.createTextNode(b));return a};e.prototype.mn=function(b){var a=document.createElement("mn");
-a.appendChild(document.createTextNode(b));return a};e.prototype.mo=function(b){var a=document.createElement("mo");e.symbols[b]&&(b=e.symbols[b]);a.appendChild(document.createTextNode(b));return a};e.prototype.addP=function(b,a){var c,g;c=document.createElement("mrow");g=this.mo("(");var f;f=a.colors?a.colors:e.COLORS;g.setAttribute("mathcolor",f[a.depth%f.length]);c.appendChild(g);a.depth++;c.appendChild(b._toMathML(a));a.depth--;g=this.mo(")");g.setAttribute("mathcolor",f[a.depth%f.length]);c.appendChild(g);
-return c};e.symbols={alpha:"\u03b1",beta:"\u03b2",gamma:"\u03b3",delta:"\u03b4",epsilon:"\u03b5",zeta:"\u03b6",eta:"\u03b7",theta:"\u03b8",iota:"\u03b9",kappa:"\u03ba",lambda:"\u03bb",mu:"\u03bc",nu:"\u03bd",xi:"\u03be",omicron:"\u03bf",pi:"\u03c0",rho:"\u03c1",sigma:"\u03c3",tau:"\u03c4",upsilon:"\u03c5",phi:"\u03c6",chi:"\u03c7",psi:"\u03c8",omega:"\u03c9",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039a",
-Lambda:"\u039b",Mu:"\u039c",Nu:"\u039d",Xi:"\u039e",Omicron:"\u039f",Pi:"\u03a0",Rho:"\u03a1",Sigma:"\u03a3",Tau:"\u03a4",Upsilon:"\u03a5",Phi:"\u03a6",Chi:"\u03a7",Psi:"\u03a8",Omega:"\u03a9","#":"\u2260",">=":"\u2265","<=":"\u2264",inf:"\u221e",minf:"-\u221e",hbar:"\u210f",G:"\ud835\udca2"};"use strict";p.UNKNOWN=0;p.UNARY=1;p.BINARY=2;p.TERNARY=3;"use strict";n.prototype.toString=function(){return this.msg+" at "+this.from+" - "+this.to};"use strict";r.prototype.expression=function(b){var a,c=
-this.current_token;if(null==c)throw new n("Expected something at the end",this.tokens[this.tokens.length-1].to+1);this.advance();if(null==c.op)a=new e(c.type,null,c.value,null);else{if(null==c.op.nud)throw new n("Unexpected operator '"+c.op.id+"'",c.from);a=c.op.nud(this)}for(;null!=this.current_token&&null!=this.current_token.op&&b<this.current_token.op.lbp;)c=this.current_token,this.advance(),a=c.op.led(this,a);return a};r.prototype.advance=function(b){if(b&&(null==this.current_token||null==this.current_token.op||
-this.current_token.op.id!==b)){if(null==this.current_token)throw new n("Expected '"+b+"' at the end",this.tokens[this.tokens.length-1].to+1);throw new n("Expected '"+b+"'",this.current_token.from);}this.token_nr>=this.tokens.length?this.current_token=null:(this.current_token=this.tokens[this.token_nr],this.token_nr+=1)};r.prototype.addHiddenOperators=function(){for(var b=this.defs.findOperator("*"),a=this.defs.findOperator("`"),c=!1,g=!1,f=0;f<this.tokens.length-1;f++){var e=this.tokens[f],d=this.tokens[f+
-1];this.unit_mode&&("`"==e.value?c=!0:c&&("^"==e.value?g=!0:g&&e.type==k.NUMBER?g=!1:g||e.type!=k.NUMBER?g||e.type!=k.OPERATOR||-1!="*/^()".indexOf(e.value)?e.type==k.NAME&&"("==d.value&&(c=!1):c=!1:c=!1));if(e.type==k.NAME&&d.type==k.NAME||e.type==k.NUMBER&&d.type==k.NAME||e.type==k.NUMBER&&d.type==k.NUMBER||e.type==k.NUMBER&&("("==d.value||"["==d.value||"{"==d.value)||(")"==e.value||"]"==e.value||"}"==e.value)&&d.type==k.NAME||(")"==e.value||"]"==e.value||"}"==e.value)&&d.type==k.NUMBER||(")"==
-e.value||"]"==e.value||"}"==e.value)&&"("==d.value){if(e=this.unit_mode&&!c&&(e.type==k.NUMBER||")"==e.value||"]"==e.value||"}"==e.value)&&(d.type==k.NAME||("("==d.value||"["==d.value||"{"==d.value)&&this.tokens.length>f+2&&this.tokens[f+2].type==k.NAME)){var h,l;d.type==k.NAME?(h=d,l=f+1):(l=f+2,h=this.tokens[l]);for(var s=0;s<this.constants.length;s++)if(h.value==this.constants[s]){e=!1;break}if(this.tokens.length>l+1&&"("==this.tokens[l+1].value)for(l="pow sqrt abs exp factorial diff integrate sum product limit binomial matrix ln log log10 mod signum ceiling floor sin cos tan asin acos atan atan2 sinh cosh tanh asinh acosh atanh".split(" "),
-s=0;s<l.length;s++)if(h.value==l[s]){e=!1;break}}e?(d=new k(k.OPERATOR,d.from,d.from,a.id,a),c=!0):d=new k(k.OPERATOR,d.from,d.from,b.id,b);this.tokens.splice(f+1,0,d)}}};r.prototype.parse=function(b){this.tokens=(new t(this.defs,b)).tokenize();if(0==this.tokens.length)return null;this.implicit_operators&&this.addHiddenOperators();this.token_nr=0;this.current_token=this.tokens[this.token_nr];this.advance();b=this.expression(0);if(null!=this.current_token)throw new n("Expected the end",this.current_token.from);
-return b};"use strict";t.prototype.tokenize=function(){var b,a,c,g,f;a=0;b=this.text.charAt(a);f=[];a:for(;b;)if(g=a," ">=b)a++,b=this.text.charAt(a);else{if("0"<=b&&"9">=b||(b===l.DECIMAL_SIGN_1||b===l.DECIMAL_SIGN_2)&&"0"<=this.text.charAt(a+1)&&"9">=this.text.charAt(a+1)){c="";if(b!==l.DECIMAL_SIGN_1&&b!==l.DECIMAL_SIGN_2)for(a++,c+=b;;){b=this.text.charAt(a);if("0">b||"9"<b)break;a++;c+=b}if(b===l.DECIMAL_SIGN_1||b===l.DECIMAL_SIGN_2)for(a++,c+=b;;){b=this.text.charAt(a);if("0">b||"9"<b)break;
-a+=1;c+=b}if("e"===b||"E"===b){a++;c+=b;b=this.text.charAt(a);if("-"===b||"+"===b)a++,c+=b,b=this.text.charAt(a);if("0">b||"9"<b)throw new n("syntax error in number exponent",g,a);do a++,c+=b,b=this.text.charAt(a);while("0"<=b&&"9">=b)}var e=+c.replace(l.DECIMAL_SIGN_1,".").replace(l.DECIMAL_SIGN_2,".");if(isFinite(e)){f.push(new k(k.NUMBER,g,a-1,c,null));continue}else throw new n("syntax error in number",g,a);}for(c=0;c<this.defs.operators.length;c++)if(e=this.defs.operators[c],this.text.substring(a,
-a+e.id.length)===e.id){a+=e.id.length;b=this.text.charAt(a);f.push(new k(k.OPERATOR,g,a-1,e.id,e));continue a}if("a"<=b&&"z">=b||"A"<=b&&"Z">=b||"\u03b1"<=b&&"\u03c9">=b||"\u0391"<=b&&"\u03a9">=b||"\u00b5"==b||"\u00b0"==b){c=b;for(a++;;)if(b=this.text.charAt(a),"a"<=b&&"z">=b||"A"<=b&&"Z">=b||"\u03b1"<=b&&"\u03c9">=b||"\u0391"<=b&&"\u03a9">=b||"\u00b5"==b||"0"<=b&&"9">=b||"_"===b)c+=b,a++;else break;f.push(new k(k.NAME,g,a-1,c,null))}else throw new n("unrecognized operator",g,a);}return f};"use strict";
-k.UNKNOWN=0;k.NAME=1;k.NUMBER=2;k.OPERATOR=3;"use strict";var u=function(b){var a,c,e,f,m;a=b.ta;c=b.output_node;a=a.value;f="";for(m=a;m!=f;)f=m,m=f.replace(/\[[^\[\]]*\]/g,"");if(m.split("[").length==m.split("]").length){for(f="";m!=f;)f=m,m=f.replace(/\([^\(\)]*\)/g,"");if(m.split("(").length==m.split(")").length){for(f="";m!=f;)f=m,m=f.replace(/\{[^\{\}]*\}/g,"");m.split("{").length==m.split("}").length&&-1!=m.indexOf(l.ARG_SEPARATOR)&&(a="["+a+"]")}}if(a!=b.oldtxt){for(b.oldtxt=a;null!=c.firstChild;)c.removeChild(c.firstChild);
-c.removeAttribute("title");if(""!=a){b=b.parser;try{if(e=b.parse(a),null!=e){var d=document.createElement("math");d.setAttribute("display","block");d.appendChild(e.toMathML());c.appendChild(d);MathJax.Hub.Queue(["Typeset",MathJax.Hub,c])}}catch(h){e="error: "+h,c.setAttribute("title",e),h instanceof n?(c.appendChild(document.createTextNode(a.substring(0,h.from))),e=document.createElement("span"),e.appendChild(document.createTextNode(a.substring(h.from,h.to+1))),e.style.border="solid 1px red",e.style.minWidth=
-"1px",c.appendChild(e),h.to<a.length-1&&c.appendChild(document.createTextNode(a.substring(h.to+1)))):(a=document.createTextNode(e),c.appendChild(a))}}}},q=[];return{Definitions:l,ENode:e,Operator:p,ParseException:n,Parser:r,initEditors:function(){MathJax.Hub.Config({messageStyle:"none"});for(var b=document.getElementsByClassName("math"),a=0;a<q.length;a++){for(var c=q[a].ta,e=!1,f=0;f<b.length;f++)if(b[f]==c){e=!0;break}e||(f=q[a].output_node,f.parentNode&&f.parentNode.removeChild(f),q.splice(a,1),
-a--)}for(a=0;a<b.length;a++)if(c=b[a],"TEXTAREA"==c.nodeName||"INPUT"==c.nodeName){e=-1;for(f=0;f<q.length;f++)if(q[f].ta==c){e=f;break}var m="true"===c.getAttribute("data-implicit_operators"),d="true"===c.getAttribute("data-unit_mode"),h=c.getAttribute("data-constants");h&&(h=h.split(/[\s,]+/));if(-1==e){f=document.createElement("span");f.style.display="none";f.style.position="absolute";f.style.backgroundColor="rgba(255,255,224,0.9)";f.style.color="black";f.style.border="1px solid #A0A0A0";f.style.padding=
-"5px";f.style.zIndex="1";var l=function(a,b){var c,d=a.getBoundingClientRect();c=a;for(var e=0,f=0;c&&!isNaN(c.offsetLeft)&&!isNaN(c.offsetTop);)if(e+=c.offsetLeft-("INPUT"==c.nodeName?0:c.scrollLeft),f+=c.offsetTop-c.scrollTop,c=c.offsetParent){var g=window.getComputedStyle(c);if("absolute"==g.position||"relative"==g.position)break}c=f;b.style.left=e+"px";b.style.top=window.innerHeight>d.bottom+b.offsetHeight?c+a.offsetHeight+"px":c-b.offsetHeight+"px"};c.nextSibling?c.parentNode.insertBefore(f,
-c.nextSibling):c.parentNode.appendChild(f);c.addEventListener("blur",function(a){return function(b){a.style.display="none"}}(f),!1);c.addEventListener("focus",function(a,b){return function(c){""!=a.value&&(b.style.display="block",l(a,b))}}(c,f),!1);f.addEventListener("mouseenter",function(a){return function(b){a.hasAttribute("title")||(a.style.display="none")}}(f),!1);e=q.length;q[e]={ta:c,output_node:f,oldtxt:"",parser:new r(m,d,h)};f=function(a){return function(b){var c=q[a];u(c);document.activeElement==
-c.ta&&(""!=c.ta.value?(c.output_node.style.display="block",MathJax.Hub.Queue(function(){l(c.ta,c.output_node)})):c.output_node.style.display="none")}}(e);""!=c.value&&f();c.addEventListener("change",f,!1);c.addEventListener("keyup",f,!1)}else{var k,n=q[e].parser;if(h||0!=n.constants.length)if(h){if(k=n.constants.length==h.length)for(f=0;f<h.length;f++)if(n.constants[f]!=h[f]){k=!1;break}}else k=!1;else k=!0;n.implicit_operators==m&&n.unit_mode==d&&k||(q[e].parser=new r(m,d,h),""!=c.value&&(q[e].oldtxt=
-"",u(q[e])))}}},updateMathSpanAndDiv:function(){for(var b=document.getElementsByClassName("math"),a=[],c=0,e=a.length=b.length;c<e;c++)a[c]=b[c];for(c=0;c<a.length;c++)if(b=a[c],("SPAN"==b.nodeName||"DIV"==b.nodeName)&&null!=b.firstChild&&3==b.firstChild.nodeType){var e="SPAN"==b.nodeName,f=b.firstChild.nodeValue,m="true"===b.getAttribute("data-implicit_operators"),d="true"===b.getAttribute("data-unit_mode"),h=b.getAttribute("data-constants");h&&(h=h.split(/[\s,]+/));m=new r(m,d,h);try{var l=m.parse(f);
-if(null!=l){var k=document.createElement("math");k.setAttribute("display",e?"inline":"block");k.appendChild(l.toMathML(["#000000"]));b.classList.remove("math");b.removeChild(b.firstChild);b.appendChild(k);MathJax.Hub.Queue(["Typeset",MathJax.Hub,b])}}catch(n){b.firstChild.nodeValue="[syntax error in math:"+n+"]",b.classList.remove("math")}}}}}();
+a.appendChild(this.mo(":")),a.appendChild(this.children[1]._toMathML(b)),d.appendChild(a),h=this.interval_type==e.OPEN_OPEN||this.interval_type==e.CLOSED_OPEN?this.mo(")"):this.mo("]"),d.appendChild(h),d;case e.SET:d=document.createElement("mrow");d.appendChild(this.mo("{"));a=document.createElement("mrow");for(f=0;f<this.children.length;f++)0<f&&a.appendChild(this.mo(k.ARG_SEPARATOR)),a.appendChild(this.children[f]._toMathML(b));d.appendChild(a);d.appendChild(this.mo("}"));return d;case e.SUBSCRIPT:g=
+document.createElement("msub");g.appendChild(a._toMathML(b));if(2<this.children.length){d=document.createElement("mrow");for(f=1;f<this.children.length;f++)d.appendChild(this.children[f]._toMathML(b)),f<this.children.length-1&&d.appendChild(this.mo(k.ARG_SEPARATOR));g.appendChild(d)}else g.appendChild(c._toMathML(b));return g}};e.prototype.mi=function(b){var a=document.createElement("mi");e.symbols[b]&&(b=e.symbols[b]);a.appendChild(document.createTextNode(b));return a};e.prototype.mn=function(b){var a=
+document.createElement("mn");a.appendChild(document.createTextNode(b));return a};e.prototype.mo=function(b){var a=document.createElement("mo");e.symbols[b]&&(b=e.symbols[b]);a.appendChild(document.createTextNode(b));return a};e.prototype.addP=function(b,a){var c,g;c=document.createElement("mrow");g=this.mo("(");var f;f=a.colors?a.colors:e.COLORS;g.setAttribute("mathcolor",f[a.depth%f.length]);c.appendChild(g);a.depth++;c.appendChild(b._toMathML(a));a.depth--;g=this.mo(")");g.setAttribute("mathcolor",
+f[a.depth%f.length]);c.appendChild(g);return c};e.symbols={alpha:"\u03b1",beta:"\u03b2",gamma:"\u03b3",delta:"\u03b4",epsilon:"\u03b5",zeta:"\u03b6",eta:"\u03b7",theta:"\u03b8",iota:"\u03b9",kappa:"\u03ba",lambda:"\u03bb",mu:"\u03bc",nu:"\u03bd",xi:"\u03be",omicron:"\u03bf",pi:"\u03c0",rho:"\u03c1",sigma:"\u03c3",tau:"\u03c4",upsilon:"\u03c5",phi:"\u03c6",chi:"\u03c7",psi:"\u03c8",omega:"\u03c9",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",
+Theta:"\u0398",Iota:"\u0399",Kappa:"\u039a",Lambda:"\u039b",Mu:"\u039c",Nu:"\u039d",Xi:"\u039e",Omicron:"\u039f",Pi:"\u03a0",Rho:"\u03a1",Sigma:"\u03a3",Tau:"\u03a4",Upsilon:"\u03a5",Phi:"\u03a6",Chi:"\u03a7",Psi:"\u03a8",Omega:"\u03a9","#":"\u2260",">=":"\u2265","<=":"\u2264",inf:"\u221e",minf:"-\u221e",hbar:"\u210f",G:"\ud835\udca2"};"use strict";p.UNKNOWN=0;p.UNARY=1;p.BINARY=2;p.TERNARY=3;"use strict";n.prototype.toString=function(){return this.msg+" at "+this.from+" - "+this.to};"use strict";
+r.prototype.expression=function(b){var a,c=this.current_token;if(null==c)throw new n("Expected something at the end",this.tokens[this.tokens.length-1].to+1);this.advance();if(null==c.op)a=new e(c.type,null,c.value,null);else{if(null==c.op.nud)throw new n("Unexpected operator '"+c.op.id+"'",c.from);a=c.op.nud(this)}for(;null!=this.current_token&&null!=this.current_token.op&&b<this.current_token.op.lbp;)c=this.current_token,this.advance(),a=c.op.led(this,a);return a};r.prototype.advance=function(b){if(b&&
+(null==this.current_token||null==this.current_token.op||this.current_token.op.id!==b)){if(null==this.current_token)throw new n("Expected '"+b+"' at the end",this.tokens[this.tokens.length-1].to+1);throw new n("Expected '"+b+"'",this.current_token.from);}this.token_nr>=this.tokens.length?this.current_token=null:(this.current_token=this.tokens[this.token_nr],this.token_nr+=1)};r.prototype.addHiddenOperators=function(){for(var b=this.defs.findOperator("*"),a=this.defs.findOperator("`"),c=!1,g=!1,f=0;f<
+this.tokens.length-1;f++){var e=this.tokens[f],d=this.tokens[f+1];this.unit_mode&&("`"==e.value?c=!0:c&&("^"==e.value?g=!0:g&&e.type==l.NUMBER?g=!1:g||e.type!=l.NUMBER?g||e.type!=l.OPERATOR||-1!="*/^()".indexOf(e.value)?e.type==l.NAME&&"("==d.value&&(c=!1):c=!1:c=!1));if(e.type==l.NAME&&d.type==l.NAME||e.type==l.NUMBER&&d.type==l.NAME||e.type==l.NUMBER&&d.type==l.NUMBER||e.type==l.NUMBER&&("("==d.value||"["==d.value||"{"==d.value)||(")"==e.value||"]"==e.value||"}"==e.value)&&d.type==l.NAME||(")"==
+e.value||"]"==e.value||"}"==e.value)&&d.type==l.NUMBER||(")"==e.value||"]"==e.value||"}"==e.value)&&"("==d.value){if(e=this.unit_mode&&!c&&(e.type==l.NUMBER||")"==e.value||"]"==e.value||"}"==e.value)&&(d.type==l.NAME||("("==d.value||"["==d.value||"{"==d.value)&&this.tokens.length>f+2&&this.tokens[f+2].type==l.NAME)){var h,k;d.type==l.NAME?(h=d,k=f+1):(k=f+2,h=this.tokens[k]);for(var s=0;s<this.constants.length;s++)if(h.value==this.constants[s]){e=!1;break}if(this.tokens.length>k+1&&"("==this.tokens[k+
+1].value)for(k="pow sqrt abs exp factorial diff integrate sum product limit binomial matrix ln log log10 mod signum ceiling floor sin cos tan asin acos atan atan2 sinh cosh tanh asinh acosh atanh".split(" "),s=0;s<k.length;s++)if(h.value==k[s]){e=!1;break}}e?(d=new l(l.OPERATOR,d.from,d.from,a.id,a),c=!0):d=new l(l.OPERATOR,d.from,d.from,b.id,b);this.tokens.splice(f+1,0,d)}}};r.prototype.parse=function(b){this.tokens=(new t(this.defs,b)).tokenize();if(0==this.tokens.length)return null;this.implicit_operators&&
+this.addHiddenOperators();this.token_nr=0;this.current_token=this.tokens[this.token_nr];this.advance();b=this.expression(0);if(null!=this.current_token)throw new n("Expected the end",this.current_token.from);return b};"use strict";t.prototype.tokenize=function(){var b,a,c,g,f;a=0;b=this.text.charAt(a);f=[];a:for(;b;)if(g=a," ">=b)a++,b=this.text.charAt(a);else{if("0"<=b&&"9">=b||(b===k.DECIMAL_SIGN_1||b===k.DECIMAL_SIGN_2)&&"0"<=this.text.charAt(a+1)&&"9">=this.text.charAt(a+1)){c="";if(b!==k.DECIMAL_SIGN_1&&
+b!==k.DECIMAL_SIGN_2)for(a++,c+=b;;){b=this.text.charAt(a);if("0">b||"9"<b)break;a++;c+=b}if(b===k.DECIMAL_SIGN_1||b===k.DECIMAL_SIGN_2)for(a++,c+=b;;){b=this.text.charAt(a);if("0">b||"9"<b)break;a+=1;c+=b}if("e"===b||"E"===b){a++;c+=b;b=this.text.charAt(a);if("-"===b||"+"===b)a++,c+=b,b=this.text.charAt(a);if("0">b||"9"<b)throw new n("syntax error in number exponent",g,a);do a++,c+=b,b=this.text.charAt(a);while("0"<=b&&"9">=b)}var e=+c.replace(k.DECIMAL_SIGN_1,".").replace(k.DECIMAL_SIGN_2,".");
+if(isFinite(e)){f.push(new l(l.NUMBER,g,a-1,c,null));continue}else throw new n("syntax error in number",g,a);}for(c=0;c<this.defs.operators.length;c++)if(e=this.defs.operators[c],this.text.substring(a,a+e.id.length)===e.id){a+=e.id.length;b=this.text.charAt(a);f.push(new l(l.OPERATOR,g,a-1,e.id,e));continue a}if("a"<=b&&"z">=b||"A"<=b&&"Z">=b||"\u03b1"<=b&&"\u03c9">=b||"\u0391"<=b&&"\u03a9">=b||"\u00b5"==b||"\u00b0"==b){c=b;for(a++;;)if(b=this.text.charAt(a),"a"<=b&&"z">=b||"A"<=b&&"Z">=b||"\u03b1"<=
+b&&"\u03c9">=b||"\u0391"<=b&&"\u03a9">=b||"\u00b5"==b||"0"<=b&&"9">=b||"_"===b)c+=b,a++;else break;f.push(new l(l.NAME,g,a-1,c,null))}else throw new n("unrecognized operator",g,a);}return f};"use strict";l.UNKNOWN=0;l.NAME=1;l.NUMBER=2;l.OPERATOR=3;"use strict";var u=function(b){var a,c,e,f,m;a=b.ta;c=b.output_node;a=a.value;f="";for(m=a;m!=f;)f=m,m=f.replace(/\[[^\[\]]*\]/g,"");if(m.split("[").length==m.split("]").length){for(f="";m!=f;)f=m,m=f.replace(/\([^\(\)]*\)/g,"");if(m.split("(").length==
+m.split(")").length){for(f="";m!=f;)f=m,m=f.replace(/\{[^\{\}]*\}/g,"");m.split("{").length==m.split("}").length&&-1!=m.indexOf(k.ARG_SEPARATOR)&&(a="["+a+"]")}}if(a!=b.oldtxt){for(b.oldtxt=a;null!=c.firstChild;)c.removeChild(c.firstChild);c.removeAttribute("title");if(""!=a){b=b.parser;try{if(e=b.parse(a),null!=e){var d=document.createElement("math");d.setAttribute("display","block");d.appendChild(e.toMathML());c.appendChild(d);MathJax.Hub.Queue(["Typeset",MathJax.Hub,c])}}catch(h){e="error: "+h,
+c.setAttribute("title",e),h instanceof n?(c.appendChild(document.createTextNode(a.substring(0,h.from))),e=document.createElement("span"),e.appendChild(document.createTextNode(a.substring(h.from,h.to+1))),e.style.border="solid 1px red",e.style.minWidth="1px",c.appendChild(e),h.to<a.length-1&&c.appendChild(document.createTextNode(a.substring(h.to+1)))):(a=document.createTextNode(e),c.appendChild(a))}}}},q=[];return{Definitions:k,ENode:e,Operator:p,ParseException:n,Parser:r,initEditors:function(){MathJax.Hub.Config({messageStyle:"none"});
+for(var b=document.getElementsByClassName("math"),a=0;a<q.length;a++){for(var c=q[a].ta,e=!1,f=0;f<b.length;f++)if(b[f]==c){e=!0;break}e||(f=q[a].output_node,f.parentNode&&f.parentNode.removeChild(f),q.splice(a,1),a--)}for(a=0;a<b.length;a++)if(c=b[a],"TEXTAREA"==c.nodeName||"INPUT"==c.nodeName){e=-1;for(f=0;f<q.length;f++)if(q[f].ta==c){e=f;break}var m="true"===c.getAttribute("data-implicit_operators"),d="true"===c.getAttribute("data-unit_mode"),h=c.getAttribute("data-constants");h&&(h=h.split(/[\s,]+/));
+if(-1==e){f=document.createElement("span");f.style.display="none";f.style.position="absolute";f.style.backgroundColor="rgba(255,255,224,0.9)";f.style.color="black";f.style.border="1px solid #A0A0A0";f.style.padding="5px";f.style.zIndex="1";var k=function(a,b){var c,d=a.getBoundingClientRect();c=a;for(var e=0,f=0;c&&!isNaN(c.offsetLeft)&&!isNaN(c.offsetTop);)if(e+=c.offsetLeft-("INPUT"==c.nodeName?0:c.scrollLeft),f+=c.offsetTop-c.scrollTop,c=c.offsetParent){var g=window.getComputedStyle(c);if("absolute"==
+g.position||"relative"==g.position)break}c=f;b.style.left=e+"px";b.style.top=window.innerHeight>d.bottom+b.offsetHeight?c+a.offsetHeight+"px":c-b.offsetHeight+"px"};c.nextSibling?c.parentNode.insertBefore(f,c.nextSibling):c.parentNode.appendChild(f);c.addEventListener("blur",function(a){return function(b){a.style.display="none"}}(f),!1);c.addEventListener("focus",function(a,b){return function(c){""!=a.value&&(b.style.display="block",k(a,b))}}(c,f),!1);f.addEventListener("mouseenter",function(a){return function(b){a.hasAttribute("title")||
+(a.style.display="none")}}(f),!1);e=q.length;q[e]={ta:c,output_node:f,oldtxt:"",parser:new r(m,d,h)};f=function(a){return function(b){var c=q[a];u(c);document.activeElement==c.ta&&(""!=c.ta.value?(c.output_node.style.display="block",MathJax.Hub.Queue(function(){k(c.ta,c.output_node)})):c.output_node.style.display="none")}}(e);""!=c.value&&f();c.addEventListener("change",f,!1);c.addEventListener("keyup",f,!1)}else{var l,n=q[e].parser;if(h||0!=n.constants.length)if(h){if(l=n.constants.length==h.length)for(f=
+0;f<h.length;f++)if(n.constants[f]!=h[f]){l=!1;break}}else l=!1;else l=!0;n.implicit_operators==m&&n.unit_mode==d&&l||(q[e].parser=new r(m,d,h),""!=c.value&&(q[e].oldtxt="",u(q[e])))}}},updateMathSpanAndDiv:function(){for(var b=document.getElementsByClassName("math"),a=[],c=0,e=a.length=b.length;c<e;c++)a[c]=b[c];for(c=0;c<a.length;c++)if(b=a[c],("SPAN"==b.nodeName||"DIV"==b.nodeName)&&null!=b.firstChild&&3==b.firstChild.nodeType){var e="SPAN"==b.nodeName,f=b.firstChild.nodeValue,k="true"===b.getAttribute("data-implicit_operators"),
+d="true"===b.getAttribute("data-unit_mode"),h=b.getAttribute("data-constants");h&&(h=h.split(/[\s,]+/));k=new r(k,d,h);try{var l=k.parse(f);if(null!=l){var n=document.createElement("math");n.setAttribute("display",e?"inline":"block");n.appendChild(l.toMathML(["#000000"]));b.classList.remove("math");b.removeChild(b.firstChild);b.appendChild(n);MathJax.Hub.Queue(["Typeset",MathJax.Hub,b])}}catch(p){b.firstChild.nodeValue="[syntax error in math:"+p+"]",b.classList.remove("math")}}}}}();
Index: loncom/html/adm/LC_math_editor/src/enode.js
diff -u loncom/html/adm/LC_math_editor/src/enode.js:1.2 loncom/html/adm/LC_math_editor/src/enode.js:1.3
--- loncom/html/adm/LC_math_editor/src/enode.js:1.2 Tue Feb 24 15:20:44 2015
+++ loncom/html/adm/LC_math_editor/src/enode.js Fri Jan 27 20:31:09 2017
@@ -627,7 +627,7 @@
mrow2 = document.createElement('mrow');
for (i=0; i<this.children.length; i++) {
if (i > 0)
- mrow2.appendChild(this.mo(";"));
+ mrow2.appendChild(this.mo(Definitions.ARG_SEPARATOR));
mrow2.appendChild(this.children[i]._toMathML(context));
}
mrow.appendChild(mrow2);
More information about the LON-CAPA-cvs
mailing list