From e9ad38afe6784f5582aab0531ef01795a7e6b8df Mon Sep 17 00:00:00 2001 From: John Livingston Date: Wed, 15 Dec 2021 15:00:39 +0100 Subject: [PATCH] WIP. --- client/videowatch/share.ts | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/client/videowatch/share.ts b/client/videowatch/share.ts index 5fb4fbf1..a72f6a81 100644 --- a/client/videowatch/share.ts +++ b/client/videowatch/share.ts @@ -27,6 +27,17 @@ async function shareChatUrl (registerOptions: RegisterOptions, settings: any, vi function renderContent (container: HTMLElement): void { if (!form) { container.childNodes.forEach(child => container.removeChild(child)) + + const pUrl = document.createElement('p') + const url = document.createElement('input') + url.setAttribute('type', 'text') + url.setAttribute('readonly', '') + url.setAttribute('autocomplete', 'off') + url.setAttribute('placeholder', '') + url.classList.add('form-control', 'readonly') + pUrl.append(url) + container.append(pUrl) + const pTips = document.createElement('p') pTips.textContent = tipsOBS container.append(pTips) @@ -40,16 +51,6 @@ async function shareChatUrl (registerOptions: RegisterOptions, settings: any, vi readonlyLabelEl.prepend(readonly) pReadonly.append(readonlyLabelEl) - const pUrl = document.createElement('p') - container.append(pUrl) - const url = document.createElement('input') - url.setAttribute('type', 'text') - url.setAttribute('readonly', '') - url.setAttribute('autocomplete', 'off') - url.setAttribute('placeholder', '') - url.classList.add('form-control', 'readonly') - pUrl.append(url) - readonly.onclick = () => { renderContent(container) } @@ -61,6 +62,8 @@ async function shareChatUrl (registerOptions: RegisterOptions, settings: any, vi } // TODO: save last form state, to restore each time the modal is opened. + // TODO: check when the feature should be available + // TODO: check the theme? some of the options should only be available in some cases. const uriOptions: UriOptions = { ignoreAutoColors: true,