plugins: migrated hazelnut and googlemaps to the new plugin class, updated plugin...
[myslice.git] / plugins / myplugin / static / js / myplugin.js
index fee1e4b..1801115 100644 (file)
 
     var MyPlugin = Plugin.extend({
 
-        // Constructor
+        /** XXX to check
+         * @brief Plugin constructor
+         * @param options : an associative array of setting values
+         * @param element : 
+         * @return : a jQuery collection of objects on which the plugin is
+         *     applied, which allows to maintain chainability of calls
+         */
         init: function(options, element) {
             // Call the parent constructor, see FAQ when forgotten
             this._super(options, element);
 
+            /* Member variables */
+
+            /* Plugin events */
+
+            /* Setup query and record handlers */
+
             // Explain this will allow query events to be handled
             // What happens when we don't define some events ?
             // Some can be less efficient
             this.listen_query(options.query_uuid);
             this.listen_query(options.query_uuid, 'all');
 
-            // GUI Event binding
+            /* GUI setup and event binding */
             // call function
 
         },
 
+        /* PLUGIN EVENTS */
+        // on_show like in hazelnut
+
+
         /* GUI EVENTS */
 
-        // a function to bind events here
+        // a function to bind events here: click change
         // how to raise manifold events
 
+
         /* GUI MANIPULATION */
 
         // We advise you to write function to change behaviour of the GUI
             //
         },
 
+        /* INTERNAL FUNCTIONS */
+        _dummy: function() {
+            // only convention, not strictly enforced at the moment
+        },
+
     });
 
+    /* Plugin registration */
+    $.plugin('MyPlugin', MyPlugin);
+
     // TODO Here use cases for instanciating plugins in different ways like in the pastie.
 
 })(jQuery);