Child Theme Configurator - Version 1.7.9.1

Version Description

  • Fix: regression bug in 1.7.9 causing new property menu to fail
Download this release

Release Info

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

Code changes from version 2.1.2 to 1.7.9.1

Files changed (43) hide show
  1. child-theme-configurator.php +21 -27
  2. css/{chldthmcfg.css → chld-thm-cfg.css} +299 -317
  3. css/chld-thm-cfg.min.css +1 -0
  4. includes/class-ctc-admin.php +741 -1239
  5. includes/class-ctc-css.php +320 -722
  6. includes/class-ctc-packer.php +0 -398
  7. includes/class-ctc-preview.php +62 -145
  8. includes/class-ctc-ui.php +128 -228
  9. includes/class-ctc.php +10 -93
  10. includes/forms/addl_panels.php +6 -6
  11. includes/forms/addl_tabs.php +2 -2
  12. includes/forms/backups.php +1 -1
  13. includes/forms/current-theme.php +0 -8
  14. includes/forms/debug-toggle.php +0 -9
  15. includes/forms/file-form-buttons.php +0 -13
  16. includes/forms/file.php +1 -3
  17. includes/forms/fileform.php +28 -7
  18. includes/forms/files.php +9 -4
  19. includes/forms/main.php +16 -39
  20. includes/forms/notices.php +0 -116
  21. includes/forms/parent-child.php +258 -321
  22. includes/forms/query-selector.php +4 -5
  23. includes/forms/related.php +1 -1
  24. includes/forms/rule-value.php +0 -1
  25. includes/forms/settings-errors.php +0 -60
  26. includes/forms/tabs.php +21 -19
  27. includes/forms/theme-menu.php +0 -19
  28. includes/forms/zipform.php +0 -9
  29. includes/help/de_DE.php +81 -79
  30. includes/help/en_US.php +52 -50
  31. js/chld-thm-cfg.js +1535 -0
  32. js/chld-thm-cfg.min.js +1 -0
  33. js/chldthmcfg.js +0 -2310
  34. js/chldthmcfg.min.js +0 -2
  35. js/ctcgrad.js +192 -192
  36. js/jquery-ui-selectmenu.js +1715 -1715
  37. js/spectrum.js +1 -1
  38. lang/child-theme-configurator-de_DE.mo +0 -0
  39. lang/child-theme-configurator-de_DE.po +539 -953
  40. lang/child-theme-configurator.pot +332 -673
  41. lang/chld_thm_cfg-sr_RS.mo +0 -0
  42. lang/chld_thm_cfg-sr_RS.po +964 -0
  43. lang/chld_thm_cfg.pot +375 -0
child-theme-configurator.php CHANGED
@@ -5,16 +5,15 @@ if ( !defined( 'ABSPATH' ) ) exit;
5
  /*
6
  Plugin Name: Child Theme Configurator
7
  Plugin URI: http://www.childthemeconfigurator.com
8
- Description: When using the Customizer is not enough - Create child themes and customize styles, templates, functions and more.
9
- Version: 2.1.2
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com
12
- Text Domain: child-theme-configurator
13
  Domain Path: /lang
14
  License: GPLv2
15
- Copyright (C) 2014-2016 Lilaea Media
16
  */
17
- defined( 'LF' ) or define( 'LF', "\n" );
18
 
19
  defined( 'CHLD_THM_CFG_DIR' ) or
20
  define( 'CHLD_THM_CFG_DIR', dirname( __FILE__ ) );
@@ -24,36 +23,31 @@ if ( !defined( 'ABSPATH' ) ) exit;
24
  define( 'CHLD_THM_CFG_OPTIONS', 'chld_thm_cfg_options' );
25
 
26
  if ( is_admin() )
27
- include_once( CHLD_THM_CFG_DIR . '/includes/class-ctc.php' );
28
 
29
- if ( isset( $_GET['preview_ctc'] ) ):
30
- // replace core preview function with CTCP function for quick preview
31
- remove_action( 'setup_theme', 'preview_theme' );
32
- include_once( CHLD_THM_CFG_DIR . '/includes/class-ctc-preview.php' );
33
- endif;
34
-
35
- add_filter( 'style_loader_src', 'chld_thm_cfg_version', 10, 2 );
36
 
37
- function chld_thm_cfg_version( $src, $handle ) {
38
- if ( strstr( $src, get_stylesheet() ) ):
39
  $src = preg_replace( "/ver=(.*?)(\&|$)/", 'ver=' . wp_get_theme()->Version . "$2", $src );
40
- endif;
41
  return $src;
42
  }
43
 
44
  register_uninstall_hook( __FILE__, 'chld_thm_cfg_uninstall' );
45
 
46
  function chld_thm_cfg_uninstall() {
47
- delete_site_option( CHLD_THM_CFG_OPTIONS );
48
- delete_site_option( CHLD_THM_CFG_OPTIONS . '_configvars' );
49
- delete_site_option( CHLD_THM_CFG_OPTIONS . '_dict_qs' );
50
- delete_site_option( CHLD_THM_CFG_OPTIONS . '_dict_sel' );
51
- delete_site_option( CHLD_THM_CFG_OPTIONS . '_dict_query' );
52
- delete_site_option( CHLD_THM_CFG_OPTIONS . '_dict_rule' );
53
- delete_site_option( CHLD_THM_CFG_OPTIONS . '_dict_val' );
54
- delete_site_option( CHLD_THM_CFG_OPTIONS . '_dict_seq' );
55
- delete_site_option( CHLD_THM_CFG_OPTIONS . '_dict_token' );
56
- delete_site_option( CHLD_THM_CFG_OPTIONS . '_sel_ndx' );
57
- delete_site_option( CHLD_THM_CFG_OPTIONS . '_val_ndx' );
58
  }
59
 
5
  /*
6
  Plugin Name: Child Theme Configurator
7
  Plugin URI: http://www.childthemeconfigurator.com
8
+ Description: Create child themes and customize styles, templates and functions. Enqueues stylesheets and web fonts. Handles rgba, vendor-prefixes and more.
9
+ Version: 1.7.9.1
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com
12
+ Text Domain: chld_thm_cfg
13
  Domain Path: /lang
14
  License: GPLv2
15
+ Copyright (C) 2014-2015 Lilaea Media
16
  */
 
17
 
18
  defined( 'CHLD_THM_CFG_DIR' ) or
19
  define( 'CHLD_THM_CFG_DIR', dirname( __FILE__ ) );
23
  define( 'CHLD_THM_CFG_OPTIONS', 'chld_thm_cfg_options' );
24
 
25
  if ( is_admin() )
26
+ include_once( dirname( __FILE__ ) . '/includes/class-ctc.php' );
27
 
28
+ if ( isset( $_GET['preview_ctc'] ) )
29
+ include_once( dirname( __FILE__ ) . '/includes/class-ctc-preview.php' );
30
+
31
+ add_filter( 'style_loader_src', 'chld_thm_cfg_plugins_version', 10, 2 );
 
 
 
32
 
33
+ function chld_thm_cfg_plugins_version( $src, $handle ) {
34
+ if ( strstr( $src, get_stylesheet() ) )
35
  $src = preg_replace( "/ver=(.*?)(\&|$)/", 'ver=' . wp_get_theme()->Version . "$2", $src );
 
36
  return $src;
37
  }
38
 
39
  register_uninstall_hook( __FILE__, 'chld_thm_cfg_uninstall' );
40
 
41
  function chld_thm_cfg_uninstall() {
42
+ delete_option( CHLD_THM_CFG_OPTIONS );
43
+ delete_option( CHLD_THM_CFG_OPTIONS . '_configvars' );
44
+ delete_option( CHLD_THM_CFG_OPTIONS . '_dict_qs' );
45
+ delete_option( CHLD_THM_CFG_OPTIONS . '_dict_sel' );
46
+ delete_option( CHLD_THM_CFG_OPTIONS . '_dict_query' );
47
+ delete_option( CHLD_THM_CFG_OPTIONS . '_dict_rule' );
48
+ delete_option( CHLD_THM_CFG_OPTIONS . '_dict_val' );
49
+ delete_option( CHLD_THM_CFG_OPTIONS . '_dict_seq' );
50
+ delete_option( CHLD_THM_CFG_OPTIONS . '_sel_ndx' );
51
+ delete_option( CHLD_THM_CFG_OPTIONS . '_val_ndx' );
 
52
  }
53
 
css/{chldthmcfg.css → chld-thm-cfg.css} RENAMED
@@ -1,8 +1,8 @@
1
  body {
2
- background: none !important;
3
  }
4
  p {
5
- line-height: 1.4;
6
  }
7
  .wrap h1, .wrap h2 {
8
  font-size: 23px;
@@ -26,29 +26,26 @@ h2 .nav-tab, h2 .ctc-recent-tab {
26
  font-size: 13px;
27
  padding: 6px 8px;
28
  font-weight: 700;
29
- line-height: 1.2;
30
- height:32px;
31
- max-width:60px;
32
- white-space:normal;
33
- text-align:center;
34
  }
35
  .ctc-option-panel-container {
36
  position: relative;
37
  min-height: 1100px;
38
- width: 100%;
39
  overflow: auto;
40
  }
41
  .ctc-three-col {
42
- -moz-columns: 3;
43
- -moz-column-gap: 3em;
44
- -webkit-columns: 3;
45
- -webkit-column-gap: 3em;
46
- columns: 3;
47
- column-gap: 3em;
48
  }
49
  #ctc_recent_selectors ul li, #all_styles_panel ul li {
50
  margin: 0;
51
  }
 
52
  #ctc_recent_selectors ul li a, #all_styles_panel ul li a {
53
  text-decoration: none;
54
  font-size: .8em;
@@ -57,18 +54,21 @@ h2 .nav-tab, h2 .ctc-recent-tab {
57
  display: block;
58
  padding: .5em;
59
  }
 
60
  #ctc_recent_selectors ul li a:hover, #ctc_recent_selectors ul li a:focus, #all_styles_panel ul li a:hover, #all_styles_panel ul li a:focus {
61
  background-color: #fff;
62
  -webkit-box-shadow: none;
63
  -moz-box-shadow: none;
64
  box-shadow: none;
65
  }
 
66
  #view_child_options_panel, #view_parnt_options_panel {
67
  white-space: pre;
68
  overflow: auto;
69
  font-family: monospace;
70
  word-wrap: normal;
71
  }
 
72
  .ctc-option-panel {
73
  visibility: hidden;
74
  position: absolute;
@@ -76,21 +76,22 @@ h2 .nav-tab, h2 .ctc-recent-tab {
76
  width: 100%;
77
  top: 0;
78
  left: 0;
79
- padding: 10px 0 0;/* transition: width 1s ease;
 
80
  -moz-transition: width 1s ease;
81
  -webkit-transition: width 1s ease;
82
  -o-transition: width 1s ease; */
83
  }
84
  .ctc-recent-container {
85
- top: 0;
86
- right: 0;
87
- position: absolute;
88
  max-width: 200px;
89
  width: 17%;
90
  display: none;
91
  overflow: auto;
92
- visibility: visible;
93
- left: inherit;
94
  background-color: #E4E4E4;
95
  }
96
  #ctc_recent_selectors {
@@ -101,66 +102,27 @@ h2 .nav-tab, h2 .ctc-recent-tab {
101
  min-height: 1100px;
102
  }
103
  a.ctc-recent-tab {
104
- float: right;
105
- border: 1px solid #ccc;
106
  border-bottom: none;
107
  background-color: #E4E4E4;
108
  color: #555;
109
  display: inline-block;
110
  text-decoration: none;
111
  margin: -1px 0 0 0;
112
- /* margin: 1px 0 -1px; */
113
  box-shadow: none;
114
- -moz-box-shadow: none;
115
  -webkit-box-shadow: none;
116
- outline: none;
117
  }
118
  .ctc-recent-tab h3 {
119
  }
 
120
  .ctc-option-panel-active {
121
  visibility: visible;
122
  }
123
- .ctc-step {
124
- -moz-border-radius: 50%;
125
- -webkit-border-radius: 50%;
126
- border-radius: 50%;
127
- text-align: center;
128
- font-weight: 700;
129
- font-style: normal;
130
- }
131
- .ctc-step-number {
132
- color: #fff;
133
- font-size: 20px;
134
- width: 24px;
135
- height: 24px;
136
- line-height: 1.1;
137
- padding: 8px;
138
- float: left;
139
- display: block;
140
- margin-right: 8px;
141
- margin-bottom: 2em;
142
- }
143
- .ctc-step-letter {
144
- color: #fff;
145
- font-size: 1em;
146
- width: 24px;
147
- height: 24px;
148
- padding: 8px;
149
- line-height: 1;
150
- float: right;
151
- display: block;
152
- margin-right: -8px;
153
- margin-top: 8px;
154
- }
155
- .ctc-step + strong {
156
- font-size: 1.1em;
157
- }
158
- .ctc-step + strong.shift:before {
159
- position: relative;
160
- content: '';
161
- display: block;
162
- height: 10px;
163
- }
164
  .ctc-swatch {
165
  display: block;
166
  float: left;
@@ -169,9 +131,11 @@ a.ctc-recent-tab {
169
  line-height: 1;
170
  overflow: hidden;
171
  }
 
172
  .ctc-hidden {
173
  display: none;
174
  }
 
175
  .ctc-swatch.ctc-specific {
176
  min-height: 60px;
177
  max-height: 100px;
@@ -180,15 +144,17 @@ a.ctc-recent-tab {
180
  border: 1px solid #ddd;*/
181
  }
182
  .ctc-selector-inner-container .ctc-swatch.ctc-specific {
183
- max-width: 13%;
184
  }
185
  .ctc-parent-row {
186
  clear: both;
187
  position: relative;
188
  margin: 4px 0;
189
  }
 
190
  .ctc-parent-value {
191
  }
 
192
  .ctc-input-cell {
193
  display: block;
194
  float: left;
@@ -198,7 +164,7 @@ a.ctc-recent-tab {
198
  word-wrap: break-word;
199
  }
200
  .ctc-selector-inner-container .ctc-input-cell {
201
- width: 35%;
202
  }
203
  .ctc-input-cell-wide {
204
  display: block;
@@ -206,38 +172,40 @@ a.ctc-recent-tab {
206
  width: 60%;
207
  margin-right: 2%;
208
  }
 
209
  .ctc-input-cell-wide input[type="text"] {
210
  width: 100%;
211
  }
212
- #ctc_main textarea {
 
213
  width: 100%;
214
  height: 200px;
215
- font-size: 12px;
216
- }
217
- .ctc-input-cell-wide textarea {
218
  white-space: pre;
219
  overflow: auto;
220
  font-family: inherit;
221
  word-wrap: normal;
222
  }
223
- #ctc_theme_attributes_content .ctc-input-cell-wide textarea {
224
- white-space: normal;
225
- }
226
  .ctc-save-input {
227
  }
 
228
  .ctc-selector-inner-container .ctc-button-cell, .ctc-selector-inner-container .ctc-input-cell.ctc-button-cell {
229
  width: 8%;
230
  }
 
231
  .ctc-textarea-button-cell {
232
  margin: 4px 10px 15px;
233
  /*width: 85px;*/
234
  text-align: right;
235
  float: right;
236
  }
 
237
  .ctc-selector-link {
238
  }
 
239
  .ctc-selector-handle {
240
  }
 
241
  .ctc-rewrite-toggle {
242
  font-size: 0.8em;
243
  padding-left: 1em;
@@ -246,10 +214,11 @@ a.ctc-recent-tab {
246
  }
247
  .ctc-delete-input {
248
  font-size: 0.8em;
249
- float: right;
250
  color: darkred;
251
- text-decoration: none;
252
  }
 
253
  .ctc-selector-container {
254
  clear: both;
255
  background: #f9f9f9;
@@ -266,15 +235,18 @@ a.ctc-recent-tab {
266
  -webkit-box-shadow: 0 2px 10px rgba(0,0,0,0.3);
267
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
268
  }
 
269
  .ctc-selector-inner-container {
270
  position: relative;
271
  min-height: 300px;
272
  /*max-height: 500px;*/
273
  overflow: auto;
274
  }
 
275
  .ctc-status-icon {
276
- /*max-width: 4%;*/
277
  }
 
278
  .ctc-status-icon.success {
279
  display: block;
280
  float: right;
@@ -283,6 +255,7 @@ a.ctc-recent-tab {
283
  width: 16px;
284
  margin: 4px;
285
  }
 
286
  .ctc-status-icon.failure {
287
  display: block;
288
  float: right;
@@ -291,6 +264,7 @@ a.ctc-recent-tab {
291
  width: 16px;
292
  margin: 4px;
293
  }
 
294
  .ctc-exit {
295
  display: block;
296
  width: 20px;
@@ -305,11 +279,14 @@ a.ctc-recent-tab {
305
  -webkit-border-radius: 16px;
306
  border-radius: 16px;
307
  }
 
308
  .ctc-exit:hover, .ctc-exit:active {
309
  background-position: right top;
310
  }
 
311
  .ctc-query-heading {
312
  }
 
313
  .ctc-selector-row {
314
  clear: both;
315
  margin: 0;
@@ -317,6 +294,7 @@ a.ctc-recent-tab {
317
  border-top: 1px solid #ddd;
318
  border-bottom: 1px solid #fff;
319
  }
 
320
  .ctc-input-row {
321
  clear: both;
322
  margin: 4px 0;
@@ -324,80 +302,92 @@ a.ctc-recent-tab {
324
  border-bottom: 1px solid #ddd;
325
  position: relative;
326
  }
 
327
  .ctc-selector-value {
328
  }
329
  .howto.sep {
330
  border-bottom: 1px solid #fff;
331
- margin-bottom: 1em;
332
- padding-bottom: 1em;
333
- }
334
- .howto.indent {
335
- padding-left: 1.75em;
336
- margin-top: .25em;
337
  }
338
  .ctc-selector-cell {
339
  float: left;
340
  width: 30%;
341
  margin-right: 2%;
342
  }
 
343
  .ctc-child-input-cell {
344
  display: block;
345
  float: left;
346
  margin-right: 2%;
347
  }
 
348
  .ctc-child-input-cell-container {
349
  float: left;
350
  width: 40%;
351
  margin-right: 2%;
352
  }
 
353
  .ctc-child-input-cell-container label {
354
  float: left;
355
  clear: both;
356
  width: 100px;
357
  margin-right: 2%;
358
  }
 
359
  .ctc-child-input-cell input[type="text"] {
360
  /*width:60px;*/
361
  }
 
362
  .ctc-disabled {
363
  opacity: 0.5;
364
  }
 
365
  .ctc-select {
366
  max-width: 100%;
367
  }
 
368
  .ctc-child-input-cell input[type="text"].ctc-input-wide {
369
  width: 200px;
370
  }
 
371
  #ctc_additional_css_label {
372
  cursor: pointer;
373
  }
 
374
  #ctc_additional_css_label span {
375
  white-space: nowrap;
376
  }
377
- .clearfix:before, .clearfix:after {
 
378
  content: ' ';
379
  display: table;
380
  margin: 0;
381
  padding: 0;
382
  }
 
383
  .clearfix:after, .clear {
384
  clear: both;
385
  }
 
386
  .ie7 .clearfix {
387
  zoom: 1;
388
  }
 
389
  .smaller {
390
  font-size: .85em;
391
  }
392
 
393
- .writable, .writable a {
394
  color: red;
395
  }
 
396
  /* added in 1.5.4 because it is not being loaded by the admin */
397
  .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus {
398
  background-color: #DADADA;
399
  color: #212121;
400
  }
 
401
  .ui-menu .ui-menu-item {
402
  position: relative;
403
  margin: 0px;
@@ -408,6 +398,7 @@ a.ctc-recent-tab {
408
  text-overflow: ellipsis;
409
  max-width: 450px;
410
  }
 
411
  /*** Added in 1.6.0 for new options ***/
412
  .ctc-section-toggle {
413
  /*margin:0;
@@ -415,54 +406,55 @@ a.ctc-recent-tab {
415
  position: relative;
416
  cursor: pointer;
417
  }
418
- .ctc-section-toggle:before {
 
419
  content: "\f140";
420
- font-weight: 400;
421
- font-size: 1.5em;
422
- line-height: 1;
423
- font-family: dashicons;
424
  color: #999;
425
- display: block;
426
- float: right;
427
- width: 1em;
428
- height: 1em;
429
  }
430
- .ctc-section-toggle.open:before {
 
431
  content: "\f142";
432
  }
433
  a.ctc-section-toggle, a.ctc-section-toggle:hover, a.ctc-section-toggle:active, a.ctc-section-toggle:visited {
434
  text-decoration: none;
435
- float: right;
436
- font-size: .85em;
437
- box-shadow: none;
438
- -moz-box-shadow: none;
439
- -webkit-box-shadow: none;
440
- outline: none;
441
  }
442
  .ctc-section-toggle-content {
443
  display: none;
444
  position: relative;
445
- margin: 0;
446
- padding: 1px 0;
447
  }
 
448
  /*** Added in 1.6.0 for new Theme chooser ***/
449
  .ctc-theme-only {
450
  margin: 0;
451
  padding: 0;
452
  position: relative;
453
  }
 
454
  h3.theme-name {
455
  margin: .25em 0;
456
  font-size: 1.2em;
457
  }
 
458
  .ctc-theme-option {
459
  max-width: 250px;
460
  }
 
461
  .ctc-theme-option-left {
462
  float: left;
463
  width: 40%;
464
  margin-right: 5%;
465
  }
 
466
  .ctc-theme-option-right {
467
  float: right;
468
  width: 55%;
@@ -470,38 +462,42 @@ h3.theme-name {
470
  font-size: .9em;
471
  line-height: 1.3;
472
  }
 
473
  .ctc-theme-option-image {
474
  height: auto;
475
  width: 100%;
476
  border: 1px solid #ddd;
477
  }
478
- #ctc_theme_attributes_content, #ctc_stylesheet_handling_content {
479
- padding: 1.5em 2.5em;
480
- }
481
  /* jquery UI widget classes */
482
 
483
  .ui-widget-content {
484
  border: 1px solid #aaa;
485
  background-color: #fff;
486
  }
 
487
  .ui-widget-header {
488
  border: 1px solid #aaa;
489
  background-color: #ccc;
490
  font-weight: bold;
491
  }
 
492
  .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
493
  border: 1px solid #d3d3d3;
494
  font-weight: normal;
495
  color: #555555;
496
  }
 
497
  .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus {
498
  font-weight: normal;
499
  color: #212121;
500
  }
 
501
  .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {
502
  font-weight: normal;
503
  color: #212121;
504
  }
 
505
  /* jQuery UI selectmenu classes */
506
 
507
  .ui-selectmenu-menu {
@@ -512,6 +508,7 @@ h3.theme-name {
512
  left: 0;
513
  display: none;
514
  }
 
515
  .ui-selectmenu-menu .ui-menu {
516
  overflow: auto;
517
  max-height: 372px;
@@ -519,12 +516,15 @@ h3.theme-name {
519
  /* Support: IE7 */
520
  overflow-x: hidden;/*padding-bottom: 1px;*/
521
  }
 
522
  .ui-selectmenu-menu .ui-menu .ui-menu-item {
523
  padding: 6px;
524
  }
 
525
  .ui-selectmenu-open {
526
  display: block;
527
  }
 
528
  .ui-selectmenu-button {
529
  display: inline-block;
530
  overflow: hidden;
@@ -532,8 +532,8 @@ h3.theme-name {
532
  text-decoration: none;
533
  cursor: pointer;
534
  min-width: 200px;
535
- padding: .4em 0;
536
  }
 
537
  .ui-selectmenu-button span.ui-icon {
538
  right: 0.5em;
539
  left: auto;
@@ -541,12 +541,14 @@ h3.theme-name {
541
  position: absolute;
542
  top: 50%;
543
  }
 
544
  .ui-icon-triangle-1-s:before {
545
  display: inline-block;
546
  -webkit-font-smoothing: antialiased;
547
  font: normal 20px/1 'dashicons';
548
  content: "\f140";
549
  }
 
550
  .ui-selectmenu-button span.ui-selectmenu-text {
551
  text-align: left;
552
  padding: 0.4em 2.1em 0.4em 1em;
@@ -558,37 +560,39 @@ h3.theme-name {
558
  }
559
  /* get pro tab styles */
560
  #get_pro_panel h1 {
561
- font-size: 1.75em;
562
  color: rgb(198, 66, 0);
563
  }
564
  #get_pro_panel h3 {
565
- font-size: 1.4em;
566
- margin-bottom: 0;
567
  }
 
568
  #get_pro_panel p {
569
- font-size: 1em;
570
  margin: .5em 0;
571
  }
572
- .ctc-input-cell .notice-warning, .ctc-input-cell-wide.notice-warning {
573
  margin: 0;
574
  }
575
- .ctc-input-cell-wide.notice-warning {
576
- margin-bottom: 1em;
577
  }
578
- #get_pro_panel ul, .ctc-input-cell-wide.notice-warning ul {
579
  list-style: square;
580
  }
581
- #get_pro_panel li, .ctc-input-cell-wide.notice-warning li {
582
- margin-left: 2em;
583
  }
584
  #get_pro_panel h3 a {
585
  display: block;
586
- padding: 5px 10px;
587
  background-color: rgb(198, 66, 0);
588
  color: #fff;
589
  text-decoration: none;
590
  text-align: center;
591
  }
 
592
  #get_pro_panel h3 a:hover {
593
  background-color: #FF902E;
594
  color: #fff;
@@ -597,53 +601,7 @@ h3.theme-name {
597
  max-width: 100%;
598
  height: auto;
599
  }
600
- .ctc_analyze_loading {
601
- display: inline-block;
602
- line-height: 2em;
603
- }
604
- #ctc_main .dashicons-before:before {
605
- float: left;
606
- margin-top: .5em;
607
- margin-right: .5em;
608
- font-size: 2em;
609
- content: "\f534";
610
- }
611
- #ctc_main .dashicons-before.error:before {
612
- color: #DC3232;
613
- }
614
- #ctc_main .dashicons-before.notice-warning:before {
615
- color: #FFBA00;
616
- }
617
- #ctc_main .dashicons-before.updated:before {
618
- color: #46B450;
619
- content: "\f147";
620
- }
621
- /* big buttons that are hard to miss */
622
 
623
- .wp-core-ui .button-primary, .wp-core-ui .button-secondary {
624
- border-color: none;
625
- text-shadow: none;
626
- font-size: 1.3em;
627
- line-height: 1.3;
628
- height: auto;
629
- margin: 0;
630
- padding: .5em 1em;
631
- border: none;
632
- -webkit-border-radius: 3px;
633
- border-radius: 3px;
634
- }
635
- /* fixed position debug output */
636
- #ctc_main textarea#ctc_debug_box {
637
- position: fixed;
638
- bottom: 0;
639
- z-index: 10000;
640
- width: 82%;
641
- height: 170px;
642
- font-size:11px;
643
- }
644
- #ctc_stylesheet_files {
645
- display:none;
646
- }
647
  /***
648
  Spectrum Colorpicker v1.7.0
649
  https://github.com/bgrins/spectrum
@@ -652,12 +610,12 @@ License: MIT
652
  ***/
653
 
654
  .sp-container {
655
- position: absolute;
656
- top: 0;
657
- left: 0;
658
- display: inline-block;
659
- *display: inline;
660
- *zoom: 1;
661
  /* https://github.com/bgrins/spectrum/issues/40 */
662
  z-index: 9999994;
663
  overflow: hidden;
@@ -665,54 +623,60 @@ License: MIT
665
  .sp-container.sp-flat {
666
  position: relative;
667
  }
 
668
  /* Fix for * { box-sizing: border-box; } */
669
- .sp-container, .sp-container * {
 
670
  -webkit-box-sizing: content-box;
671
- -moz-box-sizing: content-box;
672
- box-sizing: content-box;
673
  }
 
674
  /* http://ansciath.tumblr.com/post/7347495869/css-aspect-ratio */
675
  .sp-top {
676
- position: relative;
677
- width: 100%;
678
- display: inline-block;
679
  }
680
  .sp-top-inner {
681
- position: absolute;
682
- top: 0;
683
- left: 0;
684
- bottom: 0;
685
- right: 0;
686
  }
687
  .sp-color {
688
  position: absolute;
689
- top: 0;
690
- left: 0;
691
- bottom: 0;
692
- right: 20%;
693
  }
694
  .sp-hue {
695
  position: absolute;
696
- top: 0;
697
- right: 0;
698
- bottom: 0;
699
- left: 84%;
700
  height: 100%;
701
  }
 
702
  .sp-clear-enabled .sp-hue {
703
- top: 33px;
704
  height: 77.5%;
705
  }
 
706
  .sp-fill {
707
  padding-top: 80%;
708
  }
709
  .sp-sat, .sp-val {
710
  position: absolute;
711
- top: 0;
712
- left: 0;
713
- right: 0;
714
- bottom: 0;
715
  }
 
716
  .sp-alpha-enabled .sp-top {
717
  margin-bottom: 18px;
718
  }
@@ -720,8 +684,8 @@ License: MIT
720
  display: block;
721
  }
722
  .sp-alpha-handle {
723
- position: absolute;
724
- top: -4px;
725
  bottom: -4px;
726
  width: 6px;
727
  left: 50%;
@@ -741,28 +705,33 @@ License: MIT
741
  .sp-alpha-inner {
742
  border: solid 1px #333;
743
  }
 
744
  .sp-clear {
745
  display: none;
746
  }
 
747
  .sp-clear.sp-clear-display {
748
  background-position: center;
749
  }
 
750
  .sp-clear-enabled .sp-clear {
751
  display: block;
752
- position: absolute;
753
- top: 0px;
754
- right: 0;
755
- bottom: 0;
756
- left: 84%;
757
  height: 28px;
758
  }
 
759
  /* Don't allow text selection */
760
- .sp-container, .sp-replacer, .sp-preview, .sp-dragger, .sp-slider, .sp-alpha, .sp-clear, .sp-alpha-handle, .sp-container.sp-dragging .sp-input, .sp-container button {
761
- -webkit-user-select: none;
762
  -moz-user-select: -moz-none;
763
- -o-user-select: none;
764
  user-select: none;
765
  }
 
766
  .sp-container.sp-input-disabled .sp-input-container {
767
  display: none;
768
  }
@@ -778,19 +747,22 @@ License: MIT
778
  .sp-palette-disabled .sp-palette-container {
779
  display: none;
780
  }
 
781
  .sp-initial-disabled .sp-initial {
782
  display: none;
783
  }
 
 
784
  /* Gradients for hue, saturation and value instead of images. Not pretty... but it works */
785
  .sp-sat {
786
- background-image: -webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0)));
787
  background-image: -webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0));
788
  background-image: -moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
789
  background-image: -o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
790
  background-image: -ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
791
  background-image: linear-gradient(to right, #fff, rgba(204, 154, 129, 0));
792
  -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";
793
- filter : progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr='#FFFFFFFF', endColorstr='#00CC9A81');
794
  }
795
  .sp-val {
796
  background-image: -webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));
@@ -800,8 +772,9 @@ License: MIT
800
  background-image: -ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
801
  background-image: linear-gradient(to top, #000, rgba(204, 154, 129, 0));
802
  -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";
803
- filter : progid:DXImageTransform.Microsoft.gradient(startColorstr='#00CC9A81', endColorstr='#FF000000');
804
  }
 
805
  .sp-hue {
806
  background: -moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
807
  background: -ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
@@ -810,76 +783,66 @@ License: MIT
810
  background: -webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
811
  background: linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
812
  }
 
813
  /* IE filters do not support multiple color stops.
814
  Generate 6 divs, line them up, and do two color gradients for each.
815
  Yes, really.
816
  */
817
  .sp-1 {
818
- height: 17%;
819
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0000', endColorstr='#ffff00');
820
  }
821
  .sp-2 {
822
- height: 16%;
823
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff00', endColorstr='#00ff00');
824
  }
825
  .sp-3 {
826
- height: 17%;
827
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ff00', endColorstr='#00ffff');
828
  }
829
  .sp-4 {
830
- height: 17%;
831
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffff', endColorstr='#0000ff');
832
  }
833
  .sp-5 {
834
- height: 16%;
835
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0000ff', endColorstr='#ff00ff');
836
  }
837
  .sp-6 {
838
- height: 17%;
839
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff00ff', endColorstr='#ff0000');
840
  }
 
841
  .sp-hidden {
842
  display: none !important;
843
  }
 
844
  /* Clearfix hack */
845
- .sp-cf:before, .sp-cf:after {
846
- content: "";
847
- display: table;
848
- }
849
- .sp-cf:after {
850
- clear: both;
851
- }
852
- .sp-cf {
853
- *zoom: 1;
854
- }
855
 
856
  /* Mobile devices, make hue slider bigger so it is easier to slide */
857
  @media (max-device-width: 480px) {
858
- .sp-color {
859
- right: 40%;
860
- }
861
- .sp-hue {
862
- left: 63%;
863
- }
864
- .sp-fill {
865
- padding-top: 60%;
866
- }
867
  }
868
  .sp-dragger {
869
- border-radius: 5px;
870
- height: 5px;
871
- width: 5px;
872
- border: 1px solid #fff;
873
- background: #000;
874
- cursor: pointer;
875
- position: absolute;
876
- top: 0;
877
- left: 0;
878
  }
879
  .sp-slider {
880
  position: absolute;
881
- top: 0;
882
- cursor: pointer;
883
  height: 3px;
884
  left: -1px;
885
  right: -1px;
@@ -887,6 +850,7 @@ License: MIT
887
  background: white;
888
  opacity: .8;
889
  }
 
890
  /*
891
  Theme authors:
892
  Here are the basic themeable display options (colors, fonts, global widths).
@@ -912,34 +876,35 @@ See http://bgrins.github.io/spectrum/themes/ for instructions.
912
  .sp-color, .sp-hue, .sp-clear {
913
  border: solid 1px #666;
914
  }
 
915
  /* Input */
916
  .sp-input-container {
917
- float: right;
918
  width: 100px;
919
  margin-bottom: 4px;
920
  }
921
- .sp-initial-disabled .sp-input-container {
922
  width: 100%;
923
  }
924
  .sp-input {
925
- font-size: 12px !important;
926
- border: 1px inset;
927
- padding: 4px 5px;
928
- margin: 0;
929
- width: 100%;
930
- background: transparent;
931
- border-radius: 3px;
932
- color: #222;
933
- }
934
- .sp-input:focus {
935
  border: 1px solid orange;
936
  }
937
  .sp-input.sp-validation-error {
938
  border: 1px solid red;
939
  background: #fdd;
940
  }
941
- .sp-picker-container, .sp-palette-container {
942
- float: left;
943
  position: relative;
944
  padding: 10px;
945
  padding-bottom: 300px;
@@ -949,30 +914,34 @@ See http://bgrins.github.io/spectrum/themes/ for instructions.
949
  width: 172px;
950
  border-left: solid 1px #fff;
951
  }
 
952
  /* Palettes */
953
  .sp-palette-container {
954
  border-right: solid 1px #ccc;
955
  max-width: 60px;
956
  }
 
957
  .sp-palette-only .sp-palette-container {
958
  border: 0;
959
  }
 
960
  .sp-palette .sp-thumb-el {
961
  display: block;
962
- position: relative;
963
- float: left;
964
  width: 24px;
965
  height: 15px;
966
  margin: 3px;
967
  cursor: pointer;
968
- border: solid 2px transparent;
969
  }
970
  .sp-palette .sp-thumb-el:hover, .sp-palette .sp-thumb-el.sp-thumb-active {
971
  border-color: orange;
972
  }
973
  .sp-thumb-el {
974
- position: relative;
975
  }
 
976
  /* Initial */
977
  .sp-initial {
978
  float: left;
@@ -981,27 +950,31 @@ See http://bgrins.github.io/spectrum/themes/ for instructions.
981
  .sp-initial span {
982
  width: 30px;
983
  height: 25px;
984
- border: none;
985
- display: block;
986
- float: left;
987
- margin: 0;
988
  }
 
989
  .sp-initial .sp-clear-display {
990
  background-position: center;
991
  }
 
992
  /* Buttons */
993
- .sp-palette-button-container, .sp-button-container {
 
994
  float: right;
995
  }
 
996
  /* Replacer (the little preview div that shows up instead of the <input>) */
997
  .sp-replacer {
998
- margin: 0;
999
- overflow: hidden;
1000
- cursor: pointer;
1001
  padding: 4px;
1002
- display: inline-block;
1003
- *zoom: 1;
1004
- *display: inline;
1005
  border: solid 1px #91765d;
1006
  background: #eee;
1007
  color: #333;
@@ -1012,7 +985,7 @@ See http://bgrins.github.io/spectrum/themes/ for instructions.
1012
  color: #111;
1013
  }
1014
  .sp-replacer.sp-disabled {
1015
- cursor: default;
1016
  border-color: silver;
1017
  color: silver;
1018
  }
@@ -1020,50 +993,54 @@ See http://bgrins.github.io/spectrum/themes/ for instructions.
1020
  padding: 2px 0;
1021
  height: 16px;
1022
  line-height: 16px;
1023
- float: left;
1024
- font-size: 10px;
1025
- font-family: sans-serif;
1026
  }
1027
  .sp-preview {
1028
- position: relative;
1029
- width: 25px;
1030
  height: 20px;
1031
  border: solid 1px #222;
1032
  margin-right: 5px;
1033
- float: left;
1034
  z-index: 0;
1035
  }
 
1036
  .sp-palette {
1037
- *width: 220px;
1038
  max-width: 220px;
1039
  }
1040
  .sp-palette .sp-thumb-el {
1041
- width: 16px;
1042
  height: 16px;
1043
- margin: 2px 1px;
1044
  border: solid 1px #d0d0d0;
1045
  }
 
1046
  .sp-container {
1047
- padding-bottom: 0;
1048
  }
 
 
1049
  /* Buttons: http://hellohappy.org/css3-buttons/ */
1050
  .sp-container button {
1051
- background-color: #eeeeee;
1052
- background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);
1053
- background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
1054
- background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);
1055
- background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
1056
- background-image: linear-gradient(to bottom, #eeeeee, #cccccc);
1057
- border: 1px solid #ccc;
1058
- border-bottom: 1px solid #bbb;
1059
- border-radius: 3px;
1060
- color: #333;
1061
- font-size: 14px;
1062
- line-height: 1;
1063
- padding: 5px 4px;
1064
- text-align: center;
1065
- text-shadow: 0 1px 0 #eee;
1066
- vertical-align: middle;
1067
  }
1068
  .sp-container button:hover {
1069
  background-color: #dddddd;
@@ -1089,43 +1066,48 @@ See http://bgrins.github.io/spectrum/themes/ for instructions.
1089
  .sp-cancel {
1090
  font-size: 11px;
1091
  color: #d93f3f !important;
1092
- margin: 0;
1093
- padding: 2px;
1094
  margin-right: 5px;
1095
  vertical-align: middle;
1096
- text-decoration: none;
 
1097
  }
1098
  .sp-cancel:hover {
1099
  color: #d93f3f !important;
1100
  text-decoration: underline;
1101
  }
 
 
1102
  .sp-palette span:hover, .sp-palette span.sp-thumb-active {
1103
  border-color: #000;
1104
  }
 
1105
  .sp-preview, .sp-alpha, .sp-thumb-el {
1106
- position: relative;
1107
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);
1108
  }
1109
  .sp-preview-inner, .sp-alpha-inner, .sp-thumb-inner {
1110
- display: block;
1111
- position: absolute;
1112
- top: 0;
1113
- left: 0;
1114
- bottom: 0;
1115
- right: 0;
1116
  }
 
1117
  .sp-palette .sp-thumb-inner {
1118
  background-position: 50% 50%;
1119
  background-repeat: no-repeat;
1120
  }
 
1121
  .sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner {
1122
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=);
1123
  }
 
1124
  .sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner {
1125
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=);
1126
  }
 
1127
  .sp-clear-display {
1128
- background-repeat: no-repeat;
1129
  background-position: center;
1130
  background-image: url(data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAJmZmZ2dnZ6enqKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq/Hx8fLy8vT09PX19ff39/j4+Pn5+fr6+vv7+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==);
1131
  }
1
  body {
2
+ background:none !important;
3
  }
4
  p {
5
+ line-height:1.4;
6
  }
7
  .wrap h1, .wrap h2 {
8
  font-size: 23px;
26
  font-size: 13px;
27
  padding: 6px 8px;
28
  font-weight: 700;
29
+ line-height: 24px;
 
 
 
 
30
  }
31
  .ctc-option-panel-container {
32
  position: relative;
33
  min-height: 1100px;
34
+ width:100%;
35
  overflow: auto;
36
  }
37
  .ctc-three-col {
38
+ -moz-columns:3;
39
+ -moz-column-gap:3em;
40
+ -webkit-columns:3;
41
+ -webkit-column-gap:3em;
42
+ columns:3;
43
+ column-gap:3em;
44
  }
45
  #ctc_recent_selectors ul li, #all_styles_panel ul li {
46
  margin: 0;
47
  }
48
+
49
  #ctc_recent_selectors ul li a, #all_styles_panel ul li a {
50
  text-decoration: none;
51
  font-size: .8em;
54
  display: block;
55
  padding: .5em;
56
  }
57
+
58
  #ctc_recent_selectors ul li a:hover, #ctc_recent_selectors ul li a:focus, #all_styles_panel ul li a:hover, #all_styles_panel ul li a:focus {
59
  background-color: #fff;
60
  -webkit-box-shadow: none;
61
  -moz-box-shadow: none;
62
  box-shadow: none;
63
  }
64
+
65
  #view_child_options_panel, #view_parnt_options_panel {
66
  white-space: pre;
67
  overflow: auto;
68
  font-family: monospace;
69
  word-wrap: normal;
70
  }
71
+
72
  .ctc-option-panel {
73
  visibility: hidden;
74
  position: absolute;
76
  width: 100%;
77
  top: 0;
78
  left: 0;
79
+ padding: 10px 0 0;
80
+ /* transition: width 1s ease;
81
  -moz-transition: width 1s ease;
82
  -webkit-transition: width 1s ease;
83
  -o-transition: width 1s ease; */
84
  }
85
  .ctc-recent-container {
86
+ top:0;
87
+ right:0;
88
+ position:absolute;
89
  max-width: 200px;
90
  width: 17%;
91
  display: none;
92
  overflow: auto;
93
+ visibility:visible;
94
+ left:inherit;
95
  background-color: #E4E4E4;
96
  }
97
  #ctc_recent_selectors {
102
  min-height: 1100px;
103
  }
104
  a.ctc-recent-tab {
105
+ float:right;
106
+ border:1px solid #ccc;
107
  border-bottom: none;
108
  background-color: #E4E4E4;
109
  color: #555;
110
  display: inline-block;
111
  text-decoration: none;
112
  margin: -1px 0 0 0;
113
+ /* margin: 1px 0 -1px; */
114
  box-shadow: none;
115
+ -moz-box-shadow:none;
116
  -webkit-box-shadow: none;
117
+ outline:none;
118
  }
119
  .ctc-recent-tab h3 {
120
  }
121
+
122
  .ctc-option-panel-active {
123
  visibility: visible;
124
  }
125
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  .ctc-swatch {
127
  display: block;
128
  float: left;
131
  line-height: 1;
132
  overflow: hidden;
133
  }
134
+
135
  .ctc-hidden {
136
  display: none;
137
  }
138
+
139
  .ctc-swatch.ctc-specific {
140
  min-height: 60px;
141
  max-height: 100px;
144
  border: 1px solid #ddd;*/
145
  }
146
  .ctc-selector-inner-container .ctc-swatch.ctc-specific {
147
+ max-width:13%;
148
  }
149
  .ctc-parent-row {
150
  clear: both;
151
  position: relative;
152
  margin: 4px 0;
153
  }
154
+
155
  .ctc-parent-value {
156
  }
157
+
158
  .ctc-input-cell {
159
  display: block;
160
  float: left;
164
  word-wrap: break-word;
165
  }
166
  .ctc-selector-inner-container .ctc-input-cell {
167
+ width:35%;
168
  }
169
  .ctc-input-cell-wide {
170
  display: block;
172
  width: 60%;
173
  margin-right: 2%;
174
  }
175
+
176
  .ctc-input-cell-wide input[type="text"] {
177
  width: 100%;
178
  }
179
+
180
+ .ctc-input-cell-wide textarea {
181
  width: 100%;
182
  height: 200px;
 
 
 
183
  white-space: pre;
184
  overflow: auto;
185
  font-family: inherit;
186
  word-wrap: normal;
187
  }
188
+
 
 
189
  .ctc-save-input {
190
  }
191
+
192
  .ctc-selector-inner-container .ctc-button-cell, .ctc-selector-inner-container .ctc-input-cell.ctc-button-cell {
193
  width: 8%;
194
  }
195
+
196
  .ctc-textarea-button-cell {
197
  margin: 4px 10px 15px;
198
  /*width: 85px;*/
199
  text-align: right;
200
  float: right;
201
  }
202
+
203
  .ctc-selector-link {
204
  }
205
+
206
  .ctc-selector-handle {
207
  }
208
+
209
  .ctc-rewrite-toggle {
210
  font-size: 0.8em;
211
  padding-left: 1em;
214
  }
215
  .ctc-delete-input {
216
  font-size: 0.8em;
217
+ float:right;
218
  color: darkred;
219
+ text-decoration:none;
220
  }
221
+
222
  .ctc-selector-container {
223
  clear: both;
224
  background: #f9f9f9;
235
  -webkit-box-shadow: 0 2px 10px rgba(0,0,0,0.3);
236
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
237
  }
238
+
239
  .ctc-selector-inner-container {
240
  position: relative;
241
  min-height: 300px;
242
  /*max-height: 500px;*/
243
  overflow: auto;
244
  }
245
+
246
  .ctc-status-icon {
247
+ /*max-width: 4%;*/
248
  }
249
+
250
  .ctc-status-icon.success {
251
  display: block;
252
  float: right;
255
  width: 16px;
256
  margin: 4px;
257
  }
258
+
259
  .ctc-status-icon.failure {
260
  display: block;
261
  float: right;
264
  width: 16px;
265
  margin: 4px;
266
  }
267
+
268
  .ctc-exit {
269
  display: block;
270
  width: 20px;
279
  -webkit-border-radius: 16px;
280
  border-radius: 16px;
281
  }
282
+
283
  .ctc-exit:hover, .ctc-exit:active {
284
  background-position: right top;
285
  }
286
+
287
  .ctc-query-heading {
288
  }
289
+
290
  .ctc-selector-row {
291
  clear: both;
292
  margin: 0;
294
  border-top: 1px solid #ddd;
295
  border-bottom: 1px solid #fff;
296
  }
297
+
298
  .ctc-input-row {
299
  clear: both;
300
  margin: 4px 0;
302
  border-bottom: 1px solid #ddd;
303
  position: relative;
304
  }
305
+
306
  .ctc-selector-value {
307
  }
308
  .howto.sep {
309
  border-bottom: 1px solid #fff;
310
+ margin-bottom: .5em;
311
+ padding-bottom: .5em;
 
 
 
 
312
  }
313
  .ctc-selector-cell {
314
  float: left;
315
  width: 30%;
316
  margin-right: 2%;
317
  }
318
+
319
  .ctc-child-input-cell {
320
  display: block;
321
  float: left;
322
  margin-right: 2%;
323
  }
324
+
325
  .ctc-child-input-cell-container {
326
  float: left;
327
  width: 40%;
328
  margin-right: 2%;
329
  }
330
+
331
  .ctc-child-input-cell-container label {
332
  float: left;
333
  clear: both;
334
  width: 100px;
335
  margin-right: 2%;
336
  }
337
+
338
  .ctc-child-input-cell input[type="text"] {
339
  /*width:60px;*/
340
  }
341
+
342
  .ctc-disabled {
343
  opacity: 0.5;
344
  }
345
+
346
  .ctc-select {
347
  max-width: 100%;
348
  }
349
+
350
  .ctc-child-input-cell input[type="text"].ctc-input-wide {
351
  width: 200px;
352
  }
353
+
354
  #ctc_additional_css_label {
355
  cursor: pointer;
356
  }
357
+
358
  #ctc_additional_css_label span {
359
  white-space: nowrap;
360
  }
361
+
362
+ .clearfix:after, .clearfix:before {
363
  content: ' ';
364
  display: table;
365
  margin: 0;
366
  padding: 0;
367
  }
368
+
369
  .clearfix:after, .clear {
370
  clear: both;
371
  }
372
+
373
  .ie7 .clearfix {
374
  zoom: 1;
375
  }
376
+
377
  .smaller {
378
  font-size: .85em;
379
  }
380
 
381
+ .writable {
382
  color: red;
383
  }
384
+
385
  /* added in 1.5.4 because it is not being loaded by the admin */
386
  .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus {
387
  background-color: #DADADA;
388
  color: #212121;
389
  }
390
+
391
  .ui-menu .ui-menu-item {
392
  position: relative;
393
  margin: 0px;
398
  text-overflow: ellipsis;
399
  max-width: 450px;
400
  }
401
+
402
  /*** Added in 1.6.0 for new options ***/
403
  .ctc-section-toggle {
404
  /*margin:0;
406
  position: relative;
407
  cursor: pointer;
408
  }
409
+
410
+ .ctc-section-toggle:after {
411
  content: "\f140";
412
+ font: 400 20px/1 dashicons;
 
 
 
413
  color: #999;
414
+ vertical-align: bottom;
 
 
 
415
  }
416
+
417
+ .ctc-section-toggle.open:after {
418
  content: "\f142";
419
  }
420
  a.ctc-section-toggle, a.ctc-section-toggle:hover, a.ctc-section-toggle:active, a.ctc-section-toggle:visited {
421
  text-decoration: none;
422
+ float:right;
423
+ font-size:.85em;
424
+ box-shadow:none;
425
+ -moz-box-shadow:none;
426
+ -webkit-box-shadow:none;
427
+ outline:none;
428
  }
429
  .ctc-section-toggle-content {
430
  display: none;
431
  position: relative;
432
+ margin:0;
433
+ padding:1px 0;
434
  }
435
+
436
  /*** Added in 1.6.0 for new Theme chooser ***/
437
  .ctc-theme-only {
438
  margin: 0;
439
  padding: 0;
440
  position: relative;
441
  }
442
+
443
  h3.theme-name {
444
  margin: .25em 0;
445
  font-size: 1.2em;
446
  }
447
+
448
  .ctc-theme-option {
449
  max-width: 250px;
450
  }
451
+
452
  .ctc-theme-option-left {
453
  float: left;
454
  width: 40%;
455
  margin-right: 5%;
456
  }
457
+
458
  .ctc-theme-option-right {
459
  float: right;
460
  width: 55%;
462
  font-size: .9em;
463
  line-height: 1.3;
464
  }
465
+
466
  .ctc-theme-option-image {
467
  height: auto;
468
  width: 100%;
469
  border: 1px solid #ddd;
470
  }
471
+
 
 
472
  /* jquery UI widget classes */
473
 
474
  .ui-widget-content {
475
  border: 1px solid #aaa;
476
  background-color: #fff;
477
  }
478
+
479
  .ui-widget-header {
480
  border: 1px solid #aaa;
481
  background-color: #ccc;
482
  font-weight: bold;
483
  }
484
+
485
  .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default {
486
  border: 1px solid #d3d3d3;
487
  font-weight: normal;
488
  color: #555555;
489
  }
490
+
491
  .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus {
492
  font-weight: normal;
493
  color: #212121;
494
  }
495
+
496
  .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {
497
  font-weight: normal;
498
  color: #212121;
499
  }
500
+
501
  /* jQuery UI selectmenu classes */
502
 
503
  .ui-selectmenu-menu {
508
  left: 0;
509
  display: none;
510
  }
511
+
512
  .ui-selectmenu-menu .ui-menu {
513
  overflow: auto;
514
  max-height: 372px;
516
  /* Support: IE7 */
517
  overflow-x: hidden;/*padding-bottom: 1px;*/
518
  }
519
+
520
  .ui-selectmenu-menu .ui-menu .ui-menu-item {
521
  padding: 6px;
522
  }
523
+
524
  .ui-selectmenu-open {
525
  display: block;
526
  }
527
+
528
  .ui-selectmenu-button {
529
  display: inline-block;
530
  overflow: hidden;
532
  text-decoration: none;
533
  cursor: pointer;
534
  min-width: 200px;
 
535
  }
536
+
537
  .ui-selectmenu-button span.ui-icon {
538
  right: 0.5em;
539
  left: auto;
541
  position: absolute;
542
  top: 50%;
543
  }
544
+
545
  .ui-icon-triangle-1-s:before {
546
  display: inline-block;
547
  -webkit-font-smoothing: antialiased;
548
  font: normal 20px/1 'dashicons';
549
  content: "\f140";
550
  }
551
+
552
  .ui-selectmenu-button span.ui-selectmenu-text {
553
  text-align: left;
554
  padding: 0.4em 2.1em 0.4em 1em;
560
  }
561
  /* get pro tab styles */
562
  #get_pro_panel h1 {
563
+ font-size:1.75em;
564
  color: rgb(198, 66, 0);
565
  }
566
  #get_pro_panel h3 {
567
+ font-size:1.4em;
568
+ margin-bottom:0;
569
  }
570
+
571
  #get_pro_panel p {
572
+ font-size:1em;
573
  margin: .5em 0;
574
  }
575
+ .ctc-input-cell .update-nag, .ctc-input-cell-wide.update-nag {
576
  margin: 0;
577
  }
578
+ .ctc-input-cell-wide.update-nag {
579
+ margin-bottom:1em;
580
  }
581
+ #get_pro_panel ul, .ctc-input-cell-wide.update-nag ul {
582
  list-style: square;
583
  }
584
+ #get_pro_panel li, .ctc-input-cell-wide.update-nag li {
585
+ margin-left:2em;
586
  }
587
  #get_pro_panel h3 a {
588
  display: block;
589
+ padding:5px 10px;
590
  background-color: rgb(198, 66, 0);
591
  color: #fff;
592
  text-decoration: none;
593
  text-align: center;
594
  }
595
+
596
  #get_pro_panel h3 a:hover {
597
  background-color: #FF902E;
598
  color: #fff;
601
  max-width: 100%;
602
  height: auto;
603
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
604
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
605
  /***
606
  Spectrum Colorpicker v1.7.0
607
  https://github.com/bgrins/spectrum
610
  ***/
611
 
612
  .sp-container {
613
+ position:absolute;
614
+ top:0;
615
+ left:0;
616
+ display:inline-block;
617
+ *display: inline;
618
+ *zoom: 1;
619
  /* https://github.com/bgrins/spectrum/issues/40 */
620
  z-index: 9999994;
621
  overflow: hidden;
623
  .sp-container.sp-flat {
624
  position: relative;
625
  }
626
+
627
  /* Fix for * { box-sizing: border-box; } */
628
+ .sp-container,
629
+ .sp-container * {
630
  -webkit-box-sizing: content-box;
631
+ -moz-box-sizing: content-box;
632
+ box-sizing: content-box;
633
  }
634
+
635
  /* http://ansciath.tumblr.com/post/7347495869/css-aspect-ratio */
636
  .sp-top {
637
+ position:relative;
638
+ width: 100%;
639
+ display:inline-block;
640
  }
641
  .sp-top-inner {
642
+ position:absolute;
643
+ top:0;
644
+ left:0;
645
+ bottom:0;
646
+ right:0;
647
  }
648
  .sp-color {
649
  position: absolute;
650
+ top:0;
651
+ left:0;
652
+ bottom:0;
653
+ right:20%;
654
  }
655
  .sp-hue {
656
  position: absolute;
657
+ top:0;
658
+ right:0;
659
+ bottom:0;
660
+ left:84%;
661
  height: 100%;
662
  }
663
+
664
  .sp-clear-enabled .sp-hue {
665
+ top:33px;
666
  height: 77.5%;
667
  }
668
+
669
  .sp-fill {
670
  padding-top: 80%;
671
  }
672
  .sp-sat, .sp-val {
673
  position: absolute;
674
+ top:0;
675
+ left:0;
676
+ right:0;
677
+ bottom:0;
678
  }
679
+
680
  .sp-alpha-enabled .sp-top {
681
  margin-bottom: 18px;
682
  }
684
  display: block;
685
  }
686
  .sp-alpha-handle {
687
+ position:absolute;
688
+ top:-4px;
689
  bottom: -4px;
690
  width: 6px;
691
  left: 50%;
705
  .sp-alpha-inner {
706
  border: solid 1px #333;
707
  }
708
+
709
  .sp-clear {
710
  display: none;
711
  }
712
+
713
  .sp-clear.sp-clear-display {
714
  background-position: center;
715
  }
716
+
717
  .sp-clear-enabled .sp-clear {
718
  display: block;
719
+ position:absolute;
720
+ top:0px;
721
+ right:0;
722
+ bottom:0;
723
+ left:84%;
724
  height: 28px;
725
  }
726
+
727
  /* Don't allow text selection */
728
+ .sp-container, .sp-replacer, .sp-preview, .sp-dragger, .sp-slider, .sp-alpha, .sp-clear, .sp-alpha-handle, .sp-container.sp-dragging .sp-input, .sp-container button {
729
+ -webkit-user-select:none;
730
  -moz-user-select: -moz-none;
731
+ -o-user-select:none;
732
  user-select: none;
733
  }
734
+
735
  .sp-container.sp-input-disabled .sp-input-container {
736
  display: none;
737
  }
747
  .sp-palette-disabled .sp-palette-container {
748
  display: none;
749
  }
750
+
751
  .sp-initial-disabled .sp-initial {
752
  display: none;
753
  }
754
+
755
+
756
  /* Gradients for hue, saturation and value instead of images. Not pretty... but it works */
757
  .sp-sat {
758
+ background-image: -webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0)));
759
  background-image: -webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0));
760
  background-image: -moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
761
  background-image: -o-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
762
  background-image: -ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0));
763
  background-image: linear-gradient(to right, #fff, rgba(204, 154, 129, 0));
764
  -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";
765
+ filter : progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr='#FFFFFFFF', endColorstr='#00CC9A81');
766
  }
767
  .sp-val {
768
  background-image: -webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0)));
772
  background-image: -ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0));
773
  background-image: linear-gradient(to top, #000, rgba(204, 154, 129, 0));
774
  -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";
775
+ filter : progid:DXImageTransform.Microsoft.gradient(startColorstr='#00CC9A81', endColorstr='#FF000000');
776
  }
777
+
778
  .sp-hue {
779
  background: -moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
780
  background: -ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
783
  background: -webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
784
  background: linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
785
  }
786
+
787
  /* IE filters do not support multiple color stops.
788
  Generate 6 divs, line them up, and do two color gradients for each.
789
  Yes, really.
790
  */
791
  .sp-1 {
792
+ height:17%;
793
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0000', endColorstr='#ffff00');
794
  }
795
  .sp-2 {
796
+ height:16%;
797
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff00', endColorstr='#00ff00');
798
  }
799
  .sp-3 {
800
+ height:17%;
801
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ff00', endColorstr='#00ffff');
802
  }
803
  .sp-4 {
804
+ height:17%;
805
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffff', endColorstr='#0000ff');
806
  }
807
  .sp-5 {
808
+ height:16%;
809
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0000ff', endColorstr='#ff00ff');
810
  }
811
  .sp-6 {
812
+ height:17%;
813
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff00ff', endColorstr='#ff0000');
814
  }
815
+
816
  .sp-hidden {
817
  display: none !important;
818
  }
819
+
820
  /* Clearfix hack */
821
+ .sp-cf:before, .sp-cf:after { content: ""; display: table; }
822
+ .sp-cf:after { clear: both; }
823
+ .sp-cf { *zoom: 1; }
 
 
 
 
 
 
 
824
 
825
  /* Mobile devices, make hue slider bigger so it is easier to slide */
826
  @media (max-device-width: 480px) {
827
+ .sp-color { right: 40%; }
828
+ .sp-hue { left: 63%; }
829
+ .sp-fill { padding-top: 60%; }
 
 
 
 
 
 
830
  }
831
  .sp-dragger {
832
+ border-radius: 5px;
833
+ height: 5px;
834
+ width: 5px;
835
+ border: 1px solid #fff;
836
+ background: #000;
837
+ cursor: pointer;
838
+ position:absolute;
839
+ top:0;
840
+ left: 0;
841
  }
842
  .sp-slider {
843
  position: absolute;
844
+ top:0;
845
+ cursor:pointer;
846
  height: 3px;
847
  left: -1px;
848
  right: -1px;
850
  background: white;
851
  opacity: .8;
852
  }
853
+
854
  /*
855
  Theme authors:
856
  Here are the basic themeable display options (colors, fonts, global widths).
876
  .sp-color, .sp-hue, .sp-clear {
877
  border: solid 1px #666;
878
  }
879
+
880
  /* Input */
881
  .sp-input-container {
882
+ float:right;
883
  width: 100px;
884
  margin-bottom: 4px;
885
  }
886
+ .sp-initial-disabled .sp-input-container {
887
  width: 100%;
888
  }
889
  .sp-input {
890
+ font-size: 12px !important;
891
+ border: 1px inset;
892
+ padding: 4px 5px;
893
+ margin: 0;
894
+ width: 100%;
895
+ background:transparent;
896
+ border-radius: 3px;
897
+ color: #222;
898
+ }
899
+ .sp-input:focus {
900
  border: 1px solid orange;
901
  }
902
  .sp-input.sp-validation-error {
903
  border: 1px solid red;
904
  background: #fdd;
905
  }
906
+ .sp-picker-container , .sp-palette-container {
907
+ float:left;
908
  position: relative;
909
  padding: 10px;
910
  padding-bottom: 300px;
914
  width: 172px;
915
  border-left: solid 1px #fff;
916
  }
917
+
918
  /* Palettes */
919
  .sp-palette-container {
920
  border-right: solid 1px #ccc;
921
  max-width: 60px;
922
  }
923
+
924
  .sp-palette-only .sp-palette-container {
925
  border: 0;
926
  }
927
+
928
  .sp-palette .sp-thumb-el {
929
  display: block;
930
+ position:relative;
931
+ float:left;
932
  width: 24px;
933
  height: 15px;
934
  margin: 3px;
935
  cursor: pointer;
936
+ border:solid 2px transparent;
937
  }
938
  .sp-palette .sp-thumb-el:hover, .sp-palette .sp-thumb-el.sp-thumb-active {
939
  border-color: orange;
940
  }
941
  .sp-thumb-el {
942
+ position:relative;
943
  }
944
+
945
  /* Initial */
946
  .sp-initial {
947
  float: left;
950
  .sp-initial span {
951
  width: 30px;
952
  height: 25px;
953
+ border:none;
954
+ display:block;
955
+ float:left;
956
+ margin:0;
957
  }
958
+
959
  .sp-initial .sp-clear-display {
960
  background-position: center;
961
  }
962
+
963
  /* Buttons */
964
+ .sp-palette-button-container,
965
+ .sp-button-container {
966
  float: right;
967
  }
968
+
969
  /* Replacer (the little preview div that shows up instead of the <input>) */
970
  .sp-replacer {
971
+ margin:0;
972
+ overflow:hidden;
973
+ cursor:pointer;
974
  padding: 4px;
975
+ display:inline-block;
976
+ *zoom: 1;
977
+ *display: inline;
978
  border: solid 1px #91765d;
979
  background: #eee;
980
  color: #333;
985
  color: #111;
986
  }
987
  .sp-replacer.sp-disabled {
988
+ cursor:default;
989
  border-color: silver;
990
  color: silver;
991
  }
993
  padding: 2px 0;
994
  height: 16px;
995
  line-height: 16px;
996
+ float:left;
997
+ font-size:10px;
998
+ font-family:sans-serif;
999
  }
1000
  .sp-preview {
1001
+ position:relative;
1002
+ width:25px;
1003
  height: 20px;
1004
  border: solid 1px #222;
1005
  margin-right: 5px;
1006
+ float:left;
1007
  z-index: 0;
1008
  }
1009
+
1010
  .sp-palette {
1011
+ *width: 220px;
1012
  max-width: 220px;
1013
  }
1014
  .sp-palette .sp-thumb-el {
1015
+ width:16px;
1016
  height: 16px;
1017
+ margin:2px 1px;
1018
  border: solid 1px #d0d0d0;
1019
  }
1020
+
1021
  .sp-container {
1022
+ padding-bottom:0;
1023
  }
1024
+
1025
+
1026
  /* Buttons: http://hellohappy.org/css3-buttons/ */
1027
  .sp-container button {
1028
+ background-color: #eeeeee;
1029
+ background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);
1030
+ background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
1031
+ background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);
1032
+ background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
1033
+ background-image: linear-gradient(to bottom, #eeeeee, #cccccc);
1034
+ border: 1px solid #ccc;
1035
+ border-bottom: 1px solid #bbb;
1036
+ border-radius: 3px;
1037
+ color: #333;
1038
+ font-size: 14px;
1039
+ line-height: 1;
1040
+ padding: 5px 4px;
1041
+ text-align: center;
1042
+ text-shadow: 0 1px 0 #eee;
1043
+ vertical-align: middle;
1044
  }
1045
  .sp-container button:hover {
1046
  background-color: #dddddd;
1066
  .sp-cancel {
1067
  font-size: 11px;
1068
  color: #d93f3f !important;
1069
+ margin:0;
1070
+ padding:2px;
1071
  margin-right: 5px;
1072
  vertical-align: middle;
1073
+ text-decoration:none;
1074
+
1075
  }
1076
  .sp-cancel:hover {
1077
  color: #d93f3f !important;
1078
  text-decoration: underline;
1079
  }
1080
+
1081
+
1082
  .sp-palette span:hover, .sp-palette span.sp-thumb-active {
1083
  border-color: #000;
1084
  }
1085
+
1086
  .sp-preview, .sp-alpha, .sp-thumb-el {
1087
+ position:relative;
1088
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==);
1089
  }
1090
  .sp-preview-inner, .sp-alpha-inner, .sp-thumb-inner {
1091
+ display:block;
1092
+ position:absolute;
1093
+ top:0;left:0;bottom:0;right:0;
 
 
 
1094
  }
1095
+
1096
  .sp-palette .sp-thumb-inner {
1097
  background-position: 50% 50%;
1098
  background-repeat: no-repeat;
1099
  }
1100
+
1101
  .sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner {
1102
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=);
1103
  }
1104
+
1105
  .sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner {
1106
  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=);
1107
  }
1108
+
1109
  .sp-clear-display {
1110
+ background-repeat:no-repeat;
1111
  background-position: center;
1112
  background-image: url(data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAJmZmZ2dnZ6enqKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq/Hx8fLy8vT09PX19ff39/j4+Pn5+fr6+vv7+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==);
1113
  }
css/chld-thm-cfg.min.css ADDED
@@ -0,0 +1 @@
 
1
+ body{background:0 0!important}p{line-height:1.4}.wrap h1,.wrap h2{font-size:23px;font-weight:400;line-height:29px;margin:.5em 0 1em}a.nav-tab,a.nav-tab:active,a.nav-tab:focus{outline:0;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none}h2 .ctc-recent-tab,h2 .nav-tab{font-size:13px;padding:6px 8px;font-weight:700;line-height:24px}.ctc-option-panel-container{position:relative;min-height:1100px;width:100%;overflow:auto}.ctc-three-col{-moz-columns:3;-moz-column-gap:3em;-webkit-columns:3;-webkit-column-gap:3em;columns:3;column-gap:3em}#all_styles_panel ul li,#ctc_recent_selectors ul li{margin:0}#all_styles_panel ul li a,#ctc_recent_selectors ul li a{text-decoration:none;font-size:.8em;line-height:1.2;word-wrap:break-word;display:block;padding:.5em}#all_styles_panel ul li a:focus,#all_styles_panel ul li a:hover,#ctc_recent_selectors ul li a:focus,#ctc_recent_selectors ul li a:hover{background-color:#fff;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}#view_child_options_panel,#view_parnt_options_panel{white-space:pre;overflow:auto;font-family:monospace;word-wrap:normal}.ctc-option-panel{visibility:hidden;position:absolute;width:100%;top:0;left:0;padding:10px 0 0}.ctc-recent-container{top:0;right:0;position:absolute;max-width:200px;width:17%;display:none;overflow:auto;visibility:visible;left:inherit;background-color:#E4E4E4}#ctc_recent_selectors{padding:0 8px}#live_preview_panel iframe{width:100%;min-height:1100px}a.ctc-recent-tab{float:right;border:1px solid #ccc;border-bottom:none;background-color:#E4E4E4;color:#555;display:inline-block;text-decoration:none;margin:-1px 0 0;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;outline:0}.ctc-input-cell,.ctc-input-cell-wide{margin-right:2%;display:block;float:left}.ctc-option-panel-active{visibility:visible}.ctc-swatch{display:block;float:left;font-size:16px;padding:0;line-height:1;overflow:hidden}.ctc-hidden{display:none}.ctc-swatch.ctc-specific{min-height:60px;max-height:100px;max-width:100px;margin:0 2% 0 0}.ctc-selector-inner-container .ctc-swatch.ctc-specific{max-width:13%}.ctc-parent-row{clear:both;position:relative;margin:4px 0}.ctc-input-cell{width:30%;max-width:350px;word-wrap:break-word}.ctc-selector-inner-container .ctc-input-cell{width:35%}.ctc-input-cell-wide{width:60%}.ctc-input-cell-wide input[type=text]{width:100%}.ctc-input-cell-wide textarea{width:100%;height:200px;white-space:pre;overflow:auto;font-family:inherit;word-wrap:normal}.ctc-selector-inner-container .ctc-button-cell,.ctc-selector-inner-container .ctc-input-cell.ctc-button-cell{width:8%}.ctc-textarea-button-cell{margin:4px 10px 15px;text-align:right;float:right}.ctc-rewrite-toggle{font-size:.8em;padding-left:1em;display:none;outline:0}.ctc-delete-input{font-size:.8em;float:right;color:#8b0000;text-decoration:none}.ctc-selector-container{clear:both;background:#f9f9f9;border:1px solid #ddd;padding:10px;position:absolute;min-height:300px;width:80%;left:15%;top:30px;display:none;z-index:99999;-moz-box-shadow:0 2px 10px rgba(0,0,0,.3);-webkit-box-shadow:0 2px 10px rgba(0,0,0,.3);box-shadow:0 2px 10px rgba(0,0,0,.3)}.ctc-selector-inner-container{position:relative;min-height:300px;overflow:auto}.ctc-status-icon.failure,.ctc-status-icon.success{display:block;float:right;position:relative;height:16px;width:16px;margin:4px}.ctc-exit{display:block;width:20px;height:20px;position:absolute;top:-13px;right:-13px;transition:none!important;z-index:999;border:3px solid #f9f9f9;-moz-border-radius:16px;-webkit-border-radius:16px;border-radius:16px}.ctc-exit:active,.ctc-exit:hover{background-position:right top}.ctc-selector-row{clear:both;margin:0;padding:8px 0;border-top:1px solid #ddd;border-bottom:1px solid #fff}.ctc-input-row{clear:both;margin:4px 0;padding:4px 0;border-bottom:1px solid #ddd;position:relative}.howto.sep{border-bottom:1px solid #fff;margin-bottom:.5em;padding-bottom:.5em}.ctc-selector-cell{float:left;width:30%;margin-right:2%}.ctc-child-input-cell{display:block;float:left;margin-right:2%}.ctc-child-input-cell-container{float:left;width:40%;margin-right:2%}.ctc-child-input-cell-container label{float:left;clear:both;width:100px;margin-right:2%}.ctc-disabled{opacity:.5}.ctc-select{max-width:100%}.ctc-child-input-cell input[type=text].ctc-input-wide{width:200px}#ctc_additional_css_label{cursor:pointer}#ctc_additional_css_label span{white-space:nowrap}.clearfix:after,.clearfix:before{content:' ';display:table;margin:0;padding:0}.clear,.clearfix:after{clear:both}.ie7 .clearfix{zoom:1}.smaller{font-size:.85em}.writable{color:red}.ui-state-focus,.ui-state-hover,.ui-widget-content .ui-state-focus,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-focus,.ui-widget-header .ui-state-hover{background-color:#DADADA;color:#212121}.ui-menu .ui-menu-item{position:relative;margin:0;padding:3px 1em 3px .4em;cursor:pointer;min-height:0;overflow:hidden;text-overflow:ellipsis;max-width:450px}.ctc-section-toggle{position:relative;cursor:pointer}.ctc-section-toggle:after{content:"\f140";font:400 20px/1 dashicons;color:#999;vertical-align:bottom}.ctc-section-toggle.open:after{content:"\f142"}a.ctc-section-toggle,a.ctc-section-toggle:active,a.ctc-section-toggle:hover,a.ctc-section-toggle:visited{text-decoration:none;float:right;font-size:.85em;box-shadow:none;-moz-box-shadow:none;-webkit-box-shadow:none;outline:0}.ctc-section-toggle-content{display:none;position:relative;margin:0;padding:1px 0}.ctc-theme-only{margin:0;padding:0;position:relative}h3.theme-name{margin:.25em 0;font-size:1.2em}.ctc-theme-option{max-width:250px}.ctc-theme-option-left{float:left;width:40%;margin-right:5%}.ctc-theme-option-right{float:right;width:55%;margin-right:0;font-size:.9em;line-height:1.3}.ctc-theme-option-image{height:auto;width:100%;border:1px solid #ddd}.ui-widget-content{border:1px solid #aaa;background-color:#fff}.ui-widget-header{border:1px solid #aaa;background-color:#ccc;font-weight:700}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;font-weight:400;color:#555}.ui-state-focus,.ui-widget-content .ui-state-active,.ui-widget-content .ui-state-focus,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-active,.ui-widget-header .ui-state-focus,.ui-widget-header .ui-state-hover{font-weight:400;color:#212121}.ui-selectmenu-menu{padding:0;margin:0;position:absolute;top:0;left:0;display:none}.ui-selectmenu-menu .ui-menu{overflow:auto;max-height:372px;margin-top:0;overflow-x:hidden}.ui-selectmenu-menu .ui-menu .ui-menu-item{padding:6px}.ui-selectmenu-open{display:block}.ui-selectmenu-button{display:inline-block;overflow:hidden;position:relative;text-decoration:none;cursor:pointer;min-width:200px}.ui-selectmenu-button span.ui-icon{right:.5em;left:auto;margin-top:-10px;position:absolute;top:50%}.ui-icon-triangle-1-s:before{display:inline-block;-webkit-font-smoothing:antialiased;font:400 20px/1 dashicons;content:"\f140"}.ui-selectmenu-button span.ui-selectmenu-text{text-align:left;padding:.4em 2.1em .4em 1em;display:block;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#get_pro_panel h1{font-size:1.75em;color:#c64200}#get_pro_panel h3{font-size:1.4em;margin-bottom:0}#get_pro_panel p{font-size:1em;margin:.5em 0}.ctc-input-cell .update-nag,.ctc-input-cell-wide.update-nag{margin:0}.ctc-input-cell-wide.update-nag{margin-bottom:1em}#get_pro_panel ul,.ctc-input-cell-wide.update-nag ul{list-style:square}#get_pro_panel li,.ctc-input-cell-wide.update-nag li{margin-left:2em}#get_pro_panel h3 a{display:block;padding:5px 10px;background-color:#c64200;color:#fff;text-decoration:none;text-align:center}#get_pro_panel h3 a:hover{background-color:#FF902E;color:#fff}#get_pro_panel img{max-width:100%;height:auto}.sp-container{position:absolute;top:0;left:0;display:inline-block;z-index:9999994;overflow:hidden}.sp-container.sp-flat,.sp-top{position:relative}.sp-container,.sp-container *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.sp-top{width:100%;display:inline-block}.sp-alpha-handle,.sp-color,.sp-dragger,.sp-hue,.sp-sat,.sp-slider,.sp-top-inner,.sp-val{position:absolute}.sp-top-inner{top:0;left:0;bottom:0;right:0}.sp-color{top:0;left:0;bottom:0;right:20%}.sp-hue{top:0;right:0;bottom:0;left:84%;height:100%}.sp-clear-enabled .sp-hue{top:33px;height:77.5%}.sp-fill{padding-top:80%}.sp-sat,.sp-val{top:0;left:0;right:0;bottom:0}.sp-alpha-enabled .sp-top{margin-bottom:18px}.sp-alpha-enabled .sp-alpha{display:block}.sp-alpha-handle{top:-4px;bottom:-4px;width:6px;left:50%;cursor:pointer;border:1px solid #000;background:#fff;opacity:.8}.sp-alpha{display:none;bottom:-14px;right:0;left:0;height:8px}.sp-alpha-inner{border:1px solid #333}.sp-clear{display:none}.sp-clear.sp-clear-display{background-position:center}.sp-clear-enabled .sp-clear{display:block;position:absolute;top:0;right:0;bottom:0;left:84%;height:28px}.sp-alpha,.sp-alpha-handle,.sp-clear,.sp-container,.sp-container button,.sp-container.sp-dragging .sp-input,.sp-dragger,.sp-preview,.sp-replacer,.sp-slider{-webkit-user-select:none;-moz-user-select:-moz-none;-o-user-select:none;user-select:none}.sp-container.sp-buttons-disabled .sp-button-container,.sp-container.sp-input-disabled .sp-input-container,.sp-container.sp-palette-buttons-disabled .sp-palette-button-container,.sp-initial-disabled .sp-initial,.sp-palette-disabled .sp-palette-container,.sp-palette-only .sp-picker-container{display:none}.sp-sat{background-image:-webkit-gradient(linear,0 0,100% 0,from(#FFF),to(rgba(204,154,129,0)));background-image:-webkit-linear-gradient(left,#FFF,rgba(204,154,129,0));background-image:-moz-linear-gradient(left,#fff,rgba(204,154,129,0));background-image:-o-linear-gradient(left,#fff,rgba(204,154,129,0));background-image:-ms-linear-gradient(left,#fff,rgba(204,154,129,0));background-image:linear-gradient(to right,#fff,rgba(204,154,129,0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)";filter:progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr='#FFFFFFFF', endColorstr='#00CC9A81')}.sp-val{background-image:-webkit-gradient(linear,0 100%,0 0,from(#000),to(rgba(204,154,129,0)));background-image:-webkit-linear-gradient(bottom,#000,rgba(204,154,129,0));background-image:-moz-linear-gradient(bottom,#000,rgba(204,154,129,0));background-image:-o-linear-gradient(bottom,#000,rgba(204,154,129,0));background-image:-ms-linear-gradient(bottom,#000,rgba(204,154,129,0));background-image:linear-gradient(to top,#000,rgba(204,154,129,0));-ms-filter:"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)";filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00CC9A81', endColorstr='#FF000000')}.sp-hue{background:-moz-linear-gradient(top,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);background:-ms-linear-gradient(top,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);background:-o-linear-gradient(top,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);background:-webkit-gradient(linear,left top,left bottom,from(red),color-stop(.17,#ff0),color-stop(.33,#0f0),color-stop(.5,#0ff),color-stop(.67,#00f),color-stop(.83,#f0f),to(red));background:-webkit-linear-gradient(top,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);background:linear-gradient(to bottom,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}.sp-1{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0000', endColorstr='#ffff00')}.sp-2{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff00', endColorstr='#00ff00')}.sp-3{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ff00', endColorstr='#00ffff')}.sp-4{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffff', endColorstr='#0000ff')}.sp-5{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0000ff', endColorstr='#ff00ff')}.sp-6{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff00ff', endColorstr='#ff0000')}.sp-hidden{display:none!important}.sp-cf:after,.sp-cf:before{content:"";display:table}.sp-cf:after{clear:both}@media (max-device-width:480px){.sp-color{right:40%}.sp-hue{left:63%}.sp-fill{padding-top:60%}}.sp-dragger{border-radius:5px;height:5px;width:5px;border:1px solid #fff;background:#000;cursor:pointer;top:0;left:0}.sp-slider{top:0;cursor:pointer;height:3px;left:-1px;right:-1px;border:1px solid #000;background:#fff;opacity:.8}.sp-container{border-radius:0;background-color:#ECECEC;border:1px solid #f0c49B;padding:0}.sp-clear,.sp-color,.sp-container,.sp-container button,.sp-container input,.sp-hue{font:400 12px "Lucida Grande","Lucida Sans Unicode","Lucida Sans",Geneva,Verdana,sans-serif;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.sp-top{margin-bottom:3px}.sp-clear,.sp-color,.sp-hue{border:1px solid #666}.sp-input-container{float:right;width:100px;margin-bottom:4px}.sp-initial-disabled .sp-input-container,.sp-input{width:100%}.sp-input{font-size:12px!important;border:1px inset;padding:4px 5px;margin:0;background:0 0;border-radius:3px;color:#222}.sp-input:focus{border:1px solid orange}.sp-input.sp-validation-error{border:1px solid red;background:#fdd}.sp-palette-container,.sp-picker-container{float:left;position:relative;padding:10px 10px 300px;margin-bottom:-290px}.sp-picker-container{width:172px;border-left:solid 1px #fff}.sp-palette-container{border-right:solid 1px #ccc;max-width:60px}.sp-palette-only .sp-palette-container{border:0}.sp-palette .sp-thumb-el{display:block;position:relative;float:left;cursor:pointer}.sp-palette .sp-thumb-el.sp-thumb-active,.sp-palette .sp-thumb-el:hover{border-color:orange}.sp-thumb-el{position:relative}.sp-initial{float:left;border:1px solid #333}.sp-initial span{width:30px;height:25px;border:none;display:block;float:left;margin:0}.sp-initial .sp-clear-display{background-position:center}.sp-button-container,.sp-palette-button-container{float:right}.sp-replacer{margin:0;overflow:hidden;cursor:pointer;padding:4px;display:inline-block;border:1px solid #91765d;background:#eee;color:#333;vertical-align:middle}.sp-replacer.sp-active,.sp-replacer:hover{border-color:#F0C49B;color:#111}.sp-replacer.sp-disabled{cursor:default;border-color:silver;color:silver}.sp-dd{padding:2px 0;height:16px;line-height:16px;float:left;font-size:10px;font-family:sans-serif}.sp-preview{width:25px;height:20px;border:1px solid #222;margin-right:5px;float:left;z-index:0}.sp-palette{max-width:220px}.sp-palette .sp-thumb-el{width:16px;height:16px;margin:2px 1px;border:1px solid #d0d0d0}.sp-container{padding-bottom:0}.sp-container button{background-color:#eee;background-image:-webkit-linear-gradient(top,#eee,#ccc);background-image:-moz-linear-gradient(top,#eee,#ccc);background-image:-ms-linear-gradient(top,#eee,#ccc);background-image:-o-linear-gradient(top,#eee,#ccc);background-image:linear-gradient(to bottom,#eee,#ccc);border:1px solid #ccc;border-bottom:1px solid #bbb;border-radius:3px;color:#333;font-size:14px;line-height:1;padding:5px 4px;text-align:center;text-shadow:0 1px 0 #eee;vertical-align:middle}.sp-container button:hover{background-color:#ddd;background-image:-webkit-linear-gradient(top,#ddd,#bbb);background-image:-moz-linear-gradient(top,#ddd,#bbb);background-image:-ms-linear-gradient(top,#ddd,#bbb);background-image:-o-linear-gradient(top,#ddd,#bbb);background-image:linear-gradient(to bottom,#ddd,#bbb);border:1px solid #bbb;border-bottom:1px solid #999;cursor:pointer;text-shadow:0 1px 0 #ddd}.sp-container button:active{border:1px solid #aaa;border-bottom:1px solid #888;-webkit-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-moz-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-ms-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-o-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee}.sp-cancel{font-size:11px;color:#d93f3f!important;margin:0 5px 0 0;padding:2px;vertical-align:middle;text-decoration:none}.sp-cancel:hover{color:#d93f3f!important;text-decoration:underline}.sp-palette span.sp-thumb-active,.sp-palette span:hover{border-color:#000}.sp-alpha,.sp-preview,.sp-thumb-el{position:relative;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.sp-alpha-inner,.sp-preview-inner,.sp-thumb-inner{display:block;position:absolute;top:0;left:0;bottom:0;right:0}.sp-palette .sp-thumb-inner{background-position:50% 50%;background-repeat:no-repeat}.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=)}.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=)}.sp-clear-display{background-repeat:no-repeat;background-position:center;background-image:url(data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAJmZmZ2dnZ6enqKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq/Hx8fLy8vT09PX19ff39/j4+Pn5+fr6+vv7+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==)}
includes/class-ctc-admin.php CHANGED
@@ -3,125 +3,194 @@
3
  if ( !defined( 'ABSPATH' ) ) exit;
4
 
5
  /*
6
- Class: ChildThemeConfiguratorAdmin
7
  Plugin URI: http://www.childthemeconfigurator.com/
8
  Description: Main Controller Class
9
- Version: 2.1.2
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
- Text Domain: child-theme-configurator
13
  Domain Path: /lang
14
  License: GPLv2
15
- Copyright (C) 2014-2016 Lilaea Media
16
  */
17
  class ChildThemeConfiguratorAdmin {
18
 
19
  // state
20
- var $genesis;
21
- //var $reorder;
22
- var $processdone;
23
- var $childtype;
24
- var $template;
25
  var $is_ajax;
26
  var $is_get;
27
  var $is_post;
28
  var $skip_form;
29
  var $fs;
30
- var $encoding;
31
 
32
  var $fs_prompt;
33
  var $fs_method;
34
  var $uploadsubdir;
35
  var $menuName; // backward compatibility with plugin extension
36
  var $cache_updates = TRUE;
37
- var $debug;
38
- var $is_debug;
39
- var $is_new;
40
- // memory checks
41
  var $max_sel;
42
  var $sel_limit;
43
- var $mem_limit;
44
  // state arrays
45
  var $themes = array();
46
  var $errors = array();
47
  var $files = array();
48
  var $updates = array();
 
49
  // objects
50
  var $css;
51
  var $ui;
52
  // config arrays
53
  var $postarrays = array(
54
- 'ctc_img',
55
- 'ctc_file_parnt',
56
- 'ctc_file_child',
57
- 'ctc_additional_css',
58
- );
59
  var $configfields = array(
60
- 'theme_parnt',
61
- 'child_type',
62
- 'theme_child',
63
- 'child_template',
64
- 'child_name',
65
- 'child_themeuri',
66
- 'child_author',
67
- 'child_authoruri',
68
- 'child_descr',
69
- 'child_tags',
70
- 'child_version',
71
- 'repairheader',
72
- 'ignoreparnt',
73
- 'handling',
74
- 'enqueue',
75
- 'configtype', // backward compatability - no longer used
76
- );
77
  var $actionfields = array(
78
- 'load_styles',
79
- 'parnt_templates_submit',
80
- 'child_templates_submit',
81
- 'image_submit',
82
- 'theme_image_submit',
83
- 'theme_screenshot_submit',
84
- 'export_child_zip',
85
- 'export_theme',
86
- 'reset_permission',
87
- 'templates_writable_submit',
88
- 'set_writable',
89
- 'upgrade',
90
- );
91
  var $imgmimes = array(
92
- 'jpg|jpeg|jpe' => 'image/jpeg',
93
- 'gif' => 'image/gif',
94
- 'png' => 'image/png',
95
- );
96
-
 
 
 
 
 
 
 
 
 
 
97
  function __construct() {
98
- $this->processdone = FALSE;
99
- $this->genesis = FALSE;
100
- //$this->reorder = FALSE;
101
- $this->is_new = FALSE;
102
- $this->encoding = WP_Http_Encoding::is_available();
103
  $this->menuName = CHLD_THM_CFG_MENU; // backward compatability for plugins extension
104
  $this->is_post = ( 'POST' == $_SERVER[ 'REQUEST_METHOD' ] );
105
  $this->is_get = ( 'GET' == $_SERVER[ 'REQUEST_METHOD' ] );
106
  $this->is_debug = get_option( CHLD_THM_CFG_OPTIONS . '_debug' );
107
- $this->debug = '';
108
- $this->errors = array();
 
 
 
 
 
109
  }
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  /**
112
  * initialize configurator
113
  */
114
  function ctc_page_init () {
115
  // get all available themes
116
  $this->get_themes();
117
- $this->childtype = count( $this->themes[ 'child' ] ) ? 'existing' : 'new';
118
-
119
  // load config data and validate
120
  $this->load_config();
121
  // perform any checks prior to processing config data
122
  do_action( 'chld_thm_cfg_preprocess' );
123
  // process any additional forms
124
- do_action( 'chld_thm_cfg_forms' ); // hook for custom forms
125
  // process main post data
126
  $this->process_post();
127
  // initialize UI
@@ -129,17 +198,16 @@ class ChildThemeConfiguratorAdmin {
129
  $this->ui = new ChildThemeConfiguratorUI();
130
  // initialize help
131
  $this->ui->render_help_content();
132
- }
 
 
 
 
133
 
134
  function render() {
135
  $this->ui->render();
136
  }
137
 
138
- /* helper function to retreive css object properties */
139
- function get( $property, $params = NULL ) {
140
- return $this->css->get_prop( $property, $params );
141
- }
142
-
143
  function get_themes() {
144
  // create cache of theme info
145
  $this->themes = array( 'child' => array(), 'parnt' => array() );
@@ -180,75 +248,63 @@ class ChildThemeConfiguratorAdmin {
180
  include_once( CHLD_THM_CFG_DIR . '/includes/class-ctc-css.php' );
181
  $this->css = new ChildThemeConfiguratorCSS();
182
  if ( FALSE !== $this->css->load_config() ):
183
- $this->debug( 'config exists', __FUNCTION__, __CLASS__, __CLASS__ );
184
  // if themes do not exist reinitialize
185
- if ( ! $this->check_theme_exists( $this->get( 'child' ) )
186
- || ! $this->check_theme_exists( $this->get( 'parnt' ) ) ):
187
- $this->debug( 'theme does not exist', __FUNCTION__, __CLASS__, __CLASS__ );
188
- add_action( 'admin_notices', array( $this, 'config_notice' ) );
189
  $this->css = new ChildThemeConfiguratorCSS();
190
  $this->css->enqueue = 'enqueue';
191
  endif;
192
  else:
193
- $this->debug( 'config does not exist', __FUNCTION__, __CLASS__, __CLASS__ );
194
  // this is a fresh install
195
  $this->css->enqueue = 'enqueue';
196
  endif;
197
  do_action( 'chld_thm_cfg_load' );
198
  if ( $this->is_get ):
199
- if ( $this->get( 'child' ) ):
200
  // get filesystem credentials if available
201
  $this->verify_creds();
202
- $stylesheet = apply_filters(
203
- 'chld_thm_cfg_target',
204
- $this->css->get_child_target( $this->get_child_stylesheet() ),
205
- $this->css );
206
  // check file permissions
207
- if ( !is_writable( $stylesheet ) && !$this->fs )
208
- add_action( 'admin_notices', array( $this, 'writable_notice' ) );
209
- if ( $fsize = $this->get( 'fsize' ) ):
210
- $test = filesize( $stylesheet );
211
- $this->debug( 'filesize saved: ' . $fsize . ' current: ' . $test, __FUNCTION__, __CLASS__, __CLASS__ );
212
- if ( $test != $fsize )
213
- add_action( 'admin_notices', array( $this, 'changed_notice' ) );
214
  endif;
215
  // enqueue flag will be null for existing install < 1.6.0
216
- if ( !$this->get( 'enqueue' ) ):
217
- $this->debug( 'no enqueue:', __FUNCTION__, __CLASS__, __CLASS__ );
218
-
219
- add_action( 'admin_notices', array( $this, 'enqueue_notice' ) );
220
  endif;
221
  endif;
222
- if ( !$this->seen_upgrade_notice() ):
223
- add_action( 'admin_notices', array( $this, 'upgrade_notice' ) );
224
- endif;
225
- /**
226
- * Future use: check if max selectors reached
227
- *
228
- if ( $this->get( 'max_sel' ) ):
229
- $this->debug( 'Max selectors exceeded.', __FUNCTION__, __CLASS__, __CLASS__ );
230
  //$this->errors[] = __( 'Maximum number of styles exceeded.', 'child-theme-configurator' );
231
- add_action( 'admin_notices', array( $this, 'max_styles_notice' ) );
232
  endif;
233
- */
234
  // check if file ownership is messed up from old version or other plugin
235
  // by comparing owner of plugin to owner of child theme:
236
- if ( fileowner( $this->css->get_child_target( '' ) ) != fileowner( CHLD_THM_CFG_DIR ) )
237
- add_action( 'admin_notices', array( $this, 'owner_notice' ) );
238
- endif;
 
 
 
 
 
 
 
 
 
239
  }
240
-
241
  /**
242
  * ajax callback for saving form data
243
  */
244
  function ajax_save_postdata( $action = 'ctc_update' ) {
245
  $this->is_ajax = TRUE;
246
- $this->debug( 'ajax save ', __FUNCTION__, __CLASS__ );
247
  // security check
248
  if ( $this->validate_post( $action ) ):
249
  if ( 'ctc_plugin' == $action ) do_action( 'chld_thm_cfg_pluginmode' );
250
  $this->verify_creds(); // initialize filesystem access
251
- add_action( 'chld_thm_cfg_cache_updates', array( $this, 'cache_debug' ) );
252
  // get configuration data from options API
253
  if ( FALSE !== $this->load_config() ): // sanity check: only update if config data exists
254
  if ( isset( $_POST[ 'ctc_is_debug' ] ) ):
@@ -258,24 +314,24 @@ class ChildThemeConfiguratorAdmin {
258
  $this->css->parse_post_data(); // parse any passed values
259
  // if child theme config has been set up, save new data
260
  // return recent edits and selected stylesheets as cache updates
261
- if ( $this->get( 'child' ) ):
262
  // hook for add'l plugin files and subdirectories
263
- do_action( 'chld_thm_cfg_addl_files' );
264
  $this->css->write_css();
 
 
265
  /*
266
  $this->updates[] = array(
267
  'obj' => 'addl_css',
268
  'key' => '',
269
- 'data' => $this->get( 'addl_css' ),
270
  );
271
  */
272
  endif;
273
 
274
  // update config data in options API
275
- $this->save_config();
276
  endif;
277
- // add any additional updates to pass back to browser
278
- do_action( 'chld_thm_cfg_cache_updates' );
279
  endif;
280
  endif;
281
  $result = $this->css->obj_to_utf8( $this->updates );
@@ -283,11 +339,6 @@ class ChildThemeConfiguratorAdmin {
283
  die( json_encode( $result ) );
284
  }
285
 
286
- function save_config() {
287
- // update config data in options API
288
- $this->css->save_config();
289
- }
290
-
291
  /**
292
  * ajax callback to query config data
293
  */
@@ -296,19 +347,17 @@ class ChildThemeConfiguratorAdmin {
296
  if ( $this->validate_post( $action ) ):
297
  if ( 'ctc_plugin' == $action ) do_action( 'chld_thm_cfg_pluginmode' );
298
  $this->load_config();
299
- add_action( 'chld_thm_cfg_cache_updates', array( $this, 'cache_debug' ) );
300
  $regex = "/^ctc_query_/";
301
  foreach( preg_grep( $regex, array_keys( $_POST ) ) as $key ):
302
  $name = preg_replace( $regex, '', $key );
303
  $param[ $name ] = sanitize_text_field( $_POST[ $key ] );
304
  endforeach;
305
- $this->debug( 'ajax params: ' . print_r( $param, TRUE ), __FUNCTION__, __CLASS__, __CLASS__ );
306
  if ( !empty( $param[ 'obj' ] ) ):
307
  // add any additional updates to pass back to browser
308
  $this->updates[] = array(
309
  'key' => isset( $param[ 'key' ] ) ? $param[ 'key' ] : '',
310
  'obj' => $param[ 'obj' ],
311
- 'data' => $this->get( $param[ 'obj' ], $param ),
312
  );
313
  do_action( 'chld_thm_cfg_cache_updates' );
314
  die( json_encode( $this->updates ) );
@@ -317,39 +366,10 @@ class ChildThemeConfiguratorAdmin {
317
  die( 0 );
318
  }
319
 
320
- /**
321
- * check if user has been notified about upgrade
322
- */
323
- function seen_upgrade_notice() {
324
- $seen_upgrade_version = get_user_meta( get_current_user_id(), 'chld_thm_cfg_upgrade_notice', TRUE );
325
- return version_compare( $seen_upgrade_version, CHLD_THM_CFG_PREV_VERSION, '>=' );
326
- }
327
-
328
- /**
329
- * ajax callback to dismiss upgrade notice
330
- */
331
- function ajax_dismiss_notice( $action = 'ctc_update' ) {
332
- $this->is_ajax = TRUE;
333
- if ( $this->validate_post( $action ) ):
334
- update_user_meta( get_current_user_id(), 'chld_thm_cfg_upgrade_notice' , CHLD_THM_CFG_VERSION );
335
- $this->updates[] = array(
336
- 'key' => '',
337
- 'obj' => 'dismiss',
338
- 'data' => CHLD_THM_CFG_VERSION,
339
- );
340
- die( json_encode( $this->updates ) );
341
- endif;
342
- die( 0 );
343
- }
344
-
345
- function get_pathinfo( $path ){
346
- $pathinfo = pathinfo( $path );
347
- $path = ( preg_match( "/^[\.\/]/", $pathinfo[ 'dirname' ] ) ? '' : $pathinfo[ 'dirname' ] . '/' ) . $pathinfo[ 'filename' ];
348
- return array( $path, $pathinfo[ 'extension' ] );
349
- }
350
- /**
351
  * Handles processing for all form submissions.
352
- * Moved conditions to switch statement with the main setup logic in a separate function.
 
353
  */
354
  function process_post() {
355
  // make sure this is a post
@@ -364,372 +384,329 @@ class ChildThemeConfiguratorAdmin {
364
  if ( empty( $actionfield ) ) return FALSE;
365
 
366
  // make sure post passes security checkpoint
 
367
  if ( $this->validate_post( apply_filters( 'chld_thm_cfg_action', 'ctc_update' ) ) ):
368
- // reset debug log
369
- delete_site_transient( CHLD_THM_CFG_OPTIONS . '_debug' );
370
- // handle uploaded file before checking filesystem
371
- if ( 'theme_image_submit' == $actionfield && isset( $_FILES[ 'ctc_theme_image' ] ) ):
372
- $this->handle_file_upload( 'ctc_theme_image', $this->imgmimes );
373
- elseif ( 'theme_screenshot_submit' == $actionfield && isset( $_FILES[ 'ctc_theme_screenshot' ] ) ):
374
- $this->handle_file_upload( 'ctc_theme_screenshot', $this->imgmimes );
375
- endif;
376
- // now we need to check filesystem access
377
- $args = preg_grep( "/nonce/", array_keys( $_POST ), PREG_GREP_INVERT );
378
- $this->verify_creds( $args );
379
- if ( $this->fs ):
380
- $msg = FALSE;
381
- // we have filesystem access so proceed with specific actions
382
- switch( $actionfield ):
383
- case 'export_child_zip':
384
- case 'export_theme':
385
- $this->export_theme();
386
- // if we get here the zip failed
387
- $this->errors[] = __( 'Zip file creation failed.', 'child-theme-configurator' );
388
- break;
389
- case 'load_styles':
390
- // main child theme setup function
391
- $msg = $this->setup_child_theme();
392
- break;
393
-
394
- case 'parnt_templates_submit':
395
- // copy parent templates to child
396
- if ( isset( $_POST[ 'ctc_file_parnt' ] ) ):
397
- foreach ( $_POST[ 'ctc_file_parnt' ] as $file ):
398
- list( $path, $ext ) = $this->get_pathinfo( sanitize_text_field( $file ) );
399
- $this->copy_parent_file( $path, $ext );
400
- endforeach;
401
- $msg = '8&tab=file_options';
402
- endif;
403
- break;
404
 
405
- case 'child_templates_submit':
406
- // delete child theme files
407
- if ( isset( $_POST[ 'ctc_file_child' ] ) ):
 
 
 
 
 
 
408
 
409
- foreach ( $_POST[ 'ctc_file_child' ] as $file ):
410
- list( $path, $ext ) = $this->get_pathinfo( sanitize_text_field( $file ) );
411
- if ( 'functions' == $path ):
 
412
  $this->errors[] =
413
- __( 'The Functions file is required and cannot be deleted.', 'child-theme-configurator' );
414
- continue;
415
  else:
416
- $this->delete_child_file( $path, $ext );
 
 
 
 
417
  endif;
418
- endforeach;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
419
  $msg = '8&tab=file_options';
420
- endif;
421
- break;
422
 
423
- case 'image_submit':
424
- // delete child theme images
425
- if ( isset( $_POST[ 'ctc_img' ] ) ):
426
- foreach ( $_POST[ 'ctc_img' ] as $file )
427
- $this->delete_child_file( 'images/' . sanitize_text_field( $file ), 'img' );
428
  $msg = '8&tab=file_options';
429
- endif;
430
- break;
431
 
432
- case 'templates_writable_submit':
433
- // make specific files writable ( systems not running suExec )
434
- if ( isset( $_POST[ 'ctc_file_child' ] ) ):
435
- foreach ( $_POST[ 'ctc_file_child' ] as $file ):
436
- list( $path, $ext ) = $this->get_pathinfo( sanitize_text_field( $file ) );
437
- $this->set_writable( $path, $ext );
438
- endforeach;
439
- $msg = '8&tab=file_options';
440
- endif;
441
- break;
442
 
443
- case 'set_writable':
444
- // make child theme style.css and functions.php writable ( systems not running suExec )
445
- $this->set_writable(); // no argument defaults to style.css
446
- $this->set_writable( 'functions' );
447
- $msg = '8&tab=file_options';
448
- break;
449
-
450
- case 'reset_permission':
451
- // make child theme read-only ( systems not running suExec )
452
- $this->unset_writable();
453
- $msg = '8&tab=file_options';
454
- break;
455
-
456
- case 'theme_image_submit':
457
- // move uploaded child theme images (now we have filesystem access)
458
- if ( isset( $_POST[ 'movefile' ] ) ):
459
- $this->move_file_upload( 'images' );
460
- $msg = '8&tab=file_options';
461
- endif;
462
- break;
463
-
464
- case 'theme_screenshot_submit':
465
- // move uploaded child theme screenshot (now we have filesystem access)
466
- if ( isset( $_POST[ 'movefile' ] ) ):
467
- // remove old screenshot
468
- foreach( array_keys( $this->imgmimes ) as $extreg ):
469
- foreach ( explode( '|', $extreg ) as $ext )
470
- $this->delete_child_file( 'screenshot', $ext );
471
- endforeach;
472
- $this->move_file_upload( '' );
473
  $msg = '8&tab=file_options';
474
- endif;
475
- break;
476
- default:
477
- // assume we are on the files tab so just redirect there
478
- $msg = '8&tab=file_options';
479
- endswitch;
480
- endif; // end filesystem condition
481
- if ( empty( $this->errors ) && empty( $this->fs_prompt ) ):
482
- $this->processdone = TRUE;
483
- //die( '<pre><code><small>' . print_r( $_POST, TRUE ) . '</small></code></pre>' );
484
  // no errors so we redirect with confirmation message
485
  $this->update_redirect( $msg );
486
- endif;
487
  // otherwise fail gracefully
488
  $msg = NULL;
489
  return FALSE;
490
  endif; // end post validation condition
491
- // if you end up here you are persona non grata
492
  $msg = NULL;
493
  $this->errors[] = __( 'You do not have permission to configure child themes.', 'child-theme-configurator' );
494
  endif; // end request method condition
495
  return FALSE;
496
  }
497
 
498
- /**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
499
  * Handle the creation or update of a child theme
500
  */
501
  function setup_child_theme() {
502
- $msg = 1;
503
- $this->is_new = TRUE;
504
  // sanitize and extract config fields into local vars
505
  foreach ( $this->configfields as $configfield ):
 
506
  $varparts = explode( '_', $configfield );
507
  $varname = end( $varparts );
508
  ${$varname} = empty( $_POST[ 'ctc_' . $configfield ] ) ? '' :
509
  preg_replace( "/\s+/s", ' ', sanitize_text_field( $_POST[ 'ctc_' . $configfield ] ) );
510
- $this->debug( 'Extracting var ' . $varname . ' from ctc_' . $configfield . ' value: ' . ${$varname} , __FUNCTION__, __CLASS__ );
511
  endforeach;
512
 
513
- if ( isset( $type ) ) $this->childtype = $type;
514
-
515
- // legacy plugin extension needs parent/new values but this version disables the inputs
516
  // so get we them from current css object
517
  if ( !$this->is_theme( $configtype ) && $this->is_legacy() ):
518
- $parnt = $this->get( 'parnt' );
519
- $child = $this->get( 'child' );
520
- $name = $this->get( 'child_name' );
521
  endif;
 
522
  // validate parent and child theme inputs
523
  if ( $parnt ):
524
  if ( ! $this->check_theme_exists( $parnt ) ):
525
  $this->errors[] = sprintf(
526
- __( '%s does not exist. Please select a valid Parent Theme.', 'child-theme-configurator' ), $parnt );
 
527
  endif;
528
  else:
529
  $this->errors[] = __( 'Please select a valid Parent Theme.', 'child-theme-configurator' );
530
  endif;
531
-
532
- // if this is reset, duplicate or existing, we must have a child theme
533
- if ( 'new' != $type && empty( $child ) ):
534
- $this->errors[] = __( 'Please select a valid Child Theme.', 'child-theme-configurator' );
535
- // if this is a new or duplicate child theme we must validate child theme directory
536
- elseif ( 'new' == $type || 'duplicate' == $type ):
 
 
537
  if ( empty( $template ) && empty( $name ) ):
538
- $this->errors[] = __( 'Please enter a valid Child Theme directory name.', 'child-theme-configurator' );
539
  else:
540
- $template_sanitized = preg_replace( "%[^\w\-]%", '', empty( $template ) ? $name : $template );
541
- if ( $this->check_theme_exists( $template_sanitized ) ):
542
  $this->errors[] = sprintf(
543
- __( '<strong>%s</strong> exists. Please enter a different Child Theme template name.', 'child-theme-configurator' ), $template_sanitized );
544
- elseif ( 'duplicate' == $type ):
545
- // clone existing child theme
546
- $this->clone_child_theme( $child, $template_sanitized );
547
- if ( !empty( $this->errors ) ) return FALSE;
548
- // if no errors, copy menus, widgets and customizer options
549
- $this->copy_theme_mods( $child, $template_sanitized );
550
- $msg = 3;
551
- else:
552
- $msg = 2;
553
  endif;
554
- $child = $template_sanitized;
555
  endif;
 
556
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
557
  endif;
558
-
559
- // verify_child_dir creates child theme directory if it doesn't exist.
560
  if ( FALSE === $this->verify_child_dir( $child ) ):
561
- // if it returns false then it could not create directory.
562
  $this->errors[] = __( 'Your theme directories are not writable.', 'child-theme-configurator' );
563
- add_action( 'admin_notices', array( $this, 'writable_notice' ) );
564
- return FALSE;
565
  endif;
566
-
567
- // load or reset config
568
- if ( 'reset' == $type ):
569
- $this->debug( 'resetting child theme', __FUNCTION__, __CLASS__ );
570
- $this->reset_child_theme();
571
- $this->enqueue_parent_css();
572
- $msg = 4;
573
- else:
574
-
575
- // if any errors, bail before we create css object
576
- if ( !empty( $this->errors ) ) return FALSE;
577
-
578
- // if no name is passed, create one from the child theme directory
579
- if ( empty( $name ) ):
580
- $name = ucfirst( $child );
581
- endif;
582
-
583
- /**
584
- * before we configure the child theme we need to check if this is a rebuild
585
- * and compare some of the original settings to the new settings.
586
- */
587
- //$oldchild = $this->get( 'child' );
588
- //$oldimports = $this->get( 'imports' );
589
- //$oldenqueue = $this->get( 'enqueue' );
590
- $oldhandling = $this->get( 'handling' );
591
  // reset everything else
592
  $this->css = new ChildThemeConfiguratorCSS();
593
  // restore imports if this is a rebuild
594
- //$this->css->imports[ 'child' ] = $oldimports;
595
-
596
- // update with new parameters
597
- if ( !$this->is_theme( $configtype ) )
598
- $this->css->set_prop( 'enqueue', 'enqueue' );
599
- else
600
- $this->css->set_prop( 'enqueue', $enqueue );
601
- $this->css->set_prop( 'handling', $handling );
602
- $this->css->set_prop( 'ignoreparnt', $ignoreparnt );
603
-
604
- $this->css->set_prop( 'parnt', $parnt );
605
- $this->css->set_prop( 'child', $child );
606
- $this->css->set_prop( 'child_name', $name );
607
- $this->css->set_prop( 'child_author', $author );
608
- $this->css->set_prop( 'child_themeuri', $themeuri );
609
- $this->css->set_prop( 'child_authoruri', $authoruri );
610
- $this->css->set_prop( 'child_descr', $descr );
611
- $this->css->set_prop( 'child_tags', $tags );
612
- $this->css->set_prop( 'child_version', strlen( $version ) ? $version : '1.0' );
613
-
614
- if ( isset( $_POST[ 'ctc_action' ] ) && 'plugin' == $_POST[ 'ctc_action' ] ):
615
- // this is for PRO plugins
616
- $this->css->addl_css = array();
617
- if ( isset( $_POST[ 'ctc_additional_css' ] ) && is_array( $_POST[ 'ctc_additional_css' ] ) ):
618
- foreach ( $_POST[ 'ctc_additional_css' ] as $file )
619
- $this->css->addl_css[] = sanitize_text_field( $file );
620
- endif;
621
- add_action( 'chld_thm_cfg_parse_stylesheets', array( $this, 'parse_child_stylesheet_to_target' ) );
622
- elseif ( isset( $_POST[ 'ctc_analysis' ] ) ):
623
- // this is for themes
624
- $this->evaluate_signals();
625
- endif;
626
- // roll back CTC Pro Genesis handling option
627
- if ( $this->genesis ):
628
- $handling = 'separate';
629
- $enqueue = 'none';
630
- $ignoreparnt = TRUE;
631
- if ( $this->backup_or_restore_file( 'ctc-style.css', TRUE, 'style.css' ) &&
632
- $this->backup_or_restore_file( 'style.css', TRUE, 'ctc-genesis.css' ) ):
633
- $this->delete_child_file( 'ctc-genesis', 'css' );
634
- else:
635
- $this->errors[] = __( 'Could not upgrade child theme', 'child-theme-configurator' );
636
- endif;
637
- endif;
638
-
639
- // if any errors, bail before we set action hooks or write to filesystem
640
- if ( !empty( $this->errors ) ) return FALSE;
641
-
642
- // override enqueue action for parent theme if it is already being loaded
643
- if ( 'enqueue' == $enqueue && ( $this->get( 'parntloaded' ) || !$this->get( 'hasstyles' ) || $ignoreparnt ) ) $enqueue = 'none';
644
-
645
  // parse parent stylesheet if theme or legacy plugin extension
646
  if ( $this->is_theme( $configtype ) || $this->is_legacy() ):
647
- // do we parse parent stylesheet?
648
-
649
- if ( $this->get( 'hasstyles' ) && !$ignoreparnt ):
650
- $this->debug( 'Adding action: parse_parent_stylesheet_to_source', __FUNCTION__, __CLASS__ );
651
- add_action( 'chld_thm_cfg_parse_stylesheets', array( $this, 'parse_parent_stylesheet_to_source' ) );
652
- endif;
653
-
654
- // automatically network enable new theme // FIXME: shouldn't this be an option?
655
  if ( is_multisite() )
656
- add_action( 'chld_thm_cfg_addl_options', array( $this, 'network_enable' ) );
657
- endif;
658
- $this->debug( 'Adding action: parse_additional_stylesheets_to_source', __FUNCTION__, __CLASS__ );
659
- add_action( 'chld_thm_cfg_parse_stylesheets', array( $this, 'parse_additional_stylesheets_to_source' ) );
660
-
661
- if ( 'separate' == $handling ):
662
- // parse child theme style.css into source config
663
- $this->debug( 'Adding action: parse_child_stylesheet_to_source', __FUNCTION__, __CLASS__ );
664
- add_action( 'chld_thm_cfg_parse_stylesheets', array( $this, 'parse_child_stylesheet_to_source' ) );
665
- // parse child theme ctc-style.css into target config
666
- $this->debug( 'Adding action: parse_custom_stylesheet_to_target', __FUNCTION__, __CLASS__ );
667
- add_action( 'chld_thm_cfg_parse_stylesheets', array( $this, 'parse_custom_stylesheet_to_target' ) );
668
- elseif ( 'primary' == $handling ):
669
- // parse child theme style.css into target config
670
- $this->debug( 'Adding action: parse_child_stylesheet_to_target', __FUNCTION__, __CLASS__ );
671
- add_action( 'chld_thm_cfg_parse_stylesheets', array( $this, 'parse_child_stylesheet_to_target' ) );
672
- if ( $oldhandling != $handling ):
673
- $this->debug( 'Adding action: parse_custom_stylesheet_to_target', __FUNCTION__, __CLASS__ );
674
- add_action( 'chld_thm_cfg_parse_stylesheets', array( $this, 'parse_custom_stylesheet_to_target' ) );
675
- endif;
676
  endif;
677
 
 
 
 
678
  // function to support wp_filesystem requirements
679
  if ( $this->is_theme( $configtype ) ):
680
  // is theme means this is not a plugin stylesheet config
681
- add_action( 'chld_thm_cfg_addl_files', array( $this, 'add_base_files' ), 10, 2 );
682
- add_action( 'chld_thm_cfg_addl_files', array( $this, 'copy_screenshot' ), 10, 2 );
683
- add_action( 'chld_thm_cfg_addl_files', array( $this, 'enqueue_parent_css' ), 15, 2 );
684
- if ( $repairheader && 'reset' != $type ):
685
- add_action( 'chld_thm_cfg_addl_files', array( $this, 'repair_header' ) );
686
- endif;
687
-
 
 
688
  endif;
689
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
690
  // plugin hooks for additional stylesheet handling options
691
- // do_action( 'chld_thm_cfg_stylesheet_handling' );
692
- // do_action( 'chld_thm_cfg_existing_theme' );
693
-
694
  // plugin hook to parse additional or non-standard files
695
  do_action( 'chld_thm_cfg_parse_stylesheets' );
 
696
  // copy menus, widgets and other customizer options from parent to child if selected
697
- if ( isset( $_POST[ 'ctc_parent_mods' ] ) && 'duplicate' != $type )
698
  $this->copy_theme_mods( $parnt, $child );
 
699
  // run code generation function in read-only mode to add existing external stylesheet links to config data
700
- $this->enqueue_parent_css( TRUE );
701
  // hook for add'l plugin files and subdirectories. Must run after stylesheets are parsed to apply latest options
702
- do_action( 'chld_thm_cfg_addl_files' );
703
  // do not continue if errors
704
- if ( !empty ( $this->errors ) ) return FALSE;
705
- //echo ' no errors! saving...' . LF;
706
- if ( 'separate' == $handling ):
707
- $this->debug( 'Writing new stylesheet header...', __FUNCTION__, __CLASS__ );
708
- $this->rewrite_stylesheet_header();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
709
  endif;
710
- // set flag to skip import link conversion on ajax save
711
- $this->css->set_prop( 'converted', 1 );
712
-
713
- // try to write new stylsheet. If it fails send alert.
714
- $this->debug( 'Writing new CSS...', __FUNCTION__, __CLASS__ );
715
- if ( FALSE === $this->css->write_css() ):
716
- //$this->debug( print_r( debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ), TRUE ), __FUNCTION__, __CLASS__ );
717
- $this->errors[] = __( 'Your stylesheet is not writable.', 'child-theme-configurator' );
718
- add_action( 'admin_notices', array( $this, 'writable_notice' ) );
719
- return FALSE;
720
- endif;
721
- // get files to reload templates in new css object
722
- $this->get_files( $parnt );
723
  endif;
724
- $this->debug( 'Saving new config...', __FUNCTION__, __CLASS__ );
725
- // save new object to WP options table
726
- $this->save_config();
727
- $this->debug( 'Firing additional options action...', __FUNCTION__, __CLASS__ );
728
- // plugin hook for additional child theme setup functions
729
- do_action( 'chld_thm_cfg_addl_options' );
730
- //$this->dump_configs();
731
- // return message id 1, which says new child theme created successfully;
732
- return $msg;
 
 
 
733
  }
734
 
735
  /*
@@ -747,8 +724,9 @@ class ChildThemeConfiguratorAdmin {
747
  }
748
 
749
  function update_redirect( $msg = 1 ) {
750
- $this->log_debug();
751
  if ( empty( $this->is_ajax ) ):
 
 
752
  $ctcpage = apply_filters( 'chld_thm_cfg_admin_page', CHLD_THM_CFG_MENU );
753
  $screen = get_current_screen()->id;
754
  wp_safe_redirect(
@@ -759,15 +737,15 @@ class ChildThemeConfiguratorAdmin {
759
  }
760
 
761
  function verify_child_dir( $path ) {
762
- $this->debug( 'Verifying child dir: ' . $path, __FUNCTION__, __CLASS__ );
763
  if ( !$this->fs ):
764
- $this->debug( 'No filesystem access.', __FUNCTION__, __CLASS__ );
765
  return FALSE; // return if no filesystem access
766
  endif;
767
  global $wp_filesystem;
768
  $themedir = $wp_filesystem->find_folder( get_theme_root() );
769
  if ( ! $wp_filesystem->is_writable( $themedir ) ):
770
- $this->debug( 'Directory not writable: ' . $themedir, __FUNCTION__, __CLASS__ );
771
  return FALSE;
772
  endif;
773
  $childparts = explode( '/', $this->normalize_path( $path ) );
@@ -777,40 +755,31 @@ class ChildThemeConfiguratorAdmin {
777
  $themedir = trailingslashit( $themedir ) . $subdir;
778
  if ( ! $wp_filesystem->is_dir( $themedir ) ):
779
  if ( ! $wp_filesystem->mkdir( $themedir, FS_CHMOD_DIR ) ):
780
- $this->debug( 'Could not make directory: ' . $themedir, __FUNCTION__, __CLASS__ );
781
  return FALSE;
782
  endif;
783
  elseif ( ! $wp_filesystem->is_writable( $themedir ) ):
784
- $this->debug( 'Directory not writable: ' . $themedir, __FUNCTION__, __CLASS__ );
785
  return FALSE;
786
  endif;
787
  endwhile;
788
- $this->debug( 'Child dir verified: ' . $themedir, __FUNCTION__, __CLASS__ );
789
  return TRUE;
790
  }
791
 
792
  function add_base_files( $obj ){
793
- //$this->debug( LF . LF, __FUNCTION__, __CLASS__ );
794
  // add functions.php file
795
  $contents = "<?php
796
  // Exit if accessed directly
797
  if ( !defined( 'ABSPATH' ) ) exit;
798
  ";
799
- $handling = $this->get( 'handling' );
800
  $this->write_child_file( 'functions.php', $contents );
801
- $this->backup_or_restore_file( 'style.css' );
802
- $contents = $this->css->get_css_header_comment( $handling );
803
- $this->debug( 'writing initial stylesheet header...' . LF . $contents, __FUNCTION__, __CLASS__ );
804
- $this->write_child_file( 'style.css', $contents );
805
- if ( 'separate' == $handling ):
806
- $this->backup_or_restore_file( 'ctc-style.css' );
807
- $this->write_child_file( 'ctc-style.css', $contents . LF );
808
- endif;
809
  }
810
 
811
  // parses @import syntax and converts to wp_enqueue_style statement
812
  function convert_import_to_enqueue( $import, $count, $execute = FALSE ) {
813
- $relpath = $this->get( 'child' );
814
  $import = preg_replace( "#^.*?url\(([^\)]+?)\).*#", "$1", $import );
815
  $import = preg_replace( "#[\'\"]#", '', $import );
816
  $path = $this->css->convert_rel_url( trim( $import ), $relpath , FALSE );
@@ -828,13 +797,13 @@ if ( !defined( 'ABSPATH' ) ) exit;
828
  $this->css->imports[ 'child' ]['@import url(' . $path . ')'] = 1;
829
  return;
830
  endif;
831
- $regex = '#^' . preg_quote( trailingslashit( $this->get( 'child' ) ) ) . '#';
832
  $path = preg_replace( $regex, '', $path, -1, $count );
833
  if ( $count ):
834
  $this->css->imports[ 'child' ]['@import url(' . $path . ')'] = 1;
835
  return;
836
  endif;
837
- $parent = trailingslashit( $this->get( 'parnt' ) );
838
  $regex = '#^' . preg_quote( $parent ) . '#';
839
  $path = preg_replace( $regex, '../' . $parent, $path, -1, $count );
840
  if ( $count )
@@ -847,107 +816,55 @@ if ( !defined( 'ABSPATH' ) ) exit;
847
  * If external imports are present, it enqueues them as well.
848
  */
849
  function enqueue_parent_code(){
850
- //$this->debug( print_r( debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ), TRUE ), __FUNCTION__, __CLASS__ );
851
- $imports = $this->get( 'imports' );
852
- $enqueues = array();
853
- $code = "// AUTO GENERATED - Do not modify or remove comment markers above or below:" . LF;
854
- $deps = $this->get( 'parnt_deps' );
855
- $enq = $this->get( 'enqueue' );
856
- $handling = $this->get( 'handling' );
857
- $hasstyles = $this->get( 'hasstyles' );
858
- $childloaded = $this->get( 'childloaded' );
859
- $parntloaded = $this->get( 'parntloaded' );
860
- $cssunreg = $this->get( 'cssunreg' );
861
- $csswphead = $this->get( 'csswphead' );
862
- $cssnotheme = $this->get( 'cssnotheme' );
863
- $ignoreparnt = $this->get( 'ignoreparnt' );
864
- $priority = $this->get( 'qpriority' );
865
- $reorder = $this->get( 'reorder' );
866
- $this->debug( 'deps: ' . print_r( $deps, TRUE ) . ' enq: ' . $enq . ' handling: ' . $handling
867
- . ' hasstyles: ' . $hasstyles . ' parntloaded: ' . $parntloaded . ' childloaded: ' . $childloaded . ' reorder: ' . $reorder
868
- . ' ignoreparnt: ' . $ignoreparnt . ' priority: ' . $priority . ' childtype: ' . $this->childtype, __FUNCTION__, __CLASS__ );
869
- // enqueue parent stylesheet
870
- if ( 'enqueue' == $enq && $hasstyles && !$parntloaded && !$ignoreparnt ):
871
- $code .= "
872
- if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
873
- function chld_thm_cfg_parent_css() {
874
- wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css', array( " . implode( ',', $deps ) . " ) );
875
- }
876
- endif;
877
- add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css', " . $priority . " );
878
- ";
879
- // if loading parent theme, reset deps and add parent stylesheet
880
- $deps = array( "'chld_thm_cfg_parent'" );
881
-
882
- endif;
883
-
884
- // force a stylesheet dependency if parent is loading out of sequence
885
- if ( 'separate' != $handling && $childloaded && $reorder && ( $parntloaded || in_array( 'chld_thm_cfg_parent', $deps ) ) ):
886
- $dephandle = $parntloaded ? $parntloaded : 'chld_thm_cfg_parent';
887
- $code .= "
888
- if ( !function_exists( 'chld_thm_cfg_add_parent_dep' ) ):
889
- function chld_thm_cfg_add_parent_dep() {
890
- global \$wp_styles;
891
- array_unshift( \$wp_styles->registered[ '" . $childloaded . "' ]->deps, '" . $dephandle . "' );
892
- }
893
- endif;
894
- add_action( 'wp_head', 'chld_thm_cfg_add_parent_dep', 2 );
895
- ";
896
- endif;
897
-
898
  // enqueue external stylesheets (previously used @import in the stylesheet)
899
  if ( !empty( $imports ) ):
900
  $ext = 0;
901
  foreach ( $imports as $import ):
902
- if ( !empty( $import ) ):
903
- $ext++;
904
- $enqueues[] = ' ' . $this->convert_import_to_enqueue( $import, $ext );
905
- endif;
906
  endforeach;
907
  endif;
908
- // if child not loaded, enqueue it and add it to dependencies
909
- if ( 'separate' != $handling && ( ( $csswphead || $cssunreg || $cssnotheme )
910
- || ( 'new' != $this->childtype && !$childloaded )
911
- ) ):
912
- $deps = array_merge( $deps, $this->get( 'child_deps' ) );
913
- $enqueues[] = " wp_enqueue_style( 'chld_thm_cfg_child', trailingslashit( get_stylesheet_directory_uri() ) . 'style.css', array( " . implode( ',', $deps ) . " ) );";
914
- // if loading child theme stylesheet, reset deps and add child stylesheet
915
- $deps = array( "'chld_thm_cfg_child'" );
916
- endif;
917
- if ( 'separate' == $handling ):
918
- $deps = array_merge( $deps, $this->get( 'child_deps' ) );
919
- $enqueues[] = " wp_enqueue_style( 'chld_thm_cfg_separate', trailingslashit( get_stylesheet_directory_uri() ) . 'ctc-style.css', array( " . implode( ',', $deps ) . " ) );";
920
- endif;
921
  if ( count( $enqueues ) ):
922
- $code .= "
923
- if ( !function_exists( 'child_theme_configurator_css' ) ):
924
- function child_theme_configurator_css() {" . LF;
 
 
 
 
925
  $code .= implode( "\n", $enqueues );
926
  $code .= "
927
  }
928
  endif;
929
- add_action( 'wp_enqueue_scripts', 'child_theme_configurator_css' );" . LF;
 
930
  endif;
931
- if ( $ignoreparnt )
 
932
  $code .= "
933
- defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT', TRUE );" . LF;
934
- //$this->debug( $code, __FUNCTION__, __CLASS__ );
935
- return explode( "\n", $code ); // apply_filters( 'chld_thm_cfg_enqueue_code_filter', $code ) ); // FIXME?
 
 
 
 
 
 
936
  }
937
 
938
  // updates function file with wp_enqueue_script code block. If getexternals flag is passed function is run in read-only mode
939
- function enqueue_parent_css( $getexternals = FALSE ) {
940
- $this->debug( 'enqueueing parent css: getexternals = ' . $getexternals, __FUNCTION__, __CLASS__ );
941
- $marker = 'ENQUEUE PARENT ACTION';
942
  $insertion = $this->enqueue_parent_code();
943
- if ( $filename = $this->css->is_file_ok( $this->css->get_child_target( 'functions.php' ), 'write' ) ):
944
  $this->insert_with_markers( $filename, $marker, $insertion, $getexternals );
945
- /// FIXME - reset for Pro version
946
- if ( !$getexternals && 'reset' == $this->childtype ):
947
- $marker = 'CTC ENQUEUE PLUGIN ACTION';
948
- $this->insert_with_markers( $filename, $marker, array() );
949
- endif;
950
- endif;
951
  }
952
 
953
  /**
@@ -956,31 +873,26 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
956
  * we would have used WP's insert_with_markers function,
957
  * but it does not use wp_filesystem API.
958
  */
959
- function insert_with_markers( $filename, $marker, $insertion, $getexternals = FALSE ) {
960
  if ( count( $this->errors ) ):
961
- $this->debug( 'Errors detected, returning', __FUNCTION__, __CLASS__ );
962
  return FALSE;
963
  endif;
964
  // first check if this is an ajax update
965
  if ( $this->is_ajax && is_readable( $filename ) && is_writable( $filename ) ):
966
  // ok to proceed
967
- $this->debug( 'Ajax update, bypassing wp filesystem.', __FUNCTION__, __CLASS__ );
968
  $markerdata = explode( "\n", @file_get_contents( $filename ) );
969
  elseif ( !$this->fs ):
970
- $this->debug( 'No filesystem access.', __FUNCTION__, __CLASS__ );
971
  return FALSE; // return if no filesystem access
972
  else:
973
  global $wp_filesystem;
974
  if( !$wp_filesystem->exists( $this->fspath( $filename ) ) ):
975
- if ( $getexternals ):
976
- $this->debug( 'Read only and no functions file yet, returning...', __FUNCTION__, __CLASS__ );
977
- return FALSE;
978
- else:
979
- // make sure file exists with php header
980
- $this->debug( 'No functions file, creating...', __FUNCTION__, __CLASS__ );
981
- $this->add_base_files( $this );
982
- endif;
983
- endif;
984
  // get_contents_array returns extra linefeeds so just split it ourself
985
  $markerdata = explode( "\n", $wp_filesystem->get_contents( $this->fspath( $filename ) ) );
986
  endif;
@@ -988,15 +900,20 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
988
  $externals = array();
989
  $phpopen = 0;
990
  $in_comment = 0;
991
- $foundit = FALSE;
992
- if ( $markerdata ):
993
- $state = TRUE;
994
- foreach ( $markerdata as $n => $markerline ):
 
 
 
 
995
  // remove double slash comment to end of line
996
  $str = preg_replace( "/\/\/.*$/", '', $markerline );
997
  preg_match_all("/(<\?|\?>|\*\/|\/\*)/", $str, $matches );
998
  if ( $matches ):
999
  foreach ( $matches[1] as $token ):
 
1000
  if ( '/*' == $token ):
1001
  $in_comment = 1;
1002
  elseif ( '*/' == $token ):
@@ -1008,117 +925,96 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1008
  endif;
1009
  endforeach;
1010
  endif;
1011
- if ( strpos( $markerline, '// BEGIN ' . $marker ) !== FALSE )
1012
- $state = FALSE;
1013
- if ( $state ):
1014
- if ( $n + 1 < count( $markerdata ) )
1015
- $newfile .= "{$markerline}\n";
1016
- else
1017
- $newfile .= "{$markerline}";
1018
  elseif ( $getexternals ):
1019
  // look for existing external stylesheets and add to imports config data
1020
- if ( preg_match( "/wp_enqueue_style.+?'chld_thm_cfg_ext\d+'.+?'(.+?)'/", $markerline, $matches ) ):
1021
- $this->debug( 'external link found : ' . $matches[ 1 ] );
1022
  $this->convert_enqueue_to_import( $matches[ 1 ] );
1023
- endif;
1024
- endif;
1025
- if ( strpos( $markerline, '// END ' . $marker ) !== FALSE ):
1026
- if ( 'reset' != $this->childtype ):
1027
- $newfile .= "// BEGIN {$marker}\n";
1028
- if ( is_array( $insertion ) )
1029
- foreach ( $insertion as $insertline )
1030
- $newfile .= "{$insertline}\n";
1031
- $newfile .= "// END {$marker}\n";
1032
- endif;
1033
- $state = TRUE;
1034
- $foundit = TRUE;
1035
- endif;
1036
- endforeach;
1037
  else:
1038
- $this->debug( 'Could not parse functions file', __FUNCTION__, __CLASS__ );
1039
  return FALSE;
1040
  endif;
1041
- if ( $foundit ):
1042
- $this->debug( 'Found marker, replaced inline', __FUNCTION__, __CLASS__ );
1043
  else:
1044
- if ( 'reset' != $this->childtype ):
1045
- // verify there is no PHP close tag at end of file
1046
- if ( ! $phpopen ):
1047
- $this->debug( 'PHP not open', __FUNCTION__, __CLASS__ );
1048
- //$this->errors[] = __( 'A closing PHP tag was detected in Child theme functions file so "Parent Stylesheet Handling" option was not configured. Closing PHP at the end of the file is discouraged as it can cause premature HTTP headers. Please edit <code>functions.php</code> to remove the final <code>?&gt;</code> tag and click "Generate/Rebuild Child Theme Files" again.', 'child-theme-configurator' );
1049
- //return FALSE;
1050
- $newfile .= '<?php' . LF;
1051
- endif;
1052
- $newfile .= "\n// BEGIN {$marker}\n";
1053
- foreach ( $insertion as $insertline )
1054
- $newfile .= "{$insertline}\n";
1055
- $newfile .= "// END {$marker}\n";
1056
  endif;
 
 
 
 
1057
  endif;
1058
  // only write file when getexternals is false
1059
- if ( $getexternals ):
1060
- $this->debug( 'Read only, returning.', __FUNCTION__, __CLASS__ );
1061
- else:
1062
- $mode = 'direct' == $this->fs_method ? FALSE : 0666;
1063
- $this->debug( 'Writing new functions file...', __FUNCTION__, __CLASS__ );
1064
- if ( $this->is_ajax && is_writable( $filename ) ):
1065
- // with ajax we have to bypass wp filesystem so file must already be writable
1066
  if ( FALSE === @file_put_contents( $filename, $newfile ) ):
1067
- $this->debug( 'Ajax write failed.', __FUNCTION__, __CLASS__ );
1068
  return FALSE;
1069
  endif;
1070
- elseif ( FALSE === $wp_filesystem->put_contents(
1071
- $this->fspath( $filename ),
1072
- $newfile,
1073
- $mode
1074
- ) ): // chmod will fail unless we have fs access. user can secure files after configuring
1075
- $this->debug( 'Filesystem write failed.', __FUNCTION__, __CLASS__ );
1076
  return FALSE;
1077
  endif;
1078
- $this->css->set_prop( 'converted', 1 );
1079
  endif;
1080
  }
1081
 
1082
  // creates/updates file via filesystem API
1083
  function write_child_file( $file, $contents ) {
1084
- //$this->debug( LF . LF, __FUNCTION__, __CLASS__ );
1085
  if ( !$this->fs ):
1086
- $this->debug( 'No filesystem access, returning.', __FUNCTION__, __CLASS__ );
1087
  return FALSE; // return if no filesystem access
1088
  endif;
1089
  global $wp_filesystem;
1090
  if ( $file = $this->css->is_file_ok( $this->css->get_child_target( $file ), 'write' ) ):
1091
- $mode = 'direct' == $this->fs_method ? FALSE : 0666;
1092
- $file = $this->fspath( $file );
1093
- if ( $wp_filesystem->exists( $file ) ):
1094
- $this->debug( 'File exists, returning.', __FUNCTION__, __CLASS__ );
1095
- return FALSE;
1096
- else:
1097
- $this->debug( 'Writing to filesystem: ' . $file . LF . $contents, __FUNCTION__, __CLASS__ );
1098
- if ( FALSE === $wp_filesystem->put_contents(
1099
- $file,
1100
- $contents,
1101
- $mode
1102
- ) ):
1103
- $this->debug( 'Filesystem write failed, returning.', __FUNCTION__, __CLASS__ );
1104
  return FALSE;
1105
  endif;
 
 
 
1106
  endif;
1107
  else:
1108
- $this->debug( 'No directory, returning.', __FUNCTION__, __CLASS__ );
1109
  return FALSE;
1110
  endif;
1111
- $this->debug( 'Filesystem write successful.', __FUNCTION__, __CLASS__ );
1112
  }
1113
 
1114
- function copy_screenshot() {
1115
  // always copy screenshot
1116
  $this->copy_parent_file( 'screenshot' );
1117
  }
1118
 
1119
  function copy_parent_file( $file, $ext = 'php' ) {
1120
  if ( !$this->fs ):
1121
- $this->debug( 'No filesystem access.', __FUNCTION__, __CLASS__ );
1122
  return FALSE; // return if no filesystem access
1123
  endif;
1124
  global $wp_filesystem;
@@ -1141,20 +1037,17 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1141
  // return true if file already exists
1142
  if ( $wp_filesystem->exists( $this->fspath( $child_file ) ) ) return TRUE;
1143
  $child_dir = dirname( $this->theme_basename( '', $child_file ) );
1144
- $this->debug( 'Verifying child dir... ', __FUNCTION__, __CLASS__ );
1145
  if ( $parent_file // sanity check
1146
  && $child_file // sanity check
1147
  && $this->verify_child_dir( $child_dir ) //create child subdir if necessary
1148
- && $wp_filesystem->copy( $parent_file, $this->fspath( $child_file ), FS_CHMOD_FILE ) ):
1149
- $this->debug( 'Filesystem copy successful', __FUNCTION__, __CLASS__ );
1150
- return TRUE;
1151
- endif;
1152
  $this->errors[] = __( 'Could not copy file:' . $parent_file, 'child-theme-configurator' );
1153
  }
1154
 
1155
  function delete_child_file( $file, $ext = 'php' ) {
1156
  if ( !$this->fs ):
1157
- $this->debug( 'No filesystem access.', __FUNCTION__, __CLASS__ );
1158
  return FALSE; // return if no filesystem access
1159
  endif;
1160
  global $wp_filesystem;
@@ -1165,90 +1058,40 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1165
  if ( $wp_filesystem->delete( $this->fspath( $child_file ) ) ):
1166
  return TRUE;
1167
  else:
1168
- $this->errors[] = __( 'Could not delete ' . $ext . ' file.', 'child-theme-configurator' );
1169
- $this->debug( 'Could not delete ' . $ext . ' file', __FUNCTION__, __CLASS__ );
1170
  endif;
1171
  endif;
1172
  endif;
1173
  }
1174
 
1175
  function get_files( $theme, $type = 'template' ) {
1176
- $isparent = ( $theme === $this->get( 'parnt' ) );
1177
- if ( 'template' == $type && $isparent && ( $templates = $this->get( 'templates' ) ) ):
1178
- return $templates;
1179
- elseif ( !isset( $this->files[ $theme ] ) ):
1180
-
1181
  $this->files[ $theme ] = array();
1182
  $imgext = '(' . implode( '|', array_keys( $this->imgmimes ) ) . ')';
1183
  foreach ( $this->css->recurse_directory(
1184
- trailingslashit( get_theme_root() ) . $theme, '', TRUE ) as $filepath ):
1185
- $file = $this->theme_basename( $theme, $filepath );
1186
  if ( preg_match( "/^style\-(\d+)\.css$/", $file, $matches ) ):
1187
  $date = date_i18n( 'D, j M Y g:i A', strtotime( $matches[ 1 ] ) );
1188
  $this->files[ $theme ][ 'backup' ][ $file ] = $date;
1189
- //$this->debug( 'This is a backup file', __FUNCTION__, __CLASS__ );
1190
- elseif ( strstr( $file, "ctcbackup" ) ):
1191
- $date = date_i18n( 'D, j M Y g:i A', filemtime( $filepath ) );
1192
- $this->files[ $theme ][ 'backup' ][ $file ] = $date;
1193
  elseif ( preg_match( "/^ctc\-plugins\-(\d+)\.css$/", $file, $matches ) ):
1194
  $date = date_i18n( 'D, j M Y g:i A', strtotime( $matches[ 1 ] ) );
1195
  $this->files[ $theme ][ 'pluginbackup' ][ $file ] = $date;
1196
- //$this->debug( 'This is a plugin backup file', __FUNCTION__, __CLASS__ );
1197
  elseif ( preg_match( "/\.php$/", $file ) ):
1198
- if ( $isparent ):
1199
-
1200
- if ( ( $file_verified = $this->css->is_file_ok( $this->css->get_parent_source( $file, $theme ) , 'read' ) ) ):
1201
- $this->debug( 'scanning ' . $file_verified . '... ', __FUNCTION__, __CLASS__ );
1202
- // read 2k at a time and bail if code detected
1203
- $template = FALSE;
1204
- if ( $handle = fopen( $file_verified, "rb") ):
1205
- while ( !feof( $handle ) ) {
1206
- $contents = fread($handle, 2048);
1207
- if ( preg_match( "/\w+\s*\(/", $contents ) ):
1208
- $template = TRUE;
1209
- if ( preg_match( "/(function \w+?|require(_once)?)\s*\(/", $contents ) ):
1210
- $template = FALSE;
1211
- break;
1212
- endif;
1213
- endif;
1214
- }
1215
- fclose( $handle );
1216
- endif;
1217
- if ( $template )
1218
- $this->files[ $theme ][ 'template' ][] = $file;
1219
- endif;
1220
- else:
1221
- //$this->debug( 'Child PHP, adding to templates', __FUNCTION__, __CLASS__ );
1222
- $this->files[ $theme ][ 'template' ][] = $file;
1223
- endif;
1224
- elseif ( preg_match( "/\.css$/", $file )
1225
- && ( !in_array( $file, array(
1226
- 'style.css',
1227
- 'ctc-style.css',
1228
- 'ctc-plugins.css'
1229
- ) ) ) ):
1230
  $this->files[ $theme ][ 'stylesheet' ][] = $file;
1231
- //$this->debug( 'This is a stylesheet', __FUNCTION__, __CLASS__ );
1232
- elseif ( preg_match( "/\.(js|txt)$/", $file ) ):
1233
- $this->files[ $theme ][ 'txt' ][] = $file;
1234
  elseif ( preg_match( "/^images\/.+?\." . $imgext . "$/", $file ) ):
1235
  $this->files[ $theme ][ 'img' ][] = $file;
1236
- //$this->debug( 'This is an image file', __FUNCTION__, __CLASS__ );
1237
- else:
1238
- $this->files[ $theme ][ 'other' ][] = $file;
1239
  endif;
1240
  endforeach;
1241
  endif;
1242
- if ( $isparent ):
1243
- //$this->debug( 'Setting CSS object templates parameter', __FUNCTION__, __CLASS__ );
1244
- $this->css->templates = $this->files[ $theme ][ 'template' ];
1245
- endif;
1246
- $types = explode( ",", $type );
1247
  $files = array();
1248
- foreach ( $types as $type ):
1249
  if ( isset( $this->files[ $theme ][ $type ] ) )
1250
  $files = array_merge( $this->files[ $theme ][ $type ], $files );
1251
- endforeach;
1252
  return $files;
1253
  }
1254
 
@@ -1256,7 +1099,7 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1256
  $file = $this->normalize_path( $file );
1257
  // if no theme passed, returns theme + file
1258
  $themedir = trailingslashit( $this->normalize_path( get_theme_root() ) ) . ( '' == $theme ? '' : trailingslashit( $theme ) );
1259
- //$this->debug( 'Themedir: ' . $themedir . ' File: ' . $file , __FUNCTION__, __CLASS__ );
1260
  return preg_replace( '%^' . preg_quote( $themedir ) . '%', '', $file );
1261
  }
1262
 
@@ -1288,18 +1131,14 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1288
 
1289
  function set_writable( $file = NULL ) {
1290
 
1291
- if ( isset( $file ) ):
1292
- $file = $this->css->get_child_target( $file . '.php' );
1293
- else:
1294
- $file = apply_filters( 'chld_thm_cfg_target', $this->css->get_child_target( 'separate' == $this->get( 'handling' ) ? 'ctc-style.css' : 'style.css' ), $this->css );
1295
- endif;
1296
  if ( $this->fs ): // filesystem access
1297
- if ( is_writable( $file ) ) return;
1298
  global $wp_filesystem;
1299
  if ( $file && $wp_filesystem->chmod( $this->fspath( $file ), 0666 ) ) return;
1300
  endif;
1301
  $this->errors[] = __( 'Could not set write permissions.', 'child-theme-configurator' );
1302
- add_action( 'admin_notices', array( $this, 'writable_notice' ) );
1303
  return FALSE;
1304
  }
1305
 
@@ -1319,7 +1158,7 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1319
  $newfile = trailingslashit( $clone ) . $childfile;
1320
  $childpath = $fsthemedir . trailingslashit( $child ) . $childfile;
1321
  $newpath = $fsthemedir . $newfile;
1322
- $this->debug( 'Verifying child dir... ', __FUNCTION__, __CLASS__ );
1323
  if ( $this->verify_child_dir( is_dir( $file ) ? $newfile : dirname( $newfile ) ) ):
1324
  if ( is_file( $file ) && !@$wp_filesystem->copy( $childpath, $newpath ) ):
1325
  $errors[] = 'could not copy ' . $newpath;
@@ -1358,7 +1197,7 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1358
  $childpath = $fsthemedir . trailingslashit( $child ) . $childfile;
1359
  $newpath = $fsthemedir . $newfile;
1360
  if ( $copy ):
1361
- $this->debug( 'Verifying child dir... ' . $file, __FUNCTION__, __CLASS__ );
1362
  if ( $this->verify_child_dir( is_dir( $file ) ? $newfile : dirname( $newfile ) ) ):
1363
  if ( is_file( $file ) && !$wp_filesystem->copy( $childpath, $newpath ) ):
1364
  $errors[] = 'could not copy ' . $newpath;
@@ -1400,7 +1239,7 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1400
  endif;
1401
  if ( count( $errors ) ):
1402
  $this->errors[] = __( 'There were errors while resetting permissions.', 'child-theme-configurator' ) ;
1403
- add_action( 'admin_notices', array( $this, 'writable_notice' ) );
1404
  endif;
1405
  }
1406
 
@@ -1430,106 +1269,34 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1430
  $target_file = ( '' == $subdir ?
1431
  preg_replace( "%^.+(\.\w+)$%", "screenshot$1", basename( $source_file ) ) :
1432
  trailingslashit( $subdir ) . basename( $source_file ) );
1433
- $source_path = $this->uploads_fullpath( $source_file );
1434
- $source_dir = dirname( $source_path );
1435
- $mode = 0;
1436
- if ( FALSE !== $this->verify_child_dir( trailingslashit( $this->get( 'child' ) ) . $subdir ) ):
1437
-
1438
  if ( $target_path = $this->css->is_file_ok( $this->css->get_child_target( $target_file ), 'write' ) ):
1439
- $fs_target_path = $this->fspath( $target_path );
1440
- $fs_source_path = $this->fspath( $source_path );
1441
- if ( $wp_filesystem->exists( $fs_source_path ) ):
1442
- // in case source dir is not writable by wp_filesystem
1443
- //$fs_source_dir = dirname( $fs_source_path );
1444
- //if ( !$wp_filesystem->is_writable( $fs_source_dir ) ):
1445
- // wp_filesystem->is_writable always returns true so just try chmod as webserver
1446
- $mode = fileperms( $source_dir );
1447
- if ( $mode ) :
1448
- $writemode = $mode | 0666;
1449
- if ( $set_perms = @chmod( $source_dir, $writemode ) )
1450
- $this->debug( 'Changed source dir permissions from ' . substr( sprintf( '%o', $mode ), -4 ) . ' to ' . substr( sprintf( '%o', $writemode ), -4 ), __FUNCTION__ );
1451
- endif;
1452
- //endif;
1453
- if ( @$wp_filesystem->move( $fs_source_path, $fs_target_path ) ):
1454
- if ( $mode && $set_perms ):
1455
- if ( @chmod( $source_dir, $mode ) )
1456
- $this->debug( 'Reset source dir permissions to ' . substr( sprintf( '%o', $mode ), -4 ), __FUNCTION__ );
1457
- endif;
1458
- return TRUE;
1459
- else:
1460
- if ( $mode && $set_perms ):
1461
- if ( @chmod( $source_dir, $mode ) )
1462
- $this->debug( 'Reset source dir permissions to ' . substr( sprintf( '%o', $mode ), -4 ), __FUNCTION__ );
1463
- endif;
1464
- $this->debug( 'Could not move file from ' . $source_path . ' to ' . $target_file, __FUNCTION__ );
1465
- endif;
1466
- else:
1467
- $this->debug( 'Source file does not exist: ' . $source_path, __FUNCTION__ );
1468
  endif;
1469
- else:
1470
- $this->debug( 'Target file not OK: ' . $target_file, __FUNCTION__ );
1471
  endif;
1472
- else:
1473
- $this->debug( 'Could not verify child dir', __FUNCTION__ );
1474
  endif;
1475
 
1476
  $this->errors[] = __( 'Could not upload file.', 'child-theme-configurator' );
1477
  }
1478
 
1479
- /**
1480
- * exports theme as zip archive.
1481
- * As of version 2.03, parent themes can be exported as well
1482
- */
1483
- function export_theme() {
1484
- $version = '';
1485
- if ( empty( $_POST[ 'ctc_export_theme' ] ) ):
1486
- $template = $this->get( 'child' );
1487
- $version = preg_replace( "%[^\w\.\-]%", '', $this->get( 'version' ) );
1488
- else:
1489
- $template = sanitize_text_field( $_POST[ 'ctc_export_theme' ] );
1490
- if ( ( $theme = wp_get_theme( $template ) ) && is_object( $theme ) )
1491
- $version = preg_replace( "%\.\d{10}$%", '', $theme->Version );
1492
- endif;
1493
- // make sure directory exists and is in themes folder
1494
- if ( ( $dir = $this->css->is_file_ok( trailingslashit( get_theme_root() ) . $template, 'search' ) ) ):
1495
- if ( $tmpdir = $this->get_tmp_dir() ):
1496
- $file = trailingslashit( $tmpdir ) . $template . ( empty( $version ) ? '' : '-' . $version ) . '.zip';
1497
- $this->export_zip_file( $file, $dir );
1498
- else:
1499
- return FALSE;
1500
- endif;
1501
- else:
1502
- $this->errors = __( 'Invalid theme root directory.', 'child-theme-configurator' );
1503
- endif;
1504
- }
1505
-
1506
- function get_tmp_dir(){
1507
- // Try to use php system upload dir to store temp files first
1508
- $tmpdir = ini_get( 'upload_tmp_dir' ) ? ini_get( 'upload_tmp_dir' ) : sys_get_temp_dir();
1509
- if ( !is_writable( $tmpdir ) ):
1510
- // try uploads directory
1511
- $uploads = wp_upload_dir();
1512
- $tmpdir = $uploads[ 'basedir' ];
1513
- if ( !is_writable( $tmpdir ) ):
1514
- $this->errors[] = __( 'No writable temp directory.', 'child-theme-configurator' );
1515
- return FALSE;
1516
- endif;
1517
- endif;
1518
- return $tmpdir;
1519
- }
1520
-
1521
- function export_zip_file( $file, $source ) {
1522
- if ( file_exists( $file ) ) unlink ( $file );
1523
 
1524
- mbstring_binary_safe_encoding();
1525
-
1526
- // PclZip ships with WordPress
1527
- require_once( ABSPATH . 'wp-admin/includes/class-pclzip.php' );
1528
 
1529
- $archive = new PclZip( $file );
1530
- if ( $response = $archive->create( $source, PCLZIP_OPT_REMOVE_PATH, dirname( $source ) ) ):
1531
-
1532
- reset_mbstring_encoding();
1533
  header( 'Content-Description: File Transfer' );
1534
  header( 'Content-Type: application/octet-stream' );
1535
  header( 'Content-Length: ' . filesize( $file ) );
@@ -1540,10 +1307,9 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1540
  readfile( $file );
1541
  unlink( $file );
1542
  die();
1543
- else:
1544
- $this->errors[] = __( 'PclZip returned zero bytes.', 'child-theme-configurator' );
1545
  endif;
1546
  }
 
1547
  /*
1548
  *
1549
  */
@@ -1594,15 +1360,98 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1594
  $fsdir = $wp_filesystem->find_folder( $dir );
1595
  return trailingslashit( $fsdir ) . $base;
1596
  }
1597
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1598
  // backwards compatability < WP 3.9
1599
  function normalize_path( $path ) {
1600
- $path = str_replace( '\\', '/', $path );
1601
- // accommodates windows NT paths without C: prefix
1602
- $path = substr( $path, 0, 1 ) . preg_replace( '|/+|','/', substr( $path, 1 ) );
1603
- if ( ':' === substr( $path, 1, 1 ) )
1604
- $path = ucfirst( $path );
1605
- return $path;
1606
  }
1607
 
1608
  // case insensitive theme search
@@ -1627,7 +1476,7 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1627
  endif;
1628
  if ( $this->is_legacy()
1629
  && is_object( $this->css )
1630
- && ( $configtype = $this->get( 'configtype' ) )
1631
  && !empty( $configtype ) && 'theme' != $configtype ):
1632
  return FALSE;
1633
  endif;
@@ -1636,484 +1485,137 @@ defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) or define( 'CHLD_THM_CFG_IGNORE_PARENT',
1636
 
1637
  /* returns parent theme either from existing config or passed as post var */
1638
  function get_current_parent() {
1639
- // check if child was passed and use Template value
1640
- if ( isset( $_GET[ 'ctc_child' ] ) && ( $child = sanitize_text_field( $_GET[ 'ctc_child' ] ) ) )
1641
- return $this->themes[ 'child' ][ $child ][ 'Template' ];
1642
- // otherwise check if parent was passed
1643
  if ( isset( $_GET[ 'ctc_parent' ] ) && ( $parent = sanitize_text_field( $_GET[ 'ctc_parent' ] ) ) )
1644
  return $parent;
1645
- // otherwise use css object value
1646
- elseif ( $parent = $this->get( 'parnt' ) )
1647
  return $parent;
1648
- // otherwise use template value
1649
  else return get_template();
1650
  }
1651
 
1652
  /* returns child theme either from existing config or passed as post var */
1653
  function get_current_child() {
1654
- // check if parent was passed
1655
  if ( isset( $_GET[ 'ctc_child' ] ) && ( $child = sanitize_text_field( $_GET[ 'ctc_child' ] ) ) )
1656
  return $child;
1657
- // otherwise use css object value
1658
- elseif ( $child = $this->get( 'child' ) )
1659
  return $child;
1660
- // otherwise use stylesheet value
1661
  else return get_stylesheet();
1662
  }
1663
-
1664
- function toggle_debug() {
1665
- $debug = '';
1666
- if ( $_POST[ 'ctc_is_debug' ] ):
1667
- $this->is_debug = 1;
1668
- else:
1669
- $this->is_debug = 0;
1670
- endif;
1671
- update_option( CHLD_THM_CFG_OPTIONS . '_debug', $this->is_debug, FALSE );
1672
- delete_site_transient( CHLD_THM_CFG_OPTIONS . '_debug' );
1673
  }
1674
-
1675
- function debug( $msg = NULL, $fn = NULL, $cl = NULL ) {
1676
- if ( $this->is_debug )
1677
- $this->debug .= ( isset( $cl ) ? $cl . '::' : '' ) . ( isset( $fn ) ? $fn . ' -- ' : '' ) . ( isset( $msg ) ? $msg . LF : '' );
1678
  }
1679
 
1680
- function log_debug() {
1681
- $this->debug( '*** END OF REQUEST ***', __FUNCTION__, __CLASS__ );
1682
- // save debug data for 1 hour
1683
- set_site_transient( CHLD_THM_CFG_OPTIONS . '_debug', $this->debug, 3600 );
1684
- }
1685
- function get_debug() {
1686
- return get_site_transient( CHLD_THM_CFG_OPTIONS . '_debug' ) . LF . $this->debug;
1687
- }
1688
- function cache_debug() {
1689
- $this->debug( '*** END OF REQUEST ***', __FUNCTION__, __CLASS__ );
1690
- $this->updates[] = array(
1691
- 'obj' => 'debug',
1692
- 'key' => '',
1693
- 'data' => $this->debug,
1694
- );
1695
  }
1696
- function parse_parent_stylesheet_to_source() {
1697
- $this->css->parse_css_file( 'parnt' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1698
  }
1699
 
1700
- function parse_child_stylesheet_to_source() {
1701
- $this->css->parse_css_file( 'child', 'style.css', 'parnt' );
 
 
1702
  }
1703
 
1704
- function parse_child_stylesheet_to_target() {
1705
- $this->css->parse_css_file( 'child', 'style.css' );
 
 
1706
  }
1707
 
1708
- function parse_custom_stylesheet_to_target() {
1709
- $this->css->parse_css_file( 'child', 'ctc-style.css' );
1710
  }
1711
-
1712
- function parse_genesis_stylesheet_to_source() {
1713
- $this->css->parse_css_file( 'child', 'ctc-genesis.css', 'parnt' );
 
 
 
1714
  }
1715
-
1716
- function parse_additional_stylesheets_to_source() {
1717
  // parse additional stylesheets
1718
- foreach ( $this->css->addl_css as $file ):
1719
- //$file = sanitize_text_field( $file );
 
 
1720
  $this->css->parse_css_file( 'parnt', $file );
 
1721
  endforeach;
1722
- $this->debug( print_r( $this->css->addl_css, TRUE ), __FUNCTION__, __CLASS__ );
1723
- //endif;
1724
- }
1725
-
1726
- function reset_child_theme() {
1727
- $parnt = $this->get( 'parnt' );
1728
- $child = $this->get( 'child' );
1729
- $name = $this->get( 'child_name' );
1730
- $this->css = new ChildThemeConfiguratorCSS();
1731
- $this->css->set_prop( 'parnt', $parnt );
1732
- $this->css->set_prop( 'child', $child );
1733
- $this->css->set_prop( 'child_name', $name );
1734
- $this->css->set_prop( 'enqueue', 'enqueue' );
1735
- $this->backup_or_restore_file( 'header.php', TRUE );
1736
- $this->delete_child_file( 'header.ctcbackup', 'php' );
1737
- $this->backup_or_restore_file( 'style.css', TRUE );
1738
- $this->delete_child_file( 'style.ctcbackup', 'css' );
1739
- $this->backup_or_restore_file( 'ctc-style.css', TRUE );
1740
- $this->delete_child_file( 'ctc-style.ctcbackup', 'css' );
1741
- }
1742
-
1743
- // we can copy settings from parent to child even if neither is currently active
1744
- // so we need cases for active parent, active child or neither
1745
- function copy_theme_mods( $from, $to ) {
1746
- if ( strlen( $from ) && strlen( $to ) ):
1747
- $this->set_theme_mods( $to, $this->get_theme_mods( $from ) );
1748
  endif;
1749
  }
1750
 
1751
-
1752
- function get_theme_mods( $theme ){
 
 
 
1753
  // get active theme
1754
  $active_theme = get_stylesheet();
 
1755
  // create temp array from parent settings
1756
- $mods = get_option( 'theme_mods_' . $theme );
1757
- if ( $active_theme == $theme ):
1758
- $this->debug( 'from is active, using active widgets', __FUNCTION__, __CLASS__ );
1759
  // if parent theme is active, get widgets from active sidebars_widgets array
1760
- $mods[ 'sidebars_widgets' ][ 'data' ] = retrieve_widgets();
1761
  else:
1762
- $this->debug( 'from not active, using theme mods widgets', __FUNCTION__, __CLASS__ );
1763
  // otherwise get widgets from parent theme mods
1764
- $mods[ 'sidebars_widgets' ][ 'data' ] = empty( $mods[ 'sidebars_widgets' ][ 'data' ] ) ?
1765
- array( 'wp_inactive_widgets' => array() ) : $mods[ 'sidebars_widgets' ][ 'data' ];
1766
  endif;
1767
- return $mods;
1768
- }
1769
-
1770
- function set_theme_mods( $theme, $mods ){
1771
- $active_theme = get_stylesheet();
1772
- $widgets = $mods[ 'sidebars_widgets' ][ 'data' ];
1773
- if ( $active_theme == $theme ):
1774
- $this->debug( 'to active, setting active widgets', __FUNCTION__, __CLASS__ );
1775
- // copy widgets to active sidebars_widgets array
1776
- wp_set_sidebars_widgets( $mods[ 'sidebars_widgets' ][ 'data' ] );
1777
  // if child theme is active, remove widgets from temp array
1778
- unset( $mods[ 'sidebars_widgets' ] );
 
 
1779
  else:
1780
- $this->debug( 'child not active, saving widgets in theme mods', __FUNCTION__, __CLASS__ );
1781
  // otherwise copy widgets to temp array with time stamp
1782
- // array value is already set
1783
- //$mods[ 'sidebars_widgets' ][ 'data' ] = $widgets;
1784
- $mods[ 'sidebars_widgets' ][ 'time' ] = time();
1785
  endif;
1786
- //$this->debug( 'saving child theme mods:' . LF . print_r( $mods, TRUE ), __FUNCTION__, __CLASS__ );
1787
  // copy temp array to child mods
1788
- update_option( 'theme_mods_' . $theme, $mods );
1789
  }
1790
 
1791
  function network_enable() {
1792
- if ( $child = $this->get( 'child' ) ):
1793
  $allowed_themes = get_site_option( 'allowedthemes' );
1794
  $allowed_themes[ $child ] = true;
1795
  update_site_option( 'allowedthemes', $allowed_themes );
1796
  endif;
1797
  }
1798
-
1799
- function backup_or_restore_file( $source, $restore = FALSE, $target = NULL ){
1800
- $action = $restore ? 'Restore' : 'Backup';
1801
- $this->debug( LF . LF . $action . ' main stylesheet...', __FUNCTION__, __CLASS__ );
1802
- if ( !$this->fs ):
1803
- $this->debug( 'No filesystem access, returning', __FUNCTION__, __CLASS__ );
1804
- return FALSE; // return if no filesystem access
1805
- endif;
1806
- list( $base, $suffix ) = explode( '.', $source );
1807
- if ( empty( $target ) )
1808
- $target = $base . '.ctcbackup.' . $suffix;
1809
- if ( $restore ):
1810
- $source = $target;
1811
- $target = $base . '.' . $suffix;
1812
- endif;
1813
- $fstarget = $this->fspath( $this->css->get_child_target( $target ) );
1814
- $fssource = $this->fspath( $this->css->get_child_target( $source ) );
1815
- global $wp_filesystem;
1816
- if ( ( !$wp_filesystem->exists( $fssource ) ) || ( !$restore && $wp_filesystem->exists( $fstarget ) ) ):
1817
- $this->debug( 'No stylesheet, returning', __FUNCTION__, __CLASS__ );
1818
- return FALSE;
1819
- endif;
1820
- if ( $wp_filesystem->copy( $fssource, $fstarget, FS_CHMOD_FILE ) ):
1821
- $this->debug( 'Filesystem ' . $action . ' successful', __FUNCTION__, __CLASS__ );
1822
- return TRUE;
1823
- else:
1824
- $this->debug( 'Filesystem ' . $action . ' failed', __FUNCTION__, __CLASS__ );
1825
- return FALSE;
1826
- endif;
1827
- }
1828
-
1829
- function rewrite_stylesheet_header(){
1830
- $this->debug( LF . LF . 'Rewriting main stylesheet header...', __FUNCTION__, __CLASS__ );
1831
- if ( !$this->fs ):
1832
- $this->debug( 'No filesystem access, returning', __FUNCTION__, __CLASS__ );
1833
- return FALSE; // return if no filesystem access
1834
- endif;
1835
- $origcss = $this->css->get_child_target( 'style.css' );
1836
- $fspath = $this->fspath( $origcss );
1837
- global $wp_filesystem;
1838
- if( !$wp_filesystem->exists( $fspath ) ):
1839
- $this->debug( 'No stylesheet, returning', __FUNCTION__, __CLASS__ );
1840
- return FALSE;
1841
- endif;
1842
- // get_contents_array returns extra linefeeds so just split it ourself
1843
- $contents = $wp_filesystem->get_contents( $fspath );
1844
- $child_headers = $this->css->get_css_header();
1845
- if ( is_array( $child_headers ) )
1846
- $regex = implode( '|', array_map( 'preg_quote', array_keys( $child_headers ) ) );
1847
- else $regex = 'NO HEADERS';
1848
- $regex = '/(' . $regex . '):.*$/';
1849
- $this->debug( 'regex: ' . $regex, __FUNCTION__, __CLASS__ );
1850
- $header = str_replace( "\r", LF, substr( $contents, 0, 8192 ) );
1851
- $contents = substr( $contents, 8192 );
1852
- $this->debug( 'original header: ' . LF . substr( $header, 0, 1024 ), __FUNCTION__, __CLASS__ );
1853
- //$this->debug( 'stripping @import rules...', __FUNCTION__, __CLASS__ );
1854
- // strip out existing @import lines
1855
- $header = preg_replace( '#\@import\s+url\(.+?\);\s*#s', '', $header );
1856
- // parse header line by line
1857
- $headerdata = explode( "\n", $header );
1858
- $in_comment = 0;
1859
- $found_header = 0;
1860
- $headerdone = 0;
1861
- $newheader = '';
1862
- if ( $headerdata ):
1863
- $this->debug( 'parsing header...', __FUNCTION__, __CLASS__ );
1864
- foreach ( $headerdata as $n => $headerline ):
1865
- preg_match_all("/(\*\/|\/\*)/", $headerline, $matches );
1866
- if ( $matches ):
1867
- foreach ( $matches[1] as $token ):
1868
- if ( '/*' == $token ):
1869
- $in_comment = 1;
1870
- elseif ( '*/' == $token ):
1871
- $in_comment = 0;
1872
- endif;
1873
- endforeach;
1874
- endif;
1875
- if ( $in_comment ):
1876
- $this->debug( 'in comment', __FUNCTION__, __CLASS__ );
1877
- if ( preg_match( $regex, $headerline, $matches ) && !empty( $matches[ 1 ] ) ):
1878
- $found_header = 1;
1879
- $key = $matches[ 1 ];
1880
- $this->debug( 'found header: ' . $key, __FUNCTION__, __CLASS__ );
1881
- if ( array_key_exists( $key, $child_headers ) ):
1882
- $this->debug( 'child header value exists: ', __FUNCTION__, __CLASS__ );
1883
- $value = trim( $child_headers[ $key ] );
1884
- unset( $child_headers[ $key ] );
1885
- if ( $value ):
1886
- $this->debug( 'setting ' . $key . ' to ' . $value, __FUNCTION__, __CLASS__ );
1887
- $count = 0;
1888
- $headerline = preg_replace(
1889
- $regex,
1890
- ( empty( $value ) ? '' : $key . ': ' . $value ),
1891
- $headerline
1892
- );
1893
- else:
1894
- $this->debug( 'removing ' . $key, __FUNCTION__, __CLASS__ );
1895
- continue;
1896
- endif;
1897
- endif;
1898
- endif;
1899
- $newheader .= $headerline . LF;
1900
- elseif ( $found_header && !$headerdone ): // we have gone in and out of header block; insert any remaining parameters
1901
- //$this->debug( 'not in comment and after header', __FUNCTION__, __CLASS__ );
1902
- foreach ( $child_headers as $key => $value ):
1903
- $this->debug( 'inserting ' . $key . ': ' . $value, __FUNCTION__, __CLASS__ );
1904
- if ( empty( $value ) ) continue;
1905
- $newheader .= $key . ': ' . trim( $value ) . "\n";
1906
- endforeach;
1907
- // if importing parent, add after this line
1908
- $newheader .= $headerline . "\n" . $this->css->get_css_imports();
1909
- $headerdone = 1;
1910
- else:
1911
- //$this->debug( 'not in comment', __FUNCTION__, __CLASS__ );
1912
- $newheader .= $headerline . LF;
1913
- endif;
1914
- endforeach;
1915
- $this->debug( 'new header: ' . LF . substr( $newheader, 0, 1024 ), __FUNCTION__, __CLASS__ );
1916
- if ( !$found_header ) return FALSE;
1917
- endif;
1918
- $contents = $newheader . $contents;
1919
- if ( FALSE === $wp_filesystem->put_contents( $fspath, $contents ) ):
1920
- //$this->debug( 'Filesystem write to ' . $fspath . ' failed.', __FUNCTION__, __CLASS__ );
1921
- else:
1922
- //$this->debug( 'Filesystem write to ' . $fspath . ' successful.', __FUNCTION__, __CLASS__ );
1923
- endif;
1924
- //die( '<pre><code>' . $contents . '</code></pre>');
1925
- }
1926
-
1927
- function max_styles_notice() {
1928
- $this->ui->render_notices( 'max_styles' );
1929
- }
1930
-
1931
- function config_notice() {
1932
- $this->ui->render_notices( 'config' );
1933
- }
1934
-
1935
- function writable_notice() {
1936
- $this->ui->render_notices( 'writable' );
1937
- }
1938
-
1939
- function enqueue_notice() {
1940
- $this->ui->render_notices( 'enqueue' );
1941
- }
1942
-
1943
- function owner_notice() {
1944
- $this->ui->render_notices( 'owner' );
1945
- }
1946
-
1947
- function changed_notice() {
1948
- $this->ui->render_notices( 'changed' );
1949
- }
1950
-
1951
- function upgrade_notice() {
1952
- $this->ui->render_notices( 'upgrade' );
1953
- }
1954
-
1955
- function get_child_stylesheet() {
1956
- $handling = $this->get( 'handling' );
1957
- if ( 'separate' == $handling )
1958
- return 'ctc-style.css';
1959
- elseif ( 'reset' == $this->childtype )
1960
- return FALSE;
1961
- else
1962
- return 'style.css';
1963
- }
1964
- /**
1965
- * for themes with hard-coded stylesheets,
1966
- * change references to stylesheet_uri to template_directory_uri
1967
- * and move wp_head to end of head if possible
1968
- */
1969
- function repair_header() {
1970
- // return if no flaws detected
1971
- if ( ! $this->get( 'cssunreg' ) && !$this->get( 'csswphead' ) ) return;
1972
- $this->debug( 'repairing parent header', __FUNCTION__, __CLASS__ );
1973
- // try to copy from parent
1974
- $this->copy_parent_file( 'header' );
1975
- // try to backup child header template
1976
- $this->backup_or_restore_file( 'header.php' );
1977
- // fetch current header template
1978
- global $wp_filesystem;
1979
- $cssstr = "get_template_directory_uri()";
1980
- $wphstr = '<?php // MODIFIED BY CTC' . LF . 'wp_head();' . LF . '?>' . LF . '</head>';
1981
- $filename = $this->css->get_child_target( 'header.php' );
1982
- $contents = $wp_filesystem->get_contents( $this->fspath( $filename ) );
1983
-
1984
- // change hard-wired stylesheet link so it loads parent theme instead
1985
- if ( $this->get( 'cssunreg' ) || $this->get( 'csswphead' ) ):
1986
- $repairs = 0;
1987
- $contents = preg_replace( "#(get_bloginfo\(\s*['\"]stylesheet_url['\"]\s*\)|get_stylesheet_uri\(\s*\))#s", $cssstr . ' . "/style.css"', $contents, -1, $count );
1988
- $repairs += $count;
1989
- $contents = preg_replace( "#([^_])bloginfo\(\s*['\"]stylesheet_url['\"]\s*\)#s", "$1echo " . $cssstr . ' . "/style.css"', $contents, -1, $count );
1990
- $repairs += $count;
1991
- $contents = preg_replace( "#([^_])bloginfo\(\s*['\"]stylesheet_directory['\"]\s*\)#s", "$1echo " . $cssstr, $contents, -1, $count );
1992
- $repairs += $count;
1993
- $contents = preg_replace( "#(trailingslashit\()?(\s*)get_stylesheet_directory_uri\(\s*\)(\s*\))?\s*\.\s*['\"]\/?([\w\-\.\/]+?)\.css['\"]#s",
1994
- "$2echo $cssstr . '$3.css'", $contents, -1, $count );
1995
- $repairs += $count;
1996
- if ( $repairs )
1997
- $this->css->set_prop( 'parntloaded', TRUE );
1998
- endif;
1999
-
2000
- // put wp_head() call at the end of <head> section where it belongs
2001
- if ( $this->get( 'csswphead' ) ):
2002
- $contents = preg_replace( "#wp_head\(\s*\)\s*;#s", '', $contents );
2003
- $contents = preg_replace( "#</head>#s", $wphstr, $contents );
2004
- $contents = preg_replace( "#\s*<\?php\s*\?>\s*#s", LF, $contents ); // clean up
2005
- endif;
2006
-
2007
- // write new header template to child theme
2008
- $this->debug( 'Writing to filesystem: ' . $filename . LF . $contents, __FUNCTION__, __CLASS__ );
2009
- if ( FALSE === $wp_filesystem->put_contents( $this->fspath( $filename ), $contents ) ):
2010
- $this->debug( 'Filesystem write failed, returning.', __FUNCTION__, __CLASS__ );
2011
- return FALSE;
2012
- endif;
2013
- //die( '<textarea>' . $contents . '</textarea>' );
2014
- }
2015
-
2016
- /**
2017
- * Evaluate signals collected from theme preview and set configuration accordingly
2018
- */
2019
- function evaluate_signals() {
2020
- if ( !isset( $_POST[ 'ctc_analysis' ] ) ) return;
2021
- $analysis = json_decode( urldecode( $_POST[ 'ctc_analysis' ] ) );
2022
- //die( print_r( $analysis, TRUE ) );
2023
- // stylesheets loaded outside wp_styles queue
2024
- $unregs = array( 'thm_past_wphead', 'thm_unregistered', 'dep_unregistered', 'css_past_wphead', 'dep_past_wphead' );
2025
- //echo '<pre><code>' . print_r( $analysis, TRUE ) . "</code></pre>\n";
2026
-
2027
- // if this is a self-contained child theme ( e.g., Genesis ) use child as baseline
2028
- $baseline = $this->get( 'ignoreparnt' ) ? 'child' : 'parnt';
2029
- $this->debug( 'baseline: ' . $baseline, __FUNCTION__, __CLASS__ );
2030
- $this->css->parnt_deps = array();
2031
- $this->css->child_deps = array();
2032
- $this->css->addl_css = array();
2033
-
2034
- // store stylesheet dependencies
2035
- if ( isset( $analysis->{ $baseline } ) ):
2036
- if ( isset( $analysis->{ $baseline }->deps ) ):
2037
- foreach ( $analysis->{ $baseline }->deps[ 0 ] as $deparray ):
2038
- if ( !in_array( $deparray[ 0 ], $unregs ) ):
2039
- $this->css->parnt_deps[] = $deparray[ 0 ];
2040
- endif;
2041
- if ( !preg_match( "/^style([\-\.]min)?\.css$/", $deparray[ 1 ] ) ):
2042
- // bootstrap wastes memory among other resources
2043
- //if ( !preg_match( "/bootstrap/i", $deparray[ 0 ] ) && !preg_match( "/bootstrap/i", $deparray[ 1 ] ) )
2044
- $this->css->addl_css[] = sanitize_text_field( $deparray[ 1 ] );
2045
- endif;
2046
- endforeach;
2047
- foreach ( $analysis->{ $baseline }->deps[ 1 ] as $deparray ):
2048
- if ( !in_array( $deparray[ 0 ], $unregs ) ):
2049
- $this->css->child_deps[] = $deparray[ 0 ];
2050
- endif;
2051
- if ( 'separate' == $this->get( 'handling' ) || !empty( $analysis->{ $baseline }->signals->ctc_child_loaded ) ):
2052
- if ( !preg_match( "/^style([\-\.]min)?\.css$/", $deparray[ 1 ] ) ):
2053
- //if ( !preg_match( "/bootstrap/", $deparray[ 0 ] ) && !preg_match( "/bootstrap/", $deparray[ 1 ] ) )
2054
- $this->css->addl_css[] = sanitize_text_field( $deparray[ 1 ] );
2055
- endif;
2056
- endif;
2057
- endforeach;
2058
- endif;
2059
- endif;
2060
- // store parent theme signals
2061
- if ( isset( $analysis->{ $baseline }->signals ) ):
2062
- $this->css->set_prop( 'hasstyles', isset( $analysis->{ $baseline }->signals->thm_no_styles ) ? 0 : 1 );
2063
- $this->css->set_prop( 'csswphead', isset( $analysis->{ $baseline }->signals->thm_past_wphead ) ? 1 : 0 );
2064
- $this->css->set_prop( 'cssunreg', isset( $analysis->{ $baseline }->signals->thm_unregistered ) ? 1 : 0 );
2065
- if ( isset( $analysis->{ $baseline }->signals->thm_parnt_loaded ) ):
2066
- $this->set_enqueue_priority( $analysis, $baseline );
2067
- endif;
2068
- endif;
2069
- if ( isset( $analysis->child->signals ) ):
2070
- // test these again for child theme
2071
- $this->css->set_prop( 'csswphead', isset( $analysis->child->signals->thm_past_wphead ) ? 1 : 0 );
2072
- $this->css->set_prop( 'cssunreg', isset( $analysis->child->signals->thm_unregistered ) ? 1 : 0 );
2073
- // special case where theme does not link child stylesheet at all
2074
- $this->css->set_prop( 'cssnotheme', isset( $analysis->child->signals->thm_notheme ) ? 1 : 0 );
2075
- if ( isset( $analysis->child->signals->thm_child_loaded ) ):
2076
- $this->css->set_prop( 'childloaded', $analysis->child->signals->thm_child_loaded );
2077
- $this->set_enqueue_priority( $analysis, 'child' );
2078
- else:
2079
- $this->css->set_prop( 'childloaded', 0 );
2080
- endif;
2081
- // if theme loads parent theme when is_child_theme, add child dependency
2082
- if ( isset( $analysis->child->signals->thm_parnt_loaded ) ):
2083
- $this->css->set_prop( 'parntloaded', $analysis->child->signals->thm_parnt_loaded );
2084
- if ( 'thm_unregistered' != $analysis->child->signals->thm_parnt_loaded ):
2085
- array_unshift( $this->css->child_deps, $analysis->child->signals->thm_parnt_loaded );
2086
- endif;
2087
- else:
2088
- $this->css->set_prop( 'parntloaded', 0 );
2089
- endif;
2090
-
2091
- // if main styleheet is loading out of sequence, force dependency
2092
- if ( isset( $analysis->child->signals->ctc_parnt_reorder ) )
2093
- $this->css->set_prop( 'reorder', 1 );
2094
- // roll back CTC Pro Genesis handling option
2095
- if ( isset( $analysis->child->signals->ctc_gen_loaded ) )
2096
- $this->genesis = TRUE;
2097
- endif;
2098
- }
2099
-
2100
- /**
2101
- * Set the priority of the enqueue hook
2102
- * by matching the hook handle of the primary stylesheet ( thm_parnt_loaded or thm_child_loaded )
2103
- * to the hook handles that were passed by the preview fetched by the analyzer.
2104
- * This allows the stylesheets to be enqueued in the correct order.
2105
- */
2106
- function set_enqueue_priority( $analysis, $baseline ){
2107
- foreach ( $analysis->{ $baseline }->irreg as $irreg ):
2108
- $handles = explode( ',', $irreg );
2109
- $priority = array_shift( $handles );
2110
- $handle = $analysis->{ $baseline }->signals->{ 'thm_' . $baseline . '_loaded' };
2111
- if ( in_array( $handle, $handles ) ):
2112
- $this->debug( '(baseline: ' . $baseline . ') match: ' . $handle . ' setting priority: ' . $priority, __FUNCTION__, __CLASS__ );
2113
- $this->css->set_prop( 'qpriority', $priority );
2114
- break;
2115
- endif;
2116
- endforeach;
2117
- }
2118
-
2119
  }
3
  if ( !defined( 'ABSPATH' ) ) exit;
4
 
5
  /*
6
+ Class: Child_Theme_Configurator
7
  Plugin URI: http://www.childthemeconfigurator.com/
8
  Description: Main Controller Class
9
+ Version: 1.7.9.1
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
+ Text Domain: chld_thm_cfg
13
  Domain Path: /lang
14
  License: GPLv2
15
+ Copyright (C) 2014-2015 Lilaea Media
16
  */
17
  class ChildThemeConfiguratorAdmin {
18
 
19
  // state
 
 
 
 
 
20
  var $is_ajax;
21
  var $is_get;
22
  var $is_post;
23
  var $skip_form;
24
  var $fs;
 
25
 
26
  var $fs_prompt;
27
  var $fs_method;
28
  var $uploadsubdir;
29
  var $menuName; // backward compatibility with plugin extension
30
  var $cache_updates = TRUE;
31
+ var $debug = '';
32
+ var $is_debug = 0;
33
+ var $swatch_text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
 
34
  var $max_sel;
35
  var $sel_limit;
 
36
  // state arrays
37
  var $themes = array();
38
  var $errors = array();
39
  var $files = array();
40
  var $updates = array();
41
+ var $memory = array();
42
  // objects
43
  var $css;
44
  var $ui;
45
  // config arrays
46
  var $postarrays = array(
47
+ 'ctc_img',
48
+ 'ctc_file_parnt',
49
+ 'ctc_file_child',
50
+ 'ctc_additional_css',
51
+ );
52
  var $configfields = array(
53
+ 'theme_parnt',
54
+ 'child_type',
55
+ 'theme_child',
56
+ 'child_template',
57
+ 'child_name',
58
+ 'child_themeuri',
59
+ 'child_author',
60
+ 'child_authoruri',
61
+ 'child_descr',
62
+ 'child_tags',
63
+ 'child_version',
64
+ 'configtype', // backward compatability
65
+ 'nowarn',
66
+ );
 
 
 
67
  var $actionfields = array(
68
+ 'load_styles',
69
+ 'parnt_templates_submit',
70
+ 'child_templates_submit',
71
+ 'image_submit',
72
+ 'theme_image_submit',
73
+ 'theme_screenshot_submit',
74
+ 'export_child_zip',
75
+ 'reset_permission',
76
+ 'templates_writable_submit',
77
+ 'set_writable',
78
+ 'upgrade',
79
+ );
 
80
  var $imgmimes = array(
81
+ 'jpg|jpeg|jpe' => 'image/jpeg',
82
+ 'gif' => 'image/gif',
83
+ 'png' => 'image/png',
84
+ );
85
+ var $excludes = array(
86
+ 'inc',
87
+ 'core',
88
+ 'lang',
89
+ 'css',
90
+ 'js',
91
+ 'lib',
92
+ 'theme',
93
+ 'options',
94
+ );
95
+
96
  function __construct() {
 
 
 
 
 
97
  $this->menuName = CHLD_THM_CFG_MENU; // backward compatability for plugins extension
98
  $this->is_post = ( 'POST' == $_SERVER[ 'REQUEST_METHOD' ] );
99
  $this->is_get = ( 'GET' == $_SERVER[ 'REQUEST_METHOD' ] );
100
  $this->is_debug = get_option( CHLD_THM_CFG_OPTIONS . '_debug' );
101
+ if ( $this->is_debug && ( $this->debug = get_site_transient( CHLD_THM_CFG_OPTIONS . '_debug' ) ) )
102
+ delete_site_transient( CHLD_THM_CFG_OPTIONS . '_debug' );
103
+ // sel_limit is now calculated based on free memory to prevent out of memory on serialization
104
+ $bytes_free = $this->get_free_memory();
105
+ $this->sel_limit = ( int ) ( $bytes_free / CHLD_THM_CFG_BPSEL );
106
+ $this->debug( 'Free memory: ' . $bytes_free . ' max selectors: ' . $this->sel_limit, __FUNCTION__ );
107
+ //$this->set_benchmark( 'before', 'execute', 'program' );
108
  }
109
 
110
+ function enqueue_scripts() {
111
+ wp_enqueue_style( 'chld-thm-cfg-admin', CHLD_THM_CFG_URL . 'css/chld-thm-cfg.min.css', array(), '1.7.9.1' );
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
115
+ if ( !wp_script_is( 'jquery-ui-selectmenu', 'registered' ) ): // selectmenu.min.js
116
+ wp_enqueue_script( 'jquery-ui-selectmenu', CHLD_THM_CFG_URL . 'js/selectmenu.min.js',
117
+ array( 'jquery','jquery-ui-core','jquery-ui-position' ), FALSE, TRUE );
118
+ endif;
119
+ wp_enqueue_script( 'ctc-spectrum', CHLD_THM_CFG_URL . 'js/spectrum.min.js', array( 'jquery' ), FALSE, TRUE );
120
+ wp_enqueue_script( 'ctc-thm-cfg-ctcgrad', CHLD_THM_CFG_URL . 'js/ctcgrad.min.js', array( 'jquery' ), FALSE, TRUE );
121
+ wp_enqueue_script( 'chld-thm-cfg-admin', CHLD_THM_CFG_URL . 'js/chld-thm-cfg.min.js',
122
+ array(
123
+ 'jquery-ui-autocomplete',
124
+ 'jquery-ui-selectmenu',
125
+ 'ctc-spectrum',
126
+ 'ctc-thm-cfg-ctcgrad'
127
+ ), FALSE, TRUE );
128
+ $localize_array = apply_filters( 'chld_thm_cfg_localize_script', array(
129
+ 'ssl' => is_ssl(),
130
+ 'homeurl' => get_home_url() . '?preview_ctc=' . wp_create_nonce(),
131
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
132
+ 'theme_uri' => get_theme_root_uri(),
133
+ 'page' => CHLD_THM_CFG_MENU,
134
+ 'themes' => $this->themes,
135
+ 'source' => apply_filters( 'chld_thm_cfg_source_uri', get_theme_root_uri() . '/'
136
+ . $this->css->get_prop( 'parnt' ) . '/style.css', $this->css ),
137
+ 'target' => apply_filters( 'chld_thm_cfg_target_uri', get_theme_root_uri() . '/'
138
+ . $this->css->get_prop( 'child' ) . '/style.css', $this->css ),
139
+ 'parnt' => $this->css->get_prop( 'parnt' ),
140
+ 'child' => $this->css->get_prop( 'child' ),
141
+ 'addl_css' => $this->css->get_prop( 'addl_css' ),
142
+ 'imports' => $this->css->get_prop( 'imports' ),
143
+ 'is_debug' => $this->is_debug,
144
+ '_background_url_txt' => __( 'URL/None', 'child-theme-configurator' ),
145
+ '_background_origin_txt' => __( 'Origin', 'child-theme-configurator' ),
146
+ '_background_color1_txt' => __( 'Color 1', 'child-theme-configurator' ),
147
+ '_background_color2_txt' => __( 'Color 2', 'child-theme-configurator' ),
148
+ '_border_width_txt' => __( 'Width/None', 'child-theme-configurator' ),
149
+ '_border_style_txt' => __( 'Style', 'child-theme-configurator' ),
150
+ '_border_color_txt' => __( 'Color', 'child-theme-configurator' ),
151
+ 'swatch_txt' => $this->swatch_text,
152
+ 'load_txt' => __( 'Are you sure? This will replace your current settings.', 'child-theme-configurator' ),
153
+ 'important_txt' => __( '<span style="font-size:10px">!</span>', 'child-theme-configurator' ),
154
+ 'selector_txt' => __( 'Selectors', 'child-theme-configurator' ),
155
+ 'close_txt' => __( 'Close', 'child-theme-configurator' ),
156
+ 'edit_txt' => __( 'Edit Selector', 'child-theme-configurator' ),
157
+ 'cancel_txt' => __( 'Cancel', 'child-theme-configurator' ),
158
+ 'rename_txt' => __( 'Rename', 'child-theme-configurator' ),
159
+ 'css_fail_txt' => __( 'The stylesheet cannot be displayed.', 'child-theme-configurator' ),
160
+ 'child_only_txt' => __( '(Child Only)', 'child-theme-configurator' ),
161
+ 'inval_theme_txt' => __( 'Please enter a valid Child Theme.', 'child-theme-configurator' ),
162
+ 'inval_name_txt' => __( 'Please enter a valid Child Theme name.', 'child-theme-configurator' ),
163
+ 'theme_exists_txt' => __( '<strong>%s</strong> exists. Please enter a different Child Theme', 'child-theme-configurator' ),
164
+ 'js_txt' => __( 'The page could not be loaded correctly.',
165
+ 'child-theme-configurator' ),
166
+ 'jquery_txt' => __( 'Conflicting or out-of-date jQuery libraries were loaded by another plugin:',
167
+ 'child-theme-configurator' ),
168
+ 'plugin_txt' => __( 'Deactivating or replacing plugins may resolve this issue.', 'child-theme-configurator' ),
169
+ 'contact_txt' => sprintf( __( '%sWhy am I seeing this?%s',
170
+ 'child-theme-configurator' ),
171
+ '<a target="_blank" href="' . CHLD_THM_CFG_DOCS_URL . '/how-to-use/#script_dep">',
172
+ '</a>' ),
173
+ 'nosels_txt' => __( 'No Styles Available. Try "Parse Additional Stylesheets."', 'child-theme-configurator' ),
174
+ ) );
175
+ wp_localize_script(
176
+ 'chld-thm-cfg-admin',
177
+ 'ctcAjax',
178
+ apply_filters( 'chld_thm_cfg_localize_array', $localize_array )
179
+ );
180
+ }
181
+
182
  /**
183
  * initialize configurator
184
  */
185
  function ctc_page_init () {
186
  // get all available themes
187
  $this->get_themes();
 
 
188
  // load config data and validate
189
  $this->load_config();
190
  // perform any checks prior to processing config data
191
  do_action( 'chld_thm_cfg_preprocess' );
192
  // process any additional forms
193
+ do_action( 'chld_thm_cfg_forms', $this ); // hook for custom forms
194
  // process main post data
195
  $this->process_post();
196
  // initialize UI
198
  $this->ui = new ChildThemeConfiguratorUI();
199
  // initialize help
200
  $this->ui->render_help_content();
201
+ // load styles and scripts
202
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ), 99 );
203
+ // load web fonts for this theme
204
+ $this->load_imports();
205
+ }
206
 
207
  function render() {
208
  $this->ui->render();
209
  }
210
 
 
 
 
 
 
211
  function get_themes() {
212
  // create cache of theme info
213
  $this->themes = array( 'child' => array(), 'parnt' => array() );
248
  include_once( CHLD_THM_CFG_DIR . '/includes/class-ctc-css.php' );
249
  $this->css = new ChildThemeConfiguratorCSS();
250
  if ( FALSE !== $this->css->load_config() ):
 
251
  // if themes do not exist reinitialize
252
+ if ( ! $this->check_theme_exists( $this->css->get_prop( 'child' ) )
253
+ || ! $this->check_theme_exists( $this->css->get_prop( 'parnt' ) ) ):
254
+ add_action( 'admin_notices', array( $this, 'config_notice' ) );
 
255
  $this->css = new ChildThemeConfiguratorCSS();
256
  $this->css->enqueue = 'enqueue';
257
  endif;
258
  else:
 
259
  // this is a fresh install
260
  $this->css->enqueue = 'enqueue';
261
  endif;
262
  do_action( 'chld_thm_cfg_load' );
263
  if ( $this->is_get ):
264
+ if ( $this->css->get_prop( 'child' ) ):
265
  // get filesystem credentials if available
266
  $this->verify_creds();
267
+ $stylesheet = apply_filters( 'chld_thm_cfg_target', $this->css->get_child_target( 'style.css' ), $this->css );
 
 
 
268
  // check file permissions
269
+ if ( !is_writable( $stylesheet ) && !$this->fs ):
270
+ add_action( 'admin_notices', array( $this, 'writable_notice' ) );
 
 
 
 
 
271
  endif;
272
  // enqueue flag will be null for existing install < 1.6.0
273
+ if ( !isset( $this->css->enqueue ) ):
274
+ add_action( 'admin_notices', array( $this, 'enqueue_notice' ) );
 
 
275
  endif;
276
  endif;
277
+ // check if max selectors reached
278
+ if ( isset( $this->css->max_sel ) && $this->css->max_sel ):
279
+ $this->debug( 'Max selectors exceeded.', __FUNCTION__ );
 
 
 
 
 
280
  //$this->errors[] = __( 'Maximum number of styles exceeded.', 'child-theme-configurator' );
281
+ add_filter( 'chld_thm_cfg_update_msg', array( $this, 'max_styles_notice' ), 20 );
282
  endif;
 
283
  // check if file ownership is messed up from old version or other plugin
284
  // by comparing owner of plugin to owner of child theme:
285
+ if ( fileowner( $this->css->get_child_target( '' ) ) != fileowner( CHLD_THM_CFG_DIR ) ):
286
+ add_action( 'admin_notices', array( $this, 'owner_notice' ) );
287
+ endif;
288
+ endif;
289
+ }
290
+
291
+ function cache_debug() {
292
+ $this->updates[] = array(
293
+ 'obj' => 'debug',
294
+ 'key' => '',
295
+ 'data' => $this->print_debug( TRUE ),
296
+ );
297
  }
 
298
  /**
299
  * ajax callback for saving form data
300
  */
301
  function ajax_save_postdata( $action = 'ctc_update' ) {
302
  $this->is_ajax = TRUE;
303
+
304
  // security check
305
  if ( $this->validate_post( $action ) ):
306
  if ( 'ctc_plugin' == $action ) do_action( 'chld_thm_cfg_pluginmode' );
307
  $this->verify_creds(); // initialize filesystem access
 
308
  // get configuration data from options API
309
  if ( FALSE !== $this->load_config() ): // sanity check: only update if config data exists
310
  if ( isset( $_POST[ 'ctc_is_debug' ] ) ):
314
  $this->css->parse_post_data(); // parse any passed values
315
  // if child theme config has been set up, save new data
316
  // return recent edits and selected stylesheets as cache updates
317
+ if ( $this->css->get_prop( 'child' ) ):
318
  // hook for add'l plugin files and subdirectories
319
+ do_action( 'chld_thm_cfg_addl_files', $this );
320
  $this->css->write_css();
321
+ // add any additional updates to pass back to browser
322
+ do_action( 'chld_thm_cfg_cache_updates' );
323
  /*
324
  $this->updates[] = array(
325
  'obj' => 'addl_css',
326
  'key' => '',
327
+ 'data' => $this->css->get_prop( 'addl_css' ),
328
  );
329
  */
330
  endif;
331
 
332
  // update config data in options API
333
+ $this->css->save_config();
334
  endif;
 
 
335
  endif;
336
  endif;
337
  $result = $this->css->obj_to_utf8( $this->updates );
339
  die( json_encode( $result ) );
340
  }
341
 
 
 
 
 
 
342
  /**
343
  * ajax callback to query config data
344
  */
347
  if ( $this->validate_post( $action ) ):
348
  if ( 'ctc_plugin' == $action ) do_action( 'chld_thm_cfg_pluginmode' );
349
  $this->load_config();
 
350
  $regex = "/^ctc_query_/";
351
  foreach( preg_grep( $regex, array_keys( $_POST ) ) as $key ):
352
  $name = preg_replace( $regex, '', $key );
353
  $param[ $name ] = sanitize_text_field( $_POST[ $key ] );
354
  endforeach;
 
355
  if ( !empty( $param[ 'obj' ] ) ):
356
  // add any additional updates to pass back to browser
357
  $this->updates[] = array(
358
  'key' => isset( $param[ 'key' ] ) ? $param[ 'key' ] : '',
359
  'obj' => $param[ 'obj' ],
360
+ 'data' => $this->css->get_prop( $param[ 'obj' ], $param ),
361
  );
362
  do_action( 'chld_thm_cfg_cache_updates' );
363
  die( json_encode( $this->updates ) );
366
  die( 0 );
367
  }
368
 
369
+ /***
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
370
  * Handles processing for all form submissions.
371
+ * Older versions ( < 1.6.0 ) smelled like spaghetti so we moved conditions
372
+ * to switch statement with the main setup logic in a separate function.
373
  */
374
  function process_post() {
375
  // make sure this is a post
384
  if ( empty( $actionfield ) ) return FALSE;
385
 
386
  // make sure post passes security checkpoint
387
+ $this->errors = array();
388
  if ( $this->validate_post( apply_filters( 'chld_thm_cfg_action', 'ctc_update' ) ) ):
389
+ // zip export does not require filesystem access so check that first
390
+ if ( 'export_child_zip' == $actionfield ):
391
+ $this->export_zip();
392
+ // if we get here the zip failed
393
+ $this->errors[] = __( 'Zip file creation failed.', 'child-theme-configurator' );
394
+ // all other actions require filesystem access
395
+ else:
396
+ // handle uploaded file before checking filesystem
397
+ if ( 'theme_image_submit' == $actionfield && isset( $_FILES[ 'ctc_theme_image' ] ) ):
398
+ $this->handle_file_upload( 'ctc_theme_image', $this->imgmimes );
399
+ elseif ( 'theme_screenshot_submit' == $actionfield && isset( $_FILES[ 'ctc_theme_screenshot' ] ) ):
400
+ $this->handle_file_upload( 'ctc_theme_screenshot', $this->imgmimes );
401
+ endif;
402
+ // now we need to check filesystem access
403
+ $args = preg_grep( "/nonce/", array_keys( $_POST ), PREG_GREP_INVERT );
404
+ $this->verify_creds( $args );
405
+ if ( $this->fs ):
406
+ $msg = FALSE;
407
+ // we have filesystem access so proceed with specific actions
408
+ switch( $actionfield ):
409
+ case 'load_styles':
410
+ // main child theme setup function
411
+ $msg = $this->setup_child_theme();
412
+ break;
 
 
 
 
 
 
 
 
 
 
 
 
413
 
414
+ case 'parnt_templates_submit':
415
+ // copy parent templates to child
416
+ if ( isset( $_POST[ 'ctc_file_parnt' ] ) ):
417
+ foreach ( $_POST[ 'ctc_file_parnt' ] as $file ):
418
+ $this->copy_parent_file( sanitize_text_field( $file ) );
419
+ endforeach;
420
+ $msg = '8&tab=file_options';
421
+ endif;
422
+ break;
423
 
424
+ case 'child_templates_submit':
425
+ // delete child theme files
426
+ if ( isset( $_POST[ 'ctc_file_child' ] ) ):
427
+ if ( in_array( 'functions', $_POST[ 'ctc_file_child' ] ) ):
428
  $this->errors[] =
429
+ __( 'The Functions file is required and cannot be deleted.',
430
+ 'child-theme-configurator' );
431
  else:
432
+ foreach ( $_POST[ 'ctc_file_child' ] as $file ):
433
+ $this->delete_child_file( sanitize_text_field( $file ),
434
+ ( preg_match( "/^style|ctc\-plugins/", $file ) ? 'css' : 'php' ) );
435
+ endforeach;
436
+ $msg = '8&tab=file_options';
437
  endif;
438
+ endif;
439
+ break;
440
+
441
+ case 'image_submit':
442
+ // delete child theme images
443
+ if ( isset( $_POST[ 'ctc_img' ] ) ):
444
+ foreach ( $_POST[ 'ctc_img' ] as $file ):
445
+ $this->delete_child_file( 'images/' . sanitize_text_field( $file ), 'img' );
446
+ endforeach;
447
+ $msg = '8&tab=file_options';
448
+ endif;
449
+ break;
450
+
451
+ case 'templates_writable_submit':
452
+ // make specific files writable ( systems not running suExec )
453
+ if ( isset( $_POST[ 'ctc_file_child' ] ) ):
454
+ foreach ( $_POST[ 'ctc_file_child' ] as $file ):
455
+ $this->set_writable( sanitize_text_field( $file ),
456
+ ( 0 === strpos( $file, 'style' ) ? 'css' : 'php' ) );
457
+ endforeach;
458
+ $msg = '8&tab=file_options';
459
+ endif;
460
+ break;
461
+
462
+ case 'set_writable':
463
+ // make child theme style.css and functions.php writable ( systems not running suExec )
464
+ $this->set_writable(); // no argument defaults to style.css
465
+ $this->set_writable( 'functions' );
466
  $msg = '8&tab=file_options';
467
+ break;
 
468
 
469
+ case 'reset_permission':
470
+ // make child theme read-only ( systems not running suExec )
471
+ $this->unset_writable();
 
 
472
  $msg = '8&tab=file_options';
473
+ break;
 
474
 
475
+ case 'theme_image_submit':
476
+ // move uploaded child theme images (now we have filesystem access)
477
+ if ( isset( $_POST[ 'movefile' ] ) ):
478
+ $this->move_file_upload( 'images' );
479
+ $msg = '8&tab=file_options';
480
+ endif;
481
+ break;
 
 
 
482
 
483
+ case 'theme_screenshot_submit':
484
+ // move uploaded child theme screenshot (now we have filesystem access)
485
+ if ( isset( $_POST[ 'movefile' ] ) ):
486
+ // remove old screenshot
487
+ foreach( array_keys( $this->imgmimes ) as $extreg ):
488
+ foreach ( explode( '|', $extreg ) as $ext ):
489
+ $this->delete_child_file( 'screenshot', $ext );
490
+ endforeach;
491
+ endforeach;
492
+ $this->move_file_upload( '' );
493
+ $msg = '8&tab=file_options';
494
+ endif;
495
+ break;
496
+ default:
497
+ // assume we are on the files tab so just redirect there
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
498
  $msg = '8&tab=file_options';
499
+ endswitch;
500
+ endif; // end filesystem condition
501
+ endif; // end zip export condition
502
+ if ( empty( $this->errors ) && empty( $this->fs_prompt ) )
 
 
 
 
 
 
503
  // no errors so we redirect with confirmation message
504
  $this->update_redirect( $msg );
 
505
  // otherwise fail gracefully
506
  $msg = NULL;
507
  return FALSE;
508
  endif; // end post validation condition
509
+ // if you end up here you are not welcome
510
  $msg = NULL;
511
  $this->errors[] = __( 'You do not have permission to configure child themes.', 'child-theme-configurator' );
512
  endif; // end request method condition
513
  return FALSE;
514
  }
515
 
516
+ function toggle_debug() {
517
+ $debug = '';
518
+ if ( $_POST[ 'ctc_is_debug' ] ):
519
+ $this->is_debug = 1;
520
+ $debug = $this->print_debug( TRUE );
521
+ else:
522
+ $this->is_debug = 0;
523
+ endif;
524
+ update_option( CHLD_THM_CFG_OPTIONS . '_debug', $this->is_debug );
525
+ $this->updates[] = array(
526
+ 'obj' => 'debug',
527
+ 'key' => '',
528
+ 'data' => $debug,
529
+ );
530
+ }
531
+
532
+ /***
533
  * Handle the creation or update of a child theme
534
  */
535
  function setup_child_theme() {
 
 
536
  // sanitize and extract config fields into local vars
537
  foreach ( $this->configfields as $configfield ):
538
+
539
  $varparts = explode( '_', $configfield );
540
  $varname = end( $varparts );
541
  ${$varname} = empty( $_POST[ 'ctc_' . $configfield ] ) ? '' :
542
  preg_replace( "/\s+/s", ' ', sanitize_text_field( $_POST[ 'ctc_' . $configfield ] ) );
543
+ $this->debug( 'Extracting var ' . $varname . ' from ctc_' . $configfield . ' value: ' . ${$varname} , __FUNCTION__ );
544
  endforeach;
545
 
546
+ // legacy plugin extension needs parent/child values but this version disables the inputs
 
 
547
  // so get we them from current css object
548
  if ( !$this->is_theme( $configtype ) && $this->is_legacy() ):
549
+ $parnt = $this->css->get_prop( 'parnt' );
550
+ $child = $this->css->get_prop( 'child' );
551
+ $name = $this->css->get_prop( 'child_name' );
552
  endif;
553
+
554
  // validate parent and child theme inputs
555
  if ( $parnt ):
556
  if ( ! $this->check_theme_exists( $parnt ) ):
557
  $this->errors[] = sprintf(
558
+ __( '%s does not exist. Please select a valid Parent Theme.',
559
+ 'child-theme-configurator' ), $parnt );
560
  endif;
561
  else:
562
  $this->errors[] = __( 'Please select a valid Parent Theme.', 'child-theme-configurator' );
563
  endif;
564
+ if ( 'existing' == $type && empty( $child ) ):
565
+ $this->errors[] = __( 'Please enter a valid Child Theme directory.', 'child-theme-configurator' );
566
+ endif;
567
+ if ( empty( $name ) ):
568
+ $name = ucfirst( $child );
569
+ endif;
570
+ // if this is a shiny brand new child theme certain rules apply
571
+ if ( 'new' == $type ):
572
  if ( empty( $template ) && empty( $name ) ):
573
+ $this->errors[] = __( 'Please enter a valid Child Theme template name.', 'child-theme-configurator' );
574
  else:
575
+ $child = preg_replace( "%[^\w\-]%", '', empty( $template ) ? $name : $template );
576
+ if ( $this->check_theme_exists( $child ) ):
577
  $this->errors[] = sprintf(
578
+ __( '<strong>%s</strong> exists. Please enter a different Child Theme template name.',
579
+ 'child-theme-configurator' ), $child );
 
 
 
 
 
 
 
 
580
  endif;
 
581
  endif;
582
+ endif;
583
 
584
+ // clone existing child theme
585
+ if ( 'existing' == $type && isset( $_POST[ 'ctc_duplicate_theme' ] ) ):
586
+ $clone = strtolower( preg_replace( "%[^\w\-]%", '', sanitize_text_field( $_POST[ 'ctc_duplicate_theme_slug' ] ) ) );
587
+ if ( empty( $clone ) ):
588
+ $this->errors[] = __( 'Please enter a valid Child Theme template name.', 'child-theme-configurator' );
589
+ else:
590
+ if ( $this->check_theme_exists( $clone ) ):
591
+ $this->errors[] = sprintf(
592
+ __( '<strong>%s</strong> exists. Please enter a different Child Theme template name.',
593
+ 'child-theme-configurator' ), $clone );
594
+ else:
595
+ $this->clone_child_theme( $child, $clone );
596
+ if ( empty( $this->errors ) ):
597
+ $this->copy_theme_mods( $child, $clone );
598
+ $child = $clone;
599
+ endif;
600
+ endif;
601
+ endif;
602
  endif;
603
+
 
604
  if ( FALSE === $this->verify_child_dir( $child ) ):
 
605
  $this->errors[] = __( 'Your theme directories are not writable.', 'child-theme-configurator' );
606
+ add_action( 'admin_notices', array( $this, 'writable_notice' ) );
 
607
  endif;
608
+
609
+ // if no errors so far, we are good to create child theme
610
+ if ( empty( $this->errors ) ):
611
+ // save imports in case this is a rebuild
612
+ $imports = $this->css->imports;
613
+ $nowarn = ( $nowarn || $this->css->nowarn ) ? 1 : 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
614
  // reset everything else
615
  $this->css = new ChildThemeConfiguratorCSS();
616
  // restore imports if this is a rebuild
617
+ $this->css->imports = $imports;
618
+ $this->css->nowarn = $nowarn;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
619
  // parse parent stylesheet if theme or legacy plugin extension
620
  if ( $this->is_theme( $configtype ) || $this->is_legacy() ):
621
+ add_action( 'chld_thm_cfg_parse_stylesheets', array( &$this, 'parse_parent_stylesheet' ) );
 
 
 
 
 
 
 
622
  if ( is_multisite() )
623
+ add_action( 'chld_thm_cfg_addl_options', array( &$this, 'network_enable' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
624
  endif;
625
 
626
+ add_action( 'chld_thm_cfg_parse_stylesheets', array( &$this, 'parse_additional_stylesheets' ) );
627
+ add_action( 'chld_thm_cfg_parse_stylesheets', array( &$this, 'parse_child_stylesheet' ) );
628
+
629
  // function to support wp_filesystem requirements
630
  if ( $this->is_theme( $configtype ) ):
631
  // is theme means this is not a plugin stylesheet config
632
+ add_action( 'chld_thm_cfg_addl_files', array( &$this, 'add_base_files' ), 10, 2 );
633
+ add_action( 'chld_thm_cfg_addl_files', array( &$this, 'copy_screenshot' ), 10, 2 );
634
+ add_action( 'chld_thm_cfg_addl_files', array( &$this, 'enqueue_parent_css' ), 15, 2 );
635
+ elseif( $this->is_legacy() && has_action( 'chld_thm_cfg_addl_files' ) ):
636
+ // backwards compatability for plugins extension < 2.0.0 (before pro)
637
+ // action exists so we have to hijack it to use new filesystem checks
638
+ remove_all_actions( 'chld_thm_cfg_addl_files' );
639
+ add_action( 'chld_thm_cfg_addl_files', array( &$this, 'write_addl_files' ), 10, 2 );
640
+ $this->css->set_prop( 'configtype', $configtype );
641
  endif;
642
 
643
+ // update with new parameters
644
+ $this->css->set_prop( 'parnt', $parnt );
645
+ $this->css->set_prop( 'child', $child );
646
+ $this->css->set_prop( 'child_name', $name );
647
+ $this->css->set_prop( 'child_author', $author );
648
+ $this->css->set_prop( 'child_themeuri', $themeuri );
649
+ $this->css->set_prop( 'child_authoruri', $authoruri );
650
+ $this->css->set_prop( 'child_descr', $descr );
651
+ $this->css->set_prop( 'child_tags', $tags );
652
+ $this->css->set_prop( 'child_version', strlen( $version ) ? $version : '1.0' );
653
+
654
+ $this->css->set_prop( 'nowarn', $nowarn );
655
+ // set stylesheet handling option
656
+ if ( isset( $_POST[ 'ctc_parent_enqueue' ] ) )
657
+ $this->css->set_prop( 'enqueue', sanitize_text_field( $_POST[ 'ctc_parent_enqueue' ] ) );
658
+ elseif ( !$this->is_theme( $configtype ) )
659
+ $this->css->set_prop( 'enqueue', 'enqueue' );
660
+
661
  // plugin hooks for additional stylesheet handling options
662
+ do_action( 'chld_thm_cfg_stylesheet_handling' );
663
+ do_action( 'chld_thm_cfg_existing_theme' );
 
664
  // plugin hook to parse additional or non-standard files
665
  do_action( 'chld_thm_cfg_parse_stylesheets' );
666
+
667
  // copy menus, widgets and other customizer options from parent to child if selected
668
+ if ( isset( $_POST[ 'ctc_parent_mods' ] ) ) // && empty( $_POST[ 'ctc_duplicate_theme' ] ) )
669
  $this->copy_theme_mods( $parnt, $child );
670
+
671
  // run code generation function in read-only mode to add existing external stylesheet links to config data
672
+ $this->enqueue_parent_css( $this->css, TRUE );
673
  // hook for add'l plugin files and subdirectories. Must run after stylesheets are parsed to apply latest options
674
+ do_action( 'chld_thm_cfg_addl_files', $this );
675
  // do not continue if errors
676
+ if ( empty ( $this->errors ) ):
677
+ // set flag to skip import link conversion on ajax save
678
+ $this->css->converted = 1;
679
+
680
+ // try to write new stylsheet. If it fails send alert.
681
+ if ( FALSE === $this->css->write_css( isset( $_POST[ 'ctc_backup' ] ) ) ):
682
+ $this->debug( 'failed to write', __FUNCTION__ );
683
+ $this->errors[] = __( 'Your stylesheet is not writable.', 'child-theme-configurator' );
684
+ add_action( 'admin_notices', array( $this, 'writable_notice' ) );
685
+ return FALSE;
686
+ endif;
687
+
688
+ // save new object to WP options table
689
+ $this->css->save_config();
690
+
691
+ // plugin hook for additional child theme setup functions
692
+ do_action( 'chld_thm_cfg_addl_options', $this );
693
+
694
+ // return message id 1, which says new child theme created successfully;
695
+ return 1;
696
  endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
697
  endif;
698
+ return FALSE;
699
+ }
700
+
701
+ function load_imports() {
702
+ // allows fonts and other externals to be previewed
703
+ // loads early not to conflict with admin stylesheets
704
+ if ( $imports = $this->css->get_prop( 'imports' ) ):
705
+ $ext = 0;
706
+ foreach ( $imports as $import ):
707
+ $this->convert_import_to_enqueue( $import, ++$ext, TRUE );
708
+ endforeach;
709
+ endif;
710
  }
711
 
712
  /*
724
  }
725
 
726
  function update_redirect( $msg = 1 ) {
 
727
  if ( empty( $this->is_ajax ) ):
728
+ if ( $this->is_debug )
729
+ set_site_transient( CHLD_THM_CFG_OPTIONS . '_debug', $this->debug, 3600 );
730
  $ctcpage = apply_filters( 'chld_thm_cfg_admin_page', CHLD_THM_CFG_MENU );
731
  $screen = get_current_screen()->id;
732
  wp_safe_redirect(
737
  }
738
 
739
  function verify_child_dir( $path ) {
740
+ $this->debug( 'Verifying child dir: ' . $path, __FUNCTION__ );
741
  if ( !$this->fs ):
742
+ $this->debug( 'No filesystem access.', __FUNCTION__ );
743
  return FALSE; // return if no filesystem access
744
  endif;
745
  global $wp_filesystem;
746
  $themedir = $wp_filesystem->find_folder( get_theme_root() );
747
  if ( ! $wp_filesystem->is_writable( $themedir ) ):
748
+ $this->debug( 'Directory not writable: ' . $themedir, __FUNCTION__ );
749
  return FALSE;
750
  endif;
751
  $childparts = explode( '/', $this->normalize_path( $path ) );
755
  $themedir = trailingslashit( $themedir ) . $subdir;
756
  if ( ! $wp_filesystem->is_dir( $themedir ) ):
757
  if ( ! $wp_filesystem->mkdir( $themedir, FS_CHMOD_DIR ) ):
758
+ $this->debug( 'Could not make directory: ' . $themedir, __FUNCTION__ );
759
  return FALSE;
760
  endif;
761
  elseif ( ! $wp_filesystem->is_writable( $themedir ) ):
762
+ $this->debug( 'Directory not writable: ' . $themedir, __FUNCTION__ );
763
  return FALSE;
764
  endif;
765
  endwhile;
766
+ $this->debug( 'Child dir verified: ' . $themedir, __FUNCTION__ );
767
  return TRUE;
768
  }
769
 
770
  function add_base_files( $obj ){
 
771
  // add functions.php file
772
  $contents = "<?php
773
  // Exit if accessed directly
774
  if ( !defined( 'ABSPATH' ) ) exit;
775
  ";
 
776
  $this->write_child_file( 'functions.php', $contents );
777
+ $this->write_child_file( 'style.css', $this->css->get_css_header() );
 
 
 
 
 
 
 
778
  }
779
 
780
  // parses @import syntax and converts to wp_enqueue_style statement
781
  function convert_import_to_enqueue( $import, $count, $execute = FALSE ) {
782
+ $relpath = $this->css->get_prop( 'child' );
783
  $import = preg_replace( "#^.*?url\(([^\)]+?)\).*#", "$1", $import );
784
  $import = preg_replace( "#[\'\"]#", '', $import );
785
  $path = $this->css->convert_rel_url( trim( $import ), $relpath , FALSE );
797
  $this->css->imports[ 'child' ]['@import url(' . $path . ')'] = 1;
798
  return;
799
  endif;
800
+ $regex = '#^' . preg_quote( trailingslashit( $this->css->get_prop( 'child' ) ) ) . '#';
801
  $path = preg_replace( $regex, '', $path, -1, $count );
802
  if ( $count ):
803
  $this->css->imports[ 'child' ]['@import url(' . $path . ')'] = 1;
804
  return;
805
  endif;
806
+ $parent = trailingslashit( $this->css->get_prop( 'parnt' ) );
807
  $regex = '#^' . preg_quote( $parent ) . '#';
808
  $path = preg_replace( $regex, '../' . $parent, $path, -1, $count );
809
  if ( $count )
816
  * If external imports are present, it enqueues them as well.
817
  */
818
  function enqueue_parent_code(){
819
+ $imports = $this->css->get_prop( 'imports' );
820
+ $enqueues = array();
821
+ $code = '';
822
+ // enqueue parent stylesheet
823
+ if ( 'enqueue' == $this->css->enqueue || 'both' == $this->css->enqueue )
824
+ $enqueues[] = " wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css' );";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
825
  // enqueue external stylesheets (previously used @import in the stylesheet)
826
  if ( !empty( $imports ) ):
827
  $ext = 0;
828
  foreach ( $imports as $import ):
829
+ $ext++;
830
+ $enqueues[] = ' ' . $this->convert_import_to_enqueue( $import, $ext );
 
 
831
  endforeach;
832
  endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
833
  if ( count( $enqueues ) ):
834
+ $code = "// AUTO GENERATED - Do not modify or remove comment markers above or below:
835
+ ";
836
+ $code .= "
837
+
838
+ if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
839
+ function chld_thm_cfg_parent_css() {
840
+ ";
841
  $code .= implode( "\n", $enqueues );
842
  $code .= "
843
  }
844
  endif;
845
+ add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css' );
846
+ ";
847
  endif;
848
+ // enqueue child stylesheet. This feature was added to avoid using @import to load parent stylesheet when links are hard-coded into header.php
849
+ if ( 'child' == $this->css->enqueue || 'both' == $this->css->enqueue ):
850
  $code .= "
851
+ if ( !function_exists( 'chld_thm_cfg_child_css' ) ):
852
+ function chld_thm_cfg_child_css() {
853
+ wp_enqueue_style( 'chld_thm_cfg_child', get_stylesheet_uri() );
854
+ }
855
+ endif;
856
+ add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_child_css', 999 );
857
+ ";
858
+ endif;
859
+ return explode( "\n", apply_filters( 'chld_thm_cfg_enqueue_code_filter', $code ) );
860
  }
861
 
862
  // updates function file with wp_enqueue_script code block. If getexternals flag is passed function is run in read-only mode
863
+ function enqueue_parent_css( $obj, $getexternals = FALSE ) {
864
+ $marker = 'ENQUEUE PARENT ACTION';
 
865
  $insertion = $this->enqueue_parent_code();
866
+ if ( $filename = $this->css->is_file_ok( $this->css->get_child_target( 'functions.php' ), 'write' ) )
867
  $this->insert_with_markers( $filename, $marker, $insertion, $getexternals );
 
 
 
 
 
 
868
  }
869
 
870
  /**
873
  * we would have used WP's insert_with_markers function,
874
  * but it does not use wp_filesystem API.
875
  */
876
+ function insert_with_markers( $filename, $marker, $insertion, $getexternals = FALSE ) {
877
  if ( count( $this->errors ) ):
878
+ $this->debug( 'Errors detected, returning', __FUNCTION__ );
879
  return FALSE;
880
  endif;
881
  // first check if this is an ajax update
882
  if ( $this->is_ajax && is_readable( $filename ) && is_writable( $filename ) ):
883
  // ok to proceed
884
+ $this->debug( 'Ajax update, bypassing wp filesystem.', __FUNCTION__ );
885
  $markerdata = explode( "\n", @file_get_contents( $filename ) );
886
  elseif ( !$this->fs ):
887
+ $this->debug( 'No filesystem access.', __FUNCTION__ );
888
  return FALSE; // return if no filesystem access
889
  else:
890
  global $wp_filesystem;
891
  if( !$wp_filesystem->exists( $this->fspath( $filename ) ) ):
892
+ // make sure file exists with php header
893
+ $this->debug( 'No functions file, creating...', __FUNCTION__ );
894
+ $this->add_base_files( $this );
895
+ endif;
 
 
 
 
 
896
  // get_contents_array returns extra linefeeds so just split it ourself
897
  $markerdata = explode( "\n", $wp_filesystem->get_contents( $this->fspath( $filename ) ) );
898
  endif;
900
  $externals = array();
901
  $phpopen = 0;
902
  $in_comment = 0;
903
+ $foundit = FALSE;
904
+ $lasttoken = '';
905
+ if ( $markerdata ):
906
+ $state = TRUE;
907
+ foreach ( $markerdata as $n => $markerline ) {
908
+ // update open state
909
+ $openstars = 0;
910
+ $closestars = 0;
911
  // remove double slash comment to end of line
912
  $str = preg_replace( "/\/\/.*$/", '', $markerline );
913
  preg_match_all("/(<\?|\?>|\*\/|\/\*)/", $str, $matches );
914
  if ( $matches ):
915
  foreach ( $matches[1] as $token ):
916
+ $lasttoken = $token;
917
  if ( '/*' == $token ):
918
  $in_comment = 1;
919
  elseif ( '*/' == $token ):
925
  endif;
926
  endforeach;
927
  endif;
928
+ if ( strpos( $markerline, '// BEGIN ' . $marker ) !== FALSE )
929
+ $state = FALSE;
930
+ if ( $state ):
931
+ if ( $n + 1 < count( $markerdata ) )
932
+ $newfile .= "{$markerline}\n";
933
+ else
934
+ $newfile .= "{$markerline}";
935
  elseif ( $getexternals ):
936
  // look for existing external stylesheets and add to imports config data
937
+ if ( preg_match( "/wp_enqueue_style.+?'chld_thm_cfg_ext\d+'.+?'(.+?)'/", $markerline, $matches ) )
 
938
  $this->convert_enqueue_to_import( $matches[ 1 ] );
939
+ endif;
940
+ if ( strpos( $markerline, '// END ' . $marker ) !== FALSE ):
941
+ $newfile .= "// BEGIN {$marker}\n";
942
+ if ( is_array( $insertion ) )
943
+ foreach ( $insertion as $insertline )
944
+ $newfile .= "{$insertline}\n";
945
+ $newfile .= "// END {$marker}\n";
946
+ $state = TRUE;
947
+ $foundit = TRUE;
948
+ endif;
949
+ }
 
 
 
950
  else:
951
+ $this->debug( 'Could not parse functions file', __FUNCTION__ );
952
  return FALSE;
953
  endif;
954
+ if ( $foundit ):
955
+ $this->debug( 'Found marker, replaced inline', __FUNCTION__ );
956
  else:
957
+ // verify there is no PHP close tag at end of file
958
+ if ( ! $phpopen ):
959
+ $this->debug( 'PHP not open', __FUNCTION__ );
960
+ $this->errors[] = __( 'A closing PHP tag was detected in Child theme functions file so "Parent Stylesheet Handling" option was not configured. Closing PHP at the end of the file is discouraged as it can cause premature HTTP headers. Please edit <code>functions.php</code> to remove the final <code>?&gt;</code> tag and click "Generate/Rebuild Child Theme Files" again.', 'child-theme-configurator' );
961
+ return FALSE;
962
+ //$newfile .= '<?php' . LF;
 
 
 
 
 
 
963
  endif;
964
+ $newfile .= "\n// BEGIN {$marker}\n";
965
+ foreach ( $insertion as $insertline )
966
+ $newfile .= "{$insertline}\n";
967
+ $newfile .= "// END {$marker}\n";
968
  endif;
969
  // only write file when getexternals is false
970
+ if ( ! $getexternals ):
971
+ $this->debug( 'Writing new functions file...', __FUNCTION__ );
972
+ if ( $this->is_ajax && is_writable( $filename ) ):
 
 
 
 
973
  if ( FALSE === @file_put_contents( $filename, $newfile ) ):
974
+ $this->debug( 'Ajax write failed.', __FUNCTION__ );
975
  return FALSE;
976
  endif;
977
+ elseif ( FALSE === $wp_filesystem->put_contents( $this->fspath( $filename ), $newfile ) ):
978
+ $this->debug( 'Filesystem write failed.', __FUNCTION__ );
 
 
 
 
979
  return FALSE;
980
  endif;
981
+ $this->css->converted = 1;
982
  endif;
983
  }
984
 
985
  // creates/updates file via filesystem API
986
  function write_child_file( $file, $contents ) {
 
987
  if ( !$this->fs ):
988
+ $this->debug( 'No filesystem access.', __FUNCTION__ );
989
  return FALSE; // return if no filesystem access
990
  endif;
991
  global $wp_filesystem;
992
  if ( $file = $this->css->is_file_ok( $this->css->get_child_target( $file ), 'write' ) ):
993
+ if ( !$wp_filesystem->exists( $this->fspath( $file ) ) ):
994
+ $this->debug( 'Writing to filesystem: ' . $file, __FUNCTION__ );
995
+ if ( FALSE === $wp_filesystem->put_contents( $this->fspath( $file ), $contents ) ):
996
+ $this->debug( 'Filesystem write failed.', __FUNCTION__ );
 
 
 
 
 
 
 
 
 
997
  return FALSE;
998
  endif;
999
+ else:
1000
+ $this->debug( 'File exists.', __FUNCTION__ );
1001
+ return FALSE;
1002
  endif;
1003
  else:
1004
+ $this->debug( 'No directory.', __FUNCTION__ );
1005
  return FALSE;
1006
  endif;
1007
+ $this->debug( 'Filesystem write successful.', __FUNCTION__ );
1008
  }
1009
 
1010
+ function copy_screenshot( $obj ) {
1011
  // always copy screenshot
1012
  $this->copy_parent_file( 'screenshot' );
1013
  }
1014
 
1015
  function copy_parent_file( $file, $ext = 'php' ) {
1016
  if ( !$this->fs ):
1017
+ $this->debug( 'No filesystem access.', __FUNCTION__ );
1018
  return FALSE; // return if no filesystem access
1019
  endif;
1020
  global $wp_filesystem;
1037
  // return true if file already exists
1038
  if ( $wp_filesystem->exists( $this->fspath( $child_file ) ) ) return TRUE;
1039
  $child_dir = dirname( $this->theme_basename( '', $child_file ) );
1040
+ $this->debug( 'Verifying child dir... ', __FUNCTION__ );
1041
  if ( $parent_file // sanity check
1042
  && $child_file // sanity check
1043
  && $this->verify_child_dir( $child_dir ) //create child subdir if necessary
1044
+ && $wp_filesystem->copy( $parent_file, $this->fspath( $child_file ), FS_CHMOD_FILE ) ) return TRUE;
 
 
 
1045
  $this->errors[] = __( 'Could not copy file:' . $parent_file, 'child-theme-configurator' );
1046
  }
1047
 
1048
  function delete_child_file( $file, $ext = 'php' ) {
1049
  if ( !$this->fs ):
1050
+ $this->debug( 'No filesystem access.', __FUNCTION__ );
1051
  return FALSE; // return if no filesystem access
1052
  endif;
1053
  global $wp_filesystem;
1058
  if ( $wp_filesystem->delete( $this->fspath( $child_file ) ) ):
1059
  return TRUE;
1060
  else:
1061
+ $this->errors[] = __( 'Could not delete file.', 'child-theme-configurator' );
1062
+ $this->debug( 'Could not delete file', __FUNCTION__ );
1063
  endif;
1064
  endif;
1065
  endif;
1066
  }
1067
 
1068
  function get_files( $theme, $type = 'template' ) {
1069
+ if ( !isset( $this->files[ $theme ] ) ):
 
 
 
 
1070
  $this->files[ $theme ] = array();
1071
  $imgext = '(' . implode( '|', array_keys( $this->imgmimes ) ) . ')';
1072
  foreach ( $this->css->recurse_directory(
1073
+ trailingslashit( get_theme_root() ) . $theme, '', TRUE ) as $file ):
1074
+ $file = $this->theme_basename( $theme, $file );
1075
  if ( preg_match( "/^style\-(\d+)\.css$/", $file, $matches ) ):
1076
  $date = date_i18n( 'D, j M Y g:i A', strtotime( $matches[ 1 ] ) );
1077
  $this->files[ $theme ][ 'backup' ][ $file ] = $date;
 
 
 
 
1078
  elseif ( preg_match( "/^ctc\-plugins\-(\d+)\.css$/", $file, $matches ) ):
1079
  $date = date_i18n( 'D, j M Y g:i A', strtotime( $matches[ 1 ] ) );
1080
  $this->files[ $theme ][ 'pluginbackup' ][ $file ] = $date;
 
1081
  elseif ( preg_match( "/\.php$/", $file ) ):
1082
+ $this->files[ $theme ][ 'template' ][] = $file;
1083
+ elseif ( preg_match( "/\.css$/", $file ) && 'style.css' != $file ):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1084
  $this->files[ $theme ][ 'stylesheet' ][] = $file;
 
 
 
1085
  elseif ( preg_match( "/^images\/.+?\." . $imgext . "$/", $file ) ):
1086
  $this->files[ $theme ][ 'img' ][] = $file;
 
 
 
1087
  endif;
1088
  endforeach;
1089
  endif;
1090
+ $types = explode(",", $type);
 
 
 
 
1091
  $files = array();
1092
+ foreach ( $types as $type )
1093
  if ( isset( $this->files[ $theme ][ $type ] ) )
1094
  $files = array_merge( $this->files[ $theme ][ $type ], $files );
 
1095
  return $files;
1096
  }
1097
 
1099
  $file = $this->normalize_path( $file );
1100
  // if no theme passed, returns theme + file
1101
  $themedir = trailingslashit( $this->normalize_path( get_theme_root() ) ) . ( '' == $theme ? '' : trailingslashit( $theme ) );
1102
+ $this->debug( 'Themedir: ' . $themedir . ' File: ' . $file , __FUNCTION__ );
1103
  return preg_replace( '%^' . preg_quote( $themedir ) . '%', '', $file );
1104
  }
1105
 
1131
 
1132
  function set_writable( $file = NULL ) {
1133
 
1134
+ $file = isset( $file ) ? $this->css->get_child_target( $file . '.php' ) :
1135
+ apply_filters( 'chld_thm_cfg_target', $this->css->get_child_target(), $this->css );
 
 
 
1136
  if ( $this->fs ): // filesystem access
 
1137
  global $wp_filesystem;
1138
  if ( $file && $wp_filesystem->chmod( $this->fspath( $file ), 0666 ) ) return;
1139
  endif;
1140
  $this->errors[] = __( 'Could not set write permissions.', 'child-theme-configurator' );
1141
+ add_action( 'admin_notices', array( $this, 'writable_notice' ) );
1142
  return FALSE;
1143
  }
1144
 
1158
  $newfile = trailingslashit( $clone ) . $childfile;
1159
  $childpath = $fsthemedir . trailingslashit( $child ) . $childfile;
1160
  $newpath = $fsthemedir . $newfile;
1161
+ $this->debug( 'Verifying child dir... ', __FUNCTION__ );
1162
  if ( $this->verify_child_dir( is_dir( $file ) ? $newfile : dirname( $newfile ) ) ):
1163
  if ( is_file( $file ) && !@$wp_filesystem->copy( $childpath, $newpath ) ):
1164
  $errors[] = 'could not copy ' . $newpath;
1197
  $childpath = $fsthemedir . trailingslashit( $child ) . $childfile;
1198
  $newpath = $fsthemedir . $newfile;
1199
  if ( $copy ):
1200
+ $this->debug( 'Verifying child dir... ', __FUNCTION__ );
1201
  if ( $this->verify_child_dir( is_dir( $file ) ? $newfile : dirname( $newfile ) ) ):
1202
  if ( is_file( $file ) && !$wp_filesystem->copy( $childpath, $newpath ) ):
1203
  $errors[] = 'could not copy ' . $newpath;
1239
  endif;
1240
  if ( count( $errors ) ):
1241
  $this->errors[] = __( 'There were errors while resetting permissions.', 'child-theme-configurator' ) ;
1242
+ add_action( 'admin_notices', array( $this, 'writable_notice' ) );
1243
  endif;
1244
  }
1245
 
1269
  $target_file = ( '' == $subdir ?
1270
  preg_replace( "%^.+(\.\w+)$%", "screenshot$1", basename( $source_file ) ) :
1271
  trailingslashit( $subdir ) . basename( $source_file ) );
1272
+ $this->debug( 'Verifying child dir... ', __FUNCTION__ );
1273
+ if ( FALSE !== $this->verify_child_dir( trailingslashit( $this->css->get_prop( 'child' ) ) . $subdir ) ):
1274
+ $source_path = $this->fspath( $this->uploads_fullpath( $source_file ) );
 
 
1275
  if ( $target_path = $this->css->is_file_ok( $this->css->get_child_target( $target_file ), 'write' ) ):
1276
+ $target_path = $this->fspath( $target_path );
1277
+ if ( $wp_filesystem->exists( $source_path ) ):
1278
+ if ( $wp_filesystem->move( $source_path, $target_path ) ) return TRUE;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1279
  endif;
 
 
1280
  endif;
 
 
1281
  endif;
1282
 
1283
  $this->errors[] = __( 'Could not upload file.', 'child-theme-configurator' );
1284
  }
1285
 
1286
+ function export_zip() {
1287
+ if ( ( $child = $this->css->get_prop( 'child' ) )
1288
+ && ( $dir = $this->css->is_file_ok( dirname( $this->css->get_child_target() ), 'search' ) )
1289
+ && ( $version = preg_replace( "%[^\w\.\-]%", '', $this->css->get_prop( 'version' ) ) ) ):
1290
+ // use php system upload dir to store temp files so that we can use pclzip
1291
+ $tmpdir = ini_get( 'upload_tmp_dir' ) ? ini_get( 'upload_tmp_dir' ) : sys_get_temp_dir();
1292
+ $file = trailingslashit( $tmpdir ) . $child . '-' . $version . '.zip';
1293
+ mbstring_binary_safe_encoding();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1294
 
1295
+ require_once( ABSPATH . 'wp-admin/includes/class-pclzip.php' );
 
 
 
1296
 
1297
+ $archive = new PclZip( $file );
1298
+ if ( $archive->create( $dir, PCLZIP_OPT_REMOVE_PATH, dirname( $dir ) ) == 0 ) return FALSE;
1299
+ reset_mbstring_encoding();
 
1300
  header( 'Content-Description: File Transfer' );
1301
  header( 'Content-Type: application/octet-stream' );
1302
  header( 'Content-Length: ' . filesize( $file ) );
1307
  readfile( $file );
1308
  unlink( $file );
1309
  die();
 
 
1310
  endif;
1311
  }
1312
+
1313
  /*
1314
  *
1315
  */
1360
  $fsdir = $wp_filesystem->find_folder( $dir );
1361
  return trailingslashit( $fsdir ) . $base;
1362
  }
1363
+
1364
+ function writable_notice() {
1365
+ ?> <div class="update-nag" style="display:block">
1366
+ <div class="ctc-section-toggle" id="ctc_perm_options"><?php _e( 'The child theme is in read-only mode and Child Theme Configurator cannot apply changes. Click to see options', 'child-theme-configurator' ); ?></div><div class="ctc-section-toggle-content" id="ctc_perm_options_content"><p><ol><?php
1367
+ $ctcpage = apply_filters( 'chld_thm_cfg_admin_page', CHLD_THM_CFG_MENU );
1368
+ if ( 'WIN' != substr( strtoupper( PHP_OS ), 0, 3 ) ):
1369
+ _e( '<li>Temporarily set write permissions by clicking the button below. When you are finished editing, revert to read-only by clicking "Make read-only" under the "Files" tab.</li>', 'child-theme-configurator' );
1370
+ ?><form action="?page=<?php echo $ctcpage; ?>" method="post">
1371
+ <?php wp_nonce_field( apply_filters( 'chld_thm_cfg_action', 'ctc_update' ) ); ?>
1372
+ <input name="ctc_set_writable" class="button" type="submit" value="<?php _e( 'Make files writable', 'child-theme-configurator' ); ?>"/></form><?php endif;
1373
+ _e( '<li><a target="_blank" href="http://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants" title="Editin wp-config.php">Add your FTP/SSH credentials to the WordPress config file</a>.</li>', 'child-theme-configurator' );
1374
+ if ( isset( $_SERVER[ 'SERVER_SOFTWARE' ] ) && preg_match( '%iis%i',$_SERVER[ 'SERVER_SOFTWARE' ] ) )
1375
+ _e( '<li><a target="_blank" href="http://technet.microsoft.com/en-us/library/cc771170" title="Setting Application Pool Identity">Assign WordPress to an application pool that has write permissions</a> (Windows IIS systems).</li>', 'child-theme-configurator' );
1376
+ _e( '<li><a target="_blank" href="http://codex.wordpress.org/Changing_File_Permissions" title="Changing File Permissions">Set write permissions on the server manually</a> (not recommended).</li>', 'child-theme-configurator' );
1377
+ if ( 'WIN' != substr( strtoupper( PHP_OS ), 0, 3 ) ):
1378
+ _e( '<li>Run PHP under Apache with suEXEC (contact your web host).</li>', 'child-theme-configurator' );
1379
+ endif; ?>
1380
+ </ol></p></div>
1381
+ </div>
1382
+ <?php
1383
+ }
1384
+
1385
+ function owner_notice() {
1386
+ $ctcpage = apply_filters( 'chld_thm_cfg_admin_page', CHLD_THM_CFG_MENU );
1387
+ ?>
1388
+ <div class="update-nag">
1389
+ <p><?php _e( 'This Child Theme is not owned by your website account. It may have been created by a prior version of this plugin or by another program. Moving forward, it must be owned by your website account to make changes. Child Theme Configurator will attempt to correct this when you click the button below.', 'child-theme-configurator' ) ?></p>
1390
+ <form action="?page=<?php echo $ctcpage; ?>" method="post">
1391
+ <?php wp_nonce_field( apply_filters( 'chld_thm_cfg_action', 'ctc_update' ) ); ?>
1392
+ <input name="ctc_reset_permission" class="button" type="submit" value="<?php _e( 'Correct Child Theme Permissions', 'child-theme-configurator' ); ?>"/></form> </div>
1393
+ <?php
1394
+ }
1395
+
1396
+ function enqueue_notice() {
1397
+ ?>
1398
+ <div class="update-nag">
1399
+ <p><?php _e( 'Child Theme Configurator needs to update its interal data. Please set your preferences below and click "Generate Child Theme Files" to update your configuration.', 'child-theme-configurator' ) ?></p>
1400
+ </div>
1401
+ <?php
1402
+ }
1403
+
1404
+ function max_styles_notice( $msg ) {
1405
+ return $msg . ' ' . sprintf( __( '<strong>However, some styles could not be parsed due to memory limits.</strong> Try deselecting "Additional Stylesheets" below and click "Generate/Rebuild Child Theme Files". %sWhy am I seeing this?%s', 'child-theme-configurator' ),
1406
+ '<a target="_blank" href="' . LILAEAMEDIA_URL . '/child-theme-configurator#php_memory">',
1407
+ '</a>' );
1408
+ return $msg;
1409
+ }
1410
+
1411
+ function config_notice() {
1412
+ ?>
1413
+ <div class="update-nag">
1414
+ <p><?php _e( 'Child Theme Configurator did not detect any configuration data because a previously configured Child Theme has been removed. Please set your preferences below and click "Generate Child Theme Files".', 'child-theme-configurator' ) ?></p>
1415
+ </div>
1416
+ <?php
1417
+ }
1418
+
1419
+ // back compatibility function for legacy plugins extension
1420
+ function write_addl_files( $obj ) {
1421
+ global $chld_thm_cfg_plugins;
1422
+ if ( !is_object( $chld_thm_cfg_plugins ) || !$this->fs ) return FALSE;
1423
+ $configtype = $this->css->get_prop( 'configtype' );
1424
+ //echo $configtype . LF;
1425
+ if ( 'theme' == $configtype || !( $def = $chld_thm_cfg_plugins->defs->get_def( $configtype ) ) ) return FALSE;
1426
+ $child = trailingslashit( $this->css->get_prop( 'child' ) );
1427
+ if ( isset( $def[ 'addl' ] ) && is_array( $def[ 'addl' ] ) && count( $def[ 'addl' ] ) ):
1428
+ foreach ( $def[ 'addl' ] as $path => $type ):
1429
+
1430
+ // sanitize the crap out of the target data -- it will be used to create paths
1431
+ $path = $this->normalize_path( preg_replace( "%[^\w\\//\-]%", '', sanitize_text_field( $child . $path ) ) );
1432
+ $this->debug( 'Verifying child dir... ', __FUNCTION__ );
1433
+ if ( ( 'dir' == $type && FALSE === $this->verify_child_dir( $path ) )
1434
+ || ( 'dir' != $type && FALSE === $this->write_child_file( $path, '' ) ) ):
1435
+ //$this->errors[] = __( 'Your theme directories are not writable.', 'chld_thm_cfg_plugins' );
1436
+ endif;
1437
+ endforeach;
1438
+ endif;
1439
+ // write main def file
1440
+ if ( isset( $def[ 'target' ] ) ):
1441
+ $path = $this->normalize_path( preg_replace( "%[^\w\\//\-\.]%", '', sanitize_text_field( $def[ 'target' ] ) ) ); //$child .
1442
+ if ( FALSE === $this->write_child_file( $path, '' ) ):
1443
+ //echo "invalid path: " . $path . ' ' . ' was: ' . $def[ 'target' ] . LF;
1444
+ //$this->errors[] = __( 'Your stylesheet is not writable.', 'chld_thm_cfg_plugins' );
1445
+ return FALSE;
1446
+ endif;
1447
+ endif;
1448
+ }
1449
+
1450
  // backwards compatability < WP 3.9
1451
  function normalize_path( $path ) {
1452
+ $path = str_replace( '\\', '/', $path );
1453
+ $path = preg_replace( '|/+|','/', $path );
1454
+ return $path;
 
 
 
1455
  }
1456
 
1457
  // case insensitive theme search
1476
  endif;
1477
  if ( $this->is_legacy()
1478
  && is_object( $this->css )
1479
+ && ( $configtype = $this->css->get_prop( 'configtype' ) )
1480
  && !empty( $configtype ) && 'theme' != $configtype ):
1481
  return FALSE;
1482
  endif;
1485
 
1486
  /* returns parent theme either from existing config or passed as post var */
1487
  function get_current_parent() {
 
 
 
 
1488
  if ( isset( $_GET[ 'ctc_parent' ] ) && ( $parent = sanitize_text_field( $_GET[ 'ctc_parent' ] ) ) )
1489
  return $parent;
1490
+ elseif ( $parent = $this->css->get_prop( 'parnt' ) )
 
1491
  return $parent;
 
1492
  else return get_template();
1493
  }
1494
 
1495
  /* returns child theme either from existing config or passed as post var */
1496
  function get_current_child() {
 
1497
  if ( isset( $_GET[ 'ctc_child' ] ) && ( $child = sanitize_text_field( $_GET[ 'ctc_child' ] ) ) )
1498
  return $child;
1499
+ elseif ( $child = $this->css->get_prop( 'child' ) )
 
1500
  return $child;
 
1501
  else return get_stylesheet();
1502
  }
1503
+ /* debug backtrace with extraneous steps (missing class, function or line) removed */
1504
+ function backtrace_summary() {
1505
+ $bt = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS );
1506
+ $thisstep = array_shift( $bt );
1507
+ foreach ( $bt as $ndx => $step )
1508
+ if ( isset( $step[ 'class' ] ) && isset( $step[ 'function' ] ) && isset( $step[ 'line' ] ) )
1509
+ echo $ndx . ': ' . $step[ 'class' ] . ' ' . $step[ 'function' ] . ' ' . $step[ 'line' ] . LF;
 
 
 
1510
  }
1511
+
1512
+ function debug( $msg = NULL, $fn = NULL) {
1513
+ $this->debug .= ( isset( $fn ) ? $fn . ': ' : '' ) . ( isset( $msg ) ? $msg . LF : '' );
 
1514
  }
1515
 
1516
+ function set_benchmark( $step, $key, $label ) {
1517
+ $this->memory[ $key ][ $label ][ $step ][ 'memory' ] = memory_get_usage();
1518
+ $this->memory[ $key ][ $label ][ $step ][ 'peak' ] = memory_get_peak_usage();
1519
+
1520
+ $this->memory[ $key ][ $label ][ $step ][ 'selectors' ] = isset( $this->css ) ? $this->css->qskey : 0;
 
 
 
 
 
 
 
 
 
 
1521
  }
1522
+
1523
+ function calc_memory_usage() {
1524
+ //$this->debug( print_r( $this->memory, TRUE ), __FUNCTION__ );
1525
+
1526
+ $results = array();
1527
+ foreach ( $this->memory as $key => $labels ):
1528
+ if ( !is_array( $labels ) ) continue;
1529
+ foreach ( $labels as $label => $steps ):
1530
+ //if ( isset( $steps[ 'before' ] ) && isset( $steps[ 'after ' ] ) ):
1531
+ $results[] = $key . '|' . $label . '|'
1532
+ . ( $steps[ 'after' ][ 'memory' ] - $steps[ 'before' ][ 'memory' ] ) . '|'
1533
+ . ( $steps[ 'after' ][ 'peak' ] - $steps[ 'before' ][ 'peak' ] ) . '|'
1534
+ . ( $steps[ 'after' ][ 'peak' ] - $steps[ 'before' ][ 'memory' ] ) . '|'
1535
+ . $steps[ 'after' ][ 'selectors' ] . '|'
1536
+ . ( $steps[ 'after' ][ 'selectors' ] - $steps[ 'before' ][ 'selectors' ] );
1537
+ //endif;
1538
+ endforeach;
1539
+ endforeach;
1540
+ $this->debug( "\n" . implode( "\n", $results ), __FUNCTION__ );
1541
  }
1542
 
1543
+ function get_free_memory() {
1544
+ $limit = (int) ini_get('memory_limit') * 1024 * 1024;
1545
+ $used = memory_get_usage();
1546
+ return $limit - $used;
1547
  }
1548
 
1549
+ function print_debug( $noecho = FALSE ) {
1550
+ $debug = '<textarea style="width:100%;height:200px">' . LF . $this->debug . LF . '</textarea>' . LF;
1551
+ if ( $noecho ) return $debug;
1552
+ echo $debug;
1553
  }
1554
 
1555
+ function parse_parent_stylesheet() {
1556
+ $this->css->parse_css_file( 'parnt' );
1557
  }
1558
+
1559
+ function parse_child_stylesheet() {
1560
+ // get revert/backup
1561
+ $revert = isset( $_POST[ 'ctc_revert' ] ) ? sanitize_text_field( $_POST[ 'ctc_revert' ] ) : '';
1562
+ // parse child stylesheet, backup or skip ( to reset )
1563
+ $this->css->parse_css_file( 'child', $revert );
1564
  }
1565
+
1566
+ function parse_additional_stylesheets() {
1567
  // parse additional stylesheets
1568
+ if ( isset( $_POST[ 'ctc_additional_css' ] ) && is_array( $_POST[ 'ctc_additional_css' ] ) ):
1569
+ $this->css->addl_css = array();
1570
+ foreach ( $_POST[ 'ctc_additional_css' ] as $file ):
1571
+ $file = sanitize_text_field( $file );
1572
  $this->css->parse_css_file( 'parnt', $file );
1573
+ $this->css->addl_css[] = $file;
1574
  endforeach;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1575
  endif;
1576
  }
1577
 
1578
+ function copy_theme_mods( $from, $to ) {
1579
+
1580
+ // we can copy settings from parent to child even if neither is currently active
1581
+ // so we need cases for active parent, active child or neither
1582
+
1583
  // get active theme
1584
  $active_theme = get_stylesheet();
1585
+ $this->debug( 'from: ' . $from . ' to: ' . $to . ' active: ' . $active_theme, __FUNCTION__ );
1586
  // create temp array from parent settings
1587
+ $child_mods = get_option( 'theme_mods_' . $from );
1588
+ if ( $active_theme == $from ):
1589
+ $this->debug( 'from is active, using active widgets', __FUNCTION__ );
1590
  // if parent theme is active, get widgets from active sidebars_widgets array
1591
+ $child_widgets = retrieve_widgets();
1592
  else:
1593
+ $this->debug( 'from not active, using theme mods widgets', __FUNCTION__ );
1594
  // otherwise get widgets from parent theme mods
1595
+ $child_widgets = $child_mods[ 'sidebars_widgets' ][ 'data' ];
 
1596
  endif;
1597
+ if ( $active_theme == $to ):
1598
+ $this->debug( 'to active, setting active widgets', __FUNCTION__ );
 
 
 
 
 
 
 
 
1599
  // if child theme is active, remove widgets from temp array
1600
+ unset( $child_mods[ 'sidebars_widgets' ] );
1601
+ // copy widgets to active sidebars_widgets array
1602
+ wp_set_sidebars_widgets( $child_widgets );
1603
  else:
1604
+ $this->debug( 'child not active, saving widgets in theme mods', __FUNCTION__ );
1605
  // otherwise copy widgets to temp array with time stamp
1606
+ $child_mods[ 'sidebars_widgets' ][ 'data' ] = $child_widgets;
1607
+ $child_mods[ 'sidebars_widgets' ][ 'time' ] = time();
 
1608
  endif;
1609
+ $this->debug( 'saving child theme mods:' . LF . print_r( $child_mods, TRUE ), __FUNCTION__ );
1610
  // copy temp array to child mods
1611
+ update_option( 'theme_mods_' . $to, $child_mods );
1612
  }
1613
 
1614
  function network_enable() {
1615
+ if ( $child = $this->css->get_prop( 'child' ) ):
1616
  $allowed_themes = get_site_option( 'allowedthemes' );
1617
  $allowed_themes[ $child ] = true;
1618
  update_site_option( 'allowedthemes', $allowed_themes );
1619
  endif;
1620
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1621
  }
includes/class-ctc-css.php CHANGED
@@ -6,17 +6,15 @@ if ( !defined( 'ABSPATH' ) ) exit;
6
  Class: ChildThemeConfiguratorCSS
7
  Plugin URI: http://www.childthemeconfigurator.com/
8
  Description: Handles all CSS input, output, parsing, normalization and storage
9
- Version: 2.1.2
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
13
  Domain Path: /lang
14
  License: GPLv2
15
- Copyright (C) 2014-2016 Lilaea Media
16
  */
17
-
18
  class ChildThemeConfiguratorCSS {
19
-
20
  // data dictionaries
21
  var $dict_query; // @media queries and 'base'
22
  var $dict_sel; // selectors
@@ -24,8 +22,8 @@ class ChildThemeConfiguratorCSS {
24
  var $dict_rule; // css rules
25
  var $dict_val; // css values
26
  var $dict_seq; // child load order (priority)
27
- var $dict_token;
28
  // hierarchies
 
29
  var $val_ndx; // selector => rule => value hierarchy
30
  // key counters
31
  var $qskey; // counter for dict_qs
@@ -33,28 +31,17 @@ class ChildThemeConfiguratorCSS {
33
  var $selkey; // counter for dict_sel
34
  var $rulekey; // counter for dict_rule
35
  var $valkey; // counter for dict_val
36
- var $tokenkey; // counter for dict_token
37
-
38
- // from parent/child form
39
  var $child; // child theme slug
40
  var $parnt; // parent theme slug
41
  var $configtype; // legacy plugin slug
42
- var $handling; // child stylesheet handling option
43
- var $enqueue; // whether or not to load parent theme
44
- var $ignoreparnt; // no not parse or enqueue parent
45
- var $qpriority;
46
- var $hasstyles;
47
- var $parntloaded;
48
- var $childloaded;
49
- var $parnt_deps; //
50
- var $child_deps; //
51
- var $addl_css;
52
- var $cssunreg;
53
- var $csswphead;
54
- var $cssnotheme;
55
- var $reorder;
56
-
57
- // header settings
58
  var $child_name; // child theme name
59
  var $child_author; // child theme author
60
  var $child_authoruri; // child theme author website
@@ -62,20 +49,9 @@ class ChildThemeConfiguratorCSS {
62
  var $child_descr; // child theme description
63
  var $child_tags; // child theme tags
64
  var $child_version; // stylesheet version
65
-
66
- // miscellaneous properties
67
- var $fsize; // used to check if styles changed since last update
68
- var $converted; // @imports coverted to <link>?
69
- var $version; // version of last saved data
70
- var $templates; // cache of parent template files
71
- var $imports; // @import rules
72
- var $recent; // history of edited styles
73
  var $max_sel;
74
- var $memory;
75
- var $styles; // temporary update cache
76
  var $temparray;
77
- var $instances = array();
78
- var $vendorrule = array(
79
  'box\-sizing',
80
  'font\-smoothing',
81
  'border(\-(top|right|bottom|left))*\-radius',
@@ -93,20 +69,12 @@ class ChildThemeConfiguratorCSS {
93
  );
94
  var $configvars = array(
95
  'addl_css',
96
- 'cssunreg',
97
- 'csswphead',
98
- 'cssnotheme',
99
- 'reorder',
100
- 'parnt_deps',
101
- 'child_deps',
102
- 'hasstyles',
103
- 'parntloaded',
104
- 'childloaded',
105
- 'ignoreparnt',
106
- 'qpriority',
107
- 'enqueue',
108
- 'handling',
109
- 'templates',
110
  'max_sel',
111
  'imports',
112
  'child_version',
@@ -124,34 +92,31 @@ class ChildThemeConfiguratorCSS {
124
  'qskey',
125
  'selkey',
126
  'querykey',
127
- 'tokenkey',
128
  'recent',
129
  'converted',
130
- 'fsize',
131
- 'version',
132
  );
133
  var $dicts = array(
134
- 'dict_qs' => 0,
135
- 'dict_sel' => 0,
136
- 'dict_query' => 0,
137
- 'dict_rule' => 0,
138
- 'dict_val' => 0,
139
- 'dict_seq' => 0,
140
- 'dict_token' => 0,
141
- 'val_ndx' => 0,
142
  );
143
- var $packer; // packer object
144
 
145
  function __construct() {
146
- $this->mem_chk();
147
  // scalars
148
  $this->querykey = 0;
149
  $this->selkey = 0;
150
  $this->qskey = 0;
151
  $this->rulekey = 0;
152
  $this->valkey = 0;
153
- $this->max_sel = 0;
154
-
 
155
  $this->child_name = '';
156
  $this->child_author = 'Child Theme Configurator';
157
  $this->child_themeuri = '';
@@ -159,146 +124,94 @@ class ChildThemeConfiguratorCSS {
159
  $this->child_descr = '';
160
  $this->child_tags = '';
161
  $this->child_version = '1.0';
162
-
163
- $this->configtype = 'theme'; // legacy support
164
- $this->child = '';
165
- $this->parnt = '';
166
- $this->ignoreparnt = 0;
167
- $this->qpriority = 10;
168
- $this->version = '2.1.2';
169
-
170
- // do not set enqueue, not being set is used to flag old versions
171
 
172
  // multi-dim arrays
173
- $this->templates = array();
174
- $this->imports = array( 'child' => array(), 'parnt' => array() );
175
-
 
 
 
 
 
 
176
  $this->recent = array();
177
- include_once( CHLD_THM_CFG_DIR . '/includes/class-ctc-packer.php' );
178
- $this->packer = new ChildThemeConfiguratorPacker();
179
  }
180
 
181
  // helper function to globalize ctc object
182
  function ctc() {
183
  return ChildThemeConfigurator::ctc();
184
  }
185
- function mem_chk() {
186
- $currmemory = $this->memory;
187
- if ( function_exists( 'memory_get_peak_usage' ) ) {
188
- $usage = memory_get_peak_usage();
189
- } else {
190
- $usage = memory_get_usage();
191
- }
192
- $this->memory = $usage;
193
- $usage -= $currmemory;
194
- return number_format( $this->memory / ( 1024 * 1024 ), 2 ) . ' MB diff ' . number_format( $usage / 1024, 2 ) . ' kB';
195
- }
196
- // loads current ctc config data
197
- function load_config( $key = NULL ) {
198
- //list(, $callerarr) = debug_backtrace(false);
199
- //$caller = ( isset( $callerarr[ 'class' ] ) ? $callerarr[ 'class' ] . '::' : '' ) . $callerarr[ 'function' ];
200
- if ( $key && isset( $this->dicts[ $key ] ) ):
201
- $option = CHLD_THM_CFG_OPTIONS . apply_filters( 'chld_thm_cfg_option', '' );
202
- if ( !$this->dicts[ $key ] ): // dict not loaded yet
203
- //$this->ctc()->debug( 'memory before load: ' . $this->mem_chk(), __FUNCTION__, __CLASS__ );
204
- //$this->ctc()->debug( $option . '_' . $key . ' -- called from ' . $caller, __FUNCTION__, __CLASS__ );
205
- $this->{ $key } = $this->ctc()->is_new ? array() : get_site_option( $option . '_' . $key );
206
- $this->dicts[ $key ] = 1; // flag as loaded
207
- //$this->ctc()->debug( 'memory after load: ' . $this->mem_chk(), __FUNCTION__, __CLASS__ );
208
- else:
209
- //$this->ctc()->debug( $key . ' already loaded -- called from ' . $caller, __FUNCTION__, __CLASS__ );
210
- endif;
211
- endif;
212
- if ( empty( $key ) && !isset( $this->enqueue ) ):
213
- $option = CHLD_THM_CFG_OPTIONS . apply_filters( 'chld_thm_cfg_option', '' );
214
- //$this->ctc()->debug( 'loading option: ' . $option . '_' . ( $key ? $key : 'configvars' )
215
- // . ' -- called from ' . $caller, __FUNCTION__, __CLASS__ );
216
- if ( ( $configarray = get_site_option( $option . '_configvars' ) ) && count( $configarray ) ):
217
- foreach ( $this->configvars as $configkey ):
218
- if ( isset( $configarray[ $configkey ] ) )
219
- $this->{$configkey} = $configarray[ $configkey ];
220
- endforeach;
221
- // convert dictionaries from < 2.1.0
222
- if ( empty( $configarray[ 'version' ] ) || version_compare( $configarray[ 'version' ], '2.1.0', '<' ) ):
223
- $this->convert_dict_arrays();
224
- else:
225
- $this->ctc()->debug( 'dict format up to date', __FUNCTION__, __CLASS__ );
226
- endif;
227
- endif;
228
  endif;
229
-
230
  }
231
 
232
  // writes ctc config data to options api
233
  function save_config( $override = NULL ) {
234
- // set latest stylesheet size
235
- $this->get_stylesheet_path();
236
  global $wpdb;
237
  if ( isset( $override ) ) $option = $override;
238
  else $option = apply_filters( 'chld_thm_cfg_option', '' );
239
  $option = CHLD_THM_CFG_OPTIONS . $option;
 
240
  $configarray = array();
241
  foreach ( $this->configvars as $configkey )
242
- $configarray[ $configkey ] = empty( $this->{$configkey} ) ? NULL : $this->{ $configkey };
243
- //$this->ctc()->debug( 'saving option: ' . $option . '_configvars', __FUNCTION__, __CLASS__ );
244
  if ( is_multisite() ):
245
  update_site_option( $option . '_configvars', $configarray );
246
  else:
247
  // do not autoload ( passing false above only works if value changes
248
  update_option( $option . '_configvars', $configarray, FALSE );
249
  endif;
250
-
251
- foreach ( $this->dicts as $configkey => $loaded ):
252
- if ( $loaded ): // only save if dict is loaded
253
- //$this->ctc()->debug( 'saving option: ' . $option . '_' . $configkey, __FUNCTION__, __CLASS__ );
254
- if ( is_multisite() ):
255
- update_site_option( $option . '_' . $configkey, $this->{$configkey} );
256
- else:
257
- // do not autoload ( passing false for update_site_option only works if value changes )
258
- update_option( $option . '_' . $configkey, $this->{$configkey}, FALSE );
259
- endif;
260
  endif;
261
  endforeach;
262
-
263
- }
264
-
265
- /**
266
- * determine effective stylesheet path and measure size
267
- */
268
- function get_stylesheet_path() {
269
- $stylesheet = apply_filters( 'chld_thm_cfg_target', $this->get_child_target( $this->ctc()->get_child_stylesheet() ), $this );
270
- $this->fsize = filesize( $stylesheet );
271
- $this->ctc()->debug( 'updated file size: ' . $this->fsize, __FUNCTION__, __CLASS__ );
272
- return $stylesheet;
273
  }
 
274
  /**
275
  * get_prop
276
  * Getter interface (data sliced different ways depending on objname )
277
  */
278
- function get_prop( $property, $params = NULL ) {
279
- switch ( $property ):
280
- case 'fsize':
281
- return empty( $this->fsize ) ? FALSE : $this->fsize;
282
- case 'converted':
283
- return !empty( $this->converted );
284
- case 'max_sel':
285
- return empty( $this->max_sel ) ? FALSE : $this->max_sel;
286
  case 'imports':
287
-
288
- return $this->obj_to_utf8( !empty( $this->imports[ 'child' ] ) && is_array( $this->imports[ 'child' ] ) ?
289
  ( current( $this->imports[ 'child' ] ) == 1 ?
290
  array_keys( $this->imports[ 'child' ] ) :
291
  array_keys( array_flip( $this->imports[ 'child' ] ) ) ) :
292
  array() );
293
  case 'queries':
294
- return $this->obj_to_utf8( $this->denorm_dict_qs() );
295
  case 'selectors':
296
  return empty( $params[ 'key' ] ) ?
297
- array() : $this->obj_to_utf8( $this->denorm_dict_qs( $params[ 'key' ] ) );
298
  case 'rule_val':
299
  return empty( $params[ 'key' ] ) ? array() : $this->denorm_rule_val( $params[ 'key' ] );
300
  case 'val_qry':
301
- if ( isset( $params[ 'rule' ] ) ):
302
  return empty( $params[ 'key' ] ) ?
303
  array() : $this->denorm_val_query( $params[ 'key' ], $params[ 'rule' ] );
304
  endif;
@@ -306,66 +219,34 @@ class ChildThemeConfiguratorCSS {
306
  return empty( $params[ 'key' ] ) ?
307
  array() : $this->obj_to_utf8( $this->denorm_sel_val( $params[ 'key' ] ) );
308
  case 'rules':
309
- $this->load_config( 'dict_rule' );
310
- asort( $this->dict_rule );
311
- //ksort( $this->dict_rule );
312
- //return $this->obj_to_utf8( $this->dict_rule );
313
- /** lookup ** -- need to flip array??? */
314
- return $this->obj_to_utf8( array_flip( $this->dict_rule ) );
315
  case 'child':
316
  return $this->child;
317
  case 'parnt':
318
  return $this->parnt;
319
  case 'configtype': // legacy plugin extension support
320
  return $this->configtype;
321
- case 'enqueue':
322
- return empty( $this->enqueue ) ? FALSE : $this->enqueue;
323
  case 'addl_css':
324
- return empty( $this->addl_css ) ? array() : $this->addl_css;
325
- case 'parnt_deps':
326
- return $this->quotify_prop( 'parnt_deps' );
327
- case 'child_deps':
328
- return $this->quotify_prop( 'child_deps' );
329
- case 'templates':
330
- return empty( $this->templates ) ? FALSE : $this->templates;
331
- case 'ignoreparnt':
332
- return empty( $this->ignoreparnt ) ? 0 : 1;
333
- case 'qpriority':
334
- return empty( $this->qpriority ) ? 10 : $this->qpriority;
335
- case 'parntloaded':
336
- return empty( $this->parntloaded ) ? FALSE : $this->parntloaded;
337
- case 'childloaded':
338
- return empty( $this->childloaded ) ? FALSE : $this->childloaded;
339
- case 'hasstyles':
340
- return empty( $this->hasstyles ) ? 0 : 1;
341
- case 'cssunreg':
342
- return empty( $this->cssunreg ) ? 0 : 1;
343
- case 'csswphead':
344
- return empty( $this->csswphead ) ? 0 : 1;
345
- case 'cssnotheme':
346
- return empty( $this->cssnotheme ) ? 0 : 1;
347
- case 'reorder':
348
- return empty( $this->reorder ) ? 0 : 1;
349
- case 'handling':
350
- return empty( $this->handling ) ? 'primary' : $this->handling;
351
  case 'child_name':
352
- return stripslashes( $this->child_name );
353
  case 'author':
354
- return stripslashes( $this->child_author );
355
  case 'themeuri':
356
  return isset( $this->child_themeuri ) ? $this->child_themeuri : FALSE;
357
  case 'authoruri':
358
  return isset( $this->child_authoruri ) ? $this->child_authoruri : FALSE;
359
  case 'descr':
360
- return isset( $this->child_descr ) ? stripslashes( $this->child_descr ) : FALSE;
361
  case 'tags':
362
- return isset( $this->child_tags ) ? stripslashes( $this->child_tags ) : FALSE;
363
  case 'version':
364
  return $this->child_version;
365
  case 'preview':
366
  $this->styles = '';
367
  if ( empty( $params[ 'key' ] ) || 'child' == $params[ 'key' ] ):
368
- $this->read_stylesheet( 'child', $this->ctc()->get_child_stylesheet() );
369
  else:
370
  if ( isset( $this->addl_css ) ):
371
  foreach ( $this->addl_css as $file ):
@@ -374,22 +255,18 @@ class ChildThemeConfiguratorCSS {
374
  $this->styles .= '/*** END ' . $file . ' ***/' . LF;
375
  endforeach;
376
  endif;
377
- if ( $this->get_prop( 'hasstyles' ) && !$this->get_prop( 'ignoreparnt' ) ):
378
- $this->styles .= '/*** BEGIN Parent style.css ***/' . LF;
379
- $this->read_stylesheet( 'parnt', 'style.css' );
380
- $this->styles .= '/*** END Parent style.css ***/' . LF;
381
- endif;
382
- if ( 'separate' == $this->get_prop( 'handling' ) ):
383
- $this->styles .= '/*** BEGIN Child style.css ***/' . LF;
384
- $this->read_stylesheet( 'child', 'style.css' );
385
- $this->styles .= '/*** END Child style.css ***/' . LF;
386
  endif;
387
  endif;
388
  $this->normalize_css();
389
  return $this->styles;
390
  break;
391
  default:
392
- return $this->obj_to_utf8( apply_filters( 'chld_thm_get_prop', NULL, $property, $params ) );
393
  endswitch;
394
  return FALSE;
395
  }
@@ -398,9 +275,9 @@ class ChildThemeConfiguratorCSS {
398
  * set_prop
399
  * Setter interface (scalar values only)
400
  */
401
- function set_prop( $property, $value ) {
402
- if ( is_null( $this->{ $property } ) || is_scalar( $this->{ $property } ) )
403
- $this->{ $property } = $value;
404
  else return FALSE;
405
  }
406
 
@@ -414,64 +291,31 @@ class ChildThemeConfiguratorCSS {
414
  endif;
415
  }
416
 
417
- function quotify_prop( $prop ) {
418
- $arr = array();
419
- if (!empty( $this->{$prop} ) && is_array( $this->{$prop} ) )
420
- foreach ( $this->{$prop} as $el )
421
- $arr[] = "'" . str_replace("'", "\'", $el ) . "'";
422
- return $arr;
423
- }
424
  // creates header comments for stylesheet
425
  function get_css_header() {
426
- return array(
427
- 'Theme Name' => $this->get_prop( 'child_name' ),
428
- 'Theme URI' => ( ( $attr = $this->get_prop( 'themeuri' ) ) ? $attr : '' ),
429
- 'Template' => $this->get_prop( 'parnt' ),
430
- 'Author' => $this->get_prop( 'author' ),
431
- 'Author URI' => ( ( $attr = $this->get_prop( 'authoruri' ) ) ? $attr : '' ),
432
- 'Description' => ( ( $attr = $this->get_prop( 'descr' ) ) ? $attr : '' ),
433
- 'Tags' => ( ( $attr = $this->get_prop( 'tags' ) ) ? $attr : '' ),
434
- 'Version' => $this->get_prop( 'version' ) . '.' . time(),
435
- 'Updated' => current_time( 'mysql' ),
436
- );
437
- }
438
- function get_css_header_comment( $handling = 'primary' ) {
439
- if ( 'separate' == $handling ):
440
- $contents = "/*" . LF
441
- . 'CTC Separate Stylesheet' . LF
442
- . 'Updated: ' . current_time( 'mysql' ) . LF
443
- . '*/' . LF;
444
- else:
445
- $contents = "/*" . LF;
446
- foreach ( $this->get_css_header() as $param => $value ):
447
- if ( $value ):
448
- $contents .= $param . ': ' . $value . LF;
449
- endif;
450
- endforeach;
451
- $contents .= LF . "*/" . LF . $this->get_css_imports();
452
-
453
- endif;
454
- return $contents;
455
- }
456
-
457
- function get_css_imports() {
458
- $newheader = '';
459
- if ( 'import' == $this->get_prop( 'enqueue' ) ):
460
- $this->ctc()->debug( 'using import ', __FUNCTION__, __CLASS__ );
461
- if ( ! $this->get_prop( 'ignoreparnt' ) )
462
- $newheader .= "@import url('../" . $this->get_prop( 'parnt' ) . "/style.css');" . LF;
463
- endif;
464
- return $newheader;
465
  }
466
 
467
  // formats file path for child theme file
468
- function get_child_target( $file = '', $theme = NULL ) {
469
- return trailingslashit( get_theme_root() ) . trailingslashit( $theme ? $theme : $this->get_prop( 'child' ) ) . $file;
470
  }
471
 
472
  // formats file path for parent theme file
473
- function get_parent_source( $file = 'style.css', $theme = NULL ) {
474
- return trailingslashit( get_theme_root() ) . trailingslashit( $theme ? $theme : $this->get_prop( 'parnt' ) ) . $file;
475
  }
476
 
477
  /**
@@ -481,63 +325,39 @@ class ChildThemeConfiguratorCSS {
481
  * incrementing key value for dictionary
482
  */
483
  function get_dict_id( $dict, $value ) {
484
- if ( FALSE === ( $id = $this->lookup_dict_value( $dict, $value ) ) ):
485
- // add value to dictionary
486
- $id = ++$this->{ $dict . 'key' };
487
- $this->set_dict_value( $dict, $value, $id );
488
- endif;
489
- return $id;
490
- }
491
-
492
- function lookup_dict_value( $dict, $value ){
493
- //$this->ctc()->debug( 'dict: ' . $dict . ' value: %' . $value . '%', __FUNCTION__, __CLASS__ );
494
- $property = 'dict_' . $dict;
495
- if ( $id = array_search( (string) $value, $this->{ $property } ) )
496
- return $id;
497
- return FALSE;
498
- }
499
-
500
- function get_dict_value( $dict, $id ) {
501
  $property = 'dict_' . $dict;
502
- return ( isset( $this->{ $property }[ $id ] ) )
503
- ? $this->{ $property }[ $id ]
504
- : FALSE;
 
 
505
  }
506
 
507
- function set_dict_value( $dict, $value, $id ) {
508
- $property = 'dict_' . $dict;
509
- $this->{ $property }[ $id ] = ( string ) $value;
510
- }
511
-
512
  /**
513
  * get_qsid
514
  * query/selector id is the combination of two dictionary values
515
  * also throttles parsing if memory limit is reached
516
  */
517
  function get_qsid( $query, $sel ) {
518
- $qs = $this->get_dict_id( 'query', $query ) . ':' . $this->get_dict_id( 'sel', $sel );
519
- return $this->get_dict_id( 'qs', $qs );
520
- }
521
-
522
- function unpack_val_ndx( $qsid ){
523
- if ( isset( $this->val_ndx[ $qsid ] ) ):
524
- try {
525
- $this->packer->reset( $this->packer->decode( $this->val_ndx[ $qsid ] ) );
526
- return $this->packer->unpack();
527
- } catch ( Exception $e ){
528
- $this->ctc()->errors[] = 'Unpack failed -- ' . $e->getMessage();
529
  return FALSE;
530
- }
 
 
 
 
 
 
 
 
531
  endif;
532
- return FALSE;
533
- }
534
-
535
- function pack_val_ndx( $qsid, $valarr ){
536
- try {
537
- $this->val_ndx[ $qsid ] = $this->packer->encode( $this->packer->pack( $valarr ) );
538
- } catch ( Exception $e ){
539
- $this->ctc()->errors[] = 'Pack failed -- ' . $e->getMessage();
540
- }
541
  }
542
 
543
  /**
@@ -546,7 +366,7 @@ class ChildThemeConfiguratorCSS {
546
  * CTC object arrays, creating update cache in the process.
547
  * ( Update cache is returned to UI via AJAX to refresh page )
548
  * This has been refactored in v1.7.5 to accommodate multiple values per property.
549
- * @param $template p or c
550
  * @param $query media query
551
  * @param $sel selector
552
  * @param $rule property (rule)
@@ -566,75 +386,62 @@ class ChildThemeConfiguratorCSS {
566
  $rulevalid = NULL,
567
  $reset = FALSE
568
  ) {
569
- // if ( $this->max_sel ) return; // Future use
570
- if ( FALSE === strpos( $query, '@' ) )
571
  $query = 'base';
 
572
  // normalize selector styling
573
  $sel = implode( ', ', preg_split( '#\s*,\s*#s', trim( $sel ) ) );
574
- $qsid = $this->get_qsid( $query, $this->tokenize( $sel ) );
 
575
  // set data and value
576
  if ( $rule ):
577
  // get ids and quit if max is reached ( get_qsid handles )
578
  $ruleid = $this->get_dict_id( 'rule', $rule );
579
  $valid = $this->get_dict_id( 'val', $value );
 
580
  /**
581
- * v2.1.0
582
- * pack/unpack val_ndx
583
  */
584
- // create empty array IF value array does not exist
585
- if ( FALSE === ( $valarr = $this->unpack_val_ndx( $qsid ) ) )
586
- $valarr = array(
587
- $ruleid => array(
588
- $template => array(),
589
- ),
590
- );
591
- // create empty array IF rule array does not exist
592
- if ( !isset( $valarr[ $ruleid ] ) )
593
- $valarr[ $ruleid ] = array(
594
- $template => array(),
595
- );
596
- // create empty rule array if template is child and reset is TRUE
597
- // or IF template array does not exist
598
- if ( ( $reset && 'child' == $template ) || !isset( $valarr[ $ruleid ][ $template ] ) )
599
- $valarr[ $ruleid ][ $template ] = array();
600
-
601
- // rulevalid passed
602
- //$this->ctc()->debug( 'rule: ' . $rule . ' ' . $ruleid . ' value: ' . ( '' == $value? 'NULL' : '%' . $value . '%' ) . ' ' . ( FALSE == $valid ? 'FALSE' : $valid ) . ' valarr: ' . print_r( $valarr, TRUE ), __FUNCTION__, __CLASS__ );
603
  if ( isset( $rulevalid ) ):
604
- $this->unset_rule_value( $valarr[ $ruleid ][ $template ], $rulevalid );
605
  // value empty?
606
  if ( '' === $value ):
607
  // value exist?
608
- elseif ( $id = $this->rule_value_exists( $valarr[ $ruleid ][ $template ], $valid ) ):
609
- $this->unset_rule_value( $valarr[ $ruleid ][ $template ], $id );
610
- $this->update_rule_value( $valarr[ $ruleid ][ $template ], $rulevalid, $valid, $important );
611
  // update new value
612
  else:
613
- $this->update_rule_value( $valarr[ $ruleid ][ $template ], $rulevalid, $valid, $important );
614
  endif;
615
  // rulevalid not passed
616
  else:
617
  // value exist?
618
- if ( $id = $this->rule_value_exists( $valarr[ $ruleid ][ $template ], $valid ) ):
619
- $this->unset_rule_value( $valarr[ $ruleid ][ $template ], $id );
620
- $this->update_rule_value( $valarr[ $ruleid ][ $template ], $id, $valid, $important );
621
  // get new id and update new value
622
  else:
623
- $id = $this->get_rule_value_id( $valarr[ $ruleid ][ $template ] );
624
- $this->update_rule_value( $valarr[ $ruleid ][ $template ], $id, $valid, $important );
625
  endif;
626
  endif;
627
- // remove if all values have been cleared
628
- if ( $this->prune_if_empty( $qsid, $valarr ) )
629
- return FALSE;
630
- //$this->ctc()->debug( 'revised valarr: ' . print_r( $valarr, TRUE ), __FUNCTION__, __CLASS__ );
631
- $this->pack_val_ndx( $qsid, $valarr );
632
  // return query selector id
633
  return $qsid;
634
  endif;
635
  }
636
 
637
- /**
638
  * rule_value_exists
639
  * Determine if a value already exists for a property
640
  * and return its id
@@ -648,7 +455,7 @@ class ChildThemeConfiguratorCSS {
648
  return FALSE;
649
  }
650
 
651
- /**
652
  * get_rule_value_id
653
  * Generate a new rulevalid by iterating existing ids
654
  * and returning the next in sequence
@@ -660,7 +467,7 @@ class ChildThemeConfiguratorCSS {
660
  return $newid;
661
  }
662
 
663
- /**
664
  * update_rule_value
665
  * Generate a new value subarray
666
  */
@@ -672,7 +479,7 @@ class ChildThemeConfiguratorCSS {
672
  );
673
  }
674
 
675
- /**
676
  * unset_rule_value
677
  * Delete (splice) old value subarray from values
678
  */
@@ -680,6 +487,7 @@ class ChildThemeConfiguratorCSS {
680
  $index = 0;
681
  foreach ( $arr as $valarr ):
682
  if ( $id == $valarr[ 2 ] ):
 
683
  array_splice( $arr, $index, 1 );
684
  break;
685
  endif;
@@ -687,15 +495,15 @@ class ChildThemeConfiguratorCSS {
687
  endforeach;
688
  }
689
 
690
- /**
691
  * prune_if_empty
692
  * Automatically cleans up hierarchies when no values exist
693
  * in either parent or child for a given selector.
694
  */
695
- function prune_if_empty( $qsid, $valarr ) {
696
  $empty = $this->get_dict_id( 'val', '' );
697
- foreach ( $valarr as $ruleid => $arr ):
698
- foreach ( array( 'c', 'p' ) as $template ):
699
  if ( isset( $arr[ $template ] ) ):
700
  // v1.7.5: don't prune until converted to multi value format
701
  if ( !is_array( $arr[ $template ] ) ) return FALSE;
@@ -706,10 +514,10 @@ class ChildThemeConfiguratorCSS {
706
  endforeach;
707
  endforeach;
708
  // no values, prune from sel index, val index and qs dict data ( keep other dictionary records )
 
709
  unset( $this->val_ndx[ $qsid ] );
710
  unset( $this->dict_qs[ $qsid ] );
711
  unset( $this->dict_seq[ $qsid ] );
712
- return TRUE;
713
  }
714
 
715
  /**
@@ -754,14 +562,6 @@ class ChildThemeConfiguratorCSS {
754
  * FIXME - this function has grown too monolithic - refactor and componentize
755
  */
756
  function parse_post_data() {
757
- $this->load_config( 'dict_query' );
758
- $this->load_config( 'dict_sel' );
759
- $this->load_config( 'dict_token' );
760
- $this->load_config( 'dict_rule' );
761
- $this->load_config( 'dict_val' );
762
- $this->load_config( 'val_ndx' );
763
- $this->load_config( 'dict_seq' );
764
- $this->load_config( 'dict_qs' );
765
  $this->cache_updates = TRUE;
766
  if ( isset( $_POST[ 'ctc_new_selectors' ] ) ):
767
  $this->styles = $this->parse_css_input( LF . $_POST[ 'ctc_new_selectors' ] );
@@ -775,18 +575,6 @@ class ChildThemeConfiguratorCSS {
775
  $this->imports[ 'child' ] = array();
776
  $this->styles = $this->parse_css_input( $_POST[ 'ctc_child_imports' ] );
777
  $this->parse_css( 'child' );
778
-
779
- elseif ( isset( $_POST[ 'ctc_analysis' ] ) ):
780
-
781
- if ( $this->ctc()->cache_updates ):
782
- $this->ctc()->updates[] = array(
783
- 'obj' => 'analysis',
784
- 'data' => array(),
785
- );
786
- endif;
787
-
788
- $this->ctc()->evaluate_signals( $this->get_prop( 'ignoreparnt' ) );
789
-
790
  elseif ( isset( $_POST[ 'ctc_configtype' ] ) ):
791
  ob_start();
792
  do_action( 'chld_thm_cfg_get_stylesheets' );
@@ -813,13 +601,7 @@ class ChildThemeConfiguratorCSS {
813
  foreach ( preg_grep( '#^ctc_ovrd_child_seq_#', array_keys( $_POST ) ) as $post_key ):
814
  if ( preg_match( '#^ctc_ovrd_child_seq_(\d+)$#', $post_key, $matches ) ):
815
  $qsid = $matches[ 1 ];
816
- $seq = intval( $_POST[ $post_key ] );
817
- $this->ctc()->debug( 'set seq( ' . $qsid . ' ): custom: ' . $seq, __FUNCTION__, __CLASS__ );
818
- if ( $seq != $qsid ):
819
- $this->set_dict_value( 'seq', $seq, $qsid );
820
- else:
821
- unset( $this->dict_seq[ $seq ] );
822
- endif;
823
  endif;
824
  endforeach;
825
  $parts = array();
@@ -827,8 +609,8 @@ class ChildThemeConfiguratorCSS {
827
  if ( preg_match( '#^ctc_(ovrd|\d+)_child_([\w\-]+?)_(\d+?)_(\d+?)(_(.+))?$#', $post_key, $matches ) ):
828
  $valid = $matches[ 1 ];
829
  $rule = $matches[ 2 ];
830
- if ( NULL == $rule || FALSE === $this->lookup_dict_value( 'rule', $rule ) )
831
- continue;
832
  $qsid = $matches[ 3 ];
833
  $rulevalid = $matches[ 4 ];
834
  $value = $this->normalize_color( $this->sanitize( $this->parse_css_input( $_POST[ $post_key ] ) ) );
@@ -840,12 +622,11 @@ class ChildThemeConfiguratorCSS {
840
  $parts[ $qsid ][ $rule ][ 'values' ][ $rulevalid ][ 'important' ] = $important;
841
  $parts[ $qsid ][ $rule ][ 'query' ] = $selarr[ 'query' ];
842
  $parts[ $qsid ][ $rule ][ 'selector' ] = $selarr[ 'selector' ];
843
- //$this->ctc()->debug( 'value: ' . $value . ' parts: ' . print_r( $parts, TRUE ), __FUNCTION__, __CLASS__ );
844
  else:
845
  if ( $newselector && $newselector != $selarr[ 'selector' ] ):
846
  // If this is a renamed selector, add new selector to array
847
  $newqsid = $this->update_arrays(
848
- 'c',
849
  $selarr[ 'query' ],
850
  $newselector,
851
  $rule,
@@ -853,9 +634,9 @@ class ChildThemeConfiguratorCSS {
853
  $important,
854
  $rulevalid
855
  );
856
- // clear the original selector's new value:
857
  $this->update_arrays(
858
- 'c',
859
  $selarr[ 'query' ],
860
  $selarr[ 'selector' ],
861
  $rule,
@@ -863,16 +644,11 @@ class ChildThemeConfiguratorCSS {
863
  0,
864
  $rulevalid
865
  );
866
- $seq = $this->get_dict_value( 'seq', $qsid );
867
- if ( $seq != $newqsid ):
868
- $this->set_dict_value( 'seq', $newqsid, $seq );
869
- else:
870
- unset( $this->dict_seq[ $newqsid ] );
871
- endif;
872
  else:
873
  // otherwise, just update with the new values:
874
  $this->update_arrays(
875
- 'c',
876
  $selarr[ 'query' ],
877
  $selarr[ 'selector' ],
878
  $rule,
@@ -927,12 +703,10 @@ class ChildThemeConfiguratorCSS {
927
  else:
928
  $value = '';
929
  endif;
930
-
931
- //$this->ctc()->debug( 'modified value: ' . $value, __FUNCTION__, __CLASS__ );
932
  if ( $newselector && $newselector != $rule_arr[ 'selector' ] ):
933
  // If this is a renamed selector, add new selector to array
934
  $newqsid = $this->update_arrays(
935
- 'c',
936
  $rule_arr[ 'query' ],
937
  $newselector,
938
  $rule,
@@ -940,9 +714,9 @@ class ChildThemeConfiguratorCSS {
940
  $rule_part[ 'important' ],
941
  $rulevalid
942
  );
943
- // clear the original selector's new value:
944
  $this->update_arrays(
945
- 'c',
946
  $rule_arr[ 'query' ],
947
  $rule_arr[ 'selector' ],
948
  $rule,
@@ -953,7 +727,7 @@ class ChildThemeConfiguratorCSS {
953
  else:
954
  // otherwise, just update with the new values:
955
  $this->update_arrays(
956
- 'c',
957
  $rule_arr[ 'query' ],
958
  $rule_arr[ 'selector' ],
959
  $rule,
@@ -965,8 +739,14 @@ class ChildThemeConfiguratorCSS {
965
  endforeach;
966
  endforeach;
967
  endforeach;
968
- if ( $newqsid )
969
- $qsid = $newqsid;
 
 
 
 
 
 
970
  // return updated qsid to browser to update form
971
  if ( $this->ctc()->cache_updates ):
972
  $this->ctc()->updates[] = array(
@@ -979,7 +759,7 @@ class ChildThemeConfiguratorCSS {
979
  endif;
980
 
981
  // update enqueue function if imports have not been converted or new imports passed
982
- if ( isset( $_POST[ 'ctc_analysis' ] ) || isset( $_POST[ 'ctc_child_imports' ] ) || !$this->get_prop( 'converted' ) )
983
  add_action( 'chld_thm_cfg_addl_files', array( $this->ctc(), 'enqueue_parent_css' ), 15, 2 );
984
  }
985
 
@@ -993,7 +773,7 @@ class ChildThemeConfiguratorCSS {
993
 
994
  // strips non printables and potential commands
995
  function sanitize( $styles ) {
996
- return sanitize_text_field( preg_replace( '/[^[:print:]]|[\{\}].*/', '', $styles ) );
997
  }
998
 
999
  // escapes octal values in input to allow for specific ascii strings in content rule
@@ -1012,15 +792,11 @@ class ChildThemeConfiguratorCSS {
1012
  */
1013
  function parse_css_file( $template, $file = 'style.css', $cfgtemplate = FALSE ) {
1014
  if ( '' == $file ) $file = 'style.css';
1015
-
1016
- /**
1017
- * Future use: have we run out of memory?
1018
- *
1019
  if ( $this->max_sel ):
1020
- //$this->ctc()->debug( 'Insufficient memory to parse file.', __FUNCTION__, __CLASS__ );
1021
  return FALSE;
1022
  endif;
1023
- */
1024
  // turn off caching when parsing files to reduce memory usage
1025
  $this->ctc()->cache_updates = FALSE;
1026
  $this->styles = ''; // reset styles
@@ -1055,15 +831,12 @@ class ChildThemeConfiguratorCSS {
1055
  // read stylesheet
1056
 
1057
  if ( $stylesheet_verified = $this->is_file_ok( $stylesheet, 'read' ) ):
1058
- /**
1059
- * Future use: make sure we have space to parse
1060
- *
1061
  if ( filesize( $stylesheet_verified ) * 3 > $this->ctc()->get_free_memory() ):
1062
  $this->max_sel = 1;
1063
- //$this->ctc()->debug( 'Insufficient memory to read file', __FUNCTION__, __CLASS__ );
1064
  return;
1065
  endif;
1066
- */
1067
  $this->styles .= @file_get_contents( $stylesheet_verified ) . "\n";
1068
  //echo 'count after get contents: ' . strlen( $this->styles ) . LF;
1069
  else:
@@ -1077,15 +850,6 @@ class ChildThemeConfiguratorCSS {
1077
  * FIXME - this function has grown too monolithic - refactor and componentize
1078
  */
1079
  function parse_css( $template, $basequery = NULL, $parse_imports = TRUE, $relpath = '', $reset = FALSE ) {
1080
- //$this->load_config( 'sel_ndx' );
1081
- $this->load_config( 'val_ndx' );
1082
- $this->load_config( 'dict_query' );
1083
- $this->load_config( 'dict_sel' );
1084
- $this->load_config( 'dict_token' );
1085
- $this->load_config( 'dict_qs' );
1086
- $this->load_config( 'dict_val' );
1087
- $this->load_config( 'dict_rule' );
1088
- $this->load_config( 'dict_seq' );
1089
  if ( FALSE === strpos( $basequery, '@' ) ):
1090
  $basequery = 'base';
1091
  endif;
@@ -1140,7 +904,7 @@ class ChildThemeConfiguratorCSS {
1140
  foreach( $matches[ 1 ] as $sel ):
1141
  $stuff = array_shift( $matches[ 2 ] );
1142
  $this->update_arrays(
1143
- 'child' == $template ? 'c' : 'p',
1144
  $query,
1145
  $sel
1146
  );
@@ -1192,17 +956,11 @@ class ChildThemeConfiguratorCSS {
1192
  $rule = preg_replace( '#(\-(o|ms|moz|webkit)\-)?(' . implode( '|', $this->vendorrule ) . ')#', "$3", $rule );
1193
  if ( 'parnt' == $template && 'background-image' == $rule && strstr( $value, 'url(' ) )
1194
  $value = $this->convert_rel_url( $value, $relpath );
1195
- /**
1196
- * The reset flag forces the values for a given property (rule) to be rewritten completely
1197
- * when using the raw CSS input or when reading from a stylesheet.
1198
- * This permits complete blocks of style data to be entered verbatim, replacing existing styles.
1199
- * When entering individual values from the Query/Selector inputs, multiple fallback values for existing
1200
- * properties can be added in the order they are entered (e.g., margin: 1rem; margin: 1em;)
1201
- */
1202
  if ( !$reset ) $resetrule[ $rule ] = TRUE;
1203
 
1204
  $qsid = $this->update_arrays(
1205
- 'child' == $template ? 'c' : 'p',
1206
  $query,
1207
  $sel,
1208
  $rule,
@@ -1225,12 +983,10 @@ class ChildThemeConfiguratorCSS {
1225
  );
1226
  do_action( 'chld_thm_cfg_update_qsid', $qsid );
1227
  endif;
1228
-
1229
  }
1230
 
1231
  // converts relative path to absolute path for preview
1232
  function convert_rel_url( $value, $relpath, $url = TRUE ) {
1233
- if ( preg_match( '/data:/', $value ) ) return $value;
1234
  $path = preg_replace( '%url\([\'" ]*(.+?)[\'" ]*\)%', "$1", $value );
1235
  if ( preg_match( '%(https?:)?//%', $path ) ) return $value;
1236
  $pathparts = explode( '/', $path );
@@ -1244,7 +1000,7 @@ class ChildThemeConfiguratorCSS {
1244
  $newvalue = ( $url ? 'url(' : '' )
1245
  . ( $fileparts ? trailingslashit( implode( '/', $fileparts ) ) : '' )
1246
  . implode( '/', $newparts ) . ( $url ? ')' : '' );
1247
- $this->ctc()->debug( 'converted ' . $value . ' to ' . $newvalue . ' with ' . $relpath, __FUNCTION__, __CLASS__ );
1248
  return $newvalue;
1249
  }
1250
 
@@ -1256,29 +1012,36 @@ class ChildThemeConfiguratorCSS {
1256
  * New selectors are appended to the end of each media query block.
1257
  * FIXME - this function has grown too monolithic - refactor and componentize
1258
  */
1259
- function write_css() {
1260
- $output = '';
 
 
 
 
 
 
1261
  foreach ( $this->sort_queries() as $query => $sort_order ):
1262
  $has_selector = 0;
1263
  $sel_output = '';
1264
- $selectors = $this->denorm_dict_qs( $query, FALSE );
1265
  uasort( $selectors, array( $this, 'cmp_seq' ) );
1266
  if ( 'base' != $query ) $sel_output .= $query . ' {' . LF;
1267
  foreach ( $selectors as $selid => $qsid ):
1268
- if ( $valarr = $this->unpack_val_ndx( $qsid ) ):
1269
- $sel = $this->detokenize( $this->get_dict_value( 'sel', $selid ) );
1270
  $shorthand = array();
1271
  $rule_output = array();
1272
- foreach ( $valarr as $ruleid => $temparr ):
1273
  // normalize values for backward compatability
1274
- if ( isset( $temparr[ 'c' ] ) &&
1275
- ( !isset( $temparr[ 'p' ] ) || $temparr[ 'p' ] != $temparr[ 'c' ] ) ):
1276
- foreach ( $temparr[ 'c' ] as $rulevalarr ):
 
1277
  $this->add_vendor_rules(
1278
  $rule_output,
1279
  $shorthand,
1280
- $this->get_dict_value( 'rule', $ruleid ),
1281
- $this->get_dict_value( 'val', $rulevalarr[ 0 ] ),
1282
  $rulevalarr[ 1 ],
1283
  $rulevalarr[ 2 ]
1284
  );
@@ -1312,23 +1075,30 @@ class ChildThemeConfiguratorCSS {
1312
  if ( 'base' != $query ) $sel_output .= '}' . LF;
1313
  if ( $has_selector ) $output .= $sel_output;
1314
  endforeach;
1315
- $output = $this->get_css_header_comment( $this->get_prop( 'handling' ) ) . LF . $output;
1316
- $stylesheet = $this->get_stylesheet_path();
1317
- $this->ctc()->debug( 'writing stylesheet: ' . $stylesheet, __FUNCTION__, __CLASS__ );
1318
  //echo //print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), true) . LF;
1319
  if ( $stylesheet_verified = $this->is_file_ok( $stylesheet, 'write' ) ):
1320
  global $wp_filesystem; // this was initialized earlier;
1321
- $mode = 'direct' == $this->ctc()->fs_method ? FALSE : 0666;
 
 
 
 
 
 
 
 
1322
  // write new stylesheet:
1323
  // try direct write first, then wp_filesystem write
1324
  // stylesheet must already exist and be writable by web server
1325
  if ( $this->ctc()->is_ajax && is_writable( $stylesheet_verified ) ):
1326
  if ( FALSE === @file_put_contents( $stylesheet_verified, $output ) ):
1327
- $this->ctc()->debug( 'Ajax write failed.', __FUNCTION__, __CLASS__ );
1328
  return FALSE;
1329
  endif;
1330
- elseif ( FALSE === $wp_filesystem->put_contents( $this->ctc()->fspath( $stylesheet_verified ), $output, $mode ) ):
1331
- $this->ctc()->debug( 'Filesystem write failed.', __FUNCTION__, __CLASS__ );
1332
  return FALSE;
1333
  endif;
1334
  return TRUE;
@@ -1339,6 +1109,7 @@ class ChildThemeConfiguratorCSS {
1339
  function stringify_rule_output( &$rule_output ) {
1340
  $output = '';
1341
  asort( $rule_output );
 
1342
  foreach ( $rule_output as $rule => $sortstr )
1343
  $output .= ' ' . $rule . ";\n";
1344
  return $output;
@@ -1352,20 +1123,21 @@ class ChildThemeConfiguratorCSS {
1352
  * encode_shorthand
1353
  * converts CTC long syntax into CSS shorthand
1354
  * v1.7.5 refactored for multiple values per property
1355
- * v2.1.0 to prevent incorrect rendering, do not use shorthand if multiple values exist for any side property.
1356
  */
1357
  function encode_shorthand( $shorthand, &$rule_output ) {
 
1358
  foreach ( $shorthand as $property => $sides ):
1359
- if ( isset( $sides[ 'top' ] ) && 1 == count( $sides[ 'top' ] ) ):
1360
  foreach ( $sides[ 'top' ] as $tval => $tarr ):
1361
- if ( isset( $sides[ 'right' ] ) && 1 == count( $sides[ 'right' ] ) ):
1362
  $currseq = $tarr[ 1 ];
1363
  foreach ( $sides[ 'right' ] as $rval => $rarr ):
1364
  // value must exist from side and priority must match all sides
1365
- if ( isset( $sides[ 'bottom' ] ) && 1 == count( $sides[ 'bottom' ] ) && $tarr[ 0 ] == $rarr[ 0 ] ):
1366
  if ( $rarr[ 1 ] > $currseq ) $currseq = $rarr[ 1 ];
1367
  foreach ( $sides[ 'bottom' ] as $bval => $barr ):
1368
- if ( isset( $sides[ 'left' ] ) && 1 == count( $sides[ 'left' ] ) && $tarr[ 0 ] == $barr[ 0 ] ):
1369
  // use highest sort sequence of all sides
1370
  if ( $barr[ 1 ] > $currseq ) $currseq = $barr[ 1 ];
1371
  foreach ( $sides[ 'left' ] as $lval => $larr ):
@@ -1597,38 +1369,10 @@ class ChildThemeConfiguratorCSS {
1597
  */
1598
  function encode_gradient( $value ) {
1599
  // don't try this at home, kids
1600
- $regex = '/gradient[^\)]*?\( #exp descr
1601
- ( #[1]
1602
- ( #[2]
1603
- (to\x20)? #[3] reverse
1604
- (top|bottom|left|right)? #[4] direction1
1605
- (\x20 #[5]
1606
- (top|bottom|left|right))? #[6] direction2
1607
- |\d+deg),)? # or angle
1608
- (color-stop\()? #[7] optional
1609
- ([^\w\#\)]*[\'"]? #[8]
1610
- (\#\w{3,8} #[9] color (hex)
1611
- |rgba?\([\d.,\x20]+?\) # red green blue (alpha)
1612
- |hsla?\([\d%.,\x20]+?\) # hue sat. lum. (alpha)
1613
- |[a-z]+) # color (name)
1614
- (\x20+[\d.]+%?)?) #[10] stop position
1615
- (\),\x20*)? #[11] optional close
1616
- (color-stop\()? #[12] optional
1617
- ([^\w\#\)]*[\'"]? #[13]
1618
- (\#\w{3,8} #[14] color (hex)
1619
- |rgba?\([\d.,\x20]+?\) # red green blue (alpha)
1620
- |hsla?\([\d%.,\x20]+?\) # hue sat. lum. (alpha)
1621
- |[a-z]+) # color (name)
1622
- (\x20+[\d.]+%?)?) #[15] stop position
1623
- (\))? #[16] optional close
1624
- ([^\w\)]*gradienttype=[\'"]? #[17] IE
1625
- (\d) #[18] IE
1626
- [\'"]?)? # IE
1627
- [^\w\)]*\)/ix';
1628
  $param = $parts = array();
1629
  preg_match( $regex, $value, $parts );
1630
- //$this->ctc()->debug( 'gradient value: ' . $value . ' parts: ' . print_r( $parts, TRUE ), __FUNCTION__, __CLASS__ );
1631
- if ( empty( $parts[ 18 ] ) ):
1632
  if ( empty( $parts[ 2 ] ) ):
1633
  $param[ 0 ] = 'top';
1634
  elseif ( 'to ' == $parts[ 3 ] ):
@@ -1640,28 +1384,28 @@ class ChildThemeConfiguratorCSS {
1640
  else:
1641
  $param[ 0 ] = trim( $parts[ 2 ] );
1642
  endif;
1643
- if ( empty( $parts[ 10 ] ) ):
1644
  $param[ 2 ] = '0%';
1645
  else:
1646
- $param[ 2 ] = trim( $parts[ 10 ] );
1647
  endif;
1648
- if ( empty( $parts[ 15 ] ) ):
1649
  $param[ 4 ] = '100%';
1650
  else:
1651
- $param[ 4 ] = trim( $parts[ 15 ] );
1652
  endif;
1653
- elseif( '0' == $parts[ 18 ] ):
1654
  $param[ 0 ] = 'top';
1655
  $param[ 2 ] = '0%';
1656
  $param[ 4 ] = '100%';
1657
- elseif ( '1' == $parts[ 18 ] ):
1658
  $param[ 0 ] = 'left';
1659
  $param[ 2 ] = '0%';
1660
  $param[ 4 ] = '100%';
1661
  endif;
1662
- if ( isset( $parts[ 9 ] ) && isset( $parts[ 14 ] ) ):
1663
- $param[ 1 ] = $parts[ 9 ];
1664
- $param[ 3 ] = $parts[ 14 ];
1665
  ksort( $param );
1666
  return implode( ':', $param );
1667
  else:
@@ -1707,23 +1451,21 @@ class ChildThemeConfiguratorCSS {
1707
  /**
1708
  * denorm_rule_val
1709
  * Return array of unique values corresponding to specific rule
1710
- * FIXME: only return child if no original value exists
1711
  */
1712
  function denorm_rule_val( $ruleid ) {
1713
- $this->load_config( 'dict_val' );
1714
- $this->load_config( 'val_ndx' );
1715
  $rule_sel_arr = array();
1716
- foreach ( $this->val_ndx as $qsid => $p ):
1717
- if ( $valarr = $this->unpack_val_ndx( $qsid ) ):
1718
- if ( !isset( $valarr[ $ruleid ] ) ) continue;
1719
- foreach ( array( 'p', 'c' ) as $template ):
1720
- if ( isset( $valarr[ $ruleid ][ $template ] ) ):
1721
- foreach ( $valarr[ $ruleid ][ $template ] as $rulevalarr ):
1722
- $rule_sel_arr[ $rulevalarr[ 0 ] ] = $this->get_dict_value( 'val', $rulevalarr[ 0 ] );
1723
- endforeach;
1724
- endif;
1725
- endforeach;
1726
- endif;
1727
  endforeach;
1728
  return $rule_sel_arr;
1729
  }
@@ -1732,29 +1474,26 @@ class ChildThemeConfiguratorCSS {
1732
  * denorm_val_query
1733
  * Return array of queries, selectors, rules, and values corresponding to
1734
  * specific rule/value combo grouped by query, selector
1735
- * FIXME: only return new values corresponding to specific rulevalid of matching original value
1736
  */
1737
  function denorm_val_query( $valid, $rule ) {
1738
- $this->load_config( 'dict_rule' );
1739
- $this->load_config( 'val_ndx' );
1740
  $value_query_arr = array();
1741
- if ( $thisruleid = $this->get_dict_id( 'rule', $rule ) ):
1742
- foreach ( $this->val_ndx as $qsid => $p ):
1743
- if ( $valarr = $this->unpack_val_ndx( $qsid ) ):
1744
- foreach ( $valarr as $ruleid => $values ):
1745
- if ( $ruleid != $thisruleid ) continue;
1746
- foreach ( array( 'p', 'c' ) as $template ):
1747
- if ( isset( $values[ $template ] ) ):
1748
- foreach ( $values[ $template ] as $rulevalarr ):
1749
- if ( $rulevalarr[ 0 ] != $valid ) continue;
1750
- $selarr = $this->denorm_query_sel( $qsid );
1751
- $value_query_arr[ $rule ][ $selarr[ 'query' ] ][ $qsid ] = $this->denorm_sel_val( $qsid );
1752
- endforeach;
1753
- endif;
1754
  endforeach;
1755
- endforeach;
1756
- endif;
1757
  endforeach;
 
1758
  endif;
1759
  return $value_query_arr;
1760
  }
@@ -1764,29 +1503,16 @@ class ChildThemeConfiguratorCSS {
1764
  * Return id, query and selector values of a specific qsid (query-selector ID)
1765
  */
1766
  function denorm_query_sel( $qsid ) {
1767
- $this->load_config( 'dict_query' );
1768
- $this->load_config( 'dict_sel' );
1769
- $this->load_config( 'dict_seq' );
1770
- $this->load_config( 'dict_qs' );
1771
- $this->load_config( 'dict_token' );
1772
- if ( FALSE === ( $qs = $this->get_dict_value( 'qs', $qsid ) ) ):
1773
- $this->ctc()->debug( $qsid . ' does not exist', __FUNCTION__, __CLASS__ );
1774
- return array();
1775
- endif;
1776
- list( $q, $s ) = explode( ':', $qs );
1777
- if ( $seq = $this->get_dict_value( 'seq', $qsid ) ):
1778
- $this->ctc()->debug( 'get seq: custom: ' . $seq, __FUNCTION__, __CLASS__ );
1779
- else:
1780
- $seq = $qsid;
1781
- $this->ctc()->debug( 'get seq: using qsid: ' . $qsid, __FUNCTION__, __CLASS__ );
1782
- endif;
1783
- $qselarr = array(
1784
  'id' => $qsid,
1785
- 'query' => $this->get_dict_value( 'query', $q ),
1786
- 'selector' => $this->detokenize( $this->get_dict_value( 'sel', $s ) ),
1787
- 'seq' => $seq,
1788
  );
1789
- return $qselarr;
1790
  }
1791
 
1792
  /**
@@ -1795,21 +1521,18 @@ class ChildThemeConfiguratorCSS {
1795
  * grouped by query, selector
1796
  */
1797
  function denorm_sel_val( $qsid ) {
1798
- $this->load_config( 'dict_val' );
1799
- $this->load_config( 'dict_rule' );
1800
- $this->load_config( 'val_ndx' );
1801
  $selarr = $this->denorm_query_sel( $qsid );
1802
- if ( $valarr = $this->unpack_val_ndx( $qsid ) ):
1803
- //$this->ctc()->debug( 'valarr: ' . print_r( $valarr, TRUE ), __FUNCTION__, __CLASS__ );
1804
- foreach ( $valarr as $ruleid => $values ):
1805
- //$this->ctc()->debug( 'ruleid: ' . $ruleid, __FUNCTION__, __CLASS__ );
1806
- foreach ( array( 'p', 'c' ) as $template ):
1807
- $t = 'c' == $template ? 'child' : 'parnt';
1808
- //$this->ctc()->debug( 'template: ' . $t, __FUNCTION__, __CLASS__ );
1809
  if ( isset( $values[ $template ] ) ):
1810
  foreach ( $values[ $template ] as $rulevalarr ):
1811
- $selarr[ 'value' ][ $this->get_dict_value( 'rule', $ruleid ) ][ $t ][] = array(
1812
- $this->get_dict_value( 'val', $rulevalarr[ 0 ] ),
1813
  $rulevalarr[ 1 ],
1814
  isset( $rulevalarr[ 2 ] ) ? $rulevalarr[ 2 ] : 1,
1815
  );
@@ -1818,23 +1541,18 @@ class ChildThemeConfiguratorCSS {
1818
  endforeach;
1819
  endforeach;
1820
  endif;
1821
- //$this->ctc()->debug( print_r( $selarr, TRUE ), __FUNCTION__, __CLASS__ );
1822
  return $selarr;
1823
  }
1824
 
1825
  /**
1826
- /**
1827
- * v1.7.5
1828
  * convert and/or normalize rule/value index
1829
  * to support multiple values per property ( rule )
1830
  * allows backward compatility with < v1.7.5
1831
  */
1832
  function convert_ruleval_array( &$arr ) {
1833
- //$this->ctc()->debug( 'original array: ' . print_r( $arr, TRUE ), __FUNCTION__, __CLASS__ );
1834
  foreach ( array( 'parnt', 'child' ) as $template ):
1835
  // skip if empty array
1836
  if ( !isset( $arr[ $template ] ) ) continue;
1837
- $t = 'child' == $template ? 'c' : 'p';
1838
  // check if using original data structure ( value is scalar )
1839
  if ( ! is_array( $arr[ $template ] ) ):
1840
  /**
@@ -1844,15 +1562,9 @@ class ChildThemeConfiguratorCSS {
1844
  * [1] => important
1845
  * [2] => priority
1846
  */
1847
- $arr[ $t ] = array( array( $arr[ $template ], $arr[ 'i_' . $template ], 0, 1 ) );
1848
- else:
1849
- $arr[ $t ] = $arr[ $template ];
1850
  endif;
1851
- unset( $arr[ $template ] );
1852
- endforeach;
1853
- //$this->ctc()->debug( 'first pass: ' . print_r( $arr, TRUE ), __FUNCTION__, __CLASS__ );
1854
- foreach ( array( 'p', 'c' ) as $template ):
1855
- if ( !isset( $arr[ $template ] ) ) continue;
1856
  $newarr = array();
1857
  // iterate each value and enforce array structure
1858
  foreach ( $arr[ $template ] as $rulevalid => $rulevalarr ):
@@ -1860,7 +1572,7 @@ class ChildThemeConfiguratorCSS {
1860
  if ( empty ( $rulevalarr ) ) continue;
1861
  //
1862
  if ( ! is_array( $rulevalarr ) ):
1863
- // important flag moves to individual value in array
1864
  $important = isset( $arr[ 'i_' . $template ] ) ? $arr[ 'i_' . $template ] : 0;
1865
  unset( $arr[ 'i_' . $template ] );
1866
  $val = (int) $rulevalarr;
@@ -1872,78 +1584,22 @@ class ChildThemeConfiguratorCSS {
1872
  endforeach;
1873
  $arr[ $template ] = $newarr;
1874
  endforeach;
1875
- //$this->ctc()->debug( 'second pass: ' . print_r( $arr, TRUE ), __FUNCTION__, __CLASS__ );
1876
  }
1877
 
1878
  /**
1879
- * Convert all internal data dictionaries to latest format.
1880
- */
1881
- function convert_dict_arrays(){
1882
- $this->ctc()->debug( 'converting dictionaries from old format', __FUNCTION__, __CLASS__ );
1883
- foreach ( $this->dicts as $dict => $loaded ):
1884
- $this->load_config( $dict );
1885
- switch ( $dict ):
1886
- case 'dict_seq':
1887
- case 'dict_token':
1888
- continue;
1889
- case 'sel_ndx':
1890
- $this->{ $dict } = array();
1891
- continue;
1892
- case 'val_ndx':
1893
- foreach ( $this->val_ndx as $qsid => $rulearr ):
1894
- foreach ( $rulearr as $ruleid => $valarr )
1895
- $this->convert_ruleval_array( $this->val_ndx[ $qsid ][ $ruleid ] );
1896
- $this->pack_val_ndx( $qsid, $this->val_ndx[ $qsid ] );
1897
- endforeach;
1898
- continue;
1899
- case 'dict_qs':
1900
- $qsarr = array();
1901
- foreach ( $this->dict_qs as $qsid => $arr ):
1902
- $qs = $arr[ 'q' ] . ':' . $arr[ 's' ];
1903
- $qsarr[ $qsid ] = $qs;
1904
- endforeach;
1905
- $this->dict_qs = $qsarr;
1906
- continue;
1907
- default:
1908
- $this->{ $dict } = array_flip( $this->{ $dict } );
1909
- foreach ( $this->{ $dict } as $key => $val ):
1910
- if ( 'dict_sel' == $dict )
1911
- $this->dict_sel[ $key ] = $this->tokenize( (string) $val );
1912
- else
1913
- $this->{ $dict }[ $key ] = ( string ) $val;
1914
- endforeach;
1915
- endswitch;
1916
- //echo '<pre><code><small><strong>' . $dict . '</strong>' . print_r( $this->{ $dict }, TRUE) . '</small></code></pre>' . LF;
1917
- endforeach;
1918
- $this->save_config();
1919
- }
1920
-
1921
- /**
1922
- * denorm_dict_qs
1923
  * Return denormalized array containing query and selector heirarchy
1924
  */
1925
- function denorm_dict_qs( $query = NULL, $norm = TRUE ) {
1926
- $this->load_config( 'dict_query' );
1927
- $this->load_config( 'dict_sel' );
1928
- $this->load_config( 'dict_token' );
1929
- $this->load_config( 'dict_qs' );
1930
- $retarray = array();
1931
- if ( $query ):
1932
- $q = $this->get_dict_id( 'query', $query );
1933
- $selarr = preg_grep( '/^' . $q . ':/', $this->dict_qs );
1934
- foreach ( $selarr as $qsid => $qs ):
1935
- list( $q, $s ) = explode( ':', $qs );
1936
- if ( $norm )
1937
- $retarray[ $qsid ] = $this->detokenize( $this->get_dict_value( 'sel', $s ) );
1938
- else
1939
- $retarray[ $s ] = $qsid;
1940
  endforeach;
1941
- else:
1942
- return array_values( $this->dict_query );
1943
- endif;
1944
- if ( $norm )
1945
- return $this->sort_selectors( $retarray );
1946
- return $retarray;
1947
  }
1948
 
1949
  /**
@@ -1966,10 +1622,10 @@ class ChildThemeConfiguratorCSS {
1966
  * @media min-width queries in ascending order
1967
  */
1968
  function sort_queries() {
1969
- $this->load_config( 'dict_query' );
1970
  $queries = array();
1971
- foreach ( $this->dict_query as $queryid => $query ):
1972
- /** lookup **/
 
1973
  if ( 'base' == $query ):
1974
  $queries[ 'base' ] = -999999;
1975
  continue;
@@ -1985,9 +1641,8 @@ class ChildThemeConfiguratorCSS {
1985
  }
1986
 
1987
  function sort_selectors( $selarr ) {
1988
- $selarr = ( array ) $selarr;
1989
- uasort( $selarr, array( $this, 'cmp_sel' ) );
1990
- return array_flip( $selarr );
1991
  }
1992
 
1993
  function cmp_sel( $a, $b ) {
@@ -1999,10 +1654,8 @@ class ChildThemeConfiguratorCSS {
1999
 
2000
  // sort selectors based on dict_seq if exists, otherwise qsid
2001
  function cmp_seq( $a, $b ) {
2002
- if ( FALSE === ( $cmpa = $this->get_dict_value( 'seq', $a ) ) )
2003
- $cmpa = $a;
2004
- if ( FALSE === ( $cmpb = $this->get_dict_value( 'seq', $b ) ) )
2005
- $cmpb = $b;
2006
  if ( $cmpa == $cmpb ) return 0;
2007
  return ( $cmpa < $cmpb ) ? -1 : 1;
2008
  }
@@ -2035,37 +1688,36 @@ class ChildThemeConfiguratorCSS {
2035
  /**
2036
  * is_file_ok
2037
  * verify file exists and is in valid location
2038
- * must be in theme or plugin folders
2039
  */
2040
  function is_file_ok( $stylesheet, $permission = 'read' ) {
2041
  // remove any ../ manipulations
2042
  $stylesheet = $this->ctc()->normalize_path( preg_replace( "%\.\./%", '/', $stylesheet ) );
2043
- //$this->ctc()->debug( 'checking file: ' . $stylesheet, __FUNCTION__, __CLASS__ );
2044
  if ( 'read' == $permission && !is_file( $stylesheet ) ):
2045
- $this->ctc()->debug( 'read ' . $stylesheet . ' no file!', __FUNCTION__, __CLASS__ );
2046
  return FALSE;
2047
  elseif ( 'write' == $permission && !is_dir( dirname( $stylesheet ) ) ):
2048
- $this->ctc()->debug( 'write ' . $stylesheet . ' no dir!', __FUNCTION__, __CLASS__ );
2049
  return FALSE;
2050
  elseif ( 'search' == $permission && !is_dir( $stylesheet ) ):
2051
- $this->ctc()->debug( 'search ' . $stylesheet . ' no dir!', __FUNCTION__, __CLASS__ );
2052
  return FALSE;
2053
  endif;
2054
  // check if in themes dir;
2055
  $regex = '%^' . preg_quote( $this->ctc()->normalize_path( get_theme_root() ) ) . '%';
2056
- //$this->ctc()->debug( 'theme regex: ' . $regex, __FUNCTION__, __CLASS__ );
2057
  if ( preg_match( $regex, $stylesheet ) ):
2058
- //$this->ctc()->debug( $stylesheet . ' ok!', __FUNCTION__, __CLASS__ );
2059
  return $stylesheet;
2060
  endif;
2061
  // check if in plugins dir
2062
  $regex = '%^' . preg_quote( $this->ctc()->normalize_path( WP_PLUGIN_DIR ) ) . '%';
2063
- //$this->ctc()->debug( 'plugin regex: ' . $regex, __FUNCTION__, __CLASS__ );
2064
  if ( preg_match( $regex, $stylesheet ) ):
2065
- //$this->ctc()->debug( $stylesheet . ' ok!', __FUNCTION__, __CLASS__ );
2066
  return $stylesheet;
2067
  endif;
2068
- $this->ctc()->debug( $stylesheet . ' is not in wp folders!', __FUNCTION__, __CLASS__ );
2069
  return FALSE;
2070
  }
2071
 
@@ -2095,58 +1747,4 @@ class ChildThemeConfiguratorCSS {
2095
  function tolower( $matches ) {
2096
  return '#' . strtolower( $matches[ 1 ] );
2097
  }
2098
-
2099
- function tokenize( $value ){
2100
- return $value;
2101
- // swap out commas and/or consecutive alphas with leading non-alpha if present
2102
- $value = preg_replace_callback( "/(, |[_\W]?[^\W_]+)/", array( $this, 'get_token' ), $value );
2103
- // trim off leading/trailing delimiter
2104
- $value = preg_replace( "/^%%|%%$/", '', $value );
2105
- // split into packable array
2106
- $array = array_map( array( $this, 'to_int' ), preg_split( "/(%%)+/", $value ) );
2107
- //echo '<pre><code><small>';
2108
- //var_dump( $array );
2109
- //echo '</small></code></pre>';
2110
- try {
2111
- return $this->packer->encode( $this->packer->pack( $array ) );
2112
- } catch ( Exception $e ) {
2113
- $this->ctc()->errors[] = 'Pack failed -- ' . $e->getMessage();
2114
- }
2115
- }
2116
-
2117
- function to_int( $val ){
2118
- return intval( $val ) == $val ? (int) $val : $val;
2119
- }
2120
-
2121
- function detokenize( $packed ){
2122
- return $packed;
2123
- // unpack array
2124
- try {
2125
- $this->packer->reset( $this->packer->decode( $packed ) );
2126
- $array = $this->packer->unpack();
2127
- } catch ( Exception $e ) {
2128
- $this->ctc()->errors[] = 'Unpack failed -- ' . $e->getMessage();
2129
- }
2130
- $unpacked = array();
2131
- // iterate array and replace tokens
2132
- do {
2133
- $token = array_shift( $array );
2134
- if ( 'integer' == gettype( $token ) )
2135
- $unpacked[] = $this->get_dict_value( 'token', $token );
2136
- else
2137
- $unpacked[] = $token;
2138
- } while( $array );
2139
-
2140
- // assemble array
2141
- return implode( '', $unpacked );
2142
- }
2143
-
2144
- function get_token( $matches ){
2145
- $token = $matches[ 1 ];
2146
- $id = $this->get_dict_id( 'token', $token );
2147
- $this->instances[ $id ] = isset( $this->instances[ $id ] )
2148
- ? $this->instances[ $id ] + 1
2149
- : 1;
2150
- return '%%' . $id . '%%';
2151
- }
2152
  }
6
  Class: ChildThemeConfiguratorCSS
7
  Plugin URI: http://www.childthemeconfigurator.com/
8
  Description: Handles all CSS input, output, parsing, normalization and storage
9
+ Version: 1.7.9.1
10
  Author: Lilaea Media
11
  Author URI: http://www.lilaeamedia.com/
12
  Text Domain: chld_thm_cfg
13
  Domain Path: /lang
14
  License: GPLv2
15
+ Copyright (C) 2014-2015 Lilaea Media
16
  */
 
17
  class ChildThemeConfiguratorCSS {
 
18
  // data dictionaries
19
  var $dict_query; // @media queries and 'base'
20
  var $dict_sel; // selectors
22
  var $dict_rule; // css rules
23
  var $dict_val; // css values
24
  var $dict_seq; // child load order (priority)
 
25
  // hierarchies
26
+ var $sel_ndx; // query => selector hierarchy
27
  var $val_ndx; // selector => rule => value hierarchy
28
  // key counters
29
  var $qskey; // counter for dict_qs
31
  var $selkey; // counter for dict_sel
32
  var $rulekey; // counter for dict_rule
33
  var $valkey; // counter for dict_val
34
+ // miscellaneous properties
35
+ var $imports; // @import rules
36
+ var $styles; // temporary update cache
37
  var $child; // child theme slug
38
  var $parnt; // parent theme slug
39
  var $configtype; // legacy plugin slug
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 $nowarn; // ignore stylesheet handling warnings
 
 
 
 
 
 
 
 
 
 
 
45
  var $child_name; // child theme name
46
  var $child_author; // child theme author
47
  var $child_authoruri; // child theme author website
49
  var $child_descr; // child theme description
50
  var $child_tags; // child theme tags
51
  var $child_version; // stylesheet version
 
 
 
 
 
 
 
 
52
  var $max_sel;
 
 
53
  var $temparray;
54
+ var $vendorrule = array(
 
55
  'box\-sizing',
56
  'font\-smoothing',
57
  'border(\-(top|right|bottom|left))*\-radius',
69
  );
70
  var $configvars = array(
71
  'addl_css',
72
+ // the enqueue flag prevents the transition from 1.5.4
73
+ // from breaking the stylesheet by forcing the user to regenerate
74
+ // the config data before updating the stylesheet. Otherwise,
75
+ // removing the @import for the parent stylesheet will cause
76
+ // the parent core styles to be missing.
77
+ 'enqueue',
 
 
 
 
 
 
 
 
78
  'max_sel',
79
  'imports',
80
  'child_version',
92
  'qskey',
93
  'selkey',
94
  'querykey',
 
95
  'recent',
96
  'converted',
97
+ 'nowarn',
 
98
  );
99
  var $dicts = array(
100
+ 'dict_qs',
101
+ 'dict_sel',
102
+ 'dict_query',
103
+ 'dict_rule',
104
+ 'dict_val',
105
+ 'dict_seq',
106
+ 'sel_ndx',
107
+ 'val_ndx',
108
  );
 
109
 
110
  function __construct() {
 
111
  // scalars
112
  $this->querykey = 0;
113
  $this->selkey = 0;
114
  $this->qskey = 0;
115
  $this->rulekey = 0;
116
  $this->valkey = 0;
117
+ $this->child = '';
118
+ $this->parnt = '';
119
+ $this->configtype = 'theme'; // legacy support
120
  $this->child_name = '';
121
  $this->child_author = 'Child Theme Configurator';
122
  $this->child_themeuri = '';
124
  $this->child_descr = '';
125
  $this->child_tags = '';
126
  $this->child_version = '1.0';
127
+ $this->max_sel = 0;
 
 
 
 
 
 
 
 
128
 
129
  // multi-dim arrays
130
+ $this->dict_qs = array();
131
+ $this->dict_sel = array();
132
+ $this->dict_query = array();
133
+ $this->dict_rule = array();
134
+ $this->dict_val = array();
135
+ $this->dict_seq = array();
136
+ $this->sel_ndx = array();
137
+ $this->val_ndx = array();
138
+ $this->addl_css = array();
139
  $this->recent = array();
140
+ $this->imports = array( 'child' => array(), 'parnt' => array() );
 
141
  }
142
 
143
  // helper function to globalize ctc object
144
  function ctc() {
145
  return ChildThemeConfigurator::ctc();
146
  }
147
+
148
+ // loads current ctc config data into local memory
149
+ function load_config() {
150
+ $option = CHLD_THM_CFG_OPTIONS . apply_filters( 'chld_thm_cfg_option', '' );
151
+ //echo 'loading option: ' . $option . LF;
152
+ if ( ( $configarray = get_site_option( $option . '_configvars' ) ) && count( $configarray ) ):
153
+ foreach ( $this->configvars as $configkey ):
154
+ if ( isset( $configarray[ $configkey ] ) )
155
+ $this->{$configkey} = $configarray[ $configkey ];
156
+ endforeach;
157
+ $this->ctc()->debug( 'configvars: ' . print_r( $configarray, TRUE ), __FUNCTION__ );
158
+ foreach ( $this->dicts as $configkey ):
159
+ if ( ( $configarray = get_site_option( $option . '_' . $configkey ) ) && count( $configarray ) )
160
+ $this->{$configkey} = $configarray;
161
+ endforeach;
162
+ else:
163
+ return FALSE;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  endif;
 
165
  }
166
 
167
  // writes ctc config data to options api
168
  function save_config( $override = NULL ) {
 
 
169
  global $wpdb;
170
  if ( isset( $override ) ) $option = $override;
171
  else $option = apply_filters( 'chld_thm_cfg_option', '' );
172
  $option = CHLD_THM_CFG_OPTIONS . $option;
173
+ //echo 'saving option: ' . $option . LF;
174
  $configarray = array();
175
  foreach ( $this->configvars as $configkey )
176
+ $configarray[ $configkey ] = $this->{$configkey};
177
+ $this->ctc()->debug( 'configvars: ' . print_r( $configarray, TRUE ), __FUNCTION__ );
178
  if ( is_multisite() ):
179
  update_site_option( $option . '_configvars', $configarray );
180
  else:
181
  // do not autoload ( passing false above only works if value changes
182
  update_option( $option . '_configvars', $configarray, FALSE );
183
  endif;
184
+ foreach ( $this->dicts as $configkey ):
185
+ if ( is_multisite() ):
186
+ update_site_option( $option . '_' . $configkey, $this->{$configkey} );
187
+ else:
188
+ // do not autoload ( passing false above only works if value changes
189
+ update_option( $option . '_' . $configkey, $this->{$configkey}, FALSE );
 
 
 
 
190
  endif;
191
  endforeach;
 
 
 
 
 
 
 
 
 
 
 
192
  }
193
+
194
  /**
195
  * get_prop
196
  * Getter interface (data sliced different ways depending on objname )
197
  */
198
+ function get_prop( $objname, $params = NULL ) {
199
+ switch ( $objname ):
 
 
 
 
 
 
200
  case 'imports':
201
+ return $this->obj_to_utf8( is_array( $this->imports[ 'child' ] ) ?
 
202
  ( current( $this->imports[ 'child' ] ) == 1 ?
203
  array_keys( $this->imports[ 'child' ] ) :
204
  array_keys( array_flip( $this->imports[ 'child' ] ) ) ) :
205
  array() );
206
  case 'queries':
207
+ return $this->obj_to_utf8( $this->denorm_sel_ndx() );
208
  case 'selectors':
209
  return empty( $params[ 'key' ] ) ?
210
+ array() : $this->obj_to_utf8( $this->denorm_sel_ndx( $params[ 'key' ] ) );
211
  case 'rule_val':
212
  return empty( $params[ 'key' ] ) ? array() : $this->denorm_rule_val( $params[ 'key' ] );
213
  case 'val_qry':
214
+ if ( isset( $params[ 'rule' ] ) && isset( $this->dict_rule[ $params[ 'rule' ] ] ) ):
215
  return empty( $params[ 'key' ] ) ?
216
  array() : $this->denorm_val_query( $params[ 'key' ], $params[ 'rule' ] );
217
  endif;
219
  return empty( $params[ 'key' ] ) ?
220
  array() : $this->obj_to_utf8( $this->denorm_sel_val( $params[ 'key' ] ) );
221
  case 'rules':
222
+ ksort( $this->dict_rule );
223
+ return $this->obj_to_utf8( $this->dict_rule );;
 
 
 
 
224
  case 'child':
225
  return $this->child;
226
  case 'parnt':
227
  return $this->parnt;
228
  case 'configtype': // legacy plugin extension support
229
  return $this->configtype;
 
 
230
  case 'addl_css':
231
+ return isset( $this->addl_css ) ? $this->addl_css : array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
232
  case 'child_name':
233
+ return $this->child_name;
234
  case 'author':
235
+ return $this->child_author;
236
  case 'themeuri':
237
  return isset( $this->child_themeuri ) ? $this->child_themeuri : FALSE;
238
  case 'authoruri':
239
  return isset( $this->child_authoruri ) ? $this->child_authoruri : FALSE;
240
  case 'descr':
241
+ return isset( $this->child_descr ) ? $this->child_descr : FALSE;
242
  case 'tags':
243
+ return isset( $this->child_tags ) ? $this->child_tags : FALSE;
244
  case 'version':
245
  return $this->child_version;
246
  case 'preview':
247
  $this->styles = '';
248
  if ( empty( $params[ 'key' ] ) || 'child' == $params[ 'key' ] ):
249
+ $this->read_stylesheet( 'child' );
250
  else:
251
  if ( isset( $this->addl_css ) ):
252
  foreach ( $this->addl_css as $file ):
255
  $this->styles .= '/*** END ' . $file . ' ***/' . LF;
256
  endforeach;
257
  endif;
258
+ list ( $template, $file ) = apply_filters( 'chld_thm_cfg_parent_preview_args', array( 'parnt', 'style.css' ) );
259
+ if ( $this->ctc()->is_theme() || $this->ctc()->is_legacy() ):
260
+ $this->styles .= '/*** BEGIN ' . $file . ' ***/' . LF;
261
+ $this->read_stylesheet( $template, $file );
262
+ $this->styles .= '/*** END ' . $file . ' ***/' . LF;
 
 
 
 
263
  endif;
264
  endif;
265
  $this->normalize_css();
266
  return $this->styles;
267
  break;
268
  default:
269
+ return $this->obj_to_utf8( apply_filters( 'chld_thm_get_prop', NULL, $objname, $params ) );
270
  endswitch;
271
  return FALSE;
272
  }
275
  * set_prop
276
  * Setter interface (scalar values only)
277
  */
278
+ function set_prop( $prop, $value ) {
279
+ if ( is_null( $this->{ $prop } ) || is_scalar( $this->{ $prop } ) )
280
+ $this->{ $prop } = $value;
281
  else return FALSE;
282
  }
283
 
291
  endif;
292
  }
293
 
 
 
 
 
 
 
 
294
  // creates header comments for stylesheet
295
  function get_css_header() {
296
+ $parnt = $this->get_prop( 'parnt' );
297
+ return '/*' . LF
298
+ . 'Theme Name: ' . $this->get_prop( 'child_name' ) . LF
299
+ . ( ( $attr = $this->get_prop( 'themeuri' ) ) ? 'Theme URI: ' . $attr . LF : '' )
300
+ . 'Template: ' . $parnt . LF
301
+ . 'Author: ' . $this->get_prop( 'author' ) . LF
302
+ . ( ( $attr = $this->get_prop( 'authoruri' ) ) ? 'Author URI: ' . $attr . LF : '' )
303
+ . ( ( $attr = $this->get_prop( 'descr' ) ) ? 'Description: ' . $attr . LF : '' )
304
+ . ( ( $attr = $this->get_prop( 'tags' ) ) ? 'Tags: ' . $attr . LF : '' )
305
+ . 'Version: ' . $this->get_prop( 'version' ) . '.' . time() . LF
306
+ . 'Updated: ' . current_time( 'mysql' ) . LF
307
+ . '*/' . LF . LF . '@charset "UTF-8";' . LF . LF
308
+ . ( 'import' == $this->enqueue ? '@import url(\'../' . $parnt . '/style.css\');' . LF : '' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309
  }
310
 
311
  // formats file path for child theme file
312
+ function get_child_target( $file = 'style.css' ) {
313
+ return trailingslashit( get_theme_root() ) . trailingslashit( $this->get_prop( 'child' ) ) . $file;
314
  }
315
 
316
  // formats file path for parent theme file
317
+ function get_parent_source( $file = 'style.css' ) {
318
+ return trailingslashit( get_theme_root() ) . trailingslashit( $this->get_prop( 'parnt' ) ) . $file;
319
  }
320
 
321
  /**
325
  * incrementing key value for dictionary
326
  */
327
  function get_dict_id( $dict, $value ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
328
  $property = 'dict_' . $dict;
329
+ $key = $dict . 'key';
330
+ if ( !isset( $this->{ $property }[ $value ] ) )
331
+ // add value to index
332
+ $this->{ $property }[ $value ] = ++$this->{ $key };
333
+ return $this->{ $property }[ $value ];
334
  }
335
 
 
 
 
 
 
336
  /**
337
  * get_qsid
338
  * query/selector id is the combination of two dictionary values
339
  * also throttles parsing if memory limit is reached
340
  */
341
  function get_qsid( $query, $sel ) {
342
+ $q = $this->get_dict_id( 'query', $query );
343
+ $s = $this->get_dict_id( 'sel', $sel );
344
+ if ( !isset( $this->sel_ndx[ $q ][ $s ] ) ):
345
+ // stop parsing if limit is reached to prevent out of memory on serialize
346
+ if ( $this->qskey >= $this->ctc()->sel_limit ):
347
+ $this->max_sel = 1;
348
+ $this->ctc()->debug( 'Maximum num selectors reached ( limit: ' . $this->ctc()->sel_limit . ' )', __FUNCTION__ );
 
 
 
 
349
  return FALSE;
350
+ endif;
351
+ // increment key number
352
+ $this->sel_ndx[ $q ][ $s ] = ++$this->qskey;
353
+ $this->dict_qs[ $this->qskey ][ 's' ] = $s;
354
+ $this->dict_qs[ $this->qskey ][ 'q' ] = $q;
355
+ // update sequence for this selector if this is a later instance to keep cascade priority
356
+ if ( !isset( $this->dict_seq[ $this->qskey ] ) )
357
+ $this->dict_seq[ $this->qskey ] = $this->qskey;
358
+
359
  endif;
360
+ return $this->sel_ndx[ $q ][ $s ];
 
 
 
 
 
 
 
 
361
  }
362
 
363
  /**
366
  * CTC object arrays, creating update cache in the process.
367
  * ( Update cache is returned to UI via AJAX to refresh page )
368
  * This has been refactored in v1.7.5 to accommodate multiple values per property.
369
+ * @param $template parnt or child
370
  * @param $query media query
371
  * @param $sel selector
372
  * @param $rule property (rule)
386
  $rulevalid = NULL,
387
  $reset = FALSE
388
  ) {
389
+ if ( $this->max_sel ) return;
390
+ if ( FALSE === strpos( $query, '@' ) ):
391
  $query = 'base';
392
+ endif;
393
  // normalize selector styling
394
  $sel = implode( ', ', preg_split( '#\s*,\s*#s', trim( $sel ) ) );
395
+ if ( !( $qsid = $this->get_qsid( $query, $sel ) ) ) return;
396
+
397
  // set data and value
398
  if ( $rule ):
399
  // get ids and quit if max is reached ( get_qsid handles )
400
  $ruleid = $this->get_dict_id( 'rule', $rule );
401
  $valid = $this->get_dict_id( 'val', $value );
402
+
403
  /**
404
+ * v1.7.5
405
+ * modify existing data sructure to allow multiple property values
406
  */
407
+
408
+ // create empty array if reset is TRUE
409
+ // OR IF ruleval array does not exist
410
+ if ( $reset || !isset( $this->val_ndx[ $qsid ][ $ruleid ][ $template ] )
411
+ || !is_array( $this->val_ndx[ $qsid ][ $ruleid ][ $template ] ) )
412
+ $this->val_ndx[ $qsid ][ $ruleid ][ $template ] = array();
413
+ $this->convert_ruleval_array( $this->val_ndx[ $qsid ][ $ruleid ] );
414
+ // rulevalid passed
 
 
 
 
 
 
 
 
 
 
 
415
  if ( isset( $rulevalid ) ):
416
+ $this->unset_rule_value( $this->val_ndx[ $qsid ][ $ruleid ][ $template ], $rulevalid );
417
  // value empty?
418
  if ( '' === $value ):
419
  // value exist?
420
+ elseif ( $id = $this->rule_value_exists( $this->val_ndx[ $qsid ][ $ruleid ][ $template ], $valid ) ):
421
+ $this->unset_rule_value( $this->val_ndx[ $qsid ][ $ruleid ][ $template ], $id );
422
+ $this->update_rule_value( $this->val_ndx[ $qsid ][ $ruleid ][ $template ], $rulevalid, $valid, $important );
423
  // update new value
424
  else:
425
+ $this->update_rule_value( $this->val_ndx[ $qsid ][ $ruleid ][ $template ], $rulevalid, $valid, $important );
426
  endif;
427
  // rulevalid not passed
428
  else:
429
  // value exist?
430
+ if ( $id = $this->rule_value_exists( $this->val_ndx[ $qsid ][ $ruleid ][ $template ], $valid ) ):
431
+ $this->unset_rule_value( $this->val_ndx[ $qsid ][ $ruleid ][ $template ], $id );
432
+ $this->update_rule_value( $this->val_ndx[ $qsid ][ $ruleid ][ $template ], $id, $valid, $important );
433
  // get new id and update new value
434
  else:
435
+ $id = $this->get_rule_value_id( $this->val_ndx[ $qsid ][ $ruleid ][ $template ] );
436
+ $this->update_rule_value( $this->val_ndx[ $qsid ][ $ruleid ][ $template ], $id, $valid, $important );
437
  endif;
438
  endif;
 
 
 
 
 
439
  // return query selector id
440
  return $qsid;
441
  endif;
442
  }
443
 
444
+ /*
445
  * rule_value_exists
446
  * Determine if a value already exists for a property
447
  * and return its id
455
  return FALSE;
456
  }
457
 
458
+ /*
459
  * get_rule_value_id
460
  * Generate a new rulevalid by iterating existing ids
461
  * and returning the next in sequence
467
  return $newid;
468
  }
469
 
470
+ /*
471
  * update_rule_value
472
  * Generate a new value subarray
473
  */
479
  );
480
  }
481
 
482
+ /*
483
  * unset_rule_value
484
  * Delete (splice) old value subarray from values
485
  */
487
  $index = 0;
488
  foreach ( $arr as $valarr ):
489
  if ( $id == $valarr[ 2 ] ):
490
+ //echo 'found ' . $valarr[ 2 ] . '(index ' . $index . " )\n";
491
  array_splice( $arr, $index, 1 );
492
  break;
493
  endif;
495
  endforeach;
496
  }
497
 
498
+ /*
499
  * prune_if_empty
500
  * Automatically cleans up hierarchies when no values exist
501
  * in either parent or child for a given selector.
502
  */
503
+ function prune_if_empty( $qsid ) {
504
  $empty = $this->get_dict_id( 'val', '' );
505
+ foreach ( $this->val_ndx[ $qsid ] as $ruleid => $arr ):
506
+ foreach ( array( 'child', 'parnt' ) as $template ):
507
  if ( isset( $arr[ $template ] ) ):
508
  // v1.7.5: don't prune until converted to multi value format
509
  if ( !is_array( $arr[ $template ] ) ) return FALSE;
514
  endforeach;
515
  endforeach;
516
  // no values, prune from sel index, val index and qs dict data ( keep other dictionary records )
517
+ unset( $this->sel_ndx[ $this->dict_qs[ $qsid ][ 'q' ] ][ $this->dict_qs[ $qsid ][ 's' ] ] );
518
  unset( $this->val_ndx[ $qsid ] );
519
  unset( $this->dict_qs[ $qsid ] );
520
  unset( $this->dict_seq[ $qsid ] );
 
521
  }
522
 
523
  /**
562
  * FIXME - this function has grown too monolithic - refactor and componentize
563
  */
564
  function parse_post_data() {
 
 
 
 
 
 
 
 
565
  $this->cache_updates = TRUE;
566
  if ( isset( $_POST[ 'ctc_new_selectors' ] ) ):
567
  $this->styles = $this->parse_css_input( LF . $_POST[ 'ctc_new_selectors' ] );
575
  $this->imports[ 'child' ] = array();
576
  $this->styles = $this->parse_css_input( $_POST[ 'ctc_child_imports' ] );
577
  $this->parse_css( 'child' );
 
 
 
 
 
 
 
 
 
 
 
 
578
  elseif ( isset( $_POST[ 'ctc_configtype' ] ) ):
579
  ob_start();
580
  do_action( 'chld_thm_cfg_get_stylesheets' );
601
  foreach ( preg_grep( '#^ctc_ovrd_child_seq_#', array_keys( $_POST ) ) as $post_key ):
602
  if ( preg_match( '#^ctc_ovrd_child_seq_(\d+)$#', $post_key, $matches ) ):
603
  $qsid = $matches[ 1 ];
604
+ $this->dict_seq[ $qsid ] = intval( $_POST[ $post_key ] );
 
 
 
 
 
 
605
  endif;
606
  endforeach;
607
  $parts = array();
609
  if ( preg_match( '#^ctc_(ovrd|\d+)_child_([\w\-]+?)_(\d+?)_(\d+?)(_(.+))?$#', $post_key, $matches ) ):
610
  $valid = $matches[ 1 ];
611
  $rule = $matches[ 2 ];
612
+ if ( NULL == $rule || !isset( $this->dict_rule[ $rule ] ) ) continue;
613
+ $ruleid = $this->dict_rule[ $rule ];
614
  $qsid = $matches[ 3 ];
615
  $rulevalid = $matches[ 4 ];
616
  $value = $this->normalize_color( $this->sanitize( $this->parse_css_input( $_POST[ $post_key ] ) ) );
622
  $parts[ $qsid ][ $rule ][ 'values' ][ $rulevalid ][ 'important' ] = $important;
623
  $parts[ $qsid ][ $rule ][ 'query' ] = $selarr[ 'query' ];
624
  $parts[ $qsid ][ $rule ][ 'selector' ] = $selarr[ 'selector' ];
 
625
  else:
626
  if ( $newselector && $newselector != $selarr[ 'selector' ] ):
627
  // If this is a renamed selector, add new selector to array
628
  $newqsid = $this->update_arrays(
629
+ 'child',
630
  $selarr[ 'query' ],
631
  $newselector,
632
  $rule,
634
  $important,
635
  $rulevalid
636
  );
637
+ // clear the original selector's child value:
638
  $this->update_arrays(
639
+ 'child',
640
  $selarr[ 'query' ],
641
  $selarr[ 'selector' ],
642
  $rule,
644
  0,
645
  $rulevalid
646
  );
647
+ $this->dict_seq[ $newqsid ] = $this->dict_seq[ $qsid ];
 
 
 
 
 
648
  else:
649
  // otherwise, just update with the new values:
650
  $this->update_arrays(
651
+ 'child',
652
  $selarr[ 'query' ],
653
  $selarr[ 'selector' ],
654
  $rule,
703
  else:
704
  $value = '';
705
  endif;
 
 
706
  if ( $newselector && $newselector != $rule_arr[ 'selector' ] ):
707
  // If this is a renamed selector, add new selector to array
708
  $newqsid = $this->update_arrays(
709
+ 'child',
710
  $rule_arr[ 'query' ],
711
  $newselector,
712
  $rule,
714
  $rule_part[ 'important' ],
715
  $rulevalid
716
  );
717
+ // clear the original selector's child value:
718
  $this->update_arrays(
719
+ 'child',
720
  $rule_arr[ 'query' ],
721
  $rule_arr[ 'selector' ],
722
  $rule,
727
  else:
728
  // otherwise, just update with the new values:
729
  $this->update_arrays(
730
+ 'child',
731
  $rule_arr[ 'query' ],
732
  $rule_arr[ 'selector' ],
733
  $rule,
739
  endforeach;
740
  endforeach;
741
  endforeach;
742
+ // if this is a renamed selector, update sequence dict
743
+ if ( $newqsid ):
744
+ if ( !isset( $this->dict_seq[ $newqsid ] ) )
745
+ $this->dict_seq[ $newqsid ] = $this->dict_seq[ $qsid ];
746
+ endif;
747
+ // remove if all values have been cleared
748
+ $this->prune_if_empty( $qsid );
749
+ $qsid = $newqsid ? $newqsid : $qsid;
750
  // return updated qsid to browser to update form
751
  if ( $this->ctc()->cache_updates ):
752
  $this->ctc()->updates[] = array(
759
  endif;
760
 
761
  // update enqueue function if imports have not been converted or new imports passed
762
+ if ( isset( $_POST[ 'ctc_child_imports' ] ) || empty( $this->converted ) )
763
  add_action( 'chld_thm_cfg_addl_files', array( $this->ctc(), 'enqueue_parent_css' ), 15, 2 );
764
  }
765
 
773
 
774
  // strips non printables and potential commands
775
  function sanitize( $styles ) {
776
+ return sanitize_text_field( preg_replace( '/[^[:print:]]|\{.*/', '', $styles ) );
777
  }
778
 
779
  // escapes octal values in input to allow for specific ascii strings in content rule
792
  */
793
  function parse_css_file( $template, $file = 'style.css', $cfgtemplate = FALSE ) {
794
  if ( '' == $file ) $file = 'style.css';
795
+ // have we run out of memory?
 
 
 
796
  if ( $this->max_sel ):
797
+ $this->ctc()->debug( 'Insufficient memory to parse file.', __FUNCTION__ );
798
  return FALSE;
799
  endif;
 
800
  // turn off caching when parsing files to reduce memory usage
801
  $this->ctc()->cache_updates = FALSE;
802
  $this->styles = ''; // reset styles
831
  // read stylesheet
832
 
833
  if ( $stylesheet_verified = $this->is_file_ok( $stylesheet, 'read' ) ):
834
+ // make sure we have space to parse
 
 
835
  if ( filesize( $stylesheet_verified ) * 3 > $this->ctc()->get_free_memory() ):
836
  $this->max_sel = 1;
837
+ $this->ctc()->debug( 'Insufficient memory to read file', __FUNCTION__ );
838
  return;
839
  endif;
 
840
  $this->styles .= @file_get_contents( $stylesheet_verified ) . "\n";
841
  //echo 'count after get contents: ' . strlen( $this->styles ) . LF;
842
  else:
850
  * FIXME - this function has grown too monolithic - refactor and componentize
851
  */
852
  function parse_css( $template, $basequery = NULL, $parse_imports = TRUE, $relpath = '', $reset = FALSE ) {
 
 
 
 
 
 
 
 
 
853
  if ( FALSE === strpos( $basequery, '@' ) ):
854
  $basequery = 'base';
855
  endif;
904
  foreach( $matches[ 1 ] as $sel ):
905
  $stuff = array_shift( $matches[ 2 ] );
906
  $this->update_arrays(
907
+ $template,
908
  $query,
909
  $sel
910
  );
956
  $rule = preg_replace( '#(\-(o|ms|moz|webkit)\-)?(' . implode( '|', $this->vendorrule ) . ')#', "$3", $rule );
957
  if ( 'parnt' == $template && 'background-image' == $rule && strstr( $value, 'url(' ) )
958
  $value = $this->convert_rel_url( $value, $relpath );
959
+ // by default, set semaphore true to allow multiple values
 
 
 
 
 
 
960
  if ( !$reset ) $resetrule[ $rule ] = TRUE;
961
 
962
  $qsid = $this->update_arrays(
963
+ $template,
964
  $query,
965
  $sel,
966
  $rule,
983
  );
984
  do_action( 'chld_thm_cfg_update_qsid', $qsid );
985
  endif;
 
986
  }
987
 
988
  // converts relative path to absolute path for preview
989
  function convert_rel_url( $value, $relpath, $url = TRUE ) {
 
990
  $path = preg_replace( '%url\([\'" ]*(.+?)[\'" ]*\)%', "$1", $value );
991
  if ( preg_match( '%(https?:)?//%', $path ) ) return $value;
992
  $pathparts = explode( '/', $path );
1000
  $newvalue = ( $url ? 'url(' : '' )
1001
  . ( $fileparts ? trailingslashit( implode( '/', $fileparts ) ) : '' )
1002
  . implode( '/', $newparts ) . ( $url ? ')' : '' );
1003
+ $this->ctc()->debug( 'converted ' . $value . ' to ' . $newvalue . ' with ' . $relpath, __FUNCTION__ );
1004
  return $newvalue;
1005
  }
1006
 
1012
  * New selectors are appended to the end of each media query block.
1013
  * FIXME - this function has grown too monolithic - refactor and componentize
1014
  */
1015
+ function write_css( $backup = FALSE ) {
1016
+ // write new stylesheet
1017
+ $output = apply_filters( 'chld_thm_cfg_css_header', $this->get_css_header(), $this );
1018
+ // turn the dictionaries into indexes (value => id into id => value):
1019
+ $rulearr = array_flip( $this->dict_rule );
1020
+ $valarr = array_flip( $this->dict_val );
1021
+ $selarr = array_flip( $this->dict_sel );
1022
+
1023
  foreach ( $this->sort_queries() as $query => $sort_order ):
1024
  $has_selector = 0;
1025
  $sel_output = '';
1026
+ $selectors = $this->sel_ndx[ $this->dict_query[ $query ] ];
1027
  uasort( $selectors, array( $this, 'cmp_seq' ) );
1028
  if ( 'base' != $query ) $sel_output .= $query . ' {' . LF;
1029
  foreach ( $selectors as $selid => $qsid ):
1030
+ if ( !empty( $this->val_ndx[ $qsid ] ) ):
1031
+ $sel = $selarr[ $selid ];
1032
  $shorthand = array();
1033
  $rule_output = array();
1034
+ foreach ( $this->val_ndx[ $qsid ] as $ruleid => $temparr ):
1035
  // normalize values for backward compatability
1036
+ $this->convert_ruleval_array( $temparr );
1037
+ if ( isset( $temparr[ 'child' ] ) &&
1038
+ ( !isset( $temparr[ 'parnt' ] ) || $temparr[ 'parnt' ] != $temparr[ 'child' ] ) ):
1039
+ foreach ( $temparr[ 'child' ] as $rulevalarr ):
1040
  $this->add_vendor_rules(
1041
  $rule_output,
1042
  $shorthand,
1043
+ $rulearr[ $ruleid ],
1044
+ $valarr[ $rulevalarr[ 0 ] ],
1045
  $rulevalarr[ 1 ],
1046
  $rulevalarr[ 2 ]
1047
  );
1075
  if ( 'base' != $query ) $sel_output .= '}' . LF;
1076
  if ( $has_selector ) $output .= $sel_output;
1077
  endforeach;
1078
+ $stylesheet = apply_filters( 'chld_thm_cfg_target', $this->get_child_target(), $this );
1079
+ //echo 'writing stylesheet: ' . $stylesheet . LF;
 
1080
  //echo //print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), true) . LF;
1081
  if ( $stylesheet_verified = $this->is_file_ok( $stylesheet, 'write' ) ):
1082
  global $wp_filesystem; // this was initialized earlier;
1083
+ // backup current stylesheet
1084
+ if ( $backup && is_file( $stylesheet_verified ) ):
1085
+ $timestamp = date( 'YmdHis', current_time( 'timestamp' ) );
1086
+ $bakfile = preg_replace( "/\.css$/", '', $stylesheet_verified ) . '-' . $timestamp . '.css';
1087
+ // don't write new stylesheet if backup fails
1088
+ if ( !$wp_filesystem->copy(
1089
+ $this->ctc()->fspath( $stylesheet_verified ),
1090
+ $this->ctc()->fspath( $bakfile ) ) ) return FALSE;
1091
+ endif;
1092
  // write new stylesheet:
1093
  // try direct write first, then wp_filesystem write
1094
  // stylesheet must already exist and be writable by web server
1095
  if ( $this->ctc()->is_ajax && is_writable( $stylesheet_verified ) ):
1096
  if ( FALSE === @file_put_contents( $stylesheet_verified, $output ) ):
1097
+ $this->debug( 'Ajax write failed.', __FUNCTION__ );
1098
  return FALSE;
1099
  endif;
1100
+ elseif ( FALSE === $wp_filesystem->put_contents( $this->ctc()->fspath( $stylesheet_verified ), $output ) ):
1101
+ $this->debug( 'Filesystem write failed.', __FUNCTION__ );
1102
  return FALSE;
1103
  endif;
1104
  return TRUE;
1109
  function stringify_rule_output( &$rule_output ) {
1110
  $output = '';
1111
  asort( $rule_output );
1112
+ //print_r( $rule_output );
1113
  foreach ( $rule_output as $rule => $sortstr )
1114
  $output .= ' ' . $rule . ";\n";
1115
  return $output;
1123
  * encode_shorthand
1124
  * converts CTC long syntax into CSS shorthand
1125
  * v1.7.5 refactored for multiple values per property
1126
+ * FIXME - somehow condense all these foreach loops?
1127
  */
1128
  function encode_shorthand( $shorthand, &$rule_output ) {
1129
+ //if ( $shorthand ) print_r( $shorthand );
1130
  foreach ( $shorthand as $property => $sides ):
1131
+ if ( isset( $sides[ 'top' ] ) ):
1132
  foreach ( $sides[ 'top' ] as $tval => $tarr ):
1133
+ if ( isset( $sides[ 'right' ] ) ):
1134
  $currseq = $tarr[ 1 ];
1135
  foreach ( $sides[ 'right' ] as $rval => $rarr ):
1136
  // value must exist from side and priority must match all sides
1137
+ if ( isset( $sides[ 'bottom' ] ) && $tarr[ 0 ] == $rarr[ 0 ] ):
1138
  if ( $rarr[ 1 ] > $currseq ) $currseq = $rarr[ 1 ];
1139
  foreach ( $sides[ 'bottom' ] as $bval => $barr ):
1140
+ if ( isset( $sides[ 'left' ] ) && $tarr[ 0 ] == $barr[ 0 ] ):
1141
  // use highest sort sequence of all sides
1142
  if ( $barr[ 1 ] > $currseq ) $currseq = $barr[ 1 ];
1143
  foreach ( $sides[ 'left' ] as $lval => $larr ):
1369
  */
1370
  function encode_gradient( $value ) {
1371
  // don't try this at home, kids
1372
+ $regex = '#gradient[^\)]*?\((((to )?(top|bottom|left|right)?( (top|bottom|left|right))?|\d+deg),)?([^\w\#\)]*[\'"]?(\#\w{3,8}|rgba?\([\d., ]+?\)|hsla?\([\d%., ]+?\)|[a-z]+)( [\d.]+%)?)([^\w\#\)]*[\'"]?(\#\w{3,8}|rgba?\([\d., ]+?\)|hsla?\([\d%., ]+?\)|[a-z]+)( [\d.]+%)?)([^\w\)]*gradienttype=[\'"]?(\d)[\'"]?)?[^\w\)]*\)#i';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1373
  $param = $parts = array();
1374
  preg_match( $regex, $value, $parts );
1375
+ if ( empty( $parts[ 14 ] ) ):
 
1376
  if ( empty( $parts[ 2 ] ) ):
1377
  $param[ 0 ] = 'top';
1378
  elseif ( 'to ' == $parts[ 3 ] ):
1384
  else:
1385
  $param[ 0 ] = trim( $parts[ 2 ] );
1386
  endif;
1387
+ if ( empty( $parts[ 9 ] ) ):
1388
  $param[ 2 ] = '0%';
1389
  else:
1390
+ $param[ 2 ] = trim( $parts[ 9 ] );
1391
  endif;
1392
+ if ( empty( $parts[ 12 ] ) ):
1393
  $param[ 4 ] = '100%';
1394
  else:
1395
+ $param[ 4 ] = trim( $parts[ 12 ] );
1396
  endif;
1397
+ elseif( '0' == $parts[ 14 ] ):
1398
  $param[ 0 ] = 'top';
1399
  $param[ 2 ] = '0%';
1400
  $param[ 4 ] = '100%';
1401
+ elseif ( '1' == $parts[ 14 ] ):
1402
  $param[ 0 ] = 'left';
1403
  $param[ 2 ] = '0%';
1404
  $param[ 4 ] = '100%';
1405
  endif;
1406
+ if ( isset( $parts[ 8 ] ) && isset( $parts[ 11 ] ) ):
1407
+ $param[ 1 ] = $parts[ 8 ];
1408
+ $param[ 3 ] = $parts[ 11 ];
1409
  ksort( $param );
1410
  return implode( ':', $param );
1411
  else:
1451
  /**
1452
  * denorm_rule_val
1453
  * Return array of unique values corresponding to specific rule
1454
+ * FIXME: only return child if no parent value exists
1455
  */
1456
  function denorm_rule_val( $ruleid ) {
 
 
1457
  $rule_sel_arr = array();
1458
+ $val_arr = array_flip( $this->dict_val );
1459
+ foreach ( $this->val_ndx as $qsid => $rules ):
1460
+ if ( !isset( $rules[ $ruleid ] ) ) continue;
1461
+ $this->convert_ruleval_array( $rules[ $ruleid ] );
1462
+ foreach ( array( 'parnt', 'child' ) as $template ):
1463
+ if ( isset( $rules[ $ruleid ][ $template ] ) ):
1464
+ foreach ( $rules[ $ruleid ][ $template ] as $rulevalarr ):
1465
+ $rule_sel_arr[ $rulevalarr[ 0 ] ] = $val_arr[ $rulevalarr[ 0 ] ];
1466
+ endforeach;
1467
+ endif;
1468
+ endforeach;
1469
  endforeach;
1470
  return $rule_sel_arr;
1471
  }
1474
  * denorm_val_query
1475
  * Return array of queries, selectors, rules, and values corresponding to
1476
  * specific rule/value combo grouped by query, selector
1477
+ * FIXME: only return child values corresponding to specific rulevalid of matching parent value
1478
  */
1479
  function denorm_val_query( $valid, $rule ) {
 
 
1480
  $value_query_arr = array();
1481
+ if( $thisruleid = $this->get_dict_id( 'rule', $rule ) ):
1482
+ foreach ( $this->val_ndx as $qsid => $rules ):
1483
+ foreach ( $rules as $ruleid => $values ):
1484
+ if ( $ruleid != $thisruleid ) continue;
1485
+ $this->convert_ruleval_array( $values );
1486
+ foreach ( array( 'parnt', 'child' ) as $template ):
1487
+ if ( isset( $values[ $template ] ) ):
1488
+ foreach ( $values[ $template ] as $rulevalarr ):
1489
+ if ( $rulevalarr[ 0 ] != $valid ) continue;
1490
+ $selarr = $this->denorm_query_sel( $qsid );
1491
+ $value_query_arr[ $rule ][ $selarr[ 'query' ] ][ $qsid ] = $this->denorm_sel_val( $qsid );
 
 
1492
  endforeach;
1493
+ endif;
1494
+ endforeach;
1495
  endforeach;
1496
+ endforeach;
1497
  endif;
1498
  return $value_query_arr;
1499
  }
1503
  * Return id, query and selector values of a specific qsid (query-selector ID)
1504
  */
1505
  function denorm_query_sel( $qsid ) {
1506
+ if ( !isset( $this->dict_qs[ $qsid ] ) ) return array();
1507
+ $queryarr = array_flip( $this->dict_query );
1508
+ $selarr = array_flip( $this->dict_sel );
1509
+ $this->dict_seq[ $qsid ] = isset( $this->dict_seq[ $qsid ] ) ? $this->dict_seq[ $qsid ] : $qsid;
1510
+ return array(
 
 
 
 
 
 
 
 
 
 
 
 
1511
  'id' => $qsid,
1512
+ 'query' => $queryarr[ $this->dict_qs[ $qsid ][ 'q' ] ],
1513
+ 'selector' => $selarr[ $this->dict_qs[ $qsid ][ 's' ] ],
1514
+ 'seq' => $this->dict_seq[ $qsid ],
1515
  );
 
1516
  }
1517
 
1518
  /**
1521
  * grouped by query, selector
1522
  */
1523
  function denorm_sel_val( $qsid ) {
 
 
 
1524
  $selarr = $this->denorm_query_sel( $qsid );
1525
+ $valarr = array_flip( $this->dict_val );
1526
+ $rulearr = array_flip( $this->dict_rule );
1527
+ if ( isset( $this->val_ndx[ $qsid ] ) && is_array( $this->val_ndx[ $qsid ] ) ):
1528
+ foreach ( $this->val_ndx[ $qsid ] as $ruleid => $values ):
1529
+ // convert old value to new format
1530
+ $this->convert_ruleval_array( $values );
1531
+ foreach ( array( 'parnt', 'child' ) as $template ):
1532
  if ( isset( $values[ $template ] ) ):
1533
  foreach ( $values[ $template ] as $rulevalarr ):
1534
+ $selarr[ 'value' ][ $rulearr[ $ruleid ] ][ $template ][] = array(
1535
+ $valarr[ $rulevalarr[ 0 ] ],
1536
  $rulevalarr[ 1 ],
1537
  isset( $rulevalarr[ 2 ] ) ? $rulevalarr[ 2 ] : 1,
1538
  );
1541
  endforeach;
1542
  endforeach;
1543
  endif;
 
1544
  return $selarr;
1545
  }
1546
 
1547
  /**
 
 
1548
  * convert and/or normalize rule/value index
1549
  * to support multiple values per property ( rule )
1550
  * allows backward compatility with < v1.7.5
1551
  */
1552
  function convert_ruleval_array( &$arr ) {
 
1553
  foreach ( array( 'parnt', 'child' ) as $template ):
1554
  // skip if empty array
1555
  if ( !isset( $arr[ $template ] ) ) continue;
 
1556
  // check if using original data structure ( value is scalar )
1557
  if ( ! is_array( $arr[ $template ] ) ):
1558
  /**
1562
  * [1] => important
1563
  * [2] => priority
1564
  */
1565
+ $temparr = array( array( $arr[ $template ], $arr[ 'i_' . $template ], 0, 1 ) );
1566
+ $arr[ $template ] = $temparr;
 
1567
  endif;
 
 
 
 
 
1568
  $newarr = array();
1569
  // iterate each value and enforce array structure
1570
  foreach ( $arr[ $template ] as $rulevalid => $rulevalarr ):
1572
  if ( empty ( $rulevalarr ) ) continue;
1573
  //
1574
  if ( ! is_array( $rulevalarr ) ):
1575
+ // important flag moves to individual value array
1576
  $important = isset( $arr[ 'i_' . $template ] ) ? $arr[ 'i_' . $template ] : 0;
1577
  unset( $arr[ 'i_' . $template ] );
1578
  $val = (int) $rulevalarr;
1584
  endforeach;
1585
  $arr[ $template ] = $newarr;
1586
  endforeach;
 
1587
  }
1588
 
1589
  /**
1590
+ * denorm_sel_ndx
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1591
  * Return denormalized array containing query and selector heirarchy
1592
  */
1593
+ function denorm_sel_ndx( $query = NULL ) {
1594
+ $sel_ndx_norm = array();
1595
+ $queryarr = array_flip( $this->dict_query );
1596
+ $selarr = array_flip( $this->dict_sel );
1597
+ foreach( $this->sel_ndx as $queryid => $sel ):
1598
+ foreach( $sel as $selid => $qsid ):
1599
+ $sel_ndx_norm[ $queryarr[ $queryid ] ][ $selarr[ $selid ] ] = $qsid;
 
 
 
 
 
 
 
 
1600
  endforeach;
1601
+ endforeach;
1602
+ return empty( $query ) ? array_keys( $sel_ndx_norm ) : $this->sort_selectors( $sel_ndx_norm[ $query ] );
 
 
 
 
1603
  }
1604
 
1605
  /**
1622
  * @media min-width queries in ascending order
1623
  */
1624
  function sort_queries() {
 
1625
  $queries = array();
1626
+ $queryarr = array_flip( $this->dict_query );
1627
+ foreach ( array_keys( $this->sel_ndx ) as $queryid ):
1628
+ $query = $queryarr[ $queryid ];
1629
  if ( 'base' == $query ):
1630
  $queries[ 'base' ] = -999999;
1631
  continue;
1641
  }
1642
 
1643
  function sort_selectors( $selarr ) {
1644
+ uksort( $selarr, array( $this, 'cmp_sel' ) );
1645
+ return $selarr;
 
1646
  }
1647
 
1648
  function cmp_sel( $a, $b ) {
1654
 
1655
  // sort selectors based on dict_seq if exists, otherwise qsid
1656
  function cmp_seq( $a, $b ) {
1657
+ $cmpa = isset( $this->dict_seq[ $a ] ) ? $this->dict_seq[ $a ] : $a;
1658
+ $cmpb = isset( $this->dict_seq[ $b ] ) ? $this->dict_seq[ $b ] : $b;
 
 
1659
  if ( $cmpa == $cmpb ) return 0;
1660
  return ( $cmpa < $cmpb ) ? -1 : 1;
1661
  }
1688
  /**
1689
  * is_file_ok
1690
  * verify file exists and is in valid location
 
1691
  */
1692
  function is_file_ok( $stylesheet, $permission = 'read' ) {
1693
  // remove any ../ manipulations
1694
  $stylesheet = $this->ctc()->normalize_path( preg_replace( "%\.\./%", '/', $stylesheet ) );
1695
+ $this->ctc()->debug( 'checking file: ' . $stylesheet, __FUNCTION__ );
1696
  if ( 'read' == $permission && !is_file( $stylesheet ) ):
1697
+ $this->ctc()->debug( 'read: no file!', __FUNCTION__ );
1698
  return FALSE;
1699
  elseif ( 'write' == $permission && !is_dir( dirname( $stylesheet ) ) ):
1700
+ $this->ctc()->debug( 'write: no dir!', __FUNCTION__ );
1701
  return FALSE;
1702
  elseif ( 'search' == $permission && !is_dir( $stylesheet ) ):
1703
+ $this->ctc()->debug( 'search: no dir!', __FUNCTION__ );
1704
  return FALSE;
1705
  endif;
1706
  // check if in themes dir;
1707
  $regex = '%^' . preg_quote( $this->ctc()->normalize_path( get_theme_root() ) ) . '%';
1708
+ $this->ctc()->debug( 'theme regex: ' . $regex, __FUNCTION__ );
1709
  if ( preg_match( $regex, $stylesheet ) ):
1710
+ $this->ctc()->debug( $stylesheet . ' ok!', __FUNCTION__ );
1711
  return $stylesheet;
1712
  endif;
1713
  // check if in plugins dir
1714
  $regex = '%^' . preg_quote( $this->ctc()->normalize_path( WP_PLUGIN_DIR ) ) . '%';
1715
+ $this->ctc()->debug( 'plugin regex: ' . $regex, __FUNCTION__ );
1716
  if ( preg_match( $regex, $stylesheet ) ):
1717
+ $this->ctc()->debug( $stylesheet . ' ok!', __FUNCTION__ );
1718
  return $stylesheet;
1719
  endif;
1720
+ $this->ctc()->debug( $stylesheet . ' is not in wp folders!', __FUNCTION__ );
1721
  return FALSE;
1722
  }
1723
 
1747
  function tolower( $matches ) {
1748
  return '#' . strtolower( $matches[ 1 ] );
1749
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1750
  }
includes/class-ctc-packer.php DELETED
@@ -1,398 +0,0 @@
1
- <?php
2
-
3
- /**
4
- Some portions based on msgpack.php
5
- Copyright (c) 2015-2016 Eugene Leonovich
6
- The MIT License (MIT)
7
- Some portions based on base91.php
8
- Copyright (c) 2005-2006 Joachim Henke
9
- http://base91.sourceforge.net/
10
- */
11
-
12
- class ChildThemeConfiguratorPacker {
13
-
14
- const NON_UTF8_REGEX = '/(
15
- [\xC0-\xC1] # Invalid UTF-8 Bytes
16
- | [\xF5-\xFF] # Invalid UTF-8 Bytes
17
- | \xE0[\x80-\x9F] # Overlong encoding of prior code point
18
- | \xF0[\x80-\x8F] # Overlong encoding of prior code point
19
- | [\xC2-\xDF](?![\x80-\xBF]) # Invalid UTF-8 Sequence Start
20
- | [\xE0-\xEF](?![\x80-\xBF]{2}) # Invalid UTF-8 Sequence Start
21
- | [\xF0-\xF4](?![\x80-\xBF]{3}) # Invalid UTF-8 Sequence Start
22
- | (?<=[\x0-\x7F\xF5-\xFF])[\x80-\xBF] # Invalid UTF-8 Sequence Middle
23
- | (?<![\xC2-\xDF]|[\xE0-\xEF]|[\xE0-\xEF][\x80-\xBF]|[\xF0-\xF4]|[\xF0-\xF4][\x80-\xBF]|[\xF0-\xF4][\x80-\xBF]{2})[\x80-\xBF] # Overlong Sequence
24
- | (?<=[\xE0-\xEF])[\x80-\xBF](?![\x80-\xBF]) # Short 3 byte sequence
25
- | (?<=[\xF0-\xF4])[\x80-\xBF](?![\x80-\xBF]{2}) # Short 4 byte sequence
26
- | (?<=[\xF0-\xF4][\x80-\xBF])[\x80-\xBF](?![\x80-\xBF]) # Short 4 byte sequence (2)
27
- )/x';
28
- var $enctab = array(
29
- 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
30
- 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
31
- 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
32
- 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
33
- '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!', '#', '$',
34
- '%', '&', '(', ')', '*', '+', ',', '.', '/', ':', ';', '<', '=',
35
- '>', '?', '@', '[', ']', '^', '_', '`', '{', '|', '}', '~', '"'
36
- );
37
- var $dectab;
38
- var $buffer;
39
- var $offset;
40
-
41
- function __construct(){
42
- $this->dectab = array_flip( $this->enctab );
43
- }
44
-
45
- function reset( $buffer = '' ){
46
- $this->buffer = $buffer;
47
- $this->offset = 0;
48
- }
49
-
50
- public function pack( $value ) {
51
-
52
- switch ( gettype( $value ) ) {
53
- case 'array': return array_values( $value ) === $value
54
- ? $this->packArray( $value )
55
- : $this->packMap( $value );
56
-
57
- case 'string': return preg_match( self::NON_UTF8_REGEX, $value )
58
- ? $this->packBin( $value )
59
- : $this->packStr( $value );
60
-
61
- case 'integer': return $this->packInt( $value );
62
- case 'NULL': return $this->packNil();
63
- case 'boolean': return $this->packBool( $value );
64
- }
65
-
66
- throw new PackingFailedException( $value, 'Unsupported type.' );
67
- }
68
-
69
- public function packNil() {
70
-
71
- return "\xc0";
72
- }
73
-
74
- public function packBool( $val ) {
75
-
76
- return $val ? "\xc3" : "\xc2";
77
- }
78
-
79
- public function packArray( array $array ) {
80
-
81
- $size = count( $array );
82
- $data = self::packArrayHeader( $size );
83
-
84
- foreach ( $array as $val ) {
85
- $data .= $this->pack( $val );
86
- }
87
-
88
- return $data;
89
- }
90
-
91
- private static function packArrayHeader( $size ) {
92
-
93
- if ( $size <= 0xf ) {
94
- return chr( 0x90 | $size );
95
- }
96
- if ( $size <= 0xffff ) {
97
- return pack( 'Cn', 0xdc, $size );
98
- }
99
-
100
- return pack( 'CN', 0xdd, $size );
101
- }
102
-
103
- public function packMap( array $map ) {
104
-
105
- $size = count( $map );
106
- $data = self::packMapHeader( $size );
107
-
108
- foreach ( $map as $key => $val ) {
109
- $data .= $this->pack( $key );
110
- $data .= $this->pack( $val );
111
- }
112
-
113
- return $data;
114
- }
115
-
116
- private static function packMapHeader( $size ) {
117
-
118
- if ( $size <= 0xf ) {
119
- return chr( 0x80 | $size );
120
- }
121
- if ( $size <= 0xffff ) {
122
- return pack( 'Cn', 0xde, $size );
123
- }
124
-
125
- return pack( 'CN', 0xdf, $size );
126
- }
127
-
128
- public function packStr( $str ) {
129
-
130
- $len = strlen( $str );
131
-
132
- if ( $len < 32 ) {
133
- return chr( 0xa0 | $len ) . $str;
134
- }
135
- if ( $len <= 0xff ) {
136
- return pack( 'CC', 0xd9, $len ) . $str;
137
- }
138
- if ( $len <= 0xffff ) {
139
- return pack( 'Cn', 0xda, $len ) . $str;
140
- }
141
-
142
- return pack( 'CN', 0xdb, $len ) . $str;
143
- }
144
-
145
- public function packBin( $str ) {
146
-
147
- $len = strlen( $str );
148
-
149
- if ( $len <= 0xff ) {
150
- return pack( 'CC', 0xc4, $len ) . $str;
151
- }
152
- if ( $len <= 0xffff ) {
153
- return pack( 'Cn', 0xc5, $len ) . $str;
154
- }
155
-
156
- return pack( 'CN', 0xc6, $len ) . $str;
157
- }
158
-
159
- public function packInt( $num ) {
160
-
161
- if ( $num >= 0 ) {
162
- if ( $num <= 0x7f ) {
163
- return chr( $num );
164
- }
165
- if ( $num <= 0xff ) {
166
- return pack( 'CC', 0xcc, $num );
167
- }
168
- if ( $num <= 0xffff ) {
169
- return pack( 'Cn', 0xcd, $num );
170
- }
171
- if ( $num <= 0xffffffff ) {
172
- return pack( 'CN', 0xce, $num );
173
- }
174
-
175
- }
176
- // no negative integers allowed
177
- throw new PackingFailedException( $value, 'Unsupported type.' );
178
- }
179
-
180
- function unpack() {
181
-
182
- $this->ensureLength( 1 );
183
-
184
- $c = ord( $this->buffer[ $this->offset ] );
185
- ++$this->offset;
186
-
187
- // fixint
188
- if ( $c <= 0x7f ) {
189
- return $c;
190
- }
191
- // fixstr
192
- if ( $c >= 0xa0 && $c <= 0xbf ) {
193
- return $this->unpackStr( $c & 0x1f );
194
- }
195
- // fixarray
196
- if ( $c >= 0x90 && $c <= 0x9f ) {
197
- return $this->unpackArray( $c & 0xf );
198
- }
199
- // fixmap
200
- if ( $c >= 0x80 && $c <= 0x8f ) {
201
- return $this->unpackMap( $c & 0xf );
202
- }
203
- switch ( $c ) {
204
- case 0xc0: return null;
205
- case 0xc2: return false;
206
- case 0xc3: return true;
207
-
208
- // MP_BIN
209
- case 0xc4: return $this->unpackStr( $this->unpackU8() );
210
- case 0xc5: return $this->unpackStr( $this->unpackU16() );
211
- case 0xc6: return $this->unpackStr( $this->unpackU32() );
212
-
213
- // MP_UINT
214
- case 0xcc: return $this->unpackU8();
215
- case 0xcd: return $this->unpackU16();
216
- case 0xce: return $this->unpackU32();
217
-
218
- // MP_STR
219
- case 0xd9: return $this->unpackStr( $this->unpackU8() );
220
- case 0xda: return $this->unpackStr( $this->unpackU16() );
221
- case 0xdb: return $this->unpackStr( $this->unpackU32() );
222
-
223
- // MP_ARRAY
224
- case 0xdc: return $this->unpackArray( $this->unpackU16() );
225
- case 0xdd: return $this->unpackArray( $this->unpackU32() );
226
-
227
- // MP_MAP
228
- case 0xde: return $this->unpackMap( $this->unpackU16() );
229
- case 0xdf: return $this->unpackMap( $this->unpackU32() );
230
-
231
- }
232
-
233
- throw new UnpackingFailedException( sprintf( 'Unknown code: 0x%x.', $c ) );
234
- }
235
-
236
- private function unpackU8() {
237
-
238
- $this->ensureLength( 1 );
239
-
240
- $num = $this->buffer[ $this->offset ];
241
- ++$this->offset;
242
-
243
- return ord( $num );
244
- }
245
-
246
- private function unpackU16() {
247
-
248
- $this->ensureLength( 2 );
249
-
250
- $hi = ord( $this->buffer[ $this->offset ] );
251
- $lo = ord( $this->buffer[ $this->offset + 1 ] );
252
- $this->offset += 2;
253
-
254
- return $hi << 8 | $lo;
255
- }
256
-
257
- private function unpackU32() {
258
-
259
- $this->ensureLength( 4 );
260
-
261
- $num = substr( $this->buffer, $this->offset, 4 );
262
- $this->offset += 4;
263
-
264
- $num = unpack( 'N', $num );
265
-
266
- return $num[ 1 ];
267
- }
268
-
269
- private function unpackStr( $length ) {
270
-
271
- if ( !$length ) {
272
- return '';
273
- }
274
-
275
- $this->ensureLength( $length );
276
-
277
- $str = substr( $this->buffer, $this->offset, $length );
278
- $this->offset += $length;
279
-
280
- return $str;
281
- }
282
-
283
- private function unpackArray( $size ) {
284
-
285
- $array = array();
286
- for ( $i = $size; $i; --$i ) {
287
- $array[] = $this->unpack();
288
- }
289
-
290
- return $array;
291
- }
292
-
293
- private function unpackMap( $size ) {
294
-
295
- $map = array();
296
- for ( $i = $size; $i; --$i ) {
297
- $map[ $this->unpack() ] = $this->unpack();
298
- }
299
-
300
- return $map;
301
- }
302
-
303
- private function ensureLength( $length ) {
304
-
305
- if ( !isset( $this->buffer[ $this->offset + $length - 1 ] ) ) {
306
- throw new InsufficientDataException( $length, strlen( $this->buffer ) - $this->offset );
307
- }
308
- }
309
-
310
-
311
- public function decode( $d )
312
- {
313
- $l = strlen( $d );
314
- $v = -1;
315
- $n = 0;
316
- $o = '';
317
- $b = 0;
318
- for ( $i = 0; $i < $l; ++$i ):
319
- $c = $this->dectab[ $d{ $i } ];
320
- if ( !isset( $c ) )
321
- continue;
322
- if ( $v < 0 ):
323
- $v = $c;
324
- else:
325
- $v += $c * 91;
326
- $b |= $v << $n;
327
- $n += ( $v & 8191 ) > 88 ? 13 : 14;
328
- do {
329
- $o .= chr( $b & 255 );
330
- $b >>= 8;
331
- $n -= 8;
332
- } while ( $n > 7 );
333
- $v = -1;
334
- endif;
335
- endfor;
336
- if ( $v + 1 )
337
- $o .= chr( ( $b | $v << $n ) & 255 );
338
- return $o;
339
- }
340
-
341
- public function encode( $d )
342
- {
343
- $l = strlen( $d );
344
- $n = 0;
345
- $o = '';
346
- $b = 0;
347
- for ( $i = 0; $i < $l; ++$i ):
348
- $b |= ord( $d{ $i } ) << $n;
349
- $n += 8;
350
- if ( $n > 13 ):
351
- $v = $b & 8191;
352
- if ( $v > 88 ):
353
- $b >>= 13;
354
- $n -= 13;
355
- else:
356
- $v = $b & 16383;
357
- $b >>= 14;
358
- $n -= 14;
359
- endif;
360
- $o .= $this->enctab[ $v % 91 ] . $this->enctab[ $v / 91 ];
361
- endif;
362
- endfor;
363
- if ( $n ):
364
- $o .= $this->enctab[ $b % 91 ];
365
- if ( $n > 7 || $b > 90 )
366
- $o .= $this->enctab[ $b / 91 ];
367
- endif;
368
- return $o;
369
- }
370
- }
371
-
372
- class PackingFailedException extends RuntimeException {
373
-
374
- private $value;
375
-
376
- public function __construct( $value, $message = null, $code = null, Exception $previous = null ){
377
- parent::__construct( $message, $code, $previous );
378
-
379
- $this->value = $value;
380
- }
381
-
382
- public function getValue(){
383
- return $this->value;
384
- }
385
- }
386
-
387
- class UnpackingFailedException extends RuntimeException {
388
-
389
- }
390
-
391
- class InsufficientDataException extends UnpackingFailedException {
392
-
393
- public function __construct( $expectedLength, $actualLength, $code = null, Exception $previous = null ){
394
- $message = sprintf( 'Not enough data to unpack: need %d, have %d.', $expectedLength, $actualLength );
395
- parent::__construct( $message, $code, $previous );
396
- }
397
- }
398
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-ctc-preview.php CHANGED
@@ -2,154 +2,71 @@
2
  // Exit if accessed directly
3
  if ( !defined( 'ABSPATH' ) ) exit;
4
 
5
- error_reporting( E_ALL );
6
- ini_set( 'display_errors', 1 );
7
-
8
- /**
9
- * Provides methods required for preview to work without customizer options.
10
- * This only loads when CTC preview is loaded.
11
- */
12
- class ChildThemeConfiguratorPreview {
13
- protected $theme;
14
- protected $original_stylesheet;
15
- protected $stylesheet;
16
- protected $template;
17
-
18
- public function __construct(){
19
-
20
- add_action( 'setup_theme', array( $this, 'setup_theme' ) );
21
- add_filter( 'wp_redirect_status', array( $this, 'wp_redirect_status' ), 1000 );
22
-
23
- // Do not spawn cron (especially the alternate cron) while running the Customizer.
24
- remove_action( 'init', 'wp_cron' );
25
-
26
- // Do not run update checks when rendering the controls.
27
- remove_action( 'admin_init', '_maybe_update_core' );
28
- remove_action( 'admin_init', '_maybe_update_plugins' );
29
- remove_action( 'admin_init', '_maybe_update_themes' );
30
- }
31
-
32
- public function setup_theme() {
33
- // are we previewing?
34
- if ( !wp_verify_nonce( $_GET['preview_ctc'] ) || !current_user_can( 'switch_themes' ) )
35
- return;
36
- $this->original_stylesheet = get_stylesheet();
37
- $this->theme = wp_get_theme( isset( $_GET[ 'stylesheet' ] ) ? $_GET[ 'stylesheet' ] : NULL );
38
- if ( ! $this->is_theme_active() ):
39
- add_filter( 'template', array( $this, 'get_template' ) );
40
- add_filter( 'stylesheet', array( $this, 'get_stylesheet' ) );
41
- // swap out theme mods with preview theme mods
42
- add_filter( 'pre_option_theme_mods_' . $this->original_stylesheet, array( $this, 'preview_mods' ) );
43
- endif;
44
-
45
- // impossibly high priority to test for stylesheets loaded after wp_head()
46
- add_action( 'wp_print_styles', array( $this, 'test_css' ), 999999 );
47
- // pass the wp_styles queue back to use for stylesheet handle verification
48
- add_action( 'wp_footer', array( $this, 'parse_stylesheet' ) );
49
- send_origin_headers();
50
- // hide admin bar in preview
51
- show_admin_bar( false );
52
- }
53
-
54
- /**
55
- * Retrieves child theme mods for preview
56
- */
57
- public function preview_mods() {
58
- if ( $this->is_theme_active() ) return false;
59
- return get_option( 'theme_mods_' . $this->get_stylesheet() );
60
- }
61
-
62
- public function parse_stylesheet() {
63
- echo '<script>/*<![CDATA[' . LF;
64
- global $wp_styles, $wp_filter;
65
- $queue = implode( "\n", $wp_styles->queue );
66
- echo 'BEGIN WP QUEUE' . LF . $queue . LF . 'END WP QUEUE' . LF;
67
- if ( is_child_theme() ):
68
- // check for signals that indicate specific settings
69
- $file = get_stylesheet_directory() . '/style.css';
70
- if ( file_exists( $file ) && ( $styles = @file_get_contents( $file ) ) ):
71
- // is this child theme a standalone ( framework ) theme?
72
- if ( defined( 'CHLD_THM_CFG_IGNORE_PARENT' ) ):
73
- echo 'CHLD_THM_CFG_IGNORE_PARENT' . LF;
74
- endif;
75
- // has this child theme been configured by CTC? ( If it has the timestamp, it is one of ours. )
76
- if ( preg_match( '#\nUpdated: \d\d\d\d\-\d\d\-\d\d \d\d:\d\d:\d\d\n#s', $styles ) ):
77
- echo 'IS_CTC_THEME' . LF;
78
- endif;
79
- // is this child theme using the @import method?
80
- if ( preg_match( '#\@import\s+url\(.+?\/' . preg_quote( get_template() ) . '\/style\.css.*?\);#s', $styles ) ):
81
- echo 'HAS_CTC_IMPORT' . LF;
82
- endif;
83
- endif;
84
- else:
85
- // Check if the parent style.css file is used at all. If not we can skip the parent stylesheet handling altogether.
86
- $file = get_template_directory() . '/style.css';
87
- if ( file_exists( $file ) && ( $styles = @file_get_contents( $file ) ) ):
88
- $styles = preg_replace( '#\/\*.*?\*\/#s', '', $styles );
89
- if ( !preg_match( '#\s*([\[\.\#\:\w][\w\-\s\(\)\[\]\'\^\*\.\#\+:,"=>]+?)\s*\{(.*?)\}#s', $styles ) ):
90
- echo 'NO_CTC_STYLES' . LF;
91
- endif;
92
- endif;
93
- endif;
94
  /**
95
- * Use the filter api to determine the parent stylesheet enqueue priority
96
- * because some themes do not use the standard 10 for various reasons.
97
- * We need to match this priority so that the stylesheets load in the correct order.
98
  */
99
- echo 'BEGIN CTC IRREGULAR' . LF;
100
- // Iterate through all the added hook priorities
101
- foreach ( $wp_filter[ 'wp_enqueue_scripts' ] as $priority => $arr ):
102
- // If this is a non-standard priority hook, determine which handles are being enqueued.
103
- // These will then be compared to the primary handle ( style.css )
104
- // to determine the enqueue priority to use for the parent stylesheet.
105
- if ( $priority != 10 ):
106
- // iterate through each hook in this priority group
107
- foreach ( $arr as $funcarr ):
108
- // clear the queue
109
- $wp_styles->queue = array();
110
- // now call the hooked function to populate the queue
111
- if ( !is_null($funcarr['function']) )
112
- call_user_func_array( $funcarr[ 'function' ], array() );
113
- endforeach;
114
- // report the priority, and any handles that were added
115
- if ( !empty( $wp_styles->queue ) )
116
- echo $priority . ',' . implode( ",", $wp_styles->queue ) . LF;
 
 
 
 
 
 
 
 
117
  endif;
118
- endforeach;
119
- echo 'END CTC IRREGULAR' . LF;
120
- echo ']]>*/</script>' . LF;
121
- }
122
-
123
- // enqueue dummy stylesheet with extremely high priority to test wp_head()
124
- public function test_css() {
125
- wp_enqueue_style( 'ctc-test', get_stylesheet_directory_uri() . '/ctc-test.css' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  }
127
 
128
- public function woocommerce_unforce_ssl_checkout( $bool ){
129
- return FALSE;
130
- }
131
 
132
- public function wp_redirect_status( $status ) {
133
- return 200;
134
- }
135
-
136
- public function is_theme_active() {
137
- return $this->get_stylesheet() == $this->original_stylesheet;
138
- }
139
-
140
- public function get_template() {
141
- return $this->theme()->get_template();
142
- }
143
-
144
- public function get_stylesheet() {
145
- return $this->theme()->get_stylesheet();
146
- }
147
-
148
-
149
- public function theme() {
150
- return $this->theme;
151
- }
152
-
153
- }
154
-
155
- new ChildThemeConfiguratorPreview();
2
  // Exit if accessed directly
3
  if ( !defined( 'ABSPATH' ) ) exit;
4
 
5
+ class ChildThemeConfiguratorPreview {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  /**
7
+ * Replaces core function to start preview theme output buffer.
 
 
8
  */
9
+ static function preview_theme() {
10
+ // are we previewing?
11
+ if ( ! isset( $_GET[ 'template' ] ) || !wp_verify_nonce( $_GET['preview_ctc'] ) )
12
+ return;
13
+ // can user preview?
14
+ if ( !current_user_can( 'switch_themes' ) )
15
+ return;
16
+ // hide admin bar in preview
17
+ if ( isset( $_GET[ 'preview_iframe' ] ) )
18
+ show_admin_bar( false );
19
+ // sanitize template param
20
+ $_GET[ 'template' ] = preg_replace( '|[^a-z0-9_./-]|i', '', $_GET[ 'template' ] );
21
+ // check for manipulations
22
+ if ( validate_file( $_GET[ 'template' ] ) )
23
+ return;
24
+ // replace future get_template calls with preview template
25
+ add_filter( 'template', 'ChildThemeConfiguratorPreview::preview_theme_template_filter' );
26
+
27
+ if ( isset( $_GET[ 'stylesheet' ] ) ):
28
+ // sanitize stylesheet param
29
+ $_GET['stylesheet'] = preg_replace( '|[^a-z0-9_./-]|i', '', $_GET['stylesheet'] );
30
+ // check for manipulations
31
+ if ( validate_file( $_GET['stylesheet'] ) )
32
+ return;
33
+ // replace future get_stylesheet calls with preview stylesheet
34
+ add_filter( 'stylesheet', 'ChildThemeConfiguratorPreview::preview_theme_stylesheet_filter' );
35
  endif;
36
+ // swap out theme mods with preview theme mods
37
+ add_filter( 'pre_option_theme_mods_' . get_option( 'stylesheet' ),
38
+ 'ChildThemeConfiguratorPreview::preview_mods' );
39
+ }
40
+
41
+ /**
42
+ * Retrieves child theme mods for preview
43
+ */
44
+ static function preview_mods() {
45
+ if ( ! isset( $_GET[ 'stylesheet' ] ) || get_option( 'stylesheet' ) == $_GET[ 'stylesheet' ] ) return false;
46
+ return get_option( 'theme_mods_' . preg_replace('|[^a-z0-9_./-]|i', '', $_GET['stylesheet']) );
47
+ }
48
+
49
+ /**
50
+ * Function to modify the current template when previewing a theme
51
+ *
52
+ * @return string
53
+ */
54
+ static function preview_theme_template_filter() {
55
+ return ( isset($_GET['template']) && current_user_can( 'switch_themes' ) ) ? $_GET['template'] : '';
56
+ }
57
+
58
+ /**
59
+ * Function to modify the current stylesheet when previewing a theme
60
+ *
61
+ * @return string
62
+ */
63
+ static function preview_theme_stylesheet_filter() {
64
+ return ( isset( $_GET['stylesheet'] ) && current_user_can( 'switch_themes' ) ) ? $_GET['stylesheet'] : '';
65
+ }
66
  }
67
 
68
+ // replace core preview function with CTCP function for quick preview
69
+ remove_action( 'setup_theme', 'preview_theme' );
70
+ add_action( 'setup_theme', 'ChildThemeConfiguratorPreview::preview_theme' );
71
 
72
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-ctc-ui.php CHANGED
@@ -2,121 +2,117 @@
2
  // Exit if accessed directly
3
  if ( !defined( 'ABSPATH' ) ) exit;
4
  /*
5
- Class: ChildThemeConfiguratorUI
6
  Plugin URI: http://www.childthemeconfigurator.com/
7
  Description: Handles the plugin User Interface
8
- Version: 2.1.2
9
  Author: Lilaea Media
10
  Author URI: http://www.lilaeamedia.com/
11
  Text Domain: chld_thm_cfg
12
  Domain Path: /lang
13
  License: GPLv2
14
- Copyright (C) 2014-2016 Lilaea Media
15
  */
16
  class ChildThemeConfiguratorUI {
17
 
18
  var $warnings = array();
19
- var $swatch_txt;
20
- var $colors;
21
-
22
- function __construct() {
23
- // always load dict_sel for UI
24
- $this->css()->load_config( 'dict_sel' );
25
- add_filter( 'chld_thm_cfg_files_tab_filter', array( $this, 'render_files_tab_options' ) );
26
- add_action( 'chld_thm_cfg_tabs', array( $this, 'render_addl_tabs' ), 10, 4 );
27
- add_action( 'chld_thm_cfg_panels', array( $this, 'render_addl_panels' ), 10, 4 );
28
- add_action( 'chld_thm_cfg_related_links', array( $this, 'render_lilaea_plug' ) );
29
- add_action( 'chld_thm_cfg_before_tabs', array( $this, 'render_current_theme' ), 5 );
30
- add_action( 'chld_thm_cfg_before_tabs', array( $this, 'render_debug_toggle' ), 100 );
31
- add_action( 'chld_thm_cfg_file_form_buttons', array( $this, 'render_file_form_buttons' ), 10, 1 );
32
- add_action( 'admin_notices', array( $this, 'get_colors' ) );
33
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ), 99 );
34
- add_filter( 'chld_thm_cfg_localize_array', array( $this, 'filter_localize_array' ) );
35
- $this->swatch_txt = __( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'child-theme-configurator' );
36
- }
37
-
38
  // helper function to globalize ctc object
39
  function ctc() {
40
  return ChildThemeConfigurator::ctc();
41
  }
42
-
43
- function css() {
44
- return ChildThemeConfigurator::ctc()->css;
45
- }
46
-
47
  function render() {
48
- // load web fonts for this theme
49
- if ( $imports = $this->css()->get_prop( 'imports' ) ):
50
- $ext = 0;
51
- foreach ( $imports as $import ):
52
- $this->ctc()->convert_import_to_enqueue( $import, ++$ext, TRUE );
53
- endforeach;
54
- endif;
55
  $themes = $this->ctc()->themes;
56
- $child = $this->css()->get_prop( 'child' );
57
- $hidechild = apply_filters( 'chld_thm_cfg_hidechild', ( count( $themes[ 'child' ] ) ? '' : 'style="display:none"' ) );
58
- $enqueueset = ( isset( $this->css()->enqueue ) && $child );
59
- $this->ctc()->debug( 'Enqueue set: ' . ( $enqueueset ? 'TRUE' : 'FALSE' ), __FUNCTION__, __CLASS__ );
60
- $imports = $this->css()->get_prop( 'imports' );
 
61
  $id = 0;
62
  $this->ctc()->fs_method = get_filesystem_method();
63
  add_thickbox();
 
 
 
 
 
 
 
 
64
  include ( CHLD_THM_CFG_DIR . '/includes/forms/main.php' );
65
  }
66
 
67
- function get_colors(){
68
- global $_wp_admin_css_colors;
69
- $user_admin_color = get_user_meta( get_current_user_id(), 'admin_color', TRUE );
70
- $this->colors = $_wp_admin_css_colors[ $user_admin_color ]->colors;
71
- }
72
-
73
- function render_current_theme(){
74
- include ( CHLD_THM_CFG_DIR . '/includes/forms/current-theme.php' );
75
- }
76
-
77
- function render_debug_toggle(){
78
- include ( CHLD_THM_CFG_DIR . '/includes/forms/debug-toggle.php' );
79
- }
80
-
81
- function render_file_form_buttons( $template ){
82
- include ( CHLD_THM_CFG_DIR . '/includes/forms/file-form-buttons.php' );
 
 
 
 
 
 
 
83
  }
84
-
85
  function render_theme_menu( $template = 'child', $selected = NULL ) {
86
- include ( CHLD_THM_CFG_DIR . '/includes/forms/theme-menu.php' );
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  }
88
-
89
  function render_file_form( $template = 'parnt' ) {
90
  global $wp_filesystem;
91
  if ( $theme = $this->ctc()->css->get_prop( $template ) ):
92
  $themeroot = trailingslashit( get_theme_root() ) . trailingslashit( $theme );
93
- $files = $this->ctc()->get_files( $theme, 'child' == $template ? 'template,stylesheet,txt' : 'template' );
94
- // This include is used for both parent template section and the child files section
95
- $ctcpage = apply_filters( 'chld_thm_cfg_admin_page', CHLD_THM_CFG_MENU );
96
-
97
- if ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT ):
98
- $linktext = __( 'The Theme editor has been disabled. Template files must be edited offline.', 'child-theme-configurator' );
99
- $editorbase = '';
100
- $editorlink = '';
101
- else:
102
- $linktext = __( 'Click here to edit template files using the Theme Editor', 'child-theme-configurator' );
103
- $editorbase = apply_filters( 'chld_thm_cfg_editor_base', ( is_multisite() ? network_admin_url( 'theme-editor.php' ) : admin_url( 'theme-editor.php' ) ) . '?' ) . 'theme=' . $this->ctc()->css->get_prop( 'child' );
104
- $editorlink = '<a href="' . $editorbase . '&file=%s" title="%s">%s</a>';
105
- endif;
106
  $counter = 0;
107
  sort( $files );
108
  ob_start();
109
  foreach ( $files as $file ):
110
- $templatefile = $file; //preg_replace( '%\.php$%', '', $file );
 
 
 
111
  include ( CHLD_THM_CFG_DIR . '/includes/forms/file.php' );
112
  endforeach;
 
 
 
 
 
 
113
  $inputs = ob_get_contents();
114
  ob_end_clean();
115
  if ( $counter ):
116
  include ( CHLD_THM_CFG_DIR . '/includes/forms/fileform.php' );
117
  endif;
118
- else:
119
- echo $template . ' theme not set.';
120
  endif;
121
  }
122
 
@@ -139,14 +135,54 @@ class ChildThemeConfiguratorUI {
139
  endif;
140
  }
141
 
142
- function render_settings_errors() {
143
- include ( CHLD_THM_CFG_DIR . '/includes/forms/settings-errors.php' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  }
145
 
146
  function render_help_content() {
147
- global $wp_version;
148
- if ( version_compare( $wp_version, '3.3' ) >= 0 ):
149
- $screen = get_current_screen();
 
150
 
151
  // load help content via output buffer so we can use plain html for updates
152
  // then use regex to parse for help tab parameter values
@@ -165,37 +201,36 @@ class ChildThemeConfiguratorUI {
165
  preg_match( $regex_sidebar, $help_raw, $sidebar );
166
  preg_match_all( $regex_tab, $help_raw, $tabs );
167
 
168
- // Add help tabs
169
  if ( isset( $tabs[ 1 ] ) ):
170
- $priority = 0;
171
  while( count( $tabs[ 1 ] ) ):
172
  $id = array_shift( $tabs[ 1 ] );
173
  $title = array_shift( $tabs[ 2 ] );
174
  $content = array_shift( $tabs[ 3 ] );
175
- $tab = array(
176
- 'id' => $id,
177
- 'title' => $title,
178
- 'content' => $content,
179
- 'priority' => ++$priority,
180
- );
181
- $screen->add_help_tab( $tab );
182
  endwhile;
183
  endif;
184
  if ( isset( $sidebar[ 1 ] ) )
185
  $screen->set_help_sidebar( $sidebar[ 1 ] );
186
- //die( print_r( $screen, TRUE ) );
187
- endif;
188
  }
189
 
190
- function render_addl_tabs( $active_tab = NULL, $hidechild = '' ) {
191
  include ( CHLD_THM_CFG_DIR . '/includes/forms/addl_tabs.php' );
192
  }
193
 
194
- function render_addl_panels( $active_tab = NULL, $hidechild = '' ) {
195
  include ( CHLD_THM_CFG_DIR . '/includes/forms/addl_panels.php' );
196
  }
197
 
198
- function render_lilaea_plug() {
199
  include ( CHLD_THM_CFG_DIR . '/includes/forms/related.php' );
200
  }
201
 
@@ -204,140 +239,5 @@ class ChildThemeConfiguratorUI {
204
  $output = preg_replace( $regex, "$1", $output );
205
  return $output;
206
  }
207
-
208
- function render_notices( $msg ) {
209
- include ( CHLD_THM_CFG_DIR . '/includes/forms/notices.php' );
210
- }
211
-
212
- function get_theme_screenshot() {
213
-
214
- foreach ( array_keys( $this->ctc()->imgmimes ) as $extreg ):
215
- foreach ( explode( '|', $extreg ) as $ext ):
216
- if ( $screenshot = $this->ctc()->css->is_file_ok( $this->ctc()->css->get_child_target( 'screenshot.' . $ext ) ) ):
217
- $screenshot = trailingslashit( get_theme_root_uri() ) . $this->ctc()->theme_basename( '', $screenshot );
218
- return $screenshot . '?' . time();
219
- endif;
220
- endforeach;
221
- endforeach;
222
- return FALSE;
223
- }
224
-
225
- function cmp_theme( $a, $b ) {
226
- return strcmp( strtolower( $a[ 'Name' ] ), strtolower( $b[ 'Name' ] ) );
227
- }
228
-
229
- function enqueue_scripts() {
230
- wp_enqueue_style( 'chld-thm-cfg-admin', CHLD_THM_CFG_URL . 'css/chldthmcfg.css', array(), CHLD_THM_CFG_VERSION );
231
-
232
- // we need to use local jQuery UI Widget/Menu/Selectmenu 1.11.2 because selectmenu is not included in < 1.11.2
233
- // this will be updated in a later release to use WP Core scripts when it is widely adopted
234
-
235
- if ( !wp_script_is( 'jquery-ui-selectmenu', 'registered' ) ): // selectmenu.min.js
236
- wp_enqueue_script( 'jquery-ui-selectmenu', CHLD_THM_CFG_URL . 'js/selectmenu.min.js',
237
- array( 'jquery','jquery-ui-core','jquery-ui-position' ), FALSE, TRUE );
238
- endif;
239
-
240
- wp_enqueue_script( 'chld-thm-cfg-spectrum', CHLD_THM_CFG_URL . 'js/spectrum.min.js', array( 'jquery' ), FALSE, TRUE );
241
- wp_enqueue_script( 'chld-thm-cfg-ctcgrad', CHLD_THM_CFG_URL . 'js/ctcgrad.min.js', array( 'jquery' ), FALSE, TRUE );
242
- wp_enqueue_script( 'chld-thm-cfg-admin', CHLD_THM_CFG_URL . 'js/chldthmcfg' . ( $this->ctc()->is_debug ? '' : '.min' ) . '.js',
243
- //wp_enqueue_script( 'chld-thm-cfg-admin', CHLD_THM_CFG_URL . 'js/chldthmcfg.js',
244
- array(
245
- 'jquery-ui-autocomplete',
246
- 'jquery-ui-selectmenu',
247
- 'chld-thm-cfg-spectrum',
248
- 'chld-thm-cfg-ctcgrad'
249
- ), FALSE, TRUE );
250
-
251
- $localize_array = apply_filters( 'chld_thm_cfg_localize_script', array(
252
- 'converted' => $this->css()->get_prop( 'converted' ),
253
- 'ssl' => is_ssl(),
254
- 'homeurl' => get_home_url() . '?preview_ctc=' . wp_create_nonce(),
255
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
256
- 'theme_uri' => get_theme_root_uri(),
257
- 'page' => CHLD_THM_CFG_MENU,
258
- 'themes' => $this->ctc()->themes,
259
- 'source' => apply_filters( 'chld_thm_cfg_source_uri', get_theme_root_uri() . '/'
260
- . $this->css()->get_prop( 'parnt' ) . '/style.css', $this->css() ),
261
- 'target' => apply_filters( 'chld_thm_cfg_target_uri', get_theme_root_uri() . '/'
262
- . $this->css()->get_prop( 'child' ) . '/style.css', $this->css() ),
263
- 'parnt' => $this->css()->get_prop( 'parnt' ),
264
- 'child' => $this->css()->get_prop( 'child' ),
265
- 'addl_css' => $this->css()->get_prop( 'addl_css' ),
266
- 'imports' => $this->css()->get_prop( 'imports' ),
267
- 'converted' => $this->css()->get_prop( 'converted' ),
268
- 'is_debug' => $this->ctc()->is_debug,
269
- '_background_url_txt' => __( 'URL/None', 'child-theme-configurator' ),
270
- '_background_origin_txt' => __( 'Origin', 'child-theme-configurator' ),
271
- '_background_color1_txt' => __( 'Color 1', 'child-theme-configurator' ),
272
- '_background_color2_txt' => __( 'Color 2', 'child-theme-configurator' ),
273
- '_border_width_txt' => __( 'Width/None', 'child-theme-configurator' ),
274
- '_border_style_txt' => __( 'Style', 'child-theme-configurator' ),
275
- '_border_color_txt' => __( 'Color', 'child-theme-configurator' ),
276
- 'swatch_txt' => $this->swatch_txt,
277
- 'load_txt' => __( 'Are you sure you wish to RESET? This will destroy any work you have done in the Configurator.', 'child-theme-configurator' ),
278
- 'important_txt' => __( '<span style="font-size:10px">!</span>', 'child-theme-configurator' ),
279
- 'selector_txt' => __( 'Selectors', 'child-theme-configurator' ),
280
- 'close_txt' => __( 'Close', 'child-theme-configurator' ),
281
- 'edit_txt' => __( 'Edit Selector', 'child-theme-configurator' ),
282
- 'cancel_txt' => __( 'Cancel', 'child-theme-configurator' ),
283
- 'rename_txt' => __( 'Rename', 'child-theme-configurator' ),
284
- 'css_fail_txt' => __( 'The stylesheet cannot be displayed.', 'child-theme-configurator' ),
285
- 'child_only_txt' => __( '(Child Only)', 'child-theme-configurator' ),
286
- 'inval_theme_txt' => __( 'Please enter a valid Child Theme.', 'child-theme-configurator' ),
287
- 'inval_name_txt' => __( 'Please enter a valid Child Theme name.', 'child-theme-configurator' ),
288
- 'theme_exists_txt' => __( '<strong>%s</strong> exists. Please enter a different Child Theme', 'child-theme-configurator' ),
289
- 'js_txt' => __( 'The page could not be loaded correctly.', 'child-theme-configurator' ),
290
- 'jquery_txt' => __( 'Conflicting or out-of-date jQuery libraries were loaded by another plugin:', 'child-theme-configurator' ),
291
- 'plugin_txt' => __( 'Deactivating or replacing plugins may resolve this issue.', 'child-theme-configurator' ),
292
- 'contact_txt' => sprintf( __( '%sWhy am I seeing this?%s', 'child-theme-configurator' ),
293
- '<a target="_blank" href="' . CHLD_THM_CFG_DOCS_URL . '/how-to-use/#script_dep">',
294
- '</a>' ),
295
- 'nosels_txt' => __( 'No Styles Available. Check Parent/Child settings.', 'child-theme-configurator' ),
296
- 'anlz1_txt' => __( 'Updating', 'child-theme-configurator' ),
297
- 'anlz2_txt' => __( 'Checking', 'child-theme-configurator' ),
298
- 'anlz3_txt' => __( 'The theme "%s" generated unexpected PHP debug output.', 'child-theme-configurator' ),
299
- 'anlz4_txt' => __( 'The theme "%s" could not be analyzed because the preview did not render correctly.', 'child-theme-configurator' ),
300
- 'anlz5_txt' => sprintf( __( '<p>First, <a href="%s">refresh this page</a> and try analyzing again.</p><p>If that does not work, try temporarily disabling plugins that <strong>minify CSS</strong> or that <strong>force redirects between HTTP and HTTPS</strong>.</p>', 'child-theme-configurator' ), '?page=' . CHLD_THM_CFG_MENU ),
301
- 'anlz6_txt' => __( 'Click to show/hide PHP debug output', 'child-theme-configurator' ),
302
- 'anlz7_txt' => __( "<p>Please contact this Theme's author and report the items inside the box above. You may or may not be able to use this Theme as a Child Theme while these conditions exist.</p><p>It is possible that this theme has specific requirements to work correctly as a child theme. Please make sure you are using the latest version of this theme and check your theme's documentation for more information.</p>", 'child-theme-configurator' ),
303
- 'anlz8_txt' => __( 'Do Not Activate "%s"! A PHP FATAL ERROR has been detected.', 'child-theme-configurator' ),
304
- 'anlz9_txt' => __( 'This theme loads stylesheets after the wp_styles queue.', 'child-theme-configurator' ),
305
- 'anlz10_txt' => __( '<p>This makes it difficult for plugins to override these styles. You can try to resolve this using the "Repair header template" option (Step 6, "Additional handling options", below).</p>', 'child-theme-configurator' ),
306
- 'anlz11_txt' => __( "This theme loads the parent theme's <code>style.css</code> file outside the wp_styles queue.", 'child-theme-configurator' ),
307
- 'anlz12_txt' => __( '<p>This is common with older themes but requires the use of <code>@import</code>, which is no longer recommended. You can try to resolve this using the "Repair header template" option (see step 6, "Additional handling options", below).</p>', 'child-theme-configurator' ),
308
- 'anlz13_txt' => __( 'This child theme does not load a Configurator stylesheet.', 'child-theme-configurator' ),
309
- 'anlz14_txt' => __( '<p>If you want to customize styles using this plugin, please click "Configure Child Theme" again to add this to the settings.</p>', 'child-theme-configurator' ),
310
- 'anlz15_txt' => __( "This child theme uses the parent stylesheet but does not load the parent theme's <code>style.css</code> file.", 'child-theme-configurator' ),
311
- 'anlz16_txt' => __( '<p>Please select a stylesheet handling method or check "Ignore parent theme stylesheets" (see step 6, below).</p>', 'child-theme-configurator' ),
312
- 'anlz17_txt' => __( 'This child theme appears to be functioning correctly.', 'child-theme-configurator' ),
313
- 'anlz18_txt' => __( 'This theme appears OK to use as a Child theme.', 'child-theme-configurator' ),
314
- 'anlz19_txt' => __( 'This Child Theme has not been configured for this plugin.', 'child-theme-configurator' ),
315
- 'anlz20_txt' => __( '<p>The Configurator makes significant modifications to the child theme, including stylesheet changes and additional php functions. Please consider using the DUPLICATE child theme option (see step 1, above) and keeping the original as a backup.</p>', 'child-theme-configurator' ),
316
- 'anlz21_txt' => __( "This child theme uses <code>@import</code> to load the parent theme's <code>style.css</code> file.", 'child-theme-configurator' ),
317
- 'anlz22_txt' => __( '<p>Please consider selecting "Use the WordPress style queue" for the parent stylesheet handling option (see step 6, below).</p>', 'child-theme-configurator' ),
318
- 'anlz23_txt' => __( 'This theme loads additional stylesheets after the <code>style.css</code> file:', 'child-theme-configurator' ),
319
- 'anlz24_txt' => __( '<p>Consider saving new custom styles to a "Separate stylesheet" (see step 5, below) so that you can customize these styles.</p>', 'child-theme-configurator' ),
320
- 'anlz25_txt' => __( "The parent theme's <code>style.css</code> file is being loaded automatically.", 'child-theme-configurator' ),
321
- 'anlz26_txt' => __( '<p>The Configurator selected "Do not add any parent stylesheet handling" for the "Parent stylesheet handling" option (see step 6, below).</p>', 'child-theme-configurator' ),
322
- 'anlz27_txt' => __( "This theme does not require the parent theme's <code>style.css</code> file for its appearance.", 'child-theme-configurator' ),
323
- 'anlz28_txt' => __( "This Child Theme was configured with an earlier version.", 'child-theme-configurator' ),
324
- 'anlz29_txt' => __( '<p>The selected stylesheet handling method is no longer used. Please update the configuration using the "Repair header template" option (see step 6, "Additional handling options", below).</p>', 'child-theme-configurator' ),
325
- 'anlz30_txt' => __( 'Click to show/hide analysis data. Please include contents below with any support requests.', 'child-theme-configurator' ),
326
- 'anlz31_txt' => __( 'This child theme was configured using the CTC Pro "Genesis stylesheet handling" method.', 'child-theme-configurator' ),
327
- 'anlz32_txt' => __( '<p>This method has been replaced by the "Separate stylesheet" and "Ignore Parent Theme" options ( selected below ) for broader framework compatability.</p>', 'child-theme-configurator' ),
328
- 'anlz33_txt' => __( '<p>%1Click Here%2 to view the theme as viewed by the Analyzer.</p>', 'child-theme-configurator' ),
329
- ) );
330
- wp_localize_script(
331
- 'chld-thm-cfg-admin',
332
- 'ctcAjax',
333
- apply_filters( 'chld_thm_cfg_localize_array', $localize_array )
334
- );
335
- }
336
-
337
- function filter_localize_array( $arr ) {
338
- $arr[ 'pluginmode' ] = !$this->ctc()->is_theme();
339
- return $arr;
340
- }
341
-
342
  }
343
  ?>
2
  // Exit if accessed directly
3
  if ( !defined( 'ABSPATH' ) ) exit;
4
  /*
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.1
9
  Author: Lilaea Media
10
  Author URI: http://www.lilaeamedia.com/
11
  Text Domain: chld_thm_cfg
12
  Domain Path: /lang
13
  License: GPLv2
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
  }
24
+
 
 
 
 
25
  function render() {
26
+ $css = $this->ctc()->css;
 
 
 
 
 
 
27
  $themes = $this->ctc()->themes;
28
+ $child = $css->get_prop( 'child' );
29
+ $hidechild = ( count( $themes[ 'child' ] ) ? '' : 'style="display:none"' );
30
+ $enqueueset = ( isset( $css->enqueue ) && $child );
31
+ $this->ctc()->debug( 'Enqueue set: ' . ( $enqueueset ? 'TRUE' : 'FALSE' ), __FUNCTION__ );
32
+ if ( empty( $css->nowarn ) ) $this->parent_theme_check();
33
+ $imports = $css->get_prop( 'imports' );
34
  $id = 0;
35
  $this->ctc()->fs_method = get_filesystem_method();
36
  add_thickbox();
37
+ add_filter( 'chld_thm_cfg_files_tab_filter', array( $this, 'render_files_tab_options' ) );
38
+ add_action( 'chld_thm_cfg_tabs', array( $this, 'render_addl_tabs' ), 10, 4 );
39
+ add_action( 'chld_thm_cfg_panels', array( $this, 'render_addl_panels' ), 10, 4 );
40
+ add_action( 'chld_thm_cfg_related_links', array( $this, 'lilaea_plug' ) );
41
+ if ( $this->ctc()->is_debug ):
42
+ $this->ctc()->debug( 'adding new debug action...', __FUNCTION__ );
43
+ add_action( 'chld_thm_cfg_print_debug', array( $this->ctc(), 'print_debug' ) );
44
+ endif;
45
  include ( CHLD_THM_CFG_DIR . '/includes/forms/main.php' );
46
  }
47
 
48
+ function parent_theme_check() {
49
+ // check header for hard-coded
50
+ $bad_practice_descr = array(
51
+ // Stylesheets should be enqueued using the <code>wp_enqueue_scripts</code> action.
52
+ 'links' => __( 'A stylesheet link tag is hard-coded into the header template.', 'child-theme-configurator' ),
53
+ 'enqueue' => __( '<code>wp_enqueue_style()</code> called from the header template.', 'child-theme-configurator' ),
54
+ // <code>wp_head()</code> should be located just before the closing <code>&lt;/head&gt;</code> tag.
55
+ 'wphead' => __( 'Code exists between the <code>wp_head()</code> function and the closing <code>&lt;/head&gt;</code> tag.', 'child-theme-configurator'),
56
+ );
57
+ $parentfile = trailingslashit( get_theme_root() ) . trailingslashit( $this->ctc()->get_current_parent() ) . 'header.php';
58
+ $childfile = trailingslashit( get_theme_root() ) . trailingslashit( $this->ctc()->css->get_prop( 'child' ) ) . 'header.php';
59
+ if ( $file = ( file_exists( $childfile ) ? $childfile : ( file_exists( $parentfile ) ? $parentfile : FALSE ) ) ):
60
+ $contents = file_get_contents( $file );
61
+ $contents = preg_replace( "/\/\/.*?(\?>|\n)|\/\*.*?\*\/|<\!\-\-.*?\-\->/s", '', $contents );
62
+ // check for linked stylesheets
63
+ if ( preg_match( '/rel=[\'"]stylesheet[\'"]/is', $contents ) ) $this->warnings[] = $bad_practice_descr[ 'links' ];
64
+ if ( preg_match( '/wp_enqueue_style/is', $contents ) ) $this->warnings[] = $bad_practice_descr[ 'enqueue' ];
65
+ // check for code after wp_head
66
+ if ( preg_match( '/wp_head(.*?)<\/head>/is', $contents, $matches ) ):
67
+ $codeafter = preg_replace( "/[\(\)\?>;\s]/s", '', $matches[ 1 ] );
68
+ if ( !empty( $codeafter ) ) $this->warnings[] = $bad_practice_descr[ 'wphead' ];
69
+ endif;
70
+ endif;
71
  }
72
+
73
  function render_theme_menu( $template = 'child', $selected = NULL ) {
74
+
75
+ ?>
76
+ <select class="ctc-select" id="ctc_theme_<?php echo $template; ?>" name="ctc_theme_<?php echo $template; ?>" style="visibility:hidden" <?php echo $this->ctc()->is_theme() ? '' : ' disabled '; ?> ><?php
77
+ foreach ( $this->ctc()->themes[ $template ] as $slug => $theme )
78
+ echo '<option value="' . $slug . '"' . ( $slug == $selected ? ' selected' : '' ) . '>'
79
+ . esc_attr( $theme[ 'Name' ] ) . '</option>' . LF;
80
+ ?>
81
+ </select>
82
+ <div style="display:none">
83
+ <?php
84
+ foreach ( $this->ctc()->themes[ $template ] as $slug => $theme )
85
+ include ( CHLD_THM_CFG_DIR . '/includes/forms/themepreview.php' ); ?>
86
+ </div>
87
+ <?php
88
  }
89
+
90
  function render_file_form( $template = 'parnt' ) {
91
  global $wp_filesystem;
92
  if ( $theme = $this->ctc()->css->get_prop( $template ) ):
93
  $themeroot = trailingslashit( get_theme_root() ) . trailingslashit( $theme );
94
+ $files = $this->ctc()->get_files( $theme );
 
 
 
 
 
 
 
 
 
 
 
 
95
  $counter = 0;
96
  sort( $files );
97
  ob_start();
98
  foreach ( $files as $file ):
99
+ $templatefile = preg_replace( '%\.php$%', '', $file );
100
+ $excludes = implode( "|", ( array ) apply_filters( 'chld_thm_cfg_template_excludes', $this->ctc()->excludes ) );
101
+ if ( 'parnt' == $template && ( preg_match( '%^(' . $excludes . ' )\w*\/%',$templatefile )
102
+ || 'functions' == basename( $templatefile ) ) ) continue;
103
  include ( CHLD_THM_CFG_DIR . '/includes/forms/file.php' );
104
  endforeach;
105
+ if ( 'child' == $template && ( $backups = $this->ctc()->get_files( $theme, 'backup,pluginbackup' ) ) ):
106
+ foreach ( $backups as $backup => $label ):
107
+ $templatefile = preg_replace( '%\.css$%', '', $backup );
108
+ include ( CHLD_THM_CFG_DIR . '/includes/forms/backup.php' );
109
+ endforeach;
110
+ endif;
111
  $inputs = ob_get_contents();
112
  ob_end_clean();
113
  if ( $counter ):
114
  include ( CHLD_THM_CFG_DIR . '/includes/forms/fileform.php' );
115
  endif;
 
 
116
  endif;
117
  }
118
 
135
  endif;
136
  }
137
 
138
+ function get_theme_screenshot() {
139
+
140
+ foreach ( array_keys( $this->ctc()->imgmimes ) as $extreg ):
141
+ foreach ( explode( '|', $extreg ) as $ext ):
142
+ if ( $screenshot = $this->ctc()->css->is_file_ok( $this->ctc()->css->get_child_target( 'screenshot.' . $ext ) ) ):
143
+ $screenshot = trailingslashit( get_theme_root_uri() ) . $this->ctc()->theme_basename( '', $screenshot );
144
+ return $screenshot . '?' . time();
145
+ endif;
146
+ endforeach;
147
+ endforeach;
148
+ return FALSE;
149
+ }
150
+
151
+ function settings_errors() {
152
+
153
+ if ( count( $this->ctc()->errors ) ):
154
+ echo '<div class="error"><ul>' . LF;
155
+ foreach ( $this->ctc()->errors as $err ):
156
+ echo '<li>' . $err . '</li>' . LF;
157
+ endforeach;
158
+ echo '</ul></div>' . LF;
159
+ elseif ( isset( $_GET[ 'updated' ] ) ):
160
+ echo '<div class="updated">' . LF;
161
+ if ( 8 == $_GET[ 'updated' ] ):
162
+ echo '<p>' . __( 'Child Theme files modified successfully.', 'child-theme-configurator' ) . '</p>' . LF;
163
+ else:
164
+ $child_theme = wp_get_theme( $this->ctc()->css->get_prop( 'child' ) );
165
+ echo '<p>' . apply_filters( 'chld_thm_cfg_update_msg', sprintf( __( 'Child Theme <strong>%s</strong> has been generated successfully.
166
+ ', 'child-theme-configurator' ), $child_theme->Name ), $this->ctc() ) . LF;
167
+ if ( $this->ctc()->is_theme() ):
168
+ echo '<strong>' . __( 'IMPORTANT:', 'child-theme-configurator' ) . LF;
169
+ if ( is_multisite() && !$child_theme->is_allowed() ):
170
+ echo 'You must <a href="' . network_admin_url( '/themes.php' ) . '" title="' . __( 'Go to Themes', 'child-theme-configurator' ) . '" class="ctc-live-preview">' . __( 'Network enable', 'child-theme-configurator' ) . '</a> ' . __( 'your child theme.', 'child-theme-configurator' );
171
+ else:
172
+ echo '<a href="' . admin_url( '/customize.php?theme=' . $this->ctc()->css->get_prop( 'child' ) ) . '" title="' . __( 'Live Preview', 'child-theme-configurator' ) . '" class="ctc-live-preview">' . __( 'Test your child theme', 'child-theme-configurator' ) . '</a> ' . __( 'before activating.', 'child-theme-configurator' );
173
+ endif;
174
+ echo '</strong></p>' . LF;
175
+ endif;
176
+ endif;
177
+ echo '</div>' . LF;
178
+ endif;
179
  }
180
 
181
  function render_help_content() {
182
+ global $wp_version;
183
+ if ( version_compare( $wp_version, '3.3' ) >= 0 ) {
184
+
185
+ $screen = get_current_screen();
186
 
187
  // load help content via output buffer so we can use plain html for updates
188
  // then use regex to parse for help tab parameter values
201
  preg_match( $regex_sidebar, $help_raw, $sidebar );
202
  preg_match_all( $regex_tab, $help_raw, $tabs );
203
 
204
+ // Add help tabs
205
  if ( isset( $tabs[ 1 ] ) ):
206
+ //$priority = 0;
207
  while( count( $tabs[ 1 ] ) ):
208
  $id = array_shift( $tabs[ 1 ] );
209
  $title = array_shift( $tabs[ 2 ] );
210
  $content = array_shift( $tabs[ 3 ] );
211
+ $screen->add_help_tab( array(
212
+ 'id' => $id,
213
+ 'title' => $title,
214
+ 'content' => $content,
215
+ //'priority' => ++$priority,
216
+ ) );
 
217
  endwhile;
218
  endif;
219
  if ( isset( $sidebar[ 1 ] ) )
220
  $screen->set_help_sidebar( $sidebar[ 1 ] );
221
+
222
+ }
223
  }
224
 
225
+ function render_addl_tabs( $ctc, $active_tab = NULL, $hidechild = '' ) {
226
  include ( CHLD_THM_CFG_DIR . '/includes/forms/addl_tabs.php' );
227
  }
228
 
229
+ function render_addl_panels( $ctc, $active_tab = NULL, $hidechild = '' ) {
230
  include ( CHLD_THM_CFG_DIR . '/includes/forms/addl_panels.php' );
231
  }
232
 
233
+ function lilaea_plug() {
234
  include ( CHLD_THM_CFG_DIR . '/includes/forms/related.php' );
235
  }
236
 
239
  $output = preg_replace( $regex, "$1", $output );
240
  return $output;
241
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  }
243
  ?>
includes/class-ctc.php CHANGED
@@ -3,63 +3,47 @@
3
  if ( !defined( 'ABSPATH' ) ) exit;
4
 
5
  class ChildThemeConfigurator {
6
-
7
  static $instance;
8
- static $plugin = 'child-theme-configurator/child-theme-configurator.php';
9
- static $oldpro = 'child-theme-configurator-plugins/child-theme-configurator-plugins.php';
10
- static $ctcpro = 'child-theme-configurator-pro/child-theme-configurator-pro.php';
11
-
12
  static function init() {
13
 
14
  // verify WP version support
15
  global $wp_version;
16
- if ( version_compare( $wp_version, CHLD_THM_CFG_MIN_WP_VERSION, '<' ) ):
17
  add_action( 'admin_notices', 'ChildthemeConfigurator::version_notice' );
18
  return;
19
- endif;
20
- add_action( 'admin_init', 'ChildThemeConfigurator::check_ctc_pro', 15 );
21
  // setup admin hooks
22
  if ( is_multisite() )
23
  add_action( 'network_admin_menu', 'ChildThemeConfigurator::network_admin' );
24
  add_action( 'admin_menu', 'ChildThemeConfigurator::admin' );
25
- // add plugin upgrade notification
26
- add_action( 'in_plugin_update_message-' . self::$plugin,
27
- 'ChildThemeConfigurator::upgrade_notice', 10, 2 );
28
  // setup ajax actions
29
  add_action( 'wp_ajax_ctc_update', 'ChildThemeConfigurator::save' );
30
  add_action( 'wp_ajax_ctc_query', 'ChildThemeConfigurator::query' );
31
- add_action( 'wp_ajax_ctc_dismiss', 'ChildThemeConfigurator::dismiss' );
32
  // initialize languages
33
  add_action( 'init', 'ChildThemeConfigurator::lang' );
34
- // prevent old Pro activation
35
- if ( isset( $_GET[ 'action' ] ) && isset( $_GET[ 'plugin' ] ) && 'activate' == $_GET[ 'action' ] && self::$oldpro == $_GET[ 'plugin' ] )
36
- unset( $_GET[ 'action' ] );
37
  }
38
-
39
  static function ctc() {
40
  // create admin object
 
41
  if ( !isset( self::$instance ) ):
42
  include_once( CHLD_THM_CFG_DIR . '/includes/class-ctc-admin.php' );
43
  self::$instance = new ChildThemeConfiguratorAdmin( __FILE__ );
44
  endif;
 
45
  return self::$instance;
46
  }
47
-
48
  static function lang() {
49
  // initialize languages
50
- load_plugin_textdomain( 'child-theme-configurator', FALSE, basename( CHLD_THM_CFG_DIR ) . '/lang' );
51
  }
52
-
53
  static function save() {
54
  // ajax write
55
  self::ctc()->ajax_save_postdata();
56
  }
57
-
58
  static function query() {
59
  // ajax read
60
  self::ctc()->ajax_query_css();
61
- }
62
-
63
  static function network_admin() {
64
  $hook = add_theme_page(
65
  __( 'Child Theme Configurator', 'child-theme-configurator' ),
@@ -68,9 +52,8 @@ if ( !defined( 'ABSPATH' ) ) exit;
68
  CHLD_THM_CFG_MENU,
69
  'ChildThemeConfigurator::render'
70
  );
71
- add_action( 'load-' . $hook, 'ChildThemeConfigurator::page_init' );
72
  }
73
-
74
  static function admin() {
75
  $hook = add_management_page(
76
  __( 'Child Theme Configurator', 'child-theme-configurator' ),
@@ -82,100 +65,34 @@ if ( !defined( 'ABSPATH' ) ) exit;
82
  add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'ChildThemeConfigurator::action_links' );
83
  add_action( 'load-' . $hook, 'ChildThemeConfigurator::page_init' );
84
  }
85
-
86
  static function action_links( $actions ) {
87
  $actions[] = '<a href="' . admin_url( 'tools.php?page=' . CHLD_THM_CFG_MENU ). '">'
88
  . __( 'Child Themes', 'child-theme-configurator' ) . '</a>' . LF;
89
  return $actions;
90
  }
91
-
92
  static function page_init() {
93
  // start admin controller
94
  self::ctc()->ctc_page_init();
95
  }
96
-
97
  static function render() {
98
  // display admin page
99
  self::ctc()->render();
100
  }
101
-
102
  static function version_notice() {
103
  deactivate_plugins( plugin_basename( __FILE__ ) );
104
  unset( $_GET[ 'activate' ] );
105
- echo '<div class="notice-warning notice is-dismissible"><p>' .
106
  sprintf( __( 'Child Theme Configurator requires WordPress version %s or later.', 'child-theme-configurator' ),
107
  CHLD_THM_CFG_MIN_WP_VERSION ) . '</p></div>' . LF;
108
  }
109
-
110
- static function dismiss() {
111
- self::ctc()->ajax_dismiss_notice();
112
- }
113
-
114
- static function upgrade_ctc_pro_notice() {
115
- $key = 'unregistered';
116
- if ( ( $options = get_site_option( CHLD_THM_CFG_OPTIONS ) )
117
- && is_array( $options )
118
- && isset( $options[ 'update_key' ] ) ) // old versions were unpacking as object type instead of array type
119
- $key = $options[ 'update_key' ];
120
-
121
- $download = '<a href="' . LILAEAMEDIA_URL . '/ctc-pro-latest-version/' . ( empty( $key )
122
- ? ''
123
- : '?lilaea_update_key=' . $key ) . '" target="_blank">'
124
- . __( 'Click here to download and save the latest version to your computer.', 'child-theme-configurator' ) . '</a>';
125
-
126
- $install = '<a href="' . ( is_multisite()
127
- ? network_admin_url( 'plugin-install.php?tab=upload' )
128
- : admin_url( 'plugin-install.php?tab=upload' ) ) . '">'
129
- . __( 'Click here to switch to the plugin install page.', 'child-theme-configurator' ) . '</a>';
130
- ?>
131
- <div class="notice-warning notice is-dismissible">
132
- <p><?php printf( __( 'Child Theme Configurator Pro version %s is not compatible with this version of Child Theme Configurator and has been deactivated.'), CHLD_THM_CFG_PLUGINS_VERSION ); ?></p>
133
- <p><strong><?php _e( 'Please follow these steps carefully to upgrade to the latest version.', 'child-theme-configurator' ); ?></strong></p>
134
- <ol><li><?php _e( 'DO NOT DELETE THE EXISTING PRO PLUGIN or you will lose your settings.', 'child-theme-configurator' ); ?></li>
135
- <li><?php echo $download; ?></li>
136
- <li><?php echo $install; ?></li>
137
- <li><?php printf( __( 'Click the "Browse" button in the center of the page (NOT the button at the top) and select the "%s" file from your computer.', 'child-theme-configurator' ), 'child-theme-configurator-pro-' . CHLD_THM_CFG_PRO_MIN_VERSION . '.zip' ); ?></li>
138
- <li><?php _e( 'Click "Install Now."', 'child-theme-configurator' ); ?></li>
139
- <li><?php _e( 'Click "Activate Plugin"', 'child-theme-configurator' ); ?></li>
140
- <li><?php _e( 'WordPress will automatically remove the original plugin when you activate the new version.', 'child-theme-configurator' ); ?></li></ol>
141
- </div>
142
- <?php
143
- }
144
-
145
- static function deactivate_ctc_pro() {
146
- if ( current_user_can( 'activate_plugins' ) )
147
- deactivate_plugins( self::$oldpro, FALSE, is_network_admin() );
148
- }
149
-
150
- static function check_ctc_pro() {
151
-
152
- if ( file_exists( trailingslashit( dirname( CHLD_THM_CFG_DIR ) ) . self::$oldpro )
153
- && ( $oldpro = get_plugins( '/' . dirname( self::$oldpro ) ) ) ): // get_plugins() throwing a FNF notice for some code checkers
154
- $version = isset( $oldpro[ basename( self::$oldpro ) ] ) ? $oldpro[ basename( self::$oldpro ) ][ 'Version' ] : '';
155
- self::deactivate_ctc_pro();
156
- defined( 'CHLD_THM_CFG_PLUGINS_VERSION' ) or define( 'CHLD_THM_CFG_PLUGINS_VERSION', $version );
157
- add_action( 'admin_notices', 'ChildThemeConfigurator::upgrade_ctc_pro_notice' );
158
- add_action( 'network_admin_notices','ChildThemeConfigurator::upgrade_ctc_pro_notice' );
159
- endif;
160
-
161
- }
162
-
163
- static function upgrade_notice( $current, $new ){
164
- if ( isset( $new->upgrade_notice ) && strlen( trim ( $new->upgrade_notice ) ) )
165
- echo '<p style="background-color:#d54d21;padding:1em;color:#fff;margin: 9px 0">'
166
- . esc_html( $new->upgrade_notice ) . '</p>';
167
- }
168
-
169
  }
170
-
171
  defined( 'LILAEAMEDIA_URL' ) or
172
  define( 'LILAEAMEDIA_URL', "http://www.lilaeamedia.com" );
173
  defined( 'CHLD_THM_CFG_DOCS_URL' ) or
174
  define( 'CHLD_THM_CFG_DOCS_URL', "http://www.childthemeconfigurator.com" );
175
- define( 'CHLD_THM_CFG_VERSION', '2.1.2' );
176
- define( 'CHLD_THM_CFG_PREV_VERSION', '1.7.9.1' );
177
  define( 'CHLD_THM_CFG_MIN_WP_VERSION', '3.7' );
178
- define( 'CHLD_THM_CFG_PRO_MIN_VERSION', '2.2.0' );
179
  defined( 'CHLD_THM_CFG_BPSEL' ) or
180
  define( 'CHLD_THM_CFG_BPSEL', '2500' );
181
  defined( 'CHLD_THM_CFG_MAX_RECURSE_LOOPS' ) or
3
  if ( !defined( 'ABSPATH' ) ) exit;
4
 
5
  class ChildThemeConfigurator {
 
6
  static $instance;
 
 
 
 
7
  static function init() {
8
 
9
  // verify WP version support
10
  global $wp_version;
11
+ if ( version_compare( $wp_version, CHLD_THM_CFG_MIN_WP_VERSION ) < 0 ):
12
  add_action( 'admin_notices', 'ChildthemeConfigurator::version_notice' );
13
  return;
14
+ endif;
 
15
  // setup admin hooks
16
  if ( is_multisite() )
17
  add_action( 'network_admin_menu', 'ChildThemeConfigurator::network_admin' );
18
  add_action( 'admin_menu', 'ChildThemeConfigurator::admin' );
 
 
 
19
  // setup ajax actions
20
  add_action( 'wp_ajax_ctc_update', 'ChildThemeConfigurator::save' );
21
  add_action( 'wp_ajax_ctc_query', 'ChildThemeConfigurator::query' );
 
22
  // initialize languages
23
  add_action( 'init', 'ChildThemeConfigurator::lang' );
 
 
 
24
  }
 
25
  static function ctc() {
26
  // create admin object
27
+ global $chld_thm_cfg; /// backward compat
28
  if ( !isset( self::$instance ) ):
29
  include_once( CHLD_THM_CFG_DIR . '/includes/class-ctc-admin.php' );
30
  self::$instance = new ChildThemeConfiguratorAdmin( __FILE__ );
31
  endif;
32
+ $chld_thm_cfg = self::$instance; // backward compat
33
  return self::$instance;
34
  }
 
35
  static function lang() {
36
  // initialize languages
37
+ load_plugin_textdomain( 'child-theme-configurator', FALSE, basename( CHLD_THM_CFG_DIR ) . '/lang' );
38
  }
 
39
  static function save() {
40
  // ajax write
41
  self::ctc()->ajax_save_postdata();
42
  }
 
43
  static function query() {
44
  // ajax read
45
  self::ctc()->ajax_query_css();
46
+ }
 
47
  static function network_admin() {
48
  $hook = add_theme_page(
49
  __( 'Child Theme Configurator', 'child-theme-configurator' ),
52
  CHLD_THM_CFG_MENU,
53
  'ChildThemeConfigurator::render'
54
  );
55
+ add_action( 'load-' . $hook, 'ChildThemeConfigurator::page_init' );
56
  }
 
57
  static function admin() {
58
  $hook = add_management_page(
59
  __( 'Child Theme Configurator', 'child-theme-configurator' ),
65
  add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'ChildThemeConfigurator::action_links' );
66
  add_action( 'load-' . $hook, 'ChildThemeConfigurator::page_init' );
67
  }
 
68
  static function action_links( $actions ) {
69
  $actions[] = '<a href="' . admin_url( 'tools.php?page=' . CHLD_THM_CFG_MENU ). '">'
70
  . __( 'Child Themes', 'child-theme-configurator' ) . '</a>' . LF;
71
  return $actions;
72
  }
 
73
  static function page_init() {
74
  // start admin controller
75
  self::ctc()->ctc_page_init();
76
  }
 
77
  static function render() {
78
  // display admin page
79
  self::ctc()->render();
80
  }
 
81
  static function version_notice() {
82
  deactivate_plugins( plugin_basename( __FILE__ ) );
83
  unset( $_GET[ 'activate' ] );
84
+ echo '<div class="update-nag"><p>' .
85
  sprintf( __( 'Child Theme Configurator requires WordPress version %s or later.', 'child-theme-configurator' ),
86
  CHLD_THM_CFG_MIN_WP_VERSION ) . '</p></div>' . LF;
87
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  }
89
+ defined( 'LF' ) or define( 'LF', "\n" );
90
  defined( 'LILAEAMEDIA_URL' ) or
91
  define( 'LILAEAMEDIA_URL', "http://www.lilaeamedia.com" );
92
  defined( 'CHLD_THM_CFG_DOCS_URL' ) or
93
  define( 'CHLD_THM_CFG_DOCS_URL', "http://www.childthemeconfigurator.com" );
94
+ define( 'CHLD_THM_CFG_VERSION', '1.7.9.1' );
 
95
  define( 'CHLD_THM_CFG_MIN_WP_VERSION', '3.7' );
 
96
  defined( 'CHLD_THM_CFG_BPSEL' ) or
97
  define( 'CHLD_THM_CFG_BPSEL', '2500' );
98
  defined( 'CHLD_THM_CFG_MAX_RECURSE_LOOPS' ) or
includes/forms/addl_panels.php CHANGED
@@ -1,13 +1,13 @@
1
  <?php
2
  // Exit if accessed directly
3
  if ( !defined( 'ABSPATH' ) ) exit;
4
- if ( !defined( 'CHLD_THM_CFG_PRO_VERSION' ) ):
5
  ?><div id="get_pro_panel" class="ctc-option-panel<?php echo 'get_pro' == $active_tab ? ' ctc-option-panel-active' : ''; ?>" <?php echo $hidechild; ?> >
6
  <div class="ctc-input-row clearfix">
7
  <div class="ctc-input-cell"><div style="padding:0 40px">
8
  <h1>Upgrade Offer</h1>
9
  <p class="larger"><?php _e( 'Use coupon code', 'child-theme-configurator' ); ?><code><strong><?php _e( 'wordpress-org', 'child-theme-configurator' ); ?></strong></code><?php _e( 'and get <strong>20% off entire order</strong>.', 'child-theme-configurator' ); ?></p>
10
- <h3><a target="_blank" href="<?php echo LILAEAMEDIA_URL; ?>/cart/?add-to-cart=4549" title="<?php _e( 'Order Now', 'child-theme-configurator' ); ?>"><?php _e( 'Order Now', 'child-theme-configurator' ); ?></a></h3><small><?php _e( '*Prices and offers subject to change.', 'child-theme-configurator' ); ?></small><hr style="margin:20px 0" />
11
  <a target="_blank" href="<?php echo LILAEAMEDIA_URL; ?>/plugins/intelliwidget/" title="<?php _e( 'Learn more about IntelliWidget', 'child-theme-configurator' ); ?>"><img src="<?php echo CHLD_THM_CFG_URL . 'css/iw-banner.jpg'; ?>" width="430" height="430" /></a>
12
  <p><?php _e( 'IntelliWidget is a versatile widget manager that does the work of multiple plugins by combining custom page menus, featured posts, sliders and other dynamic content features into a single plugin that can display on a per-page or site-wide basis.', 'child-theme-configurator' ); ?> <a target="_blank" href="<?php echo LILAEAMEDIA_URL; ?>/plugins/intelliwidget/" title="<?php _e( 'Learn more about IntelliWidget', 'child-theme-configurator' ); ?>">
13
  <?php _e( 'Learn more', 'child-theme-configurator'); ?><i class="dashicons dashicons-external" style="text-decoration:none"></i></a></p><hr style="margin:20px 0" />
@@ -24,20 +24,20 @@ if ( !defined( 'CHLD_THM_CFG_PRO_VERSION' ) ):
24
  <ul>
25
  <li><h3><?php _e( 'Customize Plugin Stylesheets', 'child-theme-configurator' ); ?></h3>
26
  <p><?php _e( 'Apply the power of CTC\'s top-rated interface to your site\'s plugin styles. All new design makes it much easier to get the results you want.', 'child-theme-configurator' ); ?></p></li>
27
- <li><h3><?php _e( 'Quick Preview', 'child-theme-configurator' ); ?></h3><p><?php _e( 'Preview your child theme with a single click.', 'child-theme-configurator' ); ?></p></li>
28
  <li><h3><?php _e( 'Color Palettes', 'child-theme-configurator' ); ?></h3><p><?php _e( 'Keep the colors you select just a click away. No more searching for hex codes and RGB values.', 'child-theme-configurator' ); ?></p></li>
29
  <li><h3><?php _e( 'Find related styles', 'child-theme-configurator' ); ?></h3><p><?php _e( 'Use the "All Styles" panel to edit groups of selectors from a single combined list.', 'child-theme-configurator' ); ?></p></li>
30
  <li><h3><?php _e( 'Find styles by Nav Menu', 'child-theme-configurator' ); ?></h3><p><?php _e( 'Tweak menus quickly and easily.', 'child-theme-configurator' ); ?></p></li>
31
  <li><h3><?php _e( 'Most recent edits', 'child-theme-configurator' ); ?></h3><p><?php _e( 'Return to recently edited selectors from a toggleable sidebar.', 'child-theme-configurator' ); ?></p></li>
32
- <li><h3><?php _e( 'Add Child Theme Files', 'child-theme-configurator' ); ?></h3>
33
- <p><?php _e( 'Create new template and script files right from the admin.', 'child-theme-configurator' ); ?></p></li>
34
  <li><h3><?php _e( 'Top-rated Online Support', 'child-theme-configurator' ); ?></h3></li>
35
  <li><h3><?php _e( 'Online Documentation', 'child-theme-configurator' ); ?></h3></li>
36
  <li><h3><?php _e( 'Tutorial Videos', 'child-theme-configurator' ); ?></h3></li>
37
  </ul>
38
  <h1>Upgrade Offer</h1>
39
  <p class="larger"><?php _e( 'Use coupon code', 'child-theme-configurator' ); ?><code><strong><?php _e( 'wordpress-org', 'child-theme-configurator' ); ?></strong></code><?php _e( 'and get <strong>20% off entire order</strong>.', 'child-theme-configurator' ); ?></p>
40
- <h3><a target="_blank" href="<?php echo LILAEAMEDIA_URL; ?>/cart/?add-to-cart=4549" title="<?php _e( 'Order Now', 'child-theme-configurator' ); ?>"><?php _e( 'Order Now', 'child-theme-configurator' ); ?></a></h3><small><?php _e( '*Prices and offers subject to change.', 'child-theme-configurator' ); ?></small>
41
  </div>
42
  </div></div><?php
43
  endif;
1
  <?php
2
  // Exit if accessed directly
3
  if ( !defined( 'ABSPATH' ) ) exit;
4
+ if ( !defined( 'CHLD_THM_CFG_PLUGINS_VERSION' ) ):
5
  ?><div id="get_pro_panel" class="ctc-option-panel<?php echo 'get_pro' == $active_tab ? ' ctc-option-panel-active' : ''; ?>" <?php echo $hidechild; ?> >
6
  <div class="ctc-input-row clearfix">
7
  <div class="ctc-input-cell"><div style="padding:0 40px">
8
  <h1>Upgrade Offer</h1>
9
  <p class="larger"><?php _e( 'Use coupon code', 'child-theme-configurator' ); ?><code><strong><?php _e( 'wordpress-org', 'child-theme-configurator' ); ?></strong></code><?php _e( 'and get <strong>20% off entire order</strong>.', 'child-theme-configurator' ); ?></p>
10
+ <h3><a target="_blank" href="<?php echo LILAEAMEDIA_URL; ?>/cart/?add-to-cart=1710" title="<?php _e( 'Order Now', 'child-theme-configurator' ); ?>"><?php _e( 'Order Now', 'child-theme-configurator' ); ?></a></h3><small><?php _e( '*Prices and offers subject to change.', 'child-theme-configurator' ); ?></small><hr style="margin:20px 0" />
11
  <a target="_blank" href="<?php echo LILAEAMEDIA_URL; ?>/plugins/intelliwidget/" title="<?php _e( 'Learn more about IntelliWidget', 'child-theme-configurator' ); ?>"><img src="<?php echo CHLD_THM_CFG_URL . 'css/iw-banner.jpg'; ?>" width="430" height="430" /></a>
12
  <p><?php _e( 'IntelliWidget is a versatile widget manager that does the work of multiple plugins by combining custom page menus, featured posts, sliders and other dynamic content features into a single plugin that can display on a per-page or site-wide basis.', 'child-theme-configurator' ); ?> <a target="_blank" href="<?php echo LILAEAMEDIA_URL; ?>/plugins/intelliwidget/" title="<?php _e( 'Learn more about IntelliWidget', 'child-theme-configurator' ); ?>">
13
  <?php _e( 'Learn more', 'child-theme-configurator'); ?><i class="dashicons dashicons-external" style="text-decoration:none"></i></a></p><hr style="margin:20px 0" />
24
  <ul>
25
  <li><h3><?php _e( 'Customize Plugin Stylesheets', 'child-theme-configurator' ); ?></h3>
26
  <p><?php _e( 'Apply the power of CTC\'s top-rated interface to your site\'s plugin styles. All new design makes it much easier to get the results you want.', 'child-theme-configurator' ); ?></p></li>
27
+ <li><h3><?php _e( 'Quick Preview', 'child-theme-configurator' ); ?></h3><p><?php _e( 'Test your child theme with a single click.', 'child-theme-configurator' ); ?></p></li>
28
  <li><h3><?php _e( 'Color Palettes', 'child-theme-configurator' ); ?></h3><p><?php _e( 'Keep the colors you select just a click away. No more searching for hex codes and RGB values.', 'child-theme-configurator' ); ?></p></li>
29
  <li><h3><?php _e( 'Find related styles', 'child-theme-configurator' ); ?></h3><p><?php _e( 'Use the "All Styles" panel to edit groups of selectors from a single combined list.', 'child-theme-configurator' ); ?></p></li>
30
  <li><h3><?php _e( 'Find styles by Nav Menu', 'child-theme-configurator' ); ?></h3><p><?php _e( 'Tweak menus quickly and easily.', 'child-theme-configurator' ); ?></p></li>
31
  <li><h3><?php _e( 'Most recent edits', 'child-theme-configurator' ); ?></h3><p><?php _e( 'Return to recently edited selectors from a toggleable sidebar.', 'child-theme-configurator' ); ?></p></li>
32
+ <li><h3><?php _e( 'Genesis Framework Support', 'child-theme-configurator' ); ?></h3>
33
+ <p><?php _e( 'Automatically detects and configures Genesis Child Themes with more frameworks on the way.', 'child-theme-configurator' ); ?></p></li>
34
  <li><h3><?php _e( 'Top-rated Online Support', 'child-theme-configurator' ); ?></h3></li>
35
  <li><h3><?php _e( 'Online Documentation', 'child-theme-configurator' ); ?></h3></li>
36
  <li><h3><?php _e( 'Tutorial Videos', 'child-theme-configurator' ); ?></h3></li>
37
  </ul>
38
  <h1>Upgrade Offer</h1>
39
  <p class="larger"><?php _e( 'Use coupon code', 'child-theme-configurator' ); ?><code><strong><?php _e( 'wordpress-org', 'child-theme-configurator' ); ?></strong></code><?php _e( 'and get <strong>20% off entire order</strong>.', 'child-theme-configurator' ); ?></p>
40
+ <h3><a target="_blank" href="<?php echo LILAEAMEDIA_URL; ?>/cart/?add-to-cart=1710" title="<?php _e( 'Order Now', 'child-theme-configurator' ); ?>"><?php _e( 'Order Now', 'child-theme-configurator' ); ?></a></h3><small><?php _e( '*Prices and offers subject to change.', 'child-theme-configurator' ); ?></small>
41
  </div>
42
  </div></div><?php
43
  endif;
includes/forms/addl_tabs.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  // Exit if accessed directly
3
  if ( !defined( 'ABSPATH' ) ) exit;
4
- if ( !defined( 'CHLD_THM_CFG_PRO_VERSION' ) ):
5
  ?>
6
  <a id="get_pro" href="?page=<?php echo CHLD_THM_CFG_MENU; ?>&amp;tab=get_pro"
7
  class="nav-tab<?php echo 'get_pro' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
8
- <?php _e( 'Upgrade', 'child-theme-configurator' ); ?>
9
  </a>
10
  <?php
11
  endif;
1
  <?php
2
  // Exit if accessed directly
3
  if ( !defined( 'ABSPATH' ) ) exit;
4
+ if ( !defined( 'CHLD_THM_CFG_PLUGINS_VERSION' ) ):
5
  ?>
6
  <a id="get_pro" href="?page=<?php echo CHLD_THM_CFG_MENU; ?>&amp;tab=get_pro"
7
  class="nav-tab<?php echo 'get_pro' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
8
+ <?php _e( 'Upgrade', 'chld_thm_cfg_plugins' ); ?>
9
  </a>
10
  <?php
11
  endif;
includes/forms/backups.php CHANGED
@@ -3,7 +3,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
3
  // Additional stylesheets
4
  ?><br/>
5
  <?php
6
- foreach ( $this->get_files( $this->css()->get_prop( 'child' ), 'backup' ) as $backup => $label ): ?>
7
  <label>
8
  <input class="ctc_checkbox" id="ctc_revert_<?php echo $backup; ?>" name="ctc_revert" type="radio"
9
  value="<?php echo $backup; ?>" />
3
  // Additional stylesheets
4
  ?><br/>
5
  <?php
6
+ foreach ( $this->get_files( $this->css->get_prop( 'child' ), 'backup' ) as $backup => $label ): ?>
7
  <label>
8
  <input class="ctc_checkbox" id="ctc_revert_<?php echo $backup; ?>" name="ctc_revert" type="radio"
9
  value="<?php echo $backup; ?>" />
includes/forms/current-theme.php DELETED
@@ -1,8 +0,0 @@
1
- <?php
2
- // Exit if accessed directly
3
- if ( !defined( 'ABSPATH' ) ) exit;
4
- if ( $childname = $this->css()->get_prop( 'child_name' ) ): ?>
5
- <div class="ctc-input-cell">
6
- <h3><?php echo __( 'Currently loaded', 'child-theme-configurator' ). ': ' . $childname; ?></h3>
7
- </div>
8
- <?php endif;
 
 
 
 
 
 
 
 
includes/forms/debug-toggle.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- // Exit if accessed directly
3
- if ( !defined( 'ABSPATH' ) ) exit;
4
- ?>
5
- <label for="ctc_is_debug" style="font-size:9px;float:right">
6
- <input class="ctc_checkbox" id="ctc_is_debug" name="ctc_is_debug" type="checkbox"
7
- value="1" <?php echo checked( $this->ctc()->is_debug, 1 ); ?> autocomplete="off" />
8
- <?php _e( 'Debug', 'child-theme-configurator' ); ?>
9
- </label>
 
 
 
 
 
 
 
 
 
includes/forms/file-form-buttons.php DELETED
@@ -1,13 +0,0 @@
1
- <?php
2
- // Exit if accessed directly
3
- if ( !defined( 'ABSPATH' ) ) exit;
4
-
5
- if ( 'child' == $template && !$this->ctc()->fs ): ?>
6
-
7
- <input class="ctc_submit button button-primary" id="ctc_templates_writable_submit"
8
- name="ctc_templates_writable_submit" type="submit"
9
- value="<?php _e( 'Make Selected Writable', 'child-theme-configurator' ); ?>" />
10
- <?php endif; ?>
11
- <input class="ctc_submit button button-primary" id="ctc_<?php echo $template; ?>_templates_submit"
12
- name="ctc_<?php echo $template; ?>_templates_submit" type="submit"
13
- value="<?php echo ( 'parnt' == $template ? __( 'Copy Selected to Child Theme', 'child-theme-configurator' ) : __( 'Delete Selected', 'child-theme-configurator' ) ); ?>" />
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/forms/file.php CHANGED
@@ -6,6 +6,4 @@ if ( !defined( 'ABSPATH' ) ) exit;
6
  <input class="ctc_checkbox" id="ctc_file_<?php echo $template . '_' . ++$counter; ?>"
7
  name="ctc_file_<?php echo $template; ?>[]" type="checkbox"
8
  value="<?php echo $templatefile; ?>" />
9
- <?php echo 'child' == $template ? apply_filters( 'chld_thm_cfg_editor_link', $templatefile, $editorlink ) : $templatefile; ?></label>
10
-
11
-
6
  <input class="ctc_checkbox" id="ctc_file_<?php echo $template . '_' . ++$counter; ?>"
7
  name="ctc_file_<?php echo $template; ?>[]" type="checkbox"
8
  value="<?php echo $templatefile; ?>" />
9
+ <?php echo $templatefile; ?></label>
 
 
includes/forms/fileform.php CHANGED
@@ -1,6 +1,20 @@
1
  <?php
2
  if ( !defined( 'ABSPATH' ) ) exit;
3
  // Files Section
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  ?>
5
  <div class="ctc-input-row clearfix" id="input_row_<?php echo $template; ?>_templates">
6
  <form id="ctc_<?php echo $template; ?>_templates_form" method="post" action="?page=<?php echo $ctcpage; ?>&amp;tab=file_options">
@@ -11,17 +25,17 @@ if ( !defined( 'ABSPATH' ) ) exit;
11
  <?php
12
  if ( 'parnt' == $template ): ?>
13
  <p class="howto">
14
- <?php _e( 'Copy PHP templates from the parent theme by selecting them here. The Configurator defines a template as a Theme PHP file having no PHP functions or classes. Other PHP files cannot be safely overridden by a child theme.', 'child-theme-configurator' ); ?>
15
- </p>
16
- <p class="howto"><strong>
17
  <?php _e( 'CAUTION: If your child theme is active, the child theme version of the file will be used instead of the parent immediately after it is copied.', 'child-theme-configurator' );?>
18
  </strong></p>
19
- <p class="howto"> <?php printf( __( 'The %s file is generated separately and cannot be copied here.', 'child-theme-configurator' ),
20
- sprintf( $editorlink, 'functions.php', 'Click to edit functions.php', '<code>functions.php</code>' )
21
  );
22
  else: ?>
23
  <p class="howto">
24
- <?php printf( $editorlink, 'functions.php', 'Click to edit functions.php', 'Click to edit files using the Theme Editor' ); ?>
25
  </p>
26
  <p class="howto">
27
  <?php
@@ -37,7 +51,14 @@ else: ?>
37
  <div class="ctc-input-cell-wide"> <?php echo $inputs; ?></div>
38
  <div class="ctc-input-cell"> <strong>&nbsp;</strong> </div>
39
  <div class="ctc-input-cell-wide" style="margin-top:10px;margin-bottom:10px">
40
- <?php do_action( 'chld_thm_cfg_file_form_buttons', $template ); ?>
 
 
 
 
 
 
 
41
  </div>
42
  </form>
43
  </div>
1
  <?php
2
  if ( !defined( 'ABSPATH' ) ) exit;
3
  // Files Section
4
+ // This include is used for both parent template section and the child files section
5
+ $ctcpage = apply_filters( 'chld_thm_cfg_admin_page', CHLD_THM_CFG_MENU );
6
+
7
+ if ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT ):
8
+ $linktext = __( 'The Theme editor has been disabled. Template files must be edited offline.', 'child-theme-configurator' );
9
+ $editorlink = '';
10
+ $editorlinkend = '';
11
+ else:
12
+ $linktext = __( 'Click here to edit template files using the Theme Editor', 'child-theme-configurator' );
13
+ $adminbase = 'theme-editor.php?theme=' . $this->ctc()->css->get_prop( 'child' )
14
+ . ( 'parnt' == $template ? '&file=functions.php' : '' );
15
+ $editorlink = '<a href="' . ( is_multisite() ? network_admin_url( $adminbase ) : admin_url( $adminbase ) ) . '" title="' . $linktext . '">';
16
+ $editorlinkend = '</a>';
17
+ endif;
18
  ?>
19
  <div class="ctc-input-row clearfix" id="input_row_<?php echo $template; ?>_templates">
20
  <form id="ctc_<?php echo $template; ?>_templates_form" method="post" action="?page=<?php echo $ctcpage; ?>&amp;tab=file_options">
25
  <?php
26
  if ( 'parnt' == $template ): ?>
27
  <p class="howto">
28
+ <?php _e( 'Copy PHP template files from the parent theme by selecting them here.', 'child-theme-configurator' ); ?>
29
+ </p>
30
+ <p><strong>
31
  <?php _e( 'CAUTION: If your child theme is active, the child theme version of the file will be used instead of the parent immediately after it is copied.', 'child-theme-configurator' );?>
32
  </strong></p>
33
+ <p class="howto"> <?php echo sprintf( __( 'The %s file is generated separately and cannot be copied here.', 'child-theme-configurator' ),
34
+ $editorlink . '<code>functions.php</code>' . $editorlinkend
35
  );
36
  else: ?>
37
  <p class="howto">
38
+ <?php echo $editorlink . $linktext . $editorlinkend; ?>
39
  </p>
40
  <p class="howto">
41
  <?php
51
  <div class="ctc-input-cell-wide"> <?php echo $inputs; ?></div>
52
  <div class="ctc-input-cell"> <strong>&nbsp;</strong> </div>
53
  <div class="ctc-input-cell-wide" style="margin-top:10px;margin-bottom:10px">
54
+ <?php if ( 'child' == $template && !$this->ctc()->fs ): ?>
55
+ <input class="ctc_submit button button-primary" id="ctc_templates_writable_submit"
56
+ name="ctc_templates_writable_submit" type="submit"
57
+ value="<?php _e( 'Make Selected Writable', 'child-theme-configurator' ); ?>" />&nbsp; &nbsp;
58
+ <?php endif; ?>
59
+ <input class="ctc_submit button button-primary" id="ctc_<?php echo $template; ?>_templates_submit"
60
+ name="ctc_<?php echo $template; ?>_templates_submit" type="submit"
61
+ value="<?php echo ( 'parnt' == $template ? __( 'Copy Selected to Child Theme', 'child-theme-configurator' ) : __( 'Delete Selected', 'child-theme-configurator' ) ); ?>" />
62
  </div>
63
  </form>
64
  </div>
includes/forms/files.php CHANGED
@@ -53,12 +53,17 @@ if ( !defined( 'ABSPATH' ) ) exit;
53
  </form>
54
  </div>
55
  <div class="ctc-input-row clearfix" id="input_row_screenshot">
 
 
56
  <div class="ctc-input-cell"> <strong>
57
  <?php _e( 'Export Child Theme as Zip Archive', 'child-theme-configurator' ); ?>
58
- </strong> <p class="howto"><?php _e( 'Click "Export Zip" to save a backup of the currently loaded child theme. You can export any of your themes from the Parent/Child tab.' ); ?></p></div>
59
- <div class="ctc-input-cell-wide"><?php
60
- include ( CHLD_THM_CFG_DIR . '/includes/forms/zipform.php' );
61
- ?></div>
 
 
 
62
  </div>
63
  <?php if ( 'direct' != $this->ctc()->fs_method ): ?>
64
  <div class="ctc-input-row clearfix" id="input_row_permissions">
53
  </form>
54
  </div>
55
  <div class="ctc-input-row clearfix" id="input_row_screenshot">
56
+ <form id="ctc_export_form" method="post" action="?page=<?php echo CHLD_THM_CFG_MENU; ?>">
57
+ <?php wp_nonce_field( apply_filters( 'chld_thm_cfg_action', 'ctc_update' ) ); ?>
58
  <div class="ctc-input-cell"> <strong>
59
  <?php _e( 'Export Child Theme as Zip Archive', 'child-theme-configurator' ); ?>
60
+ </strong> </div>
61
+ <div class="ctc-input-cell-wide">
62
+ <input class="ctc_submit button button-primary" id="ctc_export_child_zip"
63
+ name="ctc_export_child_zip" type="submit"
64
+ value="<?php _e( 'Export', 'child-theme-configurator' ); ?>" />
65
+ </div>
66
+ </form>
67
  </div>
68
  <?php if ( 'direct' != $this->ctc()->fs_method ): ?>
69
  <div class="ctc-input-row clearfix" id="input_row_permissions">
includes/forms/main.php CHANGED
@@ -1,30 +1,18 @@
1
  <?php
2
  if ( !defined( 'ABSPATH' ) ) exit;
3
- // backward compat
4
- $css = $this->css();
5
  // main CTC Page
6
  ?>
7
  <style type="text/css">
8
- .ctc-step-number {
9
- background-color: <?php echo $this->colors[ 3 ];
10
- ?>;
11
- }
12
- .ctc-step-letter {
13
- background-color: <?php echo $this->colors[ 2 ];
14
- ?>;
15
- }
16
- .ctc-step + strong {
17
- color: <?php echo $this->colors[ 1 ];
18
- ?>;
19
- }
20
  .ctc-status-icon.success {
21
  background:url(<?php echo admin_url( 'images/yes.png' );
22
  ?>) no-repeat;
23
  }
 
24
  .ctc-status-icon.failure {
25
  background:url(<?php echo admin_url( 'images/no.png' );
26
  ?>) no-repeat;
27
  }
 
28
  .ctc-exit {
29
  background:#f9f9f9 url(<?php echo includes_url( 'images/xit-2x.gif' );
30
  ?>) left top no-repeat;
@@ -32,53 +20,42 @@ background:#f9f9f9 url(<?php echo includes_url( 'images/xit-2x.gif' );
32
  </style>
33
  <div class="wrap" id="ctc_main">
34
  <?php do_action( 'chld_thm_cfg_related_links' ); ?>
35
- <h2><?php echo apply_filters( 'chld_thm_cfg_header', __( 'Child Theme Configurator', 'child-theme-configurator' ) . ' ' . __( 'version', 'child-theme-configurator' ) . ' ' . CHLD_THM_CFG_VERSION ); ?></h2>
36
  <?php
37
  if ( $this->ctc()->is_post && !$this->ctc()->fs ):
38
- //die( 'in fs prompt' );
39
  echo $this->ctc()->fs_prompt;
40
- else:
41
- ?>
42
- <div class="clearfix" >
43
- <?php do_action( 'chld_thm_cfg_before_tabs' ); ?>
44
- </div>
45
  <div id="ctc_error_notice">
46
- <?php $this->render_settings_errors(); ?>
47
  </div>
48
- <?php
49
  // if flag has been set because an action is required, do not render interface
50
  if ( !$this->ctc()->skip_form ):
51
  include ( CHLD_THM_CFG_DIR . '/includes/forms/tabs.php' );
52
- ?>
53
- <div id="ctc_option_panel_wrapper" style="position:relative">
54
  <div class="ctc-option-panel-container">
55
  <?php
56
- include ( CHLD_THM_CFG_DIR . '/includes/forms/parent-child.php' );
 
 
57
  if ( $enqueueset ):
58
  include ( CHLD_THM_CFG_DIR . '/includes/forms/rule-value.php' );
59
- include ( CHLD_THM_CFG_DIR . '/includes/forms/query-selector.php' );
60
- if ( $this->ctc()->is_theme() )
61
- include ( CHLD_THM_CFG_DIR . '/includes/forms/webfonts.php' ); ?>
62
  <div id="view_child_options_panel"
63
  class="ctc-option-panel<?php echo 'view_child_options' == $active_tab ? ' ctc-option-panel-active' : ''; ?>" <?php echo $hidechild; ?>> </div>
64
  <div id="view_parnt_options_panel"
65
  class="ctc-option-panel<?php echo 'view_parnt_options' == $active_tab ? ' ctc-option-panel-active' : ''; ?>" <?php echo $hidechild; ?>> </div>
66
  <?php
67
- if ( '' == $hidechild && $this->ctc()->is_theme() )
68
  include ( CHLD_THM_CFG_DIR . '/includes/forms/files.php' );
69
- do_action( 'chld_thm_cfg_panels', $active_tab, $hidechild );
 
70
  endif;
71
  ?>
72
  </div>
73
- <?php do_action( 'chld_thm_cfg_sidebar' ); ?>
74
- </div>
75
- <?php
76
  endif;
77
  endif;
78
  ?>
79
- <div id="ctc_debug_container">
80
- <?php if ( $this->ctc()->is_debug ): ?>
81
- <textarea id="ctc_debug_box"><?php echo $this->ctc()->get_debug(); ?></textarea>
82
- <?php endif; ?>
83
- </div>
84
  </div>
1
  <?php
2
  if ( !defined( 'ABSPATH' ) ) exit;
 
 
3
  // main CTC Page
4
  ?>
5
  <style type="text/css">
 
 
 
 
 
 
 
 
 
 
 
 
6
  .ctc-status-icon.success {
7
  background:url(<?php echo admin_url( 'images/yes.png' );
8
  ?>) no-repeat;
9
  }
10
+
11
  .ctc-status-icon.failure {
12
  background:url(<?php echo admin_url( 'images/no.png' );
13
  ?>) no-repeat;
14
  }
15
+
16
  .ctc-exit {
17
  background:#f9f9f9 url(<?php echo includes_url( 'images/xit-2x.gif' );
18
  ?>) left top no-repeat;
20
  </style>
21
  <div class="wrap" id="ctc_main">
22
  <?php do_action( 'chld_thm_cfg_related_links' ); ?>
23
+ <h2><?php echo apply_filters( 'chld_thm_cfg_header', __( 'Child Theme Configurator', 'child-theme-configurator' ) . ' ' . __( 'version', 'child-theme-configurator' ) . ' ' . CHLD_THM_CFG_VERSION ); ?></h2>
24
  <?php
25
  if ( $this->ctc()->is_post && !$this->ctc()->fs ):
 
26
  echo $this->ctc()->fs_prompt;
27
+ else: ?>
 
 
 
 
28
  <div id="ctc_error_notice">
29
+ <?php $this->settings_errors(); ?>
30
  </div>
31
+ <?php
32
  // if flag has been set because an action is required, do not render interface
33
  if ( !$this->ctc()->skip_form ):
34
  include ( CHLD_THM_CFG_DIR . '/includes/forms/tabs.php' );
35
+ ?><div id="ctc_option_panel_wrapper" style="position:relative">
 
36
  <div class="ctc-option-panel-container">
37
  <?php
38
+ $parent_child_panel = apply_filters( 'chld_thm_cfg_pc_panel',
39
+ CHLD_THM_CFG_DIR . '/includes/forms/parent-child.php' );
40
+ include ( $parent_child_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"
48
  class="ctc-option-panel<?php echo 'view_parnt_options' == $active_tab ? ' ctc-option-panel-active' : ''; ?>" <?php echo $hidechild; ?>> </div>
49
  <?php
50
+ if ( '' == $hidechild ):
51
  include ( CHLD_THM_CFG_DIR . '/includes/forms/files.php' );
52
+ endif;
53
+ do_action( 'chld_thm_cfg_panels', $this->ctc(), $active_tab, $hidechild );
54
  endif;
55
  ?>
56
  </div>
57
+ <?php do_action( 'chld_thm_cfg_sidebar' ); ?></div><?php
 
 
58
  endif;
59
  endif;
60
  ?>
 
 
 
 
 
61
  </div>
includes/forms/notices.php DELETED
@@ -1,116 +0,0 @@
1
- <?php
2
- // Exit if accessed directly
3
- if ( !defined( 'ABSPATH' ) ) exit;
4
- ?>
5
-
6
- <div class="notice-warning notice is-dismissible<?php echo ( 'upgrade' == $msg ? ' ctc-upgrade-notice' : '' ); ?>" style="display:block">
7
- <?php
8
- switch( $msg ):
9
-
10
- case 'writable': ?>
11
- <p class="ctc-section-toggle" id="ctc_perm_options">
12
- <?php _e( 'The child theme is in read-only mode and Child Theme Configurator cannot apply changes. Click to see options', 'child-theme-configurator' ); ?>
13
- </p>
14
- <div class="ctc-section-toggle-content" id="ctc_perm_options_content">
15
- <p>
16
- <ol>
17
- <?php
18
- $ctcpage = apply_filters( 'chld_thm_cfg_admin_page', CHLD_THM_CFG_MENU );
19
- if ( 'WIN' != substr( strtoupper( PHP_OS ), 0, 3 ) ):
20
- _e( '<li>Temporarily set write permissions by clicking the button below. When you are finished editing, revert to read-only by clicking "Make read-only" under the "Files" tab.</li>', 'child-theme-configurator' );
21
- ?>
22
- <form action="" method="post">
23
- <?php wp_nonce_field( apply_filters( 'chld_thm_cfg_action', 'ctc_update' ) ); ?>
24
- <input name="ctc_set_writable" class="button" type="submit" value="<?php _e( 'Make files writable', 'child-theme-configurator' ); ?>"/>
25
- </form>
26
- <?php endif;
27
- _e( '<li><a target="_blank" href="http://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants" title="Editin wp-config.php">Add your FTP/SSH credentials to the WordPress config file</a>.</li>', 'child-theme-configurator' );
28
- if ( isset( $_SERVER[ 'SERVER_SOFTWARE' ] ) && preg_match( '%iis%i',$_SERVER[ 'SERVER_SOFTWARE' ] ) )
29
- _e( '<li><a target="_blank" href="http://technet.microsoft.com/en-us/library/cc771170" title="Setting Application Pool Identity">Assign WordPress to an application pool that has write permissions</a> (Windows IIS systems).</li>', 'child-theme-configurator' );
30
- _e( '<li><a target="_blank" href="http://codex.wordpress.org/Changing_File_Permissions" title="Changing File Permissions">Set write permissions on the server manually</a> (not recommended).</li>', 'child-theme-configurator' );
31
- if ( 'WIN' != substr( strtoupper( PHP_OS ), 0, 3 ) ):
32
- _e( '<li>Run PHP under Apache with suEXEC (contact your web host).</li>', 'child-theme-configurator' );
33
- endif; ?>
34
- </ol>
35
- </p>
36
- </div>
37
- <?php
38
- break;
39
-
40
-
41
- case 'owner':
42
-
43
- $ctcpage = apply_filters( 'chld_thm_cfg_admin_page', CHLD_THM_CFG_MENU ); // FIXME? ?>
44
- <p>
45
- <?php _e( 'This Child Theme has incorrect ownership permissions. Child Theme Configurator will attempt to correct this when you click the button below.', 'child-theme-configurator' ) ?>
46
- </p>
47
- <p>
48
- <form action="" method="post">
49
- <?php
50
- wp_nonce_field( apply_filters( 'chld_thm_cfg_action', 'ctc_update' ) ); ?>
51
- <input name="ctc_reset_permission" class="button" type="submit" value="<?php _e( 'Correct Child Theme Permissions', 'child-theme-configurator' ); ?>"/>
52
- </form>
53
- </p>
54
- <?php
55
- break;
56
-
57
-
58
- case 'enqueue': ?>
59
- <p>
60
- <?php _e( 'Child Theme Configurator needs to update its internal data. Please set your preferences below and click "Generate Child Theme Files" to update your configuration.', 'child-theme-configurator' ) ?>
61
- </p>
62
- <?php
63
- break;
64
-
65
-
66
- case 'max_styles':
67
-
68
- echo sprintf( __( '<strong>However, some styles could not be parsed due to memory limits.</strong> Try deselecting "Additional Stylesheets" below and click "Generate/Rebuild Child Theme Files". %sWhy am I seeing this?%s', 'child-theme-configurator' ),
69
- '<a target="_blank" href="' . LILAEAMEDIA_URL . '/child-theme-configurator#php_memory">',
70
- '</a>' );
71
- break;
72
-
73
-
74
- case 'config': ?>
75
- <p>
76
- <?php _e( 'Child Theme Configurator did not detect any configuration data because a previously configured Child Theme has been removed. Please follow the steps for "CONFIGURE an existing Child Theme" under the "Parent/Child" Tab.', 'child-theme-configurator' ) ?>
77
- </p>
78
- <?php
79
- break;
80
-
81
-
82
- case 'changed': ?>
83
- <p>
84
- <?php _e( 'Your stylesheet has changed since the last time you used the Configurator. Please follow the steps for "CONFIGURE an existing Child Theme" under the "Parent/Child" Tab or you will lose these changes.', 'child-theme-configurator' ) ?>
85
- </p>
86
- <?php
87
- break;
88
-
89
-
90
- case 'upgrade':
91
- $child = $this->css()->get_prop( 'child' );
92
- ?>
93
- <?php if ( $child ): ?>
94
- <div class="clearfix">
95
- <?php endif; ?>
96
- <h3>
97
- <?php _e( 'Thank you for installing Child Theme Configurator.', 'child-theme-configurator' ); ?>
98
- </h3>
99
- <p class="howto">
100
- <?php _e( 'A lot of time and testing has gone into this release but there may be edge cases. If you have any questions, please', 'child-theme-configurator' ); ?>
101
- <a href="<?php echo LILAEAMEDIA_URL; ?>/contact" target="_blank">
102
- <?php _e( 'Contact Us.', 'child-theme-configurator' ); ?>
103
- </a></p>
104
- <p class="howto">
105
- <?php _e( 'For more information, please open the Help tab at the top right or ', 'child-theme-configurator' ) ?>
106
- <a href="http://www.childthemeconfigurator.com/tutorial-videos/" target="_blank">
107
- <?php _e( 'click here to view the latest videos.', 'child-theme-configurator' ); ?>
108
- </a></p>
109
- <?php if ( $child ): ?>
110
- <p>
111
- <?php _e( 'It is a good idea to save a Zip Archive of your Child Theme before using CTC for the first time. Click the "save backup" link ( see Step 2, below ) to export your themes.', 'child-theme-configurator' ); ?>
112
- </p>
113
- </div>
114
- <?php endif; ?>
115
- <?php endswitch; ?>
116
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/forms/parent-child.php CHANGED
@@ -4,363 +4,300 @@ if ( !defined( 'ABSPATH' ) ) exit;
4
  ?>
5
 
6
  <div id="parent_child_options_panel" class="ctc-option-panel<?php echo 'parent_child_options' == $active_tab ? ' ctc-option-panel-active' : ''; ?>">
7
- <form id="ctc_load_form" method="post" action="">
8
-
9
- <?php if ( $this->ctc()->is_theme() ): ?>
10
-
11
- <?php // theme inputs
12
  wp_nonce_field( 'ctc_update' );
13
  //if ( '' == $hidechild )
14
- do_action( 'chld_thm_cfg_controls' );
15
  $disabled = $this->ctc()->is_legacy() && !$this->ctc()->is_theme() ? ' disabled ' : '';
16
  $disabledclass = $this->ctc()->is_legacy() && !$this->ctc()->is_theme() ? ' ctc-disabled ' : '';
17
-
18
- ?><input type="hidden" name="ctc_analysis" value="" />
 
 
 
 
 
 
 
19
  <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_child">
20
- <div class="ctc-input-cell"><span class="ctc-step ctc-step-number">1</span><strong class="shift">
21
- <?php _e( 'Select an action:', 'child-theme-configurator' ); ?>
22
- </strong></div>
23
- <div class="ctc-input-cell-wide">
24
- <label>
25
- <input class="ctc-radio ctc-themeonly" id="ctc_child_type_new" name="ctc_child_type" type="radio" value="new"
26
- <?php echo ( 'new' == $this->ctc()->childtype ? 'checked' : '' ); ?> />
27
- <strong>
28
- <?php _e( 'CREATE a new Child Theme', 'child-theme-configurator' ); ?>
29
  </strong>
30
- <p class="howto indent sep">
31
- <?php _e( 'Install a new customizable child theme using an installed theme as a parent.', 'child-theme-configurator' ); ?>
32
- </p>
 
 
 
 
 
33
  </label>
34
- <!-- /div -->
35
- <?php if ( '' == $hidechild ): ?>
36
- <!-- div class="ctc-input-cell clear">&nbsp;</div>
37
- <div class="ctc-input-cell-wide" -->
38
- <label>
39
  <input class="ctc-radio ctc-themeonly" id="ctc_child_type_existing" name="ctc_child_type" type="radio" value="existing"
40
- <?php echo ( 'new' != $this->ctc()->childtype ? 'checked' : '' ); ?> />
41
- <strong>
42
- <?php _e( 'CONFIGURE an existing Child Theme', 'child-theme-configurator' ); ?>
43
- </strong>
44
- <p class="howto indent sep">
45
- <?php _e( 'Set up a previously installed child theme for use with the Configurator or to modify current settings.', 'child-theme-configurator' ); ?>
46
- </p>
47
- </label>
48
- <!-- /div>
49
- <div class="ctc-input-cell clear">&nbsp;</div>
50
- <div class="ctc-input-cell-wide" -->
51
- <label>
52
- <input class="ctc-radio ctc-themeonly" id="ctc_child_type_duplicate" name="ctc_child_type" type="radio" value="duplicate" />
53
- <strong>
54
- <?php _e( 'DUPLICATE an existing Child Theme', 'child-theme-configurator' ); ?>
55
- </strong>
56
- <p class="howto indent sep">
57
- <?php _e( 'Make a complete copy of an existing Child Theme in a new directory, including any menus, widgets and other Customizer settings. The option to copy the Parent Theme settings (step 8, below) is disabled with this action.', 'child-theme-configurator' ); ?>
58
- </p>
59
- </label>
60
- <!-- /div>
61
- <div class="ctc-input-cell clear">&nbsp;</div>
62
- <div class="ctc-input-cell-wide" -->
63
- <label>
64
- <input class="ctc-radio ctc-themeonly" id="ctc_child_type_reset" name="ctc_child_type" type="radio" value="reset" />
65
- <strong>
66
- <?php _e( 'RESET an existing Child Theme (this will destroy any work you have done in the Configurator)', 'child-theme-configurator' ); ?>
67
- </strong>
68
- <p class="howto indent">
69
- <?php _e( 'Revert the Child theme stylesheet and functions files to their state before the initial configuration or last reset. Additional child theme files will not be removed, but you can delete them under the Files tab.', 'child-theme-configurator' ); ?>
70
- </p>
71
  </label>
72
  </div>
73
- <?php endif; ?>
74
- </div>
75
- <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_new_theme_option" style="display:none">
76
- <div class="ctc-input-cell" style="clear:both"><span class="ctc-step ctc-step-number">2</span>
77
- <strong>
78
- <?php _e( 'Select a Parent Theme:', 'child-theme-configurator' ); ?>
79
- </strong>
80
- <p class="howto indent"><a href="#" class="ctc-backup-theme"><?php _e( 'Click here to save a backup of the selected theme.', 'child-theme-configurator' ); ?></a></p>
81
- </div>
82
  <div class="ctc-input-cell" >
83
- <?php $this->render_theme_menu( 'parnt', $this->ctc()->get_current_parent() ); ?>
84
- <input type="button" class="button button-primary ctc-analyze-theme" value="<?php _e( 'Analyze', 'child-theme-configurator' ); ?>" />
85
  </div>
86
- <div class="ctc-input-cell"><span class="ctc-analyze-howto"><span class="ctc-step ctc-step-number">3</span><strong><?php _e( 'Analyze Parent Theme', 'child-theme-configurator' ); ?></strong><p class="howto indent"><?php _e( 'Click "Analyze" to determine stylesheet dependencies and other potential issues.' ); ?></p></span></div>
87
- <div class="ctc-input-cell clear">&nbsp;</div>
88
- <div class="ctc-input-cell-wide ctc-analysis" id="parnt_analysis_notice">&nbsp;</div>
89
- </div>
90
- <?php if ( '' == $hidechild ): ?>
91
- <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_existing_theme_option" style="display:none">
92
- <div class="ctc-input-cell"><span class="ctc-step ctc-step-number">2</span><strong>
93
- <?php _e( 'Select a Child Theme:', 'child-theme-configurator' ); ?>
94
- </strong>
95
- <p class="howto indent"><a href="#" class="ctc-backup-theme"><?php _e( 'Click here to save a backup of the selected theme.', 'child-theme-configurator' ); ?></a></p>
96
- </div>
97
  <div class="ctc-input-cell">
98
  <?php $this->render_theme_menu( 'child', $this->ctc()->get_current_child() ); ?>
99
- <input type="button" class="button button-primary ctc-analyze-theme" value="<?php _e( 'Analyze', 'child-theme-configurator' ); ?>" />
100
  </div>
101
- <div class="ctc-input-cell"><span class="ctc-analyze-howto"><span class="ctc-step ctc-step-number">3</span><strong><?php _e( 'Analyze Child Theme', 'child-theme-configurator' ); ?></strong><p class="howto indent"><?php _e( 'Click "Analyze" to determine stylesheet dependencies and other potential issues.', 'child-theme-configurator' ); ?></p></span></div>
102
- <div class="ctc-input-cell clear">&nbsp;</div>
103
- <div class="ctc-input-cell-wide ctc-analysis" id="child_analysis_notice">&nbsp;</div>
104
  </div>
105
- <?php
106
- endif; ?>
107
- <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_new_theme_slug" style="display:none">
108
- <div class="ctc-input-cell" style="clear:both"><span class="ctc-step ctc-step-number">4</span><strong class="shift">
109
- <?php _e( 'Name the new theme directory:', 'child-theme-configurator' ); ?>
110
- </strong></div>
111
- <div class="ctc-input-cell" >
112
- <input class="ctc_text ctc-themeonly" id="ctc_child_template" name="ctc_child_template" type="text" placeholder="<?php _e( 'Directory Name', 'child-theme-configurator' ); ?>" autocomplete="off" <?php echo $disabled; ?> />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
  </div>
114
- <div class="ctc-input-cell"><span class="howto">
115
- <strong>
116
- <?php _e( 'NOTE:', 'child-theme-configurator' ); ?>
117
- </strong>
118
- <?php _e( 'This is NOT the name of the Child Theme. You can customize the name, description, etc. in step 7, below.', 'child-theme-configurator' ); ?></span></div>
119
  </div>
120
- <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_theme_slug" style="display:none">
121
- <div class="ctc-input-cell" style="clear:both"><span class="ctc-step ctc-step-number">4</span><strong class="shift">
122
- <?php _e( 'Verify Child Theme directory:', 'child-theme-configurator' ); ?>
123
  </strong> </div>
124
- <div class="ctc-input-cell" ><code id="theme_slug_container">
125
- </code>
 
 
 
126
  </div>
127
- <div class="ctc-input-cell" ><span class="howto">
128
- <?php _e( 'For verification only (you cannot modify the directory of an existing Child Theme).', 'child-theme-configurator' ); ?></span>
 
 
129
  </div>
130
  </div>
131
- <?php
132
- $handling = $this->ctc()->get( 'handling' );
133
- $ignoreparnt = $this->ctc()->get( 'ignoreparnt' );
134
- $keepdeps = $this->ctc()->get( 'keepdeps' );
135
- $enqueue = $this->ctc()->get( 'enqueue' );
136
- $this->ctc()->debug( 'handling: ' . $handling . ' ignore: ' . $ignoreparnt . ' enqueue: ' . $enqueue . ' keepdeps: ' . $keepdeps, 'parent-child.php' );
137
- ?>
138
- <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_stylesheet_handling_container" style="display:none">
139
- <div class="ctc-input-cell clear" id="input_row_stylesheet_handling" ><span class="ctc-step ctc-step-number">5</span><strong class="shift">
140
- <?php _e( 'Select where to save new styles:', 'child-theme-configurator' ); ?>
141
- </strong> </div>
142
- <div class="ctc-input-cell-wide sep"><div id="child_handling_notice"></div>
143
- <label>
144
- <input class="ctc_radio ctc-themeonly" id="ctc_handling_primary" name="ctc_handling" type="radio"
145
- value="primary" <?php checked( $handling, 'primary' ); ?> <?php echo $disabled; ?> autocomplete="off" />
146
- <strong>
147
- <?php _e( "Primary Stylesheet (style.css)", 'child-theme-configurator' ); ?>
148
- </strong>
149
- <p class="howto indent sep">
150
- <?php _e( 'Save new custom styles directly to the Child Theme primary stylesheet, replacing the existing values. The primary stylesheet will load in the order set by the theme.', 'child-theme-configurator' ); ?>
151
- </p>
152
- </label>
153
- </div>
154
- <div class="ctc-input-cell clear">&nbsp;</div>
155
- <div class="ctc-input-cell-wide">
156
- <label>
157
- <input class="ctc_radio ctc-themeonly" id="ctc_handling_separate" name="ctc_handling" type="radio"
158
- value="separate" <?php checked( $handling, 'separate' ); ?> <?php echo $disabled; ?> autocomplete="off" />
159
- <strong>
160
- <?php _e( 'Separate Stylesheet', 'child-theme-configurator' ); ?>
161
- </strong>
162
- <p class="howto indent">
163
- <?php _e( 'Save new custom styles to a separate stylesheet and use any existing child theme styles as a baseline. Select this option if you want to preserve the original child theme styles instead of overwriting them. This option also allows you to customize stylesheets that load after the primary stylesheet.', 'child-theme-configurator' ); ?>
164
- </p>
165
- </label>
166
- </div>
167
- </div>
168
- <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_parent_handling_container" style="display:none">
169
- <div class="ctc-input-cell clear" id="input_row_parent_handling" title="<?php _e( 'Click to expand', 'child-theme-configurator' ); ?>"><span class="ctc-step ctc-step-number">6</span><strong class="shift">
170
- <?php _e( 'Select Parent Theme stylesheet handling:', 'child-theme-configurator' ); ?>
171
  </strong>
172
- <p class="howto"></p>
173
- </div>
174
- <div class="ctc-input-cell-wide sep"><div id="parent_handling_notice"></div>
175
- <?php // deprecated enqueue values
176
- if ( 'both' == $enqueue || 'child' == $enqueue ):
177
- $enqueue = 'enqueue';
178
- endif; ?>
179
- <label>
180
- <input class="ctc_checkbox ctc-themeonly" id="ctc_enqueue_enqueue" name="ctc_enqueue" type="radio"
181
- value="enqueue" <?php checked( $enqueue, 'enqueue' ); ?> <?php echo $disabled; ?> autocomplete="off" />
182
- <strong>
183
- <?php _e( 'Use the WordPress style queue.', 'child-theme-configurator' ); ?>
184
- </strong>
185
- </label>
186
- <p class="howto indent sep">
187
- <?php _e( "Let the Configurator determine the appropriate actions and dependencies and update the functions file automatically.", 'child-theme-configurator' ); ?>
188
- </p>
189
- <label>
190
- <input class="ctc_checkbox ctc-themeonly" id="ctc_enqueue_import" name="ctc_enqueue" type="radio"
191
- value="import" <?php checked( $enqueue, 'import' ); ?> <?php echo $disabled; ?> autocomplete="off" />
192
- <strong>
193
- <?php _e( 'Use <code>@import</code> in the child theme stylesheet.', 'child-theme-configurator' ); ?>
194
- </strong>
195
- </label>
196
- <p class="howto indent sep">
197
- <?php _e( "Only use this option if the parent stylesheet cannot be loaded using the WordPress style queue. Using <code>@import</code> is not recommended.", 'child-theme-configurator' ); ?>
198
- </p>
199
- <label>
200
- <input class="ctc_checkbox ctc-themeonly" id="ctc_enqueue_none" name="ctc_enqueue" type="radio"
201
- value="none" <?php checked( $enqueue, 'none' ); ?> <?php echo $disabled; ?> autocomplete="off" />
202
- <strong>
203
- <?php _e( 'Do not add any parent stylesheet handling.', 'child-theme-configurator' ); ?>
204
- </strong>
205
- <p class="howto indent sep">
206
- <?php _e( "Select this option if this theme already handles the parent theme stylesheet or if the parent theme's <code>style.css</code> file is not used for its appearance.", 'child-theme-configurator' ); ?>
207
- </p>
208
- </label></div>
209
- <div class="ctc-input-cell clear"><strong style="float:right"><?php _e( 'Additional handling options', 'child-theme-configurator' ); ?>:</strong>
210
- <p class="howto">
211
- </p>
212
- </div>
213
- <div class="ctc-input-cell-wide">
214
- <label><input class="ctc_checkbox ctc-themeonly" id="ctc_ignoreparnt" name="ctc_ignoreparnt" type="checkbox"
215
- value="1" autocomplete="off" />
216
- <strong><?php _e( 'Ignore parent theme stylesheets.', 'child-theme-configurator' ); ?></strong>
217
- <p class="howto indent"><?php _e( 'Do not load or parse the parent theme styles. Only use this option if the Child Theme uses a Framework like Genesis and only uses child theme stylesheets for its appearance.', 'child-theme-configurator' ); ?></p></label></div>
218
- <div id="ctc_repairheader_container" style="display:none">
219
- <div class="ctc-input-cell clear">
220
- <p class="howto">
221
- </p>
222
- </div>
223
- <div class="ctc-input-cell-wide sep">
224
- <label><input class="ctc_checkbox ctc-themeonly" id="ctc_repairheader" name="ctc_repairheader" type="checkbox"
225
- value="1" autocomplete="off" />
226
- <strong><?php _e( 'Repair the header template in the child theme.', 'child-theme-configurator' ); ?></strong>
227
- <p class="howto indent"><?php _e( 'Let the Configurator (try to) resolve any stylesheet issues listed above. This can fix many, but not all, common problems.', 'child-theme-configurator' ); ?></p></label></div>
228
- </div>
229
- <?php //do_action( 'chld_thm_cfg_enqueue_options' ); // removed for ctc 2.0 ?>
230
- </div>
231
- <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="ctc_child_header_parameters" style="display:none">
232
- <div class="ctc-input-cell ctc-section-toggle" id="ctc_theme_attributes" title="<?php _e( 'Click to toggle form', 'child-theme-configurator' ); ?>"><span class="ctc-step ctc-step-number">7</span><strong>
233
- <?php _e( 'Customize the Child Theme Name, Description, Author, Version, etc.:', 'child-theme-configurator' ); ?>
234
- </strong> <span class="howto"><?php _e( '(Click to toggle form)', 'child-theme-configurator' ); ?></span></div>
235
- <div class="clear ctc-section-toggle-content" id="ctc_theme_attributes_content">
236
- <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_child_name">
237
- <div class="ctc-input-cell"> <strong>
238
- <?php _e( 'Child Theme Name', 'child-theme-configurator' ); ?>
239
- </strong> </div>
240
- <div class="ctc-input-cell-wide">
241
- <input class="ctc_text ctc-themeonly" id="ctc_child_name" name="ctc_child_name" type="text"
242
- value="<?php echo esc_attr( $this->ctc()->get( 'child_name' ) ); ?>" placeholder="<?php _e( 'Theme Name', 'child-theme-configurator' ); ?>" autocomplete="off" <?php echo $disabled; ?> />
243
- </div>
244
- </div>
245
- <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_child_website">
246
- <div class="ctc-input-cell"> <strong>
247
- <?php _e( 'Theme Website', 'child-theme-configurator' ); ?>
248
- </strong> </div>
249
- <div class="ctc-input-cell-wide">
250
- <input class="ctc_text ctc-themeonly" id="ctc_child_themeuri" name="ctc_child_themeuri" type="text"
251
- value="<?php echo esc_attr( $this->ctc()->get( 'themeuri' ) ); ?>" placeholder="<?php _e( 'Theme Website', 'child-theme-configurator' ); ?>" autocomplete="off" <?php echo $disabled; ?> />
252
- </div>
253
- </div>
254
- <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_child_author">
255
- <div class="ctc-input-cell"> <strong>
256
- <?php _e( 'Author', 'child-theme-configurator' ); ?>
257
- </strong> </div>
258
- <div class="ctc-input-cell-wide">
259
- <input class="ctc_text" id="ctc_child_author" name="ctc_child_author" type="text"
260
- value="<?php echo esc_attr( $this->ctc()->get( 'author' ) ); ?>" placeholder="<?php _e( 'Author', 'child-theme-configurator' ); ?>" autocomplete="off" />
261
- </div>
262
- </div>
263
- <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_child_authoruri">
264
- <div class="ctc-input-cell"> <strong>
265
- <?php _e( 'Author Website', 'child-theme-configurator' ); ?>
266
- </strong> </div>
267
- <div class="ctc-input-cell-wide">
268
- <input class="ctc_text ctc-themeonly" id="ctc_child_authoruri" name="ctc_child_authoruri" type="text"
269
- value="<?php echo esc_attr( $this->ctc()->get( 'authoruri' ) ); ?>" placeholder="<?php _e( 'Author Website', 'child-theme-configurator' ); ?>" autocomplete="off" <?php echo $disabled; ?> />
270
- </div>
271
- </div>
272
- <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_child_descr">
273
- <div class="ctc-input-cell"> <strong>
274
- <?php _e( 'Theme Description', 'child-theme-configurator' ); ?>
275
- </strong> </div>
276
- <div class="ctc-input-cell-wide">
277
- <textarea class="ctc_text ctc-themeonly" id="ctc_child_descr" name="ctc_child_descr" placeholder="<?php _e( 'Description', 'child-theme-configurator' ); ?>" autocomplete="off" <?php echo $disabled; ?> ><?php echo esc_textarea( $this->ctc()->get( 'descr' ) ); ?></textarea>
278
- </div>
279
- </div>
280
- <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_child_tags">
281
- <div class="ctc-input-cell"> <strong>
282
- <?php _e( 'Theme Tags', 'child-theme-configurator' ); ?>
283
- </strong> </div>
284
- <div class="ctc-input-cell-wide">
285
- <textarea class="ctc_text ctc-themeonly" id="ctc_child_tags" name="ctc_child_tags" placeholder="<?php _e( 'Tags', 'child-theme-configurator' ); ?>" autocomplete="off" <?php echo $disabled; ?> ><?php echo esc_textarea( $this->ctc()->get( 'tags' ) ); ?></textarea>
286
- </div>
287
- </div>
288
- <div class="clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_child_version">
289
- <div class="ctc-input-cell"> <strong>
290
- <?php _e( 'Version', 'child-theme-configurator' ); ?>
291
- </strong> </div>
292
- <div class="ctc-input-cell">
293
- <input class="ctc_text" id="ctc_child_version" name="ctc_child_version" type="text"
294
- value="<?php echo esc_attr( $this->ctc()->get( 'version' ) ); ?>" placeholder="<?php _e( 'Version', 'child-theme-configurator' ); ?>" autocomplete="off" />
295
- </div>
296
- </div>
297
  </div>
 
 
 
 
 
 
 
 
298
  </div>
299
- <?php if ( ! is_multisite() || ! empty( $this->ctc()->themes[ 'parnt' ][ $this->ctc()->get_current_parent() ][ 'allowed' ] ) ): ?>
300
- <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="ctc_copy_theme_mods" style="display:none">
 
 
 
 
 
 
 
 
 
 
301
  <div class="ctc-input-cell">
302
- <label for="ctc_parent_mods"><span class="ctc-step ctc-step-number">8</span><strong>
303
- <?php _e( 'Copy Menus, Widgets and other Customizer Settings from the Parent Theme to the Child Theme:', 'child-theme-configurator' ); ?>
304
- </strong> </label>
 
 
305
  </div>
306
- <div class="ctc-input-cell-wide howto">
307
- <label for="ctc_parent_mods">
308
- <input class="ctc_checkbox ctc-themeonly" id="ctc_parent_mods" name="ctc_parent_mods" type="checkbox"
309
- value="1" <?php echo $disabled; ?> />
310
- <strong>
311
- <?php _e( 'NOTE:', 'child-theme-configurator' ); ?>
312
- </strong>
313
- <?php _e( "This option replaces the Child Theme's existing Menus, Widgets and other Customizer Settings with those from the Parent Theme. You should only need to use this option the first time you configure a Child Theme.", 'child-theme-configurator' ); ?>
 
 
 
 
 
 
 
 
 
 
 
314
  </label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
  </div>
316
  </div>
317
- <?php endif; ?>
318
-
319
- <div class="ctc-input-row clearfix" id="ctc_configure_submit" style="display:none">
320
- <div class="ctc-input-cell"><span class="ctc-step ctc-step-number">9</span><strong class="shift"><?php _e( 'Click to run the Configurator:', 'child-theme-configurator' ); ?></strong> </div>
321
- <div class="ctc-input-cell-wide">
322
- <input class="ctc_submit button button-primary" id="ctc_load_styles" name="ctc_load_styles" type="submit"
323
- value="<?php _e( 'Configure Child Theme', 'child-theme-configurator' ); ?>" disabled />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
  </div>
325
  </div>
326
-
327
- <?php
328
- else:
329
-
330
-
331
- // plugin inputs
332
- wp_nonce_field( 'ctc_plugin' ); ?>
333
- <input class="ctc-hidden" id="ctc_theme_parnt" name="ctc_theme_parnt" type="hidden" value="<?php echo $this->ctc()->css->get_prop( 'parnt' ); ?>" />
334
- <input class="ctc-hidden" id="ctc_theme_child" name="ctc_theme_child" type="hidden" value="<?php echo $this->ctc()->css->get_prop( 'child' ); ?>" />
335
- <input class="ctc-hidden" id="ctc_action" name="ctc_action" type="hidden" value="plugin" />
336
- <input class="ctc-hidden" id="ctc_child_type" name="ctc_child_type" type="hidden" value="existing" />
337
- <div class="ctc-input-cell-wide ctc-analysis" id="child_analysis_notice">&nbsp;</div>
338
- <div class="ctc-input-row clearfix" id="ctc_stylesheet_files"><?php
339
- $stylesheets = ChildThemeConfiguratorPro::ctcp()->get_css_files();
340
- if ( count( $stylesheets ) ):?>
341
- <div class="ctc-input-cell ctc-section-toggle" id="ctc_additional_css_files"> <strong>
342
- <?php _e( 'Parse Plugin stylesheets:', 'chld_thm_cfg' ); ?>
343
- </strong> </div>
344
- <div class="ctc-input-cell-wide ctc-section-toggle-content" id="ctc_additional_css_files_content" style="display:block">
345
- <p style="margin-top:0">
346
- <?php _e( 'Select the plugin stylesheets you wish to customize below.', 'chld_thm_cfg' ); ?>
347
- </p><ul><?php
348
- foreach ( $stylesheets as $stylesheet => $label ): ?>
349
- <li><label>
350
- <input class="ctc_checkbox" name="ctc_additional_css[]" type="checkbox"
351
  value="<?php echo $stylesheet; ?>" />
352
- <?php echo $label; ?></label></li><?php
353
- endforeach; ?>
354
- </ul></div><?php
355
- endif; ?>
 
 
356
  </div>
357
- <div class="ctc-input-row clearfix" id="ctc_configure_submit_plugins" style="display:none">
358
- <div class="ctc-input-cell"><strong class="shift"><?php _e( 'Click to run the Configurator:', 'child-theme-configurator' ); ?></strong> </div>
 
359
  <div class="ctc-input-cell-wide">
360
- <input class="ctc_submit button button-primary" id="ctc_load_styles_plugins" name="ctc_load_styles" type="submit"
361
- value="<?php _e( 'Configure Plugin Styles', 'child-theme-configurator' ); ?>" disabled />
 
 
 
 
 
 
 
 
362
  </div>
363
  </div>
364
- <?php endif; ?>
365
  </form>
 
366
  </div>
4
  ?>
5
 
6
  <div id="parent_child_options_panel" class="ctc-option-panel<?php echo 'parent_child_options' == $active_tab ? ' ctc-option-panel-active' : ''; ?>">
7
+ <form id="ctc_load_form" method="post" action=""><!-- ?page=<?php echo CHLD_THM_CFG_MENU; ?>"-->
8
+ <?php
 
 
 
9
  wp_nonce_field( 'ctc_update' );
10
  //if ( '' == $hidechild )
11
+ do_action( 'chld_thm_cfg_controls', $this->ctc() );
12
  $disabled = $this->ctc()->is_legacy() && !$this->ctc()->is_theme() ? ' disabled ' : '';
13
  $disabledclass = $this->ctc()->is_legacy() && !$this->ctc()->is_theme() ? ' ctc-disabled ' : '';
14
+ ?>
15
+ <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_parnt">
16
+ <div class="ctc-input-cell"> <strong>
17
+ <?php _e( 'Parent Theme', 'child-theme-configurator' ); ?>
18
+ </strong> </div>
19
+ <div class="ctc-input-cell">
20
+ <?php $this->render_theme_menu( 'parnt', $this->ctc()->get_current_parent() ); ?>
21
+ </div>
22
+ </div>
23
  <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_child">
24
+ <div class="ctc-input-cell ctc-section-toggle" id="ctc_theme_attributes"> <strong>
25
+ <?php _e( 'Child Theme', 'child-theme-configurator' ); ?>
 
 
 
 
 
 
 
26
  </strong>
27
+ <?php _e( '(click to edit additional fields)', 'child-theme-configurator' ); ?>
28
+ </div>
29
+ <div class="ctc-input-cell">
30
+ <input class="ctc-radio ctc-themeonly" id="ctc_child_type_new" name="ctc_child_type" type="radio" value="new"
31
+ <?php echo ( !empty( $hidechild ) ? 'checked' : '' ); ?>
32
+ <?php echo $hidechild . ' ' . $disabled;?> />
33
+ <label for="ctc_child_type_new">
34
+ <?php _e( 'Create New Child Theme', 'child-theme-configurator' ); ?>
35
  </label>
36
+ </div>
37
+ <div class="ctc-input-cell">
 
 
 
38
  <input class="ctc-radio ctc-themeonly" id="ctc_child_type_existing" name="ctc_child_type" type="radio" value="existing"
39
+ <?php echo ( empty( $hidechild ) ? 'checked' : '' ); ?>
40
+ <?php echo $hidechild . ' ' . $disabled; ?> />
41
+ &nbsp;
42
+ <label for="ctc_child_type_existing" <?php echo $hidechild;?>>
43
+ <?php _e( 'Use Existing Child Theme', 'child-theme-configurator' ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  </label>
45
  </div>
46
+ <div class="ctc-input-cell" style="clear:both"> <strong>&nbsp;</strong> </div>
 
 
 
 
 
 
 
 
47
  <div class="ctc-input-cell" >
48
+ <input class="ctc_text ctc-themeonly" id="ctc_child_template" name="ctc_child_template" type="text" placeholder="<?php _e( 'New Child Theme Slug', 'child-theme-configurator' ); ?>" autocomplete="off" <?php echo $disabled; ?> />
 
49
  </div>
50
+ <?php if ( '' == $hidechild ): ?>
 
 
 
 
 
 
 
 
 
 
51
  <div class="ctc-input-cell">
52
  <?php $this->render_theme_menu( 'child', $this->ctc()->get_current_child() ); ?>
 
53
  </div>
54
+ <?php endif; ?>
 
 
55
  </div>
56
+ <div class="ctc-section-toggle-content" id="ctc_theme_attributes_content">
57
+ <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_child_name">
58
+ <div class="ctc-input-cell"> <strong>
59
+ <?php _e( 'Child Theme Name', 'child-theme-configurator' ); ?>
60
+ </strong> </div>
61
+ <div class="ctc-input-cell-wide">
62
+ <input class="ctc_text ctc-themeonly" id="ctc_child_name" name="ctc_child_name" type="text"
63
+ value="<?php echo esc_attr( $css->get_prop( 'child_name' ) ); ?>" placeholder="<?php _e( 'Theme Name', 'child-theme-configurator' ); ?>" autocomplete="off" <?php echo $disabled; ?> /> </div></div>
64
+ <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_child_website">
65
+ <div class="ctc-input-cell"> <strong>
66
+ <?php _e( 'Theme Website', 'child-theme-configurator' ); ?>
67
+ </strong> </div>
68
+ <div class="ctc-input-cell-wide">
69
+ <input class="ctc_text ctc-themeonly" id="ctc_child_themeuri" name="ctc_child_themeuri" type="text"
70
+ value="<?php echo esc_attr( $css->get_prop( 'themeuri' ) ); ?>" placeholder="<?php _e( 'Theme Website', 'child-theme-configurator' ); ?>" autocomplete="off" <?php echo $disabled; ?> /> </div></div>
71
+ <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_child_author">
72
+ <div class="ctc-input-cell"> <strong>
73
+ <?php _e( 'Author', 'child-theme-configurator' ); ?>
74
+ </strong> </div>
75
+ <div class="ctc-input-cell-wide">
76
+ <input class="ctc_text" id="ctc_child_author" name="ctc_child_author" type="text"
77
+ value="<?php echo esc_attr( $css->get_prop( 'author' ) ); ?>" placeholder="<?php _e( 'Author', 'child-theme-configurator' ); ?>" autocomplete="off" />
78
+ </div></div>
79
+ <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_child_authoruri">
80
+ <div class="ctc-input-cell"> <strong>
81
+ <?php _e( 'Author Website', 'child-theme-configurator' ); ?>
82
+ </strong> </div>
83
+ <div class="ctc-input-cell-wide">
84
+ <input class="ctc_text ctc-themeonly" id="ctc_child_authoruri" name="ctc_child_authoruri" type="text"
85
+ value="<?php echo esc_attr( $css->get_prop( 'authoruri' ) ); ?>" placeholder="<?php _e( 'Author Website', 'child-theme-configurator' ); ?>" autocomplete="off" <?php echo $disabled; ?> /> </div></div>
86
+ <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_child_descr">
87
+ <div class="ctc-input-cell"> <strong>
88
+ <?php _e( 'Theme Description', 'child-theme-configurator' ); ?>
89
+ </strong> </div>
90
+ <div class="ctc-input-cell-wide">
91
+ <textarea class="ctc_text ctc-themeonly" id="ctc_child_descr" name="ctc_child_descr" placeholder="<?php _e( 'Description', 'child-theme-configurator' ); ?>" autocomplete="off" <?php echo $disabled; ?> ><?php echo esc_textarea( $css->get_prop( 'descr' ) ); ?></textarea> </div></div>
92
+ <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_child_tags">
93
+ <div class="ctc-input-cell"> <strong>
94
+ <?php _e( 'Theme Tags', 'child-theme-configurator' ); ?>
95
+ </strong> </div>
96
+ <div class="ctc-input-cell-wide">
97
+ <textarea class="ctc_text ctc-themeonly" id="ctc_child_tags" name="ctc_child_tags" placeholder="<?php _e( 'Tags', 'child-theme-configurator' ); ?>" autocomplete="off" <?php echo $disabled; ?> ><?php echo esc_textarea( $css->get_prop( 'tags' ) ); ?></textarea></div></div>
98
+ <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_child_version">
99
+ <div class="ctc-input-cell"> <strong>
100
+ <?php _e( 'Version', 'child-theme-configurator' ); ?>
101
+ </strong> </div>
102
+ <div class="ctc-input-cell">
103
+ <input class="ctc_text" id="ctc_child_version" name="ctc_child_version" type="text"
104
+ value="<?php echo esc_attr( $css->get_prop( 'version' ) ); ?>" placeholder="<?php _e( 'Version', 'child-theme-configurator' ); ?>" autocomplete="off" />
105
  </div>
 
 
 
 
 
106
  </div>
107
+ <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>" id="input_row_duplicate_theme" <?php echo $hidechild;?>>
108
+ <div class="ctc-input-cell"> <strong>
109
+ <?php _e( 'Duplicate Existing Child Theme', 'child-theme-configurator' ); ?>
110
  </strong> </div>
111
+ <div class="ctc-input-cell">
112
+ <input class="ctc_checkbox ctc-themeonly" id="ctc_duplicate_theme" name="ctc_duplicate_theme" type="checkbox"
113
+ value="1" <?php echo $disabled; ?> />
114
+ <input class="ctc_text" id="ctc_duplicate_theme_slug" name="ctc_duplicate_theme_slug" type="text"
115
+ value="" placeholder="<?php _e( 'Duplicate Theme Slug', 'child-theme-configurator' ); ?>" autocomplete="off" />
116
  </div>
117
+ <div class="ctc-input-cell howto"> <strong>
118
+ <?php _e( 'NOTE:', 'child-theme-configurator' ); ?>
119
+ </strong>
120
+ <?php _e( 'This will copy all child theme files and apply changes to new version.', 'child-theme-configurator' ); ?>
121
  </div>
122
  </div>
123
+ <div class="ctc-input-row clearfix" id="input_row_debug">
124
+ <div class="ctc-input-cell">
125
+ <strong>
126
+ <?php _e( 'Debug', 'chld_thm_cfg_plugins' ); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  </strong>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  </div>
129
+ <div class="ctc-input-cell">
130
+ <input class="ctc_checkbox" id="ctc_is_debug" name="ctc_is_debug" type="checkbox"
131
+ value="1" <?php echo checked( $this->ctc()->is_debug, 1 ); ?> autocomplete="off" />
132
+ </div>
133
+ <div class="ctc-input-cell howto">
134
+ <?php _e( 'Check the box to enable debugging output.', 'chld_thm_cfg_plugins' ); ?>
135
+ </div>
136
+ </div>
137
  </div>
138
+ <?php $parent_handling = ( isset( $css->enqueue ) ? $css->enqueue : 'enqueue' ); ?>
139
+ <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>">
140
+ <div class="ctc-input-cell ctc-section-toggle" id="ctc_stylesheet_handling">
141
+ <strong><?php _e( 'Stylesheet handling', 'child-theme-configurator' ); ?></strong>
142
+ <?php _e( '(click to view options)', 'child-theme-configurator' ); ?>
143
+ </div><?php if ( empty( $css->nowarn ) && count( $this->warnings ) && in_array( $css->enqueue, array( 'none', 'enqueue' ) ) ):?>
144
+ <div class="ctc-input-cell-wide update-nag"><strong><?php _e( 'This theme may not apply child theme styles correctly with the current settings:', 'child-theme-configurator' ); ?></strong><ul class="smaller">
145
+ <?php foreach ( $this->warnings as $warning ) echo '<li>' . $warning . '</li>' . LF; ?>
146
+ </ul><span class="alignright"><label class="smaller"><input type="checkbox" name="ctc_nowarn" value="1" /><?php _e( "Don't show again.", 'child-theme-configurator'); ?></label> &nbsp; <a href="#" class="ctc-section-toggle" id="ctc_stylesheet_handling2"><?php _e( 'View options', 'child-theme-configurator'); ?></a></span></div>
147
+ <?php endif; ?>
148
+ <div class="ctc-section-toggle-content clear" id="ctc_stylesheet_handling_content">
149
+ <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?', 'child-theme-configurator' ); ?></a></div>
150
  <div class="ctc-input-cell">
151
+ <label>
152
+ <input class="ctc_radio ctc-themeonly" id="ctc_parent_enqueue_none" name="ctc_parent_enqueue" type="radio"
153
+ value="none" <?php checked( 'none', $parent_handling ); ?> <?php echo $disabled; ?> />
154
+ <?php _e( 'None (handled by theme)', 'child-theme-configurator' ); ?>
155
+ </label>
156
  </div>
157
+ <div class="ctc-input-cell howto sep">
158
+ <?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.', 'child-theme-configurator' ); ?>
159
+ </div>
160
+ <div class="ctc-input-cell clear">&nbsp;</div>
161
+ <div class="ctc-input-cell">
162
+ <label>
163
+ <input class="ctc_radio ctc-themeonly" id="ctc_parent_enqueue_enqueue" name="ctc_parent_enqueue" type="radio"
164
+ value="enqueue" <?php checked( 'enqueue', $parent_handling ); ?> <?php echo $disabled; ?> />
165
+ <?php _e( 'Enqueue parent stylesheet (default)', 'child-theme-configurator' ); ?>
166
+ </label>
167
+ </strong> </div>
168
+ <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.", 'child-theme-configurator' ); ?>
169
+ </div>
170
+ <div class="ctc-input-cell clear">&nbsp;</div>
171
+ <div class="ctc-input-cell">
172
+ <label>
173
+ <input class="ctc_radio ctc-themeonly" id="ctc_parent_enqueue_child" name="ctc_parent_enqueue" type="radio"
174
+ value="child" <?php checked( 'child', $parent_handling ); ?> <?php echo $disabled; ?> />
175
+ <?php _e( 'Enqueue child stylesheet', 'child-theme-configurator' ); ?>
176
  </label>
177
+ </strong> </div>
178
+ <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.', 'child-theme-configurator' ); ?>
179
+ </div>
180
+ <div class="ctc-input-cell clear"><?php if ( count( $this->warnings ) ): ?><div class="update-nag">
181
+ <strong><?php _e( 'Recommended for this theme:', 'child-theme-configurator' ); ?></strong></div>
182
+ <?php endif; ?>&nbsp;</div>
183
+ <div class="ctc-input-cell">
184
+ <label>
185
+ <input class="ctc_radio ctc-themeonly" id="ctc_parent_enqueue_both" name="ctc_parent_enqueue" type="radio"
186
+ value="both" <?php checked( 'both', $parent_handling ); ?> <?php echo $disabled; ?> />
187
+ <?php _e( 'Enqueue both parent and child stylesheets', 'child-theme-configurator' ); ?>
188
+ </label>
189
+ </strong> </div>
190
+ <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>.', 'child-theme-configurator' ); ?>
191
+ </div><?php do_action( 'chld_thm_cfg_enqueue_options' ); ?>
192
+ <div class="ctc-input-cell clear">&nbsp;</div>
193
+ <div class="ctc-input-cell">
194
+ <label>
195
+ <input class="ctc_radio ctc-themeonly" id="ctc_parent_enqueue_import" name="ctc_parent_enqueue" type="radio"
196
+ value="import" <?php checked( 'import', $parent_handling ); ?> <?php echo $disabled; ?> />
197
+ <?php _e( '<code>@import</code> parent stylesheet', 'child-theme-configurator' ); ?>
198
+ </label>
199
+ </strong> </div>
200
+ <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.", 'child-theme-configurator' ); ?>
201
+ </div>
202
+ </div></div><?php if ( ! is_multisite() || ! empty( $this->ctc()->themes[ 'parnt' ][ $this->ctc()->get_current_parent() ][ 'allowed' ] ) ): ?>
203
+ <div class="ctc-input-row clearfix ctc-themeonly-container<?php echo $disabledclass; ?>">
204
+ <div class="ctc-input-cell"> <strong><label for="ctc_parent_mods">
205
+ <?php _e( 'Copy Parent Theme Menus, Widgets and other Customizer Options', 'child-theme-configurator' ); ?>
206
+ </label></strong> </div>
207
+ <div class="ctc-input-cell">
208
+ <input class="ctc_checkbox ctc-themeonly" id="ctc_parent_mods" name="ctc_parent_mods" type="checkbox"
209
+ value="1" <?php echo $disabled; ?> />
210
+ </div>
211
+ <div class="ctc-input-cell howto"> <strong>
212
+ <?php _e( 'NOTE:', 'child-theme-configurator' ); ?>
213
+ </strong>
214
+ <?php _e( 'This will overwrite child theme options you may have already set.', 'child-theme-configurator' ); ?>
215
+ </div>
216
+ </div><?php endif; ?>
217
+ <?php if ( '' == $hidechild ): ?>
218
+ <div class="ctc-input-row clearfix">
219
+ <div class="ctc-input-cell"> <strong><label for="ctc_backup">
220
+ <?php _e( 'Backup current stylesheet', 'child-theme-configurator' ); ?>
221
+ </label></strong> </div>
222
+ <div class="ctc-input-cell">
223
+ <input class="ctc_checkbox" id="ctc_backup" name="ctc_backup" type="checkbox"
224
+ value="1" />
225
+ </div>
226
+ <div class="ctc-input-cell howto"> <strong>
227
+ <?php _e( 'NOTE:', 'child-theme-configurator' ); ?>
228
+ </strong>
229
+ <?php _e( 'This creates a copy of the current stylesheet before applying changes. You can remove old backup files using the Files tab.', 'child-theme-configurator' ); ?>
230
  </div>
231
  </div>
232
+ <div class="ctc-input-row clearfix">
233
+ <div class="ctc-input-cell ctc-section-toggle" id="ctc_revert_css"> <strong>
234
+ <?php _e( 'Reset/Restore from backup', 'child-theme-configurator' ); ?>
235
+ </strong> </div>
236
+ <div class="ctc-input-cell-wide ctc-section-toggle-content" id="ctc_revert_css_content">
237
+ <label>
238
+ <input class="ctc_checkbox" id="ctc_revert_none" name="ctc_revert" type="radio"
239
+ value="" checked="" />
240
+ <?php _e( 'Leave unchanged', 'child-theme-configurator' );?>
241
+ </label>
242
+ <br/>
243
+ <label>
244
+ <input class="ctc_checkbox" id="ctc_revert_all" name="ctc_revert" type="radio"
245
+ value="all" />
246
+ <?php _e( 'Reset all', 'child-theme-configurator' );?>
247
+ </label>
248
+ <div id="ctc_backup_files"><?php
249
+ foreach ( $this->ctc()->get_files( $css->get_prop( 'child' ), 'backup' ) as $backup => $label ): ?>
250
+ <label>
251
+ <input class="ctc_checkbox" id="ctc_revert_<?php echo $backup; ?>" name="ctc_revert" type="radio"
252
+ value="<?php echo $backup; ?>" />
253
+ <?php echo __( 'Restore backup from', 'child-theme-configurator' ) . ' ' . $label; ?></label>
254
+ <br/>
255
+ <?php endforeach; ?>
256
+ </div>
257
  </div>
258
  </div>
259
+ <?php endif; ?>
260
+ <div class="ctc-input-row clearfix" id="ctc_stylesheet_files">
261
+ <?php
262
+ // Additional stylesheets
263
+ $stylesheets = $this->ctc()->get_files( $this->ctc()->get_current_parent(), 'stylesheet' );
264
+ if ( count( $stylesheets ) ):?>
265
+ <div class="ctc-input-cell ctc-section-toggle" id="ctc_additional_css_files"> <strong>
266
+ <?php _e( 'Parse additional stylesheets', 'child-theme-configurator' ); ?>
267
+ </strong> </div>
268
+ <div class="ctc-input-cell-wide ctc-section-toggle-content" id="ctc_additional_css_files_content">
269
+ <p style="margin-top:0" class="howto">
270
+ <?php _e( 'Stylesheets that are currently being loaded by the parent theme are automatically selected below (except for Bootstrap stylesheets which add a large amount data to the configuration). To further reduce overhead, select only the additional stylesheets you wish to customize.', 'child-theme-configurator' ); ?>
271
+ </p>
272
+ <ul>
273
+ <?php foreach ( $stylesheets as $stylesheet ): ?>
274
+ <li>
275
+ <label>
276
+ <input class="ctc_checkbox" name="ctc_additional_css[]" type="checkbox"
 
 
 
 
 
 
 
277
  value="<?php echo $stylesheet; ?>" />
278
+ <?php echo esc_attr( $stylesheet ); ?></label>
279
+ </li>
280
+ <?php endforeach; ?>
281
+ </ul>
282
+ </div><?php
283
+ endif; ?>
284
  </div>
285
+ <div class="ctc-input-row clearfix">
286
+ <?php if ( '' == $hidechild && !$enqueueset ): ?>
287
+ <div class="ctc-input-cell"> <strong>&nbsp;</strong> </div>
288
  <div class="ctc-input-cell-wide">
289
+ <div class="update-nag">
290
+ <strong><?php _e( 'Please read before you click:', 'child-theme-configurator' ); ?></strong>
291
+ <p><?php _e( 'This plugin makes significant modifications to your child theme, to include changing CSS, removing comments and adding php functions.', 'child-theme-configurator' ); ?>
292
+ <?php _e( 'If you are using an existing Child Theme,', 'child-theme-configurator' ); ?> <a href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/how-to-use/#duplicating-existing-child-themes" target="_blank"><?php _e( 'please consider using the Duplicate Child Theme option', 'child-theme-configurator' ); ?></a> <?php _e( 'before proceeding.', 'child-theme-configurator' ); ?></p>
293
+ </div><p>&nbsp;</p></div>
294
+ <?php endif; ?>
295
+ <div class="ctc-input-cell"> <strong>&nbsp;</strong> </div>
296
+ <div class="ctc-input-cell">
297
+ <input class="ctc_submit button button-primary" id="ctc_load_styles" name="ctc_load_styles" type="submit"
298
+ value="<?php _e( 'Generate/Rebuild Child Theme Files', 'child-theme-configurator' ); ?>" disabled />
299
  </div>
300
  </div>
 
301
  </form>
302
+ <div id="ctc_debug_container"><?php do_action( 'chld_thm_cfg_print_debug' ); ?></div>
303
  </div>
includes/forms/query-selector.php CHANGED
@@ -6,13 +6,12 @@ if ( !defined( 'ABSPATH' ) ) exit;
6
 
7
  <div id="query_selector_options_panel"
8
  class="ctc-option-panel<?php echo 'query_selector_options' == $active_tab ? ' ctc-option-panel-active' : ''; ?>" <?php echo $hidechild; ?>>
9
- <p class="howto"><?php _e( 'To find and edit specific selectors within @media query blocks, first choose the query, then the selector. Use the "base" query to edit all other selectors.', 'child-theme-configurator' ); ?></p>
10
  <form id="ctc_query_selector_form" method="post" action="?page=<?php echo $ctcpage; ?>">
11
  <?php wp_nonce_field( apply_filters( 'chld_thm_cfg_action', 'ctc_update' ) ); ?>
12
  <div class="ctc-input-row clearfix" id="input_row_query">
13
  <div class="ctc-input-cell"> <strong>
14
- <?php _e( '@media Query', 'child-theme-configurator' ); ?>
15
- </strong> <?php _e( '( or "base" )', 'child-theme-configurator' ); ?></div>
16
  <div class="ctc-input-cell" id="ctc_sel_ovrd_query_selected">&nbsp;</div>
17
  <div class="ctc-input-cell">
18
  <div class="ui-widget">
@@ -38,7 +37,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
38
  <?php _e( 'Sample', 'child-theme-configurator' ); ?>
39
  </strong></div>
40
  <div class="ctc-input-cell clearfix" style="max-height:150px;overflow:hidden">
41
- <div class="ctc-swatch" id="ctc_child_all_0_swatch"><?php echo $this->swatch_txt; ?></div>
42
  </div>
43
  <div id="ctc_status_sel_val"></div>
44
  <div class="ctc-input-cell ctc-button-cell" id="ctc_save_query_selector_cell">
@@ -54,7 +53,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
54
  <?php _e( 'Property', 'child-theme-configurator' ); ?>
55
  </strong> </div>
56
  <div class="ctc-input-cell"> <strong>
57
- <?php _e( 'Baseline Value', 'child-theme-configurator' ); ?>
58
  </strong> </div>
59
  <div class="ctc-input-cell"> <strong>
60
  <?php _e( 'Child Value', 'child-theme-configurator' ); ?>
6
 
7
  <div id="query_selector_options_panel"
8
  class="ctc-option-panel<?php echo 'query_selector_options' == $active_tab ? ' ctc-option-panel-active' : ''; ?>" <?php echo $hidechild; ?>>
 
9
  <form id="ctc_query_selector_form" method="post" action="?page=<?php echo $ctcpage; ?>">
10
  <?php wp_nonce_field( apply_filters( 'chld_thm_cfg_action', 'ctc_update' ) ); ?>
11
  <div class="ctc-input-row clearfix" id="input_row_query">
12
  <div class="ctc-input-cell"> <strong>
13
+ <?php _e( 'Query', 'child-theme-configurator' ); ?>
14
+ </strong> </div>
15
  <div class="ctc-input-cell" id="ctc_sel_ovrd_query_selected">&nbsp;</div>
16
  <div class="ctc-input-cell">
17
  <div class="ui-widget">
37
  <?php _e( 'Sample', 'child-theme-configurator' ); ?>
38
  </strong></div>
39
  <div class="ctc-input-cell clearfix" style="max-height:150px;overflow:hidden">
40
+ <div class="ctc-swatch" id="ctc_child_all_0_swatch"><?php echo $this->ctc()->swatch_text; ?></div>
41
  </div>
42
  <div id="ctc_status_sel_val"></div>
43
  <div class="ctc-input-cell ctc-button-cell" id="ctc_save_query_selector_cell">
53
  <?php _e( 'Property', 'child-theme-configurator' ); ?>
54
  </strong> </div>
55
  <div class="ctc-input-cell"> <strong>
56
+ <?php _e( 'Parent Value', 'child-theme-configurator' ); ?>
57
  </strong> </div>
58
  <div class="ctc-input-cell"> <strong>
59
  <?php _e( 'Child Value', 'child-theme-configurator' ); ?>
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?', 'child-theme-configurator' ); ?> <span style="color:#F1823B"><?php _e( 'Click help', 'child-theme-configurator' ); ?></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', 'child-theme-configurator' ); ?>" 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', 'child-theme-configurator' ); ?>" /></a>
1
+ <span style="float:right;margin-left:2em;margin-top:-6px;text-shadow:1px 2px 0 #fff"><strong><?php _e( 'New user?','child-theme-configurator' ); ?> <span style="color:#F1823B"><?php _e( 'Click help', 'child-theme-configurator' ); ?></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', 'child-theme-configurator' ); ?>" 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', 'child-theme-configurator' ); ?>" /></a>
includes/forms/rule-value.php CHANGED
@@ -6,7 +6,6 @@ if ( !defined( 'ABSPATH' ) ) exit;
6
 
7
  <div id="rule_value_options_panel"
8
  class="ctc-option-panel<?php echo 'rule_value_options' == $active_tab ? ' ctc-option-panel-active' : ''; ?>" <?php echo $hidechild; ?>>
9
- <p class="howto"><?php _e( 'To find and edit selectors containing specific values for a given property, first choose the property (e.g., "color"), then click "Selectors" for any resulting value. A dialog panel will open with the corresponding selectors, grouped by media query.', 'child-theme-configurator' ); ?></p>
10
  <form id="ctc_rule_value_form" method="post" action="?page=<?php echo $ctcpage; ?>">
11
  <?php wp_nonce_field( apply_filters( 'chld_thm_cfg_action', 'ctc_update' ) ); ?>
12
  <div class="ctc-input-row clearfix" id="ctc_input_row_rule_menu">
6
 
7
  <div id="rule_value_options_panel"
8
  class="ctc-option-panel<?php echo 'rule_value_options' == $active_tab ? ' ctc-option-panel-active' : ''; ?>" <?php echo $hidechild; ?>>
 
9
  <form id="ctc_rule_value_form" method="post" action="?page=<?php echo $ctcpage; ?>">
10
  <?php wp_nonce_field( apply_filters( 'chld_thm_cfg_action', 'ctc_update' ) ); ?>
11
  <div class="ctc-input-row clearfix" id="ctc_input_row_rule_menu">
includes/forms/settings-errors.php DELETED
@@ -1,60 +0,0 @@
1
- <?php
2
- // Exit if accessed directly
3
- if ( !defined( 'ABSPATH' ) ) exit;
4
- if ( count( $this->ctc()->errors ) ): ?>
5
-
6
- <div class="error notice is-dismissible">
7
- <ul>
8
- <?php
9
- foreach ( $this->ctc()->errors as $err ):
10
- echo '<li>' . $err . '</li>' . LF;
11
- endforeach; ?>
12
- </ul>
13
- </div>
14
- <?php
15
- elseif ( isset( $_GET[ 'updated' ] ) ):
16
- $child_theme = wp_get_theme( $this->ctc()->get( 'child' ) ); ?>
17
- <div class="updated notice is-dismissible">
18
- <?php
19
- if ( 4 == $_GET[ 'updated' ] ): ?>
20
- <p> <?php printf( __( 'Child Theme <strong>%s</strong> has been reset. Please configure it using the settings below.', 'child-theme-configurator' ), $child_theme->Name ); ?> </p>
21
- <?php
22
- elseif ( 7 == $_GET[ 'updated' ] ): ?>
23
- <p>
24
- <?php _e( 'Update Key saved successfully.', 'child-theme-configurator' ); ?>
25
- </p>
26
- <?php
27
- elseif ( 8 == $_GET[ 'updated' ] ): ?>
28
- <p>
29
- <?php _e( 'Child Theme files modified successfully.', 'child-theme-configurator' ); ?>
30
- </p>
31
- <?php else: ?>
32
- <p class="ctc-success-response"><?php echo apply_filters( 'chld_thm_cfg_update_msg', sprintf( __( 'Child Theme <strong>%s</strong> has been generated successfully.', 'child-theme-configurator' ), $child_theme->Name ), $this->ctc() ); ?>
33
- <?php
34
- if ( $this->ctc()->is_theme() ): ?>
35
- <strong>
36
- <?php _e( 'IMPORTANT:', 'child-theme-configurator' ); ?>
37
- <?php
38
- if ( is_multisite() && !$child_theme->is_allowed() ):
39
- printf( __( 'You must %sNetwork enable%s your child theme.', 'child-theme-configurator' ),
40
- sprintf( '<a href="%s" title="%s" class="ctc-live-preview">',
41
- network_admin_url( '/themes.php' ),
42
- __( 'Go to Themes', 'child-theme-configurator' ) ),
43
- '</a>'
44
- );
45
- else:
46
- printf( __( '%sPreview your child theme%s before activating.', 'child-theme-configurator' ),
47
- sprintf( '<a href="%s" title="%s" class="ctc-live-preview">',
48
- admin_url( '/customize.php?theme=' . $this->ctc()->css->get_prop( 'child' ) ),
49
- __( 'Live Preview', 'child-theme-configurator' ) ),
50
- '</a>'
51
- );
52
- endif; ?>
53
- </strong></p>
54
- <?php
55
- endif;
56
- endif; ?>
57
- </div>
58
- <?php
59
- endif;
60
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/forms/tabs.php CHANGED
@@ -8,32 +8,34 @@ $active_tab = isset( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : 'parent_child_options';
8
  <h2 class="nav-tab-wrapper clearfix">
9
  <a id="parent_child_options" href=""
10
  class="nav-tab<?php echo 'parent_child_options' == $active_tab ? ' nav-tab-active' : ''; ?>">
11
- <?php _e( 'Parent/ Child', 'child-theme-configurator' ); ?>
12
- </a><?php if ( $enqueueset ): ?><a id="query_selector_options" href=""
 
 
13
  class="nav-tab<?php echo 'query_selector_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
14
- <?php _e( 'Query/ Selector', 'child-theme-configurator' ); ?>
15
- </a><a id="rule_value_options" href=""
16
  class="nav-tab<?php echo 'rule_value_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
17
- <?php _e( 'Property/ Value', 'child-theme-configurator' ); ?>
18
- </a><?php
19
- if ( $this->ctc()->is_theme() ):
20
- ?><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', 'child-theme-configurator' ); ?>
23
- </a><?php
24
- endif; ?><a id="view_parnt_options" href=""
25
- class="nav-tab<?php echo 'view_parnt_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
26
- <?php _e( 'Baseline Styles', 'child-theme-configurator' ); ?>
27
- </a><a id="view_child_options" href=""
28
  class="nav-tab<?php echo 'view_child_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
29
- <?php _e( 'Child Styles', 'child-theme-configurator' ); ?>
30
- </a><?php
31
- if ( '' == $hidechild && $this->ctc()->is_theme() ):
32
- ?><a id="file_options" href="" class="nav-tab<?php echo 'file_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
 
 
 
 
 
33
  <?php _e( 'Files', 'child-theme-configurator' ); ?>
34
- </a><?php
 
35
  endif;
36
- do_action( 'chld_thm_cfg_tabs', $active_tab, $hidechild );
37
  endif; ?>
38
  <i id="ctc_status_preview"></i>
39
  </h2>
8
  <h2 class="nav-tab-wrapper clearfix">
9
  <a id="parent_child_options" href=""
10
  class="nav-tab<?php echo 'parent_child_options' == $active_tab ? ' nav-tab-active' : ''; ?>">
11
+ <?php _e( 'Parent/Child', 'child-theme-configurator' ); ?>
12
+ </a>
13
+ <?php if ( $enqueueset ): ?>
14
+ <!----><a id="query_selector_options" href=""
15
  class="nav-tab<?php echo 'query_selector_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
16
+ <?php _e( 'Query/Selector', 'child-theme-configurator' ); ?>
17
+ </a><!----><a id="rule_value_options" href=""
18
  class="nav-tab<?php echo 'rule_value_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
19
+ <?php _e( 'Property/Value', 'child-theme-configurator' ); ?>
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', 'child-theme-configurator' ); ?>
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', 'child-theme-configurator' ); ?>
26
+ </a><!----><a id="view_parnt_options" href=""
27
+ class="nav-tab<?php echo 'view_parnt_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
28
+ <?php _e( 'Parent CSS', 'child-theme-configurator' ); ?>
29
+ </a>
30
+ <?php
31
+ if ( '' == $hidechild ):
32
+ ?>
33
+ <a id="file_options" href="" class="nav-tab<?php echo 'file_options' == $active_tab ? ' nav-tab-active' : ''; ?>" <?php echo $hidechild; ?>>
34
  <?php _e( 'Files', 'child-theme-configurator' ); ?>
35
+ </a>
36
+ <?php
37
  endif;
38
+ do_action( 'chld_thm_cfg_tabs', $this->ctc(), $active_tab, $hidechild );
39
  endif; ?>
40
  <i id="ctc_status_preview"></i>
41
  </h2>
includes/forms/theme-menu.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
- // Exit if accessed directly
3
- if ( !defined( 'ABSPATH' ) ) exit;
4
- ?>
5
-
6
- <select class="ctc-select" id="ctc_theme_<?php echo $template; ?>" name="ctc_theme_<?php echo $template; ?>"
7
- style="visibility:hidden" <?php echo $this->ctc()->is_theme() ? '' : ' disabled '; ?> autocomplete="off" >
8
- <?php
9
- uasort( $this->ctc()->themes[ $template ], array( $this, 'cmp_theme' ) );
10
- foreach ( $this->ctc()->themes[ $template ] as $slug => $theme )
11
- echo '<option value="' . $slug . '"' . ( $slug == $selected ? ' selected' : '' ) . '>'
12
- . esc_attr( $theme[ 'Name' ] ) . '</option>' . LF;
13
- ?>
14
- </select>
15
- <div style="display:none">
16
- <?php
17
- foreach ( $this->ctc()->themes[ $template ] as $slug => $theme )
18
- include ( CHLD_THM_CFG_DIR . '/includes/forms/themepreview.php' ); ?>
19
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/forms/zipform.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- if ( !defined( 'ABSPATH' ) ) exit;
3
- ?>
4
- <form id="ctc_export_theme_form" method="post" action="?page=<?php echo CHLD_THM_CFG_MENU; ?>">
5
- <?php wp_nonce_field( apply_filters( 'chld_thm_cfg_action', 'ctc_update' ) ); ?>
6
- <input class="ctc_submit button button-primary" name="ctc_export_child_zip" type="submit" value="<?php _e( 'Export Child Theme', 'child-theme-configurator' ); ?>" />
7
- <input type="hidden" id="ctc_export_theme" name="ctc_export_theme" value="" />
8
- </form>
9
-
 
 
 
 
 
 
 
 
 
includes/help/de_DE.php CHANGED
@@ -3,70 +3,77 @@ if ( !defined( 'ABSPATH' ) ) exit;
3
  // Help Content
4
  ?>
5
  <!-- BEGIN tab -->
6
- <h3 id="ctc_tutorial">Hier starten: Anleitungs-Videos</h3>
7
- <!-- p><iframe width="560" height="315" src="https://www.youtube.com/embed/xL0YmieF6d0?rel=0&modestbranding=1" frameborder="0" allowfullscreen></iframe></p>
8
- <p><iframe width="560" height="315" src="https://www.youtube.com/embed/vhQ5oi20rYE?rel=0&modestbranding=1" frameborder="0" allowfullscreen></iframe></p -->
9
- <p>Wir betten aus Leistungsgründen keine Anleitungsvideos mehr ein. <a href="http://www.childthemeconfigurator.com/tutorial-videos" target="_blank">Hier klicken, um die Videos anzuschauen.</a></p><!-- END tab -->
10
- <!-- BEGIN tab -->
11
- <h3 id="ctc_getting_started">Eltern/Kind-Tab</h3>
12
- <ol><li><strong>Eine Aktion auswählen:</strong>
13
- <ul><li><strong>Neues Kind-Thema ERZEUGEN</strong> - Installiere ein neues anpassbares Kind-Thema mit einem installierten Thema als Eltern.</li>
14
- <li><strong>Bestehendes Kind-Thema ANPASSEN</strong> - Aufsetzen eines vorher installierten Kindthemas für den Konfigurator oder zum Ändern der aktuellen Einstellungen.</li>
15
- <li><strong>Bestehendes Kind-Thema DUPLIZIEREN</strong> - Eine vollständige Kopie eines Kindthemas in ein neues Verzeichnis erstellen, inkl. Menüs, Widgets und anderer Einstellungen. Die Option zum Kopieren der Eltern-Einstellungen (Schritt 8 unten) ist mit dieser Aktion deaktiviert.</li>
16
- <li><strong>Bestehendes Kind-Thema ZURÜCKSETZEN</strong> (dies wird all Ihre Arbeit im Konfigurator überschreiben) - Kind-Thema-Formatvorlage und Funktionsdateien auf ihren ursprünglichen Zustand setzen (vor der Initial-Konfiguration oder dem letzten Zurücksetzen).</li></ul></li>
17
- <li><strong>Eltern-Thema auswählen</strong> falls Sie ein neues Kind-Thema erstellen; ein Kind-Thema auswählen, falls Sie anpassen, duplizieren, oder zurücksetzen möchten.</li>
18
- <li><strong>Analysiere Kind-Thema</strong> - "Analysieren" klicken, um Formatvorlage-Abhängigkeiten und andere mögliche Probleme zu erkennen.</li>
19
- <li><strong>Neues Verzeichnis benennen</strong> beim Erstellen eines neuen Kindthemas; ansonsten prüft es, ob das Verzeichnis korrekt ist. - Dies ist NICHT der Name des Kindthemas. Sie können den Namen, die Beschreibung etc. in Schritt 7 unten anpassen.</li>
20
- <li><strong>Speicherort der neuen Stile auswählen:</strong><ul>
21
- <li><strong>Primäre Formatvorlage (style.css)</strong> - Sichere neue angepasste Stile direkt in die primäre Formatvorlage des Kindthemas (ersetze vorhandene Werte). Die primäre Formatvorlage wird in der vom Thema definierten Reihenfolge geladen.</li>
22
- <li><strong>Separate Formatvorlage</strong> - Sichere neue angepasste Stile in separate Formatvorlage und verwende bestehende Kindthemen-Stile als Basis. Diese Option wählen, wenn Sie die Original-Kindthemen-Stile behalten wollen (statt zu überschreiben). Diese Option erlaubt es Ihnen, nach der primären Formatvorlage geladene Formatvorlagen anzupassen.</li></ul></li>
23
- <li><strong>Elternthema-Formatvorlage Behandlung auswählen:</strong><ul>
24
- <li><strong>Benutze die WordPress Stil-Warteschlange.</strong> - Den Konfigurator die richtigen Aktionen und Abhängigkeiten auswählen lassen und Funktionendateien automatisch aktualisieren.</li>
25
- <li><strong>Benutze @import</strong> in der Kind-Thema-Formatvorlage. - Diese Option nur benutzen, wenn die Eltern-Formatvorlage nicht mit der WordPress-Warteschlange geladen werden kann. Die Benutzung von <code>@import</code> ist nicht länger empfohlen.</li>
26
- <li><strong>Keine zusätzliche Eltern-Formatvorlage-Behandlung hinzufügen.</strong> - Diese Option auswählen, wenn dieses Thema die Elternthema-Formatvorlage schon behandelt oder die Eltern-Thema <code>style.css</code>-Datei für die Darstellung/Anzeige nicht benutzt wird.</li></ul></li>
27
- <li><strong>Kind-Thema-Name, Beschreibung, Autor, Version etc. anpassen</strong></li>
28
- <li><strong>Kopieren der Elternthema-Menüs, Widgets und anderer Einstellungen in das Kind-Thema.</strong> - HINWEIS: Dies überschreibt alle im Kind-Thema vorgenommenen Änderungen und Einstellungen.</li>
29
- <li><strong>Klicken Sie auf die Schaltfläche</strong> um den Konfigurator zu starten.</li>
30
- <li><strong>WICHTIG: <a target="_blank" href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/how-to-use/#preview_activate" title="Testen Sie Ihr Kind-Thema vor der Aktivierung!">Testen Sie Ihr Kind-Thema immer mit der Live-Vorschau (Themen-Konfigurator) vor der Aktivierung!</a></strong></li>
 
 
 
 
 
31
  </ol>
32
  <!-- END tab -->
33
  <!-- BEGIN tab -->
34
- <h3 id="ctc_query_selector">Abfrage/Selektor-Tab</h3>
35
- <p>Es gibt zwei Wege, Eltern-Stile (Basiswerte) zu identifizieren und zu übersteuern. Der Child Theme Configurator lässt Sie Stile suchen nach <strong>Selektor</strong> oder nach <strong>Eigenschaft</strong>. Wenn Sie einen bestimmten Selektor ändern wollen (z.Bsp. h1), benutzen Sie den "Abfrage/Selektor"-Tab. Wenn Sie einen Wert Webseiten-weit ändern wollen (z.Bsp. die Farbe des Typs), benutzen Sie den "Eigenschaften/Wert"-Tab.</p>
36
- <p>Der Abfrage/Selektor-Tab lässt Sie bestimmte Selektoren finden und bearbeiten. Zuerst finden Sie die Abfrage, die den gesuchten Selektor enthält, indem Sie in die <strong>Abfrage</strong> Autoauswahl-Box schreiben. Wählen Sie durch Mausklick oder "Eingabe"- bzw. "Tabulator"-Tasten. Selektoren sind in der <strong>Basis</strong> Abfrage standardmäßig.</p>
 
 
 
37
  <p>Dann finden Sie den mit der Eingabe in der <strong>Selektor</strong> Autoauswahl-Box. Wählen Sie aus mit Mausklick oder der "Eingabe"- bzw. den "Tabulator"-Tasten.</p>
38
  <p>Dies lädt alle Eigenschaften für diesen Selektor mit den Eltern-Werten auf der linken und den Kind-Werten auf der rechten Seite. Alle bestehenden Kind-Werte werden automatisch abgefüllt. Es gibt auch eine Musteransicht, welches die Kombination der Eltern- und Kindwerte Übersteuerungen anzeigt. Beachten Sie, dass der <strong>Rahmen</strong> und <strong>Hintergrundbild</strong> speziell behandelt werden.</p>
39
- <p>Wenn Sie zusätzliche Eigenschaften zu einem bestehenden Selektor hinzufügen wollen, laden Sie zuerst den Selektor mit dem Abfrage/Selektor-Tab. Dann finden Sie die zu übersteuernde Eigenschaft mit der Eingabe in die <strong>Neue Eigenschaft</strong>-Auswahlbox. Wählen Sie mit einem Mausklick oder der Eingabe der ENTER- oder TAB-Taste. Dies wird der Auswahl eine neue Eingabezeile hinzufügen.</p>
40
- <p>Das "Reihenfolge"-Feld enthält die Original-Reihenfolge des Selektors der Eltern-Formatvorlage. Sie können die Selektor-Reihenfolge ändern, indem Sie eine tiefere/höhere Zahl im Reihenfolge-Feld eingeben. Sie können auch Stil-Übersteuerungen forcieren (sogenannter !important-Schalter), indem Sie das "!" Kästchen neben der Eingabe anwählen. Benutzen Sie es nicht zu oft.</p>
41
  <p>Klicken Sie auf "Sichern" um die Kind-Formatvorlage zu aktualisieren und die Änderungen im Wordpress-Admin zu speichern.</p>
42
  <!-- END tab -->
43
  <!-- BEGIN tab -->
44
- <h3 id="ctc_new_styles">Rohes CSS hinzufügen</h3>
45
- <p>Wenn Sie komplett neue Selektoren oder sogar @media-Queries hinzufügen wollen, können Sie formloses CSS im Textfeld "Rohes CSS" eingeben. Achten Sie auf eine korrekte Syntax (bspw. passende geschweifte Klammern etc.), damit der Parser die neuen Stile laden kann. Sie erkennen Fehler an einem roten "X", welches neben der Sichern-Schaltfläche erscheint.</p>
46
- <p>Wenn Sie die Shorthand-Syntax für Eigenschaften und Werte bevorzugen (anstatt der Vorgaben durch den Kind-Thema-Konfigurator), können Sie diese hier auch eingeben. Der Parser wir diese Eingaben automatisch in normalisierten CSS-Code konvertieren.</p>
47
- <p>Wenn Sie zusätzliche Eigenschaften zu einem bestehenden Selektor hinzufügen möchten, laden Sie zuerst den Selektor mit dem Abfrage/Selektor-Tab. Dann suchen Sie die Eigenschaft zum Übersteuern, indem Sie in die <strong>Neue Eigenschaft</strong>-Box schreiben. Wählen Sie mit einem Mausklick oder der Eingabe der ENTER- oder TAB-Taste. Dies wird der Auswahl eine neue Eingabezeile hinzufügen.</p>
48
  <!-- END tab -->
49
  <!-- BEGIN tab -->
50
- <h3 id="ctc_property_value">Eigenschaften/Wert-Tab</h3>
51
- <p>Es gibt zwei Wege, Eltern-Stile (Basiswerte) zu identifizieren und zu übersteuern. Der Child Theme Configurator lässt Sie Stile suchen nach <strong>Selektor</strong> oder nach <strong>Eigenschaft</strong>. Wenn Sie einen bestimmten Selektor ändern wollen (z.Bsp. h1), benutzen Sie den "Abfrage/Selektor"-Tab. Wenn Sie einen Wert Webseiten-weit ändern wollen (z.Bsp. die Farbe des Typs), benutzen Sie den "Eigenschaften/Wert"-Tab.</p>
52
- <p>Der Eigenschaften/Wert-Tab lässt Sie bestimmte Werte für eine gewisse Eigenschaft finden und ermöglicht dann das Bearbeiten für individuelle Selektoren, welche diese Eigenschaft-/Wert-Kombination benutzen. Zuerst finden Sie die Eigenschaft, die Sie übersteuern möchten, indem Sie diese in der <strong>Eigenschaft</strong> Autoauswahl-Box eingeben. Wählen Sie durch Mausklick oder "Eingabe"- bzw. "Tabulator"-Tasten.</p>
53
  <p>Dies lädt alle einzigartigen Werte dieser Eigenschaft in der Eltern-Formatvorlage mit einer Mustervorschau für diese Werte. Wenn Werte in der Kind-Formatvorlage existieren, die nicht in der Eltern-Formatvorlage enthalten sind, werden diese ebenfalls angezeigt.</p>
54
  <p>Für jeden einzigartigen Wert, klicken Sie auf die "Selektoren"-Verknüpfung, um eine Liste der Selektoren mit dieser Eigenschaften-/Wert-Kombination anzuzeigen, nach Abfrage gruppiert mit einer Muster-Vorschau der Werte und Eingaben für die Kind-Werte. Alle bestehenden Kind-Werte werden automatisch abgefüllt.</p>
55
  <p>Klicken Sie auf "Sichern" um die Kind-Formatvorlage zu aktualisieren und die Änderungen im Wordpress-Admin zu speichern.</p>
56
  <!-- END tab -->
57
  <!-- BEGIN tab -->
58
- <h3 id="ctc_imports">Webschriftarten-Tab</h3>
59
- <p>Sie können zusätzliche Formatvorlagen und Webschriftarten verknüpfen, indem Sie @import Regeln in das Textfeld auf dem Webschriftarten-Tab eingeben.</p>
60
  <p><strong>Hinweis:</strong> Child Theme Configurator schreibt nicht mehr länger @import Regeln in die Formatvorlage. Stattdessen benutzt es das @import Schlüsselwort und stellt sie in die Warteschlange. WordPress wandelt sie dann um in &lt;link&gt; Tags im verarbeiteten HTML.</p>
61
- <p>Wichtig: importieren Sie die Eltern-Formatvorlage nicht hier. Benutzen Sie die "Eltern-Formatvorlage-Behandlung"-Option auf dem Eltern/Kind-Tab.</p>
62
- <p>Wenn Sie eine Formatvorlage unter "Zusätzliche Formatvorlegen einlesen" gewählt haben, als Sie das Kind-Thema erstellt haben, werden diese Stile für Übersteuerungen in der Kind-Formatvorlage zur Verfügung stehen.</p>
63
  <p>WordPress lädt automatisch zusätzliche Formatvorlagen, wenn es das Eltern-Thema lädt, also müssen Sie @import rules dafür hier nicht hinzufügen.</p>
64
- <p>Unten ist ein Beispiel, welche eine lokale angepasste Formatvorlage lädt (Sie müssen das "fonts"-Verzeichnis und die Formatvorlage hinzufügen), sowie die Schriftart "Open Sans" von Google Web Fonts:</p>
65
- <blockquote><pre><code>&#64;import url(fonts/Formatvorlage.css);
66
  &#64;import url(http://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700,700italic);</code></pre></blockquote>
67
  <!-- END tab -->
68
  <!-- BEGIN tab -->
69
- <h3 id="ctc_files">Dateien-Tab</h3>
70
  <h5>Eltern-Vorlagen</h5>
71
  <p>Kopieren von PHP-Vorlagendateien des Eltern-Themes, indem Sie die Kästchen auswählen und "Auswahl zu gewählten Kind-Themen kopieren", und die Vorlage wird zum Kind-Themenverzeichnis hinzugefügt.</p>
72
  <p><strong>ACHTUNG: Wenn Ihr Kind-Thema aktiv ist, wird nach dem Kopiervorgang sofort die Kind-Thema-Version der Datei anstatt der Eltern-Datei benutzt.</strong></p>
@@ -78,7 +85,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
78
  <p>Diese Bilder befinden sich unter dem <code>Images</code>-Verzeichnis in Ihrem Kind-Thema-Verzeichnis und sind nur für Formatvorlagen vorgesehen. Benutzen Sie die Medienbibliothek für Inhaltsbilder.</p>
79
  <p>Sie können neue Bilder mittels des "Bild hochladen"-Formulars hochladen. Löschen Sie Bilder durch die Auswahl der Kästchen und dem Klicken auf "Auswahl löschen".</p>
80
  <h5>Kind-Thema Screenshot</h5>
81
- <p>Sie können hier einen speziellen/angepassten Screenshot für das Kind-Thema hochladen.</p>
82
  <p>Der Themen-Screenshot sollte ein 4:3-Verhältnis aufweisen (z.Bsp, 880px x 660px) JPG, PNG oder GIF. Es wird in <code>screenshot</code> umbenannt.</p>
83
  <h5>Kind-Thema als ZIP-Archiv exportieren </h5>
84
  <p>Sie können Ihr Kind-Thema für den Gebrauch auf einer anderen Wordpress-Webseite herunterladen, indem Sie auf "Export" klicken.</p>
@@ -87,16 +94,16 @@ if ( !defined( 'ABSPATH' ) ) exit;
87
  <h3 id="ctc_preview">Vorschau und Aktivierung</h3>
88
  <p><strong>WICHTIG: <a target="_blank" href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/how-to-use/#preview_activate" title="Testen Sie Ihr Kind-Thema vor der Aktivierung!">Testen Sie Ihr Kind-Thema vor der Aktivierung!</a></strong> Einige Themen (hauptsächlich kommerzielle Themen) laden Eltern-Formatvorlagen nicht korrekt oder laden Kind-Formatvorlagen automatisch oder PHP-Dateien. <strong>Im schlimmsten Fall wird bei Aktivierung Ihre Webseite unbrauchbar.</strong></p>
89
  <ol>
90
- <li>Navigieren Sie zu Design > Themen im Wordpress-Admin. Sie werden nun die neuen Kind-Themen als eine der installierten Themen sehen.</li>
91
  <li>Klicken Sie auf "Live-Vorschau" unterhalb des Kind-Themas, um es in Aktion zu sehen.</li>
92
- <li>Wenn Sie das Kind-Thema nun live schalten wollen, klicken Sie auf "Aktivieren."</li>
93
  </ol>
94
  <p><strong>MULTISITE NUTZER:</strong> Sie müssen Ihr Thema Netzwerk-aktivieren, um es in der Live-Vorschau zu sehen. Gehen Sie zu 'Themen' in der Netzwerk-Administration.</p>
95
  <!-- END tab -->
96
  <!-- BEGIN tab -->
97
  <h3 id="ctc_permissions">Dateiberechtigungen</h3>
98
  <p>Wordpress wurde für verschiedene Serverkonfigurationen entwickelt. Child Theme Configurator benutzt die WordPress Filesystem API, um Webseiten das Bearbeiten von Dateien zu ermöglichen, die Nutzerberechtigungen benötigen.</p>
99
- <p>Allerdings, weil die meiste Funktionalität mittels AJAX(Hintergrund)-Anfragen passiert, muss die Kind-Formatvorlage auf dem Server beschreibbar sein.</p>
100
  <p>Das Plugin erkennt automatisch Ihre Konfiguration und liefert eine Anzahl von Optionen, um diese Anforderung zu lösen. Benutzen Sie die zur Verfügung gestellten Verknüpfungen, um mehr zu erfahren, beispielsweise:</p>
101
  <ol>
102
  <li>Die Formatvorlage mithilfe des Plugins vorübergehend schreibbar machen.</li>
@@ -107,7 +114,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
107
  <!-- END tab -->
108
  <!-- BEGIN tab -->
109
  <h3 id="ctc_faq">FAQs</h3>
110
- <<h5 id="broken_theme">HILFE! Ich habe eine Datei geändert und kann nun über nicht mehr über wp-admin einloggen, um es zu reparieren!</h5>
111
  <p>Um aus einem defekten Thema herauszukommen, müssen Sie das problematische Themen-Verzeichnis umbenennen (via FTP, SSH oder Ihrem Webhoster-Kontrollpanel bzw. Dateimanager), so dass Wordpress es nicht mehr finden kann. WordPress wird dann einen Fehler generieren und zum Standard-Thema zurückkehren (aktuell Twenty-Fourteen).</p>
112
 
113
  <p>Das Kind-Thema ist normalerweise in Ihrem Themen-Verzeichnis</p>
@@ -123,93 +130,88 @@ if ( !defined( 'ABSPATH' ) ) exit;
123
  <h5 id="options_broken">Wieso verschwinden meine Themen-Optionen, wenn ich das Kind-Thema aktiviere?</h5>
124
  <p>Diese Optionen sind für jedes Thema spezifisch und werden getrennt in der Datenbank gespeichert. Beim Erstellen eines neuen Kind-Themas sind diese Optionen leer.</p>
125
 
126
- <p><strong>Viele dieser Optionen können in das Kind-Thema kopiert werden, indem man das Kästchen "Kopieren Eltern-Theme-Menüs, Widgets und andere Design-Optionen" anklickt, wenn Sie die Kind-Thema-Dateien auf dem Eltern/Kind-Tab erstellen.</strong></p>
127
 
128
  <p>Wenn Sie andere Optionen setzen wollen, können Sie diese nach dem Aktivieren des Kind-Themas aktivieren, oder mittels der Live-Vorschau unter Design > Themen.</p>
129
  <ul class="instructions">
130
- <li><strong>Menüs: </strong> Gehen Sie zu Design > Menüs und klicken Sie den "Position"-Tab. Standardmäßig wird das Primärmenü die Verknüpfungen automatisch aus den bestehenden Seiten erstellen. Wählen Sie Ihr angepasstes Menü aus der Auswahlliste und klicken Sie "Neues Menü benutzen". Dies ersetzt das Standardmenü und Sie sehen die korrekten Verknüpfungen.</li>
131
 
132
- <li><strong>Header (Kopf): </strong> Gehen Sie zu Design > Header. Einige Themen zeigen standardmäßig den Titel und die Tagline Ihrer "Allgemeinen Einstellungen". Wählen Sie "Bild auswählen" und finden Sie einen "Kopf" aus der Medienbibliothek oder mittels Hochladen. Dies ersetzt den Standard mit dem angepassten Bild.</li>
133
 
134
- <li><strong>Hintergrund: </strong> Gehen Sie zu Design > Hintergrund und wählen Sie ein neues Hintergrundbild oder eine Farbe.</li>
135
 
136
- <li><strong>Optionen: </strong> Jedes Thema behandelt Optionen speziell/anders. Meistens erstellen Sie einen Satz Optionen und speichern ihn in der Wordpress-Datenbank. Einige Optionen sind spezifisch für das aktive Thema (oder Kind-Thema), und einige nur für das Eltern-Thema bestimmt (d.h. das Kind-Thema kann sie NICHT übersteuern). Sie müssen sich beim Themen-Autor erkundigen, welche auf welche Art funktionieren.</li>
137
  </ul>
138
  </p>
139
  <h5 id="existing_parent">Wie verschiebe ich bereits gemachte Änderungen an meinem Thema in mein Kind-Thema?</h5>
140
  <p><a href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/how-to-use/#child_from_modified_parent" class="scroll-to">Folgen Sie diesen Schritten</a>. </p>
141
  <h5 id="web_fonts">Wie füge ich Webschriftarten hinzu?</h5>
142
- <p>Die einfachste Methode ist das Einfügen des @import code, geliefert von <a href="http://www.google.com/fonts" title="Google Fonts">Google</a>, <a href="http://www.fontsquirrel.com/" title="Font Squirrel">Font Squirrel</a> oder jeder anderen Schriftartenseite auf dem Schriftarten-Tab. Die Schriftarten werden dann zum Gebrauch als Wert der <strong>font-family</strong> Eigenschaft zur Verfügung stehen. Stellen Sie sicher, dass Sie die Lizenz zum Gebrauch der Webschriftarten verstehen. </p>
143
- <p>Sie können auch eine sekundäre Formatvorlage erstellen, welche die @font-face Regeln enthält, und diese auf dem Webschriftarten-Tab importieren. </p>
144
  <h5 id="plugin">Funktionert das mit Plugins?</h5>
145
  <p>Wir bieten eine Premium-Erweiterung an, die Sie Stile für jedes auf der Webseite installierte Plugin einfach verändern lässt. Der Child Theme Configurator Plugin Extension scannt Ihre Plugins und erlaubt die Erstellung von angepassten Formatvorlagen in Ihrem Kind-Thema. <a href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/child-theme-configurator-pro/" title="Die Kontrolle über Ihre Plugin-Stile mit der Child Theme Configurator Plugin Erweiterung für WordPress übernehmen">Mehr erfahren <i class="genericon genericon-next"></i></a>
146
  <h5 id="doesnt_work">Wieso funktioniert das in meinem (Hersteller des Themas hier einfügen) Thema nicht?</h5>
147
  <p>Einige Themen (hauptsächlich kommerzielle Themen) laden die Eltern-Vorlagen-Dateien nicht korrekt oder laden Kind-Thema-Formatvorlagen oder PHP-Dateien automatisch.</p><p>Das ist unglücklich, weil es im besten Fall den Webmaster daran hindert, Anpassungen vorzunehmen (abgesehen von solchen durch die Themen-Optionen), die einen Upgrade überleben. <strong>Im schlimmsten Fall jedoch wird Ihre Webseite unbrauchbar, wenn Sie das Kind-Thema aktivieren.</strong> </p>
148
  <p>Kontaktieren Sie direkt den Hersteller, um diese Kern-Funktionalität zu verlangen. Unserer Meinung nach sollten ALLE Themen (vor allem kommerzielle) die von Wordpress.org beschriebenen Themen-Tests erfüllen. </p>
149
  <h5 id="missing_parent">Wieso hat das Eltern-Thema keine Stile, wenn ich auf "Eltern-CSS anzeigen" gehe?</h5>
150
- <p>Ihr Eltern-Thema benutzt für die Formatvorlagen womöglich einen getrennten Ort. Wählen Sie individuelle Formatvorlagen aus dem "Zusätzliche Formatvorlagen auslesen"-Abschnitt des Eltern/Kind-Tabs und klicken Sie erneut auf "Neuaufbau Kind-Thema-Dateien". </p>
151
  <h5 id="performance">Wird das meine Webseite verlangsamen?</h5>
152
  Sobald die Kind-Formatvorlage erstellt ist, fügt CTC im Frontend nur ein wenig Zusatzlast hinzu, da die ganze Funktionalität im Admin enthalten ist.
153
 
154
- Das Plugin lädt den Hauptteil des Codes im Admin nur, wenn Sie das Tool benutzen. Die größte Performance-Einbuße geschieht, wenn Sie die Kind-Themen-Dateien auf dem Eltern/Kind-Tab erstellen. </p>
155
  <h5 id="where_are_styles">Wo sind die Stile? Der Konfigurator zeigt nichts an!</h5>
156
  <p>Alle Stile werden dynamisch geladen. Sie müssen in den Textfelder etwas eingeben, um die Stile zum Bearbeiten auszuwählen.</p>
157
  <p>"Base" ist die Abfragegruppe, die mit keiner bestimmten at-Regel verbunden sind.</p>
158
- <p>Beginnen Sie mit einem Klick auf den "Abfage/Selektor"-Tab und der Eingabe von "base" in der ersten Box. In der zweiten Box können Sie dann mit der Eingabe beginnen, um die Stil-Selektoren zum Bearbeiten zu holen. </p>
159
- <h5 id="preview-not-loading">Wieso zeigen die Vorschau-Tab "Formatvorlage kann nicht angezeigt werden"?</h5>
160
- <p>Sie müssen ein Kind-Thema auf dem Eltern/Kind-Tab für die Ansicht der Vorschau laden. Das kann auch passieren, wenn Ihre WP_CONTENT_URL sich von $bloginfo('site_url') unterscheidet. Ajax kann keine domänenübergreifenden Abfagen machen. Überprüfen Sie, ob der Einstellungen > Allgemein > "WordPress Adresse (URL)"-Wert korrekt ist. (Oft fehlt das "www"" in der Domäne.) </p>
161
  <h5 id="edit_manually">Kann ich das Kind-Thema manuell offline bearbeiten (oder mithilfe des Editors), oder muss ich unbedingt den Konfigurator benutzen?</h5>
162
  <p>Sie können jede gewünschte Änderung an der Formatvorlage vornehmen. Stellen Sie nur sicher, die geänderte Formatvorlage mittels des Eltern/Kind-Panels zu importieren, ansonsten wird der Konfigurator Ihre Änderungen beim nächsten Gebrauch überschreiben. Folgen Sie den üblichen Schritten, aber wählen Sie die Auswahloption "Bestehendes Kind-Thema benutzen" als Kind-Thema-Option. Der Konfigurator wird die internen Daten aus der neuen Formatvorlage automatisch aktualisieren. </p>
163
  <h5 id="update_child">Wenn das Eltern-Thema geändert wird (z.Bsp. Upgrade), muss ich das Kind-Thema aktualisieren?</h5>
164
  <p>Nein. Das ist der Zweck von Kind-Themen. Änderungen am Eltern-Thema werden vom Kind-Thema automatisch geerbt.</p>
165
  <p>Ein Kind-Thema ist keine Kopie eines Eltern-Themas. Es ist eine besondere Funktion von WordPress, die Sie bestimmte Stile und Funktionen übersteuern lässt, während der Rest intakt bleibt. Das einzige Mal, dass Sie nach einem Upgrade Änderungen machen müssen ist, wenn das Eltern-Thema Stile oder Funktionsnamen ändert oder entfernt. Qualitäts-Themen sollten alle veralteten Funktionen oder Stile in den Upgrade-Hinweisen erwähnen, so dass Nutzer von Kind-Themen die entsprechenden Anpassungen vornehmen können. </p>
166
  <h5 id="functions">Wo sind die .PHP-Dateien?</h5>
167
- <p>Der Konfigurator fügt dem Kind-Themenverzeichnis automatisch eine leere functions.php-Datei hinzu. Sie können Dateien des Eltern-Themas mittels des "Dateien"-Tabs kopieren. Wenn Sie neue Vorlagen und Verzeichnisse erstellen möchten, müssen Sie diese manuell via FTP oder SSH hochladen. Beachten Sie, dass ein Kind-Thema die Eltern-Vorlagen automatisch erbt, es sei denn, sie bestehen bereits im Kind-Thema-Verzeichnis. Kopieren Sie nur Vorlagen, die Sie auch wirklich anpassen möchten.</p>
168
  <h5 id="specific_color">Wie ändere ich eine(n) bestimmte Farbe/Schriftarttyp/Hintergrund?</h5>
169
- <p>Sie können einen bestimmten Wert global mittels des Eigenschaften/Wert-Tabs übersteuern. Siehe Eigenschaften/Werte, oben.</p>
170
  <h5 id="add_styles">Wie füge ich Stile hinzu, die nicht im Eltern-Thema enthalten sind?</h5>
171
- <p>Sie können Abfragen und Selektoren mittels des "Rohes CSS"-Textfelds auf dem Abfrage/Selektor-Tab hinzufügen. Siehe Abfrage/Selektor, oben. </p>
172
  <h5 id="add_styles">Wie entferne ich Stile aus dem Eltern-Thema?</h5>
173
  <p>Sie sollten eigentlich Stile aus dem Eltern-Thema nicht entfernen. Sie können allerdings die Eigenschaft auf "Erben"," "Keine," oder Null setzen (abhängig von der Eigenschaft). Das wird den Eltern-Wert negieren. Ein wenig Probieren wird nötig sein.</p>
174
  <h5 id="remove_styles">Wie entferne ich einen Stil aus einem Kind-Thema?</h5>
175
  <p>Löschen Sie den Wert aus der Eingabe der Eigenschaft, die sie entfernen möchten. Der Child Theme Configurator fügt Übersteuerungen nur für Eigenschaften mit Werten hinzu. </p>
176
  <h5 id="important_flag">Wie setze ich den !important-Schalter?</h5>
177
  <p>Wir empfehlen immer ein gutes, verschachteltes Design, anstatt auf globale Übersteuerungen zu vertrauen. Dazu haben Sie die Möglichkeit, die Lade-Reihenfolge von Kind-Formatvorlagen zu ändern, indem Sie einen Wert im "Reihenfolge"-Feld eingeben. Sie können Eigenschaften als wichtig setzen, indem Sie das Kästchen mit dem "!" neben jeder Eingabe setzen. Benutzen Sie es massvoll. </p>
178
- <h5 id="gradients">Wie erstelle ich browser-unabhängige Farbverläufe?</h5>
179
  <p>Der Child Theme Configurator benutzt eine standarisierte Syntax für Farbverläufe und unterstützt nur zweifarbige Verläufe ohne Zwischenstopps. Die Eingaben bestehen aus dem Startpunkt (z.Bsp. top, left, 135deg, etc.), der Startfarbe und der Endfarbe. Browser-spezifische Syntax wird automatisch erstellt, wenn Sie diese Werte speichern. Siehe Tricks/Fallen, unten, für weitere Informationen. </p>
180
  <h5 id="responsive">Wie mache ich das Thema responsive?</h5>
181
  <p>Die kurze Antwort ist, ein responsives Eltern-Thema zu benutzen. Einige übliche Methoden für responsives Design sind:
182
  <ul class="instructions"><li>Vermeiden von festen Breiten und Höhen. Der Gebrauch von max- and min-height Werten und Prozenten sind Wege, das Design dem Browser des Benutzers anzupassen.</li>
183
  <li>Die Kombination von floats und clears mit inline und relative-Positionen erlaubt den Elementen, sich der umgebenden Behälterbreite fließend anzupassen.</li>
184
- <li>Anzeigen und Verbergen von Inhalt mittels JavaScript.</li></ul>
185
  <!-- END tab -->
186
  <!-- BEGIN tab -->
187
  <h3 id="ctc_glossary">Glossar</h3>
188
  <ul>
189
  <li id="parent_theme"><strong>Eltern-Thema</strong> Das Wordpress-Thema, welches Sie bearbeiten möchten. Wordpress lädt zuerst das Kind-Thema, dann das Eltern-Thema. Wenn ein Stil im Kind-Thema enthalten ist, übersteuert es das Eltern-Thema.</li>
190
  <li id="child_theme"><strong>Kind-Thema</strong> Neues Thema, basierend auf einem Eltern-Thema. Sie können eine beliebige Anzahl von Kind-Themen von einem einzigen Eltern-Thema erstellen.</li>
191
- <li id="class"><strong>Klasse</strong> Ein Begriff, der zum Organisieren von Objekten benutzt wird. Zum Beispiel, ein &lt;div&gt; könnte die "blue-text"-Klasse zugewiesen sein. Die Formatvorlage weist dann Mitgliedern der "blue-text"-Klasse den Wert "color: blue;" zu. Somit würde &lt;div&gt; als blauer Text im Browser dargestellt. Klassen-Selektoren beginnen mit einem Punkt.</li>
192
- <li id="class"><strong>ID</strong> Eine einzigartige Zeichenkette, die ein bestimmtes Element bezeichnet. ID-Selektoren beginnen mit einem Hashtag (#).</li>
193
- <li id="selector"><strong>Abfrage</strong> @media-Query-Anweisungen (siehe At-Regel unten).</li>
194
- <li id="query"><strong>Selektor</strong> Kombination eines oder mehrere Elemente, Klassen, IDs oder andere Begriffe zum Identifizieren von Objektgruppen.</li>
195
  <li id="property"><strong>Eigenschaft</strong> Einer von vielen standardisierten Begriffen, die dem Browser mitteilen, wie Objekte mit einem bestimmten Selektor anzuzeigen sind. Beispiele sind <strong>color</strong>, <strong>background-image</strong> und <strong>font-size</strong>.</li>
196
- <li id="value"><strong>Wert</strong> Daten, die mit einer Eigenschaft korrespondieren.</li>
197
  <li id="at-rule"><strong>At-Regel</strong> Ein CSS-Browser-Befehl, um die Standard-Funktionalität zu erweitern. Der Child Theme Configurator unterstützt zwei At-Regeln:
198
  <ul>
199
- <li id="at_import"><strong>@import</strong> Weist den Browser an, zusätzliche CSS-Informationen aus einer externen Quelle zu laden.</li>
200
- <li id="at_media"><strong>@media (Media Query)</strong> Identifiziert Stilblöcke, die nur benutzt werden, wenn gewisse Browser-Eigenschaften zutreffen. Beispiele sind max-width, screen und print.</li>
201
  </ul>
202
  </li>
203
- <li id="child_theme"><strong>Basis-Stil</strong> Ein Stil einer beliebigen Kind- oder Eltern-Vorlage, der durch die Formatvorlage des Kind-Themas übersteuert werden kann. Meistens stammen diese aus der Formatvorlage des Eltern-Themas.</li>
204
- <li id="override"><strong>Übersteuerung</strong> Wenn ein Selektor in Kind- und Eltern-Thema besteht, bekommt derjenige aus dem Kind-Thema Priorität. Das ist eines der besonderen Merkmale des Kind-Thema-Konfigurators: es hilft dabei, <strong>exakte Übersteuerungen</strong> von Selektoren des Eltern-Themas zu erstellen, und eliminiert viele Stunden des mühsamen Versuchens.</li>
205
- <li id="child_theme"><strong>Themenvorlage</strong> Eine PHP-Datei eines Themas ohne Funktionen und Klassen. Andere PHP-Dateien können nicht ohne Weiteres sicher überschrieben werden.</li>
206
  </ul>
207
  <!-- END tab -->
208
  <!-- BEGIN sidebar -->
209
- <h4>Unsere Plugins werden Sie nicht mit Spendeneinblendungen nerven...</h4>
210
  <span style="font-size:smaller">...aber wir LIEBEN Empfehlungen.</span><br/><a href="http://wordpress.org/support/view/plugin-reviews/child-theme-configurator?rate=5#postform">Geben Sie uns 5 Sterne</a>
211
- <h4>Wir stellen CTC Pro vor</h4>
212
- <a href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/child-theme-configurator-pro/" title="Erfahren Sie mehr über CTC Pro"><img src="<?php echo CHLD_THM_CFG_URL . 'css/pro-banner.jpg'; ?>" width="150" height="48" /></a>
213
  <p style="font-size:smaller">Von Wordpress-Entwicklern entworfen, die es jeden Tag benutzen. CTC Pro stellt Plugin-Formatvorlagen und andere Funktionen zur Verfügung, die Ihre Arbeit schneller und einfacher machen. Das ist ein kostenloses Upgrade für Nutzer, die die Plugin-Erweiterung erworben haben. <a href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/child-theme-configurator-pro/" title="Child Theme Configurator Pro">Mehr erfahren</a></p>
214
  <h4 id="ctc_help_sidebar">Links/Verknüpfungen</h4>
215
  <ul>
3
  // Help Content
4
  ?>
5
  <!-- BEGIN tab -->
6
+ <h3 id="ctc_getting_started">Hier beginnen</h3>
7
+ <p><strong style="font-size:large">10 einfache Schritte zur Erstellung eines Kind-Themas:</strong></p>
8
+ <ol>
9
+ <li><strong>Thema zum Konfigurieren auswählen</strong> aus dem &quot;Eltern-Thema&quot; Menü.</li>
10
+ <li><strong>Wählen Sie &quot;neues&quot; oder &quot;existierendes&quot;.</strong>
11
+ <ul>
12
+ <li>Wenn keine Kind-Themen verfügbar sind, werden das &quot;Kind-Thema&quot; und &quot;Kind-Thema-Name&quot; automatisch basierend auf dem ausgewählten Eltern-Thema eingefügt. Sie können diese bei Bedarf ändern, aber es darf nicht gleich wie ein bestehendes lauten.</li>
13
+ <li>Wenn bestehende Kind-Themen verfügbar sind, gibt es ein zusätzliches Menü bezeichnet mit &quot;Benutze bestehende Kind-Themen&quot; von diesen können Sie auswählen, oder einen neuen Wert zum Neu-Erstellen eingeben.</li>
14
+ </ul>
15
+ </li>
16
+ <li><strong>Optional: Eingabe von Themen-Name, Themen-Webseite, Autor, Autor-Webseite, Beschreibung, Schlagwörtern und Version</strong> für das Kind-Thema. Wird ein bestehendes Kind-Thema benutzt, werden die Werte automatisch basierend auf dem ausgewählten Kind-Thema eingefügt.</li>
17
+ <li><strong>Wählen Sie, wie Wordpress die Eltern-Formatvorlage behandeln soll:</strong>
18
+ <ul>
19
+ <li><strong>Keine (vom Thema behandelt)</strong>
20
+ Diese Option auswählen, wenn alle Formatvorlagen für Kind-Themen korrekt eingebunden werden. Wenn Stile nicht korrekt angewendet werden, benutzen Sie eine andere Option</li>
21
+ <li><strong>Eltern-Formatvorlage einbinden (Standard)</strong>
22
+ Diese Option auswählen, wenn das Thema die aktive Formatvorlage einbindet (enqueued), aber keine Sonderbehandlung für Kind-Themen hat. Bei Unsicherheit mit dieser Option beginnen..</li>
23
+ <li><strong>Kind-Formatvorlage einbinden</strong>
24
+ Diese Option auswählen, wenn das Thema die Eltern-Formatvorlage einbindet (enqueued), aber die Kind-Formatvorlage überhaupt nicht einbindet. Dies kann passieren, wenn <code>get_template()</code> oder <code>get_template_directory_uri()</code> zum Verknüpfen von Formatvorlagen benutzt wird.</li>
25
+ <li><strong>Eltern- und Kind-Formatvorlage einbinden</strong>
26
+ Diese Option auswählen, wenn Formatvorlagen-Linktags im Header-Template fix codiert sind (normalerweise in älteren Themen). Dies aktiviert die Übersteuerung der Eltern-Formatvorlage durch die Kind-Formatvorlage ohne das Benutzen von <code>@import</code>.</li>
27
+ <li><strong><code>@import</code> der Eltern-Formatvorlage</strong>
28
+ Diese Option importiert die Eltern-Formatvorlage aus der Kind-Formatvorlage. Das erlaubt der Kind-Formatvorlage die Übersteuerung der Eltern-Formatvorlage, jedoch ist das Benutzen von <code>@import</code> nicht mehr empfohlen.</li>
29
+ </ul></li>
30
+ <li><strong>Benutzen der Eltern-Optionen(optional)</strong> Wenn Sie die gleichen Optionen wie im Eltern-Thema verwenden wollen, wählen Sie "Kopieren Eltern-Thema-Menüs, Widgets und andere Optionen". Abhängig vom Thema müssen eventuell einige Optionen separat eingestellt werden. <strong>HINWEIS: Dies wird die Kind-Thema-Optionen überschreiben, die Sie vielleicht schon gesetzt haben.</strong></li>
31
+ <li><strong>Backup sichern (optional)</strong> Bei einem bestehenden Kind-Thema können Sie "Backup Formatvorlage" auswählen, um eine Sicherung Ihrer Kind-Formatvorlage im Themen-Verzeichnis zu erstellen.</li>
32
+ <li><strong>Wiederherstellen von Sicherung (optional - neu in Version 1.6.0):</strong> Bei einem bestehenden Kind-Thema können Sie wählen, die Kind-Formatvorlage neu zu laden (unverändert lassen), alle Werte zurückzusetzen, oder es aus der Sicherung wiederherzustellen. Wenn Sicherungsdateien vorhanden sind, erscheinen entsprechende Auswahlknöpfe.</li>
33
+ <li><strong>Zusätzliche Formatvorlagen auswählen</strong> Benutzt ihr Thema zusätzliche Formatvorlagen, können Sie &quot;Zusätzliche Formatvorlagen auslesen&quot öffnen; umschalten und sie erscheinen als Auswahlkästchen. Formatvorlagen in Gebrauch des Eltern-Themas sollten automatisch für Sie ausgewählt werden. Wählen Sie nur Formatvorlagen aus, die Sie ändern wollen, um eine unnötige Last zu vermeiden. <strong>HINWEIS: Benutzt das Eltern-Thema Bootstrap-Formatvorlagen, werden Sie automatisch ausgewählt.</strong> Sie können Bootstrap-Formatvorlagen manuell auswählen, wenn Sie sie anpassen müssen, aber in den meisten Fällen erzeugt es nur unnötige Mehrbelastung.</li>
34
+ <li><strong>Klicken Sie auf "Erstellen/Neuaufbau Kind-Thema-Dateien."</strong></li>
35
+ <li><strong>WICHTIG: <a target="_blank" href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/how-to-use/#preview_activate" title="Testen Sie Ihr Kind-Thema vor der Aktivierung!">Testen Sie das Kind-Thema immer mit der Live-Vorschau vor der Aktivierung!</a></strong></li>
36
  </ol>
37
  <!-- END tab -->
38
  <!-- BEGIN tab -->
39
+ <h3 id="ctc_tutorial">Tutorial-Videos</h3>
40
+ <p>Wir betten aus Performance-Gründen nicht mehr länger Tutorial-Videos ein. <a href="http://www.childthemeconfigurator.com/tutorial-videos" target="_blank">Hier klicken, um Videos anzuschauen.</a></p><!-- END tab -->
41
+ <!-- BEGIN tab -->
42
+ <h3 id="ctc_query_selector">Abfrage/Selektor-Reiter</h3>
43
+ <p>Es gibt zwei Wege, Eltern-Stile zu identifizieren und zu übersteuern. Der Child Theme Configurator lässt Sie Stile suchen nach <strong>Selektor</strong> oder nach <strong>Eigenschaft</strong>. Wenn Sie einen bestimmten Selektor ändern wollen (z.Bsp. h1), benutzen Sie den "Abfrage/Selektor"-Reiter. Wenn Sie einen Wert Webseiten-weit ändern wollen (z.Bsp. die Farbe des Typs), benutzen Sie den "Eigenschaften/Wert"-Reiter.</p>
44
+ <p>Der Abfrage/Selektor-Reiter lässt Sie bestimmte Selektoren finden und bearbeiten. Zuerst finden Sie die Abfrage, die den gesuchten Selektor enthält, indem Sie in die <strong>Abfrage</strong> Autoauswahl-Box schreiben. Wählen Sie durch Mausklick oder "Eingabe"- bzw. "Tabulator"-Tasten. Selektoren sind in der <strong>Basis</strong> Abfrage standardmäßig.</p>
45
  <p>Dann finden Sie den mit der Eingabe in der <strong>Selektor</strong> Autoauswahl-Box. Wählen Sie aus mit Mausklick oder der "Eingabe"- bzw. den "Tabulator"-Tasten.</p>
46
  <p>Dies lädt alle Eigenschaften für diesen Selektor mit den Eltern-Werten auf der linken und den Kind-Werten auf der rechten Seite. Alle bestehenden Kind-Werte werden automatisch abgefüllt. Es gibt auch eine Musteransicht, welches die Kombination der Eltern- und Kindwerte Übersteuerungen anzeigt. Beachten Sie, dass der <strong>Rahmen</strong> und <strong>Hintergrundbild</strong> speziell behandelt werden.</p>
47
+ <p>Das "Reihenfolge"-Feld enthält die Original-Reihenfolge des Selektors der Eltern-Formatvorlage. Sie können die Selektor-Reihenfolge ändern, indem Sie eine tiefere/höhere Zahl im Reihenfolge-Feld eingeben. Sie können auch Stil-Übersteuerungen forcieren (!important-Schalter), indem Sie das "!" Kästchen neben der Eingabe anwählen. Benutzen Sie es massvoll.</p>
 
48
  <p>Klicken Sie auf "Sichern" um die Kind-Formatvorlage zu aktualisieren und die Änderungen im Wordpress-Admin zu speichern.</p>
49
  <!-- END tab -->
50
  <!-- BEGIN tab -->
51
+ <h3 id="ctc_new_styles">Neue Stile hinzufügen</h3>
52
+ <p>Wenn Sie einem Selektor zusätzliche Eigenschaften hinzufügen wollen, laden Sie zuerst den Selektor mittels des "Abfrage/Selektor-Reiters. Dann finden Sie die Eigenschaft, welche Sie übersteuern wollen, indem Sie sie in der <strong>Neue Eigenschaft</strong> Autoauswahl-Box eingeben. Wählen Sie durch Mausklick oder "Eingabe"- bzw. "Tabulator"-Tasten. Dies fügt eine neue Eingabezeile zur Selektoren-Eingabe hinzu.</p>
53
+ <p>Wenn Sie komplett neue Selektoren hinzufügen möchten, oder gar @media Abfragen, können Sie beliebiges CSS im Kasten "Rohes CSS" eingeben. Achten Sie auf absolut korrekte Syntax (z.Bsp. ausgeglichene geschweifte Klammerpaare etc.) für den Parser, um die neuen Stile zu laden. Ein rotes "X" erscheint, wenn die Syntax ungültig ist.</p>
54
+ <p>Wenn Sie Shorthand-Syntax für die Eigenschaften/Werte bevorzugen (anstatt der zur Verfügung gestellten Eingaben des Child Theme Configurator), können Sie diese hier auch eingeben. Der Parser wird Ihre Eingaben automatisch in normalisiertes CSS umwandeln.</p>
55
  <!-- END tab -->
56
  <!-- BEGIN tab -->
57
+ <h3 id="ctc_property_value">Eigenschaften/Wert-Reiter</h3>
58
+ <p>Es gibt zwei Wege, Eltern-Stile zu identifizieren und zu übersteuern. Der Child Theme Configurator lässt Sie Stile suchen nach <strong>Selektor</strong> oder nach <strong>Eigenschaft</strong>. Wenn Sie einen bestimmten Selektor ändern wollen (z.Bsp. h1), benutzen Sie den "Abfrage/Selektor"-Reiter. Wenn Sie einen Wert Webseiten-weit ändern wollen (z.Bsp. die Farbe des Typs), benutzen Sie den "Eigenschaften/Wert"-Reiter.</p>There are two ways to identify and override parent styles. The Child Theme Configurator lets you search styles by <strong>selector</strong> and by <strong>property</strong>. If you wish to change a specific selector (e.g., h1), use the "Query/Selector" tab. If you have a specific value you wish to change site-wide (e.g., the color of the type), use the "Property/Value" tab.</p>
59
+ <p>Der Eigenschaften/Wert-Reiter lässt Sie bestimmte Werte für eine gewisse Eigenschaft finden und ermöglicht dann das Bearbeiten für individuelle Selektoren, welche diese Eigenschaft-/Wert-Kombination benutzen. Zuerst finden Sie die Eigenschaft, die Sie übersteuern möchten, indem Sie diese in der <strong>Eigenschaft</strong> Autoauswahl-Box eingeben. Wählen Sie durch Mausklick oder "Eingabe"- bzw. "Tabulator"-Tasten.</p>
60
  <p>Dies lädt alle einzigartigen Werte dieser Eigenschaft in der Eltern-Formatvorlage mit einer Mustervorschau für diese Werte. Wenn Werte in der Kind-Formatvorlage existieren, die nicht in der Eltern-Formatvorlage enthalten sind, werden diese ebenfalls angezeigt.</p>
61
  <p>Für jeden einzigartigen Wert, klicken Sie auf die "Selektoren"-Verknüpfung, um eine Liste der Selektoren mit dieser Eigenschaften-/Wert-Kombination anzuzeigen, nach Abfrage gruppiert mit einer Muster-Vorschau der Werte und Eingaben für die Kind-Werte. Alle bestehenden Kind-Werte werden automatisch abgefüllt.</p>
62
  <p>Klicken Sie auf "Sichern" um die Kind-Formatvorlage zu aktualisieren und die Änderungen im Wordpress-Admin zu speichern.</p>
63
  <!-- END tab -->
64
  <!-- BEGIN tab -->
65
+ <h3 id="ctc_imports">Webschriftarten-Reiter</h3>
66
+ <p>Sie können zusätzliche Formatvorlagen und Webschriftarten verknüpfen, indem Sie @import Regeln in das Textfeld auf dem Webschriftarten-Reiter eingeben.</p>
67
  <p><strong>Hinweis:</strong> Child Theme Configurator schreibt nicht mehr länger @import Regeln in die Formatvorlage. Stattdessen benutzt es das @import Schlüsselwort und stellt sie in die Warteschlange. WordPress wandelt sie dann um in &lt;link&gt; Tags im verarbeiteten HTML.</p>
68
+ <p>Wichtig: importieren Sie die Eltern-Formatvorlage nicht hier. Benutzen Sie die "Eltern-Formatvorlage-Behandlung"-Option auf dem Eltern/Kind-Reiter.</p>
69
+ <p>Wenn Sie eine Formatvorlage unter "Zusätzliche Formatvorlegen auslesen" gewählt haben, als Sie das Kind-Thema erstellt haben, werden diese Stile für Übersteuerungen in der Kind-Formatvorlage zur Verfügung stehen.</p>
70
  <p>WordPress lädt automatisch zusätzliche Formatvorlagen, wenn es das Eltern-Thema lädt, also müssen Sie @import rules dafür hier nicht hinzufügen.</p>
71
+ <p>Unten ist ein Beispiel, welche eine lokale angepasste Formatvorlage lädt (Sie müssen das "fonts" Verzeichnis und die Formatvorlage hinzufügen), sowie die Schriftart "Open Sans" von Google Web Fonts:</p>
72
+ <blockquote><pre><code>&#64;import url(fonts/stylesheet.css);
73
  &#64;import url(http://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700,700italic);</code></pre></blockquote>
74
  <!-- END tab -->
75
  <!-- BEGIN tab -->
76
+ <h3 id="ctc_files">Dateien-Reiter</h3>
77
  <h5>Eltern-Vorlagen</h5>
78
  <p>Kopieren von PHP-Vorlagendateien des Eltern-Themes, indem Sie die Kästchen auswählen und "Auswahl zu gewählten Kind-Themen kopieren", und die Vorlage wird zum Kind-Themenverzeichnis hinzugefügt.</p>
79
  <p><strong>ACHTUNG: Wenn Ihr Kind-Thema aktiv ist, wird nach dem Kopiervorgang sofort die Kind-Thema-Version der Datei anstatt der Eltern-Datei benutzt.</strong></p>
85
  <p>Diese Bilder befinden sich unter dem <code>Images</code>-Verzeichnis in Ihrem Kind-Thema-Verzeichnis und sind nur für Formatvorlagen vorgesehen. Benutzen Sie die Medienbibliothek für Inhaltsbilder.</p>
86
  <p>Sie können neue Bilder mittels des "Bild hochladen"-Formulars hochladen. Löschen Sie Bilder durch die Auswahl der Kästchen und dem Klicken auf "Auswahl löschen".</p>
87
  <h5>Kind-Thema Screenshot</h5>
88
+ <p>Sie können einen speziellen Screenshot für das Kind-Thema hier hochladen.</p>
89
  <p>Der Themen-Screenshot sollte ein 4:3-Verhältnis aufweisen (z.Bsp, 880px x 660px) JPG, PNG oder GIF. Es wird in <code>screenshot</code> umbenannt.</p>
90
  <h5>Kind-Thema als ZIP-Archiv exportieren </h5>
91
  <p>Sie können Ihr Kind-Thema für den Gebrauch auf einer anderen Wordpress-Webseite herunterladen, indem Sie auf "Export" klicken.</p>
94
  <h3 id="ctc_preview">Vorschau und Aktivierung</h3>
95
  <p><strong>WICHTIG: <a target="_blank" href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/how-to-use/#preview_activate" title="Testen Sie Ihr Kind-Thema vor der Aktivierung!">Testen Sie Ihr Kind-Thema vor der Aktivierung!</a></strong> Einige Themen (hauptsächlich kommerzielle Themen) laden Eltern-Formatvorlagen nicht korrekt oder laden Kind-Formatvorlagen automatisch oder PHP-Dateien. <strong>Im schlimmsten Fall wird bei Aktivierung Ihre Webseite unbrauchbar.</strong></p>
96
  <ol>
97
+ <li>Navigieren Sie zu Design > Themen im Wordpress-Admin. Sie werden nun die neuen Kind-Themen als eine der installierten sehen.</li>
98
  <li>Klicken Sie auf "Live-Vorschau" unterhalb des Kind-Themas, um es in Aktion zu sehen.</li>
99
+ <li>Wenn Sie das Kind-Thema nun live nehmen wollen, klicken Sie auf "Aktivieren."</li>
100
  </ol>
101
  <p><strong>MULTISITE NUTZER:</strong> Sie müssen Ihr Thema Netzwerk-aktivieren, um es in der Live-Vorschau zu sehen. Gehen Sie zu 'Themen' in der Netzwerk-Administration.</p>
102
  <!-- END tab -->
103
  <!-- BEGIN tab -->
104
  <h3 id="ctc_permissions">Dateiberechtigungen</h3>
105
  <p>Wordpress wurde für verschiedene Serverkonfigurationen entwickelt. Child Theme Configurator benutzt die WordPress Filesystem API, um Webseiten das Bearbeiten von Dateien zu ermöglichen, die Nutzerberechtigungen benötigen.</p>
106
+ <p>Allerdings, weil die meiste Funktionalität mittels AJAX(Hintergrund)-Anfragen passiert, muss die Kind-Formatvorlage auf dem Server schreibbar sein.</p>
107
  <p>Das Plugin erkennt automatisch Ihre Konfiguration und liefert eine Anzahl von Optionen, um diese Anforderung zu lösen. Benutzen Sie die zur Verfügung gestellten Verknüpfungen, um mehr zu erfahren, beispielsweise:</p>
108
  <ol>
109
  <li>Die Formatvorlage mithilfe des Plugins vorübergehend schreibbar machen.</li>
114
  <!-- END tab -->
115
  <!-- BEGIN tab -->
116
  <h3 id="ctc_faq">FAQs</h3>
117
+ <h5 id="broken_theme">HILFE! Ich habe eine Datei geändert und kann nun über nicht mehr über wp-admin einloggen, um es zu reparieren!</h5>
118
  <p>Um aus einem defekten Thema herauszukommen, müssen Sie das problematische Themen-Verzeichnis umbenennen (via FTP, SSH oder Ihrem Webhoster-Kontrollpanel bzw. Dateimanager), so dass Wordpress es nicht mehr finden kann. WordPress wird dann einen Fehler generieren und zum Standard-Thema zurückkehren (aktuell Twenty-Fourteen).</p>
119
 
120
  <p>Das Kind-Thema ist normalerweise in Ihrem Themen-Verzeichnis</p>
130
  <h5 id="options_broken">Wieso verschwinden meine Themen-Optionen, wenn ich das Kind-Thema aktiviere?</h5>
131
  <p>Diese Optionen sind für jedes Thema spezifisch und werden getrennt in der Datenbank gespeichert. Beim Erstellen eines neuen Kind-Themas sind diese Optionen leer.</p>
132
 
133
+ <p><strong>Viele dieser Optionen können in das Kind-Thema kopiert werden, indem man das Kästchen "Kopieren Eltern-Theme-Menüs, Widgets und andere Design-Optionen" anklickt, wenn Sie die Kind-Thema-Dateien auf dem Eltern/Kind-Reiter erstellen.</strong></p>
134
 
135
  <p>Wenn Sie andere Optionen setzen wollen, können Sie diese nach dem Aktivieren des Kind-Themas aktivieren, oder mittels der Live-Vorschau unter Design > Themen.</p>
136
  <ul class="instructions">
137
+ <li><strong>Menüs: </strong> Gehen Sie zu Design > Menüs und klicken Sie den "Position"-Reiter. Standardmäßig wird das Primärmenü die Verknüpfungen automatisch aus den bestehenden Seiten erstellen. Wählen Sie Ihr angepasstes Menü aus der Auswahlliste und klicken Sie "Neues Menü benutzen". Dies ersetzt das Standardmenü und Sie sehen die korrekten Verknüpfungen.</li>
138
 
139
+ <li><strong>Header (Kopf): </strong> Gehen Sie zu Design > Header. Einige Themen zeigen standardmäßig den Titel und die Tagline Ihrer "Allgemeinen Einstellungen". Wählen Sie "Bild auswählen" und finden Sie einen "Kopf" aus der Medienbibliothek oder mittels Hochladen. Dies ersetzt den Standard mit dem angepassten Bild.</li>
140
 
141
+ <li><strong>Hintergrund: </strong> Gehen Sie zu Design > Hintergrund und wählen Sie ein neues Hintergrundbild oder eine Farbe.</li>
142
 
143
+ <li><strong>Optionen: </strong> Jedes Thema behandelt Optionen speziell. Meistens erstellen Sie einen Satz Optionen und speichern ihn in der Wordpress-Datenbank. Einige Optionen sind spezifisch für das aktive Thema (oder Kind-Thema), und einige nur für das Eltern-Thema bestimmt (d.h. das Kind-Thema kann sie NICHT übersteuern). Sie müssen sich beim Themen-Autor erkundigen, welche auf welche Art funktionieren.</li>
144
  </ul>
145
  </p>
146
  <h5 id="existing_parent">Wie verschiebe ich bereits gemachte Änderungen an meinem Thema in mein Kind-Thema?</h5>
147
  <p><a href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/how-to-use/#child_from_modified_parent" class="scroll-to">Folgen Sie diesen Schritten</a>. </p>
148
  <h5 id="web_fonts">Wie füge ich Webschriftarten hinzu?</h5>
149
+ <p>Die einfachste Methode ist das Einfügen des @import code, geliefert von <a href="http://www.google.com/fonts" title="Google Fonts">Google</a>, <a href="http://www.fontsquirrel.com/" title="Font Squirrel">Font Squirrel</a> oder jeder anderen Schriftartenseite auf dem Schriftarten-Reiter. Die Schriftarten werden dann zum Gebrauch als Wert der <strong>font-family</strong> Eigenschaft zur Verfügung stehen. Stellen Sie sicher, dass Sie die Lizenz zum Gebrauch der Webschriftarten verstehen. </p>
150
+ <p>Sie können auch eine sekundäre Formatvorlage erstellen, welche die @font-face Regeln enthält, und diese auf dem Webschriftarten-Reiter importieren. </p>
151
  <h5 id="plugin">Funktionert das mit Plugins?</h5>
152
  <p>Wir bieten eine Premium-Erweiterung an, die Sie Stile für jedes auf der Webseite installierte Plugin einfach verändern lässt. Der Child Theme Configurator Plugin Extension scannt Ihre Plugins und erlaubt die Erstellung von angepassten Formatvorlagen in Ihrem Kind-Thema. <a href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/child-theme-configurator-pro/" title="Die Kontrolle über Ihre Plugin-Stile mit der Child Theme Configurator Plugin Erweiterung für WordPress übernehmen">Mehr erfahren <i class="genericon genericon-next"></i></a>
153
  <h5 id="doesnt_work">Wieso funktioniert das in meinem (Hersteller des Themas hier einfügen) Thema nicht?</h5>
154
  <p>Einige Themen (hauptsächlich kommerzielle Themen) laden die Eltern-Vorlagen-Dateien nicht korrekt oder laden Kind-Thema-Formatvorlagen oder PHP-Dateien automatisch.</p><p>Das ist unglücklich, weil es im besten Fall den Webmaster daran hindert, Anpassungen vorzunehmen (abgesehen von solchen durch die Themen-Optionen), die einen Upgrade überleben. <strong>Im schlimmsten Fall jedoch wird Ihre Webseite unbrauchbar, wenn Sie das Kind-Thema aktivieren.</strong> </p>
155
  <p>Kontaktieren Sie direkt den Hersteller, um diese Kern-Funktionalität zu verlangen. Unserer Meinung nach sollten ALLE Themen (vor allem kommerzielle) die von Wordpress.org beschriebenen Themen-Tests erfüllen. </p>
156
  <h5 id="missing_parent">Wieso hat das Eltern-Thema keine Stile, wenn ich auf "Eltern-CSS anzeigen" gehe?</h5>
157
+ <p>Ihr Eltern-Thema benutzt für die Formatvorlagen womöglich einen getrennten Ort. Wählen Sie individuelle Formatvorlagen aus dem "Zusätzliche Formatvorlagen auslesen"-Abschnitt des Eltern/Kind-Reiters und klicken Sie erneut auf "Neuaufbau Kind-Thema-Dateien". </p>
158
  <h5 id="performance">Wird das meine Webseite verlangsamen?</h5>
159
  Sobald die Kind-Formatvorlage erstellt ist, fügt CTC im Frontend nur ein wenig Zusatzlast hinzu, da die ganze Funktionalität im Admin enthalten ist.
160
 
161
+ Das Plugin lädt den Hauptteil des Codes im Admin nur, wenn Sie das Tool benutzen. Die größte Performance-Einbusse geschieht, wenn Sie die Kind-Themen-Dateien auf dem Eltern/Kind-Reiter erstellen. </p>
162
  <h5 id="where_are_styles">Wo sind die Stile? Der Konfigurator zeigt nichts an!</h5>
163
  <p>Alle Stile werden dynamisch geladen. Sie müssen in den Textfelder etwas eingeben, um die Stile zum Bearbeiten auszuwählen.</p>
164
  <p>"Base" ist die Abfragegruppe, die mit keiner bestimmten at-Regel verbunden sind.</p>
165
+ <p>Beginnen Sie mit einem Klick auf den "Abfage/Selektor"-Reiter und der Eingabe von "base" in der ersten Box. In der zweiten Box können Sie dann mit der Eingabe beginnen, um die Stil-Selektoren zum Bearbeiten zu holen. </p>
166
+ <h5 id="preview-not-loading">Wieso zeigen die Vorschau-Reiter "Formatvorlage kann nicht angezeigt werden"?</h5>
167
+ <p>Sie müssen ein Kind-Thema auf dem Eltern/Kind-Reiter für die Ansicht der Vorschau laden. Das kann auch passieren, wenn Ihre WP_CONTENT_URL sich von $bloginfo('site_url') unterscheidet. Ajax kann keine domänenübergreifenden Abfagen machen. Überprüfen Sie, ob der Einstellungen > Allgemein > "WordPress Adresse (URL)"-Wert korrekt ist. (Oft fehlt das "www"" in der Domäne.) </p>
168
  <h5 id="edit_manually">Kann ich das Kind-Thema manuell offline bearbeiten (oder mithilfe des Editors), oder muss ich unbedingt den Konfigurator benutzen?</h5>
169
  <p>Sie können jede gewünschte Änderung an der Formatvorlage vornehmen. Stellen Sie nur sicher, die geänderte Formatvorlage mittels des Eltern/Kind-Panels zu importieren, ansonsten wird der Konfigurator Ihre Änderungen beim nächsten Gebrauch überschreiben. Folgen Sie den üblichen Schritten, aber wählen Sie die Auswahloption "Bestehendes Kind-Thema benutzen" als Kind-Thema-Option. Der Konfigurator wird die internen Daten aus der neuen Formatvorlage automatisch aktualisieren. </p>
170
  <h5 id="update_child">Wenn das Eltern-Thema geändert wird (z.Bsp. Upgrade), muss ich das Kind-Thema aktualisieren?</h5>
171
  <p>Nein. Das ist der Zweck von Kind-Themen. Änderungen am Eltern-Thema werden vom Kind-Thema automatisch geerbt.</p>
172
  <p>Ein Kind-Thema ist keine Kopie eines Eltern-Themas. Es ist eine besondere Funktion von WordPress, die Sie bestimmte Stile und Funktionen übersteuern lässt, während der Rest intakt bleibt. Das einzige Mal, dass Sie nach einem Upgrade Änderungen machen müssen ist, wenn das Eltern-Thema Stile oder Funktionsnamen ändert oder entfernt. Qualitäts-Themen sollten alle veralteten Funktionen oder Stile in den Upgrade-Hinweisen erwähnen, so dass Nutzer von Kind-Themen die entsprechenden Anpassungen vornehmen können. </p>
173
  <h5 id="functions">Wo sind die .PHP-Dateien?</h5>
174
+ <p>Der Konfigurator fügt dem Kind-Themenverzeichnis automatisch eine leere functions.php-Datei hinzu. Sie können Dateien des Eltern-Themas mittels des "Dateien"-Reiters kopieren. Wenn Sie neue Vorlagen und Verzeichnisse erstellen möchten, müssen Sie diese manuell via FTP oder SSH hochladen. Beachten Sie, dass ein Kind-Thema die Eltern-Vorlagen automatisch erbt, es sei denn, sie bestehen bereits im Kind-Thema-Verzeichnis. Kopieren Sie nur Vorlagen, die Sie auch wirklich anpassen möchten.</p>
175
  <h5 id="specific_color">Wie ändere ich eine(n) bestimmte Farbe/Schriftarttyp/Hintergrund?</h5>
176
+ <p>Sie können einen bestimmten Wert global mittels des Eigenschaften/Wert-Reiters übersteuern. Siehe Eigenschaften/Werte, oben.</p>
177
  <h5 id="add_styles">Wie füge ich Stile hinzu, die nicht im Eltern-Thema enthalten sind?</h5>
178
+ <p>Sie können Abfragen und Selektoren mittels des "Rohes CSS"-Textfelds auf dem Abfrage/Selektor-Reiter hinzufügen. Siehe Abfrage/Selektor, oben. </p>
179
  <h5 id="add_styles">Wie entferne ich Stile aus dem Eltern-Thema?</h5>
180
  <p>Sie sollten eigentlich Stile aus dem Eltern-Thema nicht entfernen. Sie können allerdings die Eigenschaft auf "Erben"," "Keine," oder Null setzen (abhängig von der Eigenschaft). Das wird den Eltern-Wert negieren. Ein wenig Probieren wird nötig sein.</p>
181
  <h5 id="remove_styles">Wie entferne ich einen Stil aus einem Kind-Thema?</h5>
182
  <p>Löschen Sie den Wert aus der Eingabe der Eigenschaft, die sie entfernen möchten. Der Child Theme Configurator fügt Übersteuerungen nur für Eigenschaften mit Werten hinzu. </p>
183
  <h5 id="important_flag">Wie setze ich den !important-Schalter?</h5>
184
  <p>Wir empfehlen immer ein gutes, verschachteltes Design, anstatt auf globale Übersteuerungen zu vertrauen. Dazu haben Sie die Möglichkeit, die Lade-Reihenfolge von Kind-Formatvorlagen zu ändern, indem Sie einen Wert im "Reihenfolge"-Feld eingeben. Sie können Eigenschaften als wichtig setzen, indem Sie das Kästchen mit dem "!" neben jeder Eingabe setzen. Benutzen Sie es massvoll. </p>
185
+ <h5 id="gradients">Wie erstelle ich browser-unabhängige Verläufe?</h5>
186
  <p>Der Child Theme Configurator benutzt eine standarisierte Syntax für Farbverläufe und unterstützt nur zweifarbige Verläufe ohne Zwischenstopps. Die Eingaben bestehen aus dem Startpunkt (z.Bsp. top, left, 135deg, etc.), der Startfarbe und der Endfarbe. Browser-spezifische Syntax wird automatisch erstellt, wenn Sie diese Werte speichern. Siehe Tricks/Fallen, unten, für weitere Informationen. </p>
187
  <h5 id="responsive">Wie mache ich das Thema responsive?</h5>
188
  <p>Die kurze Antwort ist, ein responsives Eltern-Thema zu benutzen. Einige übliche Methoden für responsives Design sind:
189
  <ul class="instructions"><li>Vermeiden von festen Breiten und Höhen. Der Gebrauch von max- and min-height Werten und Prozenten sind Wege, das Design dem Browser des Benutzers anzupassen.</li>
190
  <li>Die Kombination von floats und clears mit inline und relative-Positionen erlaubt den Elementen, sich der umgebenden Behälterbreite fließend anzupassen.</li>
191
+ <li>Anzeigen und Verbergen von Inhalt mittels JavaScript.</li></ul>
192
  <!-- END tab -->
193
  <!-- BEGIN tab -->
194
  <h3 id="ctc_glossary">Glossar</h3>
195
  <ul>
196
  <li id="parent_theme"><strong>Eltern-Thema</strong> Das Wordpress-Thema, welches Sie bearbeiten möchten. Wordpress lädt zuerst das Kind-Thema, dann das Eltern-Thema. Wenn ein Stil im Kind-Thema enthalten ist, übersteuert es das Eltern-Thema.</li>
197
  <li id="child_theme"><strong>Kind-Thema</strong> Neues Thema, basierend auf einem Eltern-Thema. Sie können eine beliebige Anzahl von Kind-Themen von einem einzigen Eltern-Thema erstellen.</li>
198
+ <li id="class"><strong>Klasse</strong> Ein Begriff, der zum Organisieren von Objekten benutzt wird. Zum Beispiel, ein &lt;div&gt; könnte die "blue-text"-Klasse zugewiesen sein. Die Formatvorlage weist dann Mitgliedern der "blue-text"-Klasse den Wert "color: blue;" zu. Somit würde &lt;div&gt; als blauer Text im Browser dargestellt.</li>
199
+ <li id="selector"><strong>Selektor</strong> Eines oder mehrere Elemente, Klassen, IDs oder andere Begriffe zum Identifizieren von Objektgruppen.</li>
 
 
200
  <li id="property"><strong>Eigenschaft</strong> Einer von vielen standardisierten Begriffen, die dem Browser mitteilen, wie Objekte mit einem bestimmten Selektor anzuzeigen sind. Beispiele sind <strong>color</strong>, <strong>background-image</strong> und <strong>font-size</strong>.</li>
 
201
  <li id="at-rule"><strong>At-Regel</strong> Ein CSS-Browser-Befehl, um die Standard-Funktionalität zu erweitern. Der Child Theme Configurator unterstützt zwei At-Regeln:
202
  <ul>
203
+ <li id="import"><strong>@import</strong> Weist den Browser an, zusätzliche CSS-Informationen aus einer externen Quelle zu laden.</li>
204
+ <li id="query"><strong>@media (Media Query)</strong> Identifiziert Stilblöcke, die nur benutzt werden, wenn gewisse Browser-Eigenschaften zutreffen. Beispiele sind max-width, screen und print.</li>
205
  </ul>
206
  </li>
207
+ <li id="override"><strong>Übersteuerung</strong> Wenn ein Selektor in Eltern- und Kind-Thema existiert, hat das Kind-Thema Priorität über das Eltern-Thema. Hier zeigt sich die Stärke des Child Theme Configurator: es hilfe Ihnen, <strong>genaue Übersteuerungen</strong> von Selektoren des Eltern-Themas zu erstellen, und eliminiert damit Stunden des Herumprobierens.</li>
 
 
208
  </ul>
209
  <!-- END tab -->
210
  <!-- BEGIN sidebar -->
211
+ <h4>Unser Plugin wird Sie nicht mit Spendeneinblendungen nerven...</h4>
212
  <span style="font-size:smaller">...aber wir LIEBEN Empfehlungen.</span><br/><a href="http://wordpress.org/support/view/plugin-reviews/child-theme-configurator?rate=5#postform">Geben Sie uns 5 Sterne</a>
213
+ <h4>Vorstellung von CTC Pro</h4>
214
+ <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>
215
  <p style="font-size:smaller">Von Wordpress-Entwicklern entworfen, die es jeden Tag benutzen. CTC Pro stellt Plugin-Formatvorlagen und andere Funktionen zur Verfügung, die Ihre Arbeit schneller und einfacher machen. Das ist ein kostenloses Upgrade für Nutzer, die die Plugin-Erweiterung erworben haben. <a href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/child-theme-configurator-pro/" title="Child Theme Configurator Pro">Mehr erfahren</a></p>
216
  <h4 id="ctc_help_sidebar">Links/Verknüpfungen</h4>
217
  <ul>
includes/help/en_US.php CHANGED
@@ -3,55 +3,62 @@ if ( !defined( 'ABSPATH' ) ) exit;
3
  // Help Content
4
  ?>
5
  <!-- BEGIN tab -->
6
- <h3 id="ctc_tutorial">Start Here: Tutorial Videos</h3>
7
- <!--p><iframe width="560" height="315" src="https://www.youtube.com/embed/xL0YmieF6d0?rel=0&modestbranding=1" frameborder="0" allowfullscreen></iframe></p>
8
- <p><iframe width="560" height="315" src="https://www.youtube.com/embed/vhQ5oi20rYE?rel=0&modestbranding=1" frameborder="0" allowfullscreen></iframe></p -->
9
- <p><a href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/tutorial-videos" target="_blank">Click here to view videos.</a></p><!-- END tab -->
10
- <!-- BEGIN tab -->
11
- <h3 id="ctc_getting_started">Parent/Child Tab</h3>
12
- <ol><li><strong>Select an action:</strong>
13
- <ul><li><strong>CREATE a new Child Theme</strong> - Install a new customizable child theme using an installed theme as a parent.</li>
14
- <li><strong>CONFIGURE an existing Child Theme</strong> - Set up a previously installed child theme for use with the Configurator or to modify current settings.</li>
15
- <li><strong>DUPLICATE an existing Child Theme</strong> - Make a complete copy of an existing Child Theme in a new directory, including any menus, widgets and other Customizer settings. The option to copy the Parent Theme settings (step 8, below) is disabled with this action.</li>
16
- <li><strong>RESET an existing Child Theme</strong> (this will destroy any work you have done in the Configurator) - Revert the Child theme stylesheet and functions files to their state before the initial configuration or last reset.</li></ul></li>
17
- <li><strong>Select a Parent Theme</strong> if creating a new Child Theme; select a Child Theme if configuring, duplicating or resetting.</li>
18
- <li><strong>Analyze Child Theme</strong> - Click "Analyze" to determine stylesheet dependencies and other potential issues.</li>
19
- <li><strong>Name the new theme directory</strong> if creating a new Child Theme; otherwise verify it the directory is correct. - This is NOT the name of the Child Theme. You can customize the name, description, etc. in step 7, below.</li>
20
- <li><strong>Select where to save new styles:</strong><ul>
21
- <li><strong>Primary Stylesheet (style.css)</strong> - Save new custom styles directly to the Child Theme primary stylesheet, replacing the existing values. The primary stylesheet will load in the order set by the theme.</li>
22
- <li><strong>Separate Stylesheet</strong> - Save new custom styles to a separate stylesheet and use any existing child theme styles as a baseline. Select this option if you want to preserve the original child theme styles instead of overwriting them. This option also allows you to customize stylesheets that load after the primary stylesheet.</li></ul></li>
23
- <li><strong>Select Parent Theme stylesheet handling:</strong><ul>
24
- <li><strong>Use the WordPress style queue.</strong> - Let the Configurator determine the appropriate actions and dependencies and update the functions file automatically.</li>
25
- <li><strong>Use @import</strong> in the child theme stylesheet. - Only use this option if the parent stylesheet cannot be loaded using the WordPress style queue. Using @import is not recommended.</li>
26
- <li><strong>Do not add any parent stylesheet handling.</strong> - Select this option if this theme already handles the parent theme stylesheet or if the parent theme's style.css file is not used for its appearance.</li></ul></li>
27
- <li><strong>Customize the Child Theme Name, Description, Author, Version, etc.</strong></li>
28
- <li><strong>Copy Parent Theme Menus, Widgets and other Customizer Settings to Child Theme.</strong> - NOTE: This will overwrite any child theme options you may have already set.</li>
29
- <li><strong>Click the button</strong> to run the Configurator.</li>
30
- <li><strong>IMPORTANT: <a target="_blank" href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/how-to-use/#preview_activate" title="Preview your child theme before activating!">Always test your child theme with Live Preview (theme customizer) before activating!</a></strong></li>
 
 
 
 
 
31
  </ol>
32
  <!-- END tab -->
33
  <!-- BEGIN tab -->
 
 
 
34
  <h3 id="ctc_query_selector">Query/Selector Tab</h3>
35
- <p>There are two ways to identify and override baseline (parent) styles. The Child Theme Configurator lets you search styles by <strong>selector</strong> and by <strong>property</strong>. If you wish to change a specific selector (e.g., h1), use the "Query/Selector" tab. If you have a specific value you wish to change site-wide (e.g., the color of the type), use the "Property/Value" tab.</p>
36
  <p>The Query/Selector tab lets you find specific selectors and edit them. First, find the query that contains the selector you wish to edit by typing in the <strong>Query</strong> autoselect box. Select by clicking with the mouse or by pressing the "Enter" or "Tab" keys. Selectors are in the <strong>base</strong> query by default.</p>
37
  <p>Next, find the selector by typing in the <strong>Selector</strong> autoselect box. Select by clicking with the mouse or by pressing the "Enter" or "Tab" keys.</p>
38
- <p>This will load all of the properties for that selector with the Original values on the left and the New values inputs on the right. Any existing new values will be automatically populated. There is also a Sample preview that displays the combination of Parent and Child overrides. Note that the <strong>border</strong> and <strong>background-image</strong> get special treatment.</p>
39
- <p>If you wish to add additional properties to an existing selector, first load the selector using the Query/Selector tab. Then find the property you wish to override by typing in the <strong>New Property</strong> autoselect box. Select by clicking with the mouse or by pressing the "Enter" or "Tab" keys. This will add a new input row to the selector inputs.</p>
40
  <p>The "Order" field contains the original sequence of the selector in the parent theme stylesheet. You can change the selector order sequence by entering a lower or higher number in the "Order" field. You can also force style overrides (so called "!important" flag) by checking the "!" box next to each input. Please use judiciously.</p>
41
  <p>Click "Save" to update the child stylesheet and save your changes to the WordPress admin.</p>
42
  <!-- END tab -->
43
  <!-- BEGIN tab -->
44
- <h3 id="ctc_new_styles">Adding Raw CSS</h3>
 
45
  <p>If you wish to add completely new selectors, or even new @media queries, you can enter free-form CSS in the "Raw CSS" textarea. Be aware that your syntax must be correct (i.e., balanced curly braces, etc.) for the parser to load the new styles. You will know it is invalid because a red "X" will appear next to the save button.</p>
46
  <p>If you prefer to use shorthand syntax for properties and values instead of the inputs provided by the Child Theme Configurator, you can enter them here as well. The parser will convert your input into normalized CSS code automatically.</p>
47
- <p>If you wish to add additional properties to an existing selector, first load the selector using the Query/Selector tab. Then find the property you wish to override by typing in the <strong>New Property</strong> autoselect box. Select by clicking with the mouse or by pressing the "Enter" or "Tab" keys. This will add a new input row to the selector inputs.</p>
48
  <!-- END tab -->
49
  <!-- BEGIN tab -->
50
  <h3 id="ctc_property_value">Property/Value Tab</h3>
51
- <p>There are two ways to identify and override baseline (parent) styles. The Child Theme Configurator lets you search styles by <strong>selector</strong> and by <strong>property</strong>. If you wish to change a specific selector (e.g., h1), use the "Query/Selector" tab. If you have a specific value you wish to change site-wide (e.g., the color of the type), use the "Property/Value" tab.</p>
52
  <p>The Property/Value tab lets you find specific values for a given property and then edit that value for individual selectors that use that property/value combination. First, find the property you wish to override by typing in the <strong>Property</strong> autoselect box. Select by clicking with the mouse or by pressing the "Enter" or "Tab" keys.</p>
53
  <p>This will load all of the unique values that exist for that property in the parent stylesheet with a Sample preview for that value. If there are values that exist in the child stylesheet that do not exist in the parent stylesheet, they will be displayed as well.</p>
54
- <p>For each unique value, click the "Selectors" link to view a list of selectors that use that property/value combination, grouped by query with a Sample preview of the value and inputs for the new value. Any existing new values will be automatically populated.</p>
55
  <p>Click "Save" to update the child stylesheet and save your changes to the WordPress admin.</p>
56
  <!-- END tab -->
57
  <!-- BEGIN tab -->
@@ -85,7 +92,7 @@ if ( !defined( 'ABSPATH' ) ) exit;
85
  <!-- END tab -->
86
  <!-- BEGIN tab -->
87
  <h3 id="ctc_preview">Preview and Activate</h3>
88
- <p><strong>IMPORTANT: <a target="_blank" href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/how-to-use/#preview_activate" title="Preview your child theme before activating!">Preview 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>
89
  <ol>
90
  <li>Navigate to Appearance > Themes in the WordPress Admin. You will now see the new Child Theme as one of the installed Themes.</li>
91
  <li>Click "Live Preview" below the new Child Theme to see it in action.</li>
@@ -127,13 +134,13 @@ if ( !defined( 'ABSPATH' ) ) exit;
127
 
128
  <p>If you want to set different options you can either apply them after you activate the child theme, or by using the "Live Preview" under Appearance > Themes.</p>
129
  <ul class="instructions">
130
- <li><strong>Menus: </strong> Go to Appearance > Menus and click the "Locations" tab. By default, the primary menu will generate the links automatically from the existing pages. Select your customized Menu from the dropdown and click "Use New Menu." This will replace the default menu and you will see the correct links.</li>
131
 
132
- <li><strong>Header: </strong> Go to Appearance > Header. Some themes will show the "Title" and "Tagline" from your "General Settings" by default. Click "Choose Image" and find the header from the Media Library or upload a new image. This will replace default with your custom image.</li>
133
 
134
- <li><strong>Background: </strong> Go to Appearance > Background and choose a new background color or image.</li>
135
 
136
- <li><strong>Options: </strong> Every theme handles options in its own way. Most often, they will create a set of options and store them in the WordPress database. Some options are specific to the active theme (or child theme), and some are specific to the parent theme only (meaning the child theme CANNOT override them). You will have to find out from the theme author which are which.</li>
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>
@@ -170,7 +177,7 @@ The plugin only loads the bulk of the code in the admin when you are using the t
170
  <h5 id="add_styles">How do I add styles that aren't in the Parent Theme?</h5>
171
  <p>You can add queries and selectors using the "Raw CSS" textarea on the Query/Selector tab. See Query/Selector, above. </p>
172
  <h5 id="add_styles">How do I remove a style from the Parent Theme?</h5>
173
- <p>You shouldn't really "remove" a style from the Parent. You can, however, set the property to "inherit," "none," or zero (depending on the property). This will negate the Original value. Some experimentation may be necessary.</p>
174
  <h5 id="remove_styles">How do I remove a style from the Child Theme?</h5>
175
  <p>Delete the value from the input for the property you wish to remove. The Child Theme Configurator only adds overrides for properties that contain values. </p>
176
  <h5 id="important_flag">How do I set the !important flag?</h5>
@@ -188,33 +195,28 @@ The plugin only loads the bulk of the code in the admin when you are using the t
188
  <ul>
189
  <li id="parent_theme"><strong>Parent Theme</strong> The WordPress Theme you wish to edit. WordPress first loads the Child Theme, then loads the Parent Theme. If a style exists in the Child Theme, it overrides the Parent Theme.</li>
190
  <li id="child_theme"><strong>Child Theme</strong> New Theme based on Parent Theme. You can create any number of Child Themes from a single Parent Theme.</li>
191
- <li id="class"><strong>Class</strong> A term used to organize objects. For example, a &lt;div&gt; might be assigned the "blue-text" class. The stylesheet might then assign "color: blue;" to members of the "blue-text" class. Thus, the &lt;div&gt; would display text as blue in the browser. Class selectors begin with a period (.).</li>
192
- <li id="class"><strong>ID</strong> A unique string used to identify a specific element. ID selectors begin with a hash (#).</li>
193
- <li id="selector"><strong>Query</strong> @media query instruction (see At-rule, below).</li>
194
- <li id="query"><strong>Selector</strong> Combination of html tag names, ids and classes used to identify objects or groups of objects.</li>
195
  <li id="property"><strong>Property</strong> One of many standardized terms used to tell the browser how to display objects matching a given selector. Examples are <strong>color</strong>, <strong>background-image</strong> and <strong>font-size</strong>.</li>
196
- <li id="value"><strong>Value</strong> Data corresponding to a Property.</li>
197
  <li id="at-rule"><strong>At-rule</strong> CSS browser instruction to extend default functionality. The Child Theme Configurator supports two At-rules:
198
  <ul>
199
- <li id="at_import"><strong>@import</strong> Instructs the browser to load additional CSS information from an external source.</li>
200
- <li id="at_media"><strong>@media (Media Query)</strong> Identifies blocks of styles that are used only when certain browser characteristics are true. Examples are max-width, screen and print.</li>
201
  </ul>
202
  </li>
203
- <li id="child_theme"><strong>Baseline Style</strong> A style from any existing Parent Theme or Child Theme stylesheet that can be overridden by the Child Theme custom stylesheet. Most of the time these will come from the Parent Theme's stylesheets.</li>
204
  <li id="override"><strong>Override</strong> When a selector exists in both the Child Theme and the Parent Theme, the Child Theme takes priority over the Parent theme. This is where the Child Theme Configurator stands out: it helps you create <strong>exact overrides</strong> of selectors from the Parent Theme, eliminating hours of trial and error.</li>
205
- <li id="child_theme"><strong>Theme Template</strong> A Theme PHP file having no PHP functions or classes. Other PHP files cannot be safely overridden by a child theme.</li>
206
  </ul>
207
  <!-- END tab -->
208
  <!-- BEGIN sidebar -->
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="Learn more about CTC Pro"><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
  <h4 id="ctc_help_sidebar">Links</h4>
215
  <ul>
216
- <li><a href="<?php echo LILAEAMEDIA_URL; ?>/contact/">Contact us</a></li>
217
- <li><a href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>">Plugin Website</a></li>
218
  <li><a href="http://codex.wordpress.org/Child_Themes">WordPress Codex</a></li>
219
  <li><a href="http://wordpress.stackexchange.com/">WordPress Development (StackExchange)</a></li>
220
  </ul>
3
  // Help Content
4
  ?>
5
  <!-- BEGIN tab -->
6
+ <h3 id="ctc_getting_started">Start Here</h3>
7
+ <p><strong style="font-size:large">10 Easy Steps to Create a Child Theme:</strong></p>
8
+ <ol>
9
+ <li><strong>Select the theme</strong> you want to configure from the &quot;Parent Theme&quot; menu.</li>
10
+ <li><strong>Select &quot;new&quot; or &quot;existing&quot;.</strong>
11
+ <ul>
12
+ <li>If there are currently no child themes available, the &quot;Child Theme&quot; and &quot;Child Theme Names&quot; will be entered for you automatically based on the parent theme selected. You may edit these if you like, but they cannot be the same as an existing theme.</li>
13
+ <li>If there are existing child themes available, there will be an additional menu labeled &quot;Use Existing Child Theme&quot; from which you can select, or enter a new value in the input box to create a new one.</li>
14
+ </ul>
15
+ </li>
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 &quot;Parse Additional Stylesheets&quot; 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 -->
39
+ <h3 id="ctc_tutorial">Tutorial Videos</h3>
40
+ <p>We are no longer embedding videos for performance reasons. <a href="http://www.childthemeconfigurator.com/tutorial-videos" target="_blank">Click here to view videos.</a></p><!-- END tab -->
41
+ <!-- BEGIN tab -->
42
  <h3 id="ctc_query_selector">Query/Selector Tab</h3>
43
+ <p>There are two ways to identify and override parent styles. The Child Theme Configurator lets you search styles by <strong>selector</strong> and by <strong>property</strong>. If you wish to change a specific selector (e.g., h1), use the "Query/Selector" tab. If you have a specific value you wish to change site-wide (e.g., the color of the type), use the "Property/Value" tab.</p>
44
  <p>The Query/Selector tab lets you find specific selectors and edit them. First, find the query that contains the selector you wish to edit by typing in the <strong>Query</strong> autoselect box. Select by clicking with the mouse or by pressing the "Enter" or "Tab" keys. Selectors are in the <strong>base</strong> query by default.</p>
45
  <p>Next, find the selector by typing in the <strong>Selector</strong> autoselect box. Select by clicking with the mouse or by pressing the "Enter" or "Tab" keys.</p>
46
+ <p>This will load all of the properties for that selector with the Parent values on the left and the Child values inputs on the right. Any existing child values will be automatically populated. There is also a Sample preview that displays the combination of Parent and Child overrides. Note that the <strong>border</strong> and <strong>background-image</strong> get special treatment.</p>
 
47
  <p>The "Order" field contains the original sequence of the selector in the parent theme stylesheet. You can change the selector order sequence by entering a lower or higher number in the "Order" field. You can also force style overrides (so called "!important" flag) by checking the "!" box next to each input. Please use judiciously.</p>
48
  <p>Click "Save" to update the child stylesheet and save your changes to the WordPress admin.</p>
49
  <!-- END tab -->
50
  <!-- BEGIN tab -->
51
+ <h3 id="ctc_new_styles">Adding New Styles</h3>
52
+ <p>If you wish to add additional properties to a given selector, first load the selector using the Query/Selector tab. Then find the property you wish to override by typing in the <strong>New Property</strong> autoselect box. Select by clicking with the mouse or by pressing the "Enter" or "Tab" keys. This will add a new input row to the selector inputs.</p>
53
  <p>If you wish to add completely new selectors, or even new @media queries, you can enter free-form CSS in the "Raw CSS" textarea. Be aware that your syntax must be correct (i.e., balanced curly braces, etc.) for the parser to load the new styles. You will know it is invalid because a red "X" will appear next to the save button.</p>
54
  <p>If you prefer to use shorthand syntax for properties and values instead of the inputs provided by the Child Theme Configurator, you can enter them here as well. The parser will convert your input into normalized CSS code automatically.</p>
 
55
  <!-- END tab -->
56
  <!-- BEGIN tab -->
57
  <h3 id="ctc_property_value">Property/Value Tab</h3>
58
+ <p>There are two ways to identify and override parent styles. The Child Theme Configurator lets you search styles by <strong>selector</strong> and by <strong>property</strong>. If you wish to change a specific selector (e.g., h1), use the "Query/Selector" tab. If you have a specific value you wish to change site-wide (e.g., the color of the type), use the "Property/Value" tab.</p>
59
  <p>The Property/Value tab lets you find specific values for a given property and then edit that value for individual selectors that use that property/value combination. First, find the property you wish to override by typing in the <strong>Property</strong> autoselect box. Select by clicking with the mouse or by pressing the "Enter" or "Tab" keys.</p>
60
  <p>This will load all of the unique values that exist for that property in the parent stylesheet with a Sample preview for that value. If there are values that exist in the child stylesheet that do not exist in the parent stylesheet, they will be displayed as well.</p>
61
+ <p>For each unique value, click the "Selectors" link to view a list of selectors that use that property/value combination, grouped by query with a Sample preview of the value and inputs for the child value. Any existing child values will be automatically populated.</p>
62
  <p>Click "Save" to update the child stylesheet and save your changes to the WordPress admin.</p>
63
  <!-- END tab -->
64
  <!-- BEGIN tab -->
92
  <!-- END tab -->
93
  <!-- BEGIN tab -->
94
  <h3 id="ctc_preview">Preview and Activate</h3>
95
+ <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>
96
  <ol>
97
  <li>Navigate to Appearance > Themes in the WordPress Admin. You will now see the new Child Theme as one of the installed Themes.</li>
98
  <li>Click "Live Preview" below the new Child Theme to see it in action.</li>
134
 
135
  <p>If you want to set different options you can either apply them after you activate the child theme, or by using the "Live Preview" under Appearance > Themes.</p>
136
  <ul class="instructions">
137
+ <li><strong>Menus: </strong> Go to Appearance > Menus and click the "Locations" tab. By default, the primary menu will generate the links automatically from the existing pages. Select your customized Menu from the dropdown and click "Use New Menu." This will replace the default menu and you will see the correct links.</li>
138
 
139
+ <li><strong>Header: </strong> Go to Appearance > Header. Some themes will show the "Title" and "Tagline" from your "General Settings" by default. Click "Choose Image" and find the header from the Media Library or upload a new image. This will replace default with your custom image.</li>
140
 
141
+ <li><strong>Background: </strong> Go to Appearance > Background and choose a new background color or image.</li>
142
 
143
+ <li><strong>Options: </strong> Every theme handles options in its own way. Most often, they will create a set of options and store them in the WordPress database. Some options are specific to the active theme (or child theme), and some are specific to the parent theme only (meaning the child theme CANNOT override them). You will have to find out from the theme author which are which.</li>
144
  </ul>
145
  </p>
146
  <h5 id="existing_parent">How do I move changes I have already made to my theme into a Child Theme?</h5>
177
  <h5 id="add_styles">How do I add styles that aren't in the Parent Theme?</h5>
178
  <p>You can add queries and selectors using the "Raw CSS" textarea on the Query/Selector tab. See Query/Selector, above. </p>
179
  <h5 id="add_styles">How do I remove a style from the Parent Theme?</h5>
180
+ <p>You shouldn't really "remove" a style from the Parent. You can, however, set the property to "inherit," "none," or zero (depending on the property). This will negate the Parent value. Some experimentation may be necessary.</p>
181
  <h5 id="remove_styles">How do I remove a style from the Child Theme?</h5>
182
  <p>Delete the value from the input for the property you wish to remove. The Child Theme Configurator only adds overrides for properties that contain values. </p>
183
  <h5 id="important_flag">How do I set the !important flag?</h5>
195
  <ul>
196
  <li id="parent_theme"><strong>Parent Theme</strong> The WordPress Theme you wish to edit. WordPress first loads the Child Theme, then loads the Parent Theme. If a style exists in the Child Theme, it overrides the Parent Theme.</li>
197
  <li id="child_theme"><strong>Child Theme</strong> New Theme based on Parent Theme. You can create any number of Child Themes from a single Parent Theme.</li>
198
+ <li id="class"><strong>Class</strong> A term used to organize objects. For example, a &lt;div&gt; might be assigned the "blue-text" class. The stylesheet might then assign "color: blue;" to members of the "blue-text" class. Thus, the &lt;div&gt; would display text as blue in the browser.</li>
199
+ <li id="selector"><strong>Selector</strong> One or more html elements, classes, ids or other terms used to identify groups of objects.</li>
 
 
200
  <li id="property"><strong>Property</strong> One of many standardized terms used to tell the browser how to display objects matching a given selector. Examples are <strong>color</strong>, <strong>background-image</strong> and <strong>font-size</strong>.</li>
 
201
  <li id="at-rule"><strong>At-rule</strong> CSS browser instruction to extend default functionality. The Child Theme Configurator supports two At-rules:
202
  <ul>
203
+ <li id="import"><strong>@import</strong> Instructs the browser to load additional CSS information from an external source.</li>
204
+ <li id="query"><strong>@media (Media Query)</strong> Identifies blocks of styles that are used only when certain browser characteristics are true. Examples are max-width, screen and print.</li>
205
  </ul>
206
  </li>
 
207
  <li id="override"><strong>Override</strong> When a selector exists in both the Child Theme and the Parent Theme, the Child Theme takes priority over the Parent theme. This is where the Child Theme Configurator stands out: it helps you create <strong>exact overrides</strong> of selectors from the Parent Theme, eliminating hours of trial and error.</li>
 
208
  </ul>
209
  <!-- END tab -->
210
  <!-- BEGIN sidebar -->
211
  <h4>Our plugins will not nag you for donations...</h4>
212
  <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>
213
  <h4>Introducing CTC Pro</h4>
214
+ <a href="<?php echo CHLD_THM_CFG_DOCS_URL; ?>/child-theme-configurator-pro/" title="<?php _e( 'Learn more about CTC Pro', 'child-theme-configurator' ); ?>"><img src="<?php echo CHLD_THM_CFG_URL . 'css/pro-banner.jpg'; ?>" width="150" height="48" /></a>
215
  <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>
216
  <h4 id="ctc_help_sidebar">Links</h4>
217
  <ul>
218
+ <li><a href="http://www.lilaeamedia.com/about/contact/">Contact us</a></li>
219
+ <li><a href="http://www.childthemeconfigurator.com/">Plugin Website</a></li>
220
  <li><a href="http://codex.wordpress.org/Child_Themes">WordPress Codex</a></li>
221
  <li><a href="http://wordpress.stackexchange.com/">WordPress Development (StackExchange)</a></li>
222
  </ul>
js/chld-thm-cfg.js ADDED
@@ -0,0 +1,1535 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
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.9.1
6
+ * Author: Lilaea Media
7
+ * Author URI: http://www.lilaeamedia.com/
8
+ * License: GPLv2
9
+ * Copyright (C) 2014-2015 Lilaea Media
10
+ */
11
+
12
+ // ** for muliple property values: **
13
+ // make sure sequence is passed with rule/val updates
14
+ // determine sequence based on sequence of value array
15
+ // add sequence to input name
16
+
17
+ ( function( $ ) {
18
+ $.chldthmcfg = {
19
+ //console.log( 'executing main function' );
20
+ esc_quot: function( str ) {
21
+ var self = this;
22
+ return self.is_empty( str ) ? str : str.toString().replace( /"/g, '&quot;' );
23
+ },
24
+
25
+ getxt: function( key ){
26
+ return ( text = ctcAjax[ key + '_txt' ] ) ? text : '';
27
+ },
28
+
29
+ from_ascii: function( str ) {
30
+ var ascii = parseInt( str ),
31
+ chr = String.fromCharCode( ascii )
32
+ return chr;
33
+ },
34
+
35
+ to_ascii: function( str ) {
36
+ var ascii = str.charCodeAt( 0 );
37
+ return ascii;
38
+ },
39
+
40
+ /**
41
+ * is_empty
42
+ * return true if value evaluates to false, null, null string,
43
+ * empty array, empty object or undefined
44
+ * but NOT 0 ( zero returns false )
45
+ */
46
+ is_empty: function( obj ) {
47
+ // first bail when definitely empty or undefined ( true ) NOTE: numeric zero returns false !
48
+ if ( 'undefined' == typeof obj || false === obj || null === obj || '' === obj ) { return true; }
49
+ // then, if this is bool, string or number it must not be empty ( false )
50
+ if ( true === obj || "string" === typeof obj || "number" === typeof obj ) { return false; }
51
+ // check for object type to be safe
52
+ if ( "object" === typeof obj ) {
53
+ // Use a standard for in loop
54
+ for ( var x in obj ) {
55
+ // A for in will iterate over members on the prototype
56
+ // chain as well, but Object.getOwnPropertyNames returns
57
+ // only those directly on the object, so use hasOwnProperty.
58
+ if ( obj.hasOwnProperty( x ) ) {
59
+ // any value means not empty ( false )
60
+ return false;
61
+ }
62
+ }
63
+ // no properties, so return empty ( true )
64
+ return true;
65
+ }
66
+ // this must be an unsupported datatype, so return not empty
67
+ return false;
68
+ },
69
+
70
+ /**
71
+ * theme_exists
72
+ * returns true if theme is already present for type
73
+ */
74
+ theme_exists: function( testslug, testtype ) {
75
+ var exists = false;
76
+ $.each( ctcAjax.themes, function( type, theme ) {
77
+ $.each( theme, function( slug, data ) {
78
+ if ( slug.toLowerCase() === testslug.toLowerCase() && ( 'parnt' == type || 'new' == testtype ) ) {
79
+ exists = true;
80
+ return false;
81
+ }
82
+ } );
83
+ if ( exists ) return false;
84
+ } );
85
+ return exists;
86
+ },
87
+
88
+ validate: function() {
89
+ var self = this,
90
+ regex = /[^\w\-]/,
91
+ newslug = $( '#ctc_child_template' ).length ? $( '#ctc_child_template' )
92
+ .val().toString().replace( regex ) : '',
93
+ slug = $( '#ctc_theme_child' ).length ? $( '#ctc_theme_child' )
94
+ .val().toString().replace( regex ) : newslug,
95
+ type = $( 'input[name=ctc_child_type]:checked' ).val(),
96
+ errors = [];
97
+ if ( 'new' == type ) slug = newslug;
98
+ if ( self.theme_exists( slug, type ) ) {
99
+ errors.push( self.getxt( 'theme_exists' ).toString().replace( /%s/, slug ) );
100
+ }
101
+ if ( '' === slug ) {
102
+ errors.push( self.getxt( 'inval_theme' ) );
103
+ }
104
+ if ( '' === $( '#ctc_child_name' ).val() ) {
105
+ errors.push( self.getxt( 'inval_name' ) );
106
+ }
107
+ if ( errors.length ) {
108
+ self.set_notice( { 'error': errors } );
109
+ return false;
110
+ }
111
+ return true;
112
+ },
113
+
114
+ autogen_slugs: function() {
115
+ if ( $( '#ctc_theme_parnt' ).length ) {
116
+ var self = this,
117
+ parent = $( '#ctc_theme_parnt' ).val(),
118
+ slug = slugbase = parent + '-child',
119
+ name = ctcAjax.themes.parnt[ parent ].Name + ' Child',
120
+ suffix = '',
121
+ padded = '',
122
+ pad = '00';
123
+ while ( self.theme_exists( slug, 'new' ) ) {
124
+ suffix = ( '' == suffix ? 2 : suffix + 1 );
125
+ padded = pad.substring( 0, pad.length - suffix.toString().length ) + suffix.toString();
126
+ slug = slugbase + padded;
127
+ }
128
+ self.testslug = slug;
129
+ self.testname = name + ( padded.length ? ' ' + padded : '' );
130
+ }
131
+ },
132
+
133
+ focus_panel: function( id ) {
134
+ var panelid = id + '_panel';
135
+ $( '.nav-tab' ).removeClass( 'nav-tab-active' );
136
+ $( '.ctc-option-panel' ).removeClass( 'ctc-option-panel-active' );
137
+ //$( '.ctc-selector-container' ).hide();
138
+ $( id ).addClass( 'nav-tab-active' );
139
+ $( '.ctc-option-panel-container' ).scrollTop( 0 );
140
+ $( panelid ).addClass( 'ctc-option-panel-active' );
141
+ },
142
+
143
+ selector_input_toggle: function( obj ) {
144
+ //console.log( 'selector_input_toggle: ' + obj );
145
+ var self = this,
146
+ origval;
147
+ if ( $( '#ctc_rewrite_selector' ).length ) {
148
+ origval = $( '#ctc_rewrite_selector_orig' ).val();
149
+ $( '#ctc_sel_ovrd_selector_selected' ).text( origval );
150
+ $( obj ).text( self.getxt( 'rename' ) );
151
+ } else {
152
+ origval = $( '#ctc_sel_ovrd_selector_selected' ).text();
153
+ $( '#ctc_sel_ovrd_selector_selected' ).html(
154
+ '<textarea id="ctc_rewrite_selector"'
155
+ + ' name="ctc_rewrite_selector" autocomplete="off"></textarea>'
156
+ + '<input id="ctc_rewrite_selector_orig" name="ctc_rewrite_selector_orig"'
157
+ + ' type="hidden" value="' + self.esc_quot( origval ) + '"/>' );
158
+ $( '#ctc_rewrite_selector' ).val( origval );
159
+ $( obj ).text( self.getxt( 'cancel' ) );
160
+ }
161
+ },
162
+
163
+ fade_update_notice: function() {
164
+ $( '.updated, .error' ).slideUp( 'slow', function() { $( '.updated' ).remove(); } );
165
+ },
166
+
167
+ coalesce_inputs: function( obj ) {
168
+ //**console.log( 'coalesce_inputs ' + $( obj ).attr( 'id' ) );
169
+ var self = this,
170
+ id = $( obj ).attr( 'id' ),
171
+ regex = /^(ctc_(ovrd|\d+)_(parent|child)_([0-9a-z\-]+)_(\d+?)(_(\d+))?)(_\w+)?$/,
172
+ container = $( obj ).parents( '.ctc-selector-row, .ctc-parent-row' ).first(),
173
+ swatch = container.find( '.ctc-swatch' ).first(),
174
+ cssrules = { 'parent': {}, 'child': {} },
175
+ gradient = {
176
+ 'parent': {
177
+ 'origin': '',
178
+ 'start': '',
179
+ 'end': ''
180
+ },
181
+ 'child': {
182
+ 'origin': '',
183
+ 'start': '',
184
+ 'end': ''
185
+ }
186
+ },
187
+ has_gradient = { 'child': false, 'parent': false },
188
+ postdata = {};
189
+ // set up objects for all neighboring inputs
190
+ container.find( '.ctc-parent-value, .ctc-child-value' ).each( function() {
191
+ var inputid = $( this ).attr( 'id' ),
192
+ inputparts = inputid.toString().match( regex ),
193
+ inputseq = inputparts[ 2 ],
194
+ inputtheme = inputparts[ 3 ],
195
+ inputrule = ( 'undefined' == typeof inputparts[ 4 ] ? '' : inputparts[ 4 ] ),
196
+ rulevalid = inputparts[ 7 ],
197
+ qsid = inputparts[ 5 ],
198
+ rulepart = ( 'undefined' == typeof inputparts[ 7 ] ? '' : inputparts[ 8 ] ),
199
+ value = ( 'parent' == inputtheme ? $( this ).text().replace( /!$/, '' ) :
200
+ ( 'seq' != inputrule && 'ctc_delete_query_selector' == id ? '' : $( this ).val() ) ), // clear values if delete was clicked
201
+ important = ( 'seq' == inputrule ? false : 'ctc_' + inputseq + '_child_' + inputrule + '_i_' + qsid + '_' + rulevalid ),
202
+ parts, subparts;
203
+ //**console.log( inputparts );
204
+ //**console.log( 'value: ' + value );
205
+ if ( 'child' == inputtheme ) {
206
+ if ( !self.is_empty( $( this ).data( 'color' ) ) ) {
207
+ value = self.color_text( $( this ).data( 'color' ) );
208
+ $( this ).data( 'color', null );
209
+ }
210
+ postdata[ inputid ] = value;
211
+ if ( important )
212
+ postdata[ important ] = ( $( '#' + important ).is( ':checked' ) ) ? 1 : 0;
213
+ }
214
+ if ( '' !== value ) {
215
+ // handle specific inputs
216
+ if ( !self.is_empty( rulepart ) ) {
217
+ switch( rulepart ) {
218
+ case '_border_width':
219
+ cssrules[ inputtheme ][ inputrule + '-width' ] = ( 'none' == value ? 0 : value );
220
+ break;
221
+ case '_border_style':
222
+ cssrules[ inputtheme ][ inputrule + '-style' ] = value;
223
+ break;
224
+ case '_border_color':
225
+ cssrules[ inputtheme ][ inputrule + '-color' ] = value;
226
+ break;
227
+ case '_background_url':
228
+ cssrules[ inputtheme ][ 'background-image' ] = self.image_url( inputtheme, value );
229
+ break;
230
+ case '_background_color':
231
+ cssrules[ inputtheme ][ 'background-color' ] = value; // was obj.value ???
232
+ break;
233
+ case '_background_color1':
234
+ gradient[ inputtheme ].start = value;
235
+ has_gradient[ inputtheme ] = true;
236
+ break;
237
+ case '_background_color2':
238
+ gradient[ inputtheme ].end = value;
239
+ has_gradient[ inputtheme ] = true;
240
+ break;
241
+ case '_background_origin':
242
+ gradient[ inputtheme ].origin = value;
243
+ has_gradient[ inputtheme ] = true;
244
+ break;
245
+ }
246
+ } else {
247
+ // handle borders
248
+ if ( parts = inputrule.toString().match( /^border(\-(top|right|bottom|left))?$/ ) && !value.match( /none/ ) ) {
249
+ var borderregx = new RegExp( self.border_regx + self.color_regx, 'i' ),
250
+ subparts = value.toString().match( borderregx );
251
+ //**console.log( 'border after regex: ');
252
+ //**console.log( value );
253
+ //**console.log( borderregx );
254
+ //**console.log( subparts );
255
+ if ( !self.is_empty( subparts ) ) {
256
+ subparts.shift();
257
+ cssrules[ inputtheme ][ inputrule + '-width' ] = subparts.shift() || '';
258
+ subparts.shift();
259
+ cssrules[ inputtheme ][ inputrule + '-style' ] = subparts.shift() || '';
260
+ cssrules[ inputtheme ][ inputrule + '-color' ] = subparts.shift() || '';
261
+ }
262
+ // handle background images
263
+ } else if ( 'background-image' == inputrule && !value.match( /none/ ) ) {
264
+ if ( value.toString().match( /url\(/ ) ) {
265
+ cssrules[ inputtheme ][ 'background-image' ] = self.image_url( inputtheme, value );
266
+ } else {
267
+ var gradregex = new RegExp( self.grad_regx + self.color_regx + self.color_regx, 'i' ),
268
+ subparts = value.toString().match( gradregex );
269
+ //**console.log( 'background-image after regex: ');
270
+ //**console.log( value );
271
+ //**console.log( gradregex );
272
+ //**console.log( subparts );
273
+ if ( !self.is_empty( subparts ) && subparts.length > 2 ) {
274
+ subparts.shift();
275
+ gradient[ inputtheme ].origin = subparts.shift() || 'top';
276
+ gradient[ inputtheme ].start = subparts.shift() || 'transparent';
277
+ gradient[ inputtheme ].end = subparts.shift() || 'transparent';
278
+ has_gradient[ inputtheme ] = true;
279
+ } else {
280
+ cssrules[ inputtheme ][ 'background-image' ] = value;
281
+ }
282
+ }
283
+ } else if ( 'seq' != inputrule ) {
284
+ cssrules[ inputtheme ][ inputrule ] = value;
285
+ }
286
+ }
287
+ }
288
+ } );
289
+ // update swatch
290
+ if ( 'undefined' != typeof swatch && !self.is_empty( swatch.attr( 'id' ) ) ) {
291
+ swatch.removeAttr( 'style' );
292
+ if ( has_gradient.parent ) {
293
+ swatch.ctcgrad( gradient.parent.origin, [ gradient.parent.start, gradient.parent.end ] );
294
+ }
295
+ //**console.log( 'combined css rules' );
296
+ //**console.log( cssrules );
297
+ swatch.css( cssrules.parent );
298
+ if ( !( swatch.attr( 'id' ).toString().match( /parent/ ) ) ) {
299
+ if ( has_gradient.child ) {
300
+ swatch.ctcgrad( gradient.child.origin, [ gradient.child.start, gradient.child.end ] );
301
+ }
302
+ //console.log( cssrules.child );
303
+ swatch.css( cssrules.child );
304
+ }
305
+ swatch.css( {'z-index':-1} );
306
+ }
307
+ return postdata;
308
+ },
309
+
310
+ decode_value: function( rule, value ) {
311
+ //**console.log( 'in decode_value ( ' + rule + ' ...' );
312
+ value = ( 'undefined' == typeof value ? '' : value );
313
+ var self = this,
314
+ obj = {
315
+ 'orig': value,
316
+ 'names': [ '' ],
317
+ 'values': [ value ]
318
+ };
319
+ if ( rule.toString().match( /^border(\-(top|right|bottom|left))?$/ ) ) {
320
+ var regex = new RegExp( self.border_regx + '(' + self.color_regx + ')?', 'i' ),
321
+ params = value.toString().match( regex );
322
+ if ( self.is_empty( params ) ) params = [];
323
+ obj.names = [
324
+ '_border_width',
325
+ '_border_style',
326
+ '_border_color',
327
+ ];
328
+ orig = params.shift();
329
+ //**console.log( value );
330
+ //**console.log( regex );
331
+ //**console.log( params );
332
+ obj.values[ 0 ] = params.shift() || '';
333
+ params.shift();
334
+ obj.values[ 1 ] = params.shift() || '';
335
+ params.shift();
336
+ obj.values[ 2 ] = params.shift() || '';
337
+ } else if ( rule.toString().match( /^background\-image/ ) ) {
338
+ obj.names = [
339
+ '_background_url',
340
+ '_background_origin',
341
+ '_background_color1',
342
+ '_background_color2'
343
+ ];
344
+ obj.values = [ '', '', '', '' ];
345
+ if ( !self.is_empty( value ) && !( value.toString().match( /(url|none)/ ) ) ) {
346
+ var params = value.toString().split( /:/ ),
347
+ stop1, stop2;
348
+ //**console.log( value );
349
+ //**console.log( params );
350
+ obj.values[ 1 ] = params.shift() || '';
351
+ obj.values[ 2 ] = params.shift() || '';
352
+ stop1 = params.shift() || '';
353
+ obj.values[ 3 ] = params.shift() || '';
354
+ stop2 = params.shift() || '';
355
+ obj.orig = [
356
+ obj.values[ 1 ],
357
+ obj.values[ 2 ],
358
+ obj.values[ 3 ]
359
+ ].join( ' ' );
360
+ } else {
361
+ obj.values[ 0 ] = value;
362
+ }
363
+ }
364
+ //**console.log( obj );
365
+ return obj;
366
+ },
367
+
368
+ image_url: function( theme, value ) {
369
+ var self = this,
370
+ parts = value.toString().match( /url\(['" ]*(.+?)['" ]*\)/ ),
371
+ path = self.is_empty( parts ) ? null : parts[ 1 ],
372
+ url = ctcAjax.theme_uri + '/' + ( 'parent' == theme ? ctcAjax.parnt : ctcAjax.child ) + '/',
373
+ image_url;
374
+ if ( !path ) {
375
+ return false;
376
+ } else if ( path.toString().match( /^(data:|https?:|\/)/ ) ) {
377
+ image_url = value;
378
+ } else {
379
+ image_url = 'url(' + url + path + ')';
380
+ }
381
+ return image_url;
382
+ },
383
+
384
+ setup_menus: function() {
385
+ var self = this;
386
+ //console.log( 'setup_menus' );
387
+ self.setup_query_menu();
388
+ self.setup_selector_menu();
389
+ self.setup_rule_menu();
390
+ self.setup_new_rule_menu();
391
+ self.load_queries();
392
+ self.load_rules();
393
+ // selectors will be loaded after query selected
394
+ self.set_query( self.current_query );
395
+ },
396
+
397
+ load_queries: function() {
398
+ var self = this;
399
+ //console.log( 'load_queries' );
400
+ // retrieve unique media queries
401
+ self.query_css( 'queries', null );
402
+ },
403
+
404
+ load_selectors: function() {
405
+ var self = this;
406
+ //console.log( 'load_selectors' );
407
+ // retrieve unique selectors from query value
408
+ self.query_css( 'selectors', self.current_query );
409
+ },
410
+
411
+ load_rules: function() {
412
+ var self = this;
413
+ //console.log( 'load_rules' );
414
+ // retrieve all unique rules
415
+ self.query_css( 'rules', null );
416
+ },
417
+
418
+ load_selector_values: function() {
419
+ var self = this;
420
+ //console.log( 'load_selector_values: ' + self.current_qsid );
421
+ // retrieve individual values from qsid
422
+ self.query_css( 'qsid', self.current_qsid );
423
+ },
424
+
425
+ get_queries: function( request, response ) {
426
+ //console.log( 'get_queries' );
427
+ //console.log( this );
428
+ var self = this,
429
+ arr = [],
430
+ matcher = new RegExp( $.ui.autocomplete.escapeRegex( request.term ), "i" );
431
+ if ( $.chldthmcfg.is_empty( this.element.data( 'menu' ) ) ) {
432
+ arr.push( { 'label': ctcAjax.nosels_txt, 'value': null } );
433
+ } else {
434
+ // note: key = ndx, value = query name
435
+ $.each( this.element.data( 'menu' ), function( key, val ) {
436
+ if ( matcher.test( val ) ) {
437
+ arr.push( { 'label': val, 'value': val } );
438
+ }
439
+ } );
440
+ }
441
+ response( arr );
442
+ },
443
+
444
+ get_selectors: function( request, response ) {
445
+ //console.log( 'get_selectors' );
446
+ var self = this,
447
+ arr = [],
448
+ matcher = new RegExp( $.ui.autocomplete.escapeRegex( request.term ), "i" );
449
+ if ( $.chldthmcfg.is_empty( this.element.data( 'menu' ) ) ) {
450
+ arr.push( { 'label': ctcAjax.nosels_txt, 'value': null } );
451
+ } else {
452
+ // note: key = selector name, value = qsid
453
+ $.each( this.element.data( 'menu' ), function( key, val ) {
454
+ if ( matcher.test( key ) ) {
455
+ arr.push( { 'label': key, 'value': val } );
456
+ }
457
+ } );
458
+ }
459
+ response( arr );
460
+ },
461
+
462
+ get_rules: function( request, response ) {
463
+ //console.log( 'get_rules' );
464
+ var self = this,
465
+ arr = [],
466
+ matcher = new RegExp( $.ui.autocomplete.escapeRegex( request.term ), "i" );
467
+ if ( $.chldthmcfg.is_empty( this.element.data( 'menu' ) ) ) {
468
+ arr.push( { 'label': ctcAjax.nosels_txt, 'value': null } );
469
+ } else {
470
+ // note: key = ruleid, value = rule name
471
+ $.each( this.element.data( 'menu' ), function( key, val ) {
472
+ if ( matcher.test( key ) ) {
473
+ arr.push( { 'label': key, 'value': val } );
474
+ }
475
+ } );
476
+ }
477
+ response( arr );
478
+ },
479
+
480
+ get_filtered_rules: function( request, response ) {
481
+ //console.log( 'get_filtered_rules' );
482
+ var arr = [],
483
+ matcher = new RegExp( $.ui.autocomplete.escapeRegex( request.term ), "i" ); //,
484
+ $.each( $( '#ctc_rule_menu' ).data( 'menu' ), function( key, val ) {
485
+ //multiple versions of rule ok
486
+ if ( matcher.test( key ) ) {
487
+ arr.push( { 'label': key, 'value': val } );
488
+ }
489
+ } );
490
+ response( arr );
491
+ },
492
+
493
+ /**
494
+ * parent and child values are stored in separate arrays
495
+ * this function puts them into parent/child columns by rulevalid
496
+ */
497
+ merge_ruleval_arrays: function( rule, value, isnew ) {
498
+ //**console.log( 'merge_ruleval_arrays' );
499
+ var self = this,
500
+ valarr = {};
501
+ nextval = isnew ? value.child.pop() : null; // if new rule, pop off the top before counting
502
+ //**console.log( value );
503
+ $.each( [ 'parnt', 'child' ], function( ndx, template ) {
504
+ // iterate through parent and child val arrays and populate new assoc array with parent/child for each rulevalid
505
+ if ( !self.is_empty( value[ template ] ) ) {
506
+ $.each( value[ template ], function( ndx2, val ) {
507
+ if ( isnew ) {
508
+ // if new rule, increment new rulevalid but do not add to parent/child assoc array
509
+ if ( parseInt( val[ 2 ] ) >= parseInt( nextval[ 2 ] ) ) nextval[ 2 ] = parseInt( val[ 2 ] ) + 1;
510
+ } else {
511
+ // add to parent/child assoc array with rulevalid as key
512
+ if ( self.is_empty( valarr[ val[ 2 ] ] ) ) valarr[ val[ 2 ] ] = {};
513
+ valarr[ val[ 2 ] ][ template ] = val;
514
+ }
515
+ } );
516
+ }
517
+ } );
518
+ // if new rule, create new parent child assoc array element with new rulevalid as key
519
+ if ( isnew ) {
520
+ valarr[ nextval[ 2 ] ] = {
521
+ parnt: [],
522
+ child: nextval
523
+ };
524
+ }
525
+ return valarr;
526
+ },
527
+
528
+ /**
529
+ * input_row
530
+ * render individual row of inputs for a given selector/rule combination
531
+ * qsid query/selector id
532
+ * rule css property
533
+ * seq panel id from rule/value tab
534
+ * data contains all rules/values for selector
535
+ * isnew is passed true when new rule is selected from menu
536
+ */
537
+ input_row: function( qsid, rule, seq, data, isnew ) {
538
+ //console.log( 'in input_row' );
539
+ var self = this,
540
+ html = '';
541
+ if ( !self.is_empty( data ) && !self.is_empty( data.value ) && !self.is_empty( data.value[ rule ] ) ) {
542
+ var value = data.value[ rule ],
543
+ valarr = self.merge_ruleval_arrays( rule, value, isnew );
544
+ $.each( valarr, function( ndx, val ) {
545
+ var pval = self.decode_value( rule, self.is_empty( val.parnt ) ? '' : val.parnt[ 0 ] ),
546
+ pimp = self.is_empty( val.parnt ) || 0 == val.parnt[ 1 ] ? 0 : 1,
547
+ cval = self.decode_value( rule, self.is_empty( val.child ) ? '' : val.child[ 0 ] ),
548
+ cimp = self.is_empty( val.child ) || 0 == val.child[ 1 ] ? 0 : 1;
549
+ html += '<div class="ctc-' + ( 'ovrd' == seq ? 'input' : 'selector' ) + '-row clearfix"><div class="ctc-input-cell">';
550
+ if ( 'ovrd' == seq ) {
551
+ html += rule.replace( /\d+/g, self.from_ascii );
552
+ } else {
553
+ html += data.selector + '<br/><a href="#" class="ctc-selector-edit"'
554
+ + ' id="ctc_selector_edit_' + qsid + '" >' + self.getxt( 'edit' ) + '</a> '
555
+ + ( self.is_empty( pval.orig ) ? self.getxt( 'child_only' ) : '' );
556
+ }
557
+ html += '</div><div class="ctc-parent-value ctc-input-cell"' + ( 'ovrd' != seq ? ' style="display:none"' : '' )
558
+ + ' id="ctc_' + seq + '_parent_' + rule + '_' + qsid + '_' + ndx + '">'
559
+ + ( self.is_empty( pval.orig ) ? '[no value]' : pval.orig + ( pimp ? self.getxt( 'important' ) : '' ) )
560
+ + '</div><div class="ctc-input-cell">';
561
+ if ( !self.is_empty( pval.names ) ) {
562
+ $.each( pval.names, function( namendx, newname ) {
563
+ newname = ( self.is_empty( newname ) ? '' : newname );
564
+ html += '<div class="ctc-child-input-cell clear">';
565
+ var id = 'ctc_' + seq + '_child_' + rule + '_' + qsid + '_' + ndx + newname,
566
+ newval;
567
+ if ( false === ( newval = cval.values.shift() ) ) {
568
+ newval = '';
569
+ }
570
+
571
+ html += ( self.is_empty( newname ) ? '' : self.getxt( newname ) + ':<br/>' )
572
+ + '<input type="text" id="' + id + '" name="' + id + '" class="ctc-child-value'
573
+ + ( ( newname + rule ).toString().match( /color/ ) ? ' color-picker' : '' )
574
+ + ( ( newname ).toString().match( /url/ ) ? ' ctc-input-wide' : '' )
575
+ + '" value="' + self.esc_quot( newval ) + '" /></div>';
576
+ } );
577
+ var impid = 'ctc_' + seq + '_child_' + rule + '_i_' + qsid + '_' + ndx;
578
+ html += '<label for="' + impid + '"><input type="checkbox"'
579
+ + ' id="' + impid + '" name="' + impid + '" value="1" '
580
+ + ( cimp ? 'checked' : '' ) + ' />'
581
+ + self.getxt( 'important' ) + '</label>';
582
+ }
583
+ html += '</div>';
584
+ if ( 'ovrd' != seq ) {
585
+ html += '<div class="ctc-swatch ctc-specific"'
586
+ + ' id="ctc_child_' + rule + '_' + qsid + '_' + ndx + '_swatch">'
587
+ + self.getxt( 'swatch' ) + '</div>'
588
+ + '<div class="ctc-child-input-cell ctc-button-cell"'
589
+ + ' id="ctc_save_' + rule + '_' + qsid + '_' + ndx + '_cell">'
590
+ + '<input type="button" class="button ctc-save-input"'
591
+ + ' id="ctc_save_' + rule + '_' + qsid + '_' + ndx + '"'
592
+ + ' name="ctc_save_' + rule + '_' + qsid + '_' + ndx + '"'
593
+ + ' value="Save" /></div>';
594
+ }
595
+ html += '</div><!-- end input row -->' + "\n";
596
+ } );
597
+ }
598
+ return html;
599
+ },
600
+
601
+ scrolltop: function() {
602
+ $('html, body, .ctc-option-panel-container').animate( { scrollTop: 0 } );
603
+ },
604
+
605
+ css_preview: function( theme ) {
606
+ var self = this,
607
+ theme;
608
+ //console.log( 'css_preview: ' + theme );
609
+ if ( !( theme = theme.match( /(child|parnt)/ )[ 1 ] ) ) {
610
+ theme = 'child';
611
+ }
612
+ // retrieve raw stylesheet ( parent or child )
613
+ self.query_css( 'preview', theme );
614
+ },
615
+
616
+ /**
617
+ * The "setup" functions initialize jQuery UI widgets
618
+ */
619
+ setup_iris: function( obj ) {
620
+ // deprecated: using spectrum for alpha support
621
+ var self = this;
622
+ self.setup_spectrum( obj );
623
+ },
624
+
625
+ setup_spectrum: function( obj ) {
626
+ var self = this,
627
+ colortxt = $( obj ).attr( 'id' ) + '_colortxt',
628
+ palette = !self.is_empty( ctcAjax.palette );
629
+ try {
630
+ $( obj ).spectrum( {
631
+ showInput: true,
632
+ allowEmpty: true,
633
+ showAlpha: true,
634
+ showInitial: true,
635
+ preferredFormat: "hex", // 'name', //
636
+ clickoutFiresChange: true,
637
+ move: function( color ) {
638
+ $( obj ).data( 'color', color );
639
+ self.coalesce_inputs( obj );
640
+ },
641
+ showPalette: palette ? true : false,
642
+ showSelectionPalette: palette ? true : false,
643
+ palette: [ ],
644
+ maxSelectionSize: 36,
645
+ localStorageKey: "ctc-palette." + ctcAjax.child,
646
+ hideAfterPaletteSelect: true,
647
+ } ).on( 'change', function( e ){
648
+ var color = $( this ).spectrum( 'get' );
649
+ //console.log( 'color change: ' + color );
650
+ self.coalesce_inputs( this );
651
+ } ).on( 'keyup', function( e ) {
652
+ // update spectrum ui to match text input after half-second delay
653
+ var $this = this,
654
+ $val = $( this ).val();
655
+ clearTimeout( $( this ).data( 'spectrumTimer' ) );
656
+ $( this ).data( 'spectrumTimer', setTimeout(
657
+ function() {
658
+ self.coalesce_inputs( $this );
659
+ $( $this ).spectrum( 'set', $val );
660
+
661
+ },
662
+ 500
663
+ ) );
664
+ } );
665
+
666
+ } catch ( exn ) {
667
+ self.jquery_exception( exn, 'Spectrum Color Picker' );
668
+ }
669
+ },
670
+
671
+ color_text: function( color ) {
672
+ var self = this;
673
+ if ( self.is_empty( color ) ) {
674
+ return '';
675
+ } else if ( color.getAlpha() < 1 ) {
676
+ return color.toRgbString();
677
+ } else {
678
+ return color.toHexString();
679
+ }
680
+ },
681
+
682
+ setup_query_menu: function() {
683
+ var self = this;
684
+ //console.log( 'setup_query_menu' );
685
+ try {
686
+ $( '#ctc_sel_ovrd_query' ).autocomplete( {
687
+ source: self.get_queries,
688
+ minLength: 0,
689
+ selectFirst: true,
690
+ autoFocus: true,
691
+ select: function( e, ui ) {
692
+ self.set_query( ui.item.value );
693
+ return false;
694
+ },
695
+ focus: function( e ) {
696
+ e.preventDefault();
697
+ }
698
+ } ).data( 'menu' , {} );
699
+ } catch ( exn ) {
700
+ self.jquery_exception( exn, 'Query Menu' );
701
+ }
702
+ },
703
+
704
+ setup_selector_menu: function() {
705
+ var self = this;
706
+ //console.log( 'setup_selector_menu' );
707
+ try {
708
+ $( '#ctc_sel_ovrd_selector' ).autocomplete( {
709
+ source: self.get_selectors,
710
+ selectFirst: true,
711
+ autoFocus: true,
712
+ select: function( e, ui ) {
713
+ self.set_selector( ui.item.value, ui.item.label );
714
+ return false;
715
+ },
716
+ focus: function( e ) {
717
+ e.preventDefault();
718
+ }
719
+ } ).data( 'menu' , {} );
720
+ } catch ( exn ) {
721
+ self.jquery_exception( exn, 'Selector Menu' );
722
+ }
723
+ },
724
+
725
+ setup_rule_menu: function() {
726
+ var self = this;
727
+ //console.log( 'setup_rule_menu' );
728
+ try {
729
+ $( '#ctc_rule_menu' ).autocomplete( {
730
+ source: self.get_rules,
731
+ //minLength: 0,
732
+ selectFirst: true,
733
+ autoFocus: true,
734
+ select: function( e, ui ) {
735
+ self.set_rule( ui.item.value, ui.item.label );
736
+ return false;
737
+ },
738
+ focus: function( e ) {
739
+ e.preventDefault();
740
+ }
741
+ } ).data( 'menu' , {} );
742
+ } catch ( exn ) {
743
+ self.jquery_exception( exn, 'Property Menu' );
744
+ }
745
+ },
746
+
747
+ setup_new_rule_menu: function() {
748
+ var self = this;
749
+ try {
750
+ $( '#ctc_new_rule_menu' ).autocomplete( {
751
+ source: self.get_filtered_rules,
752
+ //minLength: 0,
753
+ selectFirst: true,
754
+ autoFocus: true,
755
+ select: function( e, ui ) {
756
+ //console.log( 'new rule selected' );
757
+ e.preventDefault();
758
+ var newrule = ui.item.label.replace( /[^\w\-]/g, self.to_ascii ),
759
+ n = 1,
760
+ row,
761
+ first;
762
+ //console.log( 'current qsdata before:' );
763
+ //console.log( self.current_qsdata );
764
+ if ( self.is_empty( self.current_qsdata.value ) ) {
765
+ self.current_qsdata.value = {};
766
+ }
767
+ if ( self.is_empty( self.current_qsdata.value[ ui.item.label ] ) ) {
768
+ self.current_qsdata.value[ ui.item.label ] = {};
769
+ }
770
+ if ( self.is_empty( self.current_qsdata.value[ ui.item.label ].child ) ) {
771
+ self.current_qsdata.value[ ui.item.label ].child = [];
772
+ }
773
+ //console.log( 'current qsdata after:' );
774
+ //console.log( self.current_qsdata );
775
+ // seed current qsdata with new blank value with id 1
776
+ // this will be modified during input_row function to be next id in order
777
+ self.current_qsdata.value[ ui.item.label ].child.push( [ '', 0, 1, 1 ] );
778
+ row = $( self.input_row( self.current_qsid, newrule, 'ovrd', self.current_qsdata, true ) );
779
+ $( '#ctc_sel_ovrd_rule_inputs' ).append( row );
780
+ $( '#ctc_new_rule_menu' ).val( '' );
781
+
782
+ row.find( 'input[type="text"]' ).each( function( ndx, el ) {
783
+ if (! first) first = el;
784
+ if ( $( el ).hasClass( 'color-picker' ) )
785
+ self.setup_spectrum( el );
786
+ } );
787
+ if ( first )
788
+ $( first ).focus();
789
+ if ( self.jquery_err.length )
790
+ self.jquery_notice( 'setup_new_rule_menu' );
791
+ return false;
792
+ },
793
+ focus: function( e ) {
794
+ e.preventDefault();
795
+ }
796
+ } ).data( 'menu' , {} );
797
+ } catch ( exn ) {
798
+ self.jquery_exception( exn, 'New Property Menu' );
799
+ }
800
+ },
801
+
802
+ set_existing: function() {
803
+ var self = this;
804
+ if ( $( '#ctc_theme_child' ).length && $( '#ctc_child_type_existing' ).is( ':checked' ) ) {
805
+ var child = $( '#ctc_theme_child' ).val();
806
+ if ( !self.is_empty( child ) ) {
807
+ $( '#ctc_child_name' ).val( ctcAjax.themes.child[ child ].Name );
808
+ $( '#ctc_child_author' ).val( ctcAjax.themes.child[ child ].Author );
809
+ $( '#ctc_child_version' ).val( ctcAjax.themes.child[ child ].Version );
810
+ $( '#ctc_child_authoruri' ).val( ctcAjax.themes.child[ child ].AuthorURI );
811
+ $( '#ctc_child_themeuri' ).val( ctcAjax.themes.child[ child ].ThemeURI );
812
+ $( '#ctc_child_descr' ).val( ctcAjax.themes.child[ child ].Descr );
813
+ $( '#ctc_child_tags' ).val( ctcAjax.themes.child[ child ].Tags );
814
+ $( '#ctc_duplicate_theme' ).prop( 'checked', false );
815
+ $( '#ctc_duplicate_theme_slug' ).val( '' );
816
+ $( '#input_row_duplicate_theme' ).show();
817
+ }
818
+ }
819
+ },
820
+
821
+ set_notice: function( noticearr ) {
822
+ var self = this,
823
+ errorHtml = '';
824
+ if ( !self.is_empty( noticearr ) ) {
825
+ $.each( noticearr, function( type, list ) {
826
+ errorHtml += '<div class="' + type + '"><ul>' + "\n";
827
+ $( list ).each( function( ndx, el ) {
828
+ errorHtml += '<li>' + el.toString() + '</li>' + "\n";
829
+ } );
830
+ errorHtml += '</ul></div>';
831
+ } );
832
+ }
833
+ $( '#ctc_error_notice' ).html( errorHtml );
834
+ $( 'html, body' ).animate( { scrollTop: 0 }, 'slow' );
835
+ },
836
+
837
+ set_parent_menu: function( obj ) {
838
+ $( '#ctc_theme_parnt' ).parents( '.ctc-input-row' ).first()
839
+ .append( '<span class="ctc-status-icon spinner"></span>' );
840
+ $( '.spinner' ).show();
841
+ document.location='?page=' + ctcAjax.page + '&ctc_parent=' + obj.value;
842
+ },
843
+
844
+ set_child_menu: function( obj ) {
845
+ var self = this,
846
+ template,
847
+ parent;
848
+ if ( !self.is_empty( ctcAjax.themes.child[ obj.value ] ) ) {
849
+ template = ctcAjax.themes.child[ obj.value ].Template,
850
+ parent = $( '#ctc_theme_parnt' ).val();
851
+ //console.log( 'template: ' + template + ' parent: ' + parent );
852
+ if ( template == parent ) {
853
+ $( '#ctc_child_name' ).val( ctcAjax.themes.child[ obj.value ].Name );
854
+ $( '#ctc_child_author' ).val( ctcAjax.themes.child[ obj.value ].Author );
855
+ $( '#ctc_child_version' ).val( ctcAjax.themes.child[ obj.value ].Version );
856
+ } else {
857
+ $( '#ctc_theme_child' ).parents( '.ctc-input-row' ).first()
858
+ .append( '<span class="ctc-status-icon spinner"></span>' );
859
+ $( '.spinner' ).show();
860
+ document.location='?page=' + ctcAjax.page + '&ctc_parent=' + template + '&ctc_child=' + obj.value;
861
+ }
862
+ }
863
+ },
864
+
865
+ set_query: function( value ) {
866
+ var self = this;
867
+ if ( self.is_empty( value ) ) return false;
868
+ //console.log( 'set_query: ' + value );
869
+ self.current_query = value;
870
+ $( '#ctc_sel_ovrd_query' ).val( '' );
871
+ $( '#ctc_sel_ovrd_query_selected' ).text( value );
872
+ $( '#ctc_sel_ovrd_selector' ).val( '' );
873
+ $( '#ctc_sel_ovrd_selector_selected' ).html( '&nbsp;' );
874
+ //$( '#ctc_sel_ovrd_rule_inputs' ).html( '' );
875
+ self.load_selectors();
876
+ self.scrolltop();
877
+ },
878
+
879
+ set_selector: function( value, label ) {
880
+ var self = this;
881
+ if ( self.is_empty( value ) ) return false;
882
+ //console.log( 'set_selector: ' + value + ' label: ' + label );
883
+ $( '#ctc_sel_ovrd_selector' ).val( '' );
884
+ self.current_qsid = value;
885
+ self.reload_menus = false;
886
+ self.load_selector_values();
887
+ self.scrolltop();
888
+ },
889
+
890
+ set_rule: function( value, label ) {
891
+ //console.log( 'set_rule: ' + value + ' label: ' + label );
892
+ var self = this;
893
+ if ( self.is_empty( value ) ) return false;
894
+ $( '#ctc_rule_menu' ).val( '' );
895
+ $( '#ctc_rule_menu_selected' ).text( label );
896
+ $( '.ctc-rewrite-toggle' ).text( self.getxt( 'rename' ) );
897
+ $( '#ctc_rule_value_inputs, #ctc_input_row_rule_header' ).show();
898
+ // retrieve unique values by rule
899
+ self.query_css( 'rule_val', value );
900
+ self.scrolltop();
901
+ },
902
+
903
+ set_qsid: function( obj ) {
904
+ var self = this;
905
+ //console.log( 'set_qsid: ' + $( obj ).attr( 'id' ) );
906
+ self.current_qsid = $( obj ).attr( 'id' ).match( /_(\d+)$/ )[ 1 ];
907
+ self.focus_panel( '#query_selector_options' );
908
+ self.reload_menus = true;
909
+ self.load_selector_values();
910
+ },
911
+
912
+ /**
913
+ * slurp website home page and parse header for linked stylesheets
914
+ * set these to be parsed as "default" stylesheets
915
+ */
916
+ set_addl_css: function() {
917
+ //console.log( 'set_addl_css' );
918
+ var self = this,
919
+ template = $( '#ctc_theme_parnt' ).val(),
920
+ theme_uri = ctcAjax.theme_uri.replace( /^https?:\/\//, '' ),
921
+ homeurl = ctcAjax.homeurl.replace( /^https?/, ctcAjax.ssl ? 'https' : 'http' ),
922
+ url = homeurl + '&template=' + template + '&stylesheet=' + template,
923
+ regex = new RegExp( "<link rel=[\"']stylesheet[\"'][^>]+?"
924
+ + theme_uri + '/' + template + '/(.+?\\.css)[^>]+?>', 'g' ),
925
+ additional;
926
+ if ( self.is_empty( template ) ) return;
927
+ //console.log( template );
928
+ if ( template != ctcAjax.parnt ) {
929
+ $.get( url, function( data ) {
930
+ //console.log( data );
931
+ while ( additional = regex.exec( data ) ) {
932
+ //console.log( additional );
933
+ if ( 'style.css' == additional[ 1 ] ) break; // bail after main stylesheet
934
+ if ( additional[ 1 ].match( /bootstrap/ ) ) continue; // don't autoselect Bootstrap stylesheets
935
+ $( '.ctc_checkbox' ).each( function( ndx, el ) {
936
+ if ( $( this ).val() == additional[ 1 ] ) $( this ).prop( 'checked', true );
937
+ } );
938
+ }
939
+ data = null; // send page to garbage
940
+ } );
941
+ } else {
942
+ //console.log('existing... using addl_css array');
943
+ $( ctcAjax.addl_css ).each( function( ndx, el ) {
944
+ $( '#ctc_stylesheet_files .ctc_checkbox' ).each( function( index, elem ) {
945
+ if ( $( this ).val() == el ) $( this ).prop( 'checked', true );
946
+ } );
947
+ } );
948
+ }
949
+ },
950
+
951
+ /**
952
+ * Retrieve data from server and execute callback on completion
953
+ */
954
+ query_css: function( obj, key, params ) {
955
+ //console.log( 'query_css: ' + obj + ' key: ' + key );
956
+ var self = this,
957
+ postdata = { 'ctc_query_obj' : obj, 'ctc_query_key': key },
958
+ status_sel = '#ctc_status_' + obj + ( 'val_qry' == obj ? '_' + key : '' );
959
+
960
+ if ( 'object' === typeof params ) {
961
+ $.each( params, function( key, val ) {
962
+ postdata[ 'ctc_query_' + key ] = val;
963
+ } );
964
+ }
965
+ $( '.query-icon,.ctc-status-icon' ).remove();
966
+ //console.log( status_sel + ' ' + $( status_sel ).length );
967
+ $( status_sel + ' .ctc-status-icon' ).remove();
968
+ $( status_sel ).append( '<span class="ctc-status-icon spinner query-icon"></span>' );
969
+ $( '.spinner' ).show();
970
+ // add wp ajax action to array
971
+ //console.log( $( '#ctc_action' ).val() );
972
+ postdata[ 'action' ] = ( !self.is_empty( $( '#ctc_action' ).val() )
973
+ && 'plugin' == $( '#ctc_action' ).val() ) ?
974
+ 'ctc_plgqry' : 'ctc_query';
975
+ postdata[ '_wpnonce' ] = $( '#_wpnonce' ).val();
976
+ // ajax post input data
977
+ //console.log( 'query_css postdata:' );
978
+ //console.log( postdata );
979
+ self.ajax_post( obj, postdata );
980
+ },
981
+ /**
982
+ * Post data to server for saving and execute callback on completion
983
+ */
984
+ save: function( obj ) {
985
+ //console.log( 'save: ' + $( obj ).attr( 'id' ) );
986
+ var self = this,
987
+ url = ctcAjax.ajaxurl, // get ajax url from localized object
988
+ postdata = {},
989
+ $selector, $query, $imports, $rule,
990
+ id = $( obj ).attr( 'id' ), newsel, origsel;
991
+
992
+ // disable the button until ajax returns
993
+ $( obj ).prop( 'disabled', true );
994
+ // clear previous success/fail icons
995
+ $( '.ctc-query-icon,.ctc-status-icon' ).remove();
996
+ // show spinner
997
+ $( obj ).parent( '.ctc-textarea-button-cell, .ctc-button-cell' )
998
+ .append( '<span class="ctc-status-icon spinner save-icon"></span>' );
999
+ if ( id.match( /ctc_configtype/ ) ) {
1000
+ $( obj ).parents( '.ctc-input-row' ).first()
1001
+ .append( '<span class="ctc-status-icon spinner save-icon"></span>' );
1002
+ postdata[ 'ctc_configtype' ] = $( obj ).val();
1003
+ } else if ( ( $selector = $( '#ctc_new_selectors' ) )
1004
+ && 'ctc_save_new_selectors' == $( obj ).attr( 'id' ) ) {
1005
+ postdata[ 'ctc_new_selectors' ] = $selector.val();
1006
+ if ( $query = $( '#ctc_sel_ovrd_query_selected' ) ) {
1007
+ postdata[ 'ctc_sel_ovrd_query' ] = $query.text();
1008
+ }
1009
+ self.reload_menus = true;
1010
+ } else if ( ( $imports = $( '#ctc_child_imports' ) )
1011
+ && 'ctc_save_imports' == id ) {
1012
+ postdata[ 'ctc_child_imports' ] = $imports.val();
1013
+ } else if ( 'ctc_is_debug' == id ) {
1014
+ postdata[ 'ctc_is_debug' ] = $( '#ctc_is_debug' ).is( ':checked' ) ? 1 : 0;
1015
+ } else {
1016
+ // coalesce inputs
1017
+ postdata = self.coalesce_inputs( obj );
1018
+ }
1019
+ $( '.save-icon' ).show();
1020
+ // add rename selector value if it exists
1021
+ $( '#ctc_sel_ovrd_selector_selected' )
1022
+ .find( '#ctc_rewrite_selector' ).each( function() {
1023
+ newsel = $( '#ctc_rewrite_selector' ).val();
1024
+ origsel = $( '#ctc_rewrite_selector_orig' ).val();
1025
+ if ( self.is_empty( newsel ) || !newsel.toString().match( /\w/ ) ) {
1026
+ newsel = origsel;
1027
+ } else {
1028
+ postdata[ 'ctc_rewrite_selector' ] = newsel;
1029
+ self.reload_menus = true;
1030
+ }
1031
+ $( '.ctc-rewrite-toggle' ).text( self.getxt( 'rename' ) );
1032
+ $( '#ctc_sel_ovrd_selector_selected' ).html( newsel );
1033
+ } );
1034
+ // add wp ajax action to array
1035
+ //console.log( $( '#ctc_action' ).val() );
1036
+ postdata[ 'action' ] = ( !self.is_empty( $( '#ctc_action' ).val() )
1037
+ && 'plugin' == $( '#ctc_action' ).val() ) ?
1038
+ 'ctc_plugin' : 'ctc_update';
1039
+ postdata[ '_wpnonce' ] = $( '#_wpnonce' ).val();
1040
+ //console.log( postdata );
1041
+ // ajax post input data
1042
+ self.ajax_post( 'qsid', postdata );
1043
+ },
1044
+
1045
+ ajax_post: function( obj, data, datatype ) {
1046
+ var self = this,
1047
+ url = ctcAjax.ajaxurl;
1048
+ //console.log( 'ajax_post: ' + obj );
1049
+ //console.log( data );
1050
+ // get ajax url from localized object
1051
+ $.ajax( {
1052
+ url: url,
1053
+ data: data,
1054
+ dataType: ( self.is_empty( datatype ) ? 'json' : datatype ),
1055
+ // 'ctc_update' == data.action && // 'rule_val' == obj ? 'text' : // 'qsid' == obj ? 'text' :
1056
+ // 'ctc_update' == data.action && 'qsid' == obj ? 'text' :
1057
+ type: 'POST'
1058
+ } ).done( function( response ) {
1059
+ //console.log( response );
1060
+ self.handle_success( obj, response );
1061
+ } ).fail( function() {
1062
+ self.handle_failure( obj );
1063
+ } );
1064
+ },
1065
+
1066
+ handle_failure: function( obj ) {
1067
+ var self = this;
1068
+ //console.log( 'handle_failure: ' + obj );
1069
+ $( '.query-icon, .save-icon' ).removeClass( 'spinner' ).addClass( 'failure' );
1070
+ $( 'input[type=submit], input[type=button], input[type=checkbox],.ctc-delete-input' ).prop( 'disabled', false );
1071
+ $( '.ajax-pending' ).removeClass( 'ajax-pending' );
1072
+ //FIXME: return fail text in ajax response
1073
+ if ( 'preview' == obj )
1074
+ $( '#view_parnt_options_panel,#view_child_options_panel' )
1075
+ .text( self.getxt( 'css_fail' ) );
1076
+ },
1077
+
1078
+ handle_success: function( obj, response ) {
1079
+ var self = this;
1080
+ // query response
1081
+ //console.log( 'handle_success: ' + obj );
1082
+ //console.log( response );
1083
+ // hide spinner
1084
+ $( '.query-icon, .save-icon' ).removeClass( 'spinner' );
1085
+ $( '.ajax-pending' ).removeClass( 'ajax-pending' );
1086
+ // hide spinner
1087
+ if ( self.is_empty( response ) ) {
1088
+ self.handle_failure( obj );
1089
+ } else {
1090
+ $( '#ctc_new_selectors' ).val( '' );
1091
+ // update data objects
1092
+ // show check mark
1093
+ // FIXME: distinction between save and query, update specific status icon
1094
+ $( '.query-icon, .save-icon' ).addClass( 'success' );
1095
+ $( 'input[type=submit], input[type=button], input[type=checkbox],.ctc-delete-input' ).prop( 'disabled', false );
1096
+ // update ui from each response object
1097
+ $( response ).each( function() {
1098
+ if ( 'function' == typeof self.update[ this.obj ] ) {
1099
+ //console.log( 'executing method update.' + this.obj );
1100
+ self.update[ this.obj ].call( self, this );
1101
+ } else {
1102
+ //console.log( 'Fail: no method update.' + this.obj );
1103
+ }
1104
+ } );
1105
+ }
1106
+ },
1107
+
1108
+ jquery_exception: function( exn, type ) {
1109
+ var self = this,
1110
+ ln = self.is_empty( exn.lineNumber ) ? '' : ' line: ' + exn.lineNumber,
1111
+ fn = self.is_empty( exn.fileName ) ? '' : ' ' + exn.fileName.split( /\?/ )[ 0 ];
1112
+ self.jquery_err.push( '<code><small>' + type + ': ' + exn.message + fn + ln + '</small></code>' );
1113
+ },
1114
+
1115
+ jquery_notice: function( fn ) {
1116
+ //console.log( fn );
1117
+ var self = this,
1118
+ culprits = [],
1119
+ errors = [];
1120
+ // disable form submits
1121
+ $( 'input[type=submit], input[type=button]' ).prop( 'disabled', true );
1122
+ $( 'script' ).each( function( ndx,el ){
1123
+ var url = $( this ).prop( 'src' );
1124
+ if ( !self.is_empty( url ) && url.match( /jquery(\.min|\.js|\-?ui)/i )
1125
+ && ! url.match( /load\-scripts.php/ ) ) {
1126
+ culprits.push( '<code><small>' + url.split( /\?/ )[ 0 ] + '</small></code>' );
1127
+ }
1128
+ } );
1129
+ errors.push( '<strong>' + self.getxt( 'js' ) + '</strong> ' + self.getxt( 'contact' ) );
1130
+ //if ( 1 == ctcAjax.is_debug ) {
1131
+ errors.push( self.jquery_err.join( '<br/>' ) );
1132
+ //}
1133
+ if ( culprits.length ) {
1134
+ errors.push( self.getxt( 'jquery' ) + '<br/>' + culprits.join( '<br/>' ) );
1135
+ }
1136
+ errors.push( self.getxt( 'plugin' ) );
1137
+ self.set_notice( { 'error': errors } );
1138
+ },
1139
+
1140
+ update: {
1141
+ // render individual selector inputs on Query/Selector tab
1142
+ qsid: function( res ) {
1143
+ //console.log( res );
1144
+ var self = this,
1145
+ id, html, val, selector, empty;
1146
+ self.current_qsid = res.key;
1147
+ self.current_qsdata = res.data;
1148
+ //console.log( 'update.qsid: ' + self.current_qsid );
1149
+ $( '#ctc_sel_ovrd_qsid' ).val( self.current_qsid );
1150
+ if ( self.is_empty( self.current_qsdata.seq ) ) {
1151
+ $( '#ctc_child_load_order_container' ).empty();
1152
+ } else {
1153
+ id = 'ctc_ovrd_child_seq_' + self.current_qsid;
1154
+ val = parseInt( self.current_qsdata.seq );
1155
+ html = '<input type="text" id="' + id + '" name="' + id + '"'
1156
+ + ' class="ctc-child-value" value="' + val + '" />';
1157
+ $( '#ctc_child_load_order_container' ).html( html );
1158
+ }
1159
+ if ( self.is_empty( self.current_qsdata.value ) ) {
1160
+ //console.log( 'qsdata is empty' );
1161
+ empty = true;
1162
+ $( '#ctc_sel_ovrd_rule_inputs' ).empty();
1163
+ } else {
1164
+ //console.log( 'qsdata NOT empty' );
1165
+ empty = false;
1166
+ html = '';
1167
+ $.each( self.current_qsdata.value, function( rule, value ) {
1168
+ html += self.input_row( self.current_qsid, rule, 'ovrd', self.current_qsdata );
1169
+ } );
1170
+ $( '#ctc_sel_ovrd_rule_inputs' ).html( html ).find( '.color-picker' ).each( function() {
1171
+ self.setup_spectrum( this );
1172
+ } );
1173
+ self.coalesce_inputs( '#ctc_child_all_0_swatch' );
1174
+ }
1175
+ if ( self.jquery_err.length ) {
1176
+ self.jquery_notice( 'update.qsid' );
1177
+ } else {
1178
+ //console.log( 'reload menus: ' + ( self.reload_menus ? 'true' : 'false' ) );
1179
+ if ( self.reload_menus ) {
1180
+ self.load_queries();
1181
+ self.set_query( self.current_qsdata.query );
1182
+ self.load_rules();
1183
+ }
1184
+ $( '#ctc_sel_ovrd_selector_selected' ).text( self.current_qsdata.selector );
1185
+ $( '.ctc-rewrite-toggle' ).text( self.getxt( 'rename' ) );
1186
+ $( '.ctc-rewrite-toggle' ).show();
1187
+ if ( !empty ){
1188
+ $( '#ctc_sel_ovrd_rule_header,'
1189
+ + '#ctc_sel_ovrd_new_rule,'
1190
+ + '#ctc_sel_ovrd_rule_inputs_container,'
1191
+ + '#ctc_sel_ovrd_rule_inputs' ).show();
1192
+ } else {
1193
+ $( '#ctc_sel_ovrd_rule_header,'
1194
+ + '#ctc_sel_ovrd_new_rule,'
1195
+ + '#ctc_sel_ovrd_rule_inputs_container,'
1196
+ + '#ctc_sel_ovrd_rule_inputs' ).hide();
1197
+ }
1198
+ //self.scrolltop();
1199
+ }
1200
+ },
1201
+ // render list of unique values for given rule on Property/Value tab
1202
+ rule_val: function( res ) {
1203
+ //console.log( 'update.rule_val: ' + res.key );
1204
+ //console.log( res.data );
1205
+ var self = this,
1206
+ rule = $( '#ctc_rule_menu_selected' ).text(),
1207
+ html = '<div class="ctc-input-row clearfix" id="ctc_rule_row_' + rule + '">' + "\n";
1208
+ //console.log( 'rule: ' + rule );
1209
+ if ( !self.is_empty( res.data ) ) {
1210
+ $.each( res.data, function( valid, value ) {
1211
+ var parentObj = self.decode_value( rule, value );
1212
+ html += '<div class="ctc-parent-row clearfix"'
1213
+ + ' id="ctc_rule_row_' + rule + '_' + valid + '">' + "\n"
1214
+ + '<div class="ctc-input-cell ctc-parent-value"'
1215
+ + ' id="ctc_' + valid + '_parent_' + rule + '_' + valid + '">'
1216
+ + parentObj.orig + '</div>' + "\n"
1217
+ + '<div class="ctc-input-cell">' + "\n"
1218
+ + '<div class="ctc-swatch ctc-specific"'
1219
+ + ' id="ctc_' + valid + '_parent_' + rule + '_' + valid + '_swatch">'
1220
+ + self.getxt( 'swatch' ) + '</div></div>' + "\n"
1221
+ + '<div class="ctc-input-cell">'
1222
+ + '<a href="#" class="ctc-selector-handle"'
1223
+ + ' id="ctc_selector_' + rule + '_' + valid + '">'
1224
+ + self.getxt( 'selector' ) + '</a></div>' + "\n"
1225
+ + '<div id="ctc_selector_' + rule + '_' + valid + '_container"'
1226
+ + ' class="ctc-selector-container">' + "\n"
1227
+ + '<a href="#" id="ctc_selector_' + rule + '_' + valid + '_close"'
1228
+ + ' class="ctc-selector-handle ctc-exit" title="'
1229
+ + self.getxt( 'close' ) + '"></a>'
1230
+ + '<div id="ctc_selector_' + rule + '_' + valid + '_inner_container"'
1231
+ + ' class="ctc-selector-inner-container clearfix">' + "\n"
1232
+ + '<div id="ctc_status_val_qry_' + valid + '"></div>' + "\n"
1233
+ + '<div id="ctc_selector_' + rule + '_' + valid + '_rows"></div>' + "\n"
1234
+ + '</div></div></div>' + "\n";
1235
+ } );
1236
+ html += '</div>' + "\n";
1237
+ }
1238
+ $( '#ctc_rule_value_inputs' ).html( html ).find( '.ctc-swatch' ).each( function() {
1239
+ self.coalesce_inputs( this );
1240
+ } );
1241
+ },
1242
+ // render list of selectors grouped by query for given value on Property/Value Tab
1243
+ val_qry: function( res ) {
1244
+ var self = this,
1245
+ html = '';
1246
+ if ( !self.is_empty( res.data ) ) {
1247
+ $.each( res.data, function( rule, queries ) {
1248
+ page_rule = rule;
1249
+ $.each( queries, function( query, selectors ) {
1250
+ html += '<h4 class="ctc-query-heading">' + query + '</h4>' + "\n";
1251
+ if ( !self.is_empty( selectors ) ) {
1252
+ $.each( selectors, function( qsid, qsdata ) {
1253
+ html += self.input_row( qsid, rule, res.key, qsdata );
1254
+ } );
1255
+ }
1256
+ } );
1257
+ } );
1258
+ }
1259
+ selector = '#ctc_selector_' + rule + '_' + res.key + '_rows';
1260
+ $( selector ).html( html ).find( '.color-picker' ).each( function() {
1261
+ self.setup_spectrum( this );
1262
+ } );
1263
+ $( selector ).find( '.ctc-swatch' ).each( function() {
1264
+ self.coalesce_inputs( this );
1265
+ } );
1266
+ if ( self.jquery_err.length ) self.jquery_notice( 'val_qry' );
1267
+ },
1268
+ // populate list of queries and attach to query input element
1269
+ queries: function( res ) {
1270
+ $( '#ctc_sel_ovrd_query' ).data( 'menu', res.data );
1271
+ },
1272
+ // populate list of selectors and attach to selector input element
1273
+ selectors: function( res ) {
1274
+ $( '#ctc_sel_ovrd_selector' ).data( 'menu', res.data );
1275
+ },
1276
+ // populate list of rules and attach to rule input element
1277
+ rules: function( res ) {
1278
+ $( '#ctc_rule_menu' ).data( 'menu', res.data );
1279
+ },
1280
+ // render debug output
1281
+ debug: function( res ) {
1282
+ $( '#ctc_debug_container' ).html( res.data );
1283
+ //console.log( 'debug:' );
1284
+ //console.log( res.data );
1285
+ },
1286
+ // render stylesheet preview on child or parent css tab
1287
+ preview: function( res ) {
1288
+ $( '#view_' + res.key + '_options_panel' ).text( res.data );
1289
+ }
1290
+
1291
+ },
1292
+
1293
+ // initialize object vars, bind event listeners to elements, load menus and start plugin
1294
+ init: function() {
1295
+ //console.log( 'initializing...' )
1296
+ var self = this;
1297
+ // auto populate parent/child tab values
1298
+ self.autogen_slugs();
1299
+ self.set_existing();
1300
+ // initialize theme menus
1301
+ if ( !$( '#ctc_theme_parnt' ).is( 'input' ) ) {
1302
+ //console.log( 'initializing theme select menus...' )
1303
+ try {
1304
+ $.widget( 'ctc.themeMenu', $.ui.selectmenu, {
1305
+ _renderItem: function( ul, item ) {
1306
+ var li = $( "<li>" ),
1307
+ sel = item.value.replace( /[^\w\-]/, '' );
1308
+ $( '#ctc_theme_option_' + sel )
1309
+ .detach().appendTo( li );
1310
+ return li.appendTo( ul );
1311
+ }
1312
+ } );
1313
+ } catch( exn ) {
1314
+ self.jquery_exception( exn, 'Theme Menu' );
1315
+ }
1316
+ try {
1317
+ $( '#ctc_theme_parnt' ).themeMenu( {
1318
+ select: function( event, ui ) {
1319
+ self.set_parent_menu( ui.item );
1320
+ }
1321
+ } );
1322
+ } catch( exn ) {
1323
+ if ( 'function' == typeof themeMenu )
1324
+ $( '#ctc_theme_parnt' ).themeMenu( 'destroy' );
1325
+ else $( '#ctc_theme_parnt-button' ).remove();
1326
+ self.jquery_exception( exn, 'Parent Theme Menu' );
1327
+ }
1328
+ if ( self.is_empty( ctcAjax.themes.child ) ) {
1329
+ if ( $( '#ctc_child_name' ).length ) {
1330
+ $( '#ctc_child_name' ).val( self.testname );
1331
+ $( '#ctc_child_template' ).val( self.testslug );
1332
+ }
1333
+ } else {
1334
+ try {
1335
+ $( '#ctc_theme_child' ).themeMenu( {
1336
+ select: function( event, ui ) {
1337
+ self.set_child_menu( ui.item );
1338
+ }
1339
+ } );
1340
+ } catch( exn ) {
1341
+ if ( 'function' == typeof themeMenu )
1342
+ $( '#ctc_theme_child' ).themeMenu( 'destroy' );
1343
+ else $( '#ctc_theme_child-button' ).remove();
1344
+ self.jquery_exception( exn, 'Child Theme Menu' );
1345
+ }
1346
+ }
1347
+ }
1348
+ if ( self.is_empty( self.jquery_err ) ){
1349
+ //console.log( 'delegating event bindings...' )
1350
+ $( '#ctc_main' ).on( 'click', '.ctc-selector-handle', function( e ) {
1351
+ //'.ctc-option-panel-container'
1352
+ e.preventDefault();
1353
+ if ( $( this ).hasClass( 'ajax-pending' ) ) return false;
1354
+ $( this ).addClass( 'ajax-pending' );
1355
+ //set_notice( '' );
1356
+ var id = $( this ).attr( 'id' ).toString().replace( '_close', '' ),
1357
+ parts = id.toString().match( /_([^_]+)_(\d+)$/ );
1358
+ if ( $( '#' + id + '_container' ).is( ':hidden' ) ) {
1359
+ if ( !self.is_empty( parts[ 1 ] ) && !self.is_empty( parts[ 2 ] ) ) {
1360
+ rule = parts[ 1 ];
1361
+ valid = parts[ 2 ];
1362
+ // retrieve selectors / values for individual value
1363
+ self.query_css( 'val_qry', valid, { 'rule': rule } );
1364
+ }
1365
+ }
1366
+ $( '#' + id + '_container' ).fadeToggle( 'fast' );
1367
+ $( '.ctc-selector-container' ).not( '#' + id + '_container' ).fadeOut( 'fast' );
1368
+ } );
1369
+ $( '#ctc_main' ).on( 'click', '.ctc-save-input[type=button], .ctc-delete-input', function( e ) {
1370
+ e.preventDefault();
1371
+ if ( $( this ).hasClass( 'ajax-pending' ) ) return false;
1372
+ $( this ).addClass( 'ajax-pending' );
1373
+ self.save( this ); // refresh menus after updating data
1374
+ return false;
1375
+ } );
1376
+ $( '#ctc_main' ).on( 'keydown', '.ctc-selector-container .ctc-child-value[type=text]', function( e ) {
1377
+ if ( 13 === e.which ) {
1378
+ //console.log( 'return key pressed' );
1379
+ var $obj = $( this ).parents( '.ctc-selector-row' ).find( '.ctc-save-input[type=button]' ).first();
1380
+ if ( $obj.length ) {
1381
+ e.preventDefault();
1382
+ //console.log( $obj.attr( 'id' ) );
1383
+ if ( $obj.hasClass( 'ajax-pending' ) ) return false;
1384
+ $obj.addClass( 'ajax-pending' );
1385
+ self.save( $obj );
1386
+ return false;
1387
+ }
1388
+ }
1389
+ } );
1390
+ $( '#ctc_main' ).on( 'click', '.ctc-selector-edit', function( e ) {
1391
+ e.preventDefault();
1392
+ if ( $( this ).hasClass( 'ajax-pending' ) ) return false;
1393
+ $( this ).addClass( 'ajax-pending' );
1394
+ self.set_qsid( this );
1395
+ } );
1396
+ $( '#ctc_main' ).on( 'click', '.ctc-rewrite-toggle', function( e ) {
1397
+ e.preventDefault();
1398
+ self.selector_input_toggle( this );
1399
+ } );
1400
+ $( '#ctc_main' ).on( 'click', '#ctc_copy_selector', function( e ) {
1401
+ var txt = $( '#ctc_sel_ovrd_selector_selected' ).text().trim();
1402
+ if ( !self.is_empty( txt ) )
1403
+ $( '#ctc_new_selectors' ).val( $( '#ctc_new_selectors' ).val() + "\n" + txt + " {\n\n}" );
1404
+ } );
1405
+ $( '#ctc_configtype' ).on( 'change', function( e ) {
1406
+ var val = $( this ).val();
1407
+ if ( self.is_empty( val ) || 'theme' == val ) {
1408
+ $( '.ctc-theme-only, .ctc-themeonly-container' ).removeClass( 'ctc-disabled' );
1409
+ $( '.ctc-theme-only, .ctc-themeonly-container input' ).prop( 'disabled', false );
1410
+ try {
1411
+ $( '#ctc_theme_parnt, #ctc_theme_child' ).themeMenu( 'enable' );
1412
+ } catch ( exn ) {
1413
+ self.jquery_exception( exn, 'Theme Menu' );
1414
+ }
1415
+ } else {
1416
+ $( '.ctc-theme-only, .ctc-themeonly-container' ).addClass( 'ctc-disabled' );
1417
+ $( '.ctc-theme-only, .ctc-themeonly-container input' ).prop( 'disabled', true );
1418
+ try {
1419
+ $( '#ctc_theme_parnt, #ctc_theme_child' ).themeMenu( 'disable' );
1420
+ } catch ( exn ) {
1421
+ self.jquery_exception( exn, 'Theme Menu' );
1422
+ }
1423
+ }
1424
+ } );
1425
+ // these elements are not replaced so use direct selector events
1426
+ $( '.nav-tab' ).on( 'click', function( e ) {
1427
+ e.preventDefault();
1428
+ // clear the notice box
1429
+ //set_notice( '' );
1430
+ $( '.ctc-query-icon,.ctc-status-icon' ).remove();
1431
+ var id = '#' + $( this ).attr( 'id' );
1432
+ self.focus_panel( id );
1433
+ } );
1434
+ $( '.ctc-section-toggle' ).on( 'click', function( e ) {
1435
+ e.preventDefault();
1436
+ $( this ).parents( '.ctc-input-row, .update-nag' ).first().find( '.ctc-section-toggle' )
1437
+ .each( function() {
1438
+ $( this ).toggleClass( 'open' );
1439
+ } );
1440
+ var id = $( this ).attr( 'id' ).replace(/\d$/, '') + '_content';
1441
+ $( '#' + id ).stop().slideToggle( 'fast' );
1442
+ return false;
1443
+ } );
1444
+ $( '#view_child_options, #view_parnt_options' ).on( 'click', function( e ){
1445
+ if ( $( this ).hasClass( 'ajax-pending' ) ) return false;
1446
+ $( this ).addClass( 'ajax-pending' );
1447
+ self.css_preview( $( this ).attr( 'id' ) );
1448
+ } );
1449
+ $( '#ctc_load_form' ).on( 'submit', function() {
1450
+ return ( self.validate() ); //&& confirm( self.getxt( 'load' ) ) ) ;
1451
+ } );
1452
+ $( '#ctc_query_selector_form' ).on( 'submit', function( e ) {
1453
+ e.preventDefault();
1454
+ $this = $( '#ctc_save_query_selector' );
1455
+ if ( $this.hasClass( 'ajax-pending' ) ) return false;
1456
+ $this.addClass( 'ajax-pending' );
1457
+ self.save( $this ); // refresh menus after updating data
1458
+ return false;
1459
+ } );
1460
+ $( '#ctc_rule_value_form' ).on( 'submit', function( e ) {
1461
+ //console.log( 'rule value empty submit' );
1462
+ e.preventDefault();
1463
+ return false;
1464
+ } );
1465
+ $( '#ctc_theme_child, #ctc_theme_child-button, #ctc_child_type_existing' )
1466
+ .on( 'focus click', function() {
1467
+ // change the inputs to use existing child theme
1468
+ $( '#ctc_child_type_existing' ).prop( 'checked', true );
1469
+ $( '#ctc_child_type_new' ).prop( 'checked', false );
1470
+ $( '#ctc_child_template' ).val( '' );
1471
+ self.set_existing();
1472
+ } );
1473
+ $( '#ctc_duplicate_theme' ).on( 'click', function() {
1474
+ if ( $( '#ctc_duplicate_theme' ).is( ':checked' ) ) {
1475
+ $( '#ctc_child_name' ).val( self.testname );
1476
+ $( '#ctc_duplicate_theme_slug' ).val( self.testslug );
1477
+ } else {
1478
+ self.set_existing();
1479
+ }
1480
+ } );
1481
+ $( '#ctc_child_type_new, #ctc_child_template' ).on( 'focus click', function() {
1482
+ // change the inputs to use new child theme
1483
+ $( '#ctc_child_type_existing' ).prop( 'checked', false );
1484
+ $( '#ctc_duplicate_theme' ).prop( 'checked', false );
1485
+ $( '#ctc_duplicate_theme_slug' ).val( '' );
1486
+ $( '#ctc_child_type_new' ).prop( 'checked', true );
1487
+ $( '#input_row_duplicate_theme' ).hide();
1488
+ $( '#ctc_child_name' ).val( self.testname );
1489
+ $( '#ctc_child_template' ).val( self.testslug );
1490
+ } );
1491
+ $( '#ctc_is_debug' ).on( 'change', function( e ) {
1492
+ self.save( this );
1493
+ } );
1494
+ $( '.ctc-live-preview' ).on( 'click', function( e ) {
1495
+ e.stopImmediatePropagation();
1496
+ e.preventDefault();
1497
+ document.location = $( this ).prop( 'href' );
1498
+ return false;
1499
+ } );
1500
+ //console.log( 'loading autoselect menus...' )
1501
+ // initialize autoselect menus
1502
+ self.setup_menus();
1503
+ //console.log( 'checking for additional stylesheets...' )
1504
+ // mark additional linked stylesheets for parsing
1505
+ self.set_addl_css();
1506
+ // show last 25 selectors edited
1507
+ // render_recent();
1508
+ // turn on submit buttons (disabled until everything is loaded to prevent errors)
1509
+ //console.log( 'releasing submit buttons...' )
1510
+ $( 'input[type=submit], input[type=button]' ).prop( 'disabled', false );
1511
+ self.scrolltop();
1512
+ //console.log( 'Ready.' )
1513
+ // disappear any notices after 20 seconds
1514
+ setTimeout( self.fade_update_notice, 20000 );
1515
+ } else {
1516
+ //$( '.ctc-select' ).css( { 'visibility': 'visible' } ).show();
1517
+ self.jquery_notice( 'init' );
1518
+ }
1519
+ },
1520
+ // object properties
1521
+ testslug: '',
1522
+ testname: '',
1523
+ reload_menus: false,
1524
+ current_query: 'base',
1525
+ current_qsid: null,
1526
+ current_qsdata: {},
1527
+ jquery_err: [],
1528
+ color_regx: '\\s+(\\#[a-f0-9]{3,6}|rgba?\\([\\d., ]+?\\)|hsla?\\([\\d%., ]+?\\)|[a-z]+)',
1529
+ border_regx: '(\\w+)(\\s+(\\w+))?',
1530
+ grad_regx: '(\\w+)'
1531
+
1532
+ };
1533
+ //console.log( 'creating new chldthmcfg object ...' );
1534
+ $.chldthmcfg.init();
1535
+ } ( jQuery ) );
js/chld-thm-cfg.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(e){e.chldthmcfg={esc_quot:function(e){var t=this;return t.is_empty(e)?e:e.toString().replace(/"/g,"&quot;")},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,a){return e.each(a,function(e,a){return e.toLowerCase()!==t.toLowerCase()||"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):"",i=e("#ctc_theme_child").length?e("#ctc_theme_child").val().toString().replace(c):n,a=e("input[name=ctc_child_type]:checked").val(),r=[];return"new"==a&&(i=n),t.theme_exists(i,a)&&r.push(t.getxt("theme_exists").toString().replace(/%s/,i)),""===i&&r.push(t.getxt("inval_theme")),""===e("#ctc_child_name").val()&&r.push(t.getxt("inval_name")),r.length?(t.set_notice({error:r}),!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",a="",r="",s="00";t.theme_exists(n,"new");)a=""==a?2:a+1,r=s.substring(0,s.length-a.toString().length)+a.toString(),n=slugbase+r;t.testslug=n,t.testname=i+(r.length?" "+r:"")}},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(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=e(t).attr("id"),i=/^(ctc_(ovrd|\d+)_(parent|child)_([0-9a-z\-]+)_(\d+?)(_(\d+))?)(_\w+)?$/,a=e(t).parents(".ctc-selector-row, .ctc-parent-row").first(),r=a.find(".ctc-swatch").first(),s={parent:{},child:{}},l={parent:{origin:"",start:"",end:""},child:{origin:"",start:"",end:""}},_={child:!1,parent:!1},o={};return a.find(".ctc-parent-value, .ctc-child-value").each(function(){var t,a,r=e(this).attr("id"),u=r.toString().match(i),d=u[2],p=u[3],h="undefined"==typeof u[4]?"":u[4],m=u[7],v=u[5],f="undefined"==typeof u[7]?"":u[8],g="parent"==p?e(this).text().replace(/!$/,""):"seq"!=h&&"ctc_delete_query_selector"==n?"":e(this).val(),y="seq"==h?!1:"ctc_"+d+"_child_"+h+"_i_"+v+"_"+m;if("child"==p&&(c.is_empty(e(this).data("color"))||(g=c.color_text(e(this).data("color")),e(this).data("color",null)),o[r]=g,y&&(o[y]=e("#"+y).is(":checked")?1:0)),""!==g)if(c.is_empty(f))if(t=h.toString().match(/^border(\-(top|right|bottom|left))?$/)&&!g.match(/none/)){var x=new RegExp(c.border_regx+c.color_regx,"i"),a=g.toString().match(x);c.is_empty(a)||(a.shift(),s[p][h+"-width"]=a.shift()||"",a.shift(),s[p][h+"-style"]=a.shift()||"",s[p][h+"-color"]=a.shift()||"")}else if("background-image"!=h||g.match(/none/))"seq"!=h&&(s[p][h]=g);else if(g.toString().match(/url\(/))s[p]["background-image"]=c.image_url(p,g);else{var w=new RegExp(c.grad_regx+c.color_regx+c.color_regx,"i"),a=g.toString().match(w);!c.is_empty(a)&&a.length>2?(a.shift(),l[p].origin=a.shift()||"top",l[p].start=a.shift()||"transparent",l[p].end=a.shift()||"transparent",_[p]=!0):s[p]["background-image"]=g}else switch(f){case"_border_width":s[p][h+"-width"]="none"==g?0:g;break;case"_border_style":s[p][h+"-style"]=g;break;case"_border_color":s[p][h+"-color"]=g;break;case"_background_url":s[p]["background-image"]=c.image_url(p,g);break;case"_background_color":s[p]["background-color"]=g;break;case"_background_color1":l[p].start=g,_[p]=!0;break;case"_background_color2":l[p].end=g,_[p]=!0;break;case"_background_origin":l[p].origin=g,_[p]=!0}}),"undefined"==typeof r||c.is_empty(r.attr("id"))||(r.removeAttr("style"),_.parent&&r.ctcgrad(l.parent.origin,[l.parent.start,l.parent.end]),r.css(s.parent),r.attr("id").toString().match(/parent/)||(_.child&&r.ctcgrad(l.child.origin,[l.child.start,l.child.end]),r.css(s.child)),r.css({"z-index":-1})),o},decode_value:function(e,t){t="undefined"==typeof t?"":t;var c=this,n={orig:t,names:[""],values:[t]};if(e.toString().match(/^border(\-(top|right|bottom|left))?$/)){var i=new RegExp(c.border_regx+"("+c.color_regx+")?","i"),a=t.toString().match(i);c.is_empty(a)&&(a=[]),n.names=["_border_width","_border_style","_border_color"],orig=a.shift(),n.values[0]=a.shift()||"",a.shift(),n.values[1]=a.shift()||"",a.shift(),n.values[2]=a.shift()||""}else if(e.toString().match(/^background\-image/))if(n.names=["_background_url","_background_origin","_background_color1","_background_color2"],n.values=["","","",""],c.is_empty(t)||t.toString().match(/(url|none)/))n.values[0]=t;else{var r,s,a=t.toString().split(/:/);n.values[1]=a.shift()||"",n.values[2]=a.shift()||"",r=a.shift()||"",n.values[3]=a.shift()||"",s=a.shift()||"",n.orig=[n.values[1],n.values[2],n.values[3]].join(" ")}return n},image_url:function(e,t){var c,n=this,i=t.toString().match(/url\(['" ]*(.+?)['" ]*\)/),a=n.is_empty(i)?null:i[1],r=ctcAjax.theme_uri+"/"+("parent"==e?ctcAjax.parnt:ctcAjax.child)+"/";return a?c=a.toString().match(/^(data:|https?:|\/)/)?t:"url("+r+a+")":!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.chldthmcfg.is_empty(this.element.data("menu"))?n.push({label:ctcAjax.nosels_txt,value:null}):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.chldthmcfg.is_empty(this.element.data("menu"))?n.push({label:ctcAjax.nosels_txt,value:null}):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.chldthmcfg.is_empty(this.element.data("menu"))?n.push({label:ctcAjax.nosels_txt,value:null}):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");e.each(e("#ctc_rule_menu").data("menu"),function(e,t){i.test(e)&&n.push({label:e,value:t})}),c(n)},merge_ruleval_arrays:function(t,c,n){var i=this,a={};return nextval=n?c.child.pop():null,e.each(["parnt","child"],function(t,r){i.is_empty(c[r])||e.each(c[r],function(e,t){n?parseInt(t[2])>=parseInt(nextval[2])&&(nextval[2]=parseInt(t[2])+1):(i.is_empty(a[t[2]])&&(a[t[2]]={}),a[t[2]][r]=t)})}),n&&(a[nextval[2]]={parnt:[],child:nextval}),a},input_row:function(t,c,n,i,a){var r=this,s="";if(!r.is_empty(i)&&!r.is_empty(i.value)&&!r.is_empty(i.value[c])){var l=i.value[c],_=r.merge_ruleval_arrays(c,l,a);e.each(_,function(a,l){var _=r.decode_value(c,r.is_empty(l.parnt)?"":l.parnt[0]),o=r.is_empty(l.parnt)||0==l.parnt[1]?0:1,u=r.decode_value(c,r.is_empty(l.child)?"":l.child[0]),d=r.is_empty(l.child)||0==l.child[1]?0:1;if(s+='<div class="ctc-'+("ovrd"==n?"input":"selector")+'-row clearfix"><div class="ctc-input-cell">',s+="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(_.orig)?r.getxt("child_only"):""),s+='</div><div class="ctc-parent-value ctc-input-cell"'+("ovrd"!=n?' style="display:none"':"")+' id="ctc_'+n+"_parent_"+c+"_"+t+"_"+a+'">'+(r.is_empty(_.orig)?"[no value]":_.orig+(o?r.getxt("important"):""))+'</div><div class="ctc-input-cell">',!r.is_empty(_.names)){e.each(_.names,function(e,i){i=r.is_empty(i)?"":i,s+='<div class="ctc-child-input-cell clear">';var l,_="ctc_"+n+"_child_"+c+"_"+t+"_"+a+i;!1===(l=u.values.shift())&&(l=""),s+=(r.is_empty(i)?"":r.getxt(i)+":<br/>")+'<input type="text" id="'+_+'" name="'+_+'" class="ctc-child-value'+((i+c).toString().match(/color/)?" color-picker":"")+(i.toString().match(/url/)?" ctc-input-wide":"")+'" value="'+r.esc_quot(l)+'" /></div>'});var p="ctc_"+n+"_child_"+c+"_i_"+t+"_"+a;s+='<label for="'+p+'"><input type="checkbox" id="'+p+'" name="'+p+'" value="1" '+(d?"checked":"")+" />"+r.getxt("important")+"</label>"}s+="</div>","ovrd"!=n&&(s+='<div class="ctc-swatch ctc-specific" id="ctc_child_'+c+"_"+t+"_"+a+'_swatch">'+r.getxt("swatch")+'</div><div class="ctc-child-input-cell ctc-button-cell" id="ctc_save_'+c+"_"+t+"_"+a+'_cell"><input type="button" class="button ctc-save-input" id="ctc_save_'+c+"_"+t+"_"+a+'" name="ctc_save_'+c+"_"+t+"_"+a+'" value="Save" /></div>'),s+="</div><!-- end input row -->\n"})}return s},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(e){var t=this;t.setup_spectrum(e)},setup_spectrum:function(t){var c=this,n=(e(t).attr("id")+"_colortxt",!c.is_empty(ctcAjax.palette));try{e(t).spectrum({showInput:!0,allowEmpty:!0,showAlpha:!0,showInitial:!0,preferredFormat:"hex",clickoutFiresChange:!0,move:function(n){e(t).data("color",n),c.coalesce_inputs(t)},showPalette:n?!0:!1,showSelectionPalette:n?!0:!1,palette:[],maxSelectionSize:36,localStorageKey:"ctc-palette."+ctcAjax.child,hideAfterPaletteSelect:!0}).on("change",function(t){e(this).spectrum("get");c.coalesce_inputs(this)}).on("keyup",function(t){var n=this,i=e(this).val();clearTimeout(e(this).data("spectrumTimer")),e(this).data("spectrumTimer",setTimeout(function(){c.coalesce_inputs(n),e(n).spectrum("set",i)},500))})}catch(i){c.jquery_exception(i,"Spectrum Color Picker")}},color_text:function(e){var t=this;return t.is_empty(e)?"":e.getAlpha()<1?e.toRgbString():e.toHexString()},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,"Property 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();var i,a,r=n.item.label.replace(/[^\w\-]/g,t.to_ascii);return t.is_empty(t.current_qsdata.value)&&(t.current_qsdata.value={}),t.is_empty(t.current_qsdata.value[n.item.label])&&(t.current_qsdata.value[n.item.label]={}),t.is_empty(t.current_qsdata.value[n.item.label].child)&&(t.current_qsdata.value[n.item.label].child=[]),t.current_qsdata.value[n.item.label].child.push(["",0,1,1]),i=e(t.input_row(t.current_qsid,r,"ovrd",t.current_qsdata,!0)),e("#ctc_sel_ovrd_rule_inputs").append(i),e("#ctc_new_rule_menu").val(""),i.find('input[type="text"]').each(function(c,n){a||(a=n),e(n).hasClass("color-picker")&&t.setup_spectrum(n)}),a&&e(a).focus(),t.jquery_err.length&&t.jquery_notice("setup_new_rule_menu"),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"New Property 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),e("#ctc_duplicate_theme").prop("checked",!1),e("#ctc_duplicate_theme_slug").val(""),e("#input_row_duplicate_theme").show())}},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_parnt").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,n,i=this;i.is_empty(ctcAjax.themes.child[t.value])||(c=ctcAjax.themes.child[t.value].Template,n=e("#ctc_theme_parnt").val(),c==n?(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)):(e("#ctc_theme_child").parents(".ctc-input-row").first().append('<span class="ctc-status-icon spinner"></span>'),e(".spinner").show(),document.location="?page="+ctcAjax.page+"&ctc_parent="+c+"&ctc_child="+t.value))},set_query:function(t){var c=this;return c.is_empty(t)?!1:(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("&nbsp;"),c.load_selectors(),void c.scrolltop())},set_selector:function(t,c){var n=this;return n.is_empty(t)?!1:(e("#ctc_sel_ovrd_selector").val(""),n.current_qsid=t,n.reload_menus=!1,n.load_selector_values(),void n.scrolltop())},set_rule:function(t,c){var n=this;return n.is_empty(t)?!1:(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),void n.scrolltop())},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?:\/\//,""),a=ctcAjax.homeurl.replace(/^https?/,ctcAjax.ssl?"https":"http"),r=a+"&template="+n+"&stylesheet="+n,s=new RegExp("<link rel=[\"']stylesheet[\"'][^>]+?"+i+"/"+n+"/(.+?\\.css)[^>]+?>","g");c.is_empty(n)||(n!=ctcAjax.parnt?e.get(r,function(c){for(;(t=s.exec(c))&&"style.css"!=t[1];)t[1].match(/bootstrap/)||e(".ctc_checkbox").each(function(c,n){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(t,n){e(this).val()==c&&e(this).prop("checked",!0)})}))},query_css:function(t,c,n){var i=this,a={ctc_query_obj:t,ctc_query_key:c},r="#ctc_status_"+t+("val_qry"==t?"_"+c:"");"object"==typeof n&&e.each(n,function(e,t){a["ctc_query_"+e]=t}),e(".query-icon,.ctc-status-icon").remove(),e(r+" .ctc-status-icon").remove(),e(r).append('<span class="ctc-status-icon spinner query-icon"></span>'),e(".spinner").show(),a.action=i.is_empty(e("#ctc_action").val())||"plugin"!=e("#ctc_action").val()?"ctc_query":"ctc_plgqry",a._wpnonce=e("#_wpnonce").val(),i.ajax_post(t,a)},save:function(t){var c,n,i,a,r,s=this,l=(ctcAjax.ajaxurl,{}),_=e(t).attr("id");e(t).prop("disabled",!0),e(".ctc-query-icon,.ctc-status-icon").remove(),e(t).parent(".ctc-textarea-button-cell, .ctc-button-cell").append('<span class="ctc-status-icon spinner save-icon"></span>'),_.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"==_?l.ctc_child_imports=i.val():"ctc_is_debug"==_?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(){a=e("#ctc_rewrite_selector").val(),r=e("#ctc_rewrite_selector_orig").val(),s.is_empty(a)||!a.toString().match(/\w/)?a=r:(l.ctc_rewrite_selector=a,s.reload_menus=!0),e(".ctc-rewrite-toggle").text(s.getxt("rename")),e("#ctc_sel_ovrd_selector_selected").html(a)}),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,a=ctcAjax.ajaxurl;e.ajax({url:a,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], input[type=checkbox],.ctc-delete-input").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], input[type=checkbox],.ctc-delete-input").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(t){var c=this,n=[],i=[];e("input[type=submit], input[type=button]").prop("disabled",!0),e("script").each(function(t,i){var a=e(this).prop("src");c.is_empty(a)||!a.match(/jquery(\.min|\.js|\-?ui)/i)||a.match(/load\-scripts.php/)||n.push("<code><small>"+a.split(/\?/)[0]+"</small></code>")}),i.push("<strong>"+c.getxt("js")+"</strong> "+c.getxt("contact")),i.push(c.jquery_err.join("<br/>")),n.length&&i.push(c.getxt("jquery")+"<br/>"+n.join("<br/>")),i.push(c.getxt("plugin")),c.set_notice({error:i})},update:{qsid:function(t){var c,n,i,a,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)?(a=!0,e("#ctc_sel_ovrd_rule_inputs").empty()):(a=!1,n="",e.each(r.current_qsdata.value,function(e,t){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_spectrum(this)}),r.coalesce_inputs("#ctc_child_all_0_swatch")),r.jquery_err.length?r.jquery_notice("update.qsid"):(r.reload_menus&&(r.load_queries(),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-rewrite-toggle").show(),a?e("#ctc_sel_ovrd_rule_header,#ctc_sel_ovrd_new_rule,#ctc_sel_ovrd_rule_inputs_container,#ctc_sel_ovrd_rule_inputs").hide():e("#ctc_sel_ovrd_rule_header,#ctc_sel_ovrd_new_rule,#ctc_sel_ovrd_rule_inputs_container,#ctc_sel_ovrd_rule_inputs").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 a=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+'">'+a.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,a){page_rule=i,e.each(a,function(a,r){n+='<h4 class="ctc-query-heading">'+a+"</h4>\n",c.is_empty(r)||e.each(r,function(e,a){n+=c.input_row(e,i,t.key,a)})})}),selector="#ctc_selector_"+rule+"_"+t.key+"_rows",e(selector).html(n).find(".color-picker").each(function(){c.setup_spectrum(this)}),e(selector).find(".ctc-swatch").each(function(){c.coalesce_inputs(this)}),c.jquery_err.length&&c.jquery_notice("val_qry")},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>"),i=c.value.replace(/[^\w\-]/,"");return e("#ctc_theme_option_"+i).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("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], .ctc-delete-input",function(c){return c.preventDefault(),e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),t.save(this),!1)}),e("#ctc_main").on("keydown",".ctc-selector-container .ctc-child-value[type=text]",function(c){if(13===c.which){var n=e(this).parents(".ctc-selector-row").find(".ctc-save-input[type=button]").first();if(n.length)return c.preventDefault(),n.hasClass("ajax-pending")?!1:(n.addClass("ajax-pending"),t.save(n),!1)}}),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(c){var n=e("#ctc_sel_ovrd_selector_selected").text().trim();t.is_empty(n)||e("#ctc_new_selectors").val(e("#ctc_new_selectors").val()+"\n"+n+" {\n\n}")}),e("#ctc_configtype").on("change",function(c){var n=e(this).val();if(t.is_empty(n)||"theme"==n){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(i){t.jquery_exception(i,"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(i){t.jquery_exception(i,"Theme Menu")}}}),e(".nav-tab").on("click",function(c){c.preventDefault(),e(".ctc-query-icon,.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, .update-nag").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(c){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_rule_value_form").on("submit",function(e){return e.preventDefault(),!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_duplicate_theme").on("click",function(){e("#ctc_duplicate_theme").is(":checked")?(e("#ctc_child_name").val(t.testname),e("#ctc_duplicate_theme_slug").val(t.testslug)):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_duplicate_theme").prop("checked",!1),e("#ctc_duplicate_theme_slug").val(""),e("#ctc_child_type_new").prop("checked",!0),e("#input_row_duplicate_theme").hide(),e("#ctc_child_name").val(t.testname),e("#ctc_child_template").val(t.testslug)}),e("#ctc_is_debug").on("change",function(e){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("init")},testslug:"",testname:"",reload_menus:!1,current_query:"base",current_qsid:null,current_qsdata:{},jquery_err:[],color_regx:"\\s+(\\#[a-f0-9]{3,6}|rgba?\\([\\d., ]+?\\)|hsla?\\([\\d%., ]+?\\)|[a-z]+)",border_regx:"(\\w+)(\\s+(\\w+))?",grad_regx:"(\\w+)"},e.chldthmcfg.init()}(jQuery);
js/chldthmcfg.js DELETED
@@ -1,2310 +0,0 @@
1
- /*!
2
- * Script: chldthmcfg.js
3
- * Plugin URI: http://www.childthemeconfigurator.com/
4
- * Description: Handles jQuery, AJAX and other UI
5
- * Version: 2.1.2
6
- * Author: Lilaea Media
7
- * Author URI: http://www.lilaeamedia.com/
8
- * License: GPLv2
9
- * Copyright (C) 2014-2016 Lilaea Media
10
- */
11
-
12
- // ** for muliple property values: **
13
- // make sure sequence is passed with rule/val updates
14
- // determine sequence based on sequence of value array
15
- // add sequence to input name
16
-
17
- ( function( $ ) {
18
- 'use strict';
19
- $.chldthmcfg = {
20
- //console.log( 'executing main function' );
21
- escquo: function( str ) {
22
- var self = this;
23
- return self.is_empty( str ) ? str : str.toString().replace( /"/g, '&quot;' );
24
- },
25
-
26
- getxt: function( key, merge ){
27
- var text = window.ctcAjax[ key + '_txt' ];
28
- if ( text ) {
29
- if ( merge ) {
30
- text = text.replace( /%s/, merge );
31
- }
32
- return text;
33
- }
34
- return '';
35
- },
36
-
37
- getname: function( template ){
38
- var stylesheet = ( 'child' === template ? $.chldthmcfg.currchild : $.chldthmcfg.currparnt );
39
- return window.ctcAjax.themes[ template ][ stylesheet ].Name;
40
- },
41
-
42
- frascii: function( str ) {
43
- var ascii = parseInt( str ),
44
- chr = String.fromCharCode( ascii );
45
- return chr;
46
- },
47
-
48
- toascii: function( str ) {
49
- var ascii = str.charCodeAt( 0 );
50
- return ascii;
51
- },
52
-
53
- /**
54
- * is_empty
55
- * return true if value evaluates to false, null, null string,
56
- * empty array, empty object or undefined
57
- * but NOT 0 ( zero returns false ) unless zero flag is passed
58
- */
59
- is_empty: function( obj, zeros ) {
60
- // first bail when definitely empty or undefined ( true ) NOTE: numeric zero returns false !
61
- if ( 'undefined' === typeof obj || false === obj || null === obj || '' === obj ) {
62
- // console.log( 'matched empty' );
63
- return true;
64
- }
65
- // if zeros flag is set, return true for 0 or '0'
66
- if ( 'undefined' !== typeof zeros && '0' === obj || 0 === obj ) {
67
- // console.log( 'matched zero literal:' + obj );
68
- return true;
69
- }
70
- // then, if this is bool, string or number it must not be empty ( false )
71
- if ( true === obj || "string" === typeof obj || "number" === typeof obj ) {
72
- return false;
73
- }
74
- // check for object type to be safe
75
- if ( "object" === typeof obj ) {
76
- // Use a standard for in loop
77
- for ( var x in obj ) {
78
- // for in will iterate over members on the prototype
79
- // chain as well, but Object.getOwnPropertyNames returns
80
- // only those directly on the object, so use hasOwnProperty.
81
- if ( obj.hasOwnProperty( x ) ) {
82
- // any value means not empty ( false )
83
- return false;
84
- }
85
- }
86
- // no properties, so return empty ( true )
87
- return true;
88
- }
89
- // this must be an unsupported datatype, so return not empty
90
- return false;
91
- },
92
-
93
- /**
94
- * theme_exists
95
- * returns true if theme is already present for type
96
- */
97
- theme_exists: function( testslug, testtype ) {
98
- var exists = false;
99
- $.each( window.ctcAjax.themes, function( type, theme ) {
100
- $.each( theme, function( slug, data ) {
101
- data = null;
102
- if ( slug.toLowerCase() === testslug.toLowerCase() && ( 'parnt' === type || 'new' === testtype ) ) {
103
- exists = true; // no need to continue testing
104
- return false; // in this context "return false" means "break"
105
- }
106
- } );
107
- if ( exists ) { // no need to continue testing
108
- return false; // in this context "return false" means "break"
109
- }
110
- } );
111
- return exists;
112
- },
113
-
114
- validate: function() {
115
- var self = this,
116
- regex = /[^\w\-]/,
117
- newslug = $( '#ctc_child_template' ).length ? $( '#ctc_child_template' )
118
- .val().toString().replace( regex ) : '',
119
- slug = $( '#ctc_theme_child' ).length ? $( '#ctc_theme_child' )
120
- .val().toString().replace( regex ) : newslug,
121
- type = $( 'input[name=ctc_child_type]:checked' ).val(),
122
- errors = [];
123
- if ( 'new' === type ) {
124
- slug = newslug;
125
- }
126
- if ( self.theme_exists( slug, type ) ) {
127
- errors.push( self.getxt( 'theme_exists' ).toString().replace( /%s/, slug ) );
128
- }
129
- if ( self.is_empty( slug ) ) {
130
- errors.push( self.getxt( 'inval_theme' ) );
131
- }
132
- //if ( self.is_empty( $( '#ctc_child_name' ).val() ) ) {
133
- // errors.push( self.getxt( 'inval_name' ) );
134
- //}
135
- if ( errors.length ) {
136
- self.set_notice( { 'error': errors } );
137
- return false;
138
- }
139
- if ( 'reset' === type ) {
140
- if ( confirm( self.getxt( 'load' ) ) ) {
141
- return true;
142
- }
143
- return false;
144
- }
145
- return true;
146
- },
147
-
148
- autogen_slugs: function() {
149
- if ( $( '#ctc_theme_parnt' ).length ) {
150
- var self = this,
151
- parent = $( '#ctc_theme_parnt' ).val(),
152
- slugbase= parent + '-child',
153
- slug = slugbase,
154
- name = $.chldthmcfg.getname( 'parnt' ) + ' Child',
155
- suffix = '',
156
- padded = '',
157
- pad = '00';
158
- while ( self.theme_exists( slug, 'new' ) ) {
159
- suffix = ( self.is_empty( suffix ) ? 2 : suffix + 1 );
160
- padded = pad.substring( 0, pad.length - suffix.toString().length ) + suffix.toString();
161
- slug = slugbase + padded;
162
- }
163
- self.testslug = slug;
164
- self.testname = name + ( padded.length ? ' ' + padded : '' );
165
- //console.log( 'autogen_slugs: parent: ' + parent + ' slug: ' + slug );
166
- }
167
- },
168
-
169
- focus_panel: function( id ) {
170
- var panelid = id + '_panel';
171
- $( '.nav-tab' ).removeClass( 'nav-tab-active' );
172
- $( '.ctc-option-panel' ).removeClass( 'ctc-option-panel-active' );
173
- //$( '.ctc-selector-container' ).hide();
174
- $( id ).addClass( 'nav-tab-active' );
175
- $( '.ctc-option-panel-container' ).scrollTop( 0 );
176
- $( panelid ).addClass( 'ctc-option-panel-active' );
177
- },
178
-
179
- selector_input_toggle: function( obj ) {
180
- //console.log( 'selector_input_toggle: ' + obj );
181
- var self = this,
182
- origval;
183
- if ( $( '#ctc_rewrite_selector' ).length ) {
184
- origval = $( '#ctc_rewrite_selector_orig' ).val();
185
- $( '#ctc_sel_ovrd_selector_selected' ).text( origval );
186
- $( obj ).text( self.getxt( 'rename' ) );
187
- } else {
188
- origval = $( '#ctc_sel_ovrd_selector_selected' ).text();
189
- $( '#ctc_sel_ovrd_selector_selected' ).html(
190
- '<textarea id="ctc_rewrite_selector"' +
191
- ' name="ctc_rewrite_selector" autocomplete="off"></textarea>' +
192
- '<input id="ctc_rewrite_selector_orig" name="ctc_rewrite_selector_orig"' +
193
- ' type="hidden" value="' + self.escquo( origval ) + '"/>' );
194
- $( '#ctc_rewrite_selector' ).val( origval );
195
- $( obj ).text( self.getxt( 'cancel' ) );
196
- }
197
- },
198
-
199
- coalesce_inputs: function( obj ) {
200
- //**console.log( 'coalesce_inputs ' + $( obj ).attr( 'id' ) );
201
- var self = this,
202
- id = $( obj ).attr( 'id' ),
203
- regex = /^(ctc_(ovrd|\d+)_(parent|child)_([0-9a-z\-]+)_(\d+?)(_(\d+))?)(_\w+)?$/,
204
- container = $( obj ).parents( '.ctc-selector-row, .ctc-parent-row' ).first(),
205
- swatch = container.find( '.ctc-swatch' ).first(),
206
- cssrules = { 'parent': {}, 'child': {} },
207
- gradient = {
208
- 'parent': {
209
- 'origin': '',
210
- 'start': '',
211
- 'end': ''
212
- },
213
- 'child': {
214
- 'origin': '',
215
- 'start': '',
216
- 'end': ''
217
- }
218
- },
219
- has_gradient = { 'child': false, 'parent': false },
220
- postdata = {};
221
- // set up objects for all neighboring inputs
222
- container.find( '.ctc-parent-value, .ctc-child-value' ).each( function() {
223
- var inputid = $( this ).attr( 'id' ),
224
- inputparts = inputid.toString().match( regex ),
225
- inputseq = inputparts[ 2 ],
226
- inputtheme = inputparts[ 3 ],
227
- inputrule = ( 'undefined' === typeof inputparts[ 4 ] ? '' : inputparts[ 4 ] ),
228
- rulevalid = inputparts[ 7 ],
229
- qsid = inputparts[ 5 ],
230
- rulepart = ( 'undefined' === typeof inputparts[ 7 ] ? '' : inputparts[ 8 ] ),
231
- value = ( 'parent' === inputtheme ? $( this ).text().replace( /!$/, '' ) :
232
- ( 'seq' !== inputrule && 'ctc_delete_query_selector' === id ? '' :
233
- $( this ).val() ) ), // clear values if delete was clicked
234
- important = ( 'seq' === inputrule ? false : 'ctc_' + inputseq + '_child_' + inputrule + '_i_' + qsid + '_' + rulevalid ),
235
- parts, subparts;
236
- //**console.log( inputparts );
237
- //**console.log( 'value: ' + value );
238
- if ( 'child' === inputtheme ) {
239
- if ( !self.is_empty( $( this ).data( 'color' ) ) ) {
240
- value = self.color_text( $( this ).data( 'color' ) );
241
- $( this ).data( 'color', null );
242
- }
243
- postdata[ inputid ] = value;
244
- if ( important ) {
245
- postdata[ important ] = ( $( '#' + important ).is( ':checked' ) ) ? 1 : 0;
246
- }
247
- }
248
- if ( '' !== value ) {
249
- // handle specific inputs
250
- if ( !self.is_empty( rulepart ) ) {
251
- switch( rulepart ) {
252
- case '_border_width':
253
- cssrules[ inputtheme ][ inputrule + '-width' ] = ( 'none' === value ? 0 : value );
254
- break;
255
- case '_border_style':
256
- cssrules[ inputtheme ][ inputrule + '-style' ] = value;
257
- break;
258
- case '_border_color':
259
- cssrules[ inputtheme ][ inputrule + '-color' ] = value;
260
- break;
261
- case '_background_url':
262
- cssrules[ inputtheme ][ 'background-image' ] = self.image_url( inputtheme, value );
263
- break;
264
- case '_background_color':
265
- cssrules[ inputtheme ][ 'background-color' ] = value; // was obj.value ???
266
- break;
267
- case '_background_color1':
268
- gradient[ inputtheme ].start = value;
269
- has_gradient[ inputtheme ] = true;
270
- break;
271
- case '_background_color2':
272
- gradient[ inputtheme ].end = value;
273
- has_gradient[ inputtheme ] = true;
274
- break;
275
- case '_background_origin':
276
- gradient[ inputtheme ].origin = value;
277
- has_gradient[ inputtheme ] = true;
278
- break;
279
- }
280
- } else {
281
- // handle borders
282
- if ( ( parts = inputrule.toString().match( /^border(\-(top|right|bottom|left))?$/ ) && !value.match( /none/ ) ) ) {
283
- var borderregx = new RegExp( self.border_regx + self.color_regx, 'i' );
284
- subparts = value.toString().match( borderregx );
285
- //**console.log( 'border after regex: ');
286
- //**console.log( value );
287
- //**console.log( borderregx );
288
- //**console.log( subparts );
289
- if ( !self.is_empty( subparts ) ) {
290
- subparts.shift();
291
- cssrules[ inputtheme ][ inputrule + '-width' ] = subparts.shift() || '';
292
- subparts.shift();
293
- cssrules[ inputtheme ][ inputrule + '-style' ] = subparts.shift() || '';
294
- cssrules[ inputtheme ][ inputrule + '-color' ] = subparts.shift() || '';
295
- }
296
- // handle background images
297
- } else if ( 'background-image' === inputrule && !value.match( /none/ ) ) {
298
- if ( value.toString().match( /url\(/ ) ) {
299
- cssrules[ inputtheme ][ 'background-image' ] = self.image_url( inputtheme, value );
300
- } else {
301
- var gradregex = new RegExp( self.grad_regx + self.color_regx + self.color_regx, 'i' );
302
- subparts = value.toString().match( gradregex );
303
- //**console.log( 'background-image after regex: ');
304
- //**console.log( value );
305
- //**console.log( gradregex );
306
- //**console.log( subparts );
307
- if ( !self.is_empty( subparts ) && subparts.length > 2 ) {
308
- subparts.shift();
309
- gradient[ inputtheme ].origin = subparts.shift() || 'top';
310
- gradient[ inputtheme ].start = subparts.shift() || 'transparent';
311
- gradient[ inputtheme ].end = subparts.shift() || 'transparent';
312
- has_gradient[ inputtheme ] = true;
313
- } else {
314
- cssrules[ inputtheme ][ 'background-image' ] = value;
315
- }
316
- }
317
- } else if ( 'seq' !== inputrule ) {
318
- cssrules[ inputtheme ][ inputrule ] = value;
319
- }
320
- }
321
- }
322
- } );
323
- // update swatch
324
- if ( 'undefined' !== typeof swatch && !self.is_empty( swatch.attr( 'id' ) ) ) {
325
- swatch.removeAttr( 'style' );
326
- if ( has_gradient.parent ) {
327
- swatch.ctcgrad( gradient.parent.origin, [ gradient.parent.start, gradient.parent.end ] );
328
- }
329
- //**console.log( 'combined css rules' );
330
- //**console.log( cssrules );
331
- swatch.css( cssrules.parent );
332
- if ( !( swatch.attr( 'id' ).toString().match( /parent/ ) ) ) {
333
- if ( has_gradient.child ) {
334
- swatch.ctcgrad( gradient.child.origin, [ gradient.child.start, gradient.child.end ] );
335
- }
336
- //console.log( cssrules.child );
337
- swatch.css( cssrules.child );
338
- }
339
- swatch.css( {'z-index':-1} );
340
- }
341
- return postdata;
342
- },
343
-
344
- decode_value: function( rule, value ) {
345
- //**console.log( 'in decode_value ( ' + rule + ' ...' );
346
- value = ( 'undefined' === typeof value ? '' : value );
347
- var self = this,
348
- obj = {
349
- 'orig': value,
350
- 'names': [ '' ],
351
- 'values': [ value ]
352
- },
353
- params;
354
- if ( rule.toString().match( /^border(\-(top|right|bottom|left))?$/ ) ) {
355
- var regex = new RegExp( self.border_regx + '(' + self.color_regx + ')?', 'i' ),
356
- orig;
357
- params = value.toString().match( regex );
358
- if ( self.is_empty( params ) ) {
359
- params = [];
360
- }
361
- obj.names = [
362
- '_border_width',
363
- '_border_style',
364
- '_border_color',
365
- ];
366
- orig = params.shift();
367
- //**console.log( value );
368
- //**console.log( regex );
369
- //**console.log( params );
370
- obj.values[ 0 ] = params.shift() || '';
371
- params.shift();
372
- obj.values[ 1 ] = params.shift() || '';
373
- params.shift();
374
- obj.values[ 2 ] = params.shift() || '';
375
- } else if ( rule.toString().match( /^background\-image/ ) ) {
376
- obj.names = [
377
- '_background_url',
378
- '_background_origin',
379
- '_background_color1',
380
- '_background_color2'
381
- ];
382
- obj.values = [ '', '', '', '' ];
383
- if ( !self.is_empty( value ) && !( value.toString().match( /(url|none)/ ) ) ) {
384
- var stop1, stop2;
385
- params = value.toString().split( /:/ );
386
- //**console.log( value );
387
- //**console.log( params );
388
- obj.values[ 1 ] = params.shift() || '';
389
- obj.values[ 2 ] = params.shift() || '';
390
- stop1 = params.shift() || '';
391
- obj.values[ 3 ] = params.shift() || '';
392
- stop2 = params.shift() || '';
393
- obj.orig = [
394
- obj.values[ 1 ],
395
- obj.values[ 2 ],
396
- obj.values[ 3 ]
397
- ].join( ' ' );
398
- } else {
399
- obj.values[ 0 ] = value;
400
- }
401
- }
402
- //**console.log( obj );
403
- return obj;
404
- },
405
-
406
- image_url: function( theme, value ) {
407
- var self = this,
408
- parts = value.toString().match( /url\(['" ]*(.+?)['" ]*\)/ ),
409
- path = self.is_empty( parts ) ? null : parts[ 1 ],
410
- url = window.ctcAjax.theme_uri + '/' + ( 'parent' === theme ? window.ctcAjax.parnt : window.ctcAjax.child ) + '/',
411
- image_url;
412
- if ( !path ) {
413
- return false;
414
- } else if ( path.toString().match( /^(data:|https?:|\/)/ ) ) {
415
- image_url = value;
416
- } else {
417
- image_url = 'url(' + url + path + ')';
418
- }
419
- return image_url;
420
- },
421
-
422
- setup_menus: function() {
423
- var self = this;
424
- //console.log( 'setup_menus' );
425
- self.setup_query_menu();
426
- self.setup_selector_menu();
427
- self.setup_rule_menu();
428
- self.setup_new_rule_menu();
429
- self.load_queries();
430
- self.load_rules();
431
- // selectors will be loaded after query selected
432
- self.set_query( self.currquery );
433
- },
434
-
435
- load_queries: function() {
436
- var self = this;
437
- //console.log( 'load_queries' );
438
- // retrieve unique media queries
439
- self.query_css( 'queries', null );
440
- },
441
-
442
- load_selectors: function() {
443
- var self = this;
444
- //console.log( 'load_selectors' );
445
- // retrieve unique selectors from query value
446
- self.query_css( 'selectors', self.currquery );
447
- },
448
-
449
- load_rules: function() {
450
- var self = this;
451
- //console.log( 'load_rules' );
452
- // retrieve all unique rules
453
- self.query_css( 'rules', null );
454
- },
455
-
456
- load_selector_values: function() {
457
- var self = this;
458
- //console.log( 'load_selector_values: ' + self.currqsid );
459
- // retrieve individual values from qsid
460
- self.query_css( 'qsid', self.currqsid );
461
- },
462
-
463
- get_queries: function( request, response ) {
464
- //console.log( 'get_queries' );
465
- //console.log( this );
466
- var //self = this,
467
- arr = [],
468
- matcher = new RegExp( $.ui.autocomplete.escapeRegex( request.term ), "i" );
469
- if ( $.chldthmcfg.is_empty( this.element.data( 'menu' ) ) ) {
470
- arr.push( { 'label': window.ctcAjax.nosels_txt, 'value': null } );
471
- } else {
472
- // note: key = ndx, value = query name
473
- $.each( this.element.data( 'menu' ), function( key, val ) {
474
- if ( matcher.test( val ) ) {
475
- arr.push( { 'label': val, 'value': val } );
476
- }
477
- } );
478
- }
479
- response( arr );
480
- },
481
-
482
- get_selectors: function( request, response ) {
483
- //console.log( 'get_selectors' );
484
- var //self = this,
485
- arr = [],
486
- matcher = new RegExp( $.ui.autocomplete.escapeRegex( request.term ), "i" );
487
- if ( $.chldthmcfg.is_empty( this.element.data( 'menu' ) ) ) {
488
- arr.push( { 'label': window.ctcAjax.nosels_txt, 'value': null } );
489
- } else {
490
- // note: key = selector name, value = qsid
491
- $.each( this.element.data( 'menu' ), function( key, val ) {
492
- if ( matcher.test( key ) ) {
493
- arr.push( { 'label': key, 'value': val } );
494
- }
495
- } );
496
- }
497
- response( arr );
498
- },
499
-
500
- get_rules: function( request, response ) {
501
- //console.log( 'get_rules' );
502
- var //self = this,
503
- arr = [],
504
- matcher = new RegExp( $.ui.autocomplete.escapeRegex( request.term ), "i" );
505
- if ( $.chldthmcfg.is_empty( this.element.data( 'menu' ) ) ) {
506
- arr.push( { 'label': window.ctcAjax.nosels_txt, 'value': null } );
507
- } else {
508
- // note: key = ruleid, value = rule name
509
- $.each( this.element.data( 'menu' ), function( key, val ) {
510
- if ( matcher.test( key ) ) {
511
- arr.push( { 'label': key, 'value': val } );
512
- }
513
- } );
514
- }
515
- response( arr );
516
- },
517
-
518
- get_filtered_rules: function( request, response ) {
519
- //console.log( 'get_filtered_rules' );
520
- var arr = [],
521
- matcher = new RegExp( $.ui.autocomplete.escapeRegex( request.term ), "i" ); //,
522
- $.each( $( '#ctc_rule_menu' ).data( 'menu' ), function( key, val ) {
523
- //multiple versions of rule ok
524
- if ( matcher.test( key ) ) {
525
- arr.push( { 'label': key, 'value': val } );
526
- }
527
- } );
528
- response( arr );
529
- },
530
-
531
- /**
532
- * parent and new values are stored in separate arrays
533
- * this function puts them into parent/child columns by rulevalid
534
- */
535
- merge_ruleval_arrays: function( rule, value, isnew ) {
536
- //**console.log( 'merge_ruleval_arrays' );
537
- var self = this,
538
- valarr = {},
539
- nextval = isnew ? value.child.pop() : null; // if new rule, pop off the top before counting
540
- //**console.log( value );
541
- $.each( [ 'parnt', 'child' ], function( ndx, template ) {
542
- // iterate through parent and child val arrays and populate new assoc array with parent/child for each rulevalid
543
- if ( !self.is_empty( value[ template ] ) ) {
544
- $.each( value[ template ], function( ndx2, val ) {
545
- if ( isnew ) {
546
- // if new rule, increment new rulevalid but do not add to parent/child assoc array
547
- if ( parseInt( val[ 2 ] ) >= parseInt( nextval[ 2 ] ) ) {
548
- nextval[ 2 ] = parseInt( val[ 2 ] ) + 1;
549
- }
550
- } else {
551
- // add to parent/child assoc array with rulevalid as key
552
- if ( self.is_empty( valarr[ val[ 2 ] ] ) ) {
553
- valarr[ val[ 2 ] ] = {};
554
- }
555
- valarr[ val[ 2 ] ][ template ] = val;
556
- }
557
- } );
558
- }
559
- } );
560
- // if new rule, create new parent child assoc array element with new rulevalid as key
561
- if ( isnew ) {
562
- valarr[ nextval[ 2 ] ] = {
563
- parnt: [],
564
- child: nextval
565
- };
566
- }
567
- return valarr;
568
- },
569
-
570
- /**
571
- * input_row
572
- * render individual row of inputs for a given selector/rule combination
573
- * qsid query/selector id
574
- * rule css property
575
- * seq panel id from rule/value tab
576
- * data contains all rules/values for selector
577
- * isnew is passed true when new rule is selected from menu
578
- */
579
- input_row: function( qsid, rule, seq, data, isnew ) {
580
- //console.log( 'in input_row' );
581
- var self = this,
582
- html = '';
583
- if ( !self.is_empty( data ) && !self.is_empty( data.value ) && !self.is_empty( data.value[ rule ] ) ) {
584
- var value = data.value[ rule ],
585
- valarr = self.merge_ruleval_arrays( rule, value, isnew );
586
- $.each( valarr, function( ndx, val ) {
587
- var pval = self.decode_value( rule, self.is_empty( val.parnt ) ? '' : val.parnt[ 0 ] ),
588
- pimp = self.is_empty( val.parnt ) || self.is_empty( val.parnt[ 1 ], 1 ) ? 0 : 1,
589
- cval = self.decode_value( rule, self.is_empty( val.child ) ? '' : val.child[ 0 ] ),
590
- cimp = self.is_empty( val.child ) || self.is_empty( val.child[ 1 ], 1 ) ? 0 : 1;
591
- html += '<div class="ctc-' + ( 'ovrd' === seq ? 'input' : 'selector' ) + '-row clearfix"><div class="ctc-input-cell">';
592
- if ( 'ovrd' === seq ) {
593
- html += rule.replace( /\d+/g, self.frascii );
594
- } else {
595
- html += data.selector + '<br/><a href="#" class="ctc-selector-edit"' +
596
- ' id="ctc_selector_edit_' + qsid + '" >' + self.getxt( 'edit' ) + '</a> ' +
597
- ( self.is_empty( pval.orig ) ? self.getxt( 'child_only' ) : '' );
598
- }
599
- html += '</div><div class="ctc-parent-value ctc-input-cell"' + ( 'ovrd' !== seq ? ' style="display:none"' : '' ) +
600
- ' id="ctc_' + seq + '_parent_' + rule + '_' + qsid + '_' + ndx + '">' +
601
- ( self.is_empty( pval.orig ) ? '[no value]' : pval.orig + ( pimp ? self.getxt( 'important' ) : '' ) ) +
602
- '</div><div class="ctc-input-cell">';
603
- if ( !self.is_empty( pval.names ) ) {
604
- $.each( pval.names, function( namendx, newname ) {
605
- newname = ( self.is_empty( newname ) ? '' : newname );
606
- html += '<div class="ctc-child-input-cell clear">';
607
- var id = 'ctc_' + seq + '_child_' + rule + '_' + qsid + '_' + ndx + newname,
608
- newval;
609
- if ( false === ( newval = cval.values.shift() ) ) {
610
- newval = '';
611
- }
612
-
613
- html += ( self.is_empty( newname ) ? '' : self.getxt( newname ) + ':<br/>' ) +
614
- '<input type="text" id="' + id + '" name="' + id + '" class="ctc-child-value' +
615
- ( ( newname + rule ).toString().match( /color/ ) ? ' color-picker' : '' ) +
616
- ( ( newname ).toString().match( /url/ ) ? ' ctc-input-wide' : '' ) +
617
- '" value="' + self.escquo( newval ) + '" /></div>';
618
- } );
619
- var impid = 'ctc_' + seq + '_child_' + rule + '_i_' + qsid + '_' + ndx;
620
- html += '<label for="' + impid + '"><input type="checkbox"' +
621
- ' id="' + impid + '" name="' + impid + '" value="1" ' +
622
- ( cimp ? 'checked' : '' ) + ' />' +
623
- self.getxt( 'important' ) + '</label>';
624
- }
625
- html += '</div>';
626
- if ( 'ovrd' !== seq ) {
627
- html += '<div class="ctc-swatch ctc-specific"' +
628
- ' id="ctc_child_' + rule + '_' + qsid + '_' + ndx + '_swatch">' +
629
- self.getxt( 'swatch' ) + '</div>' +
630
- '<div class="ctc-child-input-cell ctc-button-cell"' +
631
- ' id="ctc_save_' + rule + '_' + qsid + '_' + ndx + '_cell">' +
632
- '<input type="button" class="button ctc-save-input"' +
633
- ' id="ctc_save_' + rule + '_' + qsid + '_' + ndx + '"' +
634
- ' name="ctc_save_' + rule + '_' + qsid + '_' + ndx + '"' +
635
- ' value="Save" /></div>';
636
- }
637
- html += '</div><!-- end input row -->' + "\n";
638
- } );
639
- }
640
- return html;
641
- },
642
-
643
- scrolltop: function() {
644
- $('html, body, .ctc-option-panel-container').animate( { scrollTop: 0 } );
645
- },
646
-
647
- css_preview: function( theme ) {
648
- var self = this;
649
- //console.log( 'css_preview: ' + theme );
650
- if ( !( theme = theme.match( /(child|parnt)/ )[ 1 ] ) ) {
651
- theme = 'child';
652
- }
653
- //console.log( 'css_preview: ' + theme );
654
- // retrieve raw stylesheet ( parent or child )
655
- self.query_css( 'preview', theme );
656
- },
657
-
658
- /**
659
- * The "setup" functions initialize jQuery UI widgets
660
- */
661
- setup_iris: function( obj ) {
662
- // deprecated: using spectrum for alpha support
663
- var self = this;
664
- self.setup_spectrum( obj );
665
- },
666
-
667
- setup_spectrum: function( obj ) {
668
- var self = this,
669
- //colortxt = $( obj ).attr( 'id' ) + '_colortxt',
670
- palette = !self.is_empty( window.ctcAjax.palette );
671
- try {
672
- $( obj ).spectrum( {
673
- showInput: true,
674
- allowEmpty: true,
675
- showAlpha: true,
676
- showInitial: true,
677
- preferredFormat: "hex", // 'name', //
678
- clickoutFiresChange: true,
679
- move: function( color ) {
680
- $( obj ).data( 'color', color );
681
- self.coalesce_inputs( obj );
682
- },
683
- showPalette: palette ? true : false,
684
- showSelectionPalette: palette ? true : false,
685
- palette: [ ],
686
- maxSelectionSize: 36,
687
- localStorageKey: "ctc-palette." + window.ctcAjax.child,
688
- hideAfterPaletteSelect: true,
689
- } ).on( 'change', function( ){
690
- //var color = $( this ).spectrum( 'get' );
691
- //console.log( 'color change: ' + color );
692
- self.coalesce_inputs( this );
693
- } ).on( 'keyup', function( ) {
694
- // update spectrum ui to match text input after half-second delay
695
- var $this = this,
696
- $val = self.addhash( $( this ).val() );
697
- $( $this ).val( $val );
698
- clearTimeout( $( this ).data( 'spectrumTimer' ) );
699
- $( this ).data( 'spectrumTimer', setTimeout(
700
- function() {
701
- self.coalesce_inputs( $this );
702
- $( $this ).spectrum( 'set', $val );
703
- },
704
- 500
705
- ) );
706
- } );
707
-
708
- } catch ( exn ) {
709
- self.jquery_exception( exn, 'Spectrum Color Picker' );
710
- }
711
- },
712
- addhash: function( color ) {
713
- return color.replace( /^#?([a-f0-9]{3,6}.*)/, "#$1" );
714
- },
715
- color_text: function( color ) {
716
- var self = this;
717
- if ( self.is_empty( color ) ) {
718
- return '';
719
- } else if ( color.getAlpha() < 1 ) {
720
- return color.toRgbString();
721
- } else {
722
- return color.toHexString();
723
- }
724
- },
725
-
726
- setup_query_menu: function() {
727
- var self = this;
728
- //console.log( 'setup_query_menu' );
729
- try {
730
- $( '#ctc_sel_ovrd_query' ).autocomplete( {
731
- source: self.get_queries,
732
- minLength: 0,
733
- selectFirst: true,
734
- autoFocus: true,
735
- select: function( e, ui ) {
736
- self.set_query( ui.item.value );
737
- return false;
738
- },
739
- focus: function( e ) {
740
- e.preventDefault();
741
- }
742
- } ).data( 'menu' , {} );
743
- } catch ( exn ) {
744
- self.jquery_exception( exn, 'Query Menu' );
745
- }
746
- },
747
-
748
- setup_selector_menu: function() {
749
- var self = this;
750
- //console.log( 'setup_selector_menu' );
751
- try {
752
- $( '#ctc_sel_ovrd_selector' ).autocomplete( {
753
- source: self.get_selectors,
754
- selectFirst: true,
755
- autoFocus: true,
756
- select: function( e, ui ) {
757
- self.set_selector( ui.item.value, ui.item.label );
758
- return false;
759
- },
760
- focus: function( e ) {
761
- e.preventDefault();
762
- }
763
- } ).data( 'menu' , {} );
764
- } catch ( exn ) {
765
- self.jquery_exception( exn, 'Selector Menu' );
766
- }
767
- },
768
-
769
- setup_rule_menu: function() {
770
- var self = this;
771
- //console.log( 'setup_rule_menu' );
772
- try {
773
- $( '#ctc_rule_menu' ).autocomplete( {
774
- source: self.get_rules,
775
- //minLength: 0,
776
- selectFirst: true,
777
- autoFocus: true,
778
- select: function( e, ui ) {
779
- self.set_rule( ui.item.value, ui.item.label );
780
- return false;
781
- },
782
- focus: function( e ) {
783
- e.preventDefault();
784
- }
785
- } ).data( 'menu' , {} );
786
- } catch ( exn ) {
787
- self.jquery_exception( exn, 'Property Menu' );
788
- }
789
- },
790
-
791
- setup_new_rule_menu: function() {
792
- var self = this;
793
- try {
794
- $( '#ctc_new_rule_menu' ).autocomplete( {
795
- source: self.get_filtered_rules,
796
- //minLength: 0,
797
- selectFirst: true,
798
- autoFocus: true,
799
- select: function( e, ui ) {
800
- //console.log( 'new rule selected' );
801
- e.preventDefault();
802
- var newrule = ui.item.label.replace( /[^\w\-]/g, self.toascii ),
803
- row,
804
- first;
805
- //console.log( 'current qsdata before:' );
806
- //console.log( self.currdata );
807
- if ( self.is_empty( self.currdata.value ) ) {
808
- self.currdata.value = {};
809
- }
810
- if ( self.is_empty( self.currdata.value[ ui.item.label ] ) ) {
811
- self.currdata.value[ ui.item.label ] = {};
812
- }
813
- if ( self.is_empty( self.currdata.value[ ui.item.label ].child ) ) {
814
- self.currdata.value[ ui.item.label ].child = [];
815
- }
816
- //console.log( 'current qsdata after:' );
817
- //console.log( self.currdata );
818
- // seed current qsdata with new blank value with id 1
819
- // this will be modified during input_row function to be next id in order
820
- self.currdata.value[ ui.item.label ].child.push( [ '', 0, 1, 1 ] );
821
- row = $( self.input_row( self.currqsid, newrule, 'ovrd', self.currdata, true ) );
822
- $( '#ctc_sel_ovrd_rule_inputs' ).append( row );
823
- $( '#ctc_new_rule_menu' ).val( '' );
824
-
825
- row.find( 'input[type="text"]' ).each( function( ndx, el ) {
826
- if (! first) {
827
- first = el;
828
- }
829
- if ( $( el ).hasClass( 'color-picker' ) ){
830
- self.setup_spectrum( el );
831
- }
832
- } );
833
- if ( first ){
834
- $( first ).focus();
835
- }
836
- // if ( self.jqueryerr.length ) {
837
- // self.jquery_notice( 'setup_new_rule_menu' );
838
- // }
839
- return false;
840
- },
841
- focus: function( e ) {
842
- e.preventDefault();
843
- }
844
- } ).data( 'menu' , {} );
845
- } catch ( exn ) {
846
- self.jquery_exception( exn, 'New Property Menu' );
847
- }
848
- },
849
- set_theme_params: function( template, themedir ) {
850
- $( '#ctc_child_author' ).val( window.ctcAjax.themes[ template ][ themedir ].Author );
851
- $( '#ctc_child_version' ).val( window.ctcAjax.themes[ template ][ themedir ].Version );
852
- $( '#ctc_child_authoruri' ).val( window.ctcAjax.themes[ template ][ themedir ].AuthorURI );
853
- $( '#ctc_child_themeuri' ).val( window.ctcAjax.themes[ template ][ themedir ].ThemeURI );
854
- $( '#ctc_child_descr' ).val( window.ctcAjax.themes[ template ][ themedir ].Descr );
855
- $( '#ctc_child_tags' ).val( window.ctcAjax.themes[ template ][ themedir ].Tags );
856
- },
857
- update_form: function() {
858
- var self = this,
859
- themedir;
860
- $( '#input_row_stylesheet_handling_container,#input_row_parent_handling_container,#ctc_additional_css_files_container,#input_row_new_theme_slug,#input_row_duplicate_theme_slug,#ctc_copy_theme_mods,#ctc_child_header_parameters,#ctc_configure_submit,#input_row_theme_slug' ).slideUp( 'fast' );
861
- $( '#ctc_configure_submit .ctc-step' ).text( '9' );
862
- if ( $( '#ctc_theme_child' ).length && !$( '#ctc_child_type_new' ).is( ':checked' ) ) {
863
- themedir = $( '#ctc_theme_child' ).val();
864
- //console.log( 'update_form (existing) ... ' + themedir );
865
- self.existing = 1;
866
- self.currparnt = window.ctcAjax.themes.child[ themedir ].Template;
867
- self.autogen_slugs();
868
- $( '#ctc_theme_parnt' ).val( self.currparnt );
869
- $( '#ctc_theme_parnt-button .ui-selectmenu-text' ).text( self.getname( 'parnt' ) );
870
- self.set_theme_params( 'child', themedir );
871
- //self.set_child_menu( document.getElementById( 'ctc_theme_child' ) );
872
- if ( $( '#ctc_child_type_duplicate' ).is( ':checked' ) ) {
873
- $( '#ctc_child_template' ).val( self.testslug );
874
- $( '#ctc_child_name' ).val( self.testname );
875
- $( '.ctc-analyze-theme, .ctc-analyze-howto' ).show();
876
- $( '#ctc_load_styles' ).val( 'Duplicate Child Theme' );
877
- } else if ( $( '#ctc_child_type_reset' ).is( ':checked' ) ) {
878
- $( '#ctc_configure_submit .ctc-step' ).text( '3' );
879
- $( '#ctc_configure_submit' ).slideDown( 'fast' );
880
- $( '#theme_slug_container' ).text( themedir );
881
- $( '.ctc-analyze-theme, .ctc-analyze-howto' ).hide();
882
- //$( '#input_row_theme_slug' ).slideDown( 'fast' );
883
- $( '#ctc_enqueue_none' ).prop( 'checked', true );
884
- $( '#ctc_load_styles' ).val( 'Reset Child Theme to Previous State' );
885
- } else {
886
- $( '#ctc_child_template' ).val( '' );
887
- $( '#theme_slug_container' ).text( themedir );
888
- $( '.ctc-analyze-theme, .ctc-analyze-howto' ).show();
889
- $( '#ctc_child_name' ).val( self.getname( 'child' ) );
890
- $( '#ctc_load_styles' ).val( 'Configure Child Theme' );
891
- }
892
- $( '#input_row_existing_theme_option' ).slideDown( 'fast' );
893
- $( '#input_row_new_theme_option' ).slideUp( 'fast' );
894
- } else {
895
- self.existing = 0;
896
- self.autogen_slugs();
897
- //themedir = $( '#ctc_theme_parnt' ).val();
898
- $( '#ctc_theme_parnt' ).val( self.currparnt );
899
- $( '#ctc_theme_parnt-button .ui-selectmenu-text' ).text( $.chldthmcfg.getname( 'parnt' ) );
900
- //console.log( 'update_form (new) ... ' + self.currparnt );
901
- //self.set_parent_menu( document.getElementById( 'ctc_theme_parnt' ) );
902
- //console.log( 'setting to new...' + $( '#ctc_theme_parnt' ).val() );
903
- self.set_theme_params( 'parnt', self.currparnt );
904
- $( '#input_row_existing_theme_option,#input_row_duplicate_theme_container,#input_row_theme_slug' ).slideUp( 'fast' );
905
- $( '#input_row_new_theme_option' ).slideDown( 'fast' );
906
- $( '#ctc_child_name' ).val( self.testname );
907
- $( '#ctc_child_template' ).val( self.testslug );
908
- $( '.ctc-analyze-theme, .ctc-analyze-howto' ).show();
909
- $( '#ctc_load_styles' ).val( 'Create New Child Theme' );
910
- }
911
- },
912
- set_notice: function( noticearr ) {
913
- var self = this,
914
- errorHtml = '',
915
- out;
916
- if ( !self.is_empty( noticearr ) ) {
917
- $.each( noticearr, function( type, list ) {
918
- errorHtml += '<div class="' + type + ' notice is-dismissible dashicons-before"><ul>' + "\n";
919
- $( list ).each( function( ndx, el ) {
920
- errorHtml += '<li>' + el.toString() + '</li>' + "\n";
921
- } );
922
- errorHtml += '</ul></div>';
923
- } );
924
- }
925
- out = $( errorHtml );
926
- $( '#ctc_error_notice' ).html( out );
927
- self.bind_dismiss( out );
928
- $( 'html, body' ).animate( { scrollTop: 0 }, 'slow' );
929
- },
930
-
931
- set_parent_menu: function( obj ) {
932
- // refresh page with current parent theme
933
- var self = this;
934
- self.currparnt = obj.value;
935
- self.update_form();
936
- //self.show_loading();
937
- //document.location = '?page=' + window.ctcAjax.page + '&ctc_parent=' + obj.value;
938
- },
939
-
940
- set_child_menu: function( obj ) {
941
- var self = this;
942
- self.currchild = obj.value;
943
- self.update_form();
944
- },
945
-
946
- set_query: function( value ) {
947
- var self = this;
948
- if ( self.is_empty( value ) ) {
949
- return false;
950
- }
951
- //console.log( 'set_query: ' + value );
952
- self.currquery = value;
953
- $( '#ctc_sel_ovrd_query' ).val( '' );
954
- $( '#ctc_sel_ovrd_query_selected' ).text( value );
955
- $( '#ctc_sel_ovrd_selector' ).val( '' );
956
- $( '#ctc_sel_ovrd_selector_selected' ).html( '&nbsp;' );
957
- //$( '#ctc_sel_ovrd_rule_inputs' ).html( '' );
958
- self.load_selectors();
959
- self.scrolltop();
960
- },
961
-
962
- set_selector: function( value, label ) {
963
- var self = this;
964
- label = null;
965
- if ( self.is_empty( value ) ) {
966
- return false;
967
- }
968
- //console.log( 'set_selector: ' + value + ' label: ' + label );
969
- $( '#ctc_sel_ovrd_selector' ).val( '' );
970
- self.currqsid = value;
971
- self.reload = false;
972
- self.load_selector_values();
973
- self.scrolltop();
974
- },
975
-
976
- set_rule: function( value, label ) {
977
- //console.log( 'set_rule: ' + value + ' label: ' + label );
978
- var self = this;
979
- if ( self.is_empty( value ) ) {
980
- return false;
981
- }
982
- $( '#ctc_rule_menu' ).val( '' );
983
- $( '#ctc_rule_menu_selected' ).text( label );
984
- $( '.ctc-rewrite-toggle' ).text( self.getxt( 'rename' ) );
985
- $( '#ctc_rule_value_inputs, #ctc_input_row_rule_header' ).show();
986
- // retrieve unique values by rule
987
- self.query_css( 'rule_val', value );
988
- self.scrolltop();
989
- },
990
-
991
- set_qsid: function( obj ) {
992
- var self = this;
993
- //console.log( 'set_qsid: ' + $( obj ).attr( 'id' ) );
994
- self.currqsid = $( obj ).attr( 'id' ).match( /_(\d+)$/ )[ 1 ];
995
- self.focus_panel( '#query_selector_options' );
996
- self.reload = true;
997
- self.load_selector_values();
998
- },
999
- /**
1000
- * Retrieve data from server and execute callback on completion
1001
- */
1002
- query_css: function( obj, key, params ) {
1003
- //console.log( 'query_css: ' + obj + ' key: ' + key );
1004
- var self = this,
1005
- postdata = { 'ctc_query_obj' : obj, 'ctc_query_key': key },
1006
- status_sel = '#ctc_status_' + obj + ( 'val_qry' === obj ? '_' + key : '' );
1007
-
1008
- if ( 'object' === typeof params ) {
1009
- $.each( params, function( key, val ) {
1010
- postdata[ 'ctc_query_' + key ] = val;
1011
- } );
1012
- }
1013
- $( '.query-icon,.ctc-status-icon' ).remove();
1014
- //console.log( status_sel + ' ' + $( status_sel ).length );
1015
- $( status_sel + ' .ctc-status-icon' ).remove();
1016
- $( status_sel ).append( '<span class="ctc-status-icon spinner is-active query-icon"></span>' );
1017
- // add wp ajax action to array
1018
- //console.log( $( '#ctc_action' ).val() );
1019
- postdata.action = ( !self.is_empty( $( '#ctc_action' ).val() ) &&
1020
- 'plugin' === $( '#ctc_action' ).val() ) ?
1021
- 'ctc_plgqry' : 'ctc_query';
1022
- postdata._wpnonce = $( '#_wpnonce' ).val();
1023
- // ajax post input data
1024
- //console.log( 'query_css postdata:' );
1025
- //console.log( postdata );
1026
- self.ajax_post( obj, postdata );
1027
- },
1028
- /**
1029
- * Post data to server for saving and execute callback on completion
1030
- */
1031
- save: function( obj ) {
1032
- //console.log( 'save: ' + $( obj ).attr( 'id' ) );
1033
- var self = this,
1034
- postdata = {},
1035
- $selector,
1036
- $query,
1037
- $imports,
1038
- id = $( obj ).attr( 'id' ),
1039
- newsel,
1040
- origsel;
1041
-
1042
- // disable the button until ajax returns
1043
- $( obj ).prop( 'disabled', true );
1044
- // clear previous success/fail icons
1045
- $( '.ctc-query-icon,.ctc-status-icon' ).remove();
1046
- // show spinner
1047
- $( obj ).parent( '.ctc-textarea-button-cell, .ctc-button-cell' )
1048
- .append( '<span class="ctc-status-icon spinner save-icon"></span>' );
1049
- if ( id.match( /ctc_configtype/ ) ) {
1050
- $( obj ).parents( '.ctc-input-row' ).first()
1051
- .append( '<span class="ctc-status-icon spinner save-icon"></span>' );
1052
- postdata.ctc_configtype = $( obj ).val();
1053
- } else if ( ( $selector = $( '#ctc_new_selectors' ) ) &&
1054
- 'ctc_save_new_selectors' === $( obj ).attr( 'id' ) ) {
1055
- postdata.ctc_new_selectors = $selector.val();
1056
- if ( ( $query = $( '#ctc_sel_ovrd_query_selected' ) ) ) {
1057
- postdata.ctc_sel_ovrd_query = $query.text();
1058
- }
1059
- self.reload = true;
1060
- } else if ( ( $imports = $( '#ctc_child_imports' ) ) &&
1061
- 'ctc_save_imports' === id ) {
1062
- postdata.ctc_child_imports = $imports.val();
1063
- } else if ( 'ctc_is_debug' === id ) {
1064
- postdata.ctc_is_debug = $( '#ctc_is_debug' ).is( ':checked' ) ? 1 : 0;
1065
- } else {
1066
- // coalesce inputs
1067
- postdata = self.coalesce_inputs( obj );
1068
- }
1069
- $( '.save-icon' ).addClass( 'is-active' );
1070
- // add rename selector value if it exists
1071
- $( '#ctc_sel_ovrd_selector_selected' )
1072
- .find( '#ctc_rewrite_selector' ).each( function() {
1073
- newsel = $( '#ctc_rewrite_selector' ).val();
1074
- origsel = $( '#ctc_rewrite_selector_orig' ).val();
1075
- if ( self.is_empty( newsel ) || !newsel.toString().match( /\w/ ) ) {
1076
- newsel = origsel;
1077
- } else {
1078
- postdata.ctc_rewrite_selector = newsel;
1079
- self.reload = true;
1080
- }
1081
- $( '.ctc-rewrite-toggle' ).text( self.getxt( 'rename' ) );
1082
- $( '#ctc_sel_ovrd_selector_selected' ).html( newsel );
1083
- } );
1084
- // add wp ajax action to array
1085
- //console.log( $( '#ctc_action' ).val() );
1086
- postdata.action = ( !self.is_empty( $( '#ctc_action' ).val() ) &&
1087
- 'plugin' === $( '#ctc_action' ).val() ) ?
1088
- 'ctc_plugin' : 'ctc_update';
1089
- postdata._wpnonce = $( '#_wpnonce' ).val();
1090
- //console.log( postdata );
1091
- // ajax post input data
1092
- self.ajax_post( 'qsid', postdata );
1093
- },
1094
-
1095
- ajax_post: function( obj, data, datatype ) {
1096
- var self = this;
1097
- //console.log( 'ajax_post: ' + obj );
1098
- //console.log( data );
1099
- //console.log( window.ctcAjax.ajaxurl );
1100
- //console.log( window.ctcAjax.ajaxurl );
1101
- // get ajax url from localized object
1102
- $.ajax( {
1103
- url: window.ctcAjax.ajaxurl,
1104
- data: data,
1105
- dataType:
1106
- //'ctc_update' === data.action && 'qsid' === obj ? 'text' :
1107
- //'ctc_update' == data.action && //
1108
- //'rule_val' === obj ? 'text' : // 'qsid' == obj ? 'text' :
1109
- ( self.is_empty( datatype ) ? 'json' : datatype ),
1110
- type: 'POST'
1111
- } ).done( function( response ) {
1112
- //console.log( response );
1113
- self.handle_success( obj, response );
1114
- } ).fail( function() { // jxr, status, err ) {
1115
- //console.log( status );
1116
- //console.log( err );
1117
- self.handle_failure( obj );
1118
- } ).always( function() {
1119
- if ( self.jqueryerr.length ) {
1120
- self.jquery_notice();
1121
- }
1122
- } );
1123
- },
1124
-
1125
- handle_failure: function( obj ) {
1126
- var self = this;
1127
- //console.log( 'handle_failure: ' + obj );
1128
- $( '.query-icon, .save-icon' ).removeClass( 'spinner' ).addClass( 'failure' );
1129
- $( 'input[type=submit], input[type=button], input[type=checkbox],.ctc-delete-input' ).prop( 'disabled', false );
1130
- $( '.ajax-pending' ).removeClass( 'ajax-pending' );
1131
- //FIXME: return fail text in ajax response
1132
- if ( 'preview' === obj ) {
1133
- $( '#view_parnt_options_panel,#view_child_options_panel' )
1134
- .text( self.getxt( 'css_fail' ) );
1135
- }
1136
- },
1137
-
1138
- handle_success: function( obj, response ) {
1139
- var self = this;
1140
- // query response
1141
- //console.log( 'handle_success: ' + obj );
1142
- //console.log( response );
1143
- // hide spinner
1144
- $( '.query-icon, .save-icon' ).removeClass( 'spinner' );
1145
- $( '.ajax-pending' ).removeClass( 'ajax-pending' );
1146
- // hide spinner
1147
- if ( self.is_empty( response ) ) {
1148
- self.handle_failure( obj );
1149
- } else {
1150
- $( '#ctc_new_selectors' ).val( '' );
1151
- // update data objects
1152
- // show check mark
1153
- // FIXME: distinction between save and query, update specific status icon
1154
- $( '.query-icon, .save-icon' ).addClass( 'success' );
1155
- $( 'input[type=submit], input[type=button], input[type=checkbox],.ctc-delete-input' ).prop( 'disabled', false );
1156
- // update ui from each response object
1157
- $( response ).each( function() {
1158
- if ( 'function' === typeof self.update[ this.obj ] ) {
1159
- //console.log( 'executing method update.' + this.obj );
1160
- self.update[ this.obj ].call( self, this );
1161
- } else {
1162
- //console.log( 'Fail: no method update.' + this.obj );
1163
- }
1164
- } );
1165
- }
1166
- },
1167
-
1168
- jquery_exception: function( exn, type ) {
1169
- var self = this,
1170
- ln = self.is_empty( exn.lineNumber ) ? '' : ' line: ' + exn.lineNumber,
1171
- fn = self.is_empty( exn.fileName ) ? '' : ' ' + exn.fileName.split( /\?/ )[ 0 ];
1172
- self.jqueryerr.push( '<code><small>' + type + ': ' + exn.message + fn + ln + '</small></code>' );
1173
- //console.log( 'jquery error detected' );
1174
- },
1175
-
1176
- jquery_notice: function( fn ) {
1177
- //console.log( fn );
1178
- fn = null;
1179
- var self = this,
1180
- culprits = [],
1181
- errors = [];
1182
- if ( self.jqueryerr.length ){
1183
- // disable form submits
1184
- $( 'input[type=submit], input[type=button]' ).prop( 'disabled', true );
1185
- $( 'script' ).each( function(){
1186
- var url = $( this ).prop( 'src' );
1187
- if ( !self.is_empty( url ) && url.match( /jquery(\.min|\.js|\-?ui)/i ) &&
1188
- ! url.match( /load\-scripts.php/ ) ) {
1189
- culprits.push( '<code><small>' + url.split( /\?/ )[ 0 ] + '</small></code>' );
1190
- }
1191
- } );
1192
- errors.push( '<strong>' + self.getxt( 'js' ) + '</strong> ' + self.getxt( 'contact' ) );
1193
- //if ( 1 == window.ctcAjax.is_debug ) {
1194
- errors.push( self.jqueryerr.join( '<br/>' ) );
1195
- //}
1196
- if ( culprits.length ) {
1197
- errors.push( self.getxt( 'jquery' ) + '<br/>' + culprits.join( '<br/>' ) );
1198
- }
1199
- errors.push( self.getxt( 'plugin' ) );
1200
- }
1201
- //return errors;
1202
- self.set_notice( { 'error': errors } );
1203
- },
1204
- /*
1205
- // test for jquery issues
1206
-
1207
- $.each( jqueryerr, function( index, err ) {
1208
- notice.hasnotice = 1;
1209
- notice.style = 'error';
1210
- notice.jquery += err;
1211
- } );
1212
- */
1213
-
1214
-
1215
- update: {
1216
- // render individual selector inputs on Query/Selector tab
1217
- qsid: function( res ) {
1218
- //console.log( res );
1219
- var self = this,
1220
- id, html, val, empty;
1221
- self.currqsid = res.key;
1222
- self.currdata = res.data;
1223
- //console.log( 'update.qsid: ' + self.currqsid );
1224
- $( '#ctc_sel_ovrd_qsid' ).val( self.currqsid );
1225
- if ( self.is_empty( self.currdata.seq ) ) {
1226
- $( '#ctc_child_load_order_container' ).empty();
1227
- } else {
1228
- id = 'ctc_ovrd_child_seq_' + self.currqsid;
1229
- val = parseInt( self.currdata.seq );
1230
- html = '<input type="text" id="' + id + '" name="' + id + '"' +
1231
- ' class="ctc-child-value" value="' + val + '" />';
1232
- $( '#ctc_child_load_order_container' ).html( html );
1233
- }
1234
- if ( self.is_empty( self.currdata.value ) ) {
1235
- //console.log( 'qsdata is empty' );
1236
- empty = true;
1237
- $( '#ctc_sel_ovrd_rule_inputs' ).empty();
1238
- } else {
1239
- //console.log( 'qsdata NOT empty' );
1240
- empty = false;
1241
- html = '';
1242
- $.each( self.currdata.value, function( rule, value ) {
1243
- value = null;
1244
- html += self.input_row( self.currqsid, rule, 'ovrd', self.currdata );
1245
- } );
1246
- $( '#ctc_sel_ovrd_rule_inputs' ).html( html ).find( '.color-picker' ).each( function() {
1247
- self.setup_spectrum( this );
1248
- } );
1249
- self.coalesce_inputs( '#ctc_child_all_0_swatch' );
1250
- }
1251
- // if ( self.jqueryerr.length ) {
1252
- // self.jquery_notice( 'update.qsid' );
1253
- // } else {
1254
- //console.log( 'reload menus: ' + ( self.reload ? 'true' : 'false' ) );
1255
- if ( self.reload ) {
1256
- self.load_queries();
1257
- self.set_query( self.currdata.query );
1258
- self.load_rules();
1259
- }
1260
- $( '#ctc_sel_ovrd_selector_selected' ).text( self.currdata.selector );
1261
- $( '.ctc-rewrite-toggle' ).text( self.getxt( 'rename' ) );
1262
- $( '.ctc-rewrite-toggle' ).show();
1263
- if ( !empty ){
1264
- $( '#ctc_sel_ovrd_rule_header,' +
1265
- '#ctc_sel_ovrd_new_rule,' +
1266
- '#ctc_sel_ovrd_rule_inputs_container,' +
1267
- '#ctc_sel_ovrd_rule_inputs' ).show();
1268
- } else {
1269
- $( '#ctc_sel_ovrd_rule_header,' +
1270
- '#ctc_sel_ovrd_new_rule,' +
1271
- '#ctc_sel_ovrd_rule_inputs_container,' +
1272
- '#ctc_sel_ovrd_rule_inputs' ).hide();
1273
- }
1274
- //self.scrolltop();
1275
- // }
1276
- },
1277
- // render list of unique values for given rule on Property/Value tab
1278
- rule_val: function( res ) {
1279
- //console.log( 'update.rule_val: ' + res.key );
1280
- //console.log( res.data );
1281
- var self = this,
1282
- rule = $( '#ctc_rule_menu_selected' ).text(),
1283
- html = '<div class="ctc-input-row clearfix" id="ctc_rule_row_' + rule + '">' + "\n";
1284
- //console.log( 'rule: ' + rule );
1285
- if ( !self.is_empty( res.data ) ) {
1286
- $.each( res.data, function( valid, value ) {
1287
- var parentObj = self.decode_value( rule, value );
1288
- html += '<div class="ctc-parent-row clearfix"' +
1289
- ' id="ctc_rule_row_' + rule + '_' + valid + '">' + "\n" +
1290
- '<div class="ctc-input-cell ctc-parent-value"' +
1291
- ' id="ctc_' + valid + '_parent_' + rule + '_' + valid + '">' +
1292
- parentObj.orig + '</div>' + "\n" +
1293
- '<div class="ctc-input-cell">' + "\n" +
1294
- '<div class="ctc-swatch ctc-specific"' +
1295
- ' id="ctc_' + valid + '_parent_' + rule + '_' + valid + '_swatch">' +
1296
- self.getxt( 'swatch' ) + '</div></div>' + "\n" +
1297
- '<div class="ctc-input-cell">' +
1298
- '<a href="#" class="ctc-selector-handle"' +
1299
- ' id="ctc_selector_' + rule + '_' + valid + '">' +
1300
- self.getxt( 'selector' ) + '</a></div>' + "\n" +
1301
- '<div id="ctc_selector_' + rule + '_' + valid + '_container"' +
1302
- ' class="ctc-selector-container">' + "\n" +
1303
- '<a href="#" id="ctc_selector_' + rule + '_' + valid + '_close"' +
1304
- ' class="ctc-selector-handle ctc-exit" title="' +
1305
- self.getxt( 'close' ) + '"></a>' +
1306
- '<div id="ctc_selector_' + rule + '_' + valid + '_inner_container"' +
1307
- ' class="ctc-selector-inner-container clearfix">' + "\n" +
1308
- '<div id="ctc_status_val_qry_' + valid + '"></div>' + "\n" +
1309
- '<div id="ctc_selector_' + rule + '_' + valid + '_rows"></div>' + "\n" +
1310
- '</div></div></div>' + "\n";
1311
- } );
1312
- html += '</div>' + "\n";
1313
- }
1314
- $( '#ctc_rule_value_inputs' ).html( html ).find( '.ctc-swatch' ).each( function() {
1315
- self.coalesce_inputs( this );
1316
- } );
1317
- },
1318
- // render list of selectors grouped by query for given value on Property/Value Tab
1319
- val_qry: function( res ) {
1320
- //console.log( 'in val_qry' );
1321
- //console.log( res );
1322
- var self = this,
1323
- html = '',
1324
- page_rule,
1325
- selector;
1326
- if ( !self.is_empty( res.data ) ) {
1327
- $.each( res.data, function( rule, queries ) {
1328
- page_rule = rule;
1329
- $.each( queries, function( query, selectors ) {
1330
- html += '<h4 class="ctc-query-heading">' + query + '</h4>' + "\n";
1331
- if ( !self.is_empty( selectors ) ) {
1332
- $.each( selectors, function( qsid, qsdata ) {
1333
- html += self.input_row( qsid, rule, res.key, qsdata );
1334
- } );
1335
- }
1336
- } );
1337
- } );
1338
- }
1339
- selector = '#ctc_selector_' + page_rule + '_' + res.key + '_rows';
1340
- //console.log( selector );
1341
-
1342
- $( selector ).html( html ).find( '.color-picker' ).each( function() {
1343
- self.setup_spectrum( this );
1344
- } );
1345
- $( selector ).find( '.ctc-swatch' ).each( function() {
1346
- self.coalesce_inputs( this );
1347
- } );
1348
- // if ( self.jqueryerr.length ) {
1349
- // self.jquery_notice( 'val_qry' );
1350
- // }
1351
- },
1352
- // populate list of queries and attach to query input element
1353
- queries: function( res ) {
1354
- $( '#ctc_sel_ovrd_query' ).data( 'menu', res.data );
1355
- },
1356
- // populate list of selectors and attach to selector input element
1357
- selectors: function( res ) {
1358
- $( '#ctc_sel_ovrd_selector' ).data( 'menu', res.data );
1359
- },
1360
- // populate list of rules and attach to rule input element
1361
- rules: function( res ) {
1362
- $( '#ctc_rule_menu' ).data( 'menu', res.data );
1363
- },
1364
- // render debug output
1365
- debug: function( res ) {
1366
- $( '#ctc_debug_box' ).val( $( '#ctc_debug_box' ).val() + res.data );
1367
- //console.log( 'debug:' );
1368
- //console.log( res.data );
1369
- },
1370
- // render stylesheet preview on child or parent css tab
1371
- preview: function( res ) {
1372
- $( '#view_' + res.key + '_options_panel' ).text( res.data );
1373
- },
1374
- dismiss: function() { // res ) {
1375
- //console.log( 'dismiss came home!' );
1376
- //console.log( res );
1377
- //var self = this;
1378
- //self.dismiss_notice();
1379
- }
1380
-
1381
- },
1382
- // applies core dismiss behavior to injected elements
1383
- bind_dismiss: function( el ) {
1384
- //console.log( 'bind_dismiss' );
1385
- var self = this,
1386
- $this = $( el ),
1387
- $button = $( '<button type="button" class="notice-dismiss"><span class="screen-reader-text"></span></button>' ),
1388
- btnText = window.commonL10n.dismiss || '';
1389
-
1390
- // Ensure plain text
1391
- $button.find( '.screen-reader-text' ).text( btnText );
1392
-
1393
- $this.append( $button );
1394
-
1395
- $button.on( 'click.wp-dismiss-notice', function( event ) {
1396
- event.preventDefault();
1397
- self.dismiss_notice( el );
1398
- });
1399
- },
1400
- dismiss_notice: function( el ) {
1401
- $( el ).fadeTo( 100 , 0, function() {
1402
- $( this ).slideUp( 100, function() {
1403
- $( this ).remove();
1404
- });
1405
- });
1406
- },
1407
- reset_handling: function() {
1408
- //console.log( '----> resetting form...' );
1409
- $( '#parnt_analysis_notice .notice, #child_analysis_notice .notice' ).slideUp();
1410
- $( '#ctc_enqueue_enqueue' ).prop( 'checked', true );
1411
- $( '#ctc_handling_primary' ).prop( 'checked', true );
1412
- $( '#ctc_ignoreparnt' ).prop( 'checked', false );
1413
- $( '#ctc_repairheader' ).prop( 'checked', false );
1414
- },
1415
- // initialize object vars, bind event listeners to elements, load menus and start plugin
1416
- init: function() {
1417
- //console.log( 'initializing...' )
1418
- var self = this;
1419
- //self.jquery_exception( { 'message':'testing' }, 'Testing' );
1420
- // try to initialize theme menus
1421
- if ( !$( '#ctc_theme_parnt' ).is( 'input' ) ) {
1422
- //console.log( 'initializing theme select menus...' );
1423
- try {
1424
- $.widget( 'ctc.themeMenu', $.ui.selectmenu, {
1425
- _renderItem: function( ul, item ) {
1426
- var li = $( "<li>" ),
1427
- sel = item.value.replace( /[^\w\-]/, '' );
1428
- $( '#ctc_theme_option_' + sel )
1429
- .detach().appendTo( li );
1430
- return li.appendTo( ul );
1431
- }
1432
- } );
1433
- } catch( exn ) {
1434
- self.jquery_exception( exn, 'Theme Menu' );
1435
- }
1436
- try {
1437
- $( '#ctc_theme_parnt' ).themeMenu( {
1438
- select: function( event, ui ) {
1439
- self.reset_handling();
1440
- self.set_parent_menu( ui.item );
1441
- }
1442
- } );
1443
- } catch( exn ) {
1444
- if ( 'function' === typeof themeMenu ) {
1445
- $( '#ctc_theme_parnt' ).themeMenu( 'destroy' );
1446
- } else {
1447
- $( '#ctc_theme_parnt-button' ).remove();
1448
- }
1449
- self.jquery_exception( exn, 'Parent Theme Menu' );
1450
- }
1451
- if ( self.is_empty( window.ctcAjax.themes.child ) ) {
1452
- if ( $( '#ctc_child_name' ).length ) {
1453
- $( '#ctc_child_name' ).val( self.testname );
1454
- $( '#ctc_child_template' ).val( self.testslug );
1455
- }
1456
- } else {
1457
- try {
1458
- $( '#ctc_theme_child' ).themeMenu( {
1459
- select: function( event, ui ) {
1460
- self.reset_handling();
1461
- self.set_child_menu( ui.item );
1462
- }
1463
- } );
1464
- } catch( exn ) {
1465
- if ( 'function' === typeof themeMenu ) {
1466
- $( '#ctc_theme_child' ).themeMenu( 'destroy' );
1467
- } else {
1468
- $( '#ctc_theme_child-button' ).remove();
1469
- }
1470
- self.jquery_exception( exn, 'Child Theme Menu' );
1471
- }
1472
- }
1473
- }
1474
-
1475
- // auto populate parent/child tab values
1476
- self.currparnt = $( '#ctc_theme_parnt' ).val();
1477
- self.currchild = $( '#ctc_theme_child' ).length ? $( '#ctc_theme_child' ).val() : '';
1478
- $( '#ctc_main' ).on( 'click', '.ctc-section-toggle', function( e ) {
1479
- e.preventDefault();
1480
- $( this ).parents( '.ctc-input-row, .notice-warning, .updated, .error' ).first().find( '.ctc-section-toggle' )
1481
- .each( function() {
1482
- $( this ).toggleClass( 'open' );
1483
- } );
1484
- var id = $( this ).attr( 'id' ).replace(/\d$/, '') + '_content';
1485
- $( '#' + id ).stop().slideToggle( 'fast' );
1486
- return false;
1487
- } );
1488
-
1489
- $( '#ctc_main' ).on( 'click', '.ctc-upgrade-notice .notice-dismiss', function() { // e ) {
1490
- //console.log( 'dismiss upgrade clicked!' );
1491
- //e.preventDefault();
1492
- var postdata = {
1493
- 'action': 'ctc_dismiss',
1494
- '_wpnonce': $( '#_wpnonce' ).val()
1495
- };
1496
- self.ajax_post( 'dismiss', postdata );
1497
- } );
1498
-
1499
- if ( self.is_empty( self.jqueryerr ) ){
1500
- //console.log( 'delegating event bindings...' )
1501
- $( '#ctc_main' ).on( 'click', '.ctc-selector-handle', function( e ) {
1502
- //'.ctc-option-panel-container'
1503
- e.preventDefault();
1504
- if ( $( this ).hasClass( 'ajax-pending' ) ) {
1505
- return false;
1506
- }
1507
- $( this ).addClass( 'ajax-pending' );
1508
- //set_notice( '' );
1509
- var id = $( this ).attr( 'id' ).toString().replace( '_close', '' ),
1510
- parts = id.toString().match( /_([^_]+)_(\d+)$/ ),
1511
- rule,
1512
- valid;
1513
- if ( $( '#' + id + '_container' ).is( ':hidden' ) ) {
1514
- if ( !self.is_empty( parts[ 1 ] ) && !self.is_empty( parts[ 2 ] ) ) {
1515
- rule = parts[ 1 ];
1516
- valid = parts[ 2 ];
1517
- // retrieve selectors / values for individual value
1518
- self.query_css( 'val_qry', valid, { 'rule': rule } );
1519
- }
1520
- }
1521
- $( '#' + id + '_container' ).fadeToggle( 'fast' );
1522
- $( '.ctc-selector-container' ).not( '#' + id + '_container' ).fadeOut( 'fast' );
1523
- } );
1524
-
1525
- $( '#ctc_main' ).on( 'click', '.ctc-save-input[type=button], .ctc-delete-input', function( e ) {
1526
- e.preventDefault();
1527
- if ( $( this ).hasClass( 'ajax-pending' ) ) {
1528
- return false;
1529
- }
1530
- $( this ).addClass( 'ajax-pending' );
1531
- self.save( this ); // refresh menus after updating data
1532
- return false;
1533
- } );
1534
-
1535
- $( '#ctc_main' ).on( 'keydown', '.ctc-selector-container .ctc-child-value[type=text]', function( e ) {
1536
- if ( 13 === e.which ) {
1537
- //console.log( 'return key pressed' );
1538
- var $obj = $( this ).parents( '.ctc-selector-row' ).find( '.ctc-save-input[type=button]' ).first();
1539
- if ( $obj.length ) {
1540
- e.preventDefault();
1541
- //console.log( $obj.attr( 'id' ) );
1542
- if ( $obj.hasClass( 'ajax-pending' ) ) {
1543
- return false;
1544
- }
1545
- $obj.addClass( 'ajax-pending' );
1546
- self.save( $obj );
1547
- return false;
1548
- }
1549
- }
1550
- } );
1551
-
1552
- $( '#ctc_main' ).on( 'click', '.ctc-selector-edit', function( e ) {
1553
- e.preventDefault();
1554
- if ( $( this ).hasClass( 'ajax-pending' ) ) {
1555
- return false;
1556
- }
1557
- $( this ).addClass( 'ajax-pending' );
1558
- self.set_qsid( this );
1559
- } );
1560
-
1561
- $( '#ctc_main' ).on( 'click', '.ctc-rewrite-toggle', function( e ) {
1562
- e.preventDefault();
1563
- self.selector_input_toggle( this );
1564
- } );
1565
-
1566
- $( '#ctc_main' ).on( 'click', '#ctc_copy_selector', function( ) {
1567
- var txt = $( '#ctc_sel_ovrd_selector_selected' ).text().trim();
1568
- if ( !self.is_empty( txt ) ){
1569
- $( '#ctc_new_selectors' ).val( $( '#ctc_new_selectors' ).val() + "\n" + txt + " {\n\n}" );
1570
- }
1571
- } );
1572
- // save theme as zip
1573
- $( '#ctc_main' ).on( 'click', '.ctc-backup-theme', function( e ) {
1574
- e.preventDefault();
1575
- // copy selected theme to zip export form
1576
- if ( self.existing ){
1577
- $( '#ctc_export_theme' ).val( self.currchild );
1578
- } else {
1579
- $( '#ctc_export_theme' ).val( self.currparnt );
1580
- }
1581
- //console.log( 'backup clicked - theme: ' + $( '#ctc_export_theme' ).val() );
1582
- // submit form
1583
- $( '#ctc_export_theme_form' ).submit();
1584
- // submit form
1585
- } );
1586
- $( '#ctc_configtype' ).on( 'change', function( ) {
1587
- var val = $( this ).val();
1588
- if ( self.is_empty( val ) || 'theme' === val ) {
1589
- $( '.ctc-theme-only, .ctc-themeonly-container' ).removeClass( 'ctc-disabled' );
1590
- $( '.ctc-theme-only, .ctc-themeonly-container input' ).prop( 'disabled', false );
1591
- try {
1592
- $( '#ctc_theme_parnt, #ctc_theme_child' ).themeMenu( 'enable' );
1593
- } catch ( exn ) {
1594
- self.jquery_exception( exn, 'Theme Menu' );
1595
- }
1596
- } else {
1597
- $( '.ctc-theme-only, .ctc-themeonly-container' ).addClass( 'ctc-disabled' );
1598
- $( '.ctc-theme-only, .ctc-themeonly-container input' ).prop( 'disabled', true );
1599
- try {
1600
- $( '#ctc_theme_parnt, #ctc_theme_child' ).themeMenu( 'disable' );
1601
- } catch ( exn ) {
1602
- self.jquery_exception( exn, 'Theme Menu' );
1603
- }
1604
- }
1605
- } );
1606
-
1607
- // these elements are not replaced so use direct selector events
1608
- $( '.nav-tab' ).on( 'click', function( e ) {
1609
- e.preventDefault();
1610
- // clear the notice box
1611
- //set_notice( '' );
1612
- $( '.ctc-query-icon,.ctc-status-icon' ).remove();
1613
- var id = '#' + $( this ).attr( 'id' );
1614
- self.focus_panel( id );
1615
- } );
1616
-
1617
- $( '#view_child_options, #view_parnt_options' ).on( 'click', function( ){
1618
- if ( $( this ).hasClass( 'ajax-pending' ) ) {
1619
- return false;
1620
- }
1621
- $( this ).addClass( 'ajax-pending' );
1622
- self.css_preview( $( this ).attr( 'id' ) );
1623
- } );
1624
-
1625
- $( '#ctc_load_form' ).on( 'submit', function() {
1626
- return ( self.validate() );
1627
- } );
1628
-
1629
- $( '#ctc_query_selector_form' ).on( 'submit', function( e ) {
1630
- e.preventDefault();
1631
- var $this = $( '#ctc_save_query_selector' );
1632
- if ( $this.hasClass( 'ajax-pending' ) ) {
1633
- return false;
1634
- }
1635
- $this.addClass( 'ajax-pending' );
1636
- self.save( $this ); // refresh menus after updating data
1637
- return false;
1638
- } );
1639
-
1640
- $( '#ctc_rule_value_form' ).on( 'submit', function( e ) {
1641
- //console.log( 'rule value empty submit' );
1642
- e.preventDefault();
1643
- return false;
1644
- } );
1645
-
1646
- // update interface for existing child theme
1647
- $( '#ctc_child_type_new,#ctc_child_type_existing,#ctc_child_type_duplicate,#ctc_child_type_reset' )
1648
- .on( 'focus click', function() {
1649
- //console.log( 'child type clicked!' );
1650
- self.reset_handling();
1651
- self.update_form();
1652
- } );
1653
-
1654
- $( '#ctc_is_debug' ).on( 'change', function( ) {
1655
- if ( $( this ).is( ':checked' ) ){
1656
- if ( !$( '#ctc_debug_box' ).length ){
1657
- $( '#ctc_debug_container' ).html( '<textarea id="ctc_debug_box"></textarea>' );
1658
- }
1659
- } else {
1660
- $( '#ctc_debug_box' ).remove();
1661
- }
1662
- self.save( this );
1663
- } );
1664
-
1665
- $( '.ctc-live-preview' ).on( 'click', function( e ) {
1666
- e.stopImmediatePropagation();
1667
- e.preventDefault();
1668
- document.location = $( this ).prop( 'href' );
1669
- return false;
1670
- } );
1671
- //console.log( 'loading autoselect menus...' )
1672
- // initialize autoselect menus
1673
- self.setup_menus();
1674
-
1675
- // turn on submit buttons (disabled until everything is loaded to prevent errors)
1676
- //console.log( 'releasing submit buttons...' )
1677
- $( 'input[type=submit], input[type=button]' ).prop( 'disabled', false );
1678
- self.scrolltop();
1679
- self.update_form();
1680
- //console.log( 'Ready.' );
1681
- }
1682
- if ( self.jqueryerr.length ) {
1683
- self.jquery_notice();
1684
- }
1685
- },
1686
- // object properties
1687
- testslug: '',
1688
- testname: '',
1689
- reload: false,
1690
- currquery: 'base',
1691
- currqsid: null,
1692
- currdata: {},
1693
- currparnt: '',
1694
- currchild: '',
1695
- existing: false,
1696
- jqueryerr: [], // stores jquery exceptions thrown during init
1697
- color_regx: '\\s+(\\#[a-f0-9]{3,6}|rgba?\\([\\d., ]+?\\)|hsla?\\([\\d%., ]+?\\)|[a-z]+)',
1698
- border_regx: '(\\w+)(\\s+(\\w+))?',
1699
- grad_regx: '(\\w+)'
1700
-
1701
- };
1702
- $.chldthmanalyze = {
1703
- escrgx: function( str ) {
1704
- return str.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
1705
- },
1706
-
1707
- trmcss: function( str ) {
1708
- //console.log( 'trmcss: ' + str );
1709
- return 'undefined' === typeof str ? '' : str.replace( /\-css$/, '' );
1710
- },
1711
- show_loading: function( resubmit, text ) {
1712
- var template = $.chldthmcfg.existing ? 'child' : 'parnt',
1713
- name = text ? text : $.chldthmcfg.getname( template ),
1714
- notice = '<strong class="ctc_analyze_loading"><span class="spinner is-active"></span>' +
1715
- $.chldthmcfg.getxt( resubmit ? 'anlz1' : 'anlz2' ) + ' ' + name + '...</strong>';
1716
- self.noticediv = ( 'child' === template ? '' : '' );
1717
- $( '#' + template + '_analysis_notice' ).html( notice );
1718
- //$( 'html, body' ).animate( { scrollTop: 0 }, 'slow' );
1719
- },
1720
- hide_loading: function() {
1721
- $( '.ctc_analyze_loading' ).fadeTo( 200, 0, function(){ $( this ).slideUp( 200, function() { $( this ).remove(); } ); } );
1722
- },
1723
- setssl: function( url ){
1724
- return url.replace( /^https?/, window.ctcAjax.ssl ? 'https' : 'http' );
1725
- },
1726
- /**
1727
- * Fetch website home page and parse <head> for linked stylesheets
1728
- * Use this to store dependencies and to mark them to be parsed as "default" stylesheets
1729
- * Detects other signals for configuration heuristics during child theme setup.
1730
- */
1731
- analyze_theme: function( template ) {
1732
- //console.log( 'analyze_theme' );
1733
- var self = this,
1734
- now = Math.floor( $.now() / 1000 ),
1735
- //template = $.chldthmcfg.existing ? 'child' : 'parnt',
1736
- stylesheet = ( 'child' === template ? $.chldthmcfg.currchild : $.chldthmcfg.currparnt ),
1737
- testparams = '&template=' + $.chldthmcfg.currparnt + '&stylesheet=' + stylesheet + '&now=' + now,
1738
- homeurl = self.setssl( window.ctcAjax.homeurl ),
1739
- themepath = window.ctcAjax.theme_uri.replace( /^https?:\/\//, '' ),
1740
- url = homeurl + testparams,
1741
- escaped = self.escrgx( $.chldthmcfg.currparnt ) + ( 'child' === template ? '|' + self.escrgx( stylesheet ) : '' ),
1742
- regex_link = new RegExp( "<link( rel=[\"']stylesheet[\"'] id=['\"]([^'\"]+?)['\"])?[^>]+?" +
1743
- self.escrgx( themepath ) + '/(' + escaped + ')/([^"\']+\\.css)(\\?[^"\']+)?["\'][^>]+>', 'gi' ),
1744
- regex_err = /<br \/>\n[^\n]+?(fatal|strict|notice|warning|error)[\s\S]+?<br \/>/gi,
1745
- msg,
1746
- queue,
1747
- csslink,
1748
- themeloaded = 0, // flag when style.css link is detected
1749
- testloaded = 0, // flag when test link is detected
1750
- analysis = {
1751
- url: url,
1752
- deps: [[],[]],
1753
- signals: {
1754
- /*
1755
- err_fatal: 0,
1756
- err_fnf: 0,
1757
- err_other: 0,
1758
- ctc_sep_loaded: 0,
1759
- ctc_ext_loaded: 0,
1760
- ctc_child_loaded: 0,
1761
- ctc_parnt_loaded: 0,
1762
- thm_wrong_order: 0,
1763
- thm_past_wphead: 0,
1764
- thm_unregistered: 0,
1765
- thm_parnt_loaded: 0,
1766
- thm_child_loaded: 0,
1767
- thm_is_ctc: 0,
1768
- thm_no_styles: 0,
1769
- thm_notheme: 0
1770
- */
1771
- },
1772
- queue: [],
1773
- irreg: []
1774
- };
1775
-
1776
- //console.log( 'Fetching home page: ' + url );
1777
- $.get( url, function( data ) {
1778
- //data = '';
1779
- if ( 'child' === template ) {
1780
- //console.log( data );
1781
- }
1782
- // retrieve enqueued stylesheet ids
1783
- if ( ( queue = data.match( /BEGIN WP QUEUE\n([\s\S]*?)\nEND WP QUEUE/ ) ) ) {
1784
- analysis.queue = queue[ 1 ].split(/\n/);
1785
- //console.log( 'QUEUE:' );
1786
- //console.log( analysis.queue );
1787
- } else {
1788
- analysis.queue = [];
1789
- analysis.signals.thm_noqueue = 1;
1790
- //analysis.signals.failure = 1;
1791
- //console.log( 'NO QUEUE' );
1792
- }
1793
- if ( ( queue = data.match( /BEGIN CTC IRREGULAR\n([\s\S]*?)\nEND CTC IRREGULAR/ ) ) ) {
1794
- analysis.irreg = queue[ 1 ].split(/\n/);
1795
- } else {
1796
- analysis.irreg = [];
1797
- }
1798
- if ( data.match( /CHLD_THM_CFG_IGNORE_PARENT/ ) ) {
1799
- analysis.signals.thm_ignoreparnt = 1;
1800
- //console.log( 'thm_ignoreparnt' );
1801
- }
1802
- if ( data.match( /IS_CTC_THEME/ ) ) {
1803
- analysis.signals.thm_is_ctc = 1;
1804
- //console.log( 'thm_is_ctc' );
1805
- }
1806
-
1807
- if ( data.match( /NO_CTC_STYLES/ ) ) {
1808
- analysis.signals.thm_no_styles = 1;
1809
- //console.log( 'thm_no_styles' );
1810
- }
1811
- if ( data.match( /HAS_CTC_IMPORT/ ) ) {
1812
- analysis.signals.thm_has_import = 1;
1813
- //console.log( 'thm_has_import' );
1814
- }
1815
-
1816
- // remove comments to avoid flagging conditional stylesheets ( IE compatability, etc. )
1817
- data = data.replace( /<!\-\-[\s\S]*?\-\->/g, '' );
1818
- //console.log( 'PARSE:' );
1819
- while ( ( msg = regex_err.exec( data ) ) ) {
1820
- var errstr = msg[ 0 ].replace( /<.*?>/g, '' );
1821
- self.phperr[ template ].push( errstr );
1822
- analysis.signals.err_php = 1;
1823
- if ( errstr.match( /Fatal error/i ) ) {
1824
- analysis.signals.err_fatal = 1;
1825
- }
1826
- //else if ( errstr.match( /(FileNotFoundException|Failed opening|failed to open stream)/i ) ) {
1827
- //analysis.signals.err_fnf = 1;
1828
- //}
1829
- }
1830
- while ( ( csslink = regex_link.exec( data ) ) ) {
1831
- var stylesheetid = self.trmcss( csslink[ 2 ] ),
1832
- stylesheettheme = csslink[ 3 ],
1833
- stylesheetpath = csslink[ 4 ],
1834
- linktheme = $.chldthmcfg.currparnt === stylesheettheme ? 'parnt' : 'child',
1835
- noid = 0;
1836
- //console.log( 'stylesheetid: ' + stylesheetid + ' stylesheetpath: ' + stylesheetpath );
1837
- // flag stylesheet links that have no id or are not in wp_styles
1838
- if ( '' === stylesheetid || -1 === $.inArray( stylesheetid, analysis.queue ) ) {
1839
- noid = 1;
1840
- //console.log( 'no id for ' + stylesheetpath + '!' );
1841
- } else if ( 0 === stylesheetid.indexOf( 'chld_thm_cfg' ) ) { // handle ctc-generated links
1842
- // console.log( 'ctc link detected: ' + stylesheetid + ' themeloaded: ' + themeloaded );
1843
- if ( stylesheetpath.match( /^ctc\-style([\-\.]min)?\.css$/ ) ) {
1844
- //console.log( 'separate stylesheet detected' );
1845
- themeloaded = 1;
1846
- analysis.signals.ctc_sep_loaded = 1; // flag that separate stylesheet has been detected
1847
- } else if ( stylesheetpath.match( /^ctc\-genesis([\-\.]min)?\.css$/ ) ) {
1848
- //console.log( 'genesis stylesheet detected' );
1849
- themeloaded = 1;
1850
- analysis.signals.ctc_gen_loaded = 1; // flag that genesis "parent" has been detected
1851
- } else if ( stylesheetid.match( /$chld_thm_cfg_ext/ ) ) {
1852
- analysis.signals.ctc_ext_loaded = 1; // flag that external stylesheet link detected
1853
- analysis.deps[ themeloaded ].push( [ stylesheetid, stylesheetpath ] );
1854
- } else if ( 'chld_thm_cfg_child' === stylesheetid ) {
1855
- analysis.signals.ctc_child_loaded = 1; // flag that ctc child stylesheet link detected
1856
- analysis.deps[ themeloaded ].push( [ stylesheetid, stylesheetpath ] );
1857
- } else if ( 'chld_thm_cfg_parent' === stylesheetid ) {
1858
- analysis.signals.ctc_parnt_loaded = 1; // flag that ctc parent stylesheet link detected
1859
- analysis.deps[ themeloaded ].push( [ stylesheetid, stylesheetpath ] );
1860
- if ( themeloaded ){
1861
- //console.log( 'parent link out of sequence' );
1862
- analysis.signals.ctc_parnt_reorder = 1; // flag that ctc parent stylesheet link out of order
1863
- }
1864
- }
1865
- continue;
1866
- }
1867
- // flag main theme stylesheet link
1868
- if ( stylesheetpath.match( /^style([\-\.]min)?\.css$/ ) ) {
1869
- //console.log( linktheme + ' theme stylesheet detected: ' + stylesheettheme + '/' + stylesheetpath );
1870
- themeloaded = 1; // flag that main theme stylesheet has been detected
1871
- // if main theme stylesheet link has no id then it is unregistered ( hard-wired )
1872
- if ( 'parnt' === linktheme ) {
1873
- if ( noid ) {
1874
- analysis.signals.thm_parnt_loaded = 'thm_unregistered';
1875
- } else {
1876
- analysis.signals.thm_parnt_loaded = stylesheetid;
1877
- // check that parent stylesheet is loaded before child stylesheet
1878
- if ( 'child' === template && analysis.signals.thm_child_loaded ) {
1879
- analysis.signals.ctc_parnt_reorder = 1;
1880
- }
1881
- }
1882
- } else {
1883
- analysis.signals.thm_child_loaded = noid ? 'thm_unregistered' : stylesheetid;
1884
- }
1885
- if ( noid ) {
1886
- if ( testloaded ) {
1887
- analysis.signals.thm_past_wphead = 1;
1888
- analysis.deps[ themeloaded ].push( [ 'thm_past_wphead', stylesheetpath ] );
1889
- //console.log( 'Unreachable theme stylesheet detected' );
1890
- } else {
1891
- analysis.signals.thm_unregistered = 1;
1892
- analysis.deps[ themeloaded ].push( [ 'thm_unregistered', stylesheetpath ] );
1893
- //console.log( 'Unregistered theme stylesheet detected' );
1894
- }
1895
- } else {
1896
- analysis.deps[ themeloaded ].push( [ stylesheetid, stylesheetpath ] );
1897
- //console.log( 'Theme stylesheet OK!' );
1898
- }
1899
-
1900
- } else if ( 'ctc-test.css' === stylesheetpath ) { // flag test stylesheet link
1901
- //console.log( 'end of queue reached' );
1902
- testloaded = 1; // flag that test queue has been detected ( end of wp_head )
1903
- } else {
1904
- var err = null;
1905
- // if stylesheet link has id and loads before main theme stylesheet, add it as a dependency
1906
- // otherwise add it as a parse option
1907
- if ( noid ) {
1908
- err = 'dep_unregistered';
1909
- }
1910
- if ( testloaded ) {
1911
- if ( themeloaded ) {
1912
- //console.log( 'Unreachable stylesheet detected!' + stylesheetpath );
1913
- err = 'css_past_wphead';
1914
- } else {
1915
- err = 'dep_past_wphead';
1916
- }
1917
- }
1918
- // Flag stylesheet links that have no id and are loaded after main theme stylesheet.
1919
- // This indicates loading outside of wp_head()
1920
- if ( err ) {
1921
- analysis.signals[ err ] = 1;
1922
- stylesheetid = err;
1923
- }
1924
- analysis.deps[ themeloaded ].push( [ stylesheetid, stylesheetpath ] );
1925
- }
1926
- }
1927
- if ( ! themeloaded ){
1928
- analysis.signals.thm_notheme = 1; // flag that no theme stylesheet has been detected
1929
- }
1930
- data = null; // send page to garbage
1931
- self.analysis[ template ] = analysis;
1932
- $( document ).trigger( 'analysisdone' );
1933
- } ).fail( function( xhr, status, err ){
1934
- //console.log( xhr );
1935
- analysis.signals.failure = 1;
1936
- analysis.signals.xhrerr = err;
1937
- self.analysis[ template ] = analysis;
1938
- $( document ).trigger( 'analysisdone' );
1939
- } );
1940
- },
1941
-
1942
- /**
1943
- * Uses analysis data to auto configure form, pass parameters
1944
- * for child theme setup and display results to user.
1945
- */
1946
- css_notice: function() {
1947
- //console.log( 'in css_notice' );
1948
- var self = this,
1949
- template = $.chldthmcfg.existing ? 'child' : 'parnt',
1950
- name = $.chldthmcfg.getname( template ),
1951
- hidden = '',
1952
- notice = {
1953
- notices: [],
1954
- },
1955
- errnotice = {
1956
- style: 'notice-warning',
1957
- headline: $.chldthmcfg.getxt( 'anlz3', name ),
1958
- errlist: ''
1959
- },
1960
- resubmit = 0,
1961
- resubmitdata= {},
1962
- anlz,
1963
- debugtxt = '';
1964
-
1965
- if ( self.analysis[ template ].signals.failure ||
1966
- ( self.analysis[ template ].signals.thm_noqueue && !self.phperr[ template ].length ) ) {
1967
- if ( $( '#ctc_is_debug' ).is( ':checked' ) ) {
1968
- debugtxt = $.chldthmcfg.getxt( 'anlz33' ).replace(/%1/, '<a href="' + self.analysis[ template ].url + '" target="_new">' ).replace( /%2/, '</a>' );
1969
- }
1970
- notice.notices.push( {
1971
- headline: $.chldthmcfg.getxt( 'anlz4', name ),
1972
- msg: $.chldthmcfg.getxt( 'anlz5' ) + debugtxt, // + self.analysis[ template ].signals.xhrerr,
1973
- style: 'notice-warning'
1974
- } );
1975
- } else {
1976
- // test errors
1977
- if ( self.phperr[ template ].length ) {
1978
- $.each( self.phperr[ template ], function( index, err ) {
1979
- if ( err.match( /Fatal error/i ) ) {
1980
- errnotice.style = 'error';
1981
- errnotice.headline = $.chldthmcfg.getxt( 'anlz8', name );
1982
- }
1983
- /*
1984
- if ( $.chldthmcfg.existing && err.match( /(FileNotFoundException|Failed opening|failed to open stream)/i ) ) {
1985
- //console.log( 'Probably using get_stylesheet_directory()' );
1986
- notice.subhead = 'A file cannot be found in the Child Theme\'s directory.';
1987
- }
1988
- */
1989
- errnotice.errlist += err + "\n";
1990
- } );
1991
- errnotice.msg = '<div style="background-color:#ffeebb;padding:6px">' +
1992
- '<div class="ctc-section-toggle" id="ctc_analysis_errs">' +
1993
- $.chldthmcfg.getxt( 'anlz6' ) + '</div>' +
1994
- '<div id="ctc_analysis_errs_content" style="display:none"><textarea>' +
1995
- errnotice.errlist + '</textarea></div></div>' +
1996
- $.chldthmcfg.getxt( 'anlz7' );
1997
- notice.notices.push( errnotice );
1998
- }
1999
- if ( self.analysis[ template ].signals.thm_past_wphead || self.analysis[ template ].signals.dep_past_wphead ) {
2000
- // || self.analysis[ template ].signals.css_past_wphead ){
2001
- notice.notices.push( {
2002
- headline: $.chldthmcfg.getxt( 'anlz9' ),
2003
- style: 'notice-warning',
2004
- msg: $.chldthmcfg.getxt( 'anlz10' )
2005
- } );
2006
- $( '#ctc_repairheader' ).prop( 'checked', true );
2007
- $( '#ctc_repairheader_container' ).show();
2008
- }
2009
- if ( self.analysis[ template ].signals.thm_unregistered ) {
2010
- if (
2011
- !self.analysis[ template ].signals.ctc_child_loaded &&
2012
- !self.analysis[ template ].signals.ctc_sep_loaded ){
2013
- // test for stylesheet enqueue issues
2014
- notice.notices.push( {
2015
- headline: $.chldthmcfg.getxt( 'anlz11' ),
2016
- style: 'notice-warning',
2017
- msg: $.chldthmcfg.getxt( 'anlz12' )
2018
- } );
2019
- $( '#ctc_repairheader_container' ).show();
2020
- $( '#ctc_repairheader' ).prop( 'checked', true );
2021
- }
2022
- }
2023
- if ( 'child' === template ) {
2024
- if ( self.analysis.child.signals.ctc_parnt_reorder ) {
2025
- //console.log( 'reorder flag detected, resubmitting.' );
2026
- resubmit = 1;
2027
- }
2028
- if ( !self.analysis.child.signals.ctc_child_loaded &&
2029
- !self.analysis.child.signals.ctc_sep_loaded &&
2030
- !self.analysis.child.signals.thm_child_loaded ){
2031
- notice.notices.push( {
2032
- headline: $.chldthmcfg.getxt( 'anlz13' ),
2033
- style: 'notice-warning',
2034
- msg: $.chldthmcfg.getxt( 'anlz14' )
2035
- } );
2036
- resubmit = 1;
2037
- }
2038
- if ( self.analysis[ template ].signals.ctc_gen_loaded ) {
2039
- notice.notices.push( {
2040
- headline: $.chldthmcfg.getxt( 'anlz31' ),
2041
- msg: $.chldthmcfg.getxt( 'anlz32' ),
2042
- style: 'notice-warning'
2043
- } );
2044
- }
2045
- if ( !self.analysis.parnt.signals.thm_no_styles &&
2046
- !self.analysis.child.signals.ctc_gen_loaded &&
2047
- !self.analysis.child.signals.thm_parnt_loaded &&
2048
- !self.analysis.child.signals.ctc_parnt_loaded &&
2049
- !self.analysis.child.signals.thm_ignoreparnt &&
2050
- !self.analysis.child.signals.thm_has_import ){
2051
- notice.notices.push( {
2052
- headline: $.chldthmcfg.getxt( 'anlz15' ),
2053
- style: 'notice-warning',
2054
- msg: $.chldthmcfg.getxt( 'anlz16' )
2055
- } );
2056
- resubmit = 1;
2057
- }
2058
- if ( self.analysis.child.signals.thm_unregistered &&
2059
- self.analysis.child.signals.thm_child_loaded &&
2060
- 'thm_unregistered' === self.analysis.child.signals.thm_child_loaded &&
2061
- self.analysis.child.signals.ctc_child_loaded &&
2062
- self.analysis.child.signals.ctc_parnt_loaded ) {
2063
- notice.notices.push( {
2064
- headline: $.chldthmcfg.getxt( 'anlz28' ),
2065
- style: 'notice-warning',
2066
- msg: $.chldthmcfg.getxt( 'anlz29' )
2067
- } );
2068
- $( '#ctc_repairheader_container' ).show();
2069
- $( '#ctc_repairheader' ).prop( 'checked', true );
2070
- }
2071
-
2072
- if ( !self.analysis.child.signals.thm_is_ctc &&
2073
- !$( '#ctc_child_type_duplicate' ).is( ':checked' ) ) {
2074
- notice.notices.push( {
2075
- headline: $.chldthmcfg.getxt( 'anlz19' ),
2076
- msg: $.chldthmcfg.getxt( 'anlz20' ),
2077
- style: 'notice-warning'
2078
- } );
2079
- }
2080
- }
2081
- // automatically set form inputs based on current analysis
2082
- if ( self.analysis[ template ].signals.ctc_sep_loaded || self.analysis[ template ].signals.ctc_gen_loaded ){
2083
- //console.log( 'Separate stylesheet detected' );
2084
- $( '#ctc_handling_separate' ).prop( 'checked', true );
2085
- }
2086
- if ( !notice.notices.length ) {
2087
- notice.notices.push( {
2088
- headline: '' + ( 'child' === template ? $.chldthmcfg.getxt( 'anlz17' ) : $.chldthmcfg.getxt( 'anlz18' ) ) + '',
2089
- style: 'updated',
2090
- msg: ''
2091
- } );
2092
- }
2093
-
2094
- if ( 'child' === template && self.analysis.child.signals.thm_has_import ) {
2095
- notice.notices.push( {
2096
- headline: $.chldthmcfg.getxt( 'anlz21' ),
2097
- msg: $.chldthmcfg.getxt( 'anlz22' ),
2098
- style: 'notice-warning'
2099
- } );
2100
- //console.log( 'Import parent detected' );
2101
- $( '#ctc_enqueue_import' ).prop( 'checked', true );
2102
- }
2103
- if ( self.analysis[ template ].signals.thm_ignoreparnt || self.analysis[ template ].signals.ctc_gen_loaded ){
2104
- //console.log( 'Ignore parent detected' );
2105
- $( '#ctc_ignoreparnt' ).prop( 'checked', true );
2106
- if ( !$( '#ctc_enqueue_none' ).is( ':checked' ) ) {
2107
- $( '#ctc_enqueue_none' ).prop( 'checked', true );
2108
- resubmit = 1;
2109
- resubmitdata.ctc_enqueue = 'none';
2110
- }
2111
- } else {
2112
- $( '#ctc_ignoreparnt' ).prop( 'checked', false );
2113
- }
2114
- if ( self.analysis[ template ].signals.thm_keepdeps ){
2115
- $( '#ctc_keepdeps' ).prop( 'checked', true );
2116
- } else {
2117
- $( '#ctc_keepdeps' ).prop( 'checked', false );
2118
- }
2119
- if ( !self.analysis[ template ].signals.ctc_sep_loaded &&
2120
- !self.analysis[ template ].signals.ctc_gen_loaded &&
2121
- !self.analysis[ template ].signals.ctc_child_loaded &&
2122
- !self.analysis[ template ].signals.thm_unregistered &&
2123
- !self.analysis[ template ].signals.thm_past_wphead &&
2124
- self.analysis[ template ].deps[ 1 ].length ) {
2125
- var sheets = '';
2126
- $.each( self.analysis[ template ].deps[ 1 ], function( ndx, el ) {
2127
- if ( el[ 1 ].match( /^style([\-\.]min)?\.css$/ ) ) { return; }
2128
- sheets += '<li>' + el[ 1 ] + "</li>\n";
2129
- } );
2130
- if ( '' !== sheets ) {
2131
- sheets = "<ul class='howto' style='padding-left:1em'>\n" + sheets + "</ul>\n";
2132
- notice.notices.push( {
2133
- headline: $.chldthmcfg.getxt( 'anlz23' ),
2134
- msg: sheets + $.chldthmcfg.getxt( 'anlz24' ),
2135
- style: 'updated'
2136
- } );
2137
- }
2138
- }
2139
- if ( 'child' === template && self.analysis[ template ].signals.thm_parnt_loaded ) {
2140
- //if ( !$( '#ctc_enqueue_none' ).is( ':checked' ) ) {
2141
- notice.notices.push( {
2142
- headline: $.chldthmcfg.getxt( 'anlz25' ),
2143
- msg: $.chldthmcfg.getxt( 'anlz26' ),
2144
- style: 'updated'
2145
- } );
2146
- //}
2147
- $( '#ctc_enqueue_none' ).prop( 'checked', true );
2148
- resubmit = 1;
2149
- resubmitdata.ctc_enqueue = 'none';
2150
- }
2151
- // if no parent styles, no need to enqueue
2152
- if ( self.analysis.parnt.signals.thm_no_styles ) {
2153
- //if ( !$( '#ctc_enqueue_none' ).is( ':checked' ) ) {
2154
- notice.notices.push( {
2155
- headline: $.chldthmcfg.getxt( 'anlz27' ),
2156
- msg: $.chldthmcfg.getxt( 'anlz26' ),
2157
- style: 'updated'
2158
- } );
2159
- //}
2160
- $( '#ctc_enqueue_none' ).prop( 'checked', true );
2161
- resubmit = 1;
2162
- resubmitdata.ctc_enqueue = 'none';
2163
- }
2164
- }
2165
-
2166
- /**
2167
- * Auto-configure parameters
2168
- * Some configuration must be done based on theme-specific signals
2169
- * These are passed back as hidden inputs
2170
- */
2171
- // parent has styles
2172
- hidden = encodeURIComponent( JSON.stringify( self.analysis ) );
2173
-
2174
- $( 'input[name="ctc_analysis"]' ).val( hidden );
2175
- resubmitdata.ctc_analysis = hidden;
2176
- if ( self.is_success() && resubmit && !self.resubmitting ){
2177
- self.resubmitting = 1;
2178
- self.resubmit( resubmitdata );
2179
- return;
2180
- } else {
2181
- self.resubmitting = 0;
2182
- self.hide_loading();
2183
- $.each( notice.notices, function( ndx, notice ){
2184
- //console.log( notice );
2185
- var $out = $( '<div class="' + notice.style + ' notice is-dismissible dashicons-before" >' +
2186
- '<h4>' + notice.headline + '</h4>' +
2187
- notice.msg +
2188
- '</div>' );
2189
- $.chldthmcfg.bind_dismiss( $out );
2190
- $out.hide().appendTo( '#' + template + '_analysis_notice' ).slideDown();
2191
- } );
2192
-
2193
- if ( $( '#ctc_is_debug' ).is( ':checked' ) ) {
2194
- anlz = '<div style="background-color:#ddd;padding:6px">' +
2195
- '<div class="ctc-section-toggle" id="ctc_analysis_obj">' +
2196
- $.chldthmcfg.getxt( 'anlz30' ) +
2197
- '</div>' +
2198
- '<div id="ctc_analysis_obj_content" style="display:none">' +
2199
- '<textarea style="font-family:monospace;font-size:10px">' +
2200
- JSON.stringify( self.analysis, null, 2 ) +
2201
- '</textarea></div></div>';
2202
-
2203
- $( anlz ).appendTo( '#' + template + '_analysis_notice' );
2204
-
2205
- }
2206
-
2207
- if ( !$( '#ctc_child_type_reset' ).is( ':checked' ) ) {
2208
- $( '#input_row_stylesheet_handling_container,#input_row_parent_handling_container,#ctc_child_header_parameters,#ctc_configure_submit' ).slideDown( 'fast' );
2209
- if ( $( '#ctc_child_type_duplicate' ).is( ':checked' ) ) {
2210
- $( '#ctc_configure_submit .ctc-step' ).text( '8' );
2211
- $( '#ctc_copy_theme_mods' ).find( 'input' ).prop( 'checked', false );
2212
- } else {
2213
- $( '#ctc_configure_submit .ctc-step' ).text( '9' );
2214
- $( '#ctc_copy_theme_mods' ).slideDown( 'fast' );
2215
- }
2216
- if ( $( '#ctc_child_type_duplicate' ).is( ':checked' ) || $( '#ctc_child_type_new' ).is( ':checked' ) ) {
2217
- $( '#input_row_theme_slug' ).hide();
2218
- $( '#input_row_new_theme_slug' ).slideDown( 'fast' );
2219
- } else {
2220
- $( '#input_row_new_theme_slug' ).hide();
2221
- $( '#input_row_theme_slug' ).slideDown( 'fast' );
2222
- }
2223
- }
2224
-
2225
- //console.log( 'end css_notice' );
2226
- }
2227
-
2228
- },
2229
- resubmit: function( data ) {
2230
- var self = this;
2231
- self.hide_loading();
2232
- self.show_loading( true );
2233
- data.action = 'ctc_update';
2234
- data._wpnonce = $( '#_wpnonce' ).val();
2235
- //console.log( '=====>>> RESUBMIT CALLED! <<<=====' );
2236
- //console.log( data );
2237
- $.ajax( {
2238
- url: window.ctcAjax.ajaxurl,
2239
- data: data,
2240
- //dataType: 'json',
2241
- type: 'POST'
2242
- } ).done( function() { // response ) {
2243
- //console.log( 'resubmit done:' );
2244
- //console.log( response );
2245
- self.hide_loading();
2246
- self.do_analysis();
2247
- } ).fail( function() { // xhr, status, err ) {
2248
- //self.do_analysis();
2249
- self.hide_loading();
2250
- //console.log( status + ' ' + err );
2251
- // FIXME: handle failure
2252
- } );
2253
- },
2254
- do_analysis: function() {
2255
- var self = this;
2256
- self.analysis = { parnt: {}, child: {} };
2257
- self.phperr = { parnt: [], child: [] };
2258
- self.done = 0;
2259
- self.show_loading( false );
2260
- self.analyze_theme( 'parnt' );
2261
- if ( $.chldthmcfg.existing ) {
2262
- self.analyze_theme( 'child' );
2263
- }
2264
- //$( '#ctc_enqueue_enqueue' ).prop( 'checked', true );
2265
- //$( '#ctc_handling_primary' ).prop( 'checked', true );
2266
- //$( '#ctc_ignoreparent' ).prop( 'checked', false );
2267
- },
2268
- // initialize object vars, bind event listeners to elements, load menus and start plugin
2269
- init: function() {
2270
- //console.log( 'initializing...' )
2271
- var self = this;
2272
- // ajax request done
2273
- $( document ).on( 'analysisdone', function(){
2274
- self.done++;
2275
- //console.log( 'analysis came home ' + self.done );
2276
- //console.log( 'existing: ' + $.chldthmcfg.existing );
2277
- //console.log( 'parent: ' + $( '#ctc_theme_parnt' ).val() );
2278
- // all ajax requests done
2279
- if ( self.done > $.chldthmcfg.existing ){
2280
- //console.log( 'analysis complete!' );
2281
- self.done = 0;
2282
- self.css_notice();
2283
- }
2284
- } );
2285
- // run analyzer on demand
2286
- $( '#ctc_main' ).on( 'click', '.ctc-analyze-theme', function() {
2287
- if ( self.is_success() ) {
2288
- $.chldthmcfg.dismiss_notice( $( '.ctc-success-response' ).parent( '.notice' ) );
2289
- }
2290
- self.do_analysis();
2291
- } );
2292
- // if page is success response run the analyzer on load
2293
- if ( self.is_success() && !window.ctcAjax.pluginmode ) {
2294
- self.do_analysis();
2295
- }
2296
- },
2297
- analysis: {}, // analysis signals object
2298
- done: 0, // analysis semphore
2299
- resubmitting: 0, // resubmit semaphore
2300
- is_success: function(){
2301
- return $( '.ctc-success-response' ).length;
2302
- }
2303
- };
2304
- // don't initialize if this is FTP request
2305
- if (!$( '#request-filesystem-credentials-form' ).length ){
2306
- $.chldthmcfg.init();
2307
- $.chldthmanalyze.init();
2308
- }
2309
- } ( jQuery ) );
2310
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/chldthmcfg.min.js DELETED
@@ -1,2 +0,0 @@
1
- !function(e){"use strict";e.chldthmcfg={escquo:function(e){var t=this;return t.is_empty(e)?e:e.toString().replace(/"/g,"&quot;")},getxt:function(e,t){var c=window.ctcAjax[e+"_txt"];return c?(t&&(c=c.replace(/%s/,t)),c):""},getname:function(t){var c="child"===t?e.chldthmcfg.currchild:e.chldthmcfg.currparnt;return window.ctcAjax.themes[t][c].Name},frascii:function(e){var t=parseInt(e),c=String.fromCharCode(t);return c},toascii:function(e){var t=e.charCodeAt(0);return t},is_empty:function(e,t){if("undefined"==typeof e||!1===e||null===e||""===e)return!0;if("undefined"!=typeof t&&"0"===e||0===e)return!0;if(!0===e||"string"==typeof e||"number"==typeof e)return!1;if("object"==typeof e){for(var c in e)if(e.hasOwnProperty(c))return!1;return!0}return!1},theme_exists:function(t,c){var n=!1;return e.each(window.ctcAjax.themes,function(i,s){return e.each(s,function(e,s){return s=null,e.toLowerCase()!==t.toLowerCase()||"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):"",i=e("#ctc_theme_child").length?e("#ctc_theme_child").val().toString().replace(c):n,s=e("input[name=ctc_child_type]:checked").val(),a=[];return"new"===s&&(i=n),t.theme_exists(i,s)&&a.push(t.getxt("theme_exists").toString().replace(/%s/,i)),t.is_empty(i)&&a.push(t.getxt("inval_theme")),a.length?(t.set_notice({error:a}),!1):"reset"===s?!!confirm(t.getxt("load")):!0},autogen_slugs:function(){if(e("#ctc_theme_parnt").length){for(var t=this,c=e("#ctc_theme_parnt").val(),n=c+"-child",i=n,s=e.chldthmcfg.getname("parnt")+" Child",a="",l="",r="00";t.theme_exists(i,"new");)a=t.is_empty(a)?2:a+1,l=r.substring(0,r.length-a.toString().length)+a.toString(),i=n+l;t.testslug=i,t.testname=s+(l.length?" "+l:"")}},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(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.escquo(c)+'"/>'),e("#ctc_rewrite_selector").val(c),e(t).text(n.getxt("cancel")))},coalesce_inputs:function(t){var c=this,n=e(t).attr("id"),i=/^(ctc_(ovrd|\d+)_(parent|child)_([0-9a-z\-]+)_(\d+?)(_(\d+))?)(_\w+)?$/,s=e(t).parents(".ctc-selector-row, .ctc-parent-row").first(),a=s.find(".ctc-swatch").first(),l={parent:{},child:{}},r={parent:{origin:"",start:"",end:""},child:{origin:"",start:"",end:""}},o={child:!1,parent:!1},_={};return s.find(".ctc-parent-value, .ctc-child-value").each(function(){var t,s,a=e(this).attr("id"),d=a.toString().match(i),u=d[2],h=d[3],p="undefined"==typeof d[4]?"":d[4],m=d[7],g=d[5],f="undefined"==typeof d[7]?"":d[8],v="parent"===h?e(this).text().replace(/!$/,""):"seq"!==p&&"ctc_delete_query_selector"===n?"":e(this).val(),y="seq"===p?!1:"ctc_"+u+"_child_"+p+"_i_"+g+"_"+m;if("child"===h&&(c.is_empty(e(this).data("color"))||(v=c.color_text(e(this).data("color")),e(this).data("color",null)),_[a]=v,y&&(_[y]=e("#"+y).is(":checked")?1:0)),""!==v)if(c.is_empty(f))if(t=p.toString().match(/^border(\-(top|right|bottom|left))?$/)&&!v.match(/none/)){var w=new RegExp(c.border_regx+c.color_regx,"i");s=v.toString().match(w),c.is_empty(s)||(s.shift(),l[h][p+"-width"]=s.shift()||"",s.shift(),l[h][p+"-style"]=s.shift()||"",l[h][p+"-color"]=s.shift()||"")}else if("background-image"!==p||v.match(/none/))"seq"!==p&&(l[h][p]=v);else if(v.toString().match(/url\(/))l[h]["background-image"]=c.image_url(h,v);else{var x=new RegExp(c.grad_regx+c.color_regx+c.color_regx,"i");s=v.toString().match(x),!c.is_empty(s)&&s.length>2?(s.shift(),r[h].origin=s.shift()||"top",r[h].start=s.shift()||"transparent",r[h].end=s.shift()||"transparent",o[h]=!0):l[h]["background-image"]=v}else switch(f){case"_border_width":l[h][p+"-width"]="none"===v?0:v;break;case"_border_style":l[h][p+"-style"]=v;break;case"_border_color":l[h][p+"-color"]=v;break;case"_background_url":l[h]["background-image"]=c.image_url(h,v);break;case"_background_color":l[h]["background-color"]=v;break;case"_background_color1":r[h].start=v,o[h]=!0;break;case"_background_color2":r[h].end=v,o[h]=!0;break;case"_background_origin":r[h].origin=v,o[h]=!0}}),"undefined"==typeof a||c.is_empty(a.attr("id"))||(a.removeAttr("style"),o.parent&&a.ctcgrad(r.parent.origin,[r.parent.start,r.parent.end]),a.css(l.parent),a.attr("id").toString().match(/parent/)||(o.child&&a.ctcgrad(r.child.origin,[r.child.start,r.child.end]),a.css(l.child)),a.css({"z-index":-1})),_},decode_value:function(e,t){t="undefined"==typeof t?"":t;var c,n=this,i={orig:t,names:[""],values:[t]};if(e.toString().match(/^border(\-(top|right|bottom|left))?$/)){var s,a=new RegExp(n.border_regx+"("+n.color_regx+")?","i");c=t.toString().match(a),n.is_empty(c)&&(c=[]),i.names=["_border_width","_border_style","_border_color"],s=c.shift(),i.values[0]=c.shift()||"",c.shift(),i.values[1]=c.shift()||"",c.shift(),i.values[2]=c.shift()||""}else if(e.toString().match(/^background\-image/))if(i.names=["_background_url","_background_origin","_background_color1","_background_color2"],i.values=["","","",""],n.is_empty(t)||t.toString().match(/(url|none)/))i.values[0]=t;else{var l,r;c=t.toString().split(/:/),i.values[1]=c.shift()||"",i.values[2]=c.shift()||"",l=c.shift()||"",i.values[3]=c.shift()||"",r=c.shift()||"",i.orig=[i.values[1],i.values[2],i.values[3]].join(" ")}return i},image_url:function(e,t){var c,n=this,i=t.toString().match(/url\(['" ]*(.+?)['" ]*\)/),s=n.is_empty(i)?null:i[1],a=window.ctcAjax.theme_uri+"/"+("parent"===e?window.ctcAjax.parnt:window.ctcAjax.child)+"/";return s?c=s.toString().match(/^(data:|https?:|\/)/)?t:"url("+a+s+")":!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.currquery)},load_queries:function(){var e=this;e.query_css("queries",null)},load_selectors:function(){var e=this;e.query_css("selectors",e.currquery)},load_rules:function(){var e=this;e.query_css("rules",null)},load_selector_values:function(){var e=this;e.query_css("qsid",e.currqsid)},get_queries:function(t,c){var n=[],i=new RegExp(e.ui.autocomplete.escapeRegex(t.term),"i");e.chldthmcfg.is_empty(this.element.data("menu"))?n.push({label:window.ctcAjax.nosels_txt,value:null}):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.chldthmcfg.is_empty(this.element.data("menu"))?n.push({label:window.ctcAjax.nosels_txt,value:null}):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.chldthmcfg.is_empty(this.element.data("menu"))?n.push({label:window.ctcAjax.nosels_txt,value:null}):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");e.each(e("#ctc_rule_menu").data("menu"),function(e,t){i.test(e)&&n.push({label:e,value:t})}),c(n)},merge_ruleval_arrays:function(t,c,n){var i=this,s={},a=n?c.child.pop():null;return e.each(["parnt","child"],function(t,l){i.is_empty(c[l])||e.each(c[l],function(e,t){n?parseInt(t[2])>=parseInt(a[2])&&(a[2]=parseInt(t[2])+1):(i.is_empty(s[t[2]])&&(s[t[2]]={}),s[t[2]][l]=t)})}),n&&(s[a[2]]={parnt:[],child:a}),s},input_row:function(t,c,n,i,s){var a=this,l="";if(!a.is_empty(i)&&!a.is_empty(i.value)&&!a.is_empty(i.value[c])){var r=i.value[c],o=a.merge_ruleval_arrays(c,r,s);e.each(o,function(s,r){var o=a.decode_value(c,a.is_empty(r.parnt)?"":r.parnt[0]),_=a.is_empty(r.parnt)||a.is_empty(r.parnt[1],1)?0:1,d=a.decode_value(c,a.is_empty(r.child)?"":r.child[0]),u=a.is_empty(r.child)||a.is_empty(r.child[1],1)?0:1;if(l+='<div class="ctc-'+("ovrd"===n?"input":"selector")+'-row clearfix"><div class="ctc-input-cell">',l+="ovrd"===n?c.replace(/\d+/g,a.frascii):i.selector+'<br/><a href="#" class="ctc-selector-edit" id="ctc_selector_edit_'+t+'" >'+a.getxt("edit")+"</a> "+(a.is_empty(o.orig)?a.getxt("child_only"):""),l+='</div><div class="ctc-parent-value ctc-input-cell"'+("ovrd"!==n?' style="display:none"':"")+' id="ctc_'+n+"_parent_"+c+"_"+t+"_"+s+'">'+(a.is_empty(o.orig)?"[no value]":o.orig+(_?a.getxt("important"):""))+'</div><div class="ctc-input-cell">',!a.is_empty(o.names)){e.each(o.names,function(e,i){i=a.is_empty(i)?"":i,l+='<div class="ctc-child-input-cell clear">';var r,o="ctc_"+n+"_child_"+c+"_"+t+"_"+s+i;!1===(r=d.values.shift())&&(r=""),l+=(a.is_empty(i)?"":a.getxt(i)+":<br/>")+'<input type="text" id="'+o+'" name="'+o+'" class="ctc-child-value'+((i+c).toString().match(/color/)?" color-picker":"")+(i.toString().match(/url/)?" ctc-input-wide":"")+'" value="'+a.escquo(r)+'" /></div>'});var h="ctc_"+n+"_child_"+c+"_i_"+t+"_"+s;l+='<label for="'+h+'"><input type="checkbox" id="'+h+'" name="'+h+'" value="1" '+(u?"checked":"")+" />"+a.getxt("important")+"</label>"}l+="</div>","ovrd"!==n&&(l+='<div class="ctc-swatch ctc-specific" id="ctc_child_'+c+"_"+t+"_"+s+'_swatch">'+a.getxt("swatch")+'</div><div class="ctc-child-input-cell ctc-button-cell" id="ctc_save_'+c+"_"+t+"_"+s+'_cell"><input type="button" class="button ctc-save-input" id="ctc_save_'+c+"_"+t+"_"+s+'" name="ctc_save_'+c+"_"+t+"_"+s+'" value="Save" /></div>'),l+="</div><!-- end input row -->\n"})}return l},scrolltop:function(){e("html, body, .ctc-option-panel-container").animate({scrollTop:0})},css_preview:function(e){var t=this;(e=e.match(/(child|parnt)/)[1])||(e="child"),t.query_css("preview",e)},setup_iris:function(e){var t=this;t.setup_spectrum(e)},setup_spectrum:function(t){var c=this,n=!c.is_empty(window.ctcAjax.palette);try{e(t).spectrum({showInput:!0,allowEmpty:!0,showAlpha:!0,showInitial:!0,preferredFormat:"hex",clickoutFiresChange:!0,move:function(n){e(t).data("color",n),c.coalesce_inputs(t)},showPalette:!!n,showSelectionPalette:!!n,palette:[],maxSelectionSize:36,localStorageKey:"ctc-palette."+window.ctcAjax.child,hideAfterPaletteSelect:!0}).on("change",function(){c.coalesce_inputs(this)}).on("keyup",function(){var t=this,n=c.addhash(e(this).val());e(t).val(n),clearTimeout(e(this).data("spectrumTimer")),e(this).data("spectrumTimer",setTimeout(function(){c.coalesce_inputs(t),e(t).spectrum("set",n)},500))})}catch(i){c.jquery_exception(i,"Spectrum Color Picker")}},addhash:function(e){return e.replace(/^#?([a-f0-9]{3,6}.*)/,"#$1")},color_text:function(e){var t=this;return t.is_empty(e)?"":e.getAlpha()<1?e.toRgbString():e.toHexString()},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,"Property 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();var i,s,a=n.item.label.replace(/[^\w\-]/g,t.toascii);return t.is_empty(t.currdata.value)&&(t.currdata.value={}),t.is_empty(t.currdata.value[n.item.label])&&(t.currdata.value[n.item.label]={}),t.is_empty(t.currdata.value[n.item.label].child)&&(t.currdata.value[n.item.label].child=[]),t.currdata.value[n.item.label].child.push(["",0,1,1]),i=e(t.input_row(t.currqsid,a,"ovrd",t.currdata,!0)),e("#ctc_sel_ovrd_rule_inputs").append(i),e("#ctc_new_rule_menu").val(""),i.find('input[type="text"]').each(function(c,n){s||(s=n),e(n).hasClass("color-picker")&&t.setup_spectrum(n)}),s&&e(s).focus(),!1},focus:function(e){e.preventDefault()}}).data("menu",{})}catch(c){t.jquery_exception(c,"New Property Menu")}},set_theme_params:function(t,c){e("#ctc_child_author").val(window.ctcAjax.themes[t][c].Author),e("#ctc_child_version").val(window.ctcAjax.themes[t][c].Version),e("#ctc_child_authoruri").val(window.ctcAjax.themes[t][c].AuthorURI),e("#ctc_child_themeuri").val(window.ctcAjax.themes[t][c].ThemeURI),e("#ctc_child_descr").val(window.ctcAjax.themes[t][c].Descr),e("#ctc_child_tags").val(window.ctcAjax.themes[t][c].Tags)},update_form:function(){var t,c=this;e("#input_row_stylesheet_handling_container,#input_row_parent_handling_container,#ctc_additional_css_files_container,#input_row_new_theme_slug,#input_row_duplicate_theme_slug,#ctc_copy_theme_mods,#ctc_child_header_parameters,#ctc_configure_submit,#input_row_theme_slug").slideUp("fast"),e("#ctc_configure_submit .ctc-step").text("9"),e("#ctc_theme_child").length&&!e("#ctc_child_type_new").is(":checked")?(t=e("#ctc_theme_child").val(),c.existing=1,c.currparnt=window.ctcAjax.themes.child[t].Template,c.autogen_slugs(),e("#ctc_theme_parnt").val(c.currparnt),e("#ctc_theme_parnt-button .ui-selectmenu-text").text(c.getname("parnt")),c.set_theme_params("child",t),e("#ctc_child_type_duplicate").is(":checked")?(e("#ctc_child_template").val(c.testslug),e("#ctc_child_name").val(c.testname),e(".ctc-analyze-theme, .ctc-analyze-howto").show(),e("#ctc_load_styles").val("Duplicate Child Theme")):e("#ctc_child_type_reset").is(":checked")?(e("#ctc_configure_submit .ctc-step").text("3"),e("#ctc_configure_submit").slideDown("fast"),e("#theme_slug_container").text(t),e(".ctc-analyze-theme, .ctc-analyze-howto").hide(),e("#ctc_enqueue_none").prop("checked",!0),e("#ctc_load_styles").val("Reset Child Theme to Previous State")):(e("#ctc_child_template").val(""),e("#theme_slug_container").text(t),e(".ctc-analyze-theme, .ctc-analyze-howto").show(),e("#ctc_child_name").val(c.getname("child")),e("#ctc_load_styles").val("Configure Child Theme")),e("#input_row_existing_theme_option").slideDown("fast"),e("#input_row_new_theme_option").slideUp("fast")):(c.existing=0,c.autogen_slugs(),e("#ctc_theme_parnt").val(c.currparnt),e("#ctc_theme_parnt-button .ui-selectmenu-text").text(e.chldthmcfg.getname("parnt")),c.set_theme_params("parnt",c.currparnt),e("#input_row_existing_theme_option,#input_row_duplicate_theme_container,#input_row_theme_slug").slideUp("fast"),e("#input_row_new_theme_option").slideDown("fast"),e("#ctc_child_name").val(c.testname),e("#ctc_child_template").val(c.testslug),e(".ctc-analyze-theme, .ctc-analyze-howto").show(),e("#ctc_load_styles").val("Create New Child Theme"))},set_notice:function(t){var c,n=this,i="";n.is_empty(t)||e.each(t,function(t,c){i+='<div class="'+t+' notice is-dismissible dashicons-before"><ul>\n',e(c).each(function(e,t){i+="<li>"+t.toString()+"</li>\n"}),i+="</ul></div>"}),c=e(i),e("#ctc_error_notice").html(c),n.bind_dismiss(c),e("html, body").animate({scrollTop:0},"slow")},set_parent_menu:function(e){var t=this;t.currparnt=e.value,t.update_form()},set_child_menu:function(e){var t=this;t.currchild=e.value,t.update_form()},set_query:function(t){var c=this;return c.is_empty(t)?!1:(c.currquery=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("&nbsp;"),c.load_selectors(),void c.scrolltop())},set_selector:function(t,c){var n=this;return c=null,n.is_empty(t)?!1:(e("#ctc_sel_ovrd_selector").val(""),n.currqsid=t,n.reload=!1,n.load_selector_values(),void n.scrolltop())},set_rule:function(t,c){var n=this;return n.is_empty(t)?!1:(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),void n.scrolltop())},set_qsid:function(t){var c=this;c.currqsid=e(t).attr("id").match(/_(\d+)$/)[1],c.focus_panel("#query_selector_options"),c.reload=!0,c.load_selector_values()},query_css:function(t,c,n){var i=this,s={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){s["ctc_query_"+e]=t}),e(".query-icon,.ctc-status-icon").remove(),e(a+" .ctc-status-icon").remove(),e(a).append('<span class="ctc-status-icon spinner is-active query-icon"></span>'),s.action=i.is_empty(e("#ctc_action").val())||"plugin"!==e("#ctc_action").val()?"ctc_query":"ctc_plgqry",s._wpnonce=e("#_wpnonce").val(),i.ajax_post(t,s)},save:function(t){var c,n,i,s,a,l=this,r={},o=e(t).attr("id");e(t).prop("disabled",!0),e(".ctc-query-icon,.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>'),r.ctc_configtype=e(t).val()):(c=e("#ctc_new_selectors"))&&"ctc_save_new_selectors"===e(t).attr("id")?(r.ctc_new_selectors=c.val(),(n=e("#ctc_sel_ovrd_query_selected"))&&(r.ctc_sel_ovrd_query=n.text()),l.reload=!0):(i=e("#ctc_child_imports"))&&"ctc_save_imports"===o?r.ctc_child_imports=i.val():"ctc_is_debug"===o?r.ctc_is_debug=e("#ctc_is_debug").is(":checked")?1:0:r=l.coalesce_inputs(t),e(".save-icon").addClass("is-active"),e("#ctc_sel_ovrd_selector_selected").find("#ctc_rewrite_selector").each(function(){s=e("#ctc_rewrite_selector").val(),a=e("#ctc_rewrite_selector_orig").val(),l.is_empty(s)||!s.toString().match(/\w/)?s=a:(r.ctc_rewrite_selector=s,l.reload=!0),e(".ctc-rewrite-toggle").text(l.getxt("rename")),e("#ctc_sel_ovrd_selector_selected").html(s)}),r.action=l.is_empty(e("#ctc_action").val())||"plugin"!==e("#ctc_action").val()?"ctc_update":"ctc_plugin",r._wpnonce=e("#_wpnonce").val(),l.ajax_post("qsid",r)},ajax_post:function(t,c,n){var i=this;e.ajax({url:window.ctcAjax.ajaxurl,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)}).always(function(){i.jqueryerr.length&&i.jquery_notice()})},handle_failure:function(t){var c=this;e(".query-icon, .save-icon").removeClass("spinner").addClass("failure"),e("input[type=submit], input[type=button], input[type=checkbox],.ctc-delete-input").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], input[type=checkbox],.ctc-delete-input").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.jqueryerr.push("<code><small>"+t+": "+e.message+i+n+"</small></code>")},jquery_notice:function(t){t=null;var c=this,n=[],i=[];c.jqueryerr.length&&(e("input[type=submit], input[type=button]").prop("disabled",!0),e("script").each(function(){var t=e(this).prop("src");c.is_empty(t)||!t.match(/jquery(\.min|\.js|\-?ui)/i)||t.match(/load\-scripts.php/)||n.push("<code><small>"+t.split(/\?/)[0]+"</small></code>")}),i.push("<strong>"+c.getxt("js")+"</strong> "+c.getxt("contact")),i.push(c.jqueryerr.join("<br/>")),n.length&&i.push(c.getxt("jquery")+"<br/>"+n.join("<br/>")),i.push(c.getxt("plugin"))),c.set_notice({error:i})},update:{qsid:function(t){var c,n,i,s,a=this;a.currqsid=t.key,a.currdata=t.data,e("#ctc_sel_ovrd_qsid").val(a.currqsid),a.is_empty(a.currdata.seq)?e("#ctc_child_load_order_container").empty():(c="ctc_ovrd_child_seq_"+a.currqsid,i=parseInt(a.currdata.seq),n='<input type="text" id="'+c+'" name="'+c+'" class="ctc-child-value" value="'+i+'" />',e("#ctc_child_load_order_container").html(n)),a.is_empty(a.currdata.value)?(s=!0,e("#ctc_sel_ovrd_rule_inputs").empty()):(s=!1,n="",e.each(a.currdata.value,function(e,t){t=null,n+=a.input_row(a.currqsid,e,"ovrd",a.currdata)}),e("#ctc_sel_ovrd_rule_inputs").html(n).find(".color-picker").each(function(){a.setup_spectrum(this)}),a.coalesce_inputs("#ctc_child_all_0_swatch")),a.reload&&(a.load_queries(),a.set_query(a.currdata.query),a.load_rules()),e("#ctc_sel_ovrd_selector_selected").text(a.currdata.selector),e(".ctc-rewrite-toggle").text(a.getxt("rename")),e(".ctc-rewrite-toggle").show(),s?e("#ctc_sel_ovrd_rule_header,#ctc_sel_ovrd_new_rule,#ctc_sel_ovrd_rule_inputs_container,#ctc_sel_ovrd_rule_inputs").hide():e("#ctc_sel_ovrd_rule_header,#ctc_sel_ovrd_new_rule,#ctc_sel_ovrd_rule_inputs_container,#ctc_sel_ovrd_rule_inputs").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 s=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+'">'+s.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,n,i=this,s="";i.is_empty(t.data)||e.each(t.data,function(n,a){c=n,e.each(a,function(c,a){s+='<h4 class="ctc-query-heading">'+c+"</h4>\n",i.is_empty(a)||e.each(a,function(e,c){s+=i.input_row(e,n,t.key,c)})})}),n="#ctc_selector_"+c+"_"+t.key+"_rows",e(n).html(s).find(".color-picker").each(function(){i.setup_spectrum(this)}),e(n).find(".ctc-swatch").each(function(){i.coalesce_inputs(this)})},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_box").val(e("#ctc_debug_box").val()+t.data)},preview:function(t){e("#view_"+t.key+"_options_panel").text(t.data)},dismiss:function(){}},bind_dismiss:function(t){var c=this,n=e(t),i=e('<button type="button" class="notice-dismiss"><span class="screen-reader-text"></span></button>'),s=window.commonL10n.dismiss||"";i.find(".screen-reader-text").text(s),n.append(i),i.on("click.wp-dismiss-notice",function(e){e.preventDefault(),c.dismiss_notice(t)})},dismiss_notice:function(t){e(t).fadeTo(100,0,function(){e(this).slideUp(100,function(){e(this).remove()})})},reset_handling:function(){e("#parnt_analysis_notice .notice, #child_analysis_notice .notice").slideUp(),e("#ctc_enqueue_enqueue").prop("checked",!0),e("#ctc_handling_primary").prop("checked",!0),e("#ctc_ignoreparnt").prop("checked",!1),e("#ctc_repairheader").prop("checked",!1)},init:function(){var t=this;if(!e("#ctc_theme_parnt").is("input")){try{e.widget("ctc.themeMenu",e.ui.selectmenu,{_renderItem:function(t,c){var n=e("<li>"),i=c.value.replace(/[^\w\-]/,"");return e("#ctc_theme_option_"+i).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.reset_handling(),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(window.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.reset_handling(),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.currparnt=e("#ctc_theme_parnt").val(),t.currchild=e("#ctc_theme_child").length?e("#ctc_theme_child").val():"",e("#ctc_main").on("click",".ctc-section-toggle",function(t){t.preventDefault(),e(this).parents(".ctc-input-row, .notice-warning, .updated, .error").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("#ctc_main").on("click",".ctc-upgrade-notice .notice-dismiss",function(){var c={action:"ctc_dismiss",_wpnonce:e("#_wpnonce").val()};t.ajax_post("dismiss",c)}),t.is_empty(t.jqueryerr)&&(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,i,s=e(this).attr("id").toString().replace("_close",""),a=s.toString().match(/_([^_]+)_(\d+)$/);e("#"+s+"_container").is(":hidden")&&(t.is_empty(a[1])||t.is_empty(a[2])||(n=a[1],i=a[2],t.query_css("val_qry",i,{rule:n}))),e("#"+s+"_container").fadeToggle("fast"),e(".ctc-selector-container").not("#"+s+"_container").fadeOut("fast")}),e("#ctc_main").on("click",".ctc-save-input[type=button], .ctc-delete-input",function(c){return c.preventDefault(),e(this).hasClass("ajax-pending")?!1:(e(this).addClass("ajax-pending"),t.save(this),!1)}),e("#ctc_main").on("keydown",".ctc-selector-container .ctc-child-value[type=text]",function(c){if(13===c.which){var n=e(this).parents(".ctc-selector-row").find(".ctc-save-input[type=button]").first();if(n.length)return c.preventDefault(),n.hasClass("ajax-pending")?!1:(n.addClass("ajax-pending"),t.save(n),!1)}}),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_main").on("click",".ctc-backup-theme",function(c){c.preventDefault(),t.existing?e("#ctc_export_theme").val(t.currchild):e("#ctc_export_theme").val(t.currparnt),e("#ctc_export_theme_form").submit()}),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-query-icon,.ctc-status-icon").remove();var n="#"+e(this).attr("id");t.focus_panel(n)}),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){c.preventDefault();var n=e("#ctc_save_query_selector");return n.hasClass("ajax-pending")?!1:(n.addClass("ajax-pending"),t.save(n),!1)}),e("#ctc_rule_value_form").on("submit",function(e){return e.preventDefault(),!1}),e("#ctc_child_type_new,#ctc_child_type_existing,#ctc_child_type_duplicate,#ctc_child_type_reset").on("focus click",function(){t.reset_handling(),t.update_form()}),e("#ctc_is_debug").on("change",function(){e(this).is(":checked")?e("#ctc_debug_box").length||e("#ctc_debug_container").html('<textarea id="ctc_debug_box"></textarea>'):e("#ctc_debug_box").remove(),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(),e("input[type=submit], input[type=button]").prop("disabled",!1),t.scrolltop(),t.update_form()),t.jqueryerr.length&&t.jquery_notice()},testslug:"",testname:"",reload:!1,currquery:"base",currqsid:null,currdata:{},currparnt:"",currchild:"",existing:!1,jqueryerr:[],color_regx:"\\s+(\\#[a-f0-9]{3,6}|rgba?\\([\\d., ]+?\\)|hsla?\\([\\d%., ]+?\\)|[a-z]+)",border_regx:"(\\w+)(\\s+(\\w+))?",grad_regx:"(\\w+)"},e.chldthmanalyze={escrgx:function(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")},trmcss:function(e){return"undefined"==typeof e?"":e.replace(/\-css$/,"")},show_loading:function(t,c){var n=e.chldthmcfg.existing?"child":"parnt",i=c?c:e.chldthmcfg.getname(n),s='<strong class="ctc_analyze_loading"><span class="spinner is-active"></span>'+e.chldthmcfg.getxt(t?"anlz1":"anlz2")+" "+i+"...</strong>";self.noticediv="",e("#"+n+"_analysis_notice").html(s)},hide_loading:function(){e(".ctc_analyze_loading").fadeTo(200,0,function(){e(this).slideUp(200,function(){e(this).remove()})})},setssl:function(e){return e.replace(/^https?/,window.ctcAjax.ssl?"https":"http")},analyze_theme:function(t){var c,n,i,s=this,a=Math.floor(e.now()/1e3),l="child"===t?e.chldthmcfg.currchild:e.chldthmcfg.currparnt,r="&template="+e.chldthmcfg.currparnt+"&stylesheet="+l+"&now="+a,o=s.setssl(window.ctcAjax.homeurl),_=window.ctcAjax.theme_uri.replace(/^https?:\/\//,""),d=o+r,u=s.escrgx(e.chldthmcfg.currparnt)+("child"===t?"|"+s.escrgx(l):""),h=new RegExp("<link( rel=[\"']stylesheet[\"'] id=['\"]([^'\"]+?)['\"])?[^>]+?"+s.escrgx(_)+"/("+u+")/([^\"']+\\.css)(\\?[^\"']+)?[\"'][^>]+>","gi"),p=/<br \/>\n[^\n]+?(fatal|strict|notice|warning|error)[\s\S]+?<br \/>/gi,m=0,g=0,f={url:d,deps:[[],[]],signals:{},queue:[],irreg:[]};e.get(d,function(a){for((n=a.match(/BEGIN WP QUEUE\n([\s\S]*?)\nEND WP QUEUE/))?f.queue=n[1].split(/\n/):(f.queue=[],f.signals.thm_noqueue=1),(n=a.match(/BEGIN CTC IRREGULAR\n([\s\S]*?)\nEND CTC IRREGULAR/))?f.irreg=n[1].split(/\n/):f.irreg=[],a.match(/CHLD_THM_CFG_IGNORE_PARENT/)&&(f.signals.thm_ignoreparnt=1),a.match(/IS_CTC_THEME/)&&(f.signals.thm_is_ctc=1),a.match(/NO_CTC_STYLES/)&&(f.signals.thm_no_styles=1),a.match(/HAS_CTC_IMPORT/)&&(f.signals.thm_has_import=1),a=a.replace(/<!\-\-[\s\S]*?\-\->/g,"");c=p.exec(a);){var l=c[0].replace(/<.*?>/g,"");s.phperr[t].push(l),f.signals.err_php=1,l.match(/Fatal error/i)&&(f.signals.err_fatal=1)}for(;i=h.exec(a);){var r=s.trmcss(i[2]),o=i[3],_=i[4],d=e.chldthmcfg.currparnt===o?"parnt":"child",u=0;if(""===r||-1===e.inArray(r,f.queue))u=1;else if(0===r.indexOf("chld_thm_cfg")){
2
- _.match(/^ctc\-style([\-\.]min)?\.css$/)?(m=1,f.signals.ctc_sep_loaded=1):_.match(/^ctc\-genesis([\-\.]min)?\.css$/)?(m=1,f.signals.ctc_gen_loaded=1):r.match(/$chld_thm_cfg_ext/)?(f.signals.ctc_ext_loaded=1,f.deps[m].push([r,_])):"chld_thm_cfg_child"===r?(f.signals.ctc_child_loaded=1,f.deps[m].push([r,_])):"chld_thm_cfg_parent"===r&&(f.signals.ctc_parnt_loaded=1,f.deps[m].push([r,_]),m&&(f.signals.ctc_parnt_reorder=1));continue}if(_.match(/^style([\-\.]min)?\.css$/))m=1,"parnt"===d?u?f.signals.thm_parnt_loaded="thm_unregistered":(f.signals.thm_parnt_loaded=r,"child"===t&&f.signals.thm_child_loaded&&(f.signals.ctc_parnt_reorder=1)):f.signals.thm_child_loaded=u?"thm_unregistered":r,u?g?(f.signals.thm_past_wphead=1,f.deps[m].push(["thm_past_wphead",_])):(f.signals.thm_unregistered=1,f.deps[m].push(["thm_unregistered",_])):f.deps[m].push([r,_]);else if("ctc-test.css"===_)g=1;else{var v=null;u&&(v="dep_unregistered"),g&&(v=m?"css_past_wphead":"dep_past_wphead"),v&&(f.signals[v]=1,r=v),f.deps[m].push([r,_])}}m||(f.signals.thm_notheme=1),a=null,s.analysis[t]=f,e(document).trigger("analysisdone")}).fail(function(c,n,i){f.signals.failure=1,f.signals.xhrerr=i,s.analysis[t]=f,e(document).trigger("analysisdone")})},css_notice:function(){var t,c=this,n=e.chldthmcfg.existing?"child":"parnt",i=e.chldthmcfg.getname(n),s="",a={notices:[]},l={style:"notice-warning",headline:e.chldthmcfg.getxt("anlz3",i),errlist:""},r=0,o={},_="";if(c.analysis[n].signals.failure||c.analysis[n].signals.thm_noqueue&&!c.phperr[n].length)e("#ctc_is_debug").is(":checked")&&(_=e.chldthmcfg.getxt("anlz33").replace(/%1/,'<a href="'+c.analysis[n].url+'" target="_new">').replace(/%2/,"</a>")),a.notices.push({headline:e.chldthmcfg.getxt("anlz4",i),msg:e.chldthmcfg.getxt("anlz5")+_,style:"notice-warning"});else{if(c.phperr[n].length&&(e.each(c.phperr[n],function(t,c){c.match(/Fatal error/i)&&(l.style="error",l.headline=e.chldthmcfg.getxt("anlz8",i)),l.errlist+=c+"\n"}),l.msg='<div style="background-color:#ffeebb;padding:6px"><div class="ctc-section-toggle" id="ctc_analysis_errs">'+e.chldthmcfg.getxt("anlz6")+'</div><div id="ctc_analysis_errs_content" style="display:none"><textarea>'+l.errlist+"</textarea></div></div>"+e.chldthmcfg.getxt("anlz7"),a.notices.push(l)),(c.analysis[n].signals.thm_past_wphead||c.analysis[n].signals.dep_past_wphead)&&(a.notices.push({headline:e.chldthmcfg.getxt("anlz9"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz10")}),e("#ctc_repairheader").prop("checked",!0),e("#ctc_repairheader_container").show()),c.analysis[n].signals.thm_unregistered&&(c.analysis[n].signals.ctc_child_loaded||c.analysis[n].signals.ctc_sep_loaded||(a.notices.push({headline:e.chldthmcfg.getxt("anlz11"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz12")}),e("#ctc_repairheader_container").show(),e("#ctc_repairheader").prop("checked",!0))),"child"===n&&(c.analysis.child.signals.ctc_parnt_reorder&&(r=1),c.analysis.child.signals.ctc_child_loaded||c.analysis.child.signals.ctc_sep_loaded||c.analysis.child.signals.thm_child_loaded||(a.notices.push({headline:e.chldthmcfg.getxt("anlz13"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz14")}),r=1),c.analysis[n].signals.ctc_gen_loaded&&a.notices.push({headline:e.chldthmcfg.getxt("anlz31"),msg:e.chldthmcfg.getxt("anlz32"),style:"notice-warning"}),c.analysis.parnt.signals.thm_no_styles||c.analysis.child.signals.ctc_gen_loaded||c.analysis.child.signals.thm_parnt_loaded||c.analysis.child.signals.ctc_parnt_loaded||c.analysis.child.signals.thm_ignoreparnt||c.analysis.child.signals.thm_has_import||(a.notices.push({headline:e.chldthmcfg.getxt("anlz15"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz16")}),r=1),c.analysis.child.signals.thm_unregistered&&c.analysis.child.signals.thm_child_loaded&&"thm_unregistered"===c.analysis.child.signals.thm_child_loaded&&c.analysis.child.signals.ctc_child_loaded&&c.analysis.child.signals.ctc_parnt_loaded&&(a.notices.push({headline:e.chldthmcfg.getxt("anlz28"),style:"notice-warning",msg:e.chldthmcfg.getxt("anlz29")}),e("#ctc_repairheader_container").show(),e("#ctc_repairheader").prop("checked",!0)),c.analysis.child.signals.thm_is_ctc||e("#ctc_child_type_duplicate").is(":checked")||a.notices.push({headline:e.chldthmcfg.getxt("anlz19"),msg:e.chldthmcfg.getxt("anlz20"),style:"notice-warning"})),(c.analysis[n].signals.ctc_sep_loaded||c.analysis[n].signals.ctc_gen_loaded)&&e("#ctc_handling_separate").prop("checked",!0),a.notices.length||a.notices.push({headline:""+("child"===n?e.chldthmcfg.getxt("anlz17"):e.chldthmcfg.getxt("anlz18")),style:"updated",msg:""}),"child"===n&&c.analysis.child.signals.thm_has_import&&(a.notices.push({headline:e.chldthmcfg.getxt("anlz21"),msg:e.chldthmcfg.getxt("anlz22"),style:"notice-warning"}),e("#ctc_enqueue_import").prop("checked",!0)),c.analysis[n].signals.thm_ignoreparnt||c.analysis[n].signals.ctc_gen_loaded?(e("#ctc_ignoreparnt").prop("checked",!0),e("#ctc_enqueue_none").is(":checked")||(e("#ctc_enqueue_none").prop("checked",!0),r=1,o.ctc_enqueue="none")):e("#ctc_ignoreparnt").prop("checked",!1),c.analysis[n].signals.thm_keepdeps?e("#ctc_keepdeps").prop("checked",!0):e("#ctc_keepdeps").prop("checked",!1),!c.analysis[n].signals.ctc_sep_loaded&&!c.analysis[n].signals.ctc_gen_loaded&&!c.analysis[n].signals.ctc_child_loaded&&!c.analysis[n].signals.thm_unregistered&&!c.analysis[n].signals.thm_past_wphead&&c.analysis[n].deps[1].length){var d="";e.each(c.analysis[n].deps[1],function(e,t){t[1].match(/^style([\-\.]min)?\.css$/)||(d+="<li>"+t[1]+"</li>\n")}),""!==d&&(d="<ul class='howto' style='padding-left:1em'>\n"+d+"</ul>\n",a.notices.push({headline:e.chldthmcfg.getxt("anlz23"),msg:d+e.chldthmcfg.getxt("anlz24"),style:"updated"}))}"child"===n&&c.analysis[n].signals.thm_parnt_loaded&&(a.notices.push({headline:e.chldthmcfg.getxt("anlz25"),msg:e.chldthmcfg.getxt("anlz26"),style:"updated"}),e("#ctc_enqueue_none").prop("checked",!0),r=1,o.ctc_enqueue="none"),c.analysis.parnt.signals.thm_no_styles&&(a.notices.push({headline:e.chldthmcfg.getxt("anlz27"),msg:e.chldthmcfg.getxt("anlz26"),style:"updated"}),e("#ctc_enqueue_none").prop("checked",!0),r=1,o.ctc_enqueue="none")}return s=encodeURIComponent(JSON.stringify(c.analysis)),e('input[name="ctc_analysis"]').val(s),o.ctc_analysis=s,c.is_success()&&r&&!c.resubmitting?(c.resubmitting=1,void c.resubmit(o)):(c.resubmitting=0,c.hide_loading(),e.each(a.notices,function(t,c){var i=e('<div class="'+c.style+' notice is-dismissible dashicons-before" ><h4>'+c.headline+"</h4>"+c.msg+"</div>");e.chldthmcfg.bind_dismiss(i),i.hide().appendTo("#"+n+"_analysis_notice").slideDown()}),e("#ctc_is_debug").is(":checked")&&(t='<div style="background-color:#ddd;padding:6px"><div class="ctc-section-toggle" id="ctc_analysis_obj">'+e.chldthmcfg.getxt("anlz30")+'</div><div id="ctc_analysis_obj_content" style="display:none"><textarea style="font-family:monospace;font-size:10px">'+JSON.stringify(c.analysis,null,2)+"</textarea></div></div>",e(t).appendTo("#"+n+"_analysis_notice")),e("#ctc_child_type_reset").is(":checked")||(e("#input_row_stylesheet_handling_container,#input_row_parent_handling_container,#ctc_child_header_parameters,#ctc_configure_submit").slideDown("fast"),e("#ctc_child_type_duplicate").is(":checked")?(e("#ctc_configure_submit .ctc-step").text("8"),e("#ctc_copy_theme_mods").find("input").prop("checked",!1)):(e("#ctc_configure_submit .ctc-step").text("9"),e("#ctc_copy_theme_mods").slideDown("fast")),e("#ctc_child_type_duplicate").is(":checked")||e("#ctc_child_type_new").is(":checked")?(e("#input_row_theme_slug").hide(),e("#input_row_new_theme_slug").slideDown("fast")):(e("#input_row_new_theme_slug").hide(),e("#input_row_theme_slug").slideDown("fast"))),void 0)},resubmit:function(t){var c=this;c.hide_loading(),c.show_loading(!0),t.action="ctc_update",t._wpnonce=e("#_wpnonce").val(),e.ajax({url:window.ctcAjax.ajaxurl,data:t,type:"POST"}).done(function(){c.hide_loading(),c.do_analysis()}).fail(function(){c.hide_loading()})},do_analysis:function(){var t=this;t.analysis={parnt:{},child:{}},t.phperr={parnt:[],child:[]},t.done=0,t.show_loading(!1),t.analyze_theme("parnt"),e.chldthmcfg.existing&&t.analyze_theme("child")},init:function(){var t=this;e(document).on("analysisdone",function(){t.done++,t.done>e.chldthmcfg.existing&&(t.done=0,t.css_notice())}),e("#ctc_main").on("click",".ctc-analyze-theme",function(){t.is_success()&&e.chldthmcfg.dismiss_notice(e(".ctc-success-response").parent(".notice")),t.do_analysis()}),t.is_success()&&!window.ctcAjax.pluginmode&&t.do_analysis()},analysis:{},done:0,resubmitting:0,is_success:function(){return e(".ctc-success-response").length}},e("#request-filesystem-credentials-form").length||(e.chldthmcfg.init(),e.chldthmanalyze.init())}(jQuery);
 
 
js/ctcgrad.js CHANGED
@@ -5,199 +5,199 @@
5
  * Licensed under the GPLv2 license.
6
  */
7
  (function( $, undef ){
8
- var _html, nonGradientIE, gradientType, vendorPrefixes, _css, Iris, UA, isIE, IEVersion;
9
- UA = navigator.userAgent.toLowerCase();
10
- isIE = navigator.appName === 'Microsoft Internet Explorer';
11
- IEVersion = isIE ? parseFloat( UA.match( /msie ([0-9]{1,}[\.0-9]{0,})/ )[1] ) : 0;
12
- nonGradientIE = ( isIE && IEVersion < 10 );
13
- // we don't bother with an unprefixed version, as it has a different syntax
14
- vendorPrefixes = ['-moz-', '-webkit-', '-o-', '-ms-' ];
15
- testGradientType();
16
-
17
- // Bail for IE <= 7
18
- if ( nonGradientIE && IEVersion <= 7 ) {
19
- $.fn.ctcgrad = $.noop;
20
- $.support.ctcgrad = false;
21
- return;
22
- }
23
-
24
- $.support.ctcgrad = true;
25
-
26
- function testGradientType() {
27
- var el, base;
28
- if ( nonGradientIE ) {
29
- gradientType = 'filter';
30
- }
31
- else {
32
- el = $('<div id="ctcgrad-gradtest" />');
33
- base = "linear-gradient(top,#fff,#000)";
34
- $.each( vendorPrefixes, function( i, val ){
35
- el.css( 'backgroundImage', val + base );
36
- if ( el.css( 'backgroundImage').match('gradient') ) {
37
- gradientType = i;
38
- return false;
39
- }
40
- });
41
- // check for legacy webkit gradient syntax
42
- if ( gradientType === false ) {
43
- el.css( 'background', '-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))' );
44
- if ( el.css( 'backgroundImage').match('gradient') )
45
- gradientType = 'webkit';
46
- }
47
- el.remove();
48
- }
49
-
50
- }
51
-
52
- /**
53
- * Only for CSS3 gradients. oldIE will use a separate function.
54
- *
55
- * Accepts as many color stops as necessary from 2nd arg on, or 2nd
56
- * arg can be an array of color stops
57
- *
58
- * @param {string} origin Gradient origin - top bottom left right (n)deg
59
- * @return {string} Appropriate CSS3 gradient string for use in
60
- */
61
- function createGradient( origin, stops ) {
62
- origin = ( origin.match(/(\d+deg|top|left|bottom|right)( (top|left|bottom|right))?/) ? origin : 'top');
63
- stops = $.isArray( stops ) ? stops : Array.prototype.slice.call(arguments, 1);
64
- if ( gradientType === 'webkit' )
65
- return legacyWebkitGradient( origin, stops );
66
- else
67
- return vendorPrefixes[gradientType] + 'linear-gradient(' + origin + ', ' + stops.join(', ') + ')';
68
- }
69
-
70
- /**
71
- * Stupid gradients for a stupid browser.
72
- */
73
- function stupidIEGradient( origin, stops ) {
74
- var type, self, lastIndex, filter, startPosProp, endPosProp, dimensionProp, template, html, filterVal;
75
-
76
- origin = ( origin === 'left' ) ? 'left' : 'top';
77
- stops = $.isArray( stops ) ? stops : Array.prototype.slice.call(arguments, 1);
78
- // 8 hex: AARRGGBB
79
- // GradientType: 0 vertical, 1 horizontal
80
- type = ( origin === 'top' ) ? 0 : 1;
81
- self = $( this );
82
- lastIndex = stops.length - 1;
83
- filter = 'filter';
84
- startPosProp = ( type === 1 ) ? 'left' : 'top';
85
- endPosProp = ( type === 1 ) ? 'right' : 'bottom';
86
- dimensionProp = ( type === 1 ) ? 'height' : 'width';
87
- // need a positioning context
88
- if ( self.css('position') === 'static' )
89
- self.css( {position: 'relative' } );
90
-
91
- stops = fillColorStops( stops );
92
- $.each(stops, function( i, startColor ) {
93
- var endColor, endStop;
94
-
95
- // we want two at a time. if we're on the last pair, bail.
96
- if ( i === lastIndex )
97
- return false;
98
-
99
- endColor = stops[ i + 1 ];
100
- //if our pairs are at the same color stop, moving along.
101
- if ( startColor.stop === endColor.stop )
102
- return;
103
-
104
- endStop = 100 - parseFloat( endColor.stop ) + '%';
105
- startColor.octoHex = new Color( startColor.color ).toIEOctoHex();
106
- endColor.octoHex = new Color( endColor.color ).toIEOctoHex();
107
-
108
- filterVal = "progid:DXImageTransform.Microsoft.Gradient(GradientType=" + type + ", StartColorStr='" + startColor.octoHex + "', EndColorStr='" + endColor.octoHex + "')";
109
- });
110
  return filterVal;
111
- }
112
-
113
- function legacyWebkitGradient( origin, colorList ) {
114
- var stops = [];
115
- origin = ( origin === 'top' ) ? '0% 0%,0% 100%,' : '0% 100%,100% 100%,';
116
- colorList = fillColorStops( colorList );
117
- $.each( colorList, function( i, val ){
118
- stops.push( 'color-stop(' + ( parseFloat( val.stop ) / 100 ) + ', ' + val.color + ')' );
119
- });
120
- return '-webkit-gradient(linear,' + origin + stops.join(',') + ')';
121
- }
122
-
123
- function fillColorStops( colorList ) {
124
- var colors = [],
125
- percs = [],
126
- newColorList = [],
127
- lastIndex = colorList.length - 1;
128
-
129
- $.each( colorList, function( index, val ) {
130
- var color = val,
131
- perc = false,
132
- match = val.match(/1?[0-9]{1,2}%$/);
133
-
134
- if ( match ) {
135
- color = val.replace(/\s?1?[0-9]{1,2}%$/, '');
136
- perc = match.shift();
137
- }
138
- colors.push( color );
139
- percs.push( perc );
140
- });
141
-
142
- // back fill first and last
143
- if ( percs[0] === false )
144
- percs[0] = '0%';
145
-
146
- if ( percs[lastIndex] === false )
147
- percs[lastIndex] = '100%';
148
-
149
- percs = backFillColorStops( percs );
150
-
151
- $.each( percs, function( i ){
152
- newColorList[i] = { color: colors[i], stop: percs[i] };
153
- });
154
- return newColorList;
155
- }
156
-
157
- function backFillColorStops( stops ) {
158
- var first = 0,
159
- last = stops.length - 1,
160
- i = 0,
161
- foundFirst = false,
162
- incr,
163
- steps,
164
- step,
165
- firstVal;
166
-
167
- if ( stops.length <= 2 || $.inArray( false, stops ) < 0 ) {
168
- return stops;
169
- }
170
- while ( i < stops.length - 1 ) {
171
- if ( ! foundFirst && stops[i] === false ) {
172
- first = i - 1;
173
- foundFirst = true;
174
- } else if ( foundFirst && stops[i] !== false ) {
175
- last = i;
176
- i = stops.length;
177
- }
178
- i++;
179
- }
180
- steps = last - first;
181
- firstVal = parseInt( stops[first].replace('%'), 10 );
182
- incr = ( parseFloat( stops[last].replace('%') ) - firstVal ) / steps;
183
- i = first + 1;
184
- step = 1;
185
- while ( i < last ) {
186
- stops[i] = ( firstVal + ( step * incr ) ) + '%';
187
- step++;
188
- i++;
189
- }
190
- return backFillColorStops( stops );
191
- }
192
-
193
- $.fn.ctcgrad = function( origin ) {
194
- var args = arguments;
195
- // this'll be oldishIE
196
- if ( nonGradientIE )
197
  $(this).css('filter',
198
- stupidIEGradient.apply( this, args ));
199
- else // new hotness
200
- $( this ).css( 'backgroundImage', createGradient.apply( this, args ) );
201
- };
202
 
203
  }( jQuery ));
5
  * Licensed under the GPLv2 license.
6
  */
7
  (function( $, undef ){
8
+ var _html, nonGradientIE, gradientType, vendorPrefixes, _css, Iris, UA, isIE, IEVersion;
9
+ UA = navigator.userAgent.toLowerCase();
10
+ isIE = navigator.appName === 'Microsoft Internet Explorer';
11
+ IEVersion = isIE ? parseFloat( UA.match( /msie ([0-9]{1,}[\.0-9]{0,})/ )[1] ) : 0;
12
+ nonGradientIE = ( isIE && IEVersion < 10 );
13
+ // we don't bother with an unprefixed version, as it has a different syntax
14
+ vendorPrefixes = ['-moz-', '-webkit-', '-o-', '-ms-' ];
15
+ testGradientType();
16
+
17
+ // Bail for IE <= 7
18
+ if ( nonGradientIE && IEVersion <= 7 ) {
19
+ $.fn.ctcgrad = $.noop;
20
+ $.support.ctcgrad = false;
21
+ return;
22
+ }
23
+
24
+ $.support.ctcgrad = true;
25
+
26
+ function testGradientType() {
27
+ var el, base;
28
+ if ( nonGradientIE ) {
29
+ gradientType = 'filter';
30
+ }
31
+ else {
32
+ el = $('<div id="ctcgrad-gradtest" />');
33
+ base = "linear-gradient(top,#fff,#000)";
34
+ $.each( vendorPrefixes, function( i, val ){
35
+ el.css( 'backgroundImage', val + base );
36
+ if ( el.css( 'backgroundImage').match('gradient') ) {
37
+ gradientType = i;
38
+ return false;
39
+ }
40
+ });
41
+ // check for legacy webkit gradient syntax
42
+ if ( gradientType === false ) {
43
+ el.css( 'background', '-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))' );
44
+ if ( el.css( 'backgroundImage').match('gradient') )
45
+ gradientType = 'webkit';
46
+ }
47
+ el.remove();
48
+ }
49
+
50
+ }
51
+
52
+ /**
53
+ * Only for CSS3 gradients. oldIE will use a separate function.
54
+ *
55
+ * Accepts as many color stops as necessary from 2nd arg on, or 2nd
56
+ * arg can be an array of color stops
57
+ *
58
+ * @param {string} origin Gradient origin - top bottom left right (n)deg
59
+ * @return {string} Appropriate CSS3 gradient string for use in
60
+ */
61
+ function createGradient( origin, stops ) {
62
+ origin = ( origin.match(/(\d+deg|top|left|bottom|right)( (top|left|bottom|right))?/) ? origin : 'top');
63
+ stops = $.isArray( stops ) ? stops : Array.prototype.slice.call(arguments, 1);
64
+ if ( gradientType === 'webkit' )
65
+ return legacyWebkitGradient( origin, stops );
66
+ else
67
+ return vendorPrefixes[gradientType] + 'linear-gradient(' + origin + ', ' + stops.join(', ') + ')';
68
+ }
69
+
70
+ /**
71
+ * Stupid gradients for a stupid browser.
72
+ */
73
+ function stupidIEGradient( origin, stops ) {
74
+ var type, self, lastIndex, filter, startPosProp, endPosProp, dimensionProp, template, html, filterVal;
75
+
76
+ origin = ( origin === 'left' ) ? 'left' : 'top';
77
+ stops = $.isArray( stops ) ? stops : Array.prototype.slice.call(arguments, 1);
78
+ // 8 hex: AARRGGBB
79
+ // GradientType: 0 vertical, 1 horizontal
80
+ type = ( origin === 'top' ) ? 0 : 1;
81
+ self = $( this );
82
+ lastIndex = stops.length - 1;
83
+ filter = 'filter';
84
+ startPosProp = ( type === 1 ) ? 'left' : 'top';
85
+ endPosProp = ( type === 1 ) ? 'right' : 'bottom';
86
+ dimensionProp = ( type === 1 ) ? 'height' : 'width';
87
+ // need a positioning context
88
+ if ( self.css('position') === 'static' )
89
+ self.css( {position: 'relative' } );
90
+
91
+ stops = fillColorStops( stops );
92
+ $.each(stops, function( i, startColor ) {
93
+ var endColor, endStop;
94
+
95
+ // we want two at a time. if we're on the last pair, bail.
96
+ if ( i === lastIndex )
97
+ return false;
98
+
99
+ endColor = stops[ i + 1 ];
100
+ //if our pairs are at the same color stop, moving along.
101
+ if ( startColor.stop === endColor.stop )
102
+ return;
103
+
104
+ endStop = 100 - parseFloat( endColor.stop ) + '%';
105
+ startColor.octoHex = new Color( startColor.color ).toIEOctoHex();
106
+ endColor.octoHex = new Color( endColor.color ).toIEOctoHex();
107
+
108
+ filterVal = "progid:DXImageTransform.Microsoft.Gradient(GradientType=" + type + ", StartColorStr='" + startColor.octoHex + "', EndColorStr='" + endColor.octoHex + "')";
109
+ });
110
  return filterVal;
111
+ }
112
+
113
+ function legacyWebkitGradient( origin, colorList ) {
114
+ var stops = [];
115
+ origin = ( origin === 'top' ) ? '0% 0%,0% 100%,' : '0% 100%,100% 100%,';
116
+ colorList = fillColorStops( colorList );
117
+ $.each( colorList, function( i, val ){
118
+ stops.push( 'color-stop(' + ( parseFloat( val.stop ) / 100 ) + ', ' + val.color + ')' );
119
+ });
120
+ return '-webkit-gradient(linear,' + origin + stops.join(',') + ')';
121
+ }
122
+
123
+ function fillColorStops( colorList ) {
124
+ var colors = [],
125
+ percs = [],
126
+ newColorList = [],
127
+ lastIndex = colorList.length - 1;
128
+
129
+ $.each( colorList, function( index, val ) {
130
+ var color = val,
131
+ perc = false,
132
+ match = val.match(/1?[0-9]{1,2}%$/);
133
+
134
+ if ( match ) {
135
+ color = val.replace(/\s?1?[0-9]{1,2}%$/, '');
136
+ perc = match.shift();
137
+ }
138
+ colors.push( color );
139
+ percs.push( perc );
140
+ });
141
+
142
+ // back fill first and last
143
+ if ( percs[0] === false )
144
+ percs[0] = '0%';
145
+
146
+ if ( percs[lastIndex] === false )
147
+ percs[lastIndex] = '100%';
148
+
149
+ percs = backFillColorStops( percs );
150
+
151
+ $.each( percs, function( i ){
152
+ newColorList[i] = { color: colors[i], stop: percs[i] };
153
+ });
154
+ return newColorList;
155
+ }
156
+
157
+ function backFillColorStops( stops ) {
158
+ var first = 0,
159
+ last = stops.length - 1,
160
+ i = 0,
161
+ foundFirst = false,
162
+ incr,
163
+ steps,
164
+ step,
165
+ firstVal;
166
+
167
+ if ( stops.length <= 2 || $.inArray( false, stops ) < 0 ) {
168
+ return stops;
169
+ }
170
+ while ( i < stops.length - 1 ) {
171
+ if ( ! foundFirst && stops[i] === false ) {
172
+ first = i - 1;
173
+ foundFirst = true;
174
+ } else if ( foundFirst && stops[i] !== false ) {
175
+ last = i;
176
+ i = stops.length;
177
+ }
178
+ i++;
179
+ }
180
+ steps = last - first;
181
+ firstVal = parseInt( stops[first].replace('%'), 10 );
182
+ incr = ( parseFloat( stops[last].replace('%') ) - firstVal ) / steps;
183
+ i = first + 1;
184
+ step = 1;
185
+ while ( i < last ) {
186
+ stops[i] = ( firstVal + ( step * incr ) ) + '%';
187
+ step++;
188
+ i++;
189
+ }
190
+ return backFillColorStops( stops );
191
+ }
192
+
193
+ $.fn.ctcgrad = function( origin ) {
194
+ var args = arguments;
195
+ // this'll be oldishIE
196
+ if ( nonGradientIE )
197
  $(this).css('filter',
198
+ stupidIEGradient.apply( this, args ));
199
+ else // new hotness
200
+ $( this ).css( 'backgroundImage', createGradient.apply( this, args ) );
201
+ };
202
 
203
  }( jQuery ));
js/jquery-ui-selectmenu.js CHANGED
@@ -4,15 +4,15 @@
4
  * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
5
 
6
  (function( factory ) {
7
- if ( typeof define === "function" && define.amd ) {
8
 
9
- // AMD. Register as an anonymous module.
10
- define([ "jquery" ], factory );
11
- } else {
12
 
13
- // Browser globals
14
- factory( jQuery );
15
- }
16
  }(function( $ ) {
17
 
18
 
@@ -29,219 +29,219 @@
29
 
30
 
31
  var widget_uuid = 0,
32
- widget_slice = Array.prototype.slice;
33
 
34
  $.cleanData = (function( orig ) {
35
- return function( elems ) {
36
- var events, elem, i;
37
- for ( i = 0; (elem = elems[i]) != null; i++ ) {
38
- try {
39
-
40
- // Only trigger remove when necessary to save time
41
- events = $._data( elem, "events" );
42
- if ( events && events.remove ) {
43
- $( elem ).triggerHandler( "remove" );
44
- }
45
-
46
- // http://bugs.jquery.com/ticket/8235
47
- } catch ( e ) {}
48
- }
49
- orig( elems );
50
- };
51
  })( $.cleanData );
52
 
53
  $.widget = function( name, base, prototype ) {
54
- var fullName, existingConstructor, constructor, basePrototype,
55
- // proxiedPrototype allows the provided prototype to remain unmodified
56
- // so that it can be used as a mixin for multiple widgets (#8876)
57
- proxiedPrototype = {},
58
- namespace = name.split( "." )[ 0 ];
59
-
60
- name = name.split( "." )[ 1 ];
61
- fullName = namespace + "-" + name;
62
-
63
- if ( !prototype ) {
64
- prototype = base;
65
- base = $.Widget;
66
- }
67
-
68
- // create selector for plugin
69
- $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
70
- return !!$.data( elem, fullName );
71
- };
72
-
73
- $[ namespace ] = $[ namespace ] || {};
74
- existingConstructor = $[ namespace ][ name ];
75
- constructor = $[ namespace ][ name ] = function( options, element ) {
76
- // allow instantiation without "new" keyword
77
- if ( !this._createWidget ) {
78
- return new constructor( options, element );
79
- }
80
-
81
- // allow instantiation without initializing for simple inheritance
82
- // must use "new" keyword (the code above always passes args)
83
- if ( arguments.length ) {
84
- this._createWidget( options, element );
85
- }
86
- };
87
- // extend with the existing constructor to carry over any static properties
88
- $.extend( constructor, existingConstructor, {
89
- version: prototype.version,
90
- // copy the object used to create the prototype in case we need to
91
- // redefine the widget later
92
- _proto: $.extend( {}, prototype ),
93
- // track widgets that inherit from this widget in case this widget is
94
- // redefined after a widget inherits from it
95
- _childConstructors: []
96
- });
97
-
98
- basePrototype = new base();
99
- // we need to make the options hash a property directly on the new instance
100
- // otherwise we'll modify the options hash on the prototype that we're
101
- // inheriting from
102
- basePrototype.options = $.widget.extend( {}, basePrototype.options );
103
- $.each( prototype, function( prop, value ) {
104
- if ( !$.isFunction( value ) ) {
105
- proxiedPrototype[ prop ] = value;
106
- return;
107
- }
108
- proxiedPrototype[ prop ] = (function() {
109
- var _super = function() {
110
- return base.prototype[ prop ].apply( this, arguments );
111
- },
112
- _superApply = function( args ) {
113
- return base.prototype[ prop ].apply( this, args );
114
- };
115
- return function() {
116
- var __super = this._super,
117
- __superApply = this._superApply,
118
- returnValue;
119
-
120
- this._super = _super;
121
- this._superApply = _superApply;
122
-
123
- returnValue = value.apply( this, arguments );
124
-
125
- this._super = __super;
126
- this._superApply = __superApply;
127
-
128
- return returnValue;
129
- };
130
- })();
131
- });
132
- constructor.prototype = $.widget.extend( basePrototype, {
133
- // TODO: remove support for widgetEventPrefix
134
- // always use the name + a colon as the prefix, e.g., draggable:start
135
- // don't prefix for widgets that aren't DOM-based
136
- widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
137
- }, proxiedPrototype, {
138
- constructor: constructor,
139
- namespace: namespace,
140
- widgetName: name,
141
- widgetFullName: fullName
142
- });
143
-
144
- // If this widget is being redefined then we need to find all widgets that
145
- // are inheriting from it and redefine all of them so that they inherit from
146
- // the new version of this widget. We're essentially trying to replace one
147
- // level in the prototype chain.
148
- if ( existingConstructor ) {
149
- $.each( existingConstructor._childConstructors, function( i, child ) {
150
- var childPrototype = child.prototype;
151
-
152
- // redefine the child widget using the same prototype that was
153
- // originally used, but inherit from the new version of the base
154
- $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
155
- });
156
- // remove the list of existing child constructors from the old constructor
157
- // so the old child constructors can be garbage collected
158
- delete existingConstructor._childConstructors;
159
- } else {
160
- base._childConstructors.push( constructor );
161
- }
162
-
163
- $.widget.bridge( name, constructor );
164
-
165
- return constructor;
166
  };
167
 
168
  $.widget.extend = function( target ) {
169
- var input = widget_slice.call( arguments, 1 ),
170
- inputIndex = 0,
171
- inputLength = input.length,
172
- key,
173
- value;
174
- for ( ; inputIndex < inputLength; inputIndex++ ) {
175
- for ( key in input[ inputIndex ] ) {
176
- value = input[ inputIndex ][ key ];
177
- if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
178
- // Clone objects
179
- if ( $.isPlainObject( value ) ) {
180
- target[ key ] = $.isPlainObject( target[ key ] ) ?
181
- $.widget.extend( {}, target[ key ], value ) :
182
- // Don't extend strings, arrays, etc. with objects
183
- $.widget.extend( {}, value );
184
- // Copy everything else by reference
185
- } else {
186
- target[ key ] = value;
187
- }
188
- }
189
- }
190
- }
191
- return target;
192
  };
193
 
194
  $.widget.bridge = function( name, object ) {
195
- var fullName = object.prototype.widgetFullName || name;
196
- $.fn[ name ] = function( options ) {
197
- var isMethodCall = typeof options === "string",
198
- args = widget_slice.call( arguments, 1 ),
199
- returnValue = this;
200
-
201
- // allow multiple hashes to be passed on init
202
- options = !isMethodCall && args.length ?
203
- $.widget.extend.apply( null, [ options ].concat(args) ) :
204
- options;
205
-
206
- if ( isMethodCall ) {
207
- this.each(function() {
208
- var methodValue,
209
- instance = $.data( this, fullName );
210
- if ( options === "instance" ) {
211
- returnValue = instance;
212
- return false;
213
- }
214
- if ( !instance ) {
215
- return $.error( "cannot call methods on " + name + " prior to initialization; " +
216
- "attempted to call method '" + options + "'" );
217
- }
218
- if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
219
- return $.error( "no such method '" + options + "' for " + name + " widget instance" );
220
- }
221
- methodValue = instance[ options ].apply( instance, args );
222
- if ( methodValue !== instance && methodValue !== undefined ) {
223
- returnValue = methodValue && methodValue.jquery ?
224
- returnValue.pushStack( methodValue.get() ) :
225
- methodValue;
226
- return false;
227
- }
228
- });
229
- } else {
230
- this.each(function() {
231
- var instance = $.data( this, fullName );
232
- if ( instance ) {
233
- instance.option( options || {} );
234
- if ( instance._init ) {
235
- instance._init();
236
- }
237
- } else {
238
- $.data( this, fullName, new object( options, this ) );
239
- }
240
- });
241
- }
242
-
243
- return returnValue;
244
- };
245
  };
246
 
247
  $.Widget = function( /* options, element */ ) {};
@@ -250,316 +250,316 @@ $.Widget = function( /* options, element */ ) {};
250
  $.Widget._childConstructors = [];
251
 
252
  $.Widget.prototype = {
253
- widgetName: "widget",
254
- widgetEventPrefix: "",
255
- defaultElement: "<div>",
256
- options: {
257
- disabled: false,
258
-
259
- // callbacks
260
- create: null
261
- },
262
- _createWidget: function( options, element ) {
263
- element = $( element || this.defaultElement || this )[ 0 ];
264
- this.element = $( element );
265
- this.uuid = widget_uuid++;
266
- this.eventNamespace = "." + this.widgetName + this.uuid;
267
-
268
- this.bindings = $();
269
- this.hoverable = $();
270
- this.focusable = $();
271
-
272
- if ( element !== this ) {
273
- $.data( element, this.widgetFullName, this );
274
- this._on( true, this.element, {
275
- remove: function( event ) {
276
- if ( event.target === element ) {
277
- this.destroy();
278
- }
279
- }
280
- });
281
- this.document = $( element.style ?
282
- // element within the document
283
- element.ownerDocument :
284
- // element is window or document
285
- element.document || element );
286
- this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
287
- }
288
-
289
- this.options = $.widget.extend( {},
290
- this.options,
291
- this._getCreateOptions(),
292
- options );
293
-
294
- this._create();
295
- this._trigger( "create", null, this._getCreateEventData() );
296
- this._init();
297
- },
298
- _getCreateOptions: $.noop,
299
- _getCreateEventData: $.noop,
300
- _create: $.noop,
301
- _init: $.noop,
302
-
303
- destroy: function() {
304
- this._destroy();
305
- // we can probably remove the unbind calls in 2.0
306
- // all event bindings should go through this._on()
307
- this.element
308
- .unbind( this.eventNamespace )
309
- .removeData( this.widgetFullName )
310
- // support: jquery <1.6.4
311
- // http://bugs.jquery.com/ticket/9413
312
- .removeData( $.camelCase( this.widgetFullName ) );
313
- this.widget()
314
- .unbind( this.eventNamespace )
315
- .removeAttr( "aria-disabled" )
316
- .removeClass(
317
- this.widgetFullName + "-disabled " +
318
- "ui-state-disabled" );
319
-
320
- // clean up events and states
321
- this.bindings.unbind( this.eventNamespace );
322
- this.hoverable.removeClass( "ui-state-hover" );
323
- this.focusable.removeClass( "ui-state-focus" );
324
- },
325
- _destroy: $.noop,
326
-
327
- widget: function() {
328
- return this.element;
329
- },
330
-
331
- option: function( key, value ) {
332
- var options = key,
333
- parts,
334
- curOption,
335
- i;
336
-
337
- if ( arguments.length === 0 ) {
338
- // don't return a reference to the internal hash
339
- return $.widget.extend( {}, this.options );
340
- }
341
-
342
- if ( typeof key === "string" ) {
343
- // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
344
- options = {};
345
- parts = key.split( "." );
346
- key = parts.shift();
347
- if ( parts.length ) {
348
- curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
349
- for ( i = 0; i < parts.length - 1; i++ ) {
350
- curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
351
- curOption = curOption[ parts[ i ] ];
352
- }
353
- key = parts.pop();
354
- if ( arguments.length === 1 ) {
355
- return curOption[ key ] === undefined ? null : curOption[ key ];
356
- }
357
- curOption[ key ] = value;
358
- } else {
359
- if ( arguments.length === 1 ) {
360
- return this.options[ key ] === undefined ? null : this.options[ key ];
361
- }
362
- options[ key ] = value;
363
- }
364
- }
365
-
366
- this._setOptions( options );
367
-
368
- return this;
369
- },
370
- _setOptions: function( options ) {
371
- var key;
372
-
373
- for ( key in options ) {
374
- this._setOption( key, options[ key ] );
375
- }
376
-
377
- return this;
378
- },
379
- _setOption: function( key, value ) {
380
- this.options[ key ] = value;
381
-
382
- if ( key === "disabled" ) {
383
- this.widget()
384
- .toggleClass( this.widgetFullName + "-disabled", !!value );
385
-
386
- // If the widget is becoming disabled, then nothing is interactive
387
- if ( value ) {
388
- this.hoverable.removeClass( "ui-state-hover" );
389
- this.focusable.removeClass( "ui-state-focus" );
390
- }
391
- }
392
-
393
- return this;
394
- },
395
-
396
- enable: function() {
397
- return this._setOptions({ disabled: false });
398
- },
399
- disable: function() {
400
- return this._setOptions({ disabled: true });
401
- },
402
-
403
- _on: function( suppressDisabledCheck, element, handlers ) {
404
- var delegateElement,
405
- instance = this;
406
-
407
- // no suppressDisabledCheck flag, shuffle arguments
408
- if ( typeof suppressDisabledCheck !== "boolean" ) {
409
- handlers = element;
410
- element = suppressDisabledCheck;
411
- suppressDisabledCheck = false;
412
- }
413
-
414
- // no element argument, shuffle and use this.element
415
- if ( !handlers ) {
416
- handlers = element;
417
- element = this.element;
418
- delegateElement = this.widget();
419
- } else {
420
- element = delegateElement = $( element );
421
- this.bindings = this.bindings.add( element );
422
- }
423
-
424
- $.each( handlers, function( event, handler ) {
425
- function handlerProxy() {
426
- // allow widgets to customize the disabled handling
427
- // - disabled as an array instead of boolean
428
- // - disabled class as method for disabling individual parts
429
- if ( !suppressDisabledCheck &&
430
- ( instance.options.disabled === true ||
431
- $( this ).hasClass( "ui-state-disabled" ) ) ) {
432
- return;
433
- }
434
- return ( typeof handler === "string" ? instance[ handler ] : handler )
435
- .apply( instance, arguments );
436
- }
437
-
438
- // copy the guid so direct unbinding works
439
- if ( typeof handler !== "string" ) {
440
- handlerProxy.guid = handler.guid =
441
- handler.guid || handlerProxy.guid || $.guid++;
442
- }
443
-
444
- var match = event.match( /^([\w:-]*)\s*(.*)$/ ),
445
- eventName = match[1] + instance.eventNamespace,
446
- selector = match[2];
447
- if ( selector ) {
448
- delegateElement.delegate( selector, eventName, handlerProxy );
449
- } else {
450
- element.bind( eventName, handlerProxy );
451
- }
452
- });
453
- },
454
-
455
- _off: function( element, eventName ) {
456
- eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) +
457
- this.eventNamespace;
458
- element.unbind( eventName ).undelegate( eventName );
459
-
460
- // Clear the stack to avoid memory leaks (#10056)
461
- this.bindings = $( this.bindings.not( element ).get() );
462
- this.focusable = $( this.focusable.not( element ).get() );
463
- this.hoverable = $( this.hoverable.not( element ).get() );
464
- },
465
-
466
- _delay: function( handler, delay ) {
467
- function handlerProxy() {
468
- return ( typeof handler === "string" ? instance[ handler ] : handler )
469
- .apply( instance, arguments );
470
- }
471
- var instance = this;
472
- return setTimeout( handlerProxy, delay || 0 );
473
- },
474
-
475
- _hoverable: function( element ) {
476
- this.hoverable = this.hoverable.add( element );
477
- this._on( element, {
478
- mouseenter: function( event ) {
479
- $( event.currentTarget ).addClass( "ui-state-hover" );
480
- },
481
- mouseleave: function( event ) {
482
- $( event.currentTarget ).removeClass( "ui-state-hover" );
483
- }
484
- });
485
- },
486
-
487
- _focusable: function( element ) {
488
- this.focusable = this.focusable.add( element );
489
- this._on( element, {
490
- focusin: function( event ) {
491
- $( event.currentTarget ).addClass( "ui-state-focus" );
492
- },
493
- focusout: function( event ) {
494
- $( event.currentTarget ).removeClass( "ui-state-focus" );
495
- }
496
- });
497
- },
498
-
499
- _trigger: function( type, event, data ) {
500
- var prop, orig,
501
- callback = this.options[ type ];
502
-
503
- data = data || {};
504
- event = $.Event( event );
505
- event.type = ( type === this.widgetEventPrefix ?
506
- type :
507
- this.widgetEventPrefix + type ).toLowerCase();
508
- // the original event may come from any element
509
- // so we need to reset the target on the new event
510
- event.target = this.element[ 0 ];
511
-
512
- // copy original event properties over to the new event
513
- orig = event.originalEvent;
514
- if ( orig ) {
515
- for ( prop in orig ) {
516
- if ( !( prop in event ) ) {
517
- event[ prop ] = orig[ prop ];
518
- }
519
- }
520
- }
521
-
522
- this.element.trigger( event, data );
523
- return !( $.isFunction( callback ) &&
524
- callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
525
- event.isDefaultPrevented() );
526
- }
527
  };
528
 
529
  $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
530
- $.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
531
- if ( typeof options === "string" ) {
532
- options = { effect: options };
533
- }
534
- var hasOptions,
535
- effectName = !options ?
536
- method :
537
- options === true || typeof options === "number" ?
538
- defaultEffect :
539
- options.effect || defaultEffect;
540
- options = options || {};
541
- if ( typeof options === "number" ) {
542
- options = { duration: options };
543
- }
544
- hasOptions = !$.isEmptyObject( options );
545
- options.complete = callback;
546
- if ( options.delay ) {
547
- element.delay( options.delay );
548
- }
549
- if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
550
- element[ method ]( options );
551
- } else if ( effectName !== method && element[ effectName ] ) {
552
- element[ effectName ]( options.duration, options.easing, callback );
553
- } else {
554
- element.queue(function( next ) {
555
- $( this )[ method ]();
556
- if ( callback ) {
557
- callback.call( element[ 0 ] );
558
- }
559
- next();
560
- });
561
- }
562
- };
563
  });
564
 
565
  var widget = $.widget;
@@ -580,621 +580,621 @@ var widget = $.widget;
580
 
581
 
582
  var menu = $.widget( "ui.menu", {
583
- version: "1.11.2",
584
- defaultElement: "<ul>",
585
- delay: 300,
586
- options: {
587
- icons: {
588
- submenu: "ui-icon-carat-1-e"
589
- },
590
- items: "> *",
591
- menus: "ul",
592
- position: {
593
- my: "left-1 top",
594
- at: "right top"
595
- },
596
- role: "menu",
597
-
598
- // callbacks
599
- blur: null,
600
- focus: null,
601
- select: null
602
- },
603
-
604
- _create: function() {
605
- this.activeMenu = this.element;
606
-
607
- // Flag used to prevent firing of the click handler
608
- // as the event bubbles up through nested menus
609
- this.mouseHandled = false;
610
- this.element
611
- .uniqueId()
612
- .addClass( "ui-menu ui-widget ui-widget-content" )
613
- .toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length )
614
- .attr({
615
- role: this.options.role,
616
- tabIndex: 0
617
- });
618
-
619
- if ( this.options.disabled ) {
620
- this.element
621
- .addClass( "ui-state-disabled" )
622
- .attr( "aria-disabled", "true" );
623
- }
624
-
625
- this._on({
626
- // Prevent focus from sticking to links inside menu after clicking
627
- // them (focus should always stay on UL during navigation).
628
- "mousedown .ui-menu-item": function( event ) {
629
- event.preventDefault();
630
- },
631
- "click .ui-menu-item": function( event ) {
632
- var target = $( event.target );
633
- if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
634
- this.select( event );
635
-
636
- // Only set the mouseHandled flag if the event will bubble, see #9469.
637
- if ( !event.isPropagationStopped() ) {
638
- this.mouseHandled = true;
639
- }
640
-
641
- // Open submenu on click
642
- if ( target.has( ".ui-menu" ).length ) {
643
- this.expand( event );
644
- } else if ( !this.element.is( ":focus" ) && $( this.document[ 0 ].activeElement ).closest( ".ui-menu" ).length ) {
645
-
646
- // Redirect focus to the menu
647
- this.element.trigger( "focus", [ true ] );
648
-
649
- // If the active item is on the top level, let it stay active.
650
- // Otherwise, blur the active item since it is no longer visible.
651
- if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
652
- clearTimeout( this.timer );
653
- }
654
- }
655
- }
656
- },
657
- "mouseenter .ui-menu-item": function( event ) {
658
- // Ignore mouse events while typeahead is active, see #10458.
659
- // Prevents focusing the wrong item when typeahead causes a scroll while the mouse
660
- // is over an item in the menu
661
- if ( this.previousFilter ) {
662
- return;
663
- }
664
- var target = $( event.currentTarget );
665
- // Remove ui-state-active class from siblings of the newly focused menu item
666
- // to avoid a jump caused by adjacent elements both having a class with a border
667
- target.siblings( ".ui-state-active" ).removeClass( "ui-state-active" );
668
- this.focus( event, target );
669
- },
670
- mouseleave: "collapseAll",
671
- "mouseleave .ui-menu": "collapseAll",
672
- focus: function( event, keepActiveItem ) {
673
- // If there's already an active item, keep it active
674
- // If not, activate the first item
675
- var item = this.active || this.element.find( this.options.items ).eq( 0 );
676
-
677
- if ( !keepActiveItem ) {
678
- this.focus( event, item );
679
- }
680
- },
681
- blur: function( event ) {
682
- this._delay(function() {
683
- if ( !$.contains( this.element[0], this.document[0].activeElement ) ) {
684
- this.collapseAll( event );
685
- }
686
- });
687
- },
688
- keydown: "_keydown"
689
- });
690
-
691
- this.refresh();
692
-
693
- // Clicks outside of a menu collapse any open menus
694
- this._on( this.document, {
695
- click: function( event ) {
696
- if ( this._closeOnDocumentClick( event ) ) {
697
- this.collapseAll( event );
698
- }
699
-
700
- // Reset the mouseHandled flag
701
- this.mouseHandled = false;
702
- }
703
- });
704
- },
705
-
706
- _destroy: function() {
707
- // Destroy (sub)menus
708
- this.element
709
- .removeAttr( "aria-activedescendant" )
710
- .find( ".ui-menu" ).addBack()
711
- .removeClass( "ui-menu ui-widget ui-widget-content ui-menu-icons ui-front" )
712
- .removeAttr( "role" )
713
- .removeAttr( "tabIndex" )
714
- .removeAttr( "aria-labelledby" )
715
- .removeAttr( "aria-expanded" )
716
- .removeAttr( "aria-hidden" )
717
- .removeAttr( "aria-disabled" )
718
- .removeUniqueId()
719
- .show();
720
-
721
- // Destroy menu items
722
- this.element.find( ".ui-menu-item" )
723
- .removeClass( "ui-menu-item" )
724
- .removeAttr( "role" )
725
- .removeAttr( "aria-disabled" )
726
- .removeUniqueId()
727
- .removeClass( "ui-state-hover" )
728
- .removeAttr( "tabIndex" )
729
- .removeAttr( "role" )
730
- .removeAttr( "aria-haspopup" )
731
- .children().each( function() {
732
- var elem = $( this );
733
- if ( elem.data( "ui-menu-submenu-carat" ) ) {
734
- elem.remove();
735
- }
736
- });
737
-
738
- // Destroy menu dividers
739
- this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" );
740
- },
741
-
742
- _keydown: function( event ) {
743
- var match, prev, character, skip,
744
- preventDefault = true;
745
-
746
- switch ( event.keyCode ) {
747
- case $.ui.keyCode.PAGE_UP:
748
- this.previousPage( event );
749
- break;
750
- case $.ui.keyCode.PAGE_DOWN:
751
- this.nextPage( event );
752
- break;
753
- case $.ui.keyCode.HOME:
754
- this._move( "first", "first", event );
755
- break;
756
- case $.ui.keyCode.END:
757
- this._move( "last", "last", event );
758
- break;
759
- case $.ui.keyCode.UP:
760
- this.previous( event );
761
- break;
762
- case $.ui.keyCode.DOWN:
763
- this.next( event );
764
- break;
765
- case $.ui.keyCode.LEFT:
766
- this.collapse( event );
767
- break;
768
- case $.ui.keyCode.RIGHT:
769
- if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
770
- this.expand( event );
771
- }
772
- break;
773
- case $.ui.keyCode.ENTER:
774
- case $.ui.keyCode.SPACE:
775
- this._activate( event );
776
- break;
777
- case $.ui.keyCode.ESCAPE:
778
- this.collapse( event );
779
- break;
780
- default:
781
- preventDefault = false;
782
- prev = this.previousFilter || "";
783
- character = String.fromCharCode( event.keyCode );
784
- skip = false;
785
-
786
- clearTimeout( this.filterTimer );
787
-
788
- if ( character === prev ) {
789
- skip = true;
790
- } else {
791
- character = prev + character;
792
- }
793
-
794
- match = this._filterMenuItems( character );
795
- match = skip && match.index( this.active.next() ) !== -1 ?
796
- this.active.nextAll( ".ui-menu-item" ) :
797
- match;
798
-
799
- // If no matches on the current filter, reset to the last character pressed
800
- // to move down the menu to the first item that starts with that character
801
- if ( !match.length ) {
802
- character = String.fromCharCode( event.keyCode );
803
- match = this._filterMenuItems( character );
804
- }
805
-
806
- if ( match.length ) {
807
- this.focus( event, match );
808
- this.previousFilter = character;
809
- this.filterTimer = this._delay(function() {
810
- delete this.previousFilter;
811
- }, 1000 );
812
- } else {
813
- delete this.previousFilter;
814
- }
815
- }
816
-
817
- if ( preventDefault ) {
818
- event.preventDefault();
819
- }
820
- },
821
-
822
- _activate: function( event ) {
823
- if ( !this.active.is( ".ui-state-disabled" ) ) {
824
- if ( this.active.is( "[aria-haspopup='true']" ) ) {
825
- this.expand( event );
826
- } else {
827
- this.select( event );
828
- }
829
- }
830
- },
831
-
832
- refresh: function() {
833
- var menus, items,
834
- that = this,
835
- icon = this.options.icons.submenu,
836
- submenus = this.element.find( this.options.menus );
837
-
838
- this.element.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length );
839
-
840
- // Initialize nested menus
841
- submenus.filter( ":not(.ui-menu)" )
842
- .addClass( "ui-menu ui-widget ui-widget-content ui-front" )
843
- .hide()
844
- .attr({
845
- role: this.options.role,
846
- "aria-hidden": "true",
847
- "aria-expanded": "false"
848
- })
849
- .each(function() {
850
- var menu = $( this ),
851
- item = menu.parent(),
852
- submenuCarat = $( "<span>" )
853
- .addClass( "ui-menu-icon ui-icon " + icon )
854
- .data( "ui-menu-submenu-carat", true );
855
-
856
- item
857
- .attr( "aria-haspopup", "true" )
858
- .prepend( submenuCarat );
859
- menu.attr( "aria-labelledby", item.attr( "id" ) );
860
- });
861
-
862
- menus = submenus.add( this.element );
863
- items = menus.find( this.options.items );
864
-
865
- // Initialize menu-items containing spaces and/or dashes only as dividers
866
- items.not( ".ui-menu-item" ).each(function() {
867
- var item = $( this );
868
- if ( that._isDivider( item ) ) {
869
- item.addClass( "ui-widget-content ui-menu-divider" );
870
- }
871
- });
872
-
873
- // Don't refresh list items that are already adapted
874
- items.not( ".ui-menu-item, .ui-menu-divider" )
875
- .addClass( "ui-menu-item" )
876
- .uniqueId()
877
- .attr({
878
- tabIndex: -1,
879
- role: this._itemRole()
880
- });
881
-
882
- // Add aria-disabled attribute to any disabled menu item
883
- items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
884
-
885
- // If the active item has been removed, blur the menu
886
- if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
887
- this.blur();
888
- }
889
- },
890
-
891
- _itemRole: function() {
892
- return {
893
- menu: "menuitem",
894
- listbox: "option"
895
- }[ this.options.role ];
896
- },
897
-
898
- _setOption: function( key, value ) {
899
- if ( key === "icons" ) {
900
- this.element.find( ".ui-menu-icon" )
901
- .removeClass( this.options.icons.submenu )
902
- .addClass( value.submenu );
903
- }
904
- if ( key === "disabled" ) {
905
- this.element
906
- .toggleClass( "ui-state-disabled", !!value )
907
- .attr( "aria-disabled", value );
908
- }
909
- this._super( key, value );
910
- },
911
-
912
- focus: function( event, item ) {
913
- var nested, focused;
914
- this.blur( event, event && event.type === "focus" );
915
-
916
- this._scrollIntoView( item );
917
-
918
- this.active = item.first();
919
- focused = this.active.addClass( "ui-state-focus" ).removeClass( "ui-state-active" );
920
- // Only update aria-activedescendant if there's a role
921
- // otherwise we assume focus is managed elsewhere
922
- if ( this.options.role ) {
923
- this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
924
- }
925
-
926
- // Highlight active parent menu item, if any
927
- this.active
928
- .parent()
929
- .closest( ".ui-menu-item" )
930
- .addClass( "ui-state-active" );
931
-
932
- if ( event && event.type === "keydown" ) {
933
- this._close();
934
- } else {
935
- this.timer = this._delay(function() {
936
- this._close();
937
- }, this.delay );
938
- }
939
-
940
- nested = item.children( ".ui-menu" );
941
- if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
942
- this._startOpening(nested);
943
- }
944
- this.activeMenu = item.parent();
945
-
946
- this._trigger( "focus", event, { item: item } );
947
- },
948
-
949
- _scrollIntoView: function( item ) {
950
- var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
951
- if ( this._hasScroll() ) {
952
- borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0;
953
- paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0;
954
- offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
955
- scroll = this.activeMenu.scrollTop();
956
- elementHeight = this.activeMenu.height();
957
- itemHeight = item.outerHeight();
958
-
959
- if ( offset < 0 ) {
960
- this.activeMenu.scrollTop( scroll + offset );
961
- } else if ( offset + itemHeight > elementHeight ) {
962
- this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
963
- }
964
- }
965
- },
966
-
967
- blur: function( event, fromFocus ) {
968
- if ( !fromFocus ) {
969
- clearTimeout( this.timer );
970
- }
971
-
972
- if ( !this.active ) {
973
- return;
974
- }
975
-
976
- this.active.removeClass( "ui-state-focus" );
977
- this.active = null;
978
-
979
- this._trigger( "blur", event, { item: this.active } );
980
- },
981
-
982
- _startOpening: function( submenu ) {
983
- clearTimeout( this.timer );
984
-
985
- // Don't open if already open fixes a Firefox bug that caused a .5 pixel
986
- // shift in the submenu position when mousing over the carat icon
987
- if ( submenu.attr( "aria-hidden" ) !== "true" ) {
988
- return;
989
- }
990
-
991
- this.timer = this._delay(function() {
992
- this._close();
993
- this._open( submenu );
994
- }, this.delay );
995
- },
996
-
997
- _open: function( submenu ) {
998
- var position = $.extend({
999
- of: this.active
1000
- }, this.options.position );
1001
-
1002
- clearTimeout( this.timer );
1003
- this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
1004
- .hide()
1005
- .attr( "aria-hidden", "true" );
1006
-
1007
- submenu
1008
- .show()
1009
- .removeAttr( "aria-hidden" )
1010
- .attr( "aria-expanded", "true" )
1011
- .position( position );
1012
- },
1013
-
1014
- collapseAll: function( event, all ) {
1015
- clearTimeout( this.timer );
1016
- this.timer = this._delay(function() {
1017
- // If we were passed an event, look for the submenu that contains the event
1018
- var currentMenu = all ? this.element :
1019
- $( event && event.target ).closest( this.element.find( ".ui-menu" ) );
1020
-
1021
- // If we found no valid submenu ancestor, use the main menu to close all sub menus anyway
1022
- if ( !currentMenu.length ) {
1023
- currentMenu = this.element;
1024
- }
1025
-
1026
- this._close( currentMenu );
1027
-
1028
- this.blur( event );
1029
- this.activeMenu = currentMenu;
1030
- }, this.delay );
1031
- },
1032
-
1033
- // With no arguments, closes the currently active menu - if nothing is active
1034
- // it closes all menus. If passed an argument, it will search for menus BELOW
1035
- _close: function( startMenu ) {
1036
- if ( !startMenu ) {
1037
- startMenu = this.active ? this.active.parent() : this.element;
1038
- }
1039
-
1040
- startMenu
1041
- .find( ".ui-menu" )
1042
- .hide()
1043
- .attr( "aria-hidden", "true" )
1044
- .attr( "aria-expanded", "false" )
1045
- .end()
1046
- .find( ".ui-state-active" ).not( ".ui-state-focus" )
1047
- .removeClass( "ui-state-active" );
1048
- },
1049
-
1050
- _closeOnDocumentClick: function( event ) {
1051
- return !$( event.target ).closest( ".ui-menu" ).length;
1052
- },
1053
-
1054
- _isDivider: function( item ) {
1055
-
1056
- // Match hyphen, em dash, en dash
1057
- return !/[^\-\u2014\u2013\s]/.test( item.text() );
1058
- },
1059
-
1060
- collapse: function( event ) {
1061
- var newItem = this.active &&
1062
- this.active.parent().closest( ".ui-menu-item", this.element );
1063
- if ( newItem && newItem.length ) {
1064
- this._close();
1065
- this.focus( event, newItem );
1066
- }
1067
- },
1068
-
1069
- expand: function( event ) {
1070
- var newItem = this.active &&
1071
- this.active
1072
- .children( ".ui-menu " )
1073
- .find( this.options.items )
1074
- .first();
1075
-
1076
- if ( newItem && newItem.length ) {
1077
- this._open( newItem.parent() );
1078
-
1079
- // Delay so Firefox will not hide activedescendant change in expanding submenu from AT
1080
- this._delay(function() {
1081
- this.focus( event, newItem );
1082
- });
1083
- }
1084
- },
1085
-
1086
- next: function( event ) {
1087
- this._move( "next", "first", event );
1088
- },
1089
-
1090
- previous: function( event ) {
1091
- this._move( "prev", "last", event );
1092
- },
1093
-
1094
- isFirstItem: function() {
1095
- return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
1096
- },
1097
-
1098
- isLastItem: function() {
1099
- return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
1100
- },
1101
-
1102
- _move: function( direction, filter, event ) {
1103
- var next;
1104
- if ( this.active ) {
1105
- if ( direction === "first" || direction === "last" ) {
1106
- next = this.active
1107
- [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
1108
- .eq( -1 );
1109
- } else {
1110
- next = this.active
1111
- [ direction + "All" ]( ".ui-menu-item" )
1112
- .eq( 0 );
1113
- }
1114
- }
1115
- if ( !next || !next.length || !this.active ) {
1116
- next = this.activeMenu.find( this.options.items )[ filter ]();
1117
- }
1118
-
1119
- this.focus( event, next );
1120
- },
1121
-
1122
- nextPage: function( event ) {
1123
- var item, base, height;
1124
-
1125
- if ( !this.active ) {
1126
- this.next( event );
1127
- return;
1128
- }
1129
- if ( this.isLastItem() ) {
1130
- return;
1131
- }
1132
- if ( this._hasScroll() ) {
1133
- base = this.active.offset().top;
1134
- height = this.element.height();
1135
- this.active.nextAll( ".ui-menu-item" ).each(function() {
1136
- item = $( this );
1137
- return item.offset().top - base - height < 0;
1138
- });
1139
-
1140
- this.focus( event, item );
1141
- } else {
1142
- this.focus( event, this.activeMenu.find( this.options.items )
1143
- [ !this.active ? "first" : "last" ]() );
1144
- }
1145
- },
1146
-
1147
- previousPage: function( event ) {
1148
- var item, base, height;
1149
- if ( !this.active ) {
1150
- this.next( event );
1151
- return;
1152
- }
1153
- if ( this.isFirstItem() ) {
1154
- return;
1155
- }
1156
- if ( this._hasScroll() ) {
1157
- base = this.active.offset().top;
1158
- height = this.element.height();
1159
- this.active.prevAll( ".ui-menu-item" ).each(function() {
1160
- item = $( this );
1161
- return item.offset().top - base + height > 0;
1162
- });
1163
-
1164
- this.focus( event, item );
1165
- } else {
1166
- this.focus( event, this.activeMenu.find( this.options.items ).first() );
1167
- }
1168
- },
1169
-
1170
- _hasScroll: function() {
1171
- return this.element.outerHeight() < this.element.prop( "scrollHeight" );
1172
- },
1173
-
1174
- select: function( event ) {
1175
- // TODO: It should never be possible to not have an active item at this
1176
- // point, but the tests don't trigger mouseenter before click.
1177
- this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
1178
- var ui = { item: this.active };
1179
- if ( !this.active.has( ".ui-menu" ).length ) {
1180
- this.collapseAll( event, true );
1181
- }
1182
- this._trigger( "select", event, ui );
1183
- },
1184
-
1185
- _filterMenuItems: function(character) {
1186
- var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ),
1187
- regex = new RegExp( "^" + escapedCharacter, "i" );
1188
-
1189
- return this.activeMenu
1190
- .find( this.options.items )
1191
-
1192
- // Only match on items, not dividers or other content (#10571)
1193
- .filter( ".ui-menu-item" )
1194
- .filter(function() {
1195
- return regex.test( $.trim( $( this ).text() ) );
1196
- });
1197
- }
1198
  });
1199
 
1200
 
@@ -1211,590 +1211,590 @@ var menu = $.widget( "ui.menu", {
1211
 
1212
 
1213
  var selectmenu = $.widget( "ui.selectmenu", {
1214
- version: "1.11.2",
1215
- defaultElement: "<select>",
1216
- options: {
1217
- appendTo: null,
1218
- disabled: null,
1219
- icons: {
1220
- button: "ui-icon-triangle-1-s"
1221
- },
1222
- position: {
1223
- my: "left top",
1224
- at: "left bottom",
1225
- collision: "none"
1226
- },
1227
- width: null,
1228
-
1229
- // callbacks
1230
- change: null,
1231
- close: null,
1232
- focus: null,
1233
- open: null,
1234
- select: null
1235
- },
1236
-
1237
- _create: function() {
1238
- var selectmenuId = this.element.uniqueId().attr( "id" );
1239
- this.ids = {
1240
- element: selectmenuId,
1241
- button: selectmenuId + "-button",
1242
- menu: selectmenuId + "-menu"
1243
- };
1244
-
1245
- this._drawButton();
1246
- this._drawMenu();
1247
-
1248
- if ( this.options.disabled ) {
1249
- this.disable();
1250
- }
1251
- },
1252
-
1253
- _drawButton: function() {
1254
- var that = this,
1255
- tabindex = this.element.attr( "tabindex" );
1256
-
1257
- // Associate existing label with the new button
1258
- this.label = $( "label[for='" + this.ids.element + "']" ).attr( "for", this.ids.button );
1259
- this._on( this.label, {
1260
- click: function( event ) {
1261
- this.button.focus();
1262
- event.preventDefault();
1263
- }
1264
- });
1265
-
1266
- // Hide original select element
1267
- this.element.hide();
1268
-
1269
- // Create button
1270
- this.button = $( "<span>", {
1271
- "class": "ui-selectmenu-button ui-widget ui-state-default ui-corner-all",
1272
- tabindex: tabindex || this.options.disabled ? -1 : 0,
1273
- id: this.ids.button,
1274
- role: "combobox",
1275
- "aria-expanded": "false",
1276
- "aria-autocomplete": "list",
1277
- "aria-owns": this.ids.menu,
1278
- "aria-haspopup": "true"
1279
- })
1280
- .insertAfter( this.element );
1281
-
1282
- $( "<span>", {
1283
- "class": "ui-icon " + this.options.icons.button
1284
- })
1285
- .prependTo( this.button );
1286
-
1287
- this.buttonText = $( "<span>", {
1288
- "class": "ui-selectmenu-text"
1289
- })
1290
- .appendTo( this.button );
1291
-
1292
- this._setText( this.buttonText, this.element.find( "option:selected" ).text() );
1293
- this._resizeButton();
1294
-
1295
- this._on( this.button, this._buttonEvents );
1296
- this.button.one( "focusin", function() {
1297
-
1298
- // Delay rendering the menu items until the button receives focus.
1299
- // The menu may have already been rendered via a programmatic open.
1300
- if ( !that.menuItems ) {
1301
- that._refreshMenu();
1302
- }
1303
- });
1304
- this._hoverable( this.button );
1305
- this._focusable( this.button );
1306
- },
1307
-
1308
- _drawMenu: function() {
1309
- var that = this;
1310
-
1311
- // Create menu
1312
- this.menu = $( "<ul>", {
1313
- "aria-hidden": "true",
1314
- "aria-labelledby": this.ids.button,
1315
- id: this.ids.menu
1316
- });
1317
-
1318
- // Wrap menu
1319
- this.menuWrap = $( "<div>", {
1320
- "class": "ui-selectmenu-menu ui-front"
1321
- })
1322
- .append( this.menu )
1323
- .appendTo( this._appendTo() );
1324
-
1325
- // Initialize menu widget
1326
- this.menuInstance = this.menu
1327
- .menu({
1328
- role: "listbox",
1329
- select: function( event, ui ) {
1330
- event.preventDefault();
1331
-
1332
- // support: IE8
1333
- // If the item was selected via a click, the text selection
1334
- // will be destroyed in IE
1335
- that._setSelection();
1336
-
1337
- that._select( ui.item.data( "ui-selectmenu-item" ), event );
1338
- },
1339
- focus: function( event, ui ) {
1340
- var item = ui.item.data( "ui-selectmenu-item" );
1341
-
1342
- // Prevent inital focus from firing and check if its a newly focused item
1343
- if ( that.focusIndex != null && item.index !== that.focusIndex ) {
1344
- that._trigger( "focus", event, { item: item } );
1345
- if ( !that.isOpen ) {
1346
- that._select( item, event );
1347
- }
1348
- }
1349
- that.focusIndex = item.index;
1350
-
1351
- that.button.attr( "aria-activedescendant",
1352
- that.menuItems.eq( item.index ).attr( "id" ) );
1353
- }
1354
- })
1355
- .menu( "instance" );
1356
-
1357
- // Adjust menu styles to dropdown
1358
- this.menu
1359
- .addClass( "ui-corner-bottom" )
1360
- .removeClass( "ui-corner-all" );
1361
-
1362
- // Don't close the menu on mouseleave
1363
- this.menuInstance._off( this.menu, "mouseleave" );
1364
-
1365
- // Cancel the menu's collapseAll on document click
1366
- this.menuInstance._closeOnDocumentClick = function() {
1367
- return false;
1368
- };
1369
-
1370
- // Selects often contain empty items, but never contain dividers
1371
- this.menuInstance._isDivider = function() {
1372
- return false;
1373
- };
1374
- },
1375
-
1376
- refresh: function() {
1377
- this._refreshMenu();
1378
- this._setText( this.buttonText, this._getSelectedItem().text() );
1379
- if ( !this.options.width ) {
1380
- this._resizeButton();
1381
- }
1382
- },
1383
-
1384
- _refreshMenu: function() {
1385
- this.menu.empty();
1386
-
1387
- var item,
1388
- options = this.element.find( "option" );
1389
-
1390
- if ( !options.length ) {
1391
- return;
1392
- }
1393
-
1394
- this._parseOptions( options );
1395
- this._renderMenu( this.menu, this.items );
1396
-
1397
- this.menuInstance.refresh();
1398
- this.menuItems = this.menu.find( "li" ).not( ".ui-selectmenu-optgroup" );
1399
-
1400
- item = this._getSelectedItem();
1401
-
1402
- // Update the menu to have the correct item focused
1403
- this.menuInstance.focus( null, item );
1404
- this._setAria( item.data( "ui-selectmenu-item" ) );
1405
-
1406
- // Set disabled state
1407
- this._setOption( "disabled", this.element.prop( "disabled" ) );
1408
- },
1409
-
1410
- open: function( event ) {
1411
- if ( this.options.disabled ) {
1412
- return;
1413
- }
1414
-
1415
- // If this is the first time the menu is being opened, render the items
1416
- if ( !this.menuItems ) {
1417
- this._refreshMenu();
1418
- } else {
1419
-
1420
- // Menu clears focus on close, reset focus to selected item
1421
- this.menu.find( ".ui-state-focus" ).removeClass( "ui-state-focus" );
1422
- this.menuInstance.focus( null, this._getSelectedItem() );
1423
- }
1424
-
1425
- this.isOpen = true;
1426
- this._toggleAttr();
1427
- this._resizeMenu();
1428
- this._position();
1429
-
1430
- this._on( this.document, this._documentClick );
1431
-
1432
- this._trigger( "open", event );
1433
- },
1434
-
1435
- _position: function() {
1436
- this.menuWrap.position( $.extend( { of: this.button }, this.options.position ) );
1437
- },
1438
-
1439
- close: function( event ) {
1440
- if ( !this.isOpen ) {
1441
- return;
1442
- }
1443
-
1444
- this.isOpen = false;
1445
- this._toggleAttr();
1446
-
1447
- this.range = null;
1448
- this._off( this.document );
1449
-
1450
- this._trigger( "close", event );
1451
- },
1452
-
1453
- widget: function() {
1454
- return this.button;
1455
- },
1456
-
1457
- menuWidget: function() {
1458
- return this.menu;
1459
- },
1460
-
1461
- _renderMenu: function( ul, items ) {
1462
- var that = this,
1463
- currentOptgroup = "";
1464
-
1465
- $.each( items, function( index, item ) {
1466
- if ( item.optgroup !== currentOptgroup ) {
1467
- $( "<li>", {
1468
- "class": "ui-selectmenu-optgroup ui-menu-divider" +
1469
- ( item.element.parent( "optgroup" ).prop( "disabled" ) ?
1470
- " ui-state-disabled" :
1471
- "" ),
1472
- text: item.optgroup
1473
- })
1474
- .appendTo( ul );
1475
-
1476
- currentOptgroup = item.optgroup;
1477
- }
1478
-
1479
- that._renderItemData( ul, item );
1480
- });
1481
- },
1482
-
1483
- _renderItemData: function( ul, item ) {
1484
- return this._renderItem( ul, item ).data( "ui-selectmenu-item", item );
1485
- },
1486
-
1487
- _renderItem: function( ul, item ) {
1488
- var li = $( "<li>" );
1489
-
1490
- if ( item.disabled ) {
1491
- li.addClass( "ui-state-disabled" );
1492
- }
1493
- this._setText( li, item.label );
1494
-
1495
- return li.appendTo( ul );
1496
- },
1497
-
1498
- _setText: function( element, value ) {
1499
- if ( value ) {
1500
- element.text( value );
1501
- } else {
1502
- element.html( "&#160;" );
1503
- }
1504
- },
1505
-
1506
- _move: function( direction, event ) {
1507
- var item, next,
1508
- filter = ".ui-menu-item";
1509
-
1510
- if ( this.isOpen ) {
1511
- item = this.menuItems.eq( this.focusIndex );
1512
- } else {
1513
- item = this.menuItems.eq( this.element[ 0 ].selectedIndex );
1514
- filter += ":not(.ui-state-disabled)";
1515
- }
1516
-
1517
- if ( direction === "first" || direction === "last" ) {
1518
- next = item[ direction === "first" ? "prevAll" : "nextAll" ]( filter ).eq( -1 );
1519
- } else {
1520
- next = item[ direction + "All" ]( filter ).eq( 0 );
1521
- }
1522
-
1523
- if ( next.length ) {
1524
- this.menuInstance.focus( event, next );
1525
- }
1526
- },
1527
-
1528
- _getSelectedItem: function() {
1529
- return this.menuItems.eq( this.element[ 0 ].selectedIndex );
1530
- },
1531
-
1532
- _toggle: function( event ) {
1533
- this[ this.isOpen ? "close" : "open" ]( event );
1534
- },
1535
-
1536
- _setSelection: function() {
1537
- var selection;
1538
-
1539
- if ( !this.range ) {
1540
- return;
1541
- }
1542
-
1543
- if ( window.getSelection ) {
1544
- selection = window.getSelection();
1545
- selection.removeAllRanges();
1546
- selection.addRange( this.range );
1547
-
1548
- // support: IE8
1549
- } else {
1550
- this.range.select();
1551
- }
1552
-
1553
- // support: IE
1554
- // Setting the text selection kills the button focus in IE, but
1555
- // restoring the focus doesn't kill the selection.
1556
- this.button.focus();
1557
- },
1558
-
1559
- _documentClick: {
1560
- mousedown: function( event ) {
1561
- if ( !this.isOpen ) {
1562
- return;
1563
- }
1564
-
1565
- if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" + this.ids.button ).length ) {
1566
- this.close( event );
1567
- }
1568
- }
1569
- },
1570
-
1571
- _buttonEvents: {
1572
-
1573
- // Prevent text selection from being reset when interacting with the selectmenu (#10144)
1574
- mousedown: function() {
1575
- var selection;
1576
-
1577
- if ( window.getSelection ) {
1578
- selection = window.getSelection();
1579
- if ( selection.rangeCount ) {
1580
- this.range = selection.getRangeAt( 0 );
1581
- }
1582
-
1583
- // support: IE8
1584
- } else {
1585
- this.range = document.selection.createRange();
1586
- }
1587
- },
1588
-
1589
- click: function( event ) {
1590
- this._setSelection();
1591
- this._toggle( event );
1592
- },
1593
-
1594
- keydown: function( event ) {
1595
- var preventDefault = true;
1596
- switch ( event.keyCode ) {
1597
- case $.ui.keyCode.TAB:
1598
- case $.ui.keyCode.ESCAPE:
1599
- this.close( event );
1600
- preventDefault = false;
1601
- break;
1602
- case $.ui.keyCode.ENTER:
1603
- if ( this.isOpen ) {
1604
- this._selectFocusedItem( event );
1605
- }
1606
- break;
1607
- case $.ui.keyCode.UP:
1608
- if ( event.altKey ) {
1609
- this._toggle( event );
1610
- } else {
1611
- this._move( "prev", event );
1612
- }
1613
- break;
1614
- case $.ui.keyCode.DOWN:
1615
- if ( event.altKey ) {
1616
- this._toggle( event );
1617
- } else {
1618
- this._move( "next", event );
1619
- }
1620
- break;
1621
- case $.ui.keyCode.SPACE:
1622
- if ( this.isOpen ) {
1623
- this._selectFocusedItem( event );
1624
- } else {
1625
- this._toggle( event );
1626
- }
1627
- break;
1628
- case $.ui.keyCode.LEFT:
1629
- this._move( "prev", event );
1630
- break;
1631
- case $.ui.keyCode.RIGHT:
1632
- this._move( "next", event );
1633
- break;
1634
- case $.ui.keyCode.HOME:
1635
- case $.ui.keyCode.PAGE_UP:
1636
- this._move( "first", event );
1637
- break;
1638
- case $.ui.keyCode.END:
1639
- case $.ui.keyCode.PAGE_DOWN:
1640
- this._move( "last", event );
1641
- break;
1642
- default:
1643
- this.menu.trigger( event );
1644
- preventDefault = false;
1645
- }
1646
-
1647
- if ( preventDefault ) {
1648
- event.preventDefault();
1649
- }
1650
- }
1651
- },
1652
-
1653
- _selectFocusedItem: function( event ) {
1654
- var item = this.menuItems.eq( this.focusIndex );
1655
- if ( !item.hasClass( "ui-state-disabled" ) ) {
1656
- this._select( item.data( "ui-selectmenu-item" ), event );
1657
- }
1658
- },
1659
-
1660
- _select: function( item, event ) {
1661
- var oldIndex = this.element[ 0 ].selectedIndex;
1662
-
1663
- // Change native select element
1664
- this.element[ 0 ].selectedIndex = item.index;
1665
- this._setText( this.buttonText, item.label );
1666
- this._setAria( item );
1667
- this._trigger( "select", event, { item: item } );
1668
-
1669
- if ( item.index !== oldIndex ) {
1670
- this._trigger( "change", event, { item: item } );
1671
- }
1672
-
1673
- this.close( event );
1674
- },
1675
-
1676
- _setAria: function( item ) {
1677
- var id = this.menuItems.eq( item.index ).attr( "id" );
1678
-
1679
- this.button.attr({
1680
- "aria-labelledby": id,
1681
- "aria-activedescendant": id
1682
- });
1683
- this.menu.attr( "aria-activedescendant", id );
1684
- },
1685
-
1686
- _setOption: function( key, value ) {
1687
- if ( key === "icons" ) {
1688
- this.button.find( "span.ui-icon" )
1689
- .removeClass( this.options.icons.button )
1690
- .addClass( value.button );
1691
- }
1692
-
1693
- this._super( key, value );
1694
-
1695
- if ( key === "appendTo" ) {
1696
- this.menuWrap.appendTo( this._appendTo() );
1697
- }
1698
-
1699
- if ( key === "disabled" ) {
1700
- this.menuInstance.option( "disabled", value );
1701
- this.button
1702
- .toggleClass( "ui-state-disabled", value )
1703
- .attr( "aria-disabled", value );
1704
-
1705
- this.element.prop( "disabled", value );
1706
- if ( value ) {
1707
- this.button.attr( "tabindex", -1 );
1708
- this.close();
1709
- } else {
1710
- this.button.attr( "tabindex", 0 );
1711
- }
1712
- }
1713
-
1714
- if ( key === "width" ) {
1715
- this._resizeButton();
1716
- }
1717
- },
1718
-
1719
- _appendTo: function() {
1720
- var element = this.options.appendTo;
1721
-
1722
- if ( element ) {
1723
- element = element.jquery || element.nodeType ?
1724
- $( element ) :
1725
- this.document.find( element ).eq( 0 );
1726
- }
1727
-
1728
- if ( !element || !element[ 0 ] ) {
1729
- element = this.element.closest( ".ui-front" );
1730
- }
1731
-
1732
- if ( !element.length ) {
1733
- element = this.document[ 0 ].body;
1734
- }
1735
-
1736
- return element;
1737
- },
1738
-
1739
- _toggleAttr: function() {
1740
- this.button
1741
- .toggleClass( "ui-corner-top", this.isOpen )
1742
- .toggleClass( "ui-corner-all", !this.isOpen )
1743
- .attr( "aria-expanded", this.isOpen );
1744
- this.menuWrap.toggleClass( "ui-selectmenu-open", this.isOpen );
1745
- this.menu.attr( "aria-hidden", !this.isOpen );
1746
- },
1747
-
1748
- _resizeButton: function() {
1749
- var width = this.options.width;
1750
-
1751
- if ( !width ) {
1752
- width = this.element.show().outerWidth();
1753
- this.element.hide();
1754
- }
1755
-
1756
- this.button.outerWidth( width );
1757
- },
1758
-
1759
- _resizeMenu: function() {
1760
- this.menu.outerWidth( Math.max(
1761
- this.button.outerWidth(),
1762
-
1763
- // support: IE10
1764
- // IE10 wraps long text (possibly a rounding bug)
1765
- // so we add 1px to avoid the wrapping
1766
- this.menu.width( "" ).outerWidth() + 1
1767
- ) );
1768
- },
1769
-
1770
- _getCreateOptions: function() {
1771
- return { disabled: this.element.prop( "disabled" ) };
1772
- },
1773
-
1774
- _parseOptions: function( options ) {
1775
- var data = [];
1776
- options.each(function( index, item ) {
1777
- var option = $( item ),
1778
- optgroup = option.parent( "optgroup" );
1779
- data.push({
1780
- element: option,
1781
- index: index,
1782
- value: option.attr( "value" ),
1783
- label: option.text(),
1784
- optgroup: optgroup.attr( "label" ) || "",
1785
- disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" )
1786
- });
1787
- });
1788
- this.items = data;
1789
- },
1790
-
1791
- _destroy: function() {
1792
- this.menuWrap.remove();
1793
- this.button.remove();
1794
- this.element.show();
1795
- this.element.removeUniqueId();
1796
- this.label.attr( "for", this.ids.element );
1797
- }
1798
  });
1799
 
1800
 
4
  * Copyright 2014 jQuery Foundation and other contributors; Licensed MIT */
5
 
6
  (function( factory ) {
7
+ if ( typeof define === "function" && define.amd ) {
8
 
9
+ // AMD. Register as an anonymous module.
10
+ define([ "jquery" ], factory );
11
+ } else {
12
 
13
+ // Browser globals
14
+ factory( jQuery );
15
+ }
16
  }(function( $ ) {
17
 
18
 
29
 
30
 
31
  var widget_uuid = 0,
32
+ widget_slice = Array.prototype.slice;
33
 
34
  $.cleanData = (function( orig ) {
35
+ return function( elems ) {
36
+ var events, elem, i;
37
+ for ( i = 0; (elem = elems[i]) != null; i++ ) {
38
+ try {
39
+
40
+ // Only trigger remove when necessary to save time
41
+ events = $._data( elem, "events" );
42
+ if ( events && events.remove ) {
43
+ $( elem ).triggerHandler( "remove" );
44
+ }
45
+
46
+ // http://bugs.jquery.com/ticket/8235
47
+ } catch ( e ) {}
48
+ }
49
+ orig( elems );
50
+ };
51
  })( $.cleanData );
52
 
53
  $.widget = function( name, base, prototype ) {
54
+ var fullName, existingConstructor, constructor, basePrototype,
55
+ // proxiedPrototype allows the provided prototype to remain unmodified
56
+ // so that it can be used as a mixin for multiple widgets (#8876)
57
+ proxiedPrototype = {},
58
+ namespace = name.split( "." )[ 0 ];
59
+
60
+ name = name.split( "." )[ 1 ];
61
+ fullName = namespace + "-" + name;
62
+
63
+ if ( !prototype ) {
64
+ prototype = base;
65
+ base = $.Widget;
66
+ }
67
+
68
+ // create selector for plugin
69
+ $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
70
+ return !!$.data( elem, fullName );
71
+ };
72
+
73
+ $[ namespace ] = $[ namespace ] || {};
74
+ existingConstructor = $[ namespace ][ name ];
75
+ constructor = $[ namespace ][ name ] = function( options, element ) {
76
+ // allow instantiation without "new" keyword
77
+ if ( !this._createWidget ) {
78
+ return new constructor( options, element );
79
+ }
80
+
81
+ // allow instantiation without initializing for simple inheritance
82
+ // must use "new" keyword (the code above always passes args)
83
+ if ( arguments.length ) {
84
+ this._createWidget( options, element );
85
+ }
86
+ };
87
+ // extend with the existing constructor to carry over any static properties
88
+ $.extend( constructor, existingConstructor, {
89
+ version: prototype.version,
90
+ // copy the object used to create the prototype in case we need to
91
+ // redefine the widget later
92
+ _proto: $.extend( {}, prototype ),
93
+ // track widgets that inherit from this widget in case this widget is
94
+ // redefined after a widget inherits from it
95
+ _childConstructors: []
96
+ });
97
+
98
+ basePrototype = new base();
99
+ // we need to make the options hash a property directly on the new instance
100
+ // otherwise we'll modify the options hash on the prototype that we're
101
+ // inheriting from
102
+ basePrototype.options = $.widget.extend( {}, basePrototype.options );
103
+ $.each( prototype, function( prop, value ) {
104
+ if ( !$.isFunction( value ) ) {
105
+ proxiedPrototype[ prop ] = value;
106
+ return;
107
+ }
108
+ proxiedPrototype[ prop ] = (function() {
109
+ var _super = function() {
110
+ return base.prototype[ prop ].apply( this, arguments );
111
+ },
112
+ _superApply = function( args ) {
113
+ return base.prototype[ prop ].apply( this, args );
114
+ };
115
+ return function() {
116
+ var __super = this._super,
117
+ __superApply = this._superApply,
118
+ returnValue;
119
+
120
+ this._super = _super;
121
+ this._superApply = _superApply;
122
+
123
+ returnValue = value.apply( this, arguments );
124
+
125
+ this._super = __super;
126
+ this._superApply = __superApply;
127
+
128
+ return returnValue;
129
+ };
130
+ })();
131
+ });
132
+ constructor.prototype = $.widget.extend( basePrototype, {
133
+ // TODO: remove support for widgetEventPrefix
134
+ // always use the name + a colon as the prefix, e.g., draggable:start
135
+ // don't prefix for widgets that aren't DOM-based
136
+ widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
137
+ }, proxiedPrototype, {
138
+ constructor: constructor,
139
+ namespace: namespace,
140
+ widgetName: name,
141
+ widgetFullName: fullName
142
+ });
143
+
144
+ // If this widget is being redefined then we need to find all widgets that
145
+ // are inheriting from it and redefine all of them so that they inherit from
146
+ // the new version of this widget. We're essentially trying to replace one
147
+ // level in the prototype chain.
148
+ if ( existingConstructor ) {
149
+ $.each( existingConstructor._childConstructors, function( i, child ) {
150
+ var childPrototype = child.prototype;
151
+
152
+ // redefine the child widget using the same prototype that was
153
+ // originally used, but inherit from the new version of the base
154
+ $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
155
+ });
156
+ // remove the list of existing child constructors from the old constructor
157
+ // so the old child constructors can be garbage collected
158
+ delete existingConstructor._childConstructors;
159
+ } else {
160
+ base._childConstructors.push( constructor );
161
+ }
162
+
163
+ $.widget.bridge( name, constructor );
164
+
165
+ return constructor;
166
  };
167
 
168
  $.widget.extend = function( target ) {
169
+ var input = widget_slice.call( arguments, 1 ),
170
+ inputIndex = 0,
171
+ inputLength = input.length,
172
+ key,
173
+ value;
174
+ for ( ; inputIndex < inputLength; inputIndex++ ) {
175
+ for ( key in input[ inputIndex ] ) {
176
+ value = input[ inputIndex ][ key ];
177
+ if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
178
+ // Clone objects
179
+ if ( $.isPlainObject( value ) ) {
180
+ target[ key ] = $.isPlainObject( target[ key ] ) ?
181
+ $.widget.extend( {}, target[ key ], value ) :
182
+ // Don't extend strings, arrays, etc. with objects
183
+ $.widget.extend( {}, value );
184
+ // Copy everything else by reference
185
+ } else {
186
+ target[ key ] = value;
187
+ }
188
+ }
189
+ }
190
+ }
191
+ return target;
192
  };
193
 
194
  $.widget.bridge = function( name, object ) {
195
+ var fullName = object.prototype.widgetFullName || name;
196
+ $.fn[ name ] = function( options ) {
197
+ var isMethodCall = typeof options === "string",
198
+ args = widget_slice.call( arguments, 1 ),
199
+ returnValue = this;
200
+
201
+ // allow multiple hashes to be passed on init
202
+ options = !isMethodCall && args.length ?
203
+ $.widget.extend.apply( null, [ options ].concat(args) ) :
204
+ options;
205
+
206
+ if ( isMethodCall ) {
207
+ this.each(function() {
208
+ var methodValue,
209
+ instance = $.data( this, fullName );
210
+ if ( options === "instance" ) {
211
+ returnValue = instance;
212
+ return false;
213
+ }
214
+ if ( !instance ) {
215
+ return $.error( "cannot call methods on " + name + " prior to initialization; " +
216
+ "attempted to call method '" + options + "'" );
217
+ }
218
+ if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
219
+ return $.error( "no such method '" + options + "' for " + name + " widget instance" );
220
+ }
221
+ methodValue = instance[ options ].apply( instance, args );
222
+ if ( methodValue !== instance && methodValue !== undefined ) {
223
+ returnValue = methodValue && methodValue.jquery ?
224
+ returnValue.pushStack( methodValue.get() ) :
225
+ methodValue;
226
+ return false;
227
+ }
228
+ });
229
+ } else {
230
+ this.each(function() {
231
+ var instance = $.data( this, fullName );
232
+ if ( instance ) {
233
+ instance.option( options || {} );
234
+ if ( instance._init ) {
235
+ instance._init();
236
+ }
237
+ } else {
238
+ $.data( this, fullName, new object( options, this ) );
239
+ }
240
+ });
241
+ }
242
+
243
+ return returnValue;
244
+ };
245
  };
246
 
247
  $.Widget = function( /* options, element */ ) {};
250
  $.Widget._childConstructors = [];
251
 
252
  $.Widget.prototype = {
253
+ widgetName: "widget",
254
+ widgetEventPrefix: "",
255
+ defaultElement: "<div>",
256
+ options: {
257
+ disabled: false,
258
+
259
+ // callbacks
260
+ create: null
261
+ },
262
+ _createWidget: function( options, element ) {
263
+ element = $( element || this.defaultElement || this )[ 0 ];
264
+ this.element = $( element );
265
+ this.uuid = widget_uuid++;
266
+ this.eventNamespace = "." + this.widgetName + this.uuid;
267
+
268
+ this.bindings = $();
269
+ this.hoverable = $();
270
+ this.focusable = $();
271
+
272
+ if ( element !== this ) {
273
+ $.data( element, this.widgetFullName, this );
274
+ this._on( true, this.element, {
275
+ remove: function( event ) {
276
+ if ( event.target === element ) {
277
+ this.destroy();
278
+ }
279
+ }
280
+ });
281
+ this.document = $( element.style ?
282
+ // element within the document
283
+ element.ownerDocument :
284
+ // element is window or document
285
+ element.document || element );
286
+ this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
287
+ }
288
+
289
+ this.options = $.widget.extend( {},
290
+ this.options,
291
+ this._getCreateOptions(),
292
+ options );
293
+
294
+ this._create();
295
+ this._trigger( "create", null, this._getCreateEventData() );
296
+ this._init();
297
+ },
298
+ _getCreateOptions: $.noop,
299
+ _getCreateEventData: $.noop,
300
+ _create: $.noop,
301
+ _init: $.noop,
302
+
303
+ destroy: function() {
304
+ this._destroy();
305
+ // we can probably remove the unbind calls in 2.0
306
+ // all event bindings should go through this._on()
307
+ this.element
308
+ .unbind( this.eventNamespace )
309
+ .removeData( this.widgetFullName )
310
+ // support: jquery <1.6.4
311
+ // http://bugs.jquery.com/ticket/9413
312
+ .removeData( $.camelCase( this.widgetFullName ) );
313
+ this.widget()
314
+ .unbind( this.eventNamespace )
315
+ .removeAttr( "aria-disabled" )
316
+ .removeClass(
317
+ this.widgetFullName + "-disabled " +
318
+ "ui-state-disabled" );
319
+
320
+ // clean up events and states
321
+ this.bindings.unbind( this.eventNamespace );
322
+ this.hoverable.removeClass( "ui-state-hover" );
323
+ this.focusable.removeClass( "ui-state-focus" );
324
+ },
325
+ _destroy: $.noop,
326
+
327
+ widget: function() {
328
+ return this.element;
329
+ },
330
+
331
+ option: function( key, value ) {
332
+ var options = key,
333
+ parts,
334
+ curOption,
335
+ i;
336
+
337
+ if ( arguments.length === 0 ) {
338
+ // don't return a reference to the internal hash
339
+ return $.widget.extend( {}, this.options );
340
+ }
341
+
342
+ if ( typeof key === "string" ) {
343
+ // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
344
+ options = {};
345
+ parts = key.split( "." );
346
+ key = parts.shift();
347
+ if ( parts.length ) {
348
+ curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
349
+ for ( i = 0; i < parts.length - 1; i++ ) {
350
+ curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
351
+ curOption = curOption[ parts[ i ] ];
352
+ }
353
+ key = parts.pop();
354
+ if ( arguments.length === 1 ) {
355
+ return curOption[ key ] === undefined ? null : curOption[ key ];
356
+ }
357
+ curOption[ key ] = value;
358
+ } else {
359
+ if ( arguments.length === 1 ) {
360
+ return this.options[ key ] === undefined ? null : this.options[ key ];
361
+ }
362
+ options[ key ] = value;
363
+ }
364
+ }
365
+
366
+ this._setOptions( options );
367
+
368
+ return this;
369
+ },
370
+ _setOptions: function( options ) {
371
+ var key;
372
+
373
+ for ( key in options ) {
374
+ this._setOption( key, options[ key ] );
375
+ }
376
+
377
+ return this;
378
+ },
379
+ _setOption: function( key, value ) {
380
+ this.options[ key ] = value;
381
+
382
+ if ( key === "disabled" ) {
383
+ this.widget()
384
+ .toggleClass( this.widgetFullName + "-disabled", !!value );
385
+
386
+ // If the widget is becoming disabled, then nothing is interactive
387
+ if ( value ) {
388
+ this.hoverable.removeClass( "ui-state-hover" );
389
+ this.focusable.removeClass( "ui-state-focus" );
390
+ }
391
+ }
392
+
393
+ return this;
394
+ },
395
+
396
+ enable: function() {
397
+ return this._setOptions({ disabled: false });
398
+ },
399
+ disable: function() {
400
+ return this._setOptions({ disabled: true });
401
+ },
402
+
403
+ _on: function( suppressDisabledCheck, element, handlers ) {
404
+ var delegateElement,
405
+ instance = this;
406
+
407
+ // no suppressDisabledCheck flag, shuffle arguments
408
+ if ( typeof suppressDisabledCheck !== "boolean" ) {
409
+ handlers = element;
410
+ element = suppressDisabledCheck;
411
+ suppressDisabledCheck = false;
412
+ }
413
+
414
+ // no element argument, shuffle and use this.element
415
+ if ( !handlers ) {
416
+ handlers = element;
417
+ element = this.element;
418
+ delegateElement = this.widget();
419
+ } else {
420
+ element = delegateElement = $( element );
421
+ this.bindings = this.bindings.add( element );
422
+ }
423
+
424
+ $.each( handlers, function( event, handler ) {
425
+ function handlerProxy() {
426
+ // allow widgets to customize the disabled handling
427
+ // - disabled as an array instead of boolean
428
+ // - disabled class as method for disabling individual parts
429
+ if ( !suppressDisabledCheck &&
430
+ ( instance.options.disabled === true ||
431
+ $( this ).hasClass( "ui-state-disabled" ) ) ) {
432
+ return;
433
+ }
434
+ return ( typeof handler === "string" ? instance[ handler ] : handler )
435
+ .apply( instance, arguments );
436
+ }
437
+
438
+ // copy the guid so direct unbinding works
439
+ if ( typeof handler !== "string" ) {
440
+ handlerProxy.guid = handler.guid =
441
+ handler.guid || handlerProxy.guid || $.guid++;
442
+ }
443
+
444
+ var match = event.match( /^([\w:-]*)\s*(.*)$/ ),
445
+ eventName = match[1] + instance.eventNamespace,
446
+ selector = match[2];
447
+ if ( selector ) {
448
+ delegateElement.delegate( selector, eventName, handlerProxy );
449
+ } else {
450
+ element.bind( eventName, handlerProxy );
451
+ }
452
+ });
453
+ },
454
+
455
+ _off: function( element, eventName ) {
456
+ eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) +
457
+ this.eventNamespace;
458
+ element.unbind( eventName ).undelegate( eventName );
459
+
460
+ // Clear the stack to avoid memory leaks (#10056)
461
+ this.bindings = $( this.bindings.not( element ).get() );
462
+ this.focusable = $( this.focusable.not( element ).get() );
463
+ this.hoverable = $( this.hoverable.not( element ).get() );
464
+ },
465
+
466
+ _delay: function( handler, delay ) {
467
+ function handlerProxy() {
468
+ return ( typeof handler === "string" ? instance[ handler ] : handler )
469
+ .apply( instance, arguments );
470
+ }
471
+ var instance = this;
472
+ return setTimeout( handlerProxy, delay || 0 );
473
+ },
474
+
475
+ _hoverable: function( element ) {
476
+ this.hoverable = this.hoverable.add( element );
477
+ this._on( element, {
478
+ mouseenter: function( event ) {
479
+ $( event.currentTarget ).addClass( "ui-state-hover" );
480
+ },
481
+ mouseleave: function( event ) {
482
+ $( event.currentTarget ).removeClass( "ui-state-hover" );
483
+ }
484
+ });
485
+ },
486
+
487
+ _focusable: function( element ) {
488
+ this.focusable = this.focusable.add( element );
489
+ this._on( element, {
490
+ focusin: function( event ) {
491
+ $( event.currentTarget ).addClass( "ui-state-focus" );
492
+ },
493
+ focusout: function( event ) {
494
+ $( event.currentTarget ).removeClass( "ui-state-focus" );
495
+ }
496
+ });
497
+ },
498
+
499
+ _trigger: function( type, event, data ) {
500
+ var prop, orig,
501
+ callback = this.options[ type ];
502
+
503
+ data = data || {};
504
+ event = $.Event( event );
505
+ event.type = ( type === this.widgetEventPrefix ?
506
+ type :
507
+ this.widgetEventPrefix + type ).toLowerCase();
508
+ // the original event may come from any element
509
+ // so we need to reset the target on the new event
510
+ event.target = this.element[ 0 ];
511
+
512
+ // copy original event properties over to the new event
513
+ orig = event.originalEvent;
514
+ if ( orig ) {
515
+ for ( prop in orig ) {
516
+ if ( !( prop in event ) ) {
517
+ event[ prop ] = orig[ prop ];
518
+ }
519
+ }
520
+ }
521
+
522
+ this.element.trigger( event, data );
523
+ return !( $.isFunction( callback ) &&
524
+ callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
525
+ event.isDefaultPrevented() );
526
+ }
527
  };
528
 
529
  $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
530
+ $.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
531
+ if ( typeof options === "string" ) {
532
+ options = { effect: options };
533
+ }
534
+ var hasOptions,
535
+ effectName = !options ?
536
+ method :
537
+ options === true || typeof options === "number" ?
538
+ defaultEffect :
539
+ options.effect || defaultEffect;
540
+ options = options || {};
541
+ if ( typeof options === "number" ) {
542
+ options = { duration: options };
543
+ }
544
+ hasOptions = !$.isEmptyObject( options );
545
+ options.complete = callback;
546
+ if ( options.delay ) {
547
+ element.delay( options.delay );
548
+ }
549
+ if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
550
+ element[ method ]( options );
551
+ } else if ( effectName !== method && element[ effectName ] ) {
552
+ element[ effectName ]( options.duration, options.easing, callback );
553
+ } else {
554
+ element.queue(function( next ) {
555
+ $( this )[ method ]();
556
+ if ( callback ) {
557
+ callback.call( element[ 0 ] );
558
+ }
559
+ next();
560
+ });
561
+ }
562
+ };
563
  });
564
 
565
  var widget = $.widget;
580
 
581
 
582
  var menu = $.widget( "ui.menu", {
583
+ version: "1.11.2",
584
+ defaultElement: "<ul>",
585
+ delay: 300,
586
+ options: {
587
+ icons: {
588
+ submenu: "ui-icon-carat-1-e"
589
+ },
590
+ items: "> *",
591
+ menus: "ul",
592
+ position: {
593
+ my: "left-1 top",
594
+ at: "right top"
595
+ },
596
+ role: "menu",
597
+
598
+ // callbacks
599
+ blur: null,
600
+ focus: null,
601
+ select: null
602
+ },
603
+
604
+ _create: function() {
605
+ this.activeMenu = this.element;
606
+
607
+ // Flag used to prevent firing of the click handler
608
+ // as the event bubbles up through nested menus
609
+ this.mouseHandled = false;
610
+ this.element
611
+ .uniqueId()
612
+ .addClass( "ui-menu ui-widget ui-widget-content" )
613
+ .toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length )
614
+ .attr({
615
+ role: this.options.role,
616
+ tabIndex: 0
617
+ });
618
+
619
+ if ( this.options.disabled ) {
620
+ this.element
621
+ .addClass( "ui-state-disabled" )
622
+ .attr( "aria-disabled", "true" );
623
+ }
624
+
625
+ this._on({
626
+ // Prevent focus from sticking to links inside menu after clicking
627
+ // them (focus should always stay on UL during navigation).
628
+ "mousedown .ui-menu-item": function( event ) {
629
+ event.preventDefault();
630
+ },
631
+ "click .ui-menu-item": function( event ) {
632
+ var target = $( event.target );
633
+ if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
634
+ this.select( event );
635
+
636
+ // Only set the mouseHandled flag if the event will bubble, see #9469.
637
+ if ( !event.isPropagationStopped() ) {
638
+ this.mouseHandled = true;
639
+ }
640
+
641
+ // Open submenu on click
642
+ if ( target.has( ".ui-menu" ).length ) {
643
+ this.expand( event );
644
+ } else if ( !this.element.is( ":focus" ) && $( this.document[ 0 ].activeElement ).closest( ".ui-menu" ).length ) {
645
+
646
+ // Redirect focus to the menu
647
+ this.element.trigger( "focus", [ true ] );
648
+
649
+ // If the active item is on the top level, let it stay active.
650
+ // Otherwise, blur the active item since it is no longer visible.
651
+ if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) {
652
+ clearTimeout( this.timer );
653
+ }
654
+ }
655
+ }
656
+ },
657
+ "mouseenter .ui-menu-item": function( event ) {
658
+ // Ignore mouse events while typeahead is active, see #10458.
659
+ // Prevents focusing the wrong item when typeahead causes a scroll while the mouse
660
+ // is over an item in the menu
661
+ if ( this.previousFilter ) {
662
+ return;
663
+ }
664
+ var target = $( event.currentTarget );
665
+ // Remove ui-state-active class from siblings of the newly focused menu item
666
+ // to avoid a jump caused by adjacent elements both having a class with a border
667
+ target.siblings( ".ui-state-active" ).removeClass( "ui-state-active" );
668
+ this.focus( event, target );
669
+ },
670
+ mouseleave: "collapseAll",
671
+ "mouseleave .ui-menu": "collapseAll",
672
+ focus: function( event, keepActiveItem ) {
673
+ // If there's already an active item, keep it active
674
+ // If not, activate the first item
675
+ var item = this.active || this.element.find( this.options.items ).eq( 0 );
676
+
677
+ if ( !keepActiveItem ) {
678
+ this.focus( event, item );
679
+ }
680
+ },
681
+ blur: function( event ) {
682
+ this._delay(function() {
683
+ if ( !$.contains( this.element[0], this.document[0].activeElement ) ) {
684
+ this.collapseAll( event );
685
+ }
686
+ });
687
+ },
688
+ keydown: "_keydown"
689
+ });
690
+
691
+ this.refresh();
692
+
693
+ // Clicks outside of a menu collapse any open menus
694
+ this._on( this.document, {
695
+ click: function( event ) {
696
+ if ( this._closeOnDocumentClick( event ) ) {
697
+ this.collapseAll( event );
698
+ }
699
+
700
+ // Reset the mouseHandled flag
701
+ this.mouseHandled = false;
702
+ }
703
+ });
704
+ },
705
+
706
+ _destroy: function() {
707
+ // Destroy (sub)menus
708
+ this.element
709
+ .removeAttr( "aria-activedescendant" )
710
+ .find( ".ui-menu" ).addBack()
711
+ .removeClass( "ui-menu ui-widget ui-widget-content ui-menu-icons ui-front" )
712
+ .removeAttr( "role" )
713
+ .removeAttr( "tabIndex" )
714
+ .removeAttr( "aria-labelledby" )
715
+ .removeAttr( "aria-expanded" )
716
+ .removeAttr( "aria-hidden" )
717
+ .removeAttr( "aria-disabled" )
718
+ .removeUniqueId()
719
+ .show();
720
+
721
+ // Destroy menu items
722
+ this.element.find( ".ui-menu-item" )
723
+ .removeClass( "ui-menu-item" )
724
+ .removeAttr( "role" )
725
+ .removeAttr( "aria-disabled" )
726
+ .removeUniqueId()
727
+ .removeClass( "ui-state-hover" )
728
+ .removeAttr( "tabIndex" )
729
+ .removeAttr( "role" )
730
+ .removeAttr( "aria-haspopup" )
731
+ .children().each( function() {
732
+ var elem = $( this );
733
+ if ( elem.data( "ui-menu-submenu-carat" ) ) {
734
+ elem.remove();
735
+ }
736
+ });
737
+
738
+ // Destroy menu dividers
739
+ this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" );
740
+ },
741
+
742
+ _keydown: function( event ) {
743
+ var match, prev, character, skip,
744
+ preventDefault = true;
745
+
746
+ switch ( event.keyCode ) {
747
+ case $.ui.keyCode.PAGE_UP:
748
+ this.previousPage( event );
749
+ break;
750
+ case $.ui.keyCode.PAGE_DOWN:
751
+ this.nextPage( event );
752
+ break;
753
+ case $.ui.keyCode.HOME:
754
+ this._move( "first", "first", event );
755
+ break;
756
+ case $.ui.keyCode.END:
757
+ this._move( "last", "last", event );
758
+ break;
759
+ case $.ui.keyCode.UP:
760
+ this.previous( event );
761
+ break;
762
+ case $.ui.keyCode.DOWN:
763
+ this.next( event );
764
+ break;
765
+ case $.ui.keyCode.LEFT:
766
+ this.collapse( event );
767
+ break;
768
+ case $.ui.keyCode.RIGHT:
769
+ if ( this.active && !this.active.is( ".ui-state-disabled" ) ) {
770
+ this.expand( event );
771
+ }
772
+ break;
773
+ case $.ui.keyCode.ENTER:
774
+ case $.ui.keyCode.SPACE:
775
+ this._activate( event );
776
+ break;
777
+ case $.ui.keyCode.ESCAPE:
778
+ this.collapse( event );
779
+ break;
780
+ default:
781
+ preventDefault = false;
782
+ prev = this.previousFilter || "";
783
+ character = String.fromCharCode( event.keyCode );
784
+ skip = false;
785
+
786
+ clearTimeout( this.filterTimer );
787
+
788
+ if ( character === prev ) {
789
+ skip = true;
790
+ } else {
791
+ character = prev + character;
792
+ }
793
+
794
+ match = this._filterMenuItems( character );
795
+ match = skip && match.index( this.active.next() ) !== -1 ?
796
+ this.active.nextAll( ".ui-menu-item" ) :
797
+ match;
798
+
799
+ // If no matches on the current filter, reset to the last character pressed
800
+ // to move down the menu to the first item that starts with that character
801
+ if ( !match.length ) {
802
+ character = String.fromCharCode( event.keyCode );
803
+ match = this._filterMenuItems( character );
804
+ }
805
+
806
+ if ( match.length ) {
807
+ this.focus( event, match );
808
+ this.previousFilter = character;
809
+ this.filterTimer = this._delay(function() {
810
+ delete this.previousFilter;
811
+ }, 1000 );
812
+ } else {
813
+ delete this.previousFilter;
814
+ }
815
+ }
816
+
817
+ if ( preventDefault ) {
818
+ event.preventDefault();
819
+ }
820
+ },
821
+
822
+ _activate: function( event ) {
823
+ if ( !this.active.is( ".ui-state-disabled" ) ) {
824
+ if ( this.active.is( "[aria-haspopup='true']" ) ) {
825
+ this.expand( event );
826
+ } else {
827
+ this.select( event );
828
+ }
829
+ }
830
+ },
831
+
832
+ refresh: function() {
833
+ var menus, items,
834
+ that = this,
835
+ icon = this.options.icons.submenu,
836
+ submenus = this.element.find( this.options.menus );
837
+
838
+ this.element.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length );
839
+
840
+ // Initialize nested menus
841
+ submenus.filter( ":not(.ui-menu)" )
842
+ .addClass( "ui-menu ui-widget ui-widget-content ui-front" )
843
+ .hide()
844
+ .attr({
845
+ role: this.options.role,
846
+ "aria-hidden": "true",
847
+ "aria-expanded": "false"
848
+ })
849
+ .each(function() {
850
+ var menu = $( this ),
851
+ item = menu.parent(),
852
+ submenuCarat = $( "<span>" )
853
+ .addClass( "ui-menu-icon ui-icon " + icon )
854
+ .data( "ui-menu-submenu-carat", true );
855
+
856
+ item
857
+ .attr( "aria-haspopup", "true" )
858
+ .prepend( submenuCarat );
859
+ menu.attr( "aria-labelledby", item.attr( "id" ) );
860
+ });
861
+
862
+ menus = submenus.add( this.element );
863
+ items = menus.find( this.options.items );
864
+
865
+ // Initialize menu-items containing spaces and/or dashes only as dividers
866
+ items.not( ".ui-menu-item" ).each(function() {
867
+ var item = $( this );
868
+ if ( that._isDivider( item ) ) {
869
+ item.addClass( "ui-widget-content ui-menu-divider" );
870
+ }
871
+ });
872
+
873
+ // Don't refresh list items that are already adapted
874
+ items.not( ".ui-menu-item, .ui-menu-divider" )
875
+ .addClass( "ui-menu-item" )
876
+ .uniqueId()
877
+ .attr({
878
+ tabIndex: -1,
879
+ role: this._itemRole()
880
+ });
881
+
882
+ // Add aria-disabled attribute to any disabled menu item
883
+ items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" );
884
+
885
+ // If the active item has been removed, blur the menu
886
+ if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
887
+ this.blur();
888
+ }
889
+ },
890
+
891
+ _itemRole: function() {
892
+ return {
893
+ menu: "menuitem",
894
+ listbox: "option"
895
+ }[ this.options.role ];
896
+ },
897
+
898
+ _setOption: function( key, value ) {
899
+ if ( key === "icons" ) {
900
+ this.element.find( ".ui-menu-icon" )
901
+ .removeClass( this.options.icons.submenu )
902
+ .addClass( value.submenu );
903
+ }
904
+ if ( key === "disabled" ) {
905
+ this.element
906
+ .toggleClass( "ui-state-disabled", !!value )
907
+ .attr( "aria-disabled", value );
908
+ }
909
+ this._super( key, value );
910
+ },
911
+
912
+ focus: function( event, item ) {
913
+ var nested, focused;
914
+ this.blur( event, event && event.type === "focus" );
915
+
916
+ this._scrollIntoView( item );
917
+
918
+ this.active = item.first();
919
+ focused = this.active.addClass( "ui-state-focus" ).removeClass( "ui-state-active" );
920
+ // Only update aria-activedescendant if there's a role
921
+ // otherwise we assume focus is managed elsewhere
922
+ if ( this.options.role ) {
923
+ this.element.attr( "aria-activedescendant", focused.attr( "id" ) );
924
+ }
925
+
926
+ // Highlight active parent menu item, if any
927
+ this.active
928
+ .parent()
929
+ .closest( ".ui-menu-item" )
930
+ .addClass( "ui-state-active" );
931
+
932
+ if ( event && event.type === "keydown" ) {
933
+ this._close();
934
+ } else {
935
+ this.timer = this._delay(function() {
936
+ this._close();
937
+ }, this.delay );
938
+ }
939
+
940
+ nested = item.children( ".ui-menu" );
941
+ if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) {
942
+ this._startOpening(nested);
943
+ }
944
+ this.activeMenu = item.parent();
945
+
946
+ this._trigger( "focus", event, { item: item } );
947
+ },
948
+
949
+ _scrollIntoView: function( item ) {
950
+ var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
951
+ if ( this._hasScroll() ) {
952
+ borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0;
953
+ paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0;
954
+ offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
955
+ scroll = this.activeMenu.scrollTop();
956
+ elementHeight = this.activeMenu.height();
957
+ itemHeight = item.outerHeight();
958
+
959
+ if ( offset < 0 ) {
960
+ this.activeMenu.scrollTop( scroll + offset );
961
+ } else if ( offset + itemHeight > elementHeight ) {
962
+ this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight );
963
+ }
964
+ }
965
+ },
966
+
967
+ blur: function( event, fromFocus ) {
968
+ if ( !fromFocus ) {
969
+ clearTimeout( this.timer );
970
+ }
971
+
972
+ if ( !this.active ) {
973
+ return;
974
+ }
975
+
976
+ this.active.removeClass( "ui-state-focus" );
977
+ this.active = null;
978
+
979
+ this._trigger( "blur", event, { item: this.active } );
980
+ },
981
+
982
+ _startOpening: function( submenu ) {
983
+ clearTimeout( this.timer );
984
+
985
+ // Don't open if already open fixes a Firefox bug that caused a .5 pixel
986
+ // shift in the submenu position when mousing over the carat icon
987
+ if ( submenu.attr( "aria-hidden" ) !== "true" ) {
988
+ return;
989
+ }
990
+
991
+ this.timer = this._delay(function() {
992
+ this._close();
993
+ this._open( submenu );
994
+ }, this.delay );
995
+ },
996
+
997
+ _open: function( submenu ) {
998
+ var position = $.extend({
999
+ of: this.active
1000
+ }, this.options.position );
1001
+
1002
+ clearTimeout( this.timer );
1003
+ this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) )
1004
+ .hide()
1005
+ .attr( "aria-hidden", "true" );
1006
+
1007
+ submenu
1008
+ .show()
1009
+ .removeAttr( "aria-hidden" )
1010
+ .attr( "aria-expanded", "true" )
1011
+ .position( position );
1012
+ },
1013
+
1014
+ collapseAll: function( event, all ) {
1015
+ clearTimeout( this.timer );
1016
+ this.timer = this._delay(function() {
1017
+ // If we were passed an event, look for the submenu that contains the event
1018
+ var currentMenu = all ? this.element :
1019
+ $( event && event.target ).closest( this.element.find( ".ui-menu" ) );
1020
+
1021
+ // If we found no valid submenu ancestor, use the main menu to close all sub menus anyway
1022
+ if ( !currentMenu.length ) {
1023
+ currentMenu = this.element;
1024
+ }
1025
+
1026
+ this._close( currentMenu );
1027
+
1028
+ this.blur( event );
1029
+ this.activeMenu = currentMenu;
1030
+ }, this.delay );
1031
+ },
1032
+
1033
+ // With no arguments, closes the currently active menu - if nothing is active
1034
+ // it closes all menus. If passed an argument, it will search for menus BELOW
1035
+ _close: function( startMenu ) {
1036
+ if ( !startMenu ) {
1037
+ startMenu = this.active ? this.active.parent() : this.element;
1038
+ }
1039
+
1040
+ startMenu
1041
+ .find( ".ui-menu" )
1042
+ .hide()
1043
+ .attr( "aria-hidden", "true" )
1044
+ .attr( "aria-expanded", "false" )
1045
+ .end()
1046
+ .find( ".ui-state-active" ).not( ".ui-state-focus" )
1047
+ .removeClass( "ui-state-active" );
1048
+ },
1049
+
1050
+ _closeOnDocumentClick: function( event ) {
1051
+ return !$( event.target ).closest( ".ui-menu" ).length;
1052
+ },
1053
+
1054
+ _isDivider: function( item ) {
1055
+
1056
+ // Match hyphen, em dash, en dash
1057
+ return !/[^\-\u2014\u2013\s]/.test( item.text() );
1058
+ },
1059
+
1060
+ collapse: function( event ) {
1061
+ var newItem = this.active &&
1062
+ this.active.parent().closest( ".ui-menu-item", this.element );
1063
+ if ( newItem && newItem.length ) {
1064
+ this._close();
1065
+ this.focus( event, newItem );
1066
+ }
1067
+ },
1068
+
1069
+ expand: function( event ) {
1070
+ var newItem = this.active &&
1071
+ this.active
1072
+ .children( ".ui-menu " )
1073
+ .find( this.options.items )
1074
+ .first();
1075
+
1076
+ if ( newItem && newItem.length ) {
1077
+ this._open( newItem.parent() );
1078
+
1079
+ // Delay so Firefox will not hide activedescendant change in expanding submenu from AT
1080
+ this._delay(function() {
1081
+ this.focus( event, newItem );
1082
+ });
1083
+ }
1084
+ },
1085
+
1086
+ next: function( event ) {
1087
+ this._move( "next", "first", event );
1088
+ },
1089
+
1090
+ previous: function( event ) {
1091
+ this._move( "prev", "last", event );
1092
+ },
1093
+
1094
+ isFirstItem: function() {
1095
+ return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
1096
+ },
1097
+
1098
+ isLastItem: function() {
1099
+ return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
1100
+ },
1101
+
1102
+ _move: function( direction, filter, event ) {
1103
+ var next;
1104
+ if ( this.active ) {
1105
+ if ( direction === "first" || direction === "last" ) {
1106
+ next = this.active
1107
+ [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" )
1108
+ .eq( -1 );
1109
+ } else {
1110
+ next = this.active
1111
+ [ direction + "All" ]( ".ui-menu-item" )
1112
+ .eq( 0 );
1113
+ }
1114
+ }
1115
+ if ( !next || !next.length || !this.active ) {
1116
+ next = this.activeMenu.find( this.options.items )[ filter ]();
1117
+ }
1118
+
1119
+ this.focus( event, next );
1120
+ },
1121
+
1122
+ nextPage: function( event ) {
1123
+ var item, base, height;
1124
+
1125
+ if ( !this.active ) {
1126
+ this.next( event );
1127
+ return;
1128
+ }
1129
+ if ( this.isLastItem() ) {
1130
+ return;
1131
+ }
1132
+ if ( this._hasScroll() ) {
1133
+ base = this.active.offset().top;
1134
+ height = this.element.height();
1135
+ this.active.nextAll( ".ui-menu-item" ).each(function() {
1136
+ item = $( this );
1137
+ return item.offset().top - base - height < 0;
1138
+ });
1139
+
1140
+ this.focus( event, item );
1141
+ } else {
1142
+ this.focus( event, this.activeMenu.find( this.options.items )
1143
+ [ !this.active ? "first" : "last" ]() );
1144
+ }
1145
+ },
1146
+
1147
+ previousPage: function( event ) {
1148
+ var item, base, height;
1149
+ if ( !this.active ) {
1150
+ this.next( event );
1151
+ return;
1152
+ }
1153
+ if ( this.isFirstItem() ) {
1154
+ return;
1155
+ }
1156
+ if ( this._hasScroll() ) {
1157
+ base = this.active.offset().top;
1158
+ height = this.element.height();
1159
+ this.active.prevAll( ".ui-menu-item" ).each(function() {
1160
+ item = $( this );
1161
+ return item.offset().top - base + height > 0;
1162
+ });
1163
+
1164
+ this.focus( event, item );
1165
+ } else {
1166
+ this.focus( event, this.activeMenu.find( this.options.items ).first() );
1167
+ }
1168
+ },
1169
+
1170
+ _hasScroll: function() {
1171
+ return this.element.outerHeight() < this.element.prop( "scrollHeight" );
1172
+ },
1173
+
1174
+ select: function( event ) {
1175
+ // TODO: It should never be possible to not have an active item at this
1176
+ // point, but the tests don't trigger mouseenter before click.
1177
+ this.active = this.active || $( event.target ).closest( ".ui-menu-item" );
1178
+ var ui = { item: this.active };
1179
+ if ( !this.active.has( ".ui-menu" ).length ) {
1180
+ this.collapseAll( event, true );
1181
+ }
1182
+ this._trigger( "select", event, ui );
1183
+ },
1184
+
1185
+ _filterMenuItems: function(character) {
1186
+ var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ),
1187
+ regex = new RegExp( "^" + escapedCharacter, "i" );
1188
+
1189
+ return this.activeMenu
1190
+ .find( this.options.items )
1191
+
1192
+ // Only match on items, not dividers or other content (#10571)
1193
+ .filter( ".ui-menu-item" )
1194
+ .filter(function() {
1195
+ return regex.test( $.trim( $( this ).text() ) );
1196
+ });
1197
+ }
1198
  });
1199
 
1200
 
1211
 
1212
 
1213
  var selectmenu = $.widget( "ui.selectmenu", {
1214
+ version: "1.11.2",
1215
+ defaultElement: "<select>",
1216
+ options: {
1217
+ appendTo: null,
1218
+ disabled: null,
1219
+ icons: {
1220
+ button: "ui-icon-triangle-1-s"
1221
+ },
1222
+ position: {
1223
+ my: "left top",
1224
+ at: "left bottom",
1225
+ collision: "none"
1226
+ },
1227
+ width: null,
1228
+
1229
+ // callbacks
1230
+ change: null,
1231
+ close: null,
1232
+ focus: null,
1233
+ open: null,
1234
+ select: null
1235
+ },
1236
+
1237
+ _create: function() {
1238
+ var selectmenuId = this.element.uniqueId().attr( "id" );
1239
+ this.ids = {
1240
+ element: selectmenuId,
1241
+ button: selectmenuId + "-button",
1242
+ menu: selectmenuId + "-menu"
1243
+ };
1244
+
1245
+ this._drawButton();
1246
+ this._drawMenu();
1247
+
1248
+ if ( this.options.disabled ) {
1249
+ this.disable();
1250
+ }
1251
+ },
1252
+
1253
+ _drawButton: function() {
1254
+ var that = this,
1255
+ tabindex = this.element.attr( "tabindex" );
1256
+
1257
+ // Associate existing label with the new button
1258
+ this.label = $( "label[for='" + this.ids.element + "']" ).attr( "for", this.ids.button );
1259
+ this._on( this.label, {
1260
+ click: function( event ) {
1261
+ this.button.focus();
1262
+ event.preventDefault();
1263
+ }
1264
+ });
1265
+
1266
+ // Hide original select element
1267
+ this.element.hide();
1268
+
1269
+ // Create button
1270
+ this.button = $( "<span>", {
1271
+ "class": "ui-selectmenu-button ui-widget ui-state-default ui-corner-all",
1272
+ tabindex: tabindex || this.options.disabled ? -1 : 0,
1273
+ id: this.ids.button,
1274
+ role: "combobox",
1275
+ "aria-expanded": "false",
1276
+ "aria-autocomplete": "list",
1277
+ "aria-owns": this.ids.menu,
1278
+ "aria-haspopup": "true"
1279
+ })
1280
+ .insertAfter( this.element );
1281
+
1282
+ $( "<span>", {
1283
+ "class": "ui-icon " + this.options.icons.button
1284
+ })
1285
+ .prependTo( this.button );
1286
+
1287
+ this.buttonText = $( "<span>", {
1288
+ "class": "ui-selectmenu-text"
1289
+ })
1290
+ .appendTo( this.button );
1291
+
1292
+ this._setText( this.buttonText, this.element.find( "option:selected" ).text() );
1293
+ this._resizeButton();
1294
+
1295
+ this._on( this.button, this._buttonEvents );
1296
+ this.button.one( "focusin", function() {
1297
+
1298
+ // Delay rendering the menu items until the button receives focus.
1299
+ // The menu may have already been rendered via a programmatic open.
1300
+ if ( !that.menuItems ) {
1301
+ that._refreshMenu();
1302
+ }
1303
+ });
1304
+ this._hoverable( this.button );
1305
+ this._focusable( this.button );
1306
+ },
1307
+
1308
+ _drawMenu: function() {
1309
+ var that = this;
1310
+
1311
+ // Create menu
1312
+ this.menu = $( "<ul>", {
1313
+ "aria-hidden": "true",
1314
+ "aria-labelledby": this.ids.button,
1315
+ id: this.ids.menu
1316
+ });
1317
+
1318
+ // Wrap menu
1319
+ this.menuWrap = $( "<div>", {
1320
+ "class": "ui-selectmenu-menu ui-front"
1321
+ })
1322
+ .append( this.menu )
1323
+ .appendTo( this._appendTo() );
1324
+
1325
+ // Initialize menu widget
1326
+ this.menuInstance = this.menu
1327
+ .menu({
1328
+ role: "listbox",
1329
+ select: function( event, ui ) {
1330
+ event.preventDefault();
1331
+
1332
+ // support: IE8
1333
+ // If the item was selected via a click, the text selection
1334
+ // will be destroyed in IE
1335
+ that._setSelection();
1336
+
1337
+ that._select( ui.item.data( "ui-selectmenu-item" ), event );
1338
+ },
1339
+ focus: function( event, ui ) {
1340
+ var item = ui.item.data( "ui-selectmenu-item" );
1341
+
1342
+ // Prevent inital focus from firing and check if its a newly focused item
1343
+ if ( that.focusIndex != null && item.index !== that.focusIndex ) {
1344
+ that._trigger( "focus", event, { item: item } );
1345
+ if ( !that.isOpen ) {
1346
+ that._select( item, event );
1347
+ }
1348
+ }
1349
+ that.focusIndex = item.index;
1350
+
1351
+ that.button.attr( "aria-activedescendant",
1352
+ that.menuItems.eq( item.index ).attr( "id" ) );
1353
+ }
1354
+ })
1355
+ .menu( "instance" );
1356
+
1357
+ // Adjust menu styles to dropdown
1358
+ this.menu
1359
+ .addClass( "ui-corner-bottom" )
1360
+ .removeClass( "ui-corner-all" );
1361
+
1362
+ // Don't close the menu on mouseleave
1363
+ this.menuInstance._off( this.menu, "mouseleave" );
1364
+
1365
+ // Cancel the menu's collapseAll on document click
1366
+ this.menuInstance._closeOnDocumentClick = function() {
1367
+ return false;
1368
+ };
1369
+
1370
+ // Selects often contain empty items, but never contain dividers
1371
+ this.menuInstance._isDivider = function() {
1372
+ return false;
1373
+ };
1374
+ },
1375
+
1376
+ refresh: function() {
1377
+ this._refreshMenu();
1378
+ this._setText( this.buttonText, this._getSelectedItem().text() );
1379
+ if ( !this.options.width ) {
1380
+ this._resizeButton();
1381
+ }
1382
+ },
1383
+
1384
+ _refreshMenu: function() {
1385
+ this.menu.empty();
1386
+
1387
+ var item,
1388
+ options = this.element.find( "option" );
1389
+
1390
+ if ( !options.length ) {
1391
+ return;
1392
+ }
1393
+
1394
+ this._parseOptions( options );
1395
+ this._renderMenu( this.menu, this.items );
1396
+
1397
+ this.menuInstance.refresh();
1398
+ this.menuItems = this.menu.find( "li" ).not( ".ui-selectmenu-optgroup" );
1399
+
1400
+ item = this._getSelectedItem();
1401
+
1402
+ // Update the menu to have the correct item focused
1403
+ this.menuInstance.focus( null, item );
1404
+ this._setAria( item.data( "ui-selectmenu-item" ) );
1405
+
1406
+ // Set disabled state
1407
+ this._setOption( "disabled", this.element.prop( "disabled" ) );
1408
+ },
1409
+
1410
+ open: function( event ) {
1411
+ if ( this.options.disabled ) {
1412
+ return;
1413
+ }
1414
+
1415
+ // If this is the first time the menu is being opened, render the items
1416
+ if ( !this.menuItems ) {
1417
+ this._refreshMenu();
1418
+ } else {
1419
+
1420
+ // Menu clears focus on close, reset focus to selected item
1421
+ this.menu.find( ".ui-state-focus" ).removeClass( "ui-state-focus" );
1422
+ this.menuInstance.focus( null, this._getSelectedItem() );
1423
+ }
1424
+
1425
+ this.isOpen = true;
1426
+ this._toggleAttr();
1427
+ this._resizeMenu();
1428
+ this._position();
1429
+
1430
+ this._on( this.document, this._documentClick );
1431
+
1432
+ this._trigger( "open", event );
1433
+ },
1434
+
1435
+ _position: function() {
1436
+ this.menuWrap.position( $.extend( { of: this.button }, this.options.position ) );
1437
+ },
1438
+
1439
+ close: function( event ) {
1440
+ if ( !this.isOpen ) {
1441
+ return;
1442
+ }
1443
+
1444
+ this.isOpen = false;
1445
+ this._toggleAttr();
1446
+
1447
+ this.range = null;
1448
+ this._off( this.document );
1449
+
1450
+ this._trigger( "close", event );
1451
+ },
1452
+
1453
+ widget: function() {
1454
+ return this.button;
1455
+ },
1456
+
1457
+ menuWidget: function() {
1458
+ return this.menu;
1459
+ },
1460
+
1461
+ _renderMenu: function( ul, items ) {
1462
+ var that = this,
1463
+ currentOptgroup = "";
1464
+
1465
+ $.each( items, function( index, item ) {
1466
+ if ( item.optgroup !== currentOptgroup ) {
1467
+ $( "<li>", {
1468
+ "class": "ui-selectmenu-optgroup ui-menu-divider" +
1469
+ ( item.element.parent( "optgroup" ).prop( "disabled" ) ?
1470
+ " ui-state-disabled" :
1471
+ "" ),
1472
+ text: item.optgroup
1473
+ })
1474
+ .appendTo( ul );
1475
+
1476
+ currentOptgroup = item.optgroup;
1477
+ }
1478
+
1479
+ that._renderItemData( ul, item );
1480
+ });
1481
+ },
1482
+
1483
+ _renderItemData: function( ul, item ) {
1484
+ return this._renderItem( ul, item ).data( "ui-selectmenu-item", item );
1485
+ },
1486
+
1487
+ _renderItem: function( ul, item ) {
1488
+ var li = $( "<li>" );
1489
+
1490
+ if ( item.disabled ) {
1491
+ li.addClass( "ui-state-disabled" );
1492
+ }
1493
+ this._setText( li, item.label );
1494
+
1495
+ return li.appendTo( ul );
1496
+ },
1497
+
1498
+ _setText: function( element, value ) {
1499
+ if ( value ) {
1500
+ element.text( value );
1501
+ } else {
1502
+ element.html( "&#160;" );
1503
+ }
1504
+ },
1505
+
1506
+ _move: function( direction, event ) {
1507
+ var item, next,
1508
+ filter = ".ui-menu-item";
1509
+
1510
+ if ( this.isOpen ) {
1511
+ item = this.menuItems.eq( this.focusIndex );
1512
+ } else {
1513
+ item = this.menuItems.eq( this.element[ 0 ].selectedIndex );
1514
+ filter += ":not(.ui-state-disabled)";
1515
+ }
1516
+
1517
+ if ( direction === "first" || direction === "last" ) {
1518
+ next = item[ direction === "first" ? "prevAll" : "nextAll" ]( filter ).eq( -1 );
1519
+ } else {
1520
+ next = item[ direction + "All" ]( filter ).eq( 0 );
1521
+ }
1522
+
1523
+ if ( next.length ) {
1524
+ this.menuInstance.focus( event, next );
1525
+ }
1526
+ },
1527
+
1528
+ _getSelectedItem: function() {
1529
+ return this.menuItems.eq( this.element[ 0 ].selectedIndex );
1530
+ },
1531
+
1532
+ _toggle: function( event ) {
1533
+ this[ this.isOpen ? "close" : "open" ]( event );
1534
+ },
1535
+
1536
+ _setSelection: function() {
1537
+ var selection;
1538
+
1539
+ if ( !this.range ) {
1540
+ return;
1541
+ }
1542
+
1543
+ if ( window.getSelection ) {
1544
+ selection = window.getSelection();
1545
+ selection.removeAllRanges();
1546
+ selection.addRange( this.range );
1547
+
1548
+ // support: IE8
1549
+ } else {
1550
+ this.range.select();
1551
+ }
1552
+
1553
+ // support: IE
1554
+ // Setting the text selection kills the button focus in IE, but
1555
+ // restoring the focus doesn't kill the selection.
1556
+ this.button.focus();
1557
+ },
1558
+
1559
+ _documentClick: {
1560
+ mousedown: function( event ) {
1561
+ if ( !this.isOpen ) {
1562
+ return;
1563
+ }
1564
+
1565
+ if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" + this.ids.button ).length ) {
1566
+ this.close( event );
1567
+ }
1568
+ }
1569
+ },
1570
+
1571
+ _buttonEvents: {
1572
+
1573
+ // Prevent text selection from being reset when interacting with the selectmenu (#10144)
1574
+ mousedown: function() {
1575
+ var selection;
1576
+
1577
+ if ( window.getSelection ) {
1578
+ selection = window.getSelection();
1579
+ if ( selection.rangeCount ) {
1580
+ this.range = selection.getRangeAt( 0 );
1581
+ }
1582
+
1583
+ // support: IE8
1584
+ } else {
1585
+ this.range = document.selection.createRange();
1586
+ }
1587
+ },
1588
+
1589
+ click: function( event ) {
1590
+ this._setSelection();
1591
+ this._toggle( event );
1592
+ },
1593
+
1594
+ keydown: function( event ) {
1595
+ var preventDefault = true;
1596
+ switch ( event.keyCode ) {
1597
+ case $.ui.keyCode.TAB:
1598
+ case $.ui.keyCode.ESCAPE:
1599
+ this.close( event );
1600
+ preventDefault = false;
1601
+ break;
1602
+ case $.ui.keyCode.ENTER:
1603
+ if ( this.isOpen ) {
1604
+ this._selectFocusedItem( event );
1605
+ }
1606
+ break;
1607
+ case $.ui.keyCode.UP:
1608
+ if ( event.altKey ) {
1609
+ this._toggle( event );
1610
+ } else {
1611
+ this._move( "prev", event );
1612
+ }
1613
+ break;
1614
+ case $.ui.keyCode.DOWN:
1615
+ if ( event.altKey ) {
1616
+ this._toggle( event );
1617
+ } else {
1618
+ this._move( "next", event );
1619
+ }
1620
+ break;
1621
+ case $.ui.keyCode.SPACE:
1622
+ if ( this.isOpen ) {
1623
+ this._selectFocusedItem( event );
1624
+ } else {
1625
+ this._toggle( event );
1626
+ }
1627
+ break;
1628
+ case $.ui.keyCode.LEFT:
1629
+ this._move( "prev", event );
1630
+ break;
1631
+ case $.ui.keyCode.RIGHT:
1632
+ this._move( "next", event );
1633
+ break;
1634
+ case $.ui.keyCode.HOME:
1635
+ case $.ui.keyCode.PAGE_UP:
1636
+ this._move( "first", event );
1637
+ break;
1638
+ case $.ui.keyCode.END:
1639
+ case $.ui.keyCode.PAGE_DOWN:
1640
+ this._move( "last", event );
1641
+ break;
1642
+ default:
1643
+ this.menu.trigger( event );
1644
+ preventDefault = false;
1645
+ }
1646
+
1647
+ if ( preventDefault ) {
1648
+ event.preventDefault();
1649
+ }
1650
+ }
1651
+ },
1652
+
1653
+ _selectFocusedItem: function( event ) {
1654
+ var item = this.menuItems.eq( this.focusIndex );
1655
+ if ( !item.hasClass( "ui-state-disabled" ) ) {
1656
+ this._select( item.data( "ui-selectmenu-item" ), event );
1657
+ }
1658
+ },
1659
+
1660
+ _select: function( item, event ) {
1661
+ var oldIndex = this.element[ 0 ].selectedIndex;
1662
+
1663
+ // Change native select element
1664
+ this.element[ 0 ].selectedIndex = item.index;
1665
+ this._setText( this.buttonText, item.label );
1666
+ this._setAria( item );
1667
+ this._trigger( "select", event, { item: item } );
1668
+
1669
+ if ( item.index !== oldIndex ) {
1670
+ this._trigger( "change", event, { item: item } );
1671
+ }
1672
+
1673
+ this.close( event );
1674
+ },
1675
+
1676
+ _setAria: function( item ) {
1677
+ var id = this.menuItems.eq( item.index ).attr( "id" );
1678
+
1679
+ this.button.attr({
1680
+ "aria-labelledby": id,
1681
+ "aria-activedescendant": id
1682
+ });
1683
+ this.menu.attr( "aria-activedescendant", id );
1684
+ },
1685
+
1686
+ _setOption: function( key, value ) {
1687
+ if ( key === "icons" ) {
1688
+ this.button.find( "span.ui-icon" )
1689
+ .removeClass( this.options.icons.button )
1690
+ .addClass( value.button );
1691
+ }
1692
+
1693
+ this._super( key, value );
1694
+
1695
+ if ( key === "appendTo" ) {
1696
+ this.menuWrap.appendTo( this._appendTo() );
1697
+ }
1698
+
1699
+ if ( key === "disabled" ) {
1700
+ this.menuInstance.option( "disabled", value );
1701
+ this.button
1702
+ .toggleClass( "ui-state-disabled", value )
1703
+ .attr( "aria-disabled", value );
1704
+
1705
+ this.element.prop( "disabled", value );
1706
+ if ( value ) {
1707
+ this.button.attr( "tabindex", -1 );
1708
+ this.close();
1709
+ } else {
1710
+ this.button.attr( "tabindex", 0 );
1711
+ }
1712
+ }
1713
+
1714
+ if ( key === "width" ) {
1715
+ this._resizeButton();
1716
+ }
1717
+ },
1718
+
1719
+ _appendTo: function() {
1720
+ var element = this.options.appendTo;
1721
+
1722
+ if ( element ) {
1723
+ element = element.jquery || element.nodeType ?
1724
+ $( element ) :
1725
+ this.document.find( element ).eq( 0 );
1726
+ }
1727
+
1728
+ if ( !element || !element[ 0 ] ) {
1729
+ element = this.element.closest( ".ui-front" );
1730
+ }
1731
+
1732
+ if ( !element.length ) {
1733
+ element = this.document[ 0 ].body;
1734
+ }
1735
+
1736
+ return element;
1737
+ },
1738
+
1739
+ _toggleAttr: function() {
1740
+ this.button
1741
+ .toggleClass( "ui-corner-top", this.isOpen )
1742
+ .toggleClass( "ui-corner-all", !this.isOpen )
1743
+ .attr( "aria-expanded", this.isOpen );
1744
+ this.menuWrap.toggleClass( "ui-selectmenu-open", this.isOpen );
1745
+ this.menu.attr( "aria-hidden", !this.isOpen );
1746
+ },
1747
+
1748
+ _resizeButton: function() {
1749
+ var width = this.options.width;
1750
+
1751
+ if ( !width ) {
1752
+ width = this.element.show().outerWidth();
1753
+ this.element.hide();
1754
+ }
1755
+
1756
+ this.button.outerWidth( width );
1757
+ },
1758
+
1759
+ _resizeMenu: function() {
1760
+ this.menu.outerWidth( Math.max(
1761
+ this.button.outerWidth(),
1762
+
1763
+ // support: IE10
1764
+ // IE10 wraps long text (possibly a rounding bug)
1765
+ // so we add 1px to avoid the wrapping
1766
+ this.menu.width( "" ).outerWidth() + 1
1767
+ ) );
1768
+ },
1769
+
1770
+ _getCreateOptions: function() {
1771
+ return { disabled: this.element.prop( "disabled" ) };
1772
+ },
1773
+
1774
+ _parseOptions: function( options ) {
1775
+ var data = [];
1776
+ options.each(function( index, item ) {
1777
+ var option = $( item ),
1778
+ optgroup = option.parent( "optgroup" );
1779
+ data.push({
1780
+ element: option,
1781
+ index: index,
1782
+ value: option.attr( "value" ),
1783
+ label: option.text(),
1784
+ optgroup: optgroup.attr( "label" ) || "",
1785
+ disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" )
1786
+ });
1787
+ });
1788
+ this.items = data;
1789
+ },
1790
+
1791
+ _destroy: function() {
1792
+ this.menuWrap.remove();
1793
+ this.button.remove();
1794
+ this.element.show();
1795
+ this.element.removeUniqueId();
1796
+ this.label.attr( "for", this.ids.element );
1797
+ }
1798
  });
1799
 
1800
 
js/spectrum.js CHANGED
@@ -2,7 +2,7 @@
2
  // https://github.com/bgrins/spectrum
3
  // Author: Brian Grinstead
4
  // License: MIT
5
- // Modifications for CTC (c) 2016 Lilaea Media LLC
6
 
7
  (function (factory) {
8
  "use strict";
2
  // https://github.com/bgrins/spectrum
3
  // Author: Brian Grinstead
4
  // License: MIT
5
+ // Modifications for CTC (c) 2015 LIlaea Media LLC
6
 
7
  (function (factory) {
8
  "use strict";
lang/child-theme-configurator-de_DE.mo CHANGED
Binary file
lang/child-theme-configurator-de_DE.po CHANGED
@@ -1,646 +1,376 @@
1
- # Copyright (C) 2016 Child Theme Configurator
2
  # This file is distributed under the same license as the Child Theme Configurator package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Child Theme Configurator 2.0.0\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/child-theme-configurator\n"
7
- "POT-Creation-Date: 2016-03-29 17:45+0200\n"
8
- "PO-Revision-Date: 2016-03-29 19:31+0200\n"
9
- "Last-Translator: \n"
10
- "Language-Team: \n"
11
- "Language: de_DE\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
- "X-Generator: Poedit 1.8.6\n"
 
 
 
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
17
 
18
- #: includes/class-ctc-admin.php:373
19
- msgid "Zip file creation failed."
20
- msgstr "ZIP-Dateierstellung fehlgeschlagen."
21
-
22
- #: includes/class-ctc-admin.php:409
23
- msgid "The Functions file is required and cannot be deleted."
24
- msgstr "Die Funktionendatei wird benötigt und kann nicht gelöscht werden."
25
-
26
- #: includes/class-ctc-admin.php:493
27
- msgid "You do not have permission to configure child themes."
28
- msgstr "Sie haben keine Berechtigung, Kindthemen zu konfigurieren."
29
 
30
- #: includes/class-ctc-admin.php:522
31
- msgid "%s does not exist. Please select a valid Parent Theme."
32
- msgstr "%s existiert nicht. Bitte wählen Sie ein gültiges Elternthema."
 
33
 
34
- #: includes/class-ctc-admin.php:525
35
- msgid "Please select a valid Parent Theme."
36
- msgstr "Bitte wählen Sie ein gültiges Elternthema."
37
 
38
- #: includes/class-ctc-admin.php:530
39
- msgid "Please select a valid Child Theme."
40
- msgstr "Bitte wählen Sie ein gültiges Kindthema."
41
 
42
- #: includes/class-ctc-admin.php:534
43
- msgid "Please enter a valid Child Theme directory name."
44
- msgstr "Bitte geben Sie ein gültiges Kindthema-Verzeichnis ein."
45
 
46
- #: includes/class-ctc-admin.php:539
47
  msgid ""
48
- "<strong>%s</strong> exists. Please enter a different Child Theme template "
49
- "name."
50
  msgstr ""
51
- "<strong>%s</strong> existiert. Bitte geben Sie einen anderen Kindthema-"
52
- "Vorlagennamen ein."
53
-
54
- #: includes/class-ctc-admin.php:558
55
- msgid "Your theme directories are not writable."
56
- msgstr "Ihr Themenverzeichnis ist schreibgeschützt."
57
-
58
- #: includes/class-ctc-admin.php:632
59
- msgid "Could not upgrade child theme"
60
- msgstr "Konnte das Kindthema nicht aktualisieren"
61
-
62
- #: includes/class-ctc-admin.php:722
63
- msgid "Your stylesheet is not writable."
64
- msgstr "Ihre Formatvorlage ist schreibgeschützt."
65
-
66
- #: includes/class-ctc-admin.php:1283
67
- msgid "Could not set write permissions."
68
- msgstr "Konnte Schreibberechtigungen nicht setzen."
69
-
70
- #: includes/class-ctc-admin.php:1384
71
- msgid "There were errors while resetting permissions."
72
- msgstr "Beim Zurücksetzen der Berechtigungen traten Fehler auf."
73
 
74
- #: includes/class-ctc-admin.php:1426
75
- msgid "Could not upload file."
76
- msgstr "Konnte Datei nicht hochladen."
77
-
78
- #: includes/class-ctc-ui.php:35
79
- msgid "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
80
- msgstr "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
81
-
82
- #: includes/class-ctc-ui.php:166
83
  msgid "Child Theme files modified successfully."
84
- msgstr "Kindthema-Dateien erfolgreich geändert."
85
 
86
- #: includes/class-ctc-ui.php:168
87
  msgid ""
88
- "Child Theme <strong>%s</strong> has been reset. Please configure it using "
89
- "the settings below."
90
  msgstr ""
91
- "Kindthema <strong>%s</strong> zurückgesetzt. Bitte mit den Einstellungen "
92
- "unten konfigurieren."
93
-
94
- #: includes/class-ctc-ui.php:170
95
- msgid "Child Theme <strong>%s</strong> has been generated successfully."
96
- msgstr "Kindthema <strong>%s</strong> wurde erfolgreich erstellt."
97
 
98
- #: includes/class-ctc-ui.php:172
99
  msgid "IMPORTANT:"
100
  msgstr "WICHTIG:"
101
 
102
- #: includes/class-ctc-ui.php:174 includes/forms/themepreview.php:20
103
  msgid "Go to Themes"
104
  msgstr "Gehe zu Themen"
105
 
106
- #: includes/class-ctc-ui.php:174
107
  msgid "Network enable"
108
- msgstr "Netzwerkfähig machen"
109
 
110
- #: includes/class-ctc-ui.php:174
111
  msgid "your child theme."
112
- msgstr "Ihr Kindthema"
113
 
114
- #: includes/class-ctc-ui.php:176 includes/forms/themepreview.php:18
115
  msgid "Live Preview"
116
  msgstr "Live-Vorschau"
117
 
118
- #: includes/class-ctc-ui.php:176
119
- msgid "Preview your child theme"
120
- msgstr "Vorschau Ihres Kindthemas"
121
 
122
- #: includes/class-ctc-ui.php:176
123
  msgid "before activating."
124
  msgstr "vor der Aktivierung."
125
 
126
- #: includes/class-ctc-ui.php:284
127
  msgid "URL/None"
128
- msgstr "URL/Keine"
129
 
130
- #: includes/class-ctc-ui.php:285
131
  msgid "Origin"
132
  msgstr "Quelle"
133
 
134
- #: includes/class-ctc-ui.php:286
135
  msgid "Color 1"
136
  msgstr "Farbe 1"
137
 
138
- #: includes/class-ctc-ui.php:287
139
  msgid "Color 2"
140
  msgstr "Farbe 2"
141
 
142
- #: includes/class-ctc-ui.php:288
143
  msgid "Width/None"
144
  msgstr "Breite/Keine"
145
 
146
- #: includes/class-ctc-ui.php:289
147
  msgid "Style"
148
  msgstr "Stil"
149
 
150
- #: includes/class-ctc-ui.php:290
151
  msgid "Color"
152
  msgstr "Farbe"
153
 
154
- #: includes/class-ctc-ui.php:292
155
- msgid ""
156
- "Are you sure you wish to RESET? This will destroy any work you have done in "
157
- "the Configurator."
158
- msgstr ""
159
- "Möchten Sie wirklich zurücksetzen? Dies wird jegliche Arbeit im Konfigurator "
160
- "überschreiben."
161
 
162
- #: includes/class-ctc-ui.php:293
163
  msgid "<span style=\"font-size:10px\">!</span>"
164
  msgstr "<span style=\"font-size:10px\">!</span>"
165
 
166
- #: includes/class-ctc-ui.php:294 includes/forms/rule-value.php:32
167
  msgid "Selectors"
168
  msgstr "Selektoren"
169
 
170
- #: includes/class-ctc-ui.php:295
171
  msgid "Close"
172
  msgstr "Schließen"
173
 
174
- #: includes/class-ctc-ui.php:296
175
  msgid "Edit Selector"
176
- msgstr "Selektor wählen"
177
 
178
- #: includes/class-ctc-ui.php:297
179
  msgid "Cancel"
180
  msgstr "Abbrechen"
181
 
182
- #: includes/class-ctc-ui.php:298
183
  msgid "Rename"
184
- msgstr "Umbennen"
185
 
186
- #: includes/class-ctc-ui.php:299
187
  msgid "The stylesheet cannot be displayed."
188
  msgstr "Die Formatvorlage kann nicht angezeigt werden."
189
 
190
- #: includes/class-ctc-ui.php:300
191
  msgid "(Child Only)"
192
  msgstr "(Nur Kind)"
193
 
194
- #: includes/class-ctc-ui.php:301
195
  msgid "Please enter a valid Child Theme."
196
- msgstr "Bitte gültiges Kindthema eingeben."
197
 
198
- #: includes/class-ctc-ui.php:302
199
  msgid "Please enter a valid Child Theme name."
200
- msgstr "Bitte gültigen Kindthema-Namen eingeben."
201
 
202
- #: includes/class-ctc-ui.php:303
203
  msgid "<strong>%s</strong> exists. Please enter a different Child Theme"
204
- msgstr "<strong>%s</strong> existiert. Bitte anderen Kindthema-Namen eingeben"
205
 
206
- #: includes/class-ctc-ui.php:304
207
  msgid "The page could not be loaded correctly."
208
  msgstr "Die Seite konnte nicht korrekt geladen werden."
209
 
210
- #: includes/class-ctc-ui.php:305
211
- msgid ""
212
- "Conflicting or out-of-date jQuery libraries were loaded by another plugin:"
213
  msgstr ""
214
- "jQuery-Bibliotheken-Konflikt oder veraltete wurden von anderem Plugin "
215
- "geladen."
216
 
217
- #: includes/class-ctc-ui.php:306
218
  msgid "Deactivating or replacing plugins may resolve this issue."
219
- msgstr "Deaktivieren oder Ersetzen von Plugins könnte das Problem lösen."
220
 
221
- #: includes/class-ctc-ui.php:307
222
  msgid "%sWhy am I seeing this?%s"
223
  msgstr "%sWieso sehe ich das?%s"
224
 
225
- #: includes/class-ctc-ui.php:310
226
- msgid "No Styles Available. Check Parent/Child settings."
227
- msgstr "Keine Stile verfügbar. Prüfen Sie Eltern/Kind-Einstellungen."
228
-
229
- #: includes/class-ctc-ui.php:311
230
- msgid "Updating"
231
- msgstr "Aktualisiere"
232
-
233
- #: includes/class-ctc-ui.php:312
234
- msgid "Checking"
235
- msgstr "Prüfe"
236
-
237
- #: includes/class-ctc-ui.php:313
238
- msgid "The theme \"%s\" generated unexpected PHP debug output."
239
- msgstr "Das Thema \"%s\" erzeugte unerwartete PHP-Debug-Ausgabe."
240
-
241
- #: includes/class-ctc-ui.php:314
242
- msgid "The theme \"%s\" could not be loaded."
243
- msgstr "Das Thema \"%s\" konnte nicht geladen werden."
244
-
245
- #: includes/class-ctc-ui.php:315
246
- msgid "<p>Please verify the theme has been installed correctly.</p>"
247
- msgstr "<p>Bitte prüfen Sie, ob das Thema korrekt installiert wurde.</p>"
248
-
249
- #: includes/class-ctc-ui.php:316
250
- msgid "Show Debug Output"
251
- msgstr "Zeige Debug-Ausgabe"
252
-
253
- #: includes/class-ctc-ui.php:317
254
- msgid ""
255
- "<p>You may not be able to use this Theme as a Child Theme while these "
256
- "conditions exist.</p><p>It is possible that this theme has specific "
257
- "requirements to work correctly as a child theme. Check your theme's "
258
- "documentation for more information.</p><p>Please make sure you are using the "
259
- "latest version of this theme. If so, please contact this Theme's author and "
260
- "report the error list above.</p>"
261
- msgstr ""
262
- "<p>Sie können dieses Thema unter diesen Bedingungen vielleicht nicht "
263
- "benutzen.</p><p>Möglicherweise braucht das Thema spezielle Anforderungen, um "
264
- "korrekt als Kindthema zu funktionieren. Prüfen Sie die Themen-Dokumentation "
265
- "für weitere Infos.</p>Bitte stellen Sie sicher, die neueste Version dieses "
266
- "Themas zu benutzen. Falls ja, kontaktieren Sie den Themenautor und melden "
267
- "Sie den obigen Fehler.</p>"
268
-
269
- #: includes/class-ctc-ui.php:318
270
- msgid "Do Not Activate \"%s\"! A PHP FATAL ERROR has been detected."
271
- msgstr "Aktivieren Sie nicht \"%s\"! Ein PHP FATAL ERROR wurde entdeckt."
272
-
273
- #: includes/class-ctc-ui.php:319
274
- msgid "This theme loads stylesheets after the wp_styles queue."
275
- msgstr "Dieses Thema lädt Formatvorlagen nach der wp_styles Warteschlange."
276
-
277
- #: includes/class-ctc-ui.php:320
278
- msgid ""
279
- "<p>This makes it difficult for plugins to override these styles. You can try "
280
- "to resolve this using the \"Repair header template\" option (Step 6, "
281
- "\"Additional handling options\", below).</p>"
282
- msgstr ""
283
- "<p>Dies macht es schwierig für Plugins, diese Stile zu übersteuern. Sie "
284
- "können dies eventuell mit der \"Reparieren Header-Vorlage\"-Option beheben "
285
- "(Schritt 6, \"Zusätzliche Behandlungsoptionen\", unten)</p>"
286
-
287
- #: includes/class-ctc-ui.php:321
288
- msgid ""
289
- "This theme loads the parent theme's <code>style.css</code> file outside the "
290
- "wp_styles queue."
291
- msgstr ""
292
- "Dieses Thema lädt die Elternthema <code>style.css</code>-Datei außerhalb der "
293
- "wp_styles-Warteschlange."
294
-
295
- #: includes/class-ctc-ui.php:322
296
- msgid ""
297
- "<p>This is common with older themes but requires the use of <code>@import</"
298
- "code>, which is no longer recommended. You can try to resolve this using the "
299
- "\"Repair header template\" option (see step 6, \"Additional handling options"
300
- "\", below).</p>"
301
- msgstr ""
302
- "<p>Dies ist üblich bei älteren Themen, benötigt aber den Gebrauch von "
303
- "<code>@import</code> (nicht mehr empfohlen). Sie können dies eventuell mit "
304
- "der \"Reparieren Header-Vorlage\"-Option beheben (Schritt 6, \"Zusätzliche "
305
- "Behandlungsoptionen\", unten)</p>"
306
-
307
- #: includes/class-ctc-ui.php:323
308
- msgid "This child theme does not load a Configurator stylesheet."
309
- msgstr "Dieses Kindthema lädt keine Konfigurator-Formatvorlage."
310
-
311
- #: includes/class-ctc-ui.php:324
312
- msgid ""
313
- "<p>If you want to customize styles using this plugin, please click "
314
- "\"Configure Child Theme\" again to add this to the settings.</p>"
315
- msgstr ""
316
- "<p>Wenn Sie Stile mit diesem Plugin anpassen wollen, bitte klicken Sie "
317
- "erneut \"Kindthema konfigurieren\", um dies zu den Einstellungen "
318
- "hinzuzufügen.</p>"
319
-
320
- #: includes/class-ctc-ui.php:325
321
- msgid ""
322
- "This child theme uses the parent stylesheet but does not load the parent "
323
- "theme's <code>style.css</code> file."
324
- msgstr ""
325
- "Dieses Kindthema benutzt die Eltern-Formatvorlage, aber lädt nicht die "
326
- "Elternthema <code>style.css</code>-Datei."
327
 
328
- #: includes/class-ctc-ui.php:326
329
- msgid ""
330
- "<p>Please select a stylesheet handling method or check \"Ignore parent theme "
331
- "stylesheets\" (see step 6, below).</p>"
332
- msgstr ""
333
- "<p>Bitte wählen Sie eine Formatvorlage-Behandlungsmethode oder kreuzen Sie "
334
- "\"Elternthema-Formatvorlagen ignorieren\" an (siehe Schritt 6 unten).</p>"
335
 
336
- #: includes/class-ctc-ui.php:327
337
- msgid "This child theme appears to be functioning correctly."
338
- msgstr "Dieses Kindthema scheint korrekt zu funktionieren."
339
 
340
- #: includes/class-ctc-ui.php:328
341
- msgid "This theme appears OK to use as a Child theme."
342
- msgstr "Dieses Thema scheint als Kindthema OK zu sein."
343
 
344
- #: includes/class-ctc-ui.php:329
345
- msgid "This Child Theme has not been configured for this plugin."
346
- msgstr "Dieses Kindthema wurde für dieses Plugin nicht konfiguriert."
347
 
348
- #: includes/class-ctc-ui.php:330
349
- msgid ""
350
- "<p>The Configurator makes significant modifications to the child theme, "
351
- "including stylesheet changes and additional php functions. Please consider "
352
- "using the DUPLICATE child theme option (see step 1, above) and keeping the "
353
- "original as a backup.</p>"
354
- msgstr ""
355
- "<p>Der Konfigurator macht umfangreiche Änderungen am Kindthema, inklusive "
356
- "Formatvorlage-Änderungen und zusätzlichen PHP-Funktionen. Bitte ziehen Sie "
357
- "die DUPLIZIEREN-Option für Kindthemen in Betracht (siehe Schritt 1 oben), um "
358
- "das Original als Backup zu behalten.</p>"
359
 
360
- #: includes/class-ctc-ui.php:331
361
- msgid ""
362
- "This child theme uses <code>@import</code> to load the parent theme's "
363
- "<code>style.css</code> file."
364
- msgstr ""
365
- "Dieses Thema benutzt das Elternthema <code>@import</code>, um die Eltern "
366
- "<code>style.css</code>-Datei zu laden."
367
 
368
- #: includes/class-ctc-ui.php:332
369
- msgid ""
370
- "<p>Please consider selecting \"Use the WordPress style queue\" for the "
371
- "parent stylesheet handling option (see step 6, below).</p>"
372
  msgstr ""
373
- "<p>Ziehen Sie bitte die Option \"Benutzen Sie die Wordpress Stil-"
374
- "Warteschlange\" in Betracht für die Formatvorlage-Behandlung (siehe Schritt "
375
- "6 unten)</p>"
376
 
377
- #: includes/class-ctc-ui.php:333
378
- msgid ""
379
- "This theme loads additional stylesheets after the <code>style.css</code> "
380
- "file:"
381
- msgstr ""
382
- "Dieses Thema lädt zusätzliche Formatvorlagen nach der <code>style.css</code>-"
383
- "Datei."
384
-
385
- #: includes/class-ctc-ui.php:334
386
- msgid ""
387
- "<p>Consider saving new custom styles to a \"Separate stylesheet\" (see step "
388
- "5, below) so that you can customize these styles.</p>"
389
- msgstr ""
390
- "<p>Ziehen Sie in Betracht, neue Stile in eine separate Formatvorlage zu "
391
- "sichern (siehe Schritt 5 unten), so dass Sie die Stile anpassen können.</p>"
392
-
393
- #: includes/class-ctc-ui.php:335
394
- msgid ""
395
- "The parent theme's <code>style.css</code> file is being loaded automatically."
396
- msgstr ""
397
- "Die Elternthema-Datei <code>style.css</code> wird automatisch geladen."
398
 
399
- #: includes/class-ctc-ui.php:336
400
- msgid ""
401
- "<p>The Configurator has been selected \"Do not add any parent stylesheet "
402
- "handling\" for the \"Parent stylesheet handling\" option (see step 6, below)."
403
- "</p>"
404
- msgstr ""
405
- "<p> Im Konfigurator wurde für \"Eltern-Formatvorlagen-Behandlung\" "
406
- "ausgewählt \"Keine Eltern-Formatvorlagen-Behandlung hinzufügen\" (siehe "
407
- "Schritt 6 unten).</p>"
408
 
409
- #: includes/class-ctc-ui.php:337
410
  msgid ""
411
- "This theme does not require the parent theme's <code>style.css</code> file "
412
- "for its appearance."
 
 
 
413
  msgstr ""
414
- "Dieses Thema benötigt die <code>style.css</code>-Datei des Elternthemas "
415
- "nicht für die Anzeige."
416
-
417
- #: includes/class-ctc-ui.php:338
418
- msgid "This Child Theme was configured with an earlier version."
419
- msgstr "Dieses Kindthema wurde mit einer früheren Version konfiguriert."
420
 
421
- #: includes/class-ctc-ui.php:339
422
- msgid ""
423
- "<p>The selected stylesheet handling method is no longer used. Please update "
424
- "the configuration using the \"Repair header template\" option (see step 6, "
425
- "\"Additional handling options\", below).</p>"
426
- msgstr ""
427
- "<p>Die ausgewählte Formatvorlage-Behandlungsmethode wird nicht mehr benutzt. "
428
- "Bitte aktualisieren Sie die Konfiguration mit der \"Reparieren Header-Vorlage"
429
- "\"-Option (siehe Schritt 6 unten, \"Zusätzliche Behandlungsoptionen\").</p>"
430
 
431
- #: includes/class-ctc-ui.php:340
432
- msgid "Show Analysis Object"
433
- msgstr "Zeige Analyse von Objekt"
434
 
435
- #: includes/class-ctc-ui.php:341
436
- msgid ""
437
- "This child theme was configured using the CTC Pro \"Genesis stylesheet "
438
- "handling\" method."
439
- msgstr ""
440
- "Dieses Kindthema wurde mit der CTC Pro \"Genesis Formatvorlagen Behandlungs"
441
- "\"-Methode konfiguriert."
442
 
443
- #: includes/class-ctc-ui.php:342
444
- msgid ""
445
- "<p>This method has been replaced by the \"Separate stylesheet\" and \"Ignore "
446
- "Parent Theme\" options ( selected below ) for broader framework "
447
- "compatability.</p>"
448
- msgstr ""
449
- "<p>Diese Methode wurde für breitere Kompatibilität durch die \"Separate "
450
- "Formatvorlage\" und \"Ignorieren Elternthema\"-Optionen ersetzt (unten "
451
- "ausgewählt)</p>."
452
 
453
- #: includes/class-ctc-ui.php:362
454
  msgid ""
455
- "The child theme is in read-only mode and Child Theme Configurator cannot "
456
- "apply changes. Click to see options"
457
  msgstr ""
458
- "Dieses Kindthema ist im Nur-Lese-Modus und der Kindthemen-Konfigurator kann "
459
- "die Änderungen nicht anwenden. Klicken Sie für Optionen"
460
 
461
- #: includes/class-ctc-ui.php:365
462
  msgid ""
463
- "<li>Temporarily set write permissions by clicking the button below. When you "
464
- "are finished editing, revert to read-only by clicking \"Make read-only\" "
465
- "under the \"Files\" tab.</li>"
466
  msgstr ""
467
- "<li>Temporär die Schreibberechtigungen setzen (mit dem Klicken der "
468
- "Schaltfläche). Wenn Sie mit der Bearbeitung fertig sind, können Sie \"Nur "
469
- "lesbar\" klicken (Dateien-Tab), um zum alten Zustand zurück zu kehren.</li>"
470
 
471
- #: includes/class-ctc-ui.php:368
472
  msgid "Make files writable"
473
- msgstr "Dateien beschreibbar machen"
474
 
475
- #: includes/class-ctc-ui.php:369
476
  msgid ""
477
- "<li><a target=\"_blank\" href=\"http://codex.wordpress.org/Editing_wp-"
478
- "config.php#WordPress_Upgrade_Constants\" title=\"Editin wp-config.php\">Add "
479
- "your FTP/SSH credentials to the WordPress config file</a>.</li>"
480
  msgstr ""
481
- "<li><a target=\"_blank\" href=\"http://codex.wordpress.org/Editing_wp-"
482
- "config.php#WordPress_Upgrade_Constants\" title=\"Editin wp-config.php\">Add "
483
- "your FTP/SSH credentials to the WordPress config file</a>.</li>"
484
 
485
- #: includes/class-ctc-ui.php:371
486
  msgid ""
487
- "<li><a target=\"_blank\" href=\"http://technet.microsoft.com/en-us/library/"
488
- "cc771170\" title=\"Setting Application Pool Identity\">Assign WordPress to "
489
- "an application pool that has write permissions</a> (Windows IIS systems).</"
490
- "li>"
491
  msgstr ""
492
- "<li><a target=\"_blank\" href=\"http://technet.microsoft.com/en-us/library/"
493
- "cc771170\" title=\"Setting Application Pool Identity\">Assign WordPress to "
494
- "an application pool that has write permissions</a> (Windows IIS systems).</"
495
- "li>"
496
 
497
- #: includes/class-ctc-ui.php:372
498
  msgid ""
499
- "<li><a target=\"_blank\" href=\"http://codex.wordpress.org/"
500
- "Changing_File_Permissions\" title=\"Changing File Permissions\">Set write "
501
- "permissions on the server manually</a> (not recommended).</li>"
502
  msgstr ""
503
- "<li><a target=\"_blank\" href=\"http://codex.wordpress.org/"
504
- "Changing_File_Permissions\" title=\"Changing File Permissions\">Set write "
505
- "permissions on the server manually</a> (not recommended).</li>"
506
 
507
- #: includes/class-ctc-ui.php:374
508
  msgid "<li>Run PHP under Apache with suEXEC (contact your web host).</li>"
509
- msgstr ""
510
- "<li>PHP unter Apache mit suEXEC laufen lassen (kontaktieren Sie Ihren "
511
- "Provider).</li>"
512
 
513
- #: includes/class-ctc-ui.php:383
514
  msgid ""
515
- "This Child Theme is not owned by your website account. It may have been "
516
- "created by a prior version of this plugin or by another program. Moving "
517
- "forward, it must be owned by your website account to make changes. Child "
518
- "Theme Configurator will attempt to correct this when you click the button "
519
- "below."
520
  msgstr ""
521
- "Dieses Kindthema gehört nicht Ihrem Webseiten-Konto. Es könnte von einer "
522
- "früheren Version dieses Plugins oder einem anderen Programm erstellt worden "
523
- "sein. Um fortzufahren und Änderungen zu machen, müssen Sie es besitzen. Der "
524
- "Kindthema-Konfigurator wird versuchen, dies zu korrigieren, wenn Sie die "
525
- "Schaltfläche unten klicken."
526
 
527
- #: includes/class-ctc-ui.php:391
528
- msgid ""
529
- "Child Theme Configurator needs to update its internal data. Please set your "
530
- "preferences below and click \"Generate Child Theme Files\" to update your "
531
- "configuration."
532
- msgstr ""
533
- "Der Kindthema-Konfigurator muss interne Daten aktualisieren. Bitte setzen "
534
- "Sie Ihre Voreinstellungen unten und klicken Sie auf \"Erzeuge Kindthemen-"
535
- "Dateien\", um die Konfiguration zu aktualisieren."
536
 
537
- #: includes/class-ctc-ui.php:397
538
  msgid ""
539
- "<strong>However, some styles could not be parsed due to memory limits.</"
540
- "strong> Try deselecting \"Additional Stylesheets\" below and click "
541
- "\"Generate/Rebuild Child Theme Files\". %sWhy am I seeing this?%s"
542
  msgstr ""
543
- "<strong>Einige Stile konnten jedoch wegen Speicherlimiten nicht gelesen "
544
- "werden.</strong> Versuchen Sie die Deselektion von \"Zusätzliche "
545
- "Formatvorlagen\" unten und klicken Sie auf \"Erzeugen/Neuaufbau Kindthemen-"
546
- "Dateien\". %sWieso sehe ich das?%s"
547
 
548
- #: includes/class-ctc-ui.php:405
549
  msgid ""
550
- "Child Theme Configurator did not detect any configuration data because a "
551
- "previously configured Child Theme has been removed. Please follow the steps "
552
- "for \"CONFIGURE an existing Child Theme\" under the \"Parent/Child\" Tab."
553
  msgstr ""
554
- "Der Kindthema-Konfigurator fand keinerlei Konfigurationsdaten, da ein früher "
555
- "konfiguriertes Kindthema entfernt wurde. Bitte folgen Sie den Schritten für "
556
- "\"KONFIGURIERE ein bestehendes Kindthema\" unter dem \"Eltern/Kind\"-Tab."
557
 
558
- #: includes/class-ctc-ui.php:411
559
  msgid ""
560
- "Your stylesheet has changed since the last time you used the Configurator. "
561
- "Please follow the steps for \"CONFIGURE an existing Child Theme\" under the "
562
- "\"Parent/Child\" Tab or you will lose these changes."
563
  msgstr ""
564
- "Ihre Formatvorlage hat sich seit der letzten Benutzung des Konfigurators "
565
- "verändert. Bitte folgen Sie den Schritten für \"KONFIGURIERE ein bestehendes "
566
- "Kindthema\" unter dem \"Eltern/Kind\"-Tab oder Sie werden diese Änderungen "
567
- "verlieren."
568
-
569
- #: includes/class-ctc-ui.php:423
570
- msgid "This version of Child Theme Configurator includes significant updates."
571
- msgstr ""
572
- "Diese Version des Kindthema-Konfigurators enthält umfangreiche Updates."
573
-
574
- #: includes/class-ctc-ui.php:424
575
- msgid ""
576
- "A lot of time and testing has gone into this release but there are always "
577
- "edge cases. If you have any questions, please"
578
- msgstr ""
579
- "Viel Zeit und Testen wurde in diese Veröffentlichung gesteckt, aber es gibt "
580
- "immer Sonderfälle. Wenn Sie Fragen haben sollten, bitte"
581
-
582
- #: includes/class-ctc-ui.php:424
583
- msgid "Contact Us."
584
- msgstr "Kontaktieren Sie uns."
585
-
586
- #: includes/class-ctc-ui.php:425
587
- msgid "For more information, please open the Help tab at the top right or "
588
- msgstr ""
589
- "Für weitere Informationen, bitte öffnen Sie oben rechts den Hilfe-Tab oder "
590
-
591
- #: includes/class-ctc-ui.php:425
592
- msgid "click here to view the latest videos."
593
- msgstr "klicken Sie hier für die neuesten Videos."
594
-
595
- #: includes/class-ctc-ui.php:427
596
- msgid ""
597
- "It is a good idea to save a Zip Archive of your Child Theme before using "
598
- "this version for the first time (click the button to the right to download). "
599
- "Remember you can always export your child themes from the \"Files\" Tab."
600
- msgstr ""
601
- "Es ist eine gute Idee, ein ZIP-Archiv Ihres Kindthemas zu speichern, bevor "
602
- "Sie diese Version erstmalig benutzen (klicken Sie die Schaltfläche rechts "
603
- "zum Herunterladen). Bedenken Sie, Sie können Ihr Kindthema immer mit dem "
604
- "\"Dateien\"-Tab exportieren."
605
-
606
- #: includes/class-ctc-ui.php:429
607
- msgid "Backup Child Theme"
608
- msgstr "Kindthema sichern"
609
-
610
- #. Plugin Name of the plugin/theme
611
- #: includes/class-ctc.php:50 includes/class-ctc.php:60
612
- #: includes/forms/main.php:34
613
- msgid "Child Theme Configurator"
614
- msgstr "Kindthema-Konfigurator"
615
-
616
- #: includes/class-ctc.php:51 includes/class-ctc.php:61
617
- #: includes/class-ctc.php:71
618
- msgid "Child Themes"
619
- msgstr "Kindthemen"
620
-
621
- #: includes/class-ctc.php:86
622
- msgid "Child Theme Configurator requires WordPress version %s or later."
623
- msgstr "Kindthema-Konfigurator benötigt WordPress-Version %s oder neuer."
624
 
625
  #: includes/forms/addl_css.php:7
626
  msgid "Parse additional stylesheets:"
627
- msgstr "Zusätzliche Formatvorlagen einlesen:"
628
 
629
- #: includes/forms/addl_css.php:11
630
  msgid ""
631
- "Stylesheets that are currently being loaded by the parent theme are "
632
- "automatically selected below (except for Bootstrap stylesheets which add a "
633
- "large amount data to the configuration). To further reduce overhead, select "
634
- "only the additional stylesheets you wish to customize."
635
  msgstr ""
636
- "Aktuell geladene Formatvorlagen vom Elternthema werden unten automatisch "
637
- "ausgewählt (ausgenommen Bootstrap-Stylesheets, welche der Konfiguration eine "
638
- "enorme Datenmenge hinzufügen). Um weiteren Overhead zu vermeiden, wählen Sie "
639
- "nur die Stylesheets aus, die Sie auch anpassen möchten."
640
 
641
  #: includes/forms/addl_panels.php:9 includes/forms/addl_panels.php:39
642
  msgid "Use coupon code"
643
- msgstr "Gutschein-Code benutzen"
644
 
645
  #: includes/forms/addl_panels.php:9 includes/forms/addl_panels.php:39
646
  msgid "wordpress-org"
@@ -648,7 +378,7 @@ msgstr "wordpress-org"
648
 
649
  #: includes/forms/addl_panels.php:9 includes/forms/addl_panels.php:39
650
  msgid "and get <strong>20% off entire order</strong>."
651
- msgstr "und erhalten Sie <strong> 20% auf die ganze Bestellung</strong>."
652
 
653
  #: includes/forms/addl_panels.php:10 includes/forms/addl_panels.php:40
654
  msgid "Order Now"
@@ -656,23 +386,22 @@ msgstr "Jetzt bestellen"
656
 
657
  #: includes/forms/addl_panels.php:10 includes/forms/addl_panels.php:40
658
  msgid "*Prices and offers subject to change."
659
- msgstr "*Preise und Angebote können sich ändern."
660
 
661
  #: includes/forms/addl_panels.php:11 includes/forms/addl_panels.php:12
662
  msgid "Learn more about IntelliWidget"
663
- msgstr "Mehr über IntelliWidget erfahren"
664
 
665
  #: includes/forms/addl_panels.php:12
666
  msgid ""
667
- "IntelliWidget is a versatile widget manager that does the work of multiple "
668
- "plugins by combining custom page menus, featured posts, sliders and other "
669
- "dynamic content features into a single plugin that can display on a per-page "
670
- "or site-wide basis."
671
  msgstr ""
672
- "IntelliWidget ist ein cleverer Widget-Manager, der die Arbeit von mehreren "
673
- "Plugins erledigt, indem er Seitenmenüs, angesagte Beiträge, Slider und "
674
- "anderen dynamischen Inhalt in ein einzelnes Plugin kombiniert, welche pro "
675
- "Seite oder Site angezeigt werden können."
676
 
677
  #: includes/forms/addl_panels.php:13 includes/forms/addl_panels.php:16
678
  msgid "Learn more"
@@ -684,43 +413,42 @@ msgstr "Mehr über IW Responsive Menu erfahren"
684
 
685
  #: includes/forms/addl_panels.php:15
686
  msgid ""
687
- "IntelliWidget Responsive Menu lets you break free from your theme’s built-in "
688
- "responsive menu options and gives you complete control over the user "
689
- "experience."
690
  msgstr ""
691
- "IntelliWidget Responsive Menu lässt Sie aus den eingebauten Themen-"
692
- "Menüoptionen ausbrechen und gibt Ihnen komplette Kontrolle über die "
693
- "Benutzererfahrung."
694
 
695
- #: includes/forms/addl_panels.php:19
696
  msgid "Learn more about CTC Pro"
697
  msgstr "Mehr über CTC Pro erfahren"
698
 
699
  #: includes/forms/addl_panels.php:20
700
  msgid "Customizing WordPress just got even easier."
701
- msgstr "WordPress anzupassen ist jetzt noch einfacher."
702
 
703
  #: includes/forms/addl_panels.php:21
704
  msgid ""
705
- "Thousands of users have already seen the benefits of using Child Theme "
706
- "Configurator. If you spend any amount of time customizing WordPress, CTC Pro "
707
- "will help maximize your productivity."
708
  msgstr ""
709
- "Tausende von Benutzern haben die Vorteile des Kindthema-Konfigurators (CTC) "
710
- "schon gesehen. Wenn Sie Zeit mit der Anpassung von WordPress verwenden, holt "
711
- "CTC Pro das Maximum an Produktivität heraus."
712
 
713
  #: includes/forms/addl_panels.php:22
714
  msgid "Designed by Developers Who Use It Every Day."
715
- msgstr "Von Entwicklern kreiert, die es jeden Tag benutzen."
716
 
717
  #: includes/forms/addl_panels.php:23
718
  msgid ""
719
- "We've packed in more features to make design work quicker and easier with "
720
- "<strong>Child Theme Configurator Pro.</strong>"
721
  msgstr ""
722
- "Wir haben noch mehr Funktionen hineingepackt, um das Designen schneller und "
723
- "einfacher zu machen mit <strong>Child Theme Configurator Pro.</strong>"
724
 
725
  #: includes/forms/addl_panels.php:25
726
  msgid "Customize Plugin Stylesheets"
@@ -728,20 +456,20 @@ msgstr "Plugin-Formatvorlagen anpassen"
728
 
729
  #: includes/forms/addl_panels.php:26
730
  msgid ""
731
- "Apply the power of CTC's top-rated interface to your site's plugin styles. "
732
- "All new design makes it much easier to get the results you want."
733
  msgstr ""
734
- "Wenden Sie die Macht von CTC's top-bewerteter Schnittstelle für Ihre Plugin-"
735
- "Stile an. Das ganz neue Design macht es noch einfacher, die gewünschten "
736
- "Resultate zu erhalten."
737
 
738
  #: includes/forms/addl_panels.php:27
739
  msgid "Quick Preview"
740
- msgstr "Schnelle Vorschau"
741
 
742
  #: includes/forms/addl_panels.php:27
743
- msgid "Preview your child theme with a single click."
744
- msgstr "Vorschau Ihres Kindthemas mit nur einem Klick."
745
 
746
  #: includes/forms/addl_panels.php:28
747
  msgid "Color Palettes"
@@ -749,22 +477,21 @@ msgstr "Farbpaletten"
749
 
750
  #: includes/forms/addl_panels.php:28
751
  msgid ""
752
- "Keep the colors you select just a click away. No more searching for hex "
753
- "codes and RGB values."
754
  msgstr ""
755
- "Die gewünschten Farben nur einen Klick entfernt. Kein umständliches Suchen "
756
- "nach Hex-Codes und RGB-Werten."
757
 
758
  #: includes/forms/addl_panels.php:29
759
  msgid "Find related styles"
760
- msgstr "Finde verwandte Stile"
761
 
762
  #: includes/forms/addl_panels.php:29
763
  msgid ""
764
- "Use the \"All Styles\" panel to edit groups of selectors from a single "
765
- "combined list."
766
  msgstr ""
767
- "Benutze Sie das \"Alle Stile\"-Werkzeug, um Gruppen von Selektoren in einer "
768
  "einzigen kombinierten Liste zu bearbeiten."
769
 
770
  #: includes/forms/addl_panels.php:30
@@ -773,7 +500,7 @@ msgstr "Finde Stile mittels Nav-Menü"
773
 
774
  #: includes/forms/addl_panels.php:30
775
  msgid "Tweak menus quickly and easily."
776
- msgstr "Menüs einfach und schnell anpassen."
777
 
778
  #: includes/forms/addl_panels.php:31
779
  msgid "Most recent edits"
@@ -782,8 +509,7 @@ msgstr "Letzte Bearbeitungen"
782
  #: includes/forms/addl_panels.php:31
783
  msgid "Return to recently edited selectors from a toggleable sidebar."
784
  msgstr ""
785
- "Zu den kürzlich bearbeiteten Selektoren mittels Umschalt-Seitenleiste "
786
- "zurückkehren."
787
 
788
  #: includes/forms/addl_panels.php:32
789
  msgid "Genesis Framework Support"
@@ -791,11 +517,10 @@ msgstr "Genesis Framework Support"
791
 
792
  #: includes/forms/addl_panels.php:33
793
  msgid ""
794
- "Automatically detects and configures Genesis Child Themes with more "
795
- "frameworks on the way."
796
  msgstr ""
797
- "Entdeckt und konfiguriert automatisch Genesis-Kindthemen (mehr Frameworks "
798
- "werden folgen)."
799
 
800
  #: includes/forms/addl_panels.php:34
801
  msgid "Top-rated Online Support"
@@ -807,31 +532,28 @@ msgstr "Online-Dokumentation"
807
 
808
  #: includes/forms/addl_panels.php:36
809
  msgid "Tutorial Videos"
810
- msgstr "Anleitungs-Videos"
811
 
812
  #: includes/forms/addl_tabs.php:8
813
  msgid "Upgrade"
814
- msgstr "Upgrade"
815
 
816
  #: includes/forms/backup.php:8
817
  msgid "Backup"
818
- msgstr "Backup"
819
 
820
- #: includes/forms/backups.php:10
821
  msgid "Restore backup from"
822
- msgstr "Backup wiederherstellen vom"
823
 
824
  #: includes/forms/fileform.php:8
825
- msgid ""
826
- "The Theme editor has been disabled. Template files must be edited offline."
827
  msgstr ""
828
- "Der Themeneditor wurde deaktiviert. Vorlagendateien müssen offline "
829
- "bearbeitet werden."
830
 
831
  #: includes/forms/fileform.php:12
832
  msgid "Click here to edit template files using the Theme Editor"
833
- msgstr ""
834
- "Hier klicken, um die Vorlagendateien mit dem Themeneditor zu bearbeiten"
835
 
836
  #: includes/forms/fileform.php:23
837
  msgid "Parent Templates"
@@ -839,51 +561,44 @@ msgstr "Eltern-Vorlagen"
839
 
840
  #: includes/forms/fileform.php:23
841
  msgid "Child Theme Files"
842
- msgstr "Kindthemen-Dateien"
843
 
844
  #: includes/forms/fileform.php:28
845
- msgid ""
846
- "Copy PHP templates from the parent theme by selecting them here. The "
847
- "Configurator defines a template as a Theme PHP file having no PHP functions "
848
- "or classes. Other PHP files cannot be safely overridden by a child theme."
849
  msgstr ""
850
- "PHP-Vorlagendateien des Elternthemas kopieren, indem Sie sie hier auswählen. "
851
- "Der Konfigurator definiert eine Vorlage als eine PHP-Datei ohne Klassen bzw. "
852
- "Funktionen. Andere PHP-Dateien können vom Kindthema nicht sicher "
853
- "überschrieben werden."
854
 
855
  #: includes/forms/fileform.php:31
856
  msgid ""
857
- "CAUTION: If your child theme is active, the child theme version of the file "
858
- "will be used instead of the parent immediately after it is copied."
859
  msgstr ""
860
- "WARNUNG: Wenn Ihr Kindthema aktiv ist, wird sofort die Kindthema-Version der "
861
- "Datei anstelle der Eltern-Version benutzt, nachdem sie kopiert wurde."
862
 
863
  #: includes/forms/fileform.php:33
864
  msgid "The %s file is generated separately and cannot be copied here."
865
- msgstr "Die %s-Datei wird separat erzeugt und kann hier nicht kopiert werden."
866
 
867
  #: includes/forms/fileform.php:43
868
  msgid "Delete child theme templates by selecting them here."
869
- msgstr "Kindthema-Vorlagen löschen, indem Sie sie hier auswählen."
870
 
871
  #: includes/forms/fileform.php:44
872
  msgid ""
873
- "Delete child theme templates or make them writable by selecting them here. "
874
- "Writable files are displayed in <span style=\"color:red\">red</span>."
875
  msgstr ""
876
- "Kindthema-Vorlagen löschen oder beschreibbar machen, indem Sie sie hier "
877
- "auswählen. Beschreibbare Dateien sind in <span style=\"color:red\">rot</"
878
- "span> angezeigt."
879
 
880
  #: includes/forms/fileform.php:57
881
  msgid "Make Selected Writable"
882
- msgstr "Auswahl beschreibbar machen"
883
 
884
  #: includes/forms/fileform.php:61
885
  msgid "Copy Selected to Child Theme"
886
- msgstr "In gewähltes Kindthema kopieren"
887
 
888
  #: includes/forms/fileform.php:61 includes/forms/images.php:21
889
  msgid "Delete Selected"
@@ -891,16 +606,15 @@ msgstr "Auswahl löschen"
891
 
892
  #: includes/forms/files.php:15
893
  msgid "Upload New Child Theme Image"
894
- msgstr "Neues Kindthema-Abbild (Image) hochladen"
895
 
896
  #: includes/forms/files.php:18
897
  msgid ""
898
- "Theme images reside under the <code>images</code> directory in your child "
899
- "theme and are meant for stylesheet use only. Use the Media Library for "
900
- "content images."
901
  msgstr ""
902
- "Themenbilder befinden sich unter dem <code>images</code>-Verzeichnis in "
903
- "Ihrem Kindthema und sind nur für Formatvorlagen gedacht. Nutzen Sie die "
904
  "Medienbibliothek für Inhaltsbilder."
905
 
906
  #: includes/forms/files.php:25 includes/forms/files.php:51
@@ -909,390 +623,311 @@ msgstr "Hochladen"
909
 
910
  #: includes/forms/files.php:32
911
  msgid "Child Theme Screenshot"
912
- msgstr "Kindthema-Screenshot"
913
 
914
  #: includes/forms/files.php:41
915
  msgid "Upload New Screenshot"
916
- msgstr "Neuer Kindthema-Screenshot"
917
 
918
  #: includes/forms/files.php:44
919
  msgid ""
920
- "The theme screenshot should be a 4:3 ratio (e.g., 880px x 660px) JPG, PNG or "
921
- "GIF. It will be renamed <code>screenshot</code>."
922
  msgstr ""
923
- "Der Themen-Screenshot sollte das Format 4:3 haben (bspw. 880px x 660px) JPG, "
924
- "PNG oder GIF. Es wird umbenannt zu <code>screenshot</code>."
925
 
926
- #: includes/forms/files.php:57
927
  msgid "Export Child Theme as Zip Archive"
928
- msgstr "Kindthema als ZIP-Archiv exportieren"
 
 
 
 
929
 
930
- #: includes/forms/files.php:68
931
  msgid "Secure Child Theme"
932
- msgstr "Kindthema absichern"
933
 
934
- #: includes/forms/files.php:71
935
- msgid ""
936
- "Attempt to reset child theme permissions to user ownership and read-only "
937
- "access."
938
  msgstr ""
939
- "Versuche, die Kindthema-Berechtigungen zurückzusetzen (auf Nur-Lese-Zugriff "
940
- "und Benutzerbesitz)."
941
 
942
- #: includes/forms/files.php:77
943
  msgid "Make read-only"
944
- msgstr "Nur-Lesbar machen"
945
 
946
  #: includes/forms/images.php:10
947
  msgid "Child Theme Images"
948
- msgstr "Kindthemen-Bilder"
949
 
950
  #: includes/forms/images.php:13
951
  msgid "Delete child theme images by selecting them here."
952
- msgstr "Auswahl der Kindthemen-Bilder zum Löschen."
953
 
954
- #: includes/forms/main.php:34
955
  msgid "version"
956
- msgstr "Version"
957
 
958
- #: includes/forms/main.php:38
959
- msgid "Debug"
960
- msgstr "Debug"
961
 
962
- #: includes/forms/main.php:41
963
- msgid "Currently Loaded"
964
- msgstr "Aktuell geladen"
965
 
966
- #: includes/forms/parent-child.php:22
967
- msgid "Select an action:"
968
- msgstr "Aktion auswählen:"
969
 
970
- #: includes/forms/parent-child.php:29
971
- msgid "CREATE a new Child Theme"
972
- msgstr "ERZEUGE ein neues Kindthema"
973
-
974
- #: includes/forms/parent-child.php:32
975
- msgid ""
976
- "Install a new customizable child theme using an installed theme as a parent."
977
- msgstr ""
978
- "Ein neues anpassbares Kindthema mittels installiertem Thema als Elternthema "
979
- "installieren."
980
 
981
  #: includes/forms/parent-child.php:43
982
- msgid "CONFIGURE an existing Child Theme"
983
- msgstr "Bestehendes Kindthema ANPASSEN"
984
 
985
- #: includes/forms/parent-child.php:46
986
- msgid ""
987
- "Set up a previously installed child theme for use with the Configurator or "
988
- "to modify current settings."
989
- msgstr ""
990
- "Ein vorher installiertes Kindthema aufsetzen, um es mit dem Konfigurator "
991
- "bearbeiten zu können."
992
 
993
- #: includes/forms/parent-child.php:55
994
- msgid "DUPLICATE an existing Child Theme"
995
- msgstr "Bestehenes Kindthema DUPLIZIEREN"
996
-
997
- #: includes/forms/parent-child.php:58
998
- msgid ""
999
- "Make a complete copy of an existing Child Theme in a new directory, "
1000
- "including any menus, widgets and other Customizer settings. The option to "
1001
- "copy the Parent Theme settings (step 8, below) is disabled with this action."
1002
- msgstr ""
1003
- "Eine vollständige Kopie eines bestehenden Kindthemas in neuem Verzeichnis "
1004
- "erstellen, inkl. Menüs, Widgets und andere Einstellungen. Die Option zum "
1005
- "Kopieren der Elternthema-Einstellungen (Schritt 8 unten) ist mit dieser "
1006
- "Aktion deaktiviert."
1007
 
1008
- #: includes/forms/parent-child.php:67
1009
- msgid ""
1010
- "RESET an existing Child Theme (this will destroy any work you have done in "
1011
- "the Configurator)"
1012
- msgstr ""
1013
- "Ein bestehendes Kindthema ZURÜCKSETZEN (zerstört all Ihre bisherige Arbeit "
1014
- "mit dem Konfigurator)"
1015
 
1016
- #: includes/forms/parent-child.php:70
1017
- msgid ""
1018
- "Revert the Child theme stylesheet and functions files to their state before "
1019
- "the initial configuration or last reset. Additional child theme files will "
1020
- "not be removed, but you can delete them under the Files tab."
1021
- msgstr ""
1022
- "Kindthema-Formatvorlage und Funktionsdateien auf ihren ursprünglichen "
1023
- "Zustand setzen (vor der Initial-Konfiguration oder dem letzten "
1024
- "Zurücksetzen). Zusätzliche Kindthemen-Dateien werden belassen, aber sie "
1025
- "können mittels \"Dateien\"-Tab gelöscht werden."
1026
 
1027
- #: includes/forms/parent-child.php:79
1028
- msgid "Select a Parent Theme:"
1029
- msgstr "Elternthema auswählen:"
1030
 
1031
- #: includes/forms/parent-child.php:83 includes/forms/parent-child.php:96
1032
- msgid "Analyze"
1033
- msgstr "Analysieren"
1034
 
1035
- #: includes/forms/parent-child.php:85
1036
- msgid "Analyze Parent Theme"
1037
- msgstr "Analysiere Elternthema"
1038
 
1039
- #: includes/forms/parent-child.php:85 includes/forms/parent-child.php:98
1040
- msgid ""
1041
- "Click \"Analyze\" to determine stylesheet dependencies and other potential "
1042
- "issues."
1043
- msgstr ""
1044
- "\"Analysieren\" klicken, um Formatvorlage-Abhängigkeiten und andere mögliche "
1045
- "Probleme zu erkennen."
1046
 
1047
- #: includes/forms/parent-child.php:92
1048
- msgid "Select a Child Theme:"
1049
- msgstr "Kindthema auswählen:"
1050
 
1051
- #: includes/forms/parent-child.php:98
1052
- msgid "Analyze Child Theme"
1053
- msgstr "Kindthema analysieren"
1054
 
1055
- #: includes/forms/parent-child.php:106
1056
- msgid "Name the new theme directory:"
1057
- msgstr "Neues Verzeichnis benennen:"
1058
 
1059
  #: includes/forms/parent-child.php:109
1060
- msgid "Directory Name"
1061
- msgstr "Verzeichnisname"
1062
 
1063
- #: includes/forms/parent-child.php:113 includes/forms/parent-child.php:307
 
 
 
 
 
1064
  msgid "NOTE:"
1065
  msgstr "HINWEIS:"
1066
 
1067
- #: includes/forms/parent-child.php:115
1068
- msgid ""
1069
- "This is NOT the name of the Child Theme. You can customize the name, "
1070
- "description, etc. in step 7, below."
1071
  msgstr ""
1072
- "Dies ist NICHT der Name des Kindthemas. Sie können Name, Beschreibung etc. "
1073
- "in Schritt 7 unten anpassen."
1074
 
1075
- #: includes/forms/parent-child.php:119
1076
- msgid "Verify Child Theme directory:"
1077
- msgstr "Kindthema-Verzeichnis prüfen:"
1078
-
1079
- #: includes/forms/parent-child.php:125
1080
- msgid ""
1081
- "For verification only (you cannot modify the directory of an existing Child "
1082
- "Theme)."
1083
- msgstr ""
1084
- "Nur zur Überprüfung (Sie können das Verzeichnis eines Kindthemas nicht "
1085
- "verändern)."
1086
 
1087
- #: includes/forms/parent-child.php:135 includes/forms/parent-child.php:165
1088
- msgid "Click to expand"
1089
- msgstr "Zum Erweitern klicken"
1090
 
1091
- #: includes/forms/parent-child.php:136
1092
- msgid "Select where to save new styles:"
1093
- msgstr "Speicherort der neuen Stile auswählen:"
1094
 
1095
- #: includes/forms/parent-child.php:143
1096
- msgid "Primary Stylesheet (style.css)"
1097
- msgstr "Primäre Formatvorlage (style.css)"
1098
 
1099
- #: includes/forms/parent-child.php:146
1100
- msgid ""
1101
- "Save new custom styles directly to the Child Theme primary stylesheet, "
1102
- "replacing the existing values. The primary stylesheet will load in the order "
1103
- "set by the theme."
1104
  msgstr ""
1105
- "Sichere neue angepasste Stile direkt in das primäre Formatvorlage des "
1106
- "Kindthemas (ersetze vorhandene Werte). Die primäre Formatvorlage wird in "
1107
- "definierter Reihenfolge geladen."
1108
 
1109
- #: includes/forms/parent-child.php:156
1110
- msgid "Separate Stylesheet"
1111
- msgstr "Separate Formatvorlage"
1112
 
1113
- #: includes/forms/parent-child.php:159
1114
- msgid ""
1115
- "Save new custom styles to a separate stylesheet and use any existing child "
1116
- "theme styles as a baseline. Select this option if you want to preserve the "
1117
- "original child theme styles instead of overwriting them. This option also "
1118
- "allows you to customize stylesheets that load after the primary stylesheet."
1119
- msgstr ""
1120
- "Sichere neue angepasste Stile in separates Formatvorlage und verwende "
1121
- "bestehende Kindthemen-Stile als Basis. Diese Option wählen, wenn Sie die "
1122
- "Original-Kindthemen-Stile behalten wollen (statt zu überschreiben). Diese "
1123
- "Option erlaubt Ihnen, nach der primären Formatvorlage geladene "
1124
- "Formatvorlagen anzupassen."
1125
 
1126
- #: includes/forms/parent-child.php:166
1127
- msgid "Select Parent Theme stylesheet handling:"
1128
- msgstr "Elternthema-Formatvorlage Behandlung auswählen:"
1129
 
1130
- #: includes/forms/parent-child.php:179
1131
- msgid "Use the WordPress style queue."
1132
- msgstr "Benutze die WordPress Stil-Warteschlange."
1133
 
1134
- #: includes/forms/parent-child.php:183
1135
  msgid ""
1136
- "Let the Configurator determine the appropriate actions and dependencies and "
1137
- "update the functions file automatically."
1138
  msgstr ""
1139
- "Den Konfigurator die richtigen Aktionen und Abhängigkeiten auswählen lassen "
1140
- "und Funktionendateien automatisch aktualisieren."
1141
 
1142
- #: includes/forms/parent-child.php:189
1143
- msgid "Use <code>@import</code> in the child theme stylesheet."
1144
- msgstr "Benutze <code>@import</code> in der Kindthema-Formatvorlage."
1145
 
1146
- #: includes/forms/parent-child.php:193
1147
  msgid ""
1148
- "Only use this option if the parent stylesheet cannot be loaded using the "
1149
- "WordPress style queue. Using <code>@import</code> is not recommended."
1150
  msgstr ""
1151
- "Diese Option nur benutzen, wenn die Eltern-Formatvorlage nicht mit der "
1152
- "WordPress-Warteschlange geladen werden kann. Benutzung von <code>@import</"
1153
- "code> ist nicht länger empfohlen."
1154
 
1155
- #: includes/forms/parent-child.php:199
1156
- msgid "Do not add any parent stylesheet handling."
1157
- msgstr "Keine zusätzliche Eltern-Formatvorlage-Behandlung hinzufügen."
1158
 
1159
- #: includes/forms/parent-child.php:202
1160
  msgid ""
1161
- "Select this option if this theme already handles the parent theme stylesheet "
1162
- "or if the parent theme's <code>style.css</code> file is not used for its "
1163
- "appearance."
1164
  msgstr ""
1165
- "Diese Option wählen, wenn dieses Thema die Elternthema-Formatvorlage schon "
1166
- "behandelt oder die Eltern-Thema <code>style.css</code>-Datei für die Anzeige "
1167
- "nicht benutzt wird."
 
1168
 
1169
- #: includes/forms/parent-child.php:205
1170
- msgid "Additional handling options"
1171
- msgstr "Zusätzliche Behandlungs-Optionen"
1172
 
1173
- #: includes/forms/parent-child.php:212
1174
- msgid "Ignore parent theme stylesheets."
1175
- msgstr "Elternthema-Formatvorlagen ignorieren."
1176
 
1177
- #: includes/forms/parent-child.php:213
1178
  msgid ""
1179
- "Do not load or parse the parent theme styles. Only use this option if the "
1180
- "Child Theme uses a Framework like Genesis and only uses child theme "
1181
- "stylesheets for its appearance."
1182
  msgstr ""
1183
- "Elternthema-Stile nicht laden oder auslesen. Diese Option nur benutzen, "
1184
- "falls das Kindthema ein Framework wie Genesis nutzt und Kindthemen-"
1185
- "Formatvorlagen für die Anzeige benutzt."
1186
 
1187
- #: includes/forms/parent-child.php:222
1188
- msgid "Repair the header template in the child theme."
1189
- msgstr "Den Header der Vorlage im Kindthema reparieren."
1190
 
1191
- #: includes/forms/parent-child.php:223
1192
  msgid ""
1193
- "Let the Configurator (try to) resolve any stylesheet issues listed above. "
1194
- "This can fix many, but not all, common problems."
 
1195
  msgstr ""
1196
- "Den Konfigurator die obigen Probleme mit Formatvorlagen selber lösen lassen. "
1197
- "Dies kann viele, aber nicht alle der üblichen Probleme lösen."
1198
-
1199
- #: includes/forms/parent-child.php:228
1200
- msgid "Click to toggle form"
1201
- msgstr "Klicken um Formular umzuschalten"
1202
-
1203
- #: includes/forms/parent-child.php:229
1204
- msgid "Customize the Child Theme Name, Description, Author, Version, etc.:"
1205
- msgstr "Kindthema-Name, Beschreibung, Autor, Version etc. anpassen"
1206
-
1207
- #: includes/forms/parent-child.php:230
1208
- msgid "(Click to toggle form)"
1209
- msgstr "(Klicken um Formular umzuschalten)"
1210
-
1211
- #: includes/forms/parent-child.php:234
1212
- msgid "Child Theme Name"
1213
- msgstr "Name des Kindthemas"
1214
-
1215
- #: includes/forms/parent-child.php:238
1216
- msgid "Theme Name"
1217
- msgstr "Themenname"
1218
 
1219
- #: includes/forms/parent-child.php:243 includes/forms/parent-child.php:247
1220
- msgid "Theme Website"
1221
- msgstr "Themenwebseite"
1222
 
1223
- #: includes/forms/parent-child.php:252 includes/forms/parent-child.php:256
1224
- msgid "Author"
1225
- msgstr "Autor"
 
1226
 
1227
- #: includes/forms/parent-child.php:261 includes/forms/parent-child.php:265
1228
- msgid "Author Website"
1229
- msgstr "Autoren-Webseite"
1230
 
1231
- #: includes/forms/parent-child.php:270
1232
- msgid "Theme Description"
1233
- msgstr "Themen-Beschreibung"
 
 
 
 
1234
 
1235
- #: includes/forms/parent-child.php:273
1236
- msgid "Description"
1237
- msgstr "Beschreibung"
1238
 
1239
- #: includes/forms/parent-child.php:278
1240
- msgid "Theme Tags"
1241
- msgstr "Themen-Schlagwörter"
1242
 
1243
- #: includes/forms/parent-child.php:281
1244
- msgid "Tags"
1245
- msgstr "Schlagwörter"
1246
 
1247
- #: includes/forms/parent-child.php:286 includes/forms/parent-child.php:290
1248
- msgid "Version"
1249
- msgstr "Version"
1250
 
1251
- #: includes/forms/parent-child.php:299
1252
- msgid ""
1253
- "Copy Menus, Widgets and other Customizer Settings from the Parent Theme to "
1254
- "the Child Theme:"
1255
- msgstr ""
1256
- "Kopiere Menüs, Widgets, und andere Customizer-Einstellungen vom Elternthema "
1257
- "in das Kindthema:"
1258
 
1259
- #: includes/forms/parent-child.php:309
1260
  msgid ""
1261
- "This option replaces the Child Theme's existing Menus, Widgets and other "
1262
- "Customizer Settings with those from the Parent Theme. You should only need "
1263
- "to use this option the first time you configure a Child Theme."
1264
  msgstr ""
1265
- "Diese Option ersetzt bestehende Menüs, Widgets und andere Customizer-"
1266
- "Einstellungen des Kindthemas mit denen des Elternthemas. Sie sollten diese "
1267
- "Option nur bei der ersten Konfiguration eines Kindthemas verwenden."
1268
-
1269
- #: includes/forms/parent-child.php:316 includes/forms/parent-child.php:353
1270
- msgid "Click to run the Configurator:"
1271
- msgstr "Klicken, um den Konfigurator laufen zu lassen:"
1272
 
1273
- #: includes/forms/parent-child.php:319
1274
- msgid "Configure Child Theme"
1275
- msgstr "Kindthema konfigurieren"
1276
 
1277
- #: includes/forms/parent-child.php:337
1278
- msgid "Parse Plugin stylesheets:"
1279
- msgstr "Plugin-Formatvorlagen einlesen"
1280
 
1281
- #: includes/forms/parent-child.php:341
1282
- msgid "Select the plugin stylesheets you wish to customize below."
1283
- msgstr "Plugin-Formatvorlagen zum Anpassen unten auswählen"
1284
 
1285
- #: includes/forms/parent-child.php:356
1286
- msgid "Configure Plugin Styles"
1287
- msgstr "Plugin-Stile konfigurieren"
1288
 
1289
  #: includes/forms/query-selector.php:13
1290
- msgid "@media Query"
1291
- msgstr "@media Query"
1292
-
1293
- #: includes/forms/query-selector.php:14
1294
- msgid "( or \"base\" )"
1295
- msgstr "( oder \"base\" )"
1296
 
1297
  #: includes/forms/query-selector.php:24
1298
  msgid "Selector"
@@ -1304,23 +939,23 @@ msgstr "Muster"
1304
 
1305
  #: includes/forms/query-selector.php:45
1306
  msgid "Save Child Values"
1307
- msgstr "Kindwerte schreiben"
1308
 
1309
  #: includes/forms/query-selector.php:46
1310
  msgid "Delete Child Values"
1311
- msgstr "Kindwerte löschen"
1312
 
1313
  #: includes/forms/query-selector.php:53 includes/forms/rule-value.php:13
1314
  msgid "Property"
1315
  msgstr "Eigenschaft"
1316
 
1317
  #: includes/forms/query-selector.php:56
1318
- msgid "Baseline Value"
1319
- msgstr "Basiswert"
1320
 
1321
  #: includes/forms/query-selector.php:59
1322
  msgid "Child Value"
1323
- msgstr "Kindwert"
1324
 
1325
  #: includes/forms/query-selector.php:65
1326
  msgid "New Property"
@@ -1332,7 +967,7 @@ msgstr "Reihenfolge"
1332
 
1333
  #: includes/forms/query-selector.php:84
1334
  msgid "Copy Selector"
1335
- msgstr "Selektor kopieren"
1336
 
1337
  #: includes/forms/query-selector.php:86 includes/forms/webfonts.php:15
1338
  msgid "Save"
@@ -1345,16 +980,15 @@ msgstr "Rohes CSS"
1345
  #: includes/forms/query-selector.php:91
1346
  msgid "Use to enter shorthand CSS or new @media queries and selectors."
1347
  msgstr ""
1348
- "Benutzen, um Shorthand-CSS oder neue @media-Queries und Selektoren "
1349
- "einzugeben."
1350
 
1351
  #: includes/forms/query-selector.php:91
1352
  msgid ""
1353
- "Values entered here are merged into existing child styles or added to the "
1354
- "child stylesheet if they do not exist in the parent."
1355
  msgstr ""
1356
- "Hier eingegebene Werte werden in bestehende Kind-Stile eingefügt oder "
1357
- "hinzugefügt, falls sie im Eltern-Stil nicht bestehen sollten."
1358
 
1359
  #: includes/forms/related.php:1
1360
  msgid "New user?"
@@ -1362,7 +996,7 @@ msgstr "Neuer Benutzer?"
1362
 
1363
  #: includes/forms/related.php:1
1364
  msgid "Click help"
1365
- msgstr "Klicken Sie auf Hilfe"
1366
 
1367
  #: includes/forms/related.php:1
1368
  msgid "Get CTC Pro and other tools"
@@ -1370,7 +1004,7 @@ msgstr "CTC Pro und andere Tools erhalten"
1370
 
1371
  #: includes/forms/related.php:1
1372
  msgid "Lilaea Media - Responsive Tools for a Mobile World"
1373
- msgstr "Klicken um Formular umzuschalten"
1374
 
1375
  #: includes/forms/rule-value.php:26
1376
  msgid "Value"
@@ -1380,27 +1014,27 @@ msgstr "Wert"
1380
  msgid "Parent/Child"
1381
  msgstr "Eltern/Kind"
1382
 
1383
- #: includes/forms/tabs.php:14
1384
  msgid "Query/Selector"
1385
  msgstr "Abfrage/Selektor"
1386
 
1387
- #: includes/forms/tabs.php:17
1388
  msgid "Property/Value"
1389
  msgstr "Eigenschaft/Wert"
1390
 
1391
- #: includes/forms/tabs.php:20
1392
  msgid "Web Fonts"
1393
  msgstr "Webschriftarten"
1394
 
1395
- #: includes/forms/tabs.php:23
1396
- msgid "Baseline Styles"
1397
- msgstr "Basis-Stile"
1398
 
1399
- #: includes/forms/tabs.php:26
1400
- msgid "Child Styles"
1401
- msgstr "Kind-Stile"
1402
 
1403
- #: includes/forms/tabs.php:30
1404
  msgid "Files"
1405
  msgstr "Dateien"
1406
 
@@ -1418,7 +1052,7 @@ msgstr "Vorschau"
1418
 
1419
  #: includes/forms/themepreview.php:17
1420
  msgid " in default Site"
1421
- msgstr " in Standard-Seite"
1422
 
1423
  #: includes/forms/themepreview.php:21
1424
  msgid "Not Network Enabled"
@@ -1430,19 +1064,14 @@ msgstr "Verknüpfte Formatvorlagen"
1430
 
1431
  #: includes/forms/webfonts.php:20
1432
  msgid ""
1433
- "Use <code>@import url( [path] );</code> to link additional stylesheets. "
1434
- "Child Theme Configurator uses the <code>@import</code> keyword to identify "
1435
- "them and convert them to <code>&lt;link&gt;</code> tags. <strong>Example:</"
1436
- "strong>"
1437
  msgstr ""
1438
- "Benutze <code>@import url( [path] );</code>, um zusätzliche Formatvorlagen "
1439
- "zu verknüpfen. CTC benutzt das <code>@import</code> Schlüsselwort, um sie zu "
1440
- "identifizieren und sie in <code>&lt;link&gt;</code> Tags zu konvertieren. "
1441
- "<strong>Beispiel:</strong>"
1442
-
1443
- #: includes/forms/zipform.php:8
1444
- msgid "Export Zip"
1445
- msgstr "ZIP-Export"
1446
 
1447
  #. Plugin URI of the plugin/theme
1448
  msgid "http://www.childthemeconfigurator.com"
@@ -1450,11 +1079,12 @@ msgstr "http://www.childthemeconfigurator.com"
1450
 
1451
  #. Description of the plugin/theme
1452
  msgid ""
1453
- "When using the Customizer is not enough - Create child themes and customize "
1454
- "styles, templates, functions and more."
1455
  msgstr ""
1456
- "Wenn der Customizer nicht genug sein sollte - Erzeugen Sie Kindthemen und "
1457
- "passen Sie Stile, Vorlagen, Funktionen und mehr an."
 
1458
 
1459
  #. Author of the plugin/theme
1460
  msgid "Lilaea Media"
@@ -1463,47 +1093,3 @@ msgstr "Lilaea Media"
1463
  #. Author URI of the plugin/theme
1464
  msgid "http://www.lilaeamedia.com"
1465
  msgstr "http://www.lilaeamedia.com"
1466
-
1467
- #~ msgid "Could not copy file"
1468
- #~ msgstr "Konnte Datei nicht kopieren"
1469
-
1470
- #~ msgid ""
1471
- #~ "<p>\"Do not add any parent stylesheet handling\" has been selected for "
1472
- #~ "\"Parent stylesheet handling\" (see step 6, below).</p>"
1473
- #~ msgstr ""
1474
- #~ "<p>\"Elternthema-Behandlung nicht hinzufügen\" wurde ausgewählt für "
1475
- #~ "\"Elternthema-Behandlung\" (siehe Schritt 6 unten).</p>"
1476
-
1477
- #~ msgid ""
1478
- #~ "Child Theme Configurator did not detect any configuration data because a "
1479
- #~ "previously configured Child Theme has been removed. Please set your "
1480
- #~ "preferences below and click \"Generate Child Theme Files\"."
1481
- #~ msgstr ""
1482
- #~ "Der Kindthema-Konfigurator enteckte keine Konfigurationsdaten, weil ein "
1483
- #~ "früher konfiguriertes Kindthema entfernt wurde. Bitte setzen Sie Ihre "
1484
- #~ "Voreinstellungen unten und klicken Sie auf \"Erzeugen Kindthema-Dateien\"."
1485
-
1486
- #~ msgid "Export"
1487
- #~ msgstr "Exportieren"
1488
-
1489
- #~ msgid ""
1490
- #~ "Copy Parent Theme Menus, Widgets and other Customizer Settings to Child "
1491
- #~ "Theme:"
1492
- #~ msgstr ""
1493
- #~ "Kopieren der Elternthema-Menüs, Widgets und anderer Einstellungen in das "
1494
- #~ "Kindthema:"
1495
-
1496
- #~ msgid ""
1497
- #~ "This will overwrite any child theme options you may have already set."
1498
- #~ msgstr ""
1499
- #~ "Dies überschreibt alle Werte des Kindthemas, die allenfalls schon gesetzt "
1500
- #~ "sind."
1501
-
1502
- #~ msgid ""
1503
- #~ "Create child themes and customize styles, templates and functions. "
1504
- #~ "Enqueues stylesheets and web fonts. Handles rgba, vendor-prefixes and "
1505
- #~ "more."
1506
- #~ msgstr ""
1507
- #~ "Benutze Kindthemen und passe Stile, Vorlagen und Funktionen an. Behandelt "
1508
- #~ "Formatvorlagen und Webschriftarten sowie RGBA, Hersteller-Präfixe und "
1509
- #~ "mehr."
1
+ # Copyright (C) 2015 Child Theme Configurator
2
  # This file is distributed under the same license as the Child Theme Configurator package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Child Theme Configurator 1.7.8\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/child-theme-configurator\n"
7
+ "POT-Creation-Date: 2015-09-24 16:44+0200\n"
 
 
 
 
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2015-09-25 11:09+0200\n"
12
+ "Language-Team: \n"
13
+ "X-Generator: Poedit 1.8.5\n"
14
+ "Last-Translator: \n"
15
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
+ "Language: de_DE\n"
17
 
18
+ #. Plugin Name of the plugin/theme
19
+ #: child-theme-configurator.php:78 child-theme-configurator.php:88
20
+ #: includes/forms/main.php:23
21
+ msgid "Child Theme Configurator"
22
+ msgstr "Child Theme Configurator"
 
 
 
 
 
 
23
 
24
+ #: child-theme-configurator.php:79 child-theme-configurator.php:89
25
+ #: child-theme-configurator.php:99
26
+ msgid "Child Themes"
27
+ msgstr "Kind-Themen"
28
 
29
+ #: child-theme-configurator.php:114
30
+ msgid "Child Theme Configurator requires WordPress version %s or later."
31
+ msgstr "Child Theme Configurator benötigt WordPress Version %s oder neuer."
32
 
33
+ #: includes/class-ctc-ui.php:52
34
+ msgid "A stylesheet link tag is hard-coded into the header template."
35
+ msgstr "Ein Formatvorlage-Verknüpfungstag ist fix in das 'header template' codiert."
36
 
37
+ #: includes/class-ctc-ui.php:53
38
+ msgid "<code>wp_enqueue_style()</code> called from the header template."
39
+ msgstr "<code>wp_enqueue_style()</code> aufgerufen vom 'header template'."
40
 
41
+ #: includes/class-ctc-ui.php:55
42
  msgid ""
43
+ "Code exists between the <code>wp_head()</code> function and the closing <code>&lt;/"
44
+ "head&gt;</code> tag."
45
  msgstr ""
46
+ "Code existiert zwischen der <code>wp_head()</code> Funktion und dem schließenden "
47
+ "<code>&lt;/head&gt;</code> Tag."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
+ #: includes/class-ctc-ui.php:162
 
 
 
 
 
 
 
 
50
  msgid "Child Theme files modified successfully."
51
+ msgstr "Kind-Thema-Dateien erfolgreich geändert."
52
 
53
+ #: includes/class-ctc-ui.php:165
54
  msgid ""
55
+ "Child Theme <strong>%s</strong> has been generated successfully.\n"
56
+ " "
57
  msgstr ""
58
+ "Kind-Thema <strong>%s</strong> wurde erfolgreich erstellt.\n"
59
+ " "
 
 
 
 
60
 
61
+ #: includes/class-ctc-ui.php:168
62
  msgid "IMPORTANT:"
63
  msgstr "WICHTIG:"
64
 
65
+ #: includes/class-ctc-ui.php:170 includes/forms/themepreview.php:20
66
  msgid "Go to Themes"
67
  msgstr "Gehe zu Themen"
68
 
69
+ #: includes/class-ctc-ui.php:170
70
  msgid "Network enable"
71
+ msgstr "Netzwerk-aktivieren"
72
 
73
+ #: includes/class-ctc-ui.php:170
74
  msgid "your child theme."
75
+ msgstr "Ihr Kind-Thema."
76
 
77
+ #: includes/class-ctc-ui.php:172 includes/forms/themepreview.php:18
78
  msgid "Live Preview"
79
  msgstr "Live-Vorschau"
80
 
81
+ #: includes/class-ctc-ui.php:172
82
+ msgid "Test your child theme"
83
+ msgstr "Testen Sie Ihr Kind-Thema"
84
 
85
+ #: includes/class-ctc-ui.php:172
86
  msgid "before activating."
87
  msgstr "vor der Aktivierung."
88
 
89
+ #: includes/class-ctc.php:144
90
  msgid "URL/None"
91
+ msgstr "URL/Kein(e)"
92
 
93
+ #: includes/class-ctc.php:145
94
  msgid "Origin"
95
  msgstr "Quelle"
96
 
97
+ #: includes/class-ctc.php:146
98
  msgid "Color 1"
99
  msgstr "Farbe 1"
100
 
101
+ #: includes/class-ctc.php:147
102
  msgid "Color 2"
103
  msgstr "Farbe 2"
104
 
105
+ #: includes/class-ctc.php:148
106
  msgid "Width/None"
107
  msgstr "Breite/Keine"
108
 
109
+ #: includes/class-ctc.php:149
110
  msgid "Style"
111
  msgstr "Stil"
112
 
113
+ #: includes/class-ctc.php:150
114
  msgid "Color"
115
  msgstr "Farbe"
116
 
117
+ #: includes/class-ctc.php:152
118
+ msgid "Are you sure? This will replace your current settings."
119
+ msgstr "Sind Sie sicher? Dies überschreibt alle aktuellen Einstellungen."
 
 
 
 
120
 
121
+ #: includes/class-ctc.php:153
122
  msgid "<span style=\"font-size:10px\">!</span>"
123
  msgstr "<span style=\"font-size:10px\">!</span>"
124
 
125
+ #: includes/class-ctc.php:154 includes/forms/rule-value.php:32
126
  msgid "Selectors"
127
  msgstr "Selektoren"
128
 
129
+ #: includes/class-ctc.php:155
130
  msgid "Close"
131
  msgstr "Schließen"
132
 
133
+ #: includes/class-ctc.php:156
134
  msgid "Edit Selector"
135
+ msgstr "Selektor bearbeiten"
136
 
137
+ #: includes/class-ctc.php:157
138
  msgid "Cancel"
139
  msgstr "Abbrechen"
140
 
141
+ #: includes/class-ctc.php:158
142
  msgid "Rename"
143
+ msgstr "Umbenennen"
144
 
145
+ #: includes/class-ctc.php:159
146
  msgid "The stylesheet cannot be displayed."
147
  msgstr "Die Formatvorlage kann nicht angezeigt werden."
148
 
149
+ #: includes/class-ctc.php:160
150
  msgid "(Child Only)"
151
  msgstr "(Nur Kind)"
152
 
153
+ #: includes/class-ctc.php:161
154
  msgid "Please enter a valid Child Theme."
155
+ msgstr "Bitte ein gültiges Kind-Thema eingeben."
156
 
157
+ #: includes/class-ctc.php:162
158
  msgid "Please enter a valid Child Theme name."
159
+ msgstr "Bitte einen gültigen Namen eines Kind-Themes eingeben."
160
 
161
+ #: includes/class-ctc.php:163
162
  msgid "<strong>%s</strong> exists. Please enter a different Child Theme"
163
+ msgstr "<strong>%s</strong> existiert. Bitte anderes Kind-Thema eingeben"
164
 
165
+ #: includes/class-ctc.php:164
166
  msgid "The page could not be loaded correctly."
167
  msgstr "Die Seite konnte nicht korrekt geladen werden."
168
 
169
+ #: includes/class-ctc.php:166
170
+ msgid "Conflicting or out-of-date jQuery libraries were loaded by another plugin:"
 
171
  msgstr ""
172
+ "Nicht mehr aktuelle oder in Konflikt stehende jQuery-Bibliotheken von anderem Plugin "
173
+ "geladen:"
174
 
175
+ #: includes/class-ctc.php:168
176
  msgid "Deactivating or replacing plugins may resolve this issue."
177
+ msgstr "Das Deaktivieren oder Ersetzen des Plugins könnte dieses Problem lösen."
178
 
179
+ #: includes/class-ctc.php:169
180
  msgid "%sWhy am I seeing this?%s"
181
  msgstr "%sWieso sehe ich das?%s"
182
 
183
+ #: includes/class-ctc.php:392
184
+ msgid "Zip file creation failed."
185
+ msgstr "ZIP-Dateierstellung fehlgeschlagen."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
 
187
+ #: includes/class-ctc.php:428
188
+ msgid "The Functions file is required and cannot be deleted."
189
+ msgstr "Die Funktionen-Datei wird benötigt und kann nicht entfernt werden."
 
 
 
 
190
 
191
+ #: includes/class-ctc.php:510
192
+ msgid "You do not have permission to configure child themes."
193
+ msgstr "Sie haben nicht die Berechtigung zur Konfiguration von Kind-Themen."
194
 
195
+ #: includes/class-ctc.php:557
196
+ msgid "%s does not exist. Please select a valid Parent Theme."
197
+ msgstr "%s existiert nicht. Bitte wählen Sie ein gültiges Eltern-Theme."
198
 
199
+ #: includes/class-ctc.php:561
200
+ msgid "Please select a valid Parent Theme."
201
+ msgstr "Bitte wählen Sie ein gültiges Eltern-Theme."
202
 
203
+ #: includes/class-ctc.php:564
204
+ msgid "Please enter a valid Child Theme directory."
205
+ msgstr "Bitte geben Sie ein gültiges Kind-Thema-Verzeichnis ein."
 
 
 
 
 
 
 
 
206
 
207
+ #: includes/class-ctc.php:572 includes/class-ctc.php:587
208
+ msgid "Please enter a valid Child Theme template name."
209
+ msgstr "Bitte geben Sie eine gültige Kind-Thema-Vorlagennamen ein."
 
 
 
 
210
 
211
+ #: includes/class-ctc.php:577 includes/class-ctc.php:591
212
+ msgid "<strong>%s</strong> exists. Please enter a different Child Theme template name."
 
 
213
  msgstr ""
214
+ "<strong>%s</strong> existiert. Bitte einen anderen Kind-Thema-Vorlagennamen eingeben."
 
 
215
 
216
+ #: includes/class-ctc.php:604
217
+ msgid "Your theme directories are not writable."
218
+ msgstr "Ihr Theme-Verzeichnis ist schreibgeschützt."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
 
220
+ #: includes/class-ctc.php:682
221
+ msgid "Your stylesheet is not writable."
222
+ msgstr "Ihre Formatvorlage kann nicht überschrieben werden."
 
 
 
 
 
 
223
 
224
+ #: includes/class-ctc.php:959
225
  msgid ""
226
+ "A closing PHP tag was detected in Child theme functions file so \"Parent Stylesheet "
227
+ "Handling\" option was not configured. Closing PHP at the end of the file is discouraged "
228
+ "as it can cause premature HTTP headers. Please edit <code>functions.php</code> to "
229
+ "remove the final <code>?&gt;</code> tag and click \"Generate/Rebuild Child Theme Files"
230
+ "\" again."
231
  msgstr ""
232
+ "Ein schließendes PHP-Tag wurde in der Kind-Thema Funktions-Datei gefunden, die \"Eltern "
233
+ "Formatvorlage-Behandlung\"-Option wurde nicht konfiguriert. Schließendes PHP am Ende "
234
+ "der Datei ist nicht empfohlen, da es zu frühe HTTP-Header verursachen kann. Bitte "
235
+ "bearbeiten Sie <code>functions.php</code> um den abschließenden <code>?&gt;</code> Tag "
236
+ "zu entfernen und klicken Sie erneut auf \"Erzeugen/Neuaufbauen Kind-Thema-Dateien\"."
 
237
 
238
+ #: includes/class-ctc.php:1060
239
+ msgid "Could not delete file."
240
+ msgstr "Konnte Dateien nicht löschen."
 
 
 
 
 
 
241
 
242
+ #: includes/class-ctc.php:1139
243
+ msgid "Could not set write permissions."
244
+ msgstr "Konnte Schreibberechtigung nicht setzen."
245
 
246
+ #: includes/class-ctc.php:1240
247
+ msgid "There were errors while resetting permissions."
248
+ msgstr "Es traten beim Zurücksetzen der Berechtigungen Fehler auf."
 
 
 
 
249
 
250
+ #: includes/class-ctc.php:1282
251
+ msgid "Could not upload file."
252
+ msgstr "Konnte Datei nicht hochladen."
 
 
 
 
 
 
253
 
254
+ #: includes/class-ctc.php:1365
255
  msgid ""
256
+ "The child theme is in read-only mode and Child Theme Configurator cannot apply changes. "
257
+ "Click to see options"
258
  msgstr ""
259
+ "Das Kind-Thema ist im Nur-Lese-Modus und der Child Theme Configurator kann die "
260
+ "Änderungen nicht anwenden. Klicken Sie für Optionen"
261
 
262
+ #: includes/class-ctc.php:1368
263
  msgid ""
264
+ "<li>Temporarily set write permissions by clicking the button below. When you are "
265
+ "finished editing, revert to read-only by clicking \"Make read-only\" under the \"Files"
266
+ "\" tab.</li>"
267
  msgstr ""
268
+ "<li>Schreibberechtigung vorübergehend setzen mittels Klicken auf die untenstehende "
269
+ "Schaltfläche. Wenn Sie die Bearbeitung beendet haben, wieder auf \"Nur-Lesen-Modus\" "
270
+ "zurück mittels Klicken auf \"Nur-Lesen setzen\" auf dem \"Dateien\"-Reiter.</li>"
271
 
272
+ #: includes/class-ctc.php:1371
273
  msgid "Make files writable"
274
+ msgstr "Mache Dateien schreibbar"
275
 
276
+ #: includes/class-ctc.php:1372
277
  msgid ""
278
+ "<li><a target=\"_blank\" href=\"http://codex.wordpress.org/Editing_wp-config."
279
+ "php#WordPress_Upgrade_Constants\" title=\"Editin wp-config.php\">Add your FTP/SSH "
280
+ "credentials to the WordPress config file</a>.</li>"
281
  msgstr ""
282
+ "<li><a target=\"_blank\" href=\"http://codex.wordpress.org/Editing_wp-config."
283
+ "php#WordPress_Upgrade_Constants\" title=\"Editin wp-config.php\">Hinzufügen von FTP/SSH-"
284
+ "Berechtigungen zur Wordpress-Konfigurationsdatei</a>.</li>"
285
 
286
+ #: includes/class-ctc.php:1374
287
  msgid ""
288
+ "<li><a target=\"_blank\" href=\"http://technet.microsoft.com/en-us/library/cc771170\" "
289
+ "title=\"Setting Application Pool Identity\">Assign WordPress to an application pool "
290
+ "that has write permissions</a> (Windows IIS systems).</li>"
 
291
  msgstr ""
292
+ "<li><a target=\"_blank\" href=\"http://technet.microsoft.com/en-us/library/cc771170\" "
293
+ "title=\"Setting Application Pool Identity\">WordPress zu einem Applikations-Pool mit "
294
+ "Schreibberechtigung zuweisen</a> (Windows IIS-Systeme).</li>"
 
295
 
296
+ #: includes/class-ctc.php:1375
297
  msgid ""
298
+ "<li><a target=\"_blank\" href=\"http://codex.wordpress.org/Changing_File_Permissions\" "
299
+ "title=\"Changing File Permissions\">Set write permissions on the server manually</a> "
300
+ "(not recommended).</li>"
301
  msgstr ""
302
+ "<li><a target=\"_blank\" href=\"http://codex.wordpress.org/Changing_File_Permissions\" "
303
+ "title=\"Changing File Permissions\">Auf einem Server Schreibberechtigung manuell "
304
+ "setzen</a> (nicht empfohlen).</li>"
305
 
306
+ #: includes/class-ctc.php:1377
307
  msgid "<li>Run PHP under Apache with suEXEC (contact your web host).</li>"
308
+ msgstr "<li>PHP unter Apache mit suEXEC ausführen (bitte Webprovider kontaktieren).</li>"
 
 
309
 
310
+ #: includes/class-ctc.php:1388
311
  msgid ""
312
+ "This Child Theme is not owned by your website account. It may have been created by a "
313
+ "prior version of this plugin or by another program. Moving forward, it must be owned by "
314
+ "your website account to make changes. Child Theme Configurator will attempt to correct "
315
+ "this when you click the button below."
 
316
  msgstr ""
317
+ "Dieses Kind-Thema ist nicht im Besitz Ihres Webseiten-Kontos. Es könnte von einer "
318
+ "älteren Version dieses Plugins oder einem anderen Programm erstellt worden sein. Um "
319
+ "fortzufahren, muss es im Besitz Ihrer Webseite sein, um Änderungen vorzunehmen. Child "
320
+ "Theme Configurator versucht dies zu korrigieren, wenn Sie auf den Knopf unten klicken."
 
321
 
322
+ #: includes/class-ctc.php:1391
323
+ msgid "Correct Child Theme Permissions"
324
+ msgstr "Kind-Thema-Berechtigungen korrigieren"
 
 
 
 
 
 
325
 
326
+ #: includes/class-ctc.php:1398
327
  msgid ""
328
+ "Child Theme Configurator needs to update its interal data. Please set your preferences "
329
+ "below and click \"Generate Child Theme Files\" to update your configuration."
 
330
  msgstr ""
331
+ "Child Theme Configurator muss seine internen Daten aktualisieren. Bitte setzen Sie "
332
+ "unten Ihre Voreinstellungen und klicken Sie auf \"Erzeugen Kind-Thema-Dateien\", um "
333
+ "Ihre Konfiguration zu aktualisieren."
 
334
 
335
+ #: includes/class-ctc.php:1404
336
  msgid ""
337
+ "<strong>However, some styles could not be parsed due to memory limits.</strong> Try "
338
+ "deselecting \"Additional Stylesheets\" below and click \"Generate/Rebuild Child Theme "
339
+ "Files\". %sWhy am I seeing this?%s"
340
  msgstr ""
341
+ "<strong>Allerdings konnten einige Stile wegen Speicherlimiten nicht ausgelesen werden</"
342
+ "strong> Versuchen Sie es mit der Deaktivierung von \"Zusätzliche Formatvorlagen\" unten "
343
+ "und klicken Sie auf \"Erstellen/Neuaufbau Kind-Thema-Dateien\". %sWieso sehe ich das?%s"
344
 
345
+ #: includes/class-ctc.php:1413
346
  msgid ""
347
+ "Child Theme Configurator did not detect any configuration data because a previously "
348
+ "configured Child Theme has been removed. Please set your preferences below and click "
349
+ "\"Generate Child Theme Files\"."
350
  msgstr ""
351
+ "Child Theme Configurator entdeckte keine Konfigurationsdaten, weil ein vorher "
352
+ "konfiguriertes Kind-Thema entfernt wurde. Bitte setzen Sie Ihre Voreinstellungen unten "
353
+ "und klicken Sie auf \"Erstellen Kind-Thema-Dateien\"."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
354
 
355
  #: includes/forms/addl_css.php:7
356
  msgid "Parse additional stylesheets:"
357
+ msgstr "Zusätzliche Formatvorlagen auslesen:"
358
 
359
+ #: includes/forms/addl_css.php:11 includes/forms/parent-child.php:270
360
  msgid ""
361
+ "Stylesheets that are currently being loaded by the parent theme are automatically "
362
+ "selected below (except for Bootstrap stylesheets which add a large amount data to the "
363
+ "configuration). To further reduce overhead, select only the additional stylesheets you "
364
+ "wish to customize."
365
  msgstr ""
366
+ "Formatvorlagen, die zurzeit vom Eltern-Theme geladen werden, sind unten automatisch "
367
+ "ausgewählt (ausgenommen für Bootstrap-Formatvorlagen welche eine große Datenmenge zur "
368
+ "Konfiguration hinzufügen). Um weitere Überlastung zu vermindern, wählen Sie nur "
369
+ "Formatvorlagen, die Sie anpassen wollen."
370
 
371
  #: includes/forms/addl_panels.php:9 includes/forms/addl_panels.php:39
372
  msgid "Use coupon code"
373
+ msgstr "Coupon-Code benutzen"
374
 
375
  #: includes/forms/addl_panels.php:9 includes/forms/addl_panels.php:39
376
  msgid "wordpress-org"
378
 
379
  #: includes/forms/addl_panels.php:9 includes/forms/addl_panels.php:39
380
  msgid "and get <strong>20% off entire order</strong>."
381
+ msgstr "und erhalte <strong>20% Rabatt auf die ganze Bestellung</strong>."
382
 
383
  #: includes/forms/addl_panels.php:10 includes/forms/addl_panels.php:40
384
  msgid "Order Now"
386
 
387
  #: includes/forms/addl_panels.php:10 includes/forms/addl_panels.php:40
388
  msgid "*Prices and offers subject to change."
389
+ msgstr "*Preise und Angebote ohne Gewähr."
390
 
391
  #: includes/forms/addl_panels.php:11 includes/forms/addl_panels.php:12
392
  msgid "Learn more about IntelliWidget"
393
+ msgstr "Erfahren Sie mehr über IntelliWidget"
394
 
395
  #: includes/forms/addl_panels.php:12
396
  msgid ""
397
+ "IntelliWidget is a versatile widget manager that does the work of multiple plugins by "
398
+ "combining custom page menus, featured posts, sliders and other dynamic content features "
399
+ "into a single plugin that can display on a per-page or site-wide basis."
 
400
  msgstr ""
401
+ "IntelliWidget ist ein ausgefeilter Widget-Manager, der die Arbeit vieler Plugins "
402
+ "erledigt, indem es Seitenmenüs, Beliebte Beiträge (Featured Posts), Slider und anderen "
403
+ "dynamischen Inhalt in ein einzelnes Plugin kombiniert, welches die Anzeige auf Seiten- "
404
+ "oder Webseiten-Basis ermöglicht."
405
 
406
  #: includes/forms/addl_panels.php:13 includes/forms/addl_panels.php:16
407
  msgid "Learn more"
413
 
414
  #: includes/forms/addl_panels.php:15
415
  msgid ""
416
+ "IntelliWidget Responsive Menu lets you break free from your theme’s built-in responsive "
417
+ "menu options and gives you complete control over the user experience."
 
418
  msgstr ""
419
+ "IntelliWidget Responsive Menu ermöglicht Ihnen das Ausbrechen aus den starren, "
420
+ "eingebauten Theme-Menüoptionen und gibt Ihnen vollständige Kontrolle über die "
421
+ "Nutzererfahrung."
422
 
423
+ #: includes/forms/addl_panels.php:19 includes/help/help_en_US.php:215
424
  msgid "Learn more about CTC Pro"
425
  msgstr "Mehr über CTC Pro erfahren"
426
 
427
  #: includes/forms/addl_panels.php:20
428
  msgid "Customizing WordPress just got even easier."
429
+ msgstr "Es ist jetzt noch einfacher, WordPress anzupassen."
430
 
431
  #: includes/forms/addl_panels.php:21
432
  msgid ""
433
+ "Thousands of users have already seen the benefits of using Child Theme Configurator. If "
434
+ "you spend any amount of time customizing WordPress, CTC Pro will help maximize your "
435
+ "productivity."
436
  msgstr ""
437
+ "Tausende Benutzer haben schon die Vorteile des Child Theme Configurator erkannt. Wenn "
438
+ "Sie Zeit für die Anpassung von WordPress aufwenden, wird CTC Pro Ihre Produktivität "
439
+ "maximieren."
440
 
441
  #: includes/forms/addl_panels.php:22
442
  msgid "Designed by Developers Who Use It Every Day."
443
+ msgstr "Entworfen von Entwicklern, die es täglich verwenden."
444
 
445
  #: includes/forms/addl_panels.php:23
446
  msgid ""
447
+ "We've packed in more features to make design work quicker and easier with <strong>Child "
448
+ "Theme Configurator Pro.</strong>"
449
  msgstr ""
450
+ "Wir haben noch mehr Funktionen hineingepackt, um die Entwurfs-Arbeit noch schneller und "
451
+ "einfacher zu gestalten mit <strong>Child Theme Configurator Pro.<strong>"
452
 
453
  #: includes/forms/addl_panels.php:25
454
  msgid "Customize Plugin Stylesheets"
456
 
457
  #: includes/forms/addl_panels.php:26
458
  msgid ""
459
+ "Apply the power of CTC's top-rated interface to your site's plugin styles. All new "
460
+ "design makes it much easier to get the results you want."
461
  msgstr ""
462
+ "Wende die Macht der ausgezeichnet bewerteten Schnittstelle von CTC für deine Plugin-"
463
+ "Stile an. Alle neuen Designs machen es noch einfacher, die gewünschten Resultate zu "
464
+ "erhalten."
465
 
466
  #: includes/forms/addl_panels.php:27
467
  msgid "Quick Preview"
468
+ msgstr "Schnell-Vorschau"
469
 
470
  #: includes/forms/addl_panels.php:27
471
+ msgid "Test your child theme with a single click."
472
+ msgstr "Testen Sie Ihr Kind-Thema mit einem einzigen Klick."
473
 
474
  #: includes/forms/addl_panels.php:28
475
  msgid "Color Palettes"
477
 
478
  #: includes/forms/addl_panels.php:28
479
  msgid ""
480
+ "Keep the colors you select just a click away. No more searching for hex codes and RGB "
481
+ "values."
482
  msgstr ""
483
+ "Behalten Sie die Farben nur einen Klick entfernt weg. Kein umständliches Suchen für Hex-"
484
+ "Codes und RGB-Werte."
485
 
486
  #: includes/forms/addl_panels.php:29
487
  msgid "Find related styles"
488
+ msgstr "Finde ähnliche Stile"
489
 
490
  #: includes/forms/addl_panels.php:29
491
  msgid ""
492
+ "Use the \"All Styles\" panel to edit groups of selectors from a single combined list."
 
493
  msgstr ""
494
+ "Nutzen Sie das \"Alle Stile\"-Bedienungsfeld, um Gruppen von Selektoren aus einer "
495
  "einzigen kombinierten Liste zu bearbeiten."
496
 
497
  #: includes/forms/addl_panels.php:30
500
 
501
  #: includes/forms/addl_panels.php:30
502
  msgid "Tweak menus quickly and easily."
503
+ msgstr "Passe Menüs schnell und einfach an."
504
 
505
  #: includes/forms/addl_panels.php:31
506
  msgid "Most recent edits"
509
  #: includes/forms/addl_panels.php:31
510
  msgid "Return to recently edited selectors from a toggleable sidebar."
511
  msgstr ""
512
+ "Zurückkehren zu kürzlich bearbeiteten Selektoren mittels umschaltbarer Seitenleiste."
 
513
 
514
  #: includes/forms/addl_panels.php:32
515
  msgid "Genesis Framework Support"
517
 
518
  #: includes/forms/addl_panels.php:33
519
  msgid ""
520
+ "Automatically detects and configures Genesis Child Themes with more frameworks on the "
521
+ "way."
522
  msgstr ""
523
+ "Entdeckt und konfiguriert nebenbei automatisch Genesis Kind-Themen mit mehr Frameworks."
 
524
 
525
  #: includes/forms/addl_panels.php:34
526
  msgid "Top-rated Online Support"
532
 
533
  #: includes/forms/addl_panels.php:36
534
  msgid "Tutorial Videos"
535
+ msgstr "Tutorial-Videos"
536
 
537
  #: includes/forms/addl_tabs.php:8
538
  msgid "Upgrade"
539
+ msgstr "Aktualisieren"
540
 
541
  #: includes/forms/backup.php:8
542
  msgid "Backup"
543
+ msgstr "Sicherung"
544
 
545
+ #: includes/forms/backups.php:10 includes/forms/parent-child.php:253
546
  msgid "Restore backup from"
547
+ msgstr "Sicherung wiederherstellen von"
548
 
549
  #: includes/forms/fileform.php:8
550
+ msgid "The Theme editor has been disabled. Template files must be edited offline."
 
551
  msgstr ""
552
+ "Der Themen-Editor wurde deaktiviert. Vorlagendateien müssen offline bearbeitet werden."
 
553
 
554
  #: includes/forms/fileform.php:12
555
  msgid "Click here to edit template files using the Theme Editor"
556
+ msgstr "Hier klicken, um Vorlagendateien mit dem Themen-Editor zu bearbeiten"
 
557
 
558
  #: includes/forms/fileform.php:23
559
  msgid "Parent Templates"
561
 
562
  #: includes/forms/fileform.php:23
563
  msgid "Child Theme Files"
564
+ msgstr "Kind-Thema-Dateien"
565
 
566
  #: includes/forms/fileform.php:28
567
+ msgid "Copy PHP template files from the parent theme by selecting them here."
 
 
 
568
  msgstr ""
569
+ "Kopieren von PHP-Vorlagendateien des Eltern-Themes, indem Sie diese hier auswählen."
 
 
 
570
 
571
  #: includes/forms/fileform.php:31
572
  msgid ""
573
+ "CAUTION: If your child theme is active, the child theme version of the file will be "
574
+ "used instead of the parent immediately after it is copied."
575
  msgstr ""
576
+ "ACHTUNG: Wenn Ihr Kind-Thema aktiv ist, wird nach dem Kopiervorgang sofort die Kind-"
577
+ "Thema-Version der Datei anstatt der Eltern-Datei benutzt."
578
 
579
  #: includes/forms/fileform.php:33
580
  msgid "The %s file is generated separately and cannot be copied here."
581
+ msgstr "Die %s Datei wird getrennt erstellt und kann nicht hierher kopiert werden."
582
 
583
  #: includes/forms/fileform.php:43
584
  msgid "Delete child theme templates by selecting them here."
585
+ msgstr "Löschen von Kind-Thema-Vorlagen, indem Sie sie hier auswählen."
586
 
587
  #: includes/forms/fileform.php:44
588
  msgid ""
589
+ "Delete child theme templates or make them writable by selecting them here. Writable "
590
+ "files are displayed in <span style=\"color:red\">red</span>."
591
  msgstr ""
592
+ "Löschen Sie Kind-Thema-Vorlagen oder setzen Sie sie schreibbar, indem Sie sie hier "
593
+ "auswählen. Schreibbare Dateien sind in <span style=\"color:red\">red</span> angezeigt."
 
594
 
595
  #: includes/forms/fileform.php:57
596
  msgid "Make Selected Writable"
597
+ msgstr "Auswahl schreibbar setzen"
598
 
599
  #: includes/forms/fileform.php:61
600
  msgid "Copy Selected to Child Theme"
601
+ msgstr "Ausgewähltes Kind-Thema kopieren"
602
 
603
  #: includes/forms/fileform.php:61 includes/forms/images.php:21
604
  msgid "Delete Selected"
606
 
607
  #: includes/forms/files.php:15
608
  msgid "Upload New Child Theme Image"
609
+ msgstr "Neues Kind-Thema-Bild hochladen"
610
 
611
  #: includes/forms/files.php:18
612
  msgid ""
613
+ "Theme images reside under the <code>images</code> directory in your child theme and are "
614
+ "meant for stylesheet use only. Use the Media Library for content images."
 
615
  msgstr ""
616
+ "Diese Bilder befinden sich unter dem <code>Images</code>-Verzeichnis in Ihrem Kind-"
617
+ "Thema-Verzeichnis und sind nur für Formatvorlagen vorgesehen. Benutzen Sie die "
618
  "Medienbibliothek für Inhaltsbilder."
619
 
620
  #: includes/forms/files.php:25 includes/forms/files.php:51
623
 
624
  #: includes/forms/files.php:32
625
  msgid "Child Theme Screenshot"
626
+ msgstr "Kind-Thema Screenshot"
627
 
628
  #: includes/forms/files.php:41
629
  msgid "Upload New Screenshot"
630
+ msgstr "Neuen Screenshot hochladen"
631
 
632
  #: includes/forms/files.php:44
633
  msgid ""
634
+ "The theme screenshot should be a 4:3 ratio (e.g., 880px x 660px) JPG, PNG or GIF. It "
635
+ "will be renamed <code>screenshot</code>."
636
  msgstr ""
637
+ "Der Theme-Screenshot sollte ein 4:3-Verhältnis aufweisen (z.Bsp, 880px x 660px) JPG, "
638
+ "PNG oder GIF. Es wird in <code>screenshot</code> umbenannt."
639
 
640
+ #: includes/forms/files.php:59
641
  msgid "Export Child Theme as Zip Archive"
642
+ msgstr "Kind-Thema als ZIP-Archiv exportieren"
643
+
644
+ #: includes/forms/files.php:64
645
+ msgid "Export"
646
+ msgstr "Export"
647
 
648
+ #: includes/forms/files.php:73
649
  msgid "Secure Child Theme"
650
+ msgstr "Kind-Thema sichern"
651
 
652
+ #: includes/forms/files.php:76
653
+ msgid "Attempt to reset child theme permissions to user ownership and read-only access."
 
 
654
  msgstr ""
655
+ "Versuchen Sie, die Kind-Thema-Berechtigungen auf Besitz und Lese-Modus-Zugriff "
656
+ "zurückzusetzen."
657
 
658
+ #: includes/forms/files.php:82
659
  msgid "Make read-only"
660
+ msgstr "Nur-Lesen setzen"
661
 
662
  #: includes/forms/images.php:10
663
  msgid "Child Theme Images"
664
+ msgstr "Kind-Thema-Bilder"
665
 
666
  #: includes/forms/images.php:13
667
  msgid "Delete child theme images by selecting them here."
668
+ msgstr "Löschen Sie Kind-Thema-Bilder, indem Sie sie hier auswählen."
669
 
670
+ #: includes/forms/main.php:23
671
  msgid "version"
672
+ msgstr "version"
673
 
674
+ #: includes/forms/parent-child.php:17
675
+ msgid "Parent Theme"
676
+ msgstr "Eltern-Theme"
677
 
678
+ #: includes/forms/parent-child.php:25
679
+ msgid "Child Theme"
680
+ msgstr "Kind-Thema"
681
 
682
+ #: includes/forms/parent-child.php:27
683
+ msgid "(click to edit additional fields)"
684
+ msgstr "(klicken, um mehr Felder zu bearbeiten)"
685
 
686
+ #: includes/forms/parent-child.php:34
687
+ msgid "Create New Child Theme"
688
+ msgstr "Neues Kind-Thema erstellen"
 
 
 
 
 
 
 
689
 
690
  #: includes/forms/parent-child.php:43
691
+ msgid "Use Existing Child Theme"
692
+ msgstr "Bestehendes Kind-Thema benutzen"
693
 
694
+ #: includes/forms/parent-child.php:48
695
+ msgid "New Child Theme Slug"
696
+ msgstr "Neuer Kind-Thema-Slug"
 
 
 
 
697
 
698
+ #: includes/forms/parent-child.php:59
699
+ msgid "Child Theme Name"
700
+ msgstr "Kind-Thema-Name"
 
 
 
 
 
 
 
 
 
 
 
701
 
702
+ #: includes/forms/parent-child.php:63
703
+ msgid "Theme Name"
704
+ msgstr "Themen-Name"
 
 
 
 
705
 
706
+ #: includes/forms/parent-child.php:66 includes/forms/parent-child.php:70
707
+ msgid "Theme Website"
708
+ msgstr "Themen-Webseite"
 
 
 
 
 
 
 
709
 
710
+ #: includes/forms/parent-child.php:73 includes/forms/parent-child.php:77
711
+ msgid "Author"
712
+ msgstr "Autor"
713
 
714
+ #: includes/forms/parent-child.php:81 includes/forms/parent-child.php:85
715
+ msgid "Author Website"
716
+ msgstr "Autor-Webseite"
717
 
718
+ #: includes/forms/parent-child.php:88
719
+ msgid "Theme Description"
720
+ msgstr "Themen-Beschreibung"
721
 
722
+ #: includes/forms/parent-child.php:91
723
+ msgid "Description"
724
+ msgstr "Beschreibung"
 
 
 
 
725
 
726
+ #: includes/forms/parent-child.php:94
727
+ msgid "Theme Tags"
728
+ msgstr "Themen-Schlagwörter"
729
 
730
+ #: includes/forms/parent-child.php:97
731
+ msgid "Tags"
732
+ msgstr "Schlagwörter"
733
 
734
+ #: includes/forms/parent-child.php:100 includes/forms/parent-child.php:104
735
+ msgid "Version"
736
+ msgstr "Version"
737
 
738
  #: includes/forms/parent-child.php:109
739
+ msgid "Duplicate Existing Child Theme"
740
+ msgstr "Bestehendes Kind-Thema duplizieren"
741
 
742
+ #: includes/forms/parent-child.php:115
743
+ msgid "Duplicate Theme Slug"
744
+ msgstr "Themen-Slug duplizieren"
745
+
746
+ #: includes/forms/parent-child.php:118 includes/forms/parent-child.php:212
747
+ #: includes/forms/parent-child.php:227
748
  msgid "NOTE:"
749
  msgstr "HINWEIS:"
750
 
751
+ #: includes/forms/parent-child.php:120
752
+ msgid "This will copy all child theme files and apply changes to new version."
 
 
753
  msgstr ""
754
+ "Dies kopiert alle Dateien des Kind-Themas und wendet bei der neuen Version die "
755
+ "Änderungen an."
756
 
757
+ #: includes/forms/parent-child.php:126
758
+ msgid "Debug"
759
+ msgstr "Fehlerverfolgung"
 
 
 
 
 
 
 
 
760
 
761
+ #: includes/forms/parent-child.php:134
762
+ msgid "Check the box to enable debugging output."
763
+ msgstr "Kästchen auswählen, um Fehlerverfolgung-Ausgabe zu aktivieren."
764
 
765
+ #: includes/forms/parent-child.php:141
766
+ msgid "Stylesheet handling"
767
+ msgstr "Formatvorlage-Behandlung"
768
 
769
+ #: includes/forms/parent-child.php:142
770
+ msgid "(click to view options)"
771
+ msgstr "(klicken für Optionen)"
772
 
773
+ #: includes/forms/parent-child.php:144
774
+ msgid "This theme may not apply child theme styles correctly with the current settings:"
 
 
 
775
  msgstr ""
776
+ "Dieses Thema wird die Kind-Thema-Stile eventuell nicht richtig anwenden (mit den "
777
+ "aktuellen Einstellungen):"
 
778
 
779
+ #: includes/forms/parent-child.php:146
780
+ msgid "Don't show again."
781
+ msgstr "Nicht mehr anzeigen."
782
 
783
+ #: includes/forms/parent-child.php:146
784
+ msgid "View options"
785
+ msgstr "Optionen anzeigen"
 
 
 
 
 
 
 
 
 
786
 
787
+ #: includes/forms/parent-child.php:149
788
+ msgid "Which option should I use?"
789
+ msgstr "Welche Option soll ich benutzen?"
790
 
791
+ #: includes/forms/parent-child.php:154
792
+ msgid "None (handled by theme)"
793
+ msgstr "Keine (vom Thema abgewickelt)"
794
 
795
+ #: includes/forms/parent-child.php:158
796
  msgid ""
797
+ "Select this option if all stylesheets are correctly enqueued for child themes. If you "
798
+ "find that styles are not being applied correctly, use a different option."
799
  msgstr ""
800
+ "Diese Option auswählen, wenn alle Formatvorlagen richtig eingebunden (enqueued) werden. "
801
+ "Sollten die Stile nicht richtig angewendet werden, benutzen Sie eine andere Option."
802
 
803
+ #: includes/forms/parent-child.php:165
804
+ msgid "Enqueue parent stylesheet (default)"
805
+ msgstr "Eltern-Formatvorlage einbinden (Standard)"
806
 
807
+ #: includes/forms/parent-child.php:168
808
  msgid ""
809
+ "Select this option if the theme enqueues the active stylesheet but has no special "
810
+ "handling for child themes. Start with this option if unsure."
811
  msgstr ""
812
+ "Diese Option auswählen, wenn das Thema die aktive Formatvorlage einbindet (enqueued), "
813
+ "aber keine Sonderbehandlung für Kind-Themen hat. Bei Unsicherheit mit dieser Option "
814
+ "beginnen."
815
 
816
+ #: includes/forms/parent-child.php:175
817
+ msgid "Enqueue child stylesheet"
818
+ msgstr "Kind-Formatvorlage einbinden"
819
 
820
+ #: includes/forms/parent-child.php:178
821
  msgid ""
822
+ "Select this option if the theme enqueues the parent stylesheet but does not enqueue the "
823
+ "child stylesheet at all. This can happen if <code>get_template()</code> or "
824
+ "<code>get_template_directory_uri()</code> is used to link the stylesheet."
825
  msgstr ""
826
+ "Diese Option auswählen, wenn das Thema die Eltern-Formatvorlage einbindet (enqueued), "
827
+ "aber die Kind-Formatvorlage überhaupt nicht aufruft. Dies kann passieren, wenn "
828
+ "<code>get_template()</code> oder <code>get_template_directory_uri()</code> zum "
829
+ "Verknüpfen von Formatvorlagen benutzt wird."
830
 
831
+ #: includes/forms/parent-child.php:181
832
+ msgid "Recommended for this theme:"
833
+ msgstr "Empfohlen für dieses Thema:"
834
 
835
+ #: includes/forms/parent-child.php:187
836
+ msgid "Enqueue both parent and child stylesheets"
837
+ msgstr "Eltern- und Kind-Formatvorlagen einbinden (enqueue)"
838
 
839
+ #: includes/forms/parent-child.php:190
840
  msgid ""
841
+ "Select this option if stylesheet link tags are hard-coded into the header template "
842
+ "(common in older themes). This enables the child stylesheet to override the parent "
843
+ "stylesheet without using <code>@import</code>."
844
  msgstr ""
845
+ "Diese Option auswählen, wenn Formatvorlagen-Linktags im Header-Template fix codiert "
846
+ "sind (normalerweise in älteren Themen). Dies aktiviert die Übersteuerung der Eltern-"
847
+ "Formatvorlage durch die Kind-Formatvorlage ohne das Benutzen von <code>@import</code>."
848
 
849
+ #: includes/forms/parent-child.php:197
850
+ msgid "<code>@import</code> parent stylesheet"
851
+ msgstr "<code>@import</code> parent stylesheet"
852
 
853
+ #: includes/forms/parent-child.php:200
854
  msgid ""
855
+ "This option imports the parent stylesheet from the child stylesheet. This enables the "
856
+ "child stylesheet to override the parent stylesheet, but using <code>@import</code> is "
857
+ "no longer recommended."
858
  msgstr ""
859
+ "Diese Option importiert die Eltern-Formatvorlage aus der Kind-Formatvorlage. Das "
860
+ "erlaubt der Kind-Formatvorlage die Übersteuerung der Eltern-Formatvorlage, aber das "
861
+ "Benutzen von <code>@import</code> ist nicht mehr empfohlen."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
862
 
863
+ #: includes/forms/parent-child.php:205
864
+ msgid "Copy Parent Theme Menus, Widgets and other Customizer Options"
865
+ msgstr "Kopieren Eltern-Theme-Menüs, Widgets und andere Design-Optionen"
866
 
867
+ #: includes/forms/parent-child.php:214
868
+ msgid "This will overwrite child theme options you may have already set."
869
+ msgstr ""
870
+ "Dies wird die Kind-Thema-Optionen überschreiben, die Sie vielleicht schon gesetzt haben."
871
 
872
+ #: includes/forms/parent-child.php:220
873
+ msgid "Backup current stylesheet"
874
+ msgstr "Aktuelle Formatvorlage sichern"
875
 
876
+ #: includes/forms/parent-child.php:229
877
+ msgid ""
878
+ "This creates a copy of the current stylesheet before applying changes. You can remove "
879
+ "old backup files using the Files tab."
880
+ msgstr ""
881
+ "Dies erstellt eine Kopie der aktuellen Formatvorlage, bevor die Änderungen angewendet "
882
+ "werden. Sie können alte Sicherungsdateien mittels des Dateien-Reiters löschen."
883
 
884
+ #: includes/forms/parent-child.php:234
885
+ msgid "Reset/Restore from backup"
886
+ msgstr "Zurücksetzen/Wiederherstellen aus Backup"
887
 
888
+ #: includes/forms/parent-child.php:240
889
+ msgid "Leave unchanged"
890
+ msgstr "Unverändert lassen"
891
 
892
+ #: includes/forms/parent-child.php:246
893
+ msgid "Reset all"
894
+ msgstr "Alles zurücksetzen"
895
 
896
+ #: includes/forms/parent-child.php:266
897
+ msgid "Parse additional stylesheets"
898
+ msgstr "Zusätzliche Formatvorlagen auslesen"
899
 
900
+ #: includes/forms/parent-child.php:290
901
+ msgid "Please read before you click:"
902
+ msgstr "Bitte vor dem Klicken durchlesen."
 
 
 
 
903
 
904
+ #: includes/forms/parent-child.php:291
905
  msgid ""
906
+ "This plugin makes significant modifications to your child theme, to include changing "
907
+ "CSS, removing comments and adding php functions."
 
908
  msgstr ""
909
+ "Dieses Plugin führt signifikante Änderungen an Ihrem Kind-Thema durch, z.Bsp. CSS-"
910
+ "Änderungen, Entfernen von Kommentaren und dem Hinzufügen von PHP-Funktionen."
 
 
 
 
 
911
 
912
+ #: includes/forms/parent-child.php:292
913
+ msgid "If you are using an existing Child Theme,"
914
+ msgstr "Wenn Sie ein bestehendes Kind-Thema benutzen,"
915
 
916
+ #: includes/forms/parent-child.php:292
917
+ msgid "please consider using the Duplicate Child Theme option"
918
+ msgstr "bitte ziehen Sie die 'Kind-Thema Duplizieren'-Option in Betracht"
919
 
920
+ #: includes/forms/parent-child.php:292
921
+ msgid "before proceeding."
922
+ msgstr "vor dem Fortfahren."
923
 
924
+ #: includes/forms/parent-child.php:298
925
+ msgid "Generate/Rebuild Child Theme Files"
926
+ msgstr "Erstellen/Neuaufbau Kind-Thema-Dateien"
927
 
928
  #: includes/forms/query-selector.php:13
929
+ msgid "Query"
930
+ msgstr "Abfrage"
 
 
 
 
931
 
932
  #: includes/forms/query-selector.php:24
933
  msgid "Selector"
939
 
940
  #: includes/forms/query-selector.php:45
941
  msgid "Save Child Values"
942
+ msgstr "Sichern Kind-Werte"
943
 
944
  #: includes/forms/query-selector.php:46
945
  msgid "Delete Child Values"
946
+ msgstr "Löschen Kind-Werte"
947
 
948
  #: includes/forms/query-selector.php:53 includes/forms/rule-value.php:13
949
  msgid "Property"
950
  msgstr "Eigenschaft"
951
 
952
  #: includes/forms/query-selector.php:56
953
+ msgid "Parent Value"
954
+ msgstr "Eltern-Wert"
955
 
956
  #: includes/forms/query-selector.php:59
957
  msgid "Child Value"
958
+ msgstr "Kind-Wert"
959
 
960
  #: includes/forms/query-selector.php:65
961
  msgid "New Property"
967
 
968
  #: includes/forms/query-selector.php:84
969
  msgid "Copy Selector"
970
+ msgstr "Kopieren Selektor"
971
 
972
  #: includes/forms/query-selector.php:86 includes/forms/webfonts.php:15
973
  msgid "Save"
980
  #: includes/forms/query-selector.php:91
981
  msgid "Use to enter shorthand CSS or new @media queries and selectors."
982
  msgstr ""
983
+ "Benutzen, um 'Shorthand-CSS' einzugeben, oder neue @media-Abfragen bzw. Selektoren."
 
984
 
985
  #: includes/forms/query-selector.php:91
986
  msgid ""
987
+ "Values entered here are merged into existing child styles or added to the child "
988
+ "stylesheet if they do not exist in the parent."
989
  msgstr ""
990
+ "Hier eingegebene Werte werden mit bestehenden Kind-Stilen zusammengeführt oder der Kind-"
991
+ "Formatvorlage hinzugefügt, wenn sie in der Elternvorlage nicht vorkommen."
992
 
993
  #: includes/forms/related.php:1
994
  msgid "New user?"
996
 
997
  #: includes/forms/related.php:1
998
  msgid "Click help"
999
+ msgstr "Auf Hilfe klicken"
1000
 
1001
  #: includes/forms/related.php:1
1002
  msgid "Get CTC Pro and other tools"
1004
 
1005
  #: includes/forms/related.php:1
1006
  msgid "Lilaea Media - Responsive Tools for a Mobile World"
1007
+ msgstr "Lilaea Media - Responsive Tools für eine Mobile Welt"
1008
 
1009
  #: includes/forms/rule-value.php:26
1010
  msgid "Value"
1014
  msgid "Parent/Child"
1015
  msgstr "Eltern/Kind"
1016
 
1017
+ #: includes/forms/tabs.php:16
1018
  msgid "Query/Selector"
1019
  msgstr "Abfrage/Selektor"
1020
 
1021
+ #: includes/forms/tabs.php:19
1022
  msgid "Property/Value"
1023
  msgstr "Eigenschaft/Wert"
1024
 
1025
+ #: includes/forms/tabs.php:22
1026
  msgid "Web Fonts"
1027
  msgstr "Webschriftarten"
1028
 
1029
+ #: includes/forms/tabs.php:25
1030
+ msgid "Child CSS"
1031
+ msgstr "Kind-CSS"
1032
 
1033
+ #: includes/forms/tabs.php:28
1034
+ msgid "Parent CSS"
1035
+ msgstr "Eltern-CSS"
1036
 
1037
+ #: includes/forms/tabs.php:34
1038
  msgid "Files"
1039
  msgstr "Dateien"
1040
 
1052
 
1053
  #: includes/forms/themepreview.php:17
1054
  msgid " in default Site"
1055
+ msgstr " auf Standard-Webseite"
1056
 
1057
  #: includes/forms/themepreview.php:21
1058
  msgid "Not Network Enabled"
1064
 
1065
  #: includes/forms/webfonts.php:20
1066
  msgid ""
1067
+ "Use <code>@import url( [path] );</code> to link additional stylesheets. Child Theme "
1068
+ "Configurator uses the <code>@import</code> keyword to identify them and convert them to "
1069
+ "<code>&lt;link&gt;</code> tags. <strong>Example:</strong>"
 
1070
  msgstr ""
1071
+ "Benutzen Sie <code>@import url( [path] );</code>, um mehr Formatvorlagen zu verknüpfen. "
1072
+ "Child Theme Configurator benutzt das <code>@import</code> Schlüsselwort um sie zu "
1073
+ "identifizieren und zu konvertieren in <code>&lt;link&gt;</code> Tags. <strong>Beispiel:"
1074
+ "</strong>"
 
 
 
 
1075
 
1076
  #. Plugin URI of the plugin/theme
1077
  msgid "http://www.childthemeconfigurator.com"
1079
 
1080
  #. Description of the plugin/theme
1081
  msgid ""
1082
+ "Create child themes and customize styles, templates and functions. Enqueues stylesheets "
1083
+ "and web fonts. Handles rgba, vendor-prefixes and more."
1084
  msgstr ""
1085
+ "Erstellen Sie Kind-Themen und passen Sie Stile, Vorlagen und Funktionen an. Bindet "
1086
+ "Formatvorlagen und Webschriftarten ein (Enqueue). Behandelt RGBA, Hersteller-Präfixe "
1087
+ "und mehr."
1088
 
1089
  #. Author of the plugin/theme
1090
  msgid "Lilaea Media"
1093
  #. Author URI of the plugin/theme
1094
  msgid "http://www.lilaeamedia.com"
1095
  msgstr "http://www.lilaeamedia.com"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lang/child-theme-configurator.pot CHANGED
@@ -1,448 +1,327 @@
1
- # Copyright (C) 2016 Child Theme Configurator
2
  # This file is distributed under the same license as the Child Theme Configurator package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Child Theme Configurator 2.1.0\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/child-theme-configurator\n"
7
- "POT-Creation-Date: 2016-08-14 01:03:04+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
- #: includes/class-ctc-admin.php:387
16
- msgid "Zip file creation failed."
17
- msgstr ""
18
-
19
- #: includes/class-ctc-admin.php:413
20
- msgid "The Functions file is required and cannot be deleted."
21
- msgstr ""
22
-
23
- #: includes/class-ctc-admin.php:493
24
- msgid "You do not have permission to configure child themes."
25
  msgstr ""
26
 
27
- #: includes/class-ctc-admin.php:526
28
- msgid "%s does not exist. Please select a valid Parent Theme."
 
29
  msgstr ""
30
 
31
- #: includes/class-ctc-admin.php:529
32
- msgid "Please select a valid Parent Theme."
33
  msgstr ""
34
 
35
- #: includes/class-ctc-admin.php:534
36
- msgid "Please select a valid Child Theme."
37
  msgstr ""
38
 
39
- #: includes/class-ctc-admin.php:538
40
- msgid "Please enter a valid Child Theme directory name."
41
  msgstr ""
42
 
43
- #: includes/class-ctc-admin.php:543
44
  msgid ""
45
- "<strong>%s</strong> exists. Please enter a different Child Theme template "
46
- "name."
47
- msgstr ""
48
-
49
- #: includes/class-ctc-admin.php:562
50
- msgid "Your theme directories are not writable."
51
- msgstr ""
52
-
53
- #: includes/class-ctc-admin.php:635
54
- msgid "Could not upgrade child theme"
55
  msgstr ""
56
 
57
- #: includes/class-ctc-admin.php:717
58
- msgid "Your stylesheet is not writable."
59
- msgstr ""
60
-
61
- #: includes/class-ctc-admin.php:1301
62
- msgid "Could not set write permissions."
63
  msgstr ""
64
 
65
- #: includes/class-ctc-admin.php:1402
66
- msgid "There were errors while resetting permissions."
 
 
67
  msgstr ""
68
 
69
- #: includes/class-ctc-admin.php:1476
70
- msgid "Could not upload file."
71
  msgstr ""
72
 
73
- #: includes/class-ctc-admin.php:1502
74
- msgid "Invalid theme root directory."
75
  msgstr ""
76
 
77
- #: includes/class-ctc-admin.php:1514
78
- msgid "No writable temp directory."
79
  msgstr ""
80
 
81
- #: includes/class-ctc-admin.php:1544
82
- msgid "PclZip returned zero bytes."
83
  msgstr ""
84
 
85
- #: includes/class-ctc-ui.php:35
86
- msgid "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
87
  msgstr ""
88
 
89
- #: includes/class-ctc-ui.php:98
90
- msgid ""
91
- "The Theme editor has been disabled. Template files must be edited offline."
92
  msgstr ""
93
 
94
- #: includes/class-ctc-ui.php:102
95
- msgid "Click here to edit template files using the Theme Editor"
96
  msgstr ""
97
 
98
- #: includes/class-ctc-ui.php:269
99
  msgid "URL/None"
100
  msgstr ""
101
 
102
- #: includes/class-ctc-ui.php:270
103
  msgid "Origin"
104
  msgstr ""
105
 
106
- #: includes/class-ctc-ui.php:271
107
  msgid "Color 1"
108
  msgstr ""
109
 
110
- #: includes/class-ctc-ui.php:272
111
  msgid "Color 2"
112
  msgstr ""
113
 
114
- #: includes/class-ctc-ui.php:273
115
  msgid "Width/None"
116
  msgstr ""
117
 
118
- #: includes/class-ctc-ui.php:274
119
  msgid "Style"
120
  msgstr ""
121
 
122
- #: includes/class-ctc-ui.php:275
123
  msgid "Color"
124
  msgstr ""
125
 
126
- #: includes/class-ctc-ui.php:277
127
- msgid ""
128
- "Are you sure you wish to RESET? This will destroy any work you have done in "
129
- "the Configurator."
130
  msgstr ""
131
 
132
- #: includes/class-ctc-ui.php:278
133
  msgid "<span style=\"font-size:10px\">!</span>"
134
  msgstr ""
135
 
136
- #: includes/class-ctc-ui.php:279 includes/forms/rule-value.php:33
137
  msgid "Selectors"
138
  msgstr ""
139
 
140
- #: includes/class-ctc-ui.php:280
141
  msgid "Close"
142
  msgstr ""
143
 
144
- #: includes/class-ctc-ui.php:281
145
  msgid "Edit Selector"
146
  msgstr ""
147
 
148
- #: includes/class-ctc-ui.php:282
149
  msgid "Cancel"
150
  msgstr ""
151
 
152
- #: includes/class-ctc-ui.php:283
153
  msgid "Rename"
154
  msgstr ""
155
 
156
- #: includes/class-ctc-ui.php:284
157
  msgid "The stylesheet cannot be displayed."
158
  msgstr ""
159
 
160
- #: includes/class-ctc-ui.php:285
161
  msgid "(Child Only)"
162
  msgstr ""
163
 
164
- #: includes/class-ctc-ui.php:286
165
  msgid "Please enter a valid Child Theme."
166
  msgstr ""
167
 
168
- #: includes/class-ctc-ui.php:287
169
  msgid "Please enter a valid Child Theme name."
170
  msgstr ""
171
 
172
- #: includes/class-ctc-ui.php:288
173
  msgid "<strong>%s</strong> exists. Please enter a different Child Theme"
174
  msgstr ""
175
 
176
- #: includes/class-ctc-ui.php:289
177
  msgid "The page could not be loaded correctly."
178
  msgstr ""
179
 
180
- #: includes/class-ctc-ui.php:290
181
  msgid ""
182
  "Conflicting or out-of-date jQuery libraries were loaded by another plugin:"
183
  msgstr ""
184
 
185
- #: includes/class-ctc-ui.php:291
186
  msgid "Deactivating or replacing plugins may resolve this issue."
187
  msgstr ""
188
 
189
- #: includes/class-ctc-ui.php:292
190
  msgid "%sWhy am I seeing this?%s"
191
  msgstr ""
192
 
193
- #: includes/class-ctc-ui.php:295
194
- msgid "No Styles Available. Check Parent/Child settings."
195
- msgstr ""
196
-
197
- #: includes/class-ctc-ui.php:296
198
- msgid "Updating"
199
- msgstr ""
200
-
201
- #: includes/class-ctc-ui.php:297
202
- msgid "Checking"
203
- msgstr ""
204
-
205
- #: includes/class-ctc-ui.php:298
206
- msgid "The theme \"%s\" generated unexpected PHP debug output."
207
- msgstr ""
208
-
209
- #: includes/class-ctc-ui.php:299
210
- msgid ""
211
- "The theme \"%s\" could not be analyzed because the preview did not render "
212
- "correctly."
213
- msgstr ""
214
-
215
- #: includes/class-ctc-ui.php:300
216
- msgid ""
217
- "<p>First, <a href=\"%s\">refresh this page</a> and try analyzing again.</"
218
- "p><p>If that does not work, try temporarily disabling plugins that "
219
- "<strong>minify CSS</strong> or that <strong>force redirects between HTTP and "
220
- "HTTPS</strong>.</p>"
221
  msgstr ""
222
 
223
- #: includes/class-ctc-ui.php:301
224
- msgid "Click to show/hide PHP debug output"
225
  msgstr ""
226
 
227
- #: includes/class-ctc-ui.php:302
228
- msgid ""
229
- "<p>Please contact this Theme's author and report the items inside the box "
230
- "above. You may or may not be able to use this Theme as a Child Theme while "
231
- "these conditions exist.</p><p>It is possible that this theme has specific "
232
- "requirements to work correctly as a child theme. Please make sure you are "
233
- "using the latest version of this theme and check your theme's documentation "
234
- "for more information.</p>"
235
  msgstr ""
236
 
237
- #: includes/class-ctc-ui.php:303
238
- msgid "Do Not Activate \"%s\"! A PHP FATAL ERROR has been detected."
239
  msgstr ""
240
 
241
- #: includes/class-ctc-ui.php:304
242
- msgid "This theme loads stylesheets after the wp_styles queue."
243
  msgstr ""
244
 
245
- #: includes/class-ctc-ui.php:305
246
- msgid ""
247
- "<p>This makes it difficult for plugins to override these styles. You can try "
248
- "to resolve this using the \"Repair header template\" option (Step 6, "
249
- "\"Additional handling options\", below).</p>"
250
  msgstr ""
251
 
252
- #: includes/class-ctc-ui.php:306
253
- msgid ""
254
- "This theme loads the parent theme's <code>style.css</code> file outside the "
255
- "wp_styles queue."
256
  msgstr ""
257
 
258
- #: includes/class-ctc-ui.php:307
259
  msgid ""
260
- "<p>This is common with older themes but requires the use of <code>@import</"
261
- "code>, which is no longer recommended. You can try to resolve this using the "
262
- "\"Repair header template\" option (see step 6, \"Additional handling options"
263
- "\", below).</p>"
264
- msgstr ""
265
-
266
- #: includes/class-ctc-ui.php:308
267
- msgid "This child theme does not load a Configurator stylesheet."
268
  msgstr ""
269
 
270
- #: includes/class-ctc-ui.php:309
271
- msgid ""
272
- "<p>If you want to customize styles using this plugin, please click "
273
- "\"Configure Child Theme\" again to add this to the settings.</p>"
274
  msgstr ""
275
 
276
- #: includes/class-ctc-ui.php:310
277
- msgid ""
278
- "This child theme uses the parent stylesheet but does not load the parent "
279
- "theme's <code>style.css</code> file."
280
  msgstr ""
281
 
282
- #: includes/class-ctc-ui.php:311
283
  msgid ""
284
- "<p>Please select a stylesheet handling method or check \"Ignore parent theme "
285
- "stylesheets\" (see step 6, below).</p>"
286
- msgstr ""
287
-
288
- #: includes/class-ctc-ui.php:312
289
- msgid "This child theme appears to be functioning correctly."
290
- msgstr ""
291
-
292
- #: includes/class-ctc-ui.php:313
293
- msgid "This theme appears OK to use as a Child theme."
294
  msgstr ""
295
 
296
- #: includes/class-ctc-ui.php:314
297
- msgid "This Child Theme has not been configured for this plugin."
298
  msgstr ""
299
 
300
- #: includes/class-ctc-ui.php:315
301
- msgid ""
302
- "<p>The Configurator makes significant modifications to the child theme, "
303
- "including stylesheet changes and additional php functions. Please consider "
304
- "using the DUPLICATE child theme option (see step 1, above) and keeping the "
305
- "original as a backup.</p>"
306
- msgstr ""
307
-
308
- #: includes/class-ctc-ui.php:316
309
- msgid ""
310
- "This child theme uses <code>@import</code> to load the parent theme's "
311
- "<code>style.css</code> file."
312
  msgstr ""
313
 
314
- #: includes/class-ctc-ui.php:317
315
- msgid ""
316
- "<p>Please consider selecting \"Use the WordPress style queue\" for the "
317
- "parent stylesheet handling option (see step 6, below).</p>"
318
  msgstr ""
319
 
320
- #: includes/class-ctc-ui.php:318
321
- msgid ""
322
- "This theme loads additional stylesheets after the <code>style.css</code> "
323
- "file:"
324
  msgstr ""
325
 
326
- #: includes/class-ctc-ui.php:319
327
  msgid ""
328
- "<p>Consider saving new custom styles to a \"Separate stylesheet\" (see step "
329
- "5, below) so that you can customize these styles.</p>"
330
  msgstr ""
331
 
332
- #: includes/class-ctc-ui.php:320
333
  msgid ""
334
- "The parent theme's <code>style.css</code> file is being loaded automatically."
 
 
335
  msgstr ""
336
 
337
- #: includes/class-ctc-ui.php:321
338
- msgid ""
339
- "<p>The Configurator selected \"Do not add any parent stylesheet handling\" "
340
- "for the \"Parent stylesheet handling\" option (see step 6, below).</p>"
341
  msgstr ""
342
 
343
- #: includes/class-ctc-ui.php:322
344
  msgid ""
345
- "This theme does not require the parent theme's <code>style.css</code> file "
346
- "for its appearance."
347
- msgstr ""
348
-
349
- #: includes/class-ctc-ui.php:323
350
- msgid "This Child Theme was configured with an earlier version."
351
  msgstr ""
352
 
353
- #: includes/class-ctc-ui.php:324
354
  msgid ""
355
- "<p>The selected stylesheet handling method is no longer used. Please update "
356
- "the configuration using the \"Repair header template\" option (see step 6, "
357
- "\"Additional handling options\", below).</p>"
 
358
  msgstr ""
359
 
360
- #: includes/class-ctc-ui.php:325
361
  msgid ""
362
- "Click to show/hide analysis data. Please include contents below with any "
363
- "support requests."
 
364
  msgstr ""
365
 
366
- #: includes/class-ctc-ui.php:326
367
- msgid ""
368
- "This child theme was configured using the CTC Pro \"Genesis stylesheet "
369
- "handling\" method."
370
  msgstr ""
371
 
372
- #: includes/class-ctc-ui.php:327
373
  msgid ""
374
- "<p>This method has been replaced by the \"Separate stylesheet\" and \"Ignore "
375
- "Parent Theme\" options ( selected below ) for broader framework "
376
- "compatability.</p>"
 
 
377
  msgstr ""
378
 
379
- #: includes/class-ctc-ui.php:328
380
- msgid "<p>%1Click Here%2 to view the theme as viewed by the Analyzer.</p>"
381
- msgstr ""
382
-
383
- #. #-#-#-#-# child-theme-configurator.pot (Child Theme Configurator 2.1.0) #-#-#-#-#
384
- #. Plugin Name of the plugin/theme
385
- #: includes/class-ctc.php:65 includes/class-ctc.php:76
386
- #: includes/forms/main.php:35
387
- msgid "Child Theme Configurator"
388
- msgstr ""
389
-
390
- #: includes/class-ctc.php:66 includes/class-ctc.php:77
391
- #: includes/class-ctc.php:88
392
- msgid "Child Themes"
393
- msgstr ""
394
-
395
- #: includes/class-ctc.php:106
396
- msgid "Child Theme Configurator requires WordPress version %s or later."
397
- msgstr ""
398
-
399
- #: includes/class-ctc.php:122
400
- msgid "Click here to download and save the latest version to your computer."
401
- msgstr ""
402
-
403
- #: includes/class-ctc.php:127
404
- msgid "Click here to switch to the plugin install page."
405
  msgstr ""
406
 
407
- #: includes/class-ctc.php:130
408
  msgid ""
409
- "Child Theme Configurator Pro version %s is not compatible with this version "
410
- "of Child Theme Configurator and has been deactivated."
411
- msgstr ""
412
-
413
- #: includes/class-ctc.php:131
414
- msgid "Please follow these steps carefully to upgrade to the latest version."
415
- msgstr ""
416
-
417
- #: includes/class-ctc.php:132
418
- msgid "DO NOT DELETE THE EXISTING PRO PLUGIN or you will lose your settings."
419
  msgstr ""
420
 
421
- #: includes/class-ctc.php:135
422
  msgid ""
423
- "Click the \"Browse\" button in the center of the page (NOT the button at the "
424
- "top) and select the \"%s\" file from your computer."
425
- msgstr ""
426
-
427
- #: includes/class-ctc.php:136
428
- msgid "Click \"Install Now.\""
429
- msgstr ""
430
-
431
- #: includes/class-ctc.php:137
432
- msgid "Click \"Activate Plugin\""
433
  msgstr ""
434
 
435
- #: includes/class-ctc.php:138
436
  msgid ""
437
- "WordPress will automatically remove the original plugin when you activate "
438
- "the new version."
 
439
  msgstr ""
440
 
441
  #: includes/forms/addl_css.php:7
442
  msgid "Parse additional stylesheets:"
443
  msgstr ""
444
 
445
- #: includes/forms/addl_css.php:11
446
  msgid ""
447
  "Stylesheets that are currently being loaded by the parent theme are "
448
  "automatically selected below (except for Bootstrap stylesheets which add a "
@@ -497,7 +376,7 @@ msgid ""
497
  "experience."
498
  msgstr ""
499
 
500
- #: includes/forms/addl_panels.php:19
501
  msgid "Learn more about CTC Pro"
502
  msgstr ""
503
 
@@ -537,7 +416,7 @@ msgid "Quick Preview"
537
  msgstr ""
538
 
539
  #: includes/forms/addl_panels.php:27
540
- msgid "Preview your child theme with a single click."
541
  msgstr ""
542
 
543
  #: includes/forms/addl_panels.php:28
@@ -577,11 +456,13 @@ msgid "Return to recently edited selectors from a toggleable sidebar."
577
  msgstr ""
578
 
579
  #: includes/forms/addl_panels.php:32
580
- msgid "Add Child Theme Files"
581
  msgstr ""
582
 
583
  #: includes/forms/addl_panels.php:33
584
- msgid "Create new template and script files right from the admin."
 
 
585
  msgstr ""
586
 
587
  #: includes/forms/addl_panels.php:34
@@ -604,65 +485,63 @@ msgstr ""
604
  msgid "Backup"
605
  msgstr ""
606
 
607
- #: includes/forms/backups.php:10
608
  msgid "Restore backup from"
609
  msgstr ""
610
 
611
- #: includes/forms/current-theme.php:6
612
- msgid "Currently loaded"
613
- msgstr ""
614
-
615
- #: includes/forms/debug-toggle.php:8
616
- msgid "Debug"
617
- msgstr ""
618
-
619
- #: includes/forms/file-form-buttons.php:9
620
- msgid "Make Selected Writable"
621
- msgstr ""
622
-
623
- #: includes/forms/file-form-buttons.php:13
624
- msgid "Copy Selected to Child Theme"
625
  msgstr ""
626
 
627
- #: includes/forms/file-form-buttons.php:13 includes/forms/images.php:21
628
- msgid "Delete Selected"
629
  msgstr ""
630
 
631
- #: includes/forms/fileform.php:9
632
  msgid "Parent Templates"
633
  msgstr ""
634
 
635
- #: includes/forms/fileform.php:9
636
  msgid "Child Theme Files"
637
  msgstr ""
638
 
639
- #: includes/forms/fileform.php:14
640
- msgid ""
641
- "Copy PHP templates from the parent theme by selecting them here. The "
642
- "Configurator defines a template as a Theme PHP file having no PHP functions "
643
- "or classes. Other PHP files cannot be safely overridden by a child theme."
644
  msgstr ""
645
 
646
- #: includes/forms/fileform.php:17
647
  msgid ""
648
  "CAUTION: If your child theme is active, the child theme version of the file "
649
  "will be used instead of the parent immediately after it is copied."
650
  msgstr ""
651
 
652
- #: includes/forms/fileform.php:19
653
  msgid "The %s file is generated separately and cannot be copied here."
654
  msgstr ""
655
 
656
- #: includes/forms/fileform.php:29
657
  msgid "Delete child theme templates by selecting them here."
658
  msgstr ""
659
 
660
- #: includes/forms/fileform.php:30
661
  msgid ""
662
  "Delete child theme templates or make them writable by selecting them here. "
663
  "Writable files are displayed in <span style=\"color:red\">red</span>."
664
  msgstr ""
665
 
 
 
 
 
 
 
 
 
 
 
 
 
666
  #: includes/forms/files.php:15
667
  msgid "Upload New Child Theme Image"
668
  msgstr ""
@@ -692,27 +571,25 @@ msgid ""
692
  "GIF. It will be renamed <code>screenshot</code>."
693
  msgstr ""
694
 
695
- #: includes/forms/files.php:57
696
  msgid "Export Child Theme as Zip Archive"
697
  msgstr ""
698
 
699
- #: includes/forms/files.php:58
700
- msgid ""
701
- "Click \"Export Zip\" to save a backup of the currently loaded child theme. "
702
- "You can export any of your themes from the Parent/Child tab."
703
  msgstr ""
704
 
705
- #: includes/forms/files.php:68
706
  msgid "Secure Child Theme"
707
  msgstr ""
708
 
709
- #: includes/forms/files.php:71
710
  msgid ""
711
  "Attempt to reset child theme permissions to user ownership and read-only "
712
  "access."
713
  msgstr ""
714
 
715
- #: includes/forms/files.php:77
716
  msgid "Make read-only"
717
  msgstr ""
718
 
@@ -724,469 +601,301 @@ msgstr ""
724
  msgid "Delete child theme images by selecting them here."
725
  msgstr ""
726
 
727
- #: includes/forms/main.php:35
728
  msgid "version"
729
  msgstr ""
730
 
731
- #: includes/forms/notices.php:12
732
- msgid ""
733
- "The child theme is in read-only mode and Child Theme Configurator cannot "
734
- "apply changes. Click to see options"
735
- msgstr ""
736
-
737
- #: includes/forms/notices.php:20
738
- msgid ""
739
- "<li>Temporarily set write permissions by clicking the button below. When you "
740
- "are finished editing, revert to read-only by clicking \"Make read-only\" "
741
- "under the \"Files\" tab.</li>"
742
- msgstr ""
743
-
744
- #: includes/forms/notices.php:24
745
- msgid "Make files writable"
746
- msgstr ""
747
-
748
- #: includes/forms/notices.php:27
749
- msgid ""
750
- "<li><a target=\"_blank\" href=\"http://codex.wordpress.org/Editing_wp-"
751
- "config.php#WordPress_Upgrade_Constants\" title=\"Editin wp-config.php\">Add "
752
- "your FTP/SSH credentials to the WordPress config file</a>.</li>"
753
  msgstr ""
754
 
755
- #: includes/forms/notices.php:29
756
- msgid ""
757
- "<li><a target=\"_blank\" href=\"http://technet.microsoft.com/en-us/library/"
758
- "cc771170\" title=\"Setting Application Pool Identity\">Assign WordPress to "
759
- "an application pool that has write permissions</a> (Windows IIS systems).</"
760
- "li>"
761
  msgstr ""
762
 
763
- #: includes/forms/notices.php:30
764
- msgid ""
765
- "<li><a target=\"_blank\" href=\"http://codex.wordpress.org/"
766
- "Changing_File_Permissions\" title=\"Changing File Permissions\">Set write "
767
- "permissions on the server manually</a> (not recommended).</li>"
768
- msgstr ""
769
-
770
- #: includes/forms/notices.php:32
771
- msgid "<li>Run PHP under Apache with suEXEC (contact your web host).</li>"
772
- msgstr ""
773
-
774
- #: includes/forms/notices.php:45
775
- msgid ""
776
- "This Child Theme has incorrect ownership permissions. Child Theme "
777
- "Configurator will attempt to correct this when you click the button below."
778
- msgstr ""
779
-
780
- #: includes/forms/notices.php:51
781
- msgid "Correct Child Theme Permissions"
782
- msgstr ""
783
-
784
- #: includes/forms/notices.php:60
785
- msgid ""
786
- "Child Theme Configurator needs to update its internal data. Please set your "
787
- "preferences below and click \"Generate Child Theme Files\" to update your "
788
- "configuration."
789
- msgstr ""
790
-
791
- #: includes/forms/notices.php:68
792
- msgid ""
793
- "<strong>However, some styles could not be parsed due to memory limits.</"
794
- "strong> Try deselecting \"Additional Stylesheets\" below and click "
795
- "\"Generate/Rebuild Child Theme Files\". %sWhy am I seeing this?%s"
796
  msgstr ""
797
 
798
- #: includes/forms/notices.php:76
799
- msgid ""
800
- "Child Theme Configurator did not detect any configuration data because a "
801
- "previously configured Child Theme has been removed. Please follow the steps "
802
- "for \"CONFIGURE an existing Child Theme\" under the \"Parent/Child\" Tab."
803
  msgstr ""
804
 
805
- #: includes/forms/notices.php:84
806
- msgid ""
807
- "Your stylesheet has changed since the last time you used the Configurator. "
808
- "Please follow the steps for \"CONFIGURE an existing Child Theme\" under the "
809
- "\"Parent/Child\" Tab or you will lose these changes."
810
  msgstr ""
811
 
812
- #: includes/forms/notices.php:97
813
- msgid "Thank you for installing Child Theme Configurator."
814
  msgstr ""
815
 
816
- #: includes/forms/notices.php:100
817
- msgid ""
818
- "A lot of time and testing has gone into this release but there may be edge "
819
- "cases. If you have any questions, please"
820
  msgstr ""
821
 
822
- #: includes/forms/notices.php:102
823
- msgid "Contact Us."
824
  msgstr ""
825
 
826
- #: includes/forms/notices.php:105
827
- msgid "For more information, please open the Help tab at the top right or "
828
  msgstr ""
829
 
830
- #: includes/forms/notices.php:107
831
- msgid "click here to view the latest videos."
832
  msgstr ""
833
 
834
- #: includes/forms/notices.php:111
835
- msgid ""
836
- "It is a good idea to save a Zip Archive of your Child Theme before using CTC "
837
- "for the first time. Click the \"save backup\" link ( see Step 2, below ) to "
838
- "export your themes."
839
  msgstr ""
840
 
841
- #: includes/forms/parent-child.php:21
842
- msgid "Select an action:"
843
  msgstr ""
844
 
845
- #: includes/forms/parent-child.php:28
846
- msgid "CREATE a new Child Theme"
847
  msgstr ""
848
 
849
- #: includes/forms/parent-child.php:31
850
- msgid ""
851
- "Install a new customizable child theme using an installed theme as a parent."
852
  msgstr ""
853
 
854
- #: includes/forms/parent-child.php:42
855
- msgid "CONFIGURE an existing Child Theme"
856
  msgstr ""
857
 
858
- #: includes/forms/parent-child.php:45
859
- msgid ""
860
- "Set up a previously installed child theme for use with the Configurator or "
861
- "to modify current settings."
862
  msgstr ""
863
 
864
- #: includes/forms/parent-child.php:54
865
- msgid "DUPLICATE an existing Child Theme"
866
  msgstr ""
867
 
868
- #: includes/forms/parent-child.php:57
869
- msgid ""
870
- "Make a complete copy of an existing Child Theme in a new directory, "
871
- "including any menus, widgets and other Customizer settings. The option to "
872
- "copy the Parent Theme settings (step 8, below) is disabled with this action."
873
  msgstr ""
874
 
875
- #: includes/forms/parent-child.php:66
876
- msgid ""
877
- "RESET an existing Child Theme (this will destroy any work you have done in "
878
- "the Configurator)"
879
  msgstr ""
880
 
881
- #: includes/forms/parent-child.php:69
882
- msgid ""
883
- "Revert the Child theme stylesheet and functions files to their state before "
884
- "the initial configuration or last reset. Additional child theme files will "
885
- "not be removed, but you can delete them under the Files tab."
886
  msgstr ""
887
 
888
- #: includes/forms/parent-child.php:78
889
- msgid "Select a Parent Theme:"
890
  msgstr ""
891
 
892
- #: includes/forms/parent-child.php:80 includes/forms/parent-child.php:95
893
- msgid "Click here to save a backup of the selected theme."
894
  msgstr ""
895
 
896
- #: includes/forms/parent-child.php:84 includes/forms/parent-child.php:99
897
- msgid "Analyze"
898
  msgstr ""
899
 
900
- #: includes/forms/parent-child.php:86
901
- msgid "Analyze Parent Theme"
902
  msgstr ""
903
 
904
- #: includes/forms/parent-child.php:86 includes/forms/parent-child.php:101
905
  msgid ""
906
- "Click \"Analyze\" to determine stylesheet dependencies and other potential "
907
- "issues."
908
  msgstr ""
909
 
910
- #: includes/forms/parent-child.php:93
911
- msgid "Select a Child Theme:"
912
  msgstr ""
913
 
914
- #: includes/forms/parent-child.php:101
915
- msgid "Analyze Child Theme"
916
  msgstr ""
917
 
918
- #: includes/forms/parent-child.php:109
919
- msgid "Name the new theme directory:"
920
  msgstr ""
921
 
922
- #: includes/forms/parent-child.php:112
923
- msgid "Directory Name"
924
  msgstr ""
925
 
926
- #: includes/forms/parent-child.php:116 includes/forms/parent-child.php:311
927
- msgid "NOTE:"
928
- msgstr ""
929
-
930
- #: includes/forms/parent-child.php:118
931
  msgid ""
932
- "This is NOT the name of the Child Theme. You can customize the name, "
933
- "description, etc. in step 7, below."
 
934
  msgstr ""
935
 
936
- #: includes/forms/parent-child.php:122
937
- msgid "Verify Child Theme directory:"
938
  msgstr ""
939
 
940
- #: includes/forms/parent-child.php:128
941
  msgid ""
942
- "For verification only (you cannot modify the directory of an existing Child "
943
- "Theme)."
944
- msgstr ""
945
-
946
- #: includes/forms/parent-child.php:140
947
- msgid "Select where to save new styles:"
948
  msgstr ""
949
 
950
- #: includes/forms/parent-child.php:147
951
- msgid "Primary Stylesheet (style.css)"
952
  msgstr ""
953
 
954
- #: includes/forms/parent-child.php:150
955
  msgid ""
956
- "Save new custom styles directly to the Child Theme primary stylesheet, "
957
- "replacing the existing values. The primary stylesheet will load in the order "
958
- "set by the theme."
959
- msgstr ""
960
-
961
- #: includes/forms/parent-child.php:160
962
- msgid "Separate Stylesheet"
963
- msgstr ""
964
-
965
- #: includes/forms/parent-child.php:163
966
- msgid ""
967
- "Save new custom styles to a separate stylesheet and use any existing child "
968
- "theme styles as a baseline. Select this option if you want to preserve the "
969
- "original child theme styles instead of overwriting them. This option also "
970
- "allows you to customize stylesheets that load after the primary stylesheet."
971
- msgstr ""
972
-
973
- #: includes/forms/parent-child.php:169
974
- msgid "Click to expand"
975
- msgstr ""
976
-
977
- #: includes/forms/parent-child.php:170
978
- msgid "Select Parent Theme stylesheet handling:"
979
  msgstr ""
980
 
981
- #: includes/forms/parent-child.php:183
982
- msgid "Use the WordPress style queue."
983
  msgstr ""
984
 
985
  #: includes/forms/parent-child.php:187
986
- msgid ""
987
- "Let the Configurator determine the appropriate actions and dependencies and "
988
- "update the functions file automatically."
989
- msgstr ""
990
-
991
- #: includes/forms/parent-child.php:193
992
- msgid "Use <code>@import</code> in the child theme stylesheet."
993
  msgstr ""
994
 
995
- #: includes/forms/parent-child.php:197
996
  msgid ""
997
- "Only use this option if the parent stylesheet cannot be loaded using the "
998
- "WordPress style queue. Using <code>@import</code> is not recommended."
 
999
  msgstr ""
1000
 
1001
- #: includes/forms/parent-child.php:203
1002
- msgid "Do not add any parent stylesheet handling."
1003
  msgstr ""
1004
 
1005
- #: includes/forms/parent-child.php:206
1006
  msgid ""
1007
- "Select this option if this theme already handles the parent theme stylesheet "
1008
- "or if the parent theme's <code>style.css</code> file is not used for its "
1009
- "appearance."
1010
- msgstr ""
1011
-
1012
- #: includes/forms/parent-child.php:209
1013
- msgid "Additional handling options"
1014
  msgstr ""
1015
 
1016
- #: includes/forms/parent-child.php:216
1017
- msgid "Ignore parent theme stylesheets."
1018
  msgstr ""
1019
 
1020
- #: includes/forms/parent-child.php:217
1021
- msgid ""
1022
- "Do not load or parse the parent theme styles. Only use this option if the "
1023
- "Child Theme uses a Framework like Genesis and only uses child theme "
1024
- "stylesheets for its appearance."
1025
  msgstr ""
1026
 
1027
- #: includes/forms/parent-child.php:226
1028
- msgid "Repair the header template in the child theme."
1029
  msgstr ""
1030
 
1031
- #: includes/forms/parent-child.php:227
1032
  msgid ""
1033
- "Let the Configurator (try to) resolve any stylesheet issues listed above. "
1034
- "This can fix many, but not all, common problems."
1035
- msgstr ""
1036
-
1037
- #: includes/forms/parent-child.php:232
1038
- msgid "Click to toggle form"
1039
- msgstr ""
1040
-
1041
- #: includes/forms/parent-child.php:233
1042
- msgid "Customize the Child Theme Name, Description, Author, Version, etc.:"
1043
  msgstr ""
1044
 
1045
  #: includes/forms/parent-child.php:234
1046
- msgid "(Click to toggle form)"
1047
  msgstr ""
1048
 
1049
- #: includes/forms/parent-child.php:238
1050
- msgid "Child Theme Name"
1051
- msgstr ""
1052
-
1053
- #: includes/forms/parent-child.php:242
1054
- msgid "Theme Name"
1055
  msgstr ""
1056
 
1057
- #: includes/forms/parent-child.php:247 includes/forms/parent-child.php:251
1058
- msgid "Theme Website"
1059
- msgstr ""
1060
-
1061
- #: includes/forms/parent-child.php:256 includes/forms/parent-child.php:260
1062
- msgid "Author"
1063
- msgstr ""
1064
-
1065
- #: includes/forms/parent-child.php:265 includes/forms/parent-child.php:269
1066
- msgid "Author Website"
1067
- msgstr ""
1068
-
1069
- #: includes/forms/parent-child.php:274
1070
- msgid "Theme Description"
1071
- msgstr ""
1072
-
1073
- #: includes/forms/parent-child.php:277
1074
- msgid "Description"
1075
- msgstr ""
1076
-
1077
- #: includes/forms/parent-child.php:282
1078
- msgid "Theme Tags"
1079
- msgstr ""
1080
-
1081
- #: includes/forms/parent-child.php:285
1082
- msgid "Tags"
1083
  msgstr ""
1084
 
1085
- #: includes/forms/parent-child.php:290 includes/forms/parent-child.php:294
1086
- msgid "Version"
1087
  msgstr ""
1088
 
1089
- #: includes/forms/parent-child.php:303
1090
- msgid ""
1091
- "Copy Menus, Widgets and other Customizer Settings from the Parent Theme to "
1092
- "the Child Theme:"
1093
  msgstr ""
1094
 
1095
- #: includes/forms/parent-child.php:313
1096
  msgid ""
1097
- "This option replaces the Child Theme's existing Menus, Widgets and other "
1098
- "Customizer Settings with those from the Parent Theme. You should only need "
1099
- "to use this option the first time you configure a Child Theme."
1100
- msgstr ""
1101
-
1102
- #: includes/forms/parent-child.php:320 includes/forms/parent-child.php:358
1103
- msgid "Click to run the Configurator:"
1104
- msgstr ""
1105
-
1106
- #: includes/forms/parent-child.php:323
1107
- msgid "Configure Child Theme"
1108
  msgstr ""
1109
 
1110
- #: includes/forms/parent-child.php:342
1111
- msgid "Parse Plugin stylesheets:"
1112
  msgstr ""
1113
 
1114
- #: includes/forms/parent-child.php:346
1115
- msgid "Select the plugin stylesheets you wish to customize below."
1116
  msgstr ""
1117
 
1118
- #: includes/forms/parent-child.php:361
1119
- msgid "Configure Plugin Styles"
1120
  msgstr ""
1121
 
1122
- #: includes/forms/query-selector.php:9
1123
- msgid ""
1124
- "To find and edit specific selectors within @media query blocks, first choose "
1125
- "the query, then the selector. Use the \"base\" query to edit all other "
1126
- "selectors."
1127
  msgstr ""
1128
 
1129
- #: includes/forms/query-selector.php:14
1130
- msgid "@media Query"
1131
  msgstr ""
1132
 
1133
- #: includes/forms/query-selector.php:15
1134
- msgid "( or \"base\" )"
1135
- msgstr ""
1136
-
1137
- #: includes/forms/query-selector.php:25
1138
  msgid "Selector"
1139
  msgstr ""
1140
 
1141
- #: includes/forms/query-selector.php:38 includes/forms/rule-value.php:30
1142
  msgid "Sample"
1143
  msgstr ""
1144
 
1145
- #: includes/forms/query-selector.php:46
1146
  msgid "Save Child Values"
1147
  msgstr ""
1148
 
1149
- #: includes/forms/query-selector.php:47
1150
  msgid "Delete Child Values"
1151
  msgstr ""
1152
 
1153
- #: includes/forms/query-selector.php:54 includes/forms/rule-value.php:14
1154
  msgid "Property"
1155
  msgstr ""
1156
 
1157
- #: includes/forms/query-selector.php:57
1158
- msgid "Baseline Value"
1159
  msgstr ""
1160
 
1161
- #: includes/forms/query-selector.php:60
1162
  msgid "Child Value"
1163
  msgstr ""
1164
 
1165
- #: includes/forms/query-selector.php:66
1166
  msgid "New Property"
1167
  msgstr ""
1168
 
1169
- #: includes/forms/query-selector.php:76
1170
  msgid "Order"
1171
  msgstr ""
1172
 
1173
- #: includes/forms/query-selector.php:85
1174
  msgid "Copy Selector"
1175
  msgstr ""
1176
 
1177
- #: includes/forms/query-selector.php:87 includes/forms/webfonts.php:15
1178
  msgid "Save"
1179
  msgstr ""
1180
 
1181
- #: includes/forms/query-selector.php:90
1182
  msgid "Raw CSS"
1183
  msgstr ""
1184
 
1185
- #: includes/forms/query-selector.php:92
1186
  msgid "Use to enter shorthand CSS or new @media queries and selectors."
1187
  msgstr ""
1188
 
1189
- #: includes/forms/query-selector.php:92
1190
  msgid ""
1191
  "Values entered here are merged into existing child styles or added to the "
1192
  "child stylesheet if they do not exist in the parent."
@@ -1208,81 +917,35 @@ msgstr ""
1208
  msgid "Lilaea Media - Responsive Tools for a Mobile World"
1209
  msgstr ""
1210
 
1211
- #: includes/forms/rule-value.php:9
1212
- msgid ""
1213
- "To find and edit selectors containing specific values for a given property, "
1214
- "first choose the property (e.g., \"color\"), then click \"Selectors\" for "
1215
- "any resulting value. A dialog panel will open with the corresponding "
1216
- "selectors, grouped by media query."
1217
- msgstr ""
1218
-
1219
- #: includes/forms/rule-value.php:27
1220
  msgid "Value"
1221
  msgstr ""
1222
 
1223
- #: includes/forms/settings-errors.php:20
1224
- msgid ""
1225
- "Child Theme <strong>%s</strong> has been reset. Please configure it using "
1226
- "the settings below."
1227
- msgstr ""
1228
-
1229
- #: includes/forms/settings-errors.php:24
1230
- msgid "Update Key saved successfully."
1231
- msgstr ""
1232
-
1233
- #: includes/forms/settings-errors.php:29
1234
- msgid "Child Theme files modified successfully."
1235
- msgstr ""
1236
-
1237
- #: includes/forms/settings-errors.php:32
1238
- msgid "Child Theme <strong>%s</strong> has been generated successfully."
1239
- msgstr ""
1240
-
1241
- #: includes/forms/settings-errors.php:36
1242
- msgid "IMPORTANT:"
1243
- msgstr ""
1244
-
1245
- #: includes/forms/settings-errors.php:39
1246
- msgid "You must %sNetwork enable%s your child theme."
1247
- msgstr ""
1248
-
1249
- #: includes/forms/settings-errors.php:42 includes/forms/themepreview.php:20
1250
- msgid "Go to Themes"
1251
- msgstr ""
1252
-
1253
- #: includes/forms/settings-errors.php:46
1254
- msgid "%sPreview your child theme%s before activating."
1255
- msgstr ""
1256
-
1257
- #: includes/forms/settings-errors.php:49 includes/forms/themepreview.php:18
1258
- msgid "Live Preview"
1259
- msgstr ""
1260
-
1261
  #: includes/forms/tabs.php:11
1262
- msgid "Parent/ Child"
1263
  msgstr ""
1264
 
1265
- #: includes/forms/tabs.php:14
1266
- msgid "Query/ Selector"
1267
  msgstr ""
1268
 
1269
- #: includes/forms/tabs.php:17
1270
- msgid "Property/ Value"
1271
  msgstr ""
1272
 
1273
  #: includes/forms/tabs.php:22
1274
  msgid "Web Fonts"
1275
  msgstr ""
1276
 
1277
- #: includes/forms/tabs.php:26
1278
- msgid "Baseline Styles"
1279
  msgstr ""
1280
 
1281
- #: includes/forms/tabs.php:29
1282
- msgid "Child Styles"
1283
  msgstr ""
1284
 
1285
- #: includes/forms/tabs.php:33
1286
  msgid "Files"
1287
  msgstr ""
1288
 
@@ -1318,18 +981,14 @@ msgid ""
1318
  "strong>"
1319
  msgstr ""
1320
 
1321
- #: includes/forms/zipform.php:6
1322
- msgid "Export Child Theme"
1323
- msgstr ""
1324
-
1325
  #. Plugin URI of the plugin/theme
1326
  msgid "http://www.childthemeconfigurator.com"
1327
  msgstr ""
1328
 
1329
  #. Description of the plugin/theme
1330
  msgid ""
1331
- "When using the Customizer is not enough - Create child themes and customize "
1332
- "styles, templates, functions and more."
1333
  msgstr ""
1334
 
1335
  #. Author of the plugin/theme
1
+ # Copyright (C) 2015 Child Theme Configurator
2
  # This file is distributed under the same license as the Child Theme Configurator package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Child Theme Configurator 1.7.8\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/child-theme-configurator\n"
7
+ "POT-Creation-Date: 2015-09-24 00:16:38+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\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.8) #-#-#-#-#
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:52
32
+ msgid "A stylesheet link tag is hard-coded into the header template."
33
  msgstr ""
34
 
35
+ #: includes/class-ctc-ui.php:53
36
+ msgid "<code>wp_enqueue_style()</code> called from the header template."
37
  msgstr ""
38
 
39
+ #: includes/class-ctc-ui.php:55
40
  msgid ""
41
+ "Code exists between the <code>wp_head()</code> function and the closing "
42
+ "<code>&lt;/head&gt;</code> tag."
 
 
 
 
 
 
 
 
43
  msgstr ""
44
 
45
+ #: includes/class-ctc-ui.php:162
46
+ msgid "Child Theme files modified successfully."
 
 
 
 
47
  msgstr ""
48
 
49
+ #: includes/class-ctc-ui.php:165
50
+ msgid ""
51
+ "Child Theme <strong>%s</strong> has been generated successfully.\n"
52
+ " "
53
  msgstr ""
54
 
55
+ #: includes/class-ctc-ui.php:168
56
+ msgid "IMPORTANT:"
57
  msgstr ""
58
 
59
+ #: includes/class-ctc-ui.php:170 includes/forms/themepreview.php:20
60
+ msgid "Go to Themes"
61
  msgstr ""
62
 
63
+ #: includes/class-ctc-ui.php:170
64
+ msgid "Network enable"
65
  msgstr ""
66
 
67
+ #: includes/class-ctc-ui.php:170
68
+ msgid "your child theme."
69
  msgstr ""
70
 
71
+ #: includes/class-ctc-ui.php:172 includes/forms/themepreview.php:18
72
+ msgid "Live Preview"
73
  msgstr ""
74
 
75
+ #: includes/class-ctc-ui.php:172
76
+ msgid "Test your child theme"
 
77
  msgstr ""
78
 
79
+ #: includes/class-ctc-ui.php:172
80
+ msgid "before activating."
81
  msgstr ""
82
 
83
+ #: includes/class-ctc.php:144
84
  msgid "URL/None"
85
  msgstr ""
86
 
87
+ #: includes/class-ctc.php:145
88
  msgid "Origin"
89
  msgstr ""
90
 
91
+ #: includes/class-ctc.php:146
92
  msgid "Color 1"
93
  msgstr ""
94
 
95
+ #: includes/class-ctc.php:147
96
  msgid "Color 2"
97
  msgstr ""
98
 
99
+ #: includes/class-ctc.php:148
100
  msgid "Width/None"
101
  msgstr ""
102
 
103
+ #: includes/class-ctc.php:149
104
  msgid "Style"
105
  msgstr ""
106
 
107
+ #: includes/class-ctc.php:150
108
  msgid "Color"
109
  msgstr ""
110
 
111
+ #: includes/class-ctc.php:152
112
+ msgid "Are you sure? This will replace your current settings."
 
 
113
  msgstr ""
114
 
115
+ #: includes/class-ctc.php:153
116
  msgid "<span style=\"font-size:10px\">!</span>"
117
  msgstr ""
118
 
119
+ #: includes/class-ctc.php:154 includes/forms/rule-value.php:32
120
  msgid "Selectors"
121
  msgstr ""
122
 
123
+ #: includes/class-ctc.php:155
124
  msgid "Close"
125
  msgstr ""
126
 
127
+ #: includes/class-ctc.php:156
128
  msgid "Edit Selector"
129
  msgstr ""
130
 
131
+ #: includes/class-ctc.php:157
132
  msgid "Cancel"
133
  msgstr ""
134
 
135
+ #: includes/class-ctc.php:158
136
  msgid "Rename"
137
  msgstr ""
138
 
139
+ #: includes/class-ctc.php:159
140
  msgid "The stylesheet cannot be displayed."
141
  msgstr ""
142
 
143
+ #: includes/class-ctc.php:160
144
  msgid "(Child Only)"
145
  msgstr ""
146
 
147
+ #: includes/class-ctc.php:161
148
  msgid "Please enter a valid Child Theme."
149
  msgstr ""
150
 
151
+ #: includes/class-ctc.php:162
152
  msgid "Please enter a valid Child Theme name."
153
  msgstr ""
154
 
155
+ #: includes/class-ctc.php:163
156
  msgid "<strong>%s</strong> exists. Please enter a different Child Theme"
157
  msgstr ""
158
 
159
+ #: includes/class-ctc.php:164
160
  msgid "The page could not be loaded correctly."
161
  msgstr ""
162
 
163
+ #: includes/class-ctc.php:166
164
  msgid ""
165
  "Conflicting or out-of-date jQuery libraries were loaded by another plugin:"
166
  msgstr ""
167
 
168
+ #: includes/class-ctc.php:168
169
  msgid "Deactivating or replacing plugins may resolve this issue."
170
  msgstr ""
171
 
172
+ #: includes/class-ctc.php:169
173
  msgid "%sWhy am I seeing this?%s"
174
  msgstr ""
175
 
176
+ #: includes/class-ctc.php:392
177
+ msgid "Zip file creation failed."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  msgstr ""
179
 
180
+ #: includes/class-ctc.php:428
181
+ msgid "The Functions file is required and cannot be deleted."
182
  msgstr ""
183
 
184
+ #: includes/class-ctc.php:510
185
+ msgid "You do not have permission to configure child themes."
 
 
 
 
 
 
186
  msgstr ""
187
 
188
+ #: includes/class-ctc.php:557
189
+ msgid "%s does not exist. Please select a valid Parent Theme."
190
  msgstr ""
191
 
192
+ #: includes/class-ctc.php:561
193
+ msgid "Please select a valid Parent Theme."
194
  msgstr ""
195
 
196
+ #: includes/class-ctc.php:564
197
+ msgid "Please enter a valid Child Theme directory."
 
 
 
198
  msgstr ""
199
 
200
+ #: includes/class-ctc.php:572 includes/class-ctc.php:587
201
+ msgid "Please enter a valid Child Theme template name."
 
 
202
  msgstr ""
203
 
204
+ #: includes/class-ctc.php:577 includes/class-ctc.php:591
205
  msgid ""
206
+ "<strong>%s</strong> exists. Please enter a different Child Theme template "
207
+ "name."
 
 
 
 
 
 
208
  msgstr ""
209
 
210
+ #: includes/class-ctc.php:604
211
+ msgid "Your theme directories are not writable."
 
 
212
  msgstr ""
213
 
214
+ #: includes/class-ctc.php:682
215
+ msgid "Your stylesheet is not writable."
 
 
216
  msgstr ""
217
 
218
+ #: includes/class-ctc.php:959
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 "
222
+ "the file is discouraged as it can cause premature HTTP headers. Please edit "
223
+ "<code>functions.php</code> to remove the final <code>?&gt;</code> tag and "
224
+ "click \"Generate/Rebuild Child Theme Files\" again."
 
 
 
 
 
225
  msgstr ""
226
 
227
+ #: includes/class-ctc.php:1060
228
+ msgid "Could not delete file."
229
  msgstr ""
230
 
231
+ #: includes/class-ctc.php:1139
232
+ msgid "Could not set write permissions."
 
 
 
 
 
 
 
 
 
 
233
  msgstr ""
234
 
235
+ #: includes/class-ctc.php:1240
236
+ msgid "There were errors while resetting permissions."
 
 
237
  msgstr ""
238
 
239
+ #: includes/class-ctc.php:1282
240
+ msgid "Could not upload file."
 
 
241
  msgstr ""
242
 
243
+ #: includes/class-ctc.php:1365
244
  msgid ""
245
+ "The child theme is in read-only mode and Child Theme Configurator cannot "
246
+ "apply changes. Click to see options"
247
  msgstr ""
248
 
249
+ #: includes/class-ctc.php:1368
250
  msgid ""
251
+ "<li>Temporarily set write permissions by clicking the button below. When you "
252
+ "are finished editing, revert to read-only by clicking \"Make read-only\" "
253
+ "under the \"Files\" tab.</li>"
254
  msgstr ""
255
 
256
+ #: includes/class-ctc.php:1371
257
+ msgid "Make files writable"
 
 
258
  msgstr ""
259
 
260
+ #: includes/class-ctc.php:1372
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:1374
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 "
271
+ "an application pool that has write permissions</a> (Windows IIS systems).</"
272
+ "li>"
273
  msgstr ""
274
 
275
+ #: includes/class-ctc.php:1375
276
  msgid ""
277
+ "<li><a target=\"_blank\" href=\"http://codex.wordpress.org/"
278
+ "Changing_File_Permissions\" title=\"Changing File Permissions\">Set write "
279
+ "permissions on the server manually</a> (not recommended).</li>"
280
  msgstr ""
281
 
282
+ #: includes/class-ctc.php:1377
283
+ msgid "<li>Run PHP under Apache with suEXEC (contact your web host).</li>"
 
 
284
  msgstr ""
285
 
286
+ #: includes/class-ctc.php:1388
287
  msgid ""
288
+ "This Child Theme is not owned by your website account. It may have been "
289
+ "created by a prior version of this plugin or by another program. Moving "
290
+ "forward, it must be owned by your website account to make changes. Child "
291
+ "Theme Configurator will attempt to correct this when you click the button "
292
+ "below."
293
  msgstr ""
294
 
295
+ #: includes/class-ctc.php:1391
296
+ msgid "Correct Child Theme Permissions"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
297
  msgstr ""
298
 
299
+ #: includes/class-ctc.php:1398
300
  msgid ""
301
+ "Child Theme Configurator needs to update its interal data. Please set your "
302
+ "preferences below and click \"Generate Child Theme Files\" to update your "
303
+ "configuration."
 
 
 
 
 
 
 
304
  msgstr ""
305
 
306
+ #: includes/class-ctc.php:1404
307
  msgid ""
308
+ "<strong>However, some styles could not be parsed due to memory limits.</"
309
+ "strong> Try deselecting \"Additional Stylesheets\" below and click "
310
+ "\"Generate/Rebuild Child Theme Files\". %sWhy am I seeing this?%s"
 
 
 
 
 
 
 
311
  msgstr ""
312
 
313
+ #: includes/class-ctc.php:1413
314
  msgid ""
315
+ "Child Theme Configurator did not detect any configuration data because a "
316
+ "previously configured Child Theme has been removed. Please set your "
317
+ "preferences below and click \"Generate Child Theme Files\"."
318
  msgstr ""
319
 
320
  #: includes/forms/addl_css.php:7
321
  msgid "Parse additional stylesheets:"
322
  msgstr ""
323
 
324
+ #: includes/forms/addl_css.php:11 includes/forms/parent-child.php:270
325
  msgid ""
326
  "Stylesheets that are currently being loaded by the parent theme are "
327
  "automatically selected below (except for Bootstrap stylesheets which add a "
376
  "experience."
377
  msgstr ""
378
 
379
+ #: includes/forms/addl_panels.php:19 includes/help/help_en_US.php:215
380
  msgid "Learn more about CTC Pro"
381
  msgstr ""
382
 
416
  msgstr ""
417
 
418
  #: includes/forms/addl_panels.php:27
419
+ msgid "Test your child theme with a single click."
420
  msgstr ""
421
 
422
  #: includes/forms/addl_panels.php:28
456
  msgstr ""
457
 
458
  #: includes/forms/addl_panels.php:32
459
+ msgid "Genesis Framework Support"
460
  msgstr ""
461
 
462
  #: includes/forms/addl_panels.php:33
463
+ msgid ""
464
+ "Automatically detects and configures Genesis Child Themes with more "
465
+ "frameworks on the way."
466
  msgstr ""
467
 
468
  #: includes/forms/addl_panels.php:34
485
  msgid "Backup"
486
  msgstr ""
487
 
488
+ #: includes/forms/backups.php:10 includes/forms/parent-child.php:253
489
  msgid "Restore backup from"
490
  msgstr ""
491
 
492
+ #: includes/forms/fileform.php:8
493
+ msgid ""
494
+ "The Theme editor has been disabled. Template files must be edited offline."
 
 
 
 
 
 
 
 
 
 
 
495
  msgstr ""
496
 
497
+ #: includes/forms/fileform.php:12
498
+ msgid "Click here to edit template files using the Theme Editor"
499
  msgstr ""
500
 
501
+ #: includes/forms/fileform.php:23
502
  msgid "Parent Templates"
503
  msgstr ""
504
 
505
+ #: includes/forms/fileform.php:23
506
  msgid "Child Theme Files"
507
  msgstr ""
508
 
509
+ #: includes/forms/fileform.php:28
510
+ msgid "Copy PHP template files from the parent theme by selecting them here."
 
 
 
511
  msgstr ""
512
 
513
+ #: includes/forms/fileform.php:31
514
  msgid ""
515
  "CAUTION: If your child theme is active, the child theme version of the file "
516
  "will be used instead of the parent immediately after it is copied."
517
  msgstr ""
518
 
519
+ #: includes/forms/fileform.php:33
520
  msgid "The %s file is generated separately and cannot be copied here."
521
  msgstr ""
522
 
523
+ #: includes/forms/fileform.php:43
524
  msgid "Delete child theme templates by selecting them here."
525
  msgstr ""
526
 
527
+ #: includes/forms/fileform.php:44
528
  msgid ""
529
  "Delete child theme templates or make them writable by selecting them here. "
530
  "Writable files are displayed in <span style=\"color:red\">red</span>."
531
  msgstr ""
532
 
533
+ #: includes/forms/fileform.php:57
534
+ msgid "Make Selected Writable"
535
+ msgstr ""
536
+
537
+ #: includes/forms/fileform.php:61
538
+ msgid "Copy Selected to Child Theme"
539
+ msgstr ""
540
+
541
+ #: includes/forms/fileform.php:61 includes/forms/images.php:21
542
+ msgid "Delete Selected"
543
+ msgstr ""
544
+
545
  #: includes/forms/files.php:15
546
  msgid "Upload New Child Theme Image"
547
  msgstr ""
571
  "GIF. It will be renamed <code>screenshot</code>."
572
  msgstr ""
573
 
574
+ #: includes/forms/files.php:59
575
  msgid "Export Child Theme as Zip Archive"
576
  msgstr ""
577
 
578
+ #: includes/forms/files.php:64
579
+ msgid "Export"
 
 
580
  msgstr ""
581
 
582
+ #: includes/forms/files.php:73
583
  msgid "Secure Child Theme"
584
  msgstr ""
585
 
586
+ #: includes/forms/files.php:76
587
  msgid ""
588
  "Attempt to reset child theme permissions to user ownership and read-only "
589
  "access."
590
  msgstr ""
591
 
592
+ #: includes/forms/files.php:82
593
  msgid "Make read-only"
594
  msgstr ""
595
 
601
  msgid "Delete child theme images by selecting them here."
602
  msgstr ""
603
 
604
+ #: includes/forms/main.php:23
605
  msgid "version"
606
  msgstr ""
607
 
608
+ #: includes/forms/parent-child.php:17
609
+ msgid "Parent Theme"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
610
  msgstr ""
611
 
612
+ #: includes/forms/parent-child.php:25
613
+ msgid "Child Theme"
 
 
 
 
614
  msgstr ""
615
 
616
+ #: includes/forms/parent-child.php:27
617
+ msgid "(click to edit additional fields)"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
618
  msgstr ""
619
 
620
+ #: includes/forms/parent-child.php:34
621
+ msgid "Create New Child Theme"
 
 
 
622
  msgstr ""
623
 
624
+ #: includes/forms/parent-child.php:43
625
+ msgid "Use Existing Child Theme"
 
 
 
626
  msgstr ""
627
 
628
+ #: includes/forms/parent-child.php:48
629
+ msgid "New Child Theme Slug"
630
  msgstr ""
631
 
632
+ #: includes/forms/parent-child.php:59
633
+ msgid "Child Theme Name"
 
 
634
  msgstr ""
635
 
636
+ #: includes/forms/parent-child.php:63
637
+ msgid "Theme Name"
638
  msgstr ""
639
 
640
+ #: includes/forms/parent-child.php:66 includes/forms/parent-child.php:70
641
+ msgid "Theme Website"
642
  msgstr ""
643
 
644
+ #: includes/forms/parent-child.php:73 includes/forms/parent-child.php:77
645
+ msgid "Author"
646
  msgstr ""
647
 
648
+ #: includes/forms/parent-child.php:81 includes/forms/parent-child.php:85
649
+ msgid "Author Website"
 
 
 
650
  msgstr ""
651
 
652
+ #: includes/forms/parent-child.php:88
653
+ msgid "Theme Description"
654
  msgstr ""
655
 
656
+ #: includes/forms/parent-child.php:91
657
+ msgid "Description"
658
  msgstr ""
659
 
660
+ #: includes/forms/parent-child.php:94
661
+ msgid "Theme Tags"
 
662
  msgstr ""
663
 
664
+ #: includes/forms/parent-child.php:97
665
+ msgid "Tags"
666
  msgstr ""
667
 
668
+ #: includes/forms/parent-child.php:100 includes/forms/parent-child.php:104
669
+ msgid "Version"
 
 
670
  msgstr ""
671
 
672
+ #: includes/forms/parent-child.php:109
673
+ msgid "Duplicate Existing Child Theme"
674
  msgstr ""
675
 
676
+ #: includes/forms/parent-child.php:115
677
+ msgid "Duplicate Theme Slug"
 
 
 
678
  msgstr ""
679
 
680
+ #: includes/forms/parent-child.php:118 includes/forms/parent-child.php:212
681
+ #: includes/forms/parent-child.php:227
682
+ msgid "NOTE:"
 
683
  msgstr ""
684
 
685
+ #: includes/forms/parent-child.php:120
686
+ msgid "This will copy all child theme files and apply changes to new version."
 
 
 
687
  msgstr ""
688
 
689
+ #: includes/forms/parent-child.php:126
690
+ msgid "Debug"
691
  msgstr ""
692
 
693
+ #: includes/forms/parent-child.php:134
694
+ msgid "Check the box to enable debugging output."
695
  msgstr ""
696
 
697
+ #: includes/forms/parent-child.php:141
698
+ msgid "Stylesheet handling"
699
  msgstr ""
700
 
701
+ #: includes/forms/parent-child.php:142
702
+ msgid "(click to view options)"
703
  msgstr ""
704
 
705
+ #: includes/forms/parent-child.php:144
706
  msgid ""
707
+ "This theme may not apply child theme styles correctly with the current "
708
+ "settings:"
709
  msgstr ""
710
 
711
+ #: includes/forms/parent-child.php:146
712
+ msgid "Don't show again."
713
  msgstr ""
714
 
715
+ #: includes/forms/parent-child.php:146
716
+ msgid "View options"
717
  msgstr ""
718
 
719
+ #: includes/forms/parent-child.php:149
720
+ msgid "Which option should I use?"
721
  msgstr ""
722
 
723
+ #: includes/forms/parent-child.php:154
724
+ msgid "None (handled by theme)"
725
  msgstr ""
726
 
727
+ #: includes/forms/parent-child.php:158
 
 
 
 
728
  msgid ""
729
+ "Select this option if all stylesheets are correctly enqueued for child "
730
+ "themes. If you find that styles are not being applied correctly, use a "
731
+ "different option."
732
  msgstr ""
733
 
734
+ #: includes/forms/parent-child.php:165
735
+ msgid "Enqueue parent stylesheet (default)"
736
  msgstr ""
737
 
738
+ #: includes/forms/parent-child.php:168
739
  msgid ""
740
+ "Select this option if the theme enqueues the active stylesheet but has no "
741
+ "special handling for child themes. Start with this option if unsure."
 
 
 
 
742
  msgstr ""
743
 
744
+ #: includes/forms/parent-child.php:175
745
+ msgid "Enqueue child stylesheet"
746
  msgstr ""
747
 
748
+ #: includes/forms/parent-child.php:178
749
  msgid ""
750
+ "Select this option if the theme enqueues the parent stylesheet but does not "
751
+ "enqueue the child stylesheet at all. This can happen if "
752
+ "<code>get_template()</code> or <code>get_template_directory_uri()</code> is "
753
+ "used to link the stylesheet."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
754
  msgstr ""
755
 
756
+ #: includes/forms/parent-child.php:181
757
+ msgid "Recommended for this theme:"
758
  msgstr ""
759
 
760
  #: includes/forms/parent-child.php:187
761
+ msgid "Enqueue both parent and child stylesheets"
 
 
 
 
 
 
762
  msgstr ""
763
 
764
+ #: includes/forms/parent-child.php:190
765
  msgid ""
766
+ "Select this option if stylesheet link tags are hard-coded into the header "
767
+ "template (common in older themes). This enables the child stylesheet to "
768
+ "override the parent stylesheet without using <code>@import</code>."
769
  msgstr ""
770
 
771
+ #: includes/forms/parent-child.php:197
772
+ msgid "<code>@import</code> parent stylesheet"
773
  msgstr ""
774
 
775
+ #: includes/forms/parent-child.php:200
776
  msgid ""
777
+ "This option imports the parent stylesheet from the child stylesheet. This "
778
+ "enables the child stylesheet to override the parent stylesheet, but using "
779
+ "<code>@import</code> is no longer recommended."
 
 
 
 
780
  msgstr ""
781
 
782
+ #: includes/forms/parent-child.php:205
783
+ msgid "Copy Parent Theme Menus, Widgets and other Customizer Options"
784
  msgstr ""
785
 
786
+ #: includes/forms/parent-child.php:214
787
+ msgid "This will overwrite child theme options you may have already set."
 
 
 
788
  msgstr ""
789
 
790
+ #: includes/forms/parent-child.php:220
791
+ msgid "Backup current stylesheet"
792
  msgstr ""
793
 
794
+ #: includes/forms/parent-child.php:229
795
  msgid ""
796
+ "This creates a copy of the current stylesheet before applying changes. You "
797
+ "can remove old backup files using the Files tab."
 
 
 
 
 
 
 
 
798
  msgstr ""
799
 
800
  #: includes/forms/parent-child.php:234
801
+ msgid "Reset/Restore from backup"
802
  msgstr ""
803
 
804
+ #: includes/forms/parent-child.php:240
805
+ msgid "Leave unchanged"
 
 
 
 
806
  msgstr ""
807
 
808
+ #: includes/forms/parent-child.php:246
809
+ msgid "Reset all"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
810
  msgstr ""
811
 
812
+ #: includes/forms/parent-child.php:266
813
+ msgid "Parse additional stylesheets"
814
  msgstr ""
815
 
816
+ #: includes/forms/parent-child.php:290
817
+ msgid "Please read before you click:"
 
 
818
  msgstr ""
819
 
820
+ #: includes/forms/parent-child.php:291
821
  msgid ""
822
+ "This plugin makes significant modifications to your child theme, to include "
823
+ "changing CSS, removing comments and adding php functions."
 
 
 
 
 
 
 
 
 
824
  msgstr ""
825
 
826
+ #: includes/forms/parent-child.php:292
827
+ msgid "If you are using an existing Child Theme,"
828
  msgstr ""
829
 
830
+ #: includes/forms/parent-child.php:292
831
+ msgid "please consider using the Duplicate Child Theme option"
832
  msgstr ""
833
 
834
+ #: includes/forms/parent-child.php:292
835
+ msgid "before proceeding."
836
  msgstr ""
837
 
838
+ #: includes/forms/parent-child.php:298
839
+ msgid "Generate/Rebuild Child Theme Files"
 
 
 
840
  msgstr ""
841
 
842
+ #: includes/forms/query-selector.php:13
843
+ msgid "Query"
844
  msgstr ""
845
 
846
+ #: includes/forms/query-selector.php:24
 
 
 
 
847
  msgid "Selector"
848
  msgstr ""
849
 
850
+ #: includes/forms/query-selector.php:37 includes/forms/rule-value.php:29
851
  msgid "Sample"
852
  msgstr ""
853
 
854
+ #: includes/forms/query-selector.php:45
855
  msgid "Save Child Values"
856
  msgstr ""
857
 
858
+ #: includes/forms/query-selector.php:46
859
  msgid "Delete Child Values"
860
  msgstr ""
861
 
862
+ #: includes/forms/query-selector.php:53 includes/forms/rule-value.php:13
863
  msgid "Property"
864
  msgstr ""
865
 
866
+ #: includes/forms/query-selector.php:56
867
+ msgid "Parent Value"
868
  msgstr ""
869
 
870
+ #: includes/forms/query-selector.php:59
871
  msgid "Child Value"
872
  msgstr ""
873
 
874
+ #: includes/forms/query-selector.php:65
875
  msgid "New Property"
876
  msgstr ""
877
 
878
+ #: includes/forms/query-selector.php:75
879
  msgid "Order"
880
  msgstr ""
881
 
882
+ #: includes/forms/query-selector.php:84
883
  msgid "Copy Selector"
884
  msgstr ""
885
 
886
+ #: includes/forms/query-selector.php:86 includes/forms/webfonts.php:15
887
  msgid "Save"
888
  msgstr ""
889
 
890
+ #: includes/forms/query-selector.php:89
891
  msgid "Raw CSS"
892
  msgstr ""
893
 
894
+ #: includes/forms/query-selector.php:91
895
  msgid "Use to enter shorthand CSS or new @media queries and selectors."
896
  msgstr ""
897
 
898
+ #: includes/forms/query-selector.php:91
899
  msgid ""
900
  "Values entered here are merged into existing child styles or added to the "
901
  "child stylesheet if they do not exist in the parent."
917
  msgid "Lilaea Media - Responsive Tools for a Mobile World"
918
  msgstr ""
919
 
920
+ #: includes/forms/rule-value.php:26
 
 
 
 
 
 
 
 
921
  msgid "Value"
922
  msgstr ""
923
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
924
  #: includes/forms/tabs.php:11
925
+ msgid "Parent/Child"
926
  msgstr ""
927
 
928
+ #: includes/forms/tabs.php:16
929
+ msgid "Query/Selector"
930
  msgstr ""
931
 
932
+ #: includes/forms/tabs.php:19
933
+ msgid "Property/Value"
934
  msgstr ""
935
 
936
  #: includes/forms/tabs.php:22
937
  msgid "Web Fonts"
938
  msgstr ""
939
 
940
+ #: includes/forms/tabs.php:25
941
+ msgid "Child CSS"
942
  msgstr ""
943
 
944
+ #: includes/forms/tabs.php:28
945
+ msgid "Parent CSS"
946
  msgstr ""
947
 
948
+ #: includes/forms/tabs.php:34
949
  msgid "Files"
950
  msgstr ""
951
 
981
  "strong>"
982
  msgstr ""
983
 
 
 
 
 
984
  #. Plugin URI of the plugin/theme
985
  msgid "http://www.childthemeconfigurator.com"
986
  msgstr ""
987
 
988
  #. Description of the plugin/theme
989
  msgid ""
990
+ "Create child themes and customize styles, templates and functions. Enqueues "
991
+ "stylesheets and web fonts. Handles rgba, vendor-prefixes and more."
992
  msgstr ""
993
 
994
  #. Author of the plugin/theme
lang/chld_thm_cfg-sr_RS.mo ADDED
Binary file
lang/chld_thm_cfg-sr_RS.po ADDED
@@ -0,0 +1,964 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2015 Child Theme Configurator
2
+ # This file is distributed under the same license as the Child Theme Configurator package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Child Theme Configurator 1.7.0\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/child-theme-configurator\n"
7
+ "POT-Creation-Date: 2015-02-20 02:29:04+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2015-03-03 11:16+0100\n"
12
+ "Last-Translator: \n"
13
+ "Language-Team: \n"
14
+ "X-Generator: Poedit 1.7.4\n"
15
+ "Language: sr_RS\n"
16
+
17
+ #. Plugin Name of the plugin/theme
18
+ #: child-theme-configurator.php:76 child-theme-configurator.php:86
19
+ #: includes/forms/main.php:23
20
+ msgid "Child Theme Configurator"
21
+ msgstr "Child Theme Configurator"
22
+
23
+ #: child-theme-configurator.php:77 child-theme-configurator.php:87
24
+ #: child-theme-configurator.php:97
25
+ msgid "Child Themes"
26
+ msgstr "Podređene teme"
27
+
28
+ #: child-theme-configurator.php:112
29
+ msgid "Child Theme Configurator requires WordPress version %s or later."
30
+ msgstr "Child Theme Configurator zahteva WordPress verziju %s ili noviju"
31
+
32
+ #: includes/class-ctc-ui.php:143
33
+ msgid "Child Theme files modified successfully."
34
+ msgstr "Podređena tema uspešno izmenjena."
35
+
36
+ #: includes/class-ctc-ui.php:146
37
+ msgid ""
38
+ "Child Theme <strong>%s</strong> has been generated successfully.\n"
39
+ " "
40
+ msgstr "Podređena tema <strong>%s</strong> uspešno generisana.\n"
41
+
42
+ #: includes/class-ctc-ui.php:149
43
+ msgid "IMPORTANT:"
44
+ msgstr "VAŽNO:"
45
+
46
+ #: includes/class-ctc-ui.php:151 includes/forms/themepreview.php:20
47
+ msgid "Go to Themes"
48
+ msgstr "Idi na teme"
49
+
50
+ #: includes/class-ctc-ui.php:151
51
+ msgid "Network enable"
52
+ msgstr "Aktiviraj mrežu"
53
+
54
+ #: includes/class-ctc-ui.php:151
55
+ msgid "your child theme."
56
+ msgstr "vaša podređena tema."
57
+
58
+ #: includes/class-ctc-ui.php:153 includes/forms/themepreview.php:18
59
+ msgid "Live Preview"
60
+ msgstr "Live pregled"
61
+
62
+ #: includes/class-ctc-ui.php:153
63
+ msgid "Test your child theme"
64
+ msgstr "Testirajte svoju podređenu temu"
65
+
66
+ #: includes/class-ctc-ui.php:153
67
+ msgid "before activating."
68
+ msgstr "pre nego što je aktivirate."
69
+
70
+ #: includes/class-ctc.php:143
71
+ msgid "URL/None"
72
+ msgstr "URL/Nijedan"
73
+
74
+ #: includes/class-ctc.php:144
75
+ msgid "Origin"
76
+ msgstr "Poreklo"
77
+
78
+ #: includes/class-ctc.php:145
79
+ msgid "Color 1"
80
+ msgstr "Boja 1"
81
+
82
+ #: includes/class-ctc.php:146
83
+ msgid "Color 2"
84
+ msgstr "Boja 2"
85
+
86
+ #: includes/class-ctc.php:147
87
+ msgid "Width/None"
88
+ msgstr "Širina/Nijedna"
89
+
90
+ #: includes/class-ctc.php:148
91
+ msgid "Style"
92
+ msgstr "Stil"
93
+
94
+ #: includes/class-ctc.php:149
95
+ msgid "Color"
96
+ msgstr "Boja"
97
+
98
+ #: includes/class-ctc.php:151
99
+ msgid "Are you sure? This will replace your current settings."
100
+ msgstr "Jeste li sigurni? Ovim ćete zameniti svoje trenutne postavke."
101
+
102
+ #: includes/class-ctc.php:152
103
+ msgid "<span style=\"font-size:10px\">!</span>"
104
+ msgstr "<span style=\"font-size:10px\">!</span>"
105
+
106
+ #: includes/class-ctc.php:153 includes/forms/rule-value.php:32
107
+ msgid "Selectors"
108
+ msgstr "Selektori"
109
+
110
+ #: includes/class-ctc.php:154
111
+ msgid "Close"
112
+ msgstr "Zatvori"
113
+
114
+ #: includes/class-ctc.php:155
115
+ msgid "Edit"
116
+ msgstr "Uredi"
117
+
118
+ #: includes/class-ctc.php:156
119
+ msgid "Cancel"
120
+ msgstr "Otkaži"
121
+
122
+ #: includes/class-ctc.php:157
123
+ msgid "Rename"
124
+ msgstr "Promeni naziv"
125
+
126
+ #: includes/class-ctc.php:158
127
+ msgid "The stylesheet cannot be displayed."
128
+ msgstr "Datoteka sa stilovima ne može biti prikazana."
129
+
130
+ #: includes/class-ctc.php:159
131
+ msgid "(Child Only)"
132
+ msgstr "(Samo podređena)"
133
+
134
+ #: includes/class-ctc.php:160
135
+ msgid "Please enter a valid Child Theme."
136
+ msgstr "Unesite važeću podređenu temu."
137
+
138
+ #: includes/class-ctc.php:161
139
+ msgid "Please enter a valid Child Theme name."
140
+ msgstr "Unesite naziv važeće podređene teme"
141
+
142
+ #: includes/class-ctc.php:162
143
+ msgid "<strong>%s</strong> exists. Please enter a different Child Theme"
144
+ msgstr "<strong>%s</strong> već postoji. Unesite drugačiju podređenu temu. "
145
+
146
+ #: includes/class-ctc.php:163
147
+ msgid "The page could not be loaded correctly so some controls have been disabled."
148
+ msgstr "Stranica se nije pravilno učitala, tako da su neke kontrole deaktivirane."
149
+
150
+ #: includes/class-ctc.php:165
151
+ msgid "Conflicting jQuery libraries were loaded by another plugin:"
152
+ msgstr "Drugi plugin je učitao konfliktne jQuery biblioteke:"
153
+
154
+ #: includes/class-ctc.php:167
155
+ msgid "Deactivating other plugins may resolve this issue."
156
+ msgstr "Deaktiviranjem drugih plugin-a možete rešiti ovaj problem."
157
+
158
+ #: includes/class-ctc.php:168
159
+ msgid "%sWhy am I seeing this?%s"
160
+ msgstr "%sZašto vidim ovu poruku?%s"
161
+
162
+ #: includes/class-ctc.php:385
163
+ msgid "Zip file creation failed."
164
+ msgstr "Neuspelo kreiranje zip datoteke."
165
+
166
+ #: includes/class-ctc.php:421
167
+ msgid "The Functions file is required and cannot be deleted."
168
+ msgstr "Datoteka ‘Funkcije’ je obavezna i ne može se obrisati. "
169
+
170
+ #: includes/class-ctc.php:502
171
+ msgid "You do not have permission to configure child themes."
172
+ msgstr "Nemate dozvole da konfigurišete podređene teme."
173
+
174
+ #: includes/class-ctc.php:549
175
+ msgid "%s does not exist. Please select a valid Parent Theme."
176
+ msgstr "%s ne postoji. Odaberite važeću nadređenu temu."
177
+
178
+ #: includes/class-ctc.php:553
179
+ msgid "Please select a valid Parent Theme."
180
+ msgstr "Odaberite važeću nadređenu temu."
181
+
182
+ #: includes/class-ctc.php:556
183
+ msgid "Please enter a valid Child Theme directory."
184
+ msgstr "Unesite važeći direktorijum za podređenu temu."
185
+
186
+ #: includes/class-ctc.php:564
187
+ msgid "Please enter a valid Child Theme template name."
188
+ msgstr "Unesite važeći naziv šablona podređene teme."
189
+
190
+ #: includes/class-ctc.php:569
191
+ msgid "<strong>%s</strong> exists. Please enter a different Child Theme template name."
192
+ msgstr "<strong>%s</strong> već postoji. Unesite drugi naziv šablona podređene teme."
193
+
194
+ #: includes/class-ctc.php:575
195
+ msgid "Your theme directories are not writable."
196
+ msgstr "Direktorijumi vaše teme nisu raspoloživi za pisanje. "
197
+
198
+ #: includes/class-ctc.php:635
199
+ msgid "Your stylesheet is not writable."
200
+ msgstr "Vaša datoteka sa stilovima nije raspoloživa za pisanje."
201
+
202
+ #: includes/class-ctc.php:877
203
+ msgid ""
204
+ "A closing PHP tag was detected in Child theme functions file so \"Parent Stylesheet "
205
+ "Handling\" option was not configured. Closing PHP at the end of the file is discouraged "
206
+ "as it can cause premature HTTP headers. Please edit <code>functions.php</code> to "
207
+ "remove the final <code>?&gt;</code> tag and click \"Generate/Rebuild Child Theme Files"
208
+ "\" again."
209
+ msgstr ""
210
+ "Završna PHP oznaka otkrivena je u datoteci sa funkcijama podređene teme pa opcija "
211
+ "\"Rukovanje nadređenom datotekom sa stilovima\" nije konfigurisana. Zatvaranje PHP-a na "
212
+ "kraju datoteke ne preporučuje se jer može dovesti do preuranjenih HTTP zaglavlja. "
213
+ "Uredite <code>functions.php</code> da ukloni završnu <code>?&gt;</code> oznaku i "
214
+ "kliknite na \"Generiši/Ponovo izgradi datoteke sa podređenim temama\"."
215
+
216
+ #: includes/class-ctc.php:964
217
+ msgid "Could not delete file."
218
+ msgstr "Datoteka nije obrisana."
219
+
220
+ #: includes/class-ctc.php:1040
221
+ msgid "Could not set write permissions."
222
+ msgstr "Dozvole za pisanje nisu podešene."
223
+
224
+ #: includes/class-ctc.php:1114
225
+ msgid "There were errors while resetting permissions."
226
+ msgstr "Došlo je do grešaka prilikom podešavanja dozvola."
227
+
228
+ #: includes/class-ctc.php:1156
229
+ msgid "Could not upload file."
230
+ msgstr "Datoteka nije otpremljena."
231
+
232
+ #: includes/class-ctc.php:1239
233
+ msgid ""
234
+ "Child Theme Configurator is unable to write to the stylesheet. This can be resolved "
235
+ "using one of the following options:<ol>"
236
+ msgstr ""
237
+ "Child Theme Configurator ne može da piše u datoteku sa stilovima. To se može rešiti uz "
238
+ "pomoć jedne od sledećih opcija: <ol>"
239
+
240
+ #: includes/class-ctc.php:1242
241
+ msgid ""
242
+ "<li>Temporarily make the stylesheet writable by clicking the button below. You should "
243
+ "change this back when you are finished editing for security by clicking \"Make read-only"
244
+ "\" under the \"Files\" tab.</li>"
245
+ msgstr ""
246
+ "<li>Trenutno učinite datoteku sa stilovima raspoloživom za pisanje tako što ćete "
247
+ "kliknuti na taster ispod. Kad završite uređivanje, trebalo bi da vratite opciju na "
248
+ "prethodno stanje iz bezbednosnih razloga, tako što ćete kliknuti na \"Raspoloživo samo "
249
+ "za čitanje\" na tabulatoru \"Datoteke\".</li>"
250
+
251
+ #: includes/class-ctc.php:1245
252
+ msgid "Temporarily make stylesheet writable"
253
+ msgstr "Privremeno napravite datoteku sa stilovima raspoloživu za pisanje."
254
+
255
+ #: includes/class-ctc.php:1246
256
+ msgid ""
257
+ "<li><a target=\"_blank\" href=\"http://codex.wordpress.org/Editing_wp-config."
258
+ "php#WordPress_Upgrade_Constants\" title=\"Editin wp-config.php\">Add your FTP/SSH "
259
+ "credentials to the WordPress config file</a>.</li>"
260
+ msgstr ""
261
+ "<li><a target=\"_blank\" href=\"http://codex.wordpress.org/Editing_wp-config."
262
+ "php#WordPress_Upgrade_Constants\" title=\"Editing wp-config.php\">Dodajte svoje FTP/SSH "
263
+ "akreditive WordPress datoteci za konfiguraciju</a>.</li>"
264
+
265
+ #: includes/class-ctc.php:1248
266
+ msgid ""
267
+ "<li><a target=\"_blank\" href=\"http://technet.microsoft.com/en-us/library/cc771170\" "
268
+ "title=\"Setting Application Pool Identity\">Assign WordPress to an application pool "
269
+ "that has write permissions</a> (Windows IIS systems).</li>"
270
+ msgstr ""
271
+ "<li><a target=\"_blank\" href=\"http://technet.microsoft.com/en-us/library/cc771170\" "
272
+ "title=\"Podešavanje identiteta skupa aplikacija\">Dodelite WordPress skupu aplikacija "
273
+ "koji ima dozvole za pisanje</a> (Windows IIS systems).</li>"
274
+
275
+ #: includes/class-ctc.php:1249
276
+ msgid ""
277
+ "<li><a target=\"_blank\" href=\"http://codex.wordpress.org/Changing_File_Permissions\" "
278
+ "title=\"Changing File Permissions\">Set the stylesheet write permissions on the server "
279
+ "manually</a> (not recommended).</li>"
280
+ msgstr ""
281
+ "<li><a target=\"_blank\" href=\"http://codex.wordpress.org/Changing_File_Permissions\" "
282
+ "title=\"Promena dozvola datoteke\">Podesite ručno dozvole na serveru </a> (ne "
283
+ "preporučuje se).</li>"
284
+
285
+ #: includes/class-ctc.php:1251
286
+ msgid "<li>Run PHP under Apache with suEXEC (contact your web host).</li>"
287
+ msgstr "<li>Pokreni PHP pod Apache-om uz suEXEC (obratite se svom web hostu).</li>"
288
+
289
+ #: includes/class-ctc.php:1261
290
+ msgid ""
291
+ "This Child Theme is not owned by your website account. It may have been created by a "
292
+ "prior version of this plugin or by another program. Moving forward, it must be owned by "
293
+ "your website account to make changes. Child Theme Configurator will attempt to correct "
294
+ "this when you click the button below."
295
+ msgstr ""
296
+ "Nalog vašeg web site-a ne poseduje ovu podređenu temu. Možda je kreirana od strane "
297
+ "prethodne verzije ovog plugin-a ili od strane drugog programa. Da biste pravili izmene, "
298
+ "mora biti u vlasništvu naloga vašeg web site-a. Child Theme Configurator će pokušati da "
299
+ "to ispravi kad kliknete na donji taster."
300
+
301
+ #: includes/class-ctc.php:1264
302
+ msgid "Correct Child Theme Permissions"
303
+ msgstr "Dozvole za ispravljanje podređene teme"
304
+
305
+ #: includes/class-ctc.php:1271
306
+ msgid ""
307
+ "Child Theme Configurator needs to update its interal data. Please set your preferences "
308
+ "below and click \"Generate Child Theme Files\" to update your configuration."
309
+ msgstr ""
310
+ "Child Theme Configurator treba da ažurira svoje interne podatke. Podesite "
311
+ "karakteristike i kliknite na \"Generiši datoteke podređene teme\" kako biste ažurirali "
312
+ "konfiguraciju."
313
+
314
+ #: includes/class-ctc.php:1277
315
+ msgid ""
316
+ "<strong>However, some styles could not be parsed due to memory limits.</strong> Try "
317
+ "deselecting \"Additional Stylesheets\" below and click \"Generate/Rebuild Child Theme "
318
+ "Files\". %sWhy am I seeing this?%s"
319
+ msgstr ""
320
+ "<strong>Neki stilovi ne mogu biti parsirani zbog ograničenja memorije.</strong> "
321
+ "Pokušajte da poništite štikliranje opcije \"Dodatne datoteke sa stilovima\" i kliknite "
322
+ "na \"Generiši/Ponovo izgradi datoteke sa podređenimm temama\". %Zašto vidim ovu poruku?"
323
+ "% "
324
+
325
+ #: includes/class-ctc.php:1286
326
+ msgid ""
327
+ "Child Theme Configurator did not detect any configuration data because a previously "
328
+ "configured Child Theme has been removed. Please set your preferences below and click "
329
+ "\"Generate Child Theme Files\"."
330
+ msgstr ""
331
+ "Child Theme Configurator nije otkrio podatke o konfiguraciji jer je prethodno "
332
+ "konfigurisana podređena tema uklonjena. Podesite karakteristike i kliknite na "
333
+ "\"Generiši datoteke podređene teme\"."
334
+
335
+ #: includes/forms/addl_css.php:7
336
+ msgid "Parse additional stylesheets:"
337
+ msgstr "Parsiraj dodatne datoteke sa stilovima:"
338
+
339
+ #: includes/forms/addl_css.php:11 includes/forms/parent-child.php:226
340
+ msgid ""
341
+ "Stylesheets that are currently being loaded by the parent theme are automatically "
342
+ "selected below (except for Bootstrap stylesheets which add a large amount data to the "
343
+ "configuration). To further reduce overhead, select only the additional stylesheets you "
344
+ "wish to customize."
345
+ msgstr ""
346
+ "Datoteke sa stilovima koje trenutno učitava nadređena tema automatski se biraju dole "
347
+ "(osim Bootstrap datoteke sa stilovima koja dodaje veliku količinu podataka "
348
+ "konfiguraciji). Da biste redukovali opterećenje, odaberite samo dodatne datoteke sa "
349
+ "stilovima koje želite da prilagodite."
350
+
351
+ #: includes/forms/addl_panels.php:8 includes/forms/addl_panels.php:9
352
+ msgid "Learn more about IntelliWidget"
353
+ msgstr "Saznajte više o IntelliWidget-u"
354
+
355
+ #: includes/forms/addl_panels.php:9
356
+ msgid ""
357
+ "IntelliWidget is a versatile widget manager that does the work of multiple plugins by "
358
+ "combining custom page menus, featured posts, sliders and other dynamic content features "
359
+ "into a single plugin that can display on a per-page or site-wide basis."
360
+ msgstr ""
361
+ "IntelliWidget je svestran upravljač widget-ima koji radi sa mnogim dodacima tako što "
362
+ "kombinuje prilagođene stranice menija, uobličene postove, slajdere i druge "
363
+ "funkcionalnosti dinamičkog sadržaja u jednom plugin-u koji se može prikazati na "
364
+ "stranici ili na site-u. "
365
+
366
+ #: includes/forms/addl_panels.php:10 includes/forms/addl_panels.php:13
367
+ msgid "Learn more"
368
+ msgstr "Saznajte više"
369
+
370
+ #: includes/forms/addl_panels.php:11 includes/forms/addl_panels.php:12
371
+ msgid "Learn more about IW Responsive Menu"
372
+ msgstr "Saznajte više o IW responzivnom meniju"
373
+
374
+ #: includes/forms/addl_panels.php:12
375
+ msgid ""
376
+ "IntelliWidget Responsive Menu lets you break free from your theme’s built-in responsive "
377
+ "menu options and gives you complete control over the user experience."
378
+ msgstr ""
379
+ "IntelliWidget responzivni meni omogućava vam da se oslobodite ugrađenih opcija "
380
+ "responzivnog menija i daje vam potpunu kontrolu korisničkog iskustva."
381
+
382
+ #: includes/forms/addl_panels.php:16 includes/help/help_en_US.php:211
383
+ msgid "Learn more about CTC Pro"
384
+ msgstr "Saznajte više o CTC Pro"
385
+
386
+ #: includes/forms/addl_panels.php:17
387
+ msgid "Customizing WordPress just got even easier."
388
+ msgstr "Prilagođavanje WordPress-a upravo je postalo još lakše!"
389
+
390
+ #: includes/forms/addl_panels.php:18
391
+ msgid ""
392
+ "Thousands of users have already seen the benefits of using Child Theme Configurator. If "
393
+ "you spend any amount of time customizing WordPress, CTC Pro will help maximize your "
394
+ "productivity."
395
+ msgstr ""
396
+ "Hiljade korisnika već su uvidele prednosti upotrebe dodatka Child Theme Configurator. "
397
+ "Ako trošite vreme na prilagođavanje WordPress-a, CTC Pro pomoći će vam da povećate "
398
+ "produktivnost."
399
+
400
+ #: includes/forms/addl_panels.php:19
401
+ msgid "Designed by Developers Who Use It Every Day."
402
+ msgstr "Osmislili su ga programeri koji ga svakodnevno koriste."
403
+
404
+ #: includes/forms/addl_panels.php:20
405
+ msgid ""
406
+ "We've packed in more features to make design work quicker and easier with <strong>Child "
407
+ "Theme Configurator Pro.</strong>"
408
+ msgstr ""
409
+ "Spakovali smo više funkcioonalnosti kako bi dizajn radio brže i lakše uz <strong>Child "
410
+ "Theme Configurator Pro.</strong>"
411
+
412
+ #: includes/forms/addl_panels.php:22
413
+ msgid "Customize Plugin Stylesheets"
414
+ msgstr "Datoteke sa stilovima za prilagođavanje plugin-a "
415
+
416
+ #: includes/forms/addl_panels.php:23
417
+ msgid ""
418
+ "Apply the power of CTC's top-rated interface to your site's plugin styles. All new "
419
+ "design makes it much easier to get the results you want."
420
+ msgstr ""
421
+ "Primenite moć najbolje ocenjenih CTC interfejsa na plugin stilove svog site-a. "
422
+ "Zahvaljujući novom dizajnu, biće vam mnogo lakše da dobijete rezultate koje želite. "
423
+
424
+ #: includes/forms/addl_panels.php:24
425
+ msgid "Quick Preview"
426
+ msgstr "Brzi pregled"
427
+
428
+ #: includes/forms/addl_panels.php:24
429
+ msgid "Test your child theme with a single click."
430
+ msgstr "Testirajte svoju podređenu temu jednim klikom."
431
+
432
+ #: includes/forms/addl_panels.php:25
433
+ msgid "Find related styles"
434
+ msgstr "Nađite povezane stilove"
435
+
436
+ #: includes/forms/addl_panels.php:25
437
+ msgid ""
438
+ "Use the \"All Styles\" panel to edit groups of selectors from a single combined list."
439
+ msgstr ""
440
+ "Koristite panel \"Svi stilovi\" da biste uredili grupe selektora iz pojedinačne "
441
+ "kombinovane liste. "
442
+
443
+ #: includes/forms/addl_panels.php:26
444
+ msgid "Find styles by Nav Menu"
445
+ msgstr "Nađi stilove u navigacionom meniju"
446
+
447
+ #: includes/forms/addl_panels.php:26
448
+ msgid "Tweak menus quickly and easily."
449
+ msgstr "Uzima delove menija lako i brzo."
450
+
451
+ #: includes/forms/addl_panels.php:27
452
+ msgid "Most recent edits"
453
+ msgstr "Najnovije ispravke"
454
+
455
+ #: includes/forms/addl_panels.php:27
456
+ msgid "Return to recently edited selectors from a toggleable sidebar."
457
+ msgstr "Vratite se na nedavno uređene selektore sa podesive bočne trake. "
458
+
459
+ #: includes/forms/addl_panels.php:28
460
+ msgid "Free Upgrades"
461
+ msgstr "Besplatna nadgradnja"
462
+
463
+ #: includes/forms/addl_panels.php:29
464
+ msgid "Your Update Key gives you access to new Pro features as soon as they are released."
465
+ msgstr ""
466
+ "Vaš novi ključ za ažuriranje omogućava vam pristup novim profesionalnim "
467
+ "funkcionalnostima čim se objave."
468
+
469
+ #: includes/forms/addl_panels.php:30
470
+ msgid "Top-rated Online Support"
471
+ msgstr "Najbolje ocenjena online podrška"
472
+
473
+ #: includes/forms/addl_panels.php:31
474
+ msgid "Online Documentation"
475
+ msgstr "Online dokumentacija"
476
+
477
+ #: includes/forms/addl_panels.php:32
478
+ msgid "Tutorial Videos"
479
+ msgstr "Video tutorijali"
480
+
481
+ #: includes/forms/addl_panels.php:34
482
+ msgid "For a limited time save over 15% off Child Theme Configurator Pro."
483
+ msgstr ""
484
+ "U ograničenom vremenskom periodu, uštedite više od 15% za Child Theme Configurator Pro."
485
+
486
+ #: includes/forms/addl_panels.php:35
487
+ msgid "Upgrade Now"
488
+ msgstr "Nadgradi sada"
489
+
490
+ #: includes/forms/addl_panels.php:35
491
+ msgid "Buy Now - Only $14.95 USD*"
492
+ msgstr "Kupite sada - samo $14.95 USD*"
493
+
494
+ #: includes/forms/addl_panels.php:35
495
+ msgid "*Prices subject to change."
496
+ msgstr "*Cene su podložne promenama."
497
+
498
+ #: includes/forms/addl_tabs.php:8
499
+ msgid "Get CTC Pro"
500
+ msgstr "Obezbedite CTC Pro"
501
+
502
+ #: includes/forms/at-import.php:15 includes/forms/query-selector.php:85
503
+ msgid "Save"
504
+ msgstr "Sačuvaj"
505
+
506
+ #: includes/forms/at-import.php:18
507
+ msgid "@import Statements"
508
+ msgstr "@uvezi izjave"
509
+
510
+ #: includes/forms/backup.php:8
511
+ msgid "Backup"
512
+ msgstr "Backup"
513
+
514
+ #: includes/forms/backups.php:10 includes/forms/parent-child.php:209
515
+ msgid "Restore backup from"
516
+ msgstr "Obnovi backup iz"
517
+
518
+ #: includes/forms/fileform.php:8
519
+ msgid "The Theme editor has been disabled. Template files must be edited offline."
520
+ msgstr "Uređivač teme je deaktiviran. Datoteke šablona moraju se uređivati offline."
521
+
522
+ #: includes/forms/fileform.php:12
523
+ msgid "Click here to edit template files using the Theme Editor"
524
+ msgstr "Kliknite ovde da biste uredili datoteke šablona uz pomoć uređivača teme"
525
+
526
+ #: includes/forms/fileform.php:23
527
+ msgid "Parent Templates"
528
+ msgstr "Nadređeni šabloni"
529
+
530
+ #: includes/forms/fileform.php:23
531
+ msgid "Child Theme Files"
532
+ msgstr "Datoteke podređene teme"
533
+
534
+ #: includes/forms/fileform.php:28
535
+ msgid "Copy PHP template files from the parent theme by selecting them here."
536
+ msgstr "Kopirajte PHP datoteke šablona iz nadređene teme tako što ćete ih odabrati ovde. "
537
+
538
+ #: includes/forms/fileform.php:31
539
+ msgid ""
540
+ "CAUTION: If your child theme is active, the child theme version of the file will be "
541
+ "used instead of the parent immediately after it is copied."
542
+ msgstr ""
543
+ "PAŽNJA: Ako je vaša podređena tema aktivna, verzija podređene teme datoteke koristiće "
544
+ "se umesto nadređene odmah nakon kopiranja."
545
+
546
+ #: includes/forms/fileform.php:33
547
+ msgid "The %s file is generated separately and cannot be copied here."
548
+ msgstr "Datoteka %s je posebno generisana i ne može se kopirati ovde. "
549
+
550
+ #: includes/forms/fileform.php:43
551
+ msgid "Delete child theme templates by selecting them here."
552
+ msgstr "Obrišite šablone podređene teme tako što ćete ih odabrati ovde."
553
+
554
+ #: includes/forms/fileform.php:44
555
+ msgid ""
556
+ "Delete child theme templates or make them writable by selecting them here. Writable "
557
+ "files are displayed in <span style=\"color:red\">red</span>."
558
+ msgstr ""
559
+ "Obrišite šablone podređene teme ili ih podesite za pisanje tako što ćete ih odabrati "
560
+ "ovde. Datoteke za pisanje prikazane su <span style=\"color:red\">crvenom bojom</span>."
561
+
562
+ #: includes/forms/fileform.php:57
563
+ msgid "Make Selected Writable"
564
+ msgstr "Neka odabrano bude raspoloživo za pisanje"
565
+
566
+ #: includes/forms/fileform.php:61
567
+ msgid "Copy Selected to Child Theme"
568
+ msgstr "Kopiraj odabrano u podređenu temu"
569
+
570
+ #: includes/forms/fileform.php:61 includes/forms/images.php:21
571
+ msgid "Delete Selected"
572
+ msgstr "Obriši odabrano"
573
+
574
+ #: includes/forms/files.php:15
575
+ msgid "Upload New Child Theme Image"
576
+ msgstr "Otpremi novu sliku podređene teme"
577
+
578
+ #: includes/forms/files.php:18
579
+ msgid ""
580
+ "Theme images reside under the <code>images</code> directory in your child theme and are "
581
+ "meant for stylesheet use only. Use the Media Library for content images."
582
+ msgstr ""
583
+ "Slike teme nalaze se u direktorijumu <code>slike</code> u vašoj podređenoj temi i "
584
+ "napravljene su samo za upotrebu datoteke sa stilovima. Koristite biblioteku za slike "
585
+ "sadržaja."
586
+
587
+ #: includes/forms/files.php:25 includes/forms/files.php:51
588
+ msgid "Upload"
589
+ msgstr "Otpremi"
590
+
591
+ #: includes/forms/files.php:32
592
+ msgid "Child Theme Screenshot"
593
+ msgstr "Snimak ekrana podređene teme"
594
+
595
+ #: includes/forms/files.php:41
596
+ msgid "Upload New Screenshot"
597
+ msgstr "Otpremi novi snimak ekrana"
598
+
599
+ #: includes/forms/files.php:44
600
+ msgid ""
601
+ "The theme screenshot should be a 4:3 ratio (e.g., 880px x 660px) JPG, PNG or GIF. It "
602
+ "will be renamed <code>screenshot</code>."
603
+ msgstr ""
604
+ "Odnos teme i snimka ekrana treba da bude 4:3 (e.g., 880px x 660px) JPG, PNG or GIF. "
605
+ "Naziv će biti promenjen <code>slika ekrana</code>."
606
+
607
+ #: includes/forms/files.php:59
608
+ msgid "Export Child Theme as Zip Archive"
609
+ msgstr "Izvezi podređenu temu kao zip arhivu"
610
+
611
+ #: includes/forms/files.php:64
612
+ msgid "Export"
613
+ msgstr "Izvezi"
614
+
615
+ #: includes/forms/files.php:73
616
+ msgid "Secure Child Theme"
617
+ msgstr "Obezbedi podređenu temu"
618
+
619
+ #: includes/forms/files.php:76
620
+ msgid "Attempt to reset child theme permissions to user ownership and read-only access."
621
+ msgstr ""
622
+ "Pokušaj da poništiš dozvole podređene teme u vlasništvu korisnika i pristup samo za "
623
+ "čitanje."
624
+
625
+ #: includes/forms/files.php:82
626
+ msgid "Make read-only"
627
+ msgstr "Neka bude samo za čitanje"
628
+
629
+ #: includes/forms/files.php:99
630
+ msgid "Debug"
631
+ msgstr "Otkloni greške"
632
+
633
+ #: includes/forms/files.php:102
634
+ msgid "Check the box to enable debugging output."
635
+ msgstr "Štiklirajte polje da biste aktivirali otklanjanje grešaka"
636
+
637
+ #: includes/forms/images.php:10
638
+ msgid "Child Theme Images"
639
+ msgstr "Slike podređene teme"
640
+
641
+ #: includes/forms/images.php:13
642
+ msgid "Delete child theme images by selecting them here."
643
+ msgstr "Obrišite slike podređene teme tako što ćete ih odabrati ovde."
644
+
645
+ #: includes/forms/main.php:23
646
+ msgid "version"
647
+ msgstr "verzija"
648
+
649
+ #: includes/forms/parent-child.php:17
650
+ msgid "Parent Theme"
651
+ msgstr "Nadređena tema"
652
+
653
+ #: includes/forms/parent-child.php:25
654
+ msgid "Child Theme"
655
+ msgstr "Podređena tema"
656
+
657
+ #: includes/forms/parent-child.php:27
658
+ msgid "(click to edit additional fields)"
659
+ msgstr "(kliknite da biste uredili dodatna polja)"
660
+
661
+ #: includes/forms/parent-child.php:34
662
+ msgid "Create New Child Theme"
663
+ msgstr "Kreiraj novu podređenu temu"
664
+
665
+ #: includes/forms/parent-child.php:43
666
+ msgid "Use Existing Child Theme"
667
+ msgstr "Koristi postojeću podređenu temu"
668
+
669
+ #: includes/forms/parent-child.php:48
670
+ msgid "Theme Slug"
671
+ msgstr "Slug teme"
672
+
673
+ #: includes/forms/parent-child.php:59
674
+ msgid "Child Theme Name"
675
+ msgstr "Naziv podređene teme"
676
+
677
+ #: includes/forms/parent-child.php:63
678
+ msgid "Theme Name"
679
+ msgstr "Naziv teme"
680
+
681
+ #: includes/forms/parent-child.php:66 includes/forms/parent-child.php:70
682
+ msgid "Theme Website"
683
+ msgstr "Tema web site-a"
684
+
685
+ #: includes/forms/parent-child.php:73 includes/forms/parent-child.php:77
686
+ msgid "Author"
687
+ msgstr "Autor"
688
+
689
+ #: includes/forms/parent-child.php:81 includes/forms/parent-child.php:85
690
+ msgid "Author Website"
691
+ msgstr "Autor web site-a"
692
+
693
+ #: includes/forms/parent-child.php:88
694
+ msgid "Theme Description"
695
+ msgstr "Opis teme"
696
+
697
+ #: includes/forms/parent-child.php:91
698
+ msgid "Description"
699
+ msgstr "Opis"
700
+
701
+ #: includes/forms/parent-child.php:94
702
+ msgid "Theme Tags"
703
+ msgstr "Oznake teme"
704
+
705
+ #: includes/forms/parent-child.php:97
706
+ msgid "Tags"
707
+ msgstr "Oznake"
708
+
709
+ #: includes/forms/parent-child.php:100 includes/forms/parent-child.php:104
710
+ msgid "Version"
711
+ msgstr "Verzija"
712
+
713
+ #: includes/forms/parent-child.php:110
714
+ msgid "Stylesheet handling"
715
+ msgstr "Upravljanje datotekama sa stilovima"
716
+
717
+ #: includes/forms/parent-child.php:113
718
+ msgid "(click to view options)"
719
+ msgstr "(kliknite da biste videli opcije)"
720
+
721
+ #: includes/forms/parent-child.php:121
722
+ msgid "Enqueue parent stylesheet (default)"
723
+ msgstr "Dodaj nadređenu datoteku sa stilovima (podrazumevano)"
724
+
725
+ #: includes/forms/parent-child.php:124
726
+ msgid ""
727
+ "Select this option if the parent theme enqueues the stylesheet but has no special "
728
+ "handling for child themes. Start with this option if unsure."
729
+ msgstr ""
730
+ "Odaberite ovu opciju ako je nadređena tema dodala datoteku sa stilovima, ali nema "
731
+ "poseban način upravljanja za podređene teme. Ako niste sigurni, počnite od ove opcije."
732
+
733
+ #: includes/forms/parent-child.php:127
734
+ msgid ""
735
+ "<strong>NOTE: This theme links the stylesheet in the header template and should use the "
736
+ "@import option to render correctly.</strong>"
737
+ msgstr ""
738
+ "<strong>NAPOMENA: Ova tema povezuje datoteku sa stilovima u zaglavlju šablona i treba "
739
+ "koristiti opciju @uvezi da bi se ispravno prikazala.</strong>"
740
+
741
+ #: includes/forms/parent-child.php:132
742
+ msgid "<code>@import</code> parent stylesheet"
743
+ msgstr "<code>@uvezi</code> nadređenu datoteku sa stilovima"
744
+
745
+ #: includes/forms/parent-child.php:135
746
+ msgid ""
747
+ "Select this option if the parent theme links the stylesheet in the header template. "
748
+ "Using <code>@import</code> is discouraged but necessary in this case unless you modify "
749
+ "the header template."
750
+ msgstr ""
751
+ "Odaberite ovu opciju ako nadređena tema povezuje datoteku sa stilovima u zaglavlju "
752
+ "šablona. Upotreba opcije <code>@uvezi</code>se ne preporučuje, ali u ovom slučaju je "
753
+ "neophodna, osim ako izmenite zaglavlje šablona. "
754
+
755
+ #: includes/forms/parent-child.php:142
756
+ msgid "Enqueue child stylesheet"
757
+ msgstr "Dodaj datoteku sa stilovima"
758
+
759
+ #: includes/forms/parent-child.php:145
760
+ msgid ""
761
+ "Select this option if the parent theme incorrectly loads the \"template\" stylesheet or "
762
+ "does not load the \"style.css\" file at all. This is unusual but occurs in some themes."
763
+ msgstr "Odaberite ovu opciju ako nadređena tema netačno učitava datoteku sa stilovima "
764
+
765
+ #: includes/forms/parent-child.php:152
766
+ msgid "None (handled by theme)"
767
+ msgstr "Nijedan (rukovodi tema)"
768
+
769
+ #: includes/forms/parent-child.php:156
770
+ msgid ""
771
+ "Select this option if all stylesheets are automatically loaded for child themes (e.g., "
772
+ "\"Responsive\" by CyberChimps)."
773
+ msgstr ""
774
+ "Odaberite ovu opciju ako se sve datoteke sa stilovima automatski učitavaju za podređene "
775
+ "teme (npr. \"Responsive\" čiji je autor CyberChimps)."
776
+
777
+ #: includes/forms/parent-child.php:161
778
+ msgid "Copy Parent Theme Menus, Widgets and other Options"
779
+ msgstr "Kopiraj meni nadređene teme, widget-e i druge opcije"
780
+
781
+ #: includes/forms/parent-child.php:168 includes/forms/parent-child.php:183
782
+ msgid "NOTE:"
783
+ msgstr "NAPOMENA:"
784
+
785
+ #: includes/forms/parent-child.php:170
786
+ msgid "This will overwrite child theme options you may have already set."
787
+ msgstr "Ovim ćete poništiti opcije podređene teme koje ste možda već podesili."
788
+
789
+ #: includes/forms/parent-child.php:176
790
+ msgid "Backup current stylesheet"
791
+ msgstr "Uradi backup za tekuću datoteku sa stilovima"
792
+
793
+ #: includes/forms/parent-child.php:185
794
+ msgid ""
795
+ "This creates a copy of the current stylesheet before applying changes. You can remove "
796
+ "old backup files using the Files tab."
797
+ msgstr ""
798
+ "Ovim se kreira kopija tekuće datoteke sa stilovima pre nego što se primene izmene. "
799
+ "Možete ukloniti stare datoteke za podršku uz pomoć tabulatora ‘Datoteke’. "
800
+
801
+ #: includes/forms/parent-child.php:190
802
+ msgid "Reset/Restore from backup"
803
+ msgstr "Poništi/Vrati iz backup-a"
804
+
805
+ #: includes/forms/parent-child.php:196
806
+ msgid "Leave unchanged"
807
+ msgstr "Ostavi nepromenjeno"
808
+
809
+ #: includes/forms/parent-child.php:202
810
+ msgid "Reset all"
811
+ msgstr "Poništi sve"
812
+
813
+ #: includes/forms/parent-child.php:222
814
+ msgid "Parse additional stylesheets"
815
+ msgstr "Parsiraj dodatne datoteke sa stilovima"
816
+
817
+ #: includes/forms/parent-child.php:245
818
+ msgid "Generate/Rebuild Child Theme Files"
819
+ msgstr "Generiši/Ponovo izgradi datoteke podređene teme"
820
+
821
+ #: includes/forms/query-selector.php:13
822
+ msgid "Query"
823
+ msgstr "Upit"
824
+
825
+ #: includes/forms/query-selector.php:24
826
+ msgid "Selector"
827
+ msgstr "Selektor"
828
+
829
+ #: includes/forms/query-selector.php:37 includes/forms/rule-value.php:29
830
+ msgid "Sample"
831
+ msgstr "Primer"
832
+
833
+ #: includes/forms/query-selector.php:45
834
+ msgid "Save Child Values"
835
+ msgstr "Sačuvaj podređene vrednosti"
836
+
837
+ #: includes/forms/query-selector.php:52 includes/forms/rule-value.php:13
838
+ msgid "Rule"
839
+ msgstr "Pravilo"
840
+
841
+ #: includes/forms/query-selector.php:55
842
+ msgid "Parent Value"
843
+ msgstr "Nadređena vrednost"
844
+
845
+ #: includes/forms/query-selector.php:58
846
+ msgid "Child Value"
847
+ msgstr "Podređena vrednost"
848
+
849
+ #: includes/forms/query-selector.php:64
850
+ msgid "New Rule"
851
+ msgstr "Novo pravilo"
852
+
853
+ #: includes/forms/query-selector.php:74
854
+ msgid "Order"
855
+ msgstr "Nalog"
856
+
857
+ #: includes/forms/query-selector.php:83
858
+ msgid "Copy Selector"
859
+ msgstr "Kopiraj selektor"
860
+
861
+ #: includes/forms/query-selector.php:88
862
+ msgid "Raw CSS"
863
+ msgstr "Neobrađeni CSS"
864
+
865
+ #: includes/forms/query-selector.php:90
866
+ msgid "Use to enter shorthand CSS or new @media queries and selectors."
867
+ msgstr "Koristite da biste uneli shorthand CSS ili nove @media upite i selektore."
868
+
869
+ #: includes/forms/query-selector.php:90
870
+ msgid ""
871
+ "Values entered here are merged into existing child styles or added to the child "
872
+ "stylesheet if they do not exist in the parent."
873
+ msgstr ""
874
+ "Ovde unete vrednosti spajaju se u postojeće podređene stilove ili se dodaju podređenoj "
875
+ "datoteci sa stilovima ako ne postoje u nadređenoj datoteci. "
876
+
877
+ #: includes/forms/related.php:1
878
+ msgid "New user?"
879
+ msgstr "Novi korisnik?"
880
+
881
+ #: includes/forms/related.php:1
882
+ msgid "Click help"
883
+ msgstr "Kliknite za pomoć"
884
+
885
+ #: includes/forms/related.php:1
886
+ msgid "Get CTC Pro and other tools"
887
+ msgstr "Obezbedite CTC Pro i druge alate"
888
+
889
+ #: includes/forms/related.php:1
890
+ msgid "Lilaea Media - Responsive Tools for a Mobile World"
891
+ msgstr "Lilaea Media - odgovarajući alati za svet mobilnih "
892
+
893
+ #: includes/forms/rule-value.php:26
894
+ msgid "Value"
895
+ msgstr "Vrednost"
896
+
897
+ #: includes/forms/tabs.php:11
898
+ msgid "Parent/Child"
899
+ msgstr "Nadređeni/Podređeni"
900
+
901
+ #: includes/forms/tabs.php:16
902
+ msgid "Query/Selector"
903
+ msgstr "Upit/Selektor"
904
+
905
+ #: includes/forms/tabs.php:19
906
+ msgid "Rule/Value"
907
+ msgstr "Pravilo/Vrednost"
908
+
909
+ #: includes/forms/tabs.php:22
910
+ msgid "@import"
911
+ msgstr "@uvezi"
912
+
913
+ #: includes/forms/tabs.php:25
914
+ msgid "Child CSS"
915
+ msgstr "Podređeni CSS"
916
+
917
+ #: includes/forms/tabs.php:28
918
+ msgid "Parent CSS"
919
+ msgstr "Nadređeni CSS"
920
+
921
+ #: includes/forms/tabs.php:34
922
+ msgid "Files"
923
+ msgstr "Datoteke"
924
+
925
+ #: includes/forms/themepreview.php:12
926
+ msgid "Version: "
927
+ msgstr "Verzija"
928
+
929
+ #: includes/forms/themepreview.php:14
930
+ msgid "By: "
931
+ msgstr "Od:"
932
+
933
+ #: includes/forms/themepreview.php:16
934
+ msgid "Preview"
935
+ msgstr "Pregled"
936
+
937
+ #: includes/forms/themepreview.php:17
938
+ msgid " in default Site"
939
+ msgstr "na podrazumevanom site-u"
940
+
941
+ #: includes/forms/themepreview.php:21
942
+ msgid "Not Network Enabled"
943
+ msgstr "Nema aktivirane mreže"
944
+
945
+ #. Plugin URI of the plugin/theme
946
+ msgid "http://www.lilaeamedia.com/plugins/child-theme-configurator/"
947
+ msgstr "http://www.lilaeamedia.com/plugins/child-theme-configurator/"
948
+
949
+ #. Description of the plugin/theme
950
+ msgid ""
951
+ "Create a Child Theme and customize the stylesheet and templates. Fast CSS editor lets "
952
+ "you search, preview and modify by selector, rule or value."
953
+ msgstr ""
954
+ "Kreirajte podređenu temu i prilagodite datoteke sa stilovima i šablone. Brzi CSS "
955
+ "uređivač omogućava vam pretragu, pregled i modifikovanje na osnovu selektora, pravila "
956
+ "ili vrednosti."
957
+
958
+ #. Author of the plugin/theme
959
+ msgid "Lilaea Media"
960
+ msgstr "Lilaea Media"
961
+
962
+ #. Author URI of the plugin/theme
963
+ msgid "http://www.lilaeamedia.com/"
964
+ msgstr "http://www.lilaeamedia.com/"
lang/chld_thm_cfg.pot ADDED
@@ -0,0 +1,1000 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2015 Child Theme Configurator
2
+ # This file is distributed under the same license as the Child Theme Configurator package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Child Theme Configurator 1.7.8\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/child-theme-configurator\n"
7
+ "POT-Creation-Date: 2015-09-24 00:16:38+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2015-MO-DA HO:MI+ZONE\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.8) #-#-#-#-#
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:52
32
+ msgid "A stylesheet link tag is hard-coded into the header template."
33
+ msgstr ""
34
+
35
+ #: includes/class-ctc-ui.php:53
36
+ msgid "<code>wp_enqueue_style()</code> called from the header template."
37
+ msgstr ""
38
+
39
+ #: includes/class-ctc-ui.php:55
40
+ msgid ""
41
+ "Code exists between the <code>wp_head()</code> function and the closing "
42
+ "<code>&lt;/head&gt;</code> tag."
43
+ msgstr ""
44
+
45
+ #: includes/class-ctc-ui.php:162
46
+ msgid "Child Theme files modified successfully."
47
+ msgstr ""
48
+
49
+ #: includes/class-ctc-ui.php:165
50
+ msgid ""
51
+ "Child Theme <strong>%s</strong> has been generated successfully.\n"
52
+ " "
53
+ msgstr ""
54
+
55
+ #: includes/class-ctc-ui.php:168
56
+ msgid "IMPORTANT:"
57
+ msgstr ""
58
+
59
+ #: includes/class-ctc-ui.php:170 includes/forms/themepreview.php:20
60
+ msgid "Go to Themes"
61
+ msgstr ""
62
+
63
+ #: includes/class-ctc-ui.php:170
64
+ msgid "Network enable"
65
+ msgstr ""
66
+
67
+ #: includes/class-ctc-ui.php:170
68
+ msgid "your child theme."
69
+ msgstr ""
70
+
71
+ #: includes/class-ctc-ui.php:172 includes/forms/themepreview.php:18
72
+ msgid "Live Preview"
73
+ msgstr ""
74
+
75
+ #: includes/class-ctc-ui.php:172
76
+ msgid "Test your child theme"
77
+ msgstr ""
78
+
79
+ #: includes/class-ctc-ui.php:172
80
+ msgid "before activating."
81
+ msgstr ""
82
+
83
+ #: includes/class-ctc.php:144
84
+ msgid "URL/None"
85
+ msgstr ""
86
+
87
+ #: includes/class-ctc.php:145
88
+ msgid "Origin"
89
+ msgstr ""
90
+
91
+ #: includes/class-ctc.php:146
92
+ msgid "Color 1"
93
+ msgstr ""
94
+
95
+ #: includes/class-ctc.php:147
96
+ msgid "Color 2"
97
+ msgstr ""
98
+
99
+ #: includes/class-ctc.php:148
100
+ msgid "Width/None"
101
+ msgstr ""
102
+
103
+ #: includes/class-ctc.php:149
104
+ msgid "Style"
105
+ msgstr ""
106
+
107
+ #: includes/class-ctc.php:150
108
+ msgid "Color"
109
+ msgstr ""
110
+
111
+ #: includes/class-ctc.php:152
112
+ msgid "Are you sure? This will replace your current settings."
113
+ msgstr ""
114
+
115
+ #: includes/class-ctc.php:153
116
+ msgid "<span style=\"font-size:10px\">!</span>"
117
+ msgstr ""
118
+
119
+ #: includes/class-ctc.php:154 includes/forms/rule-value.php:32
120
+ msgid "Selectors"
121
+ msgstr ""
122
+
123
+ #: includes/class-ctc.php:155
124
+ msgid "Close"
125
+ msgstr ""
126
+
127
+ #: includes/class-ctc.php:156
128
+ msgid "Edit Selector"
129
+ msgstr ""
130
+
131
+ #: includes/class-ctc.php:157
132
+ msgid "Cancel"
133
+ msgstr ""
134
+
135
+ #: includes/class-ctc.php:158
136
+ msgid "Rename"
137
+ msgstr ""
138
+
139
+ #: includes/class-ctc.php:159
140
+ msgid "The stylesheet cannot be displayed."
141
+ msgstr ""
142
+
143
+ #: includes/class-ctc.php:160
144
+ msgid "(Child Only)"
145
+ msgstr ""
146
+
147
+ #: includes/class-ctc.php:161
148
+ msgid "Please enter a valid Child Theme."
149
+ msgstr ""
150
+
151
+ #: includes/class-ctc.php:162
152
+ msgid "Please enter a valid Child Theme name."
153
+ msgstr ""
154
+
155
+ #: includes/class-ctc.php:163
156
+ msgid "<strong>%s</strong> exists. Please enter a different Child Theme"
157
+ msgstr ""
158
+
159
+ #: includes/class-ctc.php:164
160
+ msgid "The page could not be loaded correctly."
161
+ msgstr ""
162
+
163
+ #: includes/class-ctc.php:166
164
+ msgid ""
165
+ "Conflicting or out-of-date jQuery libraries were loaded by another plugin:"
166
+ msgstr ""
167
+
168
+ #: includes/class-ctc.php:168
169
+ msgid "Deactivating or replacing plugins may resolve this issue."
170
+ msgstr ""
171
+
172
+ #: includes/class-ctc.php:169
173
+ msgid "%sWhy am I seeing this?%s"
174
+ msgstr ""
175
+
176
+ #: includes/class-ctc.php:392
177
+ msgid "Zip file creation failed."
178
+ msgstr ""
179
+
180
+ #: includes/class-ctc.php:428
181
+ msgid "The Functions file is required and cannot be deleted."
182
+ msgstr ""
183
+
184
+ #: includes/class-ctc.php:510
185
+ msgid "You do not have permission to configure child themes."
186
+ msgstr ""
187
+
188
+ #: includes/class-ctc.php:557
189
+ msgid "%s does not exist. Please select a valid Parent Theme."
190
+ msgstr ""
191
+
192
+ #: includes/class-ctc.php:561
193
+ msgid "Please select a valid Parent Theme."
194
+ msgstr ""
195
+
196
+ #: includes/class-ctc.php:564
197
+ msgid "Please enter a valid Child Theme directory."
198
+ msgstr ""
199
+
200
+ #: includes/class-ctc.php:572 includes/class-ctc.php:587
201
+ msgid "Please enter a valid Child Theme template name."
202
+ msgstr ""
203
+
204
+ #: includes/class-ctc.php:577 includes/class-ctc.php:591
205
+ msgid ""
206
+ "<strong>%s</strong> exists. Please enter a different Child Theme template "
207
+ "name."
208
+ msgstr ""
209
+
210
+ #: includes/class-ctc.php:604
211
+ msgid "Your theme directories are not writable."
212
+ msgstr ""
213
+
214
+ #: includes/class-ctc.php:682
215
+ msgid "Your stylesheet is not writable."
216
+ msgstr ""
217
+
218
+ #: includes/class-ctc.php:959
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 "
222
+ "the file is discouraged as it can cause premature HTTP headers. Please edit "
223
+ "<code>functions.php</code> to remove the final <code>?&gt;</code> tag and "
224
+ "click \"Generate/Rebuild Child Theme Files\" again."
225
+ msgstr ""
226
+
227
+ #: includes/class-ctc.php:1060
228
+ msgid "Could not delete file."
229
+ msgstr ""
230
+
231
+ #: includes/class-ctc.php:1139
232
+ msgid "Could not set write permissions."
233
+ msgstr ""
234
+
235
+ #: includes/class-ctc.php:1240
236
+ msgid "There were errors while resetting permissions."
237
+ msgstr ""
238
+
239
+ #: includes/class-ctc.php:1282
240
+ msgid "Could not upload file."
241
+ msgstr ""
242
+
243
+ #: includes/class-ctc.php:1365
244
+ msgid ""
245
+ "The child theme is in read-only mode and Child Theme Configurator cannot "
246
+ "apply changes. Click to see options"
247
+ msgstr ""
248
+
249
+ #: includes/class-ctc.php:1368
250
+ msgid ""
251
+ "<li>Temporarily set write permissions by clicking the button below. When you "
252
+ "are finished editing, revert to read-only by clicking \"Make read-only\" "
253
+ "under the \"Files\" tab.</li>"
254
+ msgstr ""
255
+
256
+ #: includes/class-ctc.php:1371
257
+ msgid "Make files writable"
258
+ msgstr ""
259
+
260
+ #: includes/class-ctc.php:1372
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:1374
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 "
271
+ "an application pool that has write permissions</a> (Windows IIS systems).</"
272
+ "li>"
273
+ msgstr ""
274
+
275
+ #: includes/class-ctc.php:1375
276
+ msgid ""
277
+ "<li><a target=\"_blank\" href=\"http://codex.wordpress.org/"
278
+ "Changing_File_Permissions\" title=\"Changing File Permissions\">Set write "
279
+ "permissions on the server manually</a> (not recommended).</li>"
280
+ msgstr ""
281
+
282
+ #: includes/class-ctc.php:1377
283
+ msgid "<li>Run PHP under Apache with suEXEC (contact your web host).</li>"
284
+ msgstr ""
285
+
286
+ #: includes/class-ctc.php:1388
287
+ msgid ""
288
+ "This Child Theme is not owned by your website account. It may have been "
289
+ "created by a prior version of this plugin or by another program. Moving "
290
+ "forward, it must be owned by your website account to make changes. Child "
291
+ "Theme Configurator will attempt to correct this when you click the button "
292
+ "below."
293
+ msgstr ""
294
+
295
+ #: includes/class-ctc.php:1391
296
+ msgid "Correct Child Theme Permissions"
297
+ msgstr ""
298
+
299
+ #: includes/class-ctc.php:1398
300
+ msgid ""
301
+ "Child Theme Configurator needs to update its interal data. Please set your "
302
+ "preferences below and click \"Generate Child Theme Files\" to update your "
303
+ "configuration."
304
+ msgstr ""
305
+
306
+ #: includes/class-ctc.php:1404
307
+ msgid ""
308
+ "<strong>However, some styles could not be parsed due to memory limits.</"
309
+ "strong> Try deselecting \"Additional Stylesheets\" below and click "
310
+ "\"Generate/Rebuild Child Theme Files\". %sWhy am I seeing this?%s"
311
+ msgstr ""
312
+
313
+ #: includes/class-ctc.php:1413
314
+ msgid ""
315
+ "Child Theme Configurator did not detect any configuration data because a "
316
+ "previously configured Child Theme has been removed. Please set your "
317
+ "preferences below and click \"Generate Child Theme Files\"."
318
+ msgstr ""
319
+
320
+ #: includes/forms/addl_css.php:7
321
+ msgid "Parse additional stylesheets:"
322
+ msgstr ""
323
+
324
+ #: includes/forms/addl_css.php:11 includes/forms/parent-child.php:270
325
+ msgid ""
326
+ "Stylesheets that are currently being loaded by the parent theme are "
327
+ "automatically selected below (except for Bootstrap stylesheets which add a "
328
+ "large amount data to the configuration). To further reduce overhead, select "
329
+ "only the additional stylesheets you wish to customize."
330
+ msgstr ""
331
+
332
+ #: includes/forms/addl_panels.php:9 includes/forms/addl_panels.php:39
333
+ msgid "Use coupon code"
334
+ msgstr ""
335
+
336
+ #: includes/forms/addl_panels.php:9 includes/forms/addl_panels.php:39
337
+ msgid "wordpress-org"
338
+ msgstr ""
339
+
340
+ #: includes/forms/addl_panels.php:9 includes/forms/addl_panels.php:39
341
+ msgid "and get <strong>20% off entire order</strong>."
342
+ msgstr ""
343
+
344
+ #: includes/forms/addl_panels.php:10 includes/forms/addl_panels.php:40
345
+ msgid "Order Now"
346
+ msgstr ""
347
+
348
+ #: includes/forms/addl_panels.php:10 includes/forms/addl_panels.php:40
349
+ msgid "*Prices and offers subject to change."
350
+ msgstr ""
351
+
352
+ #: includes/forms/addl_panels.php:11 includes/forms/addl_panels.php:12
353
+ msgid "Learn more about IntelliWidget"
354
+ msgstr ""
355
+
356
+ #: includes/forms/addl_panels.php:12
357
+ msgid ""
358
+ "IntelliWidget is a versatile widget manager that does the work of multiple "
359
+ "plugins by combining custom page menus, featured posts, sliders and other "
360
+ "dynamic content features into a single plugin that can display on a per-page "
361
+ "or site-wide basis."
362
+ msgstr ""
363
+
364
+ #: includes/forms/addl_panels.php:13 includes/forms/addl_panels.php:16
365
+ msgid "Learn more"
366
+ msgstr ""
367
+
368
+ #: includes/forms/addl_panels.php:14 includes/forms/addl_panels.php:15
369
+ msgid "Learn more about IW Responsive Menu"
370
+ msgstr ""
371
+
372
+ #: includes/forms/addl_panels.php:15
373
+ msgid ""
374
+ "IntelliWidget Responsive Menu lets you break free from your theme’s built-in "
375
+ "respons