Thanks Eric - I'll go back around and look hard at CookieManager and
CookieSaver again. I made an initial pass at both but came unstuck
precisely where you indicated in your second reply. Being short of
time I defaulted to the dead simple ConfigOptions approach - which is
far from satisfactory but WAS good enough to get rolling. Candidly
though - the solution needs CookieManager/CookieSaver.

I'm also working on a plugin to store options locally on the iPad. I
have a couple of approaches for that: HTML5 and/or shared storage via
PhoneGap. However - my preference is always to work with what is
already there and that which people area already used to on other
platforms.

Chris.

On Jun 27, 11:43 pm, Eric Shulman <[email protected]> wrote:
> > if (config.options["txtUserName"]=="SomeNameHere") {
> >    // assignment statements go here
> > }
> > When you share the document with someone else, and they change
> > settings to suit their preferences, their settings are stored in a
> > separate username-specifric section within the CookieJar so that when
> > they load the document, only those settings are applied.
>
> addendum:
> Obviously, for the username-specific settings to be applied,
> CookieSaverPlugin does NOT store the current "txtUserName" in the
> CookieJar.  On platforms that do not support any use of persistent
> browser-cookies (i.e., Safari on iPad), the username must be set
> before the CookieJar is processed.
>
> To achieve this, you could add a small systemConfig tiddler named
> [[ConfigUserNamePrompt]], containing the following JS code:
>
> if (config.options.txtUserName=="YourName") {
>    var who=prompt("Please enter your user name:");
>    if (who) {
>       var tid="ConfigUserName";
>       var when=new Date();
>       var txt='config.options.txtUserName="'+who+'";'
>       var tags=['systemConfig'];
>       var fields={};
>       store.saveTiddler(tid,tid,txt,who,when,tags,fields);
>    }
>
> }
>
> Note that the names of the tiddlers is somewhat important, because the
> tiddlers are processed in alpha-numeric order by tiddler title.
>
> Thus, ConfigUserName (if present) is invoked first to set the desired
> username.
>
> Next , ConfigUserNamePrompt is invoked to check for a non-default
> username and prompt for input if the default value is found.
>
> Lastly, CookieJar is invoked to apply the user-specific stored
> settings.
>
> enjoy,
> -e

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywikidev?hl=en.

Reply via email to