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-07-2012, 05:11 AM   #3511
quisvir
Addict
quisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animals
 
quisvir's Avatar
 
Posts: 238
Karma: 6875
Join Date: Feb 2009
Location: Netherlands
Device: Kindle PW2
You can't 'call' an option using onSettingsChanged. onSettingsChanged itself is called by Core.settings after changing the option - and the setting is saved by Core.settings as well. To properly 'call' an option, you have jump to a temporary setting node, like is done in the ChangeEpubCSS action. Alternatively, you can have your action change the option value directly, and then call Core.settings.saveOptions(addon).
quisvir is offline   Reply With Quote
Old 03-07-2012, 03:53 PM   #3512
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,796
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 BenChen View Post
Check out the changelog here: http://code.google.com/p/prs-plus/source/list

To summarise, a number of issues have been fixed (#277, #301, #304, #305), Book Search (all books in a folder) has been added, Frotz has been renamed IntFic (and on 600/x50 can now handle all .z5, .z8 and .zblorb files), and Browse Folders has had a couple of fixes for its archive handling.

Sincerely,
Ben.
Thanks.

What are .z5, .z8, & .zblorb files?
JSWolf is offline   Reply With Quote
Old 03-08-2012, 12:23 AM   #3513
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 JSWolf View Post
Thanks.

What are .z5, .z8, & .zblorb files?
These are Interactive Fiction files for the Z-machine. They allow authors to distribute their games widely, since Z-machine interpreters (like Frotz and Nitfol) have been written for many different platforms. .z8 allow for a bigger game than .z5 and .zblorb ones can also include graphics and sound (however on the PRS+ Interactive Fiction App they just run without graphics and sound).

See http://en.wikipedia.org/wiki/Z-machi...interpreter%29 for more details.

Sincerely,
Ben.
BenChen is offline   Reply With Quote
Old 03-08-2012, 11:19 AM   #3514
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 quisvir - I try to mangage it.

A.
Analogus is offline   Reply With Quote
Old 03-09-2012, 07:17 AM   #3515
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
quisvir:

Question:
Is there a command/function which saves not already saved data in system-cache?

Reason:
I work on my auto-restart-code. For the 350 your code (formatting non existend cards) works better. Sometimes my dirty-reader-crashing code prevents to save reading-progress. After a restart the 'old' progress is used. Very unconvenient.

Idea:
When first saving properly the system-cache and then let restart reader it could solve the problem.

Another question:

Is it possible to use a CONFIRM DIALOGUE inbetween a SWITCH-block?

I have a ACTION, which functions well:

Code:
{
	name: "RestoreLastPRS",
	title: LA("ACTION_PRS_RESTORE_LAST"),
	group: "SAVE_RESTORE",
	icon: "BACK",
	action: function () 
	{
		var dialog = kbook.model.getConfirmationDialog();
		dialog.onOk = function () 
			{	
			Core.shell.exec('cp -R -f /Data/database/system/PRSPlus/PRSave3/prsp /opt0');
			}
		dialog.onNo = function () 
			{
			break;
			}
		dialog.openDialog(LA("MSG_QUESTION_RESTORE_PRS"), 0);
	}
},
I try to convert it in an option. Following works well as an 'Action'-Option:

Code:
restoreData = function (type) 
	{
		switch (type) 
		{
...
			
		case 'UNDOPRS':
			Core.shell.exec('cp -R -f /Data/database/system/PRSPlus/PRSave3/prsp /opt0');
			break;
		}
But when adding the confirm dialogue, nothing will happen:
Code:
restoreData = function (type) 
	{
		switch (type) 
		{
...
	case 'UNDOPRS':	
{
var dialog = kbook.model.getConfirmationDialog();
		dialog.onOk = function () 
			{	
			Core.shell.exec('cp -R -f /Data/database/system/PRSPlus/PRSave3/prsp /opt0');
			}
		dialog.onNo = function () 
			{
			break;
			}
		dialog.openDialog(LA("MSG_QUESTION_RESTORE_PRS"), 0);
		}
}
Where is my mistake? Tried lot of tweaking: using or not using {}, [], ';', 'break', 'return', ...
I tried it with much simpler code, no chance.

Thank you

Last edited by Analogus; 03-09-2012 at 07:20 AM.
Analogus is offline   Reply With Quote
Old 03-09-2012, 11:48 AM   #3516
quisvir
Addict
quisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animals
 
quisvir's Avatar
 
Posts: 238
Karma: 6875
Join Date: Feb 2009
Location: Netherlands
Device: Kindle PW2
Quote:
Originally Posted by Analogus View Post
Is there a command/function which saves not already saved data in system-cache?
Yes, there is:
Code:
kbook.model.commitCache();
To make the switch work, remove the {} from the case statement. So you get something like this:
Spoiler:
Code:
switch (type) {
	case 'BLABLA':
		// code
		break;
	case 'UNDOPRS':
		var dialog = kbook.model.getConfirmationDialog();
		dialog.onOk = function () {
			Core.shell.exec('cp -R -f /Data/database/system/PRSPlus/PRSave3/prsp /opt0');
		}
		dialog.openDialog(LA("MSG_QUESTION_RESTORE_PRS"), 0);
}

The break statement at the end of a case is optional. Without it, the next case(s) will be executed as well. Additionally: getConfirmationDialog resets the dialog, so you don't have to define a 'do nothing' onNo function.

Last edited by quisvir; 03-09-2012 at 11:51 AM.
quisvir is offline   Reply With Quote
Old 03-09-2012, 01:26 PM   #3517
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!
Restart working. Sadly the switch doesn't work... But at least I know that it should.

A.
Analogus is offline   Reply With Quote
Old 03-10-2012, 04:26 AM   #3518
Shark69
Zealot
Shark69 ought to be getting tired of karma fortunes by now.Shark69 ought to be getting tired of karma fortunes by now.Shark69 ought to be getting tired of karma fortunes by now.Shark69 ought to be getting tired of karma fortunes by now.Shark69 ought to be getting tired of karma fortunes by now.Shark69 ought to be getting tired of karma fortunes by now.Shark69 ought to be getting tired of karma fortunes by now.Shark69 ought to be getting tired of karma fortunes by now.Shark69 ought to be getting tired of karma fortunes by now.Shark69 ought to be getting tired of karma fortunes by now.Shark69 ought to be getting tired of karma fortunes by now.
 
Shark69's Avatar
 
Posts: 136
Karma: 493152
Join Date: Mar 2012
Location: Spain
Device: Kindle Oasis 2
Quote:
Originally Posted by Analogus View Post
Thank you!
Restart working. Sadly the switch doesn't work... But at least I know that it should.

A.
Is there any way to get your code?
Is there any clon copy?

Thanks
Shark69 is offline   Reply With Quote
Old 03-10-2012, 05:30 AM   #3519
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
There is no repository.
Following the part of the code which makes troubles (I'm actually splitting my code):
Analogus_Options.zip

There are 2 problems:

1) Function 'SystemfontData': there I want to add a YES/NO-question. It doesn't work as suggested above.

2) Function 'batteryData': I want to store the option-values to be restored on a restart of the reader. I didn't get it working so far.


A.

Edit: saving OPTION working now...

Last edited by Analogus; 03-10-2012 at 09:15 AM.
Analogus is offline   Reply With Quote
Old 03-10-2012, 06:23 AM   #3520
Shark69
Zealot
Shark69 ought to be getting tired of karma fortunes by now.Shark69 ought to be getting tired of karma fortunes by now.Shark69 ought to be getting tired of karma fortunes by now.Shark69 ought to be getting tired of karma fortunes by now.Shark69 ought to be getting tired of karma fortunes by now.Shark69 ought to be getting tired of karma fortunes by now.Shark69 ought to be getting tired of karma fortunes by now.Shark69 ought to be getting tired of karma fortunes by now.Shark69 ought to be getting tired of karma fortunes by now.Shark69 ought to be getting tired of karma fortunes by now.Shark69 ought to be getting tired of karma fortunes by now.
 
Shark69's Avatar
 
Posts: 136
Karma: 493152
Join Date: Mar 2012
Location: Spain
Device: Kindle Oasis 2
Quote:
Originally Posted by Analogus View Post
There is no repository.
Following the part of the code which makes troubles (I'm actually splitting my code):
Attachment 83700

There are 2 problems:

1) Function 'SystemfontData': there I want to add a YES/NO-question. It doesn't work as suggested above.

2) Function 'batteryData': I want to store the option-values to be restored on a restart of the reader. I didn't get it working so far.


A.
Thanks!!
Shark69 is offline   Reply With Quote
Old 03-10-2012, 09:11 AM   #3521
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
Question to developers:

I have made a FUNCTION in say A.JS. How do I call the function in B.JS when needed?

A.
Analogus is offline   Reply With Quote
Old 03-10-2012, 09:15 AM   #3522
kartu
PRS+ author
kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.
 
Posts: 1,637
Karma: 2446233
Join Date: Dec 2007
Device: Sony PRS-300, 505, 600, 650, 950
Quote:
Originally Posted by Analogus View Post
There is no repository.
Why not use "clone" feature of the Google Code?
PRS+ is GPL licensed, so if you are distributing alternative builds, you must provide sources of them as well.

Quote:
Originally Posted by Analogus View Post
Question to developers:

I have made a FUNCTION in say A.JS. How do I call the function in B.JS when needed?

A.
Depends how those js files are initialized. In general, each function (and js is normally initialized as a separate function) has it's own namespace. If files are combined prior to be initialized, then it's the same namespace and everything should be visible.

Last edited by kartu; 03-10-2012 at 09:17 AM.
kartu is offline   Reply With Quote
Old 03-10-2012, 09:46 AM   #3523
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
Quote:
Originally Posted by kartu View Post
Why not use "clone" feature of the Google Code?
PRS+ is GPL licensed, so if you are distributing alternative builds, you must provide sources of them as well.
As one learning JS from the beginning and playing with the code this would have had made no sense in the past. But knowledge is growing, with knowledge the code and I will of course put it in a repository (when I'm able to manage this challenge ;-).
Sorry, I'm new to programming and the world of open source...

Thanks for helping with calling functions as well.

A.
Analogus is offline   Reply With Quote
Old 03-10-2012, 07:56 PM   #3524
EldRick
Evangelist
EldRick goes to infinity... and beyond!EldRick goes to infinity... and beyond!EldRick goes to infinity... and beyond!EldRick goes to infinity... and beyond!EldRick goes to infinity... and beyond!EldRick goes to infinity... and beyond!EldRick goes to infinity... and beyond!EldRick goes to infinity... and beyond!EldRick goes to infinity... and beyond!EldRick goes to infinity... and beyond!EldRick goes to infinity... and beyond!
 
Posts: 470
Karma: 112801
Join Date: Aug 2010
Device: Aura H2O (i86, M96C, Mini&Glo, PRS-950, STR, K-Touch, K-DX, K-3)
Just installed 2.1 Alpha on my 950.

Outstanding! The ability to assign Press-and-Hold Button functions to things such as Change CSS and Rotation saves about a zillion tap-and-waits.

Thanks guys!

Last edited by EldRick; 03-11-2012 at 12:59 PM.
EldRick is offline   Reply With Quote
Old 03-11-2012, 05:01 PM   #3525
Nitro
Member
Nitro began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Jun 2011
Device: Sony PRS 505
Code:
<a href="#20120311"><b>11</b></a>

<a name="20120311"></a>
I've prs-505 and prs+ 2.1.0 alpha.
ebook, in epub, is simple html file with links inside it, like 2 above.

As far as I understand, when you click on 1st link you should jump to 2nd one, it's working like that in calibre or in sigil, but on prs you'll jump to the end of book.

Is it prs+ error, or sony firmware?
Nitro 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 02:19 PM.


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