Version Description
- Changed @import tab to "Web Fonts." @import statements are automatically converted to enqueued external links.
- Added "Enqueue both parent and child stylesheets" option to enable child theme overrides without using @import.
- Added checks for hard-coded link tags in header template to help resolve incorrect stylesheet load order.
- Fix: "Enqueue child stylesheet" now passes correct value.
Download this release
Release Info
Developer | lilaeamedia |
Plugin | Child Theme Configurator |
Version | 1.7.3 |
Comparing to | |
See all releases |
Code changes from version 1.7.2.1 to 1.7.3
- child-theme-configurator.php +3 -5
- css/chld-thm-cfg.css +17 -3
- includes/class-ctc-css.php +29 -13
- includes/class-ctc-ui.php +35 -7
- includes/class-ctc.php +115 -44
- includes/forms/addl_panels.php +1 -1
- includes/forms/addl_tabs.php +1 -1
- includes/forms/main.php +1 -1
- includes/forms/parent-child.php +37 -24
- includes/forms/related.php +1 -1
- includes/forms/tabs.php +1 -1
- includes/forms/{at-import.php → webfonts.php} +3 -1
- includes/help/help_en_US.php +23 -21
- js/chld-thm-cfg.js +14 -8
- js/chld-thm-cfg.min.js +1 -1
- lang/chld_thm_cfg.pot +145 -98
- readme.txt +32 -23
- screenshot-1.jpg +0 -0
- screenshot-2.jpg +0 -0
- screenshot-3.jpg +0 -0
- screenshot-4.jpg +0 -0
- screenshot-5.jpg +0 -0
- screenshot-6.jpg +0 -0
- screenshot-7.jpg +0 -0
child-theme-configurator.php
CHANGED
@@ -6,7 +6,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
6 |
Plugin Name: Child Theme Configurator
|
7 |
Plugin URI: http://www.childthemeconfigurator.com
|
8 |
Description: Create a child theme that follows WP best practice to enqueue stylesheets. Easy to use CSS editor lets you find, preview and customize any style.
|
9 |
-
Version: 1.7.
|
10 |
Author: Lilaea Media
|
11 |
Author URI: http://www.lilaeamedia.com
|
12 |
Text Domain: chld_thm_cfg
|
@@ -19,12 +19,10 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
19 |
defined( 'LILAEAMEDIA_URL' ) or
|
20 |
define( 'LILAEAMEDIA_URL', "http://www.lilaeamedia.com" );
|
21 |
defined( 'CHLD_THM_CFG_DOCS_URL' ) or
|
22 |
-
define( 'CHLD_THM_CFG_DOCS_URL', "http://www.childthemeconfigurator.com
|
23 |
-
defined( 'CHLD_THM_CFG_PRO_URL' ) or
|
24 |
-
define( 'CHLD_THM_CFG_PRO_URL', "http://www.childthemeconfigurator.com/child-theme-configurator-pro/" );
|
25 |
defined( 'CHLD_THM_CFG_OPTIONS' ) or
|
26 |
define( 'CHLD_THM_CFG_OPTIONS', 'chld_thm_cfg_options' );
|
27 |
-
define( 'CHLD_THM_CFG_VERSION', '1.7.
|
28 |
define( 'CHLD_THM_CFG_MIN_WP_VERSION', '3.7' );
|
29 |
defined( 'CHLD_THM_CFG_BPSEL' ) or
|
30 |
define( 'CHLD_THM_CFG_BPSEL', '2500' );
|
6 |
Plugin Name: Child Theme Configurator
|
7 |
Plugin URI: http://www.childthemeconfigurator.com
|
8 |
Description: Create a child theme that follows WP best practice to enqueue stylesheets. Easy to use CSS editor lets you find, preview and customize any style.
|
9 |
+
Version: 1.7.3
|
10 |
Author: Lilaea Media
|
11 |
Author URI: http://www.lilaeamedia.com
|
12 |
Text Domain: chld_thm_cfg
|
19 |
defined( 'LILAEAMEDIA_URL' ) or
|
20 |
define( 'LILAEAMEDIA_URL', "http://www.lilaeamedia.com" );
|
21 |
defined( 'CHLD_THM_CFG_DOCS_URL' ) or
|
22 |
+
define( 'CHLD_THM_CFG_DOCS_URL', "http://www.childthemeconfigurator.com" );
|
|
|
|
|
23 |
defined( 'CHLD_THM_CFG_OPTIONS' ) or
|
24 |
define( 'CHLD_THM_CFG_OPTIONS', 'chld_thm_cfg_options' );
|
25 |
+
define( 'CHLD_THM_CFG_VERSION', '1.7.3' );
|
26 |
define( 'CHLD_THM_CFG_MIN_WP_VERSION', '3.7' );
|
27 |
defined( 'CHLD_THM_CFG_BPSEL' ) or
|
28 |
define( 'CHLD_THM_CFG_BPSEL', '2500' );
|
css/chld-thm-cfg.css
CHANGED
@@ -397,7 +397,15 @@ a.ctc-recent-tab {
|
|
397 |
.ctc-section-toggle.open:after {
|
398 |
content: "\f142";
|
399 |
}
|
400 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
401 |
.ctc-section-toggle-content {
|
402 |
display: none;
|
403 |
position: relative;
|
@@ -544,10 +552,16 @@ h3.theme-name {
|
|
544 |
font-size:1em;
|
545 |
margin: .5em 0;
|
546 |
}
|
547 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
548 |
list-style: square;
|
549 |
}
|
550 |
-
#get_pro_panel li {
|
551 |
margin-left:2em;
|
552 |
}
|
553 |
#get_pro_panel h3 a {
|
397 |
.ctc-section-toggle.open:after {
|
398 |
content: "\f142";
|
399 |
}
|
400 |
+
a.ctc-section-toggle, a.ctc-section-toggle:hover, a.ctc-section-toggle:active, a.ctc-section-toggle:visited {
|
401 |
+
text-decoration: none;
|
402 |
+
float:right;
|
403 |
+
font-size:.85em;
|
404 |
+
box-shadow:none;
|
405 |
+
-moz-box-shadow:none;
|
406 |
+
-webkit-box-shadow:none;
|
407 |
+
outline:none;
|
408 |
+
}
|
409 |
.ctc-section-toggle-content {
|
410 |
display: none;
|
411 |
position: relative;
|
552 |
font-size:1em;
|
553 |
margin: .5em 0;
|
554 |
}
|
555 |
+
.ctc-input-cell .update-nag, .ctc-input-cell-wide.update-nag {
|
556 |
+
margin: 0;
|
557 |
+
}
|
558 |
+
.ctc-input-cell-wide.update-nag {
|
559 |
+
margin-bottom:1em;
|
560 |
+
}
|
561 |
+
#get_pro_panel ul, .ctc-input-cell-wide.update-nag ul {
|
562 |
list-style: square;
|
563 |
}
|
564 |
+
#get_pro_panel li, .ctc-input-cell-wide.update-nag li {
|
565 |
margin-left:2em;
|
566 |
}
|
567 |
#get_pro_panel h3 a {
|
includes/class-ctc-css.php
CHANGED
@@ -6,7 +6,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
6 |
Class: ChildThemeConfiguratorCSS
|
7 |
Plugin URI: http://www.childthemeconfigurator.com/
|
8 |
Description: Handles all CSS output, parsing, normalization
|
9 |
-
Version: 1.7.
|
10 |
Author: Lilaea Media
|
11 |
Author URI: http://www.lilaeamedia.com/
|
12 |
Text Domain: chld_thm_cfg
|
@@ -40,6 +40,7 @@ class ChildThemeConfiguratorCSS {
|
|
40 |
var $addl_css; // parent additional stylesheets
|
41 |
var $recent; // history of edited styles
|
42 |
var $enqueue; // load parent css method (enqueue, import, none)
|
|
|
43 |
var $child_name; // child theme name
|
44 |
var $child_author; // child theme author
|
45 |
var $child_authoruri; // child theme author website
|
@@ -82,6 +83,7 @@ class ChildThemeConfiguratorCSS {
|
|
82 |
'selkey',
|
83 |
'querykey',
|
84 |
'recent',
|
|
|
85 |
);
|
86 |
var $dicts = array(
|
87 |
'dict_qs',
|
@@ -134,14 +136,16 @@ class ChildThemeConfiguratorCSS {
|
|
134 |
function load_config() {
|
135 |
$option = CHLD_THM_CFG_OPTIONS . apply_filters( 'chld_thm_cfg_option', '' );
|
136 |
//echo 'loading option: ' . $option . LF;
|
137 |
-
if ( $configarray = get_option( $option . '_configvars' ) ):
|
138 |
-
foreach ( $this->configvars as $configkey )
|
139 |
if ( isset( $configarray[ $configkey ] ) )
|
140 |
$this->{$configkey} = $configarray[ $configkey ];
|
|
|
141 |
$this->ctc()->debug( 'configvars: ' . print_r( $configarray, TRUE ), __FUNCTION__ );
|
142 |
foreach ( $this->dicts as $configkey ):
|
143 |
-
if ( $configarray = get_option( $option . '_' . $configkey ) )
|
144 |
$this->{$configkey} = $configarray;
|
|
|
145 |
endforeach;
|
146 |
else:
|
147 |
return FALSE;
|
@@ -521,6 +525,10 @@ class ChildThemeConfiguratorCSS {
|
|
521 |
endif;
|
522 |
do_action( 'chld_thm_cfg_update_qsid', $qsid );
|
523 |
endif;
|
|
|
|
|
|
|
|
|
524 |
}
|
525 |
|
526 |
/*
|
@@ -613,10 +621,14 @@ class ChildThemeConfiguratorCSS {
|
|
613 |
// get all imports
|
614 |
if ( $parse_imports ):
|
615 |
|
616 |
-
$regex = '#(\@import
|
617 |
preg_match_all( $regex, $this->styles, $matches );
|
618 |
-
foreach ( preg_grep( '#' . $this->get_prop( 'parnt' ) . '\/style\.css#', $matches[ 1 ], PREG_GREP_INVERT ) as $import )
|
|
|
|
|
|
|
619 |
$this->imports[ $template ][ $import ] = 1;
|
|
|
620 |
if ( $this->ctc()->cache_updates ):
|
621 |
$this->ctc()->updates[] = array(
|
622 |
'obj' => 'imports',
|
@@ -713,22 +725,22 @@ class ChildThemeConfiguratorCSS {
|
|
713 |
do_action( 'chld_thm_cfg_update_qsid', $qsid );
|
714 |
endif;
|
715 |
}
|
|
|
716 |
// converts relative path to absolute path for preview
|
717 |
-
function convert_rel_url( $value, $relpath ) {
|
718 |
-
$source = $this->get_prop( 'parnt' );
|
719 |
$path = preg_replace( '%url\([\'" ]*(.+?)[\'" ]*\)%', "$1", $value );
|
720 |
-
if ( preg_match( '%https
|
721 |
$pathparts = explode( '/', $path );
|
722 |
$fileparts = explode( '/', $relpath );
|
723 |
$newparts = array();
|
724 |
-
$themeuri = get_theme_root_uri();
|
725 |
while ( $pathpart = array_shift( $pathparts ) ):
|
726 |
if ( '..' == $pathpart )
|
727 |
array_pop( $fileparts );
|
728 |
-
else array_push( $newparts, $pathpart );
|
729 |
endwhile;
|
730 |
-
$newvalue =
|
731 |
-
( $fileparts ? trailingslashit( implode( '/', $fileparts ) ) : '' )
|
|
|
732 |
$this->ctc()->debug( 'converted ' . $value . ' to ' . $newvalue . ' with ' . $relpath, __FUNCTION__ );
|
733 |
return $newvalue;
|
734 |
}
|
@@ -743,6 +755,9 @@ class ChildThemeConfiguratorCSS {
|
|
743 |
function write_css( $backup = FALSE ) {
|
744 |
// write new stylesheet
|
745 |
$output = apply_filters( 'chld_thm_cfg_css_header', $this->get_css_header(), $this );
|
|
|
|
|
|
|
746 |
$imports = $this->get_prop( 'imports' );
|
747 |
if ( !empty( $imports ) ):
|
748 |
foreach ( $imports as $import ):
|
@@ -750,6 +765,7 @@ class ChildThemeConfiguratorCSS {
|
|
750 |
endforeach;
|
751 |
endif;
|
752 |
$output .= LF;
|
|
|
753 |
// turn the dictionaries into indexes (value => id into id => value):
|
754 |
$rulearr = array_flip( $this->dict_rule );
|
755 |
$valarr = array_flip( $this->dict_val );
|
6 |
Class: ChildThemeConfiguratorCSS
|
7 |
Plugin URI: http://www.childthemeconfigurator.com/
|
8 |
Description: Handles all CSS output, parsing, normalization
|
9 |
+
Version: 1.7.3
|
10 |
Author: Lilaea Media
|
11 |
Author URI: http://www.lilaeamedia.com/
|
12 |
Text Domain: chld_thm_cfg
|
40 |
var $addl_css; // parent additional stylesheets
|
41 |
var $recent; // history of edited styles
|
42 |
var $enqueue; // load parent css method (enqueue, import, none)
|
43 |
+
var $converted; // @imports coverted to <link>?
|
44 |
var $child_name; // child theme name
|
45 |
var $child_author; // child theme author
|
46 |
var $child_authoruri; // child theme author website
|
83 |
'selkey',
|
84 |
'querykey',
|
85 |
'recent',
|
86 |
+
'converted',
|
87 |
);
|
88 |
var $dicts = array(
|
89 |
'dict_qs',
|
136 |
function load_config() {
|
137 |
$option = CHLD_THM_CFG_OPTIONS . apply_filters( 'chld_thm_cfg_option', '' );
|
138 |
//echo 'loading option: ' . $option . LF;
|
139 |
+
if ( ( $configarray = get_option( $option . '_configvars' ) ) && count( $configarray ) ):
|
140 |
+
foreach ( $this->configvars as $configkey ):
|
141 |
if ( isset( $configarray[ $configkey ] ) )
|
142 |
$this->{$configkey} = $configarray[ $configkey ];
|
143 |
+
endforeach;
|
144 |
$this->ctc()->debug( 'configvars: ' . print_r( $configarray, TRUE ), __FUNCTION__ );
|
145 |
foreach ( $this->dicts as $configkey ):
|
146 |
+
if ( ( $configarray = get_option( $option . '_' . $configkey ) ) && count( $configarray ) )
|
147 |
$this->{$configkey} = $configarray;
|
148 |
+
else return FALSE;
|
149 |
endforeach;
|
150 |
else:
|
151 |
return FALSE;
|
525 |
endif;
|
526 |
do_action( 'chld_thm_cfg_update_qsid', $qsid );
|
527 |
endif;
|
528 |
+
|
529 |
+
// update enqueue function if imports have not been converted or new imports passed
|
530 |
+
if ( isset( $_POST[ 'ctc_child_imports' ] ) || empty( $this->converted ) )
|
531 |
+
add_action( 'chld_thm_cfg_addl_files', array( $this->ctc(), 'enqueue_parent_css' ), 15, 2 );
|
532 |
}
|
533 |
|
534 |
/*
|
621 |
// get all imports
|
622 |
if ( $parse_imports ):
|
623 |
|
624 |
+
$regex = '#(\@import\s+url\(.+?\));#';
|
625 |
preg_match_all( $regex, $this->styles, $matches );
|
626 |
+
foreach ( preg_grep( '#' . $this->get_prop( 'parnt' ) . '\/style\.css#', $matches[ 1 ], PREG_GREP_INVERT ) as $import ):
|
627 |
+
$import = preg_replace( "#^.*?url\(([^\)]+?)\).*#", "$1", $import );
|
628 |
+
$import = preg_replace( "#[\'\"]#", '', $import );
|
629 |
+
$import = '@import url(' . trim( $import ) . ')';
|
630 |
$this->imports[ $template ][ $import ] = 1;
|
631 |
+
endforeach;
|
632 |
if ( $this->ctc()->cache_updates ):
|
633 |
$this->ctc()->updates[] = array(
|
634 |
'obj' => 'imports',
|
725 |
do_action( 'chld_thm_cfg_update_qsid', $qsid );
|
726 |
endif;
|
727 |
}
|
728 |
+
|
729 |
// converts relative path to absolute path for preview
|
730 |
+
function convert_rel_url( $value, $relpath, $url = TRUE ) {
|
|
|
731 |
$path = preg_replace( '%url\([\'" ]*(.+?)[\'" ]*\)%', "$1", $value );
|
732 |
+
if ( preg_match( '%(https?:)?//%', $path ) ) return $value;
|
733 |
$pathparts = explode( '/', $path );
|
734 |
$fileparts = explode( '/', $relpath );
|
735 |
$newparts = array();
|
|
|
736 |
while ( $pathpart = array_shift( $pathparts ) ):
|
737 |
if ( '..' == $pathpart )
|
738 |
array_pop( $fileparts );
|
739 |
+
else array_push( $newparts, sanitize_text_field( $pathpart ) );
|
740 |
endwhile;
|
741 |
+
$newvalue = ( $url ? 'url(' : '' )
|
742 |
+
. ( $fileparts ? trailingslashit( implode( '/', $fileparts ) ) : '' )
|
743 |
+
. implode( '/', $newparts ) . ( $url ? ')' : '' );
|
744 |
$this->ctc()->debug( 'converted ' . $value . ' to ' . $newvalue . ' with ' . $relpath, __FUNCTION__ );
|
745 |
return $newvalue;
|
746 |
}
|
755 |
function write_css( $backup = FALSE ) {
|
756 |
// write new stylesheet
|
757 |
$output = apply_filters( 'chld_thm_cfg_css_header', $this->get_css_header(), $this );
|
758 |
+
// 1.7.3 -- use read-only version of insert with markers to check if @imports need to be written to stylesheet
|
759 |
+
// eventually all will be migrated to link tags, but we need to account for user not updating import config
|
760 |
+
/*
|
761 |
$imports = $this->get_prop( 'imports' );
|
762 |
if ( !empty( $imports ) ):
|
763 |
foreach ( $imports as $import ):
|
765 |
endforeach;
|
766 |
endif;
|
767 |
$output .= LF;
|
768 |
+
*/
|
769 |
// turn the dictionaries into indexes (value => id into id => value):
|
770 |
$rulearr = array_flip( $this->dict_rule );
|
771 |
$valarr = array_flip( $this->dict_val );
|
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.childthemeconfigurator.com/
|
7 |
Description: Handles the plugin User Interface
|
8 |
-
Version: 1.7.
|
9 |
Author: Lilaea Media
|
10 |
Author URI: http://www.lilaeamedia.com/
|
11 |
Text Domain: chld_thm_cfg
|
@@ -14,8 +14,10 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
14 |
Copyright (C) 2014-2015 Lilaea Media
|
15 |
*/
|
16 |
class ChildThemeConfiguratorUI {
|
|
|
|
|
|
|
17 |
// helper function to globalize ctc object
|
18 |
-
|
19 |
function ctc() {
|
20 |
return ChildThemeConfigurator::ctc();
|
21 |
}
|
@@ -26,7 +28,7 @@ class ChildThemeConfiguratorUI {
|
|
26 |
$child = $css->get_prop( 'child' );
|
27 |
$hidechild = ( count( $themes[ 'child' ] ) ? '' : 'style="display:none"' );
|
28 |
$enqueueset = ( isset( $css->enqueue ) && $child );
|
29 |
-
$
|
30 |
$imports = $css->get_prop( 'imports' );
|
31 |
$id = 0;
|
32 |
$this->ctc()->fs_method = get_filesystem_method();
|
@@ -42,14 +44,40 @@ class ChildThemeConfiguratorUI {
|
|
42 |
include ( CHLD_THM_CFG_DIR . '/includes/forms/main.php' );
|
43 |
}
|
44 |
|
45 |
-
function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
$file = trailingslashit( get_theme_root() ) . trailingslashit( $this->ctc()->get_current_parent() ) . 'header.php';
|
47 |
-
$regex = '/<link[^>]+?stylesheet_ur[li]/is';
|
48 |
if ( file_exists( $file ) ):
|
49 |
$contents = file_get_contents( $file );
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
endif;
|
52 |
-
return FALSE;
|
53 |
}
|
54 |
|
55 |
function render_theme_menu( $template = 'child', $selected = NULL ) {
|
5 |
Class: Child_Theme_Configurator_UI
|
6 |
Plugin URI: http://www.childthemeconfigurator.com/
|
7 |
Description: Handles the plugin User Interface
|
8 |
+
Version: 1.7.3
|
9 |
Author: Lilaea Media
|
10 |
Author URI: http://www.lilaeamedia.com/
|
11 |
Text Domain: chld_thm_cfg
|
14 |
Copyright (C) 2014-2015 Lilaea Media
|
15 |
*/
|
16 |
class ChildThemeConfiguratorUI {
|
17 |
+
|
18 |
+
var $warnings = array();
|
19 |
+
|
20 |
// helper function to globalize ctc object
|
|
|
21 |
function ctc() {
|
22 |
return ChildThemeConfigurator::ctc();
|
23 |
}
|
28 |
$child = $css->get_prop( 'child' );
|
29 |
$hidechild = ( count( $themes[ 'child' ] ) ? '' : 'style="display:none"' );
|
30 |
$enqueueset = ( isset( $css->enqueue ) && $child );
|
31 |
+
$this->parent_theme_check();
|
32 |
$imports = $css->get_prop( 'imports' );
|
33 |
$id = 0;
|
34 |
$this->ctc()->fs_method = get_filesystem_method();
|
44 |
include ( CHLD_THM_CFG_DIR . '/includes/forms/main.php' );
|
45 |
}
|
46 |
|
47 |
+
function parent_theme_check() {
|
48 |
+
// check header for hard-coded
|
49 |
+
/*
|
50 |
+
foreach(glob($path_to_check.'*.txt') as $filename)
|
51 |
+
{
|
52 |
+
foreach(file($filename) as $fli=>$fl)
|
53 |
+
{
|
54 |
+
if(strpos($fl, $needle)!==false)
|
55 |
+
{
|
56 |
+
echo $filename.' on line '.($fli+1).': '.$fl;
|
57 |
+
}
|
58 |
+
}
|
59 |
+
}
|
60 |
+
*/
|
61 |
+
$bad_practice_descr = array(
|
62 |
+
// Stylesheets should be enqueued using the <code>wp_enqueue_scripts</code> action.
|
63 |
+
'links' => __( 'A stylesheet link tag is hard-coded into the header template.', 'chld_thm_cfg' ),
|
64 |
+
'enqueue' => __( '<code>wp_enqueue_style()</code> called from the header template.', 'chld_thm_cfg' ),
|
65 |
+
// <code>wp_head()</code> should be located just before the closing <code></head></code> tag.
|
66 |
+
'wphead' => __( 'Code exists between the <code>wp_head()</code> function and the closing <code></head></code> tag.', 'chld_thm_cfg'),
|
67 |
+
);
|
68 |
$file = trailingslashit( get_theme_root() ) . trailingslashit( $this->ctc()->get_current_parent() ) . 'header.php';
|
|
|
69 |
if ( file_exists( $file ) ):
|
70 |
$contents = file_get_contents( $file );
|
71 |
+
$contents = preg_replace( "/\/\/.*?(\?>|\n)|\/\*.*?\*\/|<\!\-\-.*?\-\->/s", '', $contents );
|
72 |
+
// check for linked stylesheets
|
73 |
+
if ( preg_match( '/rel=[\'"]stylesheet[\'"]/is', $contents ) ) $this->warnings[] = $bad_practice_descr[ 'links' ];
|
74 |
+
if ( preg_match( '/wp_enqueue_style/is', $contents ) ) $this->warnings[] = $bad_practice_descr[ 'enqueue' ];
|
75 |
+
// check for code after wp_head
|
76 |
+
if ( preg_match( '/wp_head(.*?)<\/head>/is', $contents, $matches ) ):
|
77 |
+
$codeafter = preg_replace( "/[\(\)\?>;\s]/s", '', $matches[ 1 ] );
|
78 |
+
if ( !empty( $codeafter ) ) $this->warnings[] = $bad_practice_descr[ 'wphead' ];
|
79 |
+
endif;
|
80 |
endif;
|
|
|
81 |
}
|
82 |
|
83 |
function render_theme_menu( $template = 'child', $selected = NULL ) {
|
includes/class-ctc.php
CHANGED
@@ -6,7 +6,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
6 |
Class: Child_Theme_Configurator
|
7 |
Plugin URI: http://www.childthemeconfigurator.com/
|
8 |
Description: Main Controller Class
|
9 |
-
Version: 1.7.
|
10 |
Author: Lilaea Media
|
11 |
Author URI: http://www.lilaeamedia.com/
|
12 |
Text Domain: chld_thm_cfg
|
@@ -108,7 +108,7 @@ class ChildThemeConfiguratorAdmin {
|
|
108 |
$this->ui->render();
|
109 |
}
|
110 |
function enqueue_scripts() {
|
111 |
-
wp_enqueue_style( 'chld-thm-cfg-admin', CHLD_THM_CFG_URL . 'css/chld-thm-cfg.css', array(), '1.7.
|
112 |
|
113 |
// we need to use local jQuery UI Widget/Menu/Selectmenu 1.11.2 because selectmenu is not included in < 1.11.2
|
114 |
// this will be updated in a later release to use WP Core scripts when it is widely adopted
|
@@ -121,7 +121,7 @@ class ChildThemeConfiguratorAdmin {
|
|
121 |
array(
|
122 |
'jquery-ui-autocomplete',
|
123 |
'jquery-ui-selectmenu',
|
124 |
-
'
|
125 |
'ctc-thm-cfg-ctcgrad'
|
126 |
), FALSE, TRUE );
|
127 |
$localize_array = apply_filters( 'chld_thm_cfg_localize_script', array(
|
@@ -162,12 +162,12 @@ class ChildThemeConfiguratorAdmin {
|
|
162 |
'theme_exists_txt' => __( '<strong>%s</strong> exists. Please enter a different Child Theme', 'chld_thm_cfg' ),
|
163 |
'js_txt' => __( 'The page could not be loaded correctly.',
|
164 |
'chld_thm_cfg' ),
|
165 |
-
'jquery_txt' => __( 'Conflicting jQuery libraries were loaded by another plugin:',
|
166 |
'chld_thm_cfg' ),
|
167 |
-
'plugin_txt' => __( 'Deactivating
|
168 |
'contact_txt' => sprintf( __( '%sWhy am I seeing this?%s',
|
169 |
'chld_thm_cfg' ),
|
170 |
-
'<a target="_blank" href="' . CHLD_THM_CFG_DOCS_URL . '/#script_dep">',
|
171 |
'</a>' ),
|
172 |
) );
|
173 |
wp_localize_script(
|
@@ -307,6 +307,8 @@ class ChildThemeConfiguratorAdmin {
|
|
307 |
// if child theme config has been set up, save new data
|
308 |
// return recent edits and selected stylesheets as cache updates
|
309 |
if ( $this->css->get_prop( 'child' ) ):
|
|
|
|
|
310 |
$this->css->write_css();
|
311 |
// add any additional updates to pass back to browser
|
312 |
do_action( 'chld_thm_cfg_cache_updates' );
|
@@ -578,7 +580,12 @@ class ChildThemeConfiguratorAdmin {
|
|
578 |
|
579 |
// if no errors so far, we are good to create child theme
|
580 |
if ( empty( $this->errors ) ):
|
581 |
-
|
|
|
|
|
|
|
|
|
|
|
582 |
// check if we have additional files from legacy plugin extension. if so, we have to override
|
583 |
// function to support wp_filesystem requirements
|
584 |
if ( $this->is_theme( $configtype ) ):
|
@@ -594,7 +601,8 @@ class ChildThemeConfiguratorAdmin {
|
|
594 |
add_action( 'chld_thm_cfg_addl_files', array( &$this, 'write_addl_files' ), 10, 2 );
|
595 |
$this->css->set_prop( 'configtype', $configtype );
|
596 |
endif;
|
597 |
-
|
|
|
598 |
$this->css->set_prop( 'parnt', $parnt );
|
599 |
$this->css->set_prop( 'child', $child );
|
600 |
$this->css->set_prop( 'child_name', $name );
|
@@ -605,14 +613,12 @@ class ChildThemeConfiguratorAdmin {
|
|
605 |
$this->css->set_prop( 'child_tags', $tags );
|
606 |
$this->css->set_prop( 'child_version', strlen( $version ) ? $version : '1.0' );
|
607 |
|
|
|
608 |
if ( isset( $_POST[ 'ctc_parent_enqueue' ] ) )
|
609 |
$this->css->set_prop( 'enqueue', sanitize_text_field( $_POST[ 'ctc_parent_enqueue' ] ) );
|
610 |
elseif ( !$this->is_theme( $configtype ) )
|
611 |
$this->css->set_prop( 'enqueue', 'enqueue' );
|
612 |
|
613 |
-
// hook for add'l plugin files and subdirectories
|
614 |
-
do_action( 'chld_thm_cfg_addl_files', $this );
|
615 |
-
|
616 |
// parse parent stylesheet if theme or legacy plugin extension
|
617 |
if ( $this->is_theme( $configtype ) || $this->is_legacy() )
|
618 |
$this->css->parse_css_file( 'parnt' );
|
@@ -629,6 +635,13 @@ class ChildThemeConfiguratorAdmin {
|
|
629 |
endforeach;
|
630 |
endif;
|
631 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
632 |
// try to write new stylsheet. If it fails send alert.
|
633 |
if ( FALSE === $this->css->write_css( isset( $_POST[ 'ctc_backup' ] ) ) ):
|
634 |
$this->debug( 'failed to write', __FUNCTION__ );
|
@@ -684,20 +697,10 @@ class ChildThemeConfiguratorAdmin {
|
|
684 |
function load_imports() {
|
685 |
// allows fonts and other externals to be previewed
|
686 |
// loads early not to conflict with admin stylesheets
|
687 |
-
$regex = "/\@import *(url)? *\( *['\"]?((https?:\/\/)?(.+?))['\"]? *\).*$/";
|
688 |
if ( $imports = $this->css->get_prop( 'imports' ) ):
|
689 |
-
$
|
690 |
foreach ( $imports as $import ):
|
691 |
-
|
692 |
-
if ( empty( $matches[ 3 ] ) && !empty( $matches[ 4 ] ) ): // relative filepath
|
693 |
-
$url = get_stylesheet_directory_uri();
|
694 |
-
preg_replace( "#\.\./#", '', $matches[ 4 ], -1, $count );
|
695 |
-
for( $i = 0; $i < $count; $i++ ):
|
696 |
-
$url = dirname( $url );
|
697 |
-
endfor;
|
698 |
-
$import = preg_replace( $regex, '@import url(' . trailingslashit( $url ) . $matches[ 4 ] . ')', $import );
|
699 |
-
endif;
|
700 |
-
wp_enqueue_style( 'chld-thm-cfg-admin' . ++$count, preg_replace( $regex, "$2", $import ) );
|
701 |
endforeach;
|
702 |
endif;
|
703 |
}
|
@@ -762,21 +765,76 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
762 |
$this->write_child_file( 'style.css', $this->css->get_css_header() );
|
763 |
}
|
764 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
765 |
function enqueue_parent_code(){
|
766 |
-
|
767 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
768 |
";
|
769 |
-
if ( 'enqueue' == $this->css->enqueue ):
|
770 |
$code .= "
|
771 |
|
772 |
if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
|
773 |
function chld_thm_cfg_parent_css() {
|
774 |
-
|
|
|
|
|
775 |
}
|
776 |
endif;
|
777 |
add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css' );
|
778 |
";
|
779 |
-
|
|
|
|
|
780 |
$code .= "
|
781 |
if ( !function_exists( 'chld_thm_cfg_child_css' ) ):
|
782 |
function chld_thm_cfg_child_css() {
|
@@ -789,19 +847,21 @@ add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_child_css', 999 );
|
|
789 |
return explode( "\n", $code );
|
790 |
}
|
791 |
|
792 |
-
function
|
|
|
793 |
$marker = 'ENQUEUE PARENT ACTION';
|
794 |
$insertion = $this->enqueue_parent_code();
|
795 |
-
if ( $filename = $this->css->is_file_ok( $this->css->get_child_target( 'functions.php' ), 'write' ) )
|
796 |
-
$this->insert_with_markers( $filename, $marker, $insertion );
|
797 |
-
endif;
|
798 |
}
|
799 |
|
800 |
/**
|
|
|
|
|
801 |
* we would have used WP's insert_with_markers function,
|
802 |
-
* but it does not use wp_filesystem API
|
803 |
*/
|
804 |
-
function insert_with_markers( $filename, $marker, $insertion ) {
|
805 |
if ( count( $this->errors ) ):
|
806 |
$this->debug( 'Errors detected, returning', __FUNCTION__ );
|
807 |
return FALSE;
|
@@ -819,18 +879,19 @@ add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_child_css', 999 );
|
|
819 |
// get_contents_array returns extra linefeeds so just split it ourself
|
820 |
$markerdata = explode( "\n", $wp_filesystem->get_contents( $this->fspath( $filename ) ) );
|
821 |
$newfile = '';
|
|
|
822 |
$phpopen = 0;
|
823 |
$in_comment = 0;
|
824 |
-
$foundit =
|
825 |
$lasttoken = '';
|
826 |
if ( $markerdata ):
|
827 |
-
$state =
|
828 |
foreach ( $markerdata as $n => $markerline ) {
|
829 |
// update open state
|
830 |
$openstars = 0;
|
831 |
$closestars = 0;
|
832 |
// remove double slash comment to end of line
|
833 |
-
$str = preg_replace( "/\/\/.*$/",
|
834 |
preg_match_all("/(<\?|\?>|\*\/|\/\*)/", $str, $matches );
|
835 |
if ( $matches ):
|
836 |
foreach ( $matches[1] as $token ):
|
@@ -846,22 +907,26 @@ add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_child_css', 999 );
|
|
846 |
endif;
|
847 |
endforeach;
|
848 |
endif;
|
849 |
-
if ( strpos( $markerline, '// BEGIN ' . $marker ) !==
|
850 |
-
$state =
|
851 |
if ( $state ):
|
852 |
if ( $n + 1 < count( $markerdata ) )
|
853 |
$newfile .= "{$markerline}\n";
|
854 |
else
|
855 |
$newfile .= "{$markerline}";
|
|
|
|
|
|
|
|
|
856 |
endif;
|
857 |
-
if ( strpos( $markerline, '// END ' . $marker ) !==
|
858 |
$newfile .= "// BEGIN {$marker}\n";
|
859 |
if ( is_array( $insertion ) )
|
860 |
foreach ( $insertion as $insertline )
|
861 |
$newfile .= "{$insertline}\n";
|
862 |
$newfile .= "// END {$marker}\n";
|
863 |
-
$state =
|
864 |
-
$foundit =
|
865 |
endif;
|
866 |
}
|
867 |
else:
|
@@ -883,10 +948,16 @@ add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_child_css', 999 );
|
|
883 |
$newfile .= "{$insertline}\n";
|
884 |
$newfile .= "// END {$marker}\n";
|
885 |
endif;
|
886 |
-
|
887 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
888 |
}
|
889 |
|
|
|
890 |
function write_child_file( $file, $contents ) {
|
891 |
if ( !$this->fs ):
|
892 |
$this->debug( 'No filesystem access.', __FUNCTION__ );
|
6 |
Class: Child_Theme_Configurator
|
7 |
Plugin URI: http://www.childthemeconfigurator.com/
|
8 |
Description: Main Controller Class
|
9 |
+
Version: 1.7.3
|
10 |
Author: Lilaea Media
|
11 |
Author URI: http://www.lilaeamedia.com/
|
12 |
Text Domain: chld_thm_cfg
|
108 |
$this->ui->render();
|
109 |
}
|
110 |
function enqueue_scripts() {
|
111 |
+
wp_enqueue_style( 'chld-thm-cfg-admin', CHLD_THM_CFG_URL . 'css/chld-thm-cfg.css', array(), '1.7.3' );
|
112 |
|
113 |
// we need to use local jQuery UI Widget/Menu/Selectmenu 1.11.2 because selectmenu is not included in < 1.11.2
|
114 |
// this will be updated in a later release to use WP Core scripts when it is widely adopted
|
121 |
array(
|
122 |
'jquery-ui-autocomplete',
|
123 |
'jquery-ui-selectmenu',
|
124 |
+
'iris',
|
125 |
'ctc-thm-cfg-ctcgrad'
|
126 |
), FALSE, TRUE );
|
127 |
$localize_array = apply_filters( 'chld_thm_cfg_localize_script', array(
|
162 |
'theme_exists_txt' => __( '<strong>%s</strong> exists. Please enter a different Child Theme', 'chld_thm_cfg' ),
|
163 |
'js_txt' => __( 'The page could not be loaded correctly.',
|
164 |
'chld_thm_cfg' ),
|
165 |
+
'jquery_txt' => __( 'Conflicting or out-of-date jQuery libraries were loaded by another plugin:',
|
166 |
'chld_thm_cfg' ),
|
167 |
+
'plugin_txt' => __( 'Deactivating or replacing plugins may resolve this issue.', 'chld_thm_cfg' ),
|
168 |
'contact_txt' => sprintf( __( '%sWhy am I seeing this?%s',
|
169 |
'chld_thm_cfg' ),
|
170 |
+
'<a target="_blank" href="' . CHLD_THM_CFG_DOCS_URL . '/how-to-use/#script_dep">',
|
171 |
'</a>' ),
|
172 |
) );
|
173 |
wp_localize_script(
|
307 |
// if child theme config has been set up, save new data
|
308 |
// return recent edits and selected stylesheets as cache updates
|
309 |
if ( $this->css->get_prop( 'child' ) ):
|
310 |
+
// hook for add'l plugin files and subdirectories
|
311 |
+
do_action( 'chld_thm_cfg_addl_files', $this );
|
312 |
$this->css->write_css();
|
313 |
// add any additional updates to pass back to browser
|
314 |
do_action( 'chld_thm_cfg_cache_updates' );
|
580 |
|
581 |
// if no errors so far, we are good to create child theme
|
582 |
if ( empty( $this->errors ) ):
|
583 |
+
// save imports in case this is a rebuild
|
584 |
+
$imports = $this->css->imports;
|
585 |
+
// reset everything else
|
586 |
+
$this->css = new ChildThemeConfiguratorCSS();
|
587 |
+
// restore imports if this is a rebuild
|
588 |
+
$this->css->imports = $imports;
|
589 |
// check if we have additional files from legacy plugin extension. if so, we have to override
|
590 |
// function to support wp_filesystem requirements
|
591 |
if ( $this->is_theme( $configtype ) ):
|
601 |
add_action( 'chld_thm_cfg_addl_files', array( &$this, 'write_addl_files' ), 10, 2 );
|
602 |
$this->css->set_prop( 'configtype', $configtype );
|
603 |
endif;
|
604 |
+
|
605 |
+
// update with new parameters
|
606 |
$this->css->set_prop( 'parnt', $parnt );
|
607 |
$this->css->set_prop( 'child', $child );
|
608 |
$this->css->set_prop( 'child_name', $name );
|
613 |
$this->css->set_prop( 'child_tags', $tags );
|
614 |
$this->css->set_prop( 'child_version', strlen( $version ) ? $version : '1.0' );
|
615 |
|
616 |
+
// set stylesheet handling option
|
617 |
if ( isset( $_POST[ 'ctc_parent_enqueue' ] ) )
|
618 |
$this->css->set_prop( 'enqueue', sanitize_text_field( $_POST[ 'ctc_parent_enqueue' ] ) );
|
619 |
elseif ( !$this->is_theme( $configtype ) )
|
620 |
$this->css->set_prop( 'enqueue', 'enqueue' );
|
621 |
|
|
|
|
|
|
|
622 |
// parse parent stylesheet if theme or legacy plugin extension
|
623 |
if ( $this->is_theme( $configtype ) || $this->is_legacy() )
|
624 |
$this->css->parse_css_file( 'parnt' );
|
635 |
endforeach;
|
636 |
endif;
|
637 |
|
638 |
+
// runs code generation function in read-only mode to add existing external stylesheet links to config data
|
639 |
+
$this->enqueue_parent_css( $this->css, TRUE );
|
640 |
+
// hook for add'l plugin files and subdirectories. Must run after stylesheets are parsed to apply latest options
|
641 |
+
do_action( 'chld_thm_cfg_addl_files', $this );
|
642 |
+
// set flag to skip import link conversion on ajax save
|
643 |
+
$this->css->converted = 1;
|
644 |
+
|
645 |
// try to write new stylsheet. If it fails send alert.
|
646 |
if ( FALSE === $this->css->write_css( isset( $_POST[ 'ctc_backup' ] ) ) ):
|
647 |
$this->debug( 'failed to write', __FUNCTION__ );
|
697 |
function load_imports() {
|
698 |
// allows fonts and other externals to be previewed
|
699 |
// loads early not to conflict with admin stylesheets
|
|
|
700 |
if ( $imports = $this->css->get_prop( 'imports' ) ):
|
701 |
+
$ext = 0;
|
702 |
foreach ( $imports as $import ):
|
703 |
+
$this->convert_import_to_enqueue( $import, ++$ext, TRUE );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
704 |
endforeach;
|
705 |
endif;
|
706 |
}
|
765 |
$this->write_child_file( 'style.css', $this->css->get_css_header() );
|
766 |
}
|
767 |
|
768 |
+
// parses @import syntax and converts to wp_enqueue_style statement
|
769 |
+
function convert_import_to_enqueue( $import, $count, $execute = FALSE ) {
|
770 |
+
$relpath = $this->css->get_prop( 'child' );
|
771 |
+
$import = preg_replace( "#^.*?url\(([^\)]+?)\).*#", "$1", $import );
|
772 |
+
$import = preg_replace( "#[\'\"]#", '', $import );
|
773 |
+
$path = $this->css->convert_rel_url( trim( $import ), $relpath , FALSE );
|
774 |
+
$abs = preg_match( '%(https?:)?//%', $path );
|
775 |
+
if ( $execute )
|
776 |
+
wp_enqueue_style( 'chld_thm_cfg_ext' . $count, $abs ? $path : trailingslashit( get_theme_root_uri() ) . $path );
|
777 |
+
else
|
778 |
+
return "wp_enqueue_style( 'chld_thm_cfg_ext" . $count . "', "
|
779 |
+
. ( $abs ? "'" . $path . "'" : "trailingslashit( get_theme_root_uri() ) . '" . $path . "'" ) . ' );';
|
780 |
+
}
|
781 |
+
|
782 |
+
// converts enqueued path into @import statement for config settings
|
783 |
+
function convert_enqueue_to_import( $path ) {
|
784 |
+
if ( preg_match( '%(https?:)?//%', $path ) ):
|
785 |
+
$this->css->imports[ 'child' ]['@import url(' . $path . ')'] = 1;
|
786 |
+
return;
|
787 |
+
endif;
|
788 |
+
$regex = '#^' . preg_quote( trailingslashit( $this->css->get_prop( 'child' ) ) ) . '#';
|
789 |
+
$path = preg_replace( $regex, '', $path, -1, $count );
|
790 |
+
if ( $count ):
|
791 |
+
$this->css->imports[ 'child' ]['@import url(' . $path . ')'] = 1;
|
792 |
+
return;
|
793 |
+
endif;
|
794 |
+
$parent = trailingslashit( $this->css->get_prop( 'parnt' ) );
|
795 |
+
$regex = '#^' . preg_quote( $parent ) . '#';
|
796 |
+
$path = preg_replace( $regex, '../' . $parent, $path, -1, $count );
|
797 |
+
if ( $count )
|
798 |
+
$this->css->imports[ 'child' ]['@import url(' . $path . ')'] = 1;
|
799 |
+
}
|
800 |
+
|
801 |
+
/**
|
802 |
+
* Generates wp_enqueue_script code block for child theme functions file
|
803 |
+
* Enqueues parent and/or child stylesheet depending on value of 'enqueue' setting.
|
804 |
+
* If external imports are present, it enqueues them as well.
|
805 |
+
*/
|
806 |
function enqueue_parent_code(){
|
807 |
+
$imports = $this->css->get_prop( 'imports' );
|
808 |
+
$enqueues = array();
|
809 |
+
$code = '';
|
810 |
+
// enqueue parent stylesheet
|
811 |
+
if ( 'enqueue' == $this->css->enqueue || 'both' == $this->css->enqueue )
|
812 |
+
$enqueues[] = " wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css' );";
|
813 |
+
// enqueue external stylesheets (previously used @import in the stylesheet)
|
814 |
+
if ( !empty( $imports ) ):
|
815 |
+
$ext = 0;
|
816 |
+
foreach ( $imports as $import ):
|
817 |
+
$ext++;
|
818 |
+
$enqueues[] = ' ' . $this->convert_import_to_enqueue( $import, $ext );
|
819 |
+
endforeach;
|
820 |
+
endif;
|
821 |
+
if ( count( $enqueues ) ):
|
822 |
+
$code = "// AUTO GENERATED - Do not modify or remove comment markers above or below:
|
823 |
";
|
|
|
824 |
$code .= "
|
825 |
|
826 |
if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
|
827 |
function chld_thm_cfg_parent_css() {
|
828 |
+
";
|
829 |
+
$code .= implode( "\n", $enqueues );
|
830 |
+
$code .= "
|
831 |
}
|
832 |
endif;
|
833 |
add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css' );
|
834 |
";
|
835 |
+
endif;
|
836 |
+
// enqueue child stylesheet. This feature was added to avoid using @import to load parent stylesheet when links are hard-coded into header.php
|
837 |
+
if ( 'child' == $this->css->enqueue || 'both' == $this->css->enqueue ):
|
838 |
$code .= "
|
839 |
if ( !function_exists( 'chld_thm_cfg_child_css' ) ):
|
840 |
function chld_thm_cfg_child_css() {
|
847 |
return explode( "\n", $code );
|
848 |
}
|
849 |
|
850 |
+
// updates function file with wp_enqueue_script code block. If getexternals flag is passed function is run in read-only mode
|
851 |
+
function enqueue_parent_css( $obj, $getexternals = FALSE ) {
|
852 |
$marker = 'ENQUEUE PARENT ACTION';
|
853 |
$insertion = $this->enqueue_parent_code();
|
854 |
+
if ( $filename = $this->css->is_file_ok( $this->css->get_child_target( 'functions.php' ), 'write' ) )
|
855 |
+
$this->insert_with_markers( $filename, $marker, $insertion, $getexternals );
|
|
|
856 |
}
|
857 |
|
858 |
/**
|
859 |
+
* Update functions file with wp_enqueue_style code block. Runs in read-only mode if getexternals is passed.
|
860 |
+
* This function uses the same method as the WP core function that updates .htaccess
|
861 |
* we would have used WP's insert_with_markers function,
|
862 |
+
* but it does not use wp_filesystem API.
|
863 |
*/
|
864 |
+
function insert_with_markers( $filename, $marker, $insertion, $getexternals = FALSE ) {
|
865 |
if ( count( $this->errors ) ):
|
866 |
$this->debug( 'Errors detected, returning', __FUNCTION__ );
|
867 |
return FALSE;
|
879 |
// get_contents_array returns extra linefeeds so just split it ourself
|
880 |
$markerdata = explode( "\n", $wp_filesystem->get_contents( $this->fspath( $filename ) ) );
|
881 |
$newfile = '';
|
882 |
+
$externals = array();
|
883 |
$phpopen = 0;
|
884 |
$in_comment = 0;
|
885 |
+
$foundit = FALSE;
|
886 |
$lasttoken = '';
|
887 |
if ( $markerdata ):
|
888 |
+
$state = TRUE;
|
889 |
foreach ( $markerdata as $n => $markerline ) {
|
890 |
// update open state
|
891 |
$openstars = 0;
|
892 |
$closestars = 0;
|
893 |
// remove double slash comment to end of line
|
894 |
+
$str = preg_replace( "/\/\/.*$/", '', $markerline );
|
895 |
preg_match_all("/(<\?|\?>|\*\/|\/\*)/", $str, $matches );
|
896 |
if ( $matches ):
|
897 |
foreach ( $matches[1] as $token ):
|
907 |
endif;
|
908 |
endforeach;
|
909 |
endif;
|
910 |
+
if ( strpos( $markerline, '// BEGIN ' . $marker ) !== FALSE )
|
911 |
+
$state = FALSE;
|
912 |
if ( $state ):
|
913 |
if ( $n + 1 < count( $markerdata ) )
|
914 |
$newfile .= "{$markerline}\n";
|
915 |
else
|
916 |
$newfile .= "{$markerline}";
|
917 |
+
elseif ( $getexternals ):
|
918 |
+
// look for existing external stylesheets and add to imports config data
|
919 |
+
if ( preg_match( "/wp_enqueue_style.+?'chld_thm_cfg_ext\d+'.+?'(.+?)'/", $markerline, $matches ) )
|
920 |
+
$this->convert_enqueue_to_import( $matches[ 1 ] );
|
921 |
endif;
|
922 |
+
if ( strpos( $markerline, '// END ' . $marker ) !== FALSE ):
|
923 |
$newfile .= "// BEGIN {$marker}\n";
|
924 |
if ( is_array( $insertion ) )
|
925 |
foreach ( $insertion as $insertline )
|
926 |
$newfile .= "{$insertline}\n";
|
927 |
$newfile .= "// END {$marker}\n";
|
928 |
+
$state = TRUE;
|
929 |
+
$foundit = TRUE;
|
930 |
endif;
|
931 |
}
|
932 |
else:
|
948 |
$newfile .= "{$insertline}\n";
|
949 |
$newfile .= "// END {$marker}\n";
|
950 |
endif;
|
951 |
+
// only write file when getexternals is false
|
952 |
+
if ( ! $getexternals ):
|
953 |
+
$this->debug( 'Writing new functions file...', __FUNCTION__ );
|
954 |
+
if ( FALSE === $wp_filesystem->put_contents( $this->fspath( $filename ), $newfile ) )
|
955 |
+
return FALSE;
|
956 |
+
$this->css->converted = 1;
|
957 |
+
endif;
|
958 |
}
|
959 |
|
960 |
+
// creates/updates file via filesystem API
|
961 |
function write_child_file( $file, $contents ) {
|
962 |
if ( !$this->fs ):
|
963 |
$this->debug( 'No filesystem access.', __FUNCTION__ );
|
includes/forms/addl_panels.php
CHANGED
@@ -13,7 +13,7 @@ if ( !defined( 'CHLD_THM_CFG_PLUGINS_VERSION' ) ):
|
|
13 |
<?php _e( 'Learn more', 'chld_thm_cfg'); ?><i class="dashicons dashicons-external" style="text-decoration:none"></i></a></p>
|
14 |
</div></div>
|
15 |
<div class="ctc-input-cell-wide">
|
16 |
-
<a target="_blank" href="<?php echo
|
17 |
<h1><?php _e( 'Customizing WordPress just got even easier.', 'chld_thm_cfg' ); ?></h1>
|
18 |
<p><?php _e( 'Thousands of users have already seen the benefits of using Child Theme Configurator. If you spend any amount of time customizing WordPress, CTC Pro will help maximize your productivity.', 'chld_thm_cfg' ); ?></p>
|
19 |
<h1><?php _e( 'Designed by Developers Who Use It Every Day.', 'chld_thm_cfg' ); ?></h1>
|
13 |
<?php _e( 'Learn more', 'chld_thm_cfg'); ?><i class="dashicons dashicons-external" style="text-decoration:none"></i></a></p>
|
14 |
</div></div>
|
15 |
<div class="ctc-input-cell-wide">
|
16 |
+
<a target="_blank" href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/child-theme-configurator-pro/" title="<?php _e( 'Learn more about CTC Pro', 'chld_thm_cfg' ); ?>"><img src="<?php echo CHLD_THM_CFG_URL . 'css/pro-banner.jpg'; ?>" width="610" height="197" /></a>
|
17 |
<h1><?php _e( 'Customizing WordPress just got even easier.', 'chld_thm_cfg' ); ?></h1>
|
18 |
<p><?php _e( 'Thousands of users have already seen the benefits of using Child Theme Configurator. If you spend any amount of time customizing WordPress, CTC Pro will help maximize your productivity.', 'chld_thm_cfg' ); ?></p>
|
19 |
<h1><?php _e( 'Designed by Developers Who Use It Every Day.', 'chld_thm_cfg' ); ?></h1>
|
includes/forms/addl_tabs.php
CHANGED
@@ -5,7 +5,7 @@ if ( !defined( 'CHLD_THM_CFG_PLUGINS_VERSION' ) ):
|
|
5 |
?>
|
6 |
<a id="get_pro" href="?page=<?php echo CHLD_THM_CFG_MENU; ?>&tab=get_pro"
|
7 |
class="nav-tab<?php echo 'get_pro' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
|
8 |
-
<?php _e( '
|
9 |
</a>
|
10 |
<?php
|
11 |
endif;
|
5 |
?>
|
6 |
<a id="get_pro" href="?page=<?php echo CHLD_THM_CFG_MENU; ?>&tab=get_pro"
|
7 |
class="nav-tab<?php echo 'get_pro' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
|
8 |
+
<?php _e( 'Get Pro', 'chld_thm_cfg_plugins' ); ?>
|
9 |
</a>
|
10 |
<?php
|
11 |
endif;
|
includes/forms/main.php
CHANGED
@@ -41,7 +41,7 @@ else: ?>
|
|
41 |
if ( $enqueueset ):
|
42 |
include ( CHLD_THM_CFG_DIR . '/includes/forms/rule-value.php' );
|
43 |
include ( CHLD_THM_CFG_DIR . '/includes/forms/query-selector.php' );
|
44 |
-
include ( CHLD_THM_CFG_DIR . '/includes/forms/
|
45 |
<div id="view_child_options_panel"
|
46 |
class="ctc-option-panel<?php echo 'view_child_options' == $active_tab ? ' ctc-option-panel-active' : ''; ?>" <?php echo $hidechild; ?>> </div>
|
47 |
<div id="view_parnt_options_panel"
|
41 |
if ( $enqueueset ):
|
42 |
include ( CHLD_THM_CFG_DIR . '/includes/forms/rule-value.php' );
|
43 |
include ( CHLD_THM_CFG_DIR . '/includes/forms/query-selector.php' );
|
44 |
+
include ( CHLD_THM_CFG_DIR . '/includes/forms/webfonts.php' ); ?>
|
45 |
<div id="view_child_options_panel"
|
46 |
class="ctc-option-panel<?php echo 'view_child_options' == $active_tab ? ' ctc-option-panel-active' : ''; ?>" <?php echo $hidechild; ?>> </div>
|
47 |
<div id="view_parnt_options_panel"
|
includes/forms/parent-child.php
CHANGED
@@ -104,15 +104,28 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
104 |
value="<?php echo esc_attr( $css->get_prop( 'version' ) ); ?>" placeholder="<?php _e( 'Version', 'chld_thm_cfg' ); ?>" autocomplete="off" />
|
105 |
</div>
|
106 |
</div></div>
|
107 |
-
<?php $parent_handling = ( isset( $css->enqueue ) ? $css->enqueue :
|
108 |
<div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>">
|
109 |
-
<div class="ctc-section-toggle" id="ctc_stylesheet_handling">
|
110 |
-
|
111 |
-
?>
|
112 |
-
</strong>
|
113 |
<?php _e( '(click to view options)', 'chld_thm_cfg' ); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
</div>
|
115 |
-
<div class="ctc-section-toggle-content" id="ctc_stylesheet_handling_content">
|
116 |
<div class="ctc-input-cell clear"> </div>
|
117 |
<div class="ctc-input-cell">
|
118 |
<label>
|
@@ -121,40 +134,40 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
121 |
<?php _e( 'Enqueue parent stylesheet (default)', 'chld_thm_cfg' ); ?>
|
122 |
</label>
|
123 |
</strong> </div>
|
124 |
-
<div class="ctc-input-cell howto sep"><?php _e( "Select this option if the
|
125 |
</div>
|
126 |
-
<div class="ctc-input-cell clear"
|
127 |
-
_e( '<strong>NOTE: This theme links the stylesheet in the header template and should use the @import option to render correctly.</strong>', 'chld_thm_cfg' ); ?> </div>
|
128 |
<div class="ctc-input-cell">
|
129 |
<label>
|
130 |
-
<input class="ctc_radio ctc-themeonly" id="
|
131 |
-
value="
|
132 |
-
<?php _e( '
|
133 |
</label>
|
134 |
</strong> </div>
|
135 |
-
<div class="ctc-input-cell howto sep"><?php _e(
|
136 |
</div>
|
137 |
-
<div class="ctc-input-cell clear"
|
|
|
|
|
138 |
<div class="ctc-input-cell">
|
139 |
<label>
|
140 |
<input class="ctc_radio ctc-themeonly" id="ctc_parent_enqueue_both" name="ctc_parent_enqueue" type="radio"
|
141 |
-
value="both" <?php checked( '
|
142 |
-
<?php _e( 'Enqueue child
|
143 |
</label>
|
144 |
</strong> </div>
|
145 |
-
<div class="ctc-input-cell howto sep"><?php _e( 'Select this option if
|
146 |
</div>
|
147 |
<div class="ctc-input-cell clear"> </div>
|
148 |
<div class="ctc-input-cell">
|
149 |
<label>
|
150 |
-
<input class="ctc_radio ctc-themeonly" id="
|
151 |
-
value="
|
152 |
-
<?php _e( '
|
153 |
</label>
|
154 |
-
|
155 |
-
<div class="ctc-input-cell howto">
|
156 |
-
|
157 |
-
</div>
|
158 |
</div></div>
|
159 |
<div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>">
|
160 |
<div class="ctc-input-cell"> <strong>
|
104 |
value="<?php echo esc_attr( $css->get_prop( 'version' ) ); ?>" placeholder="<?php _e( 'Version', 'chld_thm_cfg' ); ?>" autocomplete="off" />
|
105 |
</div>
|
106 |
</div></div>
|
107 |
+
<?php $parent_handling = ( isset( $css->enqueue ) ? $css->enqueue : 'enqueue' ); ?>
|
108 |
<div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>">
|
109 |
+
<div class="ctc-input-cell ctc-section-toggle" id="ctc_stylesheet_handling">
|
110 |
+
<strong><?php _e( 'Stylesheet handling', 'chld_thm_cfg' ); ?></strong>
|
|
|
|
|
111 |
<?php _e( '(click to view options)', 'chld_thm_cfg' ); ?>
|
112 |
+
</div><?php if ( count( $this->warnings ) && !in_array( $this->ctc()->css->enqueue, array( 'both', 'import' ) ) ):?>
|
113 |
+
<div class="ctc-input-cell-wide update-nag"><strong><?php _e( 'This theme may not apply child theme styles correctly with the current settings:', 'chld_thm_cfg' ); ?></strong><ul class="smaller">
|
114 |
+
<?php foreach ( $this->warnings as $warning ) echo '<li>' . $warning . '</li>' . LF; ?>
|
115 |
+
</ul> <a href="#" class="ctc-section-toggle" id="ctc_stylesheet_handling2"><?php _e( 'View options', 'chld_thm_cfg'); ?></a></div>
|
116 |
+
<?php endif; ?>
|
117 |
+
<div class="ctc-section-toggle-content clear" id="ctc_stylesheet_handling_content">
|
118 |
+
<div class="ctc-input-cell clear"><a href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/how-to-use/#stylesheet_handling" target="_blank"><?php _e( 'Which option should I use?', 'chld_thm_cfg' ); ?></a></div>
|
119 |
+
<div class="ctc-input-cell">
|
120 |
+
<label>
|
121 |
+
<input class="ctc_radio ctc-themeonly" id="ctc_parent_enqueue_none" name="ctc_parent_enqueue" type="radio"
|
122 |
+
value="none" <?php checked( 'none', $parent_handling ); ?> <?php echo $disabled; ?> />
|
123 |
+
<?php _e( 'None (handled by theme)', 'chld_thm_cfg' ); ?>
|
124 |
+
</label>
|
125 |
+
</div>
|
126 |
+
<div class="ctc-input-cell howto sep">
|
127 |
+
<?php _e( 'Select this option if all stylesheets are correctly enqueued for child themes. If you find that styles are not being applied correctly, use a different option.', 'chld_thm_cfg' ); ?>
|
128 |
</div>
|
|
|
129 |
<div class="ctc-input-cell clear"> </div>
|
130 |
<div class="ctc-input-cell">
|
131 |
<label>
|
134 |
<?php _e( 'Enqueue parent stylesheet (default)', 'chld_thm_cfg' ); ?>
|
135 |
</label>
|
136 |
</strong> </div>
|
137 |
+
<div class="ctc-input-cell howto sep"><?php _e( "Select this option if the theme enqueues the active stylesheet but has no special handling for child themes. Start with this option if unsure.", 'chld_thm_cfg' ); ?>
|
138 |
</div>
|
139 |
+
<div class="ctc-input-cell clear"> </div>
|
|
|
140 |
<div class="ctc-input-cell">
|
141 |
<label>
|
142 |
+
<input class="ctc_radio ctc-themeonly" id="ctc_parent_enqueue_child" name="ctc_parent_enqueue" type="radio"
|
143 |
+
value="both" <?php checked( 'child', $parent_handling ); ?> <?php echo $disabled; ?> />
|
144 |
+
<?php _e( 'Enqueue child stylesheet', 'chld_thm_cfg' ); ?>
|
145 |
</label>
|
146 |
</strong> </div>
|
147 |
+
<div class="ctc-input-cell howto sep"><?php _e( 'Select this option if the theme enqueues the parent stylesheet but does not enqueue the child stylesheet at all. This can happen if <code>get_template()</code> or <code>get_template_directory_uri()</code> is used to link the stylesheet.', 'chld_thm_cfg' ); ?>
|
148 |
</div>
|
149 |
+
<div class="ctc-input-cell clear"><?php if ( count( $this->warnings ) ): ?><div class="update-nag">
|
150 |
+
<strong><?php _e( 'Recommended for this theme:', 'chld_thm_cfg' ); ?></strong></div>
|
151 |
+
<?php endif; ?> </div>
|
152 |
<div class="ctc-input-cell">
|
153 |
<label>
|
154 |
<input class="ctc_radio ctc-themeonly" id="ctc_parent_enqueue_both" name="ctc_parent_enqueue" type="radio"
|
155 |
+
value="both" <?php checked( 'both', $parent_handling ); ?> <?php echo $disabled; ?> />
|
156 |
+
<?php _e( 'Enqueue both parent and child stylesheets', 'chld_thm_cfg' ); ?>
|
157 |
</label>
|
158 |
</strong> </div>
|
159 |
+
<div class="ctc-input-cell howto sep"><?php _e( 'Select this option if stylesheet link tags are hard-coded into the header template (common in older themes). This enables the child stylesheet to override the parent stylesheet without using <code>@import</code>.', 'chld_thm_cfg' ); ?>
|
160 |
</div>
|
161 |
<div class="ctc-input-cell clear"> </div>
|
162 |
<div class="ctc-input-cell">
|
163 |
<label>
|
164 |
+
<input class="ctc_radio ctc-themeonly" id="ctc_parent_enqueue_import" name="ctc_parent_enqueue" type="radio"
|
165 |
+
value="import" <?php checked( 'import', $parent_handling ); ?> <?php echo $disabled; ?> />
|
166 |
+
<?php _e( '<code>@import</code> parent stylesheet', 'chld_thm_cfg' ); ?>
|
167 |
</label>
|
168 |
+
</strong> </div>
|
169 |
+
<div class="ctc-input-cell howto"><?php _e( "This option imports the parent stylesheet from the child stylesheet. This enables the child stylesheet to override the parent stylesheet, but using <code>@import</code> is no longer recommended.", 'chld_thm_cfg' ); ?>
|
170 |
+
</div>
|
|
|
171 |
</div></div>
|
172 |
<div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>">
|
173 |
<div class="ctc-input-cell"> <strong>
|
includes/forms/related.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<span style="float:right;margin-left:2em;margin-top:-6px;text-shadow:1px 2px 0 #fff"><strong><?php _e( 'New user?','chld_thm_cfg' ); ?> <span style="color:#F1823B"><?php _e( 'Click help', 'chld_thm_cfg' ); ?></span></strong> <i class="dashicons dashicons-arrow-right-alt" style="color:#F1823B"></i></span><a href="<?php echo
|
1 |
+
<span style="float:right;margin-left:2em;margin-top:-6px;text-shadow:1px 2px 0 #fff"><strong><?php _e( 'New user?','chld_thm_cfg' ); ?> <span style="color:#F1823B"><?php _e( 'Click help', 'chld_thm_cfg' ); ?></span></strong> <i class="dashicons dashicons-arrow-right-alt" style="color:#F1823B"></i></span><a href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/child-theme-configurator-pro/" target="_blank" title="<?php _e( 'Get CTC Pro and other tools', 'chld_thm_cfg' ); ?>" style="float:right"><img src="<?php echo CHLD_THM_CFG_URL; ?>css/lilaea-logo.png" height="36" width="145" alt="<?php _e( 'Lilaea Media - Responsive Tools for a Mobile World', 'chld_thm_cfg' ); ?>" /></a>
|
includes/forms/tabs.php
CHANGED
@@ -19,7 +19,7 @@ $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'parent_child_options';
|
|
19 |
<?php _e( 'Rule/Value', 'chld_thm_cfg' ); ?>
|
20 |
</a><!----><a id="import_options" href=""
|
21 |
class="nav-tab<?php echo 'import_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
|
22 |
-
<?php _e( '
|
23 |
</a><!----><a id="view_child_options" href=""
|
24 |
class="nav-tab<?php echo 'view_child_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
|
25 |
<?php _e( 'Child CSS', 'chld_thm_cfg' ); ?>
|
19 |
<?php _e( 'Rule/Value', 'chld_thm_cfg' ); ?>
|
20 |
</a><!----><a id="import_options" href=""
|
21 |
class="nav-tab<?php echo 'import_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
|
22 |
+
<?php _e( 'Web Fonts', 'chld_thm_cfg' ); ?>
|
23 |
</a><!----><a id="view_child_options" href=""
|
24 |
class="nav-tab<?php echo 'view_child_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
|
25 |
<?php _e( 'Child CSS', 'chld_thm_cfg' ); ?>
|
includes/forms/{at-import.php → webfonts.php}
RENAMED
@@ -15,8 +15,10 @@ $ctcpage = apply_filters( 'chld_thm_cfg_admin_page', CHLD_THM_CFG_MENU );
|
|
15 |
name="ctc_save_imports" value="<?php _e( 'Save', 'chld_thm_cfg' ); ?>" disabled />
|
16 |
</div>
|
17 |
<strong>
|
18 |
-
<?php _e( '
|
19 |
</strong>
|
|
|
|
|
20 |
</div>
|
21 |
<div class="ctc-input-cell-wide">
|
22 |
<textarea id="ctc_child_imports" name="ctc_child_imports" wrap="off"><?php
|
15 |
name="ctc_save_imports" value="<?php _e( 'Save', 'chld_thm_cfg' ); ?>" disabled />
|
16 |
</div>
|
17 |
<strong>
|
18 |
+
<?php _e( 'Linked Stylesheets', 'chld_thm_cfg' ); ?>
|
19 |
</strong>
|
20 |
+
<p><?php _e( 'Use <code>@import url( [path] );</code> to link additional stylesheets. Child Theme Configurator uses the <code>@import</code> keyword to identify them and convert them to <code><link></code> tags. <strong>Example:</strong>');?></p>
|
21 |
+
<p><code>@import url(http://fonts.googleapis.com/css?family=Oswald);</code></p>
|
22 |
</div>
|
23 |
<div class="ctc-input-cell-wide">
|
24 |
<textarea id="ctc_child_imports" name="ctc_child_imports" wrap="off"><?php
|
includes/help/help_en_US.php
CHANGED
@@ -16,17 +16,23 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
16 |
<li><strong>Optional: Enter a Theme Name, Theme Website, Author, Author Website, Descriptiont, Tags and Version</strong> for the child theme. If using an existing child theme, they will be entered automatically based on the child theme selected.</li>
|
17 |
<li><strong>Choose how WordPress should handle the parent theme stylesheet:</strong>
|
18 |
<ul>
|
19 |
-
<li><strong>
|
20 |
-
|
21 |
-
<li><strong>Enqueue
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
</ul></li>
|
24 |
<li><strong>Use Parent Options (optional)</strong> If you want to maintain the same theme options as the parent theme, check "Copy Parent Theme Menus, Widgets and other Options". Depending on the theme, some options may need to be applied using separate theme option controls. <strong>NOTE: This will overwrite any child theme options you may have already set.</strong></li>
|
25 |
<li><strong>Save Backup (optional)</strong> If using an existing child theme, you can check "Backup Stylesheet", to create a backup of the child theme stylesheet in the child theme directory.</li>
|
26 |
<li><strong>Restore from backup (optional - new in version 1.6.0):</strong> If using an existing child theme, you can choose whether to reload the current child theme stylesheet (leave unchanged), reset all values, or restore it from a backup. If there are backup files available, they will appear as radio button options.</li>
|
27 |
<li><strong>Choose additional stylesheets</strong> If your theme uses additional stylesheets, you can open the "Parse Additional Stylesheets" toggle and they will appear as checkbox options. Stylesheets that are being used by the parent theme should be automatically selected for you. Only select additional stylesheets you wish to customize to reduce overhead. <strong>NOTE: If the parent theme uses Bootstrap stylesheets, they will not be automatically selected.</strong> You can select Bootstrap stylesheets manually if you need to customize them, but in most cases they add unecessary overhead to the configuration data.</li>
|
28 |
<li><strong>Click "Generate/Rebuild Child Theme Files."</strong></li>
|
29 |
-
<li><strong>IMPORTANT: <a target="_blank" href="<?php echo CHLD_THM_CFG_DOCS_URL;
|
30 |
</ol>
|
31 |
<!-- END tab -->
|
32 |
<!-- BEGIN tab -->
|
@@ -56,15 +62,11 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
56 |
<p>Click "Save" to update the child stylesheet and save your changes to the WordPress admin.</p>
|
57 |
<!-- END tab -->
|
58 |
<!-- BEGIN tab -->
|
59 |
-
<h3 id="ctc_imports"
|
60 |
-
<p>You can add additional stylesheets and web fonts by typing @import rules into the textarea on the
|
61 |
<p>Below is an example that loads a local custom stylesheet (you would have to add the "fonts" directory and stylesheet) as well as the web font "Open Sans" from Google Web Fonts:</p>
|
62 |
-
<blockquote
|
63 |
-
|
64 |
-
@import url(fonts/stylesheet.css);
|
65 |
-
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700,700italic);
|
66 |
-
</code></pre>
|
67 |
-
</blockquote>
|
68 |
<!-- END tab -->
|
69 |
<!-- BEGIN tab -->
|
70 |
<h3 id="ctc_files">Files Tab</h3>
|
@@ -86,7 +88,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
86 |
<!-- END tab -->
|
87 |
<!-- BEGIN tab -->
|
88 |
<h3 id="ctc_preview">Preview and Activate</h3>
|
89 |
-
<p><strong>IMPORTANT: <a target="_blank" href="<?php echo CHLD_THM_CFG_DOCS_URL;
|
90 |
<ol>
|
91 |
<li>Navigate to Appearance > Themes in the WordPress Admin. You will now see the new Child Theme as one of the installed Themes.</li>
|
92 |
<li>Click "Live Preview" below the new Child Theme to see it in action.</li>
|
@@ -137,12 +139,12 @@ if ( !defined( 'ABSPATH' ) ) exit;
|
|
137 |
</ul>
|
138 |
</p>
|
139 |
<h5 id="existing_parent">How do I move changes I have already made to my theme into a Child Theme?</h5>
|
140 |
-
<p><a href="<?php echo CHLD_THM_CFG_DOCS_URL;
|
141 |
<h5 id="web_fonts">How do I add Web Fonts?</h5>
|
142 |
-
<p>The easiest method is to paste the @import code provided by <a href="http://www.google.com/fonts" title="Google Fonts">Google</a>, <a href="http://www.fontsquirrel.com/" title="Font Squirrel">Font Squirrel</a> or any other Web Font site into the
|
143 |
-
<p>You can also create a secondary stylesheet that contains @font-face rules and import it using the
|
144 |
<h5 id="plugin">Does it work with plugins?</h5>
|
145 |
-
<p>We offer a premium extension to let you easily modify styles for any WordPress Plugin installed on your website. The Child Theme Configurator Plugin Extension scans your plugins and allows you to create custom stylesheets in your Child Theme. <a href="<?php echo
|
146 |
<h5 id="doesnt_work">Why doesn't this work with my (insert theme vendor here) theme?</h5>
|
147 |
<p>Some themes (particularly commercial themes) do not correctly load parent template files or automatically load child theme stylesheets or php files.</p><p>This is unfortunate, because in the best case they effectively prohibit the webmaster from adding any customizations (other than those made through the admin theme options) that will survive past an upgrade. <strong>In the worst case they will break your website when you activate the child theme.</strong> </p>
|
148 |
<p>Contact the vendor directly to ask for this core functionality. It is our opinion that ALL themes (especially commercial ones) must pass the Theme Unit Tests outlined by WordPress.org. </p>
|
@@ -207,12 +209,12 @@ The plugin only loads the bulk of the code in the admin when you are using the t
|
|
207 |
<h4>Our plugins will not nag you for donations...</h4>
|
208 |
<span style="font-size:smaller">...but we LOVE referrals.</span><br/><a href="http://wordpress.org/support/view/plugin-reviews/child-theme-configurator?rate=5#postform">Give Us 5 Stars</a>
|
209 |
<h4>Introducing CTC Pro</h4>
|
210 |
-
<a href="<?php echo
|
211 |
-
<p style="font-size:smaller">Designed by WordPress developers who use it every day, CTC Pro adds plugin stylesheets and other features to make design work quicker and easier. This is a free upgrade for users that purchased the Plugins Extension. <a href="<?php echo
|
212 |
<ul>
|
213 |
<li><a href="http://www.lilaeamedia.com/about/contact/">Contact us</a></li>
|
214 |
<li><a href="http://www.childthemeconfigurator.com/">Plugin Website</a></li>
|
215 |
<li><a href="http://codex.wordpress.org/Child_Themes">WordPress Codex</a></li>
|
216 |
-
<li><a href="http://wordpress.stackexchange.com/">WordPress
|
217 |
</ul>
|
218 |
<!-- END sidebar -->
|
16 |
<li><strong>Optional: Enter a Theme Name, Theme Website, Author, Author Website, Descriptiont, Tags and Version</strong> for the child theme. If using an existing child theme, they will be entered automatically based on the child theme selected.</li>
|
17 |
<li><strong>Choose how WordPress should handle the parent theme stylesheet:</strong>
|
18 |
<ul>
|
19 |
+
<li><strong>None (handled by theme)</strong>
|
20 |
+
Select this option if all stylesheets are correctly enqueued for child themes. If you find that styles are not being applied correctly, use a different option.</li>
|
21 |
+
<li><strong>Enqueue parent stylesheet (default)</strong>
|
22 |
+
Select this option if the theme enqueues the active stylesheet but has no special handling for child themes. Start with this option if unsure.</li>
|
23 |
+
<li><strong>Enqueue child stylesheet</strong>
|
24 |
+
Select this option if the theme enqueues the parent stylesheet but does not enqueue the child stylesheet at all. This can happen if <code>get_template()</code> or <code>get_template_directory_uri()</code> is used to link the stylesheet.</li>
|
25 |
+
<li><strong>Enqueue both parent and child stylesheets</strong>
|
26 |
+
Select this option if stylesheet link tags are hard-coded into the header template (common in older themes). This enables the child stylesheet to override the parent stylesheet without using <code>@import.</code></li>
|
27 |
+
<li><strong><code>@import</code> parent stylesheet</strong>
|
28 |
+
This option imports the parent stylesheet from the child stylesheet. This enables the child stylesheet to override the parent stylesheet, but using <code>@import</code> is no longer recommended.</li>
|
29 |
</ul></li>
|
30 |
<li><strong>Use Parent Options (optional)</strong> If you want to maintain the same theme options as the parent theme, check "Copy Parent Theme Menus, Widgets and other Options". Depending on the theme, some options may need to be applied using separate theme option controls. <strong>NOTE: This will overwrite any child theme options you may have already set.</strong></li>
|
31 |
<li><strong>Save Backup (optional)</strong> If using an existing child theme, you can check "Backup Stylesheet", to create a backup of the child theme stylesheet in the child theme directory.</li>
|
32 |
<li><strong>Restore from backup (optional - new in version 1.6.0):</strong> If using an existing child theme, you can choose whether to reload the current child theme stylesheet (leave unchanged), reset all values, or restore it from a backup. If there are backup files available, they will appear as radio button options.</li>
|
33 |
<li><strong>Choose additional stylesheets</strong> If your theme uses additional stylesheets, you can open the "Parse Additional Stylesheets" toggle and they will appear as checkbox options. Stylesheets that are being used by the parent theme should be automatically selected for you. Only select additional stylesheets you wish to customize to reduce overhead. <strong>NOTE: If the parent theme uses Bootstrap stylesheets, they will not be automatically selected.</strong> You can select Bootstrap stylesheets manually if you need to customize them, but in most cases they add unecessary overhead to the configuration data.</li>
|
34 |
<li><strong>Click "Generate/Rebuild Child Theme Files."</strong></li>
|
35 |
+
<li><strong>IMPORTANT: <a target="_blank" href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/how-to-use/#preview_activate" title="Test your child theme before activating!">Always test your child theme with Live Preview before activating!</a></strong></li>
|
36 |
</ol>
|
37 |
<!-- END tab -->
|
38 |
<!-- BEGIN tab -->
|
62 |
<p>Click "Save" to update the child stylesheet and save your changes to the WordPress admin.</p>
|
63 |
<!-- END tab -->
|
64 |
<!-- BEGIN tab -->
|
65 |
+
<h3 id="ctc_imports">Web Fonts Tab</h3>
|
66 |
+
<p>You can add additional stylesheets and web fonts by typing @import rules into the textarea on the Web Fonts tab. <strong>Important: do not import the parent theme stylesheet here. Use the "Parent stylesheet handling" option from the Parent/Child tab.</strong></p>
|
67 |
<p>Below is an example that loads a local custom stylesheet (you would have to add the "fonts" directory and stylesheet) as well as the web font "Open Sans" from Google Web Fonts:</p>
|
68 |
+
<blockquote><pre><code>@import url(fonts/stylesheet.css);
|
69 |
+
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700,700italic);</code></pre></blockquote>
|
|
|
|
|
|
|
|
|
70 |
<!-- END tab -->
|
71 |
<!-- BEGIN tab -->
|
72 |
<h3 id="ctc_files">Files Tab</h3>
|
88 |
<!-- END tab -->
|
89 |
<!-- BEGIN tab -->
|
90 |
<h3 id="ctc_preview">Preview and Activate</h3>
|
91 |
+
<p><strong>IMPORTANT: <a target="_blank" href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/how-to-use/#preview_activate" title="Test your child theme before activating!">Test your child theme before activating!</a></strong> Some themes (particularly commercial themes) do not correctly load parent template files or automatically load child theme stylesheets or php files. <strong>In the worst cases they will break your website when you activate the child theme.</strong></p>
|
92 |
<ol>
|
93 |
<li>Navigate to Appearance > Themes in the WordPress Admin. You will now see the new Child Theme as one of the installed Themes.</li>
|
94 |
<li>Click "Live Preview" below the new Child Theme to see it in action.</li>
|
139 |
</ul>
|
140 |
</p>
|
141 |
<h5 id="existing_parent">How do I move changes I have already made to my theme into a Child Theme?</h5>
|
142 |
+
<p><a href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/how-to-use/#child_from_modified_parent" class="scroll-to">Follow these steps</a>. </p>
|
143 |
<h5 id="web_fonts">How do I add Web Fonts?</h5>
|
144 |
+
<p>The easiest method is to paste the @import code provided by <a href="http://www.google.com/fonts" title="Google Fonts">Google</a>, <a href="http://www.fontsquirrel.com/" title="Font Squirrel">Font Squirrel</a> or any other Web Font site into the Web Fonts tab. The fonts will then be available to use as a value of the <strong>font-family</strong> rule. Be sure you understand the license for any embedded fonts. </p>
|
145 |
+
<p>You can also create a secondary stylesheet that contains @font-face rules and import it using the Web Fonts tab. </p>
|
146 |
<h5 id="plugin">Does it work with plugins?</h5>
|
147 |
+
<p>We offer a premium extension to let you easily modify styles for any WordPress Plugin installed on your website. The Child Theme Configurator Plugin Extension scans your plugins and allows you to create custom stylesheets in your Child Theme. <a href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/child-theme-configurator-pro/" title="Take Control of your Plugin Styles with Child Theme Configurator Plugin Extension for WordPress">Learn more <i class="genericon genericon-next"></i></a>
|
148 |
<h5 id="doesnt_work">Why doesn't this work with my (insert theme vendor here) theme?</h5>
|
149 |
<p>Some themes (particularly commercial themes) do not correctly load parent template files or automatically load child theme stylesheets or php files.</p><p>This is unfortunate, because in the best case they effectively prohibit the webmaster from adding any customizations (other than those made through the admin theme options) that will survive past an upgrade. <strong>In the worst case they will break your website when you activate the child theme.</strong> </p>
|
150 |
<p>Contact the vendor directly to ask for this core functionality. It is our opinion that ALL themes (especially commercial ones) must pass the Theme Unit Tests outlined by WordPress.org. </p>
|
209 |
<h4>Our plugins will not nag you for donations...</h4>
|
210 |
<span style="font-size:smaller">...but we LOVE referrals.</span><br/><a href="http://wordpress.org/support/view/plugin-reviews/child-theme-configurator?rate=5#postform">Give Us 5 Stars</a>
|
211 |
<h4>Introducing CTC Pro</h4>
|
212 |
+
<a href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/child-theme-configurator-pro/" title="<?php _e( 'Learn more about CTC Pro', 'chld_thm_cfg' ); ?>"><img src="<?php echo CHLD_THM_CFG_URL . 'css/pro-banner.jpg'; ?>" width="150" height="48" /></a>
|
213 |
+
<p style="font-size:smaller">Designed by WordPress developers who use it every day, CTC Pro adds plugin stylesheets and other features to make design work quicker and easier. This is a free upgrade for users that purchased the Plugins Extension. <a href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/child-theme-configurator-pro/" title="Child Theme Configurator Pro">Learn more</a></p>
|
214 |
<ul>
|
215 |
<li><a href="http://www.lilaeamedia.com/about/contact/">Contact us</a></li>
|
216 |
<li><a href="http://www.childthemeconfigurator.com/">Plugin Website</a></li>
|
217 |
<li><a href="http://codex.wordpress.org/Child_Themes">WordPress Codex</a></li>
|
218 |
+
<li><a href="http://wordpress.stackexchange.com/">WordPress Development (StackExchange)</a></li>
|
219 |
</ul>
|
220 |
<!-- END sidebar -->
|
js/chld-thm-cfg.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
* Script: chld-thm-cfg.js
|
3 |
* Plugin URI: http://www.childthemeconfigurator.com/
|
4 |
* Description: Handles jQuery, AJAX and other UI
|
5 |
-
* Version: 1.7.
|
6 |
* Author: Lilaea Media
|
7 |
* Author URI: http://www.lilaeamedia.com/
|
8 |
* License: GPLv2
|
@@ -884,6 +884,7 @@
|
|
884 |
dataType: self.is_empty( datatype ) ? 'json' : datatype,
|
885 |
type: 'POST'
|
886 |
} ).done( function( response ) {
|
|
|
887 |
self.handle_success( obj, response );
|
888 |
} ).fail( function() {
|
889 |
self.handle_failure( obj );
|
@@ -953,14 +954,14 @@
|
|
953 |
culprits.push( '<code><small>' + url.split( /\?/ )[ 0 ] + '</small></code>' );
|
954 |
}
|
955 |
} );
|
956 |
-
errors.push( '<strong>' + self.getxt( 'js' ) + '</strong>' );
|
957 |
-
|
958 |
errors.push( self.jquery_err.join( '<br/>' ) );
|
959 |
-
|
960 |
if ( culprits.length ) {
|
961 |
errors.push( self.getxt( 'jquery' ) + '<br/>' + culprits.join( '<br/>' ) );
|
962 |
}
|
963 |
-
errors.push( self.getxt( 'plugin' )
|
964 |
self.set_notice( { 'error': errors } );
|
965 |
},
|
966 |
|
@@ -1245,9 +1246,14 @@
|
|
1245 |
self.focus_panel( id );
|
1246 |
} );
|
1247 |
$( '.ctc-section-toggle' ).on( 'click', function( e ) {
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
|
|
|
|
|
|
|
|
|
|
1251 |
} );
|
1252 |
$( '#view_child_options, #view_parnt_options' ).on( 'click', function( e ){
|
1253 |
if ( $( this ).hasClass( 'ajax-pending' ) ) return false;
|
2 |
* Script: chld-thm-cfg.js
|
3 |
* Plugin URI: http://www.childthemeconfigurator.com/
|
4 |
* Description: Handles jQuery, AJAX and other UI
|
5 |
+
* Version: 1.7.3
|
6 |
* Author: Lilaea Media
|
7 |
* Author URI: http://www.lilaeamedia.com/
|
8 |
* License: GPLv2
|
884 |
dataType: self.is_empty( datatype ) ? 'json' : datatype,
|
885 |
type: 'POST'
|
886 |
} ).done( function( response ) {
|
887 |
+
//console.log( response );
|
888 |
self.handle_success( obj, response );
|
889 |
} ).fail( function() {
|
890 |
self.handle_failure( obj );
|
954 |
culprits.push( '<code><small>' + url.split( /\?/ )[ 0 ] + '</small></code>' );
|
955 |
}
|
956 |
} );
|
957 |
+
errors.push( '<strong>' + self.getxt( 'js' ) + '</strong> ' + self.getxt( 'contact' ) );
|
958 |
+
if ( 1 == ctcAjax.is_debug ) {
|
959 |
errors.push( self.jquery_err.join( '<br/>' ) );
|
960 |
+
}
|
961 |
if ( culprits.length ) {
|
962 |
errors.push( self.getxt( 'jquery' ) + '<br/>' + culprits.join( '<br/>' ) );
|
963 |
}
|
964 |
+
errors.push( self.getxt( 'plugin' ) );
|
965 |
self.set_notice( { 'error': errors } );
|
966 |
},
|
967 |
|
1246 |
self.focus_panel( id );
|
1247 |
} );
|
1248 |
$( '.ctc-section-toggle' ).on( 'click', function( e ) {
|
1249 |
+
e.preventDefault();
|
1250 |
+
$( this ).parents( '.ctc-input-row' ).first().find( '.ctc-section-toggle' )
|
1251 |
+
.each( function() {
|
1252 |
+
$( this ).toggleClass( 'open' );
|
1253 |
+
} );
|
1254 |
+
var id = $( this ).attr( 'id' ).replace(/\d$/, '') + '_content';
|
1255 |
+
$( '#' + id ).stop().slideToggle( 'fast' );
|
1256 |
+
return false;
|
1257 |
} );
|
1258 |
$( '#view_child_options, #view_parnt_options' ).on( 'click', function( e ){
|
1259 |
if ( $( this ).hasClass( 'ajax-pending' ) ) return false;
|
js/chld-thm-cfg.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e){e.chldthmcfg={esc_quot:function(e){var t=this;return t.is_empty(e)?e:e.toString().replace(/"/g,""")},getxt:function(e){return(text=ctcAjax[e+"_txt"])?text:""},from_ascii:function(e){var t=parseInt(e),c=String.fromCharCode(t);return c},to_ascii:function(e){var t=e.charCodeAt(0);return t},is_empty:function(e){if("undefined"==typeof e||!1===e||null===e||""===e)return!0;if(!0===e||"string"==typeof e||"number"==typeof e)return!1;if("object"==typeof e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}return!1},theme_exists:function(t,c){var n=!1;return e.each(ctcAjax.themes,function(i,r){return e.each(r,function(e){return e!=t||"parnt"!=i&&"new"!=c?void 0:(n=!0,!1)}),n?!1:void 0}),n},validate:function(){var t=this,c=/[^\w\-]/,n=e("#ctc_child_template").length?e("#ctc_child_template").val().toString().replace(c).toLowerCase():"",i=e("#ctc_theme_child").length?e("#ctc_theme_child").val().toString().replace(c).toLowerCase():n,r=e("input[name=ctc_child_type]:checked").val(),a=[];return"new"==r&&(i=n),t.theme_exists(i,r)&&a.push(t.getxt("theme_exists").toString().replace(/%s/,i)),""===i&&a.push(t.getxt("inval_theme")),""===e("#ctc_child_name").val()&&a.push(t.getxt("inval_name")),a.length?(t.set_notice({error:a}),!1):!0},autogen_slugs:function(){if(e("#ctc_theme_parnt").length){for(var t=this,c=e("#ctc_theme_parnt").val(),n=slugbase=c+"-child",i=ctcAjax.themes.parnt[c].Name+" Child",r="",a="",s="00";t.theme_exists(n,"new");)r=""==r?2:r+1,a=s.substring(0,s.length-r.toString().length)+r.toString(),n=slugbase+a;t.testslug=n,t.testname=i+(a.length?" "+a:"")}},focus_panel:function(t){var c=t+"_panel";e(".nav-tab").removeClass("nav-tab-active"),e(".ctc-option-panel").removeClass("ctc-option-panel-active"),e(".ctc-selector-container").hide(),e(t).addClass("nav-tab-active"),e(".ctc-option-panel-container").scrollTop(0),e(c).addClass("ctc-option-panel-active")},selector_input_toggle:function(t){var c,n=this;e("#ctc_rewrite_selector").length?(c=e("#ctc_rewrite_selector_orig").val(),e("#ctc_sel_ovrd_selector_selected").text(c),e(t).text(n.getxt("rename"))):(c=e("#ctc_sel_ovrd_selector_selected").text(),e("#ctc_sel_ovrd_selector_selected").html('<textarea id="ctc_rewrite_selector" name="ctc_rewrite_selector" autocomplete="off"></textarea><input id="ctc_rewrite_selector_orig" name="ctc_rewrite_selector_orig" type="hidden" value="'+n.esc_quot(c)+'"/>'),e("#ctc_rewrite_selector").val(c),e(t).text(n.getxt("cancel")))},fade_update_notice:function(){e(".updated, .error").slideUp("slow",function(){e(".updated").remove()})},coalesce_inputs:function(t){var c=this,n=/^(ctc_(ovrd|\d+)_(parent|child)_([0-9a-z\-]+)_(\d+))(_\w+)?$/,i=e(t).parents(".ctc-selector-row, .ctc-parent-row").first(),r=i.find(".ctc-swatch").first(),a={parent:{},child:{}},s={parent:{origin:"",start:"",end:""},child:{origin:"",start:"",end:""}},l={child:!1,parent:!1},o={};return i.find(".ctc-parent-value, .ctc-child-value").each(function(){var i,r,_=e(this).attr("id"),u=_.toString().match(n),d=u[2],p=u[3],h="undefined"==typeof u[4]?"":u[4],m=u[5],v="undefined"==typeof u[6]?"":u[6],f="parent"==p?e(this).text().replace(/!$/,""):e(this).val(),g="ctc_"+d+"_child_"+h+"_i_"+m;if(c.is_empty(e(this).data("color"))||(f=e(this).data("color"),e(this).data("color",null)),"child"==p&&(o[_]=f,o[g]=e("#"+g).is(":checked")?1:0),""!=f)if(c.is_empty(v))(i=h.toString().match(/^border(\-(top|right|bottom|left))?$/)&&!f.match(/none/))?(r=f.toString().split(/ +/),a[p][h+"-width"]="undefined"==typeof r[0]?"":r[0],a[p][h+"-style"]="undefined"==typeof r[1]?"":r[1],a[p][h+"-color"]="undefined"==typeof r[2]?"":r[2]):"background-image"!=h||f.match(/none/)?"seq"!=h&&(a[p][h]=f):f.toString().match(/url\(/)?a[p]["background-image"]=c.image_url(p,f):(r=f.toString().split(/ +/),r.length>2?(s[p].origin="undefined"==typeof r[0]?"top":r[0],s[p].start="undefined"==typeof r[1]?"transparent":r[1],s[p].end="undefined"==typeof r[2]?"transparent":r[2],l[p]=!0):a[p]["background-image"]=f);else switch(v){case"_border_width":a[p][h+"-width"]="none"==f?0:f;break;case"_border_style":a[p][h+"-style"]=f;break;case"_border_color":a[p][h+"-color"]=f;break;case"_background_url":a[p]["background-image"]=c.image_url(p,f);break;case"_background_color":a[p]["background-color"]=t.value;break;case"_background_color1":s[p].start=f,l[p]=!0;break;case"_background_color2":s[p].end=f,l[p]=!0;break;case"_background_origin":s[p].origin=f,l[p]=!0}}),"undefined"==typeof r||c.is_empty(r.attr("id"))||(r.removeAttr("style"),l.parent&&r.ctcgrad(s.parent.origin,[s.parent.start,s.parent.end]),r.css(a.parent),r.attr("id").toString().match(/parent/)||(l.child&&r.ctcgrad(s.child.origin,[s.child.start,s.child.end]),r.css(a.child)),r.css({"z-index":-1})),o},decode_value:function(e,t){t="undefined"==typeof t?"":t;var c=this,n={orig:t};if(e.toString().match(/^border(\-(top|right|bottom|left))?$/)){var i=t.toString().split(/ +/);n.names=["_border_width","_border_style","_border_color"],n.values=["undefined"==typeof i[0]?"":i[0],"undefined"==typeof i[1]?"":i[1],"undefined"==typeof i[2]?"":i[2]]}else if(e.toString().match(/^background\-image/))if(n.names=["_background_url","_background_origin","_background_color1","_background_color2"],n.values=["","","",""],!1!==c.is_empty(t)||t.toString().match(/(url|none)/))n.values[0]=t;else{var i=t.toString().split(/:/);n.values[1]="undefined"==typeof i[0]?"":i[0],n.values[2]="undefined"==typeof i[1]?"":i[1],n.values[3]="undefined"==typeof i[3]?"":i[3],n.orig=[n.values[1],n.values[2],n.values[3]].join(" ")}else n.names=[""],n.values=[t];return n},image_url:function(e,t){var c,n=this,i=t.toString().match(/url\(['" ]*(.+?)['" ]*\)/),r=n.is_empty(i)?null:i[1],a=ctcAjax.theme_uri+"/"+("parent"==e?ctcAjax.parnt:ctcAjax.child)+"/";return r?c=r.toString().match(/^(data:|https?:|\/)/)?t:"url("+a+r+")":!1},setup_menus:function(){var e=this;e.setup_query_menu(),e.setup_selector_menu(),e.setup_rule_menu(),e.setup_new_rule_menu(),e.load_queries(),e.load_rules(),e.set_query(e.current_query)},load_queries:function(){var e=this;e.query_css("queries",null)},load_selectors:function(){var e=this;e.query_css("selectors",e.current_query)},load_rules:function(){var e=this;e.query_css("rules",null)},load_selector_values:function(){var e=this;e.query_css("qsid",e.current_qsid)},get_queries:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.each(this.element.data("menu"),function(e,t){i.test(t)&&n.push({label:t,value:t})}),c(n)},get_selectors:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.each(this.element.data("menu"),function(e,t){i.test(e)&&n.push({label:e,value:t})}),c(n)},get_rules:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.each(this.element.data("menu"),function(e,t){i.test(e)&&n.push({label:e,value:t})}),c(n)},get_filtered_rules:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i"),r=e.chldthmcfg.current_qsdata,a=e.chldthmcfg.is_empty(r)||e.chldthmcfg.is_empty(r.value);e.each(e("#ctc_rule_menu").data("menu"),function(t,c){var s=!1;if(i.test(t)){if(!a&&(e.each(r.value,function(e){return t==e.replace(/\d+/g,self.from_ascii)?(s=!0,!1):void 0}),s))return;n.push({label:t,value:c})}}),c(n)},input_row:function(t,c,n,i){var r=this,a="",s=r.is_empty(i)||r.is_empty(i.value)||r.is_empty(i.value[c])?"":i.value[c],l=r.decode_value(c,r.is_empty(s)?"":s.parnt),o=r.is_empty(s)||r.is_empty(s.i_parnt)||1!=s.i_parnt?"":r.getxt("important"),_=r.decode_value(c,r.is_empty(s)?"":s.child),u=r.is_empty(s)||r.is_empty(s.i_child)||1!=s.i_child?0:1,d="ctc_"+n+"_child_"+c+"_i_"+t;return r.is_empty(i)||(a+='<div class="ctc-'+("ovrd"==n?"input":"selector")+'-row clearfix">\n<div class="ctc-input-cell">'+("ovrd"==n?c.replace(/\d+/g,r.from_ascii):i.selector+'<br/><a href="#" class="ctc-selector-edit" id="ctc_selector_edit_'+t+'" >'+r.getxt("edit")+"</a> "+(r.is_empty(l.orig)?r.getxt("child_only"):""))+"</div>\n","ovrd"==n&&(a+='<div class="ctc-parent-value ctc-input-cell" id="ctc_'+n+"_parent_"+c+"_"+t+'">'+(r.is_empty(l.orig)?"[no value]":l.orig+o)+"</div>\n"),a+='<div class="ctc-input-cell">\n',r.is_empty(l.names)||(e.each(l.names,function(e,i){i=r.is_empty(i)?"":i,a+='<div class="ctc-child-input-cell">\n';var s,l="ctc_"+n+"_child_"+c+"_"+t+i;!1===(s=_.values.shift())&&(s=""),a+=(r.is_empty(i)?"":r.getxt(i)+":<br/>")+'<input type="text" id="'+l+'" name="'+l+'" class="ctc-child-value'+((i+c).toString().match(/color/)?" color-picker":"")+(i.toString().match(/url/)?" ctc-input-wide":"")+'" value="'+r.esc_quot(s)+'" />\n</div>\n'}),a+='<label for="'+d+'"><input type="checkbox" id="'+d+'" name="'+d+'" value="1" '+(1===u?"checked":"")+" />"+r.getxt("important")+"</label>\n"),a+="</div>\n"+("ovrd"==n?"":'<div class="ctc-swatch ctc-specific" id="ctc_child_'+c+"_"+t+'_swatch">'+r.getxt("swatch")+'</div>\n<div class="ctc-child-input-cell ctc-button-cell" id="ctc_save_'+c+"_"+t+'_cell">\n<input type="button" class="button ctc-save-input" id="ctc_save_'+c+"_"+t+'" name="ctc_save_'+c+"_"+t+'" value="Save" /></div>\n')+"</div><!-- end input row -->\n"),a},scrolltop:function(){e("html, body, .ctc-option-panel-container").animate({scrollTop:0})},css_preview:function(e){var e,t=this;(e=e.match(/(child|parnt)/)[1])||(e="child"),t.query_css("preview",e)},setup_iris:function(t){var c=this;try{e(t).iris({change:function(n,i){e(t).data("color",i.color.toString()),c.coalesce_inputs(t)}})}catch(n){c.jquery_exception(n,"Iris Color Picker")}},setup_query_menu:function(){var t=this;try{e("#ctc_sel_ovrd_query").autocomplete({source:t.get_queries,minLength:0,selectFirst:!0,autoFocus:!0,select:function(e,c){return t.set_query(c.item.value),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Query Menu")}},setup_selector_menu:function(){var t=this;try{e("#ctc_sel_ovrd_selector").autocomplete({source:t.get_selectors,selectFirst:!0,autoFocus:!0,select:function(e,c){return t.set_selector(c.item.value,c.item.label),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Selector Menu")}},setup_rule_menu:function(){var t=this;try{e("#ctc_rule_menu").autocomplete({source:t.get_rules,selectFirst:!0,autoFocus:!0,select:function(e,c){return t.set_rule(c.item.value,c.item.label),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Rule Menu")}},setup_new_rule_menu:function(){var t=this;try{e("#ctc_new_rule_menu").autocomplete({source:t.get_filtered_rules,selectFirst:!0,autoFocus:!0,select:function(c,n){c.preventDefault(),t.is_empty(t.current_qsdata.value)&&(t.current_qsdata.value={}),t.current_qsdata.value[n.item.label]={child:""};var i,r=n.item.label.replace(/[^\w\-]/g,t.to_ascii),a=e(t.input_row(t.current_qsid,r,"ovrd",t.current_qsdata));return e("#ctc_sel_ovrd_rule_inputs").append(a),e("#ctc_new_rule_menu").val(""),a.find('input[type="text"]').each(function(c,n){i||(i=n),e(n).hasClass("color-picker")&&t.setup_iris(n)}),i&&e(i).focus(),t.jquery_err.length&&t.jquery_notice(),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"New Rule Menu")}},set_existing:function(){var t=this;if(e("#ctc_theme_child").length&&e("#ctc_child_type_existing").is(":checked")){var c=e("#ctc_theme_child").val();t.is_empty(c)||(e("#ctc_child_name").val(ctcAjax.themes.child[c].Name),e("#ctc_child_author").val(ctcAjax.themes.child[c].Author),e("#ctc_child_version").val(ctcAjax.themes.child[c].Version),e("#ctc_child_authoruri").val(ctcAjax.themes.child[c].AuthorURI),e("#ctc_child_themeuri").val(ctcAjax.themes.child[c].ThemeURI),e("#ctc_child_descr").val(ctcAjax.themes.child[c].Descr),e("#ctc_child_tags").val(ctcAjax.themes.child[c].Tags))}},set_notice:function(t){var c=this,n="";c.is_empty(t)||e.each(t,function(t,c){n+='<div class="'+t+'"><ul>\n',e(c).each(function(e,t){n+="<li>"+t.toString()+"</li>\n"}),n+="</ul></div>"}),e("#ctc_error_notice").html(n),e("html, body").animate({scrollTop:0},"slow")},set_parent_menu:function(t){e("#ctc_theme_parent").parents(".ctc-input-row").first().append('<span class="ctc-status-icon spinner"></span>'),e(".spinner").show(),document.location="?page="+ctcAjax.page+"&ctc_parent="+t.value},set_child_menu:function(t){var c=this;c.is_empty(ctcAjax.themes.child[t.value])||(e("#ctc_child_name").val(ctcAjax.themes.child[t.value].Name),e("#ctc_child_author").val(ctcAjax.themes.child[t.value].Author),e("#ctc_child_version").val(ctcAjax.themes.child[t.value].Version))},set_query:function(t){var c=this;c.current_query=t,e("#ctc_sel_ovrd_query").val(""),e("#ctc_sel_ovrd_query_selected").text(t),e("#ctc_sel_ovrd_selector").val(""),e("#ctc_sel_ovrd_selector_selected").html(" "),c.load_selectors()},set_selector:function(t){var c=this;e("#ctc_sel_ovrd_selector").val(""),c.current_qsid=t,c.reload_menus=!1,c.load_selector_values()},set_rule:function(t,c){var n=this;e("#ctc_rule_menu").val(""),e("#ctc_rule_menu_selected").text(c),e(".ctc-rewrite-toggle").text(n.getxt("rename")),e("#ctc_rule_value_inputs, #ctc_input_row_rule_header").show(),n.query_css("rule_val",t)},set_qsid:function(t){var c=this;c.current_qsid=e(t).attr("id").match(/_(\d+)$/)[1],c.focus_panel("#query_selector_options"),c.reload_menus=!0,c.load_selector_values()},set_addl_css:function(){var t,c=this,n=e("#ctc_theme_parnt").val(),i=ctcAjax.theme_uri.replace(/^https?:\/\//,""),r=ctcAjax.homeurl.replace(/^https?/,ctcAjax.ssl?"https":"http"),a=r+"?preview=1&p=x&template="+n+"&stylesheet="+n,s=new RegExp("<link rel=[\"']stylesheet[\"'][^>]+?"+i+"/"+n+"/(.+?\\.css)[^>]+?>","g");c.is_empty(n)||(n!=ctcAjax.parnt?e.get(a,function(c){for(;(t=s.exec(c))&&"style.css"!=t[1];)t[1].match(/bootstrap/)||e(".ctc_checkbox").each(function(){e(this).val()==t[1]&&e(this).prop("checked",!0)});c=null}):e(ctcAjax.addl_css).each(function(t,c){e("#ctc_stylesheet_files .ctc_checkbox").each(function(){e(this).val()==c&&e(this).prop("checked",!0)})}))},query_css:function(t,c,n){var i=this,r={ctc_query_obj:t,ctc_query_key:c},a="#ctc_status_"+t+("val_qry"==t?"_"+c:"");"object"==typeof n&&e.each(n,function(e,t){r["ctc_query_"+e]=t}),e(".query-icon").remove(),e(a+" .ctc-status-icon").remove(),e(a).append('<span class="ctc-status-icon spinner query-icon"></span>'),e(".spinner").show(),r.action=i.is_empty(e("#ctc_action").val())||"plugin"!=e("#ctc_action").val()?"ctc_query":"ctc_plgqry",r._wpnonce=e("#_wpnonce").val(),i.ajax_post(t,r)},save:function(t){var c,n,i,r,a,s=this,l=(ctcAjax.ajaxurl,{}),o=e(t).attr("id");e(t).prop("disabled",!0),e(".ctc-status-icon").remove(),e(t).parent(".ctc-textarea-button-cell, .ctc-button-cell").append('<span class="ctc-status-icon spinner save-icon"></span>'),o.match(/ctc_configtype/)?(e(t).parents(".ctc-input-row").first().append('<span class="ctc-status-icon spinner save-icon"></span>'),l.ctc_configtype=e(t).val()):(c=e("#ctc_new_selectors"))&&"ctc_save_new_selectors"==e(t).attr("id")?(l.ctc_new_selectors=c.val(),(n=e("#ctc_sel_ovrd_query_selected"))&&(l.ctc_sel_ovrd_query=n.text()),s.reload_menus=!0):(i=e("#ctc_child_imports"))&&"ctc_save_imports"==e(t).attr("id")?l.ctc_child_imports=i.val():"ctc_is_debug"==e(t).attr("id")?l.ctc_is_debug=e("#ctc_is_debug").is(":checked")?1:0:l=s.coalesce_inputs(t),e(".save-icon").show(),e("#ctc_sel_ovrd_selector_selected").find("#ctc_rewrite_selector").each(function(){r=e("#ctc_rewrite_selector").val(),a=e("#ctc_rewrite_selector_orig").val(),s.is_empty(r)||!r.toString().match(/\w/)?r=a:(l.ctc_rewrite_selector=r,s.reload_menus=!0),e(".ctc-rewrite-toggle").text(s.getxt("rename")),e("#ctc_sel_ovrd_selector_selected").html(r)}),l.action=s.is_empty(e("#ctc_action").val())||"plugin"!=e("#ctc_action").val()?"ctc_update":"ctc_plugin",l._wpnonce=e("#_wpnonce").val(),s.ajax_post("qsid",l)},ajax_post:function(t,c,n){var i=this,r=ctcAjax.ajaxurl;e.ajax({url:r,data:c,dataType:i.is_empty(n)?"json":n,type:"POST"}).done(function(e){i.handle_success(t,e)}).fail(function(){i.handle_failure(t)})},handle_failure:function(t){var c=this;e(".query-icon, .save-icon").removeClass("spinner").addClass("failure"),e("input[type=submit], input[type=button]").prop("disabled",!1),e(".ajax-pending").removeClass("ajax-pending"),"preview"==t&&e("#view_parnt_options_panel,#view_child_options_panel").text(c.getxt("css_fail"))},handle_success:function(t,c){var n=this;e(".query-icon, .save-icon").removeClass("spinner"),e(".ajax-pending").removeClass("ajax-pending"),n.is_empty(c)?n.handle_failure(t):(e("#ctc_new_selectors").val(""),e(".query-icon, .save-icon").addClass("success"),e("input[type=submit], input[type=button]").prop("disabled",!1),e(c).each(function(){"function"==typeof n.update[this.obj]&&n.update[this.obj].call(n,this)}))},jquery_exception:function(e,t){var c=this,n=c.is_empty(e.lineNumber)?"":" line: "+e.lineNumber,i=c.is_empty(e.fileName)?"":" "+e.fileName.split(/\?/)[0];c.jquery_err.push("<code><small>"+t+": "+e.message+i+n+"</small></code>")},jquery_notice:function(){var t=this,c=[],n=[];e("input[type=submit], input[type=button]").prop("disabled",!0),e("script").each(function(){var n=e(this).prop("src");t.is_empty(n)||!n.match(/jquery(\.min|\.js|\-?ui)/i)||n.match(/load\-scripts.php/)||c.push("<code><small>"+n.split(/\?/)[0]+"</small></code>")}),n.push("<strong>"+t.getxt("js")+"</strong>"),n.push(t.jquery_err.join("<br/>")),c.length&&n.push(t.getxt("jquery")+"<br/>"+c.join("<br/>")),n.push(t.getxt("plugin")+" "+t.getxt("contact")),t.set_notice({error:n})},update:{qsid:function(t){var c,n,i,r=this;r.current_qsid=t.key,r.current_qsdata=t.data,e("#ctc_sel_ovrd_qsid").val(r.current_qsid),r.is_empty(r.current_qsdata.seq)?e("#ctc_child_load_order_container").empty():(c="ctc_ovrd_child_seq_"+r.current_qsid,i=parseInt(r.current_qsdata.seq),n='<input type="text" id="'+c+'" name="'+c+'" class="ctc-child-value" value="'+i+'" />',e("#ctc_child_load_order_container").html(n)),r.is_empty(r.current_qsdata.value)?(e("#ctc_sel_ovrd_rule_inputs").empty(),e("#ctc_sel_ovrd_rule_header").hide()):(n="",e.each(r.current_qsdata.value,function(e){n+=r.input_row(r.current_qsid,e,"ovrd",r.current_qsdata)}),e("#ctc_sel_ovrd_rule_inputs").html(n).find(".color-picker").each(function(){r.setup_iris(this)}),r.coalesce_inputs("#ctc_child_all_0_swatch"),e("#ctc_sel_ovrd_rule_header").show()),r.jquery_err.length?r.jquery_notice():(r.reload_menus&&(r.set_query(r.current_qsdata.query),r.load_rules()),e("#ctc_sel_ovrd_selector_selected").text(r.current_qsdata.selector),e(".ctc-rewrite-toggle").text(r.getxt("rename")),e("#ctc_sel_ovrd_new_rule,#ctc_sel_ovrd_rule_inputs_container,#ctc_sel_ovrd_rule_inputs,.ctc-rewrite-toggle").show())},rule_val:function(t){var c=this,n=e("#ctc_rule_menu_selected").text(),i='<div class="ctc-input-row clearfix" id="ctc_rule_row_'+n+'">\n';c.is_empty(t.data)||(e.each(t.data,function(e,t){var r=c.decode_value(n,t);i+='<div class="ctc-parent-row clearfix" id="ctc_rule_row_'+n+"_"+e+'">\n<div class="ctc-input-cell ctc-parent-value" id="ctc_'+e+"_parent_"+n+"_"+e+'">'+r.orig+'</div>\n<div class="ctc-input-cell">\n<div class="ctc-swatch ctc-specific" id="ctc_'+e+"_parent_"+n+"_"+e+'_swatch">'+c.getxt("swatch")+'</div></div>\n<div class="ctc-input-cell"><a href="#" class="ctc-selector-handle" id="ctc_selector_'+n+"_"+e+'">'+c.getxt("selector")+'</a></div>\n<div id="ctc_selector_'+n+"_"+e+'_container" class="ctc-selector-container">\n<a href="#" id="ctc_selector_'+n+"_"+e+'_close" class="ctc-selector-handle ctc-exit" title="'+c.getxt("close")+'"></a><div id="ctc_selector_'+n+"_"+e+'_inner_container" class="ctc-selector-inner-container clearfix">\n<div id="ctc_status_val_qry_'+e+'"></div>\n<div id="ctc_selector_'+n+"_"+e+'_rows"></div>\n</div></div></div>\n'}),i+="</div>\n"),e("#ctc_rule_value_inputs").html(i).find(".ctc-swatch").each(function(){c.coalesce_inputs(this)})},val_qry:function(t){var c=this,n="";c.is_empty(t.data)||e.each(t.data,function(i,r){page_rule=i,e.each(r,function(r,a){n+='<h4 class="ctc-query-heading">'+r+"</h4>\n",c.is_empty(a)||e.each(a,function(e,r){n+=c.input_row(e,i,t.key,r)})})}),selector="#ctc_selector_"+rule+"_"+t.key+"_rows",e(selector).html(n).find(".color-picker").each(function(){c.setup_iris(this)}),e(selector).find(".ctc-swatch").each(function(){c.coalesce_inputs(this)}),c.jquery_err.length&&c.jquery_notice()},queries:function(t){e("#ctc_sel_ovrd_query").data("menu",t.data)},selectors:function(t){e("#ctc_sel_ovrd_selector").data("menu",t.data)},rules:function(t){e("#ctc_rule_menu").data("menu",t.data)},debug:function(t){e("#ctc_debug_container").html(t.data)},preview:function(t){e("#view_"+t.key+"_options_panel").text(t.data)}},init:function(){var t=this;if(t.autogen_slugs(),t.set_existing(),!e("#ctc_theme_parnt").is("input")){try{e.widget("ctc.themeMenu",e.ui.selectmenu,{_renderItem:function(t,c){var n=e("<li>");return e("#ctc_theme_option_"+c.value).detach().appendTo(n),n.appendTo(t)}})}catch(c){t.jquery_exception(c,"Theme Menu")}try{e("#ctc_theme_parnt").themeMenu({select:function(e,c){t.set_parent_menu(c.item)}})}catch(c){"function"==typeof themeMenu?e("#ctc_theme_parnt").themeMenu("destroy"):e("#ctc_theme_parnt-button").remove(),t.jquery_exception(c,"Parent Theme Menu")}if(t.is_empty(ctcAjax.themes.child))e("#ctc_child_name").length&&(e("#ctc_child_name").val(t.testname),e("#ctc_child_template").val(t.testslug));else try{e("#ctc_theme_child").themeMenu({select:function(e,c){t.set_child_menu(c.item)}})}catch(c){"function"==typeof themeMenu?e("#ctc_theme_child").themeMenu("destroy"):e("#ctc_theme_child-button").remove(),t.jquery_exception(c,"Child Theme Menu")}}t.is_empty(t.jquery_err)?(e("#ctc_main").on("focus",".color-picker",function(){try{e(".color-picker").not(this).iris("hide"),e(this).iris("toggle"),e(".iris-picker").css({position:"absolute","z-index":10})}catch(c){t.jquery_exception(c,"Iris Color Picker")}}),e("#ctc_main").on("change",".ctc-child-value, input[type=checkbox]",function(){t.coalesce_inputs(this)}),e("#ctc_main").on("click",".ctc-selector-handle",function(c){if(c.preventDefault(),e(this).hasClass("ajax-pending"))return!1;e(this).addClass("ajax-pending");var n=e(this).attr("id").toString().replace("_close",""),i=n.toString().match(/_([^_]+)_(\d+)$/);e("#"+n+"_container").is(":hidden")&&(t.is_empty(i[1])||t.is_empty(i[2])||(rule=i[1],valid=i[2],t.query_css("val_qry",valid,{rule:rule}))),e("#"+n+"_container").fadeToggle("fast"),e(".ctc-selector-container").not("#"+n+"_container").fadeOut("fast")}),e("#ctc_main").on("click",".ctc-save-input[type=button]",function(){return e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),void t.save(this))}),e("#ctc_main").on("click",".ctc-selector-edit",function(c){return c.preventDefault(),e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),void t.set_qsid(this))}),e("#ctc_main").on("click",".ctc-rewrite-toggle",function(e){e.preventDefault(),t.selector_input_toggle(this)}),e("#ctc_main").on("click","#ctc_copy_selector",function(){var c=e("#ctc_sel_ovrd_selector_selected").text().trim();t.is_empty(c)||e("#ctc_new_selectors").val(e("#ctc_new_selectors").val()+"\n"+c+" {\n\n}")}),e("#ctc_configtype").on("change",function(){var c=e(this).val();if(t.is_empty(c)||"theme"==c){e(".ctc-theme-only, .ctc-themeonly-container").removeClass("ctc-disabled"),e(".ctc-theme-only, .ctc-themeonly-container input").prop("disabled",!1);try{e("#ctc_theme_parnt, #ctc_theme_child").themeMenu("enable")}catch(n){t.jquery_exception(n,"Theme Menu")}}else{e(".ctc-theme-only, .ctc-themeonly-container").addClass("ctc-disabled"),e(".ctc-theme-only, .ctc-themeonly-container input").prop("disabled",!0);try{e("#ctc_theme_parnt, #ctc_theme_child").themeMenu("disable")}catch(n){t.jquery_exception(n,"Theme Menu")}}}),e(".nav-tab").on("click",function(c){c.preventDefault(),e(".ctc-status-icon").remove();var n="#"+e(this).attr("id");t.focus_panel(n)}),e(".ctc-section-toggle").on("click",function(){e(this).toggleClass("open");var t=e(this).attr("id")+"_content";e("#"+t).slideToggle("fast")}),e("#view_child_options, #view_parnt_options").on("click",function(){return e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),void t.css_preview(e(this).attr("id")))}),e("#ctc_load_form").on("submit",function(){return t.validate()}),e("#ctc_query_selector_form").on("submit",function(c){return c.preventDefault(),$this=e("#ctc_save_query_selector"),$this.hasClass("ajax-pending")?!1:($this.addClass("ajax-pending"),t.save($this),!1)}),e("#ctc_theme_child, #ctc_theme_child-button, #ctc_child_type_existing").on("focus click",function(){e("#ctc_child_type_existing").prop("checked",!0),e("#ctc_child_type_new").prop("checked",!1),e("#ctc_child_template").val(""),t.set_existing()}),e("#ctc_child_type_new, #ctc_child_template").on("focus click",function(){e("#ctc_child_type_existing").prop("checked",!1),e("#ctc_child_type_new").prop("checked",!0),e("#ctc_child_name").val(t.testname),e("#ctc_child_template").val(t.testslug)}),e("#ctc_is_debug").on("change",function(){t.save(this)}),e(".ctc-live-preview").on("click",function(t){return t.stopImmediatePropagation(),t.preventDefault(),document.location=e(this).prop("href"),!1}),t.setup_menus(),t.set_addl_css(),e("input[type=submit], input[type=button]").prop("disabled",!1),t.scrolltop(),setTimeout(t.fade_update_notice,2e4)):t.jquery_notice()},testslug:"",testname:"",reload_menus:!1,current_query:"base",current_qsid:null,current_qsdata:{},jquery_err:[]}}(jQuery),jQuery(document).ready(function(e){e.chldthmcfg.init()});
|
1 |
+
!function(e){e.chldthmcfg={esc_quot:function(e){var t=this;return t.is_empty(e)?e:e.toString().replace(/"/g,""")},getxt:function(e){return(text=ctcAjax[e+"_txt"])?text:""},from_ascii:function(e){var t=parseInt(e),c=String.fromCharCode(t);return c},to_ascii:function(e){var t=e.charCodeAt(0);return t},is_empty:function(e){if("undefined"==typeof e||!1===e||null===e||""===e)return!0;if(!0===e||"string"==typeof e||"number"==typeof e)return!1;if("object"==typeof e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}return!1},theme_exists:function(t,c){var n=!1;return e.each(ctcAjax.themes,function(i,r){return e.each(r,function(e){return e!=t||"parnt"!=i&&"new"!=c?void 0:(n=!0,!1)}),n?!1:void 0}),n},validate:function(){var t=this,c=/[^\w\-]/,n=e("#ctc_child_template").length?e("#ctc_child_template").val().toString().replace(c).toLowerCase():"",i=e("#ctc_theme_child").length?e("#ctc_theme_child").val().toString().replace(c).toLowerCase():n,r=e("input[name=ctc_child_type]:checked").val(),a=[];return"new"==r&&(i=n),t.theme_exists(i,r)&&a.push(t.getxt("theme_exists").toString().replace(/%s/,i)),""===i&&a.push(t.getxt("inval_theme")),""===e("#ctc_child_name").val()&&a.push(t.getxt("inval_name")),a.length?(t.set_notice({error:a}),!1):!0},autogen_slugs:function(){if(e("#ctc_theme_parnt").length){for(var t=this,c=e("#ctc_theme_parnt").val(),n=slugbase=c+"-child",i=ctcAjax.themes.parnt[c].Name+" Child",r="",a="",s="00";t.theme_exists(n,"new");)r=""==r?2:r+1,a=s.substring(0,s.length-r.toString().length)+r.toString(),n=slugbase+a;t.testslug=n,t.testname=i+(a.length?" "+a:"")}},focus_panel:function(t){var c=t+"_panel";e(".nav-tab").removeClass("nav-tab-active"),e(".ctc-option-panel").removeClass("ctc-option-panel-active"),e(".ctc-selector-container").hide(),e(t).addClass("nav-tab-active"),e(".ctc-option-panel-container").scrollTop(0),e(c).addClass("ctc-option-panel-active")},selector_input_toggle:function(t){var c,n=this;e("#ctc_rewrite_selector").length?(c=e("#ctc_rewrite_selector_orig").val(),e("#ctc_sel_ovrd_selector_selected").text(c),e(t).text(n.getxt("rename"))):(c=e("#ctc_sel_ovrd_selector_selected").text(),e("#ctc_sel_ovrd_selector_selected").html('<textarea id="ctc_rewrite_selector" name="ctc_rewrite_selector" autocomplete="off"></textarea><input id="ctc_rewrite_selector_orig" name="ctc_rewrite_selector_orig" type="hidden" value="'+n.esc_quot(c)+'"/>'),e("#ctc_rewrite_selector").val(c),e(t).text(n.getxt("cancel")))},fade_update_notice:function(){e(".updated, .error").slideUp("slow",function(){e(".updated").remove()})},coalesce_inputs:function(t){var c=this,n=/^(ctc_(ovrd|\d+)_(parent|child)_([0-9a-z\-]+)_(\d+))(_\w+)?$/,i=e(t).parents(".ctc-selector-row, .ctc-parent-row").first(),r=i.find(".ctc-swatch").first(),a={parent:{},child:{}},s={parent:{origin:"",start:"",end:""},child:{origin:"",start:"",end:""}},l={child:!1,parent:!1},o={};return i.find(".ctc-parent-value, .ctc-child-value").each(function(){var i,r,_=e(this).attr("id"),u=_.toString().match(n),d=u[2],p=u[3],h="undefined"==typeof u[4]?"":u[4],m=u[5],v="undefined"==typeof u[6]?"":u[6],f="parent"==p?e(this).text().replace(/!$/,""):e(this).val(),g="ctc_"+d+"_child_"+h+"_i_"+m;if(c.is_empty(e(this).data("color"))||(f=e(this).data("color"),e(this).data("color",null)),"child"==p&&(o[_]=f,o[g]=e("#"+g).is(":checked")?1:0),""!=f)if(c.is_empty(v))(i=h.toString().match(/^border(\-(top|right|bottom|left))?$/)&&!f.match(/none/))?(r=f.toString().split(/ +/),a[p][h+"-width"]="undefined"==typeof r[0]?"":r[0],a[p][h+"-style"]="undefined"==typeof r[1]?"":r[1],a[p][h+"-color"]="undefined"==typeof r[2]?"":r[2]):"background-image"!=h||f.match(/none/)?"seq"!=h&&(a[p][h]=f):f.toString().match(/url\(/)?a[p]["background-image"]=c.image_url(p,f):(r=f.toString().split(/ +/),r.length>2?(s[p].origin="undefined"==typeof r[0]?"top":r[0],s[p].start="undefined"==typeof r[1]?"transparent":r[1],s[p].end="undefined"==typeof r[2]?"transparent":r[2],l[p]=!0):a[p]["background-image"]=f);else switch(v){case"_border_width":a[p][h+"-width"]="none"==f?0:f;break;case"_border_style":a[p][h+"-style"]=f;break;case"_border_color":a[p][h+"-color"]=f;break;case"_background_url":a[p]["background-image"]=c.image_url(p,f);break;case"_background_color":a[p]["background-color"]=t.value;break;case"_background_color1":s[p].start=f,l[p]=!0;break;case"_background_color2":s[p].end=f,l[p]=!0;break;case"_background_origin":s[p].origin=f,l[p]=!0}}),"undefined"==typeof r||c.is_empty(r.attr("id"))||(r.removeAttr("style"),l.parent&&r.ctcgrad(s.parent.origin,[s.parent.start,s.parent.end]),r.css(a.parent),r.attr("id").toString().match(/parent/)||(l.child&&r.ctcgrad(s.child.origin,[s.child.start,s.child.end]),r.css(a.child)),r.css({"z-index":-1})),o},decode_value:function(e,t){t="undefined"==typeof t?"":t;var c=this,n={orig:t};if(e.toString().match(/^border(\-(top|right|bottom|left))?$/)){var i=t.toString().split(/ +/);n.names=["_border_width","_border_style","_border_color"],n.values=["undefined"==typeof i[0]?"":i[0],"undefined"==typeof i[1]?"":i[1],"undefined"==typeof i[2]?"":i[2]]}else if(e.toString().match(/^background\-image/))if(n.names=["_background_url","_background_origin","_background_color1","_background_color2"],n.values=["","","",""],!1!==c.is_empty(t)||t.toString().match(/(url|none)/))n.values[0]=t;else{var i=t.toString().split(/:/);n.values[1]="undefined"==typeof i[0]?"":i[0],n.values[2]="undefined"==typeof i[1]?"":i[1],n.values[3]="undefined"==typeof i[3]?"":i[3],n.orig=[n.values[1],n.values[2],n.values[3]].join(" ")}else n.names=[""],n.values=[t];return n},image_url:function(e,t){var c,n=this,i=t.toString().match(/url\(['" ]*(.+?)['" ]*\)/),r=n.is_empty(i)?null:i[1],a=ctcAjax.theme_uri+"/"+("parent"==e?ctcAjax.parnt:ctcAjax.child)+"/";return r?c=r.toString().match(/^(data:|https?:|\/)/)?t:"url("+a+r+")":!1},setup_menus:function(){var e=this;e.setup_query_menu(),e.setup_selector_menu(),e.setup_rule_menu(),e.setup_new_rule_menu(),e.load_queries(),e.load_rules(),e.set_query(e.current_query)},load_queries:function(){var e=this;e.query_css("queries",null)},load_selectors:function(){var e=this;e.query_css("selectors",e.current_query)},load_rules:function(){var e=this;e.query_css("rules",null)},load_selector_values:function(){var e=this;e.query_css("qsid",e.current_qsid)},get_queries:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.each(this.element.data("menu"),function(e,t){i.test(t)&&n.push({label:t,value:t})}),c(n)},get_selectors:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.each(this.element.data("menu"),function(e,t){i.test(e)&&n.push({label:e,value:t})}),c(n)},get_rules:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.each(this.element.data("menu"),function(e,t){i.test(e)&&n.push({label:e,value:t})}),c(n)},get_filtered_rules:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i"),r=e.chldthmcfg.current_qsdata,a=e.chldthmcfg.is_empty(r)||e.chldthmcfg.is_empty(r.value);e.each(e("#ctc_rule_menu").data("menu"),function(t,c){var s=!1;if(i.test(t)){if(!a&&(e.each(r.value,function(e){return t==e.replace(/\d+/g,self.from_ascii)?(s=!0,!1):void 0}),s))return;n.push({label:t,value:c})}}),c(n)},input_row:function(t,c,n,i){var r=this,a="",s=r.is_empty(i)||r.is_empty(i.value)||r.is_empty(i.value[c])?"":i.value[c],l=r.decode_value(c,r.is_empty(s)?"":s.parnt),o=r.is_empty(s)||r.is_empty(s.i_parnt)||1!=s.i_parnt?"":r.getxt("important"),_=r.decode_value(c,r.is_empty(s)?"":s.child),u=r.is_empty(s)||r.is_empty(s.i_child)||1!=s.i_child?0:1,d="ctc_"+n+"_child_"+c+"_i_"+t;return r.is_empty(i)||(a+='<div class="ctc-'+("ovrd"==n?"input":"selector")+'-row clearfix">\n<div class="ctc-input-cell">'+("ovrd"==n?c.replace(/\d+/g,r.from_ascii):i.selector+'<br/><a href="#" class="ctc-selector-edit" id="ctc_selector_edit_'+t+'" >'+r.getxt("edit")+"</a> "+(r.is_empty(l.orig)?r.getxt("child_only"):""))+"</div>\n","ovrd"==n&&(a+='<div class="ctc-parent-value ctc-input-cell" id="ctc_'+n+"_parent_"+c+"_"+t+'">'+(r.is_empty(l.orig)?"[no value]":l.orig+o)+"</div>\n"),a+='<div class="ctc-input-cell">\n',r.is_empty(l.names)||(e.each(l.names,function(e,i){i=r.is_empty(i)?"":i,a+='<div class="ctc-child-input-cell">\n';var s,l="ctc_"+n+"_child_"+c+"_"+t+i;!1===(s=_.values.shift())&&(s=""),a+=(r.is_empty(i)?"":r.getxt(i)+":<br/>")+'<input type="text" id="'+l+'" name="'+l+'" class="ctc-child-value'+((i+c).toString().match(/color/)?" color-picker":"")+(i.toString().match(/url/)?" ctc-input-wide":"")+'" value="'+r.esc_quot(s)+'" />\n</div>\n'}),a+='<label for="'+d+'"><input type="checkbox" id="'+d+'" name="'+d+'" value="1" '+(1===u?"checked":"")+" />"+r.getxt("important")+"</label>\n"),a+="</div>\n"+("ovrd"==n?"":'<div class="ctc-swatch ctc-specific" id="ctc_child_'+c+"_"+t+'_swatch">'+r.getxt("swatch")+'</div>\n<div class="ctc-child-input-cell ctc-button-cell" id="ctc_save_'+c+"_"+t+'_cell">\n<input type="button" class="button ctc-save-input" id="ctc_save_'+c+"_"+t+'" name="ctc_save_'+c+"_"+t+'" value="Save" /></div>\n')+"</div><!-- end input row -->\n"),a},scrolltop:function(){e("html, body, .ctc-option-panel-container").animate({scrollTop:0})},css_preview:function(e){var e,t=this;(e=e.match(/(child|parnt)/)[1])||(e="child"),t.query_css("preview",e)},setup_iris:function(t){var c=this;try{e(t).iris({change:function(n,i){e(t).data("color",i.color.toString()),c.coalesce_inputs(t)}})}catch(n){c.jquery_exception(n,"Iris Color Picker")}},setup_query_menu:function(){var t=this;try{e("#ctc_sel_ovrd_query").autocomplete({source:t.get_queries,minLength:0,selectFirst:!0,autoFocus:!0,select:function(e,c){return t.set_query(c.item.value),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Query Menu")}},setup_selector_menu:function(){var t=this;try{e("#ctc_sel_ovrd_selector").autocomplete({source:t.get_selectors,selectFirst:!0,autoFocus:!0,select:function(e,c){return t.set_selector(c.item.value,c.item.label),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Selector Menu")}},setup_rule_menu:function(){var t=this;try{e("#ctc_rule_menu").autocomplete({source:t.get_rules,selectFirst:!0,autoFocus:!0,select:function(e,c){return t.set_rule(c.item.value,c.item.label),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"Rule Menu")}},setup_new_rule_menu:function(){var t=this;try{e("#ctc_new_rule_menu").autocomplete({source:t.get_filtered_rules,selectFirst:!0,autoFocus:!0,select:function(c,n){c.preventDefault(),t.is_empty(t.current_qsdata.value)&&(t.current_qsdata.value={}),t.current_qsdata.value[n.item.label]={child:""};var i,r=n.item.label.replace(/[^\w\-]/g,t.to_ascii),a=e(t.input_row(t.current_qsid,r,"ovrd",t.current_qsdata));return e("#ctc_sel_ovrd_rule_inputs").append(a),e("#ctc_new_rule_menu").val(""),a.find('input[type="text"]').each(function(c,n){i||(i=n),e(n).hasClass("color-picker")&&t.setup_iris(n)}),i&&e(i).focus(),t.jquery_err.length&&t.jquery_notice(),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"New Rule Menu")}},set_existing:function(){var t=this;if(e("#ctc_theme_child").length&&e("#ctc_child_type_existing").is(":checked")){var c=e("#ctc_theme_child").val();t.is_empty(c)||(e("#ctc_child_name").val(ctcAjax.themes.child[c].Name),e("#ctc_child_author").val(ctcAjax.themes.child[c].Author),e("#ctc_child_version").val(ctcAjax.themes.child[c].Version),e("#ctc_child_authoruri").val(ctcAjax.themes.child[c].AuthorURI),e("#ctc_child_themeuri").val(ctcAjax.themes.child[c].ThemeURI),e("#ctc_child_descr").val(ctcAjax.themes.child[c].Descr),e("#ctc_child_tags").val(ctcAjax.themes.child[c].Tags))}},set_notice:function(t){var c=this,n="";c.is_empty(t)||e.each(t,function(t,c){n+='<div class="'+t+'"><ul>\n',e(c).each(function(e,t){n+="<li>"+t.toString()+"</li>\n"}),n+="</ul></div>"}),e("#ctc_error_notice").html(n),e("html, body").animate({scrollTop:0},"slow")},set_parent_menu:function(t){e("#ctc_theme_parent").parents(".ctc-input-row").first().append('<span class="ctc-status-icon spinner"></span>'),e(".spinner").show(),document.location="?page="+ctcAjax.page+"&ctc_parent="+t.value},set_child_menu:function(t){var c=this;c.is_empty(ctcAjax.themes.child[t.value])||(e("#ctc_child_name").val(ctcAjax.themes.child[t.value].Name),e("#ctc_child_author").val(ctcAjax.themes.child[t.value].Author),e("#ctc_child_version").val(ctcAjax.themes.child[t.value].Version))},set_query:function(t){var c=this;c.current_query=t,e("#ctc_sel_ovrd_query").val(""),e("#ctc_sel_ovrd_query_selected").text(t),e("#ctc_sel_ovrd_selector").val(""),e("#ctc_sel_ovrd_selector_selected").html(" "),c.load_selectors()},set_selector:function(t){var c=this;e("#ctc_sel_ovrd_selector").val(""),c.current_qsid=t,c.reload_menus=!1,c.load_selector_values()},set_rule:function(t,c){var n=this;e("#ctc_rule_menu").val(""),e("#ctc_rule_menu_selected").text(c),e(".ctc-rewrite-toggle").text(n.getxt("rename")),e("#ctc_rule_value_inputs, #ctc_input_row_rule_header").show(),n.query_css("rule_val",t)},set_qsid:function(t){var c=this;c.current_qsid=e(t).attr("id").match(/_(\d+)$/)[1],c.focus_panel("#query_selector_options"),c.reload_menus=!0,c.load_selector_values()},set_addl_css:function(){var t,c=this,n=e("#ctc_theme_parnt").val(),i=ctcAjax.theme_uri.replace(/^https?:\/\//,""),r=ctcAjax.homeurl.replace(/^https?/,ctcAjax.ssl?"https":"http"),a=r+"?preview=1&p=x&template="+n+"&stylesheet="+n,s=new RegExp("<link rel=[\"']stylesheet[\"'][^>]+?"+i+"/"+n+"/(.+?\\.css)[^>]+?>","g");c.is_empty(n)||(n!=ctcAjax.parnt?e.get(a,function(c){for(;(t=s.exec(c))&&"style.css"!=t[1];)t[1].match(/bootstrap/)||e(".ctc_checkbox").each(function(){e(this).val()==t[1]&&e(this).prop("checked",!0)});c=null}):e(ctcAjax.addl_css).each(function(t,c){e("#ctc_stylesheet_files .ctc_checkbox").each(function(){e(this).val()==c&&e(this).prop("checked",!0)})}))},query_css:function(t,c,n){var i=this,r={ctc_query_obj:t,ctc_query_key:c},a="#ctc_status_"+t+("val_qry"==t?"_"+c:"");"object"==typeof n&&e.each(n,function(e,t){r["ctc_query_"+e]=t}),e(".query-icon").remove(),e(a+" .ctc-status-icon").remove(),e(a).append('<span class="ctc-status-icon spinner query-icon"></span>'),e(".spinner").show(),r.action=i.is_empty(e("#ctc_action").val())||"plugin"!=e("#ctc_action").val()?"ctc_query":"ctc_plgqry",r._wpnonce=e("#_wpnonce").val(),i.ajax_post(t,r)},save:function(t){var c,n,i,r,a,s=this,l=(ctcAjax.ajaxurl,{}),o=e(t).attr("id");e(t).prop("disabled",!0),e(".ctc-status-icon").remove(),e(t).parent(".ctc-textarea-button-cell, .ctc-button-cell").append('<span class="ctc-status-icon spinner save-icon"></span>'),o.match(/ctc_configtype/)?(e(t).parents(".ctc-input-row").first().append('<span class="ctc-status-icon spinner save-icon"></span>'),l.ctc_configtype=e(t).val()):(c=e("#ctc_new_selectors"))&&"ctc_save_new_selectors"==e(t).attr("id")?(l.ctc_new_selectors=c.val(),(n=e("#ctc_sel_ovrd_query_selected"))&&(l.ctc_sel_ovrd_query=n.text()),s.reload_menus=!0):(i=e("#ctc_child_imports"))&&"ctc_save_imports"==e(t).attr("id")?l.ctc_child_imports=i.val():"ctc_is_debug"==e(t).attr("id")?l.ctc_is_debug=e("#ctc_is_debug").is(":checked")?1:0:l=s.coalesce_inputs(t),e(".save-icon").show(),e("#ctc_sel_ovrd_selector_selected").find("#ctc_rewrite_selector").each(function(){r=e("#ctc_rewrite_selector").val(),a=e("#ctc_rewrite_selector_orig").val(),s.is_empty(r)||!r.toString().match(/\w/)?r=a:(l.ctc_rewrite_selector=r,s.reload_menus=!0),e(".ctc-rewrite-toggle").text(s.getxt("rename")),e("#ctc_sel_ovrd_selector_selected").html(r)}),l.action=s.is_empty(e("#ctc_action").val())||"plugin"!=e("#ctc_action").val()?"ctc_update":"ctc_plugin",l._wpnonce=e("#_wpnonce").val(),s.ajax_post("qsid",l)},ajax_post:function(t,c,n){var i=this,r=ctcAjax.ajaxurl;e.ajax({url:r,data:c,dataType:i.is_empty(n)?"json":n,type:"POST"}).done(function(e){i.handle_success(t,e)}).fail(function(){i.handle_failure(t)})},handle_failure:function(t){var c=this;e(".query-icon, .save-icon").removeClass("spinner").addClass("failure"),e("input[type=submit], input[type=button]").prop("disabled",!1),e(".ajax-pending").removeClass("ajax-pending"),"preview"==t&&e("#view_parnt_options_panel,#view_child_options_panel").text(c.getxt("css_fail"))},handle_success:function(t,c){var n=this;e(".query-icon, .save-icon").removeClass("spinner"),e(".ajax-pending").removeClass("ajax-pending"),n.is_empty(c)?n.handle_failure(t):(e("#ctc_new_selectors").val(""),e(".query-icon, .save-icon").addClass("success"),e("input[type=submit], input[type=button]").prop("disabled",!1),e(c).each(function(){"function"==typeof n.update[this.obj]&&n.update[this.obj].call(n,this)}))},jquery_exception:function(e,t){var c=this,n=c.is_empty(e.lineNumber)?"":" line: "+e.lineNumber,i=c.is_empty(e.fileName)?"":" "+e.fileName.split(/\?/)[0];c.jquery_err.push("<code><small>"+t+": "+e.message+i+n+"</small></code>")},jquery_notice:function(){var t=this,c=[],n=[];e("input[type=submit], input[type=button]").prop("disabled",!0),e("script").each(function(){var n=e(this).prop("src");t.is_empty(n)||!n.match(/jquery(\.min|\.js|\-?ui)/i)||n.match(/load\-scripts.php/)||c.push("<code><small>"+n.split(/\?/)[0]+"</small></code>")}),n.push("<strong>"+t.getxt("js")+"</strong> "+t.getxt("contact")),1==ctcAjax.is_debug&&n.push(t.jquery_err.join("<br/>")),c.length&&n.push(t.getxt("jquery")+"<br/>"+c.join("<br/>")),n.push(t.getxt("plugin")),t.set_notice({error:n})},update:{qsid:function(t){var c,n,i,r=this;r.current_qsid=t.key,r.current_qsdata=t.data,e("#ctc_sel_ovrd_qsid").val(r.current_qsid),r.is_empty(r.current_qsdata.seq)?e("#ctc_child_load_order_container").empty():(c="ctc_ovrd_child_seq_"+r.current_qsid,i=parseInt(r.current_qsdata.seq),n='<input type="text" id="'+c+'" name="'+c+'" class="ctc-child-value" value="'+i+'" />',e("#ctc_child_load_order_container").html(n)),r.is_empty(r.current_qsdata.value)?(e("#ctc_sel_ovrd_rule_inputs").empty(),e("#ctc_sel_ovrd_rule_header").hide()):(n="",e.each(r.current_qsdata.value,function(e){n+=r.input_row(r.current_qsid,e,"ovrd",r.current_qsdata)}),e("#ctc_sel_ovrd_rule_inputs").html(n).find(".color-picker").each(function(){r.setup_iris(this)}),r.coalesce_inputs("#ctc_child_all_0_swatch"),e("#ctc_sel_ovrd_rule_header").show()),r.jquery_err.length?r.jquery_notice():(r.reload_menus&&(r.set_query(r.current_qsdata.query),r.load_rules()),e("#ctc_sel_ovrd_selector_selected").text(r.current_qsdata.selector),e(".ctc-rewrite-toggle").text(r.getxt("rename")),e("#ctc_sel_ovrd_new_rule,#ctc_sel_ovrd_rule_inputs_container,#ctc_sel_ovrd_rule_inputs,.ctc-rewrite-toggle").show())},rule_val:function(t){var c=this,n=e("#ctc_rule_menu_selected").text(),i='<div class="ctc-input-row clearfix" id="ctc_rule_row_'+n+'">\n';c.is_empty(t.data)||(e.each(t.data,function(e,t){var r=c.decode_value(n,t);i+='<div class="ctc-parent-row clearfix" id="ctc_rule_row_'+n+"_"+e+'">\n<div class="ctc-input-cell ctc-parent-value" id="ctc_'+e+"_parent_"+n+"_"+e+'">'+r.orig+'</div>\n<div class="ctc-input-cell">\n<div class="ctc-swatch ctc-specific" id="ctc_'+e+"_parent_"+n+"_"+e+'_swatch">'+c.getxt("swatch")+'</div></div>\n<div class="ctc-input-cell"><a href="#" class="ctc-selector-handle" id="ctc_selector_'+n+"_"+e+'">'+c.getxt("selector")+'</a></div>\n<div id="ctc_selector_'+n+"_"+e+'_container" class="ctc-selector-container">\n<a href="#" id="ctc_selector_'+n+"_"+e+'_close" class="ctc-selector-handle ctc-exit" title="'+c.getxt("close")+'"></a><div id="ctc_selector_'+n+"_"+e+'_inner_container" class="ctc-selector-inner-container clearfix">\n<div id="ctc_status_val_qry_'+e+'"></div>\n<div id="ctc_selector_'+n+"_"+e+'_rows"></div>\n</div></div></div>\n'}),i+="</div>\n"),e("#ctc_rule_value_inputs").html(i).find(".ctc-swatch").each(function(){c.coalesce_inputs(this)})},val_qry:function(t){var c=this,n="";c.is_empty(t.data)||e.each(t.data,function(i,r){page_rule=i,e.each(r,function(r,a){n+='<h4 class="ctc-query-heading">'+r+"</h4>\n",c.is_empty(a)||e.each(a,function(e,r){n+=c.input_row(e,i,t.key,r)})})}),selector="#ctc_selector_"+rule+"_"+t.key+"_rows",e(selector).html(n).find(".color-picker").each(function(){c.setup_iris(this)}),e(selector).find(".ctc-swatch").each(function(){c.coalesce_inputs(this)}),c.jquery_err.length&&c.jquery_notice()},queries:function(t){e("#ctc_sel_ovrd_query").data("menu",t.data)},selectors:function(t){e("#ctc_sel_ovrd_selector").data("menu",t.data)},rules:function(t){e("#ctc_rule_menu").data("menu",t.data)},debug:function(t){e("#ctc_debug_container").html(t.data)},preview:function(t){e("#view_"+t.key+"_options_panel").text(t.data)}},init:function(){var t=this;if(t.autogen_slugs(),t.set_existing(),!e("#ctc_theme_parnt").is("input")){try{e.widget("ctc.themeMenu",e.ui.selectmenu,{_renderItem:function(t,c){var n=e("<li>");return e("#ctc_theme_option_"+c.value).detach().appendTo(n),n.appendTo(t)}})}catch(c){t.jquery_exception(c,"Theme Menu")}try{e("#ctc_theme_parnt").themeMenu({select:function(e,c){t.set_parent_menu(c.item)}})}catch(c){"function"==typeof themeMenu?e("#ctc_theme_parnt").themeMenu("destroy"):e("#ctc_theme_parnt-button").remove(),t.jquery_exception(c,"Parent Theme Menu")}if(t.is_empty(ctcAjax.themes.child))e("#ctc_child_name").length&&(e("#ctc_child_name").val(t.testname),e("#ctc_child_template").val(t.testslug));else try{e("#ctc_theme_child").themeMenu({select:function(e,c){t.set_child_menu(c.item)}})}catch(c){"function"==typeof themeMenu?e("#ctc_theme_child").themeMenu("destroy"):e("#ctc_theme_child-button").remove(),t.jquery_exception(c,"Child Theme Menu")}}t.is_empty(t.jquery_err)?(e("#ctc_main").on("focus",".color-picker",function(){try{e(".color-picker").not(this).iris("hide"),e(this).iris("toggle"),e(".iris-picker").css({position:"absolute","z-index":10})}catch(c){t.jquery_exception(c,"Iris Color Picker")}}),e("#ctc_main").on("change",".ctc-child-value, input[type=checkbox]",function(){t.coalesce_inputs(this)}),e("#ctc_main").on("click",".ctc-selector-handle",function(c){if(c.preventDefault(),e(this).hasClass("ajax-pending"))return!1;e(this).addClass("ajax-pending");var n=e(this).attr("id").toString().replace("_close",""),i=n.toString().match(/_([^_]+)_(\d+)$/);e("#"+n+"_container").is(":hidden")&&(t.is_empty(i[1])||t.is_empty(i[2])||(rule=i[1],valid=i[2],t.query_css("val_qry",valid,{rule:rule}))),e("#"+n+"_container").fadeToggle("fast"),e(".ctc-selector-container").not("#"+n+"_container").fadeOut("fast")}),e("#ctc_main").on("click",".ctc-save-input[type=button]",function(){return e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),void t.save(this))}),e("#ctc_main").on("click",".ctc-selector-edit",function(c){return c.preventDefault(),e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),void t.set_qsid(this))}),e("#ctc_main").on("click",".ctc-rewrite-toggle",function(e){e.preventDefault(),t.selector_input_toggle(this)}),e("#ctc_main").on("click","#ctc_copy_selector",function(){var c=e("#ctc_sel_ovrd_selector_selected").text().trim();t.is_empty(c)||e("#ctc_new_selectors").val(e("#ctc_new_selectors").val()+"\n"+c+" {\n\n}")}),e("#ctc_configtype").on("change",function(){var c=e(this).val();if(t.is_empty(c)||"theme"==c){e(".ctc-theme-only, .ctc-themeonly-container").removeClass("ctc-disabled"),e(".ctc-theme-only, .ctc-themeonly-container input").prop("disabled",!1);try{e("#ctc_theme_parnt, #ctc_theme_child").themeMenu("enable")}catch(n){t.jquery_exception(n,"Theme Menu")}}else{e(".ctc-theme-only, .ctc-themeonly-container").addClass("ctc-disabled"),e(".ctc-theme-only, .ctc-themeonly-container input").prop("disabled",!0);try{e("#ctc_theme_parnt, #ctc_theme_child").themeMenu("disable")}catch(n){t.jquery_exception(n,"Theme Menu")}}}),e(".nav-tab").on("click",function(c){c.preventDefault(),e(".ctc-status-icon").remove();var n="#"+e(this).attr("id");t.focus_panel(n)}),e(".ctc-section-toggle").on("click",function(t){t.preventDefault(),e(this).parents(".ctc-input-row").first().find(".ctc-section-toggle").each(function(){e(this).toggleClass("open")});var c=e(this).attr("id").replace(/\d$/,"")+"_content";return e("#"+c).stop().slideToggle("fast"),!1}),e("#view_child_options, #view_parnt_options").on("click",function(){return e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),void t.css_preview(e(this).attr("id")))}),e("#ctc_load_form").on("submit",function(){return t.validate()}),e("#ctc_query_selector_form").on("submit",function(c){return c.preventDefault(),$this=e("#ctc_save_query_selector"),$this.hasClass("ajax-pending")?!1:($this.addClass("ajax-pending"),t.save($this),!1)}),e("#ctc_theme_child, #ctc_theme_child-button, #ctc_child_type_existing").on("focus click",function(){e("#ctc_child_type_existing").prop("checked",!0),e("#ctc_child_type_new").prop("checked",!1),e("#ctc_child_template").val(""),t.set_existing()}),e("#ctc_child_type_new, #ctc_child_template").on("focus click",function(){e("#ctc_child_type_existing").prop("checked",!1),e("#ctc_child_type_new").prop("checked",!0),e("#ctc_child_name").val(t.testname),e("#ctc_child_template").val(t.testslug)}),e("#ctc_is_debug").on("change",function(){t.save(this)}),e(".ctc-live-preview").on("click",function(t){return t.stopImmediatePropagation(),t.preventDefault(),document.location=e(this).prop("href"),!1}),t.setup_menus(),t.set_addl_css(),e("input[type=submit], input[type=button]").prop("disabled",!1),t.scrolltop(),setTimeout(t.fade_update_notice,2e4)):t.jquery_notice()},testslug:"",testname:"",reload_menus:!1,current_query:"base",current_qsid:null,current_qsdata:{},jquery_err:[]}}(jQuery),jQuery(document).ready(function(e){e.chldthmcfg.init()});
|
lang/chld_thm_cfg.pot
CHANGED
@@ -2,9 +2,9 @@
|
|
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.7.
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/child-theme-configurator\n"
|
7 |
-
"POT-Creation-Date: 2015-
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -12,57 +12,71 @@ msgstr ""
|
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
|
15 |
-
#. #-#-#-#-# chld_thm_cfg.pot (Child Theme Configurator 1.7.
|
16 |
#. Plugin Name of the plugin/theme
|
17 |
-
#: child-theme-configurator.php:
|
18 |
#: includes/forms/main.php:23
|
19 |
msgid "Child Theme Configurator"
|
20 |
msgstr ""
|
21 |
|
22 |
-
#: child-theme-configurator.php:
|
23 |
-
#: child-theme-configurator.php:
|
24 |
msgid "Child Themes"
|
25 |
msgstr ""
|
26 |
|
27 |
-
#: child-theme-configurator.php:
|
28 |
msgid "Child Theme Configurator requires WordPress version %s or later."
|
29 |
msgstr ""
|
30 |
|
31 |
-
#: includes/class-ctc-ui.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
msgid "Child Theme files modified successfully."
|
33 |
msgstr ""
|
34 |
|
35 |
-
#: includes/class-ctc-ui.php:
|
36 |
msgid ""
|
37 |
"Child Theme <strong>%s</strong> has been generated successfully.\n"
|
38 |
" "
|
39 |
msgstr ""
|
40 |
|
41 |
-
#: includes/class-ctc-ui.php:
|
42 |
msgid "IMPORTANT:"
|
43 |
msgstr ""
|
44 |
|
45 |
-
#: includes/class-ctc-ui.php:
|
46 |
msgid "Go to Themes"
|
47 |
msgstr ""
|
48 |
|
49 |
-
#: includes/class-ctc-ui.php:
|
50 |
msgid "Network enable"
|
51 |
msgstr ""
|
52 |
|
53 |
-
#: includes/class-ctc-ui.php:
|
54 |
msgid "your child theme."
|
55 |
msgstr ""
|
56 |
|
57 |
-
#: includes/class-ctc-ui.php:
|
58 |
msgid "Live Preview"
|
59 |
msgstr ""
|
60 |
|
61 |
-
#: includes/class-ctc-ui.php:
|
62 |
msgid "Test your child theme"
|
63 |
msgstr ""
|
64 |
|
65 |
-
#: includes/class-ctc-ui.php:
|
66 |
msgid "before activating."
|
67 |
msgstr ""
|
68 |
|
@@ -143,65 +157,65 @@ msgid "<strong>%s</strong> exists. Please enter a different Child Theme"
|
|
143 |
msgstr ""
|
144 |
|
145 |
#: includes/class-ctc.php:163
|
146 |
-
msgid ""
|
147 |
-
"The page could not be loaded correctly so some controls have been disabled."
|
148 |
msgstr ""
|
149 |
|
150 |
#: includes/class-ctc.php:165
|
151 |
-
msgid "
|
|
|
152 |
msgstr ""
|
153 |
|
154 |
#: includes/class-ctc.php:167
|
155 |
-
msgid "Deactivating
|
156 |
msgstr ""
|
157 |
|
158 |
#: includes/class-ctc.php:168
|
159 |
msgid "%sWhy am I seeing this?%s"
|
160 |
msgstr ""
|
161 |
|
162 |
-
#: includes/class-ctc.php:
|
163 |
msgid "Zip file creation failed."
|
164 |
msgstr ""
|
165 |
|
166 |
-
#: includes/class-ctc.php:
|
167 |
msgid "The Functions file is required and cannot be deleted."
|
168 |
msgstr ""
|
169 |
|
170 |
-
#: includes/class-ctc.php:
|
171 |
msgid "You do not have permission to configure child themes."
|
172 |
msgstr ""
|
173 |
|
174 |
-
#: includes/class-ctc.php:
|
175 |
msgid "%s does not exist. Please select a valid Parent Theme."
|
176 |
msgstr ""
|
177 |
|
178 |
-
#: includes/class-ctc.php:
|
179 |
msgid "Please select a valid Parent Theme."
|
180 |
msgstr ""
|
181 |
|
182 |
-
#: includes/class-ctc.php:
|
183 |
msgid "Please enter a valid Child Theme directory."
|
184 |
msgstr ""
|
185 |
|
186 |
-
#: includes/class-ctc.php:
|
187 |
msgid "Please enter a valid Child Theme template name."
|
188 |
msgstr ""
|
189 |
|
190 |
-
#: includes/class-ctc.php:
|
191 |
msgid ""
|
192 |
"<strong>%s</strong> exists. Please enter a different Child Theme template "
|
193 |
"name."
|
194 |
msgstr ""
|
195 |
|
196 |
-
#: includes/class-ctc.php:
|
197 |
msgid "Your theme directories are not writable."
|
198 |
msgstr ""
|
199 |
|
200 |
-
#: includes/class-ctc.php:
|
201 |
msgid "Your stylesheet is not writable."
|
202 |
msgstr ""
|
203 |
|
204 |
-
#: includes/class-ctc.php:
|
205 |
msgid ""
|
206 |
"A closing PHP tag was detected in Child theme functions file so \"Parent "
|
207 |
"Stylesheet Handling\" option was not configured. Closing PHP at the end of "
|
@@ -210,47 +224,47 @@ msgid ""
|
|
210 |
"click \"Generate/Rebuild Child Theme Files\" again."
|
211 |
msgstr ""
|
212 |
|
213 |
-
#: includes/class-ctc.php:
|
214 |
msgid "Could not delete file."
|
215 |
msgstr ""
|
216 |
|
217 |
-
#: includes/class-ctc.php:
|
218 |
msgid "Could not set write permissions."
|
219 |
msgstr ""
|
220 |
|
221 |
-
#: includes/class-ctc.php:
|
222 |
msgid "There were errors while resetting permissions."
|
223 |
msgstr ""
|
224 |
|
225 |
-
#: includes/class-ctc.php:
|
226 |
msgid "Could not upload file."
|
227 |
msgstr ""
|
228 |
|
229 |
-
#: includes/class-ctc.php:
|
230 |
msgid ""
|
231 |
"Child Theme Configurator is unable to write to the stylesheet. This can be "
|
232 |
"resolved using one of the following options:<ol>"
|
233 |
msgstr ""
|
234 |
|
235 |
-
#: includes/class-ctc.php:
|
236 |
msgid ""
|
237 |
"<li>Temporarily make the stylesheet writable by clicking the button below. "
|
238 |
"You should change this back when you are finished editing for security by "
|
239 |
"clicking \"Make read-only\" under the \"Files\" tab.</li>"
|
240 |
msgstr ""
|
241 |
|
242 |
-
#: includes/class-ctc.php:
|
243 |
msgid "Temporarily make stylesheet writable"
|
244 |
msgstr ""
|
245 |
|
246 |
-
#: includes/class-ctc.php:
|
247 |
msgid ""
|
248 |
"<li><a target=\"_blank\" href=\"http://codex.wordpress.org/Editing_wp-"
|
249 |
"config.php#WordPress_Upgrade_Constants\" title=\"Editin wp-config.php\">Add "
|
250 |
"your FTP/SSH credentials to the WordPress config file</a>.</li>"
|
251 |
msgstr ""
|
252 |
|
253 |
-
#: includes/class-ctc.php:
|
254 |
msgid ""
|
255 |
"<li><a target=\"_blank\" href=\"http://technet.microsoft.com/en-us/library/"
|
256 |
"cc771170\" title=\"Setting Application Pool Identity\">Assign WordPress to "
|
@@ -258,7 +272,7 @@ msgid ""
|
|
258 |
"li>"
|
259 |
msgstr ""
|
260 |
|
261 |
-
#: includes/class-ctc.php:
|
262 |
msgid ""
|
263 |
"<li><a target=\"_blank\" href=\"http://codex.wordpress.org/"
|
264 |
"Changing_File_Permissions\" title=\"Changing File Permissions\">Set the "
|
@@ -266,11 +280,11 @@ msgid ""
|
|
266 |
"li>"
|
267 |
msgstr ""
|
268 |
|
269 |
-
#: includes/class-ctc.php:
|
270 |
msgid "<li>Run PHP under Apache with suEXEC (contact your web host).</li>"
|
271 |
msgstr ""
|
272 |
|
273 |
-
#: includes/class-ctc.php:
|
274 |
msgid ""
|
275 |
"This Child Theme is not owned by your website account. It may have been "
|
276 |
"created by a prior version of this plugin or by another program. Moving "
|
@@ -279,25 +293,25 @@ msgid ""
|
|
279 |
"below."
|
280 |
msgstr ""
|
281 |
|
282 |
-
#: includes/class-ctc.php:
|
283 |
msgid "Correct Child Theme Permissions"
|
284 |
msgstr ""
|
285 |
|
286 |
-
#: includes/class-ctc.php:
|
287 |
msgid ""
|
288 |
"Child Theme Configurator needs to update its interal data. Please set your "
|
289 |
"preferences below and click \"Generate Child Theme Files\" to update your "
|
290 |
"configuration."
|
291 |
msgstr ""
|
292 |
|
293 |
-
#: includes/class-ctc.php:
|
294 |
msgid ""
|
295 |
"<strong>However, some styles could not be parsed due to memory limits.</"
|
296 |
"strong> Try deselecting \"Additional Stylesheets\" below and click "
|
297 |
"\"Generate/Rebuild Child Theme Files\". %sWhy am I seeing this?%s"
|
298 |
msgstr ""
|
299 |
|
300 |
-
#: includes/class-ctc.php:
|
301 |
msgid ""
|
302 |
"Child Theme Configurator did not detect any configuration data because a "
|
303 |
"previously configured Child Theme has been removed. Please set your "
|
@@ -308,7 +322,7 @@ msgstr ""
|
|
308 |
msgid "Parse additional stylesheets:"
|
309 |
msgstr ""
|
310 |
|
311 |
-
#: includes/forms/addl_css.php:11 includes/forms/parent-child.php:
|
312 |
msgid ""
|
313 |
"Stylesheets that are currently being loaded by the parent theme are "
|
314 |
"automatically selected below (except for Bootstrap stylesheets which add a "
|
@@ -343,7 +357,7 @@ msgid ""
|
|
343 |
"experience."
|
344 |
msgstr ""
|
345 |
|
346 |
-
#: includes/forms/addl_panels.php:16 includes/help/help_en_US.php:
|
347 |
msgid "Learn more about CTC Pro"
|
348 |
msgstr ""
|
349 |
|
@@ -451,22 +465,14 @@ msgid "*Prices subject to change."
|
|
451 |
msgstr ""
|
452 |
|
453 |
#: includes/forms/addl_tabs.php:8
|
454 |
-
msgid "Get
|
455 |
-
msgstr ""
|
456 |
-
|
457 |
-
#: includes/forms/at-import.php:15 includes/forms/query-selector.php:85
|
458 |
-
msgid "Save"
|
459 |
-
msgstr ""
|
460 |
-
|
461 |
-
#: includes/forms/at-import.php:18
|
462 |
-
msgid "@import Statements"
|
463 |
msgstr ""
|
464 |
|
465 |
#: includes/forms/backup.php:8
|
466 |
msgid "Backup"
|
467 |
msgstr ""
|
468 |
|
469 |
-
#: includes/forms/backups.php:10 includes/forms/parent-child.php:
|
470 |
msgid "Restore backup from"
|
471 |
msgstr ""
|
472 |
|
@@ -662,97 +668,122 @@ msgstr ""
|
|
662 |
msgid "Stylesheet handling"
|
663 |
msgstr ""
|
664 |
|
665 |
-
#: includes/forms/parent-child.php:
|
666 |
msgid "(click to view options)"
|
667 |
msgstr ""
|
668 |
|
669 |
-
#: includes/forms/parent-child.php:
|
670 |
-
msgid "
|
|
|
|
|
671 |
msgstr ""
|
672 |
|
673 |
-
#: includes/forms/parent-child.php:
|
674 |
-
msgid ""
|
675 |
-
|
676 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
677 |
msgstr ""
|
678 |
|
679 |
#: includes/forms/parent-child.php:127
|
680 |
msgid ""
|
681 |
-
"
|
682 |
-
"
|
|
|
683 |
msgstr ""
|
684 |
|
685 |
-
#: includes/forms/parent-child.php:
|
686 |
-
msgid "
|
687 |
msgstr ""
|
688 |
|
689 |
-
#: includes/forms/parent-child.php:
|
690 |
msgid ""
|
691 |
-
"Select this option if the
|
692 |
-
"
|
693 |
-
"case unless you modify the header template."
|
694 |
msgstr ""
|
695 |
|
696 |
-
#: includes/forms/parent-child.php:
|
697 |
msgid "Enqueue child stylesheet"
|
698 |
msgstr ""
|
699 |
|
700 |
-
#: includes/forms/parent-child.php:
|
701 |
msgid ""
|
702 |
-
"Select this option if the parent
|
703 |
-
"
|
704 |
-
"
|
|
|
705 |
msgstr ""
|
706 |
|
707 |
-
#: includes/forms/parent-child.php:
|
708 |
-
msgid "
|
709 |
msgstr ""
|
710 |
|
711 |
#: includes/forms/parent-child.php:156
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
712 |
msgid ""
|
713 |
-
"
|
714 |
-
"
|
|
|
715 |
msgstr ""
|
716 |
|
717 |
-
#: includes/forms/parent-child.php:
|
718 |
msgid "Copy Parent Theme Menus, Widgets and other Options"
|
719 |
msgstr ""
|
720 |
|
721 |
-
#: includes/forms/parent-child.php:
|
722 |
msgid "NOTE:"
|
723 |
msgstr ""
|
724 |
|
725 |
-
#: includes/forms/parent-child.php:
|
726 |
msgid "This will overwrite child theme options you may have already set."
|
727 |
msgstr ""
|
728 |
|
729 |
-
#: includes/forms/parent-child.php:
|
730 |
msgid "Backup current stylesheet"
|
731 |
msgstr ""
|
732 |
|
733 |
-
#: includes/forms/parent-child.php:
|
734 |
msgid ""
|
735 |
"This creates a copy of the current stylesheet before applying changes. You "
|
736 |
"can remove old backup files using the Files tab."
|
737 |
msgstr ""
|
738 |
|
739 |
-
#: includes/forms/parent-child.php:
|
740 |
msgid "Reset/Restore from backup"
|
741 |
msgstr ""
|
742 |
|
743 |
-
#: includes/forms/parent-child.php:
|
744 |
msgid "Leave unchanged"
|
745 |
msgstr ""
|
746 |
|
747 |
-
#: includes/forms/parent-child.php:
|
748 |
msgid "Reset all"
|
749 |
msgstr ""
|
750 |
|
751 |
-
#: includes/forms/parent-child.php:
|
752 |
msgid "Parse additional stylesheets"
|
753 |
msgstr ""
|
754 |
|
755 |
-
#: includes/forms/parent-child.php:
|
756 |
msgid "Generate/Rebuild Child Theme Files"
|
757 |
msgstr ""
|
758 |
|
@@ -796,6 +827,10 @@ msgstr ""
|
|
796 |
msgid "Copy Selector"
|
797 |
msgstr ""
|
798 |
|
|
|
|
|
|
|
|
|
799 |
#: includes/forms/query-selector.php:88
|
800 |
msgid "Raw CSS"
|
801 |
msgstr ""
|
@@ -843,7 +878,7 @@ msgid "Rule/Value"
|
|
843 |
msgstr ""
|
844 |
|
845 |
#: includes/forms/tabs.php:22
|
846 |
-
msgid "
|
847 |
msgstr ""
|
848 |
|
849 |
#: includes/forms/tabs.php:25
|
@@ -878,14 +913,26 @@ msgstr ""
|
|
878 |
msgid "Not Network Enabled"
|
879 |
msgstr ""
|
880 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
881 |
#. Plugin URI of the plugin/theme
|
882 |
-
msgid "http://www.
|
883 |
msgstr ""
|
884 |
|
885 |
#. Description of the plugin/theme
|
886 |
msgid ""
|
887 |
-
"Create a
|
888 |
-
"editor lets you
|
889 |
msgstr ""
|
890 |
|
891 |
#. Author of the plugin/theme
|
@@ -893,5 +940,5 @@ msgid "Lilaea Media"
|
|
893 |
msgstr ""
|
894 |
|
895 |
#. Author URI of the plugin/theme
|
896 |
-
msgid "http://www.lilaeamedia.com
|
897 |
msgstr ""
|
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.7.3\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/child-theme-configurator\n"
|
7 |
+
"POT-Creation-Date: 2015-03-24 16:30:33+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
|
15 |
+
#. #-#-#-#-# chld_thm_cfg.pot (Child Theme Configurator 1.7.3) #-#-#-#-#
|
16 |
#. Plugin Name of the plugin/theme
|
17 |
+
#: child-theme-configurator.php:78 child-theme-configurator.php:88
|
18 |
#: includes/forms/main.php:23
|
19 |
msgid "Child Theme Configurator"
|
20 |
msgstr ""
|
21 |
|
22 |
+
#: child-theme-configurator.php:79 child-theme-configurator.php:89
|
23 |
+
#: child-theme-configurator.php:99
|
24 |
msgid "Child Themes"
|
25 |
msgstr ""
|
26 |
|
27 |
+
#: child-theme-configurator.php:114
|
28 |
msgid "Child Theme Configurator requires WordPress version %s or later."
|
29 |
msgstr ""
|
30 |
|
31 |
+
#: includes/class-ctc-ui.php:63
|
32 |
+
msgid "A stylesheet link tag is hard-coded into the header template."
|
33 |
+
msgstr ""
|
34 |
+
|
35 |
+
#: includes/class-ctc-ui.php:64
|
36 |
+
msgid "<code>wp_enqueue_style()</code> called from the header template."
|
37 |
+
msgstr ""
|
38 |
+
|
39 |
+
#: includes/class-ctc-ui.php:66
|
40 |
+
msgid ""
|
41 |
+
"Code exists between the <code>wp_head()</code> function and the closing "
|
42 |
+
"<code></head></code> tag."
|
43 |
+
msgstr ""
|
44 |
+
|
45 |
+
#: includes/class-ctc-ui.php:171
|
46 |
msgid "Child Theme files modified successfully."
|
47 |
msgstr ""
|
48 |
|
49 |
+
#: includes/class-ctc-ui.php:174
|
50 |
msgid ""
|
51 |
"Child Theme <strong>%s</strong> has been generated successfully.\n"
|
52 |
" "
|
53 |
msgstr ""
|
54 |
|
55 |
+
#: includes/class-ctc-ui.php:177
|
56 |
msgid "IMPORTANT:"
|
57 |
msgstr ""
|
58 |
|
59 |
+
#: includes/class-ctc-ui.php:179 includes/forms/themepreview.php:20
|
60 |
msgid "Go to Themes"
|
61 |
msgstr ""
|
62 |
|
63 |
+
#: includes/class-ctc-ui.php:179
|
64 |
msgid "Network enable"
|
65 |
msgstr ""
|
66 |
|
67 |
+
#: includes/class-ctc-ui.php:179
|
68 |
msgid "your child theme."
|
69 |
msgstr ""
|
70 |
|
71 |
+
#: includes/class-ctc-ui.php:181 includes/forms/themepreview.php:18
|
72 |
msgid "Live Preview"
|
73 |
msgstr ""
|
74 |
|
75 |
+
#: includes/class-ctc-ui.php:181
|
76 |
msgid "Test your child theme"
|
77 |
msgstr ""
|
78 |
|
79 |
+
#: includes/class-ctc-ui.php:181
|
80 |
msgid "before activating."
|
81 |
msgstr ""
|
82 |
|
157 |
msgstr ""
|
158 |
|
159 |
#: includes/class-ctc.php:163
|
160 |
+
msgid "The page could not be loaded correctly."
|
|
|
161 |
msgstr ""
|
162 |
|
163 |
#: includes/class-ctc.php:165
|
164 |
+
msgid ""
|
165 |
+
"Conflicting or out-of-date jQuery libraries were loaded by another plugin:"
|
166 |
msgstr ""
|
167 |
|
168 |
#: includes/class-ctc.php:167
|
169 |
+
msgid "Deactivating or replacing plugins may resolve this issue."
|
170 |
msgstr ""
|
171 |
|
172 |
#: includes/class-ctc.php:168
|
173 |
msgid "%sWhy am I seeing this?%s"
|
174 |
msgstr ""
|
175 |
|
176 |
+
#: includes/class-ctc.php:387
|
177 |
msgid "Zip file creation failed."
|
178 |
msgstr ""
|
179 |
|
180 |
+
#: includes/class-ctc.php:423
|
181 |
msgid "The Functions file is required and cannot be deleted."
|
182 |
msgstr ""
|
183 |
|
184 |
+
#: includes/class-ctc.php:504
|
185 |
msgid "You do not have permission to configure child themes."
|
186 |
msgstr ""
|
187 |
|
188 |
+
#: includes/class-ctc.php:551
|
189 |
msgid "%s does not exist. Please select a valid Parent Theme."
|
190 |
msgstr ""
|
191 |
|
192 |
+
#: includes/class-ctc.php:555
|
193 |
msgid "Please select a valid Parent Theme."
|
194 |
msgstr ""
|
195 |
|
196 |
+
#: includes/class-ctc.php:558
|
197 |
msgid "Please enter a valid Child Theme directory."
|
198 |
msgstr ""
|
199 |
|
200 |
+
#: includes/class-ctc.php:566
|
201 |
msgid "Please enter a valid Child Theme template name."
|
202 |
msgstr ""
|
203 |
|
204 |
+
#: includes/class-ctc.php:571
|
205 |
msgid ""
|
206 |
"<strong>%s</strong> exists. Please enter a different Child Theme template "
|
207 |
"name."
|
208 |
msgstr ""
|
209 |
|
210 |
+
#: includes/class-ctc.php:577
|
211 |
msgid "Your theme directories are not writable."
|
212 |
msgstr ""
|
213 |
|
214 |
+
#: includes/class-ctc.php:648
|
215 |
msgid "Your stylesheet is not writable."
|
216 |
msgstr ""
|
217 |
|
218 |
+
#: includes/class-ctc.php:942
|
219 |
msgid ""
|
220 |
"A closing PHP tag was detected in Child theme functions file so \"Parent "
|
221 |
"Stylesheet Handling\" option was not configured. Closing PHP at the end of "
|
224 |
"click \"Generate/Rebuild Child Theme Files\" again."
|
225 |
msgstr ""
|
226 |
|
227 |
+
#: includes/class-ctc.php:1035
|
228 |
msgid "Could not delete file."
|
229 |
msgstr ""
|
230 |
|
231 |
+
#: includes/class-ctc.php:1111
|
232 |
msgid "Could not set write permissions."
|
233 |
msgstr ""
|
234 |
|
235 |
+
#: includes/class-ctc.php:1185
|
236 |
msgid "There were errors while resetting permissions."
|
237 |
msgstr ""
|
238 |
|
239 |
+
#: includes/class-ctc.php:1227
|
240 |
msgid "Could not upload file."
|
241 |
msgstr ""
|
242 |
|
243 |
+
#: includes/class-ctc.php:1310
|
244 |
msgid ""
|
245 |
"Child Theme Configurator is unable to write to the stylesheet. This can be "
|
246 |
"resolved using one of the following options:<ol>"
|
247 |
msgstr ""
|
248 |
|
249 |
+
#: includes/class-ctc.php:1313
|
250 |
msgid ""
|
251 |
"<li>Temporarily make the stylesheet writable by clicking the button below. "
|
252 |
"You should change this back when you are finished editing for security by "
|
253 |
"clicking \"Make read-only\" under the \"Files\" tab.</li>"
|
254 |
msgstr ""
|
255 |
|
256 |
+
#: includes/class-ctc.php:1316
|
257 |
msgid "Temporarily make stylesheet writable"
|
258 |
msgstr ""
|
259 |
|
260 |
+
#: includes/class-ctc.php:1317
|
261 |
msgid ""
|
262 |
"<li><a target=\"_blank\" href=\"http://codex.wordpress.org/Editing_wp-"
|
263 |
"config.php#WordPress_Upgrade_Constants\" title=\"Editin wp-config.php\">Add "
|
264 |
"your FTP/SSH credentials to the WordPress config file</a>.</li>"
|
265 |
msgstr ""
|
266 |
|
267 |
+
#: includes/class-ctc.php:1319
|
268 |
msgid ""
|
269 |
"<li><a target=\"_blank\" href=\"http://technet.microsoft.com/en-us/library/"
|
270 |
"cc771170\" title=\"Setting Application Pool Identity\">Assign WordPress to "
|
272 |
"li>"
|
273 |
msgstr ""
|
274 |
|
275 |
+
#: includes/class-ctc.php:1320
|
276 |
msgid ""
|
277 |
"<li><a target=\"_blank\" href=\"http://codex.wordpress.org/"
|
278 |
"Changing_File_Permissions\" title=\"Changing File Permissions\">Set the "
|
280 |
"li>"
|
281 |
msgstr ""
|
282 |
|
283 |
+
#: includes/class-ctc.php:1322
|
284 |
msgid "<li>Run PHP under Apache with suEXEC (contact your web host).</li>"
|
285 |
msgstr ""
|
286 |
|
287 |
+
#: includes/class-ctc.php:1332
|
288 |
msgid ""
|
289 |
"This Child Theme is not owned by your website account. It may have been "
|
290 |
"created by a prior version of this plugin or by another program. Moving "
|
293 |
"below."
|
294 |
msgstr ""
|
295 |
|
296 |
+
#: includes/class-ctc.php:1335
|
297 |
msgid "Correct Child Theme Permissions"
|
298 |
msgstr ""
|
299 |
|
300 |
+
#: includes/class-ctc.php:1342
|
301 |
msgid ""
|
302 |
"Child Theme Configurator needs to update its interal data. Please set your "
|
303 |
"preferences below and click \"Generate Child Theme Files\" to update your "
|
304 |
"configuration."
|
305 |
msgstr ""
|
306 |
|
307 |
+
#: includes/class-ctc.php:1348
|
308 |
msgid ""
|
309 |
"<strong>However, some styles could not be parsed due to memory limits.</"
|
310 |
"strong> Try deselecting \"Additional Stylesheets\" below and click "
|
311 |
"\"Generate/Rebuild Child Theme Files\". %sWhy am I seeing this?%s"
|
312 |
msgstr ""
|
313 |
|
314 |
+
#: includes/class-ctc.php:1357
|
315 |
msgid ""
|
316 |
"Child Theme Configurator did not detect any configuration data because a "
|
317 |
"previously configured Child Theme has been removed. Please set your "
|
322 |
msgid "Parse additional stylesheets:"
|
323 |
msgstr ""
|
324 |
|
325 |
+
#: includes/forms/addl_css.php:11 includes/forms/parent-child.php:239
|
326 |
msgid ""
|
327 |
"Stylesheets that are currently being loaded by the parent theme are "
|
328 |
"automatically selected below (except for Bootstrap stylesheets which add a "
|
357 |
"experience."
|
358 |
msgstr ""
|
359 |
|
360 |
+
#: includes/forms/addl_panels.php:16 includes/help/help_en_US.php:212
|
361 |
msgid "Learn more about CTC Pro"
|
362 |
msgstr ""
|
363 |
|
465 |
msgstr ""
|
466 |
|
467 |
#: includes/forms/addl_tabs.php:8
|
468 |
+
msgid "Get Pro"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
469 |
msgstr ""
|
470 |
|
471 |
#: includes/forms/backup.php:8
|
472 |
msgid "Backup"
|
473 |
msgstr ""
|
474 |
|
475 |
+
#: includes/forms/backups.php:10 includes/forms/parent-child.php:222
|
476 |
msgid "Restore backup from"
|
477 |
msgstr ""
|
478 |
|
668 |
msgid "Stylesheet handling"
|
669 |
msgstr ""
|
670 |
|
671 |
+
#: includes/forms/parent-child.php:111
|
672 |
msgid "(click to view options)"
|
673 |
msgstr ""
|
674 |
|
675 |
+
#: includes/forms/parent-child.php:113
|
676 |
+
msgid ""
|
677 |
+
"This theme may not apply child theme styles correctly with the current "
|
678 |
+
"settings:"
|
679 |
msgstr ""
|
680 |
|
681 |
+
#: includes/forms/parent-child.php:115
|
682 |
+
msgid "View options"
|
683 |
+
msgstr ""
|
684 |
+
|
685 |
+
#: includes/forms/parent-child.php:118
|
686 |
+
msgid "Which option should I use?"
|
687 |
+
msgstr ""
|
688 |
+
|
689 |
+
#: includes/forms/parent-child.php:123
|
690 |
+
msgid "None (handled by theme)"
|
691 |
msgstr ""
|
692 |
|
693 |
#: includes/forms/parent-child.php:127
|
694 |
msgid ""
|
695 |
+
"Select this option if all stylesheets are correctly enqueued for child "
|
696 |
+
"themes. If you find that styles are not being applied correctly, use a "
|
697 |
+
"different option."
|
698 |
msgstr ""
|
699 |
|
700 |
+
#: includes/forms/parent-child.php:134
|
701 |
+
msgid "Enqueue parent stylesheet (default)"
|
702 |
msgstr ""
|
703 |
|
704 |
+
#: includes/forms/parent-child.php:137
|
705 |
msgid ""
|
706 |
+
"Select this option if the theme enqueues the active stylesheet but has no "
|
707 |
+
"special handling for child themes. Start with this option if unsure."
|
|
|
708 |
msgstr ""
|
709 |
|
710 |
+
#: includes/forms/parent-child.php:144
|
711 |
msgid "Enqueue child stylesheet"
|
712 |
msgstr ""
|
713 |
|
714 |
+
#: includes/forms/parent-child.php:147
|
715 |
msgid ""
|
716 |
+
"Select this option if the theme enqueues the parent stylesheet but does not "
|
717 |
+
"enqueue the child stylesheet at all. This can happen if "
|
718 |
+
"<code>get_template()</code> or <code>get_template_directory_uri()</code> is "
|
719 |
+
"used to link the stylesheet."
|
720 |
msgstr ""
|
721 |
|
722 |
+
#: includes/forms/parent-child.php:150
|
723 |
+
msgid "Recommended for this theme:"
|
724 |
msgstr ""
|
725 |
|
726 |
#: includes/forms/parent-child.php:156
|
727 |
+
msgid "Enqueue both parent and child stylesheets"
|
728 |
+
msgstr ""
|
729 |
+
|
730 |
+
#: includes/forms/parent-child.php:159
|
731 |
+
msgid ""
|
732 |
+
"Select this option if stylesheet link tags are hard-coded into the header "
|
733 |
+
"template (common in older themes). This enables the child stylesheet to "
|
734 |
+
"override the parent stylesheet without using <code>@import</code>."
|
735 |
+
msgstr ""
|
736 |
+
|
737 |
+
#: includes/forms/parent-child.php:166
|
738 |
+
msgid "<code>@import</code> parent stylesheet"
|
739 |
+
msgstr ""
|
740 |
+
|
741 |
+
#: includes/forms/parent-child.php:169
|
742 |
msgid ""
|
743 |
+
"This option imports the parent stylesheet from the child stylesheet. This "
|
744 |
+
"enables the child stylesheet to override the parent stylesheet, but using "
|
745 |
+
"<code>@import</code> is no longer recommended."
|
746 |
msgstr ""
|
747 |
|
748 |
+
#: includes/forms/parent-child.php:174
|
749 |
msgid "Copy Parent Theme Menus, Widgets and other Options"
|
750 |
msgstr ""
|
751 |
|
752 |
+
#: includes/forms/parent-child.php:181 includes/forms/parent-child.php:196
|
753 |
msgid "NOTE:"
|
754 |
msgstr ""
|
755 |
|
756 |
+
#: includes/forms/parent-child.php:183
|
757 |
msgid "This will overwrite child theme options you may have already set."
|
758 |
msgstr ""
|
759 |
|
760 |
+
#: includes/forms/parent-child.php:189
|
761 |
msgid "Backup current stylesheet"
|
762 |
msgstr ""
|
763 |
|
764 |
+
#: includes/forms/parent-child.php:198
|
765 |
msgid ""
|
766 |
"This creates a copy of the current stylesheet before applying changes. You "
|
767 |
"can remove old backup files using the Files tab."
|
768 |
msgstr ""
|
769 |
|
770 |
+
#: includes/forms/parent-child.php:203
|
771 |
msgid "Reset/Restore from backup"
|
772 |
msgstr ""
|
773 |
|
774 |
+
#: includes/forms/parent-child.php:209
|
775 |
msgid "Leave unchanged"
|
776 |
msgstr ""
|
777 |
|
778 |
+
#: includes/forms/parent-child.php:215
|
779 |
msgid "Reset all"
|
780 |
msgstr ""
|
781 |
|
782 |
+
#: includes/forms/parent-child.php:235
|
783 |
msgid "Parse additional stylesheets"
|
784 |
msgstr ""
|
785 |
|
786 |
+
#: includes/forms/parent-child.php:258
|
787 |
msgid "Generate/Rebuild Child Theme Files"
|
788 |
msgstr ""
|
789 |
|
827 |
msgid "Copy Selector"
|
828 |
msgstr ""
|
829 |
|
830 |
+
#: includes/forms/query-selector.php:85 includes/forms/webfonts.php:15
|
831 |
+
msgid "Save"
|
832 |
+
msgstr ""
|
833 |
+
|
834 |
#: includes/forms/query-selector.php:88
|
835 |
msgid "Raw CSS"
|
836 |
msgstr ""
|
878 |
msgstr ""
|
879 |
|
880 |
#: includes/forms/tabs.php:22
|
881 |
+
msgid "Web Fonts"
|
882 |
msgstr ""
|
883 |
|
884 |
#: includes/forms/tabs.php:25
|
913 |
msgid "Not Network Enabled"
|
914 |
msgstr ""
|
915 |
|
916 |
+
#: includes/forms/webfonts.php:18
|
917 |
+
msgid "Linked Stylesheets"
|
918 |
+
msgstr ""
|
919 |
+
|
920 |
+
#: includes/forms/webfonts.php:20
|
921 |
+
msgid ""
|
922 |
+
"Use <code>@import url( [path] );</code> to link additional stylesheets. "
|
923 |
+
"Child Theme Configurator uses the <code>@import</code> keyword to identify "
|
924 |
+
"them and convert them to <code><link></code> tags. <strong>Example:</"
|
925 |
+
"strong>"
|
926 |
+
msgstr ""
|
927 |
+
|
928 |
#. Plugin URI of the plugin/theme
|
929 |
+
msgid "http://www.childthemeconfigurator.com"
|
930 |
msgstr ""
|
931 |
|
932 |
#. Description of the plugin/theme
|
933 |
msgid ""
|
934 |
+
"Create a child theme that follows WP best practice to enqueue stylesheets. "
|
935 |
+
"Easy to use CSS editor lets you find, preview and customize any style."
|
936 |
msgstr ""
|
937 |
|
938 |
#. Author of the plugin/theme
|
940 |
msgstr ""
|
941 |
|
942 |
#. Author URI of the plugin/theme
|
943 |
+
msgid "http://www.lilaeamedia.com"
|
944 |
msgstr ""
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: lilaeamedia
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8QE5YJ8WE96AJ
|
4 |
Tags: child theme, child themes, customize theme, CSS, responsive, css editor, child theme generator, child theme creator, stylesheet, customizer
|
5 |
Requires at least: 3.9
|
6 |
-
Tested up to: 4.1
|
7 |
-
Stable tag: 1.7.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -68,15 +68,15 @@ Learn more at http://www.lilaeamedia.com/plugins/intelliwidget-responsive-menu
|
|
68 |
== Installation ==
|
69 |
|
70 |
1. To install from the Plugins repository:
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
|
75 |
2. To install manually:
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
|
81 |
3. In the WordPress Admin, go to "Plugins > Installed Plugins." Locate "Child Theme Configurator" in the list and click "Activate."
|
82 |
|
@@ -93,14 +93,17 @@ Learn more at http://www.lilaeamedia.com/plugins/intelliwidget-responsive-menu
|
|
93 |
4. Optional: Copy Parent Theme Menus, Widgets and other Options. NOTE: This will overwrite any child theme options you may have already set.
|
94 |
|
95 |
5. Choose stylesheet handling:
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
|
|
|
|
|
|
104 |
|
105 |
6. Optional: Save Backup
|
106 |
|
@@ -191,9 +194,9 @@ Click the "Help" tab at the top right for a quick reference.
|
|
191 |
|
192 |
= How do I add Web Fonts? =
|
193 |
|
194 |
-
The easiest method is to paste the @import code provided by Google, Font Squirrel or any other Web Font site into the
|
195 |
|
196 |
-
You can also create a secondary stylesheet that contains @font-face rules and import it using the
|
197 |
|
198 |
= Why doesn't the Parent Theme have any styles when I "View Parent CSS"? =
|
199 |
|
@@ -261,11 +264,17 @@ https://www.youtube.com/watch?v=iBiiAgsK4G4
|
|
261 |
2. Parent/Child tab with parent theme menu open
|
262 |
3. Query/Selector tab
|
263 |
4. Rule/Value tab
|
264 |
-
5.
|
265 |
6. Parent CSS tab
|
266 |
7. Files tab
|
267 |
|
268 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
269 |
= 1.7.2.1 =
|
270 |
* Fix: hide called before iris init
|
271 |
* Fix: @import not being written on rebuild/configure
|
@@ -490,7 +499,7 @@ https://www.youtube.com/watch?v=iBiiAgsK4G4
|
|
490 |
* Initial release.
|
491 |
|
492 |
== Upgrade Notice ==
|
493 |
-
Version 1.7.
|
494 |
|
495 |
== Override Parent Styles ==
|
496 |
|
@@ -527,9 +536,9 @@ Click "Save" to update the child theme stylesheet and save your changes to the W
|
|
527 |
|
528 |
If you want to edit all of the rules for the CSS selector you can click the “Edit” link and the CSS selector will automatically load in the Query/Selector Tab.
|
529 |
|
530 |
-
==
|
531 |
|
532 |
-
You can add additional stylesheets and web fonts by typing @import rules into the textarea on the
|
533 |
|
534 |
== Files Tab ==
|
535 |
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8QE5YJ8WE96AJ
|
4 |
Tags: child theme, child themes, customize theme, CSS, responsive, css editor, child theme generator, child theme creator, stylesheet, customizer
|
5 |
Requires at least: 3.9
|
6 |
+
Tested up to: 4.1.1
|
7 |
+
Stable tag: 1.7.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
68 |
== Installation ==
|
69 |
|
70 |
1. To install from the Plugins repository:
|
71 |
+
* In the WordPress Admin, go to "Plugins > Add New."
|
72 |
+
* Type "child theme" in the "Search" box and click "Search Plugins."
|
73 |
+
* Locate "Child Theme Configurator" in the list and click "Install Now."
|
74 |
|
75 |
2. To install manually:
|
76 |
+
* Download the Child Theme Configurator plugin from http://wordpress.org/plugins/child-theme-configurator
|
77 |
+
* In the WordPress Admin, go to "Plugins > Add New."
|
78 |
+
* Click the "Upload" link at the top of the page.
|
79 |
+
* Browse for the zip file, select and click "Install."
|
80 |
|
81 |
3. In the WordPress Admin, go to "Plugins > Installed Plugins." Locate "Child Theme Configurator" in the list and click "Activate."
|
82 |
|
93 |
4. Optional: Copy Parent Theme Menus, Widgets and other Options. NOTE: This will overwrite any child theme options you may have already set.
|
94 |
|
95 |
5. Choose stylesheet handling:
|
96 |
+
* **None (handled by theme)**
|
97 |
+
Select this option if all stylesheets are correctly enqueued for child themes. If you find that styles are not being applied correctly, use a different option.
|
98 |
+
* **Enqueue parent stylesheet (default)**
|
99 |
+
Select this option if the theme enqueues the active stylesheet but has no special handling for child themes. Start with this option if unsure.
|
100 |
+
* **Enqueue child stylesheet**
|
101 |
+
Select this option if the theme enqueues the parent theme stylesheet but does not enqueue the child theme stylesheet at all. This can happen if get_template() or get_template_directory_uri() is used to link the stylesheet.
|
102 |
+
* **Enqueue both parent and child stylesheets**
|
103 |
+
Select this option if stylesheet link tags are hard-coded into the header template (common in older themes). This enables the child theme stylesheet to override the parent theme stylesheet without using @import.
|
104 |
+
* **@import parent stylesheet**
|
105 |
+
This option imports the parent theme stylesheet from the child theme stylesheet. This enables the child theme stylesheet to override the parent theme stylesheet, but using @import is no longer recommended.
|
106 |
+
* [See our website for more information about which option to use](http://www.childthemeconfigurator.com/how-to-use/#stylesheet_handling)
|
107 |
|
108 |
6. Optional: Save Backup
|
109 |
|
194 |
|
195 |
= How do I add Web Fonts? =
|
196 |
|
197 |
+
The easiest method is to paste the @import code provided by Google, Font Squirrel or any other Web Font site into the Web Fonts tab. The fonts will then be available to use as a value of the font-family rule. Be sure you understand the license for any embedded fonts.
|
198 |
|
199 |
+
You can also create a secondary stylesheet that contains @font-face rules and import it using the Web Fonts tab.
|
200 |
|
201 |
= Why doesn't the Parent Theme have any styles when I "View Parent CSS"? =
|
202 |
|
264 |
2. Parent/Child tab with parent theme menu open
|
265 |
3. Query/Selector tab
|
266 |
4. Rule/Value tab
|
267 |
+
5. Web Fonts tab
|
268 |
6. Parent CSS tab
|
269 |
7. Files tab
|
270 |
|
271 |
== Changelog ==
|
272 |
+
= 1.7.3 =
|
273 |
+
* Changed @import tab to "Web Fonts." @import statements are automatically converted to enqueued external links.
|
274 |
+
* Added "Enqueue both parent and child stylesheets" option to enable child theme overrides without using @import.
|
275 |
+
* Added checks for hard-coded link tags in header template to help resolve incorrect stylesheet load order.
|
276 |
+
* Fix: "Enqueue child stylesheet" now passes correct value.
|
277 |
+
|
278 |
= 1.7.2.1 =
|
279 |
* Fix: hide called before iris init
|
280 |
* Fix: @import not being written on rebuild/configure
|
499 |
* Initial release.
|
500 |
|
501 |
== Upgrade Notice ==
|
502 |
+
Version 1.7.3 now converts @import statements to link tags and checks parent theme for hard-coded stylesheet link tags and other problematic code issues.
|
503 |
|
504 |
== Override Parent Styles ==
|
505 |
|
536 |
|
537 |
If you want to edit all of the rules for the CSS selector you can click the “Edit” link and the CSS selector will automatically load in the Query/Selector Tab.
|
538 |
|
539 |
+
== Web Fonts Tab ==
|
540 |
|
541 |
+
You can add additional stylesheets and web fonts by typing @import rules into the textarea on the Web Fonts tab. **Important: do not import the parent theme stylesheet here.** Use the "Parent stylesheet handling" option from the Parent/Child tab.
|
542 |
|
543 |
== Files Tab ==
|
544 |
|
screenshot-1.jpg
CHANGED
Binary file
|
screenshot-2.jpg
CHANGED
Binary file
|
screenshot-3.jpg
CHANGED
Binary file
|
screenshot-4.jpg
CHANGED
Binary file
|
screenshot-5.jpg
CHANGED
Binary file
|
screenshot-6.jpg
CHANGED
Binary file
|
screenshot-7.jpg
CHANGED
Binary file
|