You are here: Foswiki>Tasks Web>Item1985 (09 Oct 2009, PaulHarvey)Edit Attach

Item1985: Oops template (no such topic) has non-functioning "create new topic" button

pencil
Priority: Normal
Current State: Closed
Released In:
Target Release: n/a
Applies To: Extension
Component: NatSkin
Branches:
Reported By: PaulHarvey
Waiting For: Main.MichaelDaum
Last Change By: PaulHarvey
NatSkin enabled on trunk.

Navigate (via URL) to a topic that doesn't exist, Eg. FooBarTopicThatDoesntExist

The "Create new topic" button does nothing.

Notice that the rendered HTML has the <span> for the button repeated twice, once within a div that's displayed, another in a hidden div (via TwistyPlugin). HTML fails validation due to these <span> elements sharing the same id.

There are a couple of mismatched %TMPL:DEF%=/=%TMPL:END% tags in NatSkin. Attached a diff fixing them all (I hope).

-- PaulHarvey - 29 Aug 2009

Both %TWISTYBUTTON% and JQuery's %BUTTON% are trying to set onClick() handler for the same element id. Perhaps this problem has been masked until now due to a change in the order that JS scripts are being loaded/initialised?...

%BUTTON% is only required to produce some HTML. The only tricky part is the way JQuery selects icons. The patch I have below hard-codes FamFamFamSilkIcons for the icon path.

Also removed some newlines in NatSkinWebCreateNewTopic.txt which broke validation (<p/> elements inside <span>).

I briefly looked at modifying JQueryPlugin/BUTTON.pm to add a new "type" (none) that would not try to set an onClick() handler. Then EugenMayer suggested we use bind(click, method) instead of .click(method), which sounds like a better idea. Being essentially brand new at JS and JQuery in general, I shall leave this for another time...

-- PaulHarvey - 30 Aug 2009

Merged in all of your fixes except the removal of %BUTTON from inside the twisty button. I use this construction quite a lot and don't have any problems with it. This might be related to some fixes in the upcoming JQueryPlugin in that area...

-- MichaelDaum - 31 Aug 2009

No longer an issue using trunk NatSkin and JQueryPlugin.

-- PaulHarvey - 09 Oct 2009

ItemTemplate edit

Summary Oops template (no such topic) has non-functioning "create new topic" button
ReportedBy PaulHarvey
Codebase trunk
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Extension
Component NatSkin
Priority Normal
CurrentState Closed
WaitingFor MichaelDaum
Checkins
TargetRelease n/a
ReleasedIn
I Attachment Action Size Date Who Comment
natskin4728_mismatched_tmpl.diffdiff natskin4728_mismatched_tmpl.diff manage 2 K 29 Aug 2009 - 14:35 PaulHarvey  
natskin4728_nosuchtopic-fixes.diffdiff natskin4728_nosuchtopic-fixes.diff manage 2 K 30 Aug 2009 - 12:25 PaulHarvey remove use of =%<nop>BUTTON%= in NatSkinTopicDoesNotExistViewTemplate.txt
Topic revision: r4 - 09 Oct 2009, PaulHarvey
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy