9b0b6f46e4076673ecd682d0c1697629512576d9
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;" />');
35)     } else {
36)         $('#pgpkey').closest('tr').show();
37)         $("#pgpid_feedback").html('<img src="../../images/error.png" style="height: 16px; width: 16px;" /><br>Es wurde kein PGP-Key zu dieser ID gefunden. Bitte geben Sie unten den kompletten Key ein.');
38) 
39)     }
40) }
41) 
42) 
43) function receive_pgpid(result) {
44)     if (result.status == 'found' && ! $('#pgpid').val()) {
45)         $('#pgpid').val(result.id);
46)         $("#pgpid_feedback").html('<img src="../../images/ok.png" style="height: 16px; width: 16px;" /><br>Es wurde ein PGP-Key auf einem Keyserver gefunden. Falls Sie einen anderen (oder gar keinen) PGP-Key nutzen möchten, ändern Sie dies bitte hier.');
47)     }
48) }
49) 
50) function pgpid_change() {
51)     val = $('#pgpid').val().replace(/\s/g, "");;
52)     if (val.length == 8 || val.length == 16 || val.length == 40) {
53)         $.getJSON("ajax_pgp?id="+encodeURIComponent(val), receive_pgpidcheck)
54)     }
55) }
56) 
57) 
Bernd Wurst Frage die Zustimmung des Do...

Bernd Wurst authored 6 years ago

58) function email_change() {
59)     var new_email = $('#email').val();
60)     if (new_email != old_email) {
61)         $('#designated-row').show();
62)     } else {
63)         $('#designated-row').hide();
64)     }
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

65)     if (new_email && ! $('#pgpid').val()) {
66)         $.getJSON("ajax_pgp?q="+encodeURIComponent(new_email), receive_pgpid)
67)     }
Bernd Wurst Frage die Zustimmung des Do...

Bernd Wurst authored 6 years ago

68) }
69) 
Bernd Wurst Prüfe Nummern via AJAX

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

71)     $('#telefon').on("focusout", check_number("telefon") );
72)     $('#mobile').on("focusout", check_number("mobile") );
73)     $('#telefax').on("focusout", check_number("telefax") );
Bernd Wurst Frage die Zustimmung des Do...

Bernd Wurst authored 6 years ago

74)     
75)     if ($('#designated-row')) {
76)         $('#designated-row').hide();
77)         old_email = $('#email').val();
78)     }
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

79)     $('#email').on("focusout", email_change);
80)     $('#pgpid').on("focusout", pgpid_change);
81)     $('#pgpkey').closest('tr').hide();