Project

General

Profile

1
function change_os(type) {
2
    if(type === 'linux') {
3
        document.getElementById('file_perms_box1').style.display = 'block';
4
console.info(type);
5
        document.getElementById('file_perms_box2').style.display = 'block';
6
        document.getElementById('file_perms_box3').style.display = 'block';
7
    } else if(type === 'windows') {
8
        document.getElementById('file_perms_box1').style.display = 'none';
9
console.info(type);
10
        document.getElementById('file_perms_box2').style.display = 'none';
11
        document.getElementById('file_perms_box3').style.display = 'none';
12
    }
13
}
14

    
15
function change_wbmailer(type) {
16
    if(type === 'smtp') {
17
        document.getElementById('row_wbmailer_smtp_settings').style.display = '';
18
        document.getElementById('row_wbmailer_smtp_host').style.display = '';
19
        document.getElementById('row_wbmailer_smtp_port').style.display = '';
20
        document.getElementById('row_wbmailer_smtp_secure').style.display = '';
21
        document.getElementById('row_wbmailer_smtp_auth_mode').style.display = '';
22
        document.getElementById('row_wbmailer_smtp_username').style.display = '';
23
        document.getElementById('row_wbmailer_smtp_password').style.display = '';
24
    } else if(type === 'phpmail') {
25
        document.getElementById('row_wbmailer_smtp_settings').style.display = 'none';
26
        document.getElementById('row_wbmailer_smtp_host').style.display = 'none';
27
        document.getElementById('row_wbmailer_smtp_port').style.display = 'none';
28
        document.getElementById('row_wbmailer_smtp_secure').style.display = 'none';
29
        document.getElementById('row_wbmailer_smtp_auth_mode').style.display = 'none';
30
        document.getElementById('row_wbmailer_smtp_username').style.display = 'none';
31
        document.getElementById('row_wbmailer_smtp_password').style.display = 'none';
32
    }
33
}
34
/*  */
35
function toggle_wbmailer_auth( elm ) {
36
        if ( elm.checked == true ) {
37
            elm.checked = false;
38
            document.getElementById('row_wbmailer_smtp_username').style.display = 'none';
39
            document.getElementById('row_wbmailer_smtp_password').style.display = 'none';
40
        }
41
        else  {
42
            elm.checked = true;
43
            document.getElementById('row_wbmailer_smtp_username').style.display = 'block';
44
            document.getElementById('row_wbmailer_smtp_password').style.display = 'block';
45
        }
46
console.info(elm);
47
}
48

    
49
function toggle_wbmailer_secure( elm ) {
50
        if ( elm.value === '465' ) {
51
            document.getElementById('wbmailer_smtp_secure').value = 'SSL';
52
console.info(elm);
53
        }
54
        else  {
55
//            document.getElementById('wbmailer_smtp_secure').value = 'block';
56
        }
57
}
58

    
59
domReady(function() {
60

    
61
    var system_linux = document.getElementById("operating_system_linux");
62
    if ( system_linux ){
63
        system_linux.addEventListener("click", function() {
64
            change_os( 'linux' );
65
        }, false);
66
    }
67

    
68
    var system_windows = document.getElementById("operating_system_windows");
69
    if ( system_windows ){
70
        system_windows.addEventListener("click", function() {
71
            change_os( 'windows' );
72
        }, false);
73
    }
74

    
75
    var phpmail = document.getElementById("wbmailer_routine_phpmail");
76
    if ( phpmail ){
77
        phpmail.addEventListener("click", function() {
78
            change_wbmailer( 'phpmail' );
79
        }, false);
80
    }
81

    
82
    var smtp = document.getElementById("wbmailer_routine_smtp");
83
    if ( smtp ){
84
        smtp.addEventListener("click", function() {
85
            change_wbmailer( 'smtp' );
86
        }, false);
87
    }
88

    
89
    var smtpAuth = document.getElementById("wbmailer_smtp_auth");
90
    if ( smtpAuth ){
91
        smtpAuth.addEventListener("click", function() {
92
            toggle_wbmailer_auth( smtpAuth );
93
        }, false);
94
    }
95

    
96
    var smtpPort = document.getElementById("wbmailer_smtp_port");
97
    if ( smtpPort ){
98
        smtpPort.addEventListener("change", function() {
99
            toggle_wbmailer_secure( smtpPort );
100
        }, false);
101
    }
102

    
103
});
104

    
105

    
(8-8/10)