mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-03 14:59:18 +02:00
5468 lines
122 KiB
HTML
5468 lines
122 KiB
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset='utf-8' />
|
|
<title> | Documentation</title>
|
|
<meta name='viewport' content='width=device-width,initial-scale=1'>
|
|
<link href='assets/bass.css' type='text/css' rel='stylesheet' />
|
|
<link href='assets/style.css' type='text/css' rel='stylesheet' />
|
|
<link href='assets/github.css' type='text/css' rel='stylesheet' />
|
|
</head>
|
|
<body class='documentation'>
|
|
<div class='max-width-4 mx-auto'>
|
|
<div class='clearfix md-mxn2'>
|
|
<div class='fixed xs-hide fix-3 overflow-auto max-height-100'>
|
|
<div class='py1 px2'>
|
|
<h3 class='mb0 no-anchor'></h3>
|
|
<div class='mb1'><code></code></div>
|
|
<input
|
|
placeholder='Filter'
|
|
id='filter-input'
|
|
class='col12 block input'
|
|
type='text' />
|
|
<div id='toc'>
|
|
<ul class='list-reset h5 py1-ul'>
|
|
|
|
|
|
<li><a
|
|
href='#epub'
|
|
class=" toggle-sibling">
|
|
ePub
|
|
<span class='icon'>▸</span>
|
|
</a>
|
|
|
|
<div class='toggle-target display-none'>
|
|
|
|
<ul class='list-reset py1-ul pl1'>
|
|
<li class='h5'><span>Static members</span></li>
|
|
|
|
<li><a
|
|
href='#ePub.register'
|
|
class='regular pre-open'>
|
|
.register
|
|
</a></li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
|
|
<li><a
|
|
href='#book'
|
|
class=" toggle-sibling">
|
|
Book
|
|
<span class='icon'>▸</span>
|
|
</a>
|
|
|
|
<div class='toggle-target display-none'>
|
|
|
|
|
|
<ul class='list-reset py1-ul pl1'>
|
|
<li class='h5'><span>Instance members</span></li>
|
|
|
|
<li><a
|
|
href='#Book#opened'
|
|
class='regular pre-open'>
|
|
#opened
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Book#spine'
|
|
class='regular pre-open'>
|
|
#spine
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Book#locations'
|
|
class='regular pre-open'>
|
|
#locations
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Book#navigation'
|
|
class='regular pre-open'>
|
|
#navigation
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Book#pageList'
|
|
class='regular pre-open'>
|
|
#pageList
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Book#open'
|
|
class='regular pre-open'>
|
|
#open
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Book#load'
|
|
class='regular pre-open'>
|
|
#load
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Book#resolve'
|
|
class='regular pre-open'>
|
|
#resolve
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Book#section'
|
|
class='regular pre-open'>
|
|
#section
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Book#renderTo'
|
|
class='regular pre-open'>
|
|
#renderTo
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Book#setRequestCredentials'
|
|
class='regular pre-open'>
|
|
#setRequestCredentials
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Book#setRequestHeaders'
|
|
class='regular pre-open'>
|
|
#setRequestHeaders
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Book#coverUrl'
|
|
class='regular pre-open'>
|
|
#coverUrl
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Book#range'
|
|
class='regular pre-open'>
|
|
#range
|
|
</a></li>
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
|
|
<li><a
|
|
href='#locations'
|
|
class=" toggle-sibling">
|
|
Locations
|
|
<span class='icon'>▸</span>
|
|
</a>
|
|
|
|
<div class='toggle-target display-none'>
|
|
|
|
|
|
<ul class='list-reset py1-ul pl1'>
|
|
<li class='h5'><span>Instance members</span></li>
|
|
|
|
<li><a
|
|
href='#Locations#generate'
|
|
class='regular pre-open'>
|
|
#generate
|
|
</a></li>
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
|
|
<li><a
|
|
href='#container'
|
|
class=" toggle-sibling">
|
|
Container
|
|
<span class='icon'>▸</span>
|
|
</a>
|
|
|
|
<div class='toggle-target display-none'>
|
|
|
|
|
|
<ul class='list-reset py1-ul pl1'>
|
|
<li class='h5'><span>Instance members</span></li>
|
|
|
|
<li><a
|
|
href='#Container#parse'
|
|
class='regular pre-open'>
|
|
#parse
|
|
</a></li>
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
|
|
<li><a
|
|
href='#packaging'
|
|
class=" toggle-sibling">
|
|
Packaging
|
|
<span class='icon'>▸</span>
|
|
</a>
|
|
|
|
<div class='toggle-target display-none'>
|
|
|
|
|
|
<ul class='list-reset py1-ul pl1'>
|
|
<li class='h5'><span>Instance members</span></li>
|
|
|
|
<li><a
|
|
href='#Packaging#parse'
|
|
class='regular pre-open'>
|
|
#parse
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Packaging#parseSpine'
|
|
class='regular pre-open'>
|
|
#parseSpine
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Packaging#findCoverPath'
|
|
class='regular pre-open'>
|
|
#findCoverPath
|
|
</a></li>
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
|
|
<li><a
|
|
href='#navigation'
|
|
class=" toggle-sibling">
|
|
Navigation
|
|
<span class='icon'>▸</span>
|
|
</a>
|
|
|
|
<div class='toggle-target display-none'>
|
|
|
|
|
|
<ul class='list-reset py1-ul pl1'>
|
|
<li class='h5'><span>Instance members</span></li>
|
|
|
|
<li><a
|
|
href='#Navigation#parse'
|
|
class='regular pre-open'>
|
|
#parse
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Navigation#get'
|
|
class='regular pre-open'>
|
|
#get
|
|
</a></li>
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
|
|
<li><a
|
|
href='#resources'
|
|
class=" toggle-sibling">
|
|
Resources
|
|
<span class='icon'>▸</span>
|
|
</a>
|
|
|
|
<div class='toggle-target display-none'>
|
|
|
|
|
|
<ul class='list-reset py1-ul pl1'>
|
|
<li class='h5'><span>Instance members</span></li>
|
|
|
|
<li><a
|
|
href='#Resources#replacements'
|
|
class='regular pre-open'>
|
|
#replacements
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Resources#relativeTo'
|
|
class='regular pre-open'>
|
|
#relativeTo
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Resources#get'
|
|
class='regular pre-open'>
|
|
#get
|
|
</a></li>
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
|
|
<li><a
|
|
href='#archive'
|
|
class=" toggle-sibling">
|
|
Archive
|
|
<span class='icon'>▸</span>
|
|
</a>
|
|
|
|
<div class='toggle-target display-none'>
|
|
|
|
|
|
<ul class='list-reset py1-ul pl1'>
|
|
<li class='h5'><span>Instance members</span></li>
|
|
|
|
<li><a
|
|
href='#Archive#open'
|
|
class='regular pre-open'>
|
|
#open
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Archive#openUrl'
|
|
class='regular pre-open'>
|
|
#openUrl
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Archive#request'
|
|
class='regular pre-open'>
|
|
#request
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Archive#getBlob'
|
|
class='regular pre-open'>
|
|
#getBlob
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Archive#getText'
|
|
class='regular pre-open'>
|
|
#getText
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Archive#getBase64'
|
|
class='regular pre-open'>
|
|
#getBase64
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Archive#createUrl'
|
|
class='regular pre-open'>
|
|
#createUrl
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Archive#revokeUrl'
|
|
class='regular pre-open'>
|
|
#revokeUrl
|
|
</a></li>
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
|
|
<li><a
|
|
href='#epubcfi'
|
|
class="">
|
|
EpubCFI
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
|
|
<li><a
|
|
href='#url'
|
|
class="">
|
|
Url
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
|
|
<li><a
|
|
href='#content'
|
|
class="">
|
|
content
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
|
|
<li><a
|
|
href='#rendition'
|
|
class=" toggle-sibling">
|
|
Rendition
|
|
<span class='icon'>▸</span>
|
|
</a>
|
|
|
|
<div class='toggle-target display-none'>
|
|
|
|
|
|
<ul class='list-reset py1-ul pl1'>
|
|
<li class='h5'><span>Instance members</span></li>
|
|
|
|
<li><a
|
|
href='#Rendition#hooks'
|
|
class='regular pre-open'>
|
|
#hooks
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Rendition#setManager'
|
|
class='regular pre-open'>
|
|
#setManager
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Rendition#requireManager'
|
|
class='regular pre-open'>
|
|
#requireManager
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Rendition#requireView'
|
|
class='regular pre-open'>
|
|
#requireView
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Rendition#start'
|
|
class='regular pre-open'>
|
|
#start
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Rendition#attachTo'
|
|
class='regular pre-open'>
|
|
#attachTo
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Rendition#display'
|
|
class='regular pre-open'>
|
|
#display
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Rendition#moveTo'
|
|
class='regular pre-open'>
|
|
#moveTo
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Rendition#next'
|
|
class='regular pre-open'>
|
|
#next
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Rendition#prev'
|
|
class='regular pre-open'>
|
|
#prev
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Rendition#flow'
|
|
class='regular pre-open'>
|
|
#flow
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Rendition#layout'
|
|
class='regular pre-open'>
|
|
#layout
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Rendition#spread'
|
|
class='regular pre-open'>
|
|
#spread
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Rendition#reportLocation'
|
|
class='regular pre-open'>
|
|
#reportLocation
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Rendition#destroy'
|
|
class='regular pre-open'>
|
|
#destroy
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Rendition#range'
|
|
class='regular pre-open'>
|
|
#range
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Rendition#adjustImages'
|
|
class='regular pre-open'>
|
|
#adjustImages
|
|
</a></li>
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
|
|
<li><a
|
|
href='#hook'
|
|
class=" toggle-sibling">
|
|
Hook
|
|
<span class='icon'>▸</span>
|
|
</a>
|
|
|
|
<div class='toggle-target display-none'>
|
|
|
|
|
|
<ul class='list-reset py1-ul pl1'>
|
|
<li class='h5'><span>Instance members</span></li>
|
|
|
|
<li><a
|
|
href='#Hook#register'
|
|
class='regular pre-open'>
|
|
#register
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Hook#trigger'
|
|
class='regular pre-open'>
|
|
#trigger
|
|
</a></li>
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
|
|
<li><a
|
|
href='#layout'
|
|
class=" toggle-sibling">
|
|
Layout
|
|
<span class='icon'>▸</span>
|
|
</a>
|
|
|
|
<div class='toggle-target display-none'>
|
|
|
|
|
|
<ul class='list-reset py1-ul pl1'>
|
|
<li class='h5'><span>Instance members</span></li>
|
|
|
|
<li><a
|
|
href='#Layout#flow'
|
|
class='regular pre-open'>
|
|
#flow
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Layout#spread'
|
|
class='regular pre-open'>
|
|
#spread
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Layout#calculate'
|
|
class='regular pre-open'>
|
|
#calculate
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Layout#format'
|
|
class='regular pre-open'>
|
|
#format
|
|
</a></li>
|
|
|
|
<li><a
|
|
href='#Layout#count'
|
|
class='regular pre-open'>
|
|
#count
|
|
</a></li>
|
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
</div>
|
|
<div class='mt1 h6 quiet'>
|
|
<a href='http://documentation.js.org/reading-documentation.html'>Need help reading this?</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class='fix-margin-3'>
|
|
|
|
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
<div class='clearfix'>
|
|
<h3 class='fl m0' id='epub'>
|
|
ePub
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
|
|
<p>Creates a new Book</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>ePub(url: (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer">ArrayBuffer</a>), options: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>): <a href="#book">Book</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>url</span> <code class='quiet'>((<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer">ArrayBuffer</a>))</code> URL, Path or ArrayBuffer
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>options</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>)</code> to pass to the book
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#book">Book</a></code>:
|
|
a new Book object
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Example</div>
|
|
|
|
|
|
<pre class='p1 overflow-auto round fill-light'>ePub(<span class="hljs-string">"/path/to/book.epub"</span>, {})</pre>
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Static Members</div>
|
|
<div class="clearfix">
|
|
|
|
<div class='border-bottom' id='ePub.register'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>register</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>register plugins</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>register</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Static Members</div>
|
|
<div class="clearfix">
|
|
|
|
<div class='border-bottom' id='ePub.register.manager'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>manager()</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>register a new view manager</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>manager()</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='ePub.register.view'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>view()</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>register a new view</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>view()</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
<div class='clearfix'>
|
|
<h3 class='fl m0' id='book'>
|
|
Book
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
|
|
<p>Creates a new Book</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>new Book(url: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, options: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>): <a href="#book">Book</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>url</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>options</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>)</code>
|
|
</div>
|
|
|
|
<table class='mt1 mb2 fixed-table h5 col-12'>
|
|
<colgroup>
|
|
<col width='30%' />
|
|
<col width='70%' />
|
|
</colgroup>
|
|
<thead>
|
|
<tr class='bold fill-light'>
|
|
<th>Name</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class='mt1'>
|
|
|
|
<tr>
|
|
<td class='break-word'><span class='code bold'>options.requestMethod</span> <code class='quiet'>method</code>
|
|
</td>
|
|
<td class='break-word'><span>a request function to use instead of the default
|
|
</span></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class='break-word'><span class='code bold'>options.requestCredentials</span> <code class='quiet'>[<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>]</code>
|
|
|
|
(default <code>undefined</code>)
|
|
</td>
|
|
<td class='break-word'><span>send the xhr request withCredentials
|
|
</span></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class='break-word'><span class='code bold'>options.requestHeaders</span> <code class='quiet'>[<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>]</code>
|
|
|
|
(default <code>undefined</code>)
|
|
</td>
|
|
<td class='break-word'><span>send the xhr request headers
|
|
</span></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class='break-word'><span class='code bold'>options.encoding</span> <code class='quiet'>[<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>]</code>
|
|
|
|
(default <code>binary</code>)
|
|
</td>
|
|
<td class='break-word'><span>optional to pass 'binary' or base64' for archived Epubs
|
|
</span></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class='break-word'><span class='code bold'>options.replacements</span> <code class='quiet'>[<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>]</code>
|
|
|
|
(default <code>base64</code>)
|
|
</td>
|
|
<td class='break-word'><span>use base64, blobs, or none for replacing assets in archived Epubs
|
|
</span></td>
|
|
</tr>
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#book">Book</a></code>:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Example</div>
|
|
|
|
|
|
<pre class='p1 overflow-auto round fill-light'><span class="hljs-keyword">new</span> Book(<span class="hljs-string">"/path/to/book.epub"</span>, {})</pre>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Instance Members</div>
|
|
<div class="clearfix">
|
|
|
|
<div class='border-bottom' id='Book#opened'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>opened</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>opened</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Properties</div>
|
|
<div>
|
|
|
|
<div class='space-bottom0'>
|
|
<span class='code bold'>opened</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">promise</a>)</code>
|
|
: returns after the book is loaded
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Book#spine'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>spine</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>spine</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Properties</div>
|
|
<div>
|
|
|
|
<div class='space-bottom0'>
|
|
<span class='code bold'>spine</span> <code class='quiet'>(Spine)</code>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Book#locations'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>locations</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>locations</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Properties</div>
|
|
<div>
|
|
|
|
<div class='space-bottom0'>
|
|
<span class='code bold'>locations</span> <code class='quiet'>(<a href="#locations">Locations</a>)</code>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Book#navigation'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>navigation</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>navigation</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Properties</div>
|
|
<div>
|
|
|
|
<div class='space-bottom0'>
|
|
<span class='code bold'>navigation</span> <code class='quiet'>(<a href="#navigation">Navigation</a>)</code>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Book#pageList'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>pageList</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>pageList</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Properties</div>
|
|
<div>
|
|
|
|
<div class='space-bottom0'>
|
|
<span class='code bold'>pagelist</span> <code class='quiet'>(PageList)</code>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Book#open'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>open(input, [what])</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Open a epub or url</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>open(input: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, what: [<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>]): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>input</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code> URL, Path or ArrayBuffer
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>what</span> <code class='quiet'>([<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>])</code> to force opening
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>:
|
|
of when the book has been loaded
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Example</div>
|
|
|
|
|
|
<pre class='p1 overflow-auto round fill-light'>book.open(<span class="hljs-string">"/path/to/book.epub"</span>)</pre>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Book#load'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>load(path)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Load a resource from the Book</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>load(path: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>path</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code> path to the resource to load
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>:
|
|
returns a promise with the requested resource
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Book#resolve'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>resolve(path, absolute)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Resolve a path to it's absolute position in the Book</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>resolve(path: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, absolute: [<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>]): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>path</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>absolute</span> <code class='quiet'>([<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>])</code> force resolving the full URL
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code>:
|
|
the resolved path string
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Book#section'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>section(target)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Alias for book.spine.get</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>section(target: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>target</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Book#renderTo'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>renderTo(element, options)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Sugar to render a book</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>renderTo(element: <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element">element</a>, options: [<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>]): <a href="#rendition">Rendition</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>element</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/API/Element">element</a>)</code> element to add the views to
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>options</span> <code class='quiet'>([<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>])</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="#rendition">Rendition</a></code>:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Book#setRequestCredentials'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>setRequestCredentials(credentials)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Set if request should use withCredentials</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>setRequestCredentials(credentials: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>credentials</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Book#setRequestHeaders'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>setRequestHeaders(headers)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Set headers request should use</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>setRequestHeaders(headers: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>headers</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Book#coverUrl'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>coverUrl()</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Get the cover url</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>coverUrl(): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code>:
|
|
coverUrl
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Book#range'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>range(cfiRange)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Find a DOM Range for a given CFI Range</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>range(cfiRange: <a href="#epubcfi">EpubCFI</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input">Range</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>cfiRange</span> <code class='quiet'>(<a href="#epubcfi">EpubCFI</a>)</code> a epub cfi range
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input">Range</a></code>:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
<div class='clearfix'>
|
|
<h3 class='fl m0' id='locations'>
|
|
Locations
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
|
|
<p>Find Locations for a Book</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>new Locations(spine: Spine, request: <a href="https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/request">request</a>)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>spine</span> <code class='quiet'>(Spine)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>request</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/request">request</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Instance Members</div>
|
|
<div class="clearfix">
|
|
|
|
<div class='border-bottom' id='Locations#generate'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>generate(chars)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Load all of sections in the book to generate locations</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>generate(chars: int): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>chars</span> <code class='quiet'>(int)</code> how many chars to split on
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></code>:
|
|
locations
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
<div class='clearfix'>
|
|
<h3 class='fl m0' id='container'>
|
|
Container
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
|
|
<p>Handles Parsing and Accessing an Epub Container</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>new Container(containerDocument: [<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">document</a>])</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>containerDocument</span> <code class='quiet'>([<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">document</a>])</code> xml document
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Instance Members</div>
|
|
<div class="clearfix">
|
|
|
|
<div class='border-bottom' id='Container#parse'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>parse(containerDocument)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Parse the Container XML</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>parse(containerDocument: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">document</a>)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>containerDocument</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">document</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
<div class='clearfix'>
|
|
<h3 class='fl m0' id='packaging'>
|
|
Packaging
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
|
|
<p>Open Packaging Format Parser</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>new Packaging(packageDocument: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">document</a>)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>packageDocument</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">document</a>)</code> OPF XML
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Instance Members</div>
|
|
<div class="clearfix">
|
|
|
|
<div class='border-bottom' id='Packaging#parse'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>parse(packageDocument)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Parse OPF XML</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>parse(packageDocument: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">document</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>packageDocument</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">document</a>)</code> OPF XML
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></code>:
|
|
parsed package parts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Packaging#parseSpine'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>parseSpine(spineXml, manifest)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Parse Spine</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>parseSpine(spineXml: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">document</a>, manifest: Packaging.manifest): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>spineXml</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">document</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>manifest</span> <code class='quiet'>(Packaging.manifest)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></code>:
|
|
spine
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Packaging#findCoverPath'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>findCoverPath(packageXml)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Find the Cover Path
|
|
<item properties="cover-image" id="ci" href="cover.svg" media-type="image/svg+xml" />
|
|
Fallback for Epub 2.0</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>findCoverPath(packageXml: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">document</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>packageXml</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">document</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code>:
|
|
href
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
<div class='clearfix'>
|
|
<h3 class='fl m0' id='navigation'>
|
|
Navigation
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
|
|
<p>Navigation Parser</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>new Navigation(xml: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">document</a>)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>xml</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">document</a>)</code> navigation html / xhtml / ncx
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Instance Members</div>
|
|
<div class="clearfix">
|
|
|
|
<div class='border-bottom' id='Navigation#parse'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>parse(xml)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Parse out the navigation items</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>parse(xml: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">document</a>)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>xml</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">document</a>)</code> navigation html / xhtml / ncx
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Navigation#get'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>get(target)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Get an item from the navigation</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>get(target: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>target</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></code>:
|
|
navItems
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
<div class='clearfix'>
|
|
<h3 class='fl m0' id='resources'>
|
|
Resources
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
|
|
<p>Handle Package Resources</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>new Resources(manifest: Manifest, options: [<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>])</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>manifest</span> <code class='quiet'>(Manifest)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>options</span> <code class='quiet'>([<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>])</code>
|
|
</div>
|
|
|
|
<table class='mt1 mb2 fixed-table h5 col-12'>
|
|
<colgroup>
|
|
<col width='30%' />
|
|
<col width='70%' />
|
|
</colgroup>
|
|
<thead>
|
|
<tr class='bold fill-light'>
|
|
<th>Name</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class='mt1'>
|
|
|
|
<tr>
|
|
<td class='break-word'><span class='code bold'>options.archive</span> <code class='quiet'>[<a href="#archive">Archive</a>]</code>
|
|
</td>
|
|
<td class='break-word'><span></span></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class='break-word'><span class='code bold'>options.resolver</span> <code class='quiet'>[method]</code>
|
|
</td>
|
|
<td class='break-word'><span></span></td>
|
|
</tr>
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Instance Members</div>
|
|
<div class="clearfix">
|
|
|
|
<div class='border-bottom' id='Resources#replacements'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>replacements(archive, resolver)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Create blob urls for all the assets</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>replacements(archive: <a href="#archive">Archive</a>, resolver: resolver): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>archive</span> <code class='quiet'>(<a href="#archive">Archive</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>resolver</span> <code class='quiet'>(resolver)</code> Url resolver
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>:
|
|
returns replacement urls
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Resources#relativeTo'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>relativeTo(absolute, resolver)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Resolve all resources URLs relative to an absolute URL</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>relativeTo(absolute: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, resolver: [resolver]): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>absolute</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code> to be resolved to
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>resolver</span> <code class='quiet'>([resolver])</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Array</a><<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>></code>:
|
|
array with relative Urls
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Resources#get'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>get(path)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Get a URL for a resource</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>get(path: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>path</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code>:
|
|
url
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
<div class='clearfix'>
|
|
<h3 class='fl m0' id='archive'>
|
|
Archive
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
|
|
<p>Handles Unzipping a requesting files from an Epub Archive</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>new Archive()</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Instance Members</div>
|
|
<div class="clearfix">
|
|
|
|
<div class='border-bottom' id='Archive#open'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>open(input, isBase64)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Open an archive</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>open(input: binary, isBase64: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>input</span> <code class='quiet'>(binary)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>isBase64</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>)</code> tells JSZip if the input data is base64 encoded
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>:
|
|
zipfile
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Archive#openUrl'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>openUrl(zipUrl, isBase64)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Load and Open an archive</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>openUrl(zipUrl: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, isBase64: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>zipUrl</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>isBase64</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>)</code> tells JSZip if the input data is base64 encoded
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>:
|
|
zipfile
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Archive#request'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>request(url, type)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Request</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>request(url: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, type: [<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>]): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>url</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code> a url to request from the archive
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>type</span> <code class='quiet'>([<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>])</code> specify the type of the returned result
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Archive#getBlob'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>getBlob(url, mimeType)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Get a Blob from Archive by Url</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>getBlob(url: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, mimeType: [<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>]): <a href="https://developer.mozilla.org/en-US/docs/Web/API/Blob">Blob</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>url</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>mimeType</span> <code class='quiet'>([<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>])</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/API/Blob">Blob</a></code>:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Archive#getText'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>getText(url, encoding)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Get Text from Archive by Url</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>getText(url: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, encoding: [<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>]): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>url</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>encoding</span> <code class='quiet'>([<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>])</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code>:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Archive#getBase64'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>getBase64(url, mimeType)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Get a base64 encoded result from Archive by Url</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>getBase64(url: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, mimeType: [<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>]): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>url</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>mimeType</span> <code class='quiet'>([<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>])</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code>:
|
|
base64 encoded
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Archive#createUrl'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>createUrl(url, options)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Create a Url from an unarchived item</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>createUrl(url: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, options: any): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>url</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>options</span> <code class='quiet'>(any)</code>
|
|
</div>
|
|
|
|
<table class='mt1 mb2 fixed-table h5 col-12'>
|
|
<colgroup>
|
|
<col width='30%' />
|
|
<col width='70%' />
|
|
</colgroup>
|
|
<thead>
|
|
<tr class='bold fill-light'>
|
|
<th>Name</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class='mt1'>
|
|
|
|
<tr>
|
|
<td class='break-word'><span class='code bold'>options.base64</span> <code class='quiet'>[<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>]</code>
|
|
</td>
|
|
<td class='break-word'><span>use base64 encoding or blob url
|
|
</span></td>
|
|
</tr>
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>:
|
|
url promise with Url string
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Archive#revokeUrl'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>revokeUrl(url)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Revoke Temp Url for a achive item</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>revokeUrl(url: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>url</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code> url of the item in the archive
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
<div class='clearfix'>
|
|
<h3 class='fl m0' id='epubcfi'>
|
|
EpubCFI
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
|
|
<p>EPUB CFI spec: <a href="http://www.idpf.org/epub/linking/cfi/epub-cfi.html">http://www.idpf.org/epub/linking/cfi/epub-cfi.html</a></p>
|
|
<p>Implements:</p>
|
|
<ul>
|
|
<li>Character Offset: epubcfi(/6/4[chap01ref]!/4[body01]/10[para05]/2/1:3)</li>
|
|
<li>Simple Ranges : epubcfi(/6/4[chap01ref]!/4[body01]/10[para05],/2/1:1,/3:4)</li>
|
|
</ul>
|
|
<p>Does Not Implement:</p>
|
|
<ul>
|
|
<li>Temporal Offset (~)</li>
|
|
<li>Spatial Offset (@)</li>
|
|
<li>Temporal-Spatial Offset (~ + @)</li>
|
|
<li>Text Location Assertion ([)</li>
|
|
</ul>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>new EpubCFI(cfiFrom: any, base: any, ignoreClass: any)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>cfiFrom</span> <code class='quiet'>(any)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>base</span> <code class='quiet'>(any)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>ignoreClass</span> <code class='quiet'>(any)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
<div class='clearfix'>
|
|
<h3 class='fl m0' id='url'>
|
|
Url
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
|
|
<p>creates a uri object</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>new Url(urlString: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, baseString: [<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>]): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>urlString</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code> a url string (relative or absolute)
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>baseString</span> <code class='quiet'>([<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>])</code> optional base for the url,
|
|
default to window.location.href
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a></code>:
|
|
url
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
<div class='clearfix'>
|
|
<h3 class='fl m0' id='content'>
|
|
content
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>content</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Properties</div>
|
|
<div>
|
|
|
|
<div class='space-bottom0'>
|
|
<span class='code bold'>hooks.content</span> <code class='quiet'>(method)</code>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
<div class='clearfix'>
|
|
<h3 class='fl m0' id='rendition'>
|
|
Rendition
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
|
|
<p>[Rendition description]</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>new Rendition(book: <a href="#book">Book</a>, options: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>book</span> <code class='quiet'>(<a href="#book">Book</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>options</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>)</code>
|
|
</div>
|
|
|
|
<table class='mt1 mb2 fixed-table h5 col-12'>
|
|
<colgroup>
|
|
<col width='30%' />
|
|
<col width='70%' />
|
|
</colgroup>
|
|
<thead>
|
|
<tr class='bold fill-light'>
|
|
<th>Name</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class='mt1'>
|
|
|
|
<tr>
|
|
<td class='break-word'><span class='code bold'>options.width</span> <code class='quiet'>int</code>
|
|
</td>
|
|
<td class='break-word'><span></span></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class='break-word'><span class='code bold'>options.height</span> <code class='quiet'>int</code>
|
|
</td>
|
|
<td class='break-word'><span></span></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class='break-word'><span class='code bold'>options.ignoreClass</span> <code class='quiet'><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code>
|
|
</td>
|
|
<td class='break-word'><span></span></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class='break-word'><span class='code bold'>options.manager</span> <code class='quiet'><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code>
|
|
</td>
|
|
<td class='break-word'><span></span></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class='break-word'><span class='code bold'>options.view</span> <code class='quiet'><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code>
|
|
</td>
|
|
<td class='break-word'><span></span></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class='break-word'><span class='code bold'>options.layout</span> <code class='quiet'><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code>
|
|
</td>
|
|
<td class='break-word'><span></span></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class='break-word'><span class='code bold'>options.spread</span> <code class='quiet'><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code>
|
|
</td>
|
|
<td class='break-word'><span></span></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class='break-word'><span class='code bold'>options.minSpreadWidth</span> <code class='quiet'>int</code>
|
|
</td>
|
|
<td class='break-word'><span>overridden by spread: none (never) / both (always)
|
|
</span></td>
|
|
</tr>
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Instance Members</div>
|
|
<div class="clearfix">
|
|
|
|
<div class='border-bottom' id='Rendition#hooks'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>hooks</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Adds Hook methods to the Rendition prototype</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>hooks</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Properties</div>
|
|
<div>
|
|
|
|
<div class='space-bottom0'>
|
|
<span class='code bold'>hooks</span> <code class='quiet'>(<a href="#hook">Hook</a>)</code>
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Rendition#setManager'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>setManager(manager)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Set the manager function</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>setManager(manager: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function">function</a>)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>manager</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function">function</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Rendition#requireManager'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>requireManager(manager)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Require the manager from passed string, or as a function</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>requireManager(manager: (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function">function</a>)): method</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>manager</span> <code class='quiet'>((<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function">function</a>))</code> [
|
|
description
|
|
]
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code>method</code>:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Rendition#requireView'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>requireView(view)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Require the view from passed string, or as a function</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>requireView(view: (<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function">function</a>)): view</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>view</span> <code class='quiet'>((<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function">function</a>))</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code>view</code>:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Rendition#start'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>start()</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Start the rendering</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>start(): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>:
|
|
rendering has started
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Rendition#attachTo'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>attachTo(element)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Call to attach the container to an element in the dom
|
|
Container must be attached before rendering can begin</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>attachTo(element: <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element">element</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>element</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/API/Element">element</a>)</code> to attach to
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Rendition#display'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>display(target)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Display a point in the book
|
|
The request will be added to the rendering Queue,
|
|
so it will wait until book is opened, rendering started
|
|
and all other rendering tasks have finished to be called.</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>display(target: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>target</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code> Url or EpubCFI
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Rendition#moveTo'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>moveTo(offset)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Move the Rendition to a specific offset
|
|
Usually you would be better off calling display()</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>moveTo(offset: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>offset</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Rendition#next'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>next()</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Go to the next "page" in the rendition</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>next(): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Rendition#prev'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>prev()</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Go to the previous "page" in the rendition</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>prev(): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a></code>:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Rendition#flow'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>flow(flow)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Adjust the flow of the rendition to paginated or scrolled
|
|
(scrolled-continuous vs scrolled-doc are handled by different view managers)</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>flow(flow: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>flow</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Rendition#layout'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>layout(settings)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Adjust the layout of the rendition to reflowable or pre-paginated</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>layout(settings: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>settings</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Rendition#spread'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>spread(spread, min)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Adjust if the rendition uses spreads</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>spread(spread: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, min: int)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>spread</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code> none | auto (TODO: implement landscape, portrait, both)
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>min</span> <code class='quiet'>(int)</code> min width to use spreads at
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Rendition#reportLocation'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>reportLocation()</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Report the current location</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>reportLocation()</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Rendition#destroy'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>destroy()</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Remove and Clean Up the Rendition</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>destroy()</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Rendition#range'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>range(cfi, ignoreClass)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Get a Range from a Visible CFI</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>range(cfi: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, ignoreClass: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input">range</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>cfi</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code> EpubCfi String
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>ignoreClass</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Input">range</a></code>:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Rendition#adjustImages'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>adjustImages(view)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Hook to adjust images to fit in columns</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>adjustImages(view: View)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>view</span> <code class='quiet'>(View)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
<div class='clearfix'>
|
|
<h3 class='fl m0' id='hook'>
|
|
Hook
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
|
|
<p>Hooks allow for injecting functions that must all complete in order before finishing
|
|
They will execute in parallel but all must finish before continuing
|
|
Functions may return a promise if they are asycn.</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>new Hook(context: any)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>context</span> <code class='quiet'>(any)</code> scope of this
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Example</div>
|
|
|
|
|
|
<pre class='p1 overflow-auto round fill-light'><span class="hljs-keyword">this</span>.content = <span class="hljs-keyword">new</span> EPUBJS.Hook(<span class="hljs-keyword">this</span>);</pre>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Instance Members</div>
|
|
<div class="clearfix">
|
|
|
|
<div class='border-bottom' id='Hook#register'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>register()</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Adds a function to be run before a hook completes</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>register()</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Example</div>
|
|
|
|
|
|
<pre class='p1 overflow-auto round fill-light'><span class="hljs-keyword">this</span>.content.register(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>)</span>{...});</pre>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Hook#trigger'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>trigger()</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Triggers a hook to run all functions</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>trigger()</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Example</div>
|
|
|
|
|
|
<pre class='p1 overflow-auto round fill-light'><span class="hljs-keyword">this</span>.content.trigger(args).then(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>)</span>{...});</pre>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
<div class='clearfix'>
|
|
<h3 class='fl m0' id='layout'>
|
|
Layout
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
|
|
<p>Figures out the CSS to apply for a layout</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>new Layout(settings: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>settings</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">object</a>)</code>
|
|
</div>
|
|
|
|
<table class='mt1 mb2 fixed-table h5 col-12'>
|
|
<colgroup>
|
|
<col width='30%' />
|
|
<col width='70%' />
|
|
</colgroup>
|
|
<thead>
|
|
<tr class='bold fill-light'>
|
|
<th>Name</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class='mt1'>
|
|
|
|
<tr>
|
|
<td class='break-word'><span class='code bold'>settings.spread</span> <code class='quiet'>[<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>]</code>
|
|
</td>
|
|
<td class='break-word'><span></span></td>
|
|
</tr>
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Instance Members</div>
|
|
<div class="clearfix">
|
|
|
|
<div class='border-bottom' id='Layout#flow'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>flow(flow)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Switch the flow between paginated and scrolled</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>flow(flow: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>flow</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code> paginated | scrolled
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Layout#spread'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>spread(spread, min)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Switch between using spreads or not, and set the
|
|
width at which they switch to single.</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>spread(spread: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>, min: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>spread</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a>)</code> true | false
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>min</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a>)</code> integer in pixels
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Layout#calculate'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>calculate(_width, _height, _gap)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Calculate the dimensions of the pagination</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>calculate(_width: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, _height: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>, _gap: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>)</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>_width</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>)</code> [
|
|
description
|
|
]
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>_height</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>)</code> [
|
|
description
|
|
]
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>_gap</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>)</code> [
|
|
description
|
|
]
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Layout#format'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>format(contents)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Apply Css to a Document</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>format(contents: Contents): [<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>]</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>contents</span> <code class='quiet'>(Contents)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code>[<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">Promise</a>]</code>:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class='border-bottom' id='Layout#count'>
|
|
<div class="clearfix small pointer toggle-sibling">
|
|
<div class="py1 contain">
|
|
<a class='icon pin-right py1 dark-link caret-right'>▸</a>
|
|
<span class='code strong strong truncate'>count(totalWidth)</span>
|
|
</div>
|
|
</div>
|
|
<div class="clearfix display-none toggle-target">
|
|
<section class='p2 mb2 clearfix bg-white minishadow'>
|
|
|
|
|
|
|
|
<p>Count number of pages</p>
|
|
|
|
|
|
<div class='pre p1 fill-light mt0'>count(totalWidth: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Parameters</div>
|
|
<div class='prose'>
|
|
|
|
<div class='space-bottom0'>
|
|
<div>
|
|
<span class='code bold'>totalWidth</span> <code class='quiet'>(<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>)</code>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code>:
|
|
spreads
|
|
|
|
|
|
|
|
<div class='py1 quiet mt1 prose-big'>Returns</div>
|
|
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code>:
|
|
pages
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script src='assets/anchor.js'></script>
|
|
<script src='assets/site.js'></script>
|
|
</body>
|
|
</html>
|