I want to add a custom WikiStyle %confirm% in the style of %newwin%, which would add a javascript onclick event handler to a link confirming that the user wants to follow it. Currently, I've implemented it as the following hack but I was wondering if there's a better way of doing this?
$WikiStyle['confirm']['rel'] = '\' onclick=\'return confirm("Are you sure?")'; The $WikiStyleAttr array already has 'rel' linked to A elements by default, which means that using %rel=something confirm% will result in <a rel='' onclick='return confirm("Are you sure?")' href='...'>, overwriting the 'something'. This isn't a problem for me as I'm not using the rel attribute. A slightly nicer way might be to use the more arcane 'rev' instead and also set $WikiStyleAttr['rev'] = 'a'; . I can't use the 'onclick' attribute directly, as that would require me to set $WikiStyleAttr['onclick'] = 'a'; as well, which would lead to the possibility of writing inline javascript in pages, which I don't want to allow. Or am I missing something? eemeli _______________________________________________ pmwiki-devel mailing list pmwiki-devel@pmichaud.com http://www.pmichaud.com/mailman/listinfo/pmwiki-devel