1705 has exposed necessity of Javascript-side plugin events.
reCAPTCHA plugin needs to know the exact timings when the comment/guestbook forms are loaded on the page (either via AJAX or refresh) and covering all timings manually leaves potential bugs and poses extra burdens to the plugin developers.
I'm going to write a simple hash-based event system, which may look like Plugin.fireEvent('loadCommentForm', entryId); and Plugin.registerHandler('loadCommentForm', my_javascript_func). Calls to fireEvent will be inserted in the core codes (e.g., dress() functions in library/view files.) The use of return values and semantics of the passed arguments are specific to individual events, just like PHP-side plugin events.
1705 has exposed necessity of Javascript-side plugin events.
reCAPTCHA plugin needs to know the exact timings when the comment/guestbook forms are loaded on the page (either via AJAX or refresh) and covering all timings manually leaves potential bugs and poses extra burdens to the plugin developers.
I'm going to write a simple hash-based event system, which may look like
Plugin.fireEvent('loadCommentForm', entryId);
andPlugin.registerHandler('loadCommentForm', my_javascript_func)
. Calls tofireEvent
will be inserted in the core codes (e.g.,dress()
functions in library/view files.) The use of return values and semantics of the passed arguments are specific to individual events, just like PHP-side plugin events.