View Single Post
Old 06-02-2015, 06:10 AM   #3
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,731
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Abekonge View Post
interesting - what are some of the potential uses of localstorage in ebooks you imagine?
IMHO, it might be useful for showing/hiding comments, answers, translations etc.

For more examples, see this very simple Javascript ebook that I found in a German ebook forum and this over-the-top ebook by the makers of Azardi with all kinds of puzzles.

It might even be useful for fancy fiction books, for example the Kadath guide by French ebook publisher Walrus. IIRC, at one point they ask the user a question and if the answer is incorrect the text becomes blurred etc.

You could even implement a book password with localStorage. (I'm aware of the fact that it could easily be defeated by tech-savvy users or by simply opening the book with an epub2 reader.)

Quote:
A functionality like your test could be done with simple javascript manipulation of css (display:none /display: block) as well I guess.
I only have rudimentary JavaScript skills and I'm pretty sure that the functionality could be implemented much more efficiently.
Since you seem to have much better JavaScript skills, I've got a question for you: I implemented the show/hide functionality using sheet.deleteRule() followed by sheet.insertRule(). Is there any JavaScript method that would allow me to directly overwrite a CSS rule?
Doitsu is offline   Reply With Quote