Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Sony Reader > Sony Reader Dev Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 03-31-2012, 11:31 AM   #3586
Mark Nord
2B || !2B
Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.
 
Posts: 854
Karma: 327896
Join Date: Feb 2010
Location: Austria
Device: Sony PRS505/650/T1/tolino vision 5
Quote:
Originally Posted by Analogus View Post
..
How do you call an external *.js-script from within an function?
Script is in say /Data/.../scripts/
A.
You can do it like this:

Code:
var myCode, codePath, f, value1, value2;
codePath = "/Data/.../scripts/";
//load js-code
myCode = Core.io.getFileContent(codePath);
//create new Function form myCode passing two paramters "param1/param2" used in external code
f = new Function("param1,param2", myCode);
// set parameters if needed
value1 = something;
value2 = anotherting;
// execute the function
try {
     f(value1,value2); 
}catch (ignore) {}
Check prsp.js code and read here:
http://de.selfhtml.org/javascript/sp...funktionen.htm
HTH
Mark

Last edited by Mark Nord; 03-31-2012 at 03:29 PM. Reason: added quote of question due to new page
Mark Nord is offline   Reply With Quote
Old 04-02-2012, 09:23 AM   #3587
Kek
Junior Member
Kek began at the beginning.
 
Posts: 9
Karma: 10
Join Date: Mar 2012
Device: Prs-650
Hello all.
It's for the battery drain thing (again). So I thought that the bug went after those 2-3 resets. In fact it was still there.
I deleted all the books on the reader, I reseted it multiple times. After all that I simply used the normal firmware.
In the end I used the last nightly build compiled by Analogus.
Still buggy.

Whatever the book, in standby it eats battery. Before going to bed, battery is full. In the morning only one bar left.
With the Lechuck Version everything went smoothly, so I reverted the only new option I ticked.
The time necessary to shut the reader. Default it was 5 minutes, I put something like 10 or 15 minutes.
Since it's set on default again, no more problems, my reader works as intended. No battery drain in the night.

Is there a correlation or is it pure luck...don't know. Since my reader is working again...I don't want to change any options
So if someone has any battery drain, it's maybe because you changed the time to shutdown option.

And just an idea by the way.
We all use Calibre and we can change the cover from epub with 2 clicks. On the official firmware, this cover will be used as main cover. On the PSR+ firmware only the "epub" cover is used.
Sometimes there is no cover or a low-res/bad one...changing it within the epub need some tools like Sigil and way much time than the calibre "change the cover" metadata way.
If we could choose wich cover to use ; the build-in cover within the epub or the calibre metadata epub cover...it would be really really great
Since there is this (awesome) feature of using the cover on the current reading book on shutdown...it would be great to implement this little tweak.

Thanks again for all the hard work
Kek
Kek is offline   Reply With Quote
Old 04-02-2012, 10:14 AM   #3588
Analogus
Fanatic
Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.
 
Analogus's Avatar
 
Posts: 568
Karma: 2170348
Join Date: Apr 2011
Device: 2x Sony PRS-350; PRS-300 (†), Paperwhite (†), Voyage
One question:

Is it possible to make an OPTION(group) callable from within a book (say with a button)?

Reason for asking:

I have allready made an optiongroup in PRS+-options which makes it possible to alter style.css in a flexible way. It lets you choose/combine you own font-size, text-indent, line-space, text-align, ...
This functions more or less well.
Ebook will reload automatically.

Now it would be nice not to close the book for altering this options and therefor calling this options from within a book similiar CSS-styles in PRS+.

In other words:

Is it possible to make a action which calls this option(group)?

Thank you very much

A.
Analogus is offline   Reply With Quote
Old 04-02-2012, 10:28 AM   #3589
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by Kek View Post
We all use Calibre and we can change the cover from epub with 2 clicks. On the official firmware, this cover will be used as main cover. On the PSR+ firmware only the "epub" cover is used.
Sometimes there is no cover or a low-res/bad one...changing it within the epub need some tools like Sigil and way much time than the calibre "change the cover" metadata way.
If we could choose wich cover to use ; the build-in cover within the epub or the calibre metadata epub cover...it would be really really great
Since there is this (awesome) feature of using the cover on the current reading book on shutdown...it would be great to implement this little tweak.
My old Calibre 'Copy Cover' plugin can still be used on your PRS-650 for those epubs without a suitable built-in cover plus non-epubs like PDF, RTF, TXT.

Once it has copied all your desired Calibre covers to the Sony you will need to decide whether you want to use the PRS+ Standby Image Type option Current Book Cover or System Standby Function, for each particular book. Switch between them as necessary.

Another Calibre plugin you may find useful is the 'Modify epub' plugin, which has an option to update the existing epub built-in cover. It won't work with all epubs (e.g. DRM'd ones) because it will depend on how the epub specifies its cover. It should work fine on any epub originally created by Calibre. Of course you will then need to resend the updated epub to the Sony.

