PluginProbe ʕ •ᴥ•ʔ
Backup Migration / 1.4.9
Backup Migration v1.4.9
2.1.6 2.1.5.2 trunk 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.6.1 1.4.7 1.4.8 1.4.9 1.4.9.1 2.0.0 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.5.1
backup-backup / analyst / templates / optin.php
backup-backup / analyst / templates Last commit date
forms 11 months ago notice.php 11 months ago optin.php 11 months ago optout.php 11 months ago
optin.php
62 lines
1 <script type="text/javascript">
2
3 (function ($) {
4 var isOptingIn = false
5
6 $('#analyst-opt-in-modal').appendTo($('body'))
7
8 var makeOptIn = function (pluginId) {
9 if (isOptingIn) return
10
11 isOptingIn = true
12
13 $.ajax({
14 url: ajaxurl,
15 method: 'POST',
16 data: {
17 action: 'analyst_opt_in_' + pluginId,
18 nonce: analyst_opt_localize.nonce
19 },
20 success: function () {
21 $('#analyst-opt-in-modal').hide()
22
23 isOptingIn = false
24
25 var optOutAction = $('<a />').attr({
26 class: 'analyst-action-opt analyst-opt-out',
27 'analyst-plugin-id': pluginId,
28 'analyst-plugin-signed': '1'
29 })
30 .text('Opt Out')
31 $('.analyst-opt-in[analyst-plugin-id="'+ pluginId +'"').replaceWith(optOutAction)
32
33 $('[analyst-plugin-id="' + pluginId + '"').attr('analyst-plugin-opted-in', 1)
34 }
35 })
36 }
37
38 $(document).on('click', '.analyst-opt-in:not([loading])', function() {
39 var pluginId = $(this).attr('analyst-plugin-id')
40 var isSigned = $(this).attr('analyst-plugin-signed') === '1'
41
42 if (!isSigned) {
43 $('#analyst-install-modal')
44 .attr('analyst-plugin-id', pluginId)
45 .show()
46
47 return;
48 }
49
50 $('#analyst-install-modal').attr({'analyst-plugin-id': pluginId})
51
52 $(this).attr('loading', true).text('Opting In...')
53
54 makeOptIn(pluginId);
55 })
56
57 $('.opt-in-modal-close').click(function () {
58 $('#analyst-opt-in-modal').hide()
59 })
60 })(jQuery)
61 </script>
62