Index: jqp.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/jqp/jqp.module,v
retrieving revision 1.4
diff -u -p -r1.4 jqp.module
--- jqp.module	19 Apr 2009 10:35:14 -0000	1.4
+++ jqp.module	10 Sep 2010 14:26:36 -0000
@@ -580,3 +580,40 @@ function jqp_jqp() {
   );
   return $js_libraries;
 }
+
+/**
+ * Implementation of hook_context_reactions().
+ */
+function jqp_context_reactions() {
+  $items = array();
+
+  module_load_include('inc', 'jqp', 'jqp.admin');
+  $plugins = jqp_list();
+
+  foreach ($plugins as $key => $object) {
+    $plugins[$key] = $object->name;
+  }
+
+  $items['jqp'] = array(
+    '#title' => t('jQuery plugins'),
+    '#type' => 'checkboxes',
+    '#options' => $plugins,
+    '#description' => t('Loads the selected jQuery plugins when this context is set.'),
+  );
+
+  return $items;
+
+}
+
+/**
+ * Implementation of hook_page_reaction().
+ */
+function jqp_context_page_reaction() {
+
+  $plugins = context_active_values('jqp');
+
+  foreach ($plugins as $plugin) {
+    drupal_add_library($plugin);
+  }
+
+}
