Child Theme Configurator - Version 2.0.4

Version Description

  • Updated preview class to send origin headers and run customize_preview_init action along with some other actions.
Download this release

Release Info

Developer lilaeamedia
Plugin Icon 128x128 Child Theme Configurator
Version 2.0.4
Comparing to
See all releases

Code changes from version 2.0.3 to 2.0.4

child-theme-configurator.php CHANGED
@@ -6,7 +6,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
6
  Plugin Name: Child Theme Configurator
7
  Plugin URI: http://www.childthemeconfigurator.com
8
  Description: When using the Customizer is not enough - Create child themes and customize styles, templates, functions and more.
9
- Version: 2.0.3
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com
12
  Text Domain: child-theme-configurator
@@ -26,9 +26,13 @@ if ( !defined( 'ABSPATH' ) ) exit;
26
  if ( is_admin() )
27
  include_once( dirname( __FILE__ ) . '/includes/class-ctc.php' );
28
 
29
- if ( isset( $_GET['preview_ctc'] ) )
30
  include_once( dirname( __FILE__ ) . '/includes/class-ctc-preview.php' );
31
-
 
 
 
 
32
  add_filter( 'style_loader_src', 'chld_thm_cfg_version', 10, 2 );
33
 
34
  function chld_thm_cfg_version( $src, $handle ) {
6
  Plugin Name: Child Theme Configurator
7
  Plugin URI: http://www.childthemeconfigurator.com
8
  Description: When using the Customizer is not enough - Create child themes and customize styles, templates, functions and more.
9
+ Version: 2.0.4
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com
12
  Text Domain: child-theme-configurator
26
  if ( is_admin() )
27
  include_once( dirname( __FILE__ ) . '/includes/class-ctc.php' );
28
 
29
+ if ( isset( $_GET['preview_ctc'] ) ):
30
  include_once( dirname( __FILE__ ) . '/includes/class-ctc-preview.php' );
31
+ // replace core preview function with CTCP function for quick preview
32
+ remove_action( 'setup_theme', 'preview_theme' );
33
+ add_action( 'setup_theme', 'ChildThemeConfiguratorPreview::preview_theme' );
34
+ endif;
35
+
36
  add_filter( 'style_loader_src', 'chld_thm_cfg_version', 10, 2 );
37
 
38
  function chld_thm_cfg_version( $src, $handle ) {
includes/class-ctc-admin.php CHANGED
@@ -6,7 +6,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
6
  Class: Child_Theme_Configurator
7
  Plugin URI: http://www.childthemeconfigurator.com/
8
  Description: Main Controller Class
9
- Version: 2.0.3
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: child-theme-configurator
6
  Class: Child_Theme_Configurator
7
  Plugin URI: http://www.childthemeconfigurator.com/
8
  Description: Main Controller Class
9
+ Version: 2.0.4
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: child-theme-configurator
includes/class-ctc-css.php CHANGED
@@ -6,7 +6,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
6
  Class: ChildThemeConfiguratorCSS
7
  Plugin URI: http://www.childthemeconfigurator.com/
8
  Description: Handles all CSS input, output, parsing, normalization and storage
9
- Version: 2.0.3
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
6
  Class: ChildThemeConfiguratorCSS
7
  Plugin URI: http://www.childthemeconfigurator.com/
8
  Description: Handles all CSS input, output, parsing, normalization and storage
9
+ Version: 2.0.4
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
includes/class-ctc-preview.php CHANGED
@@ -24,9 +24,14 @@ ini_set( 'display_errors', 1 );
24
  // check for manipulations
25
  if ( validate_file( $_GET[ 'template' ] ) )
26
  return;
27
- global $wp_customize;
28
- // require_once ABSPATH . WPINC . '/class-wp-customize-manager.php';
29
- $wp_customize = new WP_Customize_Manager();
 
 
 
 
 
30
 
31
  // replace future get_template calls with preview template
32
  add_filter( 'template', 'ChildThemeConfiguratorPreview::preview_theme_template_filter' );
@@ -43,6 +48,10 @@ ini_set( 'display_errors', 1 );
43
  // swap out theme mods with preview theme mods
44
  add_filter( 'pre_option_theme_mods_' . get_option( 'stylesheet' ),
45
  'ChildThemeConfiguratorPreview::preview_mods' );
 
 
 
 
46
  //add_filter( 'woocommerce_unforce_ssl_checkout', 'ChildThemeConfiguratorPreview::woocommerce_unforce_ssl_checkout', 1000 );
47
  // Run wp_redirect_status late to make sure we override the status last.
48
  add_action( 'wp_redirect_status', 'ChildThemeConfiguratorPreview::redirect_status', 1000 );
@@ -51,7 +60,8 @@ ini_set( 'display_errors', 1 );
51
  add_action( 'wp_print_styles', 'ChildThemeConfiguratorPreview::test_css', 999999 );
52
  // pass the wp_styles queue back to use for stylesheet handle verification
53
  add_action( 'wp_footer', 'ChildThemeConfiguratorPreview::parse_stylesheet' );
54
-
 
55
  }
56
 
57
  /**
@@ -156,12 +166,14 @@ ini_set( 'display_errors', 1 );
156
  static function woocommerce_unforce_ssl_checkout( $bool ){
157
  return FALSE;
158
  }
 
 
 
 
 
 
159
  }
160
 
161
- // replace core preview function with CTCP function for quick preview
162
- remove_action( 'setup_theme', 'preview_theme' );
163
- add_action( 'setup_theme', 'ChildThemeConfiguratorPreview::preview_theme' );
164
-
165
  if ( !class_exists( 'WP_Customize_Manager' ) ) {
166
  final class WP_Customize_Manager {
167
  function is_preview() {
24
  // check for manipulations
25
  if ( validate_file( $_GET[ 'template' ] ) )
26
  return;
27
+
28
+ // Do not spawn cron (especially the alternate cron) while running the Customizer.
29
+ remove_action( 'init', 'wp_cron' );
30
+
31
+ // Do not run update checks when rendering the controls.
32
+ remove_action( 'admin_init', '_maybe_update_core' );
33
+ remove_action( 'admin_init', '_maybe_update_plugins' );
34
+ remove_action( 'admin_init', '_maybe_update_themes' );
35
 
36
  // replace future get_template calls with preview template
37
  add_filter( 'template', 'ChildThemeConfiguratorPreview::preview_theme_template_filter' );
48
  // swap out theme mods with preview theme mods
49
  add_filter( 'pre_option_theme_mods_' . get_option( 'stylesheet' ),
50
  'ChildThemeConfiguratorPreview::preview_mods' );
51
+
52
+ // let themes and plugins do their thing
53
+ add_action( 'wp_loaded', 'ChildThemeConfiguratorPreview::customize_preview_init' );
54
+
55
  //add_filter( 'woocommerce_unforce_ssl_checkout', 'ChildThemeConfiguratorPreview::woocommerce_unforce_ssl_checkout', 1000 );
56
  // Run wp_redirect_status late to make sure we override the status last.
57
  add_action( 'wp_redirect_status', 'ChildThemeConfiguratorPreview::redirect_status', 1000 );
60
  add_action( 'wp_print_styles', 'ChildThemeConfiguratorPreview::test_css', 999999 );
61
  // pass the wp_styles queue back to use for stylesheet handle verification
62
  add_action( 'wp_footer', 'ChildThemeConfiguratorPreview::parse_stylesheet' );
63
+
64
+ send_origin_headers();
65
  }
66
 
67
  /**
166
  static function woocommerce_unforce_ssl_checkout( $bool ){
167
  return FALSE;
168
  }
169
+
170
+ static function customize_preview_init() {
171
+ global $wp_customize;
172
+ $wp_customize = new WP_Customize_Manager();
173
+ do_action( 'customize_preview_init', $wp_customize );
174
+ }
175
  }
176
 
 
 
 
 
177
  if ( !class_exists( 'WP_Customize_Manager' ) ) {
178
  final class WP_Customize_Manager {
179
  function is_preview() {
includes/class-ctc-ui.php CHANGED
@@ -5,7 +5,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
5
  Class: Child_Theme_Configurator_UI
6
  Plugin URI: http://www.childthemeconfigurator.com/
7
  Description: Handles the plugin User Interface
8
- Version: 2.0.3
9
  Author: Lilaea Media
10
  Author URI: http://www.lilaeamedia.com/
11
  Text Domain: chld_thm_cfg
@@ -315,7 +315,7 @@ class ChildThemeConfiguratorUI {
315
  'anlz4_txt' => __( 'The theme "%s" could not be analyzed because the preview did not render correctly.', 'child-theme-configurator' ),
316
  'anlz5_txt' => __( '<p>You can still generate a child theme by manually selecting the settings below, but there will be no baseline styles available in the Configurator.</strong></p><p>You might try temporarily disabling plugins that <strong>minify CSS</strong> or that <strong>force redirects between HTTP and HTTPS</strong> and try analyzing again.</p>', 'child-theme-configurator' ),
317
  'anlz6_txt' => __( 'Show Debug Output', 'child-theme-configurator' ),
318
- 'anlz7_txt' => __( "<p>You may not be able to use this Theme as a Child Theme while these conditions exist.</p><p>It is possible that this theme has specific requirements to work correctly as a child theme. Check your theme's documentation for more information.</p><p>Please make sure you are using the latest version of this theme. If so, please contact this Theme's author and report the error list above.</p>", 'child-theme-configurator' ),
319
  'anlz8_txt' => __( 'Do Not Activate "%s"! A PHP FATAL ERROR has been detected.', 'child-theme-configurator' ),
320
  'anlz9_txt' => __( 'This theme loads stylesheets after the wp_styles queue.', 'child-theme-configurator' ),
321
  'anlz10_txt' => __( '<p>This makes it difficult for plugins to override these styles. You can try to resolve this using the "Repair header template" option (Step 6, "Additional handling options", below).</p>', 'child-theme-configurator' ),
5
  Class: Child_Theme_Configurator_UI
6
  Plugin URI: http://www.childthemeconfigurator.com/
7
  Description: Handles the plugin User Interface
8
+ Version: 2.0.4
9
  Author: Lilaea Media
10
  Author URI: http://www.lilaeamedia.com/
11
  Text Domain: chld_thm_cfg
315
  'anlz4_txt' => __( 'The theme "%s" could not be analyzed because the preview did not render correctly.', 'child-theme-configurator' ),
316
  'anlz5_txt' => __( '<p>You can still generate a child theme by manually selecting the settings below, but there will be no baseline styles available in the Configurator.</strong></p><p>You might try temporarily disabling plugins that <strong>minify CSS</strong> or that <strong>force redirects between HTTP and HTTPS</strong> and try analyzing again.</p>', 'child-theme-configurator' ),
317
  'anlz6_txt' => __( 'Show Debug Output', 'child-theme-configurator' ),
318
+ 'anlz7_txt' => __( "<p>Please contact this Theme's author and report the items above. You may or may not be able to use this Theme as a Child Theme while these conditions exist.</p><p>It is possible that this theme has specific requirements to work correctly as a child theme. Please make sure you are using the latest version of this theme and check your theme's documentation for more information.</p>", 'child-theme-configurator' ),
319
  'anlz8_txt' => __( 'Do Not Activate "%s"! A PHP FATAL ERROR has been detected.', 'child-theme-configurator' ),
320
  'anlz9_txt' => __( 'This theme loads stylesheets after the wp_styles queue.', 'child-theme-configurator' ),
321
  'anlz10_txt' => __( '<p>This makes it difficult for plugins to override these styles. You can try to resolve this using the "Repair header template" option (Step 6, "Additional handling options", below).</p>', 'child-theme-configurator' ),
includes/class-ctc.php CHANGED
@@ -94,7 +94,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
94
  define( 'LILAEAMEDIA_URL', "http://www.lilaeamedia.com" );
95
  defined( 'CHLD_THM_CFG_DOCS_URL' ) or
96
  define( 'CHLD_THM_CFG_DOCS_URL', "http://www.childthemeconfigurator.com" );
97
- define( 'CHLD_THM_CFG_VERSION', '2.0.3' );
98
  define( 'CHLD_THM_CFG_PREV_VERSION', '1.7.9.1' );
99
  define( 'CHLD_THM_CFG_MIN_WP_VERSION', '3.7' );
100
  defined( 'CHLD_THM_CFG_BPSEL' ) or
94
  define( 'LILAEAMEDIA_URL', "http://www.lilaeamedia.com" );
95
  defined( 'CHLD_THM_CFG_DOCS_URL' ) or
96
  define( 'CHLD_THM_CFG_DOCS_URL', "http://www.childthemeconfigurator.com" );
97
+ define( 'CHLD_THM_CFG_VERSION', '2.0.4' );
98
  define( 'CHLD_THM_CFG_PREV_VERSION', '1.7.9.1' );
99
  define( 'CHLD_THM_CFG_MIN_WP_VERSION', '3.7' );
100
  defined( 'CHLD_THM_CFG_BPSEL' ) or
js/chldthmcfg.js CHANGED
@@ -2,7 +2,7 @@
2
  * Script: chldthmcfg.js
3
  * Plugin URI: http://www.childthemeconfigurator.com/
4
  * Description: Handles jQuery, AJAX and other UI
5
- * Version: 2.0.3
6
  * Author: Lilaea Media
7
  * Author URI: http://www.lilaeamedia.com/
8
  * License: GPLv2
@@ -1734,6 +1734,7 @@
1734
  themeloaded = 0, // flag when style.css link is detected
1735
  testloaded = 0, // flag when test link is detected
1736
  analysis = {
 
1737
  deps: [[],[]],
1738
  signals: {
1739
  /*
@@ -1761,7 +1762,7 @@
1761
  $.get( url, function( data ) {
1762
 
1763
  //if ( 'child' === template ) {
1764
- //console.log( data );
1765
  //}
1766
  // retrieve enqueued stylesheet ids
1767
  if ( ( queue = data.match( /BEGIN WP QUEUE\n([\s\S]*?)\nEND WP QUEUE/ ) ) ) {
2
  * Script: chldthmcfg.js
3
  * Plugin URI: http://www.childthemeconfigurator.com/
4
  * Description: Handles jQuery, AJAX and other UI
5
+ * Version: 2.0.4
6
  * Author: Lilaea Media
7
  * Author URI: http://www.lilaeamedia.com/
8
  * License: GPLv2
1734
  themeloaded = 0, // flag when style.css link is detected
1735
  testloaded = 0, // flag when test link is detected
1736
  analysis = {
1737
+ url: url,
1738
  deps: [[],[]],
1739
  signals: {
1740
  /*
1762
  $.get( url, function( data ) {
1763
 
1764
  //if ( 'child' === template ) {
1765
+ console.log( data );
1766
  //}
1767
  // retrieve enqueued stylesheet ids
1768
  if ( ( queue = data.match( /BEGIN WP QUEUE\n([\s\S]*?)\nEND WP QUEUE/ ) ) ) {
js/chldthmcfg.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(e){"use strict";e.chldthmcfg={escquo:function(e){var t=this;return t.is_empty(e)?e:e.toString().replace(/"/g,"&quot;")},getxt:function(e,t){var c=window.ctcAjax[e+"_txt"];return c?(t&&(c=c.replace(/%s/,t)),c):""},frascii:function(e){var t=parseInt(e),c=String.fromCharCode(t);return c},toascii:function(e){var t=e.charCodeAt(0);return t},is_empty:function(e,t){if("undefined"==typeof e||!1===e||null===e||""===e)return!0;if("undefined"!=typeof t&&"0"===e||0===e)return!0;if(!0===e||"string"==typeof e||"number"==typeof e)return!1;if("object"==typeof e){for(var c in e)if(e.hasOwnProperty(c))return!1;return!0}return!1},theme_exists:function(t,c){var n=!1;return e.each(window.ctcAjax.themes,function(i,s){return e.each(s,function(e,s){return s=null,e.toLowerCase()!==t.toLowerCase()||"parnt"!==i&&"new"!==c?void 0:(n=!0,!1)}),n?!1:void 0}),n},validate:function(){var t=this,c=/[^\w\-]/,n=e("#ctc_child_template").length?e("#ctc_child_template").val().toString().replace(c):"",i=e("#ctc_theme_child").length?e("#ctc_theme_child").val().toString().replace(c):n,s=e("input[name=ctc_child_type]:checked").val(),a=[];return"new"===s&&(i=n),t.theme_exists(i,s)&&a.push(t.getxt("theme_exists").toString().replace(/%s/,i)),t.is_empty(i)&&a.push(t.getxt("inval_theme")),a.length?(t.set_notice({error:a}),!1):"reset"===s?!!confirm(t.getxt("load")):!0},autogen_slugs:function(){if(e("#ctc_theme_parnt").length){for(var t=this,c=e("#ctc_theme_parnt").val(),n=c+"-child",i=n,s=window.ctcAjax.themes.parnt[c].Name+" Child",a="",r="",l="00";t.theme_exists(i,"new");)a=t.is_empty(a)?2:a+1,r=l.substring(0,l.length-a.toString().length)+a.toString(),i=n+r;t.testslug=i,t.testname=s+(r.length?" "+r:"")}},focus_panel:function(t){var c=t+"_panel";e(".nav-tab").removeClass("nav-tab-active"),e(".ctc-option-panel").removeClass("ctc-option-panel-active"),e(t).addClass("nav-tab-active"),e(".ctc-option-panel-container").scrollTop(0),e(c).addClass("ctc-option-panel-active")},selector_input_toggle:function(t){var c,n=this;e("#ctc_rewrite_selector").length?(c=e("#ctc_rewrite_selector_orig").val(),e("#ctc_sel_ovrd_selector_selected").text(c),e(t).text(n.getxt("rename"))):(c=e("#ctc_sel_ovrd_selector_selected").text(),e("#ctc_sel_ovrd_selector_selected").html('<textarea id="ctc_rewrite_selector" name="ctc_rewrite_selector" autocomplete="off"></textarea><input id="ctc_rewrite_selector_orig" name="ctc_rewrite_selector_orig" type="hidden" value="'+n.escquo(c)+'"/>'),e("#ctc_rewrite_selector").val(c),e(t).text(n.getxt("cancel")))},coalesce_inputs:function(t){var c=this,n=e(t).attr("id"),i=/^(ctc_(ovrd|\d+)_(parent|child)_([0-9a-z\-]+)_(\d+?)(_(\d+))?)(_\w+)?$/,s=e(t).parents(".ctc-selector-row, .ctc-parent-row").first(),a=s.find(".ctc-swatch").first(),r={parent:{},child:{}},l={parent:{origin:"",start:"",end:""},child:{origin:"",start:"",end:""}},o={child:!1,parent:!1},_={};return s.find(".ctc-parent-value, .ctc-child-value").each(function(){var t,s,a=e(this).attr("id"),d=a.toString().match(i),u=d[2],h=d[3],p="undefined"==typeof d[4]?"":d[4],m=d[7],g=d[5],f="undefined"==typeof d[7]?"":d[8],v="parent"===h?e(this).text().replace(/!$/,""):"seq"!==p&&"ctc_delete_query_selector"===n?"":e(this).val(),y="seq"===p?!1:"ctc_"+u+"_child_"+p+"_i_"+g+"_"+m;if("child"===h&&(c.is_empty(e(this).data("color"))||(v=c.color_text(e(this).data("color")),e(this).data("color",null)),_[a]=v,y&&(_[y]=e("#"+y).is(":checked")?1:0)),""!==v)if(c.is_empty(f))if(t=p.toString().match(/^border(\-(top|right|bottom|left))?$/)&&!v.match(/none/)){var w=new RegExp(c.border_regx+c.color_regx,"i");s=v.toString().match(w),c.is_empty(s)||(s.shift(),r[h][p+"-width"]=s.shift()||"",s.shift(),r[h][p+"-style"]=s.shift()||"",r[h][p+"-color"]=s.shift()||"")}else if("background-image"!==p||v.match(/none/))"seq"!==p&&(r[h][p]=v);else if(v.toString().match(/url\(/))r[h]["background-image"]=c.image_url(h,v);else{var x=new RegExp(c.grad_regx+c.color_regx+c.color_regx,"i");s=v.toString().match(x),!c.is_empty(s)&&s.length>2?(s.shift(),l[h].origin=s.shift()||"top",l[h].start=s.shift()||"transparent",l[h].end=s.shift()||"transparent",o[h]=!0):r[h]["background-image"]=v}else switch(f){case"_border_width":r[h][p+"-width"]="none"===v?0:v;break;case"_border_style":r[h][p+"-style"]=v;break;case"_border_color":r[h][p+"-color"]=v;break;case"_background_url":r[h]["background-image"]=c.image_url(h,v);break;case"_background_color":r[h]["background-color"]=v;break;case"_background_color1":l[h].start=v,o[h]=!0;break;case"_background_color2":l[h].end=v,o[h]=!0;break;case"_background_origin":l[h].origin=v,o[h]=!0}}),"undefined"==typeof a||c.is_empty(a.attr("id"))||(a.removeAttr("style"),o.parent&&a.ctcgrad(l.parent.origin,[l.parent.start,l.parent.end]),a.css(r.parent),a.attr("id").toString().match(/parent/)||(o.child&&a.ctcgrad(l.child.origin,[l.child.start,l.child.end]),a.css(r.child)),a.css({"z-index":-1})),_},decode_value:function(e,t){t="undefined"==typeof t?"":t;var c,n=this,i={orig:t,names:[""],values:[t]};if(e.toString().match(/^border(\-(top|right|bottom|left))?$/)){var s,a=new RegExp(n.border_regx+"("+n.color_regx+")?","i");c=t.toString().match(a),n.is_empty(c)&&(c=[]),i.names=["_border_width","_border_style","_border_color"],s=c.shift(),i.values[0]=c.shift()||"",c.shift(),i.values[1]=c.shift()||"",c.shift(),i.values[2]=c.shift()||""}else if(e.toString().match(/^background\-image/))if(i.names=["_background_url","_background_origin","_background_color1","_background_color2"],i.values=["","","",""],n.is_empty(t)||t.toString().match(/(url|none)/))i.values[0]=t;else{var r,l;c=t.toString().split(/:/),i.values[1]=c.shift()||"",i.values[2]=c.shift()||"",r=c.shift()||"",i.values[3]=c.shift()||"",l=c.shift()||"",i.orig=[i.values[1],i.values[2],i.values[3]].join(" ")}return i},image_url:function(e,t){var c,n=this,i=t.toString().match(/url\(['" ]*(.+?)['" ]*\)/),s=n.is_empty(i)?null:i[1],a=window.ctcAjax.theme_uri+"/"+("parent"===e?window.ctcAjax.parnt:window.ctcAjax.child)+"/";return s?c=s.toString().match(/^(data:|https?:|\/)/)?t:"url("+a+s+")":!1},setup_menus:function(){var e=this;e.setup_query_menu(),e.setup_selector_menu(),e.setup_rule_menu(),e.setup_new_rule_menu(),e.load_queries(),e.load_rules(),e.set_query(e.currquery)},load_queries:function(){var e=this;e.query_css("queries",null)},load_selectors:function(){var e=this;e.query_css("selectors",e.currquery)},load_rules:function(){var e=this;e.query_css("rules",null)},load_selector_values:function(){var e=this;e.query_css("qsid",e.currqsid)},get_queries:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.chldthmcfg.is_empty(this.element.data("menu"))?n.push({label:window.ctcAjax.nosels_txt,value:null}):e.each(this.element.data("menu"),function(e,t){i.test(t)&&n.push({label:t,value:t})}),c(n)},get_selectors:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.chldthmcfg.is_empty(this.element.data("menu"))?n.push({label:window.ctcAjax.nosels_txt,value:null}):e.each(this.element.data("menu"),function(e,t){i.test(e)&&n.push({label:e,value:t})}),c(n)},get_rules:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.chldthmcfg.is_empty(this.element.data("menu"))?n.push({label:window.ctcAjax.nosels_txt,value:null}):e.each(this.element.data("menu"),function(e,t){i.test(e)&&n.push({label:e,value:t})}),c(n)},get_filtered_rules:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.each(e("#ctc_rule_menu").data("menu"),function(e,t){i.test(e)&&n.push({label:e,value:t})}),c(n)},merge_ruleval_arrays:function(t,c,n){var i=this,s={},a=n?c.child.pop():null;return e.each(["parnt","child"],function(t,r){i.is_empty(c[r])||e.each(c[r],function(e,t){n?parseInt(t[2])>=parseInt(a[2])&&(a[2]=parseInt(t[2])+1):(i.is_empty(s[t[2]])&&(s[t[2]]={}),s[t[2]][r]=t)})}),n&&(s[a[2]]={parnt:[],child:a}),s},input_row:function(t,c,n,i,s){var a=this,r="";if(!a.is_empty(i)&&!a.is_empty(i.value)&&!a.is_empty(i.value[c])){var l=i.value[c],o=a.merge_ruleval_arrays(c,l,s);e.each(o,function(s,l){var o=a.decode_value(c,a.is_empty(l.parnt)?"":l.parnt[0]),_=a.is_empty(l.parnt)||a.is_empty(l.parnt[1],1)?0:1,d=a.decode_value(c,a.is_empty(l.child)?"":l.child[0]),u=a.is_empty(l.child)||a.is_empty(l.child[1],1)?0:1;if(r+='<div class="ctc-'+("ovrd"===n?"input":"selector")+'-row clearfix"><div class="ctc-input-cell">',r+="ovrd"===n?c.replace(/\d+/g,a.frascii):i.selector+'<br/><a href="#" class="ctc-selector-edit" id="ctc_selector_edit_'+t+'" >'+a.getxt("edit")+"</a> "+(a.is_empty(o.orig)?a.getxt("child_only"):""),r+='</div><div class="ctc-parent-value ctc-input-cell"'+("ovrd"!==n?' style="display:none"':"")+' id="ctc_'+n+"_parent_"+c+"_"+t+"_"+s+'">'+(a.is_empty(o.orig)?"[no value]":o.orig+(_?a.getxt("important"):""))+'</div><div class="ctc-input-cell">',!a.is_empty(o.names)){e.each(o.names,function(e,i){i=a.is_empty(i)?"":i,r+='<div class="ctc-child-input-cell clear">';var l,o="ctc_"+n+"_child_"+c+"_"+t+"_"+s+i;!1===(l=d.values.shift())&&(l=""),r+=(a.is_empty(i)?"":a.getxt(i)+":<br/>")+'<input type="text" id="'+o+'" name="'+o+'" class="ctc-child-value'+((i+c).toString().match(/color/)?" color-picker":"")+(i.toString().match(/url/)?" ctc-input-wide":"")+'" value="'+a.escquo(l)+'" /></div>'});var h="ctc_"+n+"_child_"+c+"_i_"+t+"_"+s;r+='<label for="'+h+'"><input type="checkbox" id="'+h+'" name="'+h+'" value="1" '+(u?"checked":"")+" />"+a.getxt("important")+"</label>"}r+="</div>","ovrd"!==n&&(r+='<div class="ctc-swatch ctc-specific" id="ctc_child_'+c+"_"+t+"_"+s+'_swatch">'+a.getxt("swatch")+'</div><div class="ctc-child-input-cell ctc-button-cell" id="ctc_save_'+c+"_"+t+"_"+s+'_cell"><input type="button" class="button ctc-save-input" id="ctc_save_'+c+"_"+t+"_"+s+'" name="ctc_save_'+c+"_"+t+"_"+s+'" value="Save" /></div>'),r+="</div><!-- end input row -->\n"})}return r},scrolltop:function(){e("html, body, .ctc-option-panel-container").animate({scrollTop:0})},css_preview:function(e){var t=this;(e=e.match(/(child|parnt)/)[1])||(e="child"),t.query_css("preview",e)},setup_iris:function(e){var t=this;t.setup_spectrum(e)},setup_spectrum:function(t){var c=this,n=!c.is_empty(window.ctcAjax.palette);try{e(t).spectrum({showInput:!0,allowEmpty:!0,showAlpha:!0,showInitial:!0,preferredFormat:"hex",clickoutFiresChange:!0,move:function(n){e(t).data("color",n),c.coalesce_inputs(t)},showPalette:!!n,showSelectionPalette:!!n,palette:[],maxSelectionSize:36,localStorageKey:"ctc-palette."+window.ctcAjax.child,hideAfterPaletteSelect:!0}).on("change",function(){c.coalesce_inputs(this)}).on("keyup",function(){var t=this,n=c.addhash(e(this).val());e(t).val(n),clearTimeout(e(this).data("spectrumTimer")),e(this).data("spectrumTimer",setTimeout(function(){c.coalesce_inputs(t),e(t).spectrum("set",n)},500))})}catch(i){c.jquery_exception(i,"Spectrum Color Picker")}},addhash:function(e){return e.replace(/^#?([a-f0-9]{3,6}.*)/,"#$1")},color_text:function(e){var t=this;return t.is_empty(e)?"":e.getAlpha()<1?e.toRgbString():e.toHexString()},setup_query_menu:function(){var t=this;try{e("#ctc_sel_ovrd_query").autocomplete({source:t.get_queries,minLength:0,selectFirst:!0,autoFocus:!0,select:function(e,c){return t.set_query(c.item.value),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Query Menu")}},setup_selector_menu:function(){var t=this;try{e("#ctc_sel_ovrd_selector").autocomplete({source:t.get_selectors,selectFirst:!0,autoFocus:!0,select:function(e,c){return t.set_selector(c.item.value,c.item.label),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Selector Menu")}},setup_rule_menu:function(){var t=this;try{e("#ctc_rule_menu").autocomplete({source:t.get_rules,selectFirst:!0,autoFocus:!0,select:function(e,c){return t.set_rule(c.item.value,c.item.label),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Property Menu")}},setup_new_rule_menu:function(){var t=this;try{e("#ctc_new_rule_menu").autocomplete({source:t.get_filtered_rules,selectFirst:!0,autoFocus:!0,select:function(c,n){c.preventDefault();var i,s,a=n.item.label.replace(/[^\w\-]/g,t.toascii);return t.is_empty(t.currdata.value)&&(t.currdata.value={}),t.is_empty(t.currdata.value[n.item.label])&&(t.currdata.value[n.item.label]={}),t.is_empty(t.currdata.value[n.item.label].child)&&(t.currdata.value[n.item.label].child=[]),t.currdata.value[n.item.label].child.push(["",0,1,1]),i=e(t.input_row(t.currqsid,a,"ovrd",t.currdata,!0)),e("#ctc_sel_ovrd_rule_inputs").append(i),e("#ctc_new_rule_menu").val(""),i.find('input[type="text"]').each(function(c,n){s||(s=n),e(n).hasClass("color-picker")&&t.setup_spectrum(n)}),s&&e(s).focus(),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"New Property Menu")}},set_theme_params:function(t,c){e("#ctc_child_author").val(window.ctcAjax.themes[t][c].Author),e("#ctc_child_version").val(window.ctcAjax.themes[t][c].Version),e("#ctc_child_authoruri").val(window.ctcAjax.themes[t][c].AuthorURI),e("#ctc_child_themeuri").val(window.ctcAjax.themes[t][c].ThemeURI),e("#ctc_child_descr").val(window.ctcAjax.themes[t][c].Descr),e("#ctc_child_tags").val(window.ctcAjax.themes[t][c].Tags)},update_form:function(){var t,c=this;e("#input_row_stylesheet_handling_container,#input_row_parent_handling_container,#ctc_additional_css_files_container,#input_row_new_theme_slug,#input_row_duplicate_theme_slug,#ctc_copy_theme_mods,#ctc_child_header_parameters,#ctc_configure_submit,#input_row_theme_slug").slideUp("fast"),e("#ctc_configure_submit .ctc-step").text("9"),e("#ctc_theme_child").length&&!e("#ctc_child_type_new").is(":checked")?(t=e("#ctc_theme_child").val(),c.existing=1,c.currparnt=window.ctcAjax.themes.child[t].Template,c.autogen_slugs(),e("#ctc_theme_parnt").val(c.currparnt),e("#ctc_theme_parnt-button .ui-selectmenu-text").text(window.ctcAjax.themes.parnt[c.currparnt].Name),c.set_theme_params("child",t),e("#ctc_child_type_duplicate").is(":checked")?(e("#ctc_child_template").val(c.testslug),e("#ctc_child_name").val(c.testname),e(".ctc-analyze-theme, .ctc-analyze-howto").show(),e("#ctc_load_styles").val("Duplicate Child Theme")):e("#ctc_child_type_reset").is(":checked")?(e("#ctc_configure_submit .ctc-step").text("3"),e("#ctc_configure_submit").slideDown("fast"),e("#theme_slug_container").text(t),e(".ctc-analyze-theme, .ctc-analyze-howto").hide(),e("#ctc_enqueue_none").prop("checked",!0),e("#ctc_load_styles").val("Reset Child Theme to Previous State")):(e("#ctc_child_template").val(""),e("#theme_slug_container").text(t),e(".ctc-analyze-theme, .ctc-analyze-howto").show(),e("#ctc_child_name").val(window.ctcAjax.themes.child[t].Name),e("#ctc_load_styles").val("Configure Child Theme")),e("#input_row_existing_theme_option").slideDown("fast"),e("#input_row_new_theme_option").slideUp("fast")):(c.existing=0,c.autogen_slugs(),e("#ctc_theme_parnt").val(c.currparnt),e("#ctc_theme_parnt-button .ui-selectmenu-text").text(window.ctcAjax.themes.parnt[c.currparnt].Name),c.set_theme_params("parnt",c.currparnt),e("#input_row_existing_theme_option,#input_row_duplicate_theme_container,#input_row_theme_slug").slideUp("fast"),e("#input_row_new_theme_option").slideDown("fast"),e("#ctc_child_name").val(c.testname),e("#ctc_child_template").val(c.testslug),e(".ctc-analyze-theme, .ctc-analyze-howto").show(),e("#ctc_load_styles").val("Create New Child Theme"))},set_notice:function(t){var c,n=this,i="";n.is_empty(t)||e.each(t,function(t,c){i+='<div class="'+t+' notice is-dismissible dashicons-before"><ul>\n',e(c).each(function(e,t){i+="<li>"+t.toString()+"</li>\n"}),i+="</ul></div>"}),c=e(i),e("#ctc_error_notice").html(c),n.bind_dismiss(c),e("html, body").animate({scrollTop:0},"slow")},set_parent_menu:function(e){var t=this;t.currparnt=e.value,t.update_form()},set_child_menu:function(e){var t=this;t.currchild=e.value,t.update_form()},set_query:function(t){var c=this;return c.is_empty(t)?!1:(c.currquery=t,e("#ctc_sel_ovrd_query").val(""),e("#ctc_sel_ovrd_query_selected").text(t),e("#ctc_sel_ovrd_selector").val(""),e("#ctc_sel_ovrd_selector_selected").html("&nbsp;"),c.load_selectors(),void c.scrolltop())},set_selector:function(t,c){var n=this;return c=null,n.is_empty(t)?!1:(e("#ctc_sel_ovrd_selector").val(""),n.currqsid=t,n.reload=!1,n.load_selector_values(),void n.scrolltop())},set_rule:function(t,c){var n=this;return n.is_empty(t)?!1:(e("#ctc_rule_menu").val(""),e("#ctc_rule_menu_selected").text(c),e(".ctc-rewrite-toggle").text(n.getxt("rename")),e("#ctc_rule_value_inputs, #ctc_input_row_rule_header").show(),n.query_css("rule_val",t),void n.scrolltop())},set_qsid:function(t){var c=this;c.currqsid=e(t).attr("id").match(/_(\d+)$/)[1],c.focus_panel("#query_selector_options"),c.reload=!0,c.load_selector_values()},query_css:function(t,c,n){var i=this,s={ctc_query_obj:t,ctc_query_key:c},a="#ctc_status_"+t+("val_qry"===t?"_"+c:"");"object"==typeof n&&e.each(n,function(e,t){s["ctc_query_"+e]=t}),e(".query-icon,.ctc-status-icon").remove(),e(a+" .ctc-status-icon").remove(),e(a).append('<span class="ctc-status-icon spinner is-active query-icon"></span>'),s.action=i.is_empty(e("#ctc_action").val())||"plugin"!==e("#ctc_action").val()?"ctc_query":"ctc_plgqry",s._wpnonce=e("#_wpnonce").val(),i.ajax_post(t,s)},save:function(t){var c,n,i,s,a,r=this,l={},o=e(t).attr("id");e(t).prop("disabled",!0),e(".ctc-query-icon,.ctc-status-icon").remove(),e(t).parent(".ctc-textarea-button-cell, .ctc-button-cell").append('<span class="ctc-status-icon spinner save-icon"></span>'),o.match(/ctc_configtype/)?(e(t).parents(".ctc-input-row").first().append('<span class="ctc-status-icon spinner save-icon"></span>'),l.ctc_configtype=e(t).val()):(c=e("#ctc_new_selectors"))&&"ctc_save_new_selectors"===e(t).attr("id")?(l.ctc_new_selectors=c.val(),(n=e("#ctc_sel_ovrd_query_selected"))&&(l.ctc_sel_ovrd_query=n.text()),r.reload=!0):(i=e("#ctc_child_imports"))&&"ctc_save_imports"===o?l.ctc_child_imports=i.val():"ctc_is_debug"===o?l.ctc_is_debug=e("#ctc_is_debug").is(":checked")?1:0:l=r.coalesce_inputs(t),e(".save-icon").addClass("is-active"),e("#ctc_sel_ovrd_selector_selected").find("#ctc_rewrite_selector").each(function(){s=e("#ctc_rewrite_selector").val(),a=e("#ctc_rewrite_selector_orig").val(),r.is_empty(s)||!s.toString().match(/\w/)?s=a:(l.ctc_rewrite_selector=s,r.reload=!0),e(".ctc-rewrite-toggle").text(r.getxt("rename")),e("#ctc_sel_ovrd_selector_selected").html(s)}),l.action=r.is_empty(e("#ctc_action").val())||"plugin"!==e("#ctc_action").val()?"ctc_update":"ctc_plugin",l._wpnonce=e("#_wpnonce").val(),r.ajax_post("qsid",l)},ajax_post:function(t,c,n){var i=this;e.ajax({url:window.ctcAjax.ajaxurl,data:c,dataType:i.is_empty(n)?"json":n,type:"POST"}).done(function(e){i.handle_success(t,e)}).fail(function(){i.handle_failure(t)}).always(function(){i.jqueryerr.length&&i.jquery_notice()})},handle_failure:function(t){var c=this;e(".query-icon, .save-icon").removeClass("spinner").addClass("failure"),e("input[type=submit], input[type=button], input[type=checkbox],.ctc-delete-input").prop("disabled",!1),e(".ajax-pending").removeClass("ajax-pending"),"preview"===t&&e("#view_parnt_options_panel,#view_child_options_panel").text(c.getxt("css_fail"))},handle_success:function(t,c){var n=this;e(".query-icon, .save-icon").removeClass("spinner"),e(".ajax-pending").removeClass("ajax-pending"),n.is_empty(c)?n.handle_failure(t):(e("#ctc_new_selectors").val(""),e(".query-icon, .save-icon").addClass("success"),e("input[type=submit], input[type=button], input[type=checkbox],.ctc-delete-input").prop("disabled",!1),e(c).each(function(){"function"==typeof n.update[this.obj]&&n.update[this.obj].call(n,this)}))},jquery_exception:function(e,t){var c=this,n=c.is_empty(e.lineNumber)?"":" line: "+e.lineNumber,i=c.is_empty(e.fileName)?"":" "+e.fileName.split(/\?/)[0];c.jqueryerr.push("<code><small>"+t+": "+e.message+i+n+"</small></code>")},jquery_notice:function(t){t=null;var c=this,n=[],i=[];c.jqueryerr.length&&(e("input[type=submit], input[type=button]").prop("disabled",!0),e("script").each(function(){var t=e(this).prop("src");c.is_empty(t)||!t.match(/jquery(\.min|\.js|\-?ui)/i)||t.match(/load\-scripts.php/)||n.push("<code><small>"+t.split(/\?/)[0]+"</small></code>")}),i.push("<strong>"+c.getxt("js")+"</strong> "+c.getxt("contact")),i.push(c.jqueryerr.join("<br/>")),n.length&&i.push(c.getxt("jquery")+"<br/>"+n.join("<br/>")),i.push(c.getxt("plugin"))),c.set_notice({error:i})},update:{qsid:function(t){var c,n,i,s,a=this;a.currqsid=t.key,a.currdata=t.data,e("#ctc_sel_ovrd_qsid").val(a.currqsid),a.is_empty(a.currdata.seq)?e("#ctc_child_load_order_container").empty():(c="ctc_ovrd_child_seq_"+a.currqsid,i=parseInt(a.currdata.seq),n='<input type="text" id="'+c+'" name="'+c+'" class="ctc-child-value" value="'+i+'" />',e("#ctc_child_load_order_container").html(n)),a.is_empty(a.currdata.value)?(s=!0,e("#ctc_sel_ovrd_rule_inputs").empty()):(s=!1,n="",e.each(a.currdata.value,function(e,t){t=null,n+=a.input_row(a.currqsid,e,"ovrd",a.currdata)}),e("#ctc_sel_ovrd_rule_inputs").html(n).find(".color-picker").each(function(){a.setup_spectrum(this)}),a.coalesce_inputs("#ctc_child_all_0_swatch")),a.reload&&(a.load_queries(),a.set_query(a.currdata.query),a.load_rules()),e("#ctc_sel_ovrd_selector_selected").text(a.currdata.selector),e(".ctc-rewrite-toggle").text(a.getxt("rename")),e(".ctc-rewrite-toggle").show(),s?e("#ctc_sel_ovrd_rule_header,#ctc_sel_ovrd_new_rule,#ctc_sel_ovrd_rule_inputs_container,#ctc_sel_ovrd_rule_inputs").hide():e("#ctc_sel_ovrd_rule_header,#ctc_sel_ovrd_new_rule,#ctc_sel_ovrd_rule_inputs_container,#ctc_sel_ovrd_rule_inputs").show()},rule_val:function(t){var c=this,n=e("#ctc_rule_menu_selected").text(),i='<div class="ctc-input-row clearfix" id="ctc_rule_row_'+n+'">\n';c.is_empty(t.data)||(e.each(t.data,function(e,t){var s=c.decode_value(n,t);i+='<div class="ctc-parent-row clearfix" id="ctc_rule_row_'+n+"_"+e+'">\n<div class="ctc-input-cell ctc-parent-value" id="ctc_'+e+"_parent_"+n+"_"+e+'">'+s.orig+'</div>\n<div class="ctc-input-cell">\n<div class="ctc-swatch ctc-specific" id="ctc_'+e+"_parent_"+n+"_"+e+'_swatch">'+c.getxt("swatch")+'</div></div>\n<div class="ctc-input-cell"><a href="#" class="ctc-selector-handle" id="ctc_selector_'+n+"_"+e+'">'+c.getxt("selector")+'</a></div>\n<div id="ctc_selector_'+n+"_"+e+'_container" class="ctc-selector-container">\n<a href="#" id="ctc_selector_'+n+"_"+e+'_close" class="ctc-selector-handle ctc-exit" title="'+c.getxt("close")+'"></a><div id="ctc_selector_'+n+"_"+e+'_inner_container" class="ctc-selector-inner-container clearfix">\n<div id="ctc_status_val_qry_'+e+'"></div>\n<div id="ctc_selector_'+n+"_"+e+'_rows"></div>\n</div></div></div>\n'}),i+="</div>\n"),e("#ctc_rule_value_inputs").html(i).find(".ctc-swatch").each(function(){c.coalesce_inputs(this)})},val_qry:function(t){var c,n,i=this,s="";i.is_empty(t.data)||e.each(t.data,function(n,a){c=n,e.each(a,function(c,a){s+='<h4 class="ctc-query-heading">'+c+"</h4>\n",i.is_empty(a)||e.each(a,function(e,c){s+=i.input_row(e,n,t.key,c)})})}),n="#ctc_selector_"+c+"_"+t.key+"_rows",e(n).html(s).find(".color-picker").each(function(){i.setup_spectrum(this)}),e(n).find(".ctc-swatch").each(function(){i.coalesce_inputs(this)})},queries:function(t){e("#ctc_sel_ovrd_query").data("menu",t.data)},selectors:function(t){e("#ctc_sel_ovrd_selector").data("menu",t.data)},rules:function(t){e("#ctc_rule_menu").data("menu",t.data)},debug:function(t){e("#ctc_debug_container").html(t.data)},preview:function(t){e("#view_"+t.key+"_options_panel").text(t.data)},dismiss:function(){}},bind_dismiss:function(t){var c=this,n=e(t),i=e('<button type="button" class="notice-dismiss"><span class="screen-reader-text"></span></button>'),s=window.commonL10n.dismiss||"";i.find(".screen-reader-text").text(s),n.append(i),i.on("click.wp-dismiss-notice",function(e){e.preventDefault(),c.dismiss_notice(t)})},dismiss_notice:function(t){e(t).fadeTo(100,0,function(){e(this).slideUp(100,function(){e(this).remove()})})},reset_handling:function(){e("#parnt_analysis_notice .notice, #child_analysis_notice .notice").slideUp(),e("#ctc_enqueue_enqueue").prop("checked",!0),e("#ctc_handling_primary").prop("checked",!0),e("#ctc_ignoreparnt").prop("checked",!1),e("#ctc_repairheader").prop("checked",!1)},init:function(){var t=this;if(!e("#ctc_theme_parnt").is("input")){try{e.widget("ctc.themeMenu",e.ui.selectmenu,{_renderItem:function(t,c){var n=e("<li>"),i=c.value.replace(/[^\w\-]/,"");return e("#ctc_theme_option_"+i).detach().appendTo(n),n.appendTo(t)}})}catch(c){t.jquery_exception(c,"Theme Menu")}try{e("#ctc_theme_parnt").themeMenu({select:function(e,c){t.reset_handling(),t.set_parent_menu(c.item)}})}catch(c){"function"==typeof themeMenu?e("#ctc_theme_parnt").themeMenu("destroy"):e("#ctc_theme_parnt-button").remove(),t.jquery_exception(c,"Parent Theme Menu")}if(t.is_empty(window.ctcAjax.themes.child))e("#ctc_child_name").length&&(e("#ctc_child_name").val(t.testname),e("#ctc_child_template").val(t.testslug));else try{e("#ctc_theme_child").themeMenu({select:function(e,c){t.reset_handling(),t.set_child_menu(c.item)}})}catch(c){"function"==typeof themeMenu?e("#ctc_theme_child").themeMenu("destroy"):e("#ctc_theme_child-button").remove(),t.jquery_exception(c,"Child Theme Menu")}}t.currparnt=e("#ctc_theme_parnt").val(),t.currchild=e("#ctc_theme_child").length?e("#ctc_theme_child").val():"",e("#ctc_main").on("click",".ctc-section-toggle",function(t){t.preventDefault(),e(this).parents(".ctc-input-row, .notice-warning, .updated, .error").first().find(".ctc-section-toggle").each(function(){e(this).toggleClass("open")});var c=e(this).attr("id").replace(/\d$/,"")+"_content";return e("#"+c).stop().slideToggle("fast"),!1}),e("#ctc_main").on("click",".ctc-upgrade-notice .notice-dismiss",function(){var c={action:"ctc_dismiss",_wpnonce:e("#_wpnonce").val()};t.ajax_post("dismiss",c)}),t.is_empty(t.jqueryerr)&&(e("#ctc_main").on("click",".ctc-selector-handle",function(c){if(c.preventDefault(),e(this).hasClass("ajax-pending"))return!1;e(this).addClass("ajax-pending");var n,i,s=e(this).attr("id").toString().replace("_close",""),a=s.toString().match(/_([^_]+)_(\d+)$/);e("#"+s+"_container").is(":hidden")&&(t.is_empty(a[1])||t.is_empty(a[2])||(n=a[1],i=a[2],t.query_css("val_qry",i,{rule:n}))),e("#"+s+"_container").fadeToggle("fast"),e(".ctc-selector-container").not("#"+s+"_container").fadeOut("fast")}),e("#ctc_main").on("click",".ctc-save-input[type=button], .ctc-delete-input",function(c){return c.preventDefault(),e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),t.save(this),!1)}),e("#ctc_main").on("keydown",".ctc-selector-container .ctc-child-value[type=text]",function(c){if(13===c.which){var n=e(this).parents(".ctc-selector-row").find(".ctc-save-input[type=button]").first();if(n.length)return c.preventDefault(),n.hasClass("ajax-pending")?!1:(n.addClass("ajax-pending"),t.save(n),!1)}}),e("#ctc_main").on("click",".ctc-selector-edit",function(c){return c.preventDefault(),e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),void t.set_qsid(this))}),e("#ctc_main").on("click",".ctc-rewrite-toggle",function(e){e.preventDefault(),t.selector_input_toggle(this)}),e("#ctc_main").on("click","#ctc_copy_selector",function(){var c=e("#ctc_sel_ovrd_selector_selected").text().trim();t.is_empty(c)||e("#ctc_new_selectors").val(e("#ctc_new_selectors").val()+"\n"+c+" {\n\n}")}),e("#ctc_main").on("click",".ctc-backup-theme",function(c){c.preventDefault(),t.existing?e("#ctc_export_theme").val(t.currchild):e("#ctc_export_theme").val(t.currparnt),e("#ctc_export_theme_form").submit()}),e("#ctc_configtype").on("change",function(){var c=e(this).val();if(t.is_empty(c)||"theme"===c){e(".ctc-theme-only, .ctc-themeonly-container").removeClass("ctc-disabled"),e(".ctc-theme-only, .ctc-themeonly-container input").prop("disabled",!1);try{e("#ctc_theme_parnt, #ctc_theme_child").themeMenu("enable")}catch(n){t.jquery_exception(n,"Theme Menu")}}else{e(".ctc-theme-only, .ctc-themeonly-container").addClass("ctc-disabled"),e(".ctc-theme-only, .ctc-themeonly-container input").prop("disabled",!0);try{e("#ctc_theme_parnt, #ctc_theme_child").themeMenu("disable")}catch(n){t.jquery_exception(n,"Theme Menu")}}}),e(".nav-tab").on("click",function(c){c.preventDefault(),e(".ctc-query-icon,.ctc-status-icon").remove();var n="#"+e(this).attr("id");t.focus_panel(n)}),e("#view_child_options, #view_parnt_options").on("click",function(){return e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),void t.css_preview(e(this).attr("id")))}),e("#ctc_load_form").on("submit",function(){return t.validate()}),e("#ctc_query_selector_form").on("submit",function(c){c.preventDefault();var n=e("#ctc_save_query_selector");return n.hasClass("ajax-pending")?!1:(n.addClass("ajax-pending"),t.save(n),!1)}),e("#ctc_rule_value_form").on("submit",function(e){return e.preventDefault(),!1}),e("#ctc_child_type_new,#ctc_child_type_existing,#ctc_child_type_duplicate,#ctc_child_type_reset").on("focus click",function(){t.reset_handling(),t.update_form()}),e("#ctc_is_debug").on("change",function(){t.save(this)}),e(".ctc-live-preview").on("click",function(t){return t.stopImmediatePropagation(),t.preventDefault(),document.location=e(this).prop("href"),!1}),t.setup_menus(),e("input[type=submit], input[type=button]").prop("disabled",!1),t.scrolltop(),t.update_form()),t.jqueryerr.length&&t.jquery_notice()},testslug:"",testname:"",reload:!1,currquery:"base",currqsid:null,currdata:{},currparnt:"",currchild:"",existing:!1,jqueryerr:[],color_regx:"\\s+(\\#[a-f0-9]{3,6}|rgba?\\([\\d., ]+?\\)|hsla?\\([\\d%., ]+?\\)|[a-z]+)",border_regx:"(\\w+)(\\s+(\\w+))?",grad_regx:"(\\w+)"},e.chldthmanalyze={escrgx:function(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},trmcss:function(e){return"undefined"==typeof e?"":e.replace(/\-css$/,"")},show_loading:function(t){var c=e.chldthmcfg.existing?"child":"parnt",n="child"===c?e.chldthmcfg.currchild:e.chldthmcfg.currparnt,i=window.ctcAjax.themes[c][n].Name,s='<strong class="ctc_analyze_loading"><span class="spinner is-active"></span>'+e.chldthmcfg.getxt(t?"anlz1":"anlz2")+" "+i+"...</strong>";self.noticediv="",e("#"+c+"_analysis_notice").html(s)},hide_loading:function(){e(".ctc_analyze_loading").fadeTo(200,0,function(){e(this).slideUp(200,function(){e(this).remove()})})},setssl:function(e){return e.replace(/^https?/,window.ctcAjax.ssl?"https":"http")},analyze_theme:function(t){var c,n,i,s=this,a=Math.floor(e.now()/1e3),r="child"===t?e.chldthmcfg.currchild:e.chldthmcfg.currparnt,l="&template="+e.chldthmcfg.currparnt+"&stylesheet="+r+"&now="+a,o=s.setssl(window.ctcAjax.homeurl),_=window.ctcAjax.theme_uri.replace(/^https?:\/\//,""),d=o+l,u=s.escrgx(e.chldthmcfg.currparnt)+("child"===t?"|"+s.escrgx(r):""),h=new RegExp("<link( rel=[\"']stylesheet[\"'] id=['\"]([^'\"]+?)['\"])?[^>]+?"+s.escrgx(_)+"/("+u+")/([^\"']+\\.css)(\\?[^\"']+)?[\"'][^>]+>","gi"),p=/<br \/>\n[^\n]+?(fatal|strict|notice|warning|error)[\s\S]+?<br \/>/gi,m=0,g=0,f={deps:[[],[]],signals:{},queue:[],irreg:[]};e.get(d,function(a){for((n=a.match(/BEGIN WP QUEUE\n([\s\S]*?)\nEND WP QUEUE/))?f.queue=n[1].split(/\n/):(f.queue=[],f.signals.thm_noqueue=1),(n=a.match(/BEGIN CTC IRREGULAR\n([\s\S]*?)\nEND CTC IRREGULAR/))?f.irreg=n[1].split(/\n/):f.irreg=[],a.match(/CHLD_THM_CFG_IGNORE_PARENT/)&&(f.signals.thm_ignoreparnt=1),a.match(/IS_CTC_THEME/)&&(f.signals.thm_is_ctc=1),a.match(/NO_CTC_STYLES/)&&(f.signals.thm_no_styles=1),a.match(/HAS_CTC_IMPORT/)&&(f.signals.thm_has_import=1),a=a.replace(/<!\-\-[\s\S]*?\-\->/g,"");c=p.exec(a);){var r=c[0].replace(/<.*?>/g,"");s.phperr[t].push(r),f.signals.err_php=1,r.match(/Fatal error/i)&&(f.signals.err_fatal=1)}for(;i=h.exec(a);){var l=s.trmcss(i[2]),o=i[3],_=i[4],d=e.chldthmcfg.currparnt===o?"parnt":"child",u=0;if(""===l||-1===e.inArray(l,f.queue))u=1;else if(0===l.indexOf("chld_thm_cfg")){_.match(/^ctc\-style([\-\.]min)?\.css$/)?(m=1,f.signals.ctc_sep_loaded=1):_.match(/^ctc\-genesis([\-\.]min)?\.css$/)?(m=1,f.signals.ctc_gen_loaded=1):l.match(/$chld_thm_cfg_ext/)?(f.signals.ctc_ext_loaded=1,
2
  f.deps[m].push([l,_])):"chld_thm_cfg_child"===l?(f.signals.ctc_child_loaded=1,f.deps[m].push([l,_])):"chld_thm_cfg_parent"===l&&(f.signals.ctc_parnt_loaded=1,f.deps[m].push([l,_]),m&&(f.signals.ctc_parnt_reorder=1));continue}if(_.match(/^style([\-\.]min)?\.css$/))m=1,"parnt"===d?f.signals.thm_parnt_loaded=u?"thm_unregistered":l:f.signals.thm_child_loaded=u?"thm_unregistered":l,u?g?(f.signals.thm_past_wphead=1,f.deps[m].push(["thm_past_wphead",_])):(f.signals.thm_unregistered=1,f.deps[m].push(["thm_unregistered",_])):f.deps[m].push([l,_]);else if("ctc-test.css"===_)g=1;else{var v=null;u&&(v="dep_unregistered"),g&&(v=m?"css_past_wphead":"dep_past_wphead"),v&&(f.signals[v]=1,l=v),f.deps[m].push([l,_])}}m||(f.signals.thm_notheme=1),a=null,s.analysis[t]=f,e(document).trigger("analysisdone")}).fail(function(c,n,i){f.signals.failure=1,f.signals.xhrerr=i,s.analysis[t]=f,e(document).trigger("analysisdone")})},css_notice:function(){var t,c=this,n=e.chldthmcfg.existing?"child":"parnt",i="child"===n?e.chldthmcfg.currchild:e.chldthmcfg.currparnt,s=window.ctcAjax.themes[n][i].Name,a="",r={notices:[]},l={style:"notice-warning",headline:e.chldthmcfg.getxt("anlz3",s),errlist:""},o=0,_={};if(e(window.ctcAjax.addl_css).each(function(t,c){e("#ctc_stylesheet_files .ctc_checkbox").each(function(){c===e(this).val()&&e(this).prop("checked",!0)})}),c.analysis[n].signals.failure||c.analysis[n].signals.thm_noqueue&&!c.phperr[n].length)r.notices.push({headline:e.chldthmcfg.getxt("anlz4",s),msg:e.chldthmcfg.getxt("anlz5"),style:"notice-warning"});else{if(c.phperr[n].length&&(e.each(c.phperr[n],function(t,c){c.match(/Fatal error/i)&&(l.style="error",l.headline=e.chldthmcfg.getxt("anlz8",s)),l.errlist+=c+"\n"}),l.msg='<div style="background-color:#ffeebb;padding:6px"><div class="ctc-section-toggle" id="ctc_analysis_errs">'+e.chldthmcfg.getxt("anlz6")+'</div><div id="ctc_analysis_errs_content" style="display:none"><textarea>'+l.errlist+"</textarea></div></div>"+e.chldthmcfg.getxt("anlz7"),r.notices.push(l)),(c.analysis[n].signals.thm_past_wphead||c.analysis[n].signals.dep_past_wphead)&&(r.notices.push({headline:e.chldthmcfg.getxt("anlz9"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz10")}),e("#ctc_repairheader").prop("checked",!0),e("#ctc_repairheader_container").show()),c.analysis[n].signals.thm_unregistered&&(c.analysis[n].signals.ctc_child_loaded||c.analysis[n].signals.ctc_sep_loaded||(r.notices.push({headline:e.chldthmcfg.getxt("anlz11"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz12")}),e("#ctc_repairheader_container").show(),e("#ctc_repairheader").prop("checked",!0))),"child"===n&&(c.analysis.child.signals.ctc_parnt_reorder&&(o=1),c.analysis.child.signals.ctc_child_loaded||c.analysis.child.signals.ctc_sep_loaded||c.analysis.child.signals.thm_child_loaded||(r.notices.push({headline:e.chldthmcfg.getxt("anlz13"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz14")}),o=1),c.analysis[n].signals.ctc_gen_loaded&&r.notices.push({headline:e.chldthmcfg.getxt("anlz31"),msg:e.chldthmcfg.getxt("anlz32"),style:"notice-warning"}),c.analysis.parnt.signals.thm_no_styles||c.analysis.child.signals.ctc_gen_loaded||c.analysis.child.signals.thm_parnt_loaded||c.analysis.child.signals.ctc_parnt_loaded||c.analysis.child.signals.thm_ignoreparnt||c.analysis.child.signals.thm_has_import||(r.notices.push({headline:e.chldthmcfg.getxt("anlz15"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz16")}),o=1),c.analysis.child.signals.thm_unregistered&&c.analysis.child.signals.thm_child_loaded&&"thm_unregistered"===c.analysis.child.signals.thm_child_loaded&&c.analysis.child.signals.ctc_child_loaded&&c.analysis.child.signals.ctc_parnt_loaded&&(r.notices.push({headline:e.chldthmcfg.getxt("anlz28"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz29")}),e("#ctc_repairheader_container").show(),e("#ctc_repairheader").prop("checked",!0)),c.analysis.child.signals.thm_is_ctc||e("#ctc_child_type_duplicate").is(":checked")||r.notices.push({headline:e.chldthmcfg.getxt("anlz19"),msg:e.chldthmcfg.getxt("anlz20"),style:"notice-warning"})),(c.analysis[n].signals.ctc_sep_loaded||c.analysis[n].signals.ctc_gen_loaded)&&e("#ctc_handling_separate").prop("checked",!0),r.notices.length||r.notices.push({headline:""+("child"===n?e.chldthmcfg.getxt("anlz17"):e.chldthmcfg.getxt("anlz18")),style:"updated",msg:""}),"child"===n&&c.analysis.child.signals.thm_has_import&&(r.notices.push({headline:e.chldthmcfg.getxt("anlz21"),msg:e.chldthmcfg.getxt("anlz22"),style:"notice-warning"}),e("#ctc_enqueue_import").prop("checked",!0)),c.analysis[n].signals.thm_ignoreparnt||c.analysis[n].signals.ctc_gen_loaded?(e("#ctc_ignoreparnt").prop("checked",!0),e("#ctc_enqueue_none").is(":checked")||(e("#ctc_enqueue_none").prop("checked",!0),o=1,_.ctc_enqueue="none")):e("#ctc_ignoreparnt").prop("checked",!1),c.analysis[n].signals.thm_keepdeps?e("#ctc_keepdeps").prop("checked",!0):e("#ctc_keepdeps").prop("checked",!1),!c.analysis[n].signals.ctc_sep_loaded&&!c.analysis[n].signals.ctc_gen_loaded&&!c.analysis[n].signals.ctc_child_loaded&&!c.analysis[n].signals.thm_unregistered&&!c.analysis[n].signals.thm_past_wphead&&c.analysis[n].deps[1].length){var d="";e.each(c.analysis[n].deps[1],function(e,t){t[1].match(/^style([\-\.]min)?\.css$/)||(d+="<li>"+t[1]+"</li>\n")}),""!==d&&(d="<ul class='howto' style='padding-left:1em'>\n"+d+"</ul>\n",r.notices.push({headline:e.chldthmcfg.getxt("anlz23"),msg:d+e.chldthmcfg.getxt("anlz24"),style:"updated"}))}"child"===n&&c.analysis[n].signals.thm_parnt_loaded&&(r.notices.push({headline:e.chldthmcfg.getxt("anlz25"),msg:e.chldthmcfg.getxt("anlz26"),style:"updated"}),e("#ctc_enqueue_none").prop("checked",!0),o=1,_.ctc_enqueue="none"),c.analysis.parnt.signals.thm_no_styles&&(r.notices.push({headline:e.chldthmcfg.getxt("anlz27"),msg:e.chldthmcfg.getxt("anlz26"),style:"updated"}),e("#ctc_enqueue_none").prop("checked",!0),o=1,_.ctc_enqueue="none")}return a=encodeURIComponent(JSON.stringify(c.analysis)),e('input[name="ctc_analysis"]').val(a),_.ctc_analysis=a,c.is_success()&&o&&!c.resubmitting?(c.resubmitting=1,void c.resubmit(_)):(c.resubmitting=0,c.hide_loading(),e.each(r.notices,function(t,c){var i=e('<div class="'+c.style+' notice is-dismissible dashicons-before" ><h4>'+c.headline+"</h4>"+c.msg+"</div>");e.chldthmcfg.bind_dismiss(i),i.hide().appendTo("#"+n+"_analysis_notice").slideDown()}),e("#ctc_is_debug").is(":checked")&&(t='<div style="background-color:#ddd;padding:6px"><div class="ctc-section-toggle" id="ctc_analysis_obj">'+e.chldthmcfg.getxt("anlz30")+'</div><div id="ctc_analysis_obj_content" style="display:none"><textarea style="font-family:monospace;font-size:10px">'+JSON.stringify(c.analysis,null,2)+"</textarea></div></div>",e(t).appendTo("#"+n+"_analysis_notice")),e("#ctc_child_type_reset").is(":checked")||(e("#input_row_stylesheet_handling_container,#input_row_parent_handling_container,#ctc_child_header_parameters,#ctc_configure_submit").slideDown("fast"),e("#ctc_child_type_duplicate").is(":checked")?(e("#ctc_configure_submit .ctc-step").text("8"),e("#ctc_copy_theme_mods").find("input").prop("checked",!1)):(e("#ctc_configure_submit .ctc-step").text("9"),e("#ctc_copy_theme_mods").slideDown("fast")),e("#ctc_child_type_duplicate").is(":checked")||e("#ctc_child_type_new").is(":checked")?(e("#input_row_theme_slug").hide(),e("#input_row_new_theme_slug").slideDown("fast")):(e("#input_row_new_theme_slug").hide(),e("#input_row_theme_slug").slideDown("fast"))),void 0)},resubmit:function(t){var c=this;c.hide_loading(),c.show_loading(!0),t.action="ctc_update",t._wpnonce=e("#_wpnonce").val(),e.ajax({url:window.ctcAjax.ajaxurl,data:t,type:"POST"}).done(function(){c.hide_loading(),c.do_analysis()}).fail(function(){c.hide_loading()})},do_analysis:function(){var t=this;t.analysis={parnt:{},child:{}},t.phperr={parnt:[],child:[]},t.done=0,t.show_loading(!1),t.analyze_theme("parnt"),e.chldthmcfg.existing&&t.analyze_theme("child")},init:function(){var t=this;e(document).on("analysisdone",function(){t.done++,t.done>e.chldthmcfg.existing&&(t.done=0,t.css_notice())}),e("#ctc_main").on("click",".ctc-analyze-theme",function(){t.is_success()&&e.chldthmcfg.dismiss_notice(e(".ctc-success-response").parent(".notice")),t.do_analysis()}),(t.is_success()||window.ctcAjax.pluginmode)&&t.do_analysis()},analysis:{},done:0,resubmitting:0,is_success:function(){return e(".ctc-success-response").length}},e("#request-filesystem-credentials-form").length||(e.chldthmcfg.init(),e.chldthmanalyze.init())}(jQuery);
1
+ !function(e){"use strict";e.chldthmcfg={escquo:function(e){var t=this;return t.is_empty(e)?e:e.toString().replace(/"/g,"&quot;")},getxt:function(e,t){var c=window.ctcAjax[e+"_txt"];return c?(t&&(c=c.replace(/%s/,t)),c):""},frascii:function(e){var t=parseInt(e),c=String.fromCharCode(t);return c},toascii:function(e){var t=e.charCodeAt(0);return t},is_empty:function(e,t){if("undefined"==typeof e||!1===e||null===e||""===e)return!0;if("undefined"!=typeof t&&"0"===e||0===e)return!0;if(!0===e||"string"==typeof e||"number"==typeof e)return!1;if("object"==typeof e){for(var c in e)if(e.hasOwnProperty(c))return!1;return!0}return!1},theme_exists:function(t,c){var n=!1;return e.each(window.ctcAjax.themes,function(i,s){return e.each(s,function(e,s){return s=null,e.toLowerCase()!==t.toLowerCase()||"parnt"!==i&&"new"!==c?void 0:(n=!0,!1)}),n?!1:void 0}),n},validate:function(){var t=this,c=/[^\w\-]/,n=e("#ctc_child_template").length?e("#ctc_child_template").val().toString().replace(c):"",i=e("#ctc_theme_child").length?e("#ctc_theme_child").val().toString().replace(c):n,s=e("input[name=ctc_child_type]:checked").val(),a=[];return"new"===s&&(i=n),t.theme_exists(i,s)&&a.push(t.getxt("theme_exists").toString().replace(/%s/,i)),t.is_empty(i)&&a.push(t.getxt("inval_theme")),a.length?(t.set_notice({error:a}),!1):"reset"===s?!!confirm(t.getxt("load")):!0},autogen_slugs:function(){if(e("#ctc_theme_parnt").length){for(var t=this,c=e("#ctc_theme_parnt").val(),n=c+"-child",i=n,s=window.ctcAjax.themes.parnt[c].Name+" Child",a="",r="",l="00";t.theme_exists(i,"new");)a=t.is_empty(a)?2:a+1,r=l.substring(0,l.length-a.toString().length)+a.toString(),i=n+r;t.testslug=i,t.testname=s+(r.length?" "+r:"")}},focus_panel:function(t){var c=t+"_panel";e(".nav-tab").removeClass("nav-tab-active"),e(".ctc-option-panel").removeClass("ctc-option-panel-active"),e(t).addClass("nav-tab-active"),e(".ctc-option-panel-container").scrollTop(0),e(c).addClass("ctc-option-panel-active")},selector_input_toggle:function(t){var c,n=this;e("#ctc_rewrite_selector").length?(c=e("#ctc_rewrite_selector_orig").val(),e("#ctc_sel_ovrd_selector_selected").text(c),e(t).text(n.getxt("rename"))):(c=e("#ctc_sel_ovrd_selector_selected").text(),e("#ctc_sel_ovrd_selector_selected").html('<textarea id="ctc_rewrite_selector" name="ctc_rewrite_selector" autocomplete="off"></textarea><input id="ctc_rewrite_selector_orig" name="ctc_rewrite_selector_orig" type="hidden" value="'+n.escquo(c)+'"/>'),e("#ctc_rewrite_selector").val(c),e(t).text(n.getxt("cancel")))},coalesce_inputs:function(t){var c=this,n=e(t).attr("id"),i=/^(ctc_(ovrd|\d+)_(parent|child)_([0-9a-z\-]+)_(\d+?)(_(\d+))?)(_\w+)?$/,s=e(t).parents(".ctc-selector-row, .ctc-parent-row").first(),a=s.find(".ctc-swatch").first(),r={parent:{},child:{}},l={parent:{origin:"",start:"",end:""},child:{origin:"",start:"",end:""}},o={child:!1,parent:!1},_={};return s.find(".ctc-parent-value, .ctc-child-value").each(function(){var t,s,a=e(this).attr("id"),d=a.toString().match(i),u=d[2],h=d[3],p="undefined"==typeof d[4]?"":d[4],m=d[7],g=d[5],f="undefined"==typeof d[7]?"":d[8],v="parent"===h?e(this).text().replace(/!$/,""):"seq"!==p&&"ctc_delete_query_selector"===n?"":e(this).val(),y="seq"===p?!1:"ctc_"+u+"_child_"+p+"_i_"+g+"_"+m;if("child"===h&&(c.is_empty(e(this).data("color"))||(v=c.color_text(e(this).data("color")),e(this).data("color",null)),_[a]=v,y&&(_[y]=e("#"+y).is(":checked")?1:0)),""!==v)if(c.is_empty(f))if(t=p.toString().match(/^border(\-(top|right|bottom|left))?$/)&&!v.match(/none/)){var w=new RegExp(c.border_regx+c.color_regx,"i");s=v.toString().match(w),c.is_empty(s)||(s.shift(),r[h][p+"-width"]=s.shift()||"",s.shift(),r[h][p+"-style"]=s.shift()||"",r[h][p+"-color"]=s.shift()||"")}else if("background-image"!==p||v.match(/none/))"seq"!==p&&(r[h][p]=v);else if(v.toString().match(/url\(/))r[h]["background-image"]=c.image_url(h,v);else{var x=new RegExp(c.grad_regx+c.color_regx+c.color_regx,"i");s=v.toString().match(x),!c.is_empty(s)&&s.length>2?(s.shift(),l[h].origin=s.shift()||"top",l[h].start=s.shift()||"transparent",l[h].end=s.shift()||"transparent",o[h]=!0):r[h]["background-image"]=v}else switch(f){case"_border_width":r[h][p+"-width"]="none"===v?0:v;break;case"_border_style":r[h][p+"-style"]=v;break;case"_border_color":r[h][p+"-color"]=v;break;case"_background_url":r[h]["background-image"]=c.image_url(h,v);break;case"_background_color":r[h]["background-color"]=v;break;case"_background_color1":l[h].start=v,o[h]=!0;break;case"_background_color2":l[h].end=v,o[h]=!0;break;case"_background_origin":l[h].origin=v,o[h]=!0}}),"undefined"==typeof a||c.is_empty(a.attr("id"))||(a.removeAttr("style"),o.parent&&a.ctcgrad(l.parent.origin,[l.parent.start,l.parent.end]),a.css(r.parent),a.attr("id").toString().match(/parent/)||(o.child&&a.ctcgrad(l.child.origin,[l.child.start,l.child.end]),a.css(r.child)),a.css({"z-index":-1})),_},decode_value:function(e,t){t="undefined"==typeof t?"":t;var c,n=this,i={orig:t,names:[""],values:[t]};if(e.toString().match(/^border(\-(top|right|bottom|left))?$/)){var s,a=new RegExp(n.border_regx+"("+n.color_regx+")?","i");c=t.toString().match(a),n.is_empty(c)&&(c=[]),i.names=["_border_width","_border_style","_border_color"],s=c.shift(),i.values[0]=c.shift()||"",c.shift(),i.values[1]=c.shift()||"",c.shift(),i.values[2]=c.shift()||""}else if(e.toString().match(/^background\-image/))if(i.names=["_background_url","_background_origin","_background_color1","_background_color2"],i.values=["","","",""],n.is_empty(t)||t.toString().match(/(url|none)/))i.values[0]=t;else{var r,l;c=t.toString().split(/:/),i.values[1]=c.shift()||"",i.values[2]=c.shift()||"",r=c.shift()||"",i.values[3]=c.shift()||"",l=c.shift()||"",i.orig=[i.values[1],i.values[2],i.values[3]].join(" ")}return i},image_url:function(e,t){var c,n=this,i=t.toString().match(/url\(['" ]*(.+?)['" ]*\)/),s=n.is_empty(i)?null:i[1],a=window.ctcAjax.theme_uri+"/"+("parent"===e?window.ctcAjax.parnt:window.ctcAjax.child)+"/";return s?c=s.toString().match(/^(data:|https?:|\/)/)?t:"url("+a+s+")":!1},setup_menus:function(){var e=this;e.setup_query_menu(),e.setup_selector_menu(),e.setup_rule_menu(),e.setup_new_rule_menu(),e.load_queries(),e.load_rules(),e.set_query(e.currquery)},load_queries:function(){var e=this;e.query_css("queries",null)},load_selectors:function(){var e=this;e.query_css("selectors",e.currquery)},load_rules:function(){var e=this;e.query_css("rules",null)},load_selector_values:function(){var e=this;e.query_css("qsid",e.currqsid)},get_queries:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.chldthmcfg.is_empty(this.element.data("menu"))?n.push({label:window.ctcAjax.nosels_txt,value:null}):e.each(this.element.data("menu"),function(e,t){i.test(t)&&n.push({label:t,value:t})}),c(n)},get_selectors:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.chldthmcfg.is_empty(this.element.data("menu"))?n.push({label:window.ctcAjax.nosels_txt,value:null}):e.each(this.element.data("menu"),function(e,t){i.test(e)&&n.push({label:e,value:t})}),c(n)},get_rules:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.chldthmcfg.is_empty(this.element.data("menu"))?n.push({label:window.ctcAjax.nosels_txt,value:null}):e.each(this.element.data("menu"),function(e,t){i.test(e)&&n.push({label:e,value:t})}),c(n)},get_filtered_rules:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.each(e("#ctc_rule_menu").data("menu"),function(e,t){i.test(e)&&n.push({label:e,value:t})}),c(n)},merge_ruleval_arrays:function(t,c,n){var i=this,s={},a=n?c.child.pop():null;return e.each(["parnt","child"],function(t,r){i.is_empty(c[r])||e.each(c[r],function(e,t){n?parseInt(t[2])>=parseInt(a[2])&&(a[2]=parseInt(t[2])+1):(i.is_empty(s[t[2]])&&(s[t[2]]={}),s[t[2]][r]=t)})}),n&&(s[a[2]]={parnt:[],child:a}),s},input_row:function(t,c,n,i,s){var a=this,r="";if(!a.is_empty(i)&&!a.is_empty(i.value)&&!a.is_empty(i.value[c])){var l=i.value[c],o=a.merge_ruleval_arrays(c,l,s);e.each(o,function(s,l){var o=a.decode_value(c,a.is_empty(l.parnt)?"":l.parnt[0]),_=a.is_empty(l.parnt)||a.is_empty(l.parnt[1],1)?0:1,d=a.decode_value(c,a.is_empty(l.child)?"":l.child[0]),u=a.is_empty(l.child)||a.is_empty(l.child[1],1)?0:1;if(r+='<div class="ctc-'+("ovrd"===n?"input":"selector")+'-row clearfix"><div class="ctc-input-cell">',r+="ovrd"===n?c.replace(/\d+/g,a.frascii):i.selector+'<br/><a href="#" class="ctc-selector-edit" id="ctc_selector_edit_'+t+'" >'+a.getxt("edit")+"</a> "+(a.is_empty(o.orig)?a.getxt("child_only"):""),r+='</div><div class="ctc-parent-value ctc-input-cell"'+("ovrd"!==n?' style="display:none"':"")+' id="ctc_'+n+"_parent_"+c+"_"+t+"_"+s+'">'+(a.is_empty(o.orig)?"[no value]":o.orig+(_?a.getxt("important"):""))+'</div><div class="ctc-input-cell">',!a.is_empty(o.names)){e.each(o.names,function(e,i){i=a.is_empty(i)?"":i,r+='<div class="ctc-child-input-cell clear">';var l,o="ctc_"+n+"_child_"+c+"_"+t+"_"+s+i;!1===(l=d.values.shift())&&(l=""),r+=(a.is_empty(i)?"":a.getxt(i)+":<br/>")+'<input type="text" id="'+o+'" name="'+o+'" class="ctc-child-value'+((i+c).toString().match(/color/)?" color-picker":"")+(i.toString().match(/url/)?" ctc-input-wide":"")+'" value="'+a.escquo(l)+'" /></div>'});var h="ctc_"+n+"_child_"+c+"_i_"+t+"_"+s;r+='<label for="'+h+'"><input type="checkbox" id="'+h+'" name="'+h+'" value="1" '+(u?"checked":"")+" />"+a.getxt("important")+"</label>"}r+="</div>","ovrd"!==n&&(r+='<div class="ctc-swatch ctc-specific" id="ctc_child_'+c+"_"+t+"_"+s+'_swatch">'+a.getxt("swatch")+'</div><div class="ctc-child-input-cell ctc-button-cell" id="ctc_save_'+c+"_"+t+"_"+s+'_cell"><input type="button" class="button ctc-save-input" id="ctc_save_'+c+"_"+t+"_"+s+'" name="ctc_save_'+c+"_"+t+"_"+s+'" value="Save" /></div>'),r+="</div><!-- end input row -->\n"})}return r},scrolltop:function(){e("html, body, .ctc-option-panel-container").animate({scrollTop:0})},css_preview:function(e){var t=this;(e=e.match(/(child|parnt)/)[1])||(e="child"),t.query_css("preview",e)},setup_iris:function(e){var t=this;t.setup_spectrum(e)},setup_spectrum:function(t){var c=this,n=!c.is_empty(window.ctcAjax.palette);try{e(t).spectrum({showInput:!0,allowEmpty:!0,showAlpha:!0,showInitial:!0,preferredFormat:"hex",clickoutFiresChange:!0,move:function(n){e(t).data("color",n),c.coalesce_inputs(t)},showPalette:!!n,showSelectionPalette:!!n,palette:[],maxSelectionSize:36,localStorageKey:"ctc-palette."+window.ctcAjax.child,hideAfterPaletteSelect:!0}).on("change",function(){c.coalesce_inputs(this)}).on("keyup",function(){var t=this,n=c.addhash(e(this).val());e(t).val(n),clearTimeout(e(this).data("spectrumTimer")),e(this).data("spectrumTimer",setTimeout(function(){c.coalesce_inputs(t),e(t).spectrum("set",n)},500))})}catch(i){c.jquery_exception(i,"Spectrum Color Picker")}},addhash:function(e){return e.replace(/^#?([a-f0-9]{3,6}.*)/,"#$1")},color_text:function(e){var t=this;return t.is_empty(e)?"":e.getAlpha()<1?e.toRgbString():e.toHexString()},setup_query_menu:function(){var t=this;try{e("#ctc_sel_ovrd_query").autocomplete({source:t.get_queries,minLength:0,selectFirst:!0,autoFocus:!0,select:function(e,c){return t.set_query(c.item.value),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Query Menu")}},setup_selector_menu:function(){var t=this;try{e("#ctc_sel_ovrd_selector").autocomplete({source:t.get_selectors,selectFirst:!0,autoFocus:!0,select:function(e,c){return t.set_selector(c.item.value,c.item.label),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Selector Menu")}},setup_rule_menu:function(){var t=this;try{e("#ctc_rule_menu").autocomplete({source:t.get_rules,selectFirst:!0,autoFocus:!0,select:function(e,c){return t.set_rule(c.item.value,c.item.label),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Property Menu")}},setup_new_rule_menu:function(){var t=this;try{e("#ctc_new_rule_menu").autocomplete({source:t.get_filtered_rules,selectFirst:!0,autoFocus:!0,select:function(c,n){c.preventDefault();var i,s,a=n.item.label.replace(/[^\w\-]/g,t.toascii);return t.is_empty(t.currdata.value)&&(t.currdata.value={}),t.is_empty(t.currdata.value[n.item.label])&&(t.currdata.value[n.item.label]={}),t.is_empty(t.currdata.value[n.item.label].child)&&(t.currdata.value[n.item.label].child=[]),t.currdata.value[n.item.label].child.push(["",0,1,1]),i=e(t.input_row(t.currqsid,a,"ovrd",t.currdata,!0)),e("#ctc_sel_ovrd_rule_inputs").append(i),e("#ctc_new_rule_menu").val(""),i.find('input[type="text"]').each(function(c,n){s||(s=n),e(n).hasClass("color-picker")&&t.setup_spectrum(n)}),s&&e(s).focus(),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"New Property Menu")}},set_theme_params:function(t,c){e("#ctc_child_author").val(window.ctcAjax.themes[t][c].Author),e("#ctc_child_version").val(window.ctcAjax.themes[t][c].Version),e("#ctc_child_authoruri").val(window.ctcAjax.themes[t][c].AuthorURI),e("#ctc_child_themeuri").val(window.ctcAjax.themes[t][c].ThemeURI),e("#ctc_child_descr").val(window.ctcAjax.themes[t][c].Descr),e("#ctc_child_tags").val(window.ctcAjax.themes[t][c].Tags)},update_form:function(){var t,c=this;e("#input_row_stylesheet_handling_container,#input_row_parent_handling_container,#ctc_additional_css_files_container,#input_row_new_theme_slug,#input_row_duplicate_theme_slug,#ctc_copy_theme_mods,#ctc_child_header_parameters,#ctc_configure_submit,#input_row_theme_slug").slideUp("fast"),e("#ctc_configure_submit .ctc-step").text("9"),e("#ctc_theme_child").length&&!e("#ctc_child_type_new").is(":checked")?(t=e("#ctc_theme_child").val(),c.existing=1,c.currparnt=window.ctcAjax.themes.child[t].Template,c.autogen_slugs(),e("#ctc_theme_parnt").val(c.currparnt),e("#ctc_theme_parnt-button .ui-selectmenu-text").text(window.ctcAjax.themes.parnt[c.currparnt].Name),c.set_theme_params("child",t),e("#ctc_child_type_duplicate").is(":checked")?(e("#ctc_child_template").val(c.testslug),e("#ctc_child_name").val(c.testname),e(".ctc-analyze-theme, .ctc-analyze-howto").show(),e("#ctc_load_styles").val("Duplicate Child Theme")):e("#ctc_child_type_reset").is(":checked")?(e("#ctc_configure_submit .ctc-step").text("3"),e("#ctc_configure_submit").slideDown("fast"),e("#theme_slug_container").text(t),e(".ctc-analyze-theme, .ctc-analyze-howto").hide(),e("#ctc_enqueue_none").prop("checked",!0),e("#ctc_load_styles").val("Reset Child Theme to Previous State")):(e("#ctc_child_template").val(""),e("#theme_slug_container").text(t),e(".ctc-analyze-theme, .ctc-analyze-howto").show(),e("#ctc_child_name").val(window.ctcAjax.themes.child[t].Name),e("#ctc_load_styles").val("Configure Child Theme")),e("#input_row_existing_theme_option").slideDown("fast"),e("#input_row_new_theme_option").slideUp("fast")):(c.existing=0,c.autogen_slugs(),e("#ctc_theme_parnt").val(c.currparnt),e("#ctc_theme_parnt-button .ui-selectmenu-text").text(window.ctcAjax.themes.parnt[c.currparnt].Name),c.set_theme_params("parnt",c.currparnt),e("#input_row_existing_theme_option,#input_row_duplicate_theme_container,#input_row_theme_slug").slideUp("fast"),e("#input_row_new_theme_option").slideDown("fast"),e("#ctc_child_name").val(c.testname),e("#ctc_child_template").val(c.testslug),e(".ctc-analyze-theme, .ctc-analyze-howto").show(),e("#ctc_load_styles").val("Create New Child Theme"))},set_notice:function(t){var c,n=this,i="";n.is_empty(t)||e.each(t,function(t,c){i+='<div class="'+t+' notice is-dismissible dashicons-before"><ul>\n',e(c).each(function(e,t){i+="<li>"+t.toString()+"</li>\n"}),i+="</ul></div>"}),c=e(i),e("#ctc_error_notice").html(c),n.bind_dismiss(c),e("html, body").animate({scrollTop:0},"slow")},set_parent_menu:function(e){var t=this;t.currparnt=e.value,t.update_form()},set_child_menu:function(e){var t=this;t.currchild=e.value,t.update_form()},set_query:function(t){var c=this;return c.is_empty(t)?!1:(c.currquery=t,e("#ctc_sel_ovrd_query").val(""),e("#ctc_sel_ovrd_query_selected").text(t),e("#ctc_sel_ovrd_selector").val(""),e("#ctc_sel_ovrd_selector_selected").html("&nbsp;"),c.load_selectors(),void c.scrolltop())},set_selector:function(t,c){var n=this;return c=null,n.is_empty(t)?!1:(e("#ctc_sel_ovrd_selector").val(""),n.currqsid=t,n.reload=!1,n.load_selector_values(),void n.scrolltop())},set_rule:function(t,c){var n=this;return n.is_empty(t)?!1:(e("#ctc_rule_menu").val(""),e("#ctc_rule_menu_selected").text(c),e(".ctc-rewrite-toggle").text(n.getxt("rename")),e("#ctc_rule_value_inputs, #ctc_input_row_rule_header").show(),n.query_css("rule_val",t),void n.scrolltop())},set_qsid:function(t){var c=this;c.currqsid=e(t).attr("id").match(/_(\d+)$/)[1],c.focus_panel("#query_selector_options"),c.reload=!0,c.load_selector_values()},query_css:function(t,c,n){var i=this,s={ctc_query_obj:t,ctc_query_key:c},a="#ctc_status_"+t+("val_qry"===t?"_"+c:"");"object"==typeof n&&e.each(n,function(e,t){s["ctc_query_"+e]=t}),e(".query-icon,.ctc-status-icon").remove(),e(a+" .ctc-status-icon").remove(),e(a).append('<span class="ctc-status-icon spinner is-active query-icon"></span>'),s.action=i.is_empty(e("#ctc_action").val())||"plugin"!==e("#ctc_action").val()?"ctc_query":"ctc_plgqry",s._wpnonce=e("#_wpnonce").val(),i.ajax_post(t,s)},save:function(t){var c,n,i,s,a,r=this,l={},o=e(t).attr("id");e(t).prop("disabled",!0),e(".ctc-query-icon,.ctc-status-icon").remove(),e(t).parent(".ctc-textarea-button-cell, .ctc-button-cell").append('<span class="ctc-status-icon spinner save-icon"></span>'),o.match(/ctc_configtype/)?(e(t).parents(".ctc-input-row").first().append('<span class="ctc-status-icon spinner save-icon"></span>'),l.ctc_configtype=e(t).val()):(c=e("#ctc_new_selectors"))&&"ctc_save_new_selectors"===e(t).attr("id")?(l.ctc_new_selectors=c.val(),(n=e("#ctc_sel_ovrd_query_selected"))&&(l.ctc_sel_ovrd_query=n.text()),r.reload=!0):(i=e("#ctc_child_imports"))&&"ctc_save_imports"===o?l.ctc_child_imports=i.val():"ctc_is_debug"===o?l.ctc_is_debug=e("#ctc_is_debug").is(":checked")?1:0:l=r.coalesce_inputs(t),e(".save-icon").addClass("is-active"),e("#ctc_sel_ovrd_selector_selected").find("#ctc_rewrite_selector").each(function(){s=e("#ctc_rewrite_selector").val(),a=e("#ctc_rewrite_selector_orig").val(),r.is_empty(s)||!s.toString().match(/\w/)?s=a:(l.ctc_rewrite_selector=s,r.reload=!0),e(".ctc-rewrite-toggle").text(r.getxt("rename")),e("#ctc_sel_ovrd_selector_selected").html(s)}),l.action=r.is_empty(e("#ctc_action").val())||"plugin"!==e("#ctc_action").val()?"ctc_update":"ctc_plugin",l._wpnonce=e("#_wpnonce").val(),r.ajax_post("qsid",l)},ajax_post:function(t,c,n){var i=this;e.ajax({url:window.ctcAjax.ajaxurl,data:c,dataType:i.is_empty(n)?"json":n,type:"POST"}).done(function(e){i.handle_success(t,e)}).fail(function(){i.handle_failure(t)}).always(function(){i.jqueryerr.length&&i.jquery_notice()})},handle_failure:function(t){var c=this;e(".query-icon, .save-icon").removeClass("spinner").addClass("failure"),e("input[type=submit], input[type=button], input[type=checkbox],.ctc-delete-input").prop("disabled",!1),e(".ajax-pending").removeClass("ajax-pending"),"preview"===t&&e("#view_parnt_options_panel,#view_child_options_panel").text(c.getxt("css_fail"))},handle_success:function(t,c){var n=this;e(".query-icon, .save-icon").removeClass("spinner"),e(".ajax-pending").removeClass("ajax-pending"),n.is_empty(c)?n.handle_failure(t):(e("#ctc_new_selectors").val(""),e(".query-icon, .save-icon").addClass("success"),e("input[type=submit], input[type=button], input[type=checkbox],.ctc-delete-input").prop("disabled",!1),e(c).each(function(){"function"==typeof n.update[this.obj]&&n.update[this.obj].call(n,this)}))},jquery_exception:function(e,t){var c=this,n=c.is_empty(e.lineNumber)?"":" line: "+e.lineNumber,i=c.is_empty(e.fileName)?"":" "+e.fileName.split(/\?/)[0];c.jqueryerr.push("<code><small>"+t+": "+e.message+i+n+"</small></code>")},jquery_notice:function(t){t=null;var c=this,n=[],i=[];c.jqueryerr.length&&(e("input[type=submit], input[type=button]").prop("disabled",!0),e("script").each(function(){var t=e(this).prop("src");c.is_empty(t)||!t.match(/jquery(\.min|\.js|\-?ui)/i)||t.match(/load\-scripts.php/)||n.push("<code><small>"+t.split(/\?/)[0]+"</small></code>")}),i.push("<strong>"+c.getxt("js")+"</strong> "+c.getxt("contact")),i.push(c.jqueryerr.join("<br/>")),n.length&&i.push(c.getxt("jquery")+"<br/>"+n.join("<br/>")),i.push(c.getxt("plugin"))),c.set_notice({error:i})},update:{qsid:function(t){var c,n,i,s,a=this;a.currqsid=t.key,a.currdata=t.data,e("#ctc_sel_ovrd_qsid").val(a.currqsid),a.is_empty(a.currdata.seq)?e("#ctc_child_load_order_container").empty():(c="ctc_ovrd_child_seq_"+a.currqsid,i=parseInt(a.currdata.seq),n='<input type="text" id="'+c+'" name="'+c+'" class="ctc-child-value" value="'+i+'" />',e("#ctc_child_load_order_container").html(n)),a.is_empty(a.currdata.value)?(s=!0,e("#ctc_sel_ovrd_rule_inputs").empty()):(s=!1,n="",e.each(a.currdata.value,function(e,t){t=null,n+=a.input_row(a.currqsid,e,"ovrd",a.currdata)}),e("#ctc_sel_ovrd_rule_inputs").html(n).find(".color-picker").each(function(){a.setup_spectrum(this)}),a.coalesce_inputs("#ctc_child_all_0_swatch")),a.reload&&(a.load_queries(),a.set_query(a.currdata.query),a.load_rules()),e("#ctc_sel_ovrd_selector_selected").text(a.currdata.selector),e(".ctc-rewrite-toggle").text(a.getxt("rename")),e(".ctc-rewrite-toggle").show(),s?e("#ctc_sel_ovrd_rule_header,#ctc_sel_ovrd_new_rule,#ctc_sel_ovrd_rule_inputs_container,#ctc_sel_ovrd_rule_inputs").hide():e("#ctc_sel_ovrd_rule_header,#ctc_sel_ovrd_new_rule,#ctc_sel_ovrd_rule_inputs_container,#ctc_sel_ovrd_rule_inputs").show()},rule_val:function(t){var c=this,n=e("#ctc_rule_menu_selected").text(),i='<div class="ctc-input-row clearfix" id="ctc_rule_row_'+n+'">\n';c.is_empty(t.data)||(e.each(t.data,function(e,t){var s=c.decode_value(n,t);i+='<div class="ctc-parent-row clearfix" id="ctc_rule_row_'+n+"_"+e+'">\n<div class="ctc-input-cell ctc-parent-value" id="ctc_'+e+"_parent_"+n+"_"+e+'">'+s.orig+'</div>\n<div class="ctc-input-cell">\n<div class="ctc-swatch ctc-specific" id="ctc_'+e+"_parent_"+n+"_"+e+'_swatch">'+c.getxt("swatch")+'</div></div>\n<div class="ctc-input-cell"><a href="#" class="ctc-selector-handle" id="ctc_selector_'+n+"_"+e+'">'+c.getxt("selector")+'</a></div>\n<div id="ctc_selector_'+n+"_"+e+'_container" class="ctc-selector-container">\n<a href="#" id="ctc_selector_'+n+"_"+e+'_close" class="ctc-selector-handle ctc-exit" title="'+c.getxt("close")+'"></a><div id="ctc_selector_'+n+"_"+e+'_inner_container" class="ctc-selector-inner-container clearfix">\n<div id="ctc_status_val_qry_'+e+'"></div>\n<div id="ctc_selector_'+n+"_"+e+'_rows"></div>\n</div></div></div>\n'}),i+="</div>\n"),e("#ctc_rule_value_inputs").html(i).find(".ctc-swatch").each(function(){c.coalesce_inputs(this)})},val_qry:function(t){var c,n,i=this,s="";i.is_empty(t.data)||e.each(t.data,function(n,a){c=n,e.each(a,function(c,a){s+='<h4 class="ctc-query-heading">'+c+"</h4>\n",i.is_empty(a)||e.each(a,function(e,c){s+=i.input_row(e,n,t.key,c)})})}),n="#ctc_selector_"+c+"_"+t.key+"_rows",e(n).html(s).find(".color-picker").each(function(){i.setup_spectrum(this)}),e(n).find(".ctc-swatch").each(function(){i.coalesce_inputs(this)})},queries:function(t){e("#ctc_sel_ovrd_query").data("menu",t.data)},selectors:function(t){e("#ctc_sel_ovrd_selector").data("menu",t.data)},rules:function(t){e("#ctc_rule_menu").data("menu",t.data)},debug:function(t){e("#ctc_debug_container").html(t.data)},preview:function(t){e("#view_"+t.key+"_options_panel").text(t.data)},dismiss:function(){}},bind_dismiss:function(t){var c=this,n=e(t),i=e('<button type="button" class="notice-dismiss"><span class="screen-reader-text"></span></button>'),s=window.commonL10n.dismiss||"";i.find(".screen-reader-text").text(s),n.append(i),i.on("click.wp-dismiss-notice",function(e){e.preventDefault(),c.dismiss_notice(t)})},dismiss_notice:function(t){e(t).fadeTo(100,0,function(){e(this).slideUp(100,function(){e(this).remove()})})},reset_handling:function(){e("#parnt_analysis_notice .notice, #child_analysis_notice .notice").slideUp(),e("#ctc_enqueue_enqueue").prop("checked",!0),e("#ctc_handling_primary").prop("checked",!0),e("#ctc_ignoreparnt").prop("checked",!1),e("#ctc_repairheader").prop("checked",!1)},init:function(){var t=this;if(!e("#ctc_theme_parnt").is("input")){try{e.widget("ctc.themeMenu",e.ui.selectmenu,{_renderItem:function(t,c){var n=e("<li>"),i=c.value.replace(/[^\w\-]/,"");return e("#ctc_theme_option_"+i).detach().appendTo(n),n.appendTo(t)}})}catch(c){t.jquery_exception(c,"Theme Menu")}try{e("#ctc_theme_parnt").themeMenu({select:function(e,c){t.reset_handling(),t.set_parent_menu(c.item)}})}catch(c){"function"==typeof themeMenu?e("#ctc_theme_parnt").themeMenu("destroy"):e("#ctc_theme_parnt-button").remove(),t.jquery_exception(c,"Parent Theme Menu")}if(t.is_empty(window.ctcAjax.themes.child))e("#ctc_child_name").length&&(e("#ctc_child_name").val(t.testname),e("#ctc_child_template").val(t.testslug));else try{e("#ctc_theme_child").themeMenu({select:function(e,c){t.reset_handling(),t.set_child_menu(c.item)}})}catch(c){"function"==typeof themeMenu?e("#ctc_theme_child").themeMenu("destroy"):e("#ctc_theme_child-button").remove(),t.jquery_exception(c,"Child Theme Menu")}}t.currparnt=e("#ctc_theme_parnt").val(),t.currchild=e("#ctc_theme_child").length?e("#ctc_theme_child").val():"",e("#ctc_main").on("click",".ctc-section-toggle",function(t){t.preventDefault(),e(this).parents(".ctc-input-row, .notice-warning, .updated, .error").first().find(".ctc-section-toggle").each(function(){e(this).toggleClass("open")});var c=e(this).attr("id").replace(/\d$/,"")+"_content";return e("#"+c).stop().slideToggle("fast"),!1}),e("#ctc_main").on("click",".ctc-upgrade-notice .notice-dismiss",function(){var c={action:"ctc_dismiss",_wpnonce:e("#_wpnonce").val()};t.ajax_post("dismiss",c)}),t.is_empty(t.jqueryerr)&&(e("#ctc_main").on("click",".ctc-selector-handle",function(c){if(c.preventDefault(),e(this).hasClass("ajax-pending"))return!1;e(this).addClass("ajax-pending");var n,i,s=e(this).attr("id").toString().replace("_close",""),a=s.toString().match(/_([^_]+)_(\d+)$/);e("#"+s+"_container").is(":hidden")&&(t.is_empty(a[1])||t.is_empty(a[2])||(n=a[1],i=a[2],t.query_css("val_qry",i,{rule:n}))),e("#"+s+"_container").fadeToggle("fast"),e(".ctc-selector-container").not("#"+s+"_container").fadeOut("fast")}),e("#ctc_main").on("click",".ctc-save-input[type=button], .ctc-delete-input",function(c){return c.preventDefault(),e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),t.save(this),!1)}),e("#ctc_main").on("keydown",".ctc-selector-container .ctc-child-value[type=text]",function(c){if(13===c.which){var n=e(this).parents(".ctc-selector-row").find(".ctc-save-input[type=button]").first();if(n.length)return c.preventDefault(),n.hasClass("ajax-pending")?!1:(n.addClass("ajax-pending"),t.save(n),!1)}}),e("#ctc_main").on("click",".ctc-selector-edit",function(c){return c.preventDefault(),e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),void t.set_qsid(this))}),e("#ctc_main").on("click",".ctc-rewrite-toggle",function(e){e.preventDefault(),t.selector_input_toggle(this)}),e("#ctc_main").on("click","#ctc_copy_selector",function(){var c=e("#ctc_sel_ovrd_selector_selected").text().trim();t.is_empty(c)||e("#ctc_new_selectors").val(e("#ctc_new_selectors").val()+"\n"+c+" {\n\n}")}),e("#ctc_main").on("click",".ctc-backup-theme",function(c){c.preventDefault(),t.existing?e("#ctc_export_theme").val(t.currchild):e("#ctc_export_theme").val(t.currparnt),e("#ctc_export_theme_form").submit()}),e("#ctc_configtype").on("change",function(){var c=e(this).val();if(t.is_empty(c)||"theme"===c){e(".ctc-theme-only, .ctc-themeonly-container").removeClass("ctc-disabled"),e(".ctc-theme-only, .ctc-themeonly-container input").prop("disabled",!1);try{e("#ctc_theme_parnt, #ctc_theme_child").themeMenu("enable")}catch(n){t.jquery_exception(n,"Theme Menu")}}else{e(".ctc-theme-only, .ctc-themeonly-container").addClass("ctc-disabled"),e(".ctc-theme-only, .ctc-themeonly-container input").prop("disabled",!0);try{e("#ctc_theme_parnt, #ctc_theme_child").themeMenu("disable")}catch(n){t.jquery_exception(n,"Theme Menu")}}}),e(".nav-tab").on("click",function(c){c.preventDefault(),e(".ctc-query-icon,.ctc-status-icon").remove();var n="#"+e(this).attr("id");t.focus_panel(n)}),e("#view_child_options, #view_parnt_options").on("click",function(){return e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),void t.css_preview(e(this).attr("id")))}),e("#ctc_load_form").on("submit",function(){return t.validate()}),e("#ctc_query_selector_form").on("submit",function(c){c.preventDefault();var n=e("#ctc_save_query_selector");return n.hasClass("ajax-pending")?!1:(n.addClass("ajax-pending"),t.save(n),!1)}),e("#ctc_rule_value_form").on("submit",function(e){return e.preventDefault(),!1}),e("#ctc_child_type_new,#ctc_child_type_existing,#ctc_child_type_duplicate,#ctc_child_type_reset").on("focus click",function(){t.reset_handling(),t.update_form()}),e("#ctc_is_debug").on("change",function(){t.save(this)}),e(".ctc-live-preview").on("click",function(t){return t.stopImmediatePropagation(),t.preventDefault(),document.location=e(this).prop("href"),!1}),t.setup_menus(),e("input[type=submit], input[type=button]").prop("disabled",!1),t.scrolltop(),t.update_form()),t.jqueryerr.length&&t.jquery_notice()},testslug:"",testname:"",reload:!1,currquery:"base",currqsid:null,currdata:{},currparnt:"",currchild:"",existing:!1,jqueryerr:[],color_regx:"\\s+(\\#[a-f0-9]{3,6}|rgba?\\([\\d., ]+?\\)|hsla?\\([\\d%., ]+?\\)|[a-z]+)",border_regx:"(\\w+)(\\s+(\\w+))?",grad_regx:"(\\w+)"},e.chldthmanalyze={escrgx:function(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},trmcss:function(e){return"undefined"==typeof e?"":e.replace(/\-css$/,"")},show_loading:function(t){var c=e.chldthmcfg.existing?"child":"parnt",n="child"===c?e.chldthmcfg.currchild:e.chldthmcfg.currparnt,i=window.ctcAjax.themes[c][n].Name,s='<strong class="ctc_analyze_loading"><span class="spinner is-active"></span>'+e.chldthmcfg.getxt(t?"anlz1":"anlz2")+" "+i+"...</strong>";self.noticediv="",e("#"+c+"_analysis_notice").html(s)},hide_loading:function(){e(".ctc_analyze_loading").fadeTo(200,0,function(){e(this).slideUp(200,function(){e(this).remove()})})},setssl:function(e){return e.replace(/^https?/,window.ctcAjax.ssl?"https":"http")},analyze_theme:function(t){var c,n,i,s=this,a=Math.floor(e.now()/1e3),r="child"===t?e.chldthmcfg.currchild:e.chldthmcfg.currparnt,l="&template="+e.chldthmcfg.currparnt+"&stylesheet="+r+"&now="+a,o=s.setssl(window.ctcAjax.homeurl),_=window.ctcAjax.theme_uri.replace(/^https?:\/\//,""),d=o+l,u=s.escrgx(e.chldthmcfg.currparnt)+("child"===t?"|"+s.escrgx(r):""),h=new RegExp("<link( rel=[\"']stylesheet[\"'] id=['\"]([^'\"]+?)['\"])?[^>]+?"+s.escrgx(_)+"/("+u+")/([^\"']+\\.css)(\\?[^\"']+)?[\"'][^>]+>","gi"),p=/<br \/>\n[^\n]+?(fatal|strict|notice|warning|error)[\s\S]+?<br \/>/gi,m=0,g=0,f={url:d,deps:[[],[]],signals:{},queue:[],irreg:[]};e.get(d,function(a){for((n=a.match(/BEGIN WP QUEUE\n([\s\S]*?)\nEND WP QUEUE/))?f.queue=n[1].split(/\n/):(f.queue=[],f.signals.thm_noqueue=1),(n=a.match(/BEGIN CTC IRREGULAR\n([\s\S]*?)\nEND CTC IRREGULAR/))?f.irreg=n[1].split(/\n/):f.irreg=[],a.match(/CHLD_THM_CFG_IGNORE_PARENT/)&&(f.signals.thm_ignoreparnt=1),a.match(/IS_CTC_THEME/)&&(f.signals.thm_is_ctc=1),a.match(/NO_CTC_STYLES/)&&(f.signals.thm_no_styles=1),a.match(/HAS_CTC_IMPORT/)&&(f.signals.thm_has_import=1),a=a.replace(/<!\-\-[\s\S]*?\-\->/g,"");c=p.exec(a);){var r=c[0].replace(/<.*?>/g,"");s.phperr[t].push(r),f.signals.err_php=1,r.match(/Fatal error/i)&&(f.signals.err_fatal=1)}for(;i=h.exec(a);){var l=s.trmcss(i[2]),o=i[3],_=i[4],d=e.chldthmcfg.currparnt===o?"parnt":"child",u=0;if(""===l||-1===e.inArray(l,f.queue))u=1;else if(0===l.indexOf("chld_thm_cfg")){_.match(/^ctc\-style([\-\.]min)?\.css$/)?(m=1,f.signals.ctc_sep_loaded=1):_.match(/^ctc\-genesis([\-\.]min)?\.css$/)?(m=1,f.signals.ctc_gen_loaded=1):l.match(/$chld_thm_cfg_ext/)?(f.signals.ctc_ext_loaded=1,
2
  f.deps[m].push([l,_])):"chld_thm_cfg_child"===l?(f.signals.ctc_child_loaded=1,f.deps[m].push([l,_])):"chld_thm_cfg_parent"===l&&(f.signals.ctc_parnt_loaded=1,f.deps[m].push([l,_]),m&&(f.signals.ctc_parnt_reorder=1));continue}if(_.match(/^style([\-\.]min)?\.css$/))m=1,"parnt"===d?f.signals.thm_parnt_loaded=u?"thm_unregistered":l:f.signals.thm_child_loaded=u?"thm_unregistered":l,u?g?(f.signals.thm_past_wphead=1,f.deps[m].push(["thm_past_wphead",_])):(f.signals.thm_unregistered=1,f.deps[m].push(["thm_unregistered",_])):f.deps[m].push([l,_]);else if("ctc-test.css"===_)g=1;else{var v=null;u&&(v="dep_unregistered"),g&&(v=m?"css_past_wphead":"dep_past_wphead"),v&&(f.signals[v]=1,l=v),f.deps[m].push([l,_])}}m||(f.signals.thm_notheme=1),a=null,s.analysis[t]=f,e(document).trigger("analysisdone")}).fail(function(c,n,i){f.signals.failure=1,f.signals.xhrerr=i,s.analysis[t]=f,e(document).trigger("analysisdone")})},css_notice:function(){var t,c=this,n=e.chldthmcfg.existing?"child":"parnt",i="child"===n?e.chldthmcfg.currchild:e.chldthmcfg.currparnt,s=window.ctcAjax.themes[n][i].Name,a="",r={notices:[]},l={style:"notice-warning",headline:e.chldthmcfg.getxt("anlz3",s),errlist:""},o=0,_={};if(e(window.ctcAjax.addl_css).each(function(t,c){e("#ctc_stylesheet_files .ctc_checkbox").each(function(){c===e(this).val()&&e(this).prop("checked",!0)})}),c.analysis[n].signals.failure||c.analysis[n].signals.thm_noqueue&&!c.phperr[n].length)r.notices.push({headline:e.chldthmcfg.getxt("anlz4",s),msg:e.chldthmcfg.getxt("anlz5"),style:"notice-warning"});else{if(c.phperr[n].length&&(e.each(c.phperr[n],function(t,c){c.match(/Fatal error/i)&&(l.style="error",l.headline=e.chldthmcfg.getxt("anlz8",s)),l.errlist+=c+"\n"}),l.msg='<div style="background-color:#ffeebb;padding:6px"><div class="ctc-section-toggle" id="ctc_analysis_errs">'+e.chldthmcfg.getxt("anlz6")+'</div><div id="ctc_analysis_errs_content" style="display:none"><textarea>'+l.errlist+"</textarea></div></div>"+e.chldthmcfg.getxt("anlz7"),r.notices.push(l)),(c.analysis[n].signals.thm_past_wphead||c.analysis[n].signals.dep_past_wphead)&&(r.notices.push({headline:e.chldthmcfg.getxt("anlz9"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz10")}),e("#ctc_repairheader").prop("checked",!0),e("#ctc_repairheader_container").show()),c.analysis[n].signals.thm_unregistered&&(c.analysis[n].signals.ctc_child_loaded||c.analysis[n].signals.ctc_sep_loaded||(r.notices.push({headline:e.chldthmcfg.getxt("anlz11"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz12")}),e("#ctc_repairheader_container").show(),e("#ctc_repairheader").prop("checked",!0))),"child"===n&&(c.analysis.child.signals.ctc_parnt_reorder&&(o=1),c.analysis.child.signals.ctc_child_loaded||c.analysis.child.signals.ctc_sep_loaded||c.analysis.child.signals.thm_child_loaded||(r.notices.push({headline:e.chldthmcfg.getxt("anlz13"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz14")}),o=1),c.analysis[n].signals.ctc_gen_loaded&&r.notices.push({headline:e.chldthmcfg.getxt("anlz31"),msg:e.chldthmcfg.getxt("anlz32"),style:"notice-warning"}),c.analysis.parnt.signals.thm_no_styles||c.analysis.child.signals.ctc_gen_loaded||c.analysis.child.signals.thm_parnt_loaded||c.analysis.child.signals.ctc_parnt_loaded||c.analysis.child.signals.thm_ignoreparnt||c.analysis.child.signals.thm_has_import||(r.notices.push({headline:e.chldthmcfg.getxt("anlz15"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz16")}),o=1),c.analysis.child.signals.thm_unregistered&&c.analysis.child.signals.thm_child_loaded&&"thm_unregistered"===c.analysis.child.signals.thm_child_loaded&&c.analysis.child.signals.ctc_child_loaded&&c.analysis.child.signals.ctc_parnt_loaded&&(r.notices.push({headline:e.chldthmcfg.getxt("anlz28"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz29")}),e("#ctc_repairheader_container").show(),e("#ctc_repairheader").prop("checked",!0)),c.analysis.child.signals.thm_is_ctc||e("#ctc_child_type_duplicate").is(":checked")||r.notices.push({headline:e.chldthmcfg.getxt("anlz19"),msg:e.chldthmcfg.getxt("anlz20"),style:"notice-warning"})),(c.analysis[n].signals.ctc_sep_loaded||c.analysis[n].signals.ctc_gen_loaded)&&e("#ctc_handling_separate").prop("checked",!0),r.notices.length||r.notices.push({headline:""+("child"===n?e.chldthmcfg.getxt("anlz17"):e.chldthmcfg.getxt("anlz18")),style:"updated",msg:""}),"child"===n&&c.analysis.child.signals.thm_has_import&&(r.notices.push({headline:e.chldthmcfg.getxt("anlz21"),msg:e.chldthmcfg.getxt("anlz22"),style:"notice-warning"}),e("#ctc_enqueue_import").prop("checked",!0)),c.analysis[n].signals.thm_ignoreparnt||c.analysis[n].signals.ctc_gen_loaded?(e("#ctc_ignoreparnt").prop("checked",!0),e("#ctc_enqueue_none").is(":checked")||(e("#ctc_enqueue_none").prop("checked",!0),o=1,_.ctc_enqueue="none")):e("#ctc_ignoreparnt").prop("checked",!1),c.analysis[n].signals.thm_keepdeps?e("#ctc_keepdeps").prop("checked",!0):e("#ctc_keepdeps").prop("checked",!1),!c.analysis[n].signals.ctc_sep_loaded&&!c.analysis[n].signals.ctc_gen_loaded&&!c.analysis[n].signals.ctc_child_loaded&&!c.analysis[n].signals.thm_unregistered&&!c.analysis[n].signals.thm_past_wphead&&c.analysis[n].deps[1].length){var d="";e.each(c.analysis[n].deps[1],function(e,t){t[1].match(/^style([\-\.]min)?\.css$/)||(d+="<li>"+t[1]+"</li>\n")}),""!==d&&(d="<ul class='howto' style='padding-left:1em'>\n"+d+"</ul>\n",r.notices.push({headline:e.chldthmcfg.getxt("anlz23"),msg:d+e.chldthmcfg.getxt("anlz24"),style:"updated"}))}"child"===n&&c.analysis[n].signals.thm_parnt_loaded&&(r.notices.push({headline:e.chldthmcfg.getxt("anlz25"),msg:e.chldthmcfg.getxt("anlz26"),style:"updated"}),e("#ctc_enqueue_none").prop("checked",!0),o=1,_.ctc_enqueue="none"),c.analysis.parnt.signals.thm_no_styles&&(r.notices.push({headline:e.chldthmcfg.getxt("anlz27"),msg:e.chldthmcfg.getxt("anlz26"),style:"updated"}),e("#ctc_enqueue_none").prop("checked",!0),o=1,_.ctc_enqueue="none")}return a=encodeURIComponent(JSON.stringify(c.analysis)),e('input[name="ctc_analysis"]').val(a),_.ctc_analysis=a,c.is_success()&&o&&!c.resubmitting?(c.resubmitting=1,void c.resubmit(_)):(c.resubmitting=0,c.hide_loading(),e.each(r.notices,function(t,c){var i=e('<div class="'+c.style+' notice is-dismissible dashicons-before" ><h4>'+c.headline+"</h4>"+c.msg+"</div>");e.chldthmcfg.bind_dismiss(i),i.hide().appendTo("#"+n+"_analysis_notice").slideDown()}),e("#ctc_is_debug").is(":checked")&&(t='<div style="background-color:#ddd;padding:6px"><div class="ctc-section-toggle" id="ctc_analysis_obj">'+e.chldthmcfg.getxt("anlz30")+'</div><div id="ctc_analysis_obj_content" style="display:none"><textarea style="font-family:monospace;font-size:10px">'+JSON.stringify(c.analysis,null,2)+"</textarea></div></div>",e(t).appendTo("#"+n+"_analysis_notice")),e("#ctc_child_type_reset").is(":checked")||(e("#input_row_stylesheet_handling_container,#input_row_parent_handling_container,#ctc_child_header_parameters,#ctc_configure_submit").slideDown("fast"),e("#ctc_child_type_duplicate").is(":checked")?(e("#ctc_configure_submit .ctc-step").text("8"),e("#ctc_copy_theme_mods").find("input").prop("checked",!1)):(e("#ctc_configure_submit .ctc-step").text("9"),e("#ctc_copy_theme_mods").slideDown("fast")),e("#ctc_child_type_duplicate").is(":checked")||e("#ctc_child_type_new").is(":checked")?(e("#input_row_theme_slug").hide(),e("#input_row_new_theme_slug").slideDown("fast")):(e("#input_row_new_theme_slug").hide(),e("#input_row_theme_slug").slideDown("fast"))),void 0)},resubmit:function(t){var c=this;c.hide_loading(),c.show_loading(!0),t.action="ctc_update",t._wpnonce=e("#_wpnonce").val(),e.ajax({url:window.ctcAjax.ajaxurl,data:t,type:"POST"}).done(function(){c.hide_loading(),c.do_analysis()}).fail(function(){c.hide_loading()})},do_analysis:function(){var t=this;t.analysis={parnt:{},child:{}},t.phperr={parnt:[],child:[]},t.done=0,t.show_loading(!1),t.analyze_theme("parnt"),e.chldthmcfg.existing&&t.analyze_theme("child")},init:function(){var t=this;e(document).on("analysisdone",function(){t.done++,t.done>e.chldthmcfg.existing&&(t.done=0,t.css_notice())}),e("#ctc_main").on("click",".ctc-analyze-theme",function(){t.is_success()&&e.chldthmcfg.dismiss_notice(e(".ctc-success-response").parent(".notice")),t.do_analysis()}),(t.is_success()||window.ctcAjax.pluginmode)&&t.do_analysis()},analysis:{},done:0,resubmitting:0,is_success:function(){return e(".ctc-success-response").length}},e("#request-filesystem-credentials-form").length||(e.chldthmcfg.init(),e.chldthmanalyze.init())}(jQuery);
readme.txt CHANGED
@@ -1,30 +1,30 @@
1
  === Child Theme Configurator ===
2
  Contributors: lilaeamedia
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8QE5YJ8WE96AJ
4
- Tags: child theme, child themes, custom styles, customize styles, customize theme, CSS, responsive, css editor, child theme generator, child theme creator, style, stylesheet, customizer, childtheme, childthemes
5
  Requires at least: 3.9
6
  Tested up to: 4.5.2
7
- Stable tag: 2.0.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- When using the Customizer is not enough - Create child themes and customize styles, templates, functions and more.
12
 
13
  == Description ==
14
 
15
- Child Theme Configurator is a fast and easy to use CSS editor that allows you to create a child theme and customize it beyond the options of the Customizer. Designed for WordPress users who want to be able to customize stylesheets directly, the Child Theme Configurator lets you easily identify and override the exact CSS attributes you want to customize. It properly enqueues theme and font stylesheets for optimum performance and handles vendor-specific syntax, giving you unlimited control over your WordPress look and feel while leaving your Parent Theme untouched. [Learn more about how to create a child theme](http://www.childthemeconfigurator.com).
16
 
17
  = Take Control of Your Child Themes =
18
 
19
- The Child Theme Configurator parses and indexes your stylesheets so that every CSS media query, selector, property and value are at your fingertips. Second, it shows you how each customization you make will look before you commit it to the child theme. Finally, it saves your work so that you can customize styles in your child themes without the risk of losing your edits.
20
 
21
- You can create any number of child themes from your existing Parent Themes. The Child Theme Configurator lets you choose from your installed themes (even existing child themes) and save the results in your Themes directory.
22
 
23
  When you are ready, just activate the Child Theme and your WordPress site takes on the custom styles automatically.
24
 
25
  https://www.youtube.com/watch?v=xL0YmieF6d0
26
 
27
- = Why create child themes and customize styles using the Child Theme Configurator? =
28
 
29
  1. Some things cannot be changed using the Customizer.
30
 
@@ -89,7 +89,7 @@ Learn more at http://www.lilaeamedia.com/plugins/intelliwidget-responsive-menu
89
  * Locate "Child Theme Configurator" in the list and click "Install Now."
90
 
91
  2. To install manually:
92
- * Download the Child Theme Configurator plugin from http://wordpress.org/plugins/child-theme-configurator
93
  * In the WordPress Admin, go to "Plugins > Add New."
94
  * Click the "Upload" link at the top of the page.
95
  * Browse for the zip file, select and click "Install."
@@ -202,11 +202,11 @@ Every theme handles options in its own way. Most often, they will create a set o
202
 
203
  = Where is Child Theme Configurator in the Admin? =
204
 
205
- For most users the Child Theme Configurator can be found under "Tools > Child Themes."
206
 
207
  WordPress Multisite (Network) users go to "Network Admin > Themes > Child Themes."
208
 
209
- NOTE: Only users with "install_themes" capability will have access to the Child Theme Configurator.
210
 
211
  Click the "Help" tab at the top right for a quick reference.
212
 
@@ -237,7 +237,7 @@ You can make any manual customizations you wish to the stylesheet. Just make sur
237
 
238
  = Where are the child theme .php files? =
239
 
240
- The Child Theme Configurator automatically adds a blank functions.php file to the child theme's directory. You can copy parent theme template files using the Files tab. If you want to create new templates and directories you will have to create/upload them manually via FTP or SSH. Remember that a child theme will automatically inherit the parent theme's templates unless they also exist in the child theme's directory. Only copy templates that you intend to customize.
241
 
242
  = How do I customize a specific color/font style/background? =
243
 
@@ -253,7 +253,7 @@ You shouldn't really "remove" a style from the Parent. You can, however, set the
253
 
254
  = How do I remove a style from the Child Theme? =
255
 
256
- Delete the value from the input for the property you wish to remove. The Child Theme Configurator only adds overrides for properties that contain values.
257
 
258
  = How do I set the !important flag? =
259
 
@@ -261,7 +261,7 @@ We always recommend relying on good cascading design over global overrides. To t
261
 
262
  = How do I create cross-browser gradients? =
263
 
264
- The Child Theme Configurator uses a standardized syntax for gradients and only supports two-color gradients without intermediate stops. The inputs consist of origin (e.g., top, left, 135deg, etc.), start color and end color. The browser-specific syntax is generated automatically when you save these values. See Caveats, below, for more information.
265
 
266
  = How do I make my Theme responsive? =
267
 
@@ -287,6 +287,8 @@ https://www.youtube.com/watch?v=iBiiAgsK4G4
287
  7. Files tab
288
 
289
  == Changelog ==
 
 
290
 
291
  = 2.0.3 =
292
  * Added logic conditions in preview class to help prevent Analyzer from failing in some cases
@@ -408,7 +410,7 @@ https://www.youtube.com/watch?v=iBiiAgsK4G4
408
  * New Feature: Better child theme handling for multisite. Moved interface to Themes menu and check for network enabled.
409
  * Fix: Restrict child theme configurator access to install_themes capability
410
  * Fix: Preview links to Themes admin if not network enabled to prevent 'Cheatin, uh?' error.
411
- * Fix: only users with "install_themes" capability have access to the Child Theme Configurator. This resolves permission issues with both multisite and single site installs. **MULTISITE USERS:** The Admin HAS MOVED to Network Admin > Themes > Child Themes for better handling for multisite (network) installs.
412
 
413
  = 1.6.2.1 =
414
  * Fix: Regular expression introduced in version 1.6.2 parses selectors incorrectly.
@@ -597,7 +599,7 @@ https://www.youtube.com/watch?v=iBiiAgsK4G4
597
 
598
  == Query/Selector Tab ==
599
 
600
- There are two ways to identify and customize baseline (parent) styles. The Child Theme Configurator lets you search styles by CSS selector and by property. If you wish to customize a specific CSS selector (e.g., h1), use the "Query/Selector" tab. If you have a specific CSS value you wish to customize site-wide (e.g., the color of the type), use the "Property/Value" tab.
601
 
602
  The Query/Selector tab lets you find specific CSS selectors and edit them. First, find the query that contains the CSS selector you wish to edit by typing in the Query autoselect box. Select by clicking with the mouse or by pressing the "Enter" or "Tab" keys. CSS selectors are in the base query by default.
603
  Next, find the CSS selector by typing in the "Selector" autoselect box. Select by clicking with the mouse or by pressing the "Enter" or "Tab" keys.
@@ -614,7 +616,7 @@ If you wish to add additional properties to a given CSS selector, first load the
614
 
615
  If you wish to add completely new CSS selectors, or even new @media queries, you can enter free-form CSS in the "Raw CSS" textarea. Be aware that your syntax must be correct (i.e., balanced curly braces, etc.) for the parser to load the new custom styles. You will know it is invalid because a red "X" will appear next to the save button.
616
 
617
- If you prefer to use shorthand syntax for properties and values instead of the inputs provided by the Child Theme Configurator, you can enter them here as well. The parser will convert your input into normalized CSS code automatically.
618
 
619
  == Property/Value Tab ==
620
 
@@ -673,10 +675,10 @@ Some themes (particularly commercial themes) do not correctly load parent templa
673
  == Caveats ==
674
 
675
  * Arbitrary comments are not supported. Providing a high level of flexibility for previewing and modifying custom styles requires a sophisticated parsing system. Maintaining comments that bound to any particular element in the stylesheet is prohibitively expensive compared to the value it would add. Although we are working to include this as an option in the future, currently all comments are stripped from the child theme stylesheet code.
676
- * No @keyframes or @font-face rules. The Child Theme Configurator plugin only supports @media and @import. If you need other @rules, put them in a separate stylesheet and import them into the Child Theme stylesheet.
677
- * Only two-color gradients. The Child Theme Configurator plugin is powerful, but we have simplified the gradient interface. You can use any gradient you want as long as it has two colors and no intermediate stops.
678
- * CSS properties are auto-discovered. The Child Theme Configurator plugin loads the properties that exist in the Parent stylesheet. You can always add new properties using the “Raw CSS” text area.
679
- * Legacy gradient syntax is not supported. The Child Theme Configurator plugin does not support the MS filter gradient or legacy webkit gradient. These will continue to work if they are used in the parent theme, but will not be written to the child theme stylesheet. If there is a demand, we may add it in a future release, but most users should have upgraded by now.
680
 
681
  == Documentation ==
682
 
1
  === Child Theme Configurator ===
2
  Contributors: lilaeamedia
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8QE5YJ8WE96AJ
4
+ Tags: child, theme, child theme, child themes, custom styles, customize styles, customize theme, css, responsive, css editor, child theme editor, child theme generator, child theme creator, style, stylesheet, customizer, childtheme, childthemes
5
  Requires at least: 3.9
6
  Tested up to: 4.5.2
7
+ Stable tag: 2.0.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ When using the Customizer is not enough - Create a child theme from your installed themes and customize styles, templates, functions and more.
12
 
13
  == Description ==
14
 
15
+ Child Theme Configurator is a fast and easy to use utility that allows you to analyze any theme for common problems, create a child theme and customize it beyond the options of the Customizer. Designed for WordPress users who want to be able to customize child theme stylesheets directly, Child Theme Configurator lets you easily identify and override the exact CSS attributes you want to customize. The Analyzer scans the rendered theme and automatically configures your child theme. It correctly enqueues theme and font stylesheets for optimum performance and handles vendor-specific syntax, giving you unlimited control over the Child Theme look and feel while leaving your Parent Theme untouched. [Learn more about how to create a child theme](http://www.childthemeconfigurator.com).
16
 
17
  = Take Control of Your Child Themes =
18
 
19
+ Child Theme Configurator parses and indexes your stylesheets so that every CSS media query, selector, property and value are at your fingertips. Second, it shows you how each customization you make will look before you commit it to the child theme. Finally, it saves your work so that you can customize styles in your child themes without the risk of losing your edits.
20
 
21
+ You can create any number of child themes from your existing Parent Themes. Child Theme Configurator lets you choose from your installed themes (even existing child themes) and save the results in your Themes directory.
22
 
23
  When you are ready, just activate the Child Theme and your WordPress site takes on the custom styles automatically.
24
 
25
  https://www.youtube.com/watch?v=xL0YmieF6d0
26
 
27
+ = Why create child themes and customize styles using Child Theme Configurator? =
28
 
29
  1. Some things cannot be changed using the Customizer.
30
 
89
  * Locate "Child Theme Configurator" in the list and click "Install Now."
90
 
91
  2. To install manually:
92
+ * Download the Child Theme Configurator from http://wordpress.org/plugins/child-theme-configurator
93
  * In the WordPress Admin, go to "Plugins > Add New."
94
  * Click the "Upload" link at the top of the page.
95
  * Browse for the zip file, select and click "Install."
202
 
203
  = Where is Child Theme Configurator in the Admin? =
204
 
205
+ For most users Child Theme Configurator can be found under "Tools > Child Themes."
206
 
207
  WordPress Multisite (Network) users go to "Network Admin > Themes > Child Themes."
208
 
209
+ NOTE: Only users with "install_themes" capability will have access to Child Theme Configurator.
210
 
211
  Click the "Help" tab at the top right for a quick reference.
212
 
237
 
238
  = Where are the child theme .php files? =
239
 
240
+ Child Theme Configurator automatically adds a blank functions.php file to the child theme's directory. You can copy parent theme template files using the Files tab. If you want to create new templates and directories you will have to create/upload them manually via FTP or SSH. Remember that a child theme will automatically inherit the parent theme's templates unless they also exist in the child theme's directory. Only copy templates that you intend to customize.
241
 
242
  = How do I customize a specific color/font style/background? =
243
 
253
 
254
  = How do I remove a style from the Child Theme? =
255
 
256
+ Delete the value from the input for the property you wish to remove. Child Theme Configurator only adds overrides for properties that contain values.
257
 
258
  = How do I set the !important flag? =
259
 
261
 
262
  = How do I create cross-browser gradients? =
263
 
264
+ Child Theme Configurator uses a standardized syntax for gradients and only supports two-color gradients without intermediate stops. The inputs consist of origin (e.g., top, left, 135deg, etc.), start color and end color. The browser-specific syntax is generated automatically when you save these values. See Caveats, below, for more information.
265
 
266
  = How do I make my Theme responsive? =
267
 
287
  7. Files tab
288
 
289
  == Changelog ==
290
+ = 2.0.4 =
291
+ * Updated preview class to send origin headers and run customize_preview_init action along with some other actions.
292
 
293
  = 2.0.3 =
294
  * Added logic conditions in preview class to help prevent Analyzer from failing in some cases
410
  * New Feature: Better child theme handling for multisite. Moved interface to Themes menu and check for network enabled.
411
  * Fix: Restrict child theme configurator access to install_themes capability
412
  * Fix: Preview links to Themes admin if not network enabled to prevent 'Cheatin, uh?' error.
413
+ * Fix: only users with "install_themes" capability have access to Child Theme Configurator. This resolves permission issues with both multisite and single site installs. **MULTISITE USERS:** The Admin HAS MOVED to Network Admin > Themes > Child Themes for better handling for multisite (network) installs.
414
 
415
  = 1.6.2.1 =
416
  * Fix: Regular expression introduced in version 1.6.2 parses selectors incorrectly.
599
 
600
  == Query/Selector Tab ==
601
 
602
+ There are two ways to identify and customize baseline (parent) styles. Child Theme Configurator lets you search styles by CSS selector and by property. If you wish to customize a specific CSS selector (e.g., h1), use the "Query/Selector" tab. If you have a specific CSS value you wish to customize site-wide (e.g., the color of the type), use the "Property/Value" tab.
603
 
604
  The Query/Selector tab lets you find specific CSS selectors and edit them. First, find the query that contains the CSS selector you wish to edit by typing in the Query autoselect box. Select by clicking with the mouse or by pressing the "Enter" or "Tab" keys. CSS selectors are in the base query by default.
605
  Next, find the CSS selector by typing in the "Selector" autoselect box. Select by clicking with the mouse or by pressing the "Enter" or "Tab" keys.
616
 
617
  If you wish to add completely new CSS selectors, or even new @media queries, you can enter free-form CSS in the "Raw CSS" textarea. Be aware that your syntax must be correct (i.e., balanced curly braces, etc.) for the parser to load the new custom styles. You will know it is invalid because a red "X" will appear next to the save button.
618
 
619
+ If you prefer to use shorthand syntax for properties and values instead of the inputs provided by Child Theme Configurator, you can enter them here as well. The parser will convert your input into normalized CSS code automatically.
620
 
621
  == Property/Value Tab ==
622
 
675
  == Caveats ==
676
 
677
  * Arbitrary comments are not supported. Providing a high level of flexibility for previewing and modifying custom styles requires a sophisticated parsing system. Maintaining comments that bound to any particular element in the stylesheet is prohibitively expensive compared to the value it would add. Although we are working to include this as an option in the future, currently all comments are stripped from the child theme stylesheet code.
678
+ * No @keyframes or @font-face rules. Child Theme Configurator only supports @media and @import. If you need other @rules, put them in a separate stylesheet and import them into the Child Theme stylesheet.
679
+ * Only two-color gradients. Child Theme Configurator is powerful, but we have simplified the gradient interface. You can use any gradient you want as long as it has two colors and no intermediate stops.
680
+ * CSS properties are auto-discovered. Child Theme Configurator loads the properties that exist in the Parent stylesheet. You can always add new properties using the “Raw CSS” text area.
681
+ * Legacy gradient syntax is not supported. Child Theme Configurator does not support the MS filter gradient or legacy webkit gradient. These will continue to work if they are used in the parent theme, but will not be written to the child theme stylesheet. If there is a demand, we may add it in a future release, but most users should have upgraded by now.
682
 
683
  == Documentation ==
684