Version Description
(31th December 2019) = * Improvement: Allow users to add custom script in amp by using amp theme frame work plugin or without plugin #3865 * Improvement: Allow users to register scripts in proper way in AMP Theme Framework #3257 * Improvement: Need to add filter to modify mobile redirection #3987 * Improvement: Need to update Sabberworm/CSS folder. #4012 * Improvement: Need to make compatibility with "Transposh WordPress Translation" plugin #3895 * Fixed: Warning issue with "$amp_emplate->get('metadata')" undefined metadata #3967 * Fixed: GDPR popup appears once agin after accepting it #3957 * Fixed: AMP Page apears blank after adding script tag in Head Section of AMP Page Builder #3834 * Fixed: when user is not an admin and the admin bar is getting displayed as gap on the site #3918 * Fixed: Option Panel not saving in AMP FOR WP, it is giving 404 error #3768 * Fixed: Page Builder Latest Posts Category Module #3927 * Fixed: Error amp-iframe extension .js appears more than once #3810 * Fixed: Query monitor is not working in our latest version. #4008 * Fixed: Google Tag manager not firing properly #3826 * Fixed: Undefined variable block_css #4021
Release Info
Developer | mohammed_kaludi |
Plugin | AMP for WP – Accelerated Mobile Pages |
Version | 1.0.6 |
Comparing to | |
See all releases |
Code changes from version 1.0.5 to 1.0.6
- README.md +18 -1
- accelerated-moblie-pages.php +12 -3
- changelog.txt +17 -0
- components/gdpr/gdpr.php +18 -13
- components/loop/loop.php +18 -10
- includes/features/analytics/analytics-functions.php +1 -1
- includes/features/functions.php +1 -1
- includes/features/notice-bar/notice-bar-functions.php +6 -4
- includes/options/redux-core/assets/js/redux.js +106 -2
- includes/options/redux-core/assets/js/redux.min.js +1 -1
- includes/vendor/amp/includes/class-amp-post-template.php +4 -3
- includes/vendor/amp/includes/sanitizers/class-amp-allowed-tags-generated.php +108 -0
- includes/vendor/amp/includes/sanitizers/class-amp-blacklist-sanitizer.php +10 -4
- includes/vendor/css-parser/sabberworm/php-css-parser/lib/Sabberworm/CSS/CSSList/CSSList.php +13 -8
- includes/vendor/css-parser/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/ParserState.php +21 -8
- includes/vendor/css-parser/sabberworm/php-css-parser/lib/Sabberworm/CSS/Parsing/UnexpectedEOFException.php +11 -0
- includes/vendor/css-parser/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/KeyframeSelector.php +25 -0
- includes/vendor/css-parser/sabberworm/php-css-parser/lib/Sabberworm/CSS/Property/Selector.php +1 -1
- includes/vendor/css-parser/sabberworm/php-css-parser/lib/Sabberworm/CSS/RuleSet/DeclarationBlock.php +17 -8
- includes/vendor/css-parser/sabberworm/php-css-parser/lib/Sabberworm/CSS/Value/Size.php +3 -3
- pagebuilder/inc/amppb_save_data.php +0 -1
- pagebuilder/modules/contents-module.php +4 -15
- readme.txt +18 -1
- templates/features.php +153 -6
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
|
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 5.3.2
|
7 |
-
Stable tag: 1.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -191,6 +191,23 @@ You can contact us from [here](https://ampforwp.com/contact/)
|
|
191 |
|
192 |
== Changelog ==
|
193 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
= 1.0.5 (30th December 2019) =
|
195 |
* Fixed: Menu arrow icon not showing properly in mobile version #3995
|
196 |
* Fixed: Google Tag manager not firing properly #3826
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 5.3.2
|
7 |
+
Stable tag: 1.0.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
191 |
|
192 |
== Changelog ==
|
193 |
|
194 |
+
= 1.0.6 (31th December 2019) =
|
195 |
+
* Improvement: Allow users to add custom script in amp by using amp theme frame work plugin or without plugin #3865
|
196 |
+
* Improvement: Allow users to register scripts in proper way in AMP Theme Framework #3257
|
197 |
+
* Improvement: Need to add filter to modify mobile redirection #3987
|
198 |
+
* Improvement: Need to update Sabberworm/CSS folder. #4012
|
199 |
+
* Improvement: Need to make compatibility with "Transposh WordPress Translation" plugin #3895
|
200 |
+
* Fixed: Warning issue with "$amp_emplate->get('metadata')" undefined metadata #3967
|
201 |
+
* Fixed: GDPR popup appears once agin after accepting it #3957
|
202 |
+
* Fixed: AMP Page apears blank after adding script tag in Head Section of AMP Page Builder #3834
|
203 |
+
* Fixed: when user is not an admin and the admin bar is getting displayed as gap on the site #3918
|
204 |
+
* Fixed: Option Panel not saving in AMP FOR WP, it is giving 404 error #3768
|
205 |
+
* Fixed: Page Builder Latest Posts Category Module #3927
|
206 |
+
* Fixed: Error amp-iframe extension .js appears more than once #3810
|
207 |
+
* Fixed: Query monitor is not working in our latest version. #4008
|
208 |
+
* Fixed: Google Tag manager not firing properly #3826
|
209 |
+
* Fixed: Undefined variable block_css #4021
|
210 |
+
|
211 |
= 1.0.5 (30th December 2019) =
|
212 |
* Fixed: Menu arrow icon not showing properly in mobile version #3995
|
213 |
* Fixed: Google Tag manager not firing properly #3826
|
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Accelerated Mobile Pages
|
4 |
Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
|
5 |
Description: AMP for WP - Accelerated Mobile Pages for WordPress
|
6 |
-
Version: 1.0.
|
7 |
Author: Ahmed Kaludi, Mohammed Kaludi
|
8 |
Author URI: https://ampforwp.com/
|
9 |
Donate link: https://www.paypal.me/Kaludi/25
|
@@ -20,7 +20,7 @@ define('AMPFORWP_PLUGIN_DIR_URI', plugin_dir_url(__FILE__));
|
|
20 |
define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
|
21 |
define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
|
22 |
define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
|
23 |
-
define('AMPFORWP_VERSION','1.0.
|
24 |
define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
|
25 |
if(!defined('AMPFROWP_HOST_NAME')){
|
26 |
$urlinfo = get_bloginfo('url');
|
@@ -1425,6 +1425,9 @@ if(!function_exists('ampforwp_get_admin_current_page')){
|
|
1425 |
}
|
1426 |
}
|
1427 |
function ampforwp_update_data_when_saved($options, $changed_values) {
|
|
|
|
|
|
|
1428 |
$updatedDataForTransient = array(
|
1429 |
'hide-amp-categories2',
|
1430 |
'amp-design-3-category-selector',
|
@@ -1441,6 +1444,9 @@ function ampforwp_update_data_when_saved($options, $changed_values) {
|
|
1441 |
}
|
1442 |
|
1443 |
function ampforwp_update_data_when_reset($rest_object = '') {
|
|
|
|
|
|
|
1444 |
if ( isset( $rest_object->parent->transients ) ) {
|
1445 |
$updatedDataForTransient = array(
|
1446 |
'hide-amp-categories2',
|
@@ -1459,6 +1465,9 @@ function ampforwp_update_data_when_reset($rest_object = '') {
|
|
1459 |
|
1460 |
if(!function_exists('ampforwp_delete_transient_on_update')){
|
1461 |
function ampforwp_delete_transient_on_update($changed_values){
|
|
|
|
|
|
|
1462 |
$key_for_trans = array('ampforwp-custom-taxonomies');
|
1463 |
$del_trans_arr = array('ampforwp-custom-taxonomies'=>array('ampforwp_header_menu','ampforwp_footer_menu'));
|
1464 |
foreach($changed_values as $key => $value ){
|
@@ -1470,4 +1479,4 @@ if(!function_exists('ampforwp_delete_transient_on_update')){
|
|
1470 |
}
|
1471 |
}
|
1472 |
}
|
1473 |
-
}
|
3 |
Plugin Name: Accelerated Mobile Pages
|
4 |
Plugin URI: https://wordpress.org/plugins/accelerated-mobile-pages/
|
5 |
Description: AMP for WP - Accelerated Mobile Pages for WordPress
|
6 |
+
Version: 1.0.6
|
7 |
Author: Ahmed Kaludi, Mohammed Kaludi
|
8 |
Author URI: https://ampforwp.com/
|
9 |
Donate link: https://www.paypal.me/Kaludi/25
|
20 |
define('AMPFORWP_DISQUS_URL',plugin_dir_url(__FILE__).'includes/disqus.html');
|
21 |
define('AMPFORWP_IMAGE_DIR',plugin_dir_url(__FILE__).'images');
|
22 |
define('AMPFORWP_MAIN_PLUGIN_DIR', plugin_dir_path( __DIR__ ) );
|
23 |
+
define('AMPFORWP_VERSION','1.0.6');
|
24 |
define('AMPFORWP_EXTENSION_DIR',plugin_dir_path(__FILE__).'includes/options/extensions');
|
25 |
if(!defined('AMPFROWP_HOST_NAME')){
|
26 |
$urlinfo = get_bloginfo('url');
|
1425 |
}
|
1426 |
}
|
1427 |
function ampforwp_update_data_when_saved($options, $changed_values) {
|
1428 |
+
if(!current_user_can( 'manage_options' )){
|
1429 |
+
return ;
|
1430 |
+
}
|
1431 |
$updatedDataForTransient = array(
|
1432 |
'hide-amp-categories2',
|
1433 |
'amp-design-3-category-selector',
|
1444 |
}
|
1445 |
|
1446 |
function ampforwp_update_data_when_reset($rest_object = '') {
|
1447 |
+
if(!current_user_can( 'manage_options' )){
|
1448 |
+
return ;
|
1449 |
+
}
|
1450 |
if ( isset( $rest_object->parent->transients ) ) {
|
1451 |
$updatedDataForTransient = array(
|
1452 |
'hide-amp-categories2',
|
1465 |
|
1466 |
if(!function_exists('ampforwp_delete_transient_on_update')){
|
1467 |
function ampforwp_delete_transient_on_update($changed_values){
|
1468 |
+
if(!current_user_can( 'manage_options' )){
|
1469 |
+
return ;
|
1470 |
+
}
|
1471 |
$key_for_trans = array('ampforwp-custom-taxonomies');
|
1472 |
$del_trans_arr = array('ampforwp-custom-taxonomies'=>array('ampforwp_header_menu','ampforwp_footer_menu'));
|
1473 |
foreach($changed_values as $key => $value ){
|
1479 |
}
|
1480 |
}
|
1481 |
}
|
1482 |
+
}
|
@@ -1,5 +1,22 @@
|
|
1 |
== Changelog ==
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
= 1.0.5 (30th December 2019) =
|
4 |
* Fixed: Menu arrow icon not showing properly in mobile version #3995
|
5 |
* Fixed: Google Tag manager not firing properly #3826
|
1 |
== Changelog ==
|
2 |
|
3 |
+
= 1.0.6 (31th December 2019) =
|
4 |
+
* Improvement: Allow users to add custom script in amp by using amp theme frame work plugin or without plugin #3865
|
5 |
+
* Improvement: Allow users to register scripts in proper way in AMP Theme Framework #3257
|
6 |
+
* Improvement: Need to add filter to modify mobile redirection #3987
|
7 |
+
* Improvement: Need to update Sabberworm/CSS folder. #4012
|
8 |
+
* Improvement: Need to make compatibility with "Transposh WordPress Translation" plugin #3895
|
9 |
+
* Fixed: Warning issue with "$amp_emplate->get('metadata')" undefined metadata #3967
|
10 |
+
* Fixed: GDPR popup appears once agin after accepting it #3957
|
11 |
+
* Fixed: AMP Page apears blank after adding script tag in Head Section of AMP Page Builder #3834
|
12 |
+
* Fixed: when user is not an admin and the admin bar is getting displayed as gap on the site #3918
|
13 |
+
* Fixed: Option Panel not saving in AMP FOR WP, it is giving 404 error #3768
|
14 |
+
* Fixed: Page Builder Latest Posts Category Module #3927
|
15 |
+
* Fixed: Error amp-iframe extension .js appears more than once #3810
|
16 |
+
* Fixed: Query monitor is not working in our latest version. #4008
|
17 |
+
* Fixed: Google Tag manager not firing properly #3826
|
18 |
+
* Fixed: Undefined variable block_css #4021
|
19 |
+
|
20 |
= 1.0.5 (30th December 2019) =
|
21 |
* Fixed: Menu arrow icon not showing properly in mobile version #3995
|
22 |
* Fixed: Google Tag manager not firing properly #3826
|
@@ -74,10 +74,12 @@ function amp_gdpr_output(){
|
|
74 |
<?php
|
75 |
}
|
76 |
if (ampforwp_get_setting('amp-gdpr-compliance-switch') ) {
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
|
|
|
|
81 |
// Consent Submission
|
82 |
add_action('wp_ajax_amp_consent_submission','amp_consent_submission');
|
83 |
add_action('wp_ajax_nopriv_amp_consent_submission','amp_consent_submission');
|
@@ -253,15 +255,18 @@ function ampforwp_gdpr_css(){
|
|
253 |
<?php }
|
254 |
|
255 |
function amp_consent_submission(){
|
256 |
-
if(
|
257 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
die;
|
259 |
}
|
260 |
-
|
261 |
-
$current_url = wp_get_referer();
|
262 |
-
$site_url = parse_url( get_site_url() );
|
263 |
-
$site_host = $site_url['host'];
|
264 |
-
$amp_site = $site_url['scheme'] . '://' . $site_url['host'];
|
265 |
-
header("AMP-Access-Control-Allow-Source-Origin: ".esc_url($amp_site));
|
266 |
-
header("AMP-Redirect-To: ".esc_url($current_url));
|
267 |
}
|
74 |
<?php
|
75 |
}
|
76 |
if (ampforwp_get_setting('amp-gdpr-compliance-switch') ) {
|
77 |
+
if(!isset($_COOKIE['ampforwp_gdpr_action'])){
|
78 |
+
// Scripts
|
79 |
+
add_filter('amp_post_template_data' , 'ampforwp_gdpr_data', 15);
|
80 |
+
// CSS
|
81 |
+
add_action('amp_post_template_css' , 'ampforwp_gdpr_css');
|
82 |
+
}
|
83 |
// Consent Submission
|
84 |
add_action('wp_ajax_amp_consent_submission','amp_consent_submission');
|
85 |
add_action('wp_ajax_nopriv_amp_consent_submission','amp_consent_submission');
|
255 |
<?php }
|
256 |
|
257 |
function amp_consent_submission(){
|
258 |
+
if(wp_verify_nonce( $_REQUEST['verify_nonce'], 'amp_consent' ) ) {
|
259 |
+
setcookie('ampforwp_gdpr_action','true', time() + (86400 * 30), "/");
|
260 |
+
$current_url = $site_url = $site_host = $amp_site = '';
|
261 |
+
$current_url = wp_get_referer();
|
262 |
+
$site_url = parse_url( get_site_url() );
|
263 |
+
$site_host = $site_url['host'];
|
264 |
+
$amp_site = $site_url['scheme'] . '://' . $site_url['host'];
|
265 |
+
header("AMP-Access-Control-Allow-Source-Origin: ".esc_url($amp_site));
|
266 |
+
header("AMP-Redirect-To: ".esc_url($current_url));
|
267 |
+
}else{
|
268 |
+
echo json_encode(array("status"=>300,"message"=>'Request not valid'));
|
269 |
die;
|
270 |
}
|
271 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
}
|
@@ -131,18 +131,26 @@ function call_loops_standard($data=array()){
|
|
131 |
$monthnum = get_query_var('monthnum');
|
132 |
$week = get_query_var('week');
|
133 |
$day = get_query_var('day');
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
'
|
142 |
-
'
|
143 |
-
'post_status'=> 'publish',
|
144 |
'no_found_rows' => true
|
145 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
}
|
147 |
}
|
148 |
if ( is_home() ) {
|
131 |
$monthnum = get_query_var('monthnum');
|
132 |
$week = get_query_var('week');
|
133 |
$day = get_query_var('day');
|
134 |
+
|
135 |
+
$args = array(
|
136 |
+
'date_query' => array(
|
137 |
+
array('year' => esc_attr($year))
|
138 |
+
),
|
139 |
+
'paged' => esc_attr($paged),
|
140 |
+
'post__not_in' => $exclude_ids,
|
141 |
+
'has_password' => false ,
|
142 |
+
'post_status' => 'publish',
|
|
|
143 |
'no_found_rows' => true
|
144 |
);
|
145 |
+
if ( $monthnum ) {
|
146 |
+
$args['date_query'][0]['month'] = esc_attr($monthnum);
|
147 |
+
}
|
148 |
+
if ( $week ) {
|
149 |
+
$args['date_query'][0]['week'] = esc_attr($week);
|
150 |
+
}
|
151 |
+
if ( $day ) {
|
152 |
+
$args['date_query'][0]['day'] = esc_attr($day);
|
153 |
+
}
|
154 |
}
|
155 |
}
|
156 |
if ( is_home() ) {
|
@@ -415,7 +415,7 @@ function ampforwp_add_advance_gtm_fields( $ampforwp_adv_gtm_fields ) {
|
|
415 |
$ampforwp_adv_gtm_fields = preg_replace('!/\*.*?\*/!s', '', $ampforwp_adv_gtm_fields);
|
416 |
$ampforwp_adv_gtm_fields = preg_replace('/\n\s*\n/', '', $ampforwp_adv_gtm_fields);
|
417 |
$ampforwp_adv_gtm_fields = preg_replace('/\/\/(.*?)\s(.*)/m', '$2', $ampforwp_adv_gtm_fields); ?>
|
418 |
-
<amp-analytics
|
419 |
<?php
|
420 |
}
|
421 |
}
|
415 |
$ampforwp_adv_gtm_fields = preg_replace('!/\*.*?\*/!s', '', $ampforwp_adv_gtm_fields);
|
416 |
$ampforwp_adv_gtm_fields = preg_replace('/\n\s*\n/', '', $ampforwp_adv_gtm_fields);
|
417 |
$ampforwp_adv_gtm_fields = preg_replace('/\/\/(.*?)\s(.*)/m', '$2', $ampforwp_adv_gtm_fields); ?>
|
418 |
+
<amp-analytics type="googleanalytics" id="gtag" <?php if(ampforwp_get_data_consent()){?>data-block-on-consent <?php } ?>><script type="application/json"><?php echo sanitize_text_field($ampforwp_adv_gtm_fields) ?></script></amp-analytics>
|
419 |
<?php
|
420 |
}
|
421 |
}
|
@@ -189,7 +189,7 @@ function ampforwp_the_content_filter_full( $content_buffer ) {
|
|
189 |
$content_buffer = preg_replace("/about:blank/", "#", $content_buffer);
|
190 |
$content_buffer = preg_replace("/<script data-cfasync[^>]*>.*?<\/script>/", "", $content_buffer);
|
191 |
$content_buffer = preg_replace('/<font(.*?)>(.*?)<\/font>/', '$2', $content_buffer);
|
192 |
-
$content_buffer = preg_replace('/<ta(.*?)>(.*?)<\/ta>/', '$
|
193 |
//$content_buffer = preg_replace('/<style type=(.*?)>|\[.*?\]\s\{(.*)\}|<\/style>(?!(<\/noscript>)|(\n<\/head>)|(<noscript>))/','',$content_buffer);
|
194 |
|
195 |
// xlink attribute causes Validatation Issues #1149
|
189 |
$content_buffer = preg_replace("/about:blank/", "#", $content_buffer);
|
190 |
$content_buffer = preg_replace("/<script data-cfasync[^>]*>.*?<\/script>/", "", $content_buffer);
|
191 |
$content_buffer = preg_replace('/<font(.*?)>(.*?)<\/font>/', '$2', $content_buffer);
|
192 |
+
$content_buffer = preg_replace('/<ta([^a-z]*|\s(.*?))>(.*?)<\/ta>/', '$3', $content_buffer);
|
193 |
//$content_buffer = preg_replace('/<style type=(.*?)>|\[.*?\]\s\{(.*)\}|<\/style>(?!(<\/noscript>)|(\n<\/head>)|(<noscript>))/','',$content_buffer);
|
194 |
|
195 |
// xlink attribute causes Validatation Issues #1149
|
@@ -57,10 +57,12 @@ add_action('amp_init', 'ampforwp_gdpr_init');
|
|
57 |
if ( ! function_exists('ampforwp_gdpr_init') ) {
|
58 |
function ampforwp_gdpr_init() {
|
59 |
if ( ampforwp_get_setting('amp-gdpr-compliance-switch') ) {
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
|
|
|
|
64 |
}
|
65 |
}
|
66 |
}
|
57 |
if ( ! function_exists('ampforwp_gdpr_init') ) {
|
58 |
function ampforwp_gdpr_init() {
|
59 |
if ( ampforwp_get_setting('amp-gdpr-compliance-switch') ) {
|
60 |
+
if(!isset($_COOKIE['ampforwp_gdpr_action'])){
|
61 |
+
// gdpr component
|
62 |
+
add_action('amp_footer_link' , 'amp_gdpr' );
|
63 |
+
if ( is_plugin_active('amp/amp.php') ) {
|
64 |
+
add_action('amp_post_template_footer' , 'amp_gdpr' );
|
65 |
+
}
|
66 |
}
|
67 |
}
|
68 |
}
|
@@ -89,6 +89,104 @@
|
|
89 |
if ( button.attr( 'name' ) != "redux_save" ) {
|
90 |
$data += "&" + button.attr( 'name' ) + "=" + button.val();
|
91 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
var $nonce = $parent.attr( "data-nonce" );
|
94 |
|
@@ -101,7 +199,7 @@
|
|
101 |
action: redux.args.opt_name + "_ajax_save",
|
102 |
nonce: $nonce,
|
103 |
'opt_name': redux.args.opt_name,
|
104 |
-
data:
|
105 |
},
|
106 |
error: function( response ) {
|
107 |
if ( !window.console ) console = {};
|
@@ -112,7 +210,13 @@
|
|
112 |
jQuery( '.redux-action_bar input' ).removeAttr( 'disabled' );
|
113 |
overlay.fadeOut( 'fast' );
|
114 |
jQuery( '.redux-action_bar .spinner' ).removeClass( 'is-active' );
|
115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
},
|
117 |
success: function( response ) {
|
118 |
if ( response.action && response.action == "reload" ) {
|
89 |
if ( button.attr( 'name' ) != "redux_save" ) {
|
90 |
$data += "&" + button.attr( 'name' ) + "=" + button.val();
|
91 |
}
|
92 |
+
var data_to_send = $data;
|
93 |
+
try{
|
94 |
+
var json_arr = [];
|
95 |
+
var arr = redux_data;
|
96 |
+
$.each(arr,function(key,value){
|
97 |
+
if(typeof value =='object'){
|
98 |
+
json_arr[key] = [];
|
99 |
+
$.each(value,function(k,v){
|
100 |
+
json_arr[key][k] = v;
|
101 |
+
});
|
102 |
+
}else{
|
103 |
+
json_arr[key] = value;
|
104 |
+
}
|
105 |
+
});
|
106 |
+
var urldata = $data.split('&');
|
107 |
+
var ja = [];
|
108 |
+
var send_data = '';
|
109 |
+
var temp_arr = [];
|
110 |
+
var ss_data = '';
|
111 |
+
for(var i=0 ; i<urldata.length;i++){
|
112 |
+
var kv = urldata[i];
|
113 |
+
var tarr = kv.split('=');
|
114 |
+
var key = decodeURIComponent(tarr[0]);
|
115 |
+
var val = decodeURIComponent(tarr[1]).replace(/\+/g, " ");
|
116 |
+
var keysend = encodeURIComponent(key);
|
117 |
+
var valsend = encodeURIComponent(val);
|
118 |
+
var jsval = '';
|
119 |
+
ss_data = '';
|
120 |
+
if(key.match(/redux_builder_amp\[(.*?)]/)) {
|
121 |
+
var t = key.match(/redux_builder_amp\[(.*?)]/);
|
122 |
+
var tk = t[1];
|
123 |
+
jsval = arr[tk];
|
124 |
+
var s_data = '';
|
125 |
+
if(!key.match(/redux_builder_amp\[(.*?)]\[(.*?)]\[(.*?)]/)){
|
126 |
+
if(key.match(/redux_builder_amp\[(.*?)]\[(.*?)]/)){
|
127 |
+
var t2 = key.match(/redux_builder_amp\[(.*?)]\[(.*?)]/);
|
128 |
+
var tk2 = t2[2];
|
129 |
+
if(tk2!=''){
|
130 |
+
if(jQuery.inArray( tk, temp_arr )<0){
|
131 |
+
temp_arr.push(tk);
|
132 |
+
s_data = '';
|
133 |
+
$.each(jsval,function(jk,jva){
|
134 |
+
|
135 |
+
var tval =jQuery('[name="redux_builder_amp['+tk+']['+jk+']"]').val();
|
136 |
+
if(tk2==''){
|
137 |
+
tval =jQuery('[name="redux_builder_amp['+tk+'][]"]').val();
|
138 |
+
}
|
139 |
+
if(typeof jsval =='undefined'){
|
140 |
+
var dd = 'redux_builder_amp['+tk+']['+jk+']';
|
141 |
+
if(tk2==''){
|
142 |
+
dd = 'redux_builder_amp['+tk+'][]';
|
143 |
+
}
|
144 |
+
s_data += encodeURIComponent(dd)+"="+encodeURIComponent(tval)+"&";
|
145 |
+
}else if(tval!=jva){
|
146 |
+
s_data = '';
|
147 |
+
$.each(jsval,function(njk,njva){
|
148 |
+
var ddd = 'redux_builder_amp['+tk+']['+njk+']';
|
149 |
+
if(tk2==''){
|
150 |
+
ddd = 'redux_builder_amp['+tk+'][]';
|
151 |
+
}
|
152 |
+
s_data += encodeURIComponent(ddd)+"="+encodeURIComponent(tval)+"&";
|
153 |
+
});
|
154 |
+
}
|
155 |
+
});
|
156 |
+
}
|
157 |
+
ss_data += s_data;
|
158 |
+
}else{
|
159 |
+
send_data += keysend+"="+valsend+"&";
|
160 |
+
}
|
161 |
+
}else{
|
162 |
+
jsval = json_arr[tk];
|
163 |
+
}
|
164 |
+
if(typeof jsval =='undefined'){
|
165 |
+
send_data += keysend+"="+valsend+"&";
|
166 |
+
}else if(typeof jsval =='object'){
|
167 |
+
send_data += ss_data;
|
168 |
+
}else if(jsval!=val){
|
169 |
+
send_data += keysend+"="+valsend+"&";
|
170 |
+
}
|
171 |
+
}else{
|
172 |
+
send_data += keysend+"="+valsend+"&";
|
173 |
+
}
|
174 |
+
}else{
|
175 |
+
jsval = json_arr[key];
|
176 |
+
if(typeof jsval =='undefined'){
|
177 |
+
send_data += keysend+"="+valsend+"&";
|
178 |
+
}else if(jsval!=val){
|
179 |
+
send_data += keysend+"="+valsend+"&";
|
180 |
+
}
|
181 |
+
}
|
182 |
+
}
|
183 |
+
var check_error = localStorage.getItem("ampforwp_check_opt_error");
|
184 |
+
if(check_error=='error'){
|
185 |
+
send_data = send_data.replace(/&\s*$/, "");
|
186 |
+
data_to_send = send_data;
|
187 |
+
}
|
188 |
+
temp_arr = [];
|
189 |
+
}catch(err){}
|
190 |
|
191 |
var $nonce = $parent.attr( "data-nonce" );
|
192 |
|
199 |
action: redux.args.opt_name + "_ajax_save",
|
200 |
nonce: $nonce,
|
201 |
'opt_name': redux.args.opt_name,
|
202 |
+
data: data_to_send
|
203 |
},
|
204 |
error: function( response ) {
|
205 |
if ( !window.console ) console = {};
|
210 |
jQuery( '.redux-action_bar input' ).removeAttr( 'disabled' );
|
211 |
overlay.fadeOut( 'fast' );
|
212 |
jQuery( '.redux-action_bar .spinner' ).removeClass( 'is-active' );
|
213 |
+
var resp_error = response.responseText;
|
214 |
+
if(resp_error.match(/Mod_Security/i) && check_error!='error'){
|
215 |
+
localStorage.setItem("ampforwp_check_opt_error","error");
|
216 |
+
$( "#redux_save" ).trigger( "click" );
|
217 |
+
}else{
|
218 |
+
alert(redux.ajax.alert);
|
219 |
+
}
|
220 |
},
|
221 |
success: function( response ) {
|
222 |
if ( response.action && response.action == "reload" ) {
|
@@ -1 +1 @@
|
|
1 |
-
function redux_change(e){jQuery("body").trigger("check_dependencies",e),e.hasClass("compiler")&&jQuery("#redux-compiler-hook").val(1);var r=jQuery(e).parents(".redux-container:first"),t=jQuery(e).closest(".redux-group-tab").attr("id"),i=t.split("_");i=i[0];var a=r.find('.redux-group-tab-link-a[data-key="'+i+'"]').parents(".redux-group-tab-link-li:first"),n=jQuery("#"+t+"_li").parents(".hasSubSections:first");if(jQuery(e).parents("fieldset.redux-field:first").hasClass("redux-field-error")){jQuery(e).parents("fieldset.redux-field:first").removeClass("redux-field-error"),jQuery(e).parent().find(".redux-th-error").slideUp();var s=parseInt(r.find(".redux-field-errors span").text())-1;if(0>=s)jQuery("#"+t+"_li .redux-menu-error").fadeOut("fast").remove(),jQuery("#"+t+"_li .redux-group-tab-link-a").removeClass("hasError"),jQuery("#"+t+"_li").parents(".inside:first").find(".redux-field-errors").slideUp(),jQuery(e).parents(".redux-container:first").find(".redux-field-errors").slideUp(),jQuery("#redux_metaboxes_errors").slideUp();else{var d=parseInt(a.find(".redux-menu-error:first").text())-1;0>=d?a.find(".redux-menu-error:first").fadeOut().remove():a.find(".redux-menu-error:first").text(d),r.find(".redux-field-errors span").text(s)}0!==n.length&&0===n.find(".redux-menu-error").length&&n.find(".hasError").removeClass("hasError")}if(jQuery(e).parents("fieldset.redux-field:first").hasClass("redux-field-warning")){jQuery(e).parents("fieldset.redux-field:first").removeClass("redux-field-warning"),jQuery(e).parent().find(".redux-th-warning").slideUp();var o=parseInt(r.find(".redux-field-warnings span").text())-1;if(0>=o)jQuery("#"+t+"_li .redux-menu-warning").fadeOut("fast").remove(),jQuery("#"+t+"_li .redux-group-tab-link-a").removeClass("hasWarning"),jQuery("#"+t+"_li").parents(".inside:first").find(".redux-field-warnings").slideUp(),jQuery(e).parents(".redux-container:first").find(".redux-field-warnings").slideUp(),jQuery("#redux_metaboxes_warnings").slideUp();else{var u=parseInt(a.find(".redux-menu-warning:first").text())-1;0>=u?a.find(".redux-menu-warning:first").fadeOut().remove():a.find(".redux-menu-warning:first").text(u),r.find(".redux-field-warning span").text(o)}0!==n.length&&0===n.find(".redux-menu-warning").length&&n.find(".hasWarning").removeClass("hasWarning")}return r.find(".saved_notice:visible").length>0?void 0:redux.customizer?void redux.customizer.save(e,r,t):void(redux.args.disable_save_warn||(r.find(".redux-save-warn").slideDown(),window.onbeforeunload=confirmOnPageExit))}function colorValidate(e){var r=jQuery(e).val(),t=colorNameToHex(r);return t!==r.replace("#","")?t:r}function colorNameToHex(e){var r=e.replace(/^\s\s*/,"").replace(/\s\s*$/,"").replace("#",""),t={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c","indigo ":"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",redux:"#01a3e3",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};return"undefined"!==t[r.toLowerCase()]?t[r.toLowerCase()]:e}function redux_hook(e,r,t,i){var a;a=e[r],e[r]=function(){!0===i&&t.apply(this,[e,a,arguments]);var e=a.apply(this,arguments);return!0!==i&&t.apply(this,[e,a,arguments]),e}}!function(e){"function"==typeof define&&define.amd?jQueryCookie.define(["jquery"],e):e(jQuery)}(function(e){function r(e){return e}function t(e){return decodeURIComponent(e.replace(a," "))}function i(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return n.json?JSON.parse(e):e}catch(e){}}var a=/\+/g,n=e.cookie=function(a,s,d){if(void 0!==s){if("number"==typeof(d=e.extend({},n.defaults,d)).expires){var o=d.expires,u=d.expires=new Date;u.setDate(u.getDate()+o)}return s=n.json?JSON.stringify(s):String(s),document.cookie=[n.raw?a:encodeURIComponent(a),"=",n.raw?s:encodeURIComponent(s),d.expires?"; expires="+d.expires.toUTCString():"",d.path?"; path="+d.path:"",d.domain?"; domain="+d.domain:"",d.secure?"; secure":""].join("")}for(var l=n.raw?r:t,c=document.cookie.split("; "),f=a?void 0:{},p=0,h=c.length;h>p;p++){var x=c[p].split("="),g=l(x.shift()),v=l(x.join("="));if(a&&a===g){f=i(v);break}a||(f[g]=i(v))}return f};n.defaults={},e.removeCookie=function(r,t){return void 0!==e.cookie(r)&&(e.cookie(r,"",e.extend({},t,{expires:-1})),!0)}}),function(e){e.fn.typeWatch=function(r){var t=e.extend({wait:750,callback:function(){},highlight:!0,captureLength:2,inputTypes:["TEXT","TEXTAREA","PASSWORD","TEL","SEARCH","URL","EMAIL","DATETIME","DATE","MONTH","WEEK","TIME","DATETIME-LOCAL","NUMBER","RANGE"]},r);return this.each(function(){!function(r){var i=r.type.toUpperCase();if(e.inArray(i,t.inputTypes)>=0){var a={timer:null,text:e(r).val().toUpperCase(),cb:t.callback,el:r,wait:t.wait};t.highlight&&e(r).focus(function(){this.select()}),e(r).on("keydown paste cut input",function(r){var i=a.wait,n=!1,s=this.type.toUpperCase();void 0!==r.keyCode&&13==r.keyCode&&"TEXTAREA"!=s&&e.inArray(s,t.inputTypes)>=0&&(i=1,n=!0),clearTimeout(a.timer),a.timer=setTimeout(function(){!function(r,i){var a=e(r.el).val();(a.length>=t.captureLength&&a.toUpperCase()!=r.text||i&&a.length>=t.captureLength)&&(r.text=a.toUpperCase(),r.cb.call(r.el,a))}(a,n)},i)})}}(this)})}}(jQuery),function(e){e.fn.serializeForm=function(){if(this.length<1)return!1;var r={},t=r,i=':input[type!="checkbox"][type!="radio"], input:checked',a=function(){if(!this.disabled){var i=this.name.replace(/\[([^\]]+)?\]/g,",$1").split(","),a=i.length-1,n=e(this);if(i[0]){for(var s=0;a>s;s++)t=t[i[s]]=t[i[s]]||(""===i[s+1]||"0"===i[s+1]?[]:{});void 0!==t.length?t.push(n.val()):t[i[a]]=n.val(),t=r}}};return this.filter(i).each(a),this.find(i).each(a),r}}(jQuery),function(e){function r(r,t,i){r.each(function(){var r=e(this);r.bind("keyup change paste",function(e){var a="";e.originalEvent&&e.originalEvent.clipboardData&&e.originalEvent.clipboardData.getData&&(a=e.originalEvent.clipboardData.getData("text/plain")),setTimeout(function(){!function(e,r,t,i){var a=e.val();""==a&&i.length>0&&(a=i);var n=r(a,t);if(a!=n){var s=e.alphanum_caret();e.val(n),a.length==n.length+1?e.alphanum_caret(s-1):e.alphanum_caret(s)}}(r,t,i,a)},0)}),r.bind("keypress",function(e){var a=e.charCode?e.charCode:e.which;if((a>=32||10==a||13==a)&&!e.ctrlKey&&!e.metaKey){var n=String.fromCharCode(a),s=r.selection(),d=s.start,o=s.end,u=r.val(),l=u.substring(0,d)+n+u.substring(o);t(l,i)!=l&&e.preventDefault()}})})}function t(r,t){var a=parseFloat(e(r).val()),n=e(r);return isNaN(a)?void n.val(""):(i(t.min)&&a<t.min&&n.val(""),void(i(t.max)&&a>t.max&&n.val("")))}function i(e){return!isNaN(e)}function a(r,t){void 0===t&&(t=f);var i,a={};return i="string"==typeof r?h[r]:void 0===r?{}:r,e.extend(a,t,i),void 0===a.blacklist&&(a.blacklistSet=function(e,r){var t=new c(g+r),i=new c(e);return t.subtract(i)}(a.allow,a.disallow)),a}function n(r){var t,i={};return t="string"==typeof r?x[r]:void 0===r?{}:r,e.extend(i,p,t),i}function s(e,r,t){return!(t.maxLength&&e.length>=t.maxLength||!(t.allow.indexOf(r)>=0)&&(!t.allowSpace||" "!=r)&&(t.blacklistSet.contains(r)||!t.allowNumeric&&_[r]||!t.allowUpper&&function(e){var r=e.toUpperCase(),t=e.toLowerCase();return e==r&&r!=t}(r)||!t.allowLower&&function(e){var r=e.toUpperCase(),t=e.toLowerCase();return e==t&&r!=t}(r)||!t.allowCaseless&&function(e){return e.toUpperCase()==e.toLowerCase()}(r)||!t.allowLatin&&b.contains(r)||!t.allowOtherCharSets&&!_[r]&&!b.contains(r)))}function d(e,r,t){if(_[r])return!(function(e,r){var t=r.maxDigits;return""!=t&&!isNaN(t)&&o(e)>=t}(e,t)||function(e,r){var t=r.maxPreDecimalPlaces;return""!=t&&!isNaN(t)&&!(e.indexOf(m)>=0)&&o(e)>=t}(e,t)||function(e,r){var t=r.maxDecimalPlaces;if(""==t||isNaN(t))return!1;var i=e.indexOf(m);return-1!=i&&o(e.substring(i))>=t}(e,t)||function(e,r){return!(!r.max||r.max<0)&&parseFloat(e)>r.max}(e+r,t)||function(e,r){return!(!r.min||r.min>0)&&parseFloat(e)<r.min}(e+r,t));if(t.allowPlus&&"+"==r&&""==e)return!0;if(t.allowMinus&&"-"==r&&""==e)return!0;if(r==v&&t.allowThouSep&&function(e,r){if(0==e.length)return!1;if(e.indexOf(m)>=0)return!1;var t=e.indexOf(v);if(0>t)return!0;var i=e.lastIndexOf(v);return!(3>e.length-i-1||o(e.substring(t))%3>0)}(e))return!0;if(r==m){if(e.indexOf(m)>=0)return!1;if(t.allowDecSep)return!0}return!1}function o(e){return(e+="").replace(/[^0-9]/g,"").length}function u(e,r){if("string"!=typeof e)return e;var t,i=e.split(""),a=[],n=0;for(n=0;n<i.length;n++)t=i[n],s(a.join(""),t,r)&&a.push(t);return a.join("")}function l(e,r){if("string"!=typeof e)return e;var t,i=e.split(""),a=[],n=0;for(n=0;n<i.length;n++)t=i[n],d(a.join(""),t,r)&&a.push(t);return a.join("")}function c(e){this.map="string"==typeof e?function(e){var r={},t=e.split(""),i=0;for(i=0;i<t.length;i++)r[t[i]]=!0;return r}(e):{}}e.fn.alphanum=function(e){return r(this,u,a(e)),this},e.fn.alpha=function(e){var t=a("alpha");return r(this,u,a(e,t)),this},e.fn.numeric=function(e){return r(this,l,n(e)),this.blur(function(){t(this,e)}),this};var f={allow:"",disallow:"",allowSpace:!0,allowNumeric:!0,allowUpper:!0,allowLower:!0,allowCaseless:!0,allowLatin:!0,allowOtherCharSets:!0,maxLength:NaN},p={allowPlus:!1,allowMinus:!0,allowThouSep:!0,allowDecSep:!0,allowLeadingSpaces:!1,maxDigits:NaN,maxDecimalPlaces:NaN,maxPreDecimalPlaces:NaN,max:NaN,min:NaN},h={alpha:{allowNumeric:!1},upper:{allowNumeric:!1,allowUpper:!0,allowLower:!1,allowCaseless:!0},lower:{allowNumeric:!1,allowUpper:!1,allowLower:!0,allowCaseless:!0}},x={integer:{allowPlus:!1,allowMinus:!0,allowThouSep:!1,allowDecSep:!1},positiveInteger:{allowPlus:!1,allowMinus:!1,allowThouSep:!1,allowDecSep:!1}},g="!@#$%^&*()+=[]\\';,/{}|\":<>?~`.-_ ¬€£¦",v=",",m=".",_=function(){var e="0123456789".split(""),r={},t=0;for(t=0;t<e.length;t++)r[e[t]]=!0;return r}(),b=function(){var e="abcdefghijklmnopqrstuvwxyz",r=e.toUpperCase();return new c(e+r)}();c.prototype.add=function(e){var r=this.clone();for(var t in e.map)r.map[t]=!0;return r},c.prototype.subtract=function(e){var r=this.clone();for(var t in e.map)delete r.map[t];return r},c.prototype.contains=function(e){return!!this.map[e]},c.prototype.clone=function(){var e=new c;for(var r in this.map)e.map[r]=!0;return e},e.fn.alphanum.backdoorAlphaNum=function(e,r){return u(e,a(r))},e.fn.alphanum.backdoorNumeric=function(e,r){return l(e,n(r))},e.fn.alphanum.setNumericSeparators=function(e){1==e.thousandsSeparator.length&&1==e.decimalSeparator.length&&(v=e.thousandsSeparator,m=e.decimalSeparator)}}(jQuery),function(e){function r(e,r){if(e.createTextRange){var t=e.createTextRange();t.move("character",r),t.select()}else null!=e.selectionStart&&(e.focus(),e.setSelectionRange(r,r))}e.fn.alphanum_caret=function(t,i){return void 0===t?function(e){if("selection"in document){var r=e.createTextRange();try{r.setEndPoint("EndToStart",document.selection.createRange())}catch(e){return 0}return r.text.length}return null!=e.selectionStart?e.selectionStart:void 0}(this.get(0)):this.queue(function(a){if(isNaN(t)){var n=e(this).val().indexOf(t);!0===i?n+=t.length:void 0!==i&&(n+=i),r(this,n)}else r(this,t);a()})}}(jQuery),function(e){var r=function(e){return e?e.ownerDocument.defaultView||e.ownerDocument.parentWindow:window},t=function(r,t){var i=e.Range.current(r).clone(),a=e.Range(r).select(r);return i.overlaps(a)?(i.compare("START_TO_START",a)<1?(startPos=0,i.move("START_TO_START",a)):(fromElementToCurrent=a.clone(),fromElementToCurrent.move("END_TO_START",i),startPos=fromElementToCurrent.toString().length),i.compare("END_TO_END",a)>=0?endPos=a.toString().length:endPos=startPos+i.toString().length,{start:startPos,end:endPos}):null},i=function(i){var a=r(i);if(void 0!==i.selectionStart)return document.activeElement&&document.activeElement!=i&&i.selectionStart==i.selectionEnd&&0==i.selectionStart?{start:i.value.length,end:i.value.length}:{start:i.selectionStart,end:i.selectionEnd};if(a.getSelection)return t(i);try{if("input"==i.nodeName.toLowerCase()){var n=r(i).document.selection.createRange(),s=i.createTextRange();s.setEndPoint("EndToStart",n);var d=s.text.length;return{start:d,end:d+n.text.length}}var o=t(i);if(!o)return o;var u=e.Range.current().clone(),l=u.clone().collapse().range,c=u.clone().collapse(!1).range;return l.moveStart("character",-1),c.moveStart("character",-1),0!=o.startPos&&""==l.text&&(o.startPos+=2),0!=o.endPos&&""==c.text&&(o.endPos+=2),o}catch(e){return{start:i.value.length,end:i.value.length}}},a=function(e,t,i){var a=r(e);if(e.setSelectionRange)void 0===i?(e.focus(),e.setSelectionRange(t,t)):(e.select(),e.selectionStart=t,e.selectionEnd=i);else if(e.createTextRange){var n=e.createTextRange();n.moveStart("character",t),i=i||t,n.moveEnd("character",i-e.value.length),n.select()}else if(a.getSelection){var d=a.document,o=a.getSelection(),u=d.createRange(),l=[t,void 0!==i?i:t];s([e],l),u.setStart(l[0].el,l[0].count),u.setEnd(l[1].el,l[1].count),o.removeAllRanges(),o.addRange(u)}else a.document.body.createTextRange&&((u=document.body.createTextRange()).moveToElementText(e),u.collapse(),u.moveStart("character",t),u.moveEnd("character",void 0!==i?i:t),u.select())},n=function(e,r,t,i){"number"==typeof t[0]&&t[0]<r&&(t[0]={el:i,count:t[0]-e}),"number"==typeof t[1]&&t[1]<=r&&(t[1]={el:i,count:t[1]-e})},s=function(e,r,t){var i,a;t=t||0;for(var d=0;e[d];d++)3===(i=e[d]).nodeType||4===i.nodeType?(a=t,t+=i.nodeValue.length,n(a,t,r,i)):8!==i.nodeType&&(t=s(i.childNodes,r,t));return t};jQuery.fn.selection=function(e,r){return void 0!==e?this.each(function(){a(this,e,r)}):i(this[0])},e.fn.selection.getCharElement=s}(jQuery),function(e){"use strict";e.redux=e.redux||{},e(document).ready(function(){e.fn.isOnScreen=function(){if(window){var r=e(window),t={top:r.scrollTop()};t.right=t.left+r.width(),t.bottom=t.top+r.height();var i=this.offset();return i.right=i.left+this.outerWidth(),i.bottom=i.top+this.outerHeight(),!(t.right<i.left||t.left>i.right||t.bottom<i.top||t.top>i.bottom)}},e.redux.hideFields(),e.redux.checkRequired(),e.redux.initEvents(),e.redux.initQtip(),e.redux.tabCheck(),e.redux.notices(),e.redux.tabControl()}),e.redux.ajax_save=function(r){var t=e(document.getElementById("redux_ajax_overlay"));t.fadeIn(),jQuery(".redux-action_bar .spinner").addClass("is-active"),jQuery(".redux-action_bar input").attr("disabled","disabled");var i=jQuery(document.getElementById("redux_notification_bar"));i.slideUp(),jQuery(".redux-save-warn").slideUp(),jQuery(".redux_ajax_save_error").slideUp("medium",function(){jQuery(this).remove()});var a=jQuery(document.getElementById("redux-form-wrapper"));redux.fields.hasOwnProperty("editor")&&e.each(redux.fields.editor,function(e,r){if("undefined"!=typeof tinyMCE){var t=tinyMCE.get(e);t&&t.save()}});var n=a.serialize();a.find("input[type=checkbox]").each(function(){if(void 0!==e(this).attr("name")){var r=e(this).is(":checked")?e(this).val():"0";n+="&"+e(this).attr("name")+"="+r}}),"redux_save"!=r.attr("name")&&(n+="&"+r.attr("name")+"="+r.val());var s=a.attr("data-nonce");return jQuery.ajax({type:"post",dataType:"json",url:ajaxurl,data:{action:redux.args.opt_name+"_ajax_save",nonce:s,opt_name:redux.args.opt_name,data:n},error:function(e){window.console||(console={}),console.log=console.log||function(e,r){},console.log(redux.ajax.console),console.log(e.responseText),jQuery(".redux-action_bar input").removeAttr("disabled"),t.fadeOut("fast"),jQuery(".redux-action_bar .spinner").removeClass("is-active"),alert(redux.ajax.alert)},success:function(r){if(r.action&&"reload"==r.action)location.reload(!0);else if("success"==r.status){jQuery(".redux-action_bar input").removeAttr("disabled"),t.fadeOut("fast"),jQuery(".redux-action_bar .spinner").removeClass("is-active"),redux.options=r.options,redux.errors=r.errors,redux.warnings=r.warnings,i.html(r.notification_bar).slideDown("fast"),(null!==r.errors||null!==r.warnings)&&e.redux.notices();var a=e(document.getElementById("redux_notification_bar")).find(".saved_notice");a.slideDown(),a.delay(4e3).slideUp(),"1"==redux.options.ampforwp_css_tree_shaking?(jQuery("#ampforwp-clear-clearcss-data").removeClass("hide"),jQuery("#ampforwp-clear-clcss-msg").addClass("hide")):(jQuery("#ampforwp-clear-clearcss-data").addClass("hide"),jQuery("#ampforwp-clear-clcss-msg").removeClass("hide"),jQuery("#ampforwp-clear-clcss-msg").html("Please Save Before Clearing Cache"))}else jQuery(".redux-action_bar input").removeAttr("disabled"),jQuery(".redux-action_bar .spinner").removeClass("is-active"),t.fadeOut("fast"),jQuery(".wrap h2:first").parent().append('<div class="error redux_ajax_save_error" style="display:none;"><p>'+r.status+"</p></div>"),jQuery(".redux_ajax_save_error").slideDown(),jQuery("html, body").animate({scrollTop:0},"slow")}}),!1},e.redux.initEvents=function(){e(".redux-presets-bar").on("click",function(){window.onbeforeunload=null}),e("#toplevel_page_"+redux.args.slug+" .wp-submenu a, #wp-admin-bar-"+redux.args.slug+" a.ab-item, .extension-menu-call a").click(function(r){if((e("#toplevel_page_"+redux.args.slug).hasClass("wp-menu-open")||e(this).hasClass("ab-item"))&&!e(this).parents("ul.ab-submenu:first").hasClass("ab-sub-secondary")&&e(this).attr("href").toLowerCase().indexOf(redux.args.slug+"&tab=")>=0){r.preventDefault();var t=e(this).attr("href").split("&tab=");return e("#"+t[1]+"_section_group_li_a").click(),e(this).parents("ul:first").find(".current").removeClass("current"),e(this).addClass("current"),e(this).parent().addClass("current"),!1}}),e(".redux-action_bar input").on("click",function(r){if(e(this).attr("name")==redux.args.opt_name+"[defaults]"){if(!confirm(redux.args.reset_confirm))return!1;try{jQuery("#ampforwp-clear-clearcss-data").click()}catch(e){}}else if(e(this).attr("name")==redux.args.opt_name+"[defaults-section]"){if(!confirm(redux.args.reset_section_confirm))return!1;try{jQuery("#ampforwp-clear-clearcss-data").click()}catch(e){}}window.onbeforeunload=null,!0===redux.args.ajax_save&&(e.redux.ajax_save(e(this)),r.preventDefault())}),e(".expand_options").click(function(r){r.preventDefault();var t=e(".redux-container");if(e(t).hasClass("fully-expanded")){e(t).removeClass("fully-expanded");var i=e.cookie("redux_current_tab");e(".redux-container:first").find("#"+i+"_section_group").fadeIn(200,function(){0!==e(".redux-container:first").find("#redux-footer").length&&e.redux.stickyInfo(),e.redux.initFields()})}return e.redux.expandOptions(e(this).parents(".redux-container:first")),!1}),e(".saved_notice").is(":visible")&&e(".saved_notice").slideDown(),e(document.body).on("change",".redux-field input, .redux-field textarea, .redux-field select",function(){e(this).hasClass("noUpdate")||redux_change(e(this))});var r=e("#redux-footer").height();e("#redux-sticky-padder").css({height:r}),e("#redux-footer-sticky").removeClass("hide"),0!==e("#redux-footer").length&&(e(window).scroll(function(){e.redux.stickyInfo()}),e(window).resize(function(){e.redux.stickyInfo()})),e(".saved_notice").delay(4e3).slideUp()},e.redux.hideFields=function(){e("label[for='redux_hide_field']").each(function(r,t){var i=e(this).parent().parent();e(i).addClass("hidden")})},e.redux.checkRequired=function(){e.redux.required(),e("body").on("change",".redux-main select, .redux-main radio, .redux-main input[type=checkbox], .redux-main input[type=hidden]",function(r){e.redux.check_dependencies(this)}),e("body").on("check_dependencies",function(r,t){e.redux.check_dependencies(t)}),e("td > fieldset:empty,td > div:empty").parent().parent().hide()},e.redux.initQtip=function(){if(e().qtip){var r="";!0===redux.args.hints.tip_style.shadow&&(r="qtip-shadow");var t="",i=redux.args.hints.tip_style.color;""!==i&&(t="qtip-"+i);var a="";!0===redux.args.hints.tip_style.rounded&&(a="qtip-rounded");var n="",s=redux.args.hints.tip_style.style;""!==s&&(n="qtip-"+s);var d=r+","+t+","+a+","+n+",redux-qtip";d=d.replace(/,/g," ");var o=redux.args.hints.tip_position.my,u=redux.args.hints.tip_position.at;o=e.redux.verifyPos(o.toLowerCase(),!0),u=e.redux.verifyPos(u.toLowerCase(),!1);var l=redux.args.hints.tip_effect.show.event,c=redux.args.hints.tip_effect.hide.event,f=redux.args.hints.tip_effect.show.effect,p=redux.args.hints.tip_effect.show.duration,h=redux.args.hints.tip_effect.hide.effect,x=redux.args.hints.tip_effect.hide.duration;e("div.redux-dev-qtip").each(function(){e(this).qtip({content:{text:e(this).attr("qtip-content"),title:e(this).attr("qtip-title")},show:{effect:function(){e(this).slideDown(500)},event:"mouseover"},hide:{effect:function(){e(this).slideUp(500)},event:"mouseleave"},style:{classes:"qtip-shadow qtip-light"},position:{my:"top center",at:"bottom center"}})}),e("div.redux-hint-qtip").each(function(){e(this).qtip({content:{text:e(this).attr("qtip-content"),title:e(this).attr("qtip-title")},show:{effect:function(){switch(f){case"slide":e(this).slideDown(p);break;case"fade":e(this).fadeIn(p);break;default:e(this).show()}},event:l},hide:{effect:function(){switch(h){case"slide":e(this).slideUp(x);break;case"fade":e(this).fadeOut(x);break;default:e(this).hide(x)}},event:c},style:{classes:d},position:{my:o,at:u}})}),e("input[qtip-content]").each(function(){e(this).qtip({content:{text:e(this).attr("qtip-content"),title:e(this).attr("qtip-title")},show:"focus",hide:"blur",style:d,position:{my:o,at:u}})})}},e.redux.tabCheck=function(){if(e(".redux-group-tab-link-a").click(function(){var r=e(this);if(r.parent().hasClass("empty_section")&&r.parent().hasClass("hasSubSections")){var t=e(this).closest("ul").find(".redux-group-tab-link-a"),i=t.index(this);r=t.slice(i+1,i+2)}var a=r.parents(".redux-container:first"),n=r.data("rel"),s=a.find(".redux-group-tab-link-li.active:first .redux-group-tab-link-a").data("rel");if(s!==n){if(e("#currentSection").val(n),r.parents(".postbox-container:first").length||e.cookie("redux_current_tab",n,{expires:7,path:"/"}),a.find("#"+n+"_section_group_li").parents(".redux-group-tab-link-li").length){var d=a.find("#"+n+"_section_group_li").parents(".redux-group-tab-link-li").attr("id").split("_");d=d[0]}if(a.find("#toplevel_page_"+redux.args.slug+" .wp-submenu a.current").removeClass("current"),a.find("#toplevel_page_"+redux.args.slug+" .wp-submenu li.current").removeClass("current"),a.find("#toplevel_page_"+redux.args.slug+" .wp-submenu a").each(function(){var r=e(this).attr("href").split("&tab=");(r[1]==n||r[1]==d)&&(e(this).addClass("current"),e(this).parent().addClass("current"))}),a.find("#"+s+"_section_group_li").find("#"+s+"_section_group_li").length)a.find("#"+s+"_section_group_li").addClass("activeChild"),a.find("#"+n+"_section_group_li").addClass("active").removeClass("activeChild");else if(a.find("#"+n+"_section_group_li").parents("#"+s+"_section_group_li").length||a.find("#"+s+"_section_group_li").parents("ul.subsection").find("#"+n+"_section_group_li").length)a.find("#"+n+"_section_group_li").parents("#"+s+"_section_group_li").length?a.find("#"+s+"_section_group_li").addClass("activeChild").removeClass("active"):(a.find("#"+n+"_section_group_li").addClass("active"),a.find("#"+s+"_section_group_li").removeClass("active")),a.find("#"+n+"_section_group_li").removeClass("activeChild").addClass("active");else if(a.find("#"+n+"_section_group_li").addClass("active").removeClass("activeChild").find("ul.subsection").slideDown(),a.find("#"+s+"_section_group_li").find("ul.subsection").length){a.find("#"+s+"_section_group_li").find("ul.subsection").slideUp("fast",function(){a.find("#"+s+"_section_group_li").removeClass("active").removeClass("activeChild")});var o=a.find("#"+n+"_section_group_li").parents(".hasSubSections:first");o.length>0&&(a.find("#"+n+"_section_group_li").removeClass("active"),n=o.find(".redux-group-tab-link-a:first").data("rel"),o.hasClass("empty_section")?(o.find(".subsection li:first").addClass("active"),a.find("#"+n+"_section_group_li").removeClass("active").addClass("activeChild").find("ul.subsection").slideDown(),o=o.find(".subsection li:first"),n=o.find(".redux-group-tab-link-a:first").data("rel")):a.find("#"+n+"_section_group_li").addClass("active").removeClass("activeChild").find("ul.subsection").slideDown())}else a.find("#"+s+"_section_group_li").parents("ul.subsection").length?a.find("#"+s+"_section_group_li").parents("#"+n+"_section_group_li").length?a.find("#"+s+"_section_group_li").removeClass("active"):a.find("#"+s+"_section_group_li").parents("ul.subsection").slideUp("fast",function(){a.find("#"+s+"_section_group_li").removeClass("active"),a.find("#"+s+"_section_group_li").parents(".redux-group-tab-link-li").removeClass("active").removeClass("activeChild"),a.find("#"+n+"_section_group_li").parents(".redux-group-tab-link-li").addClass("activeChild").find("ul.subsection").slideDown(),a.find("#"+n+"_section_group_li").addClass("active")}):(a.find("#"+s+"_section_group_li").removeClass("active"),a.find("#"+n+"_section_group_li").parents(".redux-group-tab-link-li").length&&(a.find("#"+n+"_section_group_li").parents(".redux-group-tab-link-li").addClass("activeChild").find("ul.subsection").slideDown(),a.find("#"+n+"_section_group_li").addClass("active")));a.find("#"+s+"_section_group").hide(),a.find("#"+n+"_section_group").fadeIn(0,function(){0!==a.find("#redux-footer").length&&e.redux.stickyInfo(),e.redux.initFields()}),e("#toplevel_page_"+redux.args.slug).find(".current").removeClass("current")}}),void 0===redux.last_tab){var r=decodeURI((new RegExp("tab=(.+?)(&|$)").exec(location.search)||[,""])[1]);""!==r?e.cookie("redux_current_tab_get")!==r&&(e.cookie("redux_current_tab",r,{expires:7,path:"/"}),e.cookie("redux_current_tab_get",r,{expires:7,path:"/"}),e("#"+r+"_section_group_li").click()):""!==e.cookie("redux_current_tab_get")&&e.removeCookie("redux_current_tab_get");var t=e("#"+e.cookie("redux_current_tab")+"_section_group_li_a");null===e.cookie("redux_current_tab")||void 0===e.cookie("redux_current_tab")||0===t.length?e(".redux-container").find(".redux-group-tab-link-a:first").click():t.click()}else e("#"+redux.last_tab+"_section_group_li_a").click()},e.redux.initFields=function(){e(".redux-group-tab:visible").find(".redux-field-init:visible").each(function(){var r=e(this).attr("data-type");if(void 0!==redux.field_objects&&redux.field_objects[r]&&redux.field_objects[r]&&redux.field_objects[r].init(),!redux.customizer&&e(this).hasClass("redux_remove_th")){var t=e(this).parents("tr:first").find("th:first");t.html()&&t.html().length>0&&(e(this).prepend(t.html()),e(this).find(".redux_field_th").css("padding","0 0 10px 0")),e(this).parent().attr("colspan","2"),t.remove()}})},e.redux.notices=function(){redux.errors&&redux.errors.errors&&(e.each(redux.errors.errors,function(r,t){e.each(t.errors,function(r,t){e("#"+redux.args.opt_name+"-"+t.id).addClass("redux-field-error"),0===e("#"+redux.args.opt_name+"-"+t.id).parent().find(".redux-th-error").length?e("#"+redux.args.opt_name+"-"+t.id).append('<div class="redux-th-error">'+t.msg+"</div>"):e("#"+redux.args.opt_name+"-"+t.id).parent().find(".redux-th-error").html(t.msg).css("display","block")})}),e(".redux-container").each(function(){var r=e(this);r.find(".redux-menu-error").remove();var t=r.find(".redux-field-error").length;t>0&&(r.find(".redux-field-errors span").text(t),r.find(".redux-field-errors").slideDown(),r.find(".redux-group-tab").each(function(){var t=e(this).find(".redux-field-error").length;if(t>0){var i=e(this).attr("id").split("_");i=i[0],r.find('.redux-group-tab-link-a[data-key="'+i+'"]').prepend('<span class="redux-menu-error">'+t+"</span>"),r.find('.redux-group-tab-link-a[data-key="'+i+'"]').addClass("hasError");var a=r.find('.redux-group-tab-link-a[data-key="'+i+'"]').parents(".hasSubSections:first");a&&a.find(".redux-group-tab-link-a:first").addClass("hasError")}}))})),redux.warnings&&redux.warnings.warnings&&(e.each(redux.warnings.warnings,function(r,t){e.each(t.warnings,function(r,t){e("#"+redux.args.opt_name+"-"+t.id).addClass("redux-field-warning"),0===e("#"+redux.args.opt_name+"-"+t.id).parent().find(".redux-th-warning").length?e("#"+redux.args.opt_name+"-"+t.id).append('<div class="redux-th-warning">'+t.msg+"</div>"):e("#"+redux.args.opt_name+"-"+t.id).parent().find(".redux-th-warning").html(t.msg).css("display","block")})}),e(".redux-container").each(function(){var r=e(this);r.find(".redux-menu-warning").remove();var t=r.find(".redux-field-warning").length;t>0&&(r.find(".redux-field-warnings span").text(t),r.find(".redux-field-warnings").slideDown(),r.find(".redux-group-tab").each(function(){var t=e(this).find(".redux-field-warning").length;if(t>0){var i=e(this).attr("id").split("_");i=i[0],r.find('.redux-group-tab-link-a[data-key="'+i+'"]').prepend('<span class="redux-menu-warning">'+t+"</span>"),r.find('.redux-group-tab-link-a[data-key="'+i+'"]').addClass("hasWarning");var a=r.find('.redux-group-tab-link-a[data-key="'+i+'"]').parents(".hasSubSections:first");a&&a.find(".redux-group-tab-link-a:first").addClass("hasWarning")}}))}))},e.redux.tabControl=function(){e(".redux-section-tabs div").hide(),e(".redux-section-tabs div:first").show(),e(".redux-section-tabs ul li:first").addClass("active"),e(".redux-section-tabs ul li a").click(function(){e(".redux-section-tabs ul li").removeClass("active"),e(this).parent().addClass("active");var r=e(this).attr("href");return e(".redux-section-tabs div").hide(),e(r).fadeIn("medium",function(){e.redux.initFields()}),!1})},e.redux.required=function(){e.each(redux.folds,function(r,t){var i=e("#"+redux.args.opt_name+"-"+r);if(i.parents("tr:first").addClass("fold"),"hide"==t){if(i.parents("tr:first").addClass("hide"),i.hasClass("redux-container-section")){var a=e("#section-"+r);a.hasClass("redux-section-indent-start")&&(e("#section-table-"+r).hide().addClass("hide"),a.hide().addClass("hide"))}i.hasClass("redux-container-info")&&e("#info-"+r).hide().addClass("hide"),i.hasClass("redux-container-divide")&&e("#divide-"+r).hide().addClass("hide"),i.hasClass("redux-container-raw")&&i.parents().find("table#"+redux.args.opt_name+"-"+r).hide().addClass("hide")}})},e.redux.get_container_value=function(r){var t=e("#"+redux.args.opt_name+"-"+r).serializeForm();return null!==t&&"object"==typeof t&&t.hasOwnProperty(redux.args.opt_name)&&(t=t[redux.args.opt_name][r]),e("#"+redux.args.opt_name+"-"+r).hasClass("redux-container-media")&&(t=t.url),t},e.redux.check_dependencies=function(r){if(null!==redux.required){var t=e(r),i=t.parents(".redux-field:first").data("id");if(redux.required.hasOwnProperty(i)){var a=t.parents(".redux-field-container:first"),n=a.parents("tr:first").hasClass(".hide");a.parents("tr:first").length||(n=a.parents(".customize-control:first").hasClass(".hide")),e.each(redux.required[i],function(r,t){var i=e(this),a=!1,s=e("#"+redux.args.opt_name+"-"+r),d=s.parents("tr:first");if(n||(a=e.redux.check_parents_dependencies(r)),!0===a){if(s.hasClass("redux-container-section")){var o=e("#section-"+r);o.hasClass("redux-section-indent-start")&&o.hasClass("hide")&&(e("#section-table-"+r).fadeIn(300).removeClass("hide"),o.fadeIn(300).removeClass("hide"))}s.hasClass("redux-container-info")&&e("#info-"+r).fadeIn(300).removeClass("hide"),s.hasClass("redux-container-divide")&&e("#divide-"+r).fadeIn(300).removeClass("hide"),s.hasClass("redux-container-raw")&&s.parents().find("table#"+redux.args.opt_name+"-"+r).fadeIn(300).removeClass("hide"),d.fadeIn(300,function(){e(this).removeClass("hide"),redux.required.hasOwnProperty(r)&&e.redux.check_dependencies(e("#"+redux.args.opt_name+"-"+r).children().first()),e.redux.initFields()}),(s.hasClass("redux-container-section")||s.hasClass("redux-container-info"))&&d.css({display:"none"})}else!1===a&&d.fadeOut(100,function(){e(this).addClass("hide"),redux.required.hasOwnProperty(r)&&e.redux.required_recursive_hide(r)});i.find("select, radio, input[type=checkbox]").trigger("change")})}}},e.redux.required_recursive_hide=function(r){e("#"+redux.args.opt_name+"-"+r).parents("tr:first").fadeOut(50,function(){if(e(this).addClass("hide"),e("#"+redux.args.opt_name+"-"+r).hasClass("redux-container-section")){var t=e("#section-"+r);t.hasClass("redux-section-indent-start")&&(e("#section-table-"+r).fadeOut(50).addClass("hide"),t.fadeOut(50).addClass("hide"))}e("#"+redux.args.opt_name+"-"+r).hasClass("redux-container-info")&&e("#info-"+r).fadeOut(50).addClass("hide"),e("#"+redux.args.opt_name+"-"+r).hasClass("redux-container-divide")&&e("#divide-"+r).fadeOut(50).addClass("hide"),e("#"+redux.args.opt_name+"-"+r).hasClass("redux-container-raw")&&e("#"+redux.args.opt_name+"-"+r).parents().find("table#"+redux.args.opt_name+"-"+r).fadeOut(50).addClass("hide"),redux.required.hasOwnProperty(r)&&e.each(redux.required[r],function(r){e.redux.required_recursive_hide(r)})})},e.redux.check_parents_dependencies=function(r){var t="";return redux.required_child.hasOwnProperty(r)?e.each(redux.required_child[r],function(r,i){if(e("#"+redux.args.opt_name+"-"+i.parent).parents("tr:first").hasClass(".hide"))t=!1;else if(!1!==t){var a=e.redux.get_container_value(i.parent);t=e.redux.check_dependencies_visibility(a,i)}}):t=!0,t},e.redux.check_dependencies_visibility=function(r,t){var i,a=!1,n=t.checkValue;switch(t.operation){case"=":case"equals":e.isArray(r)?e(r[0]).each(function(r,t){if(e.isArray(n))e(n).each(function(e,r){return t==r?(a=!0,!0):void 0});else if(t==n)return a=!0,!0}):e.isArray(n)?e(n).each(function(e,t){r==t&&(a=!0)}):r==n&&(a=!0);break;case"!=":case"not":e.isArray(r)?e(r).each(function(r,t){if(e.isArray(n))e(n).each(function(e,r){return t!=r?(a=!0,!0):void 0});else if(t!=n)return a=!0,!0}):e.isArray(n)?e(n).each(function(e,t){r!=t&&(a=!0)}):r!=n&&(a=!0);break;case">":case"greater":case"is_larger":parseFloat(r)>parseFloat(n)&&(a=!0);break;case">=":case"greater_equal":case"is_larger_equal":parseFloat(r)>=parseFloat(n)&&(a=!0);break;case"<":case"less":case"is_smaller":parseFloat(r)<parseFloat(n)&&(a=!0);break;case"<=":case"less_equal":case"is_smaller_equal":parseFloat(r)<=parseFloat(n)&&(a=!0);break;case"contains":e.isPlainObject(r)&&(r=Object.keys(r).map(function(e){return[e,r[e]]})),e.isPlainObject(n)&&(n=Object.keys(n).map(function(e){return[e,n[e]]})),e.isArray(n)?e(n).each(function(t,i){var n=!1,s=i[0],d=i[1];return e(r).each(function(e,r){var t=r[0],i=r[1];return s===t&&d==i?(a=!0,n=!0,!1):void 0}),!0!==n&&void 0}):-1!==r.toString().indexOf(n)&&(a=!0);break;case"doesnt_contain":case"not_contain":e.isPlainObject(r)&&(i=Object.keys(r).map(function(e){return r[e]}),r=i),e.isPlainObject(n)&&(i=Object.keys(n).map(function(e){return n[e]}),n=i),e.isArray(n)?e(n).each(function(e,t){-1===r.toString().indexOf(t)&&(a=!0)}):-1===r.toString().indexOf(n)&&(a=!0);break;case"is_empty_or":(""===r||r==n)&&(a=!0);break;case"not_empty_and":""!==r&&r!=n&&(a=!0);break;case"is_empty":case"empty":case"!isset":r&&""!==r&&null!==r||(a=!0);break;case"not_empty":case"!empty":case"isset":r&&""!==r&&null!==r&&(a=!0)}return a},e.redux.verifyPos=function(e,r){if(""===(e=e.replace(/^\s+|\s+$/gm,""))||-1==e.search(" "))return!0===r?"top left":"bottom right";var t=e.split(" "),i=r?"top":"bottom";("top"==t[0]||"center"==t[0]||"bottom"==t[0])&&(i=t[0]);var a=r?"left":"right";return("left"==t[1]||"center"==t[1]||"right"==t[1])&&(a=t[1]),i+" "+a},e.redux.stickyInfo=function(){var r=e(".redux-main").innerWidth()-20;e("#redux-footer-sticky").isOnScreen()||e("#redux-footer-sticky").isOnScreen()?(e("#redux-footer").css({background:"#eee",position:"inherit",bottom:"inherit",width:"inherit"}),e("#redux-sticky-padder").hide(),e("#redux-footer").removeClass("sticky-footer-fixed")):(e("#redux-footer").css({position:"fixed",bottom:"0",width:r,left:379}),e("#redux-footer").addClass("sticky-footer-fixed"),e(".redux-save-warn").css("left",e("#redux-sticky").offset().left),e("#redux-sticky-padder").show()),e("#info_bar").isOnScreen()?e("#redux-sticky").removeClass("sticky-save-warn"):e("#redux-sticky").addClass("sticky-save-warn")},e.redux.expandOptions=function(r){var t=r.find(".expand_options"),i=r.find(".redux-sidebar").width()-1,a=e(".redux-group-menu .active a").data("rel")+"_section_group";return t.hasClass("expanded")?(t.removeClass("expanded"),r.find(".redux-main").removeClass("expand"),r.find(".redux-sidebar").stop().animate({"margin-left":"0px"},500),r.find(".redux-main").stop().animate({"margin-left":i},500,function(){r.find(".redux-main").attr("style","")}),r.find(".redux-group-tab").each(function(){e(this).attr("id")!==a&&e(this).fadeOut("fast")})):(t.addClass("expanded"),r.find(".redux-main").addClass("expand"),r.find(".redux-sidebar").stop().animate({"margin-left":-i-113},500),r.find(".redux-main").stop().animate({"margin-left":"-1px"},500),r.find(".redux-group-tab").fadeIn("medium",function(){e.redux.initFields()})),!1},e.redux.scaleToRatio=function(r,t,i){var a=0,n=r.attr("data-width");n||(n=r.width(),r.attr("data-width",n));var s=r.attr("data-height"),d=r.height();(!s||d>s)&&(s=d,r.attr("data-height",s),r.css("width","auto"),r.attr("data-width",r.width()),n=r.width()),n>i?(a=i/n,r.css("width",i),r.css("height",s*a),s*=a,n*=a):r.css("width","auto"),s>t?(a=t/s,r.css("height",t),r.css("width",n*a),n*=a,s*=a):r.css("height","auto");var o=(e(document.getElementById("redux-header")).height()-r.height())/2;o>0?r.css("margin-top",o):r.css("margin-top",0),e("#redux-header .redux_field_search")&&e("#redux-header .redux_field_search").css("right",e(r).width()+20)},e.redux.resizeAds=function(){var r,t=e("#redux-header");t.length?r=t.width()-t.find(".display_header").width()-30:(t=e("#customize-info"),r=t.width());var i=t.height(),a=t.find(".rAds");e(a).find("video").each(function(){e.redux.scaleToRatio(e(this),i,r)}),e(a).find("img").each(function(){e.redux.scaleToRatio(e(this),i,r)}),e(a).find("div").each(function(){e.redux.scaleToRatio(e(this),i,r)}),"-99999px"==a.css("left")&&a.css("display","none").css("left","auto"),a.fadeIn("slow")},e(document).ready(function(){redux.rAds&&setTimeout(function(){var r;e("#redux-header").length>0?(e("#redux-header").append('<div class="rAds"></div>'),r=e("#redux-header")):(e("#customize-theme-controls ul").first().prepend('<li id="redux_rAds" class="accordion-section rAdsContainer" style="position: relative;"><div class="rAds"></div></li>'),r=e("#redux_rAds")),r.css("position","relative"),r.find(".rAds").attr("style","position:absolute; top: 6px; right: 6px; display:block !important;overflow:hidden;").css("left","-99999px"),r.find(".rAds").html(redux.rAds.replace(/<br\s?\/?>/,""));var t=r.find(".rAds");r.height(),r.width(),r.find(".display_header").width(),t.find("a").css("float","right").css("line-height",r.height()+"px").css("margin-left","5px"),e(document).ajaxComplete(function(){t.find("a").hide(),setTimeout(function(){e.redux.resizeAds(),t.find("a").fadeIn()},1400),setTimeout(function(){e.redux.resizeAds()},1500),e(document).unbind("ajaxComplete")}),e(window).resize(function(){e.redux.resizeAds()})},400)})}(jQuery),jQuery.noConflict();var confirmOnPageExit=function(e){e=e||window.event;var r=redux.args.save_pending;return e&&(e.returnValue=r),window.onbeforeunload=null,r};
|
1 |
+
function redux_change(e){jQuery("body").trigger("check_dependencies",e),e.hasClass("compiler")&&jQuery("#redux-compiler-hook").val(1);var r=jQuery(e).parents(".redux-container:first"),t=jQuery(e).closest(".redux-group-tab").attr("id"),a=t.split("_");a=a[0];var i=r.find('.redux-group-tab-link-a[data-key="'+a+'"]').parents(".redux-group-tab-link-li:first"),n=jQuery("#"+t+"_li").parents(".hasSubSections:first");if(jQuery(e).parents("fieldset.redux-field:first").hasClass("redux-field-error")){jQuery(e).parents("fieldset.redux-field:first").removeClass("redux-field-error"),jQuery(e).parent().find(".redux-th-error").slideUp();var s=parseInt(r.find(".redux-field-errors span").text())-1;if(0>=s)jQuery("#"+t+"_li .redux-menu-error").fadeOut("fast").remove(),jQuery("#"+t+"_li .redux-group-tab-link-a").removeClass("hasError"),jQuery("#"+t+"_li").parents(".inside:first").find(".redux-field-errors").slideUp(),jQuery(e).parents(".redux-container:first").find(".redux-field-errors").slideUp(),jQuery("#redux_metaboxes_errors").slideUp();else{var d=parseInt(i.find(".redux-menu-error:first").text())-1;0>=d?i.find(".redux-menu-error:first").fadeOut().remove():i.find(".redux-menu-error:first").text(d),r.find(".redux-field-errors span").text(s)}0!==n.length&&0===n.find(".redux-menu-error").length&&n.find(".hasError").removeClass("hasError")}if(jQuery(e).parents("fieldset.redux-field:first").hasClass("redux-field-warning")){jQuery(e).parents("fieldset.redux-field:first").removeClass("redux-field-warning"),jQuery(e).parent().find(".redux-th-warning").slideUp();var o=parseInt(r.find(".redux-field-warnings span").text())-1;if(0>=o)jQuery("#"+t+"_li .redux-menu-warning").fadeOut("fast").remove(),jQuery("#"+t+"_li .redux-group-tab-link-a").removeClass("hasWarning"),jQuery("#"+t+"_li").parents(".inside:first").find(".redux-field-warnings").slideUp(),jQuery(e).parents(".redux-container:first").find(".redux-field-warnings").slideUp(),jQuery("#redux_metaboxes_warnings").slideUp();else{var u=parseInt(i.find(".redux-menu-warning:first").text())-1;0>=u?i.find(".redux-menu-warning:first").fadeOut().remove():i.find(".redux-menu-warning:first").text(u),r.find(".redux-field-warning span").text(o)}0!==n.length&&0===n.find(".redux-menu-warning").length&&n.find(".hasWarning").removeClass("hasWarning")}return r.find(".saved_notice:visible").length>0?void 0:redux.customizer?void redux.customizer.save(e,r,t):void(redux.args.disable_save_warn||(r.find(".redux-save-warn").slideDown(),window.onbeforeunload=confirmOnPageExit))}function colorValidate(e){var r=jQuery(e).val(),t=colorNameToHex(r);return t!==r.replace("#","")?t:r}function colorNameToHex(e){var r=e.replace(/^\s\s*/,"").replace(/\s\s*$/,"").replace("#",""),t={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c","indigo ":"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",redux:"#01a3e3",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};return"undefined"!==t[r.toLowerCase()]?t[r.toLowerCase()]:e}function redux_hook(e,r,t,a){var i;i=e[r],e[r]=function(){!0===a&&t.apply(this,[e,i,arguments]);var e=i.apply(this,arguments);return!0!==a&&t.apply(this,[e,i,arguments]),e}}!function(e){"function"==typeof define&&define.amd?jQueryCookie.define(["jquery"],e):e(jQuery)}(function(e){function r(e){return e}function t(e){return decodeURIComponent(e.replace(i," "))}function a(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return n.json?JSON.parse(e):e}catch(e){}}var i=/\+/g,n=e.cookie=function(i,s,d){if(void 0!==s){if("number"==typeof(d=e.extend({},n.defaults,d)).expires){var o=d.expires,u=d.expires=new Date;u.setDate(u.getDate()+o)}return s=n.json?JSON.stringify(s):String(s),document.cookie=[n.raw?i:encodeURIComponent(i),"=",n.raw?s:encodeURIComponent(s),d.expires?"; expires="+d.expires.toUTCString():"",d.path?"; path="+d.path:"",d.domain?"; domain="+d.domain:"",d.secure?"; secure":""].join("")}for(var l=n.raw?r:t,c=document.cookie.split("; "),f=i?void 0:{},p=0,h=c.length;h>p;p++){var x=c[p].split("="),g=l(x.shift()),m=l(x.join("="));if(i&&i===g){f=a(m);break}i||(f[g]=a(m))}return f};n.defaults={},e.removeCookie=function(r,t){return void 0!==e.cookie(r)&&(e.cookie(r,"",e.extend({},t,{expires:-1})),!0)}}),function(e){e.fn.typeWatch=function(r){var t=e.extend({wait:750,callback:function(){},highlight:!0,captureLength:2,inputTypes:["TEXT","TEXTAREA","PASSWORD","TEL","SEARCH","URL","EMAIL","DATETIME","DATE","MONTH","WEEK","TIME","DATETIME-LOCAL","NUMBER","RANGE"]},r);return this.each(function(){!function(r){var a=r.type.toUpperCase();if(e.inArray(a,t.inputTypes)>=0){var i={timer:null,text:e(r).val().toUpperCase(),cb:t.callback,el:r,wait:t.wait};t.highlight&&e(r).focus(function(){this.select()}),e(r).on("keydown paste cut input",function(r){var a=i.wait,n=!1,s=this.type.toUpperCase();void 0!==r.keyCode&&13==r.keyCode&&"TEXTAREA"!=s&&e.inArray(s,t.inputTypes)>=0&&(a=1,n=!0),clearTimeout(i.timer),i.timer=setTimeout(function(){!function(r,a){var i=e(r.el).val();(i.length>=t.captureLength&&i.toUpperCase()!=r.text||a&&i.length>=t.captureLength)&&(r.text=i.toUpperCase(),r.cb.call(r.el,i))}(i,n)},a)})}}(this)})}}(jQuery),function(e){e.fn.serializeForm=function(){if(this.length<1)return!1;var r={},t=r,a=':input[type!="checkbox"][type!="radio"], input:checked',i=function(){if(!this.disabled){var a=this.name.replace(/\[([^\]]+)?\]/g,",$1").split(","),i=a.length-1,n=e(this);if(a[0]){for(var s=0;i>s;s++)t=t[a[s]]=t[a[s]]||(""===a[s+1]||"0"===a[s+1]?[]:{});void 0!==t.length?t.push(n.val()):t[a[i]]=n.val(),t=r}}};return this.filter(a).each(i),this.find(a).each(i),r}}(jQuery),function(e){function r(r,t,a){r.each(function(){var r=e(this);r.bind("keyup change paste",function(e){var i="";e.originalEvent&&e.originalEvent.clipboardData&&e.originalEvent.clipboardData.getData&&(i=e.originalEvent.clipboardData.getData("text/plain")),setTimeout(function(){!function(e,r,t,a){var i=e.val();""==i&&a.length>0&&(i=a);var n=r(i,t);if(i!=n){var s=e.alphanum_caret();e.val(n),i.length==n.length+1?e.alphanum_caret(s-1):e.alphanum_caret(s)}}(r,t,a,i)},0)}),r.bind("keypress",function(e){var i=e.charCode?e.charCode:e.which;if((i>=32||10==i||13==i)&&!e.ctrlKey&&!e.metaKey){var n=String.fromCharCode(i),s=r.selection(),d=s.start,o=s.end,u=r.val(),l=u.substring(0,d)+n+u.substring(o);t(l,a)!=l&&e.preventDefault()}})})}function t(r,t){var i=parseFloat(e(r).val()),n=e(r);return isNaN(i)?void n.val(""):(a(t.min)&&i<t.min&&n.val(""),void(a(t.max)&&i>t.max&&n.val("")))}function a(e){return!isNaN(e)}function i(r,t){void 0===t&&(t=f);var a,i={};return a="string"==typeof r?h[r]:void 0===r?{}:r,e.extend(i,t,a),void 0===i.blacklist&&(i.blacklistSet=function(e,r){var t=new c(g+r),a=new c(e);return t.subtract(a)}(i.allow,i.disallow)),i}function n(r){var t,a={};return t="string"==typeof r?x[r]:void 0===r?{}:r,e.extend(a,p,t),a}function s(e,r,t){return!(t.maxLength&&e.length>=t.maxLength||!(t.allow.indexOf(r)>=0)&&(!t.allowSpace||" "!=r)&&(t.blacklistSet.contains(r)||!t.allowNumeric&&_[r]||!t.allowUpper&&function(e){var r=e.toUpperCase(),t=e.toLowerCase();return e==r&&r!=t}(r)||!t.allowLower&&function(e){var r=e.toUpperCase(),t=e.toLowerCase();return e==t&&r!=t}(r)||!t.allowCaseless&&function(e){return e.toUpperCase()==e.toLowerCase()}(r)||!t.allowLatin&&b.contains(r)||!t.allowOtherCharSets&&!_[r]&&!b.contains(r)))}function d(e,r,t){if(_[r])return!(function(e,r){var t=r.maxDigits;return""!=t&&!isNaN(t)&&o(e)>=t}(e,t)||function(e,r){var t=r.maxPreDecimalPlaces;return""!=t&&!isNaN(t)&&!(e.indexOf(v)>=0)&&o(e)>=t}(e,t)||function(e,r){var t=r.maxDecimalPlaces;if(""==t||isNaN(t))return!1;var a=e.indexOf(v);return-1!=a&&o(e.substring(a))>=t}(e,t)||function(e,r){return!(!r.max||r.max<0)&&parseFloat(e)>r.max}(e+r,t)||function(e,r){return!(!r.min||r.min>0)&&parseFloat(e)<r.min}(e+r,t));if(t.allowPlus&&"+"==r&&""==e)return!0;if(t.allowMinus&&"-"==r&&""==e)return!0;if(r==m&&t.allowThouSep&&function(e,r){if(0==e.length)return!1;if(e.indexOf(v)>=0)return!1;var t=e.indexOf(m);if(0>t)return!0;var a=e.lastIndexOf(m);return!(3>e.length-a-1||o(e.substring(t))%3>0)}(e))return!0;if(r==v){if(e.indexOf(v)>=0)return!1;if(t.allowDecSep)return!0}return!1}function o(e){return(e+="").replace(/[^0-9]/g,"").length}function u(e,r){if("string"!=typeof e)return e;var t,a=e.split(""),i=[],n=0;for(n=0;n<a.length;n++)t=a[n],s(i.join(""),t,r)&&i.push(t);return i.join("")}function l(e,r){if("string"!=typeof e)return e;var t,a=e.split(""),i=[],n=0;for(n=0;n<a.length;n++)t=a[n],d(i.join(""),t,r)&&i.push(t);return i.join("")}function c(e){this.map="string"==typeof e?function(e){var r={},t=e.split(""),a=0;for(a=0;a<t.length;a++)r[t[a]]=!0;return r}(e):{}}e.fn.alphanum=function(e){return r(this,u,i(e)),this},e.fn.alpha=function(e){var t=i("alpha");return r(this,u,i(e,t)),this},e.fn.numeric=function(e){return r(this,l,n(e)),this.blur(function(){t(this,e)}),this};var f={allow:"",disallow:"",allowSpace:!0,allowNumeric:!0,allowUpper:!0,allowLower:!0,allowCaseless:!0,allowLatin:!0,allowOtherCharSets:!0,maxLength:NaN},p={allowPlus:!1,allowMinus:!0,allowThouSep:!0,allowDecSep:!0,allowLeadingSpaces:!1,maxDigits:NaN,maxDecimalPlaces:NaN,maxPreDecimalPlaces:NaN,max:NaN,min:NaN},h={alpha:{allowNumeric:!1},upper:{allowNumeric:!1,allowUpper:!0,allowLower:!1,allowCaseless:!0},lower:{allowNumeric:!1,allowUpper:!1,allowLower:!0,allowCaseless:!0}},x={integer:{allowPlus:!1,allowMinus:!0,allowThouSep:!1,allowDecSep:!1},positiveInteger:{allowPlus:!1,allowMinus:!1,allowThouSep:!1,allowDecSep:!1}},g="!@#$%^&*()+=[]\\';,/{}|\":<>?~`.-_ ¬€£¦",m=",",v=".",_=function(){var e="0123456789".split(""),r={},t=0;for(t=0;t<e.length;t++)r[e[t]]=!0;return r}(),b=function(){var e="abcdefghijklmnopqrstuvwxyz",r=e.toUpperCase();return new c(e+r)}();c.prototype.add=function(e){var r=this.clone();for(var t in e.map)r.map[t]=!0;return r},c.prototype.subtract=function(e){var r=this.clone();for(var t in e.map)delete r.map[t];return r},c.prototype.contains=function(e){return!!this.map[e]},c.prototype.clone=function(){var e=new c;for(var r in this.map)e.map[r]=!0;return e},e.fn.alphanum.backdoorAlphaNum=function(e,r){return u(e,i(r))},e.fn.alphanum.backdoorNumeric=function(e,r){return l(e,n(r))},e.fn.alphanum.setNumericSeparators=function(e){1==e.thousandsSeparator.length&&1==e.decimalSeparator.length&&(m=e.thousandsSeparator,v=e.decimalSeparator)}}(jQuery),function(e){function r(e,r){if(e.createTextRange){var t=e.createTextRange();t.move("character",r),t.select()}else null!=e.selectionStart&&(e.focus(),e.setSelectionRange(r,r))}e.fn.alphanum_caret=function(t,a){return void 0===t?function(e){if("selection"in document){var r=e.createTextRange();try{r.setEndPoint("EndToStart",document.selection.createRange())}catch(e){return 0}return r.text.length}return null!=e.selectionStart?e.selectionStart:void 0}(this.get(0)):this.queue(function(i){if(isNaN(t)){var n=e(this).val().indexOf(t);!0===a?n+=t.length:void 0!==a&&(n+=a),r(this,n)}else r(this,t);i()})}}(jQuery),function(e){var r=function(e){return e?e.ownerDocument.defaultView||e.ownerDocument.parentWindow:window},t=function(r,t){var a=e.Range.current(r).clone(),i=e.Range(r).select(r);return a.overlaps(i)?(a.compare("START_TO_START",i)<1?(startPos=0,a.move("START_TO_START",i)):(fromElementToCurrent=i.clone(),fromElementToCurrent.move("END_TO_START",a),startPos=fromElementToCurrent.toString().length),a.compare("END_TO_END",i)>=0?endPos=i.toString().length:endPos=startPos+a.toString().length,{start:startPos,end:endPos}):null},a=function(a){var i=r(a);if(void 0!==a.selectionStart)return document.activeElement&&document.activeElement!=a&&a.selectionStart==a.selectionEnd&&0==a.selectionStart?{start:a.value.length,end:a.value.length}:{start:a.selectionStart,end:a.selectionEnd};if(i.getSelection)return t(a);try{if("input"==a.nodeName.toLowerCase()){var n=r(a).document.selection.createRange(),s=a.createTextRange();s.setEndPoint("EndToStart",n);var d=s.text.length;return{start:d,end:d+n.text.length}}var o=t(a);if(!o)return o;var u=e.Range.current().clone(),l=u.clone().collapse().range,c=u.clone().collapse(!1).range;return l.moveStart("character",-1),c.moveStart("character",-1),0!=o.startPos&&""==l.text&&(o.startPos+=2),0!=o.endPos&&""==c.text&&(o.endPos+=2),o}catch(e){return{start:a.value.length,end:a.value.length}}},i=function(e,t,a){var i=r(e);if(e.setSelectionRange)void 0===a?(e.focus(),e.setSelectionRange(t,t)):(e.select(),e.selectionStart=t,e.selectionEnd=a);else if(e.createTextRange){var n=e.createTextRange();n.moveStart("character",t),a=a||t,n.moveEnd("character",a-e.value.length),n.select()}else if(i.getSelection){var d=i.document,o=i.getSelection(),u=d.createRange(),l=[t,void 0!==a?a:t];s([e],l),u.setStart(l[0].el,l[0].count),u.setEnd(l[1].el,l[1].count),o.removeAllRanges(),o.addRange(u)}else i.document.body.createTextRange&&((u=document.body.createTextRange()).moveToElementText(e),u.collapse(),u.moveStart("character",t),u.moveEnd("character",void 0!==a?a:t),u.select())},n=function(e,r,t,a){"number"==typeof t[0]&&t[0]<r&&(t[0]={el:a,count:t[0]-e}),"number"==typeof t[1]&&t[1]<=r&&(t[1]={el:a,count:t[1]-e})},s=function(e,r,t){var a,i;t=t||0;for(var d=0;e[d];d++)3===(a=e[d]).nodeType||4===a.nodeType?(i=t,t+=a.nodeValue.length,n(i,t,r,a)):8!==a.nodeType&&(t=s(a.childNodes,r,t));return t};jQuery.fn.selection=function(e,r){return void 0!==e?this.each(function(){i(this,e,r)}):a(this[0])},e.fn.selection.getCharElement=s}(jQuery),function(e){"use strict";e.redux=e.redux||{},e(document).ready(function(){e.fn.isOnScreen=function(){if(window){var r=e(window),t={top:r.scrollTop()};t.right=t.left+r.width(),t.bottom=t.top+r.height();var a=this.offset();return a.right=a.left+this.outerWidth(),a.bottom=a.top+this.outerHeight(),!(t.right<a.left||t.left>a.right||t.bottom<a.top||t.top>a.bottom)}},e.redux.hideFields(),e.redux.checkRequired(),e.redux.initEvents(),e.redux.initQtip(),e.redux.tabCheck(),e.redux.notices(),e.redux.tabControl()}),e.redux.ajax_save=function(r){var t=e(document.getElementById("redux_ajax_overlay"));t.fadeIn(),jQuery(".redux-action_bar .spinner").addClass("is-active"),jQuery(".redux-action_bar input").attr("disabled","disabled");var a=jQuery(document.getElementById("redux_notification_bar"));a.slideUp(),jQuery(".redux-save-warn").slideUp(),jQuery(".redux_ajax_save_error").slideUp("medium",function(){jQuery(this).remove()});var i=jQuery(document.getElementById("redux-form-wrapper"));redux.fields.hasOwnProperty("editor")&&e.each(redux.fields.editor,function(e,r){if("undefined"!=typeof tinyMCE){var t=tinyMCE.get(e);t&&t.save()}});var n=i.serialize();i.find("input[type=checkbox]").each(function(){if(void 0!==e(this).attr("name")){var r=e(this).is(":checked")?e(this).val():"0";n+="&"+e(this).attr("name")+"="+r}}),"redux_save"!=r.attr("name")&&(n+="&"+r.attr("name")+"="+r.val());var s=n;try{var d=[],o=redux_data;e.each(o,function(r,t){"object"==typeof t?(d[r]=[],e.each(t,function(e,t){d[r][e]=t})):d[r]=t});for(var u=n.split("&"),l="",c=[],f="",p=0;p<u.length;p++){var h=u[p].split("="),x=decodeURIComponent(h[0]),g=decodeURIComponent(h[1]).replace(/\+/g," "),m=encodeURIComponent(x),v=encodeURIComponent(g),_="";if(f="",x.match(/redux_builder_amp\[(.*?)]/)){var b=x.match(/redux_builder_amp\[(.*?)]/)[1];_=o[b];var y="";if(x.match(/redux_builder_amp\[(.*?)]\[(.*?)]\[(.*?)]/))l+=m+"="+v+"&";else{if(x.match(/redux_builder_amp\[(.*?)]\[(.*?)]/)){var w=x.match(/redux_builder_amp\[(.*?)]\[(.*?)]/)[2];""!=w?(jQuery.inArray(b,c)<0&&(c.push(b),y="",e.each(_,function(r,t){var a=jQuery('[name="redux_builder_amp['+b+"]["+r+']"]').val();if(""==w&&(a=jQuery('[name="redux_builder_amp['+b+'][]"]').val()),void 0===_){var i="redux_builder_amp["+b+"]["+r+"]";""==w&&(i="redux_builder_amp["+b+"][]"),y+=encodeURIComponent(i)+"="+encodeURIComponent(a)+"&"}else a!=t&&(y="",e.each(_,function(e,r){var t="redux_builder_amp["+b+"]["+e+"]";""==w&&(t="redux_builder_amp["+b+"][]"),y+=encodeURIComponent(t)+"="+encodeURIComponent(a)+"&"}))})),f+=y):l+=m+"="+v+"&"}else _=d[b];void 0===_?l+=m+"="+v+"&":"object"==typeof _?l+=f:_!=g&&(l+=m+"="+v+"&")}}else void 0===(_=d[x])?l+=m+"="+v+"&":_!=g&&(l+=m+"="+v+"&")}var C=localStorage.getItem("ampforwp_check_opt_error");"error"==C&&(s=l=l.replace(/&\s*$/,"")),c=[]}catch(e){}var k=i.attr("data-nonce");return jQuery.ajax({type:"post",dataType:"json",url:ajaxurl,data:{action:redux.args.opt_name+"_ajax_save",nonce:k,opt_name:redux.args.opt_name,data:s},error:function(e){window.console||(console={}),console.log=console.log||function(e,r){},console.log(redux.ajax.console),console.log(e.responseText),jQuery(".redux-action_bar input").removeAttr("disabled"),t.fadeOut("fast"),jQuery(".redux-action_bar .spinner").removeClass("is-active"),e.responseText.match(/Mod_Security/i)&&"error"!=C?(localStorage.setItem("ampforwp_check_opt_error","error"),jQuery("#redux_save").trigger("click")):alert(redux.ajax.alert)},success:function(r){if(r.action&&"reload"==r.action)location.reload(!0);else if("success"==r.status){jQuery(".redux-action_bar input").removeAttr("disabled"),t.fadeOut("fast"),jQuery(".redux-action_bar .spinner").removeClass("is-active"),redux.options=r.options,redux.errors=r.errors,redux.warnings=r.warnings,a.html(r.notification_bar).slideDown("fast"),(null!==r.errors||null!==r.warnings)&&e.redux.notices();var i=e(document.getElementById("redux_notification_bar")).find(".saved_notice");i.slideDown(),i.delay(4e3).slideUp(),"1"==redux.options.ampforwp_css_tree_shaking?(jQuery("#ampforwp-clear-clearcss-data").removeClass("hide"),jQuery("#ampforwp-clear-clcss-msg").addClass("hide")):(jQuery("#ampforwp-clear-clearcss-data").addClass("hide"),jQuery("#ampforwp-clear-clcss-msg").removeClass("hide"),jQuery("#ampforwp-clear-clcss-msg").html("Please Save Before Clearing Cache"))}else jQuery(".redux-action_bar input").removeAttr("disabled"),jQuery(".redux-action_bar .spinner").removeClass("is-active"),t.fadeOut("fast"),jQuery(".wrap h2:first").parent().append('<div class="error redux_ajax_save_error" style="display:none;"><p>'+r.status+"</p></div>"),jQuery(".redux_ajax_save_error").slideDown(),jQuery("html, body").animate({scrollTop:0},"slow")}}),!1},e.redux.initEvents=function(){e(".redux-presets-bar").on("click",function(){window.onbeforeunload=null}),e("#toplevel_page_"+redux.args.slug+" .wp-submenu a, #wp-admin-bar-"+redux.args.slug+" a.ab-item, .extension-menu-call a").click(function(r){if((e("#toplevel_page_"+redux.args.slug).hasClass("wp-menu-open")||e(this).hasClass("ab-item"))&&!e(this).parents("ul.ab-submenu:first").hasClass("ab-sub-secondary")&&e(this).attr("href").toLowerCase().indexOf(redux.args.slug+"&tab=")>=0){r.preventDefault();var t=e(this).attr("href").split("&tab=");return e("#"+t[1]+"_section_group_li_a").click(),e(this).parents("ul:first").find(".current").removeClass("current"),e(this).addClass("current"),e(this).parent().addClass("current"),!1}}),e(".redux-action_bar input").on("click",function(r){if(e(this).attr("name")==redux.args.opt_name+"[defaults]"){if(!confirm(redux.args.reset_confirm))return!1;try{jQuery("#ampforwp-clear-clearcss-data").click()}catch(e){}}else if(e(this).attr("name")==redux.args.opt_name+"[defaults-section]"){if(!confirm(redux.args.reset_section_confirm))return!1;try{jQuery("#ampforwp-clear-clearcss-data").click()}catch(e){}}window.onbeforeunload=null,!0===redux.args.ajax_save&&(e.redux.ajax_save(e(this)),r.preventDefault())}),e(".expand_options").click(function(r){r.preventDefault();var t=e(".redux-container");if(e(t).hasClass("fully-expanded")){e(t).removeClass("fully-expanded");var a=e.cookie("redux_current_tab");e(".redux-container:first").find("#"+a+"_section_group").fadeIn(200,function(){0!==e(".redux-container:first").find("#redux-footer").length&&e.redux.stickyInfo(),e.redux.initFields()})}return e.redux.expandOptions(e(this).parents(".redux-container:first")),!1}),e(".saved_notice").is(":visible")&&e(".saved_notice").slideDown(),e(document.body).on("change",".redux-field input, .redux-field textarea, .redux-field select",function(){e(this).hasClass("noUpdate")||redux_change(e(this))});var r=e("#redux-footer").height();e("#redux-sticky-padder").css({height:r}),e("#redux-footer-sticky").removeClass("hide"),0!==e("#redux-footer").length&&(e(window).scroll(function(){e.redux.stickyInfo()}),e(window).resize(function(){e.redux.stickyInfo()})),e(".saved_notice").delay(4e3).slideUp()},e.redux.hideFields=function(){e("label[for='redux_hide_field']").each(function(r,t){var a=e(this).parent().parent();e(a).addClass("hidden")})},e.redux.checkRequired=function(){e.redux.required(),e("body").on("change",".redux-main select, .redux-main radio, .redux-main input[type=checkbox], .redux-main input[type=hidden]",function(r){e.redux.check_dependencies(this)}),e("body").on("check_dependencies",function(r,t){e.redux.check_dependencies(t)}),e("td > fieldset:empty,td > div:empty").parent().parent().hide()},e.redux.initQtip=function(){if(e().qtip){var r="";!0===redux.args.hints.tip_style.shadow&&(r="qtip-shadow");var t="",a=redux.args.hints.tip_style.color;""!==a&&(t="qtip-"+a);var i="";!0===redux.args.hints.tip_style.rounded&&(i="qtip-rounded");var n="",s=redux.args.hints.tip_style.style;""!==s&&(n="qtip-"+s);var d=r+","+t+","+i+","+n+",redux-qtip";d=d.replace(/,/g," ");var o=redux.args.hints.tip_position.my,u=redux.args.hints.tip_position.at;o=e.redux.verifyPos(o.toLowerCase(),!0),u=e.redux.verifyPos(u.toLowerCase(),!1);var l=redux.args.hints.tip_effect.show.event,c=redux.args.hints.tip_effect.hide.event,f=redux.args.hints.tip_effect.show.effect,p=redux.args.hints.tip_effect.show.duration,h=redux.args.hints.tip_effect.hide.effect,x=redux.args.hints.tip_effect.hide.duration;e("div.redux-dev-qtip").each(function(){e(this).qtip({content:{text:e(this).attr("qtip-content"),title:e(this).attr("qtip-title")},show:{effect:function(){e(this).slideDown(500)},event:"mouseover"},hide:{effect:function(){e(this).slideUp(500)},event:"mouseleave"},style:{classes:"qtip-shadow qtip-light"},position:{my:"top center",at:"bottom center"}})}),e("div.redux-hint-qtip").each(function(){e(this).qtip({content:{text:e(this).attr("qtip-content"),title:e(this).attr("qtip-title")},show:{effect:function(){switch(f){case"slide":e(this).slideDown(p);break;case"fade":e(this).fadeIn(p);break;default:e(this).show()}},event:l},hide:{effect:function(){switch(h){case"slide":e(this).slideUp(x);break;case"fade":e(this).fadeOut(x);break;default:e(this).hide(x)}},event:c},style:{classes:d},position:{my:o,at:u}})}),e("input[qtip-content]").each(function(){e(this).qtip({content:{text:e(this).attr("qtip-content"),title:e(this).attr("qtip-title")},show:"focus",hide:"blur",style:d,position:{my:o,at:u}})})}},e.redux.tabCheck=function(){if(e(".redux-group-tab-link-a").click(function(){var r=e(this);if(r.parent().hasClass("empty_section")&&r.parent().hasClass("hasSubSections")){var t=e(this).closest("ul").find(".redux-group-tab-link-a"),a=t.index(this);r=t.slice(a+1,a+2)}var i=r.parents(".redux-container:first"),n=r.data("rel"),s=i.find(".redux-group-tab-link-li.active:first .redux-group-tab-link-a").data("rel");if(s!==n){if(e("#currentSection").val(n),r.parents(".postbox-container:first").length||e.cookie("redux_current_tab",n,{expires:7,path:"/"}),i.find("#"+n+"_section_group_li").parents(".redux-group-tab-link-li").length){var d=i.find("#"+n+"_section_group_li").parents(".redux-group-tab-link-li").attr("id").split("_");d=d[0]}if(i.find("#toplevel_page_"+redux.args.slug+" .wp-submenu a.current").removeClass("current"),i.find("#toplevel_page_"+redux.args.slug+" .wp-submenu li.current").removeClass("current"),i.find("#toplevel_page_"+redux.args.slug+" .wp-submenu a").each(function(){var r=e(this).attr("href").split("&tab=");(r[1]==n||r[1]==d)&&(e(this).addClass("current"),e(this).parent().addClass("current"))}),i.find("#"+s+"_section_group_li").find("#"+s+"_section_group_li").length)i.find("#"+s+"_section_group_li").addClass("activeChild"),i.find("#"+n+"_section_group_li").addClass("active").removeClass("activeChild");else if(i.find("#"+n+"_section_group_li").parents("#"+s+"_section_group_li").length||i.find("#"+s+"_section_group_li").parents("ul.subsection").find("#"+n+"_section_group_li").length)i.find("#"+n+"_section_group_li").parents("#"+s+"_section_group_li").length?i.find("#"+s+"_section_group_li").addClass("activeChild").removeClass("active"):(i.find("#"+n+"_section_group_li").addClass("active"),i.find("#"+s+"_section_group_li").removeClass("active")),i.find("#"+n+"_section_group_li").removeClass("activeChild").addClass("active");else if(i.find("#"+n+"_section_group_li").addClass("active").removeClass("activeChild").find("ul.subsection").slideDown(),i.find("#"+s+"_section_group_li").find("ul.subsection").length){i.find("#"+s+"_section_group_li").find("ul.subsection").slideUp("fast",function(){i.find("#"+s+"_section_group_li").removeClass("active").removeClass("activeChild")});var o=i.find("#"+n+"_section_group_li").parents(".hasSubSections:first");o.length>0&&(i.find("#"+n+"_section_group_li").removeClass("active"),n=o.find(".redux-group-tab-link-a:first").data("rel"),o.hasClass("empty_section")?(o.find(".subsection li:first").addClass("active"),i.find("#"+n+"_section_group_li").removeClass("active").addClass("activeChild").find("ul.subsection").slideDown(),o=o.find(".subsection li:first"),n=o.find(".redux-group-tab-link-a:first").data("rel")):i.find("#"+n+"_section_group_li").addClass("active").removeClass("activeChild").find("ul.subsection").slideDown())}else i.find("#"+s+"_section_group_li").parents("ul.subsection").length?i.find("#"+s+"_section_group_li").parents("#"+n+"_section_group_li").length?i.find("#"+s+"_section_group_li").removeClass("active"):i.find("#"+s+"_section_group_li").parents("ul.subsection").slideUp("fast",function(){i.find("#"+s+"_section_group_li").removeClass("active"),i.find("#"+s+"_section_group_li").parents(".redux-group-tab-link-li").removeClass("active").removeClass("activeChild"),i.find("#"+n+"_section_group_li").parents(".redux-group-tab-link-li").addClass("activeChild").find("ul.subsection").slideDown(),i.find("#"+n+"_section_group_li").addClass("active")}):(i.find("#"+s+"_section_group_li").removeClass("active"),i.find("#"+n+"_section_group_li").parents(".redux-group-tab-link-li").length&&(i.find("#"+n+"_section_group_li").parents(".redux-group-tab-link-li").addClass("activeChild").find("ul.subsection").slideDown(),i.find("#"+n+"_section_group_li").addClass("active")));i.find("#"+s+"_section_group").hide(),i.find("#"+n+"_section_group").fadeIn(0,function(){0!==i.find("#redux-footer").length&&e.redux.stickyInfo(),e.redux.initFields()}),e("#toplevel_page_"+redux.args.slug).find(".current").removeClass("current")}}),void 0===redux.last_tab){var r=decodeURI((new RegExp("tab=(.+?)(&|$)").exec(location.search)||[,""])[1]);""!==r?e.cookie("redux_current_tab_get")!==r&&(e.cookie("redux_current_tab",r,{expires:7,path:"/"}),e.cookie("redux_current_tab_get",r,{expires:7,path:"/"}),e("#"+r+"_section_group_li").click()):""!==e.cookie("redux_current_tab_get")&&e.removeCookie("redux_current_tab_get");var t=e("#"+e.cookie("redux_current_tab")+"_section_group_li_a");null===e.cookie("redux_current_tab")||void 0===e.cookie("redux_current_tab")||0===t.length?e(".redux-container").find(".redux-group-tab-link-a:first").click():t.click()}else e("#"+redux.last_tab+"_section_group_li_a").click()},e.redux.initFields=function(){e(".redux-group-tab:visible").find(".redux-field-init:visible").each(function(){var r=e(this).attr("data-type");if(void 0!==redux.field_objects&&redux.field_objects[r]&&redux.field_objects[r]&&redux.field_objects[r].init(),!redux.customizer&&e(this).hasClass("redux_remove_th")){var t=e(this).parents("tr:first").find("th:first");t.html()&&t.html().length>0&&(e(this).prepend(t.html()),e(this).find(".redux_field_th").css("padding","0 0 10px 0")),e(this).parent().attr("colspan","2"),t.remove()}})},e.redux.notices=function(){redux.errors&&redux.errors.errors&&(e.each(redux.errors.errors,function(r,t){e.each(t.errors,function(r,t){e("#"+redux.args.opt_name+"-"+t.id).addClass("redux-field-error"),0===e("#"+redux.args.opt_name+"-"+t.id).parent().find(".redux-th-error").length?e("#"+redux.args.opt_name+"-"+t.id).append('<div class="redux-th-error">'+t.msg+"</div>"):e("#"+redux.args.opt_name+"-"+t.id).parent().find(".redux-th-error").html(t.msg).css("display","block")})}),e(".redux-container").each(function(){var r=e(this);r.find(".redux-menu-error").remove();var t=r.find(".redux-field-error").length;t>0&&(r.find(".redux-field-errors span").text(t),r.find(".redux-field-errors").slideDown(),r.find(".redux-group-tab").each(function(){var t=e(this).find(".redux-field-error").length;if(t>0){var a=e(this).attr("id").split("_");a=a[0],r.find('.redux-group-tab-link-a[data-key="'+a+'"]').prepend('<span class="redux-menu-error">'+t+"</span>"),r.find('.redux-group-tab-link-a[data-key="'+a+'"]').addClass("hasError");var i=r.find('.redux-group-tab-link-a[data-key="'+a+'"]').parents(".hasSubSections:first");i&&i.find(".redux-group-tab-link-a:first").addClass("hasError")}}))})),redux.warnings&&redux.warnings.warnings&&(e.each(redux.warnings.warnings,function(r,t){e.each(t.warnings,function(r,t){e("#"+redux.args.opt_name+"-"+t.id).addClass("redux-field-warning"),0===e("#"+redux.args.opt_name+"-"+t.id).parent().find(".redux-th-warning").length?e("#"+redux.args.opt_name+"-"+t.id).append('<div class="redux-th-warning">'+t.msg+"</div>"):e("#"+redux.args.opt_name+"-"+t.id).parent().find(".redux-th-warning").html(t.msg).css("display","block")})}),e(".redux-container").each(function(){var r=e(this);r.find(".redux-menu-warning").remove();var t=r.find(".redux-field-warning").length;t>0&&(r.find(".redux-field-warnings span").text(t),r.find(".redux-field-warnings").slideDown(),r.find(".redux-group-tab").each(function(){var t=e(this).find(".redux-field-warning").length;if(t>0){var a=e(this).attr("id").split("_");a=a[0],r.find('.redux-group-tab-link-a[data-key="'+a+'"]').prepend('<span class="redux-menu-warning">'+t+"</span>"),r.find('.redux-group-tab-link-a[data-key="'+a+'"]').addClass("hasWarning");var i=r.find('.redux-group-tab-link-a[data-key="'+a+'"]').parents(".hasSubSections:first");i&&i.find(".redux-group-tab-link-a:first").addClass("hasWarning")}}))}))},e.redux.tabControl=function(){e(".redux-section-tabs div").hide(),e(".redux-section-tabs div:first").show(),e(".redux-section-tabs ul li:first").addClass("active"),e(".redux-section-tabs ul li a").click(function(){e(".redux-section-tabs ul li").removeClass("active"),e(this).parent().addClass("active");var r=e(this).attr("href");return e(".redux-section-tabs div").hide(),e(r).fadeIn("medium",function(){e.redux.initFields()}),!1})},e.redux.required=function(){e.each(redux.folds,function(r,t){var a=e("#"+redux.args.opt_name+"-"+r);if(a.parents("tr:first").addClass("fold"),"hide"==t){if(a.parents("tr:first").addClass("hide"),a.hasClass("redux-container-section")){var i=e("#section-"+r);i.hasClass("redux-section-indent-start")&&(e("#section-table-"+r).hide().addClass("hide"),i.hide().addClass("hide"))}a.hasClass("redux-container-info")&&e("#info-"+r).hide().addClass("hide"),a.hasClass("redux-container-divide")&&e("#divide-"+r).hide().addClass("hide"),a.hasClass("redux-container-raw")&&a.parents().find("table#"+redux.args.opt_name+"-"+r).hide().addClass("hide")}})},e.redux.get_container_value=function(r){var t=e("#"+redux.args.opt_name+"-"+r).serializeForm();return null!==t&&"object"==typeof t&&t.hasOwnProperty(redux.args.opt_name)&&(t=t[redux.args.opt_name][r]),e("#"+redux.args.opt_name+"-"+r).hasClass("redux-container-media")&&(t=t.url),t},e.redux.check_dependencies=function(r){if(null!==redux.required){var t=e(r),a=t.parents(".redux-field:first").data("id");if(redux.required.hasOwnProperty(a)){var i=t.parents(".redux-field-container:first"),n=i.parents("tr:first").hasClass(".hide");i.parents("tr:first").length||(n=i.parents(".customize-control:first").hasClass(".hide")),e.each(redux.required[a],function(r,t){var a=e(this),i=!1,s=e("#"+redux.args.opt_name+"-"+r),d=s.parents("tr:first");if(n||(i=e.redux.check_parents_dependencies(r)),!0===i){if(s.hasClass("redux-container-section")){var o=e("#section-"+r);o.hasClass("redux-section-indent-start")&&o.hasClass("hide")&&(e("#section-table-"+r).fadeIn(300).removeClass("hide"),o.fadeIn(300).removeClass("hide"))}s.hasClass("redux-container-info")&&e("#info-"+r).fadeIn(300).removeClass("hide"),s.hasClass("redux-container-divide")&&e("#divide-"+r).fadeIn(300).removeClass("hide"),s.hasClass("redux-container-raw")&&s.parents().find("table#"+redux.args.opt_name+"-"+r).fadeIn(300).removeClass("hide"),d.fadeIn(300,function(){e(this).removeClass("hide"),redux.required.hasOwnProperty(r)&&e.redux.check_dependencies(e("#"+redux.args.opt_name+"-"+r).children().first()),e.redux.initFields()}),(s.hasClass("redux-container-section")||s.hasClass("redux-container-info"))&&d.css({display:"none"})}else!1===i&&d.fadeOut(100,function(){e(this).addClass("hide"),redux.required.hasOwnProperty(r)&&e.redux.required_recursive_hide(r)});a.find("select, radio, input[type=checkbox]").trigger("change")})}}},e.redux.required_recursive_hide=function(r){e("#"+redux.args.opt_name+"-"+r).parents("tr:first").fadeOut(50,function(){if(e(this).addClass("hide"),e("#"+redux.args.opt_name+"-"+r).hasClass("redux-container-section")){var t=e("#section-"+r);t.hasClass("redux-section-indent-start")&&(e("#section-table-"+r).fadeOut(50).addClass("hide"),t.fadeOut(50).addClass("hide"))}e("#"+redux.args.opt_name+"-"+r).hasClass("redux-container-info")&&e("#info-"+r).fadeOut(50).addClass("hide"),e("#"+redux.args.opt_name+"-"+r).hasClass("redux-container-divide")&&e("#divide-"+r).fadeOut(50).addClass("hide"),e("#"+redux.args.opt_name+"-"+r).hasClass("redux-container-raw")&&e("#"+redux.args.opt_name+"-"+r).parents().find("table#"+redux.args.opt_name+"-"+r).fadeOut(50).addClass("hide"),redux.required.hasOwnProperty(r)&&e.each(redux.required[r],function(r){e.redux.required_recursive_hide(r)})})},e.redux.check_parents_dependencies=function(r){var t="";return redux.required_child.hasOwnProperty(r)?e.each(redux.required_child[r],function(r,a){if(e("#"+redux.args.opt_name+"-"+a.parent).parents("tr:first").hasClass(".hide"))t=!1;else if(!1!==t){var i=e.redux.get_container_value(a.parent);t=e.redux.check_dependencies_visibility(i,a)}}):t=!0,t},e.redux.check_dependencies_visibility=function(r,t){var a,i=!1,n=t.checkValue;switch(t.operation){case"=":case"equals":e.isArray(r)?e(r[0]).each(function(r,t){if(e.isArray(n))e(n).each(function(e,r){return t==r?(i=!0,!0):void 0});else if(t==n)return i=!0,!0}):e.isArray(n)?e(n).each(function(e,t){r==t&&(i=!0)}):r==n&&(i=!0);break;case"!=":case"not":e.isArray(r)?e(r).each(function(r,t){if(e.isArray(n))e(n).each(function(e,r){return t!=r?(i=!0,!0):void 0});else if(t!=n)return i=!0,!0}):e.isArray(n)?e(n).each(function(e,t){r!=t&&(i=!0)}):r!=n&&(i=!0);break;case">":case"greater":case"is_larger":parseFloat(r)>parseFloat(n)&&(i=!0);break;case">=":case"greater_equal":case"is_larger_equal":parseFloat(r)>=parseFloat(n)&&(i=!0);break;case"<":case"less":case"is_smaller":parseFloat(r)<parseFloat(n)&&(i=!0);break;case"<=":case"less_equal":case"is_smaller_equal":parseFloat(r)<=parseFloat(n)&&(i=!0);break;case"contains":e.isPlainObject(r)&&(r=Object.keys(r).map(function(e){return[e,r[e]]})),e.isPlainObject(n)&&(n=Object.keys(n).map(function(e){return[e,n[e]]})),e.isArray(n)?e(n).each(function(t,a){var n=!1,s=a[0],d=a[1];return e(r).each(function(e,r){var t=r[0],a=r[1];return s===t&&d==a?(i=!0,n=!0,!1):void 0}),!0!==n&&void 0}):-1!==r.toString().indexOf(n)&&(i=!0);break;case"doesnt_contain":case"not_contain":e.isPlainObject(r)&&(a=Object.keys(r).map(function(e){return r[e]}),r=a),e.isPlainObject(n)&&(a=Object.keys(n).map(function(e){return n[e]}),n=a),e.isArray(n)?e(n).each(function(e,t){-1===r.toString().indexOf(t)&&(i=!0)}):-1===r.toString().indexOf(n)&&(i=!0);break;case"is_empty_or":(""===r||r==n)&&(i=!0);break;case"not_empty_and":""!==r&&r!=n&&(i=!0);break;case"is_empty":case"empty":case"!isset":r&&""!==r&&null!==r||(i=!0);break;case"not_empty":case"!empty":case"isset":r&&""!==r&&null!==r&&(i=!0)}return i},e.redux.verifyPos=function(e,r){if(""===(e=e.replace(/^\s+|\s+$/gm,""))||-1==e.search(" "))return!0===r?"top left":"bottom right";var t=e.split(" "),a=r?"top":"bottom";("top"==t[0]||"center"==t[0]||"bottom"==t[0])&&(a=t[0]);var i=r?"left":"right";return("left"==t[1]||"center"==t[1]||"right"==t[1])&&(i=t[1]),a+" "+i},e.redux.stickyInfo=function(){var r=e(".redux-main").innerWidth()-20;e("#redux-footer-sticky").isOnScreen()||e("#redux-footer-sticky").isOnScreen()?(e("#redux-footer").css({background:"#eee",position:"inherit",bottom:"inherit",width:"inherit"}),e("#redux-sticky-padder").hide(),e("#redux-footer").removeClass("sticky-footer-fixed")):(e("#redux-footer").css({position:"fixed",bottom:"0",width:r,left:379}),e("#redux-footer").addClass("sticky-footer-fixed"),e(".redux-save-warn").css("left",e("#redux-sticky").offset().left),e("#redux-sticky-padder").show()),e("#info_bar").isOnScreen()?e("#redux-sticky").removeClass("sticky-save-warn"):e("#redux-sticky").addClass("sticky-save-warn")},e.redux.expandOptions=function(r){var t=r.find(".expand_options"),a=r.find(".redux-sidebar").width()-1,i=e(".redux-group-menu .active a").data("rel")+"_section_group";return t.hasClass("expanded")?(t.removeClass("expanded"),r.find(".redux-main").removeClass("expand"),r.find(".redux-sidebar").stop().animate({"margin-left":"0px"},500),r.find(".redux-main").stop().animate({"margin-left":a},500,function(){r.find(".redux-main").attr("style","")}),r.find(".redux-group-tab").each(function(){e(this).attr("id")!==i&&e(this).fadeOut("fast")})):(t.addClass("expanded"),r.find(".redux-main").addClass("expand"),r.find(".redux-sidebar").stop().animate({"margin-left":-a-113},500),r.find(".redux-main").stop().animate({"margin-left":"-1px"},500),r.find(".redux-group-tab").fadeIn("medium",function(){e.redux.initFields()})),!1},e.redux.scaleToRatio=function(r,t,a){var i=0,n=r.attr("data-width");n||(n=r.width(),r.attr("data-width",n));var s=r.attr("data-height"),d=r.height();(!s||d>s)&&(s=d,r.attr("data-height",s),r.css("width","auto"),r.attr("data-width",r.width()),n=r.width()),n>a?(i=a/n,r.css("width",a),r.css("height",s*i),s*=i,n*=i):r.css("width","auto"),s>t?(i=t/s,r.css("height",t),r.css("width",n*i),n*=i,s*=i):r.css("height","auto");var o=(e(document.getElementById("redux-header")).height()-r.height())/2;o>0?r.css("margin-top",o):r.css("margin-top",0),e("#redux-header .redux_field_search")&&e("#redux-header .redux_field_search").css("right",e(r).width()+20)},e.redux.resizeAds=function(){var r,t=e("#redux-header");t.length?r=t.width()-t.find(".display_header").width()-30:(t=e("#customize-info"),r=t.width());var a=t.height(),i=t.find(".rAds");e(i).find("video").each(function(){e.redux.scaleToRatio(e(this),a,r)}),e(i).find("img").each(function(){e.redux.scaleToRatio(e(this),a,r)}),e(i).find("div").each(function(){e.redux.scaleToRatio(e(this),a,r)}),"-99999px"==i.css("left")&&i.css("display","none").css("left","auto"),i.fadeIn("slow")},e(document).ready(function(){redux.rAds&&setTimeout(function(){var r;e("#redux-header").length>0?(e("#redux-header").append('<div class="rAds"></div>'),r=e("#redux-header")):(e("#customize-theme-controls ul").first().prepend('<li id="redux_rAds" class="accordion-section rAdsContainer" style="position: relative;"><div class="rAds"></div></li>'),r=e("#redux_rAds")),r.css("position","relative"),r.find(".rAds").attr("style","position:absolute; top: 6px; right: 6px; display:block !important;overflow:hidden;").css("left","-99999px"),r.find(".rAds").html(redux.rAds.replace(/<br\s?\/?>/,""));var t=r.find(".rAds");r.height(),r.width(),r.find(".display_header").width(),t.find("a").css("float","right").css("line-height",r.height()+"px").css("margin-left","5px"),e(document).ajaxComplete(function(){t.find("a").hide(),setTimeout(function(){e.redux.resizeAds(),t.find("a").fadeIn()},1400),setTimeout(function(){e.redux.resizeAds()},1500),e(document).unbind("ajaxComplete")}),e(window).resize(function(){e.redux.resizeAds()})},400)})}(jQuery),jQuery.noConflict();var confirmOnPageExit=function(e){e=e||window.event;var r=redux.args.save_pending;return e&&(e.returnValue=r),window.onbeforeunload=null,r};
|
@@ -129,10 +129,11 @@ class AMP_Post_Template {
|
|
129 |
if ( isset( $this->data[ $property ] ) ) {
|
130 |
return $this->data[ $property ];
|
131 |
} else {
|
132 |
-
_doing_it_wrong( __METHOD__, sprintf( esc_html__( 'Called for non-existant key ("%s").', 'accelerated-mobile-pages' ), esc_html( $property ) ), '0.1' );
|
|
|
|
|
|
|
133 |
}
|
134 |
-
|
135 |
-
return $default;
|
136 |
}
|
137 |
public function set( $property, $value = '' ) {
|
138 |
if ( isset( $this->data[ $property ] ) ) {
|
129 |
if ( isset( $this->data[ $property ] ) ) {
|
130 |
return $this->data[ $property ];
|
131 |
} else {
|
132 |
+
//_doing_it_wrong( __METHOD__, sprintf( esc_html__( 'Called for non-existant key ("%s").', 'accelerated-mobile-pages' ), esc_html( $property ) ), '0.1' );
|
133 |
+
|
134 |
+
// We commented the below line because php notice as per #3967
|
135 |
+
return $default;
|
136 |
}
|
|
|
|
|
137 |
}
|
138 |
public function set( $property, $value = '' ) {
|
139 |
if ( isset( $this->data[ $property ] ) ) {
|
@@ -2134,6 +2134,52 @@ class AMP_Allowed_Tags_Generated {
|
|
2134 |
),
|
2135 |
),
|
2136 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2137 |
'amp-selector' => array(
|
2138 |
array(
|
2139 |
'attr_spec_list' => array(
|
@@ -6961,6 +7007,68 @@ class AMP_Allowed_Tags_Generated {
|
|
6961 |
'spec_name' => 'amp-ima-video > script[type=application/json]',
|
6962 |
),
|
6963 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6964 |
array(
|
6965 |
'attr_spec_list' => array(
|
6966 |
'async' => array(
|
2134 |
),
|
2135 |
),
|
2136 |
),
|
2137 |
+
'amp-script' => array(
|
2138 |
+
array(
|
2139 |
+
'attr_spec_list' => array(
|
2140 |
+
'max-age' => array(
|
2141 |
+
'value_regex' => '[0-9]+',
|
2142 |
+
),
|
2143 |
+
'media' => array(),
|
2144 |
+
'noloading' => array(
|
2145 |
+
'value' => array(
|
2146 |
+
'',
|
2147 |
+
),
|
2148 |
+
),
|
2149 |
+
'sandbox' => array(),
|
2150 |
+
'script' => array(),
|
2151 |
+
'src' => array(
|
2152 |
+
'blacklisted_value_regex' => '__amp_source_origin',
|
2153 |
+
'value_url' => array(
|
2154 |
+
'allow_relative' => false,
|
2155 |
+
'protocol' => array(
|
2156 |
+
'https',
|
2157 |
+
),
|
2158 |
+
),
|
2159 |
+
),
|
2160 |
+
),
|
2161 |
+
'tag_spec' => array(
|
2162 |
+
'amp_layout' => array(
|
2163 |
+
'supported_layouts' => array(
|
2164 |
+
5,
|
2165 |
+
6,
|
2166 |
+
2,
|
2167 |
+
3,
|
2168 |
+
7,
|
2169 |
+
1,
|
2170 |
+
4,
|
2171 |
+
),
|
2172 |
+
),
|
2173 |
+
'disallowed_ancestor' => array(
|
2174 |
+
'amp-script',
|
2175 |
+
),
|
2176 |
+
'requires_extension' => array(
|
2177 |
+
'amp-script',
|
2178 |
+
),
|
2179 |
+
),
|
2180 |
+
),
|
2181 |
+
),
|
2182 |
+
|
2183 |
'amp-selector' => array(
|
2184 |
array(
|
2185 |
'attr_spec_list' => array(
|
7007 |
'spec_name' => 'amp-ima-video > script[type=application/json]',
|
7008 |
),
|
7009 |
),
|
7010 |
+
array(
|
7011 |
+
'attr_spec_list' => array(
|
7012 |
+
'async' => array(
|
7013 |
+
'mandatory' => true,
|
7014 |
+
'value' => array(
|
7015 |
+
'',
|
7016 |
+
),
|
7017 |
+
),
|
7018 |
+
'nonce' => array(),
|
7019 |
+
'type' => array(
|
7020 |
+
'value_casei' => array(
|
7021 |
+
'text/javascript',
|
7022 |
+
),
|
7023 |
+
),
|
7024 |
+
),
|
7025 |
+
'tag_spec' => array(
|
7026 |
+
'extension_spec' => array(
|
7027 |
+
'name' => 'amp-script',
|
7028 |
+
'requires_usage' => true,
|
7029 |
+
'version' => array(
|
7030 |
+
'0.1',
|
7031 |
+
),
|
7032 |
+
),
|
7033 |
+
),
|
7034 |
+
),
|
7035 |
+
array(
|
7036 |
+
'attr_spec_list' => array(
|
7037 |
+
'id' => array(
|
7038 |
+
'blacklisted_value_regex' => '(^|\\s)(__amp_\\S*|__count__|__defineGetter__|__defineSetter__|__lookupGetter__|__lookupSetter__|__noSuchMethod__|__parent__|__proto__|__AMP_\\S*|\\$p|\\$proxy|acceptCharset|addEventListener|appendChild|assignedSlot|attachShadow|AMP|baseURI|checkValidity|childElementCount|childNodes|classList|className|clientHeight|clientLeft|clientTop|clientWidth|compareDocumentPosition|computedName|computedRole|contentEditable|createShadowRoot|enqueAction|firstChild|firstElementChild|getAnimations|getAttribute|getAttributeNS|getAttributeNode|getAttributeNodeNS|getBoundingClientRect|getClientRects|getDestinationInsertionPoints|getElementsByClassName|getElementsByTagName|getElementsByTagNameNS|getRootNode|hasAttribute|hasAttributeNS|hasAttributes|hasChildNodes|hasPointerCapture|i-amphtml-\\S*|innerHTML|innerText|inputMode|insertAdjacentElement|insertAdjacentHTML|insertAdjacentText|isContentEditable|isDefaultNamespace|isEqualNode|isSameNode|lastChild|lastElementChild|lookupNamespaceURI|namespaceURI|nextElementSibling|nextSibling|nodeName|nodeType|nodeValue|offsetHeight|offsetLeft|offsetParent|offsetTop|offsetWidth|outerHTML|outerText|ownerDocument|parentElement|parentNode|previousElementSibling|previousSibling|querySelector|querySelectorAll|releasePointerCapture|removeAttribute|removeAttributeNS|removeAttributeNode|removeChild|removeEventListener|replaceChild|reportValidity|requestPointerLock|scrollHeight|scrollIntoView|scrollIntoViewIfNeeded|scrollLeft|scrollWidth|setAttribute|setAttributeNS|setAttributeNode|setAttributeNodeNS|setPointerCapture|shadowRoot|styleMap|tabIndex|tagName|textContent|toString|valueOf|(webkit|ms|moz|o)dropzone|(webkit|moz|ms|o)MatchesSelector|(webkit|moz|ms|o)RequestFullScreen|(webkit|moz|ms|o)RequestFullscreen)(\\s|$)',
|
7039 |
+
'mandatory' => true,
|
7040 |
+
),
|
7041 |
+
'nonce' => array(),
|
7042 |
+
'target' => array(
|
7043 |
+
'dispatch_key' => 2,
|
7044 |
+
'mandatory' => true,
|
7045 |
+
'value' => array(
|
7046 |
+
'amp-script',
|
7047 |
+
),
|
7048 |
+
),
|
7049 |
+
'type' => array(
|
7050 |
+
'mandatory' => true,
|
7051 |
+
'value_casei' => array(
|
7052 |
+
'text/plain',
|
7053 |
+
),
|
7054 |
+
),
|
7055 |
+
),
|
7056 |
+
'cdata' => array(
|
7057 |
+
'blacklisted_cdata_regex' => array(
|
7058 |
+
'error_message' => 'html comments',
|
7059 |
+
'regex' => '<!--',
|
7060 |
+
),
|
7061 |
+
'max_bytes' => 10000,
|
7062 |
+
'max_bytes_spec_url' => 'https://amp.dev/documentation/components/amp-script#faq',
|
7063 |
+
),
|
7064 |
+
'tag_spec' => array(
|
7065 |
+
'requires_extension' => array(
|
7066 |
+
'amp-script',
|
7067 |
+
),
|
7068 |
+
'spec_name' => 'amp-script extension local script',
|
7069 |
+
'spec_url' => 'https://amp.dev/documentation/components/amp-script',
|
7070 |
+
),
|
7071 |
+
),
|
7072 |
array(
|
7073 |
'attr_spec_list' => array(
|
7074 |
'async' => array(
|
@@ -115,11 +115,17 @@ class AMP_Blacklist_Sanitizer extends AMP_Base_Sanitizer {
|
|
115 |
}
|
116 |
}
|
117 |
$parent_node = $element->parentNode;
|
118 |
-
$
|
119 |
-
|
120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
$parent_node->removeChild( $element );
|
122 |
-
|
123 |
if ( 'body' !== $parent_node->nodeName && AMP_DOM_Utils::is_node_empty( $parent_node ) ) {
|
124 |
$parent_node->parentNode->removeChild( $parent_node );
|
125 |
}
|
115 |
}
|
116 |
}
|
117 |
$parent_node = $element->parentNode;
|
118 |
+
$spec_name = 'amp-script extension local script';
|
119 |
+
$checkAllowedFlag = 0 ;
|
120 |
+
foreach ( AMP_Allowed_Tags_Generated::get_allowed_tag( 'script' ) as $spec_rule ) {
|
121 |
+
if ( isset( $spec_rule[ AMP_Rule_Spec::TAG_SPEC ]['spec_name'] ) && $spec_name === $spec_rule[ AMP_Rule_Spec::TAG_SPEC ]['spec_name'] ) {
|
122 |
+
if($element->getAttribute( 'id' ) && $element->getAttribute( 'target' ) == 'amp-script')
|
123 |
+
$checkAllowedFlag = 1 ;
|
124 |
+
}
|
125 |
+
}
|
126 |
+
if( $parent_node->tagName != 'amp-state' && $checkAllowedFlag == 0){
|
127 |
$parent_node->removeChild( $element );
|
128 |
+
}
|
129 |
if ( 'body' !== $parent_node->nodeName && AMP_DOM_Utils::is_node_empty( $parent_node ) ) {
|
130 |
$parent_node->parentNode->removeChild( $parent_node );
|
131 |
}
|
@@ -6,6 +6,7 @@ use Sabberworm\CSS\Comment\Commentable;
|
|
6 |
use Sabberworm\CSS\Parsing\ParserState;
|
7 |
use Sabberworm\CSS\Parsing\SourceException;
|
8 |
use Sabberworm\CSS\Parsing\UnexpectedTokenException;
|
|
|
9 |
use Sabberworm\CSS\Property\AtRule;
|
10 |
use Sabberworm\CSS\Property\Charset;
|
11 |
use Sabberworm\CSS\Property\CSSNamespace;
|
@@ -99,7 +100,7 @@ abstract class CSSList implements Renderable, Commentable {
|
|
99 |
}
|
100 |
}
|
101 |
} else {
|
102 |
-
return DeclarationBlock::parse($oParserState);
|
103 |
}
|
104 |
}
|
105 |
|
@@ -113,14 +114,14 @@ abstract class CSSList implements Renderable, Commentable {
|
|
113 |
$oParserState->consumeWhiteSpace();
|
114 |
$sMediaQuery = null;
|
115 |
if (!$oParserState->comes(';')) {
|
116 |
-
$sMediaQuery = $oParserState->consumeUntil(';');
|
117 |
}
|
118 |
-
$oParserState->
|
119 |
-
return new Import($oLocation, $sMediaQuery, $iIdentifierLineNum);
|
120 |
} else if ($sIdentifier === 'charset') {
|
121 |
$sCharset = CSSString::parse($oParserState);
|
122 |
$oParserState->consumeWhiteSpace();
|
123 |
-
$oParserState->
|
124 |
return new Charset($sCharset, $iIdentifierLineNum);
|
125 |
} else if (self::identifierIs($sIdentifier, 'keyframes')) {
|
126 |
$oResult = new KeyFrame($iIdentifierLineNum);
|
@@ -138,7 +139,7 @@ abstract class CSSList implements Renderable, Commentable {
|
|
138 |
$sPrefix = $mUrl;
|
139 |
$mUrl = Value::parsePrimitiveValue($oParserState);
|
140 |
}
|
141 |
-
$oParserState->
|
142 |
if ($sPrefix !== null && !is_string($sPrefix)) {
|
143 |
throw new UnexpectedTokenException('Wrong namespace prefix', $sPrefix, 'custom', $iIdentifierLineNum);
|
144 |
}
|
@@ -240,10 +241,14 @@ abstract class CSSList implements Renderable, Commentable {
|
|
240 |
* Replaces an item from the CSS list.
|
241 |
* @param RuleSet|Import|Charset|CSSList $oItemToRemove May be a RuleSet (most likely a DeclarationBlock), a Import, a Charset or another CSSList (most likely a MediaQuery)
|
242 |
*/
|
243 |
-
public function replace($oOldItem, $
|
244 |
$iKey = array_search($oOldItem, $this->aContents, true);
|
245 |
if ($iKey !== false) {
|
246 |
-
|
|
|
|
|
|
|
|
|
247 |
return true;
|
248 |
}
|
249 |
return false;
|
6 |
use Sabberworm\CSS\Parsing\ParserState;
|
7 |
use Sabberworm\CSS\Parsing\SourceException;
|
8 |
use Sabberworm\CSS\Parsing\UnexpectedTokenException;
|
9 |
+
use Sabberworm\CSS\Parsing\UnexpectedEOFException;
|
10 |
use Sabberworm\CSS\Property\AtRule;
|
11 |
use Sabberworm\CSS\Property\Charset;
|
12 |
use Sabberworm\CSS\Property\CSSNamespace;
|
100 |
}
|
101 |
}
|
102 |
} else {
|
103 |
+
return DeclarationBlock::parse($oParserState, $oList);
|
104 |
}
|
105 |
}
|
106 |
|
114 |
$oParserState->consumeWhiteSpace();
|
115 |
$sMediaQuery = null;
|
116 |
if (!$oParserState->comes(';')) {
|
117 |
+
$sMediaQuery = trim($oParserState->consumeUntil(array(';', ParserState::EOF)));
|
118 |
}
|
119 |
+
$oParserState->consumeUntil(array(';', ParserState::EOF), true, true);
|
120 |
+
return new Import($oLocation, $sMediaQuery ? $sMediaQuery : null, $iIdentifierLineNum);
|
121 |
} else if ($sIdentifier === 'charset') {
|
122 |
$sCharset = CSSString::parse($oParserState);
|
123 |
$oParserState->consumeWhiteSpace();
|
124 |
+
$oParserState->consumeUntil(array(';', ParserState::EOF), true, true);
|
125 |
return new Charset($sCharset, $iIdentifierLineNum);
|
126 |
} else if (self::identifierIs($sIdentifier, 'keyframes')) {
|
127 |
$oResult = new KeyFrame($iIdentifierLineNum);
|
139 |
$sPrefix = $mUrl;
|
140 |
$mUrl = Value::parsePrimitiveValue($oParserState);
|
141 |
}
|
142 |
+
$oParserState->consumeUntil(array(';', ParserState::EOF), true, true);
|
143 |
if ($sPrefix !== null && !is_string($sPrefix)) {
|
144 |
throw new UnexpectedTokenException('Wrong namespace prefix', $sPrefix, 'custom', $iIdentifierLineNum);
|
145 |
}
|
241 |
* Replaces an item from the CSS list.
|
242 |
* @param RuleSet|Import|Charset|CSSList $oItemToRemove May be a RuleSet (most likely a DeclarationBlock), a Import, a Charset or another CSSList (most likely a MediaQuery)
|
243 |
*/
|
244 |
+
public function replace($oOldItem, $mNewItem) {
|
245 |
$iKey = array_search($oOldItem, $this->aContents, true);
|
246 |
if ($iKey !== false) {
|
247 |
+
if (is_array($mNewItem)) {
|
248 |
+
array_splice($this->aContents, $iKey, 1, $mNewItem);
|
249 |
+
} else {
|
250 |
+
array_splice($this->aContents, $iKey, 1, array($mNewItem));
|
251 |
+
}
|
252 |
return true;
|
253 |
}
|
254 |
return false;
|
@@ -3,11 +3,14 @@ namespace Sabberworm\CSS\Parsing;
|
|
3 |
|
4 |
use Sabberworm\CSS\Comment\Comment;
|
5 |
use Sabberworm\CSS\Parsing\UnexpectedTokenException;
|
|
|
6 |
use Sabberworm\CSS\Settings;
|
7 |
if ( ! defined( 'ABSPATH' ) ) {
|
8 |
exit;
|
9 |
}
|
10 |
class ParserState {
|
|
|
|
|
11 |
private $oParserSettings;
|
12 |
|
13 |
private $sText;
|
@@ -29,7 +32,9 @@ class ParserState {
|
|
29 |
public function setCharset($sCharset) {
|
30 |
$this->sCharset = $sCharset;
|
31 |
$this->aText = $this->strsplit($this->sText);
|
32 |
-
|
|
|
|
|
33 |
}
|
34 |
|
35 |
public function getCharset() {
|
@@ -90,7 +95,11 @@ class ParserState {
|
|
90 |
$sUtf32 .= chr($iUnicode & 0xff);
|
91 |
$iUnicode = $iUnicode >> 8;
|
92 |
}
|
93 |
-
|
|
|
|
|
|
|
|
|
94 |
}
|
95 |
if ($bIsForIdentifier) {
|
96 |
$peek = ord($this->peek());
|
@@ -118,8 +127,7 @@ class ParserState {
|
|
118 |
if($this->oParserSettings->bLenientParsing) {
|
119 |
try {
|
120 |
$oComment = $this->consumeComment();
|
121 |
-
} catch(
|
122 |
-
// When we can’t find the end of a comment, we assume the document is finished.
|
123 |
$this->iCurrentPosition = $this->iLength;
|
124 |
return;
|
125 |
}
|
@@ -160,7 +168,7 @@ class ParserState {
|
|
160 |
return $mValue;
|
161 |
} else {
|
162 |
if ($this->iCurrentPosition + $mValue > $this->iLength) {
|
163 |
-
throw new
|
164 |
}
|
165 |
$sResult = $this->substr($this->iCurrentPosition, $mValue);
|
166 |
$iLineCount = substr_count($sResult, "\n");
|
@@ -214,7 +222,8 @@ class ParserState {
|
|
214 |
$out = '';
|
215 |
$start = $this->iCurrentPosition;
|
216 |
|
217 |
-
while (
|
|
|
218 |
if (in_array($char, $aEnd)) {
|
219 |
if ($bIncludeEnd) {
|
220 |
$out .= $char;
|
@@ -229,8 +238,12 @@ class ParserState {
|
|
229 |
}
|
230 |
}
|
231 |
|
|
|
|
|
|
|
|
|
232 |
$this->iCurrentPosition = $start;
|
233 |
-
throw new
|
234 |
}
|
235 |
|
236 |
private function inputLeft() {
|
@@ -309,4 +322,4 @@ class ParserState {
|
|
309 |
return strpos($sString, $sNeedle, $iOffset);
|
310 |
}
|
311 |
}
|
312 |
-
}
|
3 |
|
4 |
use Sabberworm\CSS\Comment\Comment;
|
5 |
use Sabberworm\CSS\Parsing\UnexpectedTokenException;
|
6 |
+
use Sabberworm\CSS\Parsing\UnexpectedEOFException;
|
7 |
use Sabberworm\CSS\Settings;
|
8 |
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
exit;
|
10 |
}
|
11 |
class ParserState {
|
12 |
+
const EOF = null;
|
13 |
+
|
14 |
private $oParserSettings;
|
15 |
|
16 |
private $sText;
|
32 |
public function setCharset($sCharset) {
|
33 |
$this->sCharset = $sCharset;
|
34 |
$this->aText = $this->strsplit($this->sText);
|
35 |
+
if( is_array($this->aText) ) {
|
36 |
+
$this->iLength = count($this->aText);
|
37 |
+
}
|
38 |
}
|
39 |
|
40 |
public function getCharset() {
|
95 |
$sUtf32 .= chr($iUnicode & 0xff);
|
96 |
$iUnicode = $iUnicode >> 8;
|
97 |
}
|
98 |
+
if(function_exists('iconv')){
|
99 |
+
return iconv('utf-32le', $this->sCharset, $sUtf32);
|
100 |
+
}else{
|
101 |
+
return $sUtf32;
|
102 |
+
}
|
103 |
}
|
104 |
if ($bIsForIdentifier) {
|
105 |
$peek = ord($this->peek());
|
127 |
if($this->oParserSettings->bLenientParsing) {
|
128 |
try {
|
129 |
$oComment = $this->consumeComment();
|
130 |
+
} catch(UnexpectedEOFException $e) {
|
|
|
131 |
$this->iCurrentPosition = $this->iLength;
|
132 |
return;
|
133 |
}
|
168 |
return $mValue;
|
169 |
} else {
|
170 |
if ($this->iCurrentPosition + $mValue > $this->iLength) {
|
171 |
+
throw new UnexpectedEOFException($mValue, $this->peek(5), 'count', $this->iLineNo);
|
172 |
}
|
173 |
$sResult = $this->substr($this->iCurrentPosition, $mValue);
|
174 |
$iLineCount = substr_count($sResult, "\n");
|
222 |
$out = '';
|
223 |
$start = $this->iCurrentPosition;
|
224 |
|
225 |
+
while (!$this->isEnd()) {
|
226 |
+
$char = $this->consume(1);
|
227 |
if (in_array($char, $aEnd)) {
|
228 |
if ($bIncludeEnd) {
|
229 |
$out .= $char;
|
238 |
}
|
239 |
}
|
240 |
|
241 |
+
if (in_array(self::EOF, $aEnd)) {
|
242 |
+
return $out;
|
243 |
+
}
|
244 |
+
|
245 |
$this->iCurrentPosition = $start;
|
246 |
+
throw new UnexpectedEOFException('One of ("'.implode('","', $aEnd).'")', $this->peek(5), 'search', $this->iLineNo);
|
247 |
}
|
248 |
|
249 |
private function inputLeft() {
|
322 |
return strpos($sString, $sNeedle, $iOffset);
|
323 |
}
|
324 |
}
|
325 |
+
}
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Parsing;
|
4 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
5 |
+
exit;
|
6 |
+
}
|
7 |
+
/**
|
8 |
+
* Thrown if the CSS parsers encounters end of file it did not expect
|
9 |
+
* Extends UnexpectedTokenException in order to preserve backwards compatibility
|
10 |
+
*/
|
11 |
+
class UnexpectedEOFException extends UnexpectedTokenException {}
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Sabberworm\CSS\Property;
|
4 |
+
|
5 |
+
use Sabberworm\CSS\Parsing\UnexpectedTokenException;
|
6 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
+
exit;
|
8 |
+
}
|
9 |
+
class KeyframeSelector extends Selector {
|
10 |
+
|
11 |
+
//Regexes for specificity calculations
|
12 |
+
|
13 |
+
const SELECTOR_VALIDATION_RX = '/
|
14 |
+
^(
|
15 |
+
(?:
|
16 |
+
[a-zA-Z0-9\x{00A0}-\x{FFFF}_^$|*="\'~\[\]()\-\s\.:#+>]* # any sequence of valid unescaped characters
|
17 |
+
(?:\\\\.)? # a single escaped character
|
18 |
+
(?:([\'"]).*?(?<!\\\\)\2)? # a quoted text like [id="example"]
|
19 |
+
)*
|
20 |
+
)|
|
21 |
+
(\d+%) # keyframe animation progress percentage (e.g. 50%)
|
22 |
+
$
|
23 |
+
/ux';
|
24 |
+
|
25 |
+
}
|
@@ -53,7 +53,7 @@ class Selector {
|
|
53 |
private $iSpecificity;
|
54 |
|
55 |
public static function isValid($sSelector) {
|
56 |
-
return preg_match(
|
57 |
}
|
58 |
|
59 |
public function __construct($sSelector, $bCalculateSpecificity = false) {
|
53 |
private $iSpecificity;
|
54 |
|
55 |
public static function isValid($sSelector) {
|
56 |
+
return preg_match(static::SELECTOR_VALIDATION_RX, $sSelector);
|
57 |
}
|
58 |
|
59 |
public function __construct($sSelector, $bCalculateSpecificity = false) {
|
@@ -6,12 +6,14 @@ use Sabberworm\CSS\Parsing\ParserState;
|
|
6 |
use Sabberworm\CSS\Parsing\OutputException;
|
7 |
use Sabberworm\CSS\Parsing\UnexpectedTokenException;
|
8 |
use Sabberworm\CSS\Property\Selector;
|
|
|
9 |
use Sabberworm\CSS\Rule\Rule;
|
10 |
use Sabberworm\CSS\Value\RuleValueList;
|
11 |
use Sabberworm\CSS\Value\Value;
|
12 |
use Sabberworm\CSS\Value\Size;
|
13 |
use Sabberworm\CSS\Value\Color;
|
14 |
use Sabberworm\CSS\Value\URL;
|
|
|
15 |
if ( ! defined( 'ABSPATH' ) ) {
|
16 |
exit;
|
17 |
}
|
@@ -28,7 +30,7 @@ class DeclarationBlock extends RuleSet {
|
|
28 |
$this->aSelectors = array();
|
29 |
}
|
30 |
|
31 |
-
public static function parse(ParserState $oParserState) {
|
32 |
$aComments = array();
|
33 |
$oResult = new DeclarationBlock($oParserState->currentLine());
|
34 |
try {
|
@@ -44,7 +46,7 @@ class DeclarationBlock extends RuleSet {
|
|
44 |
}
|
45 |
}
|
46 |
} while (!in_array($oParserState->peek(), array('{', '}')) || $sStringWrapperChar !== false);
|
47 |
-
$oResult->setSelector(implode('', $aSelectorParts));
|
48 |
if ($oParserState->comes('{')) {
|
49 |
$oParserState->consume(1);
|
50 |
}
|
@@ -64,7 +66,7 @@ class DeclarationBlock extends RuleSet {
|
|
64 |
}
|
65 |
|
66 |
|
67 |
-
public function setSelectors($mSelector) {
|
68 |
if (is_array($mSelector)) {
|
69 |
$this->aSelectors = $mSelector;
|
70 |
} else {
|
@@ -72,10 +74,17 @@ class DeclarationBlock extends RuleSet {
|
|
72 |
}
|
73 |
foreach ($this->aSelectors as $iKey => $mSelector) {
|
74 |
if (!($mSelector instanceof Selector)) {
|
75 |
-
if (!
|
76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
}
|
78 |
-
$this->aSelectors[$iKey] = new Selector($mSelector);
|
79 |
}
|
80 |
}
|
81 |
}
|
@@ -104,8 +113,8 @@ class DeclarationBlock extends RuleSet {
|
|
104 |
/**
|
105 |
* @deprecated use setSelectors()
|
106 |
*/
|
107 |
-
public function setSelector($mSelector) {
|
108 |
-
$this->setSelectors($mSelector);
|
109 |
}
|
110 |
|
111 |
/**
|
6 |
use Sabberworm\CSS\Parsing\OutputException;
|
7 |
use Sabberworm\CSS\Parsing\UnexpectedTokenException;
|
8 |
use Sabberworm\CSS\Property\Selector;
|
9 |
+
use Sabberworm\CSS\Property\KeyframeSelector;
|
10 |
use Sabberworm\CSS\Rule\Rule;
|
11 |
use Sabberworm\CSS\Value\RuleValueList;
|
12 |
use Sabberworm\CSS\Value\Value;
|
13 |
use Sabberworm\CSS\Value\Size;
|
14 |
use Sabberworm\CSS\Value\Color;
|
15 |
use Sabberworm\CSS\Value\URL;
|
16 |
+
use Sabberworm\CSS\CSSList\KeyFrame;
|
17 |
if ( ! defined( 'ABSPATH' ) ) {
|
18 |
exit;
|
19 |
}
|
30 |
$this->aSelectors = array();
|
31 |
}
|
32 |
|
33 |
+
public static function parse(ParserState $oParserState, $oList = NULL) {
|
34 |
$aComments = array();
|
35 |
$oResult = new DeclarationBlock($oParserState->currentLine());
|
36 |
try {
|
46 |
}
|
47 |
}
|
48 |
} while (!in_array($oParserState->peek(), array('{', '}')) || $sStringWrapperChar !== false);
|
49 |
+
$oResult->setSelector(implode('', $aSelectorParts), $oList);
|
50 |
if ($oParserState->comes('{')) {
|
51 |
$oParserState->consume(1);
|
52 |
}
|
66 |
}
|
67 |
|
68 |
|
69 |
+
public function setSelectors($mSelector, $oList = NULL) {
|
70 |
if (is_array($mSelector)) {
|
71 |
$this->aSelectors = $mSelector;
|
72 |
} else {
|
74 |
}
|
75 |
foreach ($this->aSelectors as $iKey => $mSelector) {
|
76 |
if (!($mSelector instanceof Selector)) {
|
77 |
+
if ($oList === NULL || !($oList instanceof KeyFrame)) {
|
78 |
+
if (!Selector::isValid($mSelector)) {
|
79 |
+
throw new UnexpectedTokenException("Selector did not match '" . Selector::SELECTOR_VALIDATION_RX . "'.", $mSelector, "custom");
|
80 |
+
}
|
81 |
+
$this->aSelectors[$iKey] = new Selector($mSelector);
|
82 |
+
} else {
|
83 |
+
if (!KeyframeSelector::isValid($mSelector)) {
|
84 |
+
throw new UnexpectedTokenException("Selector did not match '" . KeyframeSelector::SELECTOR_VALIDATION_RX . "'.", $mSelector, "custom");
|
85 |
+
}
|
86 |
+
$this->aSelectors[$iKey] = new KeyframeSelector($mSelector);
|
87 |
}
|
|
|
88 |
}
|
89 |
}
|
90 |
}
|
113 |
/**
|
114 |
* @deprecated use setSelectors()
|
115 |
*/
|
116 |
+
public function setSelector($mSelector, $oList = NULL) {
|
117 |
+
$this->setSelectors($mSelector, $oList);
|
118 |
}
|
119 |
|
120 |
/**
|
@@ -63,8 +63,7 @@ class Size extends PrimitiveValue {
|
|
63 |
self::$SIZE_UNITS[$iSize][strtolower($val)] = $val;
|
64 |
}
|
65 |
|
66 |
-
|
67 |
-
ksort(self::$SIZE_UNITS, SORT_NUMERIC);
|
68 |
}
|
69 |
|
70 |
return self::$SIZE_UNITS;
|
@@ -118,7 +117,8 @@ class Size extends PrimitiveValue {
|
|
118 |
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
119 |
$l = localeconv();
|
120 |
$sPoint = preg_quote($l['decimal_point'], '/');
|
121 |
-
|
|
|
122 |
}
|
123 |
|
124 |
}
|
63 |
self::$SIZE_UNITS[$iSize][strtolower($val)] = $val;
|
64 |
}
|
65 |
|
66 |
+
krsort(self::$SIZE_UNITS, SORT_NUMERIC);
|
|
|
67 |
}
|
68 |
|
69 |
return self::$SIZE_UNITS;
|
117 |
public function render(\Sabberworm\CSS\OutputFormat $oOutputFormat) {
|
118 |
$l = localeconv();
|
119 |
$sPoint = preg_quote($l['decimal_point'], '/');
|
120 |
+
$sSize = preg_match("/[\d\.]+e[+-]?\d+/i", (string)$this->fSize) ? preg_replace("/$sPoint?0+$/", "", sprintf("%f", $this->fSize)) : $this->fSize;
|
121 |
+
return preg_replace(array("/$sPoint/", "/^(-?)0\./"), array('.', '$1.'), $sSize) . ($this->sUnit === null ? '' : $this->sUnit);
|
122 |
}
|
123 |
|
124 |
}
|
@@ -41,7 +41,6 @@ function amppb_save_post( $post_id, $post ){
|
|
41 |
|
42 |
/* Get new submitted data and sanitize it. */
|
43 |
$submitted_data = isset( $request['amp-page-builder'] ) && ampforwp_isjson($request['amp-page-builder']) ? $request['amp-page-builder'] : null;
|
44 |
-
$submitted_data = (str_replace(array("'","<script>","</script>"), array("'","",""), $submitted_data));
|
45 |
$submitted_data = wp_slash($submitted_data);
|
46 |
|
47 |
/* New data submitted, No previous data, create it */
|
41 |
|
42 |
/* Get new submitted data and sanitize it. */
|
43 |
$submitted_data = isset( $request['amp-page-builder'] ) && ampforwp_isjson($request['amp-page-builder']) ? $request['amp-page-builder'] : null;
|
|
|
44 |
$submitted_data = wp_slash($submitted_data);
|
45 |
|
46 |
/* New data submitted, No previous data, create it */
|
@@ -445,21 +445,10 @@ if ( is_admin() ) {
|
|
445 |
$width = $width * $resolution;
|
446 |
$height = $height * $resolution;
|
447 |
}
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
if($thumb_url!=false){
|
454 |
-
$image = $thumb_url[0];
|
455 |
-
$width = $thumb_url[1];
|
456 |
-
$height = $thumb_url[2];
|
457 |
-
}
|
458 |
-
}
|
459 |
-
|
460 |
-
}catch(Exception $e){
|
461 |
-
error_log($e);
|
462 |
-
}
|
463 |
}
|
464 |
|
465 |
$excerptContent = "";
|
445 |
$width = $width * $resolution;
|
446 |
$height = $height * $resolution;
|
447 |
}
|
448 |
+
if(!is_numeric($width) && !is_numeric($height)){
|
449 |
+
$width = '346';
|
450 |
+
$height = '188';
|
451 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
452 |
}
|
453 |
|
454 |
$excerptContent = "";
|
@@ -4,7 +4,7 @@ Tags: AMP, accelerated mobile pages, mobile, amp project, google amp, amp wp, go
|
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 5.3.2
|
7 |
-
Stable tag: 1.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -191,6 +191,23 @@ You can contact us from [here](https://ampforwp.com/contact/)
|
|
191 |
|
192 |
== Changelog ==
|
193 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
= 1.0.5 (30th December 2019) =
|
195 |
* Fixed: Menu arrow icon not showing properly in mobile version #3995
|
196 |
* Fixed: Google Tag manager not firing properly #3826
|
4 |
Donate link: https://www.paypal.me/Kaludi/25
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 5.3.2
|
7 |
+
Stable tag: 1.0.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
191 |
|
192 |
== Changelog ==
|
193 |
|
194 |
+
= 1.0.6 (31th December 2019) =
|
195 |
+
* Improvement: Allow users to add custom script in amp by using amp theme frame work plugin or without plugin #3865
|
196 |
+
* Improvement: Allow users to register scripts in proper way in AMP Theme Framework #3257
|
197 |
+
* Improvement: Need to add filter to modify mobile redirection #3987
|
198 |
+
* Improvement: Need to update Sabberworm/CSS folder. #4012
|
199 |
+
* Improvement: Need to make compatibility with "Transposh WordPress Translation" plugin #3895
|
200 |
+
* Fixed: Warning issue with "$amp_emplate->get('metadata')" undefined metadata #3967
|
201 |
+
* Fixed: GDPR popup appears once agin after accepting it #3957
|
202 |
+
* Fixed: AMP Page apears blank after adding script tag in Head Section of AMP Page Builder #3834
|
203 |
+
* Fixed: when user is not an admin and the admin bar is getting displayed as gap on the site #3918
|
204 |
+
* Fixed: Option Panel not saving in AMP FOR WP, it is giving 404 error #3768
|
205 |
+
* Fixed: Page Builder Latest Posts Category Module #3927
|
206 |
+
* Fixed: Error amp-iframe extension .js appears more than once #3810
|
207 |
+
* Fixed: Query monitor is not working in our latest version. #4008
|
208 |
+
* Fixed: Google Tag manager not firing properly #3826
|
209 |
+
* Fixed: Undefined variable block_css #4021
|
210 |
+
|
211 |
= 1.0.5 (30th December 2019) =
|
212 |
* Fixed: Menu arrow icon not showing properly in mobile version #3995
|
213 |
* Fixed: Google Tag manager not firing properly #3826
|
@@ -874,7 +874,7 @@ function ampforwp_meta_redirection_status(){
|
|
874 |
if ( empty( $ampforwp_redirection_post_on_off_meta ) ) {
|
875 |
$ampforwp_redirection_post_on_off_meta = 'enable';
|
876 |
}
|
877 |
-
|
878 |
return $ampforwp_redirection_post_on_off_meta;
|
879 |
|
880 |
}
|
@@ -2226,12 +2226,37 @@ function ampforwp_footer_html_output() {
|
|
2226 |
}
|
2227 |
}
|
2228 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2229 |
add_action('amp_post_template_head','ampforwp_header_html_output',11);
|
2230 |
function ampforwp_header_html_output() {
|
2231 |
|
2232 |
if( ampforwp_get_setting('amp-header-text-area-for-html') ) {
|
2233 |
-
|
2234 |
-
|
|
|
|
|
2235 |
// amphtml tag when AMP Takeover is enabled #2550
|
2236 |
if(ampforwp_get_setting('ampforwp-amp-takeover') == true){
|
2237 |
$amp_url = "";
|
@@ -2246,6 +2271,37 @@ function ampforwp_header_html_output() {
|
|
2246 |
}
|
2247 |
}
|
2248 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2249 |
|
2250 |
//40. Meta Robots
|
2251 |
add_action('amp_post_template_head' , 'ampforwp_talking_to_robots');
|
@@ -7173,8 +7229,14 @@ function ampforwp_head_css(){
|
|
7173 |
$css = ampforwp_get_remote_content(AMPFORWP_PLUGIN_DIR_URI."/templates/template-mode/admin-bar.css");
|
7174 |
$incurl = includes_url();
|
7175 |
$incurl = trailingslashit($incurl) .'fonts/dashicons.ttf?50db0456fde2a241f005968eede3f987';
|
7176 |
-
$css.='@font-face{font-family:dashicons;src:url('
|
7177 |
-
font-weight:400;font-style:normal}
|
|
|
|
|
|
|
|
|
|
|
|
|
7178 |
echo ampforwp_css_sanitizer($css);
|
7179 |
}
|
7180 |
}
|
@@ -7381,7 +7443,7 @@ if(ampforwp_get_setting('ampforwp_css_tree_shaking') == true && ampforwp_is_gute
|
|
7381 |
}
|
7382 |
if(!function_exists('ampforwp_gutenberg_block_styles')){
|
7383 |
function ampforwp_gutenberg_block_styles(){
|
7384 |
-
$gutenberg_styles = '';
|
7385 |
ob_start();
|
7386 |
wp_print_styles('wp-block-library');
|
7387 |
$block_css .= ob_get_contents();
|
@@ -7417,4 +7479,89 @@ function ampforwp_is_gutenberg_active() {
|
|
7417 |
}
|
7418 |
$use_block_editor = ( get_option( 'classic-editor-replace' ) === 'no-replace' );
|
7419 |
return $use_block_editor;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7420 |
}
|
874 |
if ( empty( $ampforwp_redirection_post_on_off_meta ) ) {
|
875 |
$ampforwp_redirection_post_on_off_meta = 'enable';
|
876 |
}
|
877 |
+
$ampforwp_redirection_post_on_off_meta = apply_filters('ampforwp_disable_mobile_redirection', $ampforwp_redirection_post_on_off_meta);
|
878 |
return $ampforwp_redirection_post_on_off_meta;
|
879 |
|
880 |
}
|
2226 |
}
|
2227 |
}
|
2228 |
|
2229 |
+
add_filter( 'amp_post_template_data', 'ampforwp_global_head_scripts');
|
2230 |
+
function ampforwp_global_head_scripts($data){
|
2231 |
+
$content = $data['post_amp_content'];
|
2232 |
+
$script_slug = '';
|
2233 |
+
$script_url = '';
|
2234 |
+
if( ampforwp_get_setting('amp-header-text-area-for-html') ) {
|
2235 |
+
$allscripts = ampforwp_get_setting('amp-header-text-area-for-html');
|
2236 |
+
preg_match_all('/<script(.*?)custom-element=\"(.*?)\"(.*?)src=\"(.*?)\"(.*?)><\/script>/', $allscripts, $matches);
|
2237 |
+
$script_slug = $matches[2];
|
2238 |
+
$script_url = $matches[4];
|
2239 |
+
if($matches){
|
2240 |
+
foreach ($script_slug as $key => $slug) {
|
2241 |
+
if(preg_match('/<\/'.$slug.'>/', $content)){
|
2242 |
+
if ( empty( $data['amp_component_scripts'][$slug] ) ) {
|
2243 |
+
$data['amp_component_scripts'][$slug] = $script_url[$key];
|
2244 |
+
}
|
2245 |
+
}
|
2246 |
+
}
|
2247 |
+
}
|
2248 |
+
}
|
2249 |
+
return $data;
|
2250 |
+
}
|
2251 |
+
|
2252 |
add_action('amp_post_template_head','ampforwp_header_html_output',11);
|
2253 |
function ampforwp_header_html_output() {
|
2254 |
|
2255 |
if( ampforwp_get_setting('amp-header-text-area-for-html') ) {
|
2256 |
+
$allhtml = ampforwp_get_setting('amp-header-text-area-for-html');
|
2257 |
+
$allhtml = preg_replace('/<script(.*?)custom-element=\"(.*?)\"(.*?)src=\"(.*?)\"(.*?)><\/script>/','', $allhtml);
|
2258 |
+
echo $allhtml;
|
2259 |
+
}
|
2260 |
// amphtml tag when AMP Takeover is enabled #2550
|
2261 |
if(ampforwp_get_setting('ampforwp-amp-takeover') == true){
|
2262 |
$amp_url = "";
|
2271 |
}
|
2272 |
}
|
2273 |
|
2274 |
+
add_filter('amp_post_template_data','ampforwp_set_body_content_script', 20);
|
2275 |
+
function ampforwp_set_body_content_script($data){
|
2276 |
+
if( ampforwp_get_setting('amp-body-text-area') || ampforwp_get_setting('amp-footer-text-area-for-html') ) {
|
2277 |
+
$head_content = ampforwp_get_setting('amp-header-text-area-for-html');
|
2278 |
+
preg_match_all('/"amp-(.*?)"/', $head_content, $matches1);
|
2279 |
+
$body_content = ampforwp_get_setting('amp-body-text-area');
|
2280 |
+
preg_match_all('/<\/amp-(.*?)>/', $body_content, $matches);
|
2281 |
+
if(ampforwp_get_setting('amp-footer-text-area-for-html') ) {
|
2282 |
+
$footer_content = ampforwp_get_setting('amp-footer-text-area-for-html');
|
2283 |
+
preg_match_all('/<\/amp-(.*?)>/', $footer_content, $matches);
|
2284 |
+
}
|
2285 |
+
if(isset($matches[1][0])){
|
2286 |
+
$amp_comp = $matches[1];
|
2287 |
+
for($i=0;$i<count($amp_comp);$i++){
|
2288 |
+
$comp = $amp_comp[$i];
|
2289 |
+
if($comp!='img'){
|
2290 |
+
if(isset($matches[1][0])){
|
2291 |
+
$thtml = $matches1[1];
|
2292 |
+
if(!in_array($comp, $thtml)){
|
2293 |
+
$data['amp_component_scripts']["amp-".esc_attr($comp)] = "https://cdn.ampproject.org/v0/amp-".esc_attr($comp)."-latest.js";
|
2294 |
+
}
|
2295 |
+
} else{
|
2296 |
+
$data['amp_component_scripts']["amp-".esc_attr($comp)] = "https://cdn.ampproject.org/v0/amp-".esc_attr($comp)."-latest.js";
|
2297 |
+
}
|
2298 |
+
}
|
2299 |
+
}
|
2300 |
+
}
|
2301 |
+
|
2302 |
+
}
|
2303 |
+
return $data;
|
2304 |
+
}
|
2305 |
|
2306 |
//40. Meta Robots
|
2307 |
add_action('amp_post_template_head' , 'ampforwp_talking_to_robots');
|
7229 |
$css = ampforwp_get_remote_content(AMPFORWP_PLUGIN_DIR_URI."/templates/template-mode/admin-bar.css");
|
7230 |
$incurl = includes_url();
|
7231 |
$incurl = trailingslashit($incurl) .'fonts/dashicons.ttf?50db0456fde2a241f005968eede3f987';
|
7232 |
+
$css.='@font-face{font-family:dashicons;src:url('.$incurl.'/fonts/dashicons.ttf?50db0456fde2a241f005968eede3f987) format("truetype");
|
7233 |
+
font-weight:400;font-style:normal}
|
7234 |
+
#wp-admin-bar-my-account .avatar{float:right;margin-top:7px;margin-left:5px;height:18px;width:18px;border:1px solid #82878c}#wp-admin-bar-wpseo-notifications .yoast-issue-counter{float:right}@media(max-width:782px){#wpadminbar~header #headerwrap{top:46px}}';
|
7235 |
+
if(ampforwp_get_setting('amp-design-selector')!=3){
|
7236 |
+
$css.='#wpadminbar~header{margin-top:32px}@media(max-width:782px){#wpadminbar~header{margin-top:46px}}';
|
7237 |
+
}else{
|
7238 |
+
$css.='#wpadminbar~header #headerwrap{top:32px}@media(max-width:782px){#wpadminbar~header #headerwrap{margin-top:46px}}';
|
7239 |
+
}
|
7240 |
echo ampforwp_css_sanitizer($css);
|
7241 |
}
|
7242 |
}
|
7443 |
}
|
7444 |
if(!function_exists('ampforwp_gutenberg_block_styles')){
|
7445 |
function ampforwp_gutenberg_block_styles(){
|
7446 |
+
$gutenberg_styles = $block_css = '';
|
7447 |
ob_start();
|
7448 |
wp_print_styles('wp-block-library');
|
7449 |
$block_css .= ob_get_contents();
|
7479 |
}
|
7480 |
$use_block_editor = ( get_option( 'classic-editor-replace' ) === 'no-replace' );
|
7481 |
return $use_block_editor;
|
7482 |
+
}
|
7483 |
+
|
7484 |
+
add_filter( 'amp_post_template_data', 'ampforwp_pblayout_head_scripts');
|
7485 |
+
$pb_remove_script = array();
|
7486 |
+
function ampforwp_pblayout_head_scripts($data){
|
7487 |
+
$postId = ampforwp_get_the_ID();
|
7488 |
+
$ampforwp_pagebuilder_enable = get_post_meta($postId,'ampforwp_page_builder_enable', true);
|
7489 |
+
if(isset($ampforwp_pagebuilder_enable) && $ampforwp_pagebuilder_enable=="yes"){
|
7490 |
+
$previousData = get_post_meta($postId,'amp-page-builder');
|
7491 |
+
$previousData = isset($previousData[0])? $previousData[0]: null;
|
7492 |
+
$previousData = (str_replace("'", "'", $previousData));
|
7493 |
+
$totalRows = 1;
|
7494 |
+
$totalmodules = 1;
|
7495 |
+
if(!empty($previousData)){
|
7496 |
+
$jsonData = json_decode($previousData,true);
|
7497 |
+
if(count($jsonData['rows'])>0){
|
7498 |
+
$totalRows = $jsonData['totalrows'];
|
7499 |
+
$totalmodules = $jsonData['totalmodules'];
|
7500 |
+
$previousData = json_encode($jsonData);
|
7501 |
+
}else{
|
7502 |
+
$jsonData['rows'] = array();
|
7503 |
+
$jsonData['totalrows']=1;
|
7504 |
+
$jsonData['totalmodules'] = 1;
|
7505 |
+
$previousData = json_encode($jsonData);
|
7506 |
+
}
|
7507 |
+
}
|
7508 |
+
$jarr = json_decode($previousData);
|
7509 |
+
if(isset($jarr->settingdata->scripts_data)){
|
7510 |
+
$script_data = $jarr->settingdata->scripts_data;
|
7511 |
+
$content = $data['post_amp_content'];
|
7512 |
+
$script_slug = '';
|
7513 |
+
$allscripts = $script_data;
|
7514 |
+
preg_match_all('/<script(.*?)custom-element=\"(.*?)\"(.*?)src=\"(.*?)\"(.*?)><\/script>/', $allscripts, $matches);
|
7515 |
+
if($matches){
|
7516 |
+
if(isset($matches[2])){
|
7517 |
+
$script_slug = $matches[2];
|
7518 |
+
foreach ($script_slug as $key => $slug) {
|
7519 |
+
if(!preg_match('/'.$slug.'/', $content)){
|
7520 |
+
global $pb_remove_script;
|
7521 |
+
$pb_remove_script[]= esc_attr($slug);
|
7522 |
+
}
|
7523 |
+
}
|
7524 |
+
}
|
7525 |
+
add_filter( 'ampforwp_the_content_last_filter','ampforwp_remove_unused_pb_amp_script',12);
|
7526 |
+
}
|
7527 |
+
}
|
7528 |
+
}
|
7529 |
+
return $data;
|
7530 |
+
}
|
7531 |
+
function ampforwp_remove_unused_pb_amp_script($data){
|
7532 |
+
global $pb_remove_script;
|
7533 |
+
for($i=0;$i<count($pb_remove_script);$i++){
|
7534 |
+
$data = preg_replace('/<script(.*?)custom-element=\"'.esc_attr($pb_remove_script[$i]).'\"(.*?)src=\"(.*?)\"(.*?)><\/script>/', '', $data);
|
7535 |
+
}
|
7536 |
+
return $data;
|
7537 |
+
}
|
7538 |
+
|
7539 |
+
if(class_exists('transposh_plugin')){
|
7540 |
+
add_action('amp_post_template_css','ampforwp_transposh_plugin_rtl_css');
|
7541 |
+
}
|
7542 |
+
if(!function_exists('ampforwp_transposh_plugin_rtl_css')){
|
7543 |
+
function ampforwp_transposh_plugin_rtl_css() {
|
7544 |
+
$rtl_lang_arr = array('ar', 'he', 'fa', 'ur', 'yi');
|
7545 |
+
if(isset($_GET['lang'])){
|
7546 |
+
if(in_array(esc_attr($_GET['lang']), $rtl_lang_arr)){
|
7547 |
+
if(ampforwp_get_setting('header-position-type') == '1'){?>
|
7548 |
+
.tg:checked + .hamb-mnu > .m-ctr {
|
7549 |
+
margin-right: 0%;
|
7550 |
+
}
|
7551 |
+
.m-ctr{
|
7552 |
+
margin-right: -100%;
|
7553 |
+
float: left;
|
7554 |
+
}
|
7555 |
+
<?php } if(ampforwp_get_setting('header-position-type') == '2'){?>
|
7556 |
+
.tg:checked + .hamb-mnu > .m-ctr {
|
7557 |
+
margin-right: calc(100% - <?php echo esc_html(ampforwp_get_setting('header-overlay-width'))?>);
|
7558 |
+
}
|
7559 |
+
.m-ctr{
|
7560 |
+
margin-right: 100%;
|
7561 |
+
float: right;
|
7562 |
+
}
|
7563 |
+
<?php }
|
7564 |
+
}
|
7565 |
+
}
|
7566 |
+
}
|
7567 |
}
|