~ubuntu-branches/ubuntu/trusty/qiime/trusty

« back to all changes in this revision

Viewing changes to qiime_test_data/make_distance_histograms/example4/js/histograms.js

  • Committer: Package Import Robot
  • Author(s): Andreas Tille
  • Date: 2013-06-17 18:28:26 UTC
  • mfrom: (9.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20130617182826-376az5ad080a0sfe
Tags: 1.7.0+dfsg-1
Upload preparations done for BioLinux to Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function visibilityAndOpacity(chkbox, group) {
 
2
    toggleCheckbox(chkbox, group);
 
3
    setAllOpacity();
 
4
}
 
5
 
 
6
function setAllOpacity() {
 
7
    var visible = document.getElementsByName("visible");
 
8
    var opacity_value = (1.0/visible.length)*100.0
 
9
    for(i=0; i<visible.length; i++) {
 
10
        SetOpacity(visible[i],opacity_value)
 
11
    }
 
12
}
 
13
 
 
14
function toggleCheckbox(chkbox, group) { 
 
15
    var visSetting = (chkbox.checked) ? "visible" : "hidden"; 
 
16
    document.getElementById(group).style.visibility = visSetting;
 
17
    document.getElementById(group).name = visSetting;
 
18
}
 
19
 
 
20
function makeVisible(group) { 
 
21
    document.getElementById(group).style.visibility = "visible";
 
22
    document.getElementById(group).name = "visible";
 
23
}
 
24
 
 
25
function makeHidden(group) { 
 
26
    document.getElementById(group).style.visibility = "hidden";
 
27
    document.getElementById(group).name = "hidden";
 
28
}
 
29
 
 
30
function mouseoverVisible(group) {
 
31
    var checkname = "check_" + group
 
32
    if (! document.getElementById(checkname).checked){
 
33
        makeVisible(group);
 
34
        setAllOpacity();
 
35
    }
 
36
}
 
37
 
 
38
function mouseoverHidden(group) {
 
39
    var checkname = "check_" + group
 
40
    if (! document.getElementById(checkname).checked){
 
41
        makeHidden(group);
 
42
        setAllOpacity();
 
43
    }
 
44
}
 
45
 
 
46
function SetOpacity(elem, opacityAsInt)
 
47
{
 
48
        var opacityAsDecimal = opacityAsInt;
 
49
        
 
50
        if (opacityAsInt > 100)
 
51
                opacityAsInt = opacityAsDecimal = 100; 
 
52
        else if (opacityAsInt < 0)
 
53
                opacityAsInt = opacityAsDecimal = 0; 
 
54
        
 
55
        opacityAsDecimal /= 100;
 
56
        if (opacityAsInt < 1)
 
57
                opacityAsInt = 1; // IE7 bug, text smoothing cuts out if 0
 
58
        
 
59
        elem.style.opacity = opacityAsDecimal;
 
60
        elem.style.filter  = "alpha(opacity=" + opacityAsInt + ")";
 
61
}