-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
363 additions
and
363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
export const NS = { | ||
OPF: 'http://www.idpf.org/2007/opf', | ||
OPS: 'http://www.idpf.org/2007/ops', | ||
DC: 'http://purl.org/dc/elements/1.1/', | ||
DAISY: 'http://www.daisy.org/z3986/2005/ncx/', | ||
XHTML: 'http://www.w3.org/1999/xhtml', | ||
SVG: 'http://www.w3.org/2000/svg', | ||
XLINK: 'http://www.w3.org/1999/xlink' | ||
} | ||
|
||
export const tidyOptions = { | ||
'indent': 'auto', | ||
'numeric-entities': 'yes', | ||
'output-xhtml': 'yes', | ||
'alt-text': 'Image', | ||
'wrap': '0', | ||
'quiet': 'yes', | ||
'show-warnings': 0, | ||
'newline': 'LF', | ||
'tidy-mark': 'no' | ||
} | ||
|
||
export const mimeMap = { | ||
'image/jpeg': 'Images/*.jpg', | ||
'image/png': 'Images/*.png', | ||
'image/gif': 'Images/*.gif' | ||
} | ||
|
||
export const containerXml = `<?xml version="1.0" encoding="UTF-8"?> | ||
<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container"> | ||
<rootfiles> | ||
<rootfile full-path="content.opf" media-type="application/oebps-package+xml"/> | ||
</rootfiles> | ||
</container> | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
export default function fetch (url, cb, type) { | ||
if (url.indexOf('//') === 0) { | ||
url = 'http:' + url | ||
} | ||
let x = new XMLHttpRequest() | ||
x.open('get', url, true) | ||
if (type) { | ||
x.responseType = type | ||
} | ||
x.onload = function () { | ||
cb(x.response, x.getResponseHeader('content-type')) | ||
} | ||
x.onerror = function () { | ||
console.error('error') | ||
cb(null) | ||
} | ||
x.send() | ||
} |
Oops, something went wrong.