Subversion Repositories oidplus

Rev

Rev 890 | Rev 1288 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 890 Rev 891
Line 22... Line 22...
22
                //document.location.href = url;
22
                //document.location.href = url;
23
                window.open(url);
23
                window.open(url);
24
        },
24
        },
25
 
25
 
26
        refresh_whois_url_bar: function() {
26
        refresh_whois_url_bar: function() {
-
 
27
                var query = "";
-
 
28
                // -------------------------------------------------------------
-
 
29
                var obj = $("#whois_query")[0].value.trim();
-
 
30
                var tmp = obj.split(":");
-
 
31
                var ns = tmp.shift();
-
 
32
                var id = tmp.join(":");
-
 
33
                if (!/^[a-z0-9]+$/.test(ns) || id.includes("$")) {
-
 
34
                        $("#whois_query_invalid")[0].style.display = "Inline";
-
 
35
                } else {
-
 
36
                        $("#whois_query_invalid")[0].style.display = "None";
-
 
37
                }
-
 
38
                query = ns + ":" + id;
-
 
39
                // -------------------------------------------------------------
27
                var format = "text";
40
                var format = "text";
28
                var radios = $("[name=format]");
41
                var radios = $("[name=format]");
29
 
-
 
30
                for (var i = 0, length = radios.length; i < length; i++) {
42
                for (var i = 0, length = radios.length; i < length; i++) {
31
                        if (radios[i].checked) {
43
                        if (radios[i].checked) {
32
                                format = radios[i].value;
44
                                format = radios[i].value;
33
                        }
45
                        }
34
                }
46
                }
35
 
-
 
36
                var query = $("#whois_query")[0].value;
-
 
37
                if (format != "text") query += "$format="+format;
47
                if (format != "text") query += "$format="+format;
38
 
-
 
-
 
48
                // -------------------------------------------------------------
39
                var auth = $("#whois_auth")[0].value;
49
                var auth = $("#whois_auth")[0].value;
-
 
50
                var invalid_tokens = false;
-
 
51
                if (auth != "") {
-
 
52
                        var tokens = auth.split(",");
-
 
53
                        for (var i=0; i<tokens.length; i++) {
-
 
54
                                var token = tokens[i];
-
 
55
                                if ((token == "") || token.includes("$") || token.includes("=")) {
-
 
56
                                        invalid_tokens = true;
-
 
57
                                        break;
-
 
58
                                }
-
 
59
                                tokens[i] = token.trim();
-
 
60
                        }
-
 
61
                        auth = tokens.join(",");
-
 
62
                }
-
 
63
                if (invalid_tokens) {
-
 
64
                        $("#whois_auth_invalid")[0].style.display = "Inline";
-
 
65
                        auth = "";
-
 
66
                } else {
-
 
67
                        $("#whois_auth_invalid")[0].style.display = "None";
-
 
68
                }
40
                if (auth != "") query += "$auth="+auth;
69
                if (auth != "") query += "$auth="+auth;
41
 
-
 
-
 
70
                // -------------------------------------------------------------
42
                $("#whois_url_bar")[0].innerHTML = getSystemUrl() + 'plugins/viathinksoft/publicPages/100_whois/whois/webwhois.php?query=' + encodeURIComponent(query);
71
                $("#whois_url_bar")[0].innerText = getSystemUrl() + 'plugins/viathinksoft/publicPages/100_whois/whois/webwhois.php?query=' + encodeURIComponent(query);
43
                $("#whois_query_bar")[0].innerHTML = query;
72
                $("#whois_query_bar")[0].innerText = query;
44
        }
73
        }
45
 
74
 
46
};
75
};