readium/readium — pull request #154 by imc-ag (2012-07-03 10:36:24+00:00)
Title: Functionality of TOC in Webbrowser

We tested several eBooks on http://github.readium.org as well as the current master branch on a local testserver. Here the TOC was not working.

The reason was that in the function packageDocument.spineIndexFromHref() the condition could never be true as in the spine the files are listed with their subdirectory but in the toc they are listed without their subdirectory, as the toc is in the same dir as the files.

We added a quickfix here, by only comparing the filenames. (See SOURCECODE)

If duplicate filenames occur in different directories of a book, this approach will fail. One idea would be to define that packageDocument.spineIndexFromHref() only gets hrefs like they are defined in the spine. Some other method would need to preprocess the href before. This could be done for example in ebook.gotoHref when the method would get beside the href also the caller.

Further while adapting the reader for Android we are need to load files defined by full qualified urls. For this we added a switch in the web_overrides/httpFileApi. The behavior of absolute path will be the same.