Child Theme Creator by Orbisius - Version 1.1.9

Version Description

  • Added the buttons under the 2nd editor
  • Hid the plugin from the Tools menu
  • Integrated with Orbisius Theme Switcher
Download this release

Release Info

Developer lordspace
Plugin Icon wp plugin Child Theme Creator by Orbisius
Version 1.1.9
Comparing to
See all releases

Code changes from version 1.1.8 to 1.1.9

assets/main.js CHANGED
@@ -38,8 +38,11 @@ var orbisius_child_theme_creator = {
38
  data : jQuery(form_id).serialize() + '&action=orbisius_ctc_theme_editor_ajax&sub_cmd=' + escape('delete_file'),
39
 
40
  success : function (result) {
41
- jQuery("#theme_1_file option:selected").remove();
42
- jQuery("#theme_1_file").trigger('change');
 
 
 
43
  }
44
  });
45
  }
@@ -66,7 +69,7 @@ function orbisius_ctc_theme_editor_setup() {
66
  }
67
 
68
  ///////////////////////////////////////////////////////////////////////////////////////////////////
69
- // Delete File
70
  ///////////////////////////////////////////////////////////////////////////////////////////////////
71
  $('#theme_1_delete_file_btn').on("click", function () {
72
  var selected_file = $('#theme_1_file').val();
@@ -78,7 +81,19 @@ function orbisius_ctc_theme_editor_setup() {
78
  ///////////////////////////////////////////////////////////////////////////////////////////////////
79
 
80
  ///////////////////////////////////////////////////////////////////////////////////////////////////
81
- // New File
 
 
 
 
 
 
 
 
 
 
 
 
82
  ///////////////////////////////////////////////////////////////////////////////////////////////////
83
  $('#theme_1_new_file_btn').on("click", function () {
84
  $('#theme_1_new_file_container').toggle('slow');
@@ -161,8 +176,94 @@ function orbisius_ctc_theme_editor_setup() {
161
  });
162
  ///////////////////////////////////////////////////////////////////////////////////////////////////
163
 
 
164
  ///////////////////////////////////////////////////////////////////////////////////////////////////
165
- // Syntax check button
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  ///////////////////////////////////////////////////////////////////////////////////////////////////
167
  $('#theme_1_syntax_chk_btn').on("click", function () {
168
  var form_id = '#orbisius_ctc_theme_editor_theme_1_form';
@@ -196,9 +297,48 @@ function orbisius_ctc_theme_editor_setup() {
196
  } // success
197
  }); // ajax
198
  }); // click
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
 
200
  ///////////////////////////////////////////////////////////////////////////////////////////////////
201
- // Send
202
  ///////////////////////////////////////////////////////////////////////////////////////////////////
203
  $('#theme_1_send_btn').on("click", function () {
204
  $('#theme_1_send_container').toggle('slow');
@@ -254,7 +394,62 @@ function orbisius_ctc_theme_editor_setup() {
254
  }); // click
255
  ///////////////////////////////////////////////////////////////////////////////////////////////////
256
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
257
 
 
 
 
 
 
 
 
 
 
 
258
 
259
 
260
  ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -265,6 +460,11 @@ function orbisius_ctc_theme_editor_setup() {
265
  $('#theme_1_new_folder').focus();
266
  });
267
 
 
 
 
 
 
268
  // The user enters a folder name. Let's check if it exists.
269
  $('#theme_1_new_folder').on("input", function (event) {
270
  var new_folder = $('#theme_1_new_folder').val();
@@ -290,6 +490,31 @@ function orbisius_ctc_theme_editor_setup() {
290
  }
291
  });
292
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
293
  /**
294
  * New Folder: On OK this will hide the form but will add a new element
295
  * to the theme files dropdown.
@@ -342,11 +567,68 @@ function orbisius_ctc_theme_editor_setup() {
342
  });
343
  ///////////////////////////////////////////////////////////////////////////////////////////////////
344
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
345
  // Change theme selection
346
  $('#theme_1').on("change", function () {
347
  app_load('#orbisius_ctc_theme_editor_theme_1_form', 'generate_dropdown', '#theme_1_file', app_handle_theme_change);
348
  });
349
 
 
 
 
 
 
350
  $('#orbisius_ctc_theme_editor_theme_1_form').submit(function () {
351
  app_load('#orbisius_ctc_theme_editor_theme_1_form', 'save_file', '#theme_1_file_contents');
352
 
@@ -375,7 +657,7 @@ function orbisius_ctc_theme_editor_setup() {
375
  * When the theme is selected we need to check if there is a file selected so we can load it.
376
  * When the file dropdown is changed/selected we'll load the selected file.
377
  *
378
- * @returns {undefined}
379
  */
380
  function app_handle_theme_change(form_id, action, target_container, result) {
381
  var form_prefix = jQuery(form_id) ? jQuery(form_id).attr('id') : ''; // orbisius_ctc_theme_editor_theme_1_form
@@ -388,6 +670,17 @@ function app_handle_theme_change(form_id, action, target_container, result) {
388
  form_prefix = form_prefix.replace(/.+(theme[-_]*\d+).*/, '$1');
389
  form_prefix = '#' + form_prefix + '_'; // jQuery ID prefix. Res: #theme_2_
390
 
 
 
 
 
 
 
 
 
 
 
 
391
  var cur_file = jQuery(form_prefix + '_file').val();
392
 
393
  if (cur_file !== '') {
38
  data : jQuery(form_id).serialize() + '&action=orbisius_ctc_theme_editor_ajax&sub_cmd=' + escape('delete_file'),
39
 
40
  success : function (result) {
41
+ var form_num = form_id.indexOf('#theme_1') >= 0 ? 1 : 2;
42
+
43
+ // theme_1_ or theme_2_
44
+ jQuery("#theme_" + form_num + "_file option:selected").remove();
45
+ jQuery("#theme_" + form_num + "_file").trigger('change');
46
  }
47
  });
48
  }
69
  }
70
 
71
  ///////////////////////////////////////////////////////////////////////////////////////////////////
72
+ // Delete File #1
73
  ///////////////////////////////////////////////////////////////////////////////////////////////////
74
  $('#theme_1_delete_file_btn').on("click", function () {
75
  var selected_file = $('#theme_1_file').val();
81
  ///////////////////////////////////////////////////////////////////////////////////////////////////
82
 
83
  ///////////////////////////////////////////////////////////////////////////////////////////////////
84
+ // Delete File #2
85
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
86
+ $('#theme_2_delete_file_btn').on("click", function () {
87
+ var selected_file = $('#theme_2_file').val();
88
+
89
+ if (confirm('Delete: [' + selected_file + '] ? Are you sure?', '')) {
90
+ orbisius_child_theme_creator.delete_file(selected_file, '#orbisius_ctc_theme_editor_theme_2_form');
91
+ }
92
+ });
93
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
94
+
95
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
96
+ // New File #1
97
  ///////////////////////////////////////////////////////////////////////////////////////////////////
98
  $('#theme_1_new_file_btn').on("click", function () {
99
  $('#theme_1_new_file_container').toggle('slow');
176
  });
177
  ///////////////////////////////////////////////////////////////////////////////////////////////////
178
 
179
+
180
  ///////////////////////////////////////////////////////////////////////////////////////////////////
181
+ // New File #2
182
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
183
+ $('#theme_2_new_file_btn').on("click", function () {
184
+ $('#theme_2_new_file_container').toggle('slow');
185
+ $('#theme_2_new_file').focus();
186
+ });
187
+
188
+ // The user enters a file name. Let's check if it exists.
189
+ $('#theme_2_new_file').on("input", function (event) {
190
+ var new_file = $('#theme_2_new_file').val();
191
+ new_file = orbisius_child_theme_creator.sanitize_file_name(new_file);
192
+
193
+ var ok = 1; // let's by positive by default
194
+
195
+ // Let's check if that file exists by checking if there is an entry in the options
196
+ $("#theme_2_file option").each(function() { // idx, val
197
+ var cur_val = $(this).val();
198
+
199
+ if (cur_val == new_file) {
200
+ ok = 0;
201
+ return ;
202
+ }
203
+ });
204
+
205
+ if (ok) {
206
+ $('.status', $('#theme_2_new_file_container')).text('').removeClass('app-alert-error');
207
+ } else {
208
+ var err = 'File with that name already exists.';
209
+ $('.status', $('#theme_2_new_file_container')).text(err).addClass('app-alert-error');
210
+ }
211
+ });
212
+
213
+ /**
214
+ * New File: On OK this will hide the form but will add a new element
215
+ * to the theme files dropdown.
216
+ */
217
+ $('#theme_2_new_file_btn_ok').on("click", function () {
218
+ var val = $('#theme_2_new_file').val();
219
+ val = orbisius_child_theme_creator.sanitize_file_name(val);
220
+ var text = val;
221
+
222
+ if (val == '') {
223
+ alert('Invalid or empty value for filename.');
224
+ $('#theme_2_new_file').focus();
225
+ return ;
226
+ }
227
+
228
+ var ok = 1; // let's by positive by default
229
+
230
+ // Let's check if that file exists by checking if there is an entry in the options
231
+ $("#theme_2_file option").each(function() { // idx, val
232
+ var cur_val = $(this).val();
233
+
234
+ if (cur_val == val) {
235
+ ok = 0;
236
+ return ;
237
+ }
238
+ });
239
+
240
+ if (!ok) {
241
+ alert('File with that name already exists.');
242
+ $('#theme_2_new_file').focus();
243
+ return ;
244
+ }
245
+
246
+ // unselects current element from the dropdown.
247
+ $("select theme_2_file").prop("selected", false);
248
+ var new_option = $('<option></option>').val(val).html(text).prop("selected", true);
249
+
250
+ $('#theme_2_file').append( new_option ); // select
251
+ $('#theme_2_new_file_container').hide('slow');
252
+ $('#theme_2_new_file').val(''); // text box for new file
253
+ $('#theme_2_file_contents').val('').focus(); // textarea
254
+ });
255
+
256
+ // This is when the cancel button is clicked so the user doesn't want a new file.
257
+ $('#theme_2_new_file_btn_cancel').on("click", function () {
258
+ $('#theme_2_new_file').val('');
259
+ $('#theme_2_new_file_container').hide('slow');
260
+ $('.status', $('#theme_2_new_file_container')).text('').removeClass('app-alert-error');
261
+ });
262
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
263
+
264
+
265
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
266
+ // Syntax check button #1
267
  ///////////////////////////////////////////////////////////////////////////////////////////////////
268
  $('#theme_1_syntax_chk_btn').on("click", function () {
269
  var form_id = '#orbisius_ctc_theme_editor_theme_1_form';
297
  } // success
298
  }); // ajax
299
  }); // click
