('img.picture')!;
+ img.src = URL.createObjectURL(blob);
+ img.onload = () => {
+ if (wasEnabled) return submit.click();
+ URL.revokeObjectURL(img.src);
+ setSubmitEnabled();
+ };
+ },
+ });
+}
diff --git a/ui/bits/src/bits.ts b/ui/bits/src/bits.ts
index 6dbf7b4aa58b..48d730631152 100644
--- a/ui/bits/src/bits.ts
+++ b/ui/bits/src/bits.ts
@@ -34,8 +34,8 @@ export function initModule(args: { fn: string } & any): void {
return relayForm();
case 'setAssetInfo':
return setAssetInfo();
- case 'streamer':
- return streamer();
+ case 'streamerSubscribe':
+ return streamerSubscribe();
case 'thanksReport':
return thanksReport();
case 'titleRequest':
@@ -233,7 +233,7 @@ function setAssetInfo() {
$('#asset-version-message').text(site.info.message);
}
-function streamer() {
+function streamerSubscribe() {
$('.streamer-show, .streamer-list').on('change', '.streamer-subscribe input', (e: Event) => {
const target = e.target as HTMLInputElement;
$(target)
@@ -247,13 +247,6 @@ function streamer() {
);
});
});
- wireCropDialog({
- aspectRatio: 1,
- post: { url: '/upload/image/streamer', field: 'picture' },
- max: { pixels: 1000 },
- selectClicks: $('.select-image, .drop-target'),
- selectDrags: $('.drop-target'),
- });
}
function titleRequest() {
diff --git a/ui/common/src/dialog.ts b/ui/common/src/dialog.ts
index 0889e41b77d4..c82e6dede364 100644
--- a/ui/common/src/dialog.ts
+++ b/ui/common/src/dialog.ts
@@ -89,7 +89,7 @@ export async function confirm(
(
await domDialog({
htmlText:
- `${escapeHtml(msg)}
` +
+ `${escapeHtmlAddBreaks(msg)}
` +
`` +
``,
class: 'alert',
@@ -111,7 +111,7 @@ export async function confirm(
export async function prompt(msg: string, def: string = ''): Promise {
const res = await domDialog({
htmlText:
- `${escapeHtml(msg)}
` +
+ `${escapeHtmlAddBreaks(msg)}
` +
`` +
`` +
``,
@@ -361,6 +361,10 @@ function loadAssets(o: DialogOpts) {
]);
}
+function escapeHtmlAddBreaks(s: string) {
+ return escapeHtml(s).replace(/\n/g, '
');
+}
+
function onKeydown(e: KeyboardEvent) {
if (e.key === 'Tab') {
const $focii = $(focusQuery, e.currentTarget as Element),