[Swift-commit] r4898 - wwwdev

vytas at ci.uchicago.edu vytas at ci.uchicago.edu
Mon Aug 1 09:23:46 CDT 2011


Author: vytas
Date: 2011-08-01 09:23:45 -0500 (Mon, 01 Aug 2011)
New Revision: 4898

Added:
   wwwdev/dhtml.js
Log:
new look & feel

Added: wwwdev/dhtml.js
===================================================================
--- wwwdev/dhtml.js	                        (rev 0)
+++ wwwdev/dhtml.js	2011-08-01 14:23:45 UTC (rev 4898)
@@ -0,0 +1,40 @@
+function initjs() {
+	selectCurrent();
+	//decorateLinks();
+}
+
+function decorateLinks() {
+	for (i in document.links) {
+		link = document.links[i];
+		if (link.className == "menulink") {
+			ld = link.parentNode.innerHTML;
+			index = ld.indexOf(">");
+			link.parentNode.innerHTML = ld.substr(0, index) + 
+				" onMouseOver=\"highlight(" + i + ");\"" +
+				" onMouseOut=\"unhighlight(" + i + ");\"" +
+				ld.substr(index);
+		}
+	}
+}
+
+function highlight(i) {
+	link = document.links[i];
+	link.style.color = "#6060ff";
+}
+
+function unhighlight(i) {
+	link = document.links[i];
+	link.style.color = "#000000";
+}
+
+function selectCurrent() {
+	docname = document.URL;
+	for (i in document.links) {
+		link = document.links[i];
+		if (link.className == "menulink") {
+			if (docname.indexOf(link.href) != -1) {
+				link.className = "selected";
+			}
+		}
+	}
+}




More information about the Swift-commit mailing list