Last edited by jackie_w; 04-02-2012 at 10:34 AM. Reason: another option
jackie_w is offline   Reply With Quote
Old 04-02-2012, 01:29 PM   #3590
BenChen
EPUB Metadata ******
BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.
 
Posts: 525
Karma: 26874
Join Date: Dec 2010
Device: Kobo Glo HD
Quote:
Originally Posted by Kek View Post
We all use Calibre and we can change the cover from epub with 2 clicks. On the official firmware, this cover will be used as main cover. On the PSR+ firmware only the "epub" cover is used.
Sometimes there is no cover or a low-res/bad one...changing it within the epub need some tools like Sigil and way much time than the calibre "change the cover" metadata way.
If we could choose wich cover to use ; the build-in cover within the epub or the calibre metadata epub cover...it would be really really great
Since there is this (awesome) feature of using the cover on the current reading book on shutdown...it would be great to implement this little tweak.
Hi Kek,

Actually, what you say is incorrect. Our code uses the built-in Sony procedure for retrieving the cover from the epub file. The difference is we then use it at 800x600 size, whereas Sony only used it to generate a small thumbnail. But the same source file is being used in both cases.

What you are noticing is that sometimes an epub has a cover image (according to the metadata) and then the first page of the book is a higher quality version of the cover. It would be too difficult to write a procedure to find an then use such a higher quality image.

Instead, just make sure that when you use Calibre to change the cover, choose a high quality image! I never use the one that Calibre suggests. I do my own Google image search and find the highest quality image I can.

Sincerely,
Ben.
BenChen is offline   Reply With Quote
Old 04-02-2012, 02:21 PM   #3591
Mark Nord
2B || !2B
Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.
 
Posts: 854
Karma: 327896
Join Date: Feb 2010
Location: Austria
Device: Sony PRS505/650/T1/tolino vision 5
Quote:
Originally Posted by Analogus View Post
One question:

Is it possible to make an OPTION(group) callable from within a book (say with a button)?
..
A.
Hi Analogus (Jo, Sepp?)

funny that we are doing this all here in English, whereas it would be so much easier doing it in our mouther-tongue.

But to answer your question:
It is already done in "EpubUserStyle.js" which provides the CSS selection upon a keypress.
See if you can rework your code like this, or integrate it into this addon, as it very much suits the same case.
Mark Nord is offline   Reply With Quote
Old 04-02-2012, 02:22 PM   #3592
Analogus
Fanatic
Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.
 
Analogus's Avatar
 
Posts: 568
Karma: 2170348
Join Date: Apr 2011
Device: 2x Sony PRS-350; PRS-300 (†), Paperwhite (†), Voyage
Hi all

Another question - maybe someone could help (as most of the time):

What I want to do:


I add new buttons on the FONTSIZE OVERLAY (sizeOverlay.xml).
Over this buttons I try to activate one of my own FUNCTIONS.

What I allready have:
New buttons on the FONTSIZE OVERLAY

What I don't know:
How to call FUNCTIONS which are stored in one of my own *.js-files.

Any information would be very helpfull

Thank you

A.
Analogus is offline   Reply With Quote
Old 04-02-2012, 02:25 PM   #3593
Mark Nord
2B || !2B
Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.
 
Posts: 854
Karma: 327896
Join Date: Feb 2010
Location: Austria
Device: Sony PRS505/650/T1/tolino vision 5
Quote:
Originally Posted by Kek View Post
...
With the Lechuck Version everything went smoothly, so I reverted the only new option I ticked.
The time necessary to shut the reader. Default it was 5 minutes, I put something like 10 or 15 minutes.
Since it's set on default again, no more problems, my reader works as intended. No battery drain in the night.

Is there a correlation or is it pure luck...don't know. Since my reader is working again...I don't want to change any options
..
Thanks again for all the hard work
Kek
You are welcome and thanks for sharing this findings.

I havn't changed the value on my 650, but set the 505 to go to sleep after 10 minutes, and there are no side-effects so far.
Mark Nord is offline   Reply With Quote
Old 04-02-2012, 02:31 PM   #3594
Analogus
Fanatic
Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.
 
Analogus's Avatar
 
Posts: 568
Karma: 2170348
Join Date: Apr 2011
Device: 2x Sony PRS-350; PRS-300 (†), Paperwhite (†), Voyage
Hi Mark

Yes that's right: "Jo, Sepp"... But that's of course not my real name. Concerning mother-tongue I regard writing in English as an exercise not becoming too rusty ;-)


EpubUserStyle
: I recoginzed that but was not able to make some usefull things with that code. Still a very beginner in coding. Besides: I learn bits of HTML, XML, CSS, LINUX and JS just to improve my reader. Its great 'fun'.

Question in the post above aims in same direction - I try to call my functions over buttons. Any (simple) idea?

Thanks
Analogus is offline   Reply With Quote
Old 04-02-2012, 02:42 PM   #3595
Mark Nord
2B || !2B
Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.
 
