In this chapter, we learned how to build a plugin; a plugin that automatically captions images in a web page with their respective alt
(or title)
property.
This is what we covered in this chapter:
Designing a plugin: We created a design sheet that we can easily reference as we build our plugin, and when we document it for public use.
How to convert a script to a flexible MooTools class: We converted an image captioning script that we wrote into a class (plugin) with various options that allow its class instance to be customized.
Instantiating our plugin: We learned how useful plugins can be in allowing us to customize instances to reduce the amount of code we have to write (and re-write).
How to properly document our plugin: We followed documentation and used the MooTools coding style and plugin documentation to let other MooTools developers quickly learn how to implement our plugin into their own projects.
At this point, you're now officially a MooTools rockstar!