diff --git a/README.md b/README.md index 656ebea..1a3d06b 100644 --- a/README.md +++ b/README.md @@ -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. -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. diff --git a/documentation/md/API.md b/documentation/md/API.md index 60a447b..091f23f 100644 --- a/documentation/md/API.md +++ b/documentation/md/API.md @@ -150,7 +150,7 @@ Returns **[Range](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Inpu ### 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** @@ -350,7 +350,7 @@ Returns **[Section](#section)** last section 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** @@ -389,8 +389,8 @@ Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refere ### reconcileLayoutSettings -Reconciles the current chapters layout properies with -the global layout properities. +Reconciles the current chapters layout properties with +the global layout properties. **Parameters** @@ -839,7 +839,7 @@ Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe ### revokeUrl -Revoke Temp Url for a achive item +Revoke Temp Url for a archive item **Parameters** @@ -1077,7 +1077,7 @@ A Rendered Location Range 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. +Functions may return a promise if they are async. **Parameters** @@ -2066,7 +2066,7 @@ Returns **BoundingClientRect** ### 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)}** @@ -2225,7 +2225,7 @@ Create a treeWalker - `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 -- `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 @@ -2264,7 +2264,7 @@ Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refere ### findChildren -Find direct decendents of an element +Find direct descendents of an element **Parameters** @@ -2284,7 +2284,7 @@ Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refere ### filterChildren -Find all direct decendents of a specific type +Find all direct descendents of a specific type **Parameters** diff --git a/src/archive.js b/src/archive.js index ea22a81..15b3835 100644 --- a/src/archive.js +++ b/src/archive.js @@ -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 */ revokeUrl(url){ diff --git a/src/book.js b/src/book.js index 4243bd1..fb66e54 100644 --- a/src/book.js +++ b/src/book.js @@ -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 * @return {string} key */ diff --git a/src/epubcfi.js b/src/epubcfi.js index 77142a3..98a6b90 100644 --- a/src/epubcfi.js +++ b/src/epubcfi.js @@ -109,7 +109,7 @@ class EpubCFI { } 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); } @@ -395,7 +395,7 @@ class EpubCFI { return -1; } - // Compare the charecter offset of the text node + // Compare the character offset of the text node if(terminalA.offset > terminalB.offset) { return 1; } diff --git a/src/mapping.js b/src/mapping.js index 4216204..0075f29 100644 --- a/src/mapping.js +++ b/src/mapping.js @@ -73,7 +73,7 @@ class Mapping { walk(root, func) { // IE11 has strange issue, if root is text node IE throws exception on // 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) { return; } diff --git a/src/packaging.js b/src/packaging.js index f20f918..e038471 100644 --- a/src/packaging.js +++ b/src/packaging.js @@ -157,7 +157,7 @@ class Packaging { // 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){ var idref = item.getAttribute("idref"); // var cfiBase = epubcfi.generateChapterComponent(spineNodeIndex, index, Id); @@ -213,7 +213,7 @@ class Packaging { */ findNavPath(manifestNode){ // 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 = qsp(manifestNode, "item", {"properties":"nav"}); return node ? node.getAttribute("href") : false; diff --git a/src/rendition.js b/src/rendition.js index 8dcbe06..3c3a4e5 100644 --- a/src/rendition.js +++ b/src/rendition.js @@ -895,7 +895,7 @@ class Rendition { */ triggerSelectedEvent(cfirange, contents){ /** - * Emit that a text selection has occured + * Emit that a text selection has occurred * @event selected * @param {string} cfirange * @param {Contents} contents diff --git a/src/section.js b/src/section.js index 7c2c3c4..aa61310 100644 --- a/src/section.js +++ b/src/section.js @@ -9,7 +9,7 @@ import { DOMParser as XMLDOMSerializer } from "@xmldom/xmldom"; /** * 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} 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. * @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} */ search(_query , maxSeqEle = 5){ @@ -245,8 +245,8 @@ class Section { } /** - * Reconciles the current chapters layout properies with - * the global layout properities. + * Reconciles the current chapters layout properties with + * the global layout properties. * @param {object} globalLayout The global layout settings object, chapter properties string * @return {object} layoutProperties Object with layout properties */ diff --git a/src/store.js b/src/store.js index 0d12103..4775275 100644 --- a/src/store.js +++ b/src/store.js @@ -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 */ revokeUrl(url){ diff --git a/src/utils/core.js b/src/utils/core.js index 4819397..4d18573 100644 --- a/src/utils/core.js +++ b/src/utils/core.js @@ -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 }} * @memberof Core */ @@ -590,7 +590,7 @@ export function sprint(root, func) { * @memberof Core * @param {element} root element to start with * @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) { var treeWalker = document.createTreeWalker(root, filter, null, false); @@ -653,7 +653,7 @@ export function defer() { */ 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. * * @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 * @returns {element[]} children * @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 {string} nodeName * @param {boolean} [single] diff --git a/src/utils/hook.js b/src/utils/hook.js index ea1b901..85f4463 100644 --- a/src/utils/hook.js +++ b/src/utils/hook.js @@ -1,7 +1,7 @@ /** * 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. + * Functions may return a promise if they are async. * @param {any} context scope of this * @example this.content = new EPUBJS.Hook(this); */ diff --git a/test/epubcfi.js b/test/epubcfi.js index 232f9ab..b40c566 100644 --- a/test/epubcfi.js +++ b/test/epubcfi.js @@ -34,7 +34,7 @@ describe('EpubCFI', function() { 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)"); 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 range = docHighlightsAlice.createRange(); var cfi;