Diff for /loncom/html/adm/LC_math_editor/dist/LC_math_editor.min.js between versions 1.4 and 1.5

version 1.4, 2015/04/15 16:50:37 version 1.5, 2015/08/13 18:30:36
Line 43  e.value||"]"==e.value||"}"==e.value)&&"( Line 43  e.value||"]"==e.value||"}"==e.value)&&"(
 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);  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;  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+=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){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=  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";
 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);  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=  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),  "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=  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=

Removed from v.1.4  
changed lines
  Added in v.1.5


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>