View Single Post
Old 08-15-2011, 03:37 PM   #2358
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
TechTalk:

While searching the sources to find a solution to the LRF-StandbyImage problem with PRS-505 I came across some interesting definitions in kbook.kbookPage [EDIT] for x50 models [/EDIT]
  1. kbookPage.canDoubleTap: if set to function {return false} doubletap on a book-page no longer opens the dictionary. This feature is often asked over at the-ebook.org
  2. kbookPage.borderColor by modifying this, the annoying grey-border mostly with PDF's, can be removed (actually be replaced with white)
  3. kbookPage.NoMarkOverlapArea there are several complaints about the repeated lines on the second half page in landscape-mode. With a PRS-505 this repeated lines a greyed-out, and there is code in this.kbook.kbookPage.draw for the x50 to do so too.

While 1 and 2 are already working, I see no differences when changing 3.

It's to early to push to the repository, but I will attach the code of x50_ViewerSettings - Addon

Spoiler:
Code:
// Name: x50_ViewerSettings
// Description: Allows to choose if Overlap in 2page mode is masked, disables doubleTapAction and so dictionary
// Author: Mark Nord
//
// History:
//	2011-08-15 Mark Nord - Initial version


tmp = function() {

	switch (Core.config.model) {
	case "505":
	case "300":
	case "600":
		return;	
		break;
	default:       
	}

	// Localize	 	
	var L = Core.lang.getLocalizer("x50_ViewerSettings");

	// Constants

	var x50_ViewerSettings = {
		name: "x50_ViewerSettings",
		settingsGroup: "viewer",
		optionDefs: [
			{
				name: "NotMarkOverlapArea",
				title: L("OPTION_NOTMARKOVERLAP"),
				icon: "SETTINGS",
				defaultValue: "true",
				values: ["true", "false"],
				valueTitles: {
					"true": L("VALUE_TRUE"),
					"false": L("VALUE_FALSE")
				}
			},	
			{
				name: "NoDictionary",
				title: L("OPTION_NODICT"),
				icon: "SETTINGS",
				defaultValue: "false",
				values: ["true", "false"],
				valueTitles: {
					"true": L("VALUE_TRUE"),
					"false": L("VALUE_FALSE")
				}
			},	
			{
				name: "BorderColor",
				title: L("OPTION_BORDERCOLOR"),
				icon: "SETTINGS",
				defaultValue: "grey",
				values: ["grey", "white"],
				valueTitles: {
					"grey": L("VALUE_GREY"),
					"white": L("VALUE_WHITE")
				}									
			}
		],
		/**
		* @constructor
		*/
		onPreInit: function () {
		},
		onInit: function () {
		 onSettingsChanged();
		},
		onSettingsChanged: function (propertyName, oldValue, newValue, object) {
		//	var log = Core.log.getLogger("x50_ViewerSettings");
			kbook.kbookPage.NotMarkOverlapArea = x50_ViewerSettings.options.NotMarkOverlapArea === "true";
			kbook.kbookPage.canDoubleTap = (x50_ViewerSettings.options.NoDictionary ==="true") ? function () {return false;} : function () {return true;};
		//	log.trace("kbook.kbookPage.canDoubleTap "+kbook.kbookPage.canDoubleTap.call() , "trace");
			if (x50_ViewerSettings.options.BorderColor ==='grey') 
				{kbook.kbookPage.borderColor=Color.rgb.parse('#6D6D6D')
			} else { kbook.kbookPage.borderColor=Color.rgb.parse('white')
			}		
		}	
	};

	Core.addAddon(x50_ViewerSettings);
};
try {
	tmp();
} catch (e) {
	// Core's log
	log.error("in x50_ViewerSettings.js", e);
}


Any comments or hints are highly welcome.

Last edited by Mark Nord; 08-16-2011 at 02:06 AM. Reason: added x50
Mark Nord is offline   Reply With Quote