Modify invitation layout

- Make URLs easily copyable
- Do not show XMPP URI
This commit is contained in:
Jonas Schäfer
2021-01-17 19:32:02 +01:00
parent 427f73811c
commit 1b6d340d49
8 changed files with 144 additions and 59 deletions

View File

@@ -36,6 +36,15 @@ function copyTextToClipboard(text, context, callback) {
}
/* end of https://stackoverflow.com/a/30810322/1248008 */
var insert_first = function(parent_el, new_el) {
var first = parent_el.firstChild;
if (!first) {
parent_el.appendChild(new_el);
} else {
parent_el.insertBefore(new_el, first);
}
}
var copy_to_clipboard = function(el) {
var text = el.dataset.cliptext;
if (!text) {
@@ -51,12 +60,12 @@ var copy_to_clipboard = function(el) {
result_el.id = "clipboard-result";
if (success) {
result_el.classList.add("success");
result_el.innerText = "Copied!";
result_el.innerText = "";
} else {
result_el.classList.add("error");
result_el.innerText = "Clipboard operation failed!";
result_el.innerText = "";
}
el.appendChild(result_el);
insert_first(el, result_el);
setTimeout(function() {
el.removeChild(result_el);
el.blur();