drop.chapril.org-firefoxsend/app/ui/copyDialog.js
John Gruen 7197cc3bea Add legal and final strings (#1185)
* add legal and final strings

* removed unneeded suffixes from string ids

* removed unused strings and simplified string ids for vnext-only strings

* reword nostreams option
2019-03-04 14:13:17 -08:00

49 lines
1.5 KiB
JavaScript

const html = require('choo/html');
const { copyToClipboard } = require('../utils');
module.exports = function(name, url) {
return function(state, emit, close) {
return html`
<send-copy-dialog
class="flex flex-col items-center text-center p-4 max-w-sm m-auto"
>
<h1 class="font-bold my-4">
${state.translate('notifyUploadEncryptDone')}
</h1>
<p class="font-normal leading-normal text-grey-darkest word-break-all">
${state.translate('copyLinkDescription')} <br />
${name}
</p>
<input
type="text"
id="share-url"
class="w-full my-4 border rounded-lg leading-loose h-12 px-2 py-1"
value="${url}"
readonly="true"
/>
<button
class="btn rounded-lg w-full flex-no-shrink focus:outline"
onclick="${copy}"
title="${state.translate('copyLinkButton')}"
>
${state.translate('copyLinkButton')}
</button>
<button
class="text-blue-dark hover:text-blue-darker focus:text-blue-darker my-4 font-medium cursor-pointer focus:outline"
onclick="${close}"
title="${state.translate('okButton')}"
>
${state.translate('okButton')}
</button>
</send-copy-dialog>
`;
function copy(event) {
event.stopPropagation();
copyToClipboard(url);
event.target.textContent = state.translate('copiedUrl');
setTimeout(close, 1000);
}
};
};