300
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
301
+
302
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
303
+ // Syntax check button #2
304
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
305
+ $('#theme_2_syntax_chk_btn').on("click", function () {
306
+ var form_id = '#orbisius_ctc_theme_editor_theme_2_form';
307
+ var action = 'syntax_check';
308
+ var target_container = '.orbisius_ctc_theme_editor_theme_2_primary_buttons .status';
309
+
310
+ jQuery(target_container)
311
+ .empty()
312
+ .removeClass('app-alert-success app-alert-error app-alert-notice')
313
+ .addClass( 'app-alert-notice')
314
+ .html('Checking ...');
315
+
316
+ jQuery.ajax({
317
+ type : "post",
318
+ //dataType : "json",
319
+ url : ajaxurl, // WP defines it and it contains all the necessary params
320
+ data : jQuery(form_id).serialize() + '&action=orbisius_ctc_theme_editor_ajax&sub_cmd=' + escape(action),
321
+
322
+ success : function (json) {
323
+ jQuery(target_container)
324
+ .empty()
325
+ .removeClass('app-alert-notice')
326
+ .html(json.msg)
327
+ .addClass( json.status ? 'app-alert-success' : 'app-alert-error' );
328
+
329
+ if (json.status) { // auto hide on success
330
+ setTimeout(function () {
331
+ jQuery(target_container).empty().removeClass('app-alert-success app-alert-error');
332
+ }, 2000);
333
+ }
334
+ } // success
335
+ }); // ajax
336
+ }); // click
337
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
338
+
339
 
340
  ///////////////////////////////////////////////////////////////////////////////////////////////////
341
+ // Send #1
342
  ///////////////////////////////////////////////////////////////////////////////////////////////////
343
  $('#theme_1_send_btn').on("click", function () {
344
  $('#theme_1_send_container').toggle('slow');
394
  }); // click
395
  ///////////////////////////////////////////////////////////////////////////////////////////////////
396
 
397
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
398
+ // Send #2
399
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
400
+ $('#theme_2_send_btn').on("click", function () {
401
+ $('#theme_2_send_container').toggle('slow');
402
+ $('#theme_2_send_to').focus();
403
+ });
404
+
405
+ // This is when the cancel button is clicked so the user doesn't want a new folder.
406
+ $('#theme_2_send_btn_cancel').on("click", function () {
407
+ //$('#theme_2_send_to').val(''); //??
408
+ $('#theme_2_send_container').hide('slow');
409
+ });
410
+
411
+ $('#theme_2_send_btn_ok').on("click", function () {
412
+ var to = jQuery('#theme_2_send_to').val().trim();
413
+
414
+ if (to.indexOf('@') == -1 || to.indexOf('.') < 1) {
415
+ alert('Invalid email(s).');
416
+ $('#theme_2_send_to').focus();
417
+ return;
418
+ }
419
+
420
+ var form_id = '#orbisius_ctc_theme_editor_theme_2_form';
421
+ var action = 'send_theme';
422
+ var target_container = '.orbisius_ctc_theme_editor_theme_2_primary_buttons .status';
423
+
424
+ jQuery(target_container)
425
+ .empty()
426
+ .removeClass('app-alert-success app-alert-error app-alert-notice')
427
+ .addClass( 'app-alert-notice')
428
+ .html('Processing ...');
429
+
430
+ jQuery.ajax({
431
+ type : "post",
432
+ //dataType : "json",
433
+ url : ajaxurl, // WP defines it and it contains all the necessary params
434
+ data : jQuery(form_id).serialize() + '&action=orbisius_ctc_theme_editor_ajax&sub_cmd=' + escape(action),
435
+
436
+ success : function (json) {
437
+ jQuery(target_container)
438
+ .empty()
439
+ .removeClass('app-alert-notice')
440
+ .html(json.msg)
441
+ .addClass( json.status ? 'app-alert-success' : 'app-alert-error' );
442
 
443
+ if (json.status) { // auto hide on success
444
+ setTimeout(function () {
445
+ jQuery(target_container).empty().removeClass('app-alert-success app-alert-error');
446
+ $('#theme_2_send_btn_cancel').click();
447
+ }, 2000);
448
+ }
449
+ } // success
450
+ }); // ajax
451
+ }); // click
452
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
453
 
454
 
455
  ///////////////////////////////////////////////////////////////////////////////////////////////////
460
  $('#theme_1_new_folder').focus();
461
  });
462
 
463
+ $('#theme_2_new_folder_btn').on("click", function () {
464
+ $('#theme_2_new_folder_container').toggle('slow');
465
+ $('#theme_2_new_folder').focus();
466
+ });
467
+
468
  // The user enters a folder name. Let's check if it exists.
469
  $('#theme_1_new_folder').on("input", function (event) {
470
  var new_folder = $('#theme_1_new_folder').val();
490
  }
491
  });
492
 
