rename w30 to webxdc

master
B. Petersen 2022-01-01 18:47:14 +01:00
parent 3d70e6f05b
commit 5f6bf9fb14
No known key found for this signature in database
GPG Key ID: 3B88E92DEA8E9AFC
3 changed files with 11 additions and 13 deletions

View File

@ -1,14 +1,14 @@
# w30 development tool
# Webxdc Development Tool
this is a little tool to make development of w30 apps easier.
this is a little tool to make development of webxdc apps easier.
for developing w30 apps,
just copy the `deltachat.js` from this repo beside
for developing webxdc apps,
just copy the `webxdc.js` from this repo beside
your `index.html` and you are ready to go.
no server or installation required.
- include your `deltachat.js` to your `index.html` as usual
- include your `webxdc.js` to your `index.html` as usual
- open your `index.html` from your local disk in your browser,
tested with Firefox.
- the emulation layer will add an "add peer" button,
@ -16,10 +16,8 @@ no server or installation required.
- once you call sendUpdate() in on peer,
all peers will get the update with their update listeners.
keep in mind, when bundling your w30 app, deltachat.js is not needed,
keep in mind, when bundling your webxdc app, `webxdc.js` is not needed,
it will be provided by the target implementation.
note, that the api is not yet complete,
this is just a, maybe already useful, proof-of-concept for now.

View File

@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8"/>
<script src="deltachat.js"></script>
<script src="webxdc.js"></script>
</head>
<body>
<input id="input" type="text"/>
@ -12,14 +12,14 @@
function sendMsg() {
msg = document.getElementById("input").value;
window.deltachat.sendUpdate('someone typed "'+msg+'"', {"addr": window.deltachat.selfAddr(), "msg": msg});
window.webxdc.sendUpdate('someone typed "'+msg+'"', {"addr": window.webxdc.selfAddr(), "msg": msg});
}
function receiveUpdate(update) {
document.getElementById('output').innerHTML += "<strong>&lt;" + update.payload.addr + "&gt;</strong> " + update.payload.msg + "<br>";
}
window.deltachat.setUpdateListener(receiveUpdate);
window.webxdc.setUpdateListener(receiveUpdate);
</script>
</body>

View File

@ -1,7 +1,7 @@
// debug friend: document.writeln(JSON.stringify(value));
// maybe helpful: window.sessionStorage, https://www.w3schools.com/html/html5_webstorage.asp
window.deltachat = (() => {
window.webxdc = (() => {
var updateListener = () => {};
return {
@ -57,7 +57,7 @@ function alterApp() {
title = document.createElement('title');
document.getElementsByTagName('head')[0].append(title);
}
title.innerText = window.deltachat.selfAddr();
title.innerText = window.webxdc.selfAddr();
if (getXdcRoot() == window) {
var div = document.createElement('div');