10-18-2010, 01:04 PM | #1 |
i warned you ...
Posts: 54
Karma: 222
Join Date: Apr 2010
Device: none
|
Two columns broken in 7.24
I know that maybe I’m the only one using calibre viewer as the only e-book reading application, so pardon me for asking.
I’ve been happily using the script I wrote sometime ago to read my e-books in two facing columns. But alas, something changed in the new 7.24. Now when I open an e-book, it displays the two columns and two seconds later removes them. Can some of the developers please help me? Thanks, btw: There is substantial increase on the speed of the viewer… |
10-18-2010, 01:35 PM | #2 |
creator of calibre
Posts: 43,835
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
the sequence of javascript library loading has changed. You will probably need to adjust your script to compensate. Now javascript is only loaded once the full page has finished loading rather than at the start (this was needed to upgrade jquery to the latest version, which in turn is responsible for the speedup).
|
Advert | |
|
10-18-2010, 03:37 PM | #3 |
Wizard
Posts: 2,013
Karma: 251649
Join Date: Apr 2010
Location: Tempe, AZ, USA, Earth
Device: JetBook Lite (away from home) + 1 spare, 32" TV (at home)
|
Btw, you aren't the only one to solely use calibre's viewer. It works fine for me (especially after Kovid tweaked it a bit several versions ago; thanks, Kovid!) so why use another?
|
10-18-2010, 04:10 PM | #4 | |
i warned you ...
Posts: 54
Karma: 222
Join Date: Apr 2010
Device: none
|
Hi Kovid,
Sorry but I did not get it. If as you said the Quote:
$(document).ready(function(){ alert('1'); }); to the imajes.js . It is as if the page was constructed twice: first with javascript loaded ahead and then with it loaded afterwards. Is the only explanation I can find to why the two columns view is displayed just to be removed. In any case, until I find some time for a better solution, just changed the script from $(document).ready( to $(document).dblclick( . Thanks. |
|
10-18-2010, 04:20 PM | #5 |
creator of calibre
Posts: 43,835
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
My guess is that $(document.ready) is never being called, because the javascript is no loaded after that event fires. Try just putting your code at the top level
|
Advert | |
|
10-18-2010, 06:05 PM | #6 | |
i warned you ...
Posts: 54
Karma: 222
Join Date: Apr 2010
Device: none
|
Quote:
1-document flow is loaded 2-a javascript aware document is rendered. One can test it using $(document).ready(function(){ alert('ready fired'); }); 3-javascript is unloaded 4-document is rendered again 5-javascript is loaded But all this is only important if it was some bug, otherwise please ignore it. I’m simply sorry that can not contribute more… |
|
10-27-2010, 11:58 PM | #7 |
creator of calibre
Posts: 43,835
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I put the alert into images.js and it is run only once for for me per load of an html file
|
10-28-2010, 04:09 AM | #8 | |
i warned you ...
Posts: 54
Karma: 222
Join Date: Apr 2010
Device: none
|
Quote:
You explained that the script engine is not loaded anymore at the beginning, but rather after the full page is loaded. If I understand correctly, this necessarily means that the ready event can not be handled via jQuery, because the DOM is ready before the HTML parser is JavaScript aware. What I see is that the when I invoke the reader, it shows an spinner and a message saying “loading document flow”. After it finishes, my script is fired and the document rearranged in two columns, but somehow grayed out. Later on, after a second or so, the two columns layout disappears. I suggested the theory that maybe the document is rendered twice and that the script engine is loaded, unloaded and loaded again. But, I may be off by miles |
|
10-28-2010, 09:51 AM | #9 |
creator of calibre
Posts: 43,835
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Apparently jquery still simulates the ready event.
|
10-28-2010, 03:29 PM | #10 |
i warned you ...
Posts: 54
Karma: 222
Join Date: Apr 2010
Device: none
|
|
10-28-2010, 03:55 PM | #11 |
creator of calibre
Posts: 43,835
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
yes by simulates I mean that it fires the event once it is loaded if the document is already ready
|
10-28-2010, 05:55 PM | #12 |
i warned you ...
Posts: 54
Karma: 222
Join Date: Apr 2010
Device: none
|
Wait, it seems I did not get you and I am now really confused.
In your first message when you said that “the sequence of javascript library loading has changed”, were you referring to the JavaScript engine? I mean, were you talking of the interpreter or however is called in WebKit, the thing that executes the JavaScript? Or maybe you were talking about the jQuery library? In any case, this whole issue seems to be an old bug in jQuery or WebKit (see here), but it somehow was not affecting calibre before. |
10-28-2010, 06:00 PM | #13 |
creator of calibre
Posts: 43,835
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
no i mean the loading of all the javascript libraries, including jQuery. Earlier they were being loaded when the window object is cleared, now they are loaded after the document object is ready.
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
I'm looking to convert 2 columns to 1 but ... | SeaBookGuy | 1 | 10-17-2010 08:19 PM | |
Creating custom columns is broken in 0.7.3 | chaley | Calibre | 6 | 06-20-2010 03:40 AM |
Broken PRS-505; any place to buy chrome bottom piece? Or anyone with broken 505? | erikk | Sony Reader | 1 | 12-09-2009 06:51 PM |
Columns | darkpoet | ePub | 8 | 09-09-2009 10:17 PM |
Broken Ipod works Fine! except that its broken | Andybaby | Lounge | 1 | 06-04-2009 02:03 AM |