mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-02 14:49:16 +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: '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.
|
/* Any copyright is dedicated to the Public Domain.
|
||||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||||
'use strict';
|
'use strict';
|
||||||
(function (root, factory) {
|
(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.
|
// AMD. Register as an anonymous module.
|
||||||
define([], factory);
|
define([], factory);
|
||||||
} else if (typeof module === 'object' && module.exports) {
|
|
||||||
// Node
|
|
||||||
module.exports = factory(global);
|
|
||||||
} else {
|
} else {
|
||||||
// Browser globals (root is window)
|
// Browser globals (root is window)
|
||||||
root.URL = factory(root);
|
root.URL = factory(root);
|
||||||
}
|
}
|
||||||
}(this, function (scope) {
|
}(this, function (scope) {
|
||||||
|
|
||||||
// feature detect for URL constructor
|
// feature detect for URL constructor
|
||||||
var hasWorkingUrl = false;
|
var hasWorkingUrl = false;
|
||||||
if (!scope.forceJURL) {
|
if (!scope.forceJURL) {
|
||||||
|
@ -595,7 +602,7 @@
|
||||||
// WebKit/Blink returns String("SCHEME://") for file: mailto:
|
// WebKit/Blink returns String("SCHEME://") for file: mailto:
|
||||||
switch (this._scheme) {
|
switch (this._scheme) {
|
||||||
case 'file':
|
case 'file':
|
||||||
return 'file://'
|
return 'file://' // EPUBJS Added
|
||||||
case 'data':
|
case 'data':
|
||||||
case 'javascript':
|
case 'javascript':
|
||||||
case 'mailto':
|
case 'mailto':
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "epubjs",
|
"name": "epubjs",
|
||||||
"version": "0.3.38",
|
"version": "0.3.39",
|
||||||
"description": "Parse and Render Epubs",
|
"description": "Parse and Render Epubs",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"module": "src/index.js",
|
"module": "src/index.js",
|
||||||
|
|
|
@ -3,6 +3,7 @@ import EpubCFI from "./epubcfi";
|
||||||
import Rendition from "./rendition";
|
import Rendition from "./rendition";
|
||||||
import Contents from "./contents";
|
import Contents from "./contents";
|
||||||
import * as core from "./utils/core";
|
import * as core from "./utils/core";
|
||||||
|
import '../libs/url/url-polyfill'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new Book
|
* Creates a new Book
|
||||||
|
|
|
@ -163,7 +163,7 @@ class Packaging {
|
||||||
|
|
||||||
var itemref = {
|
var itemref = {
|
||||||
"idref" : idref,
|
"idref" : idref,
|
||||||
"linear" : item.getAttribute("linear") || "",
|
"linear" : item.getAttribute("linear") || "yes",
|
||||||
"properties" : propArray,
|
"properties" : propArray,
|
||||||
// "href" : manifest[Id].href,
|
// "href" : manifest[Id].href,
|
||||||
// "url" : manifest[Id].url,
|
// "url" : manifest[Id].url,
|
||||||
|
|
|
@ -6,7 +6,7 @@ var LEGACY = (process.env.LEGACY)
|
||||||
var hostname = "localhost";
|
var hostname = "localhost";
|
||||||
var port = 8080;
|
var port = 8080;
|
||||||
var enter = LEGACY ? {
|
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",
|
"epub": "./src/epub.js",
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue