Version Description
- Added call to reset_updates() before update_option() to prevent serialization errors.
Download this release
Release Info
Developer | lilaeamedia |
Plugin | Child Theme Configurator |
Version | 1.1.6 |
Comparing to | |
See all releases |
Code changes from version 1.1.5 to 1.1.6
- child-theme-configurator.php +2 -2
- css/chld-thm-cfg.css +112 -81
- includes/class-ctc-css.php +2 -2
- includes/class-ctc-ui.php +1 -1
- includes/class-ctc.php +10 -5
- js/chld-thm-cfg.js +2 -2
- js/chld-thm-cfg.min.js +2 -2
- readme.txt +17 -10
- screenshot-1.jpg +0 -0
- screenshot-2.jpg +0 -0
- screenshot-3.jpg +0 -0
- screenshot-4.jpg +0 -0
- screenshot-5.jpg +0 -0
child-theme-configurator.php
CHANGED
@@ -5,8 +5,8 @@ if ( !defined('ABSPATH')) exit;
|
|
5 |
/*
|
6 |
Plugin Name: Child Theme Configurator
|
7 |
Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
|
8 |
-
Description: Create Child Theme from any Theme
|
9 |
-
Version: 1.1.
|
10 |
Author: Lilaea Media
|
11 |
Author URI: http://www.lilaeamedia.com/
|
12 |
Text Domain: chld_thm_cfg
|
5 |
/*
|
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.1.6
|
10 |
Author: Lilaea Media
|
11 |
Author URI: http://www.lilaeamedia.com/
|
12 |
Text Domain: chld_thm_cfg
|
css/chld-thm-cfg.css
CHANGED
@@ -1,153 +1,185 @@
|
|
|
|
1 |
.nav-tab, .nav-tab:focus, .nav-tab:active {
|
2 |
outline: none;
|
3 |
}
|
|
|
4 |
.nav-tab-active {
|
5 |
-
|
6 |
}
|
|
|
7 |
.ctc-option-panel-container {
|
8 |
-
position:relative;
|
9 |
-
min-height:600px;
|
10 |
-
max-height:800px;
|
11 |
-
overflow:auto;
|
12 |
-
border-bottom:1px solid #f9f9f9;
|
13 |
}
|
|
|
14 |
#view_child_options_panel, #view_parnt_options_panel {
|
15 |
-
white-space:pre;
|
16 |
-
overflow:auto;
|
17 |
-
font-family:monospace;
|
18 |
-
word-wrap:normal;
|
19 |
}
|
|
|
20 |
.ctc-option-panel {
|
21 |
visibility: hidden;
|
22 |
-
position:absolute;
|
23 |
-
width:96%;
|
24 |
-
top:0;
|
25 |
-
left:0;
|
26 |
-
padding:10px 2%;
|
27 |
}
|
|
|
28 |
.ctc-option-panel-active {
|
29 |
visibility: visible;
|
30 |
}
|
|
|
31 |
.ctc-swatch {
|
32 |
-
display:block;
|
33 |
-
float:left;
|
34 |
-
font-size:16px;
|
35 |
-
padding:0;
|
36 |
-
line-height:1;
|
37 |
overflow: hidden;
|
38 |
}
|
|
|
39 |
.ctc-hidden {
|
40 |
-
display:none;
|
41 |
}
|
|
|
42 |
.ctc-swatch.ctc-specific {
|
43 |
-
min-height:60px;
|
44 |
-
max-height:100px;
|
45 |
-
max-width:100px;
|
46 |
-
margin:0 2% 0 0;
|
47 |
-
/*color:#7f7f7f;
|
48 |
border: 1px solid #ddd;*/
|
49 |
}
|
|
|
50 |
.ctc-parent-row {
|
51 |
-
clear:both;
|
52 |
-
position:relative;
|
53 |
-
margin:4px 0;
|
54 |
}
|
|
|
55 |
.ctc-parent-value {
|
56 |
}
|
|
|
57 |
.ctc-input-cell {
|
58 |
-
display:block;
|
59 |
-
float:left;
|
60 |
-
width:25%;
|
61 |
-
max-width:250px;
|
62 |
-
margin-right:2.13%;
|
63 |
}
|
|
|
64 |
.ctc-input-cell-wide {
|
65 |
-
display:block;
|
66 |
-
float:left;
|
67 |
-
width:70%;
|
68 |
-
margin-right:2.13%;
|
69 |
}
|
|
|
70 |
.ctc-input-cell-wide textarea {
|
71 |
-
width:100%;
|
72 |
-
height:200px;
|
73 |
-
white-space:pre;
|
74 |
-
overflow:auto;
|
75 |
-
font-family:monospace;
|
76 |
-
word-wrap:normal;
|
77 |
}
|
|
|
78 |
.ctc-save-input {
|
79 |
}
|
|
|
80 |
.ctc-button-cell, .ctc-input-cell.ctc-button-cell {
|
81 |
-
width:85px;
|
82 |
}
|
|
|
83 |
.ctc-textarea-button-cell {
|
84 |
-
margin:15px 0;
|
85 |
-
width:85px;
|
86 |
}
|
|
|
87 |
.ctc-selector-link {
|
88 |
}
|
|
|
89 |
.ctc-selector-handle {
|
90 |
}
|
|
|
91 |
.ctc-selector-container {
|
92 |
-
clear:both;
|
93 |
-
background
|
94 |
-
border:1px solid #ddd;
|
95 |
-
padding:10px;
|
96 |
-
min-height:300px;
|
97 |
-
max-height:500px;
|
98 |
-
position:absolute;
|
99 |
-
width:90%;
|
100 |
overflow: auto;
|
101 |
-
left:0;
|
102 |
-
top:30px;
|
103 |
-
display:none;
|
104 |
-
z-index:99999;
|
|
|
|
|
|
|
105 |
}
|
|
|
106 |
.ctc-query-heading {
|
107 |
}
|
|
|
108 |
.ctc-selector-row {
|
109 |
-
clear:both;
|
110 |
margin: 0;
|
111 |
-
padding:8px 0;
|
112 |
border-top: 1px solid #ddd;
|
113 |
border-bottom: 1px solid #fff;
|
114 |
}
|
|
|
115 |
.ctc-input-row {
|
116 |
-
clear:both;
|
117 |
-
margin:4px 0;
|
118 |
-
padding:4px 0;
|
119 |
border-bottom: 1px solid #ddd;
|
120 |
}
|
|
|
121 |
.ctc-selector-value {
|
122 |
}
|
|
|
123 |
.ctc-selector-cell {
|
124 |
-
float:left;
|
125 |
-
width:30%;
|
126 |
-
margin-right:2%;
|
127 |
}
|
|
|
128 |
.ctc-child-input-cell {
|
129 |
-
display:block;
|
130 |
-
float:left;
|
131 |
-
margin-right:2.13%;
|
132 |
-
|
133 |
}
|
|
|
134 |
.ctc-child-input-cell-container {
|
135 |
-
float:left;
|
136 |
-
width:40%;
|
137 |
-
margin-right:2%;
|
138 |
}
|
|
|
139 |
.ctc-child-input-cell-container label {
|
140 |
-
float:left;
|
141 |
-
clear:both;
|
142 |
-
width:100px;
|
143 |
-
margin-right:2%;
|
144 |
}
|
|
|
145 |
.ctc-child-input-cell input[type="text"] {
|
146 |
-
|
147 |
}
|
|
|
148 |
.ctc-child-input-cell input[type="text"].ctc-input-wide {
|
149 |
-
width:200px;
|
150 |
}
|
|
|
151 |
.clearfix:after, .clearfix:before {
|
152 |
content: ' ';
|
153 |
display: table;
|
@@ -162,4 +194,3 @@
|
|
162 |
.ie7 .clearfix {
|
163 |
zoom: 1;
|
164 |
}
|
165 |
-
|
1 |
+
|
2 |
.nav-tab, .nav-tab:focus, .nav-tab:active {
|
3 |
outline: none;
|
4 |
}
|
5 |
+
|
6 |
.nav-tab-active {
|
7 |
+
/*background-color:#f9f9f9;*/
|
8 |
}
|
9 |
+
|
10 |
.ctc-option-panel-container {
|
11 |
+
position: relative;
|
12 |
+
min-height: 600px;
|
13 |
+
max-height: 800px;
|
14 |
+
overflow: auto;
|
15 |
+
border-bottom: 1px solid #f9f9f9;
|
16 |
}
|
17 |
+
|
18 |
#view_child_options_panel, #view_parnt_options_panel {
|
19 |
+
white-space: pre;
|
20 |
+
overflow: auto;
|
21 |
+
font-family: monospace;
|
22 |
+
word-wrap: normal;
|
23 |
}
|
24 |
+
|
25 |
.ctc-option-panel {
|
26 |
visibility: hidden;
|
27 |
+
position: absolute;
|
28 |
+
width: 96%;
|
29 |
+
top: 0;
|
30 |
+
left: 0;
|
31 |
+
padding: 10px 2%;
|
32 |
}
|
33 |
+
|
34 |
.ctc-option-panel-active {
|
35 |
visibility: visible;
|
36 |
}
|
37 |
+
|
38 |
.ctc-swatch {
|
39 |
+
display: block;
|
40 |
+
float: left;
|
41 |
+
font-size: 16px;
|
42 |
+
padding: 0;
|
43 |
+
line-height: 1;
|
44 |
overflow: hidden;
|
45 |
}
|
46 |
+
|
47 |
.ctc-hidden {
|
48 |
+
display: none;
|
49 |
}
|
50 |
+
|
51 |
.ctc-swatch.ctc-specific {
|
52 |
+
min-height: 60px;
|
53 |
+
max-height: 100px;
|
54 |
+
max-width: 100px;
|
55 |
+
margin: 0 2% 0 0;/*color:#7f7f7f;
|
|
|
56 |
border: 1px solid #ddd;*/
|
57 |
}
|
58 |
+
|
59 |
.ctc-parent-row {
|
60 |
+
clear: both;
|
61 |
+
position: relative;
|
62 |
+
margin: 4px 0;
|
63 |
}
|
64 |
+
|
65 |
.ctc-parent-value {
|
66 |
}
|
67 |
+
|
68 |
.ctc-input-cell {
|
69 |
+
display: block;
|
70 |
+
float: left;
|
71 |
+
width: 25%;
|
72 |
+
max-width: 250px;
|
73 |
+
margin-right: 2.13%;
|
74 |
}
|
75 |
+
|
76 |
.ctc-input-cell-wide {
|
77 |
+
display: block;
|
78 |
+
float: left;
|
79 |
+
width: 70%;
|
80 |
+
margin-right: 2.13%;
|
81 |
}
|
82 |
+
|
83 |
.ctc-input-cell-wide textarea {
|
84 |
+
width: 100%;
|
85 |
+
height: 200px;
|
86 |
+
white-space: pre;
|
87 |
+
overflow: auto;
|
88 |
+
font-family: monospace;
|
89 |
+
word-wrap: normal;
|
90 |
}
|
91 |
+
|
92 |
.ctc-save-input {
|
93 |
}
|
94 |
+
|
95 |
.ctc-button-cell, .ctc-input-cell.ctc-button-cell {
|
96 |
+
width: 85px;
|
97 |
}
|
98 |
+
|
99 |
.ctc-textarea-button-cell {
|
100 |
+
margin: 15px 0;
|
101 |
+
width: 85px;
|
102 |
}
|
103 |
+
|
104 |
.ctc-selector-link {
|
105 |
}
|
106 |
+
|
107 |
.ctc-selector-handle {
|
108 |
}
|
109 |
+
|
110 |
.ctc-selector-container {
|
111 |
+
clear: both;
|
112 |
+
background: #f9f9f9;
|
113 |
+
border: 1px solid #ddd;
|
114 |
+
padding: 10px;
|
115 |
+
min-height: 300px;
|
116 |
+
max-height: 500px;
|
117 |
+
position: absolute;
|
118 |
+
width: 90%;
|
119 |
overflow: auto;
|
120 |
+
left: 0;
|
121 |
+
top: 30px;
|
122 |
+
display: none;
|
123 |
+
z-index: 99999;
|
124 |
+
-moz-box-shadow: 1px 2px 10px rgba(51,51,51,0.4);
|
125 |
+
-webkit-box-shadow: 1px 2px 10px rgba(51,51,51,0.4);
|
126 |
+
box-shadow: 1px 2px 10px rgba(51,51,51,0.4);
|
127 |
}
|
128 |
+
|
129 |
.ctc-query-heading {
|
130 |
}
|
131 |
+
|
132 |
.ctc-selector-row {
|
133 |
+
clear: both;
|
134 |
margin: 0;
|
135 |
+
padding: 8px 0;
|
136 |
border-top: 1px solid #ddd;
|
137 |
border-bottom: 1px solid #fff;
|
138 |
}
|
139 |
+
|
140 |
.ctc-input-row {
|
141 |
+
clear: both;
|
142 |
+
margin: 4px 0;
|
143 |
+
padding: 4px 0;
|
144 |
border-bottom: 1px solid #ddd;
|
145 |
}
|
146 |
+
|
147 |
.ctc-selector-value {
|
148 |
}
|
149 |
+
|
150 |
.ctc-selector-cell {
|
151 |
+
float: left;
|
152 |
+
width: 30%;
|
153 |
+
margin-right: 2%;
|
154 |
}
|
155 |
+
|
156 |
.ctc-child-input-cell {
|
157 |
+
display: block;
|
158 |
+
float: left;
|
159 |
+
margin-right: 2.13%;
|
|
|
160 |
}
|
161 |
+
|
162 |
.ctc-child-input-cell-container {
|
163 |
+
float: left;
|
164 |
+
width: 40%;
|
165 |
+
margin-right: 2%;
|
166 |
}
|
167 |
+
|
168 |
.ctc-child-input-cell-container label {
|
169 |
+
float: left;
|
170 |
+
clear: both;
|
171 |
+
width: 100px;
|
172 |
+
margin-right: 2%;
|
173 |
}
|
174 |
+
|
175 |
.ctc-child-input-cell input[type="text"] {
|
176 |
+
/*width:60px;*/
|
177 |
}
|
178 |
+
|
179 |
.ctc-child-input-cell input[type="text"].ctc-input-wide {
|
180 |
+
width: 200px;
|
181 |
}
|
182 |
+
|
183 |
.clearfix:after, .clearfix:before {
|
184 |
content: ' ';
|
185 |
display: table;
|
194 |
.ie7 .clearfix {
|
195 |
zoom: 1;
|
196 |
}
|
|
includes/class-ctc-css.php
CHANGED
@@ -6,7 +6,7 @@ if ( !defined('ABSPATH')) exit;
|
|
6 |
Class: Child_Theme_Configurator_CSS
|
7 |
Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
|
8 |
Description: Handles all CSS output, parsing, normalization
|
9 |
-
Version: 1.1.
|
10 |
Author: Lilaea Media
|
11 |
Author URI: http://www.lilaeamedia.com/
|
12 |
Text Domain: chld_thm_cfg
|
@@ -42,7 +42,7 @@ class Child_Theme_Configurator_CSS {
|
|
42 |
|
43 |
function __construct() {
|
44 |
// scalars
|
45 |
-
$this->version = '1.1.
|
46 |
$this->querykey = 0;
|
47 |
$this->selkey = 0;
|
48 |
$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.1.6
|
10 |
Author: Lilaea Media
|
11 |
Author URI: http://www.lilaeamedia.com/
|
12 |
Text Domain: chld_thm_cfg
|
42 |
|
43 |
function __construct() {
|
44 |
// scalars
|
45 |
+
$this->version = '1.1.6';
|
46 |
$this->querykey = 0;
|
47 |
$this->selkey = 0;
|
48 |
$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.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.1.6
|
9 |
Author: Lilaea Media
|
10 |
Author URI: http://www.lilaeamedia.com/
|
11 |
Text Domain: chld_thm_cfg
|
includes/class-ctc.php
CHANGED
@@ -6,7 +6,7 @@ if ( !defined('ABSPATH')) exit;
|
|
6 |
Class: Child_Theme_Configurator
|
7 |
Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
|
8 |
Description: Main Controller Class
|
9 |
-
Version: 1.1.
|
10 |
Author: Lilaea Media
|
11 |
Author URI: http://www.lilaeamedia.com/
|
12 |
Text Domain: chld_thm_cfg
|
@@ -18,7 +18,7 @@ require_once('class-ctc-ui.php');
|
|
18 |
require_once('class-ctc-css.php');
|
19 |
class Child_Theme_Configurator {
|
20 |
|
21 |
-
var $version = '1.1.
|
22 |
var $css;
|
23 |
var $optionsName;
|
24 |
var $menuName;
|
@@ -133,7 +133,8 @@ class Child_Theme_Configurator {
|
|
133 |
if (!($this->css = get_option($this->optionsName))
|
134 |
|| !is_object($this->css)
|
135 |
// upgrade to v.1.1.1
|
136 |
-
|| !($version = $this->css->get_property('version'))
|
|
|
137 |
|
138 |
$this->css = new Child_Theme_Configurator_CSS();
|
139 |
}
|
@@ -230,8 +231,12 @@ class Child_Theme_Configurator {
|
|
230 |
$this->css->parse_css_file('parnt');
|
231 |
$this->css->parse_css_file('child');
|
232 |
$this->css->write_css(true); // backup current stylesheet
|
233 |
-
|
234 |
-
$this->
|
|
|
|
|
|
|
|
|
235 |
endif;
|
236 |
}
|
237 |
|
6 |
Class: Child_Theme_Configurator
|
7 |
Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
|
8 |
Description: Main Controller Class
|
9 |
+
Version: 1.1.6
|
10 |
Author: Lilaea Media
|
11 |
Author URI: http://www.lilaeamedia.com/
|
12 |
Text Domain: chld_thm_cfg
|
18 |
require_once('class-ctc-css.php');
|
19 |
class Child_Theme_Configurator {
|
20 |
|
21 |
+
var $version = '1.1.6';
|
22 |
var $css;
|
23 |
var $optionsName;
|
24 |
var $menuName;
|
133 |
if (!($this->css = get_option($this->optionsName))
|
134 |
|| !is_object($this->css)
|
135 |
// upgrade to v.1.1.1
|
136 |
+
|| !($version = $this->css->get_property('version'))
|
137 |
+
)
|
138 |
|
139 |
$this->css = new Child_Theme_Configurator_CSS();
|
140 |
}
|
231 |
$this->css->parse_css_file('parnt');
|
232 |
$this->css->parse_css_file('child');
|
233 |
$this->css->write_css(true); // backup current stylesheet
|
234 |
+
$this->css->reset_updates();
|
235 |
+
if (update_option($this->optionsName, $this->css)):
|
236 |
+
$this->update_redirect();
|
237 |
+
else:
|
238 |
+
$this->errors[] = sprintf(__('Child Theme %s was unchanged.', 'chld_thm_cfg'), $name, $this->optionsName);
|
239 |
+
endif;
|
240 |
endif;
|
241 |
}
|
242 |
|
js/chld-thm-cfg.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
* Script: chld-thm-cfg.js
|
3 |
* Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
|
4 |
* Description: Handles jQuery, AJAX and other UI
|
5 |
-
* Version: 1.1.
|
6 |
* Author: Lilaea Media
|
7 |
* Author URI: http://www.lilaeamedia.com/
|
8 |
* License: GPLv2
|
@@ -796,7 +796,7 @@ jQuery(document).ready(function($){
|
|
796 |
}
|
797 |
},
|
798 |
fade_update_notice = function() {
|
799 |
-
$('.updated').slideUp('slow', function(){ $('.updated').remove(); });
|
800 |
},
|
801 |
// initialize vars
|
802 |
// ajax semaphores: 0 = reload, 1 = loading, 2 = loaded
|
2 |
* Script: chld-thm-cfg.js
|
3 |
* Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
|
4 |
* Description: Handles jQuery, AJAX and other UI
|
5 |
+
* Version: 1.1.6
|
6 |
* Author: Lilaea Media
|
7 |
* Author URI: http://www.lilaeamedia.com/
|
8 |
* License: GPLv2
|
796 |
}
|
797 |
},
|
798 |
fade_update_notice = function() {
|
799 |
+
$('.updated, .error').slideUp('slow', function(){ $('.updated').remove(); });
|
800 |
},
|
801 |
// initialize vars
|
802 |
// ajax semaphores: 0 = reload, 1 = loading, 2 = loaded
|
js/chld-thm-cfg.min.js
CHANGED
@@ -2,10 +2,10 @@
|
|
2 |
* Script: chld-thm-cfg.js
|
3 |
* Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
|
4 |
* Description: Handles jQuery, AJAX and other UI
|
5 |
-
* Version: 1.1.
|
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_)?(parent|child)_([a-z\-]+)_(\d+))(_\w+)?$/,w=g(v).parents(".ctc-selector-row, .ctc-parent-row").first(),u=w.find(".ctc-swatch").first(),t={parent:{},child:{}},s={parent:{origin:"",start:"",end:""},child:{origin:"",start:"",end:""}},q={child:false,parent:false},p={};w.find(".ctc-parent-value, .ctc-child-value").each(function(){var D=g(this).attr("id"),x=D.toString().match(r),y=x[3],F=("undefined"==typeof x[4]?"":x[4]),C=x[5],B=("undefined"==typeof x[6]?"":x[6]),E=("parent"==y?g(this).text():g(this).val()),A,z;if("child"==y){p[D]=E}if(""===E){return}if(false===b(B)){switch(B){case"_border_width":t[y][F+"-width"]=E;break;case"_border_style":t[y][F+"-style"]=E;break;case"_border_color":t[y][F+"-color"]=E;break;case"_background_url":t[y]["background-image"]=d(y,E);break;case"_background_color":t[y]["background-color"]=v.value;break;case"_background_color1":s[y].start=E;q[y]=true;break;case"_background_color2":s[y].end=E;q[y]=true;break;case"_background_origin":s[y].origin=E;q[y]=true;break}}else{if(A=F.toString().match(/^border(\-(top|right|bottom|left))?$/)&&!E.match(/none/)){z=E.toString().split(/ +/);t[y][F+"-width"]="undefined"==typeof z[0]?"":z[0];t[y][F+"-style"]="undefined"==typeof z[1]?"":z[1];t[y][F+"-color"]="undefined"==typeof z[2]?"":z[2]}else{if("background-image"==F){if(E.toString().match(/url\(/)){t[y]["background-image"]=d(y,E)}else{z=E.toString().split(/ +/);if(z.length>2){s[y].origin="undefined"==typeof z[0]?"top":z[0];s[y].start="undefined"==typeof z[1]?"transparent":z[1];s[y].end="undefined"==typeof z[2]?"transparent":z[2];q[y]=true}else{t[y]["background-image"]=E}}}else{t[y][F]=E}}}});if("undefined"!=typeof u){g(u).removeAttr("style");if(q.parent){g(u).ctcgrad(s.parent.origin,[s.parent.start,s.parent.end])}g(u).css(t.parent);if(!(u.attr("id").toString().match(/parent/))){if(q.child){g(u).ctcgrad(s.child.origin,[s.child.start,s.child.end])}g(u).css(t.child)}}return p},c=function(r){var q,s,p;g(r).each(function(){switch(this.obj){case"imports":ctcAjax.imports=this.data;break;case"rule_val":ctcAjax.rule_val[this.key]=this.data;currRuleId=this.key;break;case"val_qry":ctcAjax.val_qry[this.key]=this.data;break;case"rule":ctcAjax.rule=this.data;break;case"sel_ndx":if(b(this.key)){ctcAjax.sel_ndx=this.data}else{if("qsid"==this.key){ctcAjax.sel_ndx[this.data.query][this.data.selector]=this.data.qsid}else{ctcAjax.sel_ndx[this.key]=this.data;q=this.key}}break;case"sel_val":ctcAjax.sel_val[this.key]=this.data;s=this.key;break}})},d=function(t,q){var s=q.toString().match(/url\([" ]*(.+?)[" ]*\)/),r=("undefined"==typeof s?null:s[1]),p=ctcAjax.theme_uri+"/"+("parent"==t?ctcAjax.parnt:ctcAjax.child)+"/",u;if(!r){return false}else{if(r.toString().match(/^(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(r,v,q){var s="",u=(b(ctcAjax.sel_val[r])||b(ctcAjax.sel_val[r].value)||b(ctcAjax.sel_val[r].value[v])?"":ctcAjax.sel_val[r].value[v]),t=ctc_decode_value(v,("undefined"==typeof u?"":u.parnt)),p=ctc_decode_value(v,("undefined"==typeof u?"":u.child));if(false===b(ctcAjax.sel_val[r])){s+='<div class="ctc-'+(q?"selector":"input")+'-row clearfix">'+n;s+='<div class="ctc-input-cell">'+(q?ctcAjax.sel_val[r].selector+(b(t.orig)?"<br/>"+ctcAjax.child_only_txt:""):v)+"</div>"+n;if(!q){s+='<div class="ctc-parent-value ctc-input-cell" id="ctc_parent_'+v+"_"+r+'">'+(b(t.orig)?"[no value]":t.orig)+"</div>"+n}s+='<div class="ctc-input-cell">'+n;if(false===b(t.names)){g.each(t.names,function(w,x){x=(b(x)?"":x);s+='<div class="ctc-child-input-cell">'+n;var z="ctc_"+(q?"":"ovrd_")+"child_"+v+"_"+r+x,y;if(false===(y=p.values.shift())){y=""}s+=(b(x)?"":ctcAjax.field_labels[x]+":<br/>")+'<input type="text" id="'+z+'" name="'+z+'" class="ctc-child-value'+((x+v).toString().match(/color/)?" color-picker":"")+((x).toString().match(/url/)?" ctc-input-wide":"")+'" value="'+y+'" />'+n;s+="</div>"+n})}s+="</div>"+n;s+=(q?'<div class="ctc-swatch ctc-specific" id="ctc_child_'+v+"_"+r+'_swatch">'+ctcAjax.swatch_txt+"</div>"+n+'<div class="ctc-child-input-cell ctc-button-cell" id="ctc_save_'+v+"_"+r+'_cell">'+n+'<input type="button" class="button ctc-save-input" id="ctc_save_'+v+"_"+r+'" name="ctc_save_'+v+"_"+r+'" value="Save" /></div>'+n:"");s+="</div><!-- end input row -->"+n}return s},e=function(p){if(1===loading.sel_val){return false}if(0==loading.sel_val){loading.sel_val=1;ctc_query_css("sel_val",p,e);return false}var q="";if(false===b(ctcAjax.sel_val[p]&&false===b(ctcAjax.sel_val[p].value))){g.each(ctcAjax.sel_val[p].value,function(s,r){q+=h(p,s,false)})}g("#ctc_sel_ovrd_rule_inputs").html(q).find(".color-picker").each(function(){o(this)});j("#ctc_child_all_0_swatch")};ctc_render_rule_value_inputs=function(q){if(1===loading.rule_val){return false}if(0==loading.rule_val){loading.rule_val=1;ctc_query_css("rule_val",q,ctc_render_rule_value_inputs);return false}var r=ctcAjax.rule[q],p='<div class="ctc-input-row clearfix" id="ctc_rule_row_'+r+'">'+n;if(false===b(ctcAjax.rule_val[q])){g.each(ctcAjax.rule_val[q],function(t,u){var s=ctc_decode_value(r,u);p+='<div class="ctc-parent-row clearfix" id="ctc_rule_row_'+r+"_"+t+'">'+n;p+='<div class="ctc-input-cell ctc-parent-value" id="ctc_parent_'+r+"_"+t+'">'+s.orig+"</div>"+n;p+='<div class="ctc-input-cell">'+n;p+='<div class="ctc-swatch ctc-specific" id="ctc_parent_'+r+"_"+t+'_swatch">'+ctcAjax.swatch_txt+"</div></div>"+n;p+='<div class="ctc-input-cell"><a href="#" class="ctc-selector-handle" id="ctc_selector_'+r+"_"+t+'">'+ctcAjax.selector_txt+"</a></div>"+n;p+='<div id="ctc_selector_'+r+"_"+t+'_container" class="ctc-selector-container clearfix">'+n;p+='<a href="#" id="ctc_selector_'+r+"_"+t+'_close" class="ctc-selector-handle" style="float:right">'+ctcAjax.close_txt+'</a><div id="ctc_status_val_qry_'+t+'"></div>'+n;p+='<div id="ctc_selector_'+r+"_"+t+'_rows"></div>'+n;p+="</div></div>"+n});p+="</div>"+n}g("#ctc_rule_value_inputs").html(p).find(".ctc-swatch").each(function(){j(this)})},ctc_render_selector_value_inputs=function(s){if(1==loading.val_qry){return false}var u,q,t=g("#ctc_rule_menu_selected").text(),p,r="";if(0===loading.val_qry){loading.val_qry=1;u={rule:t};ctc_query_css("val_qry",s,ctc_render_selector_value_inputs,u);return false}if(false===b(ctcAjax.val_qry[s])){g.each(ctcAjax.val_qry[s],function(w,v){page_rule=w;g.each(v,function(y,x){r+='<h4 class="ctc-query-heading">'+y+"</h4>"+n;if(false===b(x)){g.each(x,function(z,A){ctcAjax.sel_val[z]=A;r+=h(z,w,true)})}})})}p="#ctc_selector_"+t+"_"+s+"_rows";g(p).html(r).find(".color-picker").each(function(){o(this)});g(p).find(".ctc-swatch").each(function(){j(this)})},ctc_query_css=function(r,q,u,s){var p={ctc_query_obj:r,ctc_query_key:q},t="#ctc_status_"+r+("val_qry"==r?"_"+q:"");if("object"===typeof s){g.each(s,function(v,w){p["ctc_query_"+v]=w})}g(".ctc-status-icon").remove();g(t).append('<span class="ctc-status-icon spinner"></span>');g(".spinner").show();p.action="ctc_query";p._wpnonce=g("#_wpnonce").val();g.post(ctcAjax.ajaxurl,p,function(v){loading[r]=2;g(".ctc-status-icon").removeClass("spinner");if(b(v)){g(".ctc-status-icon").addClass("failure")}else{g(".ctc-status-icon").addClass("success");c(v);if("function"===typeof u){u(q)}return false}},"json").fail(function(){loading[r]=0;g(".ctc-status-icon").removeClass("spinner");g(".ctc-status-icon").addClass("failure")});return false},ctc_save=function(t){var s={},u,r,p,q,v=g(t).attr("id");if(b(m[v])){m[v]=0}m[v]++;g(t).prop("disabled",true);g(".ctc-status-icon").remove();g(t).parent(".ctc-textarea-button-cell, .ctc-button-cell").append('<span class="ctc-status-icon spinner"></span>');g(".spinner").show();if((u=g("#ctc_new_selectors"))&&"ctc_save_new_selectors"==g(t).attr("id")){s.ctc_new_selectors=u.val();if(r=g("#ctc_sel_ovrd_query_selected")){s.ctc_sel_ovrd_query=r.text()}}else{if((p=g("#ctc_child_imports"))&&"ctc_save_imports"==g(t).attr("id")){s.ctc_child_imports=p.val()}else{s=j(t)}}s.action="ctc_update";s._wpnonce=g("#_wpnonce").val();g.post(ctcAjax.ajaxurl,s,function(w){g(t).prop("disabled",false);g(".ctc-status-icon").removeClass("spinner");if(b(w)){g(".ctc-status-icon").addClass("failure")}else{g(".ctc-status-icon").addClass("success");g("#ctc_new_selectors").val("");c(w);ctc_setup_menus()}return false},"json").fail(function(){g(t).prop("disabled",false);g(".ctc-status-icon").removeClass("spinner");g(".ctc-status-icon").addClass("failure")});return false},ctc_decode_value=function(r,p){p=("undefined"==typeof p?"":p);var q={orig:p};if(r.toString().match(/^border(\-(top|right|bottom|left))?$/)){var s=p.toString().split(/ +/);q.names=["_border_width","_border_style","_border_color"];q.values=[("undefined"==typeof s[0]?"":s[0]),("undefined"==typeof s[1]?"":s[1]),("undefined"==typeof s[2]?"":s[2])]}else{if(r.toString().match(/^background\-image/)){q.names=["_background_url","_background_origin","_background_color1","_background_color2"];q.values=["","","",""];if(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,false)).find(".color-picker").each(function(){o(this)});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").slideUp("slow",function(){g(".updated").remove()})},loading={rule:2,sel_ndx:2,val_qry:0,rule_val:0,sel_val:0},ctc_selectors=[],ctc_queries=[],ctc_rules=[];g(".color-picker").each(function(){o(this)});g(".ctc-option-panel-container").on("focus",".color-picker",function(){ctc_set_notice("");g(this).iris("toggle");g(".iris-picker").css({position:"absolute","z-index":10})});g(".ctc-option-panel-container").on("focus","input",function(){ctc_set_notice("");g(".color-picker").not(this).iris("hide")});g(".ctc-option-panel-container").on("change",".ctc-child-value",function(){j(this)});g(".ctc-option-panel-container").on("click",".ctc-selector-handle",function(q){q.preventDefault();ctc_set_notice("");var r=g(this).attr("id").toString().replace("_close",""),p=r.toString().replace(/\D+/g,"");if(g("#"+r+"_container").is(":hidden")){if(1!=loading.val_qry){loading.val_qry=0}ctc_render_selector_value_inputs(p)}g("#"+r+"_container").fadeToggle("fast");g(".ctc-selector-container").not("#"+r+"_container").fadeOut("fast")});g(".nav-tab").on("click",function(q){q.preventDefault();ctc_set_notice("");var r="#"+g(this).attr("id"),p=r+"_panel";g(".nav-tab").removeClass("nav-tab-active");g(".ctc-option-panel").removeClass("ctc-option-panel-active");g(".ctc-selector-container").hide();g(r).addClass("nav-tab-active");g(".ctc-option-panel-container").scrollTop(0);g(p).addClass("ctc-option-panel-active")});g("#view_child_options,#view_parnt_options").on("click",function(s){ctc_set_notice("");var p=new Date().getTime(),r=g(this).attr("id").toString().match(/(child|parnt)/)[1],q=ctcAjax.theme_uri+"/"+ctcAjax[r]+"/style.css?"+p;g.get(q,function(t){g("#view_"+r+"_options_panel").text(t)}).fail(function(){g("#view_"+r+"_options_panel").text(ctcAjax.css_fail_txt)})});g("#ctc_load_form").on("submit",function(){return(ctc_validate()&&confirm(ctcAjax.load_txt))});g("#parent_child_options_panel").on("change","#ctc_theme_child",ctc_set_theme_menu);g(document).on("click",".ctc-save-input",function(p){ctc_save(this)});ctc_setup_menus();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.1.6
|
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_)?(parent|child)_([a-z\-]+)_(\d+))(_\w+)?$/,w=g(v).parents(".ctc-selector-row, .ctc-parent-row").first(),u=w.find(".ctc-swatch").first(),t={parent:{},child:{}},s={parent:{origin:"",start:"",end:""},child:{origin:"",start:"",end:""}},q={child:false,parent:false},p={};w.find(".ctc-parent-value, .ctc-child-value").each(function(){var D=g(this).attr("id"),x=D.toString().match(r),y=x[3],F=("undefined"==typeof x[4]?"":x[4]),C=x[5],B=("undefined"==typeof x[6]?"":x[6]),E=("parent"==y?g(this).text():g(this).val()),A,z;if("child"==y){p[D]=E}if(""===E){return}if(false===b(B)){switch(B){case"_border_width":t[y][F+"-width"]=E;break;case"_border_style":t[y][F+"-style"]=E;break;case"_border_color":t[y][F+"-color"]=E;break;case"_background_url":t[y]["background-image"]=d(y,E);break;case"_background_color":t[y]["background-color"]=v.value;break;case"_background_color1":s[y].start=E;q[y]=true;break;case"_background_color2":s[y].end=E;q[y]=true;break;case"_background_origin":s[y].origin=E;q[y]=true;break}}else{if(A=F.toString().match(/^border(\-(top|right|bottom|left))?$/)&&!E.match(/none/)){z=E.toString().split(/ +/);t[y][F+"-width"]="undefined"==typeof z[0]?"":z[0];t[y][F+"-style"]="undefined"==typeof z[1]?"":z[1];t[y][F+"-color"]="undefined"==typeof z[2]?"":z[2]}else{if("background-image"==F){if(E.toString().match(/url\(/)){t[y]["background-image"]=d(y,E)}else{z=E.toString().split(/ +/);if(z.length>2){s[y].origin="undefined"==typeof z[0]?"top":z[0];s[y].start="undefined"==typeof z[1]?"transparent":z[1];s[y].end="undefined"==typeof z[2]?"transparent":z[2];q[y]=true}else{t[y]["background-image"]=E}}}else{t[y][F]=E}}}});if("undefined"!=typeof u){g(u).removeAttr("style");if(q.parent){g(u).ctcgrad(s.parent.origin,[s.parent.start,s.parent.end])}g(u).css(t.parent);if(!(u.attr("id").toString().match(/parent/))){if(q.child){g(u).ctcgrad(s.child.origin,[s.child.start,s.child.end])}g(u).css(t.child)}}return p},c=function(r){var q,s,p;g(r).each(function(){switch(this.obj){case"imports":ctcAjax.imports=this.data;break;case"rule_val":ctcAjax.rule_val[this.key]=this.data;currRuleId=this.key;break;case"val_qry":ctcAjax.val_qry[this.key]=this.data;break;case"rule":ctcAjax.rule=this.data;break;case"sel_ndx":if(b(this.key)){ctcAjax.sel_ndx=this.data}else{if("qsid"==this.key){ctcAjax.sel_ndx[this.data.query][this.data.selector]=this.data.qsid}else{ctcAjax.sel_ndx[this.key]=this.data;q=this.key}}break;case"sel_val":ctcAjax.sel_val[this.key]=this.data;s=this.key;break}})},d=function(t,q){var s=q.toString().match(/url\([" ]*(.+?)[" ]*\)/),r=("undefined"==typeof s?null:s[1]),p=ctcAjax.theme_uri+"/"+("parent"==t?ctcAjax.parnt:ctcAjax.child)+"/",u;if(!r){return false}else{if(r.toString().match(/^(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(r,v,q){var s="",u=(b(ctcAjax.sel_val[r])||b(ctcAjax.sel_val[r].value)||b(ctcAjax.sel_val[r].value[v])?"":ctcAjax.sel_val[r].value[v]),t=ctc_decode_value(v,("undefined"==typeof u?"":u.parnt)),p=ctc_decode_value(v,("undefined"==typeof u?"":u.child));if(false===b(ctcAjax.sel_val[r])){s+='<div class="ctc-'+(q?"selector":"input")+'-row clearfix">'+n;s+='<div class="ctc-input-cell">'+(q?ctcAjax.sel_val[r].selector+(b(t.orig)?"<br/>"+ctcAjax.child_only_txt:""):v)+"</div>"+n;if(!q){s+='<div class="ctc-parent-value ctc-input-cell" id="ctc_parent_'+v+"_"+r+'">'+(b(t.orig)?"[no value]":t.orig)+"</div>"+n}s+='<div class="ctc-input-cell">'+n;if(false===b(t.names)){g.each(t.names,function(w,x){x=(b(x)?"":x);s+='<div class="ctc-child-input-cell">'+n;var z="ctc_"+(q?"":"ovrd_")+"child_"+v+"_"+r+x,y;if(false===(y=p.values.shift())){y=""}s+=(b(x)?"":ctcAjax.field_labels[x]+":<br/>")+'<input type="text" id="'+z+'" name="'+z+'" class="ctc-child-value'+((x+v).toString().match(/color/)?" color-picker":"")+((x).toString().match(/url/)?" ctc-input-wide":"")+'" value="'+y+'" />'+n;s+="</div>"+n})}s+="</div>"+n;s+=(q?'<div class="ctc-swatch ctc-specific" id="ctc_child_'+v+"_"+r+'_swatch">'+ctcAjax.swatch_txt+"</div>"+n+'<div class="ctc-child-input-cell ctc-button-cell" id="ctc_save_'+v+"_"+r+'_cell">'+n+'<input type="button" class="button ctc-save-input" id="ctc_save_'+v+"_"+r+'" name="ctc_save_'+v+"_"+r+'" value="Save" /></div>'+n:"");s+="</div><!-- end input row -->"+n}return s},e=function(p){if(1===loading.sel_val){return false}if(0==loading.sel_val){loading.sel_val=1;ctc_query_css("sel_val",p,e);return false}var q="";if(false===b(ctcAjax.sel_val[p]&&false===b(ctcAjax.sel_val[p].value))){g.each(ctcAjax.sel_val[p].value,function(s,r){q+=h(p,s,false)})}g("#ctc_sel_ovrd_rule_inputs").html(q).find(".color-picker").each(function(){o(this)});j("#ctc_child_all_0_swatch")};ctc_render_rule_value_inputs=function(q){if(1===loading.rule_val){return false}if(0==loading.rule_val){loading.rule_val=1;ctc_query_css("rule_val",q,ctc_render_rule_value_inputs);return false}var r=ctcAjax.rule[q],p='<div class="ctc-input-row clearfix" id="ctc_rule_row_'+r+'">'+n;if(false===b(ctcAjax.rule_val[q])){g.each(ctcAjax.rule_val[q],function(t,u){var s=ctc_decode_value(r,u);p+='<div class="ctc-parent-row clearfix" id="ctc_rule_row_'+r+"_"+t+'">'+n;p+='<div class="ctc-input-cell ctc-parent-value" id="ctc_parent_'+r+"_"+t+'">'+s.orig+"</div>"+n;p+='<div class="ctc-input-cell">'+n;p+='<div class="ctc-swatch ctc-specific" id="ctc_parent_'+r+"_"+t+'_swatch">'+ctcAjax.swatch_txt+"</div></div>"+n;p+='<div class="ctc-input-cell"><a href="#" class="ctc-selector-handle" id="ctc_selector_'+r+"_"+t+'">'+ctcAjax.selector_txt+"</a></div>"+n;p+='<div id="ctc_selector_'+r+"_"+t+'_container" class="ctc-selector-container clearfix">'+n;p+='<a href="#" id="ctc_selector_'+r+"_"+t+'_close" class="ctc-selector-handle" style="float:right">'+ctcAjax.close_txt+'</a><div id="ctc_status_val_qry_'+t+'"></div>'+n;p+='<div id="ctc_selector_'+r+"_"+t+'_rows"></div>'+n;p+="</div></div>"+n});p+="</div>"+n}g("#ctc_rule_value_inputs").html(p).find(".ctc-swatch").each(function(){j(this)})},ctc_render_selector_value_inputs=function(s){if(1==loading.val_qry){return false}var u,q,t=g("#ctc_rule_menu_selected").text(),p,r="";if(0===loading.val_qry){loading.val_qry=1;u={rule:t};ctc_query_css("val_qry",s,ctc_render_selector_value_inputs,u);return false}if(false===b(ctcAjax.val_qry[s])){g.each(ctcAjax.val_qry[s],function(w,v){page_rule=w;g.each(v,function(y,x){r+='<h4 class="ctc-query-heading">'+y+"</h4>"+n;if(false===b(x)){g.each(x,function(z,A){ctcAjax.sel_val[z]=A;r+=h(z,w,true)})}})})}p="#ctc_selector_"+t+"_"+s+"_rows";g(p).html(r).find(".color-picker").each(function(){o(this)});g(p).find(".ctc-swatch").each(function(){j(this)})},ctc_query_css=function(r,q,u,s){var p={ctc_query_obj:r,ctc_query_key:q},t="#ctc_status_"+r+("val_qry"==r?"_"+q:"");if("object"===typeof s){g.each(s,function(v,w){p["ctc_query_"+v]=w})}g(".ctc-status-icon").remove();g(t).append('<span class="ctc-status-icon spinner"></span>');g(".spinner").show();p.action="ctc_query";p._wpnonce=g("#_wpnonce").val();g.post(ctcAjax.ajaxurl,p,function(v){loading[r]=2;g(".ctc-status-icon").removeClass("spinner");if(b(v)){g(".ctc-status-icon").addClass("failure")}else{g(".ctc-status-icon").addClass("success");c(v);if("function"===typeof u){u(q)}return false}},"json").fail(function(){loading[r]=0;g(".ctc-status-icon").removeClass("spinner");g(".ctc-status-icon").addClass("failure")});return false},ctc_save=function(t){var s={},u,r,p,q,v=g(t).attr("id");if(b(m[v])){m[v]=0}m[v]++;g(t).prop("disabled",true);g(".ctc-status-icon").remove();g(t).parent(".ctc-textarea-button-cell, .ctc-button-cell").append('<span class="ctc-status-icon spinner"></span>');g(".spinner").show();if((u=g("#ctc_new_selectors"))&&"ctc_save_new_selectors"==g(t).attr("id")){s.ctc_new_selectors=u.val();if(r=g("#ctc_sel_ovrd_query_selected")){s.ctc_sel_ovrd_query=r.text()}}else{if((p=g("#ctc_child_imports"))&&"ctc_save_imports"==g(t).attr("id")){s.ctc_child_imports=p.val()}else{s=j(t)}}s.action="ctc_update";s._wpnonce=g("#_wpnonce").val();g.post(ctcAjax.ajaxurl,s,function(w){g(t).prop("disabled",false);g(".ctc-status-icon").removeClass("spinner");if(b(w)){g(".ctc-status-icon").addClass("failure")}else{g(".ctc-status-icon").addClass("success");g("#ctc_new_selectors").val("");c(w);ctc_setup_menus()}return false},"json").fail(function(){g(t).prop("disabled",false);g(".ctc-status-icon").removeClass("spinner");g(".ctc-status-icon").addClass("failure")});return false},ctc_decode_value=function(r,p){p=("undefined"==typeof p?"":p);var q={orig:p};if(r.toString().match(/^border(\-(top|right|bottom|left))?$/)){var s=p.toString().split(/ +/);q.names=["_border_width","_border_style","_border_color"];q.values=[("undefined"==typeof s[0]?"":s[0]),("undefined"==typeof s[1]?"":s[1]),("undefined"==typeof s[2]?"":s[2])]}else{if(r.toString().match(/^background\-image/)){q.names=["_background_url","_background_origin","_background_color1","_background_color2"];q.values=["","","",""];if(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,false)).find(".color-picker").each(function(){o(this)});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",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)});
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
4 |
Tags: child theme, custom theme, CSS, responsive design, CSS editor, theme generator
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 3.8
|
7 |
-
Stable tag: 1.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -65,27 +65,31 @@ A child theme is not a "copy" of the parent theme. It is a special feature of Wo
|
|
65 |
|
66 |
You can add your own functions.php file, and any other files and directories you need for your Child Theme. The Child Theme Configurator helps you identify and override selectors in the Parent stylesheet without touching the other files.
|
67 |
|
68 |
-
= How
|
69 |
|
70 |
You can override a specific value globally using the Rule/Value tab. See "Rule/Value," below.
|
71 |
|
72 |
-
= How
|
73 |
|
74 |
You can add queries and selectors using the "New Selector(s)" textarea on the Query/Selector tab. See "Query/Selector," below.
|
75 |
|
76 |
-
= How
|
77 |
|
78 |
-
You
|
79 |
|
80 |
-
= How
|
81 |
|
82 |
Delete the value from the input for the rule you wish to remove. The Child Theme Configurator only adds overrides for rules that contain values.
|
83 |
|
84 |
-
= How
|
|
|
|
|
|
|
|
|
85 |
|
86 |
The Child Theme Configurator uses a standardized syntax for gradients and only supports two-color gradients without intermediate stops. The inputs consist of origin (e.g., top, left, 135deg, etc.), start color and end color. The browser-specific syntax is generated automatically when you save these values. See Caveats, below, for more information.
|
87 |
|
88 |
-
= How
|
89 |
|
90 |
This topic is beyond the scope of this document. The short answer is to use a responsive Parent Theme. Some common characteristics of responsive design are:
|
91 |
|
@@ -93,7 +97,7 @@ This topic is beyond the scope of this document. The short answer is to use a re
|
|
93 |
* Combining floats and clears with inline and relative positions allow the elements to adjust gracefully to their container's width.
|
94 |
* Showing and hiding content with Javascript.
|
95 |
|
96 |
-
= How
|
97 |
|
98 |
The easiest method is to paste the @import code provided by Google, Font Squirrel or any other Web Font site into the @import tab. The fonts will then be available to use as a value of the font-family rule. Be sure you understand the license for any embedded fonts.
|
99 |
|
@@ -109,6 +113,9 @@ You can also create a secondary stylesheet that contains @font-face rules and im
|
|
109 |
|
110 |
== Changelog ==
|
111 |
|
|
|
|
|
|
|
112 |
= 1.1.5 =
|
113 |
* Query/Selector panel now defaults to 'base'
|
114 |
* Fixed bug causing background-image with full urls (http://) to be parsed as gradients
|
@@ -209,7 +216,7 @@ If you prefer to use shorthand syntax for rules and values instead of the inputs
|
|
209 |
|
210 |
== Add Imports ==
|
211 |
|
212 |
-
You can add additional stylesheets and web fonts by typing @import rules into the textarea on the @import tab. Important: The Child Theme Configurator adds the @import rule that loads the Parent Theme's stylesheet automatically.
|
213 |
|
214 |
== Preview and Activate ==
|
215 |
|
4 |
Tags: child theme, custom theme, CSS, responsive design, CSS editor, theme generator
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 3.8
|
7 |
+
Stable tag: 1.1.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
65 |
|
66 |
You can add your own functions.php file, and any other files and directories you need for your Child Theme. The Child Theme Configurator helps you identify and override selectors in the Parent stylesheet without touching the other files.
|
67 |
|
68 |
+
= How do I change a specific color/font style/background? =
|
69 |
|
70 |
You can override a specific value globally using the Rule/Value tab. See "Rule/Value," below.
|
71 |
|
72 |
+
= How do I add styles that aren't in the Parent Theme? =
|
73 |
|
74 |
You can add queries and selectors using the "New Selector(s)" textarea on the Query/Selector tab. See "Query/Selector," below.
|
75 |
|
76 |
+
= How do I remove a style from the Parent Theme? =
|
77 |
|
78 |
+
You shouldn't really "remove" a style from the Parent. You can, however, set the rule to "inherit," "none," or zero (depending on the rule). This will negate the Parent value. Some experimentation may be necessary.
|
79 |
|
80 |
+
= How do I remove a style from the Child Theme? =
|
81 |
|
82 |
Delete the value from the input for the rule you wish to remove. The Child Theme Configurator only adds overrides for rules that contain values.
|
83 |
|
84 |
+
= How do I set the !important flag? =
|
85 |
+
|
86 |
+
If you are overriding a style from the parent that is flagged as important, the Child Theme Configurator will automatically add the flag to the child stylesheet. New styles are added to the end of the query block, so they will take precedence. We are discussing adding the ability to set the important flag in the child stylesheet, but for now you'll have to rely on good cascading design.
|
87 |
+
|
88 |
+
= How do I create cross-browser gradients? =
|
89 |
|
90 |
The Child Theme Configurator uses a standardized syntax for gradients and only supports two-color gradients without intermediate stops. The inputs consist of origin (e.g., top, left, 135deg, etc.), start color and end color. The browser-specific syntax is generated automatically when you save these values. See Caveats, below, for more information.
|
91 |
|
92 |
+
= How do I make my Theme responsive? =
|
93 |
|
94 |
This topic is beyond the scope of this document. The short answer is to use a responsive Parent Theme. Some common characteristics of responsive design are:
|
95 |
|
97 |
* Combining floats and clears with inline and relative positions allow the elements to adjust gracefully to their container's width.
|
98 |
* Showing and hiding content with Javascript.
|
99 |
|
100 |
+
= How do I add Web Fonts? =
|
101 |
|
102 |
The easiest method is to paste the @import code provided by Google, Font Squirrel or any other Web Font site into the @import tab. The fonts will then be available to use as a value of the font-family rule. Be sure you understand the license for any embedded fonts.
|
103 |
|
113 |
|
114 |
== Changelog ==
|
115 |
|
116 |
+
= 1.1.6 =
|
117 |
+
* Added call to reset_updates() before update_option() to prevent serialization errors.
|
118 |
+
|
119 |
= 1.1.5 =
|
120 |
* Query/Selector panel now defaults to 'base'
|
121 |
* Fixed bug causing background-image with full urls (http://) to be parsed as gradients
|
216 |
|
217 |
== Add Imports ==
|
218 |
|
219 |
+
You can add additional stylesheets and web fonts by typing @import rules into the textarea on the @import tab. Important: The Child Theme Configurator adds the @import rule that loads the Parent Theme's stylesheet automatically. You do not need to add it here.
|
220 |
|
221 |
== Preview and Activate ==
|
222 |
|
screenshot-1.jpg
CHANGED
Binary file
|
screenshot-2.jpg
CHANGED
Binary file
|
screenshot-3.jpg
CHANGED
Binary file
|
screenshot-4.jpg
CHANGED
Binary file
|
screenshot-5.jpg
CHANGED
Binary file
|