Minimal online import implementation
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
class="flex flex-row gap-5 items-center justify-between w-full"
|
||||
>
|
||||
<div>
|
||||
<p class="font-semibold" class:text-white={!isComplete}>{volumeName}</p>
|
||||
<p class="font-semibold" class:text-white={!isComplete}>{decodeURI(volumeName)}</p>
|
||||
<p>{progressDisplay}</p>
|
||||
</div>
|
||||
{#if isComplete}
|
||||
|
||||
@@ -4,6 +4,8 @@ import { showSnackbar } from '$lib/util/snackbar';
|
||||
import { requestPersistentStorage } from '$lib/util/upload';
|
||||
import { BlobReader, ZipReader, BlobWriter, getMimeType } from '@zip.js/zip.js';
|
||||
|
||||
export * from './web-import'
|
||||
|
||||
const zipTypes = ['zip', 'cbz', 'ZIP', 'CBZ'];
|
||||
const imageTypes = ['image/jpeg', 'image/png', 'image/webp'];
|
||||
|
||||
|
||||
7
src/lib/upload/web-import.ts
Normal file
7
src/lib/upload/web-import.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export function getItems(html: string) {
|
||||
const parser = new DOMParser();
|
||||
const htmlDoc = parser.parseFromString(html, 'text/html');
|
||||
|
||||
const items = htmlDoc.getElementsByTagName('a');
|
||||
return [...items]
|
||||
}
|
||||
Reference in New Issue
Block a user