Debian Codegraph @

examples/Tracenpoche/viewer.html

raw
1 <html>
2 <head>
3 <title>JSXGraph example</title>
4 <link rel="stylesheet" type="text/css" href="../../distrib/jsxgraph.css" />
5 <script type="text/javascript" src="../../distrib/jsxgraphcore.js"></script>
6 <script type="text/javascript" src="../../src/reader/tracenpoche.js"></script>
7 <style type="text/css">
8 body {
9 margin:30px;
10 background-color: #472E29; /**/
11 color: #F0E99A; /* #381C19 #362E29 #948658*/
12 font-family: Arial, Helvetica;
13 }
14 textarea {
15 background-color: #948658; /**/
16 font-size: 150%;
17 padding:10px;
18 }
19 </style>
20 </head>
21 <body>
22 <body id="body">
23 <form>
24 <!--
25 <p>
26 TracenPoche examples: <br>
27 <select id="tep">
28 <option value='frame.txt'>[ ] frame.txt</option>
29 <option value='lines_position_analyse.txt'>[ ] lines_position_analyse.txt</option>
30 <option value='point_segment_polygon.txt'>[ ] point_segment_polygon.txt</option>
31 <option value='point.txt'>[ ] point.txt</option>
32 <option value='polygon.txt'>[ ] polygon.txt</option>
33 <option value='real_scroll.txt'>[ ] real_scroll.txt</option>
34 <option value='thales_situation.txt'>[ ] thales_situation.txt</option>
35 <option value='triangle_circumcircle.txt'>[ ] triangle_circumcircle.txt</option>
36 <option value='triangle_innercircle.txt'>[ ] triangle_innercircle.txt</option>
37 <option value='triangle_orthocenter.txt'>[ ] triangle_orthocenter.txt</option>
38 </select>
39 -->
40 <!--
41 <input type='button' value='Show script' onclick="showFile('tep')">
42 -->
43 </form>
44 <div id="box" class='jxgbox' style="width:700px; height:600px; float:left"></div>
45 <textarea cols=30 rows=10 id="inputtext">@options;
46
47 @figure;
48 A = point(-1,0) ;
49 B = point(1,1) ;
50 C = point(0,-1) ;
51 d =droite(A,B) ;
52 para =parallele(C,d) ;
53 </textarea><br />
54 <input type='button' value="Read TracenPoche string" onclick="loadFile('tep','Tracenpoche')" />
55 <div id="debug" style="display:block;"></div>
56 <script type="text/javascript">
57 var board;
58 function loadFile(bspname, format) {
59 document.getElementById('box').innerHTML = '';
60 /*
61 var value = document.getElementById(bspname).options[document.getElementById(bspname).selectedIndex].value;
62 //document.getElementById('debug').innerHTML = "<b>Debug (lade "+ value +" ...):</b>";
63 */
64 var str = document.getElementById('inputtext').value;
65 if (typeof board != 'undefined') JXG.JSXGraph.freeBoard(board);
66
67 //document.title = "Tracenpoche example: "+ document.getElementById(bspname).options[document.getElementById(bspname).selectedIndex].text;
68 //board = JXG.JSXGraph.loadBoardFromFile('box', value, format);
69 board = JXG.JSXGraph.loadBoardFromString('box', str, format);
70 };
71
72 function showFile(bspname) {
73 var value = document.getElementById(bspname).options[document.getElementById(bspname).selectedIndex].value;
74 window.open(value);
75 };
76 </script>
77 </body>
78 </html>