493
+ // The user enters a folder name. Let's check if it exists.
494
+ $('#theme_2_new_folder').on("input", function (event) {
495
+ var new_folder = $('#theme_2_new_folder').val();
496
+ new_folder = orbisius_child_theme_creator.sanitize_file_name(new_folder);
497
+
498
+ var ok = 1; // let's by positive by default
499
+
500
+ // Let's check if that folder exists by checking if there is an entry in the options
501
+ $("#theme_2_file option").each(function() { // idx, val
502
+ var cur_val = $(this).val();
503
+
504
+ if (cur_val == new_folder) {
505
+ ok = 0;
506
+ return ;
507
+ }
508
+ });
509
+
510
+ if (ok) {
511
+ $('.status', $('#theme_2_new_folder_container')).text('').removeClass('app-alert-error');
512
+ } else {
513
+ var err = 'File/folder with that name already exists.';
514
+ $('.status', $('#theme_2_new_folder_container')).text(err).addClass('app-alert-error');
515
+ }
516
+ });
517
+
518
  /**
519
  * New Folder: On OK this will hide the form but will add a new element
520
  * to the theme files dropdown.
567
  });
568
  ///////////////////////////////////////////////////////////////////////////////////////////////////
569
 
570
+ /**
571
+ * New Folder: On OK this will hide the form but will add a new element
572
+ * to the theme files dropdown.
573
+ * @TODO
574
+ */
575
+ $('#theme_2_new_folder_btn_ok').on("click", function () {
576
+ var val = $('#theme_2_new_folder').val();
577
+ val = orbisius_child_theme_creator.sanitize_file_name(val);
578
+ var text = val;
579
+
580
+ if (val == '') {
581
+ alert('Invalid or empty value for folder name.');
582
+ $('#theme_2_new_folder').focus();
583
+ return ;
584
+ }
585
+
586
+ var ok = 1; // let's by positive by default
587
+
588
+ // Let's check if that file exists by checking if there is an entry in the options
589
+ $("#theme_2_folder option").each(function() { // idx, val
590
+ var cur_val = $(this).val();
591
+
592
+ if (cur_val == val) {
593
+ ok = 0;
594
+ return ;
595
+ }
596
+ });
597
+
598
+ if (!ok) {
599
+ alert('File with that name already exists.');
600
+ $('#theme_2_new_folder').focus();
601
+ return ;
602
+ }
603
+
604
+ // unselects current element from the dropdown.
605
+ $("select theme_2_folder").prop("selected", false);
606
+ var new_option = $('<option></option>').val(val).html(text).prop("selected", true);
607
+
608
+ $('#theme_2_folder').append( new_option ); // select
609
+ $('#theme_2_new_folder_container').hide('slow');
610
+ $('#theme_2_new_folder').val(''); // text box for new folder
611
+ $('#theme_2_folder_contents').val('').focus(); // textarea
612
+ });
613
+
614
+ // This is when the cancel button is clicked so the user doesn't want a new folder.
615
+ $('#theme_2_new_folder_btn_cancel').on("click", function () {
616
+ $('#theme_2_new_folder').val('');
617
+ $('#theme_2_new_folder_container').hide('slow');
618
+ $('.status', $('#theme_2_new_folder_container')).text('').removeClass('app-alert-error');
619
+ });
620
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
621
+
622
  // Change theme selection
623
  $('#theme_1').on("change", function () {
624
  app_load('#orbisius_ctc_theme_editor_theme_1_form', 'generate_dropdown', '#theme_1_file', app_handle_theme_change);
625
  });
626
 
