From f36d3298f0401e4fb1ca131d18d51d3d47e39818 Mon Sep 17 00:00:00 2001 From: Jason Oster Date: Tue, 7 Jul 2009 14:48:28 +0000 Subject: HTML/CSS template rewrites, nice-title integration, XSS fixes, version bump --- README | 22 ++- default_config.php | 4 +- functions/calendar_functions.php | 1 - functions/date_functions.php | 6 +- functions/event.js | 4 +- functions/template.php | 42 ++++- month.php | 8 +- nicetitle/nicetitle.css | 32 ++++ nicetitle/nicetitle.js | 362 +++++++++++++++++++++++++++++++++++++ nicetitle/ntbg.png | Bin 0 -> 914 bytes print.php | 2 +- templates/default/calendar_nav.tpl | 265 ++++++++++++++------------- templates/default/day.tpl | 20 +- templates/default/default.css | 26 ++- templates/default/event.tpl | 4 +- templates/default/footer.tpl | 2 +- templates/default/header.tpl | 4 +- templates/default/month.tpl | 153 +++++++++------- templates/default/month_large.tpl | 4 +- templates/default/month_medium.tpl | 4 +- templates/default/print.tpl | 10 +- templates/default/week.tpl | 12 +- templates/default/year.tpl | 87 +++------ templates/green/calendar_nav.tpl | 151 ---------------- templates/green/day.tpl | 104 ----------- templates/green/default.css | 16 ++ templates/green/header.tpl | 4 +- templates/green/month.tpl | 88 --------- templates/green/month_large.tpl | 42 ----- templates/green/month_medium.tpl | 45 ----- templates/green/sidebar.tpl | 225 ----------------------- templates/green/year.tpl | 140 -------------- templates/grey/calendar_nav.tpl | 151 ---------------- templates/grey/day.tpl | 104 ----------- templates/grey/default.css | 18 ++ templates/grey/header.tpl | 4 +- templates/grey/month.tpl | 88 --------- templates/grey/month_large.tpl | 42 ----- templates/grey/month_medium.tpl | 45 ----- templates/grey/sidebar.tpl | 225 ----------------------- templates/grey/year.tpl | 140 -------------- templates/red/calendar_nav.tpl | 151 ---------------- templates/red/day.tpl | 104 ----------- templates/red/default.css | 18 ++ templates/red/header.tpl | 4 +- templates/red/month.tpl | 88 --------- templates/red/month_large.tpl | 42 ----- templates/red/month_medium.tpl | 45 ----- templates/red/sidebar.tpl | 225 ----------------------- templates/red/sidebar_year.tpl | 196 -------------------- templates/red/year.tpl | 140 -------------- templates/tan/calendar_nav.tpl | 151 ---------------- templates/tan/day.tpl | 104 ----------- templates/tan/default.css | 16 ++ templates/tan/header.tpl | 4 +- templates/tan/month.tpl | 88 --------- templates/tan/month_large.tpl | 42 ----- templates/tan/month_medium.tpl | 45 ----- templates/tan/sidebar.tpl | 225 ----------------------- templates/tan/year.tpl | 140 -------------- year.php | 5 +- 61 files changed, 849 insertions(+), 3690 deletions(-) create mode 100644 nicetitle/nicetitle.css create mode 100644 nicetitle/nicetitle.js create mode 100644 nicetitle/ntbg.png delete mode 100644 templates/green/calendar_nav.tpl delete mode 100644 templates/green/day.tpl delete mode 100644 templates/green/month.tpl delete mode 100644 templates/green/month_large.tpl delete mode 100644 templates/green/month_medium.tpl delete mode 100644 templates/green/sidebar.tpl delete mode 100644 templates/green/year.tpl delete mode 100644 templates/grey/calendar_nav.tpl delete mode 100644 templates/grey/day.tpl delete mode 100644 templates/grey/month.tpl delete mode 100644 templates/grey/month_large.tpl delete mode 100644 templates/grey/month_medium.tpl delete mode 100644 templates/grey/sidebar.tpl delete mode 100644 templates/grey/year.tpl delete mode 100644 templates/red/calendar_nav.tpl delete mode 100644 templates/red/day.tpl delete mode 100644 templates/red/month.tpl delete mode 100644 templates/red/month_large.tpl delete mode 100644 templates/red/month_medium.tpl delete mode 100644 templates/red/sidebar.tpl delete mode 100644 templates/red/sidebar_year.tpl delete mode 100644 templates/red/year.tpl delete mode 100644 templates/tan/calendar_nav.tpl delete mode 100644 templates/tan/day.tpl delete mode 100644 templates/tan/month.tpl delete mode 100644 templates/tan/month_large.tpl delete mode 100644 templates/tan/month_medium.tpl delete mode 100644 templates/tan/sidebar.tpl delete mode 100644 templates/tan/year.tpl diff --git a/README b/README index e9e88cc..b809640 100644 --- a/README +++ b/README @@ -88,14 +88,32 @@ COPYING for more information about our license. Changes: -------- -2.31 Fix events ending at midnight bug in day view +2.4 + Event information displayed with Nice Titles + More ICS input sanitizing + Better display of tabs/line breaks in calendar events + Many updates to included templates; HTML fixes, better CSS support + Webcal caching now works like local calendar caching (with save_parsed_cals enabled) + Updates to Czech and French translations + Fixes for attendee/organizer parsing and email address hyperlinking + Fixes for Print View + Fix setting time format in preferences page + Fix default calendar selections in listbox picker + Fix timezone DST calculation with all-day events + Fix dates before 1970 + Fixed bugs with ALL_CALENDARS_COMBINED and saving parsed calendars (using wrong file name) + Better handling of URLs and email addresses in event descriptions (also strip "blocked" protocols, added by some mail servers) + +2.31 + Fix events ending at midnight bug in day view Fix publish.php for 2.3 config system add option to hide location in month view add option to make individual events downloadable from event view Fix calendar showing modified events twice Make multiline descriptions display with line breaks in event popup Fix German language file -2.3 Major changes to recurrence handling +2.3 + Major changes to recurrence handling Added more languages Added login to month view Consolidated common rss functions diff --git a/default_config.php b/default_config.php index 9aac854..5fa5c1f 100644 --- a/default_config.php +++ b/default_config.php @@ -2,8 +2,8 @@ class Configs{ private static $instance; private function __construct(){ - $this->phpicalendar_version = '2.32alpha'; - // Configuration file for PHP iCalendar 2.32 + $this->phpicalendar_version = '2.4alpha'; + // Configuration file for PHP iCalendar 2.4 // // To set values, change the text between the single quotes // Follow instructions to the right for detailed information diff --git a/functions/calendar_functions.php b/functions/calendar_functions.php index 80bab71..3cd17e4 100644 --- a/functions/calendar_functions.php +++ b/functions/calendar_functions.php @@ -264,7 +264,6 @@ function display_ical_list($cals, $pick=FALSE) { $return .= "\n"; } } else { - $cal_httpPrefix_tmp = str_replace('webcal://', 'http://', $cal_tmp); if ($cal_encoded_tmp == $cal || $cal_encoded_tmp == urldecode($cal)) { $return .= ""; } else { diff --git a/functions/date_functions.php b/functions/date_functions.php index 4751ad2..0aeef60 100644 --- a/functions/date_functions.php +++ b/functions/date_functions.php @@ -234,6 +234,8 @@ function openevent($event_date, $time, $uid, $arr, $lines = 0, $length = 0, $lin $full_event_text = $event_text; $event_text = strip_tags($event_text, ''); } + + if (!empty($link_class)) $link_class = ' class="'.$link_class.'"'; if (!empty($event_text)) { $title = strip_tags(str_replace("
","\n",$title)); @@ -254,10 +256,10 @@ function openevent($event_date, $time, $uid, $arr, $lines = 0, $length = 0, $lin document.popup_data[$popup_data_index] = eventData; // -->"; - $return .= ''; + $return .= ''; $popup_data_index++; } else { - $return .= ''; + $return .= ''; } $return .= $pre_text.$event_text.$post_text.''."\n"; } diff --git a/functions/event.js b/functions/event.js index 9020de9..13aa609 100644 --- a/functions/event.js +++ b/functions/event.js @@ -11,7 +11,7 @@ function openEventWindow(num) { form.elements.event_data.value = data.event_data; // open a new window - var w = window.open('', 'Popup', 'scrollbars=yes,width=460,height=275'); + var w = window.open('', 'Popup', 'scrollbars=yes,width=550,height=350'); form.target = 'Popup'; form.submit(); } @@ -36,7 +36,7 @@ function openTodoInfo(num) { form.elements.todo_data.value = data.todo_data; // open a new window - var w = window.open('', 'Popup', 'scrollbars=yes,width=460,height=275'); + var w = window.open('', 'Popup', 'scrollbars=yes,width=550,height=350'); form.target = 'Popup'; form.submit(); } diff --git a/functions/template.php b/functions/template.php index cc80925..9ce5124 100644 --- a/functions/template.php +++ b/functions/template.php @@ -253,7 +253,7 @@ class Page { }#end draw_search function draw_week($template_p) { - global $phpiCal_config, $start_week_time, $getdate, $cal, $master_array, $dateFormat_week_list, $current_view, $day_array, $timeFormat, $timeFormat_small; + global $phpiCal_config, $start_week_time, $getdate, $cal, $master_array, $dateFormat_week_list, $current_view, $day_array, $timeFormat; // Figure out colspans and initialize weekarray $thisdate = $start_week_time; @@ -306,6 +306,10 @@ class Page { while ($day < $phpiCal_config->week_length){ $colspan = 0; $replace .= $loop_begin; # + + if ($weekarray[$day] == $getdate) $replace = str_replace('{TODAY}', "rowToday", $replace); + $replace = str_replace('{TODAY}', "rowOff", $replace); + if(array_search($weekarray[$day], $allday_uids)){ $uid = array_search($weekarray[$day], $allday_uids); unset($allday_uids[$uid]); @@ -464,9 +468,14 @@ class Page { } else { $class = ''; $dayborder = 0; - } + } + $tclass = $class; + if ($thisday == $getdate) { + if ($tclass) $tclass = ' class="weekborder weektoday"'; + else $tclass = ' class="weektoday"'; + } $drawWidth = 1; - $weekdisplay .= ' '."\n"; + $weekdisplay .= ' '."\n"; } else { # have events $emptyWidth = $nbrGridCols[$thisday]; @@ -478,13 +487,18 @@ class Page { switch ($el["state"]) { case "begin": if ($ended_counter) { - $weekdisplay .= ' '; + $tclass = $class; + if ($thisday == $getdate) { + if ($tclass) $tclass = ' class="weekborder weektoday"'; + else $tclass = ' class="weektoday"'; + } + $weekdisplay .= ' '; $ended_counter = 0; } $event_length[$thisday][$i]["state"] = "started"; $uid = $event_length[$thisday][$i]["key"]; $event_start = $this_time_arr[$uid]['start_unixtime']; - $event_start = date ($timeFormat_small, $event_start); + $event_start = date ($timeFormat, $event_start); $event_calno = $this_time_arr[$uid]['calnumber']; $event_status = strtolower($this_time_arr[$uid]['status']); $event_recur = $this_time_arr[$uid]['recur']; @@ -510,7 +524,12 @@ class Page { break; case "started": if ($ended_counter) { - $weekdisplay .= ' '; + $tclass = $class; + if ($thisday == $getdate) { + if ($tclass) $tclass = ' class="weekborder weektoday"'; + else $tclass = ' class="weektoday"'; + } + $weekdisplay .= ' '; $ended_counter = 0; } break; @@ -528,7 +547,12 @@ class Page { $emptyWidth += $ended_counter; //fill empty space on the right if ($emptyWidth > 0) { - $weekdisplay .= " \n"; + $tclass = $class; + if ($thisday == $getdate) { + if ($tclass) $tclass = ' class="weekborder weektoday"'; + else $tclass = ' class="weektoday"'; + } + $weekdisplay .= " \n"; } while (isset($event_length[$thisday][(sizeof($event_length[$thisday]) - 1)]["state"]) && $event_length[$thisday][(sizeof($event_length[$thisday]) - 1)]["state"] == "ended") { array_pop($event_length[$thisday]); @@ -981,7 +1005,7 @@ class Page { $start2 = date($timeFormat_small, $val['start_unixtime']); if ($type == 'large') { $switch['EVENT'] .= '
'; - $switch['EVENT'] .= openevent($daylink, $cal_time, $uid, $val, $phpiCal_config->month_event_lines, 10, 'ps3', "$start2 ").''; + $switch['EVENT'] .= openevent($daylink, $cal_time, $uid, $val, $phpiCal_config->month_event_lines, 10, 'ps3', "$start2 "); $switch['EVENT'] .= (isset($val['location']) && $val['location'] != '' && $phpiCal_config->month_locations == 'yes') ? "
".$val['location']."
" : ''; $switch['EVENT'] .= '
'; } else { @@ -1033,7 +1057,7 @@ class Page { } function monthbottom() { - global $phpiCal_config, $getdate, $master_array, $this_year, $this_month, $cal, $timeFormat, $timeFormat_small, $dateFormat_week_list, $lang; + global $phpiCal_config, $getdate, $master_array, $this_year, $this_month, $cal, $timeFormat, $dateFormat_week_list, $lang; preg_match("!<\!-- loop showbottomevents_odd on -->(.*)<\!-- loop showbottomevents_odd off -->!Uis", $this->page, $match1); preg_match("!<\!-- loop showbottomevents_even on -->(.*)<\!-- loop showbottomevents_even off -->!Uis", $this->page, $match2); diff --git a/month.php b/month.php index 04516bd..9c2953b 100644 --- a/month.php +++ b/month.php @@ -84,7 +84,9 @@ $page->replace_tags(array( 'rss_available' => '', 'rss_valid' => '', 'show_search' => $phpiCal_config->show_search, + 'next_day' => $tomorrows_date, 'next_month' => $next_month, + 'prev_day' => $yesterdays_date, 'prev_month' => $prev_month, 'show_goto' => '', 'show_user_login' => $show_user_login, @@ -110,6 +112,8 @@ $page->replace_tags(array( 'l_tomorrows' => $lang['l_tomorrows'], 'l_jump' => $lang['l_jump'], 'l_todo' => $lang['l_todo'], + 'l_prev' => $lang['l_prev'], + 'l_next' => $lang['l_next'], 'l_day' => $lang['l_day'], 'l_week' => $lang['l_week'], 'l_month' => $lang['l_month'], @@ -148,10 +152,8 @@ if ($phpiCal_config->this_months_events == 'yes') { } else { $page->nomonthbottom($page); } -$page->draw_subscribe($page); +$page->draw_subscribe($page); $page->output(); - - ?> diff --git a/nicetitle/nicetitle.css b/nicetitle/nicetitle.css new file mode 100644 index 0000000..8c981c5 --- /dev/null +++ b/nicetitle/nicetitle.css @@ -0,0 +1,32 @@ +div.nicetitle { + position: absolute; + padding: 4px; + top: 0px; + left: 0px; + color: white; + font-size: 12px; + font-family: Verdana, Helvetica, Arial, sans-serif; + font-weight: bold; + width: 25em; + background: url(ntbg.png); + + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + text-shadow: black 1px 1px 1px; +} +div.nicetitle p { + margin: 0; + padding: 0 3px; +} +div.nicetitle p.destination { + font-size: 9px; + text-align: left; + padding-top: 3px; +} + +@media print { + div.nicetitle { + display: none; + } +} diff --git a/nicetitle/nicetitle.js b/nicetitle/nicetitle.js new file mode 100644 index 0000000..62e3229 --- /dev/null +++ b/nicetitle/nicetitle.js @@ -0,0 +1,362 @@ +/* + * Based on NiceTitle, by Stuart Langridge + * http://www.kryogenix.org/code/browser/nicetitle/ + */ + +addEvent(window, "load", makeNiceTitles); + + +// Get script self directory +var src = document.getElementById("nicetitle").src.split("/"); +src.pop(); +src = src.join("/"); + +// Pre-load background PNG +(new Image()).src = src + "/ntbg.png"; + +// Start configuration +var SHOW_LINKS = false; // Set to false to disable showing link URLs +var FOLLOW_MOUSE = true; // Set to false to disable title follows mouse + +var MIN_WIDTH = 100; // Min/Max width/height of title +var MAX_WIDTH = 600; +var MIN_HEIGHT = 25; + +var SNAP_LENGTH = 25; // Define the length from the edge of the window to snap to +var MOUSE_OFFSET = 15; // Define the distance to place the title from the mouse +// End configuration + + +var XHTMLNS = "http://www.w3.org/1999/xhtml"; +var CURRENT_NICE_TITLE; +var browser = new Browser(); + +function makeNiceTitles() { + if (!document.createElement || !document.getElementsByTagName) return; + // add namespace methods to HTML DOM; this makes the script work in both + // HTML and XML contexts. + if (!document.createElementNS) { + document.createElementNS = function(ns,elt) { + return document.createElement(elt); + } + } + + if (!document.links) { + document.links = document.getElementsByTagName("a"); + } + for (var ti = 0; ti < document.links.length; ti++) { + var lnk = document.links[ti]; + if (lnk.title) { + lnk.setAttribute("nicetitle", lnk.title); + lnk.removeAttribute("title"); + addEvent(lnk, "mouseover", showNiceTitle); + addEvent(lnk, "mouseover", moveNiceTitle); + addEvent(lnk, "mouseout", hideNiceTitle); + addEvent(lnk, "mousemove", moveNiceTitle); + addEvent(lnk, "mousedown", hideNiceTitle); + /* + * Focus and blur events are not quite right. In Mozilla, titles do not show on keyboard focus. + * This may present an accessibility issue, but it doesn't currently play nice + * with FOLLOW_MOUSE=true, or mousedown events. + */ +// addEvent(lnk, "focus", showNiceTitle); +// addEvent(lnk, "blur", hideNiceTitle); + } + } + var instags = document.getElementsByTagName("ins"); + if (instags) { + for (var ti = 0; ti < instags.length; ti++) { + var instag = instags[ti]; + if (instag.dateTime) { + var strDate = instag.dateTime; + var dtIns = new Date( + strDate.substring(0, 4), + parseInt(strDate.substring(4, 6) - 1), + strDate.substring(6, 8), + strDate.substring(9, 11), + strDate.substring(11, 13), + strDate.substring(13, 15) + ); + instag.setAttribute("nicetitle", "Added on " + dtIns.toString()); + addEvent(instag, "mouseover", showNiceTitle); + addEvent(instag, "mouseover", moveNiceTitle); + addEvent(instag, "mouseout", hideNiceTitle); + addEvent(instag, "mousemove", moveNiceTitle); + addEvent(instag, "mousedown", hideNiceTitle); +// addEvent(instag, "focus", showNiceTitle); +// addEvent(instag, "blur", hideNiceTitle); + } + } + } +} + +function findPosition(oLink) { + if (oLink.offsetParent) { + for (var posX = 0, posY = 0; oLink.offsetParent; oLink = oLink.offsetParent) { + posX += oLink.offsetLeft; + posY += oLink.offsetTop; + } + return [posX, posY]; + } else { + return [oLink.x, oLink.y]; + } +} + +function get_longest(ary) { + var l = 0; + ary.forEach(function(el) { + if (el.length > l) l = el.length; + }); + + return l; +} + +function moveNiceTitle(e) { + if (!CURRENT_NICE_TITLE) return; + var d = CURRENT_NICE_TITLE; + if (window.event && window.event.srcElement) { + var el = window.event.srcElement + } else if (e && e.currentTarget) { + var el = e.currentTarget + } + + // Browser size + var xy = getWindowSize(); + var ww = xy[0]; + var wh = xy[1]; + + // Title width and height + var w = (d.offsetWidth || MIN_WIDTH); + var h = (d.offsetHeight || MIN_HEIGHT); + + if (FOLLOW_MOUSE) { + // Mouse position within document (not window) + var xy = getMousePosition(e); + var mx = xy[0]; + var my = xy[1]; + + // Document scroll position within window + var xy = getScrollPosition(); + var sx = xy[0]; + var sy = xy[1]; + + // Title element position within document + var x = mx + MOUSE_OFFSET; + var y = my + MOUSE_OFFSET; + } + else { + // Document scroll position within window + // Unused + var sx = 0; + var sy = 0; + + // Title element position within document + var elPos = findPosition(el); + var x = elPos[0]; + var y = elPos[1] + el.offsetHeight + MOUSE_OFFSET; + } + + // Find out if we've already snapped + var SNAP_RIGHT = false; + var SNAP_BOTTOM = false; + + // Snap title to the right side of the window + if ((x + w + SNAP_LENGTH) >= (ww + sx)) { + x = ((ww + sx) - w - SNAP_LENGTH); + SNAP_RIGHT = true; + } + + // Snap title to the bottom of the window + if ((y + h + SNAP_LENGTH) >= (wh + sy)) { + y = ((wh + sy) - h - SNAP_LENGTH); + SNAP_BOTTOM = true; + } + + // Ensure mouse can never enter the title in the lower right corner of the window + if (FOLLOW_MOUSE && SNAP_RIGHT && SNAP_BOTTOM) { + y = (my - MOUSE_OFFSET - h); + } + else if (!FOLLOW_MOUSE && SNAP_BOTTOM) { + y = elPos[1] - h - MOUSE_OFFSET; + } + + d.style.left = x + 'px'; + d.style.top = y + 'px'; +} + +function showNiceTitle(e) { + if (CURRENT_NICE_TITLE) hideNiceTitle(CURRENT_NICE_TITLE); + if (!document.getElementsByTagName) return; + if (window.event && window.event.srcElement) { + var lnk = window.event.srcElement + } else if (e && e.currentTarget) { + var lnk = e.currentTarget + } + if (!lnk) return; + if (lnk.nodeName.toUpperCase() != 'A') { + // lnk is not actually the link -- ascend parents until we hit a link + lnk = getParent(lnk,"A"); + } + if (!lnk) return; + var nicetitle = lnk.getAttribute("nicetitle"); + + var d = document.createElementNS(XHTMLNS,"div"); + if (browser.isIE) { + /* + * IE likes to display the element as soon as it is created. + * So let's hide it now and show it after it's been appended to the body + */ + d.style.display = 'none'; + } + d.className = "nicetitle"; + + var nicetitle_parts = nicetitle.split('\n'); + nicetitle_parts.forEach(function(textpart) { + var pat = document.createElementNS(XHTMLNS, "p"); + pat.className = "titletext"; + var tnt = document.createTextNode(textpart); + pat.appendChild(tnt); + var brk = document.createElementNS(XHTMLNS, "br"); + pat.appendChild(brk); + d.appendChild(pat); + }); + + if (lnk.href && SHOW_LINKS) { + var tnd = document.createTextNode(lnk.href); + pad = document.createElementNS(XHTMLNS, "p"); + pad.className = "destination"; + pad.appendChild(tnd); + d.appendChild(pad); + } + + var l = get_longest(nicetitle_parts); + + // Approximate pixel width of longest line in the title + var w = ((lnk.href && SHOW_LINKS) ? lnk.href.length : 0) * 6; + var t = (l ? l : 0) * 8; + + // Use the greatest width: title text, link URL, or MIN_WIDTH. Limited to MAX_WIDTH + w = ((w > MIN_WIDTH) ? w : MIN_WIDTH); + w = ((w > t) ? w : t); + w = ((w > MAX_WIDTH) ? MAX_WIDTH : w); + d.style.width = w + 'px'; + + document.getElementsByTagName("body")[0].appendChild(d); + if (browser.isIE) { + d.style.display = 'block'; + } + + CURRENT_NICE_TITLE = d; + moveNiceTitle(e); +} + +function hideNiceTitle(e) { + if (!document.getElementsByTagName) return; + if (CURRENT_NICE_TITLE) { + document.getElementsByTagName("body")[0].removeChild(CURRENT_NICE_TITLE); + CURRENT_NICE_TITLE = null; + } +} + +// Add an eventListener to browsers that can do it somehow. +// Originally by the amazing Scott Andrew. +function addEvent(obj, evType, fn) { + if (obj.addEventListener) { + obj.addEventListener(evType, fn, false); + return true; + } else if (obj.attachEvent) { + return obj.attachEvent("on"+evType, fn); + } else { + return false; + } +} + +function getParent(el, pTagName) { + if (el == null) return null; + else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase()) // Gecko bug, supposed to be uppercase + return el; + else + return getParent(el.parentNode, pTagName); +} + +function getMousePosition(event) { + if (browser.isIE) { + var x = window.event.clientX + document.documentElement.scrollLeft;// + document.body.scrollLeft; + var y = window.event.clientY + document.documentElement.scrollTop;// + document.body.scrollTop; + } + if (browser.isNS) { + var x = event.clientX + window.scrollX;// window.pageXOffset; + var y = event.clientY + window.scrollY;// window.pageYOffset; + } + return [x,y]; +} + +function getScrollPosition() { + if (browser.isIE) { + var x = document.documentElement.scrollLeft;// + document.body.scrollLeft; + var y = document.documentElement.scrollTop;// + document.body.scrollTop; + } + if (browser.isNS) { + var x = window.scrollX;// window.pageXOffset; + var y = window.scrollY;// window.pageYOffset; + } + return [x,y]; +} + +function getWindowSize() { + if (browser.isIE) { + var x = document.documentElement.clientWidth; + var y = document.documentElement.clientHeight; + } + if (browser.isNS) { + var x = window.innerWidth; + var y = window.innerHeight; + } + return [x,y]; +} + +// Determine browser and version. + +function Browser() { +// blah, browser detect, but mouse-position stuff doesn't work any other way + var ua, s, i; + + this.isIE = false; + this.isNS = false; + this.version = null; + + ua = navigator.userAgent; + + s = "MSIE"; + if ((i = ua.indexOf(s)) >= 0) { + this.isIE = true; + this.version = parseFloat(ua.substr(i + s.length)); + return; + } + + s = "Netscape6/"; + if ((i = ua.indexOf(s)) >= 0) { + this.isNS = true; + this.version = parseFloat(ua.substr(i + s.length)); + return; + } + + // Treat any other "Gecko" browser as NS 6.1. + + s = "Gecko"; + if ((i = ua.indexOf(s)) >= 0) { + this.isNS = true; + this.version = 6.1; + return; + } +} + +// IE does not support the Array.forEach() method... Try to approximate it +if (!Array.prototype.forEach) { + Array.prototype.forEach = function(action, context) { + var len = this.length; + for (var i = 0; i < len; i++) { + if (this[i] != undefined) action(this[i], context); + } + }; +} diff --git a/nicetitle/ntbg.png b/nicetitle/ntbg.png new file mode 100644 index 0000000..2dbe77e Binary files /dev/null and b/nicetitle/ntbg.png differ diff --git a/print.php b/print.php index aee8f39..3a2e36f 100644 --- a/print.php +++ b/print.php @@ -1,5 +1,5 @@ + + - + + + + + + -
- {MONTH_SMALL|-1} + +
+ + + + + + + + + + + + + + + + + + + + + +
{L_LOGIN}
+
+ {L_INVALID_LOGIN} +
+
{L_USERNAME}:
{L_PASSWORD}:
+
+ + + + + + +
+
+ + + + + + + + + +
{L_PREV}{SIDEBAR_DATE}{L_NEXT}
+
+ {L_LEGEND}:
+ {LEGEND} + {L_GOPRINT}
+ + {L_PREFERENCES}
+ + + {L_SUBSCRIBE} | {L_DOWNLOAD}
+ + + {L_LOGOUT} {USERNAME} + +
+
@@ -10,136 +77,82 @@
- + + + + + + + + + + + + - + + + + +
+ + + + - - -
{L_JUMP}
- - - - - - - -
{L_JUMP}
-
-
-
-
-
-
-
- +
+
+ +
+
+
+
+
+ - - - {SEARCH_BOX} - - -
- - - - -
- -
-
{L_PICK_MULTIPLE}:
-
- - -
- -
-
-
- - - - - - -
-
-  - - -
- - - - - - - - - - - - - - - - - - - - - -
{L_LOGIN}
-
- {L_INVALID_LOGIN} -
-
{L_USERNAME}:
{L_PASSWORD}:
-
- - - - - - -
-
- - - - - - - - -
{SIDEBAR_DATE}
-
- {L_LEGEND}:
- {LEGEND} - {L_GOPRINT}
- - {L_PREFERENCES}
- - - {L_SUBSCRIBE} | {L_DOWNLOAD}
- - - {L_LOGOUT} {USERNAME} - -
-
- - - - - - -
+ + + {SEARCH_BOX} + + +
+ + + + +
+ +
+
{L_PICK_MULTIPLE}:
+
+ + +
+ +
+
+ + + + + + +
+
+ {MONTH_SMALL|-1} + + + + + + +
+
{MONTH_SMALL|+1} - +
diff --git a/templates/default/day.tpl b/templates/default/day.tpl index c66d40f..b9cbf10 100644 --- a/templates/default/day.tpl +++ b/templates/default/day.tpl @@ -1,19 +1,19 @@ {HEADER}
-
+
-
- +
+
- +

{DISPLAY_DATE}

{CALENDAR_NAME} {L_CALENDAR}

{DISPLAY_DATE}

{CALENDAR_NAME}