Child Theme Configurator - Version 1.1.3

Version Description

  • Fixed bug that assumed lowercase only for theme slugs. (Thanks to timk)
  • Fixed update redirect to execute on first run
Download this release

Release Info

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

Code changes from version 1.1.2 to 1.1.3

child-theme-configurator.php CHANGED
@@ -6,7 +6,7 @@ if ( !defined('ABSPATH')) exit;
6
  Plugin Name: Child Theme Configurator
7
  Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
8
  Description: Create Child Theme from any Theme or Stylesheet
9
- Version: 1.1.2
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
6
  Plugin Name: Child Theme Configurator
7
  Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
8
  Description: Create Child Theme from any Theme or Stylesheet
9
+ Version: 1.1.3
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
includes/class-ctc-css.php CHANGED
@@ -6,7 +6,7 @@ if ( !defined('ABSPATH')) exit;
6
  Class: Child_Theme_Configurator_CSS
7
  Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
8
  Description: Handles all CSS output, parsing, normalization
9
- Version: 1.1.2
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
@@ -42,7 +42,7 @@ class Child_Theme_Configurator_CSS {
42
 
43
  function __construct() {
44
  // scalars
45
- $this->version = '1.1.2';
46
  $this->querykey = 0;
47
  $this->selkey = 0;
48
  $this->qskey = 0;
@@ -422,6 +422,7 @@ class Child_Theme_Configurator_CSS {
422
  endforeach;
423
  endforeach;
424
  endforeach;
 
425
  }
426
 
427
  /*
6
  Class: Child_Theme_Configurator_CSS
7
  Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
8
  Description: Handles all CSS output, parsing, normalization
9
+ Version: 1.1.3
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
42
 
43
  function __construct() {
44
  // scalars
45
+ $this->version = '1.1.3';
46
  $this->querykey = 0;
47
  $this->selkey = 0;
48
  $this->qskey = 0;
422
  endforeach;
423
  endforeach;
424
  endforeach;
425
+
426
  }
427
 
428
  /*
includes/class-ctc-ui.php CHANGED
@@ -5,7 +5,7 @@ if ( !defined('ABSPATH')) exit;
5
  Class: Child_Theme_Configurator_UI
6
  Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
7
  Description: Handles the plugin User Interface
8
- Version: 1.1.2
9
  Author: Lilaea Media
10
  Author URI: http://www.lilaeamedia.com/
11
  Text Domain: chld_thm_cfg
5
  Class: Child_Theme_Configurator_UI
6
  Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
7
  Description: Handles the plugin User Interface
8
+ Version: 1.1.3
9
  Author: Lilaea Media
10
  Author URI: http://www.lilaeamedia.com/
11
  Text Domain: chld_thm_cfg
includes/class-ctc.php CHANGED
@@ -6,7 +6,7 @@ if ( !defined('ABSPATH')) exit;
6
  Class: Child_Theme_Configurator
7
  Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
8
  Description: Main Controller Class
9
- Version: 1.1.2
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
@@ -18,7 +18,7 @@ require_once('class-ctc-ui.php');
18
  require_once('class-ctc-css.php');
19
  class Child_Theme_Configurator {
20
 
21
- var $version = '1.1.2';
22
  var $css;
23
  var $optionsName;
24
  var $menuName;
@@ -50,7 +50,7 @@ class Child_Theme_Configurator {
50
  add_action('admin_enqueue_scripts', array(&$this, 'enqueue_scripts'));
51
  add_action('wp_ajax_ctc_update', array(&$this, 'ajax_save_postdata' ));
52
  add_action('wp_ajax_ctc_query', array(&$this, 'ajax_query_css' ));
53
- add_action('update_option_' . $this->optionsName, array(&$this, 'update_redirect'), 10);
54
  }
55
 
56
  function admin_menu() {
@@ -65,7 +65,7 @@ class Child_Theme_Configurator {
65
  wp_enqueue_style('chld-thm-cfg-admin', $this->pluginURL . 'css/chld-thm-cfg.css');
66
  wp_enqueue_script('iris');
67
  wp_enqueue_script('ctc-thm-cfg-ctcgrad', $this->pluginURL . 'js/ctcgrad.min.js', array('iris'), '1.0');
68
- wp_enqueue_script('chld-thm-cfg-admin', $this->pluginURL . 'js/chld-thm-cfg.js', //'js/chld-thm-cfg.js',
69
  array('jquery-ui-autocomplete'), '1.0', true);
70
  wp_localize_script( 'chld-thm-cfg-admin', 'ctcAjax',
71
  apply_filters('ctc_localize_script', array(
@@ -231,6 +231,7 @@ class Child_Theme_Configurator {
231
  $this->css->parse_css_file('child');
232
  $this->css->write_css(true); // backup current stylesheet
233
  update_option($this->optionsName, $this->css);
 
234
  endif;
235
  }
236
 
@@ -244,7 +245,7 @@ class Child_Theme_Configurator {
244
  }
245
 
246
  function check_theme_exists($theme) {
247
- return in_array(strtolower($theme), array_keys(wp_get_themes()));
248
  }
249
 
250
  function sanitize_options($input) {
6
  Class: Child_Theme_Configurator
7
  Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
8
  Description: Main Controller Class
9
+ Version: 1.1.3
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
18
  require_once('class-ctc-css.php');
19
  class Child_Theme_Configurator {
20
 
21
+ var $version = '1.1.3';
22
  var $css;
23
  var $optionsName;
24
  var $menuName;
50
  add_action('admin_enqueue_scripts', array(&$this, 'enqueue_scripts'));
51
  add_action('wp_ajax_ctc_update', array(&$this, 'ajax_save_postdata' ));
52
  add_action('wp_ajax_ctc_query', array(&$this, 'ajax_query_css' ));
53
+ //add_action('update_option_' . $this->optionsName, array(&$this, 'update_redirect'), 10);
54
  }
55
 
56
  function admin_menu() {
65
  wp_enqueue_style('chld-thm-cfg-admin', $this->pluginURL . 'css/chld-thm-cfg.css');
66
  wp_enqueue_script('iris');
67
  wp_enqueue_script('ctc-thm-cfg-ctcgrad', $this->pluginURL . 'js/ctcgrad.min.js', array('iris'), '1.0');
68
+ wp_enqueue_script('chld-thm-cfg-admin', $this->pluginURL . 'js/chld-thm-cfg.min.js', //'js/chld-thm-cfg.js',
69
  array('jquery-ui-autocomplete'), '1.0', true);
70
  wp_localize_script( 'chld-thm-cfg-admin', 'ctcAjax',
71
  apply_filters('ctc_localize_script', array(
231
  $this->css->parse_css_file('child');
232
  $this->css->write_css(true); // backup current stylesheet
233
  update_option($this->optionsName, $this->css);
234
+ $this->update_redirect();
235
  endif;
236
  }
237
 
245
  }
246
 
247
  function check_theme_exists($theme) {
248
+ return in_array($theme, array_keys(wp_get_themes()));
249
  }
250
 
251
  function sanitize_options($input) {
js/chld-thm-cfg.js CHANGED
@@ -2,7 +2,7 @@
2
  * Script: chld-thm-cfg.js
3
  * Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
4
  * Description: Handles jQuery, AJAX and other UI
5
- * Version: 1.1.2
6
  * Author: Lilaea Media
7
  * Author URI: http://www.lilaeamedia.com/
8
  * License: GPLv2
@@ -499,12 +499,12 @@ jQuery(document).ready(function($){
499
  $('.ctc-status-icon').addClass('success');
500
  $('#ctc_new_selectors').val('');
501
  // update data objects
502
- ////ctc_update_cache(response);
503
- ////ctc_setup_menus();
504
  }
505
  return false;
506
- }/*,
507
- 'json'*/
508
  ).fail(function(){
509
  // release button
510
  $(obj).prop('disabled', false);
@@ -788,7 +788,7 @@ jQuery(document).ready(function($){
788
  }
789
  },
790
  fade_update_notice = function() {
791
- $('.updated').fadeOut('slow', function(){ $('.updated').remove(); });
792
  },
793
  // initialize vars
794
  // ajax semaphores: 0 = reload, 1 = loading, 2 = loaded
2
  * Script: chld-thm-cfg.js
3
  * Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
4
  * Description: Handles jQuery, AJAX and other UI
5
+ * Version: 1.1.3
6
  * Author: Lilaea Media
7
  * Author URI: http://www.lilaeamedia.com/
8
  * License: GPLv2
499
  $('.ctc-status-icon').addClass('success');
500
  $('#ctc_new_selectors').val('');
501
  // update data objects
502
+ ctc_update_cache(response);
503
+ ctc_setup_menus();
504
  }
505
  return false;
506
+ },
507
+ 'json'
508
  ).fail(function(){
509
  // release button
510
  $(obj).prop('disabled', false);
788
  }
789
  },
