diff --git a/index.html b/index.html index 269b503..16473d9 100644 --- a/index.html +++ b/index.html @@ -257,7 +257,15 @@ (isValid ? document.querySelector('form') : document.querySelector('section')).classList.add('hidden'); }; + // when all apps can generate invite links internally, we may decide to remove on-site generator + // and instead show a page with instructions how to generate links in Delta Chat function textareaInput(inputData) { + // be idempotent: allow pasting a already generated invite-link to the generator (esp. if generated by the app) + if (inputData.startsWith('https://i.delta.chat')) { + inputData = inputData.replace(/https:\/\/i.delta.chat\/?#/, '') + inputData = inputData.replace(/&/, '#') + } + // '#' may be wrongly encoded to '%23' by Safari/iOS; convert it back. see issue #16 if (inputData.indexOf('#') == -1) { inputData = inputData.replace(/%23/, '#')