Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 35: | Line 35: | ||
for(var i = 0; i < len; i++) | for(var i = 0; i < len; i++) | ||
{ | { | ||
alert('for: ' + i); | alert('for-i: ' + i); | ||
var thisNavToc = navTocAppend.childNodes[i]; | var thisNavToc = navTocAppend.childNodes[i]; | ||
//not the right way to do this | //not the right way to do this | ||
Line 41: | Line 41: | ||
{ | { | ||
var thisNavTocClone = thisNavToc.cloneNode(true); | var thisNavTocClone = thisNavToc.cloneNode(true); | ||
var len2 = thisNavToc.childNodes.length; | |||
var len2 = | |||
for(var j = 0; j < len2; j++) | for(var j = 0; j < len2; j++) | ||
{ | { | ||
alert('for-j: ' + j); | |||
if( | var thisNavTocChildClone = thisNavToc.childNodes[j].cloneNode(true); | ||
if( | alert('1'); | ||
thisNavToc.removeChild(thisNavTocChildClone); | |||
alert('2'); | |||
navRight.appendChild(thisNavTocChildClone); | |||
alert('3'); | |||
if(thisNavTocChildClone.style.display) {thisNavTocChildClone.style.display = 'block';} | |||
alert('4'); | |||
if(thisNavTocChildClone.visibility) {thisNavTocChildClone.visibility = 'visible';} | |||
alert('5'); | |||
} | } | ||
} | } | ||
thisNavToc.parentNode.removeChild(thisNavToc); | |||
} | } | ||
} | } |
Revision as of 15:00, 19 October 2006
// [[User:Lupin/popups.js]]
document.write('<script type="text/javascript" src="http://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');
simplePopups=false;
popupAdminLinks=true;
popupStructure='menus';
popupFixRedirs=true;
popupFixDabs=true;
popupPreviewFirstParOnly=false;
popupExtraUserMenu=true;
popupUseQueryInterface = false;
function siteArticlePath(){ return 'wiki'; }
function siteBotInterfacePath(){ return 'w'; }
// Appends any #nav_toc_append > .nav_toc to #nav_right
// Moves any existing #nav_toc to #nav_right
function domNavToc()
{
//var errNode = document.createTextNode( "No Sidebar" );
var navRight = document.getElementById( 'nav_right' );
if( !navRight ) {
return 0;
}
// Append all .nav_toc classed elements under #nav_toc_append
var navTocAppend = document.getElementById( 'nav_toc_append' );
if( navTocAppend ) {
// while (node.hasChildNodes())
// {
// node.removeChild(node.firstChild);
// }
var len = navTocAppend.childNodes.length;
for(var i = 0; i < len; i++)
{
alert('for-i: ' + i);
var thisNavToc = navTocAppend.childNodes[i];
//not the right way to do this
if(thisNavToc.className == 'nav_toc')
{
var thisNavTocClone = thisNavToc.cloneNode(true);
var len2 = thisNavToc.childNodes.length;
for(var j = 0; j < len2; j++)
{
alert('for-j: ' + j);
var thisNavTocChildClone = thisNavToc.childNodes[j].cloneNode(true);
alert('1');
thisNavToc.removeChild(thisNavTocChildClone);
alert('2');
navRight.appendChild(thisNavTocChildClone);
alert('3');
if(thisNavTocChildClone.style.display) {thisNavTocChildClone.style.display = 'block';}
alert('4');
if(thisNavTocChildClone.visibility) {thisNavTocChildClone.visibility = 'visible';}
alert('5');
}
}
thisNavToc.parentNode.removeChild(thisNavToc);
}
}
// Append errNode if navToc doesn't exist
var navToc = document.getElementById( 'nav_toc' );
if( !navToc ) {
//navRight.appendChild( errNode );
return 0;
}
alert('navToc = true');
var navToc2 = navToc.cloneNode(true);
navToc.parentNode.removeChild(navToc);
navRight.appendChild( navToc2 );
navToc2.style.display = 'block';
}