* Bubble tooltips were not working properly in some browsers. Removed all JavaScript...
authorArt Cancro <ajc@citadel.org>
Thu, 8 Jul 2010 04:41:12 +0000 (04:41 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 8 Jul 2010 04:41:12 +0000 (04:41 +0000)
webcit/README.txt
webcit/calendar_view.c
webcit/static/BubbleTooltips.js [deleted file]
webcit/static/bt.css [deleted file]
webcit/static/bt.gif [deleted file]
webcit/static/bubble.gif [new file with mode: 0644]
webcit/static/bubble_filler.gif [new file with mode: 0644]
webcit/static/t/head.html
webcit/static/webcit.css

index ba8563e355913a1a2687264e1a9505c0124461e7..a31452402e7188afadb36fa5f5a103d9c589a6ee 100644 (file)
@@ -206,9 +206,7 @@ further customization.
  ----------------
  
  WebCit contains support for calendaring and scheduling.  In order to use it
-you must have libical v0.26 (or newer) on your system.  You must also be
-running a Citadel server with calendaring support.  The calendar service will
-be automatically configured and installed if your host system supports it.
+you must have libical v0.26 (or newer) on your system.
  
  WebCit also provides iCalendar format free/busy data for calendar clients.
 Unlike with some other servers, there is no need for each user to "publish"
index a60697a623d896eac465bd67341a314ce82ac944..5f7de0d9e8d5d61263c432db2cdf956923c2c26f 100644 (file)
@@ -274,14 +274,19 @@ void calendar_month_view_display_events(int year, int month, int day)
                                                );
                                }
 
+
                                wc_printf("<font size=\"-1\">"
                                        "<a class=\"event%s\" href=\"display_edit_event?"
-                                       "msgnum=%ld?calview=month?year=%d?month=%d?day=%d\""
-                                       " btt_tooltext=\"",
+                                       "msgnum=%ld?calview=month?year=%d?month=%d?day=%d\">"
+                                       ,
                                        (Cal->unread)?"_unread":"_read",
                                        Cal->cal_msgnum,
                                        year, month, day
-                                       );
+                               );
+
+                               escputs((char *) icalproperty_get_comment(p));
+
+                               wc_printf("<span class=\"tooltip\"><span class=\"btttop\"></span><span class=\"bttmiddle\">");
 
                                wc_printf("<i>%s: %s</i><br />", _("From"), Cal->from);
                                wc_printf("<i>%s</i> ",          _("Summary:"));
@@ -377,9 +382,7 @@ void calendar_month_view_display_events(int year, int month, int day)
                                        wc_printf("<br />");
                                }
                                
