Child Theme Configurator - Version 2.2.1

Version Description

  • Fix in javascript affecting Pro users
Download this release

Release Info

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

Code changes from version 2.2.0 to 2.2.1

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.2.0
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com
12
  Text Domain: child-theme-configurator
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.2.1
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com
12
  Text Domain: child-theme-configurator
css/chldthmcfg.css CHANGED
@@ -4,13 +4,8 @@ body {
4
  p {
5
  line-height: 1.4;
6
  }
7
- #ctc_main .clear {
8
  clear: both;
9
- display: unset;
10
- overflow: unset;
11
- visibility: unset;
12
- width: unset;
13
- height: unset;
14
  }
15
  #ctc_main .clearfix:before, #ctc_main .clearfix:after {
16
  content: ' ';
4
  p {
5
  line-height: 1.4;
6
  }
7
+ #ctc_main .ctc-clear {
8
  clear: both;
 
 
 
 
 
9
  }
10
  #ctc_main .clearfix:before, #ctc_main .clearfix:after {
11
  content: ' ';
includes/classes/Admin.php CHANGED
@@ -6,7 +6,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
6
  Class: ChildThemeConfiguratorAdmin
7
  Plugin URI: http://www.childthemeconfigurator.com/
8
  Description: Main Controller Class
9
- Version: 2.2.0
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: child-theme-configurator
6
  Class: ChildThemeConfiguratorAdmin
7
  Plugin URI: http://www.childthemeconfigurator.com/
8
  Description: Main Controller Class
9
+ Version: 2.2.1
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: child-theme-configurator
includes/classes/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.2.0
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
@@ -167,7 +167,7 @@ class ChildThemeConfiguratorCSS {
167
  $this->parnt = '';
168
  $this->ignoreparnt = 0;
169
  $this->qpriority = 10;
170
- $this->version = '2.2.0';
171
 
172
  // do not set enqueue, not being set is used to flag old versions
173
 
6
  Class: ChildThemeConfiguratorCSS
7
  Plugin URI: http://www.childthemeconfigurator.com/
8
  Description: Handles all CSS input, output, parsing, normalization and storage
9
+ Version: 2.2.1
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
167
  $this->parnt = '';
168
  $this->ignoreparnt = 0;
169
  $this->qpriority = 10;
170
+ $this->version = '2.2.1';
171
 
172
  // do not set enqueue, not being set is used to flag old versions
173
 
includes/classes/Core.php CHANGED
@@ -14,7 +14,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
14
  define( 'LILAEAMEDIA_URL', "http://www.lilaeamedia.com" );
15
  defined( 'CHLD_THM_CFG_DOCS_URL' ) or
16
  define( 'CHLD_THM_CFG_DOCS_URL', "http://www.childthemeconfigurator.com" );
17
- define( 'CHLD_THM_CFG_VERSION', '2.2.0' );
18
  define( 'CHLD_THM_CFG_PREV_VERSION', '1.7.9.1' );
19
  define( 'CHLD_THM_CFG_MIN_WP_VERSION', '3.7' );
20
  define( 'CHLD_THM_CFG_PRO_MIN_VERSION', '2.2.0' );
14
  define( 'LILAEAMEDIA_URL', "http://www.lilaeamedia.com" );
15
  defined( 'CHLD_THM_CFG_DOCS_URL' ) or
16
  define( 'CHLD_THM_CFG_DOCS_URL', "http://www.childthemeconfigurator.com" );
17
+ define( 'CHLD_THM_CFG_VERSION', '2.2.1' );
18
  define( 'CHLD_THM_CFG_PREV_VERSION', '1.7.9.1' );
19
  define( 'CHLD_THM_CFG_MIN_WP_VERSION', '3.7' );
20
  define( 'CHLD_THM_CFG_PRO_MIN_VERSION', '2.2.0' );
includes/classes/UI.php CHANGED
@@ -5,7 +5,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
5
  Class: ChildThemeConfiguratorUI
6
  Plugin URI: http://www.childthemeconfigurator.com/
7
  Description: Handles the plugin User Interface
8
- Version: 2.2.0
9
  Author: Lilaea Media
10
  Author URI: http://www.lilaeamedia.com/
11
  Text Domain: chld_thm_cfg
@@ -200,7 +200,7 @@ class ChildThemeConfiguratorUI {
200
  }
201
 
202
  function render_files_tab_options( $output ) {
203
- $regex = '%<div class="ctc\-input\-cell clear">.*?(</form>).*%s';
204
  $output = preg_replace( $regex, "$1", $output );
205
  return $output;
206
  }
5
  Class: ChildThemeConfiguratorUI
6
  Plugin URI: http://www.childthemeconfigurator.com/
7
  Description: Handles the plugin User Interface
8
+ Version: 2.2.1
9
  Author: Lilaea Media
10
  Author URI: http://www.lilaeamedia.com/
11
  Text Domain: chld_thm_cfg
200
  }
201
 
202
  function render_files_tab_options( $output ) {
203
+ $regex = '%<div class="ctc\-input\-cell ctc-clear">.*?(</form>).*%s';
204
  $output = preg_replace( $regex, "$1", $output );
205
  return $output;
206
  }
includes/forms/parent-child.php CHANGED
@@ -37,7 +37,7 @@ if ( !defined( 'ABSPATH' ) )exit;
37
 
38
  <!-- /div -->
39
  <?php if ( '' == $hidechild ): ?>
40
- <!-- div class="ctc-input-cell clear">&nbsp;</div>
41
  <div class="ctc-input-cell-wide" -->
42
  <label>
43
  <input class="ctc-radio ctc-themeonly" id="ctc_child_type_existing" name="ctc_child_type" type="radio" value="existing"
@@ -52,7 +52,7 @@ if ( !defined( 'ABSPATH' ) )exit;
52
 
53
 
54
  <!-- /div>
55
- <div class="ctc-input-cell clear">&nbsp;</div>
56
  <div class="ctc-input-cell-wide" -->
57
  <label>
58
  <input class="ctc-radio ctc-themeonly" id="ctc_child_type_duplicate" name="ctc_child_type" type="radio" value="duplicate" />
@@ -66,7 +66,7 @@ if ( !defined( 'ABSPATH' ) )exit;
66
 
67
 
68
  <!-- /div>
69
- <div class="ctc-input-cell clear">&nbsp;</div>
70
  <div class="ctc-input-cell-wide" -->
71
  <label>
72
  <input class="ctc-radio ctc-themeonly" id="ctc_child_type_reset" name="ctc_child_type" type="radio" value="reset" />
@@ -106,7 +106,7 @@ if ( !defined( 'ABSPATH' ) )exit;
106
  </p>
107
  </span>
108
  </div>
109
- <div class="ctc-input-cell clear">&nbsp;</div>
110
  <div class="ctc-input-cell-wide ctc-analysis" id="parnt_analysis_notice">&nbsp;</div>
111
  </div>
112
  <?php if ( '' == $hidechild ): ?>
@@ -134,7 +134,7 @@ if ( !defined( 'ABSPATH' ) )exit;
134
  </p>
135
  </span>
136
  </div>
