Skip to content

Commit 456ce93

Browse files
refactor: align browser examples with "WoT" global object (#1361)
* refactor: align browser examples with "WoT" global object Note: used to be "Wot" * docs: forgot readme * fix: coding style issue * fix coding style issue once again
1 parent 0ae70fb commit 456ce93

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

examples/browser/counter.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/**
2-
* In the browser, node wot only works in client mode with limited binding support.
2+
* In the browser, node-wot only works in client mode with limited binding support.
33
* Supported bindings: HTTP / HTTPS / WebSockets
44
*
55
* After adding the following <script> tag to your HTML page:
66
* <script src="https://cdn.jsdelivr.net/npm/@node-wot/browser-bundle@latest/dist/wot-bundle.min.js" defer></script>
77
*
8-
* you can access all node-wot functionality / supported packages through the "Wot" global object.
8+
* you can access all node-wot functionality / supported packages through the "WoT" global object.
99
* Examples:
10-
* var servient = new Wot.Core.Servient();
11-
* var client = new Wot.Http.HttpClient();
10+
* var servient = new WoT.Core.Servient();
11+
* var client = new WoT.Http.HttpClient();
1212
*
1313
**/
1414

@@ -175,9 +175,9 @@ function updateProperties() {
175175
});
176176
}
177177

178-
var servient = new Wot.Core.Servient();
179-
servient.addClientFactory(new Wot.Http.HttpClientFactory());
180-
var helpers = new Wot.Core.Helpers(servient);
178+
var servient = new WoT.Core.Servient();
179+
servient.addClientFactory(new WoT.Http.HttpClientFactory());
180+
var helpers = new WoT.Core.Helpers(servient);
181181
window.onload = () => {
182182
// process passed URL
183183
let $_GET = location.search

examples/browser/index.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/**
2-
* In the browser, node wot only works in client mode with limited binding support.
2+
* In the browser, node-wot only works in client mode with limited binding support.
33
* Supported bindings: HTTP / HTTPS / WebSockets
44
*
55
* After adding the following <script> tag to your HTML page:
66
* <script src="https://cdn.jsdelivr.net/npm/@node-wot/browser-bundle@latest/dist/wot-bundle.min.js" defer></script>
77
*
8-
* you can access all node-wot functionality / supported packages through the "Wot" global object.
8+
* you can access all node-wot functionality / supported packages through the "WoT" global object.
99
* Examples:
10-
* var servient = new Wot.Core.Servient();
11-
* var client = new Wot.Http.HttpClient();
10+
* var servient = new WoT.Core.Servient();
11+
* var client = new WoT.Http.HttpClient();
1212
*
1313
**/
1414

@@ -163,9 +163,9 @@ function removeSchemaEditor() {
163163
}
164164
}
165165

166-
var servient = new Wot.Core.Servient();
167-
servient.addClientFactory(new Wot.Http.HttpClientFactory());
168-
var helpers = new Wot.Core.Helpers(servient);
166+
var servient = new WoT.Core.Servient();
167+
servient.addClientFactory(new WoT.Http.HttpClientFactory());
168+
var helpers = new WoT.Core.Helpers(servient);
169169
document.getElementById("fetch").onclick = () => {
170170
get_td(document.getElementById("td_addr").value);
171171
};

examples/browser/smart-coffee-machine.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/**
2-
* In the browser, node wot only works in client mode with limited binding support.
2+
* In the browser, node-wot only works in client mode with limited binding support.
33
* Supported bindings: HTTP / HTTPS / WebSockets
44
*
55
* After adding the following <script> tag to your HTML page:
66
* <script src="https://cdn.jsdelivr.net/npm/@node-wot/browser-bundle@latest/dist/wot-bundle.min.js" defer></script>
77
*
8-
* you can access all node-wot functionality / supported packages through the "Wot" global object.
8+
* you can access all node-wot functionality / supported packages through the "WoT" global object.
99
* Examples:
10-
* var servient = new Wot.Core.Servient();
11-
* var client = new Wot.Http.HttpClient();
10+
* var servient = new WoT.Core.Servient();
11+
* var client = new WoT.Http.HttpClient();
1212
*
1313
**/
1414

@@ -67,7 +67,7 @@ function showProperties(thing) {
6767
}, UPDATE_PERIOD);
6868
}
6969

70-
var servient = new Wot.Core.Servient();
71-
servient.addClientFactory(new Wot.Http.HttpClientFactory());
72-
var helpers = new Wot.Core.Helpers(servient);
70+
var servient = new WoT.Core.Servient();
71+
servient.addClientFactory(new WoT.Http.HttpClientFactory());
72+
var helpers = new WoT.Core.Helpers(servient);
7373
get_td(TD_URL);

packages/browser-bundle/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ Include the following script tag in your html
1616
<script src="https://cdn.jsdelivr.net/npm/@node-wot/browser-bundle@latest/dist/wot-bundle.min.js"></script>
1717
```
1818

19-
You can access all node-wot functionality through the "Wot" global object:
19+
You can access all node-wot functionality through the "WoT" global object:
2020

2121
```js
22-
var servient = new Wot.Core.Servient();
23-
var client = new Wot.Http.HttpClient();
22+
var servient = new WoT.Core.Servient();
23+
var client = new WoT.Http.HttpClient();
2424
```
2525

2626
## Using node-wot browser bundle library in web frameworks (e.g., Angular)

0 commit comments

Comments
 (0)