Index: hint.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/hint/hint.module,v
retrieving revision 1.4
diff -u -r1.4 hint.module
--- hint.module	20 Dec 2009 02:05:12 -0000	1.4
+++ hint.module	5 Mar 2010 18:45:15 -0000
@@ -25,10 +25,15 @@
 }
 
 /**
- * Implementation of hook_init().
+ * Implements hook_library().
  */
-function hint_init() {
-  drupal_add_js(drupal_get_path('module', 'hint') . '/hint.js');
+function hint_library() {
+  $libraries['hint'] = array(
+    'js' => array(
+      drupal_get_path('module', 'hint') . '/hint.js' => array(),
+    ),
+  );
+  return $libraries;
 }
 
 /**
@@ -46,12 +51,13 @@
 /**
  * Pre-render function to read #hint properties.
  */
-function hint_pre_render($element) {
+function hint_pre_render(&$element) {
 
   if (isset($element['#hint'])) {
     $class = 'hint-enabled';
     $element['#attributes']['title'] = $element['#hint'];
     $element['#attributes']['class'][] = $class;
+    $element['#attached']['library'][] = array('hint', 'hint');
   }
   if (isset($element['#hint_remove_title']) && $element['#hint_remove_title']) {
     unset($element['#title']);