-                               wc_printf("\">");
-                               escputs((char *)
-                                       icalproperty_get_comment(p));
+                               wc_printf("</span><span class=\"bttbottom\"></span></span>");
                                wc_printf("</a></font><br />\n");
                                
                                if (all_day_event) {
@@ -663,21 +666,6 @@ void calendar_month_view(int year, int month, int day) {
        wc_printf("</table>"                    /* end of inner table */
                "</td></tr></table>"            /* end of outer table */
                "</div>\n");
-
-       /*
-        * Initialize the bubble tooltips.
-        *
-        * Yes, this is as stupid as it looks.  Instead of just making the call
-        * to btt_enableTooltips() straight away, we have to create a timer event
-        * and let it initialize as an event after 1 millisecond.  This is to
-        * work around a bug in Internet Explorer that causes it to crash if we
-        * manipulate the innerHTML of various DOM nodes while the page is still
-        * being rendered.  See http://www.shaftek.org/blog/archives/000212.html
-        * for more information.
-        */ 
-       StrBufAppendPrintf(WC->trailing_javascript,
-               " setTimeout(\"btt_enableTooltips('inner_month')\", 1); \n"
-       );
 }
 
 /*
@@ -959,10 +947,13 @@ void calendar_day_view_display_events(time_t thetime,
                                wc_printf("<li class=\"event_framed%s\"> "
                                        "<a href=\"display_edit_event?"
                                        "msgnum=%ld?calview=day?year=%d?month=%d?day=%d\" "
-                                       " class=\"event_title\" "
-                                       " btt_tooltext=\"",
+                                       " class=\"event_title\">"
+                                       ,
                                        (Cal->unread)?"_unread":"_read",
-                                        Cal->cal_msgnum, year, month, day);
+                                        Cal->cal_msgnum, year, month, day
+                               );
+                                escputs((char *) icalproperty_get_comment(p));
+                               wc_printf("<span class=\"tooltip\"><span class=\"btttop\"></span><span class=\"bttmiddle\">");
                                 wc_printf("<i>%s</i><br />",      _("All day event"));
                                wc_printf("<i>%s: %s</i><br />",  _("From"), Cal->from);
                                 wc_printf("<i>%s</i> ",           _("Summary:"));
@@ -990,8 +981,7 @@ void calendar_day_view_display_events(time_t thetime,
                                         escputs((char *)icalproperty_get_comment(q));
                                         wc_printf("<br />");
                                 }
-                                wc_printf("\">");
-                                escputs((char *) icalproperty_get_comment(p));
+                               wc_printf("</span><span class=\"bttbottom\"></span></span>");
                                 wc_printf("</a> <span>(");
                                 wc_printf(_("All day event"));
                                 wc_printf(")</span></li>\n");
@@ -1001,10 +991,13 @@ void calendar_day_view_display_events(time_t thetime,
                                wc_printf("<li class=\"event_framed%s\"> "
                                        "<a href=\"display_edit_event?"
                                        "msgnum=%ld&calview=day?year=%d?month=%d?day=%d\" "
-                                       " class=\"event_title\" 
-                                       "btt_tooltext=\"",
+                                       " class=\"event_title\">
+                                       ,
                                        (Cal->unread)?"_unread":"_read",
-                                       Cal->cal_msgnum, year, month, day);
+                                       Cal->cal_msgnum, year, month, day
+                               );
+                               escputs((char *) icalproperty_get_comment(p));
+                               wc_printf("<span class=\"tooltip\"><span class=\"btttop\"></span><span class=\"bttmiddle\">");
                                 wc_printf("<i>%s</i><br />",     _("Ongoing event"));
                                wc_printf("<i>%s: %s</i><br />", _("From"), Cal->from);
                                 wc_printf("<i>%s</i> ",          _("Summary:"));
@@ -1026,8 +1019,7 @@ void calendar_day_view_display_events(time_t thetime,
                                         escputs((char *)icalproperty_get_comment(q));
                                         wc_printf("<br />");
                                 }
-                                wc_printf("\">");
-                               escputs((char *) icalproperty_get_comment(p));
+                                wc_printf("</span><span class=\"bttbottom\"></span></span>");
                                wc_printf("</a> <span>(");
                                wc_printf(_("Ongoing event"));
                                wc_printf(")</span></li>\n");
@@ -1082,9 +1074,12 @@ void calendar_day_view_display_events(time_t thetime,
                                        );
                                wc_printf("<a href=\"display_edit_event?"
                                        "msgnum=%ld?calview=day?year=%d?month=%d?day=%d?hour=%d\" "
-                                       "class=\"event_title\" "
-                                               "btt_tooltext=\"",
-                                       Cal->cal_msgnum, year, month, day, t.hour);
+                                       "class=\"event_title\">"
+                                       ,
+                                       Cal->cal_msgnum, year, month, day, t.hour
+                               );
+                               escputs((char *) icalproperty_get_comment(p));
+                               wc_printf("<span class=\"tooltip\"><span class=\"btttop\"></span><span class=\"bttmiddle\">");
                                wc_printf("<i>%s: %s</i><br />", _("From"), Cal->from);
                                 wc_printf("<i>%s</i> ",          _("Summary:"));
                                 escputs((char *) icalproperty_get_comment(p));
@@ -1111,9 +1106,7 @@ void calendar_day_view_display_events(time_t thetime,
                                         escputs((char *)icalproperty_get_comment(q));
                                         wc_printf("<br />");
                                 }
-                                wc_printf("\">");
-
-                               escputs((char *) icalproperty_get_comment(p));
+                               wc_printf("</span><span class=\"bttbottom\"></span></span>");
                                wc_printf("</a></dd>\n");
                        }
                }
@@ -1342,10 +1335,6 @@ void calendar_day_view(int year, int month, int day) {
 
        wc_printf("</table>"                    /* end of inner table */
                "</div>");
