|
From: <mat...@us...> - 2008-01-22 08:59:41
|
Revision: 661
http://webical.svn.sourceforge.net/webical/?rev=661&view=rev
Author: mattijshoitink
Date: 2008-01-22 00:59:14 -0800 (Tue, 22 Jan 2008)
Log Message:
-----------
- javascript file added
- commit specially for sjoerd :)
Modified Paths:
--------------
trunk/webical-war/src/main/webapp/css/style.css
Added Paths:
-----------
trunk/webical-war/src/main/webapp/js/
trunk/webical-war/src/main/webapp/js/scripts.js
Modified: trunk/webical-war/src/main/webapp/css/style.css
===================================================================
--- trunk/webical-war/src/main/webapp/css/style.css 2008-01-17 16:15:49 UTC (rev 660)
+++ trunk/webical-war/src/main/webapp/css/style.css 2008-01-22 08:59:14 UTC (rev 661)
@@ -706,7 +706,6 @@
.dayItemMonth, .todayItemMonth {
height: 12.5em;
- /* height: 18%; */
width: 14.25%;
border: 0px;
border-right: 1px solid #B3B3B3;
Added: trunk/webical-war/src/main/webapp/js/scripts.js
===================================================================
--- trunk/webical-war/src/main/webapp/js/scripts.js (rev 0)
+++ trunk/webical-war/src/main/webapp/js/scripts.js 2008-01-22 08:59:14 UTC (rev 661)
@@ -0,0 +1,70 @@
+function resizeDayInMonthBox() {
+ if (typeof document.body.style.maxHeight != "undefined") { //Not for Internet Explorer 6 and earlier versions
+ if (document.getElementById("monthView")) {
+ var tableCells_arr = document.getElementById("monthView").getElementsByTagName("td");
+ for (i = 0; i < tableCells_arr.length; i++) {
+ tableCells_arr[i].style.height = "auto";
+ }
+ var daysInMonth_arr = getElementsByClassName("eventsInMonth", "div", document);
+ for (j = 0; j < daysInMonth_arr.length; j++) {
+ daysInMonth_arr[j].style.display = "none";
+ }
+ var newHeight = daysInMonth_arr[9].parentNode.offsetHeight;
+ for (j = 0; j < daysInMonth_arr.length; j++) {
+ daysInMonth_arr[j].style.display = "block";
+ daysInMonth_arr[j].style.height = (newHeight - 21) + "px";
+ }
+ }
+ }
+}
+
+function getElementsByClassName(className, tag, elm) {
+ var testClass = new RegExp("(^|\\\\s)" + className + "(\\\\s|$)");
+ var tag = tag || "*";
+ var elm = elm || document;
+ var elements = (tag == "*" && elm.all)? elm.all : elm.getElementsByTagName(tag);
+ var returnElements = [];
+ var current;
+ var length = elements.length;
+ for(var i=0; i<length; i++) {
+ current = elements[i];
+ if(testClass.test(current.className)) {
+ returnElements.push(current);
+ }
+ }
+ return returnElements;
+}
+
+function addLoadEvent(func) {
+ var oldonload = window.onload;
+ if (typeof window.onload != 'function') {
+ window.onload = func;
+ } else {
+ window.onload = function() {
+ if (oldonload) {
+ oldonload();
+ }
+ func();
+ }
+ }
+}
+
+function addResizeEvent(func) {
+ var oldonresize = window.onresize;
+ if (typeof window.onresize != 'function') {
+ window.onresize = func;
+ } else {
+ window.onresize = function() {
+ if (onresize) {
+ onresize();
+ }
+ func();
+ }
+ }
+}
+
+addLoadEvent(resizeDayInMonthBox);
+addResizeEvent(resizeDayInMonthBox);
+addLoadEvent(function() {
+ /* more code to run on page load */
+});
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|