-
Notifications
You must be signed in to change notification settings - Fork 0
/
panel.html
51 lines (46 loc) · 1.31 KB
/
panel.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
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>DAM panel demo</title>
</head>
<style>
.dam-panel {
border: 1px solid black;
margin-bottom: 0.5em;
}
.dam-panel > button {
letter-spacing: 3px;
}
.dam-panel > div {
padding: 0.5em;
}
</style>
<body>
<h1>DAM panel demo</h1>
<p>DAM comes with a panel widget. This widget provides a button by which it can
be collapsed or expanded. The styling is just an example.</p>
<div id="installation"></div>
<script src="../dist/dam-plus-widgets-0.2.js"></script>
<script>
var div=DAM.maker("div"), p=DAM.maker("p"), span=DAM.maker("span"), button=DAM.maker("button");
var statusBar = span();
function updateStatus(msg) {
statusBar.innerHTML += "<p>clicked " + msg + "</p>";
}
document.getElementById('installation').appendChild(
div(
DAM.makePanel(
{ title: "Knobs", isOpen: false },
button("Knob 1", { onclick: function(e) { updateStatus("Knob 1"); }}),
button("Knob 2", { onclick: function(e) { updateStatus("Knob 2"); }})
),
DAM.makePanel(
{ title: "Doohickeys", isOpen: false },
button("Doohickey 1", { onclick: function(e) { updateStatus("Doohickey 1"); }}),
button("Doohickey 2", { onclick: function(e) { updateStatus("Doohickey 2"); }})
),
statusBar
)
);
</script>
</body>