Files
fulpstation/code/_js/menus.dm
spookydonut 4e8ff18b07 Fix Travis grep script to use PCRE to actually match things (#47065)
Several of the greps were missing the `-P` switch which caused them to 
fail to match things. The EOL grep also wasn't working right so I 
replaced it with the one I added to TGMC.
2019-10-19 10:21:05 -07:00

38 lines
1.4 KiB
Plaintext

#define js_dropdowns {"
function dropdowns() {
var divs = document.getElementsByTagName('div');
var headers = new Array();
var links = new Array();
for(var i=0;i<divs.length;i++){
if(divs\[i\].className=='header') {
divs\[i\].className='header closed';
divs\[i\].innerHTML = divs\[i\].innerHTML+' +';
headers.push(divs\[i\]);
}
if(divs\[i\].className=='links') {
divs\[i\].className='links hidden';
links.push(divs\[i\]);
}
}
for(var i=0;i<headers.length;i++){
if(typeof(links\[i\])!== 'undefined' && links\[i\]!=null) {
headers\[i\].onclick = (function(elem) {
return function() {
if(elem.className.search('visible')>=0) {
elem.className = elem.className.replace('visible','hidden');
this.className = this.className.replace('open','closed');
this.innerHTML = this.innerHTML.replace('-','+');
}
else {
elem.className = elem.className.replace('hidden','visible');
this.className = this.className.replace('closed','open');
this.innerHTML = this.innerHTML.replace('+','-');
}
return false;
}
})(links\[i\]);
}
}
}
"}