forked from eclipse-thingweb/node-wot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
137 lines (132 loc) · 6.12 KB
/
index.html
File metadata and controls
137 lines (132 loc) · 6.12 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!doctype html>
<html>
<head>
<title>Browser Native node-wot tryout</title>
<!-- Foundation CSS framework -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/foundation/5.5.3/css/foundation.min.css" />
<!-- Font Awesome icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.0.3/css/font-awesome.css" />
<link rel="stylesheet" href="styles.css" />
<!-- defer to not block rendering -->
<script src="https://cdn.jsdelivr.net/npm/@json-editor/json-editor@latest/dist/jsoneditor.min.js"></script>
<!-- local vs cdn dependency -->
<!-- <script src="../../packages/browser-bundle/dist/wot-bundle.min.js" defer></script> -->
<script
src="https://cdn.jsdelivr.net/npm/@node-wot/browser-bundle@latest/dist/wot-bundle.min.js"
defer
></script>
<script src="index.js" defer></script>
<script>
// Set the default CSS theme and icon library globally
// JSONEditor.defaults.theme = 'foundation5';
JSONEditor.defaults.iconlib = "fontawesome4";
</script>
</head>
<body>
<div id="topbar" class="row">
<div class="medium-12 columns">
<h1>Browsified node-wot</h1>
<!-- Tabs for TD selection -->
<ul class="tabs" data-tab id="td-tabs">
<li class="tab-title active">
<a href="#tab-testthing" id="tab-link-testthing">Test Thing</a>
</li>
<li class="tab-title">
<a href="#tab-smartcoffee" id="tab-link-smartcoffee">Smart Coffee Machine</a>
</li>
<li class="tab-title">
<a href="#tab-counter" id="tab-link-counter">Counter</a>
</li>
<li class="tab-title">
<a href="#tab-custom" id="tab-link-custom">Custom</a>
</li>
</ul>
<div class="tabs-content">
<div class="content active" id="tab-testthing">
<p>Consumed TD at <a href="" target="_blank" class="td-url"></a></p>
<p>
<strong>TD Description:</strong>
<span class="td-description">Loading...</span>
</p>
</div>
<div class="content" id="tab-smartcoffee">
<p>
Consumed TD at
<a href="" target="_blank" class="td-url"></a>
</p>
<p>
<strong>TD Description:</strong>
<span class="td-description">Loading...</span>
</p>
</div>
<div class="content" id="tab-counter">
<p>Consumed TD at <a href="" target="_blank" class="td-url"></a></p>
<p>
<strong>TD Description:</strong>
<span class="td-description">Loading...</span>
</p>
</div>
<div class="content" id="tab-custom">
<div class="row">
<div class="medium-12 columns">
<input
id="td_addr"
type="url"
placeholder="Paste the TD URL to start consuming it"
style="width: 100%"
onkeydown="if(event.key==='Enter') document.getElementById('fetch').click()"
/>
</div>
</div>
<div class="row">
<div class="medium-12 columns" style="margin-top: 10px">
<button id="fetch" type="button" class="button">Consume</button>
</div>
</div>
<div id="custom-td-info" style="margin-top: 10px">
<p>Consumed TD at <a href="" target="_blank" class="td-url"></a></p>
<p>
<strong>TD Description:</strong>
<span class="td-description">Enter a TD URL above to consume it.</span>
</p>
</div>
</div>
</div>
<!-- Error message container -->
<div id="error-container" class="row" style="display: none; margin-top: 10px">
<div class="medium-12 columns">
<div class="alert-box alert" id="error-message">
<span id="error-text"></span>
<a href="#" class="close" id="close-error">×</a>
</div>
</div>
</div>
</div>
</div>
<div id="interactions" class="row" style="display: none">
<div class="medium-4 columns">
<figure>
<figcaption><h4>Properties</h4></figcaption>
<ul id="properties" class="side-nav"></ul>
</figure>
</div>
<div class="medium-4 columns">
<figure>
<figcaption><h4>Actions</h4></figcaption>
<ul id="actions" class="side-nav"></ul>
</figure>
</div>
<div class="medium-4 columns">
<figure>
<figcaption><h4>Events</h4></figcaption>
<ul id="events" class="side-nav"></ul>
</figure>
</div>
</div>
<div class="row">
<div class="medium-6 columns small-offset-3">
<div id="editor_holder"></div>
</div>
</div>
</body>
</html>