Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 10-18-2010, 01:04 PM   #1
pollito pito
i warned you ...
pollito pito doesn't litterpollito pito doesn't litterpollito pito doesn't litter
 
pollito pito's Avatar
 
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…
pollito pito is offline   Reply With Quote
Old 10-18-2010, 01:35 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
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).
kovidgoyal is offline   Reply With Quote
Advert
Old 10-18-2010, 03:37 PM   #3
Lady Fitzgerald
Wizard
Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.
 
Lady Fitzgerald's Avatar
 
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?
Lady Fitzgerald is offline   Reply With Quote
Old 10-18-2010, 04:10 PM   #4
pollito pito
i warned you ...
pollito pito doesn't litterpollito pito doesn't litterpollito pito doesn't litter
 
pollito pito's Avatar
 
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:
javascript is only loaded once the full page has finished loading rather than at the start
there would be no way my script could trap the $(document).ready . However it does. You can test it adding
$(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.
pollito pito is offline   Reply With Quote
Old 10-18-2010, 04:20 PM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
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
kovidgoyal is offline   Reply With Quote
Advert
Old 10-18-2010, 06:05 PM   #6
pollito pito
i warned you ...
pollito pito doesn't litterpollito pito doesn't litterpollito pito doesn't litter
 
pollito pito's Avatar
 
Posts: 54
Karma: 222
Join Date: Apr 2010
Device: none
Quote:
Originally Posted by kovidgoyal View Post
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
But it is being called. The sequence seems to be like this:
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…
pollito pito is offline   Reply With Quote
Old 10-27-2010, 11:58 PM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
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
kovidgoyal is offline   Reply With Quote
Old 10-28-2010, 04:09 AM   #8
pollito pito
i warned you ...
pollito pito doesn't litterpollito pito doesn't litterpollito pito doesn't litter
 
pollito pito's Avatar
 
Posts: 54
Karma: 222
Join Date: Apr 2010
Device: none
Quote:
Originally Posted by kovidgoyal View Post
I put the alert into images.js and it is run only once for for me per load of an html file
Yes, indeed. The problem is that it should not run at all!

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
pollito pito is offline   Reply With Quote
Old 10-28-2010, 09:51 AM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Apparently jquery still simulates the ready event.
kovidgoyal is offline   Reply With Quote
Old 10-28-2010, 03:29 PM   #10
pollito pito
i warned you ...
pollito pito doesn't litterpollito pito doesn't litterpollito pito doesn't litter
 
pollito pito's Avatar
 
Posts: 54
Karma: 222
Join Date: Apr 2010
Device: none
Quote:
Originally Posted by kovidgoyal View Post
Apparently jquery still simulates the ready event.
Yes, but how? I mean, jquery can do nothing until the JavaScript library is loaded ...
pollito pito is offline   Reply With Quote
Old 10-28-2010, 03:55 PM   #11
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
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
kovidgoyal is offline   Reply With Quote
Old 10-28-2010, 05:55 PM   #12
pollito pito
i warned you ...
pollito pito doesn't litterpollito pito doesn't litterpollito pito doesn't litter
 
pollito pito's Avatar
 
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.
pollito pito is offline   Reply With Quote
Old 10-28-2010, 06:00 PM   #13
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,871
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.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I'm looking to convert 2 columns to 1 but ... SeaBookGuy PDF 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


All times are GMT -4. The time now is 04:57 AM.


MobileRead.com is a privately owned, operated and funded community.