This seems to work 95%, however, when logging out or in, the cookie (or
wherever the setting is saved) is only updated after the load happens, so I
need an additional F5 to get the correct...
Also I've beet trying to get the login link to be a button, but failed.
This works (but is link): jQuery("<span/>").html('<a
href="http://pepdnf1.pepstores.com/challenge/cookie_form">Login</a>').appendTo(place);
One of my (many) tries: Query("<span/>").html('<button
onclick="window.location.href=''http://pepdnf1.pepstores.com/challenge/cookie_form''">Click
me</button>').appendTo(place);
Anyone have a clue how to make a button rather than a link to my login url?
On Tuesday, 13 November 2012 10:27:40 UTC+2, Reenen wrote:
>
> Hi
>
> I am trying to create a macro that will, if I am logged out, have a Login
> button/link, and if I am logged in, have a logout. (This is on a TiddlyWeb
> installation)
>
> Currently I have a tiddler called LoginLogoutPlugin, with the systemConfig
> tag, which looks like this:
>
> //{{{
> config.macros.loginout = {
> handler:
> function(place,macroName,params,wikifier,paramString,tiddler) {
> if (config.options.txtUserName == 'GUEST') {
> jQuery("<span/>").text('<a href="
> http://pepdnf1.pepstores.com/challenge/cookie_form
> ">Login</a>').appendTo(place);
> } else {
> jQuery("<span/>").text('<form method="POST" action="/logout">
> <input type="submit" value="logout"> </form>').appendTo(place);
> }
> }
> };
> //}}}
>
> No the problem is that the text is not interpreted but is displayed
> verbatim on my wiki.
>
> Also I'd prefer having both my login and my logout as buttons if you guys
> could help me with that.
>
> Regards,
> -Reenen
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/tiddlywikidev/-/tCwS79LCNA0J.
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.