diff client/digitallibrary/jquery/jquery.digilib.js @ 792:52c5595af03e jquery

started to adapt regions plugin to new plugin mechanism
author hertzhaft
date Fri, 18 Feb 2011 23:13:26 +0100
parents 0ce8175f025a
children ac1d6b056a6f
line wrap: on
line diff
--- a/client/digitallibrary/jquery/jquery.digilib.js	Fri Feb 18 20:09:15 2011 +0100
+++ b/client/digitallibrary/jquery/jquery.digilib.js	Fri Feb 18 23:13:26 2011 +0100
@@ -1596,9 +1596,9 @@
             getBorderWidth : getBorderWidth
     };
 
-    // hook plugin into jquery
+    // hook digilib plugin into jquery
     $.fn.digilib = function (action) {
-        // plugin extension mechanism
+        // plugin extension mechanism, called when the plugins' code is read 
         if (action === 'plugin') {
             var plugin = arguments[1];
             // each plugin needs a name
@@ -1615,7 +1615,7 @@
                     plugin.install(plugin);
                 }
             }
-            // initialisation of plugins done later
+            // plugins will be initialised when action.init is called
         } else if (actions[action]) {
             // call action on this with the remaining arguments (inserting data as first argument)
             var $elem = $(this);
@@ -1624,7 +1624,7 @@
             args.unshift(data);
             return actions[action].apply(this, args);
         } else if (typeof action === 'object' || !action) {
-            // call init on this
+            // call init on the digilib jQuery object
             return actions.init.apply(this, arguments);
         } else {
             $.error('action ' + action + ' does not exist on jQuery.digilib');