1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-03 14:59:18 +02:00

Merge pull request #1232 from kianmeng/fix-typos

Fix typos
This commit is contained in:
Fred Chasen 2022-01-07 11:17:51 -08:00 committed by GitHub
commit 858c3a8f91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 32 additions and 32 deletions

View file

@ -92,7 +92,7 @@ Scrolled: `book.renderTo("area", { flow: "scrolled-doc" });`
[Scripted content](https://www.w3.org/TR/epub-33/#sec-scripted-content), JavasScript the ePub HTML content, is disabled by default due to the potential for executing malicious content. [Scripted content](https://www.w3.org/TR/epub-33/#sec-scripted-content), JavasScript the ePub HTML content, is disabled by default due to the potential for executing malicious content.
This is done by sandboxing the iframe the content is rendered into, though it is still recommened to santize the ePub content server-side as well. This is done by sandboxing the iframe the content is rendered into, though it is still recommended to sanitize the ePub content server-side as well.
If a trusted ePub contains interactivity, it can be enabled by passing `allowScriptedContent: true` to the `Rendition` settings. If a trusted ePub contains interactivity, it can be enabled by passing `allowScriptedContent: true` to the `Rendition` settings.

View file

@ -150,7 +150,7 @@ Returns **[Range](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Inpu
### key ### key
Generates the Book Key using the identifer in the manifest or other string provided Generates the Book Key using the identifier in the manifest or other string provided
**Parameters** **Parameters**
@ -350,7 +350,7 @@ Returns **[Section](#section)** last section
Represents a Section of the Book Represents a Section of the Book
In most books this is equivelent to a Chapter In most books this is equivalent to a Chapter
**Parameters** **Parameters**
@ -389,8 +389,8 @@ Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refere
### reconcileLayoutSettings ### reconcileLayoutSettings
Reconciles the current chapters layout properies with Reconciles the current chapters layout properties with
the global layout properities. the global layout properties.
**Parameters** **Parameters**
@ -839,7 +839,7 @@ Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe
### revokeUrl ### revokeUrl
Revoke Temp Url for a achive item Revoke Temp Url for a archive item
**Parameters** **Parameters**
@ -1077,7 +1077,7 @@ A Rendered Location Range
Hooks allow for injecting functions that must all complete in order before finishing Hooks allow for injecting functions that must all complete in order before finishing
They will execute in parallel but all must finish before continuing They will execute in parallel but all must finish before continuing
Functions may return a promise if they are asycn. Functions may return a promise if they are async.
**Parameters** **Parameters**
@ -2066,7 +2066,7 @@ Returns **BoundingClientRect**
### windowBounds ### windowBounds
Find the equivelent of getBoundingClientRect of a browser window Find the equivalent of getBoundingClientRect of a browser window
Returns **{width: [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), height: [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), top: [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), left: [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), right: [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), bottom: [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)}** Returns **{width: [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), height: [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), top: [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), left: [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), right: [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), bottom: [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)}**
@ -2225,7 +2225,7 @@ Create a treeWalker
- `root` **[element](https://developer.mozilla.org/en-US/docs/Web/API/Element)** element to start with - `root` **[element](https://developer.mozilla.org/en-US/docs/Web/API/Element)** element to start with
- `func` **[function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** function to run on each element - `func` **[function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** function to run on each element
- `filter` **([function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function) \| [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object))** funtion or object to filter with - `filter` **([function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function) \| [object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object))** function or object to filter with
### walk ### walk
@ -2264,7 +2264,7 @@ Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refere
### findChildren ### findChildren
Find direct decendents of an element Find direct descendents of an element
**Parameters** **Parameters**
@ -2284,7 +2284,7 @@ Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refere
### filterChildren ### filterChildren
Find all direct decendents of a specific type Find all direct descendents of a specific type
**Parameters** **Parameters**

View file

@ -233,7 +233,7 @@ class Archive {
} }
/** /**
* Revoke Temp Url for a achive item * Revoke Temp Url for a archive item
* @param {string} url url of the item in the archive * @param {string} url url of the item in the archive
*/ */
revokeUrl(url){ revokeUrl(url){

View file

@ -714,7 +714,7 @@ class Book {
} }
/** /**
* Generates the Book Key using the identifer in the manifest or other string provided * Generates the Book Key using the identifier in the manifest or other string provided
* @param {string} [identifier] to use instead of metadata identifier * @param {string} [identifier] to use instead of metadata identifier
* @return {string} key * @return {string} key
*/ */

View file

@ -109,7 +109,7 @@ class EpubCFI {
} }
if(cfiStr.indexOf("epubcfi(") === 0 && cfiStr[cfiStr.length-1] === ")") { if(cfiStr.indexOf("epubcfi(") === 0 && cfiStr[cfiStr.length-1] === ")") {
// Remove intial epubcfi( and ending ) // Remove initial epubcfi( and ending )
cfiStr = cfiStr.slice(8, cfiStr.length-1); cfiStr = cfiStr.slice(8, cfiStr.length-1);
} }
@ -395,7 +395,7 @@ class EpubCFI {
return -1; return -1;
} }
// Compare the charecter offset of the text node // Compare the character offset of the text node
if(terminalA.offset > terminalB.offset) { if(terminalA.offset > terminalB.offset) {
return 1; return 1;
} }

View file

@ -73,7 +73,7 @@ class Mapping {
walk(root, func) { walk(root, func) {
// IE11 has strange issue, if root is text node IE throws exception on // IE11 has strange issue, if root is text node IE throws exception on
// calling treeWalker.nextNode(), saying // calling treeWalker.nextNode(), saying
// Unexpected call to method or property access instead of returing null value // Unexpected call to method or property access instead of returning null value
if(root && root.nodeType === Node.TEXT_NODE) { if(root && root.nodeType === Node.TEXT_NODE) {
return; return;
} }

View file

@ -157,7 +157,7 @@ class Packaging {
// var epubcfi = new EpubCFI(); // var epubcfi = new EpubCFI();
//-- Add to array to mantain ordering and cross reference with manifest //-- Add to array to maintain ordering and cross reference with manifest
items.forEach(function(item, index){ items.forEach(function(item, index){
var idref = item.getAttribute("idref"); var idref = item.getAttribute("idref");
// var cfiBase = epubcfi.generateChapterComponent(spineNodeIndex, index, Id); // var cfiBase = epubcfi.generateChapterComponent(spineNodeIndex, index, Id);
@ -213,7 +213,7 @@ class Packaging {
*/ */
findNavPath(manifestNode){ findNavPath(manifestNode){
// Find item with property "nav" // Find item with property "nav"
// Should catch nav irregardless of order // Should catch nav regardless of order
// var node = manifestNode.querySelector("item[properties$='nav'], item[properties^='nav '], item[properties*=' nav ']"); // var node = manifestNode.querySelector("item[properties$='nav'], item[properties^='nav '], item[properties*=' nav ']");
var node = qsp(manifestNode, "item", {"properties":"nav"}); var node = qsp(manifestNode, "item", {"properties":"nav"});
return node ? node.getAttribute("href") : false; return node ? node.getAttribute("href") : false;

View file

@ -895,7 +895,7 @@ class Rendition {
*/ */
triggerSelectedEvent(cfirange, contents){ triggerSelectedEvent(cfirange, contents){
/** /**
* Emit that a text selection has occured * Emit that a text selection has occurred
* @event selected * @event selected
* @param {string} cfirange * @param {string} cfirange
* @param {Contents} contents * @param {Contents} contents

View file

@ -9,7 +9,7 @@ import { DOMParser as XMLDOMSerializer } from "@xmldom/xmldom";
/** /**
* Represents a Section of the Book * Represents a Section of the Book
* *
* In most books this is equivelent to a Chapter * In most books this is equivalent to a Chapter
* @param {object} item The spine item representing the section * @param {object} item The spine item representing the section
* @param {object} hooks hooks for serialize and content * @param {object} hooks hooks for serialize and content
*/ */
@ -179,7 +179,7 @@ class Section {
/** /**
* Search a string in multiple sequential Element of the section. If the document.createTreeWalker api is missed(eg: IE8), use `find` as a fallback. * Search a string in multiple sequential Element of the section. If the document.createTreeWalker api is missed(eg: IE8), use `find` as a fallback.
* @param {string} _query The query string to search * @param {string} _query The query string to search
* @param {int} maxSeqEle The maximum number of Element that are combined for search, defualt value is 5. * @param {int} maxSeqEle The maximum number of Element that are combined for search, default value is 5.
* @return {object[]} A list of matches, with form {cfi, excerpt} * @return {object[]} A list of matches, with form {cfi, excerpt}
*/ */
search(_query , maxSeqEle = 5){ search(_query , maxSeqEle = 5){
@ -245,8 +245,8 @@ class Section {
} }
/** /**
* Reconciles the current chapters layout properies with * Reconciles the current chapters layout properties with
* the global layout properities. * the global layout properties.
* @param {object} globalLayout The global layout settings object, chapter properties string * @param {object} globalLayout The global layout settings object, chapter properties string
* @return {object} layoutProperties Object with layout properties * @return {object} layoutProperties Object with layout properties
*/ */

View file

@ -360,7 +360,7 @@ class Store {
} }
/** /**
* Revoke Temp Url for a achive item * Revoke Temp Url for a archive item
* @param {string} url url of the item in the store * @param {string} url url of the item in the store
*/ */
revokeUrl(url){ revokeUrl(url){

View file

@ -322,7 +322,7 @@ export function nodeBounds(node) {
} }
/** /**
* Find the equivelent of getBoundingClientRect of a browser window * Find the equivalent of getBoundingClientRect of a browser window
* @returns {{ width: Number, height: Number, top: Number, left: Number, right: Number, bottom: Number }} * @returns {{ width: Number, height: Number, top: Number, left: Number, right: Number, bottom: Number }}
* @memberof Core * @memberof Core
*/ */
@ -590,7 +590,7 @@ export function sprint(root, func) {
* @memberof Core * @memberof Core
* @param {element} root element to start with * @param {element} root element to start with
* @param {function} func function to run on each element * @param {function} func function to run on each element
* @param {function | object} filter funtion or object to filter with * @param {function | object} filter function or object to filter with
*/ */
export function treeWalker(root, func, filter) { export function treeWalker(root, func, filter) {
var treeWalker = document.createTreeWalker(root, filter, null, false); var treeWalker = document.createTreeWalker(root, filter, null, false);
@ -653,7 +653,7 @@ export function defer() {
*/ */
this.resolve = null; this.resolve = null;
/* A method to reject the assocaited Promise with the value passed. /* A method to reject the associated Promise with the value passed.
* If the promise is already settled it does nothing. * If the promise is already settled it does nothing.
* *
* @param {anything} reason: The reason for the rejection of the Promise. * @param {anything} reason: The reason for the rejection of the Promise.
@ -702,7 +702,7 @@ export function querySelectorByType(html, element, type){
} }
/** /**
* Find direct decendents of an element * Find direct descendents of an element
* @param {element} el * @param {element} el
* @returns {element[]} children * @returns {element[]} children
* @memberof Core * @memberof Core
@ -734,7 +734,7 @@ export function parents(node) {
} }
/** /**
* Find all direct decendents of a specific type * Find all direct descendents of a specific type
* @param {element} el * @param {element} el
* @param {string} nodeName * @param {string} nodeName
* @param {boolean} [single] * @param {boolean} [single]

View file

@ -1,7 +1,7 @@
/** /**
* Hooks allow for injecting functions that must all complete in order before finishing * Hooks allow for injecting functions that must all complete in order before finishing
* They will execute in parallel but all must finish before continuing * They will execute in parallel but all must finish before continuing
* Functions may return a promise if they are asycn. * Functions may return a promise if they are async.
* @param {any} context scope of this * @param {any} context scope of this
* @example this.content = new EPUBJS.Hook(this); * @example this.content = new EPUBJS.Hook(this);
*/ */

View file

@ -34,7 +34,7 @@ describe('EpubCFI', function() {
assert.equal( parsed.spinePos, 0, "base is ignored and spinePos is parsed as the first item" ); assert.equal( parsed.spinePos, 0, "base is ignored and spinePos is parsed as the first item" );
}); });
it('parse a cfi with a charecter offset', function() { it('parse a cfi with a character offset', function() {
var parsed = cfi.parse("epubcfi(/6/4[chap01ref]!/4[body01]/10[para05]/2/1:3)"); var parsed = cfi.parse("epubcfi(/6/4[chap01ref]!/4[body01]/10[para05]/2/1:3)");
assert.equal( parsed.path.terminal.offset, 3, "Path has a terminal offset of 3" ); assert.equal( parsed.path.terminal.offset, 3, "Path has a terminal offset of 3" );
@ -285,7 +285,7 @@ describe('EpubCFI', function() {
}); });
it('get a cfi from a range inbetween two highlights', function() { it('get a cfi from a range in between two highlights', function() {
var t1 = docHighlightsAlice.getElementById('p2').childNodes[1]; var t1 = docHighlightsAlice.getElementById('p2').childNodes[1];
var range = docHighlightsAlice.createRange(); var range = docHighlightsAlice.createRange();
var cfi; var cfi;