-
-       StrBufAppendPrintf(WC->trailing_javascript,
-                " setTimeout(\"btt_enableTooltips('inner_day')\", 1);  \n"
-        );
 }
 
 
diff --git a/webcit/static/BubbleTooltips.js b/webcit/static/BubbleTooltips.js
deleted file mode 100644 (file)
index 19ec980..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * JavaScript code to create "bubble tooltips"
- * 
- * Copyright (C) 2006 Alessandro Fulciniti [http://web-graphics.com]
- * Copyright (C) 2006 Art Cancro [http://www.citadel.org]
- *
- * The original version of this module was released into the public
- * domain.  This version is distributed as part of the Citadel system
- * under the terms of the GNU General Public License v3.
- *
- */
-
-function btt_enableTooltips(id)
-{
-       var links, i, h;
-       if (!document.getElementById || !document.getElementsByTagName) {
-               return;
-       }
-       h = document.createElement("span");
-       h.id = "btc";
-       h.setAttribute("id", "btc");
-       h.style.position = "absolute";
-       document.getElementsByTagName("body")[0].appendChild(h);
-       if (id == null) {
-               links = document.getElementsByTagName("a");
-       }
-       else {
-               links = document.getElementById(id).getElementsByTagName("a");
-       }
-       for (i = 0; i < links.length; i++) {
-               btt_Prepare(links[i]);
-       }
-}
-
-function btt_Prepare(el)
-{
-       var tooltip, b, s, l, ih;
-       ih = el.getAttribute("btt_tooltext");
-       if (!ih) {
-               return;
-       }
-       el.removeAttribute("btt_tooltext");
-       el.removeAttribute("title");
-       tooltip = btt_CreateEl("span", "tooltip");
-       s = btt_CreateEl("span", "top");
-       s.appendChild(document.createTextNode(""));
-       s.innerHTML = ih;
-       tooltip.appendChild(s);
-       b = btt_CreateEl("b", "bottom");
-       tooltip.appendChild(b);
-       btt_setOpacity(tooltip);
-       el.tooltip = tooltip;
-       el.onmouseover = btt_showTooltip;
-       el.onmouseout = btt_hideTooltip;
-       el.onmousemove = btt_Locate;
-}
-
-function btt_showTooltip(e)
-{
-       document.getElementById("btc").appendChild(this.tooltip);
-       btt_Locate(e);
-}
-
-function btt_hideTooltip(e)
-{
-       var d = document.getElementById("btc");
-       if (d.childNodes.length > 0) {
-               d.removeChild(d.firstChild);
-       }
-}
-
-function btt_setOpacity(el)
-{
-       el.style.filter = "alpha(opacity:95)";
-       el.style.KHTMLOpacity = "0.95";
-       el.style.MozOpacity = "0.95";
-       el.style.opacity = "0.95";
-}
-
-function btt_CreateEl(t, c)
-{
-       var x = document.createElement(t);
-       x.className = c;
-       x.style.display = "block";
-       return (x);
-}
-
-function btt_Locate(e)
-{
-       var posx = 0, posy = 0;
-       if (e == null) {
-               e = window.event;
-       }
-       if (e.pageX || e.pageY) {
-               posx = e.pageX;
-               posy = e.pageY;
-       }
-       
-       else if (e.clientX || e.clientY) {
-               if (document.documentElement.scrollTop) {
-                       posx =
-                           e.clientX +
-                           document.documentElement.scrollLeft;
-                       posy =
-                           e.clientY + document.documentElement.scrollTop;
-               }
-               
-               else {
-                       posx = e.clientX + document.body.scrollLeft;
-                       posy = e.clientY + document.body.scrollTop;
-               }
-       }
-       document.getElementById("btc").style.top = (posy + 10) + "px";
-       document.getElementById("btc").style.left = (posx - 260) + "px";
-}
diff --git a/webcit/static/bt.css b/webcit/static/bt.css
deleted file mode 100644 (file)
index 74b30a1..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright 2005 - 2009 The Citadel Team
- * Licensed under the GPL V3
- */
-.tooltip {
-       width: 300px;
-       color: #000;
-       font:lighter 11px/1.3 sans-serif;
-       text-decoration: none;
-       text-align: left;
-}
-
-.tooltip span.top {
-       padding: 30px 8px 0;
-       background: url(bt.gif) no-repeat top
-}
-
-.tooltip b.bottom {
-       padding:3px 8px 15px;
-       color: #548912;
-       background: url(bt.gif) no-repeat bottom
-}
diff --git a/webcit/static/bt.gif b/webcit/static/bt.gif
deleted file mode 100644 (file)
index 6670c48..0000000
Binary files a/webcit/static/bt.gif and /dev/null differ
diff --git a/webcit/static/bubble.gif b/webcit/static/bubble.gif
new file mode 100644 (file)
index 0000000..93adba3
Binary files /dev/null and b/webcit/static/bubble.gif differ
diff --git a/webcit/static/bubble_filler.gif b/webcit/static/bubble_filler.gif
new file mode 100644 (file)
index 0000000..49c9a6b
Binary files /dev/null and b/webcit/static/bubble_filler.gif differ
index fbdcbbb7d9f0205d01d727684248aeb72f29f6c5..37caceb1c8fe66cc6c85f63f8b44599fbe8efd96 100644 (file)
@@ -8,7 +8,6 @@
 <link href="static/niftyCorners.css" rel="stylesheet" type="text/css">
 <link href="static/webcit.css" rel="stylesheet" type="text/css">
 <link href="static/datepicker.css" rel="stylesheet" type="text/css">
-<link href="static/bt.css" rel="stylesheet" type="text/css">
 
 <??("COND:LOGGEDIN",1)>
 <link href="do_template?template=iconbar_user" rel="stylesheet" type="text/css">
@@ -20,7 +19,6 @@
 <script type="text/javascript" src="static/prototype.js"></script> 
 <script type="text/javascript" src="static/scriptaculous.js"></script> 
 <script type="text/javascript" src="static/niftycube.js"></script>
-<script type="text/javascript" src="static/BubbleTooltips.js"></script>
 <script type="text/javascript" src="static/datepicker-dev.js"></script>
 <script type="text/javascript" src="static/wcpref.js"></script>
 <script type="text/javascript" src="static/table.js"></script>
index d71112296a02c6c45f305d0594438179bb31c4f9..b3699d78652cc3685564f6bccdcb9f9a013df6e3 100644 (file)
@@ -1735,3 +1735,57 @@ li.event_unread span, a.event_read_title {
 
 .chat_text_class {
 }
+
+/*---------- bubble tooltips start -----------*/
+
+a.event_title, a.event_unread, a.event_read {
+       position:relative;
+       z-index:24;
+}
+
+a.event_title span, a.event_unread span, a.event_read span {
+       display: none;
+}
+
+/* background:; ie hack, something must be changed in a for ie to execute it */
+
+a.event_title:hover, a.event_unread:hover, a.event_read:hover {
+       z-index:25;
+       background:;
+}
+
+a.event_title:hover span.tooltip, a.event_unread:hover span.tooltip, a.event_read:hover span.tooltip {
+       display:block;
+       position:absolute;
+       top:0px; left:0;
+       padding: 15px 0 0 0;
+       width:200px;
+       text-align: center;
+       filter: alpha(opacity:90);
+       KHTMLOpacity: 0.90;
+       MozOpacity: 0.90;
+       opacity: 0.90;
+}
+
+a.event_title:hover span.btttop, a.event_unread:hover span.btttop, a.event_read:hover span.btttop {
+       display: block;
+       padding: 30px 8px 0;
+       background: url(/static/bubble.gif) no-repeat top;
+}
+
+/* different middle bg for stretch */
+a.event_title:hover span.bttmiddle, a.event_unread:hover span.bttmiddle, a.event_read:hover span.bttmiddle {
+       display: block;
+       padding: 0 8px; 
+       background: url(/static/bubble_filler.gif) repeat bottom; 
+       color: #022750;
+       font-size: 10px;
+}
+
+a.event_title:hover span.bttbottom, a.event_unread:hover span.bttbottom, a.event_read:hover span.bttbottom {
+       display: block;
+       padding:3px 8px 10px;
+       background: url(/static/bubble.gif) no-repeat bottom;
+}
+
+/*---------- bubble tooltips end -----------*/