PluginProbe
Poll Maker by AYS – Versus Polls, Anonymous Polls, Image Polls / 5.6.6
Poll Maker by AYS – Versus Polls, Anonymous Polls, Image Polls v5.6.6
6.5.0 6.4.9 6.4.8 6.4.7 6.4.6 6.4.5 6.4.4 6.4.3 6.4.2 6.4.1 6.4.0 6.3.9 6.3.8 6.3.7 6.3.6 6.3.5 6.3.4 6.3.3 5.6.0 5.6.1 5.6.2 5.6.3 5.6.4 5.6.5 5.6.6 All 153 releases
poll-maker / admin / js / admin.js

admin.js in Poll Maker by AYS – Versus Polls, Anonymous Polls, Image Polls 5.6.6, at admin/js/admin.js

65 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function($) {
2 'use strict';
3
4 $(document).on('click', '[data-slug="poll-maker"] .deactivate a', function () {
5 swal({
6 html: "<h2>Do you want to upgrade to Pro version or permanently delete the plugin?</h2><ul><li>Upgrade: Your data will be saved for upgrade.</li><li>Deactivate: Your data will be deleted completely.</li></ul>",
7 footer: '<a href="" class="ays-poll-temporary-deactivation">Temporary deactivation</a>',
8 type: 'question',
9 showCancelButton: true,
10 showCloseButton: true,
11 allowOutsideClick: false,
12 allowEscapeKey: false,
13 allowEnterKey: false,
14 confirmButtonColor: '#3085d6',
15 cancelButtonColor: '#d33',
16 confirmButtonText: 'Upgrade',
17 cancelButtonText: 'Deactivate',
18 confirmButtonClass: "ays-poll-upgrade-button",
19 cancelButtonClass: "ays-poll-cancel-button",
20 customClass: ".ays-poll-deactivate-popup",
21 }).then((result) => {
22 let upgrade_plugin = false;
23 if (result.value) upgrade_plugin = true;
24
25 if( result.dismiss && result.dismiss == 'close' ){
26 return false;
27 }
28
29 var wp_nonce = $(document).find('#ays_poll_maker_ajax_deactivate_plugin_nonce').val();
30
31 let data = {
32 action: 'apm_deactivate_plugin_option_pm',
33 upgrade_plugin,
34 _ajax_nonce: wp_nonce,
35 };
36 $.ajax({
37 url: apm_admin_ajax_obj.ajaxUrl,
38 method: "post",
39 dataType: 'json',
40 data,
41 success() {
42 location.replace($('[data-slug="poll-maker"] .deactivate a').attr('href'))
43 }
44 });
45 });
46 return false;
47 });
48
49 $(document).on('click', '.ays-poll-temporary-deactivation', function (e) {
50 e.preventDefault();
51
52 $(document).find('.ays-poll-upgrade-button').trigger('click');
53
54 });
55
56 $('.ays-poll-upgrade-plugin-btn').hover(
57 function() {
58 $(this).css('color', '#3B8D3F');
59 },
60 function() {
61 $(this).css('color', '#01A32A');
62 }
63 );
64
65 })(jQuery);