> I'm making a website on tiddlyspot (http://cryj.tiddlyspot.com/) for a
> nonprofit organization and I want to make the edit (AND view) button
> go away entirely when the password for editing isn't entered. Is there
> any way to do this?

Checking for a password might be problematic (e.g., how would you
validate it without actually attempting to save the file to the
server?)  Instead, you could enable/disable 'readOnly' mode based on a
specific TiddlyWiki username...

Start by entering the following javascript into a tiddler called
[[TSpotSetupTweaks]]:
---------------
readOnly=config.options.txtUserName!='EnterAdminNameHere';
config.commands.editTiddler.hideReadOnly=true;
---------------
The first line sets/clears the readOnly flag.  The second line ensures
that the 'edit/view' command will be hidden when readOnly is enabled.
Put *your* TiddlyWiki username into the first line and then tag the
tiddler with 'systemConfig' (so it will be treated as a plugin) and
save/reload the document (so the plugin will take effect).

By default, the document should now be displayed in readOnly mode.  Go
to the sidebar options panel, enter your name (the same as the one you
put into the code above), and reload the document.  It should then be
editable.  If you change the username setting and reload, it should
once again be readOnly.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" 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/TiddlyWiki?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to