Create node server to replace 'make watch'

Reviewers: xymostech

Reviewed By: xymostech

Differential Revision: http://phabricator.benalpert.com/D38
This commit is contained in:
Ben Alpert
2013-07-05 22:55:10 -07:00
parent afb29f5df3
commit 4bc599966f
9 changed files with 70 additions and 6 deletions

14
static/index.html Normal file
View File

@@ -0,0 +1,14 @@
<!doctype html>
<html>
<head>
<title>MJLite Test</title>
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.4/underscore-min.js" type="text/javascript"></script>
<script src="MJLite.js" type="text/javascript"></script>
<script src="main.js" type="text/javascript"></script>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<input type="text" value="2x^2 + 3" id="input" />
<div id="math"></div>
</body>
</html>

10
static/main.js Normal file
View File

@@ -0,0 +1,10 @@
window.onload = function() {
var input = document.getElementById("input");
var math = document.getElementById("math");
MJLite.process(input.value, math);
input.oninput = function() {
MJLite.process(input.value, math);
};
};

106
static/style.css Normal file
View File

@@ -0,0 +1,106 @@
@font-face {
font-family: MathJax_Main;
src: url("http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Main-Regular.otf");
}
@font-face {
font-family: MathJax_Main;
src: url("http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Main-Italic.otf");
font-style: italic;
}
@font-face {
font-family: MathJax_Math;
src: url("http://cdn.mathjax.org/mathjax/latest/fonts/HTML-CSS/TeX/otf/MathJax_Math-Italic.otf");
font-style: italic;
}
/*
thin space: 1/6 quad
medium space: 2/9 quad
thick space: 5/18 quad
things to do:
^ _ and styles
\sin
\sum, \int, \lim
\frac
\sqrt
big parens
*/
body {
margin: 0px;
padding: 0px;
}
input {
margin: 0px;
font-size: 100%;
}
#math {
font-family: MathJax_Main;
}
.mathit {
font: italic 100% MathJax_Math;
}
.mord + .mbin {
margin-left: 0.22222em;
}
.mbin + .mord {
margin-left: 0.22222em;
}
.mbin + .mopen {
margin-left: 0.22222em;
}
.mclose + .mbin {
margin-left: 0.22222em;
}
.msub {
vertical-align: bottom;
font-size: 70%;
position: relative;
top: 0.2em;
}
.msup {
position: relative;
top: -0.5em;
font-size: 70%;
}
.msupsub {
display: inline-table;
table-layout: fixed;
vertical-align: middle;
}
.msupsub > .msup, .msupsub > .msub {
display: table-row;
vertical-align: baseline;
line-height: 1em;
}
.mfrac {
display: inline-table;
vertical-align: 0.88em;
}
.mfracnum, .mfracmid, .mfracden {
display: table-row;
text-align: center;
}
.mfracmid > span {
background: black;
display: block;
height: 0.05em;
min-height: 1px;
}