Version Description
- New features: Link to Query/Selector tab from specific Rule/Value selector, new rule focus on adding new rule. Bugs fixed: clear Query/Selector inputs when loaded selector is empty, use latest min.js script.
Download this release
Release Info
Developer | lilaeamedia |
Plugin | Child Theme Configurator |
Version | 1.2.0 |
Comparing to | |
See all releases |
Code changes from version 1.1.9 to 1.2.0
- child-theme-configurator.php +1 -1
- includes/class-ctc-css.php +2 -2
- includes/class-ctc-ui.php +1 -1
- includes/class-ctc.php +3 -2
- js/chld-thm-cfg.js +45 -19
- js/chld-thm-cfg.min.js +2 -2
- lang/chld_thm_cfg.pot +24 -14
- readme.txt +7 -1
child-theme-configurator.php
CHANGED
@@ -6,7 +6,7 @@ if ( !defined('ABSPATH')) exit;
|
|
6 |
Plugin Name: Child Theme Configurator
|
7 |
Plugin URI: http://www.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.
|
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 a Child Theme from any installed Theme. Each CSS selector, rule and value can then be searched, previewed and modified.
|
9 |
+
Version: 1.2.0
|
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.
|
10 |
Author: Lilaea Media
|
11 |
Author URI: http://www.lilaeamedia.com/
|
12 |
Text Domain: chld_thm_cfg
|
@@ -43,7 +43,7 @@ class Child_Theme_Configurator_CSS {
|
|
43 |
|
44 |
function __construct() {
|
45 |
// scalars
|
46 |
-
$this->version = '1.
|
47 |
$this->querykey = 0;
|
48 |
$this->selkey = 0;
|
49 |
$this->qskey = 0;
|
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.2.0
|
10 |
Author: Lilaea Media
|
11 |
Author URI: http://www.lilaeamedia.com/
|
12 |
Text Domain: chld_thm_cfg
|
43 |
|
44 |
function __construct() {
|
45 |
// scalars
|
46 |
+
$this->version = '1.2.0';
|
47 |
$this->querykey = 0;
|
48 |
$this->selkey = 0;
|
49 |
$this->qskey = 0;
|
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.
|
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.2.0
|
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.
|
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.
|
22 |
var $css;
|
23 |
var $optionsName;
|
24 |
var $menuName;
|
@@ -95,6 +95,7 @@ class Child_Theme_Configurator {
|
|
95 |
'important_label' => __('<span style="font-size:10px">!</span>', 'chld_thm_cfg'),
|
96 |
'selector_txt' => __('Selectors', 'chld_thm_cfg'),
|
97 |
'close_txt' => __('Close', 'chld_thm_cfg'),
|
|
|
98 |
'css_fail_txt' => __('The stylesheet cannot be displayed.', 'chld_thm_cfg'),
|
99 |
'child_only_txt' => __('(Child Only)', 'chld_thm_cfg'),
|
100 |
'inval_theme_txt' => __('Please enter a valid Child Theme', '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.2.0
|
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.2.0';
|
22 |
var $css;
|
23 |
var $optionsName;
|
24 |
var $menuName;
|
95 |
'important_label' => __('<span style="font-size:10px">!</span>', 'chld_thm_cfg'),
|
96 |
'selector_txt' => __('Selectors', 'chld_thm_cfg'),
|
97 |
'close_txt' => __('Close', 'chld_thm_cfg'),
|
98 |
+
'edit_txt' => __('Edit', 'chld_thm_cfg'),
|
99 |
'css_fail_txt' => __('The stylesheet cannot be displayed.', 'chld_thm_cfg'),
|
100 |
'child_only_txt' => __('(Child Only)', 'chld_thm_cfg'),
|
101 |
'inval_theme_txt' => __('Please enter a valid Child Theme', '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.
|
6 |
* Author: Lilaea Media
|
7 |
* Author URI: http://www.lilaeamedia.com/
|
8 |
* License: GPLv2
|
@@ -290,7 +290,9 @@ jQuery(document).ready(function($){
|
|
290 |
if (false === ctc_is_empty(ctcAjax.sel_val[qsid])) {
|
291 |
html += '<div class="ctc-' + ('ovrd' == seq ? 'input' : 'selector' ) + '-row clearfix">' + lf;
|
292 |
html += '<div class="ctc-input-cell">' + ('ovrd' == seq ? rule : ctcAjax.sel_val[qsid].selector
|
293 |
-
+
|
|
|
|
|
294 |
if ('ovrd' == seq) {
|
295 |
html += '<div class="ctc-parent-value ctc-input-cell" id="ctc_' + seq + '_parent_' + rule + '_' + qsid + '">'
|
296 |
+ (ctc_is_empty(oldRuleObj.orig) ? '[no value]' : oldRuleObj.orig + oldRuleFlag) + '</div>' + lf;
|
@@ -337,14 +339,20 @@ jQuery(document).ready(function($){
|
|
337 |
return false;
|
338 |
}
|
339 |
var id, html, val;
|
340 |
-
if (
|
341 |
-
|
|
|
|
|
|
|
|
|
342 |
id = 'ctc_ovrd_child_seq_' + qsid;
|
343 |
val = parseInt(ctcAjax.sel_val[qsid].seq);
|
344 |
html = '<input type="text" id="' + id + '" name="' + id + '" class="ctc-child-value" value="' + val + '" />';
|
345 |
$('#ctc_child_load_order_container').html(html);
|
346 |
}
|
347 |
-
if (
|
|
|
|
|
348 |
html = '';
|
349 |
$.each(ctcAjax.sel_val[qsid].value, function(rule, value) {
|
350 |
html += ctc_render_child_rule_input(qsid, rule, 'ovrd');
|
@@ -742,18 +750,19 @@ jQuery(document).ready(function($){
|
|
742 |
selectFirst: true,
|
743 |
autoFocus: true,
|
744 |
select: function(e, ui) {
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
if ($(this).hasClass('color-picker'))
|
749 |
-
ctc_setup_iris($(this));
|
750 |
-
$(this).focus();
|
751 |
-
});
|
752 |
$('#ctc_new_rule_menu').val('');
|
753 |
if (ctc_is_empty(ctcAjax.sel_val[currentSel].value)) {
|
754 |
ctcAjax.sel_val[currentSel]['value'] = {};
|
755 |
}
|
756 |
ctcAjax.sel_val[currentSel].value[ui.item.label] = {'child': ''};
|
|
|
|
|
|
|
|
|
|
|
757 |
return false;
|
758 |
},
|
759 |
focus: function(e) { e.preventDefault(); }
|
@@ -825,6 +834,25 @@ jQuery(document).ready(function($){
|
|
825 |
fade_update_notice = function() {
|
826 |
$('.updated, .error').slideUp('slow', function(){ $('.updated').remove(); });
|
827 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
828 |
// initialize vars
|
829 |
// ajax semaphores: 0 = reload, 1 = loading, 2 = loaded
|
830 |
loading = {
|
@@ -873,13 +901,8 @@ jQuery(document).ready(function($){
|
|
873 |
e.preventDefault();
|
874 |
// clear the notice box
|
875 |
ctc_set_notice('')
|
876 |
-
var id = '#' + $(this).attr('id')
|
877 |
-
|
878 |
-
$('.ctc-option-panel').removeClass('ctc-option-panel-active');
|
879 |
-
$('.ctc-selector-container').hide();
|
880 |
-
$(id).addClass('nav-tab-active');
|
881 |
-
$('.ctc-option-panel-container').scrollTop(0);
|
882 |
-
$(panelid).addClass('ctc-option-panel-active');
|
883 |
});
|
884 |
$('#view_child_options,#view_parnt_options').on('click', function(e){
|
885 |
ctc_set_notice('')
|
@@ -902,6 +925,9 @@ jQuery(document).ready(function($){
|
|
902 |
$(document).on('click', '.ctc-save-input', function(e) {
|
903 |
ctc_save(this);
|
904 |
});
|
|
|
|
|
|
|
905 |
// initialize menus
|
906 |
ctc_setup_menus();
|
907 |
ctc_set_query(currentQuery);
|
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.2.0
|
6 |
* Author: Lilaea Media
|
7 |
* Author URI: http://www.lilaeamedia.com/
|
8 |
* License: GPLv2
|
290 |
if (false === ctc_is_empty(ctcAjax.sel_val[qsid])) {
|
291 |
html += '<div class="ctc-' + ('ovrd' == seq ? 'input' : 'selector' ) + '-row clearfix">' + lf;
|
292 |
html += '<div class="ctc-input-cell">' + ('ovrd' == seq ? rule : ctcAjax.sel_val[qsid].selector
|
293 |
+
+ '<br/><a href="#" class="ctc-selector-edit" id="ctc_selector_edit_' + qsid + '" >' + ctcAjax.edit_txt + '</a> '
|
294 |
+
+ (ctc_is_empty(oldRuleObj.orig) ? ctcAjax.child_only_txt : ''))
|
295 |
+
+ '</div>' + lf;
|
296 |
if ('ovrd' == seq) {
|
297 |
html += '<div class="ctc-parent-value ctc-input-cell" id="ctc_' + seq + '_parent_' + rule + '_' + qsid + '">'
|
298 |
+ (ctc_is_empty(oldRuleObj.orig) ? '[no value]' : oldRuleObj.orig + oldRuleFlag) + '</div>' + lf;
|
339 |
return false;
|
340 |
}
|
341 |
var id, html, val;
|
342 |
+
if (ctc_is_empty(ctcAjax.sel_val[qsid])) {
|
343 |
+
$('#ctc_sel_ovrd_rule_inputs').html('')
|
344 |
+
} else {
|
345 |
+
if (ctc_is_empty(ctcAjax.sel_val[qsid].seq)) {
|
346 |
+
$('#ctc_child_load_order_container').html('');
|
347 |
+
} else {
|
348 |
id = 'ctc_ovrd_child_seq_' + qsid;
|
349 |
val = parseInt(ctcAjax.sel_val[qsid].seq);
|
350 |
html = '<input type="text" id="' + id + '" name="' + id + '" class="ctc-child-value" value="' + val + '" />';
|
351 |
$('#ctc_child_load_order_container').html(html);
|
352 |
}
|
353 |
+
if (ctc_is_empty(ctcAjax.sel_val[qsid].value)){
|
354 |
+
$('#ctc_sel_ovrd_rule_inputs').html('');
|
355 |
+
} else {
|
356 |
html = '';
|
357 |
$.each(ctcAjax.sel_val[qsid].value, function(rule, value) {
|
358 |
html += ctc_render_child_rule_input(qsid, rule, 'ovrd');
|
750 |
selectFirst: true,
|
751 |
autoFocus: true,
|
752 |
select: function(e, ui) {
|
753 |
+
e.preventDefault();
|
754 |
+
var n = $(ctc_render_child_rule_input(currentSel, ui.item.label, 'ovrd'));
|
755 |
+
$('#ctc_sel_ovrd_rule_inputs').append(n);
|
|
|
|
|
|
|
|
|
756 |
$('#ctc_new_rule_menu').val('');
|
757 |
if (ctc_is_empty(ctcAjax.sel_val[currentSel].value)) {
|
758 |
ctcAjax.sel_val[currentSel]['value'] = {};
|
759 |
}
|
760 |
ctcAjax.sel_val[currentSel].value[ui.item.label] = {'child': ''};
|
761 |
+
n.find('input[type="text"]').each(function(ndx, el){
|
762 |
+
if ($(el).hasClass('color-picker'))
|
763 |
+
ctc_setup_iris(el);
|
764 |
+
$(el).focus();
|
765 |
+
});
|
766 |
return false;
|
767 |
},
|
768 |
focus: function(e) { e.preventDefault(); }
|
834 |
fade_update_notice = function() {
|
835 |
$('.updated, .error').slideUp('slow', function(){ $('.updated').remove(); });
|
836 |
},
|
837 |
+
ctc_focus_panel = function(id) {
|
838 |
+
var panelid = id + '_panel';
|
839 |
+
$('.nav-tab').removeClass('nav-tab-active');
|
840 |
+
$('.ctc-option-panel').removeClass('ctc-option-panel-active');
|
841 |
+
$('.ctc-selector-container').hide();
|
842 |
+
$(id).addClass('nav-tab-active');
|
843 |
+
$('.ctc-option-panel-container').scrollTop(0);
|
844 |
+
$(panelid).addClass('ctc-option-panel-active');
|
845 |
+
},
|
846 |
+
ctc_selector_edit = function(obj) {
|
847 |
+
var qsid = $(obj).attr('id').match(/_(\d+)$/)[1],
|
848 |
+
q = ctcAjax.sel_val[qsid].query,
|
849 |
+
s = ctcAjax.sel_val[qsid].selector,
|
850 |
+
id = '#query_selector_options';
|
851 |
+
ctc_set_query(q);
|
852 |
+
ctc_set_selector(qsid, s);
|
853 |
+
ctc_focus_panel(id);
|
854 |
+
|
855 |
+
},
|
856 |
// initialize vars
|
857 |
// ajax semaphores: 0 = reload, 1 = loading, 2 = loaded
|
858 |
loading = {
|
901 |
e.preventDefault();
|
902 |
// clear the notice box
|
903 |
ctc_set_notice('')
|
904 |
+
var id = '#' + $(this).attr('id');
|
905 |
+
ctc_focus_panel(id);
|
|
|
|
|
|
|
|
|
|
|
906 |
});
|
907 |
$('#view_child_options,#view_parnt_options').on('click', function(e){
|
908 |
ctc_set_notice('')
|
925 |
$(document).on('click', '.ctc-save-input', function(e) {
|
926 |
ctc_save(this);
|
927 |
});
|
928 |
+
$(document).on('click', '.ctc-selector-edit', function(e) {
|
929 |
+
ctc_selector_edit(this);
|
930 |
+
});
|
931 |
// initialize menus
|
932 |
ctc_setup_menus();
|
933 |
ctc_set_query(currentQuery);
|
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.
|
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="base",a,m={},o=function(p){g(p).iris({change:function(){j(p)}})},j=function(v){var r=/^(ctc_(ovrd|\d+)_(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 E=g(this).attr("id"),x=E.toString().match(r),F=x[2],y=x[3],H=("undefined"==typeof x[4]?"":x[4]),D=x[5],C=("undefined"==typeof x[6]?"":x[6]),G=("parent"==y?g(this).text():g(this).val()),z="ctc_"+F+"_child_"+H+"_i_"+D,B,A;if("child"==y){p[E]=G;p[z]=(g("#"+z).is(":checked"))?1:0}if(""===G){g("#"+z).prop("checked",false);return}if(false===b(C)){switch(C){case"_border_width":t[y][H+"-width"]=G;break;case"_border_style":t[y][H+"-style"]=G;break;case"_border_color":t[y][H+"-color"]=G;break;case"_background_url":t[y]["background-image"]=d(y,G);break;case"_background_color":t[y]["background-color"]=v.value;break;case"_background_color1":s[y].start=G;q[y]=true;break;case"_background_color2":s[y].end=G;q[y]=true;break;case"_background_origin":s[y].origin=G;q[y]=true;break}}else{if(B=H.toString().match(/^border(\-(top|right|bottom|left))?$/)&&!G.match(/none/)){A=G.toString().split(/ +/);t[y][H+"-width"]="undefined"==typeof A[0]?"":A[0];t[y][H+"-style"]="undefined"==typeof A[1]?"":A[1];t[y][H+"-color"]="undefined"==typeof A[2]?"":A[2]}else{if("background-image"==H){if(G.toString().match(/url\(/)){t[y]["background-image"]=d(y,G)}else{A=G.toString().split(/ +/);if(A.length>2){s[y].origin="undefined"==typeof A[0]?"top":A[0];s[y].start="undefined"==typeof A[1]?"transparent":A[1];s[y].end="undefined"==typeof A[2]?"transparent":A[2];q[y]=true}else{t[y]["background-image"]=G}}}else{t[y][H]=G}}}});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){if(b(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;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(/^(https?:|\/)/)){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(t,v,y){var r="",w=(b(ctcAjax.sel_val[t])||b(ctcAjax.sel_val[t].value)||b(ctcAjax.sel_val[t].value[v])?"":ctcAjax.sel_val[t].value[v]),q=ctc_decode_value(v,("undefined"==typeof w?"":w.parnt)),u=(false===b(w.i_parnt)&&w.i_parnt)?ctcAjax.important_label:"",s=ctc_decode_value(v,("undefined"==typeof w?"":w.child)),p=(false===b(w.i_child)&&w.i_child)?1:0,x="ctc_"+y+"_child_"+v+"_i_"+t;if(false===b(ctcAjax.sel_val[t])){r+='<div class="ctc-'+("ovrd"==y?"input":"selector")+'-row clearfix">'+n;r+='<div class="ctc-input-cell">'+("ovrd"==y?v:ctcAjax.sel_val[t].selector+(b(q.orig)?"<br/>"+ctcAjax.child_only_txt:""))+"</div>"+n;if("ovrd"==y){r+='<div class="ctc-parent-value ctc-input-cell" id="ctc_'+y+"_parent_"+v+"_"+t+'">'+(b(q.orig)?"[no value]":q.orig+u)+"</div>"+n}r+='<div class="ctc-input-cell">'+n;if(false===b(q.names)){g.each(q.names,function(z,A){A=(b(A)?"":A);r+='<div class="ctc-child-input-cell">'+n;var C="ctc_"+y+"_child_"+v+"_"+t+A,B;if(false===(B=s.values.shift())){B=""}r+=(b(A)?"":ctcAjax.field_labels[A]+":<br/>")+'<input type="text" id="'+C+'" name="'+C+'" class="ctc-child-value'+((A+v).toString().match(/color/)?" color-picker":"")+((A).toString().match(/url/)?" ctc-input-wide":"")+'" value="'+B+'" />'+n;r+="</div>"+n});r+='<label for="'+x+'"><input type="checkbox" id="'+x+'" name="'+x+'" value="1" '+(1===p?"checked":"")+" />"+ctcAjax.important_label+"</label>"+n}r+="</div>"+n;r+=("ovrd"==y?"":'<div class="ctc-swatch ctc-specific" id="ctc_child_'+v+"_"+t+'_swatch">'+ctcAjax.swatch_txt+"</div>"+n+'<div class="ctc-child-input-cell ctc-button-cell" id="ctc_save_'+v+"_"+t+'_cell">'+n+'<input type="button" class="button ctc-save-input" id="ctc_save_'+v+"_"+t+'" name="ctc_save_'+v+"_"+t+'" value="Save" /></div>'+n);r+="</div><!-- end input row -->"+n}return r},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 s,q,r;if(false===b(ctcAjax.sel_val[p])){if(false===b(ctcAjax.sel_val[p].seq)){s="ctc_ovrd_child_seq_"+p;r=parseInt(ctcAjax.sel_val[p].seq);q='<input type="text" id="'+s+'" name="'+s+'" class="ctc-child-value" value="'+r+'" />';g("#ctc_child_load_order_container").html(q)}if(false===b(ctcAjax.sel_val[p].value)){q="";g.each(ctcAjax.sel_val[p].value,function(u,t){q+=h(p,u,"ovrd")});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_'+t+"_parent_"+r+"_"+t+'">'+s.orig+"</div>"+n;p+='<div class="ctc-input-cell">'+n;p+='<div class="ctc-swatch ctc-specific" id="ctc_'+t+"_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,s)})}})})}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(false===(b(p))&&!(p.toString().match(/url/))){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){k=p;g("#ctc_sel_ovrd_query").val("");g("#ctc_sel_ovrd_query_selected").text(p);g("#ctc_sel_ovrd_selector").val("");g("#ctc_sel_ovrd_selector_selected").html(" ");g("#ctc_sel_ovrd_rule_inputs").html("");ctc_setup_selector_menu(p);j("#ctc_child_all_0_swatch");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(s,q){var p=[],r=(b(ctcAjax.sel_val[a]))||(b(ctcAjax.sel_val[a].value));if(b(ctc_rules)){ctc_rules=l()}g.each(ctc_rules,function(t,w){var u=false,v=new RegExp(g.ui.autocomplete.escapeRegex(s.term),"i");if(v.test(w.label)){if(false===r){g.each(ctcAjax.sel_val[a].value,function(y,x){if(w.label==y){u=true;return false}});if(u){return}}p.push(w)}});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,"ovrd")).find(".ctc-child-value").each(function(){if(g(this).hasClass("color-picker")){o(g(this))}g(this).focus()});g("#ctc_new_rule_menu").val("");if(b(ctcAjax.sel_val[a].value)){ctcAjax.sel_val[a]["value"]={}}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, .error").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, input[type=checkbox]",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();ctc_set_query(k);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.2.0
|
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="base",a,m={},o=function(p){g(p).iris({change:function(){j(p)}})},j=function(v){var r=/^(ctc_(ovrd|\d+)_(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 E=g(this).attr("id"),x=E.toString().match(r),F=x[2],y=x[3],H=("undefined"==typeof x[4]?"":x[4]),D=x[5],C=("undefined"==typeof x[6]?"":x[6]),G=("parent"==y?g(this).text():g(this).val()),z="ctc_"+F+"_child_"+H+"_i_"+D,B,A;if("child"==y){p[E]=G;p[z]=(g("#"+z).is(":checked"))?1:0}if(""===G){g("#"+z).prop("checked",false);return}if(false===b(C)){switch(C){case"_border_width":t[y][H+"-width"]=G;break;case"_border_style":t[y][H+"-style"]=G;break;case"_border_color":t[y][H+"-color"]=G;break;case"_background_url":t[y]["background-image"]=d(y,G);break;case"_background_color":t[y]["background-color"]=v.value;break;case"_background_color1":s[y].start=G;q[y]=true;break;case"_background_color2":s[y].end=G;q[y]=true;break;case"_background_origin":s[y].origin=G;q[y]=true;break}}else{if(B=H.toString().match(/^border(\-(top|right|bottom|left))?$/)&&!G.match(/none/)){A=G.toString().split(/ +/);t[y][H+"-width"]="undefined"==typeof A[0]?"":A[0];t[y][H+"-style"]="undefined"==typeof A[1]?"":A[1];t[y][H+"-color"]="undefined"==typeof A[2]?"":A[2]}else{if("background-image"==H){if(G.toString().match(/url\(/)){t[y]["background-image"]=d(y,G)}else{A=G.toString().split(/ +/);if(A.length>2){s[y].origin="undefined"==typeof A[0]?"top":A[0];s[y].start="undefined"==typeof A[1]?"transparent":A[1];s[y].end="undefined"==typeof A[2]?"transparent":A[2];q[y]=true}else{t[y]["background-image"]=G}}}else{t[y][H]=G}}}});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){if(b(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;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(/^(https?:|\/)/)){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(t,v,y){var r="",w=(b(ctcAjax.sel_val[t])||b(ctcAjax.sel_val[t].value)||b(ctcAjax.sel_val[t].value[v])?"":ctcAjax.sel_val[t].value[v]),q=ctc_decode_value(v,("undefined"==typeof w?"":w.parnt)),u=(false===b(w.i_parnt)&&w.i_parnt)?ctcAjax.important_label:"",s=ctc_decode_value(v,("undefined"==typeof w?"":w.child)),p=(false===b(w.i_child)&&w.i_child)?1:0,x="ctc_"+y+"_child_"+v+"_i_"+t;if(false===b(ctcAjax.sel_val[t])){r+='<div class="ctc-'+("ovrd"==y?"input":"selector")+'-row clearfix">'+n;r+='<div class="ctc-input-cell">'+("ovrd"==y?v:ctcAjax.sel_val[t].selector+'<br/><a href="#" class="ctc-selector-edit" id="ctc_selector_edit_'+t+'" >'+ctcAjax.edit_txt+"</a> "+(b(q.orig)?ctcAjax.child_only_txt:""))+"</div>"+n;if("ovrd"==y){r+='<div class="ctc-parent-value ctc-input-cell" id="ctc_'+y+"_parent_"+v+"_"+t+'">'+(b(q.orig)?"[no value]":q.orig+u)+"</div>"+n}r+='<div class="ctc-input-cell">'+n;if(false===b(q.names)){g.each(q.names,function(z,A){A=(b(A)?"":A);r+='<div class="ctc-child-input-cell">'+n;var C="ctc_"+y+"_child_"+v+"_"+t+A,B;if(false===(B=s.values.shift())){B=""}r+=(b(A)?"":ctcAjax.field_labels[A]+":<br/>")+'<input type="text" id="'+C+'" name="'+C+'" class="ctc-child-value'+((A+v).toString().match(/color/)?" color-picker":"")+((A).toString().match(/url/)?" ctc-input-wide":"")+'" value="'+B+'" />'+n;r+="</div>"+n});r+='<label for="'+x+'"><input type="checkbox" id="'+x+'" name="'+x+'" value="1" '+(1===p?"checked":"")+" />"+ctcAjax.important_label+"</label>"+n}r+="</div>"+n;r+=("ovrd"==y?"":'<div class="ctc-swatch ctc-specific" id="ctc_child_'+v+"_"+t+'_swatch">'+ctcAjax.swatch_txt+"</div>"+n+'<div class="ctc-child-input-cell ctc-button-cell" id="ctc_save_'+v+"_"+t+'_cell">'+n+'<input type="button" class="button ctc-save-input" id="ctc_save_'+v+"_"+t+'" name="ctc_save_'+v+"_"+t+'" value="Save" /></div>'+n);r+="</div><!-- end input row -->"+n}return r},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 s,q,r;if(b(ctcAjax.sel_val[p])){g("#ctc_sel_ovrd_rule_inputs").html("")}else{if(b(ctcAjax.sel_val[p].seq)){g("#ctc_child_load_order_container").html("")}else{s="ctc_ovrd_child_seq_"+p;r=parseInt(ctcAjax.sel_val[p].seq);q='<input type="text" id="'+s+'" name="'+s+'" class="ctc-child-value" value="'+r+'" />';g("#ctc_child_load_order_container").html(q)}if(b(ctcAjax.sel_val[p].value)){g("#ctc_sel_ovrd_rule_inputs").html("")}else{q="";g.each(ctcAjax.sel_val[p].value,function(u,t){q+=h(p,u,"ovrd")});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_'+t+"_parent_"+r+"_"+t+'">'+s.orig+"</div>"+n;p+='<div class="ctc-input-cell">'+n;p+='<div class="ctc-swatch ctc-specific" id="ctc_'+t+"_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,s)})}})})}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(false===(b(p))&&!(p.toString().match(/url/))){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){k=p;g("#ctc_sel_ovrd_query").val("");g("#ctc_sel_ovrd_query_selected").text(p);g("#ctc_sel_ovrd_selector").val("");g("#ctc_sel_ovrd_selector_selected").html(" ");g("#ctc_sel_ovrd_rule_inputs").html("");ctc_setup_selector_menu(p);j("#ctc_child_all_0_swatch");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(s,q){var p=[],r=(b(ctcAjax.sel_val[a]))||(b(ctcAjax.sel_val[a].value));if(b(ctc_rules)){ctc_rules=l()}g.each(ctc_rules,function(t,w){var u=false,v=new RegExp(g.ui.autocomplete.escapeRegex(s.term),"i");if(v.test(w.label)){if(false===r){g.each(ctcAjax.sel_val[a].value,function(y,x){if(w.label==y){u=true;return false}});if(u){return}}p.push(w)}});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){q.preventDefault();var r=g(h(a,p.item.label,"ovrd"));g("#ctc_sel_ovrd_rule_inputs").append(r);g("#ctc_new_rule_menu").val("");if(b(ctcAjax.sel_val[a].value)){ctcAjax.sel_val[a]["value"]={}}ctcAjax.sel_val[a].value[p.item.label]={child:""};r.find('input[type="text"]').each(function(s,t){if(g(t).hasClass("color-picker")){o(t)}g(t).focus()});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, .error").slideUp("slow",function(){g(".updated").remove()})},ctc_focus_panel=function(q){var p=q+"_panel";g(".nav-tab").removeClass("nav-tab-active");g(".ctc-option-panel").removeClass("ctc-option-panel-active");g(".ctc-selector-container").hide();g(q).addClass("nav-tab-active");g(".ctc-option-panel-container").scrollTop(0);g(p).addClass("ctc-option-panel-active")},ctc_selector_edit=function(u){var p=g(u).attr("id").match(/_(\d+)$/)[1],t=ctcAjax.sel_val[p].query,r=ctcAjax.sel_val[p].selector,v="#query_selector_options";ctc_set_query(t);ctc_set_selector(p,r);ctc_focus_panel(v)},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, input[type=checkbox]",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(p){p.preventDefault();ctc_set_notice("");var q="#"+g(this).attr("id");ctc_focus_panel(q)});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)});g(document).on("click",".ctc-selector-edit",function(p){ctc_selector_edit(this)});ctc_setup_menus();ctc_set_query(k);g("input[type=submit],input[type=button]").prop("disabled",false);setTimeout(fade_update_notice,6000)});
|
lang/chld_thm_cfg.pot
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
-
# Copyright (C) 2014
|
2 |
# This file is distributed under the same license as the Child Theme Configurator package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Child Theme Configurator 1.1.
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/child-theme-configurator\n"
|
7 |
-
"POT-Creation-Date: 2014-01-
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -416,7 +416,7 @@ msgstr ""
|
|
416 |
msgid "WordPress Answers"
|
417 |
msgstr ""
|
418 |
|
419 |
-
#. #-#-#-#-#
|
420 |
#. Plugin Name of the plugin/theme
|
421 |
#: includes/class-ctc.php:43
|
422 |
msgid "Child Theme Configurator"
|
@@ -467,48 +467,58 @@ msgid "Close"
|
|
467 |
msgstr ""
|
468 |
|
469 |
#: includes/class-ctc.php:98
|
470 |
-
msgid "
|
471 |
msgstr ""
|
472 |
|
473 |
#: includes/class-ctc.php:99
|
474 |
-
msgid "
|
475 |
msgstr ""
|
476 |
|
477 |
#: includes/class-ctc.php:100
|
|
|
|
|
|
|
|
|
478 |
msgid "Please enter a valid Child Theme"
|
479 |
msgstr ""
|
480 |
|
481 |
-
#: includes/class-ctc.php:
|
482 |
msgid "Please enter a valid Child Theme name"
|
483 |
msgstr ""
|
484 |
|
485 |
-
#: includes/class-ctc.php:
|
486 |
msgid "<strong>%s</strong> exists. Please enter a different Child Theme"
|
487 |
msgstr ""
|
488 |
|
489 |
-
#: includes/class-ctc.php:
|
490 |
msgid "%s does not exist. Please select a valid Parent Theme"
|
491 |
msgstr ""
|
492 |
|
493 |
-
#: includes/class-ctc.php:
|
494 |
msgid "Please select a valid Parent Theme"
|
495 |
msgstr ""
|
496 |
|
497 |
-
#: includes/class-ctc.php:
|
498 |
msgid ""
|
499 |
"<strong>%s</strong> exists. Please enter a different Child Theme template "
|
500 |
"name"
|
501 |
msgstr ""
|
502 |
|
503 |
-
#: includes/class-ctc.php:
|
504 |
msgid "Please enter a valid Child Theme template name"
|
505 |
msgstr ""
|
506 |
|
507 |
-
#: includes/class-ctc.php:
|
508 |
msgid "You do not have permission to configure child themes."
|
509 |
msgstr ""
|
510 |
|
511 |
-
#: includes/class-ctc.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
512 |
msgid "Child Theme %s was unchanged."
|
513 |
msgstr ""
|
514 |
|
1 |
+
# Copyright (C) 2014 Lilaea Media LLC
|
2 |
# This file is distributed under the same license as the Child Theme Configurator package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Child Theme Configurator 1.1.9\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/child-theme-configurator\n"
|
7 |
+
"POT-Creation-Date: 2014-01-30 13:44:59+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
416 |
msgid "WordPress Answers"
|
417 |
msgstr ""
|
418 |
|
419 |
+
#. #-#-#-#-# pot.txt (Child Theme Configurator 1.1.9) #-#-#-#-#
|
420 |
#. Plugin Name of the plugin/theme
|
421 |
#: includes/class-ctc.php:43
|
422 |
msgid "Child Theme Configurator"
|
467 |
msgstr ""
|
468 |
|
469 |
#: includes/class-ctc.php:98
|
470 |
+
msgid "Edit"
|
471 |
msgstr ""
|
472 |
|
473 |
#: includes/class-ctc.php:99
|
474 |
+
msgid "The stylesheet cannot be displayed."
|
475 |
msgstr ""
|
476 |
|
477 |
#: includes/class-ctc.php:100
|
478 |
+
msgid "(Child Only)"
|
479 |
+
msgstr ""
|
480 |
+
|
481 |
+
#: includes/class-ctc.php:101
|
482 |
msgid "Please enter a valid Child Theme"
|
483 |
msgstr ""
|
484 |
|
485 |
+
#: includes/class-ctc.php:102 includes/class-ctc.php:221
|
486 |
msgid "Please enter a valid Child Theme name"
|
487 |
msgstr ""
|
488 |
|
489 |
+
#: includes/class-ctc.php:103
|
490 |
msgid "<strong>%s</strong> exists. Please enter a different Child Theme"
|
491 |
msgstr ""
|
492 |
|
493 |
+
#: includes/class-ctc.php:206
|
494 |
msgid "%s does not exist. Please select a valid Parent Theme"
|
495 |
msgstr ""
|
496 |
|
497 |
+
#: includes/class-ctc.php:209
|
498 |
msgid "Please select a valid Parent Theme"
|
499 |
msgstr ""
|
500 |
|
501 |
+
#: includes/class-ctc.php:214
|
502 |
msgid ""
|
503 |
"<strong>%s</strong> exists. Please enter a different Child Theme template "
|
504 |
"name"
|
505 |
msgstr ""
|
506 |
|
507 |
+
#: includes/class-ctc.php:218
|
508 |
msgid "Please enter a valid Child Theme template name"
|
509 |
msgstr ""
|
510 |
|
511 |
+
#: includes/class-ctc.php:224
|
512 |
msgid "You do not have permission to configure child themes."
|
513 |
msgstr ""
|
514 |
|
515 |
+
#: includes/class-ctc.php:236
|
516 |
+
msgid ""
|
517 |
+
"Your theme directory is not writable. Please adjust permissions and try "
|
518 |
+
"again."
|
519 |
+
msgstr ""
|
520 |
+
|
521 |
+
#: includes/class-ctc.php:243
|
522 |
msgid "Child Theme %s was unchanged."
|
523 |
msgstr ""
|
524 |
|
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.8
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -121,6 +121,9 @@ You can also create a secondary stylesheet that contains @font-face rules and im
|
|
121 |
|
122 |
== Changelog ==
|
123 |
|
|
|
|
|
|
|
124 |
= 1.1.9 =
|
125 |
* Added check for writability before attempting to create child theme files to avoid fatal error on servers not running suEXEC. Fixed a bug in the ctc_update_cache function that was throwing a fatal JS error when new media queries were saved via the Raw CSS input. Configurator now adds functions.php file to child theme when it does not exist.
|
126 |
|
@@ -174,6 +177,9 @@ You can also create a secondary stylesheet that contains @font-face rules and im
|
|
174 |
|
175 |
== Upgrade Notice ==
|
176 |
|
|
|
|
|
|
|
177 |
= 1.1.9 =
|
178 |
* Several bugs fixed/improvements made, see change log for details.
|
179 |
|
4 |
Tags: child theme, custom theme, CSS, responsive design, CSS editor, theme generator
|
5 |
Requires at least: 3.7
|
6 |
Tested up to: 3.8
|
7 |
+
Stable tag: 1.2.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
121 |
|
122 |
== Changelog ==
|
123 |
|
124 |
+
= 1.2.0 =
|
125 |
+
* New features: Link to Query/Selector tab from specific Rule/Value selector, new rule focus on adding new rule. Bugs fixed: clear Query/Selector inputs when loaded selector is empty, use latest min.js script.
|
126 |
+
|
127 |
= 1.1.9 =
|
128 |
* Added check for writability before attempting to create child theme files to avoid fatal error on servers not running suEXEC. Fixed a bug in the ctc_update_cache function that was throwing a fatal JS error when new media queries were saved via the Raw CSS input. Configurator now adds functions.php file to child theme when it does not exist.
|
129 |
|
177 |
|
178 |
== Upgrade Notice ==
|
179 |
|
180 |
+
= 1.2.0 =
|
181 |
+
* New features: Link to Query/Selector tab from specific Rule/Value selector, new rule focus on adding new rule. Bugs fixed: clear Query/Selector inputs when loaded selector is empty, use latest min.js script.
|
182 |
+
|
183 |
= 1.1.9 =
|
184 |
* Several bugs fixed/improvements made, see change log for details.
|
185 |
|