137
- <div class="ctc-input-cell clear">&nbsp;</div>
138
  <div class="ctc-input-cell-wide ctc-analysis" id="child_analysis_notice">&nbsp;</div>
139
  </div>
140
  <?php
@@ -180,7 +180,7 @@ if ( !defined( 'ABSPATH' ) )exit;
180
  $this->ctc()->debug( 'handling: ' . $handling . ' ignore: ' . $ignoreparnt . ' enqueue: ' . $enqueue, 'parent-child.php' );
181
  ?>
182
  <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_stylesheet_handling_container" style="display:none">
183
- <div class="ctc-input-cell clear" id="input_row_stylesheet_handling"><span class="ctc-step ctc-step-number">5</span>
184
  <strong class="shift">
185
  <?php _e( 'Select where to save new styles:', 'child-theme-configurator' ); ?>
186
  </strong>
@@ -200,7 +200,7 @@ if ( !defined( 'ABSPATH' ) )exit;
200
 
201
 
202
  </div>
203
- <div class="ctc-input-cell clear">&nbsp;</div>
204
  <div class="ctc-input-cell-wide">
205
  <label>
206
  <input class="ctc_radio ctc-themeonly" id="ctc_handling_separate" name="ctc_handling" type="radio"
@@ -217,7 +217,7 @@ if ( !defined( 'ABSPATH' ) )exit;
217
  </div>
218
  </div>
219
  <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_parent_handling_container" style="display:none">
220
- <div class="ctc-input-cell clear" id="input_row_parent_handling" title="<?php _e( 'Click to expand', 'child-theme-configurator' ); ?>"><span class="ctc-step ctc-step-number">6</span>
221
  <strong class="shift">
222
  <?php _e( 'Select Parent Theme stylesheet handling:', 'child-theme-configurator' ); ?>
223
  </strong>
@@ -265,7 +265,7 @@ if ( !defined( 'ABSPATH' ) )exit;
265
  </label>
266
 
267
  </div>
268
- <div class="ctc-input-cell clear">
269
  <strong style="float:right">
270
  <?php _e( 'Advanced handling options', 'child-theme-configurator' ); ?>:</strong>
271
  <p class="howto">
@@ -278,7 +278,7 @@ if ( !defined( 'ABSPATH' ) )exit;
278
  <p class="howto indent"><?php _e( 'Do not load or parse the parent theme styles. Only use this option if the Child Theme uses a Framework like Genesis and only uses child theme stylesheets for its appearance.', 'child-theme-configurator' ); ?></p></label>
279
  </div>
280
  <div id="ctc_repairheader_container" style="display:none">
281
- <div class="ctc-input-cell clear">
282
  <p class="howto">
283
  </p>
284
  </div>
@@ -290,7 +290,7 @@ if ( !defined( 'ABSPATH' ) )exit;
290
  </div>
291
  </div>
292
  <div id="ctc_dependencies_container" style="display:none">
293
- <div class="ctc-input-cell clear">
294
  <p class="howto">
295
  </p>
296
  </div>
@@ -315,7 +315,7 @@ if ( !defined( 'ABSPATH' ) )exit;
315
  <?php _e( '(Click to toggle form)', 'child-theme-configurator' ); ?>
316
  </span>
317
  </div>
318
- <div class="clear ctc-section-toggle-content" id="ctc_theme_attributes_content">
319
  <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_child_name">
320
  <div class="ctc-input-cell">
321
  <strong>
37
 
38
  <!-- /div -->
39
  <?php if ( '' == $hidechild ): ?>
40
+ <!-- div class="ctc-input-cell ctc-clear">&nbsp;</div>
41
  <div class="ctc-input-cell-wide" -->
42
  <label>
43
  <input class="ctc-radio ctc-themeonly" id="ctc_child_type_existing" name="ctc_child_type" type="radio" value="existing"
52
 
53
 
54
  <!-- /div>
55
+ <div class="ctc-input-cell ctc-clear">&nbsp;</div>
56
  <div class="ctc-input-cell-wide" -->
57
  <label>
58
  <input class="ctc-radio ctc-themeonly" id="ctc_child_type_duplicate" name="ctc_child_type" type="radio" value="duplicate" />
66
 
67
 
68
  <!-- /div>
69
+ <div class="ctc-input-cell ctc-clear">&nbsp;</div>
70
  <div class="ctc-input-cell-wide" -->
71
  <label>
72
  <input class="ctc-radio ctc-themeonly" id="ctc_child_type_reset" name="ctc_child_type" type="radio" value="reset" />
106
  </p>
107
  </span>
108
  </div>
109
+ <div class="ctc-input-cell ctc-clear">&nbsp;</div>
110
  <div class="ctc-input-cell-wide ctc-analysis" id="parnt_analysis_notice">&nbsp;</div>
111
  </div>
112
  <?php if ( '' == $hidechild ): ?>
134
  </p>
135
  </span>
136
  </div>
137
+ <div class="ctc-input-cell ctc-clear">&nbsp;</div>
138
  <div class="ctc-input-cell-wide ctc-analysis" id="child_analysis_notice">&nbsp;</div>
139
  </div>
140
  <?php
180
  $this->ctc()->debug( 'handling: ' . $handling . ' ignore: ' . $ignoreparnt . ' enqueue: ' . $enqueue, 'parent-child.php' );
181
  ?>
182
  <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_stylesheet_handling_container" style="display:none">
183
+ <div class="ctc-input-cell ctc-clear" id="input_row_stylesheet_handling"><span class="ctc-step ctc-step-number">5</span>
184
  <strong class="shift">
185
  <?php _e( 'Select where to save new styles:', 'child-theme-configurator' ); ?>
186
  </strong>
200
 
201
 
202
  </div>
203
+ <div class="ctc-input-cell ctc-clear">&nbsp;</div>
204
  <div class="ctc-input-cell-wide">
205
  <label>
206
  <input class="ctc_radio ctc-themeonly" id="ctc_handling_separate" name="ctc_handling" type="radio"
217
  </div>
218
  </div>
219
  <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_parent_handling_container" style="display:none">
220
+ <div class="ctc-input-cell ctc-clear" id="input_row_parent_handling" title="<?php _e( 'Click to expand', 'child-theme-configurator' ); ?>"><span class="ctc-step ctc-step-number">6</span>
221
  <strong class="shift">
222
  <?php _e( 'Select Parent Theme stylesheet handling:', 'child-theme-configurator' ); ?>
223
  </strong>
265
  </label>
266
 
267
  </div>
268
+ <div class="ctc-input-cell ctc-clear">
269
  <strong style="float:right">
270
  <?php _e( 'Advanced handling options', 'child-theme-configurator' ); ?>:</strong>
271
  <p class="howto">
278
  <p class="howto indent"><?php _e( 'Do not load or parse the parent theme styles. Only use this option if the Child Theme uses a Framework like Genesis and only uses child theme stylesheets for its appearance.', 'child-theme-configurator' ); ?></p></label>
279
  </div>
280
  <div id="ctc_repairheader_container" style="display:none">
281
+ <div class="ctc-input-cell ctc-clear">
282
  <p class="howto">
283
  </p>
284
  </div>
290
  </div>
291
  </div>
292
  <div id="ctc_dependencies_container" style="display:none">
