| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package Freemius |
| 4 |
* @copyright Copyright (c) 2015, Freemius, Inc. |
| 5 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 6 |
* @since 1.0.5 |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit; |
| 11 |
} |
| 12 |
|
| 13 |
$VARS = isset($VARS) ? $VARS : array(); |
| 14 |
|
| 15 |
wp_enqueue_script( 'jquery' ); |
| 16 |
wp_enqueue_script( 'json2' ); |
| 17 |
fs_enqueue_local_script( 'postmessage', 'nojquery.ba-postmessage.min.js' ); |
| 18 |
fs_enqueue_local_script( 'fs-postmessage', 'postmessage.js' ); |
| 19 |
?> |
| 20 |
|
| 21 |
<div id="piframe"></div> |
| 22 |
<script type="text/javascript"> |
| 23 |
(function ($) { |
| 24 |
$(function () { |
| 25 |
var |
| 26 |
base_url = '<?php echo WP_FS__ADDRESS ?>', |
| 27 |
piframe = $('<iframe id="fs_promo_tab" src="' + base_url + '/promotional-tab/?<?php echo http_build_query($VARS) ?>#' + encodeURIComponent(document.location.href) + '" height="350" width="60" frameborder="0" style=" background: transparent; position: fixed; top: 20%; right: 0;" scrolling="no"></iframe>') |
| 28 |
.appendTo('#piframe'); |
| 29 |
|
| 30 |
FS.PostMessage.init(base_url); |
| 31 |
FS.PostMessage.receive('state', function (state) { |
| 32 |
if ('closed' === state) |
| 33 |
$('#fs_promo_tab').css('width', '60px'); |
| 34 |
else |
| 35 |
$('#fs_promo_tab').css('width', '345px'); |
| 36 |
}); |
| 37 |
}); |
| 38 |
})(jQuery); |
| 39 |
</script> |