meson1 wrote:Hi Phil
Did you happen to look at the JS pageid issue I mentioned above?
Also, a question: how do you set and unset flags in JS?
Also, also,

did you know that when you have <AutoSetPageWhenSeen> set to true. it adds pageids without checking if they are there first, so if you loop round the same page multiple times, you end up with a huge long list of that pageid in the flag string.
It doesn't happen for flags set using the xml "set=" clause. If I do a set="wibble" multiple times in the xml guide, I only ever end up with one "wibble" in the flag string which is what I expect. But <AutoSetPageWhenSeen>true swamps the flag string with multiple instances of the same pageid. So perhaps this might be something worth tightening up when time allows.
Kindest regards
Version 0.0.8 (overwrite your current GuideMe.jar with this one)
Fix for autopage spawning multiple identical flags
Current Page and Previous page available to javascript
Access to set, unset and test for flags
https://mega.co.nz/#!MdACnIYK!T5FFzDElj ... tygLRscITA
Code: Select all
//Returns true or false (this is the code that is used within guideme so ifset/ifnotset handle and/or conditions as they would in the xml)comonFunctions.canShow(guide.getFlags(), String ifSet, String ifNotSet); //flagNames is a comma separated list e.g."page3,page5" or "page3" comonFunctions.SetFlags(String flagNames, guide.getFlags());comonFunctions.UnsetFlags(String flagNames, guide.getFlags()); guideSettings.getCurrPage();guideSettings.getPrevPage(); htmltext = htmltext + "Current Page is " + guideSettings.getCurrPage() + " <br/>";htmltext = htmltext + "Previous Page is " + guideSettings.getPrevPage() + " <br/>"; jscriptLog("Flags " + comonFunctions.GetFlags(guide.getFlags()));jscriptLog("Can show ? " + comonFunctions.canShow(guide.getFlags(), "start", "fluffy"));comonFunctions.SetFlags("fluffy", guide.getFlags());jscriptLog("Flags " + comonFunctions.GetFlags(guide.getFlags()));jscriptLog("Can show ? " + comonFunctions.canShow(guide.getFlags(), "start", "fluffy"));comonFunctions.UnsetFlags("fluffy", guide.getFlags());jscriptLog("Flags " + comonFunctions.GetFlags(guide.getFlags()));jscriptLog("Can show ? " + comonFunctions.canShow(guide.getFlags(), "start", "fluffy")); 2014-01-10 20:57:22,986 INFO Jscript - Starting Flags {[start, Page1a, Page1]}2014-01-10 20:57:23,058 INFO Jscript - Flags start,Page1a,Page12014-01-10 20:57:23,059 INFO Jscript - Can show ? true2014-01-10 20:57:23,059 INFO Jscript - Flags start,Page1a,fluffy,Page12014-01-10 20:57:23,059 INFO Jscript - Can show ? false2014-01-10 20:57:23,060 INFO Jscript - Flags start,Page1a,Page12014-01-10 20:57:23,060 INFO Jscript - Can show ? true2014-01-10 20:57:23,060 INFO Jscript - Ending Flags {[start, Page1a, Page1]}