Child Theme Configurator - Version 1.1.8

Version Description

  • Added reorder sequence and important flag functionality. Fixed bug where multiple inputs with same selector/rule combo were assigned the same id. Fixed bug in the shorthand encoding routine.
Download this release

Release Info

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

Code changes from version 1.1.7 to 1.1.8

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.1.7
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.1.8
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
includes/class-ctc-css.php CHANGED
@@ -6,7 +6,7 @@ if ( !defined('ABSPATH')) exit;
6
  Class: Child_Theme_Configurator_CSS
7
  Plugin URI: http://www.lilaeamedia.com/plugins/child-theme-configurator/
8
  Description: Handles all CSS output, parsing, normalization
9
- Version: 1.1.7
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
@@ -22,6 +22,7 @@ class Child_Theme_Configurator_CSS {
22
  var $dict_qs; // query/selector lookup
23
  var $dict_rule; // css rules
24
  var $dict_val; // css values
 
25
  // hierarchies
26
  var $sel_ndx; // query => selector hierarchy
27
  var $val_ndx; // selector => rule => value hierarchy
@@ -42,7 +43,7 @@ class Child_Theme_Configurator_CSS {
42
 
43
  function __construct() {
44
  // scalars
45
- $this->version = '1.1.7';
46
  $this->querykey = 0;
47
  $this->selkey = 0;
48
  $this->qskey = 0;
@@ -59,6 +60,7 @@ class Child_Theme_Configurator_CSS {
59
  $this->dict_query = array();
60
  $this->dict_rule = array();
61
  $this->dict_val = array();
 
62
  $this->sel_ndx = array();
63
  $this->val_ndx = array();
64
  $this->imports = array('child' => '', 'parnt' => '');
@@ -231,28 +233,47 @@ class Child_Theme_Configurator_CSS {
231
 
232
  function encode_shorthand($shorthand) {
233
  $rules = '';
 
234
  foreach (array_keys($shorthand) as $key):
235
- $rule = $shorthand[$key];
236
- if (4 == count($rule)):
 
 
 
 
 
 
 
 
 
 
 
237
  $parts = array();
238
  $parts[0] = $rule['top'];
239
- if ($rule['left'] != $rule['right']):
 
240
  $parts[3] = $rule['left'];
241
  $parts[2] = $rule['bottom'];
242
  $parts[1] = $rule['right'];
243
  endif;
244
- if ($rule['bottom'] != $rule['top']):
 
245
  $parts[2] = $rule['bottom'];
246
  $parts[1] = $rule['right'];
247
  endif;
248
- if ($rule['right'] != $rule['top']):
 
249
  $parts[1] = $rule['right'];
250
  endif;
 
251
  ksort($parts);
252
- $rules .= ' ' . $key . ': ' . implode(' ', $parts) . ';' . LF;
 
 
253
  else:
 
254
  foreach ($rule as $side => $value):
255
- $rules .= ' ' . $key . '-' . $side . ': ' . $value . ';' . LF;
256
  endforeach;
257
  endif;
258
  endforeach;
@@ -290,13 +311,14 @@ class Child_Theme_Configurator_CSS {
290
  * CTC object arrays, creating update cache in the process.
291
  * Update cache is returned to UI via AJAX to refresh page
292
  */
293
- function update_arrays($template, $query, $sel, $rule = null, $value = null, $important = null) {
294
  // add selector and query to index
295
  if (!isset($this->dict_query[$query])) $this->dict_query[$query] = ++$this->querykey;
296
  if (!isset($this->dict_sel[$sel])) $this->dict_sel[$sel] = ++$this->selkey;
297
  if (!isset($this->sel_ndx[$this->dict_query[$query]][$this->dict_sel[$sel]])):
298
  // increment key number
299
  $this->sel_ndx[$this->dict_query[$query]][$this->dict_sel[$sel]] = ++$this->qskey;
 
300
  $this->dict_qs[$this->qskey]['s'] = $this->dict_sel[$sel];
301
  $this->dict_qs[$this->qskey]['q'] = $this->dict_query[$query];
302
  // tell the UI to update a single cached query/selector lookup by passing 'qsid' as the key
@@ -311,6 +333,8 @@ class Child_Theme_Configurator_CSS {
311
  ),
312
  );
313
  endif;
 
 
314
  // set data and value
315
  if ($rule):
316
  if (!isset($this->dict_rule[$rule])):
@@ -324,12 +348,12 @@ class Child_Theme_Configurator_CSS {
324
  endif;
325
  $qsid = $this->sel_ndx[$this->dict_query[$query]][$this->dict_sel[$sel]];
326
  $ruleid = $this->dict_rule[$rule];
327
-
328
  if (!isset($this->dict_val[$value])):
329
  $this->dict_val[$value] = ++$this->valkey;
330
  endif;
331
  $this->val_ndx[$qsid][$ruleid][$template] = $this->dict_val[$value];
332
- $this->val_ndx[$qsid][$ruleid]['i'] = $important;
 
333
  // tell the UI to add a single cached query/selector data array:
334
  $updatearr = array(
335
  'obj' => 'sel_val',
@@ -385,7 +409,7 @@ class Child_Theme_Configurator_CSS {
385
  if (false === strpos($ruleval, ':')) continue;
386
  list($rule, $value) = explode(':', $ruleval, 2);
387
  $rule = trim($rule);
388
- $value = trim($value);
389
 
390
  $rules = $values = array();
391
  // save important flag
@@ -423,7 +447,6 @@ class Child_Theme_Configurator_CSS {
423
  endforeach;
424
  endforeach;
425
  endforeach;
426
-
427
  }
428
 
429
  /*
@@ -451,15 +474,15 @@ class Child_Theme_Configurator_CSS {
451
  endforeach;
452
  endif;
453
  $output .= LF;
454
- // turn the dictionaries into indexes:
455
  $rulearr = array_flip($this->dict_rule);
456
  $valarr = array_flip($this->dict_val);
457
  $selarr = array_flip($this->dict_sel);
458
  foreach ($this->sort_queries() as $query => $sort_order):
459
- $selectors = $this->sel_ndx[$this->dict_query[$query]];
460
- asort($selectors);
461
  $has_selector = 0;
462
  $sel_output = '';
 
 
463
  if ('base' != $query) $sel_output .= $query . ' {' . LF;
464
  foreach ($selectors as $selid => $qsid):
465
  $has_value = 0;
@@ -469,14 +492,18 @@ class Child_Theme_Configurator_CSS {
469
  foreach ($this->val_ndx[$qsid] as $ruleid => $valid):
470
  if (isset($valid['child']) && isset($valarr[$valid['child']]) && '' !== $valarr[$valid['child']]):
471
  if (! $has_value):
 
472
  $sel_output .= $sel . ' {' . LF;
473
  $has_value = 1;
474
  $has_selector = 1;
475
  endif;
476
- $sel_output .= $this->add_vendor_rules($rulearr[$ruleid], $valarr[$valid['child']], $shorthand);
 
 
477
  endif;
478
  endforeach;
479
- $sel_output .= $this->encode_shorthand($shorthand);
 
480
  if ($has_value):
481
  $sel_output .= '}' . LF;
482
  endif;
@@ -506,23 +533,25 @@ class Child_Theme_Configurator_CSS {
506
  * These are based on commonly used practices and not all vendor prefixed are supported
507
  * TODO: verify this logic against vendor and W3C documentation
508
  */
509
- function add_vendor_rules($rule, $value, &$shorthand) {
510
  $rules = '';
 
 
511
  if (preg_match("/^(margin|padding)\-(top|right|bottom|left)$/", $rule, $matches)):
512
- $shorthand[$matches[1]][$matches[2]] = $value;
513
  return '';
514
  elseif (preg_match("/^(box\-sizing|font\-smoothing|border\-radius|box\-shadow|transition)$/", $rule)):
515
  foreach(array('moz', 'webkit', 'o') as $prefix):
516
- $rules .= ' -' . $prefix . '-' . $rule . ': ' . $value . ';' . LF;
517
  endforeach;
518
- $rules .= ' ' . $rule . ': ' . $value . ';' . LF;
519
  elseif ('background-image' == $rule):
520
  // gradient?
521
  if ($gradient = $this->decode_gradient($value)):
522
  // standard gradient
523
  foreach(array('moz', 'webkit', 'o', 'ms') as $prefix):
524
  $rules .= ' background-image: -' . $prefix . '-' . 'linear-gradient(' . $gradient['origin'] . ', '
525
- . $gradient['color1'] . ', ' . $gradient['color2'] . ');' . LF;
526
  endforeach;
527
  // W3C standard gradient
528
  // rotate origin 90 degrees
@@ -536,7 +565,7 @@ class Child_Theme_Configurator_CSS {
536
  $org = 'to ' . implode(' ', $dirs);
537
  endif;
538
  $rules .= ' background-image: linear-gradient(' . $org . ', '
539
- . $gradient['color1'] . ', ' . $gradient['color2'] . ');' . LF;
540
 
541
  // legacy webkit gradient - we'll add if there is demand
542
  // '-webkit-gradient(linear,' .$origin . ', ' . $color1 . ', '. $color2 . ')';
@@ -545,13 +574,13 @@ class Child_Theme_Configurator_CSS {
545
  $type = (in_array($gradient['origin'], array('left', 'right', '0deg', '180deg')) ? 1 : 0);
546
  $color1 = preg_replace("/^#/", '#00', $gradient['color1']);
547
  $rules .= ' filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=' . $type . ', StartColorStr="'
548
- . strtoupper($color1) . '", EndColorStr="' . strtoupper($gradient['color2']) . '");' . LF;
549
  else:
550
  // url or other value
551
- $rules .= ' ' . $rule . ': ' . $value . ';' . LF;
552
  endif;
553
  else:
554
- $rules .= ' ' . $rule . ': ' . $value . ';' . LF;
555
  endif;
556
  return $rules;
557
  }
@@ -653,15 +682,26 @@ class Child_Theme_Configurator_CSS {
653
  elseif (isset($_POST['ctc_child_imports'])):
654
  $this->parse_css('child', $_POST['ctc_child_imports']);
655
  else:
 
 
 
 
 
 
 
 
 
656
  $parts = array();
657
- foreach (preg_grep('#^ctc_(ovrd_)?child#', array_keys($_POST)) as $post_key):
658
- if (preg_match('#^ctc_(ovrd_)?child_([\w\-]+?)_(\d+?)(_(.+))?$#', $post_key, $matches)):
 
659
  $rule = $matches[2];
660
  if (null == $rule || !isset($this->dict_rule[$rule])) continue;
661
  $ruleid = $this->dict_rule[$rule];
662
  $qsid = $matches[3];
663
- $value = sanitize_text_field($_POST[$post_key]);
664
- $important = empty($this->val_ndx[$qsid][$ruleid]['i']) ? 0 : $this->val_ndx[$qsid][$ruleid]['i'];
 
665
 
666
  $selarr = $this->denorm_query_sel($qsid);
667
  if (!empty($matches[5])):
@@ -747,6 +787,15 @@ class Child_Theme_Configurator_CSS {
747
  return $queries;
748
  }
749
 
 
 
 
 
 
 
 
 
 
750
  /*
751
  * denorm_rule_val
752
  * Return array of unique values corresponding to specific rule
@@ -790,13 +839,14 @@ class Child_Theme_Configurator_CSS {
790
  * Return id, query and selector values of a specific qsid (query-selector ID)
791
  */
792
  function denorm_query_sel($qsid) {
793
- $queryarr = array_flip($this->dict_query);
794
- $selarr = array_flip($this->dict_sel);
795
-
796
  return array(
797
  'id' => $qsid,
798
  'query' => $queryarr[$this->dict_qs[$qsid]['q']],
799
  'selector' => $selarr[$this->dict_qs[$qsid]['s']],
 
800
  );
801
  }
802
 
@@ -812,11 +862,15 @@ class Child_Theme_Configurator_CSS {
812
  if (isset($this->val_ndx[$qsid]) && is_array($this->val_ndx[$qsid])):
813
  foreach ($this->val_ndx[$qsid] as $ruleid => $values):
814
  foreach ($values as $name => $val):
815
- if ('i' == $name || !isset($valarr[$val]) || '' === $valarr[$val]):
 
 
816
  continue;
 
 
817
  endif;
818
- $selarr['value'][$rulearr[$ruleid]][$name] = $valarr[$val];
819
  endforeach;
 
820
  endforeach;
821
  endif;
822
  return $selarr;
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.8
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
22
  var $dict_qs; // query/selector lookup
23
  var $dict_rule; // css rules
24
  var $dict_val; // css values
25
+ var $dict_seq; // child load order (priority)
26
  // hierarchies
27
  var $sel_ndx; // query => selector hierarchy
28
  var $val_ndx; // selector => rule => value hierarchy
43
 
44
  function __construct() {
45
  // scalars
46
+ $this->version = '1.1.8';
47
  $this->querykey = 0;
48
  $this->selkey = 0;
49
  $this->qskey = 0;
60
  $this->dict_query = array();
61
  $this->dict_rule = array();
62
  $this->dict_val = array();
63
+ $this->dict_seq = array();
64
  $this->sel_ndx = array();
65
  $this->val_ndx = array();
66
  $this->imports = array('child' => '', 'parnt' => '');
233
 
234
  function encode_shorthand($shorthand) {
235
  $rules = '';
236
+ $importantstr = ' !important';
237
  foreach (array_keys($shorthand) as $key):
238
+ $important = array();
239
+ $rule = array();
240
+ $importantct = 0;
241
+ // which sides do we have and are they important?
242
+ foreach($shorthand[$key] as $side => $val):
243
+ $ict = 0;
244
+ $rule[$side] = trim(preg_replace('/'.$importantstr.'/', '', $val, 1, $ict));
245
+ $important[$side] = $ict;
246
+ $importantct += $ict;
247
+ endforeach;
248
+ // shorthand must have 4 explicit values and all must have same priority
249
+ if (4 == count($rule) && (0 == $importantct || 4 == $importantct )):
250
+ // let's try to condense the values into as few as possible, starting with the top value
251
  $parts = array();
252
  $parts[0] = $rule['top'];
253
+ // if left is not the same as right, we must use all 4 values
254
+ if ($rule['left'] !== $rule['right']):
255
  $parts[3] = $rule['left'];
256
  $parts[2] = $rule['bottom'];
257
  $parts[1] = $rule['right'];
258
  endif;
259
+ // if top is not the same as bottom, we must use at least 3 values
260
+ if ($rule['bottom'] !== $rule['top']):
261
  $parts[2] = $rule['bottom'];
262
  $parts[1] = $rule['right'];
263
  endif;
264
+ // if top is not the same as right, we must use at least 2 values
265
+ if ($rule['right'] !== $rule['top']):
266
  $parts[1] = $rule['right'];
267
  endif;
268
+ // the order of the sides is critical: top right bottom left
269
  ksort($parts);
270
+ $shorthandstr = implode(' ', $parts);
271
+ // if important counter is > 0, it must be == 4, add flag
272
+ $rules .= ' ' . $key . ': ' . $shorthandstr . ($importantct ? ' ' . $importantstr : '') . ';' . LF;
273
  else:
274
+ // otherwise return separate rule for each side
275
  foreach ($rule as $side => $value):
276
+ $rules .= ' ' . $key . '-' . $side . ': ' . $value . ($important[$side] ? $importantstr : '') . ';' . LF;
277
  endforeach;
278
  endif;
279
  endforeach;
311
  * CTC object arrays, creating update cache in the process.
312
  * Update cache is returned to UI via AJAX to refresh page
313
  */
314
+ function update_arrays($template, $query, $sel, $rule = null, $value = null, $important = 0) {
315
  // add selector and query to index
316
  if (!isset($this->dict_query[$query])) $this->dict_query[$query] = ++$this->querykey;
317
  if (!isset($this->dict_sel[$sel])) $this->dict_sel[$sel] = ++$this->selkey;
318
  if (!isset($this->sel_ndx[$this->dict_query[$query]][$this->dict_sel[$sel]])):
319
  // increment key number
320
  $this->sel_ndx[$this->dict_query[$query]][$this->dict_sel[$sel]] = ++$this->qskey;
321
+
322
  $this->dict_qs[$this->qskey]['s'] = $this->dict_sel[$sel];
323
  $this->dict_qs[$this->qskey]['q'] = $this->dict_query[$query];
324
  // tell the UI to update a single cached query/selector lookup by passing 'qsid' as the key
333
  ),
334
  );
335
  endif;
336
+ if (!isset($this->dict_seq[$this->qskey]))
337
+ $this->dict_seq[$this->qskey] = $this->qskey;
338
  // set data and value
339
  if ($rule):
340
  if (!isset($this->dict_rule[$rule])):
348
  endif;
349
  $qsid = $this->sel_ndx[$this->dict_query[$query]][$this->dict_sel[$sel]];
350
  $ruleid = $this->dict_rule[$rule];
 
351
  if (!isset($this->dict_val[$value])):
352
  $this->dict_val[$value] = ++$this->valkey;
353
  endif;
354
  $this->val_ndx[$qsid][$ruleid][$template] = $this->dict_val[$value];
355
+ // set the important flag for this value
356
+ $this->val_ndx[$qsid][$ruleid]['i_' . $template] = $important;
357
  // tell the UI to add a single cached query/selector data array:
358
  $updatearr = array(
359
  'obj' => 'sel_val',
409
  if (false === strpos($ruleval, ':')) continue;
410
  list($rule, $value) = explode(':', $ruleval, 2);
411
  $rule = trim($rule);
412
+ $value = stripslashes(trim($value));
413
 
414
  $rules = $values = array();
415
  // save important flag
447
  endforeach;
448
  endforeach;
449
  endforeach;
 
450
  }
451
 
452
  /*
474
  endforeach;
475
  endif;
476
  $output .= LF;
477
+ // turn the dictionaries into indexes (value => id into id => value):
478
  $rulearr = array_flip($this->dict_rule);
479
  $valarr = array_flip($this->dict_val);
480
  $selarr = array_flip($this->dict_sel);
481
  foreach ($this->sort_queries() as $query => $sort_order):
 
 
482
  $has_selector = 0;
483
  $sel_output = '';
484
+ $selectors = $this->sel_ndx[$this->dict_query[$query]];
485
+ uasort($selectors, array($this, 'cmp_seq'));
486
  if ('base' != $query) $sel_output .= $query . ' {' . LF;
487
  foreach ($selectors as $selid => $qsid):
488
  $has_value = 0;
492
  foreach ($this->val_ndx[$qsid] as $ruleid => $valid):
493
  if (isset($valid['child']) && isset($valarr[$valid['child']]) && '' !== $valarr[$valid['child']]):
494
  if (! $has_value):
495
+ $sel_output .= isset($this->dict_seq[$qsid])?'/*' . $this->dict_seq[$qsid] . '*/' . LF:''; // show load order
496
  $sel_output .= $sel . ' {' . LF;
497
  $has_value = 1;
498
  $has_selector = 1;
499
  endif;
500
+ $important_parnt = empty($valid['i_parnt']) ? 0 : 1;
501
+ $important = isset($valid['i_child']) ? $valid['i_child'] : $important_parnt;
502
+ $sel_output .= $this->add_vendor_rules($rulearr[$ruleid], stripslashes($valarr[$valid['child']]), $shorthand, $important);
503
  endif;
504
  endforeach;
505
+ $sel_output .= $this->encode_shorthand($shorthand); // . ($important ? ' !important' : '');
506
+ ;
507
  if ($has_value):
508
  $sel_output .= '}' . LF;
509
  endif;
533
  * These are based on commonly used practices and not all vendor prefixed are supported
534
  * TODO: verify this logic against vendor and W3C documentation
535
  */
536
+ function add_vendor_rules($rule, $value, &$shorthand, $important = 0) {
537
  $rules = '';
538
+ if ('filter' == $rule && (false !== strpos($value, 'progid:DXImageTransform.Microsoft.Gradient'))) return;
539
+ $importantstr = $important ? ' !important' : '';
540
  if (preg_match("/^(margin|padding)\-(top|right|bottom|left)$/", $rule, $matches)):
541
+ $shorthand[$matches[1]][$matches[2]] = $value . $importantstr;
542
  return '';
543
  elseif (preg_match("/^(box\-sizing|font\-smoothing|border\-radius|box\-shadow|transition)$/", $rule)):
544
  foreach(array('moz', 'webkit', 'o') as $prefix):
545
+ $rules .= ' -' . $prefix . '-' . $rule . ': ' . $value . $importantstr . ';' . LF;
546
  endforeach;
547
+ $rules .= ' ' . $rule . ': ' . $value . $importantstr . ';' . LF;
548
  elseif ('background-image' == $rule):
549
  // gradient?
550
  if ($gradient = $this->decode_gradient($value)):
551
  // standard gradient
552
  foreach(array('moz', 'webkit', 'o', 'ms') as $prefix):
553
  $rules .= ' background-image: -' . $prefix . '-' . 'linear-gradient(' . $gradient['origin'] . ', '
554
+ . $gradient['color1'] . ', ' . $gradient['color2'] . ')' . $importantstr . ';' . LF;
555
  endforeach;
556
  // W3C standard gradient
557
  // rotate origin 90 degrees
565
  $org = 'to ' . implode(' ', $dirs);
566
  endif;
567
  $rules .= ' background-image: linear-gradient(' . $org . ', '
568
+ . $gradient['color1'] . ', ' . $gradient['color2'] . ')' . $importantstr . ';' . LF;
569
 
570
  // legacy webkit gradient - we'll add if there is demand
571
  // '-webkit-gradient(linear,' .$origin . ', ' . $color1 . ', '. $color2 . ')';
574
  $type = (in_array($gradient['origin'], array('left', 'right', '0deg', '180deg')) ? 1 : 0);
575
  $color1 = preg_replace("/^#/", '#00', $gradient['color1']);
576
  $rules .= ' filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=' . $type . ', StartColorStr="'
577
+ . strtoupper($color1) . '", EndColorStr="' . strtoupper($gradient['color2']) . '")' . $importantstr . ';' . LF;
578
  else:
579
  // url or other value
580
+ $rules .= ' ' . $rule . ': ' . $value . $importantstr . ';' . LF;
581
  endif;
582
  else:
583
+ $rules .= ' ' . $rule . ': ' . $value . $importantstr . ';' . LF;
584
  endif;
585
  return $rules;
586
  }
682
  elseif (isset($_POST['ctc_child_imports'])):
683
  $this->parse_css('child', $_POST['ctc_child_imports']);
684
  else:
685
+ // set the custom sequence value
686
+ foreach (preg_grep('#^ctc_ovrd_child_seq_#', array_keys($_POST)) as $post_key):
687
+ if (preg_match('#^ctc_ovrd_child_seq_(\d+)$#', $post_key, $matches)):
688
+ $qsid = $matches[1];
689
+ $this->dict_seq[$qsid] = intval($_POST[$post_key]);
690
+ endif;
691
+ endforeach;
692
+ foreach (preg_grep('#^ctc_(ovrd|\d+)_child_seq_#', array_keys($_POST)) as $post_key):
693
+ endforeach;
694
  $parts = array();
695
+ foreach (preg_grep('#^ctc_(ovrd|\d+)_child#', array_keys($_POST)) as $post_key):
696
+ if (preg_match('#^ctc_(ovrd|\d+)_child_([\w\-]+?)_(\d+?)(_(.+))?$#', $post_key, $matches)):
697
+ $valid = $matches[1];
698
  $rule = $matches[2];
699
  if (null == $rule || !isset($this->dict_rule[$rule])) continue;
700
  $ruleid = $this->dict_rule[$rule];
701
  $qsid = $matches[3];
702
+ $value = sanitize_text_field(stripslashes($_POST[$post_key]));
703
+ $important = $this->is_important($value);
704
+ if (!empty($_POST['ctc_' . $valid . '_child_' . $rule . '_i_' . $qsid])) $important = 1;
705
 
706
  $selarr = $this->denorm_query_sel($qsid);
707
  if (!empty($matches[5])):
787
  return $queries;
788
  }
789
 
790
+ // sort selectors based on dict_seq if exists, otherwise qsid
791
+ function cmp_seq($a, $b) {
792
+ $cmpa = isset($this->dict_seq[$a])?$this->dict_seq[$a]:$a;
793
+ $cmpb = isset($this->dict_seq[$b])?$this->dict_seq[$b]:$b;
794
+ if ($cmpa == $cmpb) return 0;
795
+ return ($cmpa < $cmpb) ? -1 : 1;
796
+ }
797
+
798
+
799
  /*
800
  * denorm_rule_val
801
  * Return array of unique values corresponding to specific rule
839
  * Return id, query and selector values of a specific qsid (query-selector ID)
840
  */
841
  function denorm_query_sel($qsid) {
842
+ $queryarr = array_flip($this->dict_query);
843
+ $selarr = array_flip($this->dict_sel);
844
+ $this->dict_seq[$qsid] = isset($this->dict_seq[$qsid]) ? $this->dict_seq[$qsid] : $qsid;
845
  return array(
846
  'id' => $qsid,
847
  'query' => $queryarr[$this->dict_qs[$qsid]['q']],
848
  'selector' => $selarr[$this->dict_qs[$qsid]['s']],
849
+ 'seq' => $this->dict_seq[$qsid],
850
  );
851
  }
852
 
862
  if (isset($this->val_ndx[$qsid]) && is_array($this->val_ndx[$qsid])):
863
  foreach ($this->val_ndx[$qsid] as $ruleid => $values):
864
  foreach ($values as $name => $val):
865
+ if ('i_parnt' == $name || 'i_child' == $name):
866
+ $selarr['value'][$rulearr[$ruleid]][$name] = (empty($val) ? 0 : 1);
867
+ elseif (!isset($valarr[$val]) || '' === $valarr[$val]):
868
  continue;
869
+ else:
870
+ $selarr['value'][$rulearr[$ruleid]][$name] = $valarr[$val];
871
  endif;
 
872
  endforeach;
873
+ // add load order
874
  endforeach;
875
  endif;
876
  return $selarr;
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.7
9
  Author: Lilaea Media
10
  Author URI: http://www.lilaeamedia.com/
11
  Text Domain: chld_thm_cfg
@@ -196,7 +196,7 @@ class Child_Theme_Configurator_UI {
196
  <div class="ctc-input-cell" id="ctc_sel_ovrd_query_selected">&nbsp;</div>
197
  <div class="ctc-input-cell">
198
  <div class="ui-widget">
199
- <input id="ctc_sel_ovrd_query"/>
200
  </div>
201
  </div>
202
  </div>
@@ -207,7 +207,7 @@ class Child_Theme_Configurator_UI {
207
  <div class="ctc-input-cell" id="ctc_sel_ovrd_selector_selected">&nbsp;</div>
208
  <div class="ctc-input-cell">
209
  <div class="ui-widget">
210
- <input id="ctc_sel_ovrd_selector"/>
211
  <div id="ctc_status_sel_ndx"></div>
212
  </div>
213
  </div>
@@ -217,12 +217,12 @@ class Child_Theme_Configurator_UI {
217
  <div class="ctc-input-cell"><strong>
218
  <?php _e('Sample', 'chld_thm_cfg'); ?>
219
  </strong></div>
220
- <div id="ctc_status_sel_val"></div>
221
  <div class="ctc-input-cell clearfix" style="max-height:150px;overflow:hidden">
222
  <div class="ctc-swatch" id="ctc_child_all_0_swatch"><?php echo $this->swatch_text; ?></div>
223
  </div>
 
224
  <div class="ctc-input-cell ctc-button-cell" id="ctc_save_query_selector_cell">
225
- <input type="button" class="button ctc-save-input" id="ctc_save_query_selector"
226
  name="ctc_save_query_selector" value="Save" disabled />
227
  <input type="hidden" id="ctc_sel_ovrd_qsid"
228
  name="ctc_sel_ovrd_qsid" value="" />
@@ -246,14 +246,20 @@ class Child_Theme_Configurator_UI {
246
  </strong> </div>
247
  <div class="ctc-input-cell">
248
  <div class="ui-widget">
249
- <input id="ctc_new_rule_menu"/>
250
  </div>
251
  </div>
252
  </div>
 
 
 
 
 
 
253
  </div>
254
  <div class="ctc-selector-row clearfix" id="ctc_new_selector_row">
255
  <div class="ctc-input-cell"> <strong>
256
- <?php _e('New Selector(s)', 'chld_thm_cfg'); ?>
257
  </strong>
258
  <div class="ctc-textarea-button-cell" id="ctc_save_query_selector_cell">
259
  <input type="button" class="button ctc-save-input" id="ctc_save_new_selectors"
@@ -376,6 +382,7 @@ class Child_Theme_Configurator_UI {
376
  <p>The Query/Selector tab lets you find specific selectors and edit them. First, find the query that contains the selector you wish to edit by typing in the <strong>Query</strong> autoselect box. Select by clicking with the mouse or by pressing the "Enter" or "Tab" keys. Selectors are in the <strong>base</strong> query by default.</p>
377
  <p>Next, find the selector by typing in the <strong>Selector</strong> autoselect box. Select by clicking with the mouse or by pressing the "Enter" or "Tab" keys.</p>
378
  <p>This will load all of the rules for that selector with the Parent values on the left and the Child values inputs on the right. Any existing child values will be automatically populated. There is also a Sample preview that displays the combination of Parent and Child overrides. Note that the <strong>border</strong> and <strong>background-image</strong> get special treatment.</p>
 
379
  <p>Click "Save" to update the child stylesheet and save your changes to the WordPress admin.</p>
380
  ', 'chld_thm_cfg'
381
  ),
@@ -443,6 +450,8 @@ class Child_Theme_Configurator_UI {
443
  <p>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.</p>
444
  <h5 id="remove_styles">How do I remove a style from the Child Theme?</h5>
445
  <p>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.</p>
 
 
446
  <h5 id="gradients">How do I create cross-browser gradients?</h5>
447
  <p>The Child Theme Configurator automatically generates the vendor prefixes and filters to display gradients across most browsers. It uses a normalized syntax and only supports two colors 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. <strong>Note:</strong> For Internet Explorer, a filter rule approximates the gradient but can only be horizontal (origin top) or vertical (origin left). The legacy webkit-gradient syntax is not supported.</p>
448
  <h5 id="responsive">How do I make my Theme responsive?</h5>
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.8
9
  Author: Lilaea Media
10
  Author URI: http://www.lilaeamedia.com/
11
  Text Domain: chld_thm_cfg
196
  <div class="ctc-input-cell" id="ctc_sel_ovrd_query_selected">&nbsp;</div>
197
  <div class="ctc-input-cell">
198
  <div class="ui-widget">
199
+ <input id="ctc_sel_ovrd_query" />
200
  </div>
201
  </div>
202
  </div>
207
  <div class="ctc-input-cell" id="ctc_sel_ovrd_selector_selected">&nbsp;</div>
208
  <div class="ctc-input-cell">
209
  <div class="ui-widget">
210
+ <input id="ctc_sel_ovrd_selector" />
211
  <div id="ctc_status_sel_ndx"></div>
212
  </div>
213
  </div>
217
  <div class="ctc-input-cell"><strong>
218
  <?php _e('Sample', 'chld_thm_cfg'); ?>
219
  </strong></div>
 
220
  <div class="ctc-input-cell clearfix" style="max-height:150px;overflow:hidden">
221
  <div class="ctc-swatch" id="ctc_child_all_0_swatch"><?php echo $this->swatch_text; ?></div>
222
  </div>
223
+ <div id="ctc_status_sel_val"></div>
224
  <div class="ctc-input-cell ctc-button-cell" id="ctc_save_query_selector_cell">
225
+ <input type="button" class="button button-primary ctc-save-input" id="ctc_save_query_selector"
226
  name="ctc_save_query_selector" value="Save" disabled />
227
  <input type="hidden" id="ctc_sel_ovrd_qsid"
228
  name="ctc_sel_ovrd_qsid" value="" />
246
  </strong> </div>
247
  <div class="ctc-input-cell">
248
  <div class="ui-widget">
249
+ <input id="ctc_new_rule_menu" />
250
  </div>
251
  </div>
252
  </div>
253
+ <div class="ctc-input-row clearfix" id="input_row_selector">
254
+ <div class="ctc-input-cell"> <strong>
255
+ <?php _e('Order', 'chld_thm_cfg'); ?>
256
+ </strong> </div>
257
+ <div class="ctc-input-cell" id="ctc_child_load_order_container">&nbsp;</div>
258
+ </div>
259
  </div>
260
  <div class="ctc-selector-row clearfix" id="ctc_new_selector_row">
261
  <div class="ctc-input-cell"> <strong>
262
+ <?php _e('Raw CSS', 'chld_thm_cfg'); ?>
263
  </strong>
264
  <div class="ctc-textarea-button-cell" id="ctc_save_query_selector_cell">
265
  <input type="button" class="button ctc-save-input" id="ctc_save_new_selectors"
382
  <p>The Query/Selector tab lets you find specific selectors and edit them. First, find the query that contains the selector you wish to edit by typing in the <strong>Query</strong> autoselect box. Select by clicking with the mouse or by pressing the "Enter" or "Tab" keys. Selectors are in the <strong>base</strong> query by default.</p>
383
  <p>Next, find the selector by typing in the <strong>Selector</strong> autoselect box. Select by clicking with the mouse or by pressing the "Enter" or "Tab" keys.</p>
384
  <p>This will load all of the rules for that selector with the Parent values on the left and the Child values inputs on the right. Any existing child values will be automatically populated. There is also a Sample preview that displays the combination of Parent and Child overrides. Note that the <strong>border</strong> and <strong>background-image</strong> get special treatment.</p>
385
+ <p>The "Order" field contains the original sequence of the selector in the parent theme stylesheet. You can change the selector order sequence by entering a lower or higher number in the "Order" field. You can also force style overrides (so called "!important" flag) by checking the "!" box next to each input. Please use judiciously.</p>
386
  <p>Click "Save" to update the child stylesheet and save your changes to the WordPress admin.</p>
387
  ', 'chld_thm_cfg'
388
  ),
450
  <p>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.</p>
451
  <h5 id="remove_styles">How do I remove a style from the Child Theme?</h5>
452
  <p>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.</p>
453
+ <h5 id="important_flag">How do I set the !important flag?</h5>
454
+ <p>We always recommend relying on good cascading design over global overrides. To that end, you have ability to change the load order of child theme styles by entering a value in the "Order" field. And yes, you can now set rules as important by checking the "!" box next to each input. Please use judiciously.</p>
455
  <h5 id="gradients">How do I create cross-browser gradients?</h5>
456
  <p>The Child Theme Configurator automatically generates the vendor prefixes and filters to display gradients across most browsers. It uses a normalized syntax and only supports two colors 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. <strong>Note:</strong> For Internet Explorer, a filter rule approximates the gradient but can only be horizontal (origin top) or vertical (origin left). The legacy webkit-gradient syntax is not supported.</p>
457
  <h5 id="responsive">How do I make my Theme responsive?</h5>
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.7
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.7';
22
  var $css;
23
  var $optionsName;
24
  var $menuName;
@@ -92,6 +92,7 @@ class Child_Theme_Configurator {
92
  'load_txt' => __('Are you sure? This will replace your current settings.', 'chld_thm_cfg'),
93
  'swatch_txt' => $this->ui->swatch_text,
94
  'swatch_label' => __('Sample', 'chld_thm_cfg'),
 
95
  'selector_txt' => __('Selectors', 'chld_thm_cfg'),
96
  'close_txt' => __('Close', 'chld_thm_cfg'),
97
  'css_fail_txt' => __('The stylesheet cannot be displayed.', '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.1.8
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.8';
22
  var $css;
23
  var $optionsName;
24
  var $menuName;
92
  'load_txt' => __('Are you sure? This will replace your current settings.', 'chld_thm_cfg'),
93
  'swatch_txt' => $this->ui->swatch_text,
94
  'swatch_label' => __('Sample', 'chld_thm_cfg'),
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'),
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.7
6
  * Author: Lilaea Media
7
  * Author URI: http://www.lilaeamedia.com/
8
  * License: GPLv2
@@ -24,7 +24,7 @@ jQuery(document).ready(function($){
24
  },
25
 
26
  ctc_coalesce_inputs = function(obj) {
27
- var regex = /^(ctc_(ovrd_)?(parent|child)_([a-z\-]+)_(\d+))(_\w+)?$/,
28
  $container = $(obj).parents('.ctc-selector-row, .ctc-parent-row').first(),
29
  $swatch = $container.find('.ctc-swatch').first(),
30
  cssrules = { 'parent': {}, 'child': {} },
@@ -46,16 +46,22 @@ jQuery(document).ready(function($){
46
  $container.find('.ctc-parent-value, .ctc-child-value').each(function(){
47
  var inputid = $(this).attr('id'),
48
  inputparts = inputid.toString().match(regex),
 
49
  inputtheme = inputparts[3],
50
  inputrule = ('undefined' == typeof inputparts[4] ? '' : inputparts[4]),
51
  qsid = inputparts[5],
52
  rulepart = ('undefined' == typeof inputparts[6] ? '' : inputparts[6]),
53
  value = ('parent' == inputtheme ? $(this).text() : $(this).val()),
 
54
  parts, subparts;
55
  if ('child' == inputtheme) {
56
  postdata[inputid] = value;
 
 
 
 
 
57
  }
58
- if ('' === value) return;
59
  // handle specific inputs
60
  if (false === ctc_is_empty(rulepart)) {
61
  switch(rulepart) {
@@ -267,26 +273,31 @@ jQuery(document).ready(function($){
267
  });
268
  },
269
 
270
- ctc_render_child_rule_input = function(qsid, rule, specific) {
271
- var html = '',
272
- value = (ctc_is_empty(ctcAjax.sel_val[qsid]) || ctc_is_empty(ctcAjax.sel_val[qsid].value)
 
273
  || ctc_is_empty(ctcAjax.sel_val[qsid].value[rule]) ? '' : ctcAjax.sel_val[qsid].value[rule]),
274
- oldRuleObj = ctc_decode_value(rule, ('undefined' == typeof value ? '' : value['parnt'])),
275
- newRuleObj = ctc_decode_value(rule, ('undefined' == typeof value ? '' : value['child']));
 
 
 
 
276
  if (false === ctc_is_empty(ctcAjax.sel_val[qsid])) {
277
- html += '<div class="ctc-' + (specific ? 'selector' : 'input' ) + '-row clearfix">' + lf;
278
- html += '<div class="ctc-input-cell">' + (specific ? ctcAjax.sel_val[qsid].selector
279
- + (ctc_is_empty(oldRuleObj.orig) ? '<br/>' + ctcAjax.child_only_txt : '') : rule) + '</div>' + lf;
280
- if (!specific) {
281
- html += '<div class="ctc-parent-value ctc-input-cell" id="ctc_parent_' + rule + '_' + qsid + '">'
282
- + (ctc_is_empty(oldRuleObj.orig) ? '[no value]' : oldRuleObj.orig) + '</div>' + lf;
283
  }
284
  html += '<div class="ctc-input-cell">' + lf;
285
  if (false === ctc_is_empty(oldRuleObj.names)){
286
  $.each(oldRuleObj.names, function(ndx, newname) {
287
  newname = (ctc_is_empty(newname) ? '' : newname);
288
  html += '<div class="ctc-child-input-cell">' + lf;
289
- var id = 'ctc_' + (specific? '' : 'ovrd_') + 'child_' + rule + '_' + qsid + newname,
290
  newval;
291
  if (false === (newval = newRuleObj.values.shift()) ){
292
  newval = '';
@@ -299,13 +310,15 @@ jQuery(document).ready(function($){
299
  + '" value="' + newval + '" />' + lf;
300
  html += '</div>' + lf;
301
  });
 
 
302
  }
303
  html += '</div>' + lf;
304
- html += (specific ? '<div class="ctc-swatch ctc-specific" id="ctc_child_' + rule + '_' + qsid + '_swatch">'
305
  + ctcAjax.swatch_txt + '</div>' + lf
306
  + '<div class="ctc-child-input-cell ctc-button-cell" id="ctc_save_' + rule + '_' + qsid + '_cell">' + lf
307
  + '<input type="button" class="button ctc-save-input" id="ctc_save_' + rule + '_' + qsid
308
- + '" name="ctc_save_' + rule + '_' + qsid + '" value="Save" /></div>' + lf : '');
309
  html += '</div><!-- end input row -->' + lf;
310
  }
311
  return html;
@@ -320,16 +333,25 @@ jQuery(document).ready(function($){
320
  ctc_query_css('sel_val', qsid, ctc_render_selector_inputs);
321
  return false;
322
  }
323
- var html = '';
324
- if (false === ctc_is_empty(ctcAjax.sel_val[qsid] && false === ctc_is_empty(ctcAjax.sel_val[qsid].value))){
325
- $.each(ctcAjax.sel_val[qsid].value, function(rule, value) {
326
- html += ctc_render_child_rule_input(qsid, rule, false);
327
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
328
  }
329
- $('#ctc_sel_ovrd_rule_inputs').html(html).find('.color-picker').each(function() {
330
- ctc_setup_iris(this);
331
- });
332
- ctc_coalesce_inputs('#ctc_child_all_0_swatch');
333
  }
334
 
335
  ctc_render_rule_value_inputs = function(ruleid) {
@@ -346,10 +368,10 @@ jQuery(document).ready(function($){
346
  $.each(ctcAjax.rule_val[ruleid], function(valid, value) {
347
  var oldRuleObj = ctc_decode_value(rule, value);
348
  html += '<div class="ctc-parent-row clearfix" id="ctc_rule_row_' + rule + '_' + valid + '">' + lf;
349
- html += '<div class="ctc-input-cell ctc-parent-value" id="ctc_parent_' + rule + '_' + valid + '">'
350
  + oldRuleObj.orig + '</div>' + lf;
351
  html += '<div class="ctc-input-cell">' + lf;
352
- html += '<div class="ctc-swatch ctc-specific" id="ctc_parent_'+rule+'_' + valid + '_swatch">'
353
  + ctcAjax.swatch_txt + '</div></div>' + lf;
354
  html += '<div class="ctc-input-cell"><a href="#" class="ctc-selector-handle" id="ctc_selector_' + rule + '_' + valid + '">'
355
  + ctcAjax.selector_txt + '</a></div>' + lf;
@@ -387,7 +409,7 @@ jQuery(document).ready(function($){
387
  if (false === ctc_is_empty(selectors)){
388
  $.each(selectors, function(qsid, data) {
389
  ctcAjax.sel_val[qsid] = data;
390
- html += ctc_render_child_rule_input(qsid, rule, true);
391
  });
392
  }
393
  });
@@ -487,7 +509,6 @@ jQuery(document).ready(function($){
487
  postdata,
488
  //on success function
489
  function(response){
490
- //console.log(response);
491
  // release button
492
  $(obj).prop('disabled', false);
493
  // hide spinner
@@ -503,8 +524,7 @@ jQuery(document).ready(function($){
503
  ctc_setup_menus();
504
  }
505
  return false;
506
- },
507
- 'json'
508
  ).fail(function(){
509
  // release button
510
  $(obj).prop('disabled', false);
@@ -719,9 +739,13 @@ jQuery(document).ready(function($){
719
  selectFirst: true,
720
  autoFocus: true,
721
  select: function(e, ui) {
722
- $('#ctc_sel_ovrd_rule_inputs').append(ctc_render_child_rule_input(currentSel, ui.item.label, false)).find('.color-picker').each(function() {
723
- ctc_setup_iris(this);
724
- });
 
 
 
 
725
  $('#ctc_new_rule_menu').val('');
726
  if (ctc_is_empty(ctcAjax.sel_val[currentSel].value)) {
727
  ctcAjax.sel_val[currentSel]['value'] = {};
@@ -827,7 +851,7 @@ jQuery(document).ready(function($){
827
  ctc_set_notice('')
828
  $('.color-picker').not(this).iris('hide');
829
  });
830
- $('.ctc-option-panel-container').on('change', '.ctc-child-value', function() {
831
  ctc_coalesce_inputs(this);
832
  });
833
  $('.ctc-option-panel-container').on('click', '.ctc-selector-handle', function(e) {
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.8
6
  * Author: Lilaea Media
7
  * Author URI: http://www.lilaeamedia.com/
8
  * License: GPLv2
24
  },
25
 
26
  ctc_coalesce_inputs = function(obj) {
27
+ var regex = /^(ctc_(ovrd|\d+)_(parent|child)_([a-z\-]+)_(\d+))(_\w+)?$/,
28
  $container = $(obj).parents('.ctc-selector-row, .ctc-parent-row').first(),
29
  $swatch = $container.find('.ctc-swatch').first(),
30
  cssrules = { 'parent': {}, 'child': {} },
46
  $container.find('.ctc-parent-value, .ctc-child-value').each(function(){
47
  var inputid = $(this).attr('id'),
48
  inputparts = inputid.toString().match(regex),
49
+ inputseq = inputparts[2],
50
  inputtheme = inputparts[3],
51
  inputrule = ('undefined' == typeof inputparts[4] ? '' : inputparts[4]),
52
  qsid = inputparts[5],
53
  rulepart = ('undefined' == typeof inputparts[6] ? '' : inputparts[6]),
54
  value = ('parent' == inputtheme ? $(this).text() : $(this).val()),
55
+ important = 'ctc_' + inputseq + '_child_' + inputrule + '_i_' + qsid,
56
  parts, subparts;
57
  if ('child' == inputtheme) {
58
  postdata[inputid] = value;
59
+ postdata[important] = ($('#' + important).is(':checked')) ? 1 : 0;
60
+ }
61
+ if ('' === value) {
62
+ $('#'+important).prop('checked', false);
63
+ return;
64
  }
 
65
  // handle specific inputs
66
  if (false === ctc_is_empty(rulepart)) {
67
  switch(rulepart) {
273
  });
274
  },
275
 
276
+ ctc_render_child_rule_input = function(qsid, rule, seq) {
277
+ var html = '',
278
+ value = (ctc_is_empty(ctcAjax.sel_val[qsid])
279
+ || ctc_is_empty(ctcAjax.sel_val[qsid].value)
280
  || ctc_is_empty(ctcAjax.sel_val[qsid].value[rule]) ? '' : ctcAjax.sel_val[qsid].value[rule]),
281
+ oldRuleObj = ctc_decode_value(rule, ('undefined' == typeof value ? '' : value['parnt'])),
282
+ oldRuleFlag = (false === ctc_is_empty(value['i_parnt']) && value['i_parnt']) ?
283
+ ctcAjax.important_label : '',
284
+ newRuleObj = ctc_decode_value(rule, ('undefined' == typeof value ? '' : value['child'])),
285
+ newRuleFlag = (false === ctc_is_empty(value['i_child']) && value['i_child']) ? 1 : 0,
286
+ impid = 'ctc_' + seq + '_child_' + rule + '_i_' + qsid;
287
  if (false === ctc_is_empty(ctcAjax.sel_val[qsid])) {
288
+ html += '<div class="ctc-' + ('ovrd' == seq ? 'input' : 'selector' ) + '-row clearfix">' + lf;
289
+ html += '<div class="ctc-input-cell">' + ('ovrd' == seq ? rule : ctcAjax.sel_val[qsid].selector
290
+ + (ctc_is_empty(oldRuleObj.orig) ? '<br/>' + ctcAjax.child_only_txt : '')) + '</div>' + lf;
291
+ if ('ovrd' == seq) {
292
+ html += '<div class="ctc-parent-value ctc-input-cell" id="ctc_' + seq + '_parent_' + rule + '_' + qsid + '">'
293
+ + (ctc_is_empty(oldRuleObj.orig) ? '[no value]' : oldRuleObj.orig + oldRuleFlag) + '</div>' + lf;
294
  }
295
  html += '<div class="ctc-input-cell">' + lf;
296
  if (false === ctc_is_empty(oldRuleObj.names)){
297
  $.each(oldRuleObj.names, function(ndx, newname) {
298
  newname = (ctc_is_empty(newname) ? '' : newname);
299
  html += '<div class="ctc-child-input-cell">' + lf;
300
+ var id = 'ctc_' + seq + '_child_' + rule + '_' + qsid + newname,
301
  newval;
302
  if (false === (newval = newRuleObj.values.shift()) ){
303
  newval = '';
310
  + '" value="' + newval + '" />' + lf;
311
  html += '</div>' + lf;
312
  });
313
+ html += '<label for="' + impid + '"><input type="checkbox" id="' + impid + '" name="' + impid + '" value="1" '
314
+ + (1 === newRuleFlag ? 'checked' : '') + ' />' + ctcAjax.important_label + '</label>' + lf;
315
  }
316
  html += '</div>' + lf;
317
+ html += ('ovrd' == seq ? '' : '<div class="ctc-swatch ctc-specific" id="ctc_child_' + rule + '_' + qsid + '_swatch">'
318
  + ctcAjax.swatch_txt + '</div>' + lf
319
  + '<div class="ctc-child-input-cell ctc-button-cell" id="ctc_save_' + rule + '_' + qsid + '_cell">' + lf
320
  + '<input type="button" class="button ctc-save-input" id="ctc_save_' + rule + '_' + qsid
321
+ + '" name="ctc_save_' + rule + '_' + qsid + '" value="Save" /></div>' + lf);
322
  html += '</div><!-- end input row -->' + lf;
323
  }
324
  return html;
333
  ctc_query_css('sel_val', qsid, ctc_render_selector_inputs);
334
  return false;
335
  }
336
+ var id, html, val;
337
+ if (false === ctc_is_empty(ctcAjax.sel_val[qsid])) {
338
+ if (false === ctc_is_empty(ctcAjax.sel_val[qsid].seq)) {
339
+ id = 'ctc_ovrd_child_seq_' + qsid;
340
+ val = parseInt(ctcAjax.sel_val[qsid].seq);
341
+ html = '<input type="text" id="' + id + '" name="' + id + '" class="ctc-child-value" value="' + val + '" />';
342
+ $('#ctc_child_load_order_container').html(html);
343
+ }
344
+ if (false === ctc_is_empty(ctcAjax.sel_val[qsid].value)){
345
+ html = '';
346
+ $.each(ctcAjax.sel_val[qsid].value, function(rule, value) {
347
+ html += ctc_render_child_rule_input(qsid, rule, 'ovrd');
348
+ });
349
+ $('#ctc_sel_ovrd_rule_inputs').html(html).find('.color-picker').each(function() {
350
+ ctc_setup_iris(this);
351
+ });
352
+ ctc_coalesce_inputs('#ctc_child_all_0_swatch');
353
+ }
354
  }
 
 
 
 
355
  }
356
 
357
  ctc_render_rule_value_inputs = function(ruleid) {
368
  $.each(ctcAjax.rule_val[ruleid], function(valid, value) {
369
  var oldRuleObj = ctc_decode_value(rule, value);
370
  html += '<div class="ctc-parent-row clearfix" id="ctc_rule_row_' + rule + '_' + valid + '">' + lf;
371
+ html += '<div class="ctc-input-cell ctc-parent-value" id="ctc_' + valid + '_parent_' + rule + '_' + valid + '">'
372
  + oldRuleObj.orig + '</div>' + lf;
373
  html += '<div class="ctc-input-cell">' + lf;
374
+ html += '<div class="ctc-swatch ctc-specific" id="ctc_' + valid + '_parent_' + rule + '_' + valid + '_swatch">'
375
  + ctcAjax.swatch_txt + '</div></div>' + lf;
376
  html += '<div class="ctc-input-cell"><a href="#" class="ctc-selector-handle" id="ctc_selector_' + rule + '_' + valid + '">'
377
  + ctcAjax.selector_txt + '</a></div>' + lf;
409
  if (false === ctc_is_empty(selectors)){
410
  $.each(selectors, function(qsid, data) {
411
  ctcAjax.sel_val[qsid] = data;
412
+ html += ctc_render_child_rule_input(qsid, rule, valid);
413
  });
414
  }
415
  });
509
  postdata,
510
  //on success function
511
  function(response){
 
512
  // release button
513
  $(obj).prop('disabled', false);
514
  // hide spinner
524
  ctc_setup_menus();
525
  }
526
  return false;
527
+ }, 'json'
 
528
  ).fail(function(){
529
  // release button
530
  $(obj).prop('disabled', false);
739
  selectFirst: true,
740
  autoFocus: true,
741
  select: function(e, ui) {
742
+ $('#ctc_sel_ovrd_rule_inputs')
743
+ .append(ctc_render_child_rule_input(currentSel, ui.item.label, 'ovrd'))
744
+ .find('.ctc-child-value').each(function(){
745
+ if ($(this).hasClass('color-picker'))
746
+ ctc_setup_iris($(this));
747
+ $(this).focus();
748
+ });
749
  $('#ctc_new_rule_menu').val('');
750
  if (ctc_is_empty(ctcAjax.sel_val[currentSel].value)) {
751
  ctcAjax.sel_val[currentSel]['value'] = {};
851
  ctc_set_notice('')
852
  $('.color-picker').not(this).iris('hide');
853
  });
854
+ $('.ctc-option-panel-container').on('change', '.ctc-child-value, input[type=checkbox]', function() {
855
  ctc_coalesce_inputs(this);
856
  });
857
  $('.ctc-option-panel-container').on('click', '.ctc-selector-handle', function(e) {
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.7
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("&nbsp;");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)});
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.8
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){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("&nbsp;");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)});
lang/chld_thm_cfg.pot CHANGED
@@ -1,14 +1,14 @@
1
- # Copyright (C) 2013 Child Theme Configurator
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.0\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/child-theme-configurator\n"
7
- "POT-Creation-Date: 2013-12-08 03:44:46+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2013-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
@@ -16,11 +16,11 @@ msgstr ""
16
  msgid "Parent/Child"
17
  msgstr ""
18
 
19
- #: includes/class-ctc-ui.php:49 includes/class-ctc-ui.php:365
20
  msgid "Query/Selector"
21
  msgstr ""
22
 
23
- #: includes/class-ctc-ui.php:52 includes/class-ctc-ui.php:378
24
  msgid "Rule/Value"
25
  msgstr ""
26
 
@@ -81,7 +81,7 @@ msgstr ""
81
  msgid "Sample"
82
  msgstr ""
83
 
84
- #: includes/class-ctc-ui.php:183 includes/class-ctc.php:95
85
  msgid "Selectors"
86
  msgstr ""
87
 
@@ -105,23 +105,38 @@ msgstr ""
105
  msgid "New Rule"
106
  msgstr ""
107
 
108
- #: includes/class-ctc-ui.php:256
109
- msgid "New Selector(s)"
110
  msgstr ""
111
 
112
- #: includes/class-ctc-ui.php:275
 
 
 
 
113
  msgid "@import Statements"
114
  msgstr ""
115
 
116
- #: includes/class-ctc-ui.php:331
117
  msgid "Child Theme <strong>%s</strong> has been generated successfully."
118
  msgstr ""
119
 
120
- #: includes/class-ctc-ui.php:348
 
 
 
 
 
 
 
 
 
 
 
121
  msgid "Start Here"
122
  msgstr ""
123
 
124
- #: includes/class-ctc-ui.php:349
125
  msgid ""
126
  "\n"
127
  "<p>The first step is to create a child theme and import your parent theme "
@@ -142,7 +157,7 @@ msgid ""
142
  "\t\t\t\t "
143
  msgstr ""
144
 
145
- #: includes/class-ctc-ui.php:366
146
  msgid ""
147
  "\n"
148
  "<p>There are two ways to identify and override parent styles. The Child "
@@ -165,12 +180,17 @@ msgid ""
165
  "displays the combination of Parent and Child overrides. Note that the "
166
  "<strong>border</strong> and <strong>background-image</strong> get special "
167
  "treatment.</p>\n"
 
 
 
 
 
168
  "<p>Click \"Save\" to update the child stylesheet and save your changes to "
169
  "the WordPress admin.</p>\n"
170
  "\t\t\t\t "
171
  msgstr ""
172
 
173
- #: includes/class-ctc-ui.php:379
174
  msgid ""
175
  "\n"
176
  "<p>There are two ways to identify and override parent styles. The Child "
@@ -197,11 +217,11 @@ msgid ""
197
  "\t\t\t\t "
198
  msgstr ""
199
 
200
- #: includes/class-ctc-ui.php:391
201
  msgid "Add New Styles"
202
  msgstr ""
203
 
204
- #: includes/class-ctc-ui.php:392
205
  msgid ""
206
  "\n"
207
  "<p>If you wish to add additional rules to a given selector, first load the "
@@ -221,11 +241,11 @@ msgid ""
221
  "\t\t\t\t "
222
  msgstr ""
223
 
224
- #: includes/class-ctc-ui.php:402
225
  msgid "@imports"
226
  msgstr ""
227
 
228
- #: includes/class-ctc-ui.php:403
229
  msgid ""
230
  "\n"
231
  "<p>You can add additional stylesheets and web fonts by typing @import rules "
@@ -243,11 +263,11 @@ msgid ""
243
  "\t\t\t\t "
244
  msgstr ""
245
 
246
- #: includes/class-ctc-ui.php:416
247
  msgid "Preview and Activate"
248
  msgstr ""
249
 
250
- #: includes/class-ctc-ui.php:417
251
  msgid ""
252
  "\n"
253
  "<p>Click the View Child or Parent CSS tab to reference the stylesheet code. "
@@ -261,11 +281,11 @@ msgid ""
261
  "\t\t\t\t "
262
  msgstr ""
263
 
264
- #: includes/class-ctc-ui.php:428
265
  msgid "FAQs"
266
  msgstr ""
267
 
268
- #: includes/class-ctc-ui.php:429
269
  msgid ""
270
  "\n"
271
  "<h5 id=\"specific_color\">How do I change a specific color/font style/"
@@ -285,6 +305,12 @@ msgid ""
285
  "<p>Delete the value from the input for the rule you wish to remove. The "
286
  "Child Theme Configurator only adds overrides for rules that contain values.</"
287
  "p>\n"
 
 
 
 
 
 
288
  "<h5 id=\"gradients\">How do I create cross-browser gradients?</h5>\n"
289
  "<p>The Child Theme Configurator automatically generates the vendor prefixes "
290
  "and filters to display gradients across most browsers. It uses a normalized "
@@ -322,11 +348,11 @@ msgid ""
322
  " "
323
  msgstr ""
324
 
325
- #: includes/class-ctc-ui.php:456
326
  msgid "Glossary"
327
  msgstr ""
328
 
329
- #: includes/class-ctc-ui.php:457
330
  msgid ""
331
  "\n"
332
  "<h3 id=\"terms\">Glossary</h3>\n"
@@ -366,31 +392,31 @@ msgid ""
366
  "\t\t\t\t "
367
  msgstr ""
368
 
369
- #: includes/class-ctc-ui.php:478
370
  msgid "Contact us"
371
  msgstr ""
372
 
373
- #: includes/class-ctc-ui.php:479
374
  msgid "Plugin Website"
375
  msgstr ""
376
 
377
- #: includes/class-ctc-ui.php:480
378
  msgid "Donate"
379
  msgstr ""
380
 
381
- #: includes/class-ctc-ui.php:481
382
  msgid "Give Us 5 Stars"
383
  msgstr ""
384
 
385
- #: includes/class-ctc-ui.php:482
386
  msgid "WordPress Codex"
387
  msgstr ""
388
 
389
- #: includes/class-ctc-ui.php:483
390
  msgid "WordPress Answers"
391
  msgstr ""
392
 
393
- #. #-#-#-#-# child-theme-configurator.pot (Child Theme Configurator 1.1.0) #-#-#-#-#
394
  #. Plugin Name of the plugin/theme
395
  #: includes/class-ctc.php:43
396
  msgid "Child Theme Configurator"
@@ -432,58 +458,68 @@ msgstr ""
432
  msgid "Are you sure? This will replace your current settings."
433
  msgstr ""
434
 
435
- #: includes/class-ctc.php:96
436
- msgid "Close"
437
  msgstr ""
438
 
439
  #: includes/class-ctc.php:97
440
- msgid "The stylesheet cannot be displayed."
441
  msgstr ""
442
 
443
  #: includes/class-ctc.php:98
444
- msgid "(Child Only)"
445
  msgstr ""
446
 
447
  #: includes/class-ctc.php:99
 
 
 
 
448
  msgid "Please enter a valid Child Theme"
449
  msgstr ""
450
 
451
- #: includes/class-ctc.php:100 includes/class-ctc.php:218
452
  msgid "Please enter a valid Child Theme name"
453
  msgstr ""
454
 
455
- #: includes/class-ctc.php:101
456
  msgid "<strong>%s</strong> exists. Please enter a different Child Theme"
457
  msgstr ""
458
 
459
- #: includes/class-ctc.php:203
460
  msgid "%s does not exist. Please select a valid Parent Theme"
461
  msgstr ""
462
 
463
- #: includes/class-ctc.php:206
464
  msgid "Please select a valid Parent Theme"
465
  msgstr ""
466
 
467
- #: includes/class-ctc.php:211
468
  msgid ""
469
  "<strong>%s</strong> exists. Please enter a different Child Theme template "
470
  "name"
471
  msgstr ""
472
 
473
- #: includes/class-ctc.php:215
474
  msgid "Please enter a valid Child Theme template name"
475
  msgstr ""
476
 
477
- #: includes/class-ctc.php:221
478
  msgid "You do not have permission to configure child themes."
479
  msgstr ""
480
 
 
 
 
 
481
  #. Plugin URI of the plugin/theme
482
  msgid "http://www.lilaeamedia.com/plugins/child-theme-configurator/"
483
  msgstr ""
484
 
485
  #. Description of the plugin/theme
486
- msgid "Create Child Theme from any Theme or Stylesheet"
 
 
487
  msgstr ""
488
 
489
  #. Author of the plugin/theme
1
+ # Copyright (C) 2014 Child Theme Configurator
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.8\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/child-theme-configurator\n"
7
+ "POT-Creation-Date: 2014-01-18 00:37:07+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2014-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
16
  msgid "Parent/Child"
17
  msgstr ""
18
 
19
+ #: includes/class-ctc-ui.php:49 includes/class-ctc-ui.php:379
20
  msgid "Query/Selector"
21
  msgstr ""
22
 
23
+ #: includes/class-ctc-ui.php:52 includes/class-ctc-ui.php:393
24
  msgid "Rule/Value"
25
  msgstr ""
26
 
81
  msgid "Sample"
82
  msgstr ""
83
 
84
+ #: includes/class-ctc-ui.php:183 includes/class-ctc.php:96
85
  msgid "Selectors"
86
  msgstr ""
87
 
105
  msgid "New Rule"
106
  msgstr ""
107
 
108
+ #: includes/class-ctc-ui.php:255
109
+ msgid "Order"
110
  msgstr ""
111
 
112
+ #: includes/class-ctc-ui.php:262
113
+ msgid "Raw CSS"
114
+ msgstr ""
115
+
116
+ #: includes/class-ctc-ui.php:281
117
  msgid "@import Statements"
118
  msgstr ""
119
 
120
+ #: includes/class-ctc-ui.php:337
121
  msgid "Child Theme <strong>%s</strong> has been generated successfully."
122
  msgstr ""
123
 
124
+ #: includes/class-ctc-ui.php:355
125
+ msgid "Tutorial Video"
126
+ msgstr ""
127
+
128
+ #: includes/class-ctc-ui.php:356
129
+ msgid ""
130
+ "<iframe width=\"480\" height=\"270\" src=\"//www.youtube.com/embed/"
131
+ "xL2HkWQxgOA?rel=0&modestbranding=1\" frameborder=\"0\" allowfullscreen></"
132
+ "iframe>"
133
+ msgstr ""
134
+
135
+ #: includes/class-ctc-ui.php:362
136
  msgid "Start Here"
137
  msgstr ""
138
 
139
+ #: includes/class-ctc-ui.php:363
140
  msgid ""
141
  "\n"
142
  "<p>The first step is to create a child theme and import your parent theme "
157
  "\t\t\t\t "
158
  msgstr ""
159
 
160
+ #: includes/class-ctc-ui.php:380
161
  msgid ""
162
  "\n"
163
  "<p>There are two ways to identify and override parent styles. The Child "
180
  "displays the combination of Parent and Child overrides. Note that the "
181
  "<strong>border</strong> and <strong>background-image</strong> get special "
182
  "treatment.</p>\n"
183
+ "<p>The \"Order\" field contains the original sequence of the selector in the "
184
+ "parent theme stylesheet. You can change the selector order sequence by "
185
+ "entering a lower or higher number in the \"Order\" field. You can also force "
186
+ "style overrides (so called \"!important\" flag) by checking the \"!\" box "
187
+ "next to each input. Please use judiciously.</p>\n"
188
  "<p>Click \"Save\" to update the child stylesheet and save your changes to "
189
  "the WordPress admin.</p>\n"
190
  "\t\t\t\t "
191
  msgstr ""
192
 
193
+ #: includes/class-ctc-ui.php:394
194
  msgid ""
195
  "\n"
196
  "<p>There are two ways to identify and override parent styles. The Child "
217
  "\t\t\t\t "
218
  msgstr ""
219
 
220
+ #: includes/class-ctc-ui.php:406
221
  msgid "Add New Styles"
222
  msgstr ""
223
 
224
+ #: includes/class-ctc-ui.php:407
225
  msgid ""
226
  "\n"
227
  "<p>If you wish to add additional rules to a given selector, first load the "
241
  "\t\t\t\t "
242
  msgstr ""
243
 
244
+ #: includes/class-ctc-ui.php:417
245
  msgid "@imports"
246
  msgstr ""
247
 
248
+ #: includes/class-ctc-ui.php:418
249
  msgid ""
250
  "\n"
251
  "<p>You can add additional stylesheets and web fonts by typing @import rules "
263
  "\t\t\t\t "
264
  msgstr ""
265
 
266
+ #: includes/class-ctc-ui.php:431
267
  msgid "Preview and Activate"
268
  msgstr ""
269
 
270
+ #: includes/class-ctc-ui.php:432
271
  msgid ""
272
  "\n"
273
  "<p>Click the View Child or Parent CSS tab to reference the stylesheet code. "
281
  "\t\t\t\t "
282
  msgstr ""
283
 
284
+ #: includes/class-ctc-ui.php:443
285
  msgid "FAQs"
286
  msgstr ""
287
 
288
+ #: includes/class-ctc-ui.php:444
289
  msgid ""
290
  "\n"
291
  "<h5 id=\"specific_color\">How do I change a specific color/font style/"
305
  "<p>Delete the value from the input for the rule you wish to remove. The "
306
  "Child Theme Configurator only adds overrides for rules that contain values.</"
307
  "p>\n"
308
+ "<h5 id=\"important_flag\">How do I set the !important flag?</h5>\n"
309
+ "<p>We always recommend relying on good cascading design over global "
310
+ "overrides. To that end, you have ability to change the load order of child "
311
+ "theme styles by entering a value in the \"Order\" field. And yes, you can "
312
+ "now set rules as important by checking the \"!\" box next to each input. "
313
+ "Please use judiciously.</p>\n"
314
  "<h5 id=\"gradients\">How do I create cross-browser gradients?</h5>\n"
315
  "<p>The Child Theme Configurator automatically generates the vendor prefixes "
316
  "and filters to display gradients across most browsers. It uses a normalized "
348
  " "
349
  msgstr ""
350
 
351
+ #: includes/class-ctc-ui.php:473
352
  msgid "Glossary"
353
  msgstr ""
354
 
355
+ #: includes/class-ctc-ui.php:474
356
  msgid ""
357
  "\n"
358
  "<h3 id=\"terms\">Glossary</h3>\n"
392
  "\t\t\t\t "
393
  msgstr ""
394
 
395
+ #: includes/class-ctc-ui.php:495
396
  msgid "Contact us"
397
  msgstr ""
398
 
399
+ #: includes/class-ctc-ui.php:496
400
  msgid "Plugin Website"
401
  msgstr ""
402
 
403
+ #: includes/class-ctc-ui.php:497
404
  msgid "Donate"
405
  msgstr ""
406
 
407
+ #: includes/class-ctc-ui.php:498
408
  msgid "Give Us 5 Stars"
409
  msgstr ""
410
 
411
+ #: includes/class-ctc-ui.php:499
412
  msgid "WordPress Codex"
413
  msgstr ""
414
 
415
+ #: includes/class-ctc-ui.php:500
416
  msgid "WordPress Answers"
417
  msgstr ""
418
 
419
+ #. #-#-#-#-# ctc.pot (Child Theme Configurator 1.1.8) #-#-#-#-#
420
  #. Plugin Name of the plugin/theme
421
  #: includes/class-ctc.php:43
422
  msgid "Child Theme Configurator"
458
  msgid "Are you sure? This will replace your current settings."
459
  msgstr ""
460
 
461
+ #: includes/class-ctc.php:95
462
+ msgid "<span style=\"font-size:10px\">!</span>"
463
  msgstr ""
464
 
465
  #: includes/class-ctc.php:97
466
+ msgid "Close"
467
  msgstr ""
468
 
469
  #: includes/class-ctc.php:98
470
+ msgid "The stylesheet cannot be displayed."
471
  msgstr ""
472
 
473
  #: includes/class-ctc.php:99
474
+ msgid "(Child Only)"
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:101 includes/class-ctc.php:220
482
  msgid "Please enter a valid Child Theme name"
483
  msgstr ""
484
 
485
+ #: includes/class-ctc.php:102
486
  msgid "<strong>%s</strong> exists. Please enter a different Child Theme"
487
  msgstr ""
488
 
489
+ #: includes/class-ctc.php:205
490
  msgid "%s does not exist. Please select a valid Parent Theme"
491
  msgstr ""
492
 
493
+ #: includes/class-ctc.php:208
494
  msgid "Please select a valid Parent Theme"
495
  msgstr ""
496
 
497
+ #: includes/class-ctc.php:213
498
  msgid ""
499
  "<strong>%s</strong> exists. Please enter a different Child Theme template "
500
  "name"
501
  msgstr ""
502
 
503
+ #: includes/class-ctc.php:217
504
  msgid "Please enter a valid Child Theme template name"
505
  msgstr ""
506
 
507
+ #: includes/class-ctc.php:223
508
  msgid "You do not have permission to configure child themes."
509
  msgstr ""
510
 
511
+ #: includes/class-ctc.php:239
512
+ msgid "Child Theme %s was unchanged."
513
+ msgstr ""
514
+
515
  #. Plugin URI of the plugin/theme
516
  msgid "http://www.lilaeamedia.com/plugins/child-theme-configurator/"
517
  msgstr ""
518
 
519
  #. Description of the plugin/theme
520
+ msgid ""
521
+ "Create a Child Theme from any installed Theme. Each CSS selector, rule and "
522
+ "value can then be searched, previewed and modified."
523
  msgstr ""
524
 
525
  #. Author of the plugin/theme
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.1.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -75,7 +75,7 @@ You can override a specific value globally using the Rule/Value tab. See "Rule/V
75
 
76
  = How do I add styles that aren't in the Parent Theme? =
77
 
78
- You can add queries and selectors using the "New Selector(s)" textarea on the Query/Selector tab. See "Query/Selector," below.
79
 
80
  = How do I remove a style from the Parent Theme? =
81
 
@@ -87,7 +87,7 @@ Delete the value from the input for the rule you wish to remove. The Child Theme
87
 
88
  = How do I set the !important flag? =
89
 
90
- 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.
91
 
92
  = How do I create cross-browser gradients? =
93
 
@@ -117,6 +117,9 @@ You can also create a secondary stylesheet that contains @font-face rules and im
117
 
118
  == Changelog ==
119
 
 
 
 
120
  = 1.1.7 =
121
  * Added tutorial video to help tabs.
122
 
@@ -201,6 +204,8 @@ Next, find the selector by typing in the Selector autoselect box. Select by clic
201
 
202
  This will load all of the rules for that selector with the Parent values on the left and the Child values inputs on the right. Any existing child values will be automatically populated. There is also a Sample preview that displays the combination of Parent and Child overrides. Note that the border and background-image get special treatment.
203
 
 
 
204
  Click "Save" to update the child stylesheet and save your changes to the WordPress admin.
205
 
206
  = Rule/Value =
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.1.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
75
 
76
  = How do I add styles that aren't in the Parent Theme? =
77
 
78
+ You can add queries and selectors using the "Raw CSS" textarea on the Query/Selector tab. See "Query/Selector," below.
79
 
80
  = How do I remove a style from the Parent Theme? =
81
 
87
 
88
  = How do I set the !important flag? =
89
 
90
+ We always recommend relying on good cascading design over global overrides. To that end, version 1.1.8 gives the ability to change the load order of child theme styles by entering a value in the "Order" field. And yes, you can now set rules as important by checking the "!" box next to each input. Please use judiciously.
91
 
92
  = How do I create cross-browser gradients? =
93
 
117
 
118
  == Changelog ==
119
 
120
+ = 1.1.8 =
121
+ * Added reorder sequence and important flag functionality. Fixed bug where multiple inputs with same selector/rule combo were assigned the same id. Fixed bug in the shorthand encoding routine.
122
+
123
  = 1.1.7 =
124
  * Added tutorial video to help tabs.
125
 
204
 
205
  This will load all of the rules for that selector with the Parent values on the left and the Child values inputs on the right. Any existing child values will be automatically populated. There is also a Sample preview that displays the combination of Parent and Child overrides. Note that the border and background-image get special treatment.
206
 
207
+ The "Order" field contains the original sequence of the selector in the parent theme stylesheet. You can change the selector order sequence by entering a lower or higher number in the "Order" field. You can also force style overrides (so called "!important" flag) by checking the "!" box next to each input. Please use judiciously.
208
+
209
  Click "Save" to update the child stylesheet and save your changes to the WordPress admin.
210
 
211
  = Rule/Value =