Passed
Push — master ( 28eddd...1e0b05 )
by Stefan
08:22
created

web/admin/js/option_expand.js   A

Size

Lines of Code 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
rs 10
c 0
b 0
f 0
noi 2
1
/* 
2
 *******************************************************************************
3
 * Copyright 2011-2017 DANTE Ltd. and GÉANT on behalf of the GN3, GN3+, GN4-1 
4
 * and GN4-2 consortia
5
 *
6
 * License: see the web/copyright.php file in the file structure
7
 *******************************************************************************
8
 */
9
10
/* General function for doing HTTP XML GET requests. */
11
12
/* global marks */
13
/** global: marks */
14
15
function getXML(attribute_class) {
16
    var client = new XMLHttpRequest();
17
    client.attribute_class = attribute_class;
18
    client.onreadystatechange = addOption;
19
    client.open("GET", "inc/option_xhr.inc.php?class=" + attribute_class + "&etype=XML");
20
    client.send();
21
}
22
23
function addOption(attribute_class) {
24
    if (this.readyState === 4 && this.status === 200) {
25
        var field = document.getElementById("expandable_" + this.attribute_class + "_options");
26
        var div = document.createElement('tbody');
27
        div.innerHTML = this.responseText;
28
        field.appendChild(div.firstChild);
29
    }
30
}
31
32
function processCredentials() {
33
    if (this.readyState === 4 && this.status === 200) {
34
        var field = document.getElementById("disposable_credential_container");
35
        field.innerHTML = this.responseText;
36
    }
37
}
38
39
function doCredentialCheck(form) {
40
    postXML(processCredentials, form);
41
}
42
43
function deleteOption(identifier) {
44
    var field = document.getElementById(identifier);
45
    field.parentNode.removeChild(field);
46
}
47
48
function MapGoogleDeleteCoord(e) {
49
    marks[e - 1].setOptions({visible: false});
1 ignored issue
show
Bug introduced by
The variable marks seems to be never declared. If this is a global, consider adding a /** global: marks */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
50
}
51
52
function MapNoneDeleteCoord(e) {
0 ignored issues
show
Unused Code introduced by
The parameter e is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
53
    // we don't do anything special because there is no map widget at all
54
}