One tooltips library to rule them all.
authorJan Schneider <jan@horde.org>
Wed, 29 Jul 2009 15:16:44 +0000 (17:16 +0200)
committerJan Schneider <jan@horde.org>
Wed, 29 Jul 2009 16:53:26 +0000 (18:53 +0200)
kronolith/js/src/kronolith.js
kronolith/js/src/views.js
kronolith/lib/Ajax/Imple/Embed.php

index 9b04092..3e5126b 100644 (file)
@@ -931,9 +931,9 @@ KronolithCore = {
                 if (title) {
                     td.writeAttribute('title', title).addClassName('kronolithHasEvents');
                     if (td.readAttribute('nicetitle')) {
-                        ToolTips.detach(td);
+                        Horde_ToolTips.detach(td);
                     }
-                    ToolTips.attach(td);
+                    Horde_ToolTips.attach(td);
                     if (busy) {
                         td.addClassName('kronolithIsBusy');
                     }
index 9ed1b43..e19e2a7 100644 (file)
@@ -72,9 +72,9 @@ function _ShowView()
     if (Object.isFunction(stripeAllElements)) {
         stripeAllElements();
     }
-    if (typeof ToolTips == 'object') {
-        ToolTips.out();
-        ToolTips.attachBehavior();
+    if (!Object.isUndefined(Horde_ToolTips)) {
+        Horde_ToolTips.out();
+        Horde_ToolTips.attachBehavior();
     }
 
     var titleDiv = $('view_title');
index 03b5d85..1f0434e 100644 (file)
@@ -86,7 +86,7 @@ class Kronolith_Ajax_Imple_Embed extends Horde_Ajax_Imple_Base
 
         /* Horde's js */
         $hjs_path = $registry->get('jsuri', 'horde');
-        $hjsurl = Horde::url($hjs_path . '/horde-embed.js', true);
+        $hjsurl = Horde::url($hjs_path . '/tooltips.js', true);
         $pturl = Horde::url($hjs_path . '/prototype.js', true);
 
         /* CSS */
@@ -102,13 +102,14 @@ class Kronolith_Ajax_Imple_Embed extends Horde_Ajax_Imple_Base
         $html = <<<EOT
         //<![CDATA[
         if (typeof kronolith == 'undefined') {
+            if (typeof Prototype == 'undefined') {
+                document.write('<script type="text/javascript" src="$pturl"></script>');
+            }
             if (typeof Horde_ToolTips == 'undefined') {
+                Horde_ToolTips_Autoload = false;
                 document.write('<script type="text/javascript" src="$hjsurl"></script>');
                 document.write('<link type="text/css" rel="stylesheet" href="$hcssurl" />');
             }
-            if (typeof Prototype == 'undefined') {
-                document.write('<script type="text/javascript" src="$pturl"></script>');
-            }
             kronolith = new Object();
             kronolithNodes = new Array();
             document.write('<script type="text/javascript" src="$jsurl"></script>');