790
  fade_update_notice = function() {
791
+ $('.updated').slideUp('slow', function(){ $('.updated').remove(); });
792
  },
793
  // initialize vars
794
  // ajax semaphores: 0 = reload, 1 = loading, 2 = loaded
js/chld-thm-cfg.min.js CHANGED
@@ -2,10 +2,10 @@
2
  * Script: chld-thm-cfg.js
3
  * Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
4
  * Description: Handles jQuery, AJAX and other UI
5
- * Version: 1.1.2
6
  * Author: Lilaea Media
7
  * Author URI: http://www.lilaeamedia.com/
8
  * License: GPLv2
9
  * Copyright (C) 2013 Lilaea Media
10
  */
11
- ;jQuery(document).ready(function(g){var n="\n",k="",a,m={},o=function(p){g(p).iris({change:function(){j(p)}})},j=function(v){var r=/^(ctc_(ovrd_)?(parent|child)_([a-z\-]+)_(\d+))(_\w+)?$/,w=g(v).parents(".ctc-selector-row, .ctc-parent-row").first(),u=w.find(".ctc-swatch").first(),t={parent:{},child:{}},s={parent:{origin:"",start:"",end:""},child:{origin:"",start:"",end:""}},q={child:false,parent:false},p={};w.find(".ctc-parent-value, .ctc-child-value").each(function(){var D=g(this).attr("id"),x=D.toString().match(r),y=x[3],F=("undefined"==typeof x[4]?"":x[4]),C=x[5],B=("undefined"==typeof x[6]?"":x[6]),E=("parent"==y?g(this).text():g(this).val()),A,z;if("child"==y){p[D]=E}if(""===E){return}if(false===b(B)){switch(B){case"_border_width":t[y][F+"-width"]=E;break;case"_border_style":t[y][F+"-style"]=E;break;case"_border_color":t[y][F+"-color"]=E;break;case"_background_url":t[y]["background-image"]=d(y,E);break;case"_background_color":t[y]["background-color"]=v.value;break;case"_background_color1":s[y].start=E;q[y]=true;break;case"_background_color2":s[y].end=E;q[y]=true;break;case"_background_origin":s[y].origin=E;q[y]=true;break}}else{if(A=F.toString().match(/^border(\-(top|right|bottom|left))?$/)&&!E.match(/none/)){z=E.toString().split(/ +/);t[y][F+"-width"]="undefined"==typeof z[0]?"":z[0];t[y][F+"-style"]="undefined"==typeof z[1]?"":z[1];t[y][F+"-color"]="undefined"==typeof z[2]?"":z[2]}else{if("background-image"==F){if(E.toString().match(/url\(/)){t[y]["background-image"]=d(y,E)}else{z=E.toString().split(/ +/);if(z.length>2){s[y].origin="undefined"==typeof z[0]?"top":z[0];s[y].start="undefined"==typeof z[1]?"transparent":z[1];s[y].end="undefined"==typeof z[2]?"transparent":z[2];q[y]=true}else{t[y]["background-image"]=E}}}else{t[y][F]=E}}}});if("undefined"!=typeof u){g(u).removeAttr("style");if(q.parent){g(u).ctcgrad(s.parent.origin,[s.parent.start,s.parent.end])}g(u).css(t.parent);if(!(u.attr("id").toString().match(/parent/))){if(q.child){g(u).ctcgrad(s.child.origin,[s.child.start,s.child.end])}g(u).css(t.child)}}return p},c=function(r){var q,s,p;g(r).each(function(){switch(this.obj){case"imports":ctcAjax.imports=this.data;break;case"rule_val":ctcAjax.rule_val[this.key]=this.data;currRuleId=this.key;break;case"val_qry":ctcAjax.val_qry[this.key]=this.data;break;case"rule":ctcAjax.rule=this.data;break;case"sel_ndx":if(b(this.key)){ctcAjax.sel_ndx=this.data}else{if("qsid"==this.key){ctcAjax.sel_ndx[this.data.query][this.data.selector]=this.data.qsid}else{ctcAjax.sel_ndx[this.key]=this.data;q=this.key}}break;case"sel_val":ctcAjax.sel_val[this.key]=this.data;s=this.key;break}})},d=function(t,q){var s=q.toString().match(/url\([" ]*(.+?)[" ]*\)/),r=("undefined"==typeof s?null:s[1]),p=ctcAjax.theme_uri+"/"+("parent"==t?ctcAjax.parnt:ctcAjax.child)+"/",u;if(!r){return false}else{if(r.toString().match(/^(http:|\/)/)){u=q}else{u="url("+p+r+")"}}return u},b=function(q){if("undefined"==typeof q||false===q||null===q||""===q){return true}if(true===q||"string"===typeof q||"number"===typeof q){return false}if("object"===typeof q){for(var p in q){if(q.hasOwnProperty(p)){return false}}return true}return false},i=function(){var p=[];if(1===loading.sel_ndx){return p}if(0===loading.sel_ndx){loading.sel_ndx=1;ctc_query_css("sel_ndx",null,ctc_setup_query_menu);return p}if(false===b(ctcAjax.sel_ndx)){g.each(ctcAjax.sel_ndx,function(q,r){var s={label:q,value:q};p.push(s)})}return p},f=function(q){var p=[];if(1===loading.sel_ndx){return p}if(0===loading.sel_ndx){loading.sel_ndx=1;ctc_query_css("sel_ndx",q,ctc_setup_selector_menu);return p}if(false===b(ctcAjax.sel_ndx[q])){g.each(ctcAjax.sel_ndx[q],function(r,s){var t={label:r,value:s};p.push(t)})}return p},l=function(){var p=[];if(1===loading.rule){return p}if(0===loading.rule){loading.rule=1;ctc_query_css("rule",null,ctc_setup_rule_menu);return p}if(false===b(ctcAjax.rule)){g.each(ctcAjax.rule,function(q,r){var s={label:r,value:q};p.push(s)})}return p.sort(function(r,q){if(r.label>q.label){return 1}if(r.label<q.label){return -1}return 0})},h=function(r,v,q){var s="",u=(b(ctcAjax.sel_val[r])||b(ctcAjax.sel_val[r].value)||b(ctcAjax.sel_val[r].value[v])?"":ctcAjax.sel_val[r].value[v]),t=ctc_decode_value(v,("undefined"==typeof u?"":u.parnt)),p=ctc_decode_value(v,("undefined"==typeof u?"":u.child));if(false===b(ctcAjax.sel_val[r])){s+='<div class="ctc-'+(q?"selector":"input")+'-row clearfix">'+n;s+='<div class="ctc-input-cell">'+(q?ctcAjax.sel_val[r].selector+(b(t.orig)?"<br/>"+ctcAjax.child_only_txt:""):v)+"</div>"+n;if(!q){s+='<div class="ctc-parent-value ctc-input-cell" id="ctc_parent_'+v+"_"+r+'">'+(b(t.orig)?"[no value]":t.orig)+"</div>"+n}s+='<div class="ctc-input-cell">'+n;if(false===b(t.names)){g.each(t.names,function(w,x){x=(b(x)?"":x);s+='<div class="ctc-child-input-cell">'+n;var z="ctc_"+(q?"":"ovrd_")+"child_"+v+"_"+r+x,y;if(false===(y=p.values.shift())){y=""}s+=(b(x)?"":ctcAjax.field_labels[x]+":<br/>")+'<input type="text" id="'+z+'" name="'+z+'" class="ctc-child-value'+((x+v).toString().match(/color/)?" color-picker":"")+((x).toString().match(/url/)?" ctc-input-wide":"")+'" value="'+y+'" />'+n;s+="</div>"+n})}s+="</div>"+n;s+=(q?'<div class="ctc-swatch ctc-specific" id="ctc_child_'+v+"_"+r+'_swatch">'+ctcAjax.swatch_txt+"</div>"+n+'<div class="ctc-child-input-cell ctc-button-cell" id="ctc_save_'+v+"_"+r+'_cell">'+n+'<input type="button" class="button ctc-save-input" id="ctc_save_'+v+"_"+r+'" name="ctc_save_'+v+"_"+r+'" value="Save" /></div>'+n:"");s+="</div><!-- end input row -->"+n}return s},e=function(p){if(1===loading.sel_val){return false}if(0==loading.sel_val){loading.sel_val=1;ctc_query_css("sel_val",p,e);return false}var q="";if(false===b(ctcAjax.sel_val[p]&&false===b(ctcAjax.sel_val[p].value))){g.each(ctcAjax.sel_val[p].value,function(s,r){q+=h(p,s,false)})}g("#ctc_sel_ovrd_rule_inputs").html(q).find(".color-picker").each(function(){o(this)});j("#ctc_child_all_0_swatch")};ctc_render_rule_value_inputs=function(q){if(1===loading.rule_val){return false}if(0==loading.rule_val){loading.rule_val=1;ctc_query_css("rule_val",q,ctc_render_rule_value_inputs);return false}var r=ctcAjax.rule[q],p='<div class="ctc-input-row clearfix" id="ctc_rule_row_'+r+'">'+n;if(false===b(ctcAjax.rule_val[q])){g.each(ctcAjax.rule_val[q],function(t,u){var s=ctc_decode_value(r,u);p+='<div class="ctc-parent-row clearfix" id="ctc_rule_row_'+r+"_"+t+'">'+n;p+='<div class="ctc-input-cell ctc-parent-value" id="ctc_parent_'+r+"_"+t+'">'+s.orig+"</div>"+n;p+='<div class="ctc-input-cell">'+n;p+='<div class="ctc-swatch ctc-specific" id="ctc_parent_'+r+"_"+t+'_swatch">'+ctcAjax.swatch_txt+"</div></div>"+n;p+='<div class="ctc-input-cell"><a href="#" class="ctc-selector-handle" id="ctc_selector_'+r+"_"+t+'">'+ctcAjax.selector_txt+"</a></div>"+n;p+='<div id="ctc_selector_'+r+"_"+t+'_container" class="ctc-selector-container clearfix">'+n;p+='<a href="#" id="ctc_selector_'+r+"_"+t+'_close" class="ctc-selector-handle" style="float:right">'+ctcAjax.close_txt+'</a><div id="ctc_status_val_qry_'+t+'"></div>'+n;p+='<div id="ctc_selector_'+r+"_"+t+'_rows"></div>'+n;p+="</div></div>"+n});p+="</div>"+n}g("#ctc_rule_value_inputs").html(p).find(".ctc-swatch").each(function(){j(this)})},ctc_render_selector_value_inputs=function(s){if(1==loading.val_qry){return false}var u,q,t=g("#ctc_rule_menu_selected").text(),p,r="";if(0===loading.val_qry){loading.val_qry=1;u={rule:t};ctc_query_css("val_qry",s,ctc_render_selector_value_inputs,u);return false}if(false===b(ctcAjax.val_qry[s])){g.each(ctcAjax.val_qry[s],function(w,v){page_rule=w;g.each(v,function(y,x){r+='<h4 class="ctc-query-heading">'+y+"</h4>"+n;if(false===b(x)){g.each(x,function(z,A){ctcAjax.sel_val[z]=A;r+=h(z,w,true)})}})})}p="#ctc_selector_"+t+"_"+s+"_rows";g(p).html(r).find(".color-picker").each(function(){o(this)});g(p).find(".ctc-swatch").each(function(){j(this)})},ctc_query_css=function(r,q,u,s){var p={ctc_query_obj:r,ctc_query_key:q},t="#ctc_status_"+r+("val_qry"==r?"_"+q:"");if("object"===typeof s){g.each(s,function(v,w){p["ctc_query_"+v]=w})}g(".ctc-status-icon").remove();g(t).append('<span class="ctc-status-icon spinner"></span>');g(".spinner").show();p.action="ctc_query";p._wpnonce=g("#_wpnonce").val();g.post(ctcAjax.ajaxurl,p,function(v){loading[r]=2;g(".ctc-status-icon").removeClass("spinner");if(b(v)){g(".ctc-status-icon").addClass("failure")}else{g(".ctc-status-icon").addClass("success");c(v);if("function"===typeof u){u(q)}return false}},"json").fail(function(){loading[r]=0;g(".ctc-status-icon").removeClass("spinner");g(".ctc-status-icon").addClass("failure")});return false},ctc_save=function(t){var s={},u,r,p,q,v=g(t).attr("id");if(b(m[v])){m[v]=0}m[v]++;g(t).prop("disabled",true);g(".ctc-status-icon").remove();g(t).parent(".ctc-textarea-button-cell, .ctc-button-cell").append('<span class="ctc-status-icon spinner"></span>');g(".spinner").show();if((u=g("#ctc_new_selectors"))&&"ctc_save_new_selectors"==g(t).attr("id")){s.ctc_new_selectors=u.val();if(r=g("#ctc_sel_ovrd_query_selected")){s.ctc_sel_ovrd_query=r.text()}}else{if((p=g("#ctc_child_imports"))&&"ctc_save_imports"==g(t).attr("id")){s.ctc_child_imports=p.val()}else{s=j(t)}}s.action="ctc_update";s._wpnonce=g("#_wpnonce").val();g.post(ctcAjax.ajaxurl,s,function(w){g(t).prop("disabled",false);g(".ctc-status-icon").removeClass("spinner");if(b(w)){g(".ctc-status-icon").addClass("failure")}else{g(".ctc-status-icon").addClass("success");g("#ctc_new_selectors").val("")}return false}).fail(function(){g(t).prop("disabled",false);g(".ctc-status-icon").removeClass("spinner");g(".ctc-status-icon").addClass("failure")});return false},ctc_decode_value=function(r,p){p=("undefined"==typeof p?"":p);var q={orig:p};if(r.toString().match(/^border(\-(top|right|bottom|left))?$/)){var s=p.toString().split(/ +/);q.names=["_border_width","_border_style","_border_color"];q.values=[("undefined"==typeof s[0]?"":s[0]),("undefined"==typeof s[1]?"":s[1]),("undefined"==typeof s[2]?"":s[2])]}else{if(r.toString().match(/^background\-image/)){q.names=["_background_url","_background_origin","_background_color1","_background_color2"];q.values=["","","",""];if(p.toString().match(/:/)){var s=p.toString().split(/:/);q.values[1]=("undefined"==typeof s[0]?"":s[0]);q.values[2]=("undefined"==typeof s[1]?"":s[1]);q.values[3]=("undefined"==typeof s[3]?"":s[3]);q.orig=[q.values[1],q.values[2],q.values[3]].join(" ")}else{q.values[0]=p}}else{q.names=[""];q.values=[p]}}return q},ctc_set_query=function(p){g("#ctc_sel_ovrd_query").val("");g("#ctc_sel_ovrd_query_selected").text(p);k=p;ctc_setup_selector_menu(p);g("#ctc_new_selector_row").show()},ctc_set_selector=function(q,p){g("#ctc_sel_ovrd_selector").val("");g("#ctc_sel_ovrd_selector_selected").text(p);g("#ctc_sel_ovrd_qsid").val(q);a=q;if(1!=loading.sel_val){loading.sel_val=0}e(q);g("#ctc_sel_ovrd_new_rule, #ctc_sel_ovrd_rule_header,#ctc_sel_ovrd_rule_inputs_container,#ctc_sel_ovrd_rule_inputs").show()},ctc_set_rule=function(q,p){g("#ctc_rule_menu").val("");g("#ctc_rule_menu_selected").text(p);if(1!=loading.rule_val){loading.rule_val=0}ctc_render_rule_value_inputs(q);g("#ctc_rule_value_inputs,#ctc_input_row_rule_header").show()},ctc_setup_query_menu=function(){ctc_queries=i();g("#ctc_sel_ovrd_query").autocomplete({source:ctc_queries,minLength:0,selectFirst:true,autoFocus:true,select:function(q,p){ctc_set_query(p.item.value);return false},focus:function(p){p.preventDefault()}})},ctc_setup_selector_menu=function(p){ctc_selectors=f(p);g("#ctc_sel_ovrd_selector").autocomplete({source:ctc_selectors,selectFirst:true,autoFocus:true,select:function(r,q){ctc_set_selector(q.item.value,q.item.label);return false},focus:function(q){q.preventDefault()}})},ctc_setup_rule_menu=function(){ctc_rules=l();g("#ctc_rule_menu").autocomplete({source:ctc_rules,selectFirst:true,autoFocus:true,select:function(q,p){ctc_set_rule(p.item.value,p.item.label);return false},focus:function(p){p.preventDefault()}})},ctc_filtered_rules=function(r,q){var p=[];if(false===(b(ctcAjax.sel_val[a]))){if(b(ctc_rules)){ctc_rules=l()}g.each(ctc_rules,function(s,v){var t=false,u=new RegExp(g.ui.autocomplete.escapeRegex(r.term),"i");if(u.test(v.label)){g.each(ctcAjax.sel_val[a].value,function(x,w){if(v.label==x){t=true;return false}});if(t){return}p.push(v)}})}q(p)},ctc_setup_new_rule_menu=function(){g("#ctc_new_rule_menu").autocomplete({source:ctc_filtered_rules,selectFirst:true,autoFocus:true,select:function(q,p){g("#ctc_sel_ovrd_rule_inputs").append(h(a,p.item.label,false)).find(".color-picker").each(function(){o(this)});g("#ctc_new_rule_menu").val("");ctcAjax.sel_val[a].value[p.item.label]={child:""};return false},focus:function(p){p.preventDefault()}})},ctc_setup_menus=function(){ctc_setup_query_menu();ctc_setup_selector_menu(k);ctc_setup_rule_menu();ctc_setup_new_rule_menu()},ctc_theme_exists=function(p,q){var r=false;g.each(ctcAjax.themes,function(s,t){g.each(t,function(u,v){if(u==p&&("parnt"==s||"new"==q)){r=true;return false}});if(r){return false}});return r},ctc_set_notice=function(p){var q="";if(false===b(p)){g.each(p,function(r,s){q+='<div class="'+r+'"><ul>'+n;g(s).each(function(t,u){q+="<li>"+u.toString()+"</li>"+n});q+="</ul></div>"})}g("#ctc_error_notice").html(q)},ctc_validate=function(){var s=/[^\w\-]/,q=g("#ctc_child_template").val().toString().replace(s).toLowerCase(),p=g("#ctc_theme_child").val().toString().replace(s).toLowerCase(),r=g("input[name=ctc_child_type]:checked").val(),t=[];if("new"==r){p=q}if(ctc_theme_exists(p,r)){t.push(ctcAjax.theme_exists_txt.toString().replace(/%s/,p))}if(""===p){t.push(ctcAjax.inval_theme_txt)}if(""===g("#ctc_child_name").val()){t.push(ctcAjax.inval_name_txt)}if(t.length){ctc_set_notice({error:t});return false}return true},ctc_set_theme_menu=function(q){var p=g("#ctc_theme_child").val();if(false===b(ctcAjax.themes.child[p])){g("#ctc_child_name").val(ctcAjax.themes.child[p].Name);g("#ctc_child_author").val(ctcAjax.themes.child[p].Author);g("#ctc_child_version").val(ctcAjax.themes.child[p].Version)}},fade_update_notice=function(){g(".updated").fadeOut("slow",function(){g(".updated").remove()})},loading={rule:2,sel_ndx:2,val_qry:0,rule_val:0,sel_val:0},ctc_selectors=[],ctc_queries=[],ctc_rules=[];g(".color-picker").each(function(){o(this)});g(".ctc-option-panel-container").on("focus",".color-picker",function(){ctc_set_notice("");g(this).iris("toggle");g(".iris-picker").css({position:"absolute","z-index":10})});g(".ctc-option-panel-container").on("focus","input",function(){ctc_set_notice("");g(".color-picker").not(this).iris("hide")});g(".ctc-option-panel-container").on("change",".ctc-child-value",function(){j(this)});g(".ctc-option-panel-container").on("click",".ctc-selector-handle",function(q){q.preventDefault();ctc_set_notice("");var r=g(this).attr("id").toString().replace("_close",""),p=r.toString().replace(/\D+/g,"");if(g("#"+r+"_container").is(":hidden")){if(1!=loading.val_qry){loading.val_qry=0}ctc_render_selector_value_inputs(p)}g("#"+r+"_container").fadeToggle("fast");g(".ctc-selector-container").not("#"+r+"_container").fadeOut("fast")});g(".nav-tab").on("click",function(q){q.preventDefault();ctc_set_notice("");var r="#"+g(this).attr("id"),p=r+"_panel";g(".nav-tab").removeClass("nav-tab-active");g(".ctc-option-panel").removeClass("ctc-option-panel-active");g(".ctc-selector-container").hide();g(r).addClass("nav-tab-active");g(".ctc-option-panel-container").scrollTop(0);g(p).addClass("ctc-option-panel-active")});g("#view_child_options,#view_parnt_options").on("click",function(s){ctc_set_notice("");var p=new Date().getTime(),r=g(this).attr("id").toString().match(/(child|parnt)/)[1],q=ctcAjax.theme_uri+"/"+ctcAjax[r]+"/style.css?"+p;g.get(q,function(t){g("#view_"+r+"_options_panel").text(t)}).fail(function(){g("#view_"+r+"_options_panel").text(ctcAjax.css_fail_txt)})});g("#ctc_load_form").on("submit",function(){return(ctc_validate()&&confirm(ctcAjax.load_txt))});g("#parent_child_options_panel").on("change","#ctc_theme_child",ctc_set_theme_menu);g(document).on("click",".ctc-save-input",function(p){ctc_save(this)});ctc_setup_menus();g("input[type=submit],input[type=button]").prop("disabled",false);setTimeout(fade_update_notice,6000)});
2
  * Script: chld-thm-cfg.js
3
  * Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
4
  * Description: Handles jQuery, AJAX and other UI
5
+ * Version: 1.1.3
6
  * Author: Lilaea Media
7
  * Author URI: http://www.lilaeamedia.com/
8
  * License: GPLv2
9
  * Copyright (C) 2013 Lilaea Media
10
  */
11
+ ;jQuery(document).ready(function(g){var n="\n",k="",a,m={},o=function(p){g(p).iris({change:function(){j(p)}})},j=function(v){var r=/^(ctc_(ovrd_)?(parent|child)_([a-z\-]+)_(\d+))(_\w+)?$/,w=g(v).parents(".ctc-selector-row, .ctc-parent-row").first(),u=w.find(".ctc-swatch").first(),t={parent:{},child:{}},s={parent:{origin:"",start:"",end:""},child:{origin:"",start:"",end:""}},q={child:false,parent:false},p={};w.find(".ctc-parent-value, .ctc-child-value").each(function(){var D=g(this).attr("id"),x=D.toString().match(r),y=x[3],F=("undefined"==typeof x[4]?"":x[4]),C=x[5],B=("undefined"==typeof x[6]?"":x[6]),E=("parent"==y?g(this).text():g(this).val()),A,z;if("child"==y){p[D]=E}if(""===E){return}if(false===b(B)){switch(B){case"_border_width":t[y][F+"-width"]=E;break;case"_border_style":t[y][F+"-style"]=E;break;case"_border_color":t[y][F+"-color"]=E;break;case"_background_url":t[y]["background-image"]=d(y,E);break;case"_background_color":t[y]["background-color"]=v.value;break;case"_background_color1":s[y].start=E;q[y]=true;break;case"_background_color2":s[y].end=E;q[y]=true;break;case"_background_origin":s[y].origin=E;q[y]=true;break}}else{if(A=F.toString().match(/^border(\-(top|right|bottom|left))?$/)&&!E.match(/none/)){z=E.toString().split(/ +/);t[y][F+"-width"]="undefined"==typeof z[0]?"":z[0];t[y][F+"-style"]="undefined"==typeof z[1]?"":z[1];t[y][F+"-color"]="undefined"==typeof z[2]?"":z[2]}else{if("background-image"==F){if(E.toString().match(/url\(/)){t[y]["background-image"]=d(y,E)}else{z=E.toString().split(/ +/);if(z.length>2){s[y].origin="undefined"==typeof z[0]?"top":z[0];s[y].start="undefined"==typeof z[1]?"transparent":z[1];s[y].end="undefined"==typeof z[2]?"transparent":z[2];q[y]=true}else{t[y]["background-image"]=E}}}else{t[y][F]=E}}}});if("undefined"!=typeof u){g(u).removeAttr("style");if(q.parent){g(u).ctcgrad(s.parent.origin,[s.parent.start,s.parent.end])}g(u).css(t.parent);if(!(u.attr("id").toString().match(/parent/))){if(q.child){g(u).ctcgrad(s.child.origin,[s.child.start,s.child.end])}g(u).css(t.child)}}return p},c=function(r){var q,s,p;g(r).each(function(){switch(this.obj){case"imports":ctcAjax.imports=this.data;break;case"rule_val":ctcAjax.rule_val[this.key]=this.data;currRuleId=this.key;break;case"val_qry":ctcAjax.val_qry[this.key]=this.data;break;case"rule":ctcAjax.rule=this.data;break;case"sel_ndx":if(b(this.key)){ctcAjax.sel_ndx=this.data}else{if("qsid"==this.key){ctcAjax.sel_ndx[this.data.query][this.data.selector]=this.data.qsid}else{ctcAjax.sel_ndx[this.key]=this.data;q=this.key}}break;case"sel_val":ctcAjax.sel_val[this.key]=this.data;s=this.key;break}})},d=function(t,q){var s=q.toString().match(/url\([" ]*(.+?)[" ]*\)/),r=("undefined"==typeof s?null:s[1]),p=ctcAjax.theme_uri+"/"+("parent"==t?ctcAjax.parnt:ctcAjax.child)+"/",u;if(!r){return false}else{if(r.toString().match(/^(http:|\/)/)){u=q}else{u="url("+p+r+")"}}return u},b=function(q){if("undefined"==typeof q||false===q||null===q||""===q){return true}if(true===q||"string"===typeof q||"number"===typeof q){return false}if("object"===typeof q){for(var p in q){if(q.hasOwnProperty(p)){return false}}return true}return false},i=function(){var p=[];if(1===loading.sel_ndx){return p}if(0===loading.sel_ndx){loading.sel_ndx=1;ctc_query_css("sel_ndx",null,ctc_setup_query_menu);return p}if(false===b(ctcAjax.sel_ndx)){g.each(ctcAjax.sel_ndx,function(q,r){var s={label:q,value:q};p.push(s)})}return p},f=function(q){var p=[];if(1===loading.sel_ndx){return p}if(0===loading.sel_ndx){loading.sel_ndx=1;ctc_query_css("sel_ndx",q,ctc_setup_selector_menu);return p}if(false===b(ctcAjax.sel_ndx[q])){g.each(ctcAjax.sel_ndx[q],function(r,s){var t={label:r,value:s};p.push(t)})}return p},l=function(){var p=[];if(1===loading.rule){return p}if(0===loading.rule){loading.rule=1;ctc_query_css("rule",null,ctc_setup_rule_menu);return p}if(false===b(ctcAjax.rule)){g.each(ctcAjax.rule,function(q,r){var s={label:r,value:q};p.push(s)})}return p.sort(function(r,q){if(r.label>q.label){return 1}if(r.label<q.label){return -1}return 0})},h=function(r,v,q){var s="",u=(b(ctcAjax.sel_val[r])||b(ctcAjax.sel_val[r].value)||b(ctcAjax.sel_val[r].value[v])?"":ctcAjax.sel_val[r].value[v]),t=ctc_decode_value(v,("undefined"==typeof u?"":u.parnt)),p=ctc_decode_value(v,("undefined"==typeof u?"":u.child));if(false===b(ctcAjax.sel_val[r])){s+='<div class="ctc-'+(q?"selector":"input")+'-row clearfix">'+n;s+='<div class="ctc-input-cell">'+(q?ctcAjax.sel_val[r].selector+(b(t.orig)?"<br/>"+ctcAjax.child_only_txt:""):v)+"</div>"+n;if(!q){s+='<div class="ctc-parent-value ctc-input-cell" id="ctc_parent_'+v+"_"+r+'">'+(b(t.orig)?"[no value]":t.orig)+"</div>"+n}s+='<div class="ctc-input-cell">'+n;if(false===b(t.names)){g.each(t.names,function(w,x){x=(b(x)?"":x);s+='<div class="ctc-child-input-cell">'+n;var z="ctc_"+(q?"":"ovrd_")+"child_"+v+"_"+r+x,y;if(false===(y=p.values.shift())){y=""}s+=(b(x)?"":ctcAjax.field_labels[x]+":<br/>")+'<input type="text" id="'+z+'" name="'+z+'" class="ctc-child-value'+((x+v).toString().match(/color/)?" color-picker":"")+((x).toString().match(/url/)?" ctc-input-wide":"")+'" value="'+y+'" />'+n;s+="</div>"+n})}s+="</div>"+n;s+=(q?'<div class="ctc-swatch ctc-specific" id="ctc_child_'+v+"_"+r+'_swatch">'+ctcAjax.swatch_txt+"</div>"+n+'<div class="ctc-child-input-cell ctc-button-cell" id="ctc_save_'+v+"_"+r+'_cell">'+n+'<input type="button" class="button ctc-save-input" id="ctc_save_'+v+"_"+r+'" name="ctc_save_'+v+"_"+r+'" value="Save" /></div>'+n:"");s+="</div><!-- end input row -->"+n}return s},e=function(p){if(1===loading.sel_val){return false}if(0==loading.sel_val){loading.sel_val=1;ctc_query_css("sel_val",p,e);return false}var q="";if(false===b(ctcAjax.sel_val[p]&&false===b(ctcAjax.sel_val[p].value))){g.each(ctcAjax.sel_val[p].value,function(s,r){q+=h(p,s,false)})}g("#ctc_sel_ovrd_rule_inputs").html(q).find(".color-picker").each(function(){o(this)});j("#ctc_child_all_0_swatch")};ctc_render_rule_value_inputs=function(q){if(1===loading.rule_val){return false}if(0==loading.rule_val){loading.rule_val=1;ctc_query_css("rule_val",q,ctc_render_rule_value_inputs);return false}var r=ctcAjax.rule[q],p='<div class="ctc-input-row clearfix" id="ctc_rule_row_'+r+'">'+n;if(false===b(ctcAjax.rule_val[q])){g.each(ctcAjax.rule_val[q],function(t,u){var s=ctc_decode_value(r,u);p+='<div class="ctc-parent-row clearfix" id="ctc_rule_row_'+r+"_"+t+'">'+n;p+='<div class="ctc-input-cell ctc-parent-value" id="ctc_parent_'+r+"_"+t+'">'+s.orig+"</div>"+n;p+='<div class="ctc-input-cell">'+n;p+='<div class="ctc-swatch ctc-specific" id="ctc_parent_'+r+"_"+t+'_swatch">'+ctcAjax.swatch_txt+"</div></div>"+n;p+='<div class="ctc-input-cell"><a href="#" class="ctc-selector-handle" id="ctc_selector_'+r+"_"+t+'">'+ctcAjax.selector_txt+"</a></div>"+n;p+='<div id="ctc_selector_'+r+"_"+t+'_container" class="ctc-selector-container clearfix">'+n;p+='<a href="#" id="ctc_selector_'+r+"_"+t+'_close" class="ctc-selector-handle" style="float:right">'+ctcAjax.close_txt+'</a><div id="ctc_status_val_qry_'+t+'"></div>'+n;p+='<div id="ctc_selector_'+r+"_"+t+'_rows"></div>'+n;p+="</div></div>"+n});p+="</div>"+n}g("#ctc_rule_value_inputs").html(p).find(".ctc-swatch").each(function(){j(this)})},ctc_render_selector_value_inputs=function(s){if(1==loading.val_qry){return false}var u,q,t=g("#ctc_rule_menu_selected").text(),p,r="";if(0===loading.val_qry){loading.val_qry=1;u={rule:t};ctc_query_css("val_qry",s,ctc_render_selector_value_inputs,u);return false}if(false===b(ctcAjax.val_qry[s])){g.each(ctcAjax.val_qry[s],function(w,v){page_rule=w;g.each(v,function(y,x){r+='<h4 class="ctc-query-heading">'+y+"</h4>"+n;if(false===b(x)){g.each(x,function(z,A){ctcAjax.sel_val[z]=A;r+=h(z,w,true)})}})})}p="#ctc_selector_"+t+"_"+s+"_rows";g(p).html(r).find(".color-picker").each(function(){o(this)});g(p).find(".ctc-swatch").each(function(){j(this)})},ctc_query_css=function(r,q,u,s){var p={ctc_query_obj:r,ctc_query_key:q},t="#ctc_status_"+r+("val_qry"==r?"_"+q:"");if("object"===typeof s){g.each(s,function(v,w){p["ctc_query_"+v]=w})}g(".ctc-status-icon").remove();g(t).append('<span class="ctc-status-icon spinner"></span>');g(".spinner").show();p.action="ctc_query";p._wpnonce=g("#_wpnonce").val();g.post(ctcAjax.ajaxurl,p,function(v){loading[r]=2;g(".ctc-status-icon").removeClass("spinner");if(b(v)){g(".ctc-status-icon").addClass("failure")}else{g(".ctc-status-icon").addClass("success");c(v);if("function"===typeof u){u(q)}return false}},"json").fail(function(){loading[r]=0;g(".ctc-status-icon").removeClass("spinner");g(".ctc-status-icon").addClass("failure")});return false},ctc_save=function(t){var s={},u,r,p,q,v=g(t).attr("id");if(b(m[v])){m[v]=0}m[v]++;g(t).prop("disabled",true);g(".ctc-status-icon").remove();g(t).parent(".ctc-textarea-button-cell, .ctc-button-cell").append('<span class="ctc-status-icon spinner"></span>');g(".spinner").show();if((u=g("#ctc_new_selectors"))&&"ctc_save_new_selectors"==g(t).attr("id")){s.ctc_new_selectors=u.val();if(r=g("#ctc_sel_ovrd_query_selected")){s.ctc_sel_ovrd_query=r.text()}}else{if((p=g("#ctc_child_imports"))&&"ctc_save_imports"==g(t).attr("id")){s.ctc_child_imports=p.val()}else{s=j(t)}}s.action="ctc_update";s._wpnonce=g("#_wpnonce").val();g.post(ctcAjax.ajaxurl,s,function(w){g(t).prop("disabled",false);g(".ctc-status-icon").removeClass("spinner");if(b(w)){g(".ctc-status-icon").addClass("failure")}else{g(".ctc-status-icon").addClass("success");g("#ctc_new_selectors").val("");c(w);ctc_setup_menus()}return false},"json").fail(function(){g(t).prop("disabled",false);g(".ctc-status-icon").removeClass("spinner");g(".ctc-status-icon").addClass("failure")});return false},ctc_decode_value=function(r,p){p=("undefined"==typeof p?"":p);var q={orig:p};if(r.toString().match(/^border(\-(top|right|bottom|left))?$/)){var s=p.toString().split(/ +/);q.names=["_border_width","_border_style","_border_color"];q.values=[("undefined"==typeof s[0]?"":s[0]),("undefined"==typeof s[1]?"":s[1]),("undefined"==typeof s[2]?"":s[2])]}else{if(r.toString().match(/^background\-image/)){q.names=["_background_url","_background_origin","_background_color1","_background_color2"];q.values=["","","",""];if(p.toString().match(/:/)){var s=p.toString().split(/:/);q.values[1]=("undefined"==typeof s[0]?"":s[0]);q.values[2]=("undefined"==typeof s[1]?"":s[1]);q.values[3]=("undefined"==typeof s[3]?"":s[3]);q.orig=[q.values[1],q.values[2],q.values[3]].join(" ")}else{q.values[0]=p}}else{q.names=[""];q.values=[p]}}return q},ctc_set_query=function(p){g("#ctc_sel_ovrd_query").val("");g("#ctc_sel_ovrd_query_selected").text(p);k=p;ctc_setup_selector_menu(p);g("#ctc_new_selector_row").show()},ctc_set_selector=function(q,p){g("#ctc_sel_ovrd_selector").val("");g("#ctc_sel_ovrd_selector_selected").text(p);g("#ctc_sel_ovrd_qsid").val(q);a=q;if(1!=loading.sel_val){loading.sel_val=0}e(q);g("#ctc_sel_ovrd_new_rule, #ctc_sel_ovrd_rule_header,#ctc_sel_ovrd_rule_inputs_container,#ctc_sel_ovrd_rule_inputs").show()},ctc_set_rule=function(q,p){g("#ctc_rule_menu").val("");g("#ctc_rule_menu_selected").text(p);if(1!=loading.rule_val){loading.rule_val=0}ctc_render_rule_value_inputs(q);g("#ctc_rule_value_inputs,#ctc_input_row_rule_header").show()},ctc_setup_query_menu=function(){ctc_queries=i();g("#ctc_sel_ovrd_query").autocomplete({source:ctc_queries,minLength:0,selectFirst:true,autoFocus:true,select:function(q,p){ctc_set_query(p.item.value);return false},focus:function(p){p.preventDefault()}})},ctc_setup_selector_menu=function(p){ctc_selectors=f(p);g("#ctc_sel_ovrd_selector").autocomplete({source:ctc_selectors,selectFirst:true,autoFocus:true,select:function(r,q){ctc_set_selector(q.item.value,q.item.label);return false},focus:function(q){q.preventDefault()}})},ctc_setup_rule_menu=function(){ctc_rules=l();g("#ctc_rule_menu").autocomplete({source:ctc_rules,selectFirst:true,autoFocus:true,select:function(q,p){ctc_set_rule(p.item.value,p.item.label);return false},focus:function(p){p.preventDefault()}})},ctc_filtered_rules=function(r,q){var p=[];if(false===(b(ctcAjax.sel_val[a]))){if(b(ctc_rules)){ctc_rules=l()}g.each(ctc_rules,function(s,v){var t=false,u=new RegExp(g.ui.autocomplete.escapeRegex(r.term),"i");if(u.test(v.label)){g.each(ctcAjax.sel_val[a].value,function(x,w){if(v.label==x){t=true;return false}});if(t){return}p.push(v)}})}q(p)},ctc_setup_new_rule_menu=function(){g("#ctc_new_rule_menu").autocomplete({source:ctc_filtered_rules,selectFirst:true,autoFocus:true,select:function(q,p){g("#ctc_sel_ovrd_rule_inputs").append(h(a,p.item.label,false)).find(".color-picker").each(function(){o(this)});g("#ctc_new_rule_menu").val("");ctcAjax.sel_val[a].value[p.item.label]={child:""};return false},focus:function(p){p.preventDefault()}})},ctc_setup_menus=function(){ctc_setup_query_menu();ctc_setup_selector_menu(k);ctc_setup_rule_menu();ctc_setup_new_rule_menu()},ctc_theme_exists=function(p,q){var r=false;g.each(ctcAjax.themes,function(s,t){g.each(t,function(u,v){if(u==p&&("parnt"==s||"new"==q)){r=true;return false}});if(r){return false}});return r},ctc_set_notice=function(p){var q="";if(false===b(p)){g.each(p,function(r,s){q+='<div class="'+r+'"><ul>'+n;g(s).each(function(t,u){q+="<li>"+u.toString()+"</li>"+n});q+="</ul></div>"})}g("#ctc_error_notice").html(q)},ctc_validate=function(){var s=/[^\w\-]/,q=g("#ctc_child_template").val().toString().replace(s).toLowerCase(),p=g("#ctc_theme_child").val().toString().replace(s).toLowerCase(),r=g("input[name=ctc_child_type]:checked").val(),t=[];if("new"==r){p=q}if(ctc_theme_exists(p,r)){t.push(ctcAjax.theme_exists_txt.toString().replace(/%s/,p))}if(""===p){t.push(ctcAjax.inval_theme_txt)}if(""===g("#ctc_child_name").val()){t.push(ctcAjax.inval_name_txt)}if(t.length){ctc_set_notice({error:t});return false}return true},ctc_set_theme_menu=function(q){var p=g("#ctc_theme_child").val();if(false===b(ctcAjax.themes.child[p])){g("#ctc_child_name").val(ctcAjax.themes.child[p].Name);g("#ctc_child_author").val(ctcAjax.themes.child[p].Author);g("#ctc_child_version").val(ctcAjax.themes.child[p].Version)}},fade_update_notice=function(){g(".updated").slideUp("slow",function(){g(".updated").remove()})},loading={rule:2,sel_ndx:2,val_qry:0,rule_val:0,sel_val:0},ctc_selectors=[],ctc_queries=[],ctc_rules=[];g(".color-picker").each(function(){o(this)});g(".ctc-option-panel-container").on("focus",".color-picker",function(){ctc_set_notice("");g(this).iris("toggle");g(".iris-picker").css({position:"absolute","z-index":10})});g(".ctc-option-panel-container").on("focus","input",function(){ctc_set_notice("");g(".color-picker").not(this).iris("hide")});g(".ctc-option-panel-container").on("change",".ctc-child-value",function(){j(this)});g(".ctc-option-panel-container").on("click",".ctc-selector-handle",function(q){q.preventDefault();ctc_set_notice("");var r=g(this).attr("id").toString().replace("_close",""),p=r.toString().replace(/\D+/g,"");if(g("#"+r+"_container").is(":hidden")){if(1!=loading.val_qry){loading.val_qry=0}ctc_render_selector_value_inputs(p)}g("#"+r+"_container").fadeToggle("fast");g(".ctc-selector-container").not("#"+r+"_container").fadeOut("fast")});g(".nav-tab").on("click",function(q){q.preventDefault();ctc_set_notice("");var r="#"+g(this).attr("id"),p=r+"_panel";g(".nav-tab").removeClass("nav-tab-active");g(".ctc-option-panel").removeClass("ctc-option-panel-active");g(".ctc-selector-container").hide();g(r).addClass("nav-tab-active");g(".ctc-option-panel-container").scrollTop(0);g(p).addClass("ctc-option-panel-active")});g("#view_child_options,#view_parnt_options").on("click",function(s){ctc_set_notice("");var p=new Date().getTime(),r=g(this).attr("id").toString().match(/(child|parnt)/)[1],q=ctcAjax.theme_uri+"/"+ctcAjax[r]+"/style.css?"+p;g.get(q,function(t){g("#view_"+r+"_options_panel").text(t)}).fail(function(){g("#view_"+r+"_options_panel").text(ctcAjax.css_fail_txt)})});g("#ctc_load_form").on("submit",function(){return(ctc_validate()&&confirm(ctcAjax.load_txt))});g("#parent_child_options_panel").on("change","#ctc_theme_child",ctc_set_theme_menu);g(document).on("click",".ctc-save-input",function(p){ctc_save(this)});ctc_setup_menus();g("input[type=submit],input[type=button]").prop("disabled",false);setTimeout(fade_update_notice,6000)});
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, custom theme, CSS, responsive design, CSS editor, theme generator
5
  Requires at least: 3.5
6
  Tested up to: 3.8
7
- Stable tag: 1.1.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -89,6 +89,10 @@ You can also create a secondary stylesheet that contains @font-face rules and im
89
 
90
  == Changelog ==
91
 
 
 
 
 
92
  = 1.1.2 =
93
  * Small bug fix to javascript (casting number to string)
94
 
4
  Tags: child theme, custom theme, CSS, responsive design, CSS editor, theme generator
5
  Requires at least: 3.5
6
  Tested up to: 3.8
7
+ Stable tag: 1.1.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
89
 
90
  == Changelog ==
91
 
92
+ = 1.1.3 =
93
+ * Fixed bug that assumed lowercase only for theme slugs. (Thanks to timk)
94
+ * Fixed update redirect to execute on first run
95
+
96
  = 1.1.2 =
97
  * Small bug fix to javascript (casting number to string)
98