627
+ // Change theme selection
628
+ $('#theme_2').on("change", function () {
629
+ app_load('#orbisius_ctc_theme_editor_theme_2_form', 'generate_dropdown', '#theme_2_file', app_handle_theme_change);
630
+ });
631
+
632
  $('#orbisius_ctc_theme_editor_theme_1_form').submit(function () {
633
  app_load('#orbisius_ctc_theme_editor_theme_1_form', 'save_file', '#theme_1_file_contents');
634
 
657
  * When the theme is selected we need to check if there is a file selected so we can load it.
658
  * When the file dropdown is changed/selected we'll load the selected file.
659
  *
660
+ * @returns void
661
  */
662
  function app_handle_theme_change(form_id, action, target_container, result) {
663
  var form_prefix = jQuery(form_id) ? jQuery(form_id).attr('id') : ''; // orbisius_ctc_theme_editor_theme_1_form
670
  form_prefix = form_prefix.replace(/.+(theme[-_]*\d+).*/, '$1');
671
  form_prefix = '#' + form_prefix + '_'; // jQuery ID prefix. Res: #theme_2_
672
 
673
+ // Let's notify the extensions (if any)
674
+ if ( (typeof OrbisiusChildThemeCreatorExt != 'undefined')
675
+ && (typeof OrbisiusChildThemeCreatorExt.Editors != 'undefined')
676
+ && (typeof OrbisiusChildThemeCreatorExt.Editors.onThemeChange != 'undefined') )
677
+ {
678
+ var dropdown_id = form_prefix;
679
+ var dropdown_id = dropdown_id.replace(/_+$/g, ''); // rm trailing stuff
680
+ //var dropdown_id = dropdown_id.replace(/\#+/g, ''); // rm #
681
+ OrbisiusChildThemeCreatorExt.Editors.onThemeChange(dropdown_id, jQuery(dropdown_id).val());
682
+ }
683
+
684
  var cur_file = jQuery(form_prefix + '_file').val();
685
 
686
  if (cur_file !== '') {
assets/main.min.js CHANGED
@@ -1 +1 @@
1
- function orbisius_ctc_theme_editor_setup(){var e=jQuery;var t=e("#theme_1").val();if(t!=""){app_load("#orbisius_ctc_theme_editor_theme_1_form","generate_dropdown","#theme_1_file",app_handle_theme_change)}e("#theme_1_delete_file_btn").on("click",function(){var t=e("#theme_1_file").val();if(confirm("Delete: ["+t+"] ? Are you sure?","")){orbisius_child_theme_creator.delete_file(t,"#orbisius_ctc_theme_editor_theme_1_form")}});e("#theme_1_new_file_btn").on("click",function(){e("#theme_1_new_file_container").toggle("slow");e("#theme_1_new_file").focus()});e("#theme_1_new_file").on("input",function(t){var n=e("#theme_1_new_file").val();n=orbisius_child_theme_creator.sanitize_file_name(n);var r=1;e("#theme_1_file option").each(function(){var t=e(this).val();if(t==n){r=0;return}});if(r){e(".status",e("#theme_1_new_file_container")).text("").removeClass("app-alert-error")}else{var i="File with that name already exists.";e(".status",e("#theme_1_new_file_container")).text(i).addClass("app-alert-error")}});e("#theme_1_new_file_btn_ok").on("click",function(){var t=e("#theme_1_new_file").val();t=orbisius_child_theme_creator.sanitize_file_name(t);var n=t;if(t==""){alert("Invalid or empty value for filename.");e("#theme_1_new_file").focus();return}var r=1;e("#theme_1_file option").each(function(){var n=e(this).val();if(n==t){r=0;return}});if(!r){alert("File with that name already exists.");e("#theme_1_new_file").focus();return}e("select theme_1_file").prop("selected",false);var i=e("<option></option>").val(t).html(n).prop("selected",true);e("#theme_1_file").append(i);e("#theme_1_new_file_container").hide("slow");e("#theme_1_new_file").val("");e("#theme_1_file_contents").val("").focus()});e("#theme_1_new_file_btn_cancel").on("click",function(){e("#theme_1_new_file").val("");e("#theme_1_new_file_container").hide("slow");e(".status",e("#theme_1_new_file_container")).text("").removeClass("app-alert-error")});e("#theme_1_syntax_chk_btn").on("click",function(){var e="#orbisius_ctc_theme_editor_theme_1_form";var t="syntax_check";var n=".orbisius_ctc_theme_editor_theme_1_primary_buttons .status";jQuery(n).empty().removeClass("app-alert-success app-alert-error app-alert-notice").addClass("app-alert-notice").html("Checking ...");jQuery.ajax({type:"post",url:ajaxurl,data:jQuery(e).serialize()+"&action=orbisius_ctc_theme_editor_ajax&sub_cmd="+escape(t),success:function(e){jQuery(n).empty().removeClass("app-alert-notice").html(e.msg).addClass(e.status?"app-alert-success":"app-alert-error");if(e.status){setTimeout(function(){jQuery(n).empty().removeClass("app-alert-success app-alert-error")},2e3)}}})});e("#theme_1_send_btn").on("click",function(){e("#theme_1_send_container").toggle("slow");e("#theme_1_send_to").focus()});e("#theme_1_send_btn_cancel").on("click",function(){e("#theme_1_send_container").hide("slow")});e("#theme_1_send_btn_ok").on("click",function(){var t=jQuery("#theme_1_send_to").val().trim();if(t.indexOf("@")==-1||t.indexOf(".")<1){alert("Invalid email(s).");e("#theme_1_send_to").focus();return}var n="#orbisius_ctc_theme_editor_theme_1_form";var r="send_theme";var i=".orbisius_ctc_theme_editor_theme_1_primary_buttons .status";jQuery(i).empty().removeClass("app-alert-success app-alert-error app-alert-notice").addClass("app-alert-notice").html("Processing ...");jQuery.ajax({type:"post",url:ajaxurl,data:jQuery(n).serialize()+"&action=orbisius_ctc_theme_editor_ajax&sub_cmd="+escape(r),success:function(t){jQuery(i).empty().removeClass("app-alert-notice").html(t.msg).addClass(t.status?"app-alert-success":"app-alert-error");if(t.status){setTimeout(function(){jQuery(i).empty().removeClass("app-alert-success app-alert-error");e("#theme_1_send_btn_cancel").click()},2e3)}}})});e("#theme_1_new_folder_btn").on("click",function(){e("#theme_1_new_folder_container").toggle("slow");e("#theme_1_new_folder").focus()});e("#theme_1_new_folder").on("input",function(t){var n=e("#theme_1_new_folder").val();n=orbisius_child_theme_creator.sanitize_file_name(n);var r=1;e("#theme_1_file option").each(function(){var t=e(this).val();if(t==n){r=0;return}});if(r){e(".status",e("#theme_1_new_folder_container")).text("").removeClass("app-alert-error")}else{var i="File/folder with that name already exists.";e(".status",e("#theme_1_new_folder_container")).text(i).addClass("app-alert-error")}});e("#theme_1_new_folder_btn_ok").on("click",function(){var t=e("#theme_1_new_folder").val();t=orbisius_child_theme_creator.sanitize_file_name(t);var n=t;if(t==""){alert("Invalid or empty value for folder name.");e("#theme_1_new_folder").focus();return}var r=1;e("#theme_1_folder option").each(function(){var n=e(this).val();if(n==t){r=0;return}});if(!r){alert("File with that name already exists.");e("#theme_1_new_folder").focus();return}e("select theme_1_folder").prop("selected",false);var i=e("<option></option>").val(t).html(n).prop("selected",true);e("#theme_1_folder").append(i);e("#theme_1_new_folder_container").hide("slow");e("#theme_1_new_folder").val("");e("#theme_1_folder_contents").val("").focus()});e("#theme_1_new_folder_btn_cancel").on("click",function(){e("#theme_1_new_folder").val("");e("#theme_1_new_folder_container").hide("slow");e(".status",e("#theme_1_new_folder_container")).text("").removeClass("app-alert-error")});e("#theme_1").on("change",function(){app_load("#orbisius_ctc_theme_editor_theme_1_form","generate_dropdown","#theme_1_file",app_handle_theme_change)});e("#orbisius_ctc_theme_editor_theme_1_form").submit(function(){app_load("#orbisius_ctc_theme_editor_theme_1_form","save_file","#theme_1_file_contents");return false});var t=e("#theme_2").val();if(t!=""){app_load("#orbisius_ctc_theme_editor_theme_2_form","generate_dropdown","#theme_2_file",app_handle_theme_change)}e("#theme_2").on("change",function(){app_load("#orbisius_ctc_theme_editor_theme_2_form","generate_dropdown","#theme_2_file",app_handle_theme_change)});e("#orbisius_ctc_theme_editor_theme_2_form").submit(function(){app_load("#orbisius_ctc_theme_editor_theme_2_form","save_file","#theme_2_file_contents");return false})}function app_handle_theme_change(e,t,n,r){var i=jQuery(e)?jQuery(e).attr("id"):"";i=i||"";if(i==""){return}i=i.replace(/.+(theme[-_]*\d+).*/,"$1");i="#"+i+"_";var s=jQuery(i+"_file").val();if(s!==""){app_load(e,"load_file",i+"file_contents")}jQuery(i+"file").on("change",function(){app_load(e,"load_file",i+"file_contents")})}function app_load(e,t,n,r){var i='<span class="app-alert-notice">Loading...</span>';var s="Loading...";var o=0;var u=t.indexOf("save")>=0;if(u){if(jQuery(n).is("input,textarea")){jQuery(n).attr("readonly","readonly");jQuery(n).addClass("saving_action")}jQuery(".status",jQuery(n).parent()).html(i)}else{if(jQuery(n).is("input,textarea")){jQuery(n).val(s);jQuery(n).addClass("saving_action")}else if(jQuery(n).is("select")){jQuery(n+" option").text(s)}else{jQuery(n).html(i)}}jQuery.ajax({type:"post",url:ajaxurl,data:jQuery(e).serialize()+"&action=orbisius_ctc_theme_editor_ajax&sub_cmd="+escape(t),success:function(i){if(i!=""){if(jQuery(n).is("input,textarea")){jQuery(n).val(i)}else{jQuery(n).html(i)}if(u){jQuery(".status",jQuery(n).parent()).html("Saved.").addClass("app-alert-success");setTimeout(function(){jQuery(".status",jQuery(n).parent()).empty().removeClass("app-alert-success app-alert-error")},2e3)}}else if(u){jQuery(".status",jQuery(n).parent()).html("Oops. Cannot save.").addClass("app-alert-error")}if(typeof r!="undefined"){r(e,t,n,i)}},complete:function(e){jQuery(n).removeClass("saving_action");if(u){if(jQuery(n).is("input,textarea")){jQuery(n).removeAttr("readonly")}}}})}var orbisius_child_theme_creator={sanitize_file_name:function(e){e=e.replace(/[^\w-.\s]/ig,"");e=e.replace(/\s+/ig,"-");e=e.replace(/\.+/ig,".");e=e.replace(/-+/ig,"-");e=e.replace(/_+/ig,"_");e=e.replace(/^[._-]+/ig,"");e=e.replace(/[._-]+$/ig,"");e=jQuery.trim(e);return e},delete_file:function(e,t){jQuery.ajax({type:"post",url:ajaxurl,data:jQuery(t).serialize()+"&action=orbisius_ctc_theme_editor_ajax&sub_cmd="+escape("delete_file"),success:function(e){jQuery("#theme_1_file option:selected").remove();jQuery("#theme_1_file").trigger("change")}})}};jQuery(document).ready(function(e){orbisius_ctc_theme_editor_setup()})
1
+ function orbisius_ctc_theme_editor_setup(){var e=jQuery;var t=e("#theme_1").val();if(t!=""){app_load("#orbisius_ctc_theme_editor_theme_1_form","generate_dropdown","#theme_1_file",app_handle_theme_change)}e("#theme_1_delete_file_btn").on("click",function(){var t=e("#theme_1_file").val();if(confirm("Delete: ["+t+"] ? Are you sure?","")){orbisius_child_theme_creator.delete_file(t,"#orbisius_ctc_theme_editor_theme_1_form")}});e("#theme_2_delete_file_btn").on("click",function(){var t=e("#theme_2_file").val();if(confirm("Delete: ["+t+"] ? Are you sure?","")){orbisius_child_theme_creator.delete_file(t,"#orbisius_ctc_theme_editor_theme_2_form")}});e("#theme_1_new_file_btn").on("click",function(){e("#theme_1_new_file_container").toggle("slow");e("#theme_1_new_file").focus()});e("#theme_1_new_file").on("input",function(t){var n=e("#theme_1_new_file").val();n=orbisius_child_theme_creator.sanitize_file_name(n);var r=1;e("#theme_1_file option").each(function(){var t=e(this).val();if(t==n){r=0;return}});if(r){e(".status",e("#theme_1_new_file_container")).text("").removeClass("app-alert-error")}else{var i="File with that name already exists.";e(".status",e("#theme_1_new_file_container")).text(i).addClass("app-alert-error")}});e("#theme_1_new_file_btn_ok").on("click",function(){var t=e("#theme_1_new_file").val();t=orbisius_child_theme_creator.sanitize_file_name(t);var n=t;if(t==""){alert("Invalid or empty value for filename.");e("#theme_1_new_file").focus();return}var r=1;e("#theme_1_file option").each(function(){var n=e(this).val();if(n==t){r=0;return}});if(!r){alert("File with that name already exists.");e("#theme_1_new_file").focus();return}e("select theme_1_file").prop("selected",false);var i=e("<option></option>").val(t).html(n).prop("selected",true);e("#theme_1_file").append(i);e("#theme_1_new_file_container").hide("slow");e("#theme_1_new_file").val("");e("#theme_1_file_contents").val("").focus()});e("#theme_1_new_file_btn_cancel").on("click",function(){e("#theme_1_new_file").val("");e("#theme_1_new_file_container").hide("slow");e(".status",e("#theme_1_new_file_container")).text("").removeClass("app-alert-error")});e("#theme_2_new_file_btn").on("click",function(){e("#theme_2_new_file_container").toggle("slow");e("#theme_2_new_file").focus()});e("#theme_2_new_file").on("input",function(t){var n=e("#theme_2_new_file").val();n=orbisius_child_theme_creator.sanitize_file_name(n);var r=1;e("#theme_2_file option").each(function(){var t=e(this).val();if(t==n){r=0;return}});if(r){e(".status",e("#theme_2_new_file_container")).text("").removeClass("app-alert-error")}else{var i="File with that name already exists.";e(".status",e("#theme_2_new_file_container")).text(i).addClass("app-alert-error")}});e("#theme_2_new_file_btn_ok").on("click",function(){var t=e("#theme_2_new_file").val();t=orbisius_child_theme_creator.sanitize_file_name(t);var n=t;if(t==""){alert("Invalid or empty value for filename.");e("#theme_2_new_file").focus();return}var r=1;e("#theme_2_file option").each(function(){var n=e(this).val();if(n==t){r=0;return}});if(!r){alert("File with that name already exists.");e("#theme_2_new_file").focus();return}e("select theme_2_file").prop("selected",false);var i=e("<option></option>").val(t).html(n).prop("selected",true);e("#theme_2_file").append(i);e("#theme_2_new_file_container").hide("slow");e("#theme_2_new_file").val("");e("#theme_2_file_contents").val("").focus()});e("#theme_2_new_file_btn_cancel").on("click",function(){e("#theme_2_new_file").val("");e("#theme_2_new_file_container").hide("slow");e(".status",e("#theme_2_new_file_container")).text("").removeClass("app-alert-error")});e("#theme_1_syntax_chk_btn").on("click",function(){var e="#orbisius_ctc_theme_editor_theme_1_form";var t="syntax_check";var n=".orbisius_ctc_theme_editor_theme_1_primary_buttons .status";jQuery(n).empty().removeClass("app-alert-success app-alert-error app-alert-notice").addClass("app-alert-notice").html("Checking ...");jQuery.ajax({type:"post",url:ajaxurl,data:jQuery(e).serialize()+"&action=orbisius_ctc_theme_editor_ajax&sub_cmd="+escape(t),success:function(e){jQuery(n).empty().removeClass("app-alert-notice").html(e.msg).addClass(e.status?"app-alert-success":"app-alert-error");if(e.status){setTimeout(function(){jQuery(n).empty().removeClass("app-alert-success app-alert-error")},2e3)}}})});e("#theme_2_syntax_chk_btn").on("click",function(){var e="#orbisius_ctc_theme_editor_theme_2_form";var t="syntax_check";var n=".orbisius_ctc_theme_editor_theme_2_primary_buttons .status";jQuery(n).empty().removeClass("app-alert-success app-alert-error app-alert-notice").addClass("app-alert-notice").html("Checking ...");jQuery.ajax({type:"post",url:ajaxurl,data:jQuery(e).serialize()+"&action=orbisius_ctc_theme_editor_ajax&sub_cmd="+escape(t),success:function(e){jQuery(n).empty().removeClass("app-alert-notice").html(e.msg).addClass(e.status?"app-alert-success":"app-alert-error");if(e.status){setTimeout(function(){jQuery(n).empty().removeClass("app-alert-success app-alert-error")},2e3)}}})});e("#theme_1_send_btn").on("click",function(){e("#theme_1_send_container").toggle("slow");e("#theme_1_send_to").focus()});e("#theme_1_send_btn_cancel").on("click",function(){e("#theme_1_send_container").hide("slow")});e("#theme_1_send_btn_ok").on("click",function(){var t=jQuery("#theme_1_send_to").val().trim();if(t.indexOf("@")==-1||t.indexOf(".")<1){alert("Invalid email(s).");e("#theme_1_send_to").focus();return}var n="#orbisius_ctc_theme_editor_theme_1_form";var r="send_theme";var i=".orbisius_ctc_theme_editor_theme_1_primary_buttons .status";jQuery(i).empty().removeClass("app-alert-success app-alert-error app-alert-notice").addClass("app-alert-notice").html("Processing ...");jQuery.ajax({type:"post",url:ajaxurl,data:jQuery(n).serialize()+"&action=orbisius_ctc_theme_editor_ajax&sub_cmd="+escape(r),success:function(t){jQuery(i).empty().removeClass("app-alert-notice").html(t.msg).addClass(t.status?"app-alert-success":"app-alert-error");if(t.status){setTimeout(function(){jQuery(i).empty().removeClass("app-alert-success app-alert-error");e("#theme_1_send_btn_cancel").click()},2e3)}}})});e("#theme_2_send_btn").on("click",function(){e("#theme_2_send_container").toggle("slow");e("#theme_2_send_to").focus()});e("#theme_2_send_btn_cancel").on("click",function(){e("#theme_2_send_container").hide("slow")});e("#theme_2_send_btn_ok").on("click",function(){var t=jQuery("#theme_2_send_to").val().trim();if(t.indexOf("@")==-1||t.indexOf(".")<1){alert("Invalid email(s).");e("#theme_2_send_to").focus();return}var n="#orbisius_ctc_theme_editor_theme_2_form";var r="send_theme";var i=".orbisius_ctc_theme_editor_theme_2_primary_buttons .status";jQuery(i).empty().removeClass("app-alert-success app-alert-error app-alert-notice").addClass("app-alert-notice").html("Processing ...");jQuery.ajax({type:"post",url:ajaxurl,data:jQuery(n).serialize()+"&action=orbisius_ctc_theme_editor_ajax&sub_cmd="+escape(r),success:function(t){jQuery(i).empty().removeClass("app-alert-notice").html(t.msg).addClass(t.status?"app-alert-success":"app-alert-error");if(t.status){setTimeout(function(){jQuery(i).empty().removeClass("app-alert-success app-alert-error");e("#theme_2_send_btn_cancel").click()},2e3)}}})});e("#theme_1_new_folder_btn").on("click",function(){e("#theme_1_new_folder_container").toggle("slow");e("#theme_1_new_folder").focus()});e("#theme_2_new_folder_btn").on("click",function(){e("#theme_2_new_folder_container").toggle("slow");e("#theme_2_new_folder").focus()});e("#theme_1_new_folder").on("input",function(t){var n=e("#theme_1_new_folder").val();n=orbisius_child_theme_creator.sanitize_file_name(n);var r=1;e("#theme_1_file option").each(function(){var t=e(this).val();if(t==n){r=0;return}});if(r){e(".status",e("#theme_1_new_folder_container")).text("").removeClass("app-alert-error")}else{var i="File/folder with that name already exists.";e(".status",e("#theme_1_new_folder_container")).text(i).addClass("app-alert-error")}});e("#theme_2_new_folder").on("input",function(t){var n=e("#theme_2_new_folder").val();n=orbisius_child_theme_creator.sanitize_file_name(n);var r=1;e("#theme_2_file option").each(function(){var t=e(this).val();if(t==n){r=0;return}});if(r){e(".status",e("#theme_2_new_folder_container")).text("").removeClass("app-alert-error")}else{var i="File/folder with that name already exists.";e(".status",e("#theme_2_new_folder_container")).text(i).addClass("app-alert-error")}});e("#theme_1_new_folder_btn_ok").on("click",function(){var t=e("#theme_1_new_folder").val();t=orbisius_child_theme_creator.sanitize_file_name(t);var n=t;if(t==""){alert("Invalid or empty value for folder name.");e("#theme_1_new_folder").focus();return}var r=1;e("#theme_1_folder option").each(function(){var n=e(this).val();if(n==t){r=0;return}});if(!r){alert("File with that name already exists.");e("#theme_1_new_folder").focus();return}e("select theme_1_folder").prop("selected",false);var i=e("<option></option>").val(t).html(n).prop("selected",true);e("#theme_1_folder").append(i);e("#theme_1_new_folder_container").hide("slow");e("#theme_1_new_folder").val("");e("#theme_1_folder_contents").val("").focus()});e("#theme_1_new_folder_btn_cancel").on("click",function(){e("#theme_1_new_folder").val("");e("#theme_1_new_folder_container").hide("slow");e(".status",e("#theme_1_new_folder_container")).text("").removeClass("app-alert-error")});e("#theme_2_new_folder_btn_ok").on("click",function(){var t=e("#theme_2_new_folder").val();t=orbisius_child_theme_creator.sanitize_file_name(t);var n=t;if(t==""){alert("Invalid or empty value for folder name.");e("#theme_2_new_folder").focus();return}var r=1;e("#theme_2_folder option").each(function(){var n=e(this).val();if(n==t){r=0;return}});if(!r){alert("File with that name already exists.");e("#theme_2_new_folder").focus();return}e("select theme_2_folder").prop("selected",false);var i=e("<option></option>").val(t).html(n).prop("selected",true);e("#theme_2_folder").append(i);e("#theme_2_new_folder_container").hide("slow");e("#theme_2_new_folder").val("");e("#theme_2_folder_contents").val("").focus()});e("#theme_2_new_folder_btn_cancel").on("click",function(){e("#theme_2_new_folder").val("");e("#theme_2_new_folder_container").hide("slow");e(".status",e("#theme_2_new_folder_container")).text("").removeClass("app-alert-error")});e("#theme_1").on("change",function(){app_load("#orbisius_ctc_theme_editor_theme_1_form","generate_dropdown","#theme_1_file",app_handle_theme_change)});e("#theme_2").on("change",function(){app_load("#orbisius_ctc_theme_editor_theme_2_form","generate_dropdown","#theme_2_file",app_handle_theme_change)});e("#orbisius_ctc_theme_editor_theme_1_form").submit(function(){app_load("#orbisius_ctc_theme_editor_theme_1_form","save_file","#theme_1_file_contents");return false});var t=e("#theme_2").val();if(t!=""){app_load("#orbisius_ctc_theme_editor_theme_2_form","generate_dropdown","#theme_2_file",app_handle_theme_change)}e("#theme_2").on("change",function(){app_load("#orbisius_ctc_theme_editor_theme_2_form","generate_dropdown","#theme_2_file",app_handle_theme_change)});e("#orbisius_ctc_theme_editor_theme_2_form").submit(function(){app_load("#orbisius_ctc_theme_editor_theme_2_form","save_file","#theme_2_file_contents");return false})}function app_handle_theme_change(e,t,n,r){var i=jQuery(e)?jQuery(e).attr("id"):"";i=i||"";if(i==""){return}i=i.replace(/.+(theme[-_]*\d+).*/,"$1");i="#"+i+"_";if(typeof OrbisiusChildThemeCreatorExt!="undefined"&&typeof OrbisiusChildThemeCreatorExt.Editors!="undefined"&&typeof OrbisiusChildThemeCreatorExt.Editors.onThemeChange!="undefined"){var s=i;var s=s.replace(/_+$/g,"");OrbisiusChildThemeCreatorExt.Editors.onThemeChange(s,jQuery(s).val())}var o=jQuery(i+"_file").val();if(o!==""){app_load(e,"load_file",i+"file_contents")}jQuery(i+"file").on("change",function(){app_load(e,"load_file",i+"file_contents")})}function app_load(e,t,n,r){var i='<span class="app-alert-notice">Loading...</span>';var s="Loading...";var o=0;var u=t.indexOf("save")>=0;if(u){if(jQuery(n).is("input,textarea")){jQuery(n).attr("readonly","readonly");jQuery(n).addClass("saving_action")}jQuery(".status",jQuery(n).parent()).html(i)}else{if(jQuery(n).is("input,textarea")){jQuery(n).val(s);jQuery(n).addClass("saving_action")}else if(jQuery(n).is("select")){jQuery(n+" option").text(s)}else{jQuery(n).html(i)}}jQuery.ajax({type:"post",url:ajaxurl,data:jQuery(e).serialize()+"&action=orbisius_ctc_theme_editor_ajax&sub_cmd="+escape(t),success:function(i){if(i!=""){if(jQuery(n).is("input,textarea")){jQuery(n).val(i)}else{jQuery(n).html(i)}if(u){jQuery(".status",jQuery(n).parent()).html("Saved.").addClass("app-alert-success");setTimeout(function(){jQuery(".status",jQuery(n).parent()).empty().removeClass("app-alert-success app-alert-error")},2e3)}}else if(u){jQuery(".status",jQuery(n).parent()).html("Oops. Cannot save.").addClass("app-alert-error")}if(typeof r!="undefined"){r(e,t,n,i)}},complete:function(e){jQuery(n).removeClass("saving_action");if(u){if(jQuery(n).is("input,textarea")){jQuery(n).removeAttr("readonly")}}}})}var orbisius_child_theme_creator={sanitize_file_name:function(e){e=e.replace(/[^\w-.\s]/ig,"");e=e.replace(/\s+/ig,"-");e=e.replace(/\.+/ig,".");e=e.replace(/-+/ig,"-");e=e.replace(/_+/ig,"_");e=e.replace(/^[._-]+/ig,"");e=e.replace(/[._-]+$/ig,"");e=jQuery.trim(e);return e},delete_file:function(e,t){jQuery.ajax({type:"post",url:ajaxurl,data:jQuery(t).serialize()+"&action=orbisius_ctc_theme_editor_ajax&sub_cmd="+escape("delete_file"),success:function(e){var n=t.indexOf("#theme_1")>=0?1:2;jQuery("#theme_"+n+"_file option:selected").remove();jQuery("#theme_"+n+"_file").trigger("change")}})}};jQuery(document).ready(function(e){orbisius_ctc_theme_editor_setup()})
orbisius-child-theme-creator.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Orbisius Child Theme Creator
4
  Plugin URI: http://club.orbisius.com/products/wordpress-plugins/orbisius-child-theme-creator/
5
  Description: This plugin allows you to quickly create child themes from any theme that you have currently installed on your site/blog.
6
- Version: 1.1.8
7
  Author: Svetoslav Marinov (Slavi)
8
  Author URI: http://orbisius.com
9
  */
@@ -30,7 +30,7 @@ add_action('admin_init', 'orbisius_child_theme_creator_admin_init');
30
  add_action('admin_init', 'orbisius_child_theme_creator_register_settings');
31
  add_action('admin_enqueue_scripts', 'orbisius_child_theme_creator_admin_enqueue_scripts');
32
  add_action('admin_menu', 'orbisius_child_theme_creator_setup_admin');
33
- add_action('network_admin_menu', 'orbisius_child_theme_creator_setup_admin');
34
  add_action('wp_footer', 'orbisius_child_theme_creator_add_plugin_credits', 1000); // be the last in the footer
35
  add_action('admin_notices', 'orbisius_child_theme_creator_admin_notice_message');
36
  add_action('network_admin_notices', 'orbisius_child_theme_creator_admin_notice_message');
@@ -223,8 +223,7 @@ function orbisius_child_theme_creator_admin_enqueue_scripts($current_page = '')
223
  return ;
224
  }
225
 
226
- $dev = empty($_SERVER['DEV_ENV']) ? 0 : 1;
227
- $suffix = $dev ? '' : '.min';
228
 
229
  wp_register_style('orbisius_child_theme_creator', plugins_url("/assets/main{$suffix}.css", __FILE__), false,
230
  filemtime( plugin_dir_path( __FILE__ ) . "/assets/main{$suffix}.css" ) );
@@ -249,8 +248,8 @@ function orbisius_child_theme_creator_setup_admin() {
249
  add_theme_page('Orbisius Child Theme Creator', 'Orbisius Child Theme Creator', 'manage_options',
250
  'orbisius_child_theme_creator_themes_action', 'orbisius_child_theme_creator_tools_action');
251
 
252
- add_submenu_page('tools.php', 'Orbisius Child Theme Creator', 'Orbisius Child Theme Creator', 'manage_options',
253
- 'orbisius_child_theme_creator_tools_action', 'orbisius_child_theme_creator_tools_action');
254
 
255
  // when plugins are show add a settings link near my plugin for a quick access to the settings page.
256
  add_filter('plugin_action_links', 'orbisius_child_theme_creator_add_plugin_settings_link', 10, 2);
@@ -438,6 +437,22 @@ function orbisius_child_theme_creator_settings_page() {
438
  </div> <!-- .inside -->
439
  </div> <!-- .postbox -->
440
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
441
  <div class="postbox">
442
  <div class="inside">
443
  <!-- Twitter: code -->
@@ -455,10 +470,13 @@ function orbisius_child_theme_creator_settings_page() {
455
  <a href="https://twitter.com/share" class="twitter-share-button"
456
  data-lang="en" data-text="Checkout Like Gate Pro #WordPress #plugin.Increase your site & fb page's likes"
457
  data-count="none" data-via="orbisius" data-related="orbisius"
458
- data-url="http://club.orbisius.com/products/wordpress-plugins/orbisius-child-theme-creator/">Tweet</a>
459
  <!-- /Twitter: Tweet:js -->
460
 
 
461
  <br/>
 
 
462
  <span>Support: <a href="http://club.orbisius.com/forums/forum/community-support-forum/wordpress-plugins/orbisius-child-theme-creator/?utm_source=orbisius-child-theme-creator&utm_medium=plugin-settings&utm_campaign=product"
463
  target="_blank" title="[new window]">Forums</a>
464
 
@@ -735,7 +753,7 @@ function orbisius_child_theme_creator_tools_action() {
735
  update_site_option( 'allowedthemes', $allowed_themes );
736
  }
737
  } catch (Exception $e) {
738
- $errors[] = "There was an error during the chat installation.";
739
  $errors[] = $e->getMessage();
740
 
741
  if (is_object($installer->result)) {
@@ -1759,7 +1777,9 @@ function orbisius_ctc_theme_editor() {
1759
  <button type="button" class='button' id="theme_1_syntax_chk_btn" name="theme_1_syntax_chk_btn">PHP Syntax Check</button>
1760
  <button type="button" class='button' id="theme_1_send_btn" name="theme_1_send_btn">Send</button>
1761
  <a href="<?php echo site_url('/');?>" class='button' target="_blank" title="new tab/window"
1762
- id="theme_1_site_preview_btn" name="theme_1_site_preview_btn">View Site</button>
 
 
1763
 
1764
  <!--
1765
  <button type="button" class='button' id="theme_1_new_folder_btn" name="theme_1_new_folder_btn">New Folder</button>-->
@@ -1792,6 +1812,15 @@ function orbisius_ctc_theme_editor() {
1792
  </div>
1793
  <!-- /send -->
1794
 
 
 
 
 
 
 
 
 
 
1795
 
1796
  <!-- new folder -->
1797
  <!--
@@ -1821,10 +1850,51 @@ function orbisius_ctc_theme_editor() {
1821
  </span>
1822
 
1823
  <textarea id="theme_2_file_contents" name="theme_2_file_contents" rows="22" class="widefat"></textarea>
1824
- <div class="primary_buttons">
1825
  <button type='submit' class='button button-primary' id="theme_2_submit" name="theme_2_submit">Save Changes</button>
1826
  <span class="status"></span>
1827
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1828
  </form>
1829
  </td>
1830
  </tr>
3
  Plugin Name: Orbisius Child Theme Creator
4
  Plugin URI: http://club.orbisius.com/products/wordpress-plugins/orbisius-child-theme-creator/
5
  Description: This plugin allows you to quickly create child themes from any theme that you have currently installed on your site/blog.
6
+ Version: 1.1.9
7
  Author: Svetoslav Marinov (Slavi)
8
  Author URI: http://orbisius.com
9
  */
30
  add_action('admin_init', 'orbisius_child_theme_creator_register_settings');
31
  add_action('admin_enqueue_scripts', 'orbisius_child_theme_creator_admin_enqueue_scripts');
32
  add_action('admin_menu', 'orbisius_child_theme_creator_setup_admin');
33
+ add_action('network_admin_menu', 'orbisius_child_theme_creator_setup_admin'); // manage_network_themes
34
  add_action('wp_footer', 'orbisius_child_theme_creator_add_plugin_credits', 1000); // be the last in the footer
35
  add_action('admin_notices', 'orbisius_child_theme_creator_admin_notice_message');
36
  add_action('network_admin_notices', 'orbisius_child_theme_creator_admin_notice_message');
223
  return ;
224
  }
225
 
226
+ $suffix = empty($_SERVER['DEV_ENV']) ? '.min' : '';
 
227
 
228
  wp_register_style('orbisius_child_theme_creator', plugins_url("/assets/main{$suffix}.css", __FILE__), false,
229
  filemtime( plugin_dir_path( __FILE__ ) . "/assets/main{$suffix}.css" ) );
248
  add_theme_page('Orbisius Child Theme Creator', 'Orbisius Child Theme Creator', 'manage_options',
249
  'orbisius_child_theme_creator_themes_action', 'orbisius_child_theme_creator_tools_action');
250
 
251
+ /*add_submenu_page('tools.php', 'Orbisius Child Theme Creator', 'Orbisius Child Theme Creator', 'manage_options',
252
+ 'orbisius_child_theme_creator_tools_action', 'orbisius_child_theme_creator_tools_action');*/
253
 
254
  // when plugins are show add a settings link near my plugin for a quick access to the settings page.
255
  add_filter('plugin_action_links', 'orbisius_child_theme_creator_add_plugin_settings_link', 10, 2);
437
  </div> <!-- .inside -->
438
  </div> <!-- .postbox -->
439
 
440
+ <?php
441
+ $plugin_data = get_plugin_data(__FILE__);
442
+ $product_name = trim($plugin_data['PluginName']);
443
+ $product_page = trim($plugin_data['PluginURI']);
444
+ $product_descr = trim($plugin_data['Description']);
445
+ $product_descr_short = substr($product_descr, 0, 50) . '...';
446
+
447
+ $base_name_slug = basename(__FILE__);
448
+ $base_name_slug = str_replace('.php', '', $base_name_slug);
449
+ $product_page .= (strpos($product_page, '?') === false) ? '?' : '&';
450
+ $product_page .= "utm_source=$base_name_slug&utm_medium=plugin-settings&utm_campaign=product";
451
+
452
+ $product_page_tweet_link = $product_page;
453
+ $product_page_tweet_link = str_replace('plugin-settings', 'tweet', $product_page_tweet_link);
454
+ ?>
455
+
456
  <div class="postbox">
457
  <div class="inside">
458
  <!-- Twitter: code -->
470
  <a href="https://twitter.com/share" class="twitter-share-button"
471
  data-lang="en" data-text="Checkout Like Gate Pro #WordPress #plugin.Increase your site & fb page's likes"
472
  data-count="none" data-via="orbisius" data-related="orbisius"
473
+ data-url="<?php echo $product_page_tweet_link;?>">Tweet</a>
474
  <!-- /Twitter: Tweet:js -->
475
 
476
+
477
  <br/>
478
+ <a href="<?php echo $product_page; ?>" target="_blank" title="[new window]">Product Page</a>
479
+ |
480
  <span>Support: <a href="http://club.orbisius.com/forums/forum/community-support-forum/wordpress-plugins/orbisius-child-theme-creator/?utm_source=orbisius-child-theme-creator&utm_medium=plugin-settings&utm_campaign=product"
481
  target="_blank" title="[new window]">Forums</a>
482
 
753
  update_site_option( 'allowedthemes', $allowed_themes );
754
  }
755
  } catch (Exception $e) {
756
+ $errors[] = "There was an error during the child theme creation.";
757
  $errors[] = $e->getMessage();
758
 
759
  if (is_object($installer->result)) {
1777
  <button type="button" class='button' id="theme_1_syntax_chk_btn" name="theme_1_syntax_chk_btn">PHP Syntax Check</button>
1778
  <button type="button" class='button' id="theme_1_send_btn" name="theme_1_send_btn">Send</button>
1779
  <a href="<?php echo site_url('/');?>" class='button' target="_blank" title="new tab/window"
1780
+ id="theme_1_site_preview_btn" name="theme_1_site_preview_btn">View Site</a>
1781
+
1782
+ <?php do_action('orbisius_child_theme_creator_editors_ext_actions', 'theme_1'); ?>
1783
 
1784
  <!--
1785
  <button type="button" class='button' id="theme_1_new_folder_btn" name="theme_1_new_folder_btn">New Folder</button>-->
1812
  </div>
1813
  <!-- /send -->
1814
 
1815
+ <div>
1816
+ <h3>Premium Plugins/Addons</h3>
1817
+ <span>Please, support our work by purchasing a premium addon</span>
1818
+ <ul>
1819
+ <li><a href="http://club.orbisius.com/products/wordpress-plugins/orbisius-theme-switcher/?utm_source=orbisius-child-theme-creator&utm_medium=editors&utm_campaign=product"
1820
+ target="_blank" title="Opens in a new tab/window">Orbisius Theme Switcher</a> - Allows you to preview any of the installed themes on your site.</li>
1821
+ </ul>
1822
+ </div>
1823
+
1824
 
1825
  <!-- new folder -->
1826
  <!--
1850
  </span>
1851
 
1852
  <textarea id="theme_2_file_contents" name="theme_2_file_contents" rows="22" class="widefat"></textarea>
1853
+ <div class="orbisius_ctc_theme_editor_theme_2_primary_buttons primary_buttons">
1854
  <button type='submit' class='button button-primary' id="theme_2_submit" name="theme_2_submit">Save Changes</button>
1855
  <span class="status"></span>
1856
  </div>
1857
+
1858
+ <hr />
1859
+ <div class="orbisius_ctc_theme_editor_theme_2_secondary_buttons secondary_buttons">
1860
+ <!-- If you're looking at this code. Slavi says Hi to the curious developer! :) -->
1861
+
1862
+ <button type="button" class='button' id="theme_2_new_file_btn" name="theme_2_new_file_btn">New File</button>
1863
+ <button type="button" class='button' id="theme_2_syntax_chk_btn" name="theme_2_syntax_chk_btn">PHP Syntax Check</button>
1864
+ <button type="button" class='button' id="theme_2_send_btn" name="theme_2_send_btn">Send</button>
1865
+ <a href="<?php echo site_url('/');?>" class='button' target="_blank" title="new tab/window"
1866
+ id="theme_2_site_preview_btn" name="theme_2_site_preview_btn">View Site</a>
1867
+
1868
+ <?php do_action('orbisius_child_theme_creator_editors_ext_actions', 'theme_2'); ?>
1869
+
1870
+ <a href='javascript:void(0)' class='app-button-right app-button-negative' id="theme_2_delete_file_btn" name="theme_2_delete_file_btn">Delete File</a>
1871
+
1872
+ <div id='theme_2_new_file_container' class="theme_2_new_file_container app-hide">
1873
+ <strong>New File</strong>
1874
+ <input type="text" id="theme_2_new_file" name="theme_2_new_file" value="" />
1875
+ <span>e.g. test.js, extra.css etc</span>
1876
+ <span class="status"></span>
1877
+
1878
+ <br/>
1879
+ <button type='button' class='button button-primary' id="theme_2_new_file_btn_ok" name="theme_2_new_file_btn_ok">Save</button>
1880
+ <a href='javascript:void(0)' class='app-button-negative00 button delete' id="theme_2_new_file_btn_cancel" name="theme_2_new_file_btn_cancel">Cancel</a>
1881
+ </div>
1882
+
1883
+ <!-- send -->
1884
+ <div id='theme_2_send_container' class="theme_2_send_container app-hide">
1885
+ <p>
1886
+ Email selected theme and parent theme (if any) to yourself or a colleague.
1887
+ Separate multiple emails with commas.<br/>
1888
+ <strong>To:</strong>
1889
+ <input type="text" id="theme_2_send_to" name="email" value="" placeholder="Enter email" />
1890
+
1891
+ <button type='button' class='button button-primary' id="theme_2_send_btn_ok" name="theme_2_send_btn_ok">Send</button>
1892
+ <a href='javascript:void(0)' class='app-button-negative00 button delete'
1893
+ id="theme_2_send_btn_cancel" name="theme_2_send_btn_cancel">Cancel</a>
1894
+ </p>
1895
+ </div>
1896
+ <!-- /send -->
1897
+ </div>
1898
  </form>
1899
  </td>
1900
  </tr>
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Orbisius Child Theme Creator ===
2
  Contributors: lordspace,orbisius
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7APYDVPBCSY9A
4
- Tags: child theme, childtheme,childthemes,child themes,CSS, styling,resposive design,design,custom themeing, shared hosting, theme,themes,wp,wordpress,orbisius,theme creator
5
  Requires at least: 3.4
6
- Tested up to: 3.8.1
7
- Stable tag: 1.1.8
8
  License: GPLv2 or later
9
 
10
  This plugin allows you to quickly create child themes from any theme that you have currently installed on your site/blog.
@@ -19,7 +19,7 @@ It also creates rtl.css if exists in the parent theme.
19
  > This is not a bug in this plugin but could be caused by theme authors using custom theme frameworks and/or do not using WordPress' recommended functions for themes that support child themes.
20
  > Please check with the created of the theme first to see if their theme supports child themes.
21
 
22
- We have launched a **FREE** service that allows you to setup a test/sandbox WordPress site in seconds. No technical knowledge is required.
23
  Join today and test themes and plugins before you actually put them on your live site. For more info go to:
24
  <a href="http://qsandbox.com/?utm_source=orbisius-child-theme-creator&utm_medium=readme&utm_campaign=product" target="_blank" title="Free Test/Sandbox WordPress Site">http://qsandbox.com</a>
25
 
@@ -29,7 +29,7 @@ Join today and test themes and plugins before you actually put them on your live
29
  * Easy to use interface
30
  * When moving through the themes the currently looked one will have a nice background & border
31
  * Create *unlimited* child themes from a parent theme. The plugin will add Child 01, Child 02 etc.
32
- * Edit theme files with our double theme editor.
33
 
34
  This plugin allows you to quickly edit theme files from Appearance &gt; Orbisius Theme Editor (entry added by the same plugin)
35
  It features two editors and you can pick snippets from one theme and paste into another.
@@ -45,6 +45,7 @@ It features two editors and you can pick snippets from one theme and paste into
45
  * Since (v1.1.3) PHP syntax check
46
  * Since (v1.1.3) Send selected theme and parent theme (if any) to yourself or a colleague.
47
  * Since (v1.1.3) Implemented theme files to be listed recursively (i.e. all files from the selected theme)
 
48
 
49
  = Usage : To create a child theme go to =
50
  Go to Admin > Appearance > Orbisius Child Theme Creator then click on the theme you like and the child theme will be created for you.
@@ -53,9 +54,12 @@ Go to Admin > Appearance > Orbisius Child Theme Creator then click on the theme
53
  Go to Admin > Appearance > Orbisius Theme Editor then click on the theme you like and the child theme will be created for you.
54
 
55
  = Demo =
56
-
57
  http://www.youtube.com/watch?v=BZUVq6ZTv-o
58
 
 
 
 
 
59
  = Support =
60
  > Support is handled on our site: <a href="http://club.orbisius.com/" target="_blank" title="[new window]">http://club.orbisius.com/</a>
61
  > Please do NOT use the WordPress forums or other places to seek support.
@@ -123,6 +127,12 @@ Let's talk.
123
 
124
  == Changelog ==
125
 
 
 
 
 
 
 
126
  = 1.1.8 =
127
  * Tested with WP 3.8.1
128
 
1
  === Orbisius Child Theme Creator ===
2
  Contributors: lordspace,orbisius
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7APYDVPBCSY9A
4
+ Tags: child theme,childtheme,childthemes,child themes,CSS,styling,resposive design,design,custom themeing, shared hosting,theme editor theme,themes,wp,wordpress,orbisius,theme creator
5
  Requires at least: 3.4
6
+ Tested up to: 3.9
7
+ Stable tag: 1.1.9
8
  License: GPLv2 or later
9
 
10
  This plugin allows you to quickly create child themes from any theme that you have currently installed on your site/blog.
19
  > This is not a bug in this plugin but could be caused by theme authors using custom theme frameworks and/or do not using WordPress' recommended functions for themes that support child themes.
20
  > Please check with the created of the theme first to see if their theme supports child themes.
21
 
22
+ We launched a **FREE** service that allows you to setup a test/sandbox WordPress site in seconds. No technical knowledge is required.
23
  Join today and test themes and plugins before you actually put them on your live site. For more info go to:
24
  <a href="http://qsandbox.com/?utm_source=orbisius-child-theme-creator&utm_medium=readme&utm_campaign=product" target="_blank" title="Free Test/Sandbox WordPress Site">http://qsandbox.com</a>
25
 
29
  * Easy to use interface
30
  * When moving through the themes the currently looked one will have a nice background & border
31
  * Create *unlimited* child themes from a parent theme. The plugin will add Child 01, Child 02 etc.
32
+ * Edit theme files with our two theme editors.
33
 
34
  This plugin allows you to quickly edit theme files from Appearance &gt; Orbisius Theme Editor (entry added by the same plugin)
35
  It features two editors and you can pick snippets from one theme and paste into another.
45
  * Since (v1.1.3) PHP syntax check
46
  * Since (v1.1.3) Send selected theme and parent theme (if any) to yourself or a colleague.
47
  * Since (v1.1.3) Implemented theme files to be listed recursively (i.e. all files from the selected theme)
48
+ * Since (v1.1.9) Both editors have the same buttons (in older versions only the left editor had all of the buttons).
49
 
50
  = Usage : To create a child theme go to =
51
  Go to Admin > Appearance > Orbisius Child Theme Creator then click on the theme you like and the child theme will be created for you.
54
  Go to Admin > Appearance > Orbisius Theme Editor then click on the theme you like and the child theme will be created for you.
55
 
56
  = Demo =
 
57
  http://www.youtube.com/watch?v=BZUVq6ZTv-o
58
 
59
+ = Premium =
60
+ Do you want to be able to preview themes from within the 2 editors?
61
+ Get this <a href="http://club.orbisius.com/products/wordpress-plugins/orbisius-theme-switcher/?utm_source=orbisius-child-theme-creator&utm_medium=readme_description&utm_campaign=product" target="_blank" title="[new window]">Orbisius Theme Switcher</a> plugin
62
+
63
  = Support =
64
  > Support is handled on our site: <a href="http://club.orbisius.com/" target="_blank" title="[new window]">http://club.orbisius.com/</a>
65
  > Please do NOT use the WordPress forums or other places to seek support.
127
 
128
  == Changelog ==
129
 
130
+ = 1.1.9 =
131
+ * Added the buttons under the 2nd editor
132
+ * Hid the plugin from the Tools menu
133
+ * Integrated with <a href="http://club.orbisius.com/products/wordpress-plugins/orbisius-theme-switcher/?utm_source=orbisius-child-theme-creator&utm_medium=readme_changelog&utm_campaign=product" target="_blank" title="[new window]">Orbisius Theme Switcher</a>
134
+
135
+
136
  = 1.1.8 =
137
  * Tested with WP 3.8.1
138