Permalink
Browse files

History is now active (click it, it'll return the diagram.

Working on it.
  • Loading branch information...
1 parent c3c71a8 commit 8409903f13501446197a24d19ad6975cd93d097c @vpatryshev committed Jul 6, 2011
Showing with 22 additions and 20 deletions.
  1. +4 −4 web/1.css
  2. +7 −7 web/index.html
  3. +7 −7 web/newpage.html
  4. +4 −2 web/presheaf.js
View
@@ -40,7 +40,7 @@ body {
#textDiv {
position: absolute;
- left: 100px;
+ left: 139px;
height: 100%;
}
@@ -70,9 +70,9 @@ div.historyEntry img {
#history {
position: absolute;
- width: 100px;
- background: white;
- overflow: auto;
+ width: 131px;
+ background: #DCF2F2;
+ overflow: auto;2
}
#errorDiv {
View
@@ -17,16 +17,16 @@ <h1 id="d_status">Diagram Renderer</h1>
<span id="d_error" style="color:red"></span>
<span id="d_results" style="display:none">
<p><b id="d_txt"></b></p>
- <p><img id="d_png"</img></p><p><a id="d_pdf">pdf</a></p><p></p>
+ <p><img id="d_png"</img>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a id="d_pdf">pdf</a></p><p></p>
</span>
<form>
- <select id="d_format" name="format">
- <option value="xy">xypic</option>
- <option value="graph">graph</option>
- <option value="guess">ascii art</option>
- </select>
<textarea cols="60" id="d_in" name="in" rows="10">X \ar@/_2pc/[rr]_{f;g} \ar[r]^f &amp;Y \ar[r]^g &amp;Z\</textarea>
- <input type="button" value="Submit" onclick="commit()"></input>
+ <input type="button" value="Submit" onclick="commit()"></input><br/>
+ <select id="d_format" name="format">
+ <option value="xy">xypic</option>
+ <option value="graph">graph</option>
+ <option value="guess">ascii art</option>
+ </select>
</form>
<p>
<a href="http://ctan.org/tex-archive/macros/generic/diagrams/xypic/xy/doc/xyguide.pdf">This pdf</a> tells in details how to write diagrams in xypic format.
View
@@ -17,16 +17,16 @@ <h1 id="d_status">Diagram Renderer</h1>
<span id="d_error" style="color:red"></span>
<span id="d_results" style="display:none">
<p><b id="d_txt"></b></p>
- <p><img id="d_png"</img></p><p><a id="d_pdf">pdf</a></p><p></p>
+ <p><img id="d_png"</img>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a id="d_pdf">pdf</a></p><p></p>
</span>
<form>
- <select id="d_format" name="format">
- <option value="xy">xypic</option>
- <option value="graph">graph</option>
- <option value="guess">ascii art</option>
- </select>
<textarea cols="60" id="d_in" name="in" rows="10">X \ar@/_2pc/[rr]_{f;g} \ar[r]^f &amp;Y \ar[r]^g &amp;Z\</textarea>
- <input type="button" value="Submit" onclick="commit()"></input>
+ <input type="button" value="Submit" onclick="commit()"></input><br/>
+ <select id="d_format" name="format">
+ <option value="xy">xypic</option>
+ <option value="graph">graph</option>
+ <option value="guess">ascii art</option>
+ </select>
</form>
<p>
<a href="http://ctan.org/tex-archive/macros/generic/diagrams/xypic/xy/doc/xyguide.pdf">This pdf</a> tells in details how to write diagrams in xypic format.
View
@@ -46,7 +46,9 @@ function image(id) {
var history = {}
function choose(id) {
- send(history[id].text, "xy")
+ var text = history[id].text
+ $("d_in").value = text
+ send(text, "xy")
}
function addToHistory(id, text, image) {
@@ -64,7 +66,7 @@ function show(diagram) {
setState("Here's your diagram")
$("d_png").src=diagram.image.src
$("d_pdf").href=pdfRef(diagram.id)
- $("d_txt").innerHTML=diagram.source
+// $("d_txt").innerHTML=diagram.source
$("d_version").innerHTML=diagram.version
$("d_results").style.display="block"
addToHistory(diagram.id, diagram.source, diagram.image)

0 comments on commit 8409903

Please sign in to comment.