Version Description
- Fix: javascript bug
Download this release
Release Info
Developer | lilaeamedia |
Plugin | Child Theme Configurator |
Version | 1.4.5.2 |
Comparing to | |
See all releases |
Code changes from version 1.4.5.1 to 1.4.5.2
- child-theme-configurator.php +2 -2
- css/chld-thm-cfg.css +2 -2
- includes/class-ctc-css.php +7 -6
- includes/class-ctc-ui.php +1 -1
- includes/class-ctc.php +1 -1
- js/chld-thm-cfg.js +2 -2
- js/chld-thm-cfg.min.js +2 -2
- readme.txt +6 -2
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 a Child Theme from any installed Theme. Each CSS selector, rule and value can then be searched, previewed and modified.
|
9 |
-
Version: 1.4.5.
|
10 |
Author: Lilaea Media
|
11 |
Author URI: http://www.lilaeamedia.com/
|
12 |
Text Domain: chld_thm_cfg
|
@@ -16,7 +16,7 @@ if ( !defined('ABSPATH')) exit;
|
|
16 |
*/
|
17 |
|
18 |
defined('LF') or define('LF', "\n");
|
19 |
-
define('CHLD_THM_CFG_VERSION', '1.4.5.
|
20 |
define('CHLD_THM_CFG_MAX_SELECTORS', '5000');
|
21 |
define('CHLD_THM_CFG_MAX_RECURSE_LOOPS', '100');
|
22 |
|
6 |
Plugin Name: Child Theme Configurator
|
7 |
Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
|
8 |
Description: Create a Child Theme from any installed Theme. Each CSS selector, rule and value can then be searched, previewed and modified.
|
9 |
+
Version: 1.4.5.2
|
10 |
Author: Lilaea Media
|
11 |
Author URI: http://www.lilaeamedia.com/
|
12 |
Text Domain: chld_thm_cfg
|
16 |
*/
|
17 |
|
18 |
defined('LF') or define('LF', "\n");
|
19 |
+
define('CHLD_THM_CFG_VERSION', '1.4.5.2');
|
20 |
define('CHLD_THM_CFG_MAX_SELECTORS', '5000');
|
21 |
define('CHLD_THM_CFG_MAX_RECURSE_LOOPS', '100');
|
22 |
|
css/chld-thm-cfg.css
CHANGED
@@ -123,9 +123,9 @@ a.nav-tab, a.nav-tab:focus, a.nav-tab:active {
|
|
123 |
min-height: 300px;
|
124 |
max-height: 500px;
|
125 |
position: absolute;
|
126 |
-
width:
|
127 |
overflow: auto;
|
128 |
-
left:
|
129 |
top: 30px;
|
130 |
display: none;
|
131 |
z-index: 99999;
|
123 |
min-height: 300px;
|
124 |
max-height: 500px;
|
125 |
position: absolute;
|
126 |
+
width: 80%;
|
127 |
overflow: auto;
|
128 |
+
left: 15%;
|
129 |
top: 30px;
|
130 |
display: none;
|
131 |
z-index: 99999;
|
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.4.5.
|
10 |
Author: Lilaea Media
|
11 |
Author URI: http://www.lilaeamedia.com/
|
12 |
Text Domain: chld_thm_cfg
|
@@ -44,7 +44,7 @@ class Child_Theme_Configurator_CSS {
|
|
44 |
|
45 |
function __construct($parent = '') {
|
46 |
// scalars
|
47 |
-
$this->version = '1.4.5.
|
48 |
$this->querykey = 0;
|
49 |
$this->selkey = 0;
|
50 |
$this->qskey = 0;
|
@@ -302,7 +302,7 @@ class Child_Theme_Configurator_CSS {
|
|
302 |
$this->styles = $this->parse_css_input($_POST['ctc_child_imports']);
|
303 |
$this->parse_css('child');
|
304 |
else:
|
305 |
-
$newselector = isset($_POST['ctc_rewrite_selector']) ? $this->parse_css_input($_POST['ctc_rewrite_selector']) : NULL;
|
306 |
// set the custom sequence value
|
307 |
foreach (preg_grep('#^ctc_ovrd_child_seq_#', array_keys($_POST)) as $post_key):
|
308 |
if (preg_match('#^ctc_ovrd_child_seq_(\d+)$#', $post_key, $matches)):
|
@@ -318,7 +318,7 @@ class Child_Theme_Configurator_CSS {
|
|
318 |
if (null == $rule || !isset($this->dict_rule[$rule])) continue;
|
319 |
$ruleid = $this->dict_rule[$rule];
|
320 |
$qsid = $matches[3];
|
321 |
-
$value = $this->normalize_color($this->sanitize($_POST[$post_key]));
|
322 |
$important = $this->is_important($value);
|
323 |
if (!empty($_POST['ctc_' . $valid . '_child_' . $rule . '_i_' . $qsid])) $important = 1;
|
324 |
|
@@ -397,7 +397,7 @@ class Child_Theme_Configurator_CSS {
|
|
397 |
}
|
398 |
|
399 |
function sanitize($styles) {
|
400 |
-
return
|
401 |
}
|
402 |
|
403 |
function esc_octal($styles){
|
@@ -427,6 +427,7 @@ class Child_Theme_Configurator_CSS {
|
|
427 |
* accepts raw CSS as text and parses into separate properties
|
428 |
*/
|
429 |
function parse_css($template, $basequery = null, $parse_imports = true) {
|
|
|
430 |
if (false === strpos($basequery, '@')):
|
431 |
$basequery = 'base';
|
432 |
endif;
|
@@ -471,7 +472,7 @@ class Child_Theme_Configurator_CSS {
|
|
471 |
list($rule, $value) = explode(':', $ruleval, 2);
|
472 |
$rule = trim($rule);
|
473 |
$rule = preg_replace_callback("/[^\w\-]/", array($this, 'to_ascii'), $rule);
|
474 |
-
|
475 |
|
476 |
$rules = $values = array();
|
477 |
// save important flag
|
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.4.5.2
|
10 |
Author: Lilaea Media
|
11 |
Author URI: http://www.lilaeamedia.com/
|
12 |
Text Domain: chld_thm_cfg
|
44 |
|
45 |
function __construct($parent = '') {
|
46 |
// scalars
|
47 |
+
$this->version = '1.4.5.2';
|
48 |
$this->querykey = 0;
|
49 |
$this->selkey = 0;
|
50 |
$this->qskey = 0;
|
302 |
$this->styles = $this->parse_css_input($_POST['ctc_child_imports']);
|
303 |
$this->parse_css('child');
|
304 |
else:
|
305 |
+
$newselector = isset($_POST['ctc_rewrite_selector']) ? $this->sanitize($this->parse_css_input($_POST['ctc_rewrite_selector'])) : NULL;
|
306 |
// set the custom sequence value
|
307 |
foreach (preg_grep('#^ctc_ovrd_child_seq_#', array_keys($_POST)) as $post_key):
|
308 |
if (preg_match('#^ctc_ovrd_child_seq_(\d+)$#', $post_key, $matches)):
|
318 |
if (null == $rule || !isset($this->dict_rule[$rule])) continue;
|
319 |
$ruleid = $this->dict_rule[$rule];
|
320 |
$qsid = $matches[3];
|
321 |
+
$value = $this->normalize_color($this->sanitize($this->parse_css_input($_POST[$post_key])));
|
322 |
$important = $this->is_important($value);
|
323 |
if (!empty($_POST['ctc_' . $valid . '_child_' . $rule . '_i_' . $qsid])) $important = 1;
|
324 |
|
397 |
}
|
398 |
|
399 |
function sanitize($styles) {
|
400 |
+
return sanitize_text_field($styles);
|
401 |
}
|
402 |
|
403 |
function esc_octal($styles){
|
427 |
* accepts raw CSS as text and parses into separate properties
|
428 |
*/
|
429 |
function parse_css($template, $basequery = null, $parse_imports = true) {
|
430 |
+
//echo $this->styles;
|
431 |
if (false === strpos($basequery, '@')):
|
432 |
$basequery = 'base';
|
433 |
endif;
|
472 |
list($rule, $value) = explode(':', $ruleval, 2);
|
473 |
$rule = trim($rule);
|
474 |
$rule = preg_replace_callback("/[^\w\-]/", array($this, 'to_ascii'), $rule);
|
475 |
+
$value = trim($value);
|
476 |
|
477 |
$rules = $values = array();
|
478 |
// save important flag
|
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.4.5.
|
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.4.5.2
|
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.4.5.
|
10 |
Author: Lilaea Media
|
11 |
Author URI: http://www.lilaeamedia.com/
|
12 |
Text Domain: chld_thm_cfg
|
6 |
Class: Child_Theme_Configurator
|
7 |
Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
|
8 |
Description: Main Controller Class
|
9 |
+
Version: 1.4.5.2
|
10 |
Author: Lilaea Media
|
11 |
Author URI: http://www.lilaeamedia.com/
|
12 |
Text Domain: chld_thm_cfg
|
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.4.5.
|
6 |
* Author: Lilaea Media
|
7 |
* Author URI: http://www.lilaeamedia.com/
|
8 |
* License: GPLv2
|
@@ -19,7 +19,7 @@ jQuery(document).ready(function($){
|
|
19 |
quot_regex = new RegExp('"', 'g'),
|
20 |
// initialize functions
|
21 |
esc_quot = function(str){
|
22 |
-
return str.replace(quot_regex, '"');
|
23 |
},
|
24 |
ctc_setup_iris = function(obj) {
|
25 |
$(obj).iris({
|
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.4.5.2
|
6 |
* Author: Lilaea Media
|
7 |
* Author URI: http://www.lilaeamedia.com/
|
8 |
* License: GPLv2
|
19 |
quot_regex = new RegExp('"', 'g'),
|
20 |
// initialize functions
|
21 |
esc_quot = function(str){
|
22 |
+
return ctc_is_empty(str) ? str : str.toString().replace(quot_regex, '"');
|
23 |
},
|
24 |
ctc_setup_iris = function(obj) {
|
25 |
$(obj).iris({
|
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.4.5.
|
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(c){var l="\n",u="base",h,b={},r,s,p=new RegExp('"',"g"),n=function(v){return v.replace(p,""")},k=function(v){c(v).iris({change:function(){f(v)}})},e=function(x){var v=parseInt(x),w=String.fromCharCode(v);return w},m=function(w){var v=w.charCodeAt(0);return v},f=function(B){var x=/^(ctc_(ovrd|\d+)_(parent|child)_([0-9a-z\-]+)_(\d+))(_\w+)?$/,C=c(B).parents(".ctc-selector-row, .ctc-parent-row").first(),A=C.find(".ctc-swatch").first(),z={parent:{},child:{}},y={parent:{origin:"",start:"",end:""},child:{origin:"",start:"",end:""}},w={child:false,parent:false},v={};C.find(".ctc-parent-value, .ctc-child-value").each(function(){var K=c(this).attr("id"),D=K.toString().match(x),L=D[2],E=D[3],N=("undefined"==typeof D[4]?"":D[4]),J=D[5],I=("undefined"==typeof D[6]?"":D[6]),M=("parent"==E?c(this).text():c(this).val()),F="ctc_"+L+"_child_"+N+"_i_"+J,H,G;if("child"==E){v[K]=M;v[F]=(c("#"+F).is(":checked"))?1:0}if(""!=M){if(false===t(I)){switch(I){case"_border_width":z[E][N+"-width"]=M;break;case"_border_style":z[E][N+"-style"]=M;break;case"_border_color":z[E][N+"-color"]=M;break;case"_background_url":z[E]["background-image"]=i(E,M);break;case"_background_color":z[E]["background-color"]=B.value;break;case"_background_color1":y[E].start=M;w[E]=true;break;case"_background_color2":y[E].end=M;w[E]=true;break;case"_background_origin":y[E].origin=M;w[E]=true;break}}else{if(H=N.toString().match(/^border(\-(top|right|bottom|left))?$/)&&!M.match(/none/)){G=M.toString().split(/ +/);z[E][N+"-width"]="undefined"==typeof G[0]?"":G[0];z[E][N+"-style"]="undefined"==typeof G[1]?"":G[1];z[E][N+"-color"]="undefined"==typeof G[2]?"":G[2]}else{if("background-image"==N){if(M.toString().match(/url\(/)){z[E]["background-image"]=i(E,M)}else{G=M.toString().split(/ +/);if(G.length>2){y[E].origin="undefined"==typeof G[0]?"top":G[0];y[E].start="undefined"==typeof G[1]?"transparent":G[1];y[E].end="undefined"==typeof G[2]?"transparent":G[2];w[E]=true}else{z[E]["background-image"]=M}}}else{z[E][N]=M}}}}});if("undefined"!=typeof A&&false===t(A.attr("id"))){c(A).removeAttr("style");if(w.parent){c(A).ctcgrad(y.parent.origin,[y.parent.start,y.parent.end])}c(A).css(z.parent);if(!(A.attr("id").toString().match(/parent/))){if(w.child){c(A).ctcgrad(y.child.origin,[y.child.start,y.child.end])}c(A).css(z.child)}}return v},o=function(w){var v,x,y;c(w).each(function(){switch(this.obj){case"imports":ctcAjax.imports=this.data;break;case"rule_val":ctcAjax.rule_val[this.key]=this.data;y=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(t(this.key)){ctcAjax.sel_ndx=this.data}else{if("qsid"==this.key){if(t(ctcAjax.sel_ndx[this.data.query])){ctcAjax.sel_ndx[this.data.query]={}}ctcAjax.sel_ndx[this.data.query][this.data.selector]=this.data.qsid}else{ctcAjax.sel_ndx[this.key]=this.data;v=this.key}}break;case"sel_val":ctcAjax.sel_val[this.key]=this.data;x=this.key;break;case"rewrite":r=this.key;s=this.data;break}})},i=function(z,w){var y=w.toString().match(/url\(['" ]*(.+?)['" ]*\)/),x=t(y)?null:y[1],v=ctcAjax.theme_uri+"/"+("parent"==z?ctcAjax.parnt:ctcAjax.child)+"/",A;if(!x){return false}else{if(x.toString().match(/^(https?:|\/)/)){A=w}else{A="url("+v+x+")"}}return A},t=function(w){if("undefined"==typeof w||false===w||null===w||""===w){return true}if(true===w||"string"===typeof w||"number"===typeof w){return false}if("object"===typeof w){for(var v in w){if(w.hasOwnProperty(v)){return false}}return true}return false},a=function(){var v=[];if(1===loading.sel_ndx){return v}if(0===loading.sel_ndx){loading.sel_ndx=1;ctc_query_css("sel_ndx",null,ctc_setup_query_menu);return v}if(false===t(ctcAjax.sel_ndx)){c.each(ctcAjax.sel_ndx,function(w,x){var y={label:w,value:w};v.push(y)})}return v},q=function(w){var v=[];if(1===loading.sel_ndx){return v}if(0===loading.sel_ndx){loading.sel_ndx=1;ctc_query_css("sel_ndx",w,ctc_setup_selector_menu);return v}if(false===t(ctcAjax.sel_ndx[w])){c.each(ctcAjax.sel_ndx[w],function(x,y){var z={label:x,value:y};v.push(z)})}return v},d=function(){var v=[];if(1===loading.rule){return v}if(0===loading.rule){loading.rule=1;ctc_query_css("rule",null,ctc_setup_rule_menu);return v}if(false===t(ctcAjax.rule)){c.each(ctcAjax.rule,function(w,x){var y={label:x.replace(/\d+/g,e),value:w};v.push(y)})}return v.sort(function(x,w){if(x.label>w.label){return 1}if(x.label<w.label){return -1}return 0})},j=function(z,B,E){var x="",C=(t(ctcAjax.sel_val[z])||t(ctcAjax.sel_val[z].value)||t(ctcAjax.sel_val[z].value[B])?"":ctcAjax.sel_val[z].value[B]),w=ctc_decode_value(B,("undefined"==typeof C?"":C.parnt)),A=(false===t(C.i_parnt)&&C.i_parnt)?ctcAjax.important_label:"",y=ctc_decode_value(B,("undefined"==typeof C?"":C.child)),v=(false===t(C.i_child)&&C.i_child)?1:0,D="ctc_"+E+"_child_"+B+"_i_"+z;if(false===t(ctcAjax.sel_val[z])){x+='<div class="ctc-'+("ovrd"==E?"input":"selector")+'-row clearfix">'+l;x+='<div class="ctc-input-cell">'+("ovrd"==E?B.replace(/\d+/g,e):ctcAjax.sel_val[z].selector+'<br/><a href="#" class="ctc-selector-edit" id="ctc_selector_edit_'+z+'" >'+ctcAjax.edit_txt+"</a> "+(t(w.orig)?ctcAjax.child_only_txt:""))+"</div>"+l;if("ovrd"==E){x+='<div class="ctc-parent-value ctc-input-cell" id="ctc_'+E+"_parent_"+B+"_"+z+'">'+(t(w.orig)?"[no value]":w.orig+A)+"</div>"+l}x+='<div class="ctc-input-cell">'+l;if(false===t(w.names)){c.each(w.names,function(F,G){G=(t(G)?"":G);x+='<div class="ctc-child-input-cell">'+l;var I="ctc_"+E+"_child_"+B+"_"+z+G,H;if(false===(H=y.values.shift())){H=""}x+=(t(G)?"":ctcAjax.field_labels[G]+":<br/>")+'<input type="text" id="'+I+'" name="'+I+'" class="ctc-child-value'+((G+B).toString().match(/color/)?" color-picker":"")+((G).toString().match(/url/)?" ctc-input-wide":"")+'" value="'+n(H)+'" />'+l;x+="</div>"+l});x+='<label for="'+D+'"><input type="checkbox" id="'+D+'" name="'+D+'" value="1" '+(1===v?"checked":"")+" />"+ctcAjax.important_label+"</label>"+l}x+="</div>"+l;x+=("ovrd"==E?"":'<div class="ctc-swatch ctc-specific" id="ctc_child_'+B+"_"+z+'_swatch">'+ctcAjax.swatch_txt+"</div>"+l+'<div class="ctc-child-input-cell ctc-button-cell" id="ctc_save_'+B+"_"+z+'_cell">'+l+'<input type="button" class="button ctc-save-input" id="ctc_save_'+B+"_"+z+'" name="ctc_save_'+B+"_"+z+'" value="Save" /></div>'+l);x+="</div><!-- end input row -->"+l}return x},g=function(v){if(1===loading.sel_val){return false}if(0==loading.sel_val){loading.sel_val=1;ctc_query_css("sel_val",v,g);return false}var y,w,x;if(t(ctcAjax.sel_val[v])){c("#ctc_sel_ovrd_rule_inputs").html("")}else{if(t(ctcAjax.sel_val[v].seq)){c("#ctc_child_load_order_container").html("")}else{y="ctc_ovrd_child_seq_"+v;x=parseInt(ctcAjax.sel_val[v].seq);w='<input type="text" id="'+y+'" name="'+y+'" class="ctc-child-value" value="'+x+'" />';c("#ctc_child_load_order_container").html(w)}if(t(ctcAjax.sel_val[v].value)){c("#ctc_sel_ovrd_rule_inputs").html("")}else{w="";c.each(ctcAjax.sel_val[v].value,function(A,z){w+=j(v,A,"ovrd")});c("#ctc_sel_ovrd_rule_inputs").html(w).find(".color-picker").each(function(){k(this)});f("#ctc_child_all_0_swatch")}}};ctc_render_css_preview=function(v){if(1===loading.preview){return false}if(0==loading.preview){loading.preview=1;var v;if(!(v=c(this).attr("id").toString().match(/(child|parnt)/)[1])){v="child"}ctc_set_notice("");ctc_query_css("preview",v,ctc_render_css_preview);return false}if(2==loading.preview){c("#view_"+v+"_options_panel").text(ctcAjax.previewResponse);loading.preview=0}},ctc_render_rule_value_inputs=function(w){if(1===loading.rule_val){return false}if(0==loading.rule_val){loading.rule_val=1;ctc_query_css("rule_val",w,ctc_render_rule_value_inputs);return false}var x=ctcAjax.rule[w],v='<div class="ctc-input-row clearfix" id="ctc_rule_row_'+x+'">'+l;if(false===t(ctcAjax.rule_val[w])){c.each(ctcAjax.rule_val[w],function(z,A){var y=ctc_decode_value(x,A);v+='<div class="ctc-parent-row clearfix" id="ctc_rule_row_'+x+"_"+z+'">'+l;v+='<div class="ctc-input-cell ctc-parent-value" id="ctc_'+z+"_parent_"+x+"_"+z+'">'+y.orig+"</div>"+l;v+='<div class="ctc-input-cell">'+l;v+='<div class="ctc-swatch ctc-specific" id="ctc_'+z+"_parent_"+x+"_"+z+'_swatch">'+ctcAjax.swatch_txt+"</div></div>"+l;v+='<div class="ctc-input-cell"><a href="#" class="ctc-selector-handle" id="ctc_selector_'+x+"_"+z+'">'+ctcAjax.selector_txt+"</a></div>"+l;v+='<div id="ctc_selector_'+x+"_"+z+'_container" class="ctc-selector-container clearfix">'+l;v+='<a href="#" id="ctc_selector_'+x+"_"+z+'_close" class="ctc-selector-handle" style="float:right">'+ctcAjax.close_txt+'</a><div id="ctc_status_val_qry_'+z+'"></div>'+l;v+='<div id="ctc_selector_'+x+"_"+z+'_rows"></div>'+l;v+="</div></div>"+l});v+="</div>"+l}c("#ctc_rule_value_inputs").html(v).find(".ctc-swatch").each(function(){f(this)})},ctc_render_selector_value_inputs=function(y){if(1==loading.val_qry){return false}var A,w,z=c("#ctc_rule_menu_selected").text().replace(/[^\w\-]/g,m),v,x="";if(0===loading.val_qry){loading.val_qry=1;A={rule:z};ctc_query_css("val_qry",y,ctc_render_selector_value_inputs,A);return false}if(false===t(ctcAjax.val_qry[y])){c.each(ctcAjax.val_qry[y],function(C,B){page_rule=C;c.each(B,function(E,D){x+='<h4 class="ctc-query-heading">'+E+"</h4>"+l;if(false===t(D)){c.each(D,function(F,G){ctcAjax.sel_val[F]=G;x+=j(F,C,y)})}})})}v="#ctc_selector_"+z+"_"+y+"_rows";c(v).html(x).find(".color-picker").each(function(){k(this)});c(v).find(".ctc-swatch").each(function(){f(this)})},ctc_query_css=function(x,w,A,y){var v={ctc_query_obj:x,ctc_query_key:w},z="#ctc_status_"+x+("val_qry"==x?"_"+w:"");if("object"===typeof y){c.each(y,function(B,C){v["ctc_query_"+B]=C})}c(".ctc-status-icon").remove();c(z).append('<span class="ctc-status-icon spinner"></span>');c(".spinner").show();v.action="ctc_query";v._wpnonce=c("#_wpnonce").val();c.post(ctcAjax.ajaxurl,v,function(B){loading[x]=2;c(".ctc-status-icon").removeClass("spinner");if(t(B)){c(".ctc-status-icon").addClass("failure");if("preview"==x){ctcAjax.previewResponse=ctcAjax.css_fail_txt;A(w)}}else{c(".ctc-status-icon").addClass("success");if("preview"==x){ctcAjax.previewResponse=B.shift().data}else{o(B)}if("function"===typeof A){A(w)}return false}},"json").fail(function(){c(".ctc-status-icon").removeClass("spinner");c(".ctc-status-icon").addClass("failure");if("preview"==x){ctcAjax.previewResponse=ctcAjax.css_fail_txt;loading[x]=2;A(w)}else{loading[x]=0}});return false},ctc_save=function(A){var y={},B,x,v,w,C=c(A).attr("id"),z;if(t(b[C])){b[C]=0}b[C]++;c(A).prop("disabled",true);c(".ctc-status-icon").remove();c(A).parent(".ctc-textarea-button-cell, .ctc-button-cell").append('<span class="ctc-status-icon spinner"></span>');c(".spinner").show();if((B=c("#ctc_new_selectors"))&&"ctc_save_new_selectors"==c(A).attr("id")){y.ctc_new_selectors=B.val();if(x=c("#ctc_sel_ovrd_query_selected")){y.ctc_sel_ovrd_query=x.text()}}else{if((v=c("#ctc_child_imports"))&&"ctc_save_imports"==c(A).attr("id")){y.ctc_child_imports=v.val()}else{y=f(A)}}c("#ctc_sel_ovrd_selector_selected").find("#ctc_rewrite_selector").each(function(){z=c("#ctc_rewrite_selector").val(),origsel=c("#ctc_rewrite_selector_orig").val();if(t(z)||!z.toString().match(/\w/)){z=origsel}else{y.ctc_rewrite_selector=z}c(".ctc-rewrite-toggle").text(ctcAjax.rename_txt);c("#ctc_sel_ovrd_selector_selected").html(z)});y.action="ctc_update";y._wpnonce=c("#_wpnonce").val();c.post(ctcAjax.ajaxurl,y,function(D){c(A).prop("disabled",false);c(".ctc-status-icon").removeClass("spinner");if(t(D)){c(".ctc-status-icon").addClass("failure")}else{c(".ctc-status-icon").addClass("success");c("#ctc_new_selectors").val("");o(D);ctc_setup_menus();if(false===t(r)){ctc_set_selector(r,s);r=s=null}}return false},"json").fail(function(){c(A).prop("disabled",false);c(".ctc-status-icon").removeClass("spinner");c(".ctc-status-icon").addClass("failure")});return false},ctc_decode_value=function(x,v){v=("undefined"==typeof v?"":v);var w={orig:v};if(x.toString().match(/^border(\-(top|right|bottom|left))?$/)){var y=v.toString().split(/ +/);w.names=["_border_width","_border_style","_border_color"];w.values=[("undefined"==typeof y[0]?"":y[0]),("undefined"==typeof y[1]?"":y[1]),("undefined"==typeof y[2]?"":y[2])]}else{if(x.toString().match(/^background\-image/)){w.names=["_background_url","_background_origin","_background_color1","_background_color2"];w.values=["","","",""];if(false===(t(v))&&!(v.toString().match(/url/))){var y=v.toString().split(/:/);w.values[1]=("undefined"==typeof y[0]?"":y[0]);w.values[2]=("undefined"==typeof y[1]?"":y[1]);w.values[3]=("undefined"==typeof y[3]?"":y[3]);w.orig=[w.values[1],w.values[2],w.values[3]].join(" ")}else{w.values[0]=v}}else{w.names=[""];w.values=[v]}}return w},ctc_set_query=function(v){u=v;c("#ctc_sel_ovrd_query").val("");c("#ctc_sel_ovrd_query_selected").text(v);c("#ctc_sel_ovrd_selector").val("");c("#ctc_sel_ovrd_selector_selected").html(" ");c("#ctc_sel_ovrd_rule_inputs").html("");ctc_setup_selector_menu(v);f("#ctc_child_all_0_swatch");c("#ctc_new_selector_row").show()},ctc_set_selector=function(w,v){c("#ctc_sel_ovrd_selector").val("");c("#ctc_sel_ovrd_selector_selected").text(v);c("#ctc_sel_ovrd_qsid").val(w);h=w;if(1!=loading.sel_val){loading.sel_val=0}g(w);c(".ctc-rewrite-toggle").text(ctcAjax.rename_txt);c("#ctc_sel_ovrd_new_rule, #ctc_sel_ovrd_rule_header,#ctc_sel_ovrd_rule_inputs_container,#ctc_sel_ovrd_rule_inputs,.ctc-rewrite-toggle").show()},ctc_set_rule=function(w,v){c("#ctc_rule_menu").val("");c("#ctc_rule_menu_selected").text(v);if(1!=loading.rule_val){loading.rule_val=0}ctc_render_rule_value_inputs(w);c(".ctc-rewrite-toggle").text(ctcAjax.rename_txt);c("#ctc_rule_value_inputs,#ctc_input_row_rule_header").show()},ctc_setup_query_menu=function(){ctc_queries=a();c("#ctc_sel_ovrd_query").autocomplete({source:ctc_queries,minLength:0,selectFirst:true,autoFocus:true,select:function(w,v){ctc_set_query(v.item.value);return false},focus:function(v){v.preventDefault()}})},ctc_setup_selector_menu=function(v){ctc_selectors=q(v);c("#ctc_sel_ovrd_selector").autocomplete({source:ctc_selectors,selectFirst:true,autoFocus:true,select:function(x,w){ctc_set_selector(w.item.value,w.item.label);return false},focus:function(w){w.preventDefault()}})},ctc_setup_rule_menu=function(){ctc_rules=d();c("#ctc_rule_menu").autocomplete({source:ctc_rules,selectFirst:true,autoFocus:true,select:function(w,v){ctc_set_rule(v.item.value,v.item.label);return false},focus:function(v){v.preventDefault()}})},ctc_filtered_rules=function(y,w){var v=[],x=(t(ctcAjax.sel_val[h]))||(t(ctcAjax.sel_val[h].value));if(t(ctc_rules)){ctc_rules=d()}c.each(ctc_rules,function(z,C){var A=false,B=new RegExp(c.ui.autocomplete.escapeRegex(y.term),"i");if(B.test(C.label)){if(false===x){c.each(ctcAjax.sel_val[h].value,function(E,D){if(C.label==E.replace(/\d+/g,e)){A=true;return false}});if(A){return}}v.push(C)}});w(v)},ctc_setup_new_rule_menu=function(){c("#ctc_new_rule_menu").autocomplete({source:ctc_filtered_rules,selectFirst:true,autoFocus:true,select:function(w,v){w.preventDefault();var x=c(j(h,v.item.label.replace(/[^\w\-]/g,m),"ovrd"));c("#ctc_sel_ovrd_rule_inputs").append(x);c("#ctc_new_rule_menu").val("");if(t(ctcAjax.sel_val[h].value)){ctcAjax.sel_val[h]["value"]={}}ctcAjax.sel_val[h].value[v.item.label]={child:""};x.find('input[type="text"]').each(function(y,z){if(c(z).hasClass("color-picker")){k(z)}c(z).focus()});return false},focus:function(v){v.preventDefault()}})},ctc_setup_menus=function(){ctc_setup_query_menu();ctc_setup_selector_menu(u);ctc_setup_rule_menu();ctc_setup_new_rule_menu()},ctc_theme_exists=function(v,w){var x=false;c.each(ctcAjax.themes,function(y,z){c.each(z,function(A,B){if(A==v&&("parnt"==y||"new"==w)){x=true;return false}});if(x){return false}});return x},ctc_set_notice=function(v){var w="";if(false===t(v)){c.each(v,function(x,y){w+='<div class="'+x+'"><ul>'+l;c(y).each(function(z,A){w+="<li>"+A.toString()+"</li>"+l});w+="</ul></div>"})}c("#ctc_error_notice").html(w)},ctc_validate=function(){var y=/[^\w\-]/,w=c("#ctc_child_template").val().toString().replace(y).toLowerCase(),v=c("#ctc_theme_child").val().toString().replace(y).toLowerCase(),x=c("input[name=ctc_child_type]:checked").val(),z=[];if("new"==x){v=w}if(ctc_theme_exists(v,x)){z.push(ctcAjax.theme_exists_txt.toString().replace(/%s/,v))}if(""===v){z.push(ctcAjax.inval_theme_txt)}if(""===c("#ctc_child_name").val()){z.push(ctcAjax.inval_name_txt)}if(z.length){ctc_set_notice({error:z});return false}return true},ctc_set_theme_menu=function(w){var v=c("#ctc_theme_child").val();if(false===t(ctcAjax.themes.child[v])){c("#ctc_child_name").val(ctcAjax.themes.child[v].Name);c("#ctc_child_author").val(ctcAjax.themes.child[v].Author);c("#ctc_child_version").val(ctcAjax.themes.child[v].Version)}},fade_update_notice=function(){c(".updated, .error").slideUp("slow",function(){c(".updated").remove()})},ctc_focus_panel=function(w){var v=w+"_panel";c(".nav-tab").removeClass("nav-tab-active");c(".ctc-option-panel").removeClass("ctc-option-panel-active");c(".ctc-selector-container").hide();c(w).addClass("nav-tab-active");c(".ctc-option-panel-container").scrollTop(0);c(v).addClass("ctc-option-panel-active")},ctc_selector_edit=function(y){var v=c(y).attr("id").match(/_(\d+)$/)[1],x=ctcAjax.sel_val[v].query,w=ctcAjax.sel_val[v].selector,z="#query_selector_options";ctc_set_query(x);ctc_set_selector(v,w);ctc_focus_panel(z)},ctc_selector_input_toggle=function(w){var v;if(c("#ctc_rewrite_selector").length){v=c("#ctc_rewrite_selector_orig").val();c("#ctc_sel_ovrd_selector_selected").text(v);c(w).text(ctcAjax.rename_txt)}else{v=c("#ctc_sel_ovrd_selector_selected").text();c("#ctc_sel_ovrd_selector_selected").html('<input id="ctc_rewrite_selector" name="ctc_rewrite_selector" type="text" value="'+n(v)+'" autocomplete="off" /><input id="ctc_rewrite_selector_orig" name="ctc_rewrite_selector_orig" type="hidden" value="'+n(v)+'"/>');c(w).text(ctcAjax.cancel_txt)}};loading={rule:2,sel_ndx:2,val_qry:0,rule_val:0,sel_val:0,preview:0},ctc_selectors=[],ctc_queries=[],ctc_rules=[];c(".color-picker").each(function(){k(this)});c(".ctc-option-panel-container").on("focus",".color-picker",function(){ctc_set_notice("");c(this).iris("toggle");c(".iris-picker").css({position:"absolute","z-index":10})});c(".ctc-option-panel-container").on("focus","input",function(){ctc_set_notice("");c(".color-picker").not(this).iris("hide")});c(".ctc-option-panel-container").on("change",".ctc-child-value, input[type=checkbox]",function(){f(this)});c(".ctc-option-panel-container").on("click",".ctc-selector-handle",function(w){w.preventDefault();ctc_set_notice("");var x=c(this).attr("id").toString().replace("_close",""),v=x.toString().match(/_(\d+)$/)[1];if(c("#"+x+"_container").is(":hidden")){if(1!=loading.val_qry){loading.val_qry=0}ctc_render_selector_value_inputs(v)}c("#"+x+"_container").fadeToggle("fast");c(".ctc-selector-container").not("#"+x+"_container").fadeOut("fast")});c(".nav-tab").on("click",function(v){v.preventDefault();ctc_set_notice("");c(".ctc-status-icon").remove();var w="#"+c(this).attr("id");ctc_focus_panel(w)});c("#view_child_options,#view_parnt_options").on("click",ctc_render_css_preview);c("#ctc_load_form").on("submit",function(){return(ctc_validate()&&confirm(ctcAjax.load_txt))});c("#parent_child_options_panel").on("change","#ctc_theme_child",ctc_set_theme_menu);c(document).on("click",".ctc-save-input",function(v){ctc_save(this)});c(document).on("click",".ctc-selector-edit",function(v){ctc_selector_edit(this)});c(document).on("click",".ctc-rewrite-toggle",function(v){v.preventDefault();ctc_selector_input_toggle(this)});c(document).on("change","#ctc_theme_parnt",function(v){c(this).parents(".ctc-input-row").first().append('<span class="ctc-status-icon spinner"></span>');c(".spinner").show();document.location="?page=chld_thm_cfg_menu&ctc_parent="+c(this).val()});c(document).on("click","#ctc_additional_css_label",function(v){c(this).toggleClass("open");c("#ctc_additional_css_files").slideToggle("fast")});ctc_setup_menus();ctc_set_query(u);c("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.4.5.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(c){var l="\n",u="base",h,b={},r,s,p=new RegExp('"',"g"),n=function(v){return t(v)?v:v.toString().replace(p,""")},k=function(v){c(v).iris({change:function(){f(v)}})},e=function(x){var v=parseInt(x),w=String.fromCharCode(v);return w},m=function(w){var v=w.charCodeAt(0);return v},f=function(B){var x=/^(ctc_(ovrd|\d+)_(parent|child)_([0-9a-z\-]+)_(\d+))(_\w+)?$/,C=c(B).parents(".ctc-selector-row, .ctc-parent-row").first(),A=C.find(".ctc-swatch").first(),z={parent:{},child:{}},y={parent:{origin:"",start:"",end:""},child:{origin:"",start:"",end:""}},w={child:false,parent:false},v={};C.find(".ctc-parent-value, .ctc-child-value").each(function(){var K=c(this).attr("id"),D=K.toString().match(x),L=D[2],E=D[3],N=("undefined"==typeof D[4]?"":D[4]),J=D[5],I=("undefined"==typeof D[6]?"":D[6]),M=("parent"==E?c(this).text():c(this).val()),F="ctc_"+L+"_child_"+N+"_i_"+J,H,G;if("child"==E){v[K]=M;v[F]=(c("#"+F).is(":checked"))?1:0}if(""!=M){if(false===t(I)){switch(I){case"_border_width":z[E][N+"-width"]=M;break;case"_border_style":z[E][N+"-style"]=M;break;case"_border_color":z[E][N+"-color"]=M;break;case"_background_url":z[E]["background-image"]=i(E,M);break;case"_background_color":z[E]["background-color"]=B.value;break;case"_background_color1":y[E].start=M;w[E]=true;break;case"_background_color2":y[E].end=M;w[E]=true;break;case"_background_origin":y[E].origin=M;w[E]=true;break}}else{if(H=N.toString().match(/^border(\-(top|right|bottom|left))?$/)&&!M.match(/none/)){G=M.toString().split(/ +/);z[E][N+"-width"]="undefined"==typeof G[0]?"":G[0];z[E][N+"-style"]="undefined"==typeof G[1]?"":G[1];z[E][N+"-color"]="undefined"==typeof G[2]?"":G[2]}else{if("background-image"==N){if(M.toString().match(/url\(/)){z[E]["background-image"]=i(E,M)}else{G=M.toString().split(/ +/);if(G.length>2){y[E].origin="undefined"==typeof G[0]?"top":G[0];y[E].start="undefined"==typeof G[1]?"transparent":G[1];y[E].end="undefined"==typeof G[2]?"transparent":G[2];w[E]=true}else{z[E]["background-image"]=M}}}else{z[E][N]=M}}}}});if("undefined"!=typeof A&&false===t(A.attr("id"))){c(A).removeAttr("style");if(w.parent){c(A).ctcgrad(y.parent.origin,[y.parent.start,y.parent.end])}c(A).css(z.parent);if(!(A.attr("id").toString().match(/parent/))){if(w.child){c(A).ctcgrad(y.child.origin,[y.child.start,y.child.end])}c(A).css(z.child)}}return v},o=function(w){var v,x,y;c(w).each(function(){switch(this.obj){case"imports":ctcAjax.imports=this.data;break;case"rule_val":ctcAjax.rule_val[this.key]=this.data;y=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(t(this.key)){ctcAjax.sel_ndx=this.data}else{if("qsid"==this.key){if(t(ctcAjax.sel_ndx[this.data.query])){ctcAjax.sel_ndx[this.data.query]={}}ctcAjax.sel_ndx[this.data.query][this.data.selector]=this.data.qsid}else{ctcAjax.sel_ndx[this.key]=this.data;v=this.key}}break;case"sel_val":ctcAjax.sel_val[this.key]=this.data;x=this.key;break;case"rewrite":r=this.key;s=this.data;break}})},i=function(z,w){var y=w.toString().match(/url\(['" ]*(.+?)['" ]*\)/),x=t(y)?null:y[1],v=ctcAjax.theme_uri+"/"+("parent"==z?ctcAjax.parnt:ctcAjax.child)+"/",A;if(!x){return false}else{if(x.toString().match(/^(https?:|\/)/)){A=w}else{A="url("+v+x+")"}}return A},t=function(w){if("undefined"==typeof w||false===w||null===w||""===w){return true}if(true===w||"string"===typeof w||"number"===typeof w){return false}if("object"===typeof w){for(var v in w){if(w.hasOwnProperty(v)){return false}}return true}return false},a=function(){var v=[];if(1===loading.sel_ndx){return v}if(0===loading.sel_ndx){loading.sel_ndx=1;ctc_query_css("sel_ndx",null,ctc_setup_query_menu);return v}if(false===t(ctcAjax.sel_ndx)){c.each(ctcAjax.sel_ndx,function(w,x){var y={label:w,value:w};v.push(y)})}return v},q=function(w){var v=[];if(1===loading.sel_ndx){return v}if(0===loading.sel_ndx){loading.sel_ndx=1;ctc_query_css("sel_ndx",w,ctc_setup_selector_menu);return v}if(false===t(ctcAjax.sel_ndx[w])){c.each(ctcAjax.sel_ndx[w],function(x,y){var z={label:x,value:y};v.push(z)})}return v},d=function(){var v=[];if(1===loading.rule){return v}if(0===loading.rule){loading.rule=1;ctc_query_css("rule",null,ctc_setup_rule_menu);return v}if(false===t(ctcAjax.rule)){c.each(ctcAjax.rule,function(w,x){var y={label:x.replace(/\d+/g,e),value:w};v.push(y)})}return v.sort(function(x,w){if(x.label>w.label){return 1}if(x.label<w.label){return -1}return 0})},j=function(z,B,E){var x="",C=(t(ctcAjax.sel_val[z])||t(ctcAjax.sel_val[z].value)||t(ctcAjax.sel_val[z].value[B])?"":ctcAjax.sel_val[z].value[B]),w=ctc_decode_value(B,("undefined"==typeof C?"":C.parnt)),A=(false===t(C.i_parnt)&&C.i_parnt)?ctcAjax.important_label:"",y=ctc_decode_value(B,("undefined"==typeof C?"":C.child)),v=(false===t(C.i_child)&&C.i_child)?1:0,D="ctc_"+E+"_child_"+B+"_i_"+z;if(false===t(ctcAjax.sel_val[z])){x+='<div class="ctc-'+("ovrd"==E?"input":"selector")+'-row clearfix">'+l;x+='<div class="ctc-input-cell">'+("ovrd"==E?B.replace(/\d+/g,e):ctcAjax.sel_val[z].selector+'<br/><a href="#" class="ctc-selector-edit" id="ctc_selector_edit_'+z+'" >'+ctcAjax.edit_txt+"</a> "+(t(w.orig)?ctcAjax.child_only_txt:""))+"</div>"+l;if("ovrd"==E){x+='<div class="ctc-parent-value ctc-input-cell" id="ctc_'+E+"_parent_"+B+"_"+z+'">'+(t(w.orig)?"[no value]":w.orig+A)+"</div>"+l}x+='<div class="ctc-input-cell">'+l;if(false===t(w.names)){c.each(w.names,function(F,G){G=(t(G)?"":G);x+='<div class="ctc-child-input-cell">'+l;var I="ctc_"+E+"_child_"+B+"_"+z+G,H;if(false===(H=y.values.shift())){H=""}x+=(t(G)?"":ctcAjax.field_labels[G]+":<br/>")+'<input type="text" id="'+I+'" name="'+I+'" class="ctc-child-value'+((G+B).toString().match(/color/)?" color-picker":"")+((G).toString().match(/url/)?" ctc-input-wide":"")+'" value="'+n(H)+'" />'+l;x+="</div>"+l});x+='<label for="'+D+'"><input type="checkbox" id="'+D+'" name="'+D+'" value="1" '+(1===v?"checked":"")+" />"+ctcAjax.important_label+"</label>"+l}x+="</div>"+l;x+=("ovrd"==E?"":'<div class="ctc-swatch ctc-specific" id="ctc_child_'+B+"_"+z+'_swatch">'+ctcAjax.swatch_txt+"</div>"+l+'<div class="ctc-child-input-cell ctc-button-cell" id="ctc_save_'+B+"_"+z+'_cell">'+l+'<input type="button" class="button ctc-save-input" id="ctc_save_'+B+"_"+z+'" name="ctc_save_'+B+"_"+z+'" value="Save" /></div>'+l);x+="</div><!-- end input row -->"+l}return x},g=function(v){if(1===loading.sel_val){return false}if(0==loading.sel_val){loading.sel_val=1;ctc_query_css("sel_val",v,g);return false}var y,w,x;if(t(ctcAjax.sel_val[v])){c("#ctc_sel_ovrd_rule_inputs").html("")}else{if(t(ctcAjax.sel_val[v].seq)){c("#ctc_child_load_order_container").html("")}else{y="ctc_ovrd_child_seq_"+v;x=parseInt(ctcAjax.sel_val[v].seq);w='<input type="text" id="'+y+'" name="'+y+'" class="ctc-child-value" value="'+x+'" />';c("#ctc_child_load_order_container").html(w)}if(t(ctcAjax.sel_val[v].value)){c("#ctc_sel_ovrd_rule_inputs").html("")}else{w="";c.each(ctcAjax.sel_val[v].value,function(A,z){w+=j(v,A,"ovrd")});c("#ctc_sel_ovrd_rule_inputs").html(w).find(".color-picker").each(function(){k(this)});f("#ctc_child_all_0_swatch")}}};ctc_render_css_preview=function(v){if(1===loading.preview){return false}if(0==loading.preview){loading.preview=1;var v;if(!(v=c(this).attr("id").toString().match(/(child|parnt)/)[1])){v="child"}ctc_set_notice("");ctc_query_css("preview",v,ctc_render_css_preview);return false}if(2==loading.preview){c("#view_"+v+"_options_panel").text(ctcAjax.previewResponse);loading.preview=0}},ctc_render_rule_value_inputs=function(w){if(1===loading.rule_val){return false}if(0==loading.rule_val){loading.rule_val=1;ctc_query_css("rule_val",w,ctc_render_rule_value_inputs);return false}var x=ctcAjax.rule[w],v='<div class="ctc-input-row clearfix" id="ctc_rule_row_'+x+'">'+l;if(false===t(ctcAjax.rule_val[w])){c.each(ctcAjax.rule_val[w],function(z,A){var y=ctc_decode_value(x,A);v+='<div class="ctc-parent-row clearfix" id="ctc_rule_row_'+x+"_"+z+'">'+l;v+='<div class="ctc-input-cell ctc-parent-value" id="ctc_'+z+"_parent_"+x+"_"+z+'">'+y.orig+"</div>"+l;v+='<div class="ctc-input-cell">'+l;v+='<div class="ctc-swatch ctc-specific" id="ctc_'+z+"_parent_"+x+"_"+z+'_swatch">'+ctcAjax.swatch_txt+"</div></div>"+l;v+='<div class="ctc-input-cell"><a href="#" class="ctc-selector-handle" id="ctc_selector_'+x+"_"+z+'">'+ctcAjax.selector_txt+"</a></div>"+l;v+='<div id="ctc_selector_'+x+"_"+z+'_container" class="ctc-selector-container clearfix">'+l;v+='<a href="#" id="ctc_selector_'+x+"_"+z+'_close" class="ctc-selector-handle" style="float:right">'+ctcAjax.close_txt+'</a><div id="ctc_status_val_qry_'+z+'"></div>'+l;v+='<div id="ctc_selector_'+x+"_"+z+'_rows"></div>'+l;v+="</div></div>"+l});v+="</div>"+l}c("#ctc_rule_value_inputs").html(v).find(".ctc-swatch").each(function(){f(this)})},ctc_render_selector_value_inputs=function(y){if(1==loading.val_qry){return false}var A,w,z=c("#ctc_rule_menu_selected").text().replace(/[^\w\-]/g,m),v,x="";if(0===loading.val_qry){loading.val_qry=1;A={rule:z};ctc_query_css("val_qry",y,ctc_render_selector_value_inputs,A);return false}if(false===t(ctcAjax.val_qry[y])){c.each(ctcAjax.val_qry[y],function(C,B){page_rule=C;c.each(B,function(E,D){x+='<h4 class="ctc-query-heading">'+E+"</h4>"+l;if(false===t(D)){c.each(D,function(F,G){ctcAjax.sel_val[F]=G;x+=j(F,C,y)})}})})}v="#ctc_selector_"+z+"_"+y+"_rows";c(v).html(x).find(".color-picker").each(function(){k(this)});c(v).find(".ctc-swatch").each(function(){f(this)})},ctc_query_css=function(x,w,A,y){var v={ctc_query_obj:x,ctc_query_key:w},z="#ctc_status_"+x+("val_qry"==x?"_"+w:"");if("object"===typeof y){c.each(y,function(B,C){v["ctc_query_"+B]=C})}c(".ctc-status-icon").remove();c(z).append('<span class="ctc-status-icon spinner"></span>');c(".spinner").show();v.action="ctc_query";v._wpnonce=c("#_wpnonce").val();c.post(ctcAjax.ajaxurl,v,function(B){loading[x]=2;c(".ctc-status-icon").removeClass("spinner");if(t(B)){c(".ctc-status-icon").addClass("failure");if("preview"==x){ctcAjax.previewResponse=ctcAjax.css_fail_txt;A(w)}}else{c(".ctc-status-icon").addClass("success");if("preview"==x){ctcAjax.previewResponse=B.shift().data}else{o(B)}if("function"===typeof A){A(w)}return false}},"json").fail(function(){c(".ctc-status-icon").removeClass("spinner");c(".ctc-status-icon").addClass("failure");if("preview"==x){ctcAjax.previewResponse=ctcAjax.css_fail_txt;loading[x]=2;A(w)}else{loading[x]=0}});return false},ctc_save=function(A){var y={},B,x,v,w,C=c(A).attr("id"),z;if(t(b[C])){b[C]=0}b[C]++;c(A).prop("disabled",true);c(".ctc-status-icon").remove();c(A).parent(".ctc-textarea-button-cell, .ctc-button-cell").append('<span class="ctc-status-icon spinner"></span>');c(".spinner").show();if((B=c("#ctc_new_selectors"))&&"ctc_save_new_selectors"==c(A).attr("id")){y.ctc_new_selectors=B.val();if(x=c("#ctc_sel_ovrd_query_selected")){y.ctc_sel_ovrd_query=x.text()}}else{if((v=c("#ctc_child_imports"))&&"ctc_save_imports"==c(A).attr("id")){y.ctc_child_imports=v.val()}else{y=f(A)}}c("#ctc_sel_ovrd_selector_selected").find("#ctc_rewrite_selector").each(function(){z=c("#ctc_rewrite_selector").val(),origsel=c("#ctc_rewrite_selector_orig").val();if(t(z)||!z.toString().match(/\w/)){z=origsel}else{y.ctc_rewrite_selector=z}c(".ctc-rewrite-toggle").text(ctcAjax.rename_txt);c("#ctc_sel_ovrd_selector_selected").html(z)});y.action="ctc_update";y._wpnonce=c("#_wpnonce").val();c.post(ctcAjax.ajaxurl,y,function(D){c(A).prop("disabled",false);c(".ctc-status-icon").removeClass("spinner");if(t(D)){c(".ctc-status-icon").addClass("failure")}else{c(".ctc-status-icon").addClass("success");c("#ctc_new_selectors").val("");o(D);ctc_setup_menus();if(false===t(r)){ctc_set_selector(r,s);r=s=null}}return false},"json").fail(function(){c(A).prop("disabled",false);c(".ctc-status-icon").removeClass("spinner");c(".ctc-status-icon").addClass("failure")});return false},ctc_decode_value=function(x,v){v=("undefined"==typeof v?"":v);var w={orig:v};if(x.toString().match(/^border(\-(top|right|bottom|left))?$/)){var y=v.toString().split(/ +/);w.names=["_border_width","_border_style","_border_color"];w.values=[("undefined"==typeof y[0]?"":y[0]),("undefined"==typeof y[1]?"":y[1]),("undefined"==typeof y[2]?"":y[2])]}else{if(x.toString().match(/^background\-image/)){w.names=["_background_url","_background_origin","_background_color1","_background_color2"];w.values=["","","",""];if(false===(t(v))&&!(v.toString().match(/url/))){var y=v.toString().split(/:/);w.values[1]=("undefined"==typeof y[0]?"":y[0]);w.values[2]=("undefined"==typeof y[1]?"":y[1]);w.values[3]=("undefined"==typeof y[3]?"":y[3]);w.orig=[w.values[1],w.values[2],w.values[3]].join(" ")}else{w.values[0]=v}}else{w.names=[""];w.values=[v]}}return w},ctc_set_query=function(v){u=v;c("#ctc_sel_ovrd_query").val("");c("#ctc_sel_ovrd_query_selected").text(v);c("#ctc_sel_ovrd_selector").val("");c("#ctc_sel_ovrd_selector_selected").html(" ");c("#ctc_sel_ovrd_rule_inputs").html("");ctc_setup_selector_menu(v);f("#ctc_child_all_0_swatch");c("#ctc_new_selector_row").show()},ctc_set_selector=function(w,v){c("#ctc_sel_ovrd_selector").val("");c("#ctc_sel_ovrd_selector_selected").text(v);c("#ctc_sel_ovrd_qsid").val(w);h=w;if(1!=loading.sel_val){loading.sel_val=0}g(w);c(".ctc-rewrite-toggle").text(ctcAjax.rename_txt);c("#ctc_sel_ovrd_new_rule, #ctc_sel_ovrd_rule_header,#ctc_sel_ovrd_rule_inputs_container,#ctc_sel_ovrd_rule_inputs,.ctc-rewrite-toggle").show()},ctc_set_rule=function(w,v){c("#ctc_rule_menu").val("");c("#ctc_rule_menu_selected").text(v);if(1!=loading.rule_val){loading.rule_val=0}ctc_render_rule_value_inputs(w);c(".ctc-rewrite-toggle").text(ctcAjax.rename_txt);c("#ctc_rule_value_inputs,#ctc_input_row_rule_header").show()},ctc_setup_query_menu=function(){ctc_queries=a();c("#ctc_sel_ovrd_query").autocomplete({source:ctc_queries,minLength:0,selectFirst:true,autoFocus:true,select:function(w,v){ctc_set_query(v.item.value);return false},focus:function(v){v.preventDefault()}})},ctc_setup_selector_menu=function(v){ctc_selectors=q(v);c("#ctc_sel_ovrd_selector").autocomplete({source:ctc_selectors,selectFirst:true,autoFocus:true,select:function(x,w){ctc_set_selector(w.item.value,w.item.label);return false},focus:function(w){w.preventDefault()}})},ctc_setup_rule_menu=function(){ctc_rules=d();c("#ctc_rule_menu").autocomplete({source:ctc_rules,selectFirst:true,autoFocus:true,select:function(w,v){ctc_set_rule(v.item.value,v.item.label);return false},focus:function(v){v.preventDefault()}})},ctc_filtered_rules=function(y,w){var v=[],x=(t(ctcAjax.sel_val[h]))||(t(ctcAjax.sel_val[h].value));if(t(ctc_rules)){ctc_rules=d()}c.each(ctc_rules,function(z,C){var A=false,B=new RegExp(c.ui.autocomplete.escapeRegex(y.term),"i");if(B.test(C.label)){if(false===x){c.each(ctcAjax.sel_val[h].value,function(E,D){if(C.label==E.replace(/\d+/g,e)){A=true;return false}});if(A){return}}v.push(C)}});w(v)},ctc_setup_new_rule_menu=function(){c("#ctc_new_rule_menu").autocomplete({source:ctc_filtered_rules,selectFirst:true,autoFocus:true,select:function(w,v){w.preventDefault();var x=c(j(h,v.item.label.replace(/[^\w\-]/g,m),"ovrd"));c("#ctc_sel_ovrd_rule_inputs").append(x);c("#ctc_new_rule_menu").val("");if(t(ctcAjax.sel_val[h].value)){ctcAjax.sel_val[h]["value"]={}}ctcAjax.sel_val[h].value[v.item.label]={child:""};x.find('input[type="text"]').each(function(y,z){if(c(z).hasClass("color-picker")){k(z)}c(z).focus()});return false},focus:function(v){v.preventDefault()}})},ctc_setup_menus=function(){ctc_setup_query_menu();ctc_setup_selector_menu(u);ctc_setup_rule_menu();ctc_setup_new_rule_menu()},ctc_theme_exists=function(v,w){var x=false;c.each(ctcAjax.themes,function(y,z){c.each(z,function(A,B){if(A==v&&("parnt"==y||"new"==w)){x=true;return false}});if(x){return false}});return x},ctc_set_notice=function(v){var w="";if(false===t(v)){c.each(v,function(x,y){w+='<div class="'+x+'"><ul>'+l;c(y).each(function(z,A){w+="<li>"+A.toString()+"</li>"+l});w+="</ul></div>"})}c("#ctc_error_notice").html(w)},ctc_validate=function(){var y=/[^\w\-]/,w=c("#ctc_child_template").val().toString().replace(y).toLowerCase(),v=c("#ctc_theme_child").val().toString().replace(y).toLowerCase(),x=c("input[name=ctc_child_type]:checked").val(),z=[];if("new"==x){v=w}if(ctc_theme_exists(v,x)){z.push(ctcAjax.theme_exists_txt.toString().replace(/%s/,v))}if(""===v){z.push(ctcAjax.inval_theme_txt)}if(""===c("#ctc_child_name").val()){z.push(ctcAjax.inval_name_txt)}if(z.length){ctc_set_notice({error:z});return false}return true},ctc_set_theme_menu=function(w){var v=c("#ctc_theme_child").val();if(false===t(ctcAjax.themes.child[v])){c("#ctc_child_name").val(ctcAjax.themes.child[v].Name);c("#ctc_child_author").val(ctcAjax.themes.child[v].Author);c("#ctc_child_version").val(ctcAjax.themes.child[v].Version)}},fade_update_notice=function(){c(".updated, .error").slideUp("slow",function(){c(".updated").remove()})},ctc_focus_panel=function(w){var v=w+"_panel";c(".nav-tab").removeClass("nav-tab-active");c(".ctc-option-panel").removeClass("ctc-option-panel-active");c(".ctc-selector-container").hide();c(w).addClass("nav-tab-active");c(".ctc-option-panel-container").scrollTop(0);c(v).addClass("ctc-option-panel-active")},ctc_selector_edit=function(y){var v=c(y).attr("id").match(/_(\d+)$/)[1],x=ctcAjax.sel_val[v].query,w=ctcAjax.sel_val[v].selector,z="#query_selector_options";ctc_set_query(x);ctc_set_selector(v,w);ctc_focus_panel(z)},ctc_selector_input_toggle=function(w){var v;if(c("#ctc_rewrite_selector").length){v=c("#ctc_rewrite_selector_orig").val();c("#ctc_sel_ovrd_selector_selected").text(v);c(w).text(ctcAjax.rename_txt)}else{v=c("#ctc_sel_ovrd_selector_selected").text();c("#ctc_sel_ovrd_selector_selected").html('<input id="ctc_rewrite_selector" name="ctc_rewrite_selector" type="text" value="'+n(v)+'" autocomplete="off" /><input id="ctc_rewrite_selector_orig" name="ctc_rewrite_selector_orig" type="hidden" value="'+n(v)+'"/>');c(w).text(ctcAjax.cancel_txt)}};loading={rule:2,sel_ndx:2,val_qry:0,rule_val:0,sel_val:0,preview:0},ctc_selectors=[],ctc_queries=[],ctc_rules=[];c(".color-picker").each(function(){k(this)});c(".ctc-option-panel-container").on("focus",".color-picker",function(){ctc_set_notice("");c(this).iris("toggle");c(".iris-picker").css({position:"absolute","z-index":10})});c(".ctc-option-panel-container").on("focus","input",function(){ctc_set_notice("");c(".color-picker").not(this).iris("hide")});c(".ctc-option-panel-container").on("change",".ctc-child-value, input[type=checkbox]",function(){f(this)});c(".ctc-option-panel-container").on("click",".ctc-selector-handle",function(w){w.preventDefault();ctc_set_notice("");var x=c(this).attr("id").toString().replace("_close",""),v=x.toString().match(/_(\d+)$/)[1];if(c("#"+x+"_container").is(":hidden")){if(1!=loading.val_qry){loading.val_qry=0}ctc_render_selector_value_inputs(v)}c("#"+x+"_container").fadeToggle("fast");c(".ctc-selector-container").not("#"+x+"_container").fadeOut("fast")});c(".nav-tab").on("click",function(v){v.preventDefault();ctc_set_notice("");c(".ctc-status-icon").remove();var w="#"+c(this).attr("id");ctc_focus_panel(w)});c("#view_child_options,#view_parnt_options").on("click",ctc_render_css_preview);c("#ctc_load_form").on("submit",function(){return(ctc_validate()&&confirm(ctcAjax.load_txt))});c("#parent_child_options_panel").on("change","#ctc_theme_child",ctc_set_theme_menu);c(document).on("click",".ctc-save-input",function(v){ctc_save(this)});c(document).on("click",".ctc-selector-edit",function(v){ctc_selector_edit(this)});c(document).on("click",".ctc-rewrite-toggle",function(v){v.preventDefault();ctc_selector_input_toggle(this)});c(document).on("change","#ctc_theme_parnt",function(v){c(this).parents(".ctc-input-row").first().append('<span class="ctc-status-icon spinner"></span>');c(".spinner").show();document.location="?page=chld_thm_cfg_menu&ctc_parent="+c(this).val()});c(document).on("click","#ctc_additional_css_label",function(v){c(this).toggleClass("open");c("#ctc_additional_css_files").slideToggle("fast")});ctc_setup_menus();ctc_set_query(u);c("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.7
|
6 |
Tested up to: 3.9.1
|
7 |
-
Stable tag: 1.4.5.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -179,6 +179,9 @@ You can also create a secondary stylesheet that contains @font-face rules and im
|
|
179 |
|
180 |
== Changelog ==
|
181 |
|
|
|
|
|
|
|
182 |
= 1.4.5.1 =
|
183 |
* Fix: regression bug - sanitizing broke raw input selectors
|
184 |
|
@@ -294,7 +297,8 @@ You can also create a secondary stylesheet that contains @font-face rules and im
|
|
294 |
|
295 |
== Upgrade Notice ==
|
296 |
|
297 |
-
= 1.4.5.
|
|
|
298 |
* Fixed regression bug introduced in 1.4.5 that broke raw css input
|
299 |
|
300 |
== Create Your Child Theme ==
|
4 |
Tags: child theme, custom theme, CSS, responsive design, CSS editor, theme generator
|
5 |
Requires at least: 3.7
|
6 |
Tested up to: 3.9.1
|
7 |
+
Stable tag: 1.4.5.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
179 |
|
180 |
== Changelog ==
|
181 |
|
182 |
+
= 1.4.5.2 =
|
183 |
+
* Fix: javascript bug
|
184 |
+
|
185 |
= 1.4.5.1 =
|
186 |
* Fix: regression bug - sanitizing broke raw input selectors
|
187 |
|
297 |
|
298 |
== Upgrade Notice ==
|
299 |
|
300 |
+
= 1.4.5.2 =
|
301 |
+
* Fixed JavaScript bug introduced in 1.4.5
|
302 |
* Fixed regression bug introduced in 1.4.5 that broke raw css input
|
303 |
|
304 |
== Create Your Child Theme ==
|