mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-03 14:59:18 +02:00
Include url-polyfill by default, fix linear default to yes
This commit is contained in:
parent
2caf88543b
commit
fdf7fda0d9
6 changed files with 18 additions and 10 deletions
|
@ -26,7 +26,7 @@ module.exports = function(config) {
|
|||
|
||||
// {pattern: 'node_modules/es6-promise/dist/es6-promise.auto.js', watched: false, included: true, served: true},
|
||||
|
||||
{pattern: 'libs/url/url.js', watched: false, included: true, served: true}
|
||||
{pattern: 'libs/url/url-polyfill.js', watched: false, included: true, served: true}
|
||||
|
||||
],
|
||||
|
||||
|
|
|
@ -1,19 +1,26 @@
|
|||
/* From https://github.com/webcomponents/URL/blob/master/url.js
|
||||
* Added UMD, file link handling */
|
||||
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
'use strict';
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// Fix for this being undefined in modules
|
||||
if (!root) {
|
||||
root = window || global;
|
||||
}
|
||||
if (typeof module === 'object' && module.exports) {
|
||||
// Node
|
||||
console.log("root", root);
|
||||
module.exports = factory(root);
|
||||
} else if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define([], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// Node
|
||||
module.exports = factory(global);
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
root.URL = factory(root);
|
||||
}
|
||||
}(this, function (scope) {
|
||||
|
||||
// feature detect for URL constructor
|
||||
var hasWorkingUrl = false;
|
||||
if (!scope.forceJURL) {
|
||||
|
@ -595,7 +602,7 @@
|
|||
// WebKit/Blink returns String("SCHEME://") for file: mailto:
|
||||
switch (this._scheme) {
|
||||
case 'file':
|
||||
return 'file://'
|
||||
return 'file://' // EPUBJS Added
|
||||
case 'data':
|
||||
case 'javascript':
|
||||
case 'mailto':
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "epubjs",
|
||||
"version": "0.3.38",
|
||||
"version": "0.3.39",
|
||||
"description": "Parse and Render Epubs",
|
||||
"main": "lib/index.js",
|
||||
"module": "src/index.js",
|
||||
|
|
|
@ -3,6 +3,7 @@ import EpubCFI from "./epubcfi";
|
|||
import Rendition from "./rendition";
|
||||
import Contents from "./contents";
|
||||
import * as core from "./utils/core";
|
||||
import '../libs/url/url-polyfill'
|
||||
|
||||
/**
|
||||
* Creates a new Book
|
||||
|
|
|
@ -163,7 +163,7 @@ class Packaging {
|
|||
|
||||
var itemref = {
|
||||
"idref" : idref,
|
||||
"linear" : item.getAttribute("linear") || "",
|
||||
"linear" : item.getAttribute("linear") || "yes",
|
||||
"properties" : propArray,
|
||||
// "href" : manifest[Id].href,
|
||||
// "url" : manifest[Id].url,
|
||||
|
|
|
@ -6,7 +6,7 @@ var LEGACY = (process.env.LEGACY)
|
|||
var hostname = "localhost";
|
||||
var port = 8080;
|
||||
var enter = LEGACY ? {
|
||||
"epub.legacy": ["babel-polyfill", "./libs/url/url.js", "./src/epub.js"]
|
||||
"epub.legacy": ["babel-polyfill", "./src/epub.js"]
|
||||
} : {
|
||||
"epub": "./src/epub.js",
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue