> 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