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