1
- import './view.js'
2
- import { createTOCView } from './ui/tree.js'
3
- import { createMenu } from './ui/menu.js'
4
- import { Overlayer } from './overlayer.js'
1
+ import './foliate-js/ view.js'
2
+ import { createTOCView } from './foliate-js/ ui/tree.js'
3
+ import { createMenu } from './foliate-js/ ui/menu.js'
4
+ import { Overlayer } from './foliate-js/ overlayer.js'
5
5
6
6
const isZip = async file => {
7
7
const arr = new Uint8Array ( await file . slice ( 0 , 4 ) . arrayBuffer ( ) )
@@ -17,7 +17,7 @@ const isPDF = async file => {
17
17
18
18
const makeZipLoader = async file => {
19
19
const { configure, ZipReader, BlobReader, TextWriter, BlobWriter } =
20
- await import ( './vendor/zip.js' )
20
+ await import ( './foliate-js/ vendor/zip.js' )
21
21
configure ( { useWebWorkers : false } )
22
22
const reader = new ZipReader ( new BlobReader ( file ) )
23
23
const entries = await reader . getEntries ( )
@@ -35,19 +35,19 @@ const getView = async file => {
35
35
if ( ! file . size ) throw new Error ( 'File not found' )
36
36
else if ( await isZip ( file ) ) {
37
37
const loader = await makeZipLoader ( file )
38
- const { EPUB } = await import ( './epub.js' )
38
+ const { EPUB } = await import ( './foliate-js/ epub.js' )
39
39
book = await new EPUB ( loader ) . init ( )
40
40
}
41
41
else if ( await isPDF ( file ) ) {
42
- const { makePDF } = await import ( './pdf.js' )
42
+ const { makePDF } = await import ( './foliate-js/ pdf.js' )
43
43
book = await makePDF ( file )
44
44
}
45
45
if ( ! book ) throw new Error ( 'File type not supported' )
46
46
const view = document . createElement ( 'foliate-view' )
47
47
const storage = window . localStorage
48
48
document . body . append ( view )
49
49
await view . open ( book )
50
- view . init ( { lastLocation : storage . getItem ( "loc" ) } )
50
+ await view . init ( { lastLocation : storage . getItem ( "loc" ) } )
51
51
return view
52
52
}
53
53
@@ -185,7 +185,7 @@ class Reader {
185
185
// load and show highlights embedded in the file by Calibre
186
186
const bookmarks = await book . getCalibreBookmarks ?. ( )
187
187
if ( bookmarks ) {
188
- const { fromCalibreHighlight } = await import ( './epubcfi.js' )
188
+ const { fromCalibreHighlight } = await import ( './foliate-js/ epubcfi.js' )
189
189
for ( const obj of bookmarks ) {
190
190
if ( obj . type === 'highlight' ) {
191
191
const value = fromCalibreHighlight ( obj )
0 commit comments