90da2da308dae512eb32794cd8d9c91095c87b73
Bernd Wurst Frage die Zustimmung des Do...

Bernd Wurst authored 6 years ago

1) var old_email;
2) 
Bernd Wurst Prüfe Nummern via AJAX

Bernd Wurst authored 6 years ago

3) function populate_number(result) {
4)   var field = result.field;
5)   if (result.valid == 1) {
6)     $("#"+field).val(result.number);
7)     $("#"+field+"_feedback").html('<img src="../../images/ok.png" style="height: 16px; width: 16px;" />');
8)   } else {
9)     $("#"+field+"_feedback").html('<img src="../../images/error.png" style="height: 16px; width: 16px;" alt="Nummer scheint nicht gültig zu sein" title="Nummer scheint nicht gültig zu sein" />');
10)   }
11) }
12) 
13) function check_number( field ) 
14) {
15)     return function () {
16)         if ($("#"+field).val().length > 0) {
17)             var number = $("#"+field).val();
18)             var country = $("#land").val();
19)             $("#"+field).prop("disabled", true);
20)             $.getJSON("numbercheck?number="+encodeURIComponent(number)+"&country="+encodeURIComponent(country)+"&field="+field, populate_number)
21)                 .always( function() {
22)                     $("#"+field).prop("disabled", false);
23)                 });
24)         } else {
25)             $("#"+field+"_feedback").html('');
26)         }
27)     }
28) }
29) 
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

30) 
31) function receive_pgpidcheck(result) {
32)     if (result.status == 'found') {
33)         $('#pgpid').val(result.id);
34)         $("#pgpid_feedback").html('<img src="../../images/ok.png" style="height: 16px; width: 16px;" />');
Bernd Wurst Prüfe die Verwendbarkeit vo...

Bernd Wurst authored 5 years ago

35)     } else if (result.status == 'unusable') {
36)         $('#pgpid').val(result.id);
37)         $('#pgpkey').closest('tr').show();
38)         $("#pgpid_feedback").html('<img src="../../images/error.png" style="height: 16px; width: 16px;" /><br>Es wurde ein Key gefunden, allerdings scheint dieser kaputt oder veraltet zu sein. Bitte geben Sie unten den kompletten aktuellen Key ein.');
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

39)     } else {
40)         $('#pgpkey').closest('tr').show();
Bernd Wurst Prüfe die Verwendbarkeit vo...

Bernd Wurst authored 5 years ago

41)         $("#pgpid_feedback").html('<img src="../../images/error.png" style="height: 16px; width: 16px;" /><br>Es konnte kein PGP-Key zu dieser ID vom Keyserver-Netzwerk bezogen werden. Bitte geben Sie unten den kompletten Key ein.');
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

42)     }
43) }
44) 
45) 
46) function receive_pgpid(result) {
47)     if (result.status == 'found' && ! $('#pgpid').val()) {
48)         $('#pgpid').val(result.id);
Bernd Wurst Prüfe die Verwendbarkeit vo...

Bernd Wurst authored 5 years ago

49)         $("#pgpid_feedback").html('<img src="../../images/ok.png" style="height: 16px; width: 16px;" /><br>Es wurde ein PGP-Key auf einem Keyserver gefunden. Bitte prüfen Sie, ob die ID korrekt ist und Sie auch den dazu passenden privaten Schlüssel besitzen.');
50)         pgpid_change();
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

51)     }
52) }
53) 
54) function pgpid_change() {
55)     val = $('#pgpid').val().replace(/\s/g, "");;
56)     if (val.length == 8 || val.length == 16 || val.length == 40) {
57)         $.getJSON("ajax_pgp?id="+encodeURIComponent(val), receive_pgpidcheck)
58)     }
59) }
60) 
61) 
Bernd Wurst Frage die Zustimmung des Do...

Bernd Wurst authored 6 years ago

62) function email_change() {
63)     var new_email = $('#email').val();
64)     if (new_email != old_email) {
65)         $('#designated-row').show();
66)     } else {
67)         $('#designated-row').hide();
68)     }
Bernd Wurst Suche PGP-Key nur wenn der...

Bernd Wurst authored 6 years ago

69) }
70) 
71) function usepgp_yes() {
72)     if ($('#email').val() && ! $('#pgpid').val()) {
73)         $.getJSON("ajax_pgp?q="+encodeURIComponent($('#email').val()), receive_pgpid)
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

74)     }
Bernd Wurst Suche PGP-Key nur wenn der...

Bernd Wurst authored 6 years ago

75)     $('#pgpid').closest('tr').show();
76) }
77) 
78) function usepgp_no() {
79)     $('#pgpid').val('');
80)     $("#pgpid_feedback").html('');
81)     $('#pgpkey').val('');
82)     $('#pgpid').closest('tr').hide();
83)     $('#pgpkey').closest('tr').hide();
Bernd Wurst Frage die Zustimmung des Do...

Bernd Wurst authored 6 years ago

84) }
85) 
Bernd Wurst Suche PGP-Key nur wenn der...

Bernd Wurst authored 6 years ago

86) 
Bernd Wurst Prüfe Nummern via AJAX

Bernd Wurst authored 6 years ago

87) $(function() {
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

88)     $('#telefon').on("focusout", check_number("telefon") );
89)     $('#mobile').on("focusout", check_number("mobile") );
90)     $('#telefax').on("focusout", check_number("telefax") );
Bernd Wurst Frage die Zustimmung des Do...

Bernd Wurst authored 6 years ago

91)     
92)     if ($('#designated-row')) {
93)         $('#designated-row').hide();
94)         old_email = $('#email').val();
95)     }
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

96)     $('#email').on("focusout", email_change);
97)     $('#pgpid').on("focusout", pgpid_change);
98)     $('#pgpkey').closest('tr').hide();
Bernd Wurst Suche PGP-Key nur wenn der...

Bernd Wurst authored 6 years ago

99)     $(".buttonset").buttonset();
100)     $("#usepgp-yes").click(usepgp_yes);
101)     $("#usepgp-no").click(usepgp_no);
102)     if ($('#usepgp-no').is(':checked')) {
103)         $('#pgpid').closest('tr').hide();
104)     }