User: andreas
Date: 00/11/13 22:10:00
Added: developers general.scripts.js main.css
Log:
I extracted the JavaScript from the menu.html page
and put it into the general.scripts.js file and also the
CSS definitions into the main.css file.
Both files can now be loaded either through the <link>
tag or the <script> tag.
Revision Changes Path
1.1 newsite/developers/general.scripts.js
Index: general.scripts.js
===================================================================
//
// Bunch of JavaScript functions used in the new website
// of jBoss.
//
//
// List the evaluation of all the properties of the
// given object. It will show an alert box for each evaluation.
//
// @param obj Object where its properties should
// be displayed. It must not be null.
//
function list(obj) {
for (var i in obj) alert(i + " = " + eval("obj."+i));
}
//
// List the value of all the properties of the
// given object. It will show an alert box for each value.
//
// @param obj Object where its properties should
// be displayed. It must not be null.
//
function enumerate(obj) {
for (var i in obj) alert(i + " = " + obj[i]);
}
//
// Looks up the image to a given link and when found it
// set the source of the image to a new, given value
//
// @element Link which wraps the image to be set.
// If not found then nothing happens.
// @src New source to be set which has to point
// an image.
function setSrc(element, src) {
var i = 0;
var done = false;
while (!done && i < document.links.length) {
if (document.links[i] == element) {
document.images[i+firstImage-firstLink].src = src;
}
i++;
}
}
//
// Set the source of the given element to "filled" image
//
// @element Image element to which the source
// has to be set. The element must be
// an image and must not be null.
//
function over(element) {
setSrc(element,"dot_filled.gif");
}
//
// Set the source of the given element to "empty" image
//
// @element Image element to which the source
// has to be set. The element must be
// an image and must not be null.
//
function out(element) {
setSrc(element,"dot_empty.gif");
}
var firstImage = 0;
var firstLink = 0;
function init() {
var i = 0;
while (firstImage == 0 && i < document.images.length) {
if (document.images[i].src.indexOf("dot") > 0) {
firstImage = i;
}
i++;
}
i = 0;
while (firstLink == 0 && i < document.links.length) {
if (document.links[i].offsetLeft < 100) {
firstLink = i;
}
if (document.links[i].x < 100) {
firstLink = i;
}
i++;
}
}
1.1 newsite/developers/main.css
Index: main.css
===================================================================
/* Style Sheet document for the new jBoss website */
a.menu { color: black; text-decoration: none }
body { background-color: gray; margin: 0 }
td { font-size: 8pt; font-family: Verdana, Arial, helvetica, sans-serif }
td.black { background-color: #000000 }
td.dark { background-color: #276561 }
td.light { background-color: #307d77 }
td.marginbody { background-color: #edefed }
td.marginheader { font-weight: bold; background-color: #e2b73c }
td.menuheader { color: black; font-weight: bold; background-color: #e2b73c }
td.menuitem { background-color: #307d77 }
td.newsbody { background-color: #edefed }
td.newsheader { color: white; background-color: #2c746e }
td.pageheader { color: #000000; font-weight: bold; font-size: 14pt;
background-color: #e2b73c }
td.yellow { background-color: #f4c641 }