GithubHelp home page GithubHelp logo

readium / readium-shared-js Goto Github PK

View Code? Open in Web Editor NEW
78.0 50.0 101.0 43.66 MB

Repository for the shared JavaScript libraries that are used in the SDK-Launchers and other applications developed on top of the SDK

License: BSD 3-Clause "New" or "Revised" License

JavaScript 99.72% CSS 0.15% HTML 0.13%
javascript epub

readium-shared-js's Introduction

readium-shared-js

EPUB rendering engine written in HTML, CSS and Javascript.

This is a software component commonly-shared between the Readium Chrome extension and "cloud reader" ( https://github.com/readium/readium-js-viewer ), as well as various native application "launchers" such as iOS ( https://github.com/readium/SDKLauncher-iOS ), OSX ( https://github.com/readium/SDKLauncher-OSX ), Android ( https://github.com/readium/SDKLauncher-Android ), Windows ( https://github.com/readium/SDKLauncher-Windows ), etc.

You can try Readium here:

License

BSD-3-Clause ( http://opensource.org/licenses/BSD-3-Clause )

See license.txt.

Prerequisites

Development

Initial setup:

  • git submodule update --init --recursive to ensure that the readium-shared-js chain of dependencies is initialised (readium-cfi-js)
  • git checkout BRANCH_NAME && git submodule foreach --recursive 'git checkout BRANCH_NAME' to switch to the desired BRANCH_NAME
  • npm run prepare:all (to perform required preliminary tasks, like patching code before building)
  • OR: yarn run prepare:yarn:all (to use Yarn instead of NPM for node_module management)

Note that in some cases, administrator rights may be needed in order to install dependencies, because of NPM-related file access permissions (the console log would clearly show the error). Should this be the case, running sudo npm run prepare:all usually solves this.

Note that the above command executes the following:

  • npm install (to download dependencies defined in package.json ... note that the --production option can be used to avoid downloading development dependencies, for example when testing only the pre-built build-output folder contents)
  • npm update (to make sure that the dependency tree is up to date)

Typical workflow:

  • Hack away! (mostly the source code in the js and plugins folders)
  • npm run build (to update the RequireJS bundles in the build output folder)
  • npm run http:watch (to launch an http server with live-reload, automatically opens a web browser instance to the HTML files in the dev folder)
  • npm run http (same as above, but without watching for file changes (no automatic rebuild))

Plugins integration:

When invoking the npm run build command, the build-output folder contains RequireJS module bundles that include the default plugins specified in plugins/plugins.cson (see the PLUGINS.md documentation). Normally, developers can override the default plugins configuration by using an additional file called plugins-override.cson. This file is git-ignored (not persistent in the Git repository), which means that Readium's default configuration is never at risk of being mistakenly overridden by developers, whilst giving developers the possibility of creating custom builds.

However, unlike other Readium repositories, the readium-shared-js Git repository includes the build-output folder, so that Readium's native application "launchers" can be built directly with those pre-built libraries (no Javascript-specific build process required, i.e. Node, NPM, etc.). So, in the specific case of readium-shared-js, developers must set the RJS_PLUGINS_OVERRIDE environment variable to "yes" (or "true"), in order for plugins-override.cson to be taken into account. For example, using PowerShell on Windows: Set-Item Env:RJS_PLUGINS_OVERRIDE no, or Terminal on OSX: RJS_PLUGINS_OVERRIDE=no npm run build (which sets a temporary environment variable for the lifespan of the invoked command, rather than a persistent one).

NPM (Node Package Manager)

All packages "owned" and maintained by the Readium Foundation are listed here: https://www.npmjs.com/~readium

Note that although Node and NPM natively use the CommonJS format, Readium modules are currently only defined as AMD (RequireJS). This explains why Browserify ( http://browserify.org ) is not used by this Readium project. More information at http://requirejs.org/docs/commonjs.html and http://requirejs.org/docs/node.html

Note: the --dev option after npm install readium-shared-js can be used to force the download of development dependencies, but this is kind of pointless as the code source and RequireJS build configuration files are missing. See below if you need to hack the code.

How to use (RequireJS bundles / AMD modules)

The build-output directory contains common CSS styles, as well as two distinct folders:

Single bundle

The _single-bundle folder contains readium-shared-js_all.js (and its associated source-map file, as well as a RequireJS bundle index file (which isn't actually needed at runtime, so here just as a reference)), which aggregates all the required code (external library dependencies included, such as Underscore, jQuery, etc.), as well as the "Almond" lightweight AMD loader ( https://github.com/jrburke/almond ).

This means that the full RequireJS library ( http://requirejs.org ) is not actually needed to bootstrap the AMD modules at runtime, as demonstrated by the HTML file in the dev folder (trimmed for brevity):

<html>
<head>

<!-- main code bundle, which includes its own Almond AMD loader (no need for the full RequireJS library) -->
<script type="text/javascript" src="../build-output/_single-bundle/readium-shared-js_all.js"> </script>

<!-- index.js calls into the above library -->
<script type="text/javascript" src="./index.js"> </script>

</head>
<body>
<div id="viewport"> </div>
</body>
</html>

Multiple bundles

The _multiple-bundles folder contains several Javascript bundles (and their respective source-map files, as well as RequireJS bundle index files):

  • readium-external-libs.js: aggregated library dependencies (e.g. Underscore, jQuery, etc.)
  • readium-cfi-js.js: Readium CFI library (basically, equivalent to the js folder of the readium-cfi-js submodule)
  • readium-shared-js.js: Readium-specific code (basically, equivalent to the js folder)
  • readium-plugin-example.js: simple plugin demo
  • readium-plugin-annotations.js: the annotation plugin (DOM selection + highlight), which bundle actually contains the "Backbone" library, as this dependency is not already included in the "external libs" bundle.

In addition, the folder contains the full RequireJS.js library ( http://requirejs.org ), as the above bundles do no include the lightweight "Almond" AMD loader ( https://github.com/jrburke/almond ).

Usage is demonstrated by the HTML file in the dev folder (trimmed for brevity):

<html>
<head>

<!-- full RequireJS library -->
<script type="text/javascript" src="../build-output/_multiple-bundles/RequireJS.js"> </script>



<!-- individual bundles: -->

<!-- readium CFI library -->
<script type="text/javascript" src="../build-output/_multiple-bundles/readium-cfi-js.js"> </script>

<!-- external libraries -->
<script type="text/javascript" src="../build-output/_multiple-bundles/readium-external-libs.js"> </script>

<!-- readium itself -->
<script type="text/javascript" src="../build-output/_multiple-bundles/readium-shared-js.js"> </script>

<!-- simple example plugin -->
<script type="text/javascript" src="../build-output/_multiple-bundles/readium-plugin-example.js"> </script>

<!-- annotations plugin -->
<script type="text/javascript" src="../build-output/_multiple-bundles/readium-plugin-annotations.js"> </script>



<!-- index.js calls into the above libraries -->
<script type="text/javascript" src="./index.js"> </script>

</head>
<body>
<div id="viewport"> </div>
</body>
</html>

Note how the various sets of AMD modules can be invoked on-demand (lazy) using the bundles RequireJS configuration directive (this eliminates the apparent opacity of such as large container of library dependencies):

<script type="text/javascript">
requirejs.config({
    baseUrl: '../build-output/_multiple-bundles'
});
</script>

<script type="text/javascript" src="../build-output/_multiple-bundles/readium-cfi-js.js.bundles.js"> </script>

<script type="text/javascript" src="../build-output/_multiple-bundles/readium-external-libs.js.bundles.js"> </script>

<script type="text/javascript" src="../build-output/_multiple-bundles/readium-shared-js.js.bundles.js"> </script>

<script type="text/javascript" src="../build-output/_multiple-bundles/readium-plugin-example.js.bundles.js"> </script>

<script type="text/javascript" src="../build-output/_multiple-bundles/readium-plugin-annotations.js.bundles.js"> </script>

CSON vs. JSON (package.json)

CSON = CoffeeScript-Object-Notation ( https://github.com/bevry/cson )

Running the command npm run cson2json will re-generate the package.json JSON file. For more information, see comments in the master package.cson CSON file.

Why CSON? Because it is a lot more readable than JSON, and therefore easier to maintain. The syntax is not only less verbose (separators, etc.), more importantly it allows comments and line breaking!

Although these benefits are not so critical for basic "package" definitions, here package.cson/json declares relatively intricate script tasks that are used in the development workflow. npm run SCRIPT_NAME offers a lightweight technique to handle most build tasks, as NPM CLI utilities are available to perform cross-platform operations (agnostic to the actual command line interface / shell). For more complex build processes, Grunt / Gulp can be used, but these build systems do not necessarily offer the most readable / maintainable options.

Downside: DO NOT invoke npm init or npm install --save --save-dev --save-optional, as this would overwrite / update the JSON, not the master CSON!

readium-shared-js's People

Contributors

aadamowski avatar barbender avatar becka11y avatar bormind avatar cappadeini avatar chine avatar da70 avatar danielweck avatar einarstubhaug avatar euro-fly avatar hugapps avatar idov-isd avatar jansc avatar jccr avatar llemeurfr avatar lmvco avatar matwood avatar olivierkorner avatar pmstss avatar rkwright avatar ryanackley avatar yuriyp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

readium-shared-js's Issues

Activated hyperlinks in HTML documents get their parameters suppressed (query and fragment)

Is there a use-case whereby EPUB3 XHTML5 Content Documents include local links with parameters in the URI query or fragment parts? Such links may be authored specifically to enable an embedded Javascript event / navigation handler to detect user-activated interactive elements, and pass information along the way. Although "parametered" hyperlinks may not be common now, I wonder if educational publications will include more scripted interactivity that depends on webpage-like clicked links (quizzes, assessments, practical exercises)?

Code reference:
https://github.com/readium/readium-shared-js/blob/develop/js/views/internal_links_support.js#L143

Images not resizing to fit the screen in scrollview

Originally posted by @vanisuthamathi
readium/readium-js#57

Steps to Reproduce:

  1. Enable scroll view - readium.reader.updateSettings({
    scroll: "scroll-doc"
    }); in the Epub reader view
  2. Read any article containing big image sizes like 600x511, 600X300 and etc.,
    Observation:

    Images are not resizing to fit the screen as shown in the attached image.
    image_notresizing

Note: We have fixed in our application by adding css properties to the image tags after the content documents are loaded
$(imgTags).css('max-width', '98%');
$(imgTags).css('max-height', '98%');

Please fix in the readium library

Inconsistent word-spacing across platforms (font metrics?)

From Talha Yalta [email protected]:

Still, as can be seen in the attached file, Readium has (I think) word
spacing problems. This is a serious issue because the looks of the
fixed-layout book can be seriously affected by it, resulting in text
cutoff etc.

After testing the attached file with Azardi, Readium in Windows 7 and
Readium in Snow Leopard; it seems to me that
word spacing in Readium (Win) < Azardi < Readium (OSX)

The difference is probably small but it is enough to shift a single
word to the next line. These shifts can in turn result in significant
changes to the text layout, even in not-too-long paragraphs.

Bugzilla:
https://app.devzing.com/Readium/bugzilla/show_bug.cgi?id=71

What contributes to a page clipping text in fixed layout?

Using the file epub30-test-0220 I noticed that even though the file property is set to pre-paginated, the text in the first xhtml content doc is clipped on the page. Rendition:flow is set to auto, which might be the reason; possibly there is no parameter yet set as auto is reading system dependent.

But I'm very curious what would cause around 100 words to clip on a pre-paginated file. I would more expect that the text size would be reduced until all the copy fit, then the page would come into the viewer at a smaller scale that it currently doe (59%. Make sense?

It would be very helpful to know how fit decisions are being made. What is the one criteria which is maintained at 100% so all other know how to scale?

I've attached a doc which illustrates the issue, and shows how much of the content is being clipped BEFORE the page is rendered in the viewer.

Bugzilla:
https://app.devzing.com/Readium/bugzilla/show_bug.cgi?id=93

Reading position is lost when resizing the browser window in a reflow document

Originally posted by
@edas
at
readium/readium-js#48

Reproduce

Open the readium-js-viewer (but this is not viewer-specific), go to a reflow book (like the embedded accessible epub 3). Go to chapter 2, turn a few pages. Look at the text visible in the top left corner. Change the size of the browser

It is easier to reproduce if you go next to the end of the chapter and then you reduce the browser window by a factor of 2.

Actual result

The text that were visible in the top left corner is no more visible after the resize / layout. It may be multiple pages forward or backwards. The user has to turn pages until he finds again his reading position.

Expected result

The text that was in the top left corner is still visible (but probably not in the top left) after the resize / layout.

Fix

Possible fix : https://github.com/edas/readium-shared-js/commit/f61b9a9d371227f1046238efe7d826e11257ed27

But when done in addition of #47 , Firefox bugs on restoring the current page : The targeted element often returns inconsistent values in getClientRects() so we cannot find the new spread to show.

Media Overlays: slight audio hiccup at first word in XHTML content document, Safari (not Chrome)

On Mac OSX, I can reproduce a hiccup on the very first word of a page, when using Safari (cloud reader). However Chrome works fine (cloud reader and extension).

This is a seeking issue with HTML5 audio: Chrome is okay, but under Safari the clip-end seems to be reached too late (the Javascript audio-player polls for audio.currentTime using a very short time interval), resulting in a few milliseconds of extra audio at the end of an XHTML (assuming the next XHTML re-uses the same audio file).

Bugzilla:
https://app.devzing.com/Readium/bugzilla/show_bug.cgi?id=49

Imprecise CFI for getFirstVisibleElementCfi() / cfi_navigation_logic.js

Originally posted by
@edas
at
readium/readium-js#47

The CFI returned by getFirstVisibleElementCfi() in cfi_navigation_logic.js is unprecise.

Procedure to reproduce

Open the redium-js-viewer with the embedded book 'accessible epub 3'. Go to chapter 2 and turn a few pages. Launch getFirstVisibleElementCfi()

Actual result

The partial CFI returned is always ""/4/2[building_a_better_epub]/2@0:xx". This targets the first <section> of the chapter, which include the whole text content of the chapter, then add a positionning in % in that chapter.

Expected result

CFI returned should be more precise and return an CFI pointing to an inner <p>inside the <section>, like "/4/2[building_a_better_epub]/10/32/12@0:xx".

Explaination

This is because the first child of the <section> element, which is a blank text node, is reported by both Chrome and Firefox as visible on all columns in a multi-columns layout. When walking the DOM to find the first visible text node, this one is always checked first and always answer "yes".

The code should ignore blank text nodes but this one is not ignored. Probably because it contains tabulations, carriage returns or other characters than space and line feed.

Fix

In cfi_navigation_logic.js :

function isValidTextNode(node) {
    if(node.nodeType === Node.TEXT_NODE) {
        return (! node.nodeValue.match(/^\s*$/) );
     }
     return false;
}

This replace the all code that just strip spaces and line feeds then check that the length is not 0.

Problem

I did not send a PR because when fixing this bug, I trigger a browser bug on Firefox which forbids Firefox from being able to jump to these more precise CFI (the getClientRects() of the targeted element are always totally incoherent).

Can't see epub on Android

Hi,

I try to open ePub3 file cole-voyage-of-life-20120320.epub (I found it in readium-sdk/TestData/ ), the app no crash when open ePub file.
But can see the page, the page is blank, I have this error:

10-07 13:06:13.631: I/NavigationTableActivity(6592): Open webview at : 0-intro.xhtml
10-07 13:06:13.821: D/WebViewActivity(6592): onPageStarted: file:///android_asset/readium-shared-js/reader.html
10-07 13:06:14.021: D/dalvikvm(6592): GC_CONCURRENT freed 184K, 26% free 8091K/10887K, paused 3ms+3ms
10-07 13:06:14.091: D/OpenGLRenderer(6592): Flushing caches (mode 0)
10-07 13:06:14.521: E/Web Console(6592): Uncaught TypeError: Object function (a,b){var c;a||(a={});b&&b.parse&&(a=this.parse(a));if(c=j(this,"defaults"))a=f.extend({},c,a);b&&b.collection&&(this.collection=b.collection);this.attributes={};this.escapedAttributes={};this.cid=f.uniqueId("c");if(!this.set(a,
10-07 13:06:14.521: E/Web Console(6592): {silent:!0}))throw Error("Can't create an invalid model");delete this.changed;this.previousAttributes=f.clone(this.attributes);this.initialize.apply(this,arguments)} has no method 'bindRoutes' at file:///android_asset/readium-shared-js/lib/backbone.min.js:24
10-07 13:06:14.521: E/Web Console(6592): Uncaught TypeError: Object function (a,b){var c;a||(a={});b&&b.parse&&(a=this.parse(a));if(c=j(this,"defaults"))a=f.extend({},c,a);b&&b.collection&&(this.collection=b.collection);this.attributes={};this.escapedAttributes={};this.cid=f.uniqueId("c");if(!this.set(a,
10-07 13:06:14.521: E/Web Console(6592): {silent:!0}))throw Error("Can't create an invalid model");delete this.changed;this.previousAttributes=f.clone(this.attributes);this.initialize.apply(this,arguments)} has no method 'bindRoutes' at file:///android_asset/readium-shared-js/lib/backbone.min.js:24
10-07 13:06:14.651: D/WebViewActivity(6592): onPageFinished: file:///android_asset/readium-shared-js/reader.html
10-07 13:06:14.651: D/WebViewActivity(6592): openPageRequestData: org.readium.sdk.android.launcher.model.OpenPageRequest@413ff52
10-07 13:06:14.651: D/libepub3 ./../../Platform/Android/jni/jni/jni_ptr.cpp:204: PointerPool::get(): got pointer 1BCB1C(3) package [./../../Platform/Android/jni/epub3.cpp:349]
10-07 13:06:14.651: D/libepub3 ./../../Platform/Android/jni/jni/jni_ptr.cpp:204: PointerPool::get(): got pointer 1BCB1C(6) package [./../../Platform/Android/jni/epub3.cpp:349]
10-07 13:06:14.651: D/libepub3 ./../../Platform/Android/jni/package.cpp:119: getProperty(): called for name='layout' pref='rendition'
10-07 13:06:14.651: D/libepub3 ./../../Platform/Android/jni/package.cpp:132: getProperty(): returning EMPTY
10-07 13:06:14.651: I/ReadiumJSApi(6592): loadJS: $(document).ready(function () {ReadiumSDK.reader.openBook({"package":{"mediaOverlays":[],"spine":{"items":[{"idref":"i","href":"xhtml/0-intro.xhtml","rendition_layout":"","page_spread":""},{"idref":"s1a","href":"xhtml/1a-childhood-text.xhtml","rendition_layout":"","page_spread":""},{"idref":"s1b","href":"xhtml/1b-childhood-painting.xhtml","rendition_layout":"pre-paginated","page_spread":""},{"idref":"s2a","href":"xhtml/2a-youth-text.xhtml","rendition_layout":"","page_spread":""},{"idref":"s2b","href":"xhtml/2b-youth-painting.xhtml","rendition_layout":"pre-paginated","page_spread":""},{"idref":"s3a","href":"xhtml/3a-manhood-text.xhtml","rendition_layout":"","page_spread":""},{"idref":"s3b","href":"xhtml/3b-manhood-painting.xhtml","rendition_layout":"pre-paginated","page_spread":""},{"idref":"s4a","href":"xhtml/4a-oldage-text.xhtml","rendition_layout":"","page_spread":""},{"idref":"s4b","href":"xhtml/4b-oldage-painting.xhtml","rendition_layout":"pre-paginated","page_spread":""},{"idref":"s5","href":"xhtml/5-significance.xhtml","rendition_layout":"","page_spread":""}],"direction":""},"rendition_layout":"","rootUrl":"EPUB/"},"openPageRequest":{"elementCfi":"","spineItemPageIndex":0,"idref":"","sourceFileHref":"xhtml/nav.xhtml","contentRefUrl":"0-intro.xhtml"},"settings":{"fontSize":100,"columnGap":20,"isSyntheticSpread":false}});});
10-07 13:06:14.701: E/Web Console(6592): Uncaught TypeError: undefined is not a function at file:///android_asset/readium-shared-js/js/views/reader_view.js:98

With the latest code in readium-shared-js, the latest code of readium-sdk and the latest LaucherAndroid, for branch develop.

Tien Haï

In 2 pages mode, the second page may not show up entirely

Originally posted by
@edas
at
readium/readium-js#49

readium

See screenshot (in the right page : lack of a few characters on end of line, and lack of the blue right border of the "note"). Both reproduceable in Firefox and Chrome, both in master and in develop branches. This example is with the file "accessible epub 3" from readium-js-viewer.

When resizing little step per little step, it is easy to find a step where the second column is truncated of a few pixels.

In my example, here a few metrics :

  • #reflowable-content-frame (<div> surrounding the <iframe>) is of 766.5 pixels
  • iframe is of 767 pixels
  • inner html document is 767 pixels with 353px columns and 60px gap

The total (2 columns + gap) should fit in the iframe, but does not.

<p>in the columns have 353.5px (and not 353px) however there are more than 1 pixel missing at right so I doubt this rounding error is the root problem.

However, the <aside> surrounded by a blue border has 335.5px widht + 2_8px padding + 2_1px border. This may have to be investigated as a potential cause of the problem.

User can inadvertently load a PDF into the Chrome extension

The HTTP PDF link correctly opened the targeted PDF document when I first clicked on the link (target="_BLANK"). However, whilst browsing the book I used the "back" browser navigation key instead of "previous page", and then clicked on the PDF link => this time, it opened within the spine item iframe, displayed using Chrome's built-in PDF viewer.

Test case e-book:

http://diagramcenter.org/standards-and-practices/accessible-image-sample-book.html

Bugzilla:
https://app.devzing.com/Readium/bugzilla/show_bug.cgi?id=64

There is no getCurrentSelectionCfi() function in reader_view.js

Hi
I have some problems with using Readium sdk.
There is no getCurrentSelectionCfi() or addSelectionHighlight() function in reader_view.js in master branch.so I fetched release 0.13 and replace readium-shared-js in project but after that no epub opened.
How can I use this methods for ios SDK?

Thanks

Code aggregation, minification, optimisation?

Native launcher apps currently include the Javascript codebase as-is, using direct links to individual files. The readium-js and readium-js-viewer repositories contain build tasks that take care of packaging the JS payload from readium-shared-js. Should a similar build subsystem be provided for the native apps? (note: this would require some changes in the automated Continuous Integration build scripts in Jenkins)

Verify that jQuery selectors are escaped everywhere needed (epub-cfi.js?)

This problem of XHTML / XML unique identifiers containing "special" characters was brought to my attention via the IDPF Readium forum (escaping rules for jQuery selectors):

http://idpf.org/forum/topic-1438

...so I resolved the issue for Media Overlays, and had a go at other areas as well:

26c7713

I used this regular expression to search the entire Readium codebase for potential occurrences of selectors that should be escaped (let me know if you think I may have missed some jQuery calls):

$(.+,.+)

Note that I have also checked every calls to Reader.getElement(spineItem, selector), which is a sneaky level of indirection to cfi_navigation_logic's own $(selector, this.getRootElement()) ... remember, we cannot escape indiscriminately, this has to be addressed in an ad-hoc manner, depending on what kind of selector is used (which is why we cannot simply escape the "selector" string variable).

I also double-checked CFI expressions that reference a single element with a UID assertion (e.g. ".../2/4[UID]"), and I did not see any problems. I used my Media Overlays CFI experiment (talking book with word-level highlighting), and I was able to work with an XHTML id such as "this.is.a.UID".

There is however one file that I did not want to touch, namely "epub_cfi.js" (primarily because it is not supposed to have access to ReadiumSDK.Helper functions, as it is an external library). For example:

retrieveItemRefHref
$("#" + $itemRefElement.attr("idref"), $packageDocument)

https://github.com/readium/readium-shared-js/blob/develop/lib/epub_cfi.js#L1669

As you can see, if idref contains forbidden characters, the selector matching will fail.

In the same file, I am pretty sure that these need escaping as well (albeit taking into consideration that they are attribute value selectors, not # UID):

generatePackageDocumentCFIComponent
$("itemref[idref='" + contentDocumentName + "']", $(packageDocument))

validatePackageDocument
$("itemref[idref='" + contentDocumentName + "']", packageDocument)

Email discussion:

https://groups.google.com/forum/#!topic/readium-dev/yDMmvT4cqCU

Bugzilla:
https://app.devzing.com/Readium/bugzilla/show_bug.cgi?id=47

Media Overlays playback does not progress pages (Windows)

Originally posted by @becka11y at
readium/readium-js-viewer#78

Tested Release 0.14 in IE 7, Firefox 30, and Chrome 35 in Windows 7 running via parallels 8 on a MBP OS X 10.9.4

Tested with epub30-test-0120-20140612.epub.

Open the above test file and navigate to Test mo-nav-020 Section Navigation - TOC. Open the Table of Contents and click on a paragraph in the test to start playback. Follow the instructions to click on the Section Navigation - Part 2 entry in the ToC. Playback does not continue in the new section.

On OS X this works in the Chrome Extension 2.14.2 and Safari 7.05. I got inconsistent results in Chrome 35.

Text highlighting

HI,
Thanks to all developers. I m building a web app to read epub files using Readium-viewer js library and I am succeeded in that. Now my intention is to provide text highlighting option. Now my doubt is, is this option is in Readium-Shared js library ? and can I use this Readium-Shared js libarary in my existing project. Thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.