From 13473e686921141b9334a90ab17f8d452ea95a74 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Thu, 8 Jul 2010 04:41:12 +0000 Subject: [PATCH] * Bubble tooltips were not working properly in some browsers. Removed all JavaScript and replaced with one driven purely by CSS. --- webcit/README.txt | 4 +- webcit/calendar_view.c | 71 +++++++++----------- webcit/static/BubbleTooltips.js | 115 -------------------------------- webcit/static/bt.css | 22 ------ webcit/static/bt.gif | Bin 2131 -> 0 bytes webcit/static/bubble.gif | Bin 0 -> 1535 bytes webcit/static/bubble_filler.gif | Bin 0 -> 71 bytes webcit/static/t/head.html | 2 - webcit/static/webcit.css | 54 +++++++++++++++ 9 files changed, 85 insertions(+), 183 deletions(-) delete mode 100644 webcit/static/BubbleTooltips.js delete mode 100644 webcit/static/bt.css delete mode 100644 webcit/static/bt.gif create mode 100644 webcit/static/bubble.gif create mode 100644 webcit/static/bubble_filler.gif diff --git a/webcit/README.txt b/webcit/README.txt index ba8563e35..a31452402 100644 --- a/webcit/README.txt +++ b/webcit/README.txt @@ -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" diff --git a/webcit/calendar_view.c b/webcit/calendar_view.c index a60697a62..5f7de0d9e 100644 --- a/webcit/calendar_view.c +++ b/webcit/calendar_view.c @@ -274,14 +274,19 @@ void calendar_month_view_display_events(int year, int month, int day) ); } + wc_printf("" "" + , (Cal->unread)?"_unread":"_read", Cal->cal_msgnum, year, month, day - ); + ); + + escputs((char *) icalproperty_get_comment(p)); + + wc_printf(""); wc_printf("%s: %s
", _("From"), Cal->from); wc_printf("%s ", _("Summary:")); @@ -377,9 +382,7 @@ void calendar_month_view_display_events(int year, int month, int day) wc_printf("
"); } - wc_printf("\">"); - escputs((char *) - icalproperty_get_comment(p)); + wc_printf("
"); wc_printf("

\n"); if (all_day_event) { @@ -663,21 +666,6 @@ void calendar_month_view(int year, int month, int day) { wc_printf("" /* end of inner table */ "" /* end of outer table */ "\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("
  • " "" + , (Cal->unread)?"_unread":"_read", - Cal->cal_msgnum, year, month, day); + Cal->cal_msgnum, year, month, day + ); + escputs((char *) icalproperty_get_comment(p)); + wc_printf(""); wc_printf("%s
    ", _("All day event")); wc_printf("%s: %s
    ", _("From"), Cal->from); wc_printf("%s ", _("Summary:")); @@ -990,8 +981,7 @@ void calendar_day_view_display_events(time_t thetime, escputs((char *)icalproperty_get_comment(q)); wc_printf("
    "); } - wc_printf("\">"); - escputs((char *) icalproperty_get_comment(p)); + wc_printf("
    "); wc_printf("
    ("); wc_printf(_("All day event")); wc_printf(")
  • \n"); @@ -1001,10 +991,13 @@ void calendar_day_view_display_events(time_t thetime, wc_printf("
  • " "" + , (Cal->unread)?"_unread":"_read", - Cal->cal_msgnum, year, month, day); + Cal->cal_msgnum, year, month, day + ); + escputs((char *) icalproperty_get_comment(p)); + wc_printf(""); wc_printf("%s
    ", _("Ongoing event")); wc_printf("%s: %s
    ", _("From"), Cal->from); wc_printf("%s ", _("Summary:")); @@ -1026,8 +1019,7 @@ void calendar_day_view_display_events(time_t thetime, escputs((char *)icalproperty_get_comment(q)); wc_printf("
    "); } - wc_printf("\">"); - escputs((char *) icalproperty_get_comment(p)); + wc_printf("
    "); wc_printf("
    ("); wc_printf(_("Ongoing event")); wc_printf(")
  • \n"); @@ -1082,9 +1074,12 @@ void calendar_day_view_display_events(time_t thetime, ); wc_printf("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(""); wc_printf("%s: %s
    ", _("From"), Cal->from); wc_printf("%s ", _("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("
    "); } - wc_printf("\">"); - - escputs((char *) icalproperty_get_comment(p)); + wc_printf("
    "); wc_printf("
    \n"); } } @@ -1342,10 +1335,6 @@ void calendar_day_view(int year, int month, int day) { wc_printf("" /* end of inner table */ ""); - - 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 index 19ec98023..000000000 --- a/webcit/static/BubbleTooltips.js +++ /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 index 74b30a19a..000000000 --- a/webcit/static/bt.css +++ /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 index 6670c482f08a9b2c1aebc717711dd738cad90043..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2131 zcmV-Z2(0%Nt=J1N0#N+Apj-bZq?DXvL`0(@j_xSsgq{zU_ z)EsLQUr+0xqSv%uM^x!171+R4)8%GBt`(Btj!_P@#C+~V%3x7Ppv|NsC0 z|NsC0|NsC0|NsC0A^8LW0018VEC2ui04xD40RRR5;3tk`X`X1Ru59bRa4gSsZQppV z?|kq7z@TtQEE-F{{2X_Jx@bdl(gYF4bXUC0#T>)JA0|1b~z=zN< zNE1L|*TR2TAZiRY0oR~N@UC41DB#Zl1q}W;F0PICJXU$#c-f zpROKd;YrkGgA59`sW>3PO{bzzqe`7hwW?K?tQ7wACy30Tt2qTksDxsIn+6anJV?m4 zt=qS7sKm`e@Je^R$q=ABJg8ORT z%(=7Y&!G330}NOz>C>o5^8%ni=mkw!-YpDGySDAyxId>Zy}S2mbE6gddVnvswS==x z`(Dnxx%21Hqf4Joy?SqCun3HbAb^_kc-F&V6QNG7Rd zi>@4*;*wBCDW!E}5HRJHSZ2wbliz9S<(E@B3Feq&MtS64Wu~d-jbg6p=9?_G3Fn-2 zUMOdsc;;E%oqG1^=W=}hDd?a-1xo0lgBptHqIxRI=%aHw3hAV3N=oUaU|NdlrdVpq z>8DV73hJmtic0FKIhu;Z>Zc3hS&O%1Z04=h=$uuHxy+>#x)K3hc1X2}|s; zy%~$_vZN`??6V6w3+=Sh{!aUBwbm|+ZMMg5%k8k`YQwnn6H4aX=i-sQ_C)bLXnRw$QJ`TBvl22YM z_fs%yL7hS4qfiL7dw0J zIPwlWpuZ1ac=5&~j(qZq_szVN!asjn^wI-Hef5Pdk9~;OZ|_g{-m?OJ_~UzD{`Ti% zpMLf0OW*$U?=v5N^79*C|M2$%pMUTB>)!wE|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(RILrE+@er=ha8Du=0>Ix3g3F8XSQwL*F;tgVV^siM95ngN};3c9O= z#U6UBg~{T%EQrAhOKh~9J-cB4vwd0%Ewz|wdmy&X&YC5-YkDgnxo?{LEw|l@`y{(; zx*H|BWUBigy=K}QAiiAcn;*Yn`l}znRtoGM!C4w?AHqy3d>_2+{(33IgE=f7!%H3DgO zb~f2sA5C@JoV~3h-EOaqH)eLKRGo^Q`>)UzV+pI zUyAqLtM8Nh4A_zZ1nt*v|NZ#qumAr1_wWDz01Ti2`*)g;U}1m=OrQc6$iN0VuztaC z0B&?cfC^ghf*8!81~XiTFT*T}{;y77&0jH4Xc*nnW<<^=Uf#RC)|MgRoBkAVE6 zAOlIrK^n4fU_sqy%4ExazcLD - @@ -20,7 +19,6 @@ - diff --git a/webcit/static/webcit.css b/webcit/static/webcit.css index d71112296..b3699d786 100644 --- a/webcit/static/webcit.css +++ b/webcit/static/webcit.css @@ -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 -----------*/ -- 2.30.2