Posts: 854
Karma: 327896
Join Date: Feb 2010
Location: Austria
Device: Sony PRS505/650/T1/tolino vision 5
Analogus,

same here "fun" and though more then 20 years in programming/reverse-engineering only some two years with kinoma-FSK and JavaScript.

Look on quisvir's code applied to main.xml.
There are some new buttons with actions like : "doAddToCollection"

The "trick" is to set your code into the right "context", which for above mentiond example is: "model.container.sandbox.OPTION_OVERLAY_PAGE.sandb ox.doAddToCollection"
(See BookManagement_x50.js)

To find the context folllow the xml-structure of your "host".

All xml-created/triggered code is executed in "sandbox"es separating it form the inner/elevated FSK or also PRS+core/addon code.
Mark Nord is offline   Reply With Quote
Old 04-03-2012, 03:33 AM   #3596
Analogus
Fanatic
Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.
 
Analogus's Avatar
 
Posts: 568
Karma: 2170348
Join Date: Apr 2011
Device: 2x Sony PRS-350; PRS-300 (†), Paperwhite (†), Voyage
Thank you. More accidentally than with knowledge I managed it.

Now it is possible to use fine-grained font size changing over CSS with the SIZE-OVERLAY:
Click image for larger version

Name:	2020-4-30_1.jpg
Views:	381
Size:	53.0 KB
ID:	84805
Group for changing CSS-file:
Click image for larger version

Name:	2020-4-30_3.jpg
Views:	401
Size:	26.8 KB
ID:	84806

A.
Analogus is offline   Reply With Quote
Old 04-03-2012, 05:36 AM   #3597
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,252
Karma: 16544692
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
Quote:
Originally Posted by Analogus View Post
Now it is possible to use fine-grained font size changing over CSS with the SIZE-OVERLAY:
That sounds encouraging. Is this a possibility for the 'official' version at some point?
jackie_w is offline   Reply With Quote
Old 04-03-2012, 08:50 AM   #3598
VICTORSJG
Addict
VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.
 
Posts: 318
Karma: 1846
Join Date: Dec 2009
Device: PRS-505
Quote:
Originally Posted by Analogus View Post
Thank you. More accidentally than with knowledge I managed it.

Now it is possible to use fine-grained font size changing over CSS with the SIZE-OVERLAY:
Attachment 84805
Group for changing CSS-file:
Attachment 84806

A.
Could you upload these modifications on your repository?

thanks
VICTORSJG is offline   Reply With Quote
Old 04-03-2012, 11:05 AM   #3599
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,792
Karma: 146391129
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Analogus View Post
Thank you. More accidentally than with knowledge I managed it.

Now it is possible to use fine-grained font size changing over CSS with the SIZE-OVERLAY:
Attachment 84805
Group for changing CSS-file:
Attachment 84806

A.
So when are these changes going to be part of a compiled version? I would love to have fine control over the font size.
JSWolf is offline   Reply With Quote
Old 04-03-2012, 02:06 PM   #3600
Analogus
Fanatic
Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.Analogus ought to be getting tired of karma fortunes by now.
 
Analogus's Avatar
 
Posts: 568
Karma: 2170348
Join Date: Apr 2011
Device: 2x Sony PRS-350; PRS-300 (†), Paperwhite (†), Voyage
jackie_w:
That should be answered by the developers of PRS+. I'm just playing with the code for myself ;-)

VICTORSJG:
I will when it's ready. Problem now are the buttons:
The button pressed don't remain black. So far as I can see, there is a hardcoded(?) variable responsible for that (VAR_RADIO_CSS_FONT_SIZE) which I am not able to use.
Code is very rough and shoud be cleaned up.

JSWolf:
Of course there will be a compiled version ("Zork-Edition"). But it takes a couple of days to finish the job. I'll post it here when ready. Source-Code will be uploaded then too.

Things to be done:
I'll integrate line-height-buttons in the overlay too to have the possibility to change it on the fly. Looking good so far.
Problem generally is, that all this formattings have to be done over CSS. And problem with CSS (additional to my limited knowledge) is that lots of books have very different CSS-tags.
Buttons need other icons (much work).


A.
Analogus is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using HD Folders as Collections on Sony PRS-505 fglaysher Calibre 8 07-26-2010 09:55 PM
Enhanced Firmware for V3 keng2000 HanLin eBook 12 04-12-2010 09:30 AM
Poll: Sony Reader PRS-505 upgrade to Sony PRS-700 Kris777 Sony Reader 70 02-18-2009 06:34 PM
Sony Reader PRS-505 upgrade to Sony PRS-700 Kris777 Sony Reader 23 12-08-2008 06:56 AM
Sub folders in firmware v1.08 Prince Hal Amazon Kindle 28 10-23-2008 03:20 PM


All times are GMT -4. The time now is 05:22 PM.


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