Book Image

MooTools 1.2 Beginner's Guide

Book Image

MooTools 1.2 Beginner's Guide

Overview of this book

MooTools is a simple-to-use JavaScript library, ideal for people with basic JavaScript skills who want to elevate their web applications to a superior level. If you're a newcomer to MooTools looking to build dynamic, rich, and user-interactive web site applications this beginner's guide with its easy-to-follow step-by-step instructions is all you need to rapidly get to grips with MooTools.
Table of Contents (14 chapters)
MooTools 1.2 Beginner's Guide
Credits
About the Authors
About the Reviewer
Preface

Chapter 9. Creating Your Own Plugin

Authoring your own plugin is a great practice for creating flexible, extensible, and reusable scripts. Plugins are inline with the MooTools philosophy of writing reusable code that you can instantiate and customize. For example, if you build many websites and find that there are certain JavaScript functionalities that you reuse and tweak for each project, you can simply write a class for it and instantiate them with varying options in your projects.

You can also release plugins to the public, and, thus, participate and help your fellow MooTools developers. This can be an added advantage to your curriculum vitae; it can showcase your abilities in writing MooTools code, the right way.

In this chapter we shall:

  • Design a plugin by making a design sheet

  • Create a script that accomplishes the function of the plugin; it will serve as a pattern and as a lesson on converting your existing scripts into a reusable and flexible plugin

  • Create documentation for the plugin...