| @@ -1,64 +1,64 @@ | ||
| 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 1.2.2.7 | |
| 7 | - */ | |
| 8 | - | |
| 9 | - if ( ! defined( 'ABSPATH' ) ) { | |
| 10 | - exit; | |
| 11 | - } | |
| 12 | - | |
| 13 | - /** | |
| 14 | - * @var array $VARS | |
| 15 | - * @var Freemius $fs | |
| 16 | - */ | |
| 17 | - $fs = freemius( $VARS['id'] ); | |
| 18 | - $slug = $fs->get_slug(); | |
| 19 | -?> | |
| 20 | -<script type="text/javascript"> | |
| 21 | - (function ($) { | |
| 22 | - $(document).ready(function () { | |
| 23 | - var $wrap = $( '.wrap' ); | |
| 24 | - if ( 0 === $wrap.length ) { | |
| 25 | - $wrap = $( '<div class="wrap">' ); | |
| 26 | - $wrap.insertBefore( $( '#wpbody-content .clear' ) ); | |
| 27 | - } | |
| 28 | - | |
| 29 | - $wrap = $wrap.clone().wrap( '<div>' ).parent(); | |
| 30 | - | |
| 31 | - var | |
| 32 | - settingHtml = $wrap.html(), | |
| 33 | - tabsPosition = settingHtml.indexOf('nav-tab-wrapper'), | |
| 34 | - aboveTabsHtml = ''; | |
| 35 | - | |
| 36 | - if (-1 < tabsPosition) { | |
| 37 | - // Find the tabs HTML beginning exact position. | |
| 38 | - while ('<' !== settingHtml[tabsPosition] && 0 < tabsPosition) { | |
| 39 | - tabsPosition--; | |
| 40 | - } | |
| 41 | - | |
| 42 | - if (-1 < tabsPosition) { | |
| 43 | - aboveTabsHtml = settingHtml.substr(0, tabsPosition); | |
| 44 | - | |
| 45 | - var tabsHtml = $('.wrap .nav-tab-wrapper').clone().wrap('<div>').parent().html(), | |
| 46 | - ajaxUrl = <?php echo Freemius::ajax_url() ?>; | |
| 47 | - | |
| 48 | - $.ajax({ | |
| 49 | - url : ajaxUrl + (ajaxUrl.includes('?') ? '&' : '?') + $.param({ | |
| 50 | - action : '<?php echo $fs->get_ajax_action( 'store_tabs' ) ?>', | |
| 51 | - security : '<?php echo $fs->get_ajax_security( 'store_tabs' ) ?>', | |
| 52 | - module_id: '<?php echo $fs->get_id() ?>' | |
| 53 | - }), | |
| 54 | - method : 'POST', | |
| 55 | - data : aboveTabsHtml + "\n" + tabsHtml + '</div>', | |
| 56 | - dataType : 'html', | |
| 57 | - // Avoid escaping the HTML. | |
| 58 | - processData: false | |
| 59 | - }); | |
| 60 | - } | |
| 61 | - } | |
| 62 | - }); | |
| 63 | - })(jQuery); | |
| 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 1.2.2.7 | |
| 7 | + */ | |
| 8 | + | |
| 9 | + if ( ! defined( 'ABSPATH' ) ) { | |
| 10 | + exit; | |
| 11 | + } | |
| 12 | + | |
| 13 | + /** | |
| 14 | + * @var array $VARS | |
| 15 | + * @var Freemius $fs | |
| 16 | + */ | |
| 17 | + $fs = freemius( $VARS['id'] ); | |
| 18 | + $slug = $fs->get_slug(); | |
| 19 | +?> | |
| 20 | +<script type="text/javascript"> | |
| 21 | + (function ($) { | |
| 22 | + $(document).ready(function () { | |
| 23 | + var $wrap = $( '.wrap' ); | |
| 24 | + if ( 0 === $wrap.length ) { | |
| 25 | + $wrap = $( '<div class="wrap">' ); | |
| 26 | + $wrap.insertBefore( $( '#wpbody-content .clear' ) ); | |
| 27 | + } | |
| 28 | + | |
| 29 | + $wrap = $wrap.clone().wrap( '<div>' ).parent(); | |
| 30 | + | |
| 31 | + var | |
| 32 | + settingHtml = $wrap.html(), | |
| 33 | + tabsPosition = settingHtml.indexOf('nav-tab-wrapper'), | |
| 34 | + aboveTabsHtml = ''; | |
| 35 | + | |
| 36 | + if (-1 < tabsPosition) { | |
| 37 | + // Find the tabs HTML beginning exact position. | |
| 38 | + while ('<' !== settingHtml[tabsPosition] && 0 < tabsPosition) { | |
| 39 | + tabsPosition--; | |
| 40 | + } | |
| 41 | + | |
| 42 | + if (-1 < tabsPosition) { | |
| 43 | + aboveTabsHtml = settingHtml.substr(0, tabsPosition); | |
| 44 | + | |
| 45 | + var tabsHtml = $('.wrap .nav-tab-wrapper').clone().wrap('<div>').parent().html(), | |
| 46 | + ajaxUrl = <?php echo Freemius::ajax_url() ?>; | |
| 47 | + | |
| 48 | + $.ajax({ | |
| 49 | + url : ajaxUrl + (ajaxUrl.includes('?') ? '&' : '?') + $.param({ | |
| 50 | + action : '<?php echo $fs->get_ajax_action( 'store_tabs' ) ?>', | |
| 51 | + security : '<?php echo $fs->get_ajax_security( 'store_tabs' ) ?>', | |
| 52 | + module_id: '<?php echo $fs->get_id() ?>' | |
| 53 | + }), | |
| 54 | + method : 'POST', | |
| 55 | + data : aboveTabsHtml + "\n" + tabsHtml + '</div>', | |
| 56 | + dataType : 'html', | |
| 57 | + // Avoid escaping the HTML. | |
| 58 | + processData: false | |
| 59 | + }); | |
| 60 | + } | |
| 61 | + } | |
| 62 | + }); | |
| 63 | + })(jQuery); | |
| 64 | 64 | </script> |