83bafd4482f700f9d62cc8322ded5c245db133cf
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) function receive_pgpid(result) {
43)     if (result.status == 'found' && ! $('#pgpid').val()) {
44)         $('#pgpid').val(result.id);
Bernd Wurst Suche PGP-Key nur wenn der...

Bernd Wurst authored 6 years ago

45)         $("#pgpid_feedback").html('<img src="../../images/ok.png" style="height: 16px; width: 16px;" /><br>Es wurde ein PGP-Key auf einem Keyserver gefunden.');
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

57) function email_change() {
58)     var new_email = $('#email').val();
59)     if (new_email != old_email) {
60)         $('#designated-row').show();
61)     } else {
62)         $('#designated-row').hide();
63)     }
Bernd Wurst Suche PGP-Key nur wenn der...

Bernd Wurst authored 6 years ago

64) }
65) 
66) function usepgp_yes() {
67)     if ($('#email').val() && ! $('#pgpid').val()) {
68)         $.getJSON("ajax_pgp?q="+encodeURIComponent($('#email').val()), receive_pgpid)
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

70)     $('#pgpid').closest('tr').show();
71) }
72) 
73) function usepgp_no() {
74)     $('#pgpid').val('');
75)     $("#pgpid_feedback").html('');
76)     $('#pgpkey').val('');
77)     $('#pgpid').closest('tr').hide();
78)     $('#pgpkey').closest('tr').hide();
Bernd Wurst Frage die Zustimmung des Do...

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

81) 
Bernd Wurst Prüfe Nummern via AJAX

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

83)     $('#telefon').on("focusout", check_number("telefon") );
84)     $('#mobile').on("focusout", check_number("mobile") );
85)     $('#telefax').on("focusout", check_number("telefax") );
Bernd Wurst Frage die Zustimmung des Do...

Bernd Wurst authored 6 years ago

86)     
87)     if ($('#designated-row')) {
88)         $('#designated-row').hide();
89)         old_email = $('#email').val();
90)     }
Bernd Wurst Ermögliche das Setzen des P...

Bernd Wurst authored 6 years ago

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

Bernd Wurst authored 6 years ago

94)     $(".buttonset").buttonset();
95)     $("#usepgp-yes").click(usepgp_yes);
96)     $("#usepgp-no").click(usepgp_no);
97)     if ($('#usepgp-no').is(':checked')) {
98)         $('#pgpid').closest('tr').hide();
99)     }