forked from jscad/OpenJSCAD.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
min.html
86 lines (69 loc) · 2.72 KB
/
min.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE html>
<html>
<!--
== OpenJSCAD.org, Copyright (c) 2016, Licensed under MIT License ==
in conjunction with other libraries by various authors (see the individual files)
Purpose:
This application provides an example of how to show JSCAD designs with minimal HTML and CSS.
History:
2016/06/27: 0.5.1: Changes for 0.5.1 libraries by Z3 Dev
2016/05/01: 0.5.0: Changes for 0.5.0 libraries by Z3 Dev
2016/02/02: 0.4.0: Initial version by Z3 Dev
-->
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>OpenJSCAD.org Logo</title>
<script src="jquery/jquery-1.9.1.js?0.5.1"></script>
<script src="jquery/jquery.hammer.js?0.5.1"></script>
<script src="lightgl.js"></script>
<script src="csg.js?0.5.1"></script>
<script src="formats.js?0.5.1"></script>
<script src="openjscad.js?0.5.1"></script>
<script src="openscad.js?0.5.1"></script>
<script src="js/jscad-worker.js?0.5.1" charset="utf-8"></script>
<script src="js/jscad-function.js?0.5.1" charset="utf-8"></script>
<link rel="stylesheet" href="min.css?0.5.1" type="text/css">
</head>
<body onload="loadProcessor()">
<!-- setup display of the errors as required by OpenJSCAD.js -->
<div class="jscad-container">
<div id="header">
<div id="errordiv">hello</div>
</div>
<!-- setup display of the viewer, i.e. canvas -->
<div oncontextmenu="return false;" id="viewerContext"></div>
<!-- setup display of the design parameters, as required by OpenJSCAD.js -->
<!-- set display: block to display this -->
<div id="parametersdiv" style="display: none;"></div>
<!-- setup display of the status, as required by OpenJSCAD.js -->
<!-- set display: block to display this -->
<div id="tail" style="display: none;">
<div id="statusdiv"></div>
</div>
</div>
<!-- define the design and the parameters -->
<script type="text/javascript">
var gProcessor = null; // required by OpenJScad.org
var gComponents = [ { file: 'examples/logo.jscad' } ];
function loadProcessor() {
gProcessor = new OpenJsCad.Processor(document.getElementById("viewerContext"));
loadJSCAD(0);
}
function loadJSCAD(choice) {
var filepath = gComponents[choice].file;
var xhr = new XMLHttpRequest();
xhr.open("GET", filepath, true);
gProcessor.setStatus("Loading "+filepath+" <img id=busy src='imgs/busy.gif'>");
xhr.onload = function() {
var source = this.responseText;
//console.log(source);
if(filepath.match(/\.jscad$/i)||filepath.match(/\.js$/i)) {
gProcessor.setStatus("Processing "+filepath+" <img id=busy src='imgs/busy.gif'>");
gProcessor.setJsCad(source,filepath);
}
}
xhr.send();
}
</script>
</body>
</html>