Skip to content

Commit

Permalink
refactor: align browser examples with "WoT" global object (#1361)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
danielpeintner authored Mar 12, 2025
1 parent 0ae70fb commit 456ce93
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
14 changes: 7 additions & 7 deletions examples/browser/counter.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/**
* In the browser, node wot only works in client mode with limited binding support.
* In the browser, node-wot only works in client mode with limited binding support.
* Supported bindings: HTTP / HTTPS / WebSockets
*
* After adding the following <script> tag to your HTML page:
* <script src="https://cdn.jsdelivr.net/npm/@node-wot/browser-bundle@latest/dist/wot-bundle.min.js" defer></script>
*
* you can access all node-wot functionality / supported packages through the "Wot" global object.
* you can access all node-wot functionality / supported packages through the "WoT" global object.
* Examples:
* var servient = new Wot.Core.Servient();
* var client = new Wot.Http.HttpClient();
* var servient = new WoT.Core.Servient();
* var client = new WoT.Http.HttpClient();
*
**/

Expand Down Expand Up @@ -175,9 +175,9 @@ function updateProperties() {
});
}

var servient = new Wot.Core.Servient();
servient.addClientFactory(new Wot.Http.HttpClientFactory());
var helpers = new Wot.Core.Helpers(servient);
var servient = new WoT.Core.Servient();
servient.addClientFactory(new WoT.Http.HttpClientFactory());
var helpers = new WoT.Core.Helpers(servient);
window.onload = () => {
// process passed URL
let $_GET = location.search
Expand Down
14 changes: 7 additions & 7 deletions examples/browser/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/**
* In the browser, node wot only works in client mode with limited binding support.
* In the browser, node-wot only works in client mode with limited binding support.
* Supported bindings: HTTP / HTTPS / WebSockets
*
* After adding the following <script> tag to your HTML page:
* <script src="https://cdn.jsdelivr.net/npm/@node-wot/browser-bundle@latest/dist/wot-bundle.min.js" defer></script>
*
* you can access all node-wot functionality / supported packages through the "Wot" global object.
* you can access all node-wot functionality / supported packages through the "WoT" global object.
* Examples:
* var servient = new Wot.Core.Servient();
* var client = new Wot.Http.HttpClient();
* var servient = new WoT.Core.Servient();
* var client = new WoT.Http.HttpClient();
*
**/

Expand Down Expand Up @@ -163,9 +163,9 @@ function removeSchemaEditor() {
}
}

var servient = new Wot.Core.Servient();
servient.addClientFactory(new Wot.Http.HttpClientFactory());
var helpers = new Wot.Core.Helpers(servient);
var servient = new WoT.Core.Servient();
servient.addClientFactory(new WoT.Http.HttpClientFactory());
var helpers = new WoT.Core.Helpers(servient);
document.getElementById("fetch").onclick = () => {
get_td(document.getElementById("td_addr").value);
};
14 changes: 7 additions & 7 deletions examples/browser/smart-coffee-machine.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/**
* In the browser, node wot only works in client mode with limited binding support.
* In the browser, node-wot only works in client mode with limited binding support.
* Supported bindings: HTTP / HTTPS / WebSockets
*
* After adding the following <script> tag to your HTML page:
* <script src="https://cdn.jsdelivr.net/npm/@node-wot/browser-bundle@latest/dist/wot-bundle.min.js" defer></script>
*
* you can access all node-wot functionality / supported packages through the "Wot" global object.
* you can access all node-wot functionality / supported packages through the "WoT" global object.
* Examples:
* var servient = new Wot.Core.Servient();
* var client = new Wot.Http.HttpClient();
* var servient = new WoT.Core.Servient();
* var client = new WoT.Http.HttpClient();
*
**/

Expand Down Expand Up @@ -67,7 +67,7 @@ function showProperties(thing) {
}, UPDATE_PERIOD);
}

var servient = new Wot.Core.Servient();
servient.addClientFactory(new Wot.Http.HttpClientFactory());
var helpers = new Wot.Core.Helpers(servient);
var servient = new WoT.Core.Servient();
servient.addClientFactory(new WoT.Http.HttpClientFactory());
var helpers = new WoT.Core.Helpers(servient);
get_td(TD_URL);
6 changes: 3 additions & 3 deletions packages/browser-bundle/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Include the following script tag in your html
<script src="https://cdn.jsdelivr.net/npm/@node-wot/browser-bundle@latest/dist/wot-bundle.min.js"></script>
```

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

```js
var servient = new Wot.Core.Servient();
var client = new Wot.Http.HttpClient();
var servient = new WoT.Core.Servient();
var client = new WoT.Http.HttpClient();
```

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

0 comments on commit 456ce93

Please sign in to comment.