293
+ <div class="ctc-input-cell ctc-clear">
294
  <p class="howto">
295
  </p>
296
  </div>
315
  <?php _e( '(Click to toggle form)', 'child-theme-configurator' ); ?>
316
  </span>
317
  </div>
318
+ <div class="ctc-clear ctc-section-toggle-content" id="ctc_theme_attributes_content">
319
  <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_child_name">
320
  <div class="ctc-input-cell">
321
  <strong>
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.2.0
6
  * Author: Lilaea Media
7
  * Author URI: http://www.lilaeamedia.com/
8
  * License: GPLv2
@@ -604,7 +604,7 @@
604
  if ( !self.is_empty( pval.names ) ) {
605
  $.each( pval.names, function( namendx, newname ) {
606
  newname = ( self.is_empty( newname ) ? '' : newname );
607
- html += '<div class="ctc-child-input-cell clear">';
608
  var id = 'ctc_' + seq + '_child_' + rule + '_' + qsid + '_' + ndx + newname,
609
  newval;
610
  if ( false === ( newval = cval.values.shift() ) ) {
@@ -1729,6 +1729,18 @@
1729
  hide_loading: function() {
1730
  $( '.ctc_analyze_loading' ).fadeTo( 200, 0, function(){ $( this ).slideUp( 200, function() { $( this ).remove(); } ); } );
1731
  },
 
 
 
 
 
 
 
 
 
 
 
 
1732
  /**
1733
  * Fetch website home page and parse <head> for linked stylesheets
1734
  * Use this to store dependencies and to mark them to be parsed as "default" stylesheets
2
  * Script: chldthmcfg.js
3
  * Plugin URI: http://www.childthemeconfigurator.com/
4
  * Description: Handles jQuery, AJAX and other UI
5
+ * Version: 2.2.1
6
  * Author: Lilaea Media
7
  * Author URI: http://www.lilaeamedia.com/
8
  * License: GPLv2
604
  if ( !self.is_empty( pval.names ) ) {
605
  $.each( pval.names, function( namendx, newname ) {
606
  newname = ( self.is_empty( newname ) ? '' : newname );
607
+ html += '<div class="ctc-child-input-cell ctc-clear">';
608
  var id = 'ctc_' + seq + '_child_' + rule + '_' + qsid + '_' + ndx + newname,
609
  newval;
610
  if ( false === ( newval = cval.values.shift() ) ) {
1729
  hide_loading: function() {
1730
  $( '.ctc_analyze_loading' ).fadeTo( 200, 0, function(){ $( this ).slideUp( 200, function() { $( this ).remove(); } ); } );
1731
  },
1732
+ /* these are legacy functions required by Pro 2.2.0 */
1733
+ setssl: function( url ){
1734
+ return url.replace( /^https?/, window.ctcAjax.ssl ? 'https' : 'http' );
1735
+ },
1736
+ escrgx: function( str ) {
1737
+ return str.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
1738
+ },
1739
+ trmcss: function( str ) {
1740
+ //console.log( 'trmcss: ' + str );
1741
+ return 'undefined' === typeof str ? '' : str.replace( /\-css$/, '' );
1742
+ },
1743
+ /* end of legacy functions */
1744
  /**
1745
  * Fetch website home page and parse <head> for linked stylesheets
1746
  * Use this to store dependencies and to mark them to be parsed as "default" stylesheets
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,'"')},getxt:function(e,t){var c=window.ctcAjax[e+"_txt"];return c?(t&&(c=c.replace(/%s/,t)),c):""},getname:function(t){var c="child"===t?e.chldthmcfg.currchild:e.chldthmcfg.currparnt;return window.ctcAjax.themes[t][c].Name},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,a){return e.each(a,function(e,a){return a=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,a=e("input[name=ctc_child_type]:checked").val(),s=[];return"new"===a&&(i=n),t.theme_exists(i,a)&&s.push(t.getxt("theme_exists").toString().replace(/%s/,i)),t.is_empty(i)&&s.push(t.getxt("inval_theme")),s.length?(t.set_notice({error:s}),!1):"reset"===a?!!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=e("#ctc_theme_child").length?e("#ctc_theme_child").val():"",i=""!==n&&e("#ctc_child_type_duplicate").is(":checked")?n:c+"-child",a=i,s=""!==n&&e("#ctc_child_type_duplicate").is(":checked")?e.chldthmcfg.getname("child"):e.chldthmcfg.getname("parnt")+" Child",l="",r="",o="00";t.theme_exists(a,"new");)l=t.is_empty(l)?2:l+1,r=o.substring(0,o.length-l.toString().length)+l.toString(),a=i+r;t.testslug=a,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+)?$/,a=e(t).parents(".ctc-selector-row, .ctc-parent-row").first(),s=a.find(".ctc-swatch").first(),l={parent:{},child:{}},r={parent:{origin:"",start:"",end:""},child:{origin:"",start:"",end:""}},o={child:!1,parent:!1},_={};return a.find(".ctc-parent-value, .ctc-child-value").each(function(){var t,a,s=e(this).attr("id"),d=s.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)),_[s]=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");a=v.toString().match(w),c.is_empty(a)||(a.shift(),l[h][p+"-width"]=a.shift()||"",a.shift(),l[h][p+"-style"]=a.shift()||"",l[h][p+"-color"]=a.shift()||"")}else if("background-image"!==p||v.match(/none/))"seq"!==p&&(l[h][p]=v);else if(v.toString().match(/url\(/))l[h]["background-image"]=c.image_url(h,v);else{var x=new RegExp(c.grad_regx+c.color_regx+c.color_regx,"i");a=v.toString().match(x),!c.is_empty(a)&&a.length>2?(a.shift(),r[h].origin=a.shift()||"top",r[h].start=a.shift()||"transparent",r[h].end=a.shift()||"transparent",o[h]=!0):l[h]["background-image"]=v}else switch(f){case"_border_width":l[h][p+"-width"]="none"===v?0:v;break;case"_border_style":l[h][p+"-style"]=v;break;case"_border_color":l[h][p+"-color"]=v;break;case"_background_url":l[h]["background-image"]=c.image_url(h,v);break;case"_background_color":l[h]["background-color"]=v;break;case"_background_color1":r[h].start=v,o[h]=!0;break;case"_background_color2":r[h].end=v,o[h]=!0;break;case"_background_origin":r[h].origin=v,o[h]=!0}}),"undefined"==typeof s||c.is_empty(s.attr("id"))||(s.removeAttr("style"),o.parent&&s.ctcgrad(r.parent.origin,[r.parent.start,r.parent.end]),s.css(l.parent),s.attr("id").toString().match(/parent/)||(o.child&&s.ctcgrad(r.child.origin,[r.child.start,r.child.end]),s.css(l.child)),s.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 a,s=new RegExp(n.border_regx+"("+n.color_regx+")?","i");c=t.toString().match(s),n.is_empty(c)&&(c=[]),i.names=["_border_width","_border_style","_border_color"],a=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 l,r;c=t.toString().split(/:/),i.values[1]=c.shift()||"",i.values[2]=c.shift()||"",l=c.shift()||"",i.values[3]=c.shift()||"",r=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\(['" ]*(.+?)['" ]*\)/),a=n.is_empty(i)?null:i[1],s=window.ctcAjax.theme_uri+"/"+("parent"===e?window.ctcAjax.parnt:window.ctcAjax.child)+"/";return a?c=a.toString().match(/^(data:|https?:|\/)/)?t:"url("+s+a+")":!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,a={},s=n?c.child.pop():null;return e.each(["parnt","child"],function(t,l){i.is_empty(c[l])||e.each(c[l],function(e,t){n?parseInt(t[2])>=parseInt(s[2])&&(s[2]=parseInt(t[2])+1):(i.is_empty(a[t[2]])&&(a[t[2]]={}),a[t[2]][l]=t)})}),n&&(a[s[2]]={parnt:[],child:s}),a},input_row:function(t,c,n,i,a){var s=this,l="";if(!s.is_empty(i)&&!s.is_empty(i.value)&&!s.is_empty(i.value[c])){var r=i.value[c],o=s.merge_ruleval_arrays(c,r,a);e.each(o,function(a,r){var o=s.decode_value(c,s.is_empty(r.parnt)?"":r.parnt[0]),_=s.is_empty(r.parnt)||s.is_empty(r.parnt[1],1)?0:1,d=s.decode_value(c,s.is_empty(r.child)?"":r.child[0]),u=s.is_empty(r.child)||s.is_empty(r.child[1],1)?0:1;if(l+='<div class="ctc-'+("ovrd"===n?"input":"selector")+'-row clearfix"><div class="ctc-input-cell">',l+="ovrd"===n?c.replace(/\d+/g,s.frascii):i.selector+'<br/><a href="#" class="ctc-selector-edit" id="ctc_selector_edit_'+t+'" >'+s.getxt("edit")+"</a> "+(s.is_empty(o.orig)?s.getxt("child_only"):""),l+='</div><div class="ctc-parent-value ctc-input-cell"'+("ovrd"!==n?' style="display:none"':"")+' id="ctc_'+n+"_parent_"+c+"_"+t+"_"+a+'">'+(s.is_empty(o.orig)?"[no value]":o.orig+(_?s.getxt("important"):""))+'</div><div class="ctc-input-cell">',!s.is_empty(o.names)){e.each(o.names,function(e,i){i=s.is_empty(i)?"":i,l+='<div class="ctc-child-input-cell clear">';var r,o="ctc_"+n+"_child_"+c+"_"+t+"_"+a+i;!1===(r=d.values.shift())&&(r=""),l+=(s.is_empty(i)?"":s.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="'+s.escquo(r)+'" /></div>'});var h="ctc_"+n+"_child_"+c+"_i_"+t+"_"+a;l+='<label for="'+h+'"><input type="checkbox" id="'+h+'" name="'+h+'" value="1" '+(u?"checked":"")+" />"+s.getxt("important")+"</label>"}l+="</div>","ovrd"!==n&&(l+='<div class="ctc-swatch ctc-specific" id="ctc_child_'+c+"_"+t+"_"+a+'_swatch">'+s.getxt("swatch")+'</div><div class="ctc-child-input-cell ctc-button-cell" id="ctc_save_'+c+"_"+t+"_"+a+'_cell"><input type="button" class="button ctc-save-input" id="ctc_save_'+c+"_"+t+"_"+a+'" name="ctc_save_'+c+"_"+t+"_"+a+'" value="Save" /></div>'),l+="</div><!-- end input row -->\n"})}return l},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,a,s=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,s,"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){a||(a=n),e(n).hasClass("color-picker")&&t.setup_spectrum(n)}),a&&e(a).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(c.getname("parnt")),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(c.getname("child")),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(e.chldthmcfg.getname("parnt")),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,a={ctc_query_obj:t,ctc_query_key:c},s="#ctc_status_"+t+("val_qry"===t?"_"+c:"");"object"==typeof n&&e.each(n,function(e,t){a["ctc_query_"+e]=t}),e(".query-icon,.ctc-status-icon").remove(),e(s+" .ctc-status-icon").remove(),e(s).append('<span class="ctc-status-icon spinner is-active query-icon"></span>'),a.action=i.is_empty(e("#ctc_action").val())||"plugin"!==e("#ctc_action").val()?"ctc_query":"ctc_plgqry",a._wpnonce=e("#_wpnonce").val(),i.ajax_post(t,a)},save:function(t){var c,n,i,a,s,l=this,r={},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>'),r.ctc_configtype=e(t).val()):(c=e("#ctc_new_selectors"))&&"ctc_save_new_selectors"===e(t).attr("id")?(r.ctc_new_selectors=c.val(),(n=e("#ctc_sel_ovrd_query_selected"))&&(r.ctc_sel_ovrd_query=n.text()),l.reload=!0):(i=e("#ctc_child_imports"))&&"ctc_save_imports"===o?r.ctc_child_imports=i.val():"ctc_is_debug"===o?r.ctc_is_debug=e("#ctc_is_debug").is(":checked")?1:0:r=l.coalesce_inputs(t),e(".save-icon").addClass("is-active"),e("#ctc_sel_ovrd_selector_selected").find("#ctc_rewrite_selector").each(function(){a=e("#ctc_rewrite_selector").val(),s=e("#ctc_rewrite_selector_orig").val(),l.is_empty(a)||!a.toString().match(/\w/)?a=s:(r.ctc_rewrite_selector=a,l.reload=!0),e(".ctc-rewrite-toggle").text(l.getxt("rename")),e("#ctc_sel_ovrd_selector_selected").html(a)}),r.action=l.is_empty(e("#ctc_action").val())||"plugin"!==e("#ctc_action").val()?"ctc_update":"ctc_plugin",r._wpnonce=e("#_wpnonce").val(),l.ajax_post("qsid",r)},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,a,s=this;s.currqsid=t.key,s.currdata=t.data,e("#ctc_sel_ovrd_qsid").val(s.currqsid),s.is_empty(s.currdata.seq)?e("#ctc_child_load_order_container").empty():(c="ctc_ovrd_child_seq_"+s.currqsid,i=parseInt(s.currdata.seq),n='<input type="text" id="'+c+'" name="'+c+'" class="ctc-child-value" value="'+i+'" />',e("#ctc_child_load_order_container").html(n)),s.is_empty(s.currdata.value)?(a=!0,e("#ctc_sel_ovrd_rule_inputs").empty()):(a=!1,n="",e.each(s.currdata.value,function(e,t){t=null,n+=s.input_row(s.currqsid,e,"ovrd",s.currdata)}),e("#ctc_sel_ovrd_rule_inputs").html(n).find(".color-picker").each(function(){s.setup_spectrum(this)}),s.coalesce_inputs("#ctc_child_all_0_swatch")),s.reload&&(s.load_queries(),s.set_query(s.currdata.query),s.load_rules()),e("#ctc_sel_ovrd_selector_selected").text(s.currdata.selector),e(".ctc-rewrite-toggle").text(s.getxt("rename")),e(".ctc-rewrite-toggle").show(),a?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 a=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+'">'+a.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,a="";i.is_empty(t.data)||e.each(t.data,function(n,s){c=n,e.each(s,function(c,s){a+='<h4 class="ctc-query-heading">'+c+"</h4>\n",i.is_empty(s)||e.each(s,function(e,c){a+=i.input_row(e,n,t.key,c)})})}),n="#ctc_selector_"+c+"_"+t.key+"_rows",e(n).html(a).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_box").val(e("#ctc_debug_box").val()+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>'),a=window.commonL10n.dismiss||"";i.find(".screen-reader-text").text(a),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,a=e(this).attr("id").toString().replace("_close",""),s=a.toString().match(/_([^_]+)_(\d+)$/);e("#"+a+"_container").is(":hidden")&&(t.is_empty(s[1])||t.is_empty(s[2])||(n=s[1],i=s[2],t.query_css("val_qry",i,{rule:n}))),e("#"+a+"_container").fadeToggle("fast"),e(".ctc-selector-container").not("#"+a+"_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(){e(this).is(":checked")?e("#ctc_debug_box").length||e("#ctc_debug_container").html('<textarea id="ctc_debug_box"></textarea>'):e("#ctc_debug_box").remove(),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={show_loading:function(t,c){var n=e.chldthmcfg.existing?"child":"parnt",i=c?c:e.chldthmcfg.getname(n),a='<strong class="ctc_analyze_loading"><span class="spinner is-active"></span>'+e.chldthmcfg.getxt(t?"anlz1":"anlz2")+" "+i+"...</strong>";self.noticediv="",e("#"+n+"_analysis_notice").html(a)},hide_loading:function(){e(".ctc_analyze_loading").fadeTo(200,0,function(){e(this).slideUp(200,function(){e(this).remove()})})},analyze_theme:function(t){var c=this,n=e.chldthmcfg.currparnt,i="child"===t?e.chldthmcfg.currchild:e.chldthmcfg.currparnt;e.ajax({url:window.ctcAjax.ajaxurl,data:{action:"ctc_analyze",stylesheet:i,template:n,_wpnonce:e("#_wpnonce").val()},dataType:"json",type:"POST"}).done(function(n){c.analysis[t]=n,e.each(n.dependencies,function(e,t){c.dependencies[e]=t}),e(document).trigger("analysisdone")}).fail(function(n,i,a){var s={signals:{failure:1,xhrerr:a}};c.analysis[t]=s,e(document).trigger("analysisdone")})},css_notice:function(){var t,c,n=this,i=e.chldthmcfg.existing?"child":"parnt",a=e.chldthmcfg.getname(i),s="",l={notices:[]},r={style:"notice-warning",headline:e.chldthmcfg.getxt("anlz3",a),errlist:""},o=0,_={},d="";if(n.analysis[i].signals.failure||n.analysis[i].signals.thm_noqueue&&!n.phperr[i].length)e("#ctc_is_debug").is(":checked")&&(d=e.chldthmcfg.getxt("anlz33").replace(/%1/,'<a href="'+n.analysis[i].url+'" target="_new">').replace(/%2/,"</a>")),e("#ctc_is_debug").is(":checked")&&(d=e.chldthmcfg.getxt("anlz33").replace(/%1/,'<a href="'+n.analysis[template].url+'" target="_new">').replace(/%2/,"</a>")),l.notices.push({headline:e.chldthmcfg.getxt("anlz4",a),msg:e.chldthmcfg.getxt("anlz5")+d,style:"notice-warning"});else{if(n.analysis[i].errors.length&&(e.each(n.analysis[i].errors,function(t,c){c.match(/Fatal error/i)&&(r.style="error",r.headline=e.chldthmcfg.getxt("anlz8",a)),r.errlist+=c+"\n"}),r.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>'+r.errlist+"</textarea></div></div>"+e.chldthmcfg.getxt("anlz7"),
2
- l.notices.push(r)),(n.analysis[i].signals.thm_past_wphead||n.analysis[i].signals.dep_past_wphead)&&(l.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()),n.analysis[i].signals.thm_unregistered&&(n.analysis[i].signals.ctc_child_loaded||n.analysis[i].signals.ctc_sep_loaded||(l.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"===i&&(n.analysis.child.signals.ctc_parnt_reorder&&(o=1),n.analysis.child.signals.ctc_child_loaded||n.analysis.child.signals.ctc_sep_loaded||n.analysis.child.signals.thm_child_loaded||(l.notices.push({headline:e.chldthmcfg.getxt("anlz13"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz14")}),o=1),n.analysis[i].signals.ctc_gen_loaded&&l.notices.push({headline:e.chldthmcfg.getxt("anlz31"),msg:e.chldthmcfg.getxt("anlz32"),style:"notice-warning"}),n.analysis.parnt.signals.thm_no_styles||n.analysis.child.signals.ctc_gen_loaded||n.analysis.child.signals.thm_parnt_loaded||n.analysis.child.signals.ctc_parnt_loaded||n.analysis.child.signals.thm_ignoreparnt||n.analysis.child.signals.thm_has_import||(l.notices.push({headline:e.chldthmcfg.getxt("anlz15"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz16")}),o=1),n.analysis.child.signals.thm_unregistered&&n.analysis.child.signals.thm_child_loaded&&"thm_unregistered"===n.analysis.child.signals.thm_child_loaded&&n.analysis.child.signals.ctc_child_loaded&&n.analysis.child.signals.ctc_parnt_loaded&&(l.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)),n.analysis.child.signals.thm_is_ctc||e("#ctc_child_type_duplicate").is(":checked")||l.notices.push({headline:e.chldthmcfg.getxt("anlz19"),msg:e.chldthmcfg.getxt("anlz20"),style:"notice-warning"})),(n.analysis[i].signals.ctc_sep_loaded||n.analysis[i].signals.ctc_gen_loaded)&&e("#ctc_handling_separate").prop("checked",!0),l.notices.length||l.notices.push({headline:""+("child"===i?e.chldthmcfg.getxt("anlz17"):e.chldthmcfg.getxt("anlz18")),style:"updated",msg:""}),"child"===i&&n.analysis.child.signals.thm_has_import&&(l.notices.push({headline:e.chldthmcfg.getxt("anlz21"),msg:e.chldthmcfg.getxt("anlz22"),style:"notice-warning"}),e("#ctc_enqueue_import").prop("checked",!0)),n.analysis[i].signals.thm_ignoreparnt||n.analysis[i].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),!n.analysis[i].signals.ctc_sep_loaded&&!n.analysis[i].signals.ctc_gen_loaded&&!n.analysis[i].signals.ctc_child_loaded&&!n.analysis[i].signals.thm_unregistered&&!n.analysis[i].signals.thm_past_wphead&&n.analysis[i].deps[1].length){var u="";e.each(n.analysis[i].deps[1],function(e,t){t[1].match(/^style([\-\.]min)?\.css$/)||(u+="<li>"+t[1]+"</li>\n")}),""!==u&&(u="<ul class='howto' style='padding-left:1em'>\n"+u+"</ul>\n",l.notices.push({headline:e.chldthmcfg.getxt("anlz23"),msg:u+e.chldthmcfg.getxt("anlz24"),style:"updated"}))}"child"===i&&n.analysis[i].signals.thm_parnt_loaded&&(l.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"),n.analysis.parnt.signals.thm_no_styles&&(l.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 s=encodeURIComponent(JSON.stringify(n.analysis)),e('input[name="ctc_analysis"]').val(s),_.ctc_analysis=s,n.is_success()&&o&&!n.resubmitting?(n.resubmitting=1,void n.resubmit(_)):(n.resubmitting=0,n.hide_loading(),e.each(l.notices,function(t,c){var n=e('<div class="'+c.style+' notice is-dismissible dashicons-before" ><h4>'+c.headline+"</h4>"+c.msg+"</div>");e.chldthmcfg.bind_dismiss(n),n.hide().appendTo("#"+i+"_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(n.analysis,null,2)+"</textarea></div></div>",e(t).appendTo("#"+i+"_analysis_notice")),c="",e.each(n.dependencies,function(t,n){n&&(c+='<label><input class="ctc_checkbox ctc-themeonly" id="ctc_forcedep_'+t+'" name="ctc_forcedep[]" type="checkbox" value="'+t+'" autocomplete="off" '+(-1!==e.inArray(t,window.ctcAjax.forcedep)?"checked":"")+" />"+t+"</label><br/>\n")}),c.length?(e("#ctc_dependencies").html(c),e("#ctc_dependencies_container").show()):(e("#ctc_dependencies").empty(),e("#ctc_dependencies_container").hide()),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.dependencies={},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,dependencies:{},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,'"')},getxt:function(e,t){var c=window.ctcAjax[e+"_txt"];return c?(t&&(c=c.replace(/%s/,t)),c):""},getname:function(t){var c="child"===t?e.chldthmcfg.currchild:e.chldthmcfg.currparnt;return window.ctcAjax.themes[t][c].Name},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,a){return e.each(a,function(e,a){return a=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,a=e("input[name=ctc_child_type]:checked").val(),s=[];return"new"===a&&(i=n),t.theme_exists(i,a)&&s.push(t.getxt("theme_exists").toString().replace(/%s/,i)),t.is_empty(i)&&s.push(t.getxt("inval_theme")),s.length?(t.set_notice({error:s}),!1):"reset"===a?!!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=e("#ctc_theme_child").length?e("#ctc_theme_child").val():"",i=""!==n&&e("#ctc_child_type_duplicate").is(":checked")?n:c+"-child",a=i,s=""!==n&&e("#ctc_child_type_duplicate").is(":checked")?e.chldthmcfg.getname("child"):e.chldthmcfg.getname("parnt")+" Child",l="",r="",o="00";t.theme_exists(a,"new");)l=t.is_empty(l)?2:l+1,r=o.substring(0,o.length-l.toString().length)+l.toString(),a=i+r;t.testslug=a,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+)?$/,a=e(t).parents(".ctc-selector-row, .ctc-parent-row").first(),s=a.find(".ctc-swatch").first(),l={parent:{},child:{}},r={parent:{origin:"",start:"",end:""},child:{origin:"",start:"",end:""}},o={child:!1,parent:!1},_={};return a.find(".ctc-parent-value, .ctc-child-value").each(function(){var t,a,s=e(this).attr("id"),d=s.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)),_[s]=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");a=v.toString().match(w),c.is_empty(a)||(a.shift(),l[h][p+"-width"]=a.shift()||"",a.shift(),l[h][p+"-style"]=a.shift()||"",l[h][p+"-color"]=a.shift()||"")}else if("background-image"!==p||v.match(/none/))"seq"!==p&&(l[h][p]=v);else if(v.toString().match(/url\(/))l[h]["background-image"]=c.image_url(h,v);else{var x=new RegExp(c.grad_regx+c.color_regx+c.color_regx,"i");a=v.toString().match(x),!c.is_empty(a)&&a.length>2?(a.shift(),r[h].origin=a.shift()||"top",r[h].start=a.shift()||"transparent",r[h].end=a.shift()||"transparent",o[h]=!0):l[h]["background-image"]=v}else switch(f){case"_border_width":l[h][p+"-width"]="none"===v?0:v;break;case"_border_style":l[h][p+"-style"]=v;break;case"_border_color":l[h][p+"-color"]=v;break;case"_background_url":l[h]["background-image"]=c.image_url(h,v);break;case"_background_color":l[h]["background-color"]=v;break;case"_background_color1":r[h].start=v,o[h]=!0;break;case"_background_color2":r[h].end=v,o[h]=!0;break;case"_background_origin":r[h].origin=v,o[h]=!0}}),"undefined"==typeof s||c.is_empty(s.attr("id"))||(s.removeAttr("style"),o.parent&&s.ctcgrad(r.parent.origin,[r.parent.start,r.parent.end]),s.css(l.parent),s.attr("id").toString().match(/parent/)||(o.child&&s.ctcgrad(r.child.origin,[r.child.start,r.child.end]),s.css(l.child)),s.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 a,s=new RegExp(n.border_regx+"("+n.color_regx+")?","i");c=t.toString().match(s),n.is_empty(c)&&(c=[]),i.names=["_border_width","_border_style","_border_color"],a=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 l,r;c=t.toString().split(/:/),i.values[1]=c.shift()||"",i.values[2]=c.shift()||"",l=c.shift()||"",i.values[3]=c.shift()||"",r=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\(['" ]*(.+?)['" ]*\)/),a=n.is_empty(i)?null:i[1],s=window.ctcAjax.theme_uri+"/"+("parent"===e?window.ctcAjax.parnt:window.ctcAjax.child)+"/";return a?c=a.toString().match(/^(data:|https?:|\/)/)?t:"url("+s+a+")":!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,a={},s=n?c.child.pop():null;return e.each(["parnt","child"],function(t,l){i.is_empty(c[l])||e.each(c[l],function(e,t){n?parseInt(t[2])>=parseInt(s[2])&&(s[2]=parseInt(t[2])+1):(i.is_empty(a[t[2]])&&(a[t[2]]={}),a[t[2]][l]=t)})}),n&&(a[s[2]]={parnt:[],child:s}),a},input_row:function(t,c,n,i,a){var s=this,l="";if(!s.is_empty(i)&&!s.is_empty(i.value)&&!s.is_empty(i.value[c])){var r=i.value[c],o=s.merge_ruleval_arrays(c,r,a);e.each(o,function(a,r){var o=s.decode_value(c,s.is_empty(r.parnt)?"":r.parnt[0]),_=s.is_empty(r.parnt)||s.is_empty(r.parnt[1],1)?0:1,d=s.decode_value(c,s.is_empty(r.child)?"":r.child[0]),u=s.is_empty(r.child)||s.is_empty(r.child[1],1)?0:1;if(l+='<div class="ctc-'+("ovrd"===n?"input":"selector")+'-row clearfix"><div class="ctc-input-cell">',l+="ovrd"===n?c.replace(/\d+/g,s.frascii):i.selector+'<br/><a href="#" class="ctc-selector-edit" id="ctc_selector_edit_'+t+'" >'+s.getxt("edit")+"</a> "+(s.is_empty(o.orig)?s.getxt("child_only"):""),l+='</div><div class="ctc-parent-value ctc-input-cell"'+("ovrd"!==n?' style="display:none"':"")+' id="ctc_'+n+"_parent_"+c+"_"+t+"_"+a+'">'+(s.is_empty(o.orig)?"[no value]":o.orig+(_?s.getxt("important"):""))+'</div><div class="ctc-input-cell">',!s.is_empty(o.names)){e.each(o.names,function(e,i){i=s.is_empty(i)?"":i,l+='<div class="ctc-child-input-cell ctc-clear">';var r,o="ctc_"+n+"_child_"+c+"_"+t+"_"+a+i;!1===(r=d.values.shift())&&(r=""),l+=(s.is_empty(i)?"":s.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="'+s.escquo(r)+'" /></div>'});var h="ctc_"+n+"_child_"+c+"_i_"+t+"_"+a;l+='<label for="'+h+'"><input type="checkbox" id="'+h+'" name="'+h+'" value="1" '+(u?"checked":"")+" />"+s.getxt("important")+"</label>"}l+="</div>","ovrd"!==n&&(l+='<div class="ctc-swatch ctc-specific" id="ctc_child_'+c+"_"+t+"_"+a+'_swatch">'+s.getxt("swatch")+'</div><div class="ctc-child-input-cell ctc-button-cell" id="ctc_save_'+c+"_"+t+"_"+a+'_cell"><input type="button" class="button ctc-save-input" id="ctc_save_'+c+"_"+t+"_"+a+'" name="ctc_save_'+c+"_"+t+"_"+a+'" value="Save" /></div>'),l+="</div><!-- end input row -->\n"})}return l},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,a,s=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,s,"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){a||(a=n),e(n).hasClass("color-picker")&&t.setup_spectrum(n)}),a&&e(a).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(c.getname("parnt")),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(c.getname("child")),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(e.chldthmcfg.getname("parnt")),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,a={ctc_query_obj:t,ctc_query_key:c},s="#ctc_status_"+t+("val_qry"===t?"_"+c:"");"object"==typeof n&&e.each(n,function(e,t){a["ctc_query_"+e]=t}),e(".query-icon,.ctc-status-icon").remove(),e(s+" .ctc-status-icon").remove(),e(s).append('<span class="ctc-status-icon spinner is-active query-icon"></span>'),a.action=i.is_empty(e("#ctc_action").val())||"plugin"!==e("#ctc_action").val()?"ctc_query":"ctc_plgqry",a._wpnonce=e("#_wpnonce").val(),i.ajax_post(t,a)},save:function(t){var c,n,i,a,s,l=this,r={},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>'),r.ctc_configtype=e(t).val()):(c=e("#ctc_new_selectors"))&&"ctc_save_new_selectors"===e(t).attr("id")?(r.ctc_new_selectors=c.val(),(n=e("#ctc_sel_ovrd_query_selected"))&&(r.ctc_sel_ovrd_query=n.text()),l.reload=!0):(i=e("#ctc_child_imports"))&&"ctc_save_imports"===o?r.ctc_child_imports=i.val():"ctc_is_debug"===o?r.ctc_is_debug=e("#ctc_is_debug").is(":checked")?1:0:r=l.coalesce_inputs(t),e(".save-icon").addClass("is-active"),e("#ctc_sel_ovrd_selector_selected").find("#ctc_rewrite_selector").each(function(){a=e("#ctc_rewrite_selector").val(),s=e("#ctc_rewrite_selector_orig").val(),l.is_empty(a)||!a.toString().match(/\w/)?a=s:(r.ctc_rewrite_selector=a,l.reload=!0),e(".ctc-rewrite-toggle").text(l.getxt("rename")),e("#ctc_sel_ovrd_selector_selected").html(a)}),r.action=l.is_empty(e("#ctc_action").val())||"plugin"!==e("#ctc_action").val()?"ctc_update":"ctc_plugin",r._wpnonce=e("#_wpnonce").val(),l.ajax_post("qsid",r)},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,a,s=this;s.currqsid=t.key,s.currdata=t.data,e("#ctc_sel_ovrd_qsid").val(s.currqsid),s.is_empty(s.currdata.seq)?e("#ctc_child_load_order_container").empty():(c="ctc_ovrd_child_seq_"+s.currqsid,i=parseInt(s.currdata.seq),n='<input type="text" id="'+c+'" name="'+c+'" class="ctc-child-value" value="'+i+'" />',e("#ctc_child_load_order_container").html(n)),s.is_empty(s.currdata.value)?(a=!0,e("#ctc_sel_ovrd_rule_inputs").empty()):(a=!1,n="",e.each(s.currdata.value,function(e,t){t=null,n+=s.input_row(s.currqsid,e,"ovrd",s.currdata)}),e("#ctc_sel_ovrd_rule_inputs").html(n).find(".color-picker").each(function(){s.setup_spectrum(this)}),s.coalesce_inputs("#ctc_child_all_0_swatch")),s.reload&&(s.load_queries(),s.set_query(s.currdata.query),s.load_rules()),e("#ctc_sel_ovrd_selector_selected").text(s.currdata.selector),e(".ctc-rewrite-toggle").text(s.getxt("rename")),e(".ctc-rewrite-toggle").show(),a?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 a=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+'">'+a.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,a="";i.is_empty(t.data)||e.each(t.data,function(n,s){c=n,e.each(s,function(c,s){a+='<h4 class="ctc-query-heading">'+c+"</h4>\n",i.is_empty(s)||e.each(s,function(e,c){a+=i.input_row(e,n,t.key,c)})})}),n="#ctc_selector_"+c+"_"+t.key+"_rows",e(n).html(a).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_box").val(e("#ctc_debug_box").val()+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>'),a=window.commonL10n.dismiss||"";i.find(".screen-reader-text").text(a),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,a=e(this).attr("id").toString().replace("_close",""),s=a.toString().match(/_([^_]+)_(\d+)$/);e("#"+a+"_container").is(":hidden")&&(t.is_empty(s[1])||t.is_empty(s[2])||(n=s[1],i=s[2],t.query_css("val_qry",i,{rule:n}))),e("#"+a+"_container").fadeToggle("fast"),e(".ctc-selector-container").not("#"+a+"_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(){e(this).is(":checked")?e("#ctc_debug_box").length||e("#ctc_debug_container").html('<textarea id="ctc_debug_box"></textarea>'):e("#ctc_debug_box").remove(),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={show_loading:function(t,c){var n=e.chldthmcfg.existing?"child":"parnt",i=c?c:e.chldthmcfg.getname(n),a='<strong class="ctc_analyze_loading"><span class="spinner is-active"></span>'+e.chldthmcfg.getxt(t?"anlz1":"anlz2")+" "+i+"...</strong>";self.noticediv="",e("#"+n+"_analysis_notice").html(a)},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")},escrgx:function(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},trmcss:function(e){return"undefined"==typeof e?"":e.replace(/\-css$/,"")},analyze_theme:function(t){var c=this,n=e.chldthmcfg.currparnt,i="child"===t?e.chldthmcfg.currchild:e.chldthmcfg.currparnt;e.ajax({url:window.ctcAjax.ajaxurl,data:{action:"ctc_analyze",stylesheet:i,template:n,_wpnonce:e("#_wpnonce").val()},dataType:"json",type:"POST"}).done(function(n){c.analysis[t]=n,e.each(n.dependencies,function(e,t){c.dependencies[e]=t}),e(document).trigger("analysisdone")}).fail(function(n,i,a){var s={signals:{failure:1,xhrerr:a}};c.analysis[t]=s,e(document).trigger("analysisdone")})},css_notice:function(){var t,c,n=this,i=e.chldthmcfg.existing?"child":"parnt",a=e.chldthmcfg.getname(i),s="",l={notices:[]},r={style:"notice-warning",headline:e.chldthmcfg.getxt("anlz3",a),errlist:""},o=0,_={},d="";if(n.analysis[i].signals.failure||n.analysis[i].signals.thm_noqueue&&!n.phperr[i].length)e("#ctc_is_debug").is(":checked")&&(d=e.chldthmcfg.getxt("anlz33").replace(/%1/,'<a href="'+n.analysis[i].url+'" target="_new">').replace(/%2/,"</a>")),e("#ctc_is_debug").is(":checked")&&(d=e.chldthmcfg.getxt("anlz33").replace(/%1/,'<a href="'+n.analysis[template].url+'" target="_new">').replace(/%2/,"</a>")),l.notices.push({headline:e.chldthmcfg.getxt("anlz4",a),msg:e.chldthmcfg.getxt("anlz5")+d,style:"notice-warning"
2
+ });else{if(n.analysis[i].errors.length&&(e.each(n.analysis[i].errors,function(t,c){c.match(/Fatal error/i)&&(r.style="error",r.headline=e.chldthmcfg.getxt("anlz8",a)),r.errlist+=c+"\n"}),r.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>'+r.errlist+"</textarea></div></div>"+e.chldthmcfg.getxt("anlz7"),l.notices.push(r)),(n.analysis[i].signals.thm_past_wphead||n.analysis[i].signals.dep_past_wphead)&&(l.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()),n.analysis[i].signals.thm_unregistered&&(n.analysis[i].signals.ctc_child_loaded||n.analysis[i].signals.ctc_sep_loaded||(l.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"===i&&(n.analysis.child.signals.ctc_parnt_reorder&&(o=1),n.analysis.child.signals.ctc_child_loaded||n.analysis.child.signals.ctc_sep_loaded||n.analysis.child.signals.thm_child_loaded||(l.notices.push({headline:e.chldthmcfg.getxt("anlz13"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz14")}),o=1),n.analysis[i].signals.ctc_gen_loaded&&l.notices.push({headline:e.chldthmcfg.getxt("anlz31"),msg:e.chldthmcfg.getxt("anlz32"),style:"notice-warning"}),n.analysis.parnt.signals.thm_no_styles||n.analysis.child.signals.ctc_gen_loaded||n.analysis.child.signals.thm_parnt_loaded||n.analysis.child.signals.ctc_parnt_loaded||n.analysis.child.signals.thm_ignoreparnt||n.analysis.child.signals.thm_has_import||(l.notices.push({headline:e.chldthmcfg.getxt("anlz15"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz16")}),o=1),n.analysis.child.signals.thm_unregistered&&n.analysis.child.signals.thm_child_loaded&&"thm_unregistered"===n.analysis.child.signals.thm_child_loaded&&n.analysis.child.signals.ctc_child_loaded&&n.analysis.child.signals.ctc_parnt_loaded&&(l.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)),n.analysis.child.signals.thm_is_ctc||e("#ctc_child_type_duplicate").is(":checked")||l.notices.push({headline:e.chldthmcfg.getxt("anlz19"),msg:e.chldthmcfg.getxt("anlz20"),style:"notice-warning"})),(n.analysis[i].signals.ctc_sep_loaded||n.analysis[i].signals.ctc_gen_loaded)&&e("#ctc_handling_separate").prop("checked",!0),l.notices.length||l.notices.push({headline:""+("child"===i?e.chldthmcfg.getxt("anlz17"):e.chldthmcfg.getxt("anlz18")),style:"updated",msg:""}),"child"===i&&n.analysis.child.signals.thm_has_import&&(l.notices.push({headline:e.chldthmcfg.getxt("anlz21"),msg:e.chldthmcfg.getxt("anlz22"),style:"notice-warning"}),e("#ctc_enqueue_import").prop("checked",!0)),n.analysis[i].signals.thm_ignoreparnt||n.analysis[i].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),!n.analysis[i].signals.ctc_sep_loaded&&!n.analysis[i].signals.ctc_gen_loaded&&!n.analysis[i].signals.ctc_child_loaded&&!n.analysis[i].signals.thm_unregistered&&!n.analysis[i].signals.thm_past_wphead&&n.analysis[i].deps[1].length){var u="";e.each(n.analysis[i].deps[1],function(e,t){t[1].match(/^style([\-\.]min)?\.css$/)||(u+="<li>"+t[1]+"</li>\n")}),""!==u&&(u="<ul class='howto' style='padding-left:1em'>\n"+u+"</ul>\n",l.notices.push({headline:e.chldthmcfg.getxt("anlz23"),msg:u+e.chldthmcfg.getxt("anlz24"),style:"updated"}))}"child"===i&&n.analysis[i].signals.thm_parnt_loaded&&(l.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"),n.analysis.parnt.signals.thm_no_styles&&(l.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 s=encodeURIComponent(JSON.stringify(n.analysis)),e('input[name="ctc_analysis"]').val(s),_.ctc_analysis=s,n.is_success()&&o&&!n.resubmitting?(n.resubmitting=1,void n.resubmit(_)):(n.resubmitting=0,n.hide_loading(),e.each(l.notices,function(t,c){var n=e('<div class="'+c.style+' notice is-dismissible dashicons-before" ><h4>'+c.headline+"</h4>"+c.msg+"</div>");e.chldthmcfg.bind_dismiss(n),n.hide().appendTo("#"+i+"_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(n.analysis,null,2)+"</textarea></div></div>",e(t).appendTo("#"+i+"_analysis_notice")),c="",e.each(n.dependencies,function(t,n){n&&(c+='<label><input class="ctc_checkbox ctc-themeonly" id="ctc_forcedep_'+t+'" name="ctc_forcedep[]" type="checkbox" value="'+t+'" autocomplete="off" '+(-1!==e.inArray(t,window.ctcAjax.forcedep)?"checked":"")+" />"+t+"</label><br/>\n")}),c.length?(e("#ctc_dependencies").html(c),e("#ctc_dependencies_container").show()):(e("#ctc_dependencies").empty(),e("#ctc_dependencies_container").hide()),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.dependencies={},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,dependencies:{},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
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
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: 4.0
6
  Tested up to: 4.7
7
- Stable tag: 2.2.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -287,6 +287,9 @@ https://www.youtube.com/watch?v=iBiiAgsK4G4
287
  7. Files tab
288
 
289
  == Changelog ==
 
 
 
290
  = 2.2.0 =
291
  * Cross domain Parse error
292
  * Showing "reconfigure" message on new install
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: 4.0
6
  Tested up to: 4.7
7
+ Stable tag: 2.2.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
287
  7. Files tab
288
 
289
  == Changelog ==
290
+ = 2.2.1 =
291
+ * Fix in javascript affecting Pro users
292
+
293
  = 2.2.0 =
294
  * Cross domain Parse error
295
  * Showing "reconfigure" message on new install