Tags:
create new tag
view all tags
In the CommentPlugin, I inherited some dodgy code that detects when the plugin is being called in "preview mode" by parsing the script name, looking for the string "preview". This is required in the commonTagsHandler to disable the comment forms when in preview mode.

I thought this code was dodgy, and so it proves; SimonLang reports that GnuSkin uses "gnusave" instead of "preview".

Rather than hacking "gnusave" into the CommentPlugin, it occurs to me that it would be much better for plugins to be told what "mode" they are being called in, same as they are told what skin they are wearing. That way plugins that normally accept input in "view" mode can disable the inputs in "preview".

There are a number of ways this could be handled. A new parameter to initPlugin. A function "getMode" in the plugins interface. Addition of a "beforeViewHandler" that can be used to validate the fact that we are in view mode.

-- CrawfordCurrie - 27 Feb 2004

Topic revision: r1 - 2004-02-27 - CrawfordCurrie
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.