checht 2005/06/03 19:11:03 CEST
Added files:
MaquetteHTML/Internet/js keepieapart.js mktree.js mktree2.js
navcontent.js
Log:
no message
Revision Changes Path
1.1 +21 -0 minefi_templates/MaquetteHTML/Internet/js/keepieapart.js
(new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/minefi_templates/MaquetteHTML/Internet/js/keepieapart.js?rev=1.1&content-type=text/plain
1.1 +178 -0 minefi_templates/MaquetteHTML/Internet/js/mktree.js (new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/minefi_templates/MaquetteHTML/Internet/js/mktree.js?rev=1.1&content-type=text/plain
1.1 +179 -0 minefi_templates/MaquetteHTML/Internet/js/mktree2.js
(new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/minefi_templates/MaquetteHTML/Internet/js/mktree2.js?rev=1.1&content-type=text/plain
1.1 +170 -0 minefi_templates/MaquetteHTML/Internet/js/navcontent.js
(new)
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/minefi_templates/MaquetteHTML/Internet/js/navcontent.js?rev=1.1&content-type=text/plain
Index: keepieapart.js
====================================================================
if (document.all)
{
var detect = navigator.userAgent.toLowerCase();
var browser,thestring;
var version = 0;
if (checkIt('msie'))
{
browser = "IE "
browser += detect.substr(place + thestring.length,3);
document.title = browser + ' - ' + document.title;
}
}
function checkIt(string)
{
place = detect.indexOf(string) + 1;
thestring = string;
return place;
}
Index: mktree.js
====================================================================
// ===================================================================
// Author: Matt Kruse <[EMAIL PROTECTED]>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download.
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
// ===================================================================
/*
This code is inspired by and extended from Stuart Langridge's aqlist code:
http://www.kryogenix.org/code/browser/aqlists/
Stuart Langridge, November 2002
[EMAIL PROTECTED]
Inspired by Aaron's labels.js
(http://youngpup.net/demos/labels/)
and Dave Lindquist's menuDropDown.js
(http://www.gazingus.org/dhtml/?id=109)
*/
/*
Auto-close parameter added by Fran�ois BACCONNET (www.tchoa.com)
fonctionality : only one top level branch can be open at one time
*/
var AUTOCLOSE=1; // 1:yes | 0:no
// Automatically attach a listener to the window onload, to convert the trees
addEvent(window,"load",convertTrees);
// Utility function to add an event listener
function addEvent(o,e,f){
if (o.addEventListener){ o.addEventListener(e,f,true); return true; }
else if (o.attachEvent){ return o.attachEvent("on"+e,f); }
else { return false; }
}
// utility function to set a global variable if it is not already set
function setDefault(name,val) {
if (typeof(window[name])=="undefined" || window[name]==null) {
window[name]=val;
}
}
// Full expands a tree with a given ID
function expandTree(treeId) {
var ul = document.getElementById(treeId);
if (ul == null) { return false; }
expandCollapseList(ul,nodeOpenClass);
}
// Fully collapses a tree with a given ID
function collapseTree(treeId) {
var ul = document.getElementById(treeId);
if (ul == null) { return false; }
expandCollapseList(ul,nodeClosedClass);
}
// Expands enough nodes to expose an LI with a given ID
function expandToItem(treeId,itemId) {
var ul = document.getElementById(treeId);
if (ul == null) { return false; }
var ret = expandCollapseList(ul,nodeOpenClass,itemId);
if (ret) {
var o = document.getElementById(itemId);
if (o.scrollIntoView) {
o.scrollIntoView(false);
}
}
}
// Performs 3 functions:
// a) Expand all nodes
// b) Collapse all nodes
// c) Expand all nodes to reach a certain ID
function expandCollapseList(ul,cName,itemId) {
if (!ul.childNodes || ul.childNodes.length==0) { return false; }
// Iterate LIs
for (var itemi=0;itemi<ul.childNodes.length;itemi++) {
var item = ul.childNodes[itemi];
if (itemId!=null && item.id==itemId) { return true; }
if (item.nodeName == "LI") {
// Iterate things in this LI
var subLists = false;
for (var
sitemi=0;sitemi<item.childNodes.length;sitemi++) {
var sitem = item.childNodes[sitemi];
if (sitem.nodeName=="UL") {
subLists = true;
var ret =
expandCollapseList(sitem,cName,itemId);
if (itemId!=null && ret) {
item.className=cName;
return true;
}
}
}
if (subLists && itemId==null) {
item.className = cName;
}
}
}
}
// Search the document for UL elements with the correct CLASS name, then
process them
function convertTrees() {
setDefault("treeClass","mktree");
setDefault("nodeClosedClass","liClosed");
setDefault("nodeOpenClass","liOpen");
setDefault("nodeBulletClass","liBullet");
setDefault("nodeLinkClass","bullet");
if (!document.createElement) { return; } // Without createElement, we
can't do anything
uls = document.getElementsByTagName("ul");
for (var uli=0;uli<uls.length;uli++) {
var ul=uls[uli];
if (ul.nodeName=="UL" && ul.className==treeClass) {
processList(ul);
}
}
afterload();
}
// Process a UL tag and all its children, to convert to a tree
function processList(ul) {
if (!ul.childNodes || ul.childNodes.length==0) { alert("No
child");return; }
// Iterate LIs
for (var itemi=0;itemi<ul.childNodes.length;itemi++) {
var item = ul.childNodes[itemi];
if (item.nodeName == "LI") {
// Iterate things in this LI
var subLists = false;
for (var
sitemi=0;sitemi<item.childNodes.length;sitemi++) {
var sitem = item.childNodes[sitemi];
if (sitem.nodeName=="UL") {
subLists = true;
processList(sitem);
}
}
var s= document.createElement("SPAN");
var t= '\u00A0'; //
s.className = nodeLinkClass;
if (subLists) {
// This LI has UL's in it, so it's a +/- node
item.className = nodeClosedClass;
// If it's just text, make the text work as the
link also
if (item.firstChild.nodeName=="#text") {
t = t+item.firstChild.nodeValue;
item.removeChild(item.firstChild);
}
s.onclick = function () {
if
(this.parentNode.className==nodeOpenClass)
this.parentNode.className
=nodeClosedClass;
else {
// this is where autoclose
works : condition means "if the parent of the node we're opening is the UL
classed mktree" or "is it a top level node ?" ; if yes, close all, then open
that node
//alert(this.parentNode.parentNode.className);
if
(this.parentNode.parentNode.className==treeClass && AUTOCLOSE)
collapseTree("mytree");
this.parentNode.className
=nodeOpenClass;
}
return false;
}
}
else {
// No sublists, so it's just a bullet node
item.className = nodeBulletClass;
s.onclick = function () { return false; }
}
s.appendChild(document.createTextNode(t));
item.insertBefore(s,item.firstChild);
}
}
}
Index: mktree2.js
====================================================================
// ===================================================================
// Author: Matt Kruse <[EMAIL PROTECTED]>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download.
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
// ===================================================================
/*
This code is inspired by and extended from Stuart Langridge's aqlist code:
http://www.kryogenix.org/code/browser/aqlists/
Stuart Langridge, November 2002
[EMAIL PROTECTED]
Inspired by Aaron's labels.js
(http://youngpup.net/demos/labels/)
and Dave Lindquist's menuDropDown.js
(http://www.gazingus.org/dhtml/?id=109)
*/
/*
Auto-close parameter added by Fran�ois BACCONNET (www.tchoa.com)
fonctionality : only one top level branch can be open at one time
*/
var AUTOCLOSE=1; // 1:yes | 0:no
// Automatically attach a listener to the window onload, to convert the trees
addEvent(window,"load",convertTrees2);
// Utility function to add an event listener
function addEvent(o,e,f){
if (o.addEventListener){ o.addEventListener(e,f,true); return true; }
else if (o.attachEvent){ return o.attachEvent("on"+e,f); }
else { return false; }
}
// utility function to set a global variable if it is not already set
function setDefault(name,val) {
if (typeof(window[name])=="undefined" || window[name]==null) {
window[name]=val;
}
}
// Full expands a tree with a given ID
function expandTree(treeId) {
var ul = document.getElementById(treeId);
if (ul == null) { return false; }
expandCollapseList(ul,nodeOpenClass);
}
// Fully collapses a tree with a given ID
function collapseTree(treeId) {
var ul = document.getElementById(treeId);
if (ul == null) { return false; }
expandCollapseList(ul,nodeClosedClass);
}
// Expands enough nodes to expose an LI with a given ID
function expandToItem(treeId,itemId) {
var ul = document.getElementById(treeId);
if (ul == null) { return false; }
var ret = expandCollapseList(ul,nodeOpenClass,itemId);
if (ret) {
var o = document.getElementById(itemId);
if (o.scrollIntoView) {
o.scrollIntoView(false);
}
}
}
// Performs 3 functions:
// a) Expand all nodes
// b) Collapse all nodes
// c) Expand all nodes to reach a certain ID
function expandCollapseList(ul,cName,itemId) {
if (!ul.childNodes || ul.childNodes.length==0) { return false; }
// Iterate LIs
for (var itemi=0;itemi<ul.childNodes.length;itemi++) {
var item = ul.childNodes[itemi];
if (itemId!=null && item.id==itemId) { return true; }
if (item.nodeName == "LI") {
// Iterate things in this LI
var subLists = false;
for (var
sitemi=0;sitemi<item.childNodes.length;sitemi++) {
var sitem = item.childNodes[sitemi];
if (sitem.nodeName=="UL") {
subLists = true;
var ret =
expandCollapseList(sitem,cName,itemId);
if (itemId!=null && ret) {
item.className=cName;
return true;
}
}
}
if (subLists && itemId==null) {
item.className = cName;
}
}
}
}
// Search the document for UL elements with the correct CLASS name, then
process them
function convertTrees2() {
setDefault("treeClass2","mktree2");
setDefault("nodeClosedClass","liClosed");
setDefault("nodeOpenClass","liOpen");
setDefault("nodeBulletClass","liBullet");
setDefault("nodeLinkClass","bullet");
if (!document.createElement) { return; } // Without createElement, we
can't do anything
uls = document.getElementsByTagName("ul");
for (var uli=0;uli<uls.length;uli++) {
var ul=uls[uli];
if (ul.nodeName=="UL" && ul.className==treeClass2) {
processList2(ul);
}
}
//alert("convertTrees2 done !!!");
}
// Process a UL tag and all its children, to convert to a tree
function processList2(ul) {
if (!ul.childNodes || ul.childNodes.length==0) { alert("No
child");return; }
// Iterate LIs
for (var itemi=0;itemi<ul.childNodes.length;itemi++) {
var item = ul.childNodes[itemi];
if (item.nodeName == "LI") {
// Iterate things in this LI
var subLists = false;
for (var
sitemi=0;sitemi<item.childNodes.length;sitemi++) {
var sitem = item.childNodes[sitemi];
if (sitem.nodeName=="UL") {
subLists = true;
processList(sitem);
}
}
var s= document.createElement("SPAN");
var t= '\u00A0'; //
s.className = nodeLinkClass;
if (subLists) {
// This LI has UL's in it, so it's a +/- node
item.className = nodeClosedClass;
// If it's just text, make the text work as the
link also
if (item.firstChild.nodeName=="#text") {
t = t+item.firstChild.nodeValue;
item.removeChild(item.firstChild);
}
s.onclick = function () {
if
(this.parentNode.className==nodeOpenClass)
this.parentNode.className
=nodeClosedClass;
else {
// this is where autoclose
works : condition means "if the parent of the node we're opening is the UL
classed mktree" or "is it a top level node ?" ; if yes, close all, then open
that node
/*alert(this.parentNode.parentNode.className);*/
//alert("mktre2 onclick");
if
(this.parentNode.parentNode.className=="mktree2" && AUTOCLOSE)
collapseTree("mytree2");
this.parentNode.className
=nodeOpenClass;
}
return false;
}
}
else {
// No sublists, so it's just a bullet node
item.className = nodeBulletClass;
s.onclick = function () { return false; }
}
s.appendChild(document.createTextNode(t));
item.insertBefore(s,item.firstChild);
}
}
}
Index: navcontent.js
====================================================================
var timesover=0;
var timerID = null;
var boolTimerOn = false;
var intTimecount = 450;
var intRunCount = 0;
var intTabActive = 999;
var NumMainMenus = 4;
var MainMenuTabs = new Array();
MainMenuTabs[0] = "solutions";
MainMenuTabs[1] = "products";
MainMenuTabs[2] = "services";
MainMenuTabs[3] = "customers";
var NumSubMenus = 1;
var SubMenuTabs = new Array();
SubMenuTabs[0] = "resources";
function doInitializeMenu() {
for (i=0; i<NumMainMenus; i++)
{
if(document.getElementById("menuItem-" +
MainMenuTabs[i]).className=="mainMenuItem active")
intTabActive = i;
}
}
function HideMenus(){
if (!document.layers)
{
intRunCount++;
SubMenuOff();
for (i=0; i<NumMainMenus; i++)
{
document.getElementById("submenu-" + MainMenuTabs[i]).style.display = "none";
if (document.getElementById("menuitem-" +
MainMenuTabs[i]).className=="mainmenuitem active")
{
document.getElementById("menuitem-" +
MainMenuTabs[i]).className="mainmenuitem active";
}
else
{
document.getElementById("menuitem-" +
MainMenuTabs[i]).className="mainmenuitem inactive";
}
}
}
}
function MainMenuOn(id) {
if (!document.layers)
{
SubMenuOff();
HideMenus();
if (document.getElementById("menuitem-" + id).className!="mainmenuitem
active")
{
document.getElementById("menuitem-" + id).className = "mainmenuitem hover";
if(document.getElementById("submenu-" + id))
{
document.getElementById("submenu-" + id).style.display = "block";
}
}
if (document.getElementById("menuitem-" + id).className=="mainmenuitem
active" && intRunCount>1)
{
intRunCount++;
document.getElementById("menuitem-" + id).className = "mainmenuitem active";
document.getElementById("submenu-" + id).style.display = "block";
}
//alert(timesrun);
}
}
function SubMenuOn(id) {
if (!document.layers)
{
//SubMenuOff();
if(document.getElementById("submenu2-" + id))
{
if (id=="gomezpro")
{
}
else
{
document.getElementById("submenuitem-" + id).className="submenuitem
subactive";
document.getElementById("submenu2-" + id).style.display = "block";
}
}
for (i=0; i<NumSubMenus; i++)
{
if (SubMenuTabs[i]==id)
{
}
else
{
document.getElementById("submenuitem-" +
SubMenuTabs[i]).className="submenuitem inactive";
document.getElementById("submenu2-" + SubMenuTabs[i]).style.display = "none";
}
}
}
}
function SubMenuOff() {
if (!document.layers)
{
for (i=0; i<NumSubMenus; i++)
{
document.getElementById("submenuitem-" +
SubMenuTabs[i]).className="submenuitem inactive";
document.getElementById("submenu2-" + SubMenuTabs[i]).style.display = "none";
}
}
}
function doMenuOff(id) {
for (i=0; i<NumMainMenus; i++)
{
if(document.getElementById("menuitem-" +
MainMenuTabs[i]).className=="mainmenuitem active")
timesover=1;
}
/*start the timer */
//toto()
//doHideAll();
//setTimeout( "doHideAll()" , intTimecount);
doStartTime();
}
function doSubMenuOn(){
/* stop the timer */
doStopTime();
}
function doSubMenuOff(){
/* start the timer */
doStartTime();
}
function doHideAll(){
for (i=0; i<NumMainMenus; i++)
{
/* if statement to check if the submenu exists before we try to
hide it */
if(document.getElementById("submenu-" + MainMenuTabs[i]))
document.getElementById("submenu-" +
MainMenuTabs[i]).style.display = "none"; /* hide the submenu */
/*set all tabs to the inactive style */
document.getElementById("menuitem-" +
MainMenuTabs[i]).className="mainmenuitem inactive";
}
/*set the active tab to the active style*/
if (intTabActive < 999)
{
document.getElementById("menuitem-" +
MainMenuTabs[intTabActive]).className="mainmenuitem active";
}
}
function doStopTime(){
if (boolTimerOn){
clearTimeout(timerID);
timerID = null;
boolTimerOn = false;
}
}
function doStartTime(){
if (boolTimerOn == false) {
timerID=setTimeout( "doHideAll()" , intTimecount);
boolTimerOn = true;
}
}