PluginProbe ʕ •ᴥ•ʔ
Email Encoder – Protect Email Addresses and Phone Numbers / 2.4.7
Email Encoder – Protect Email Addresses and Phone Numbers v2.4.7
2.5.1 2.5.0 2.4.8 trunk 0.10 0.11 0.12 0.20 0.21 0.22 0.30 0.31 0.32 0.40 0.41 0.42 0.50 0.60 0.70 0.71 0.80 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.5 1.5.2 1.51 1.53 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.10 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7
email-encoder-bundle / core / includes / assets / js / encoder-form.js
email-encoder-bundle / core / includes / assets / js Last commit date
custom-admin.js 6 years ago custom.js 5 years ago encoder-form.js 6 months ago
encoder-form.js
75 lines
1 jQuery( document ).ready( function( $ ) {
2
3 'use strict';
4
5 var $wrap = $('.eeb-form');
6 var $email = $wrap.find('#eeb-email');
7 var $display = $wrap.find('#eeb-display');
8 var prevEmail;
9
10 // get encoded email ( ajax call )
11 var getEncoded = function () {
12 // stop when email field is empty
13 if (!$email.val()) {
14 return;
15 }
16
17 // empty the output field
18 $wrap.find('#eeb-encoded-output').val('');
19
20 // get the encoded email link
21 $.post( eeb_ef.ajaxurl, {
22 action: 'eeb_get_email_form_output',
23 eebsec : eeb_ef.security,
24 eebEmail: $email.val(),
25 eebDisplay: $display.val() || $email.val(),
26 eebMethod: $wrap.find('#eeb-encode-method').val()
27 }, function ( response ) {
28 $wrap.find('#eeb-encoded-output').val( response );
29 $wrap.find('.eeb-output').fadeIn();
30 });
31
32 };
33
34 // hide output
35 $wrap.find('.eeb-output').hide();
36
37 // auto-set display field
38 $email.keyup(function () {
39 var email = $email.val();
40 var display = $display.val();
41
42 if (!display || display === prevEmail) {
43 $display.val(email);
44 }
45
46 prevEmail = email;
47 });
48
49 // get encoded link on these events
50 $wrap.find('#eeb-email, #eeb-display')
51 .keyup(function () {
52 if ($display.val().length > 0) {
53 // show example how it will appear on the page
54 $wrap.find('.eeb-example')
55 .html('<a href="mailto:' + $email.val() + '">' + $display.val() + '</a>')
56 .parents('tr').fadeIn();
57 } else {
58 $wrap.find('.eeb-example').parents('tr').fadeOut();
59 }
60
61 // clear code field
62 $wrap.find('.eeb-output').fadeOut();
63 $wrap.find('#eeb-encoded-output').val('');
64 })
65 .keyup();
66
67 $wrap.find('#eeb-encode-method').bind('change keyup', function () {
68 getEncoded();
69 });
70
71 $wrap.find('#eeb-ajax-encode').click(function () {
72 getEncoded();
73 });
74
75 });