File: tutorial.js

package info (click to toggle)
augustus 3.3.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 486,188 kB
  • sloc: cpp: 51,969; perl: 20,926; ansic: 1,251; makefile: 935; python: 120; sh: 118
file content (37 lines) | stat: -rw-r--r-- 1,038 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* javascript funtions for turning on/off details boxes
 * Mario Stanke
 */
function onoff (linkDivID) {
  if (!document.getElementById)
     return;
  var linkItem = document.getElementById(linkDivID);
  var showItem = document.getElementById(linkItem.title);

  if (!showItem || !linkItem)
     return;
  if (showItem.style.display=='none')
     turnOn(showItem, linkItem);
  else
     turnOff(showItem, linkItem);
}

function turnOff (showItem, linkItem) {
     showItem.style.display='none';
     linkItem.innerHTML = "[+]";
}
function turnOn (showItem, linkItem) {
     showItem.style.display='block';
     linkItem.innerHTML = "[-]";
}
function allOn(){
     var details = document.getElementsByClassName('dcross');
     for (var i = 0; (d = details[i]) != null; i++) {
         turnOn(document.getElementById(d.title), d);
     }
}
function allOff(){
     var details = document.getElementsByClassName('dcross');
     for (var i = 0; (d = details[i]) != null; i++) {
         turnOff(document.getElementById(d.title), d);
     }
}