account
3 years ago
connect
3 years ago
debug
5 years ago
forms
3 years ago
js
3 years ago
partials
3 years ago
plugin-info
3 years ago
account.php
3 years ago
add-ons.php
5 years ago
add-trial-to-pricing.php
5 years ago
admin-notice.php
3 years ago
ajax-loader.php
4 years ago
auto-installation.php
3 years ago
checkout.php
5 years ago
clone-resolution-js.php
3 years ago
connect.php
3 years ago
contact.php
3 years ago
debug.php
3 years ago
email.php
5 years ago
firewall-issues-js.php
3 years ago
gdpr-optin-js.php
3 years ago
index.php
5 years ago
plugin-icon.php
3 years ago
powered-by.php
3 years ago
pricing.php
3 years ago
secure-https-header.php
5 years ago
sticky-admin-notice-js.php
3 years ago
tabs-capture-js.php
3 years ago
tabs.php
5 years ago
gdpr-optin-js.php
66 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package Freemius |
| 4 | * @copyright Copyright (c) 2015, Freemius, Inc. |
| 5 | * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 |
| 6 | * @since 2.1.0 |
| 7 | */ |
| 8 | |
| 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | exit; |
| 11 | } |
| 12 | |
| 13 | /** |
| 14 | * @var array $VARS |
| 15 | */ |
| 16 | $fs = freemius( $VARS['id'] ); |
| 17 | ?> |
| 18 | <script type="text/javascript"> |
| 19 | (function( $ ) { |
| 20 | $( document ).ready(function() { |
| 21 | var $gdprOptinNotice = $( 'div[data-id^="gdpr_optin_actions"]' ); |
| 22 | if ( 0 === $gdprOptinNotice.length ) { |
| 23 | return; |
| 24 | } |
| 25 | |
| 26 | $gdprOptinNotice.on( 'click', '.button', function() { |
| 27 | var |
| 28 | $this = $( this ), |
| 29 | allowMarketing = $this.hasClass( 'allow-marketing' ), |
| 30 | cursor = $this.css( 'cursor' ), |
| 31 | $products = $gdprOptinNotice.find( 'span[data-plugin-id]' ), |
| 32 | pluginIDs = []; |
| 33 | |
| 34 | if ( $products.length > 0 ) { |
| 35 | $products.each(function() { |
| 36 | pluginIDs.push( $( this ).data( 'plugin-id' ) ); |
| 37 | }); |
| 38 | } |
| 39 | |
| 40 | $.ajax({ |
| 41 | url : <?php echo Freemius::ajax_url() ?> + '?' + $.param({ |
| 42 | action : '<?php echo $fs->get_ajax_action( 'gdpr_optin_action' ) ?>', |
| 43 | security : '<?php echo $fs->get_ajax_security( 'gdpr_optin_action' ) ?>', |
| 44 | module_id: '<?php echo $fs->get_id() ?>' |
| 45 | }), |
| 46 | method : 'POST', |
| 47 | data : { |
| 48 | is_marketing_allowed: allowMarketing, |
| 49 | plugin_ids : pluginIDs |
| 50 | }, |
| 51 | beforeSend: function() { |
| 52 | $this.text( <?php fs_json_encode_echo_inline( 'Thanks, please wait', 'thanks-please-wait', $fs->get_slug() ) ?> + '...' ); |
| 53 | $this.css({'cursor': 'wait'}); |
| 54 | |
| 55 | $gdprOptinNotice.find( '.button' ).addClass( 'disabled' ); |
| 56 | }, |
| 57 | complete : function() { |
| 58 | $this.css({'cursor': cursor}); |
| 59 | |
| 60 | $gdprOptinNotice.remove(); |
| 61 | } |
| 62 | }); |
| 63 | }); |
| 64 | }); |
| 65 | })( jQuery ); |
| 66 | </script> |