This repository has been archived by the owner on Oct 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
99 lines (80 loc) · 3.61 KB
/
index.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
87
88
89
90
91
92
93
94
95
96
97
98
99
<!doctype html>
<html>
<head>
<title>jsPlumb Toolkit Demonstrations</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
</head>
<body>
<style>
[data-lib] {
margin-top:1rem;
display:flex;
flex-direction:column;
}
[data-built='true'] .alert-danger {
display:none;
}
</style>
<header class="h3 p-3">jsPlumb Toolkit Demonstrations</header>
<div class="container">
<div class="row">
<div class="d-flex flex-column p-5 col col-6">
<div class="h5 mt-3">Repository configuration</div>
<p>
You'll need to follow the instructions on this page:
<a href="https://docs.jsplumbtoolkit.com/toolkit/6.x/lib/npm-repository" target="_blank">https://docs.jsplumbtoolkit.com/toolkit/6.x/lib/npm-repository</a> to setup your
local NPM for access to jsPlumb's repository.
</p>
<div class="h5 mt-3">Initializing</div>
<p>
If you're seeing this page in a web server then you've run <code>npm i</code> already. If you
ran <code>npm run init</code> then you'll also be able to access the demonstrations.
Otherwise you'll want to run a build.
</p>
<div class="h5 mt-3">Building</div>
<p>
<code>npm run build</code>
</p>
<p>This will build all of the demonstrations. For demonstrations for which there is more than one
version, we build the Typescript version</p>
</div>
<div class="d-flex flex-column p-5 col col-6" id="demo-list">
<div data-lib="vanilla">
<div class="h5">Demonstrations</div>
<div class="alert alert-danger">
No demonstrations have been built! See instructions on the left hand side of this page.
</div>
</div>
</div>
</div>
</div>
<script>
(function() {
function _add(lib, name, target) {
var root = document.querySelector("[data-lib='" + lib + "']")
root.setAttribute("data-built", true)
var a = document.createElement("a")
a.setAttribute("href", target)
root.appendChild(a)
a.innerHTML = name;
}
function _oneSet(lib, linkGen) {
fetch(`./demonstrations-${lib}.json`, {
method:"get"
}).then(r => r.json()).then(d => {
try {
for (let dir in d) {
_add(lib, dir, linkGen(dir, d[dir]))
}
} catch (e) {
console.log("Error processing demonstrations for " + lib + " " + e)
}
}).catch(e => { })
}
_oneSet("vanilla", function(name, version) {
return `src/${name}/${version}/index.html`
})
})();
</script>
</body>
</html>