summaryrefslogtreecommitdiffstats
path: root/static/js/mathml.js
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2020-05-21 05:15:49 +0200
committerGuilhem Moulin <guilhem@fripost.org>2020-05-21 08:36:16 +0200
commit72983121e68289a7497927417e52a8ec5f16aa7b (patch)
tree1f72bf5f3d4d0c3d46f9a56a887bef7d8eb21080 /static/js/mathml.js
parent8358104be6ca8f361b9f6abad502fc98e8a01b71 (diff)
Drop static content.
JQuery, Bootstrap etc. are not maintainable in this repository, just like one should avoid embedding copies of other project in packaging work. We rely on the distro-provided variants instead: $ apt install fonts-font-awesome libjs-bootstrap4 libjs-jquery Ikwiki doesn't copy symlinks for security reasons, so unfortunately deploy one's own sandbox wiki is less easy now. Instructions will follow shortly. Also, port the templates to Bootstrap 4.
Diffstat (limited to 'static/js/mathml.js')
-rw-r--r--static/js/mathml.js70
1 files changed, 0 insertions, 70 deletions
diff --git a/static/js/mathml.js b/static/js/mathml.js
deleted file mode 100644
index a72c2e5..0000000
--- a/static/js/mathml.js
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
-March 19, 2004 MathHTML (c) Peter Jipsen http://www.chapman.edu/~jipsen
-Released under the GNU General Public License version 2 or later.
-See the GNU General Public License (at http://www.gnu.org/copyleft/gpl.html)
-for more details.
-*/
-
-function convertMath(node) {// for Gecko
- if (node.nodeType==1) {
- var newnode =
- document.createElementNS("http://www.w3.org/1998/Math/MathML",
- node.nodeName.toLowerCase());
- for(var i=0; i < node.attributes.length; i++)
- newnode.setAttribute(node.attributes[i].nodeName,
- node.attributes[i].nodeValue);
- for (var i=0; i<node.childNodes.length; i++) {
- var st = node.childNodes[i].nodeValue;
- if (st==null || st.slice(0,1)!=" " && st.slice(0,1)!="\n")
- newnode.appendChild(convertMath(node.childNodes[i]));
- }
- return newnode;
- }
- else return node;
-}
-
-function convert() {
- var mmlnode = document.getElementsByTagName("math");
- var st,str,node,newnode;
- for (var i=0; i<mmlnode.length; i++)
- if (document.createElementNS!=null)
- mmlnode[i].parentNode.replaceChild(convertMath(mmlnode[i]),mmlnode[i]);
- else { // convert for IE
- str = "";
- node = mmlnode[i];
- while (node.nodeName!="/MATH") {
- st = node.nodeName.toLowerCase();
- if (st=="#text") str += node.nodeValue;
- else {
- str += (st.slice(0,1)=="/" ? "</m:"+st.slice(1) : "<m:"+st);
- if (st.slice(0,1)!="/")
- for(var j=0; j < node.attributes.length; j++)
- if (node.attributes[j].nodeValue!="italic" &&
- node.attributes[j].nodeValue!="" &&
- node.attributes[j].nodeValue!="inherit" &&
- node.attributes[j].nodeValue!=undefined)
- str += " "+node.attributes[j].nodeName+"="+
- "\""+node.attributes[j].nodeValue+"\"";
- str += ">";
- }
- node = node.nextSibling;
- node.parentNode.removeChild(node.previousSibling);
- }
- str += "</m:math>";
- newnode = document.createElement("span");
- node.parentNode.replaceChild(newnode,node);
- newnode.innerHTML = str;
- }
-}
-
-if (document.createElementNS==null) {
- document.write("<object id=\"mathplayer\"\
- classid=\"clsid:32F66A20-7614-11D4-BD11-00104BD3F987\"></object>");
- document.write("<?import namespace=\"m\" implementation=\"#mathplayer\"?>");
-}
-if(typeof window.addEventListener != 'undefined'){
- window.addEventListener('load', convert, false);
-}
-if(typeof window.attachEvent != 'undefined') {
- window.attachEvent('onload', convert);
-}