PageSourceSearch

https://www.hepatitisandmore.de/scripts/restricted.js

js hepatitisandmore.de collected 2026-10-02 20:18:07 UTC 5,290 bytes, 177 lines download raw bytes

1$(document).ready( restricted_ready ); 
2
3function restricted_ready(){
4    $("#content").append("<div id='waitwait'><img src='/pics/ajax-loader.gif' /></div>");
5    $("#login-register").click(toggleNewRegistration);
6    $("#login-hiv").click(function(){toggleLoginDiv('#local-login-div')});
7    $("#login-doccheck").click(function(){toggleLoginDiv('#doccheck-div')});
8    var auto = window.location.search;
9    if(auto.match(/auto/)){
10        if(auto.match(/login/)){
11            toggleLoginDiv("#local-login-div");
12        }
13    }
14    if(!cookies_enabled()) showCookieNote();
15}
16
17function showCookieNote(){
18    $(document.body).append("<div id='cookieNotice'><h1>In Ihrem Browser sind Cookies ausgeschaltet.</h1><h3>Cookies sind aber eine Voraussetzung für diesen Bereich, "
19        + "da sie aus Sicherheitsgründen verwendet werden um zu Prüfen ob Sie korrekt eingelogged sind.</h3></div>");
20}
21
22function cookies_enabled(){
23	var cookieEnabled = (navigator.cookieEnabled) ? true : false;
24	if (typeof navigator.cookieEnabled == "undefined" && !cookieEnabled){ 
25		document.cookie="cookieText";
26		cookieEnabled = (document.cookie.indexOf("testcookie") != -1) ? true : false;
27	}
28	return (cookieEnabled);
29}
30
31function toggleLoginDiv(ename){
32    var d = $(ename);
33    if(d.height() > 30)d.fixHeight(0);
34    else {
35        d.fixHeight();
36        var divs = ["#local-login-div", "#new-registration-div", "#doccheck-div"];
37        for (var i = 0; i < divs.length; i++) {
38            if( divs[i] == ename) continue;
39            $(divs[i]).fixHeight(0);
40        }
41    }
42}
43
44function toggleNewRegistration(e){
45    var nrd=$('#new-registration-div');
46    if(nrd.data("loaded") === true) {
47        toggleLoginDiv("#new-registration-div");
48        return false;
49    }
50    var pos = $(this).position();
51    $('#waitwait').css("left", (pos.left+50) + "px");
52    $('#waitwait').css("top", (pos.top-20) + "px");
53    $('#waitwait').show();
54    
55    nrd.load("/restricted/register_form.php",  
56        function(){
57            toggleLoginDiv("#new-registration-div");
58            nrd.data("loaded", true);
59            $('#waitwait').hide();
60        });
61}
62
63
64function checkInputSubmit(elm){
65    $.ajax({
66            type: 'post',
67            url: 'register_form.php',
68            data: $(elm.form).serialize(),
69            success: function (data, textStatus, jqXHR) {
70                if(data.match(/redirect:/)){
71                    
72                }
73                else {
74                    var d= $('#new-registration-div').html(data).fixHeight();
75                    $('#login-register').get(0).scrollIntoView();
76                }
77            }
78          });
79}
80
81function checkSendLogin(elm, action){
82    $("#loginaction").val( action =="forgotPassword" ? "forgotPassword" : "login");
83    var data=$(elm.form).serialize();
84    if( !checkEmail( _id("logininput1").value) ) {
85        alert("Bitte geben Sie eine korrekte E-Mail-Adresse ein.");
86        return false;
87    }
88    if(action=="login"){
89        if(!_id("logininput3").value){
90            alert("Bitte geben Sie Ihr Passwort ein");
91            return false;
92        }
93    }
94    console.log(data)
95    $.ajax({
96            type: 'post',
97            url: 'process_login.php',
98            data: data,
99            success: function (data, textStatus, jqXHR) {
100                if(data.match(/redirect::/)){
101                    window.location.href=data.replace(/redirect::/, '');
102                }
103                else {
104                    $('#loginErrorMessages').html(data);
105                    $("#forgotPasswordMessage").fixHeight(0);
106                }
107            }
108          });
109}
110
111
112function checkEmail(s){
113    return s.match(/.+@[\w\[\]-]+\.\w+/)
114}
115
116
117
118function showForgotPassword(){
119    var fpm = $("#forgotPasswordMessage");
120    if(fpm.height() > 10){
121        $('#loginErrorMessages').html('');
122        $('#logininput1').css("border", "1px solid #e3e3e3");
123        fpm.fixHeight(0);
124    } 
125    else {
126        $('#logininput1').css("border", "2px solid #339966");
127        fpm.fixHeight(140);
128    }
129    $("#local-login-div").fixHeight();
130}
131
132
133$.fn.fixHeight = function(h){
134    ht = h === undefined ? this.get(0).scrollHeight : h;
135    this.css("height", ht + "px");
136}
137
138
139function checkMyRequired(e,elm){
140    if(!elm.required) return false;
141    var pdt = $(elm).closest('dd').prev("dt");
142    if(elm.value){ 
143        pdt.get(0).dataset.required = '0';
144        pdt.toggleClass("missing", false);
145    }
146    else { 
147        pdt.get(0).dataset.required = '1';
148        pdt.toggleClass("missing", true);
149    }
150}
151
152function checkPasswordRules(elm){
153    var pw1in=$("#pwd1");
154    var pw1=pw1in.val();
155
156    var pw2=$("#pwd2").val();
157    
158    var len = pw1.length;
159    var disp = pw1.replace(/(.)(?=.*\1)/g, "").length;
160    
161    var cap = pw1.match(/[A-Z]/) ? 1 : 0;
162    var low = pw1.match(/[a-z]/) ? 1 : 0;
163    var num = pw1.match(/[^a-zA-Z]/) ? 1 : 0;
164    
165    var factor=cap+low+num;
166    
167    if( factor >= 3 && len >=7 || len >15 && disp > 6) color="green";
168    else if( factor * len > 12 || len > 9 && disp > 5 ) color="yellow";
169    else color = "red";
170    $("#pwbar").css("background-color", color);
171
172console.log(pw1 + ":" + pw2);
173
174    
175    var submitbut = $("#submitpassword").get(0)
176    submitbut.disabled = (color=="green" && pw2 == pw1 ? false : true );
177}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.