From 5f6bf9fb142766945de3be963d90a0df1a101f06 Mon Sep 17 00:00:00 2001 From: "B. Petersen" <r10s@b44t.com> Date: Sat, 1 Jan 2022 18:47:14 +0100 Subject: [PATCH] rename w30 to webxdc --- README.md | 14 ++++++-------- index.html | 6 +++--- deltachat.js => webxdc.js | 4 ++-- 3 files changed, 11 insertions(+), 13 deletions(-) rename deltachat.js => webxdc.js (96%) diff --git a/README.md b/README.md index 89d911c..fcf8629 100644 --- a/README.md +++ b/README.md @@ -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. - - diff --git a/index.html b/index.html index d6e1b81..9831560 100644 --- a/index.html +++ b/index.html @@ -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><" + update.payload.addr + "></strong> " + update.payload.msg + "<br>"; } - window.deltachat.setUpdateListener(receiveUpdate); + window.webxdc.setUpdateListener(receiveUpdate); </script> </body> diff --git a/deltachat.js b/webxdc.js similarity index 96% rename from deltachat.js rename to webxdc.js index 9f32022..d80e91f 100644 --- a/deltachat.js +++ b/webxdc.js @@ -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');