Demo: Client side javascript plug-in framework

This demo will show how client side plug-in framework works, it illustrates the article: Plug-in architecture II: JavaScript Event-Driven plug-in framework. The code of the demo can be downloaded here. This demo uses underdog.js library.

When Plugin Handler (PH) is initialized a first event is fired: "ph-init-after" event. This will provokes the execution of a first plug-in that prints a list of articles' titles. When user clicks a title the content of the article is printed below. When the content of an article is printed three other plugins are fired: One that will add a textbox for searching words in the text (it will highlight matched words), and another that will identify the word with more than 3 characters under the user's mouse and will show a tooltip. This last plugin will be extended by a third one for the purpose of having an example of how plugins can extend others.
If you open the console, you will notice we had added a decorator that is being called on the first plug-in run() method.