diff --git a/README.md b/README.md index bf27b31..1e3c648 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,19 @@ # [Merlin WP](https://merlinwp.com) #### Better WordPress Theme Onboarding -Merlin WP is my stab at addressing the tedious and exhausting WordPress theme setup and onboarding process. It makes installing a new WordPress theme, its recommended WordPress plugins, Customizer settings, widgets, and demo content, an exciting and gratifying user experience. Read about it here: https://richtabor.com/merlin-wp +Merlin WP is my stab at addressing the tedious and exhausting WordPress theme setup and onboarding process. It makes installing a new WordPress theme, its recommended WordPress plugins, Customizer settings, widgets, and demo content, an exciting and gratifying user experience. + +Read about Merlin WP here: https://richtabor.com/merlin-wp + +## Beta & Testing + +Merlin WP is currently in beta, it's not suggested to use Merlin WP in live products just yet. There's still a few kinks and features to be added. If you run into anything, raise an [issue](https://github.com/richtabor/MerlinWP/issues) and let's work on it. + +In the package, I've included a fork of one of my themes, [York Pro](https://themebeans.com/themes/york-pro), with Merlin WP already integrated. If you want to run a live test of Merlin WP, install this theme anywhere and give it a spin. ## License -Merlin WP has three kinds of licenses: open-source, commercial, and OEM. +Merlin WP has three kinds of licenses: open-source, commercial, and OEM. The commercial and OEM licenses will be available once Merlin WP is out of beta. ### 1. Open Source License @@ -27,7 +35,7 @@ If you want to include Merlin WP as part of a commercial interface builder, SDK, ## Usage ### 1. Add Merlin WP to your theme -Let's get you set up to use Merlin WP! First off, download and add the add the /merlin/ folder and the merlin-config.php file into your theme. Next, include the Merlin class (`merlin/merlin.php`) and the `merlin-config.php` file. +Let's get you set up to use Merlin WP! First off, download and add the add the unzipped `/merlin/` folder (within the `/dist/` directory) and the merlin-config.php file into your theme. Next, include the Merlin class (`merlin/merlin.php`) and the `merlin-config.php` file. Refer to the example below: ``` diff --git a/assets/js/merlin.min.js b/assets/js/merlin.min.js index df5c4b0..227c44e 100755 --- a/assets/js/merlin.min.js +++ b/assets/js/merlin.min.js @@ -1 +1 @@ -var Merlin=function(n){function e(){var e=n(".merlin__body"),i=(n(".merlin__body--loading"),n(".merlin__body--exiting"),n("#merlin__drawer-trigger"));drawer_opened="merlin__drawer--open",setTimeout(function(){e.addClass("loaded")},100),i.on("click",function(){e.toggleClass(drawer_opened)}),n(".merlin__button--proceed:not(.merlin__button--closer)").click(function(n){n.preventDefault();var i=this.getAttribute("href");e.addClass("exiting"),setTimeout(function(){window.location=i},400)}),n(".merlin__button--closer").on("click",function(n){e.removeClass(drawer_opened),n.preventDefault();var i=this.getAttribute("href");setTimeout(function(){e.addClass("exiting")},600),setTimeout(function(){window.location=i},1100)}),n(".button-next").on("click",function(e){e.preventDefault();var i=s(this);if(!i)return!1;var t=n(this).data("callback");return t&&"undefined"!=typeof d[t]?(d[t](this),!1):!0})}function i(){function e(n){"undefined"!=typeof n.done?(setTimeout(function(){a.addClass("lead")},0),setTimeout(function(){a.addClass("success"),a.html(n.message)},600),t()):(a.addClass("lead error"),a.html(n.error))}function i(){jQuery.post(merlin_params.ajaxurl,{action:"merlin_child_theme",wpnonce:merlin_params.wpnonce},e).fail(e)}var t,o=n(".merlin__body"),a=n("#child-theme-text");return{init:function(e){t=function(){setTimeout(function(){n(".merlin__body").addClass("js--finished")},1500),o.removeClass(drawer_opened),setTimeout(function(){n(".merlin__body").addClass("exiting")},3500),setTimeout(function(){window.location.href=e.href},4e3)},i()}}}function t(){function e(n){"undefined"!=typeof n.done?(setTimeout(function(){a.addClass("lead")},0),setTimeout(function(){a.addClass("success"),a.html(n.message)},600),t()):(a.addClass("lead error"),a.html(n.error))}function i(){childThemeName=n("#theme_license_key").val(),jQuery.post(merlin_params.ajaxurl,{action:"merlin_activate_license",wpnonce:merlin_params.wpnonce,cThemeName:childThemeName},e).fail(e)}var t,o=n(".merlin__body"),a=n("#child-theme-text");return{init:function(e){t=function(){setTimeout(function(){n(".merlin__body").addClass("js--finished")},1500),o.removeClass(drawer_opened),setTimeout(function(){n(".merlin__body").addClass("exiting")},3500),setTimeout(function(){window.location.href=e.href},4e3)},i()}}}function o(){function e(n){"object"==typeof n&&"undefined"!=typeof n.message?(a.find("span").text(n.message),"undefined"!=typeof n.url?n.hash==l?(a.find("span").text("failed"),t()):(l=n.hash,jQuery.post(n.url,n,function(n){i()}).fail(e)):("undefined"!=typeof n.done,t())):(a.find("span").text("Success"),t())}function i(){d&&jQuery.post(merlin_params.ajaxurl,{action:"merlin_plugins",wpnonce:merlin_params.wpnonce,slug:d},e).fail(e)}function t(){var e=!1;a&&(a.data("done_item")||(r++,a.data("done_item",1)),a.find(".spinner").css("visibility","hidden"));var t=n(".merlin__drawer--install-plugins li");t.each(function(){""==d||e?(d=n(this).data("slug"),a=n(this),i(),e=!1):n(this).data("slug")==d&&(e=!0)}),r>=t.length&&o()}var o,a,s=n(".merlin__body"),r=0,d="",l="";return{init:function(e){n(".merlin__drawer--install-plugins").addClass("installing"),o=function(){setTimeout(function(){n(".merlin__body").addClass("js--finished")},1e3),s.removeClass(drawer_opened),setTimeout(function(){n(".merlin__body").addClass("exiting")},3e3),setTimeout(function(){window.location.href=e.href},3500)},t()}}}function a(){function e(n){var i=a.find("label");"object"==typeof n&&"undefined"!=typeof n.message?(i.addClass(n.message.toLowerCase()),"undefined"!=typeof n.url?n.hash===l?(i.addClass("status--failed"),t()):(l=n.hash,jQuery.post(n.url,n,e).fail(e)):("undefined"!=typeof n.done,t())):(console.log(n),i.addClass("status--error"),t())}function i(){if(d){var n=a.find("input:checkbox");n.is(":checked")?jQuery.post(merlin_params.ajaxurl,{action:"merlin_content",wpnonce:merlin_params.wpnonce,content:d},e).fail(e):(a.addClass("skipping"),setTimeout(t,300))}}function t(){var e=!1;a&&(a.data("done_item")||(r++,a.data("done_item",1)),a.find(".spinner").css("visibility","hidden"));var t=n(".merlin__drawer--import-content__list-item");n(".merlin__drawer--import-content__list-item input:checked");t.each(function(){""==d||e?(d=n(this).data("content"),a=n(this),i(),e=!1):n(this).data("content")==d&&(e=!0)}),r>=t.length&&o()}var o,a,s=n(".merlin__body"),r=0,d="",l="";return{init:function(e){n(".merlin__drawer--import-content").addClass("installing"),n(".merlin__drawer--import-content").find("input").prop("disabled",!0),o=function(){setTimeout(function(){s.removeClass(drawer_opened)},500),setTimeout(function(){n(".merlin__body").addClass("js--finished")},1500),setTimeout(function(){n(".merlin__body").addClass("exiting")},3400),setTimeout(function(){window.location.href=e.href},4e3)},t()}}}function s(n){var e=jQuery(n);if("yes"==e.data("done-loading"))return!1;var i=!1;e.is("input")||e.is("button")?"val":"text";return e.data("done-loading","yes"),e.addClass("merlin__button--loading"),{done:function(){i=!0,e.attr("disabled",!1)}}}var r,d={install_child:function(n){var e=new i;e.init(n)},activate_license:function(n){var e=new t;e.init(n)},install_plugins:function(n){var e=new o;e.init(n)},install_content:function(n){var e=new a;e.init(n)}};return{init:function(){r=this,n(e)},callback:function(n){console.log(n),console.log(this)}}}(jQuery);Merlin.init();var Merlin=function(n){function e(){var e=n(".merlin__body"),i=(n(".merlin__body--loading"),n(".merlin__body--exiting"),n("#merlin__drawer-trigger"));drawer_opened="merlin__drawer--open",setTimeout(function(){e.addClass("loaded")},100),i.on("click",function(){e.toggleClass(drawer_opened)}),n(".merlin__button--proceed:not(.merlin__button--closer)").click(function(n){n.preventDefault();var i=this.getAttribute("href");e.addClass("exiting"),setTimeout(function(){window.location=i},400)}),n(".merlin__button--closer").on("click",function(n){e.removeClass(drawer_opened),n.preventDefault();var i=this.getAttribute("href");setTimeout(function(){e.addClass("exiting")},600),setTimeout(function(){window.location=i},1100)}),n(".button-next").on("click",function(e){e.preventDefault();var i=s(this);if(!i)return!1;var t=n(this).data("callback");return t&&"undefined"!=typeof d[t]?(d[t](this),!1):!0})}function i(){function e(n){"undefined"!=typeof n.done?(setTimeout(function(){a.addClass("lead")},0),setTimeout(function(){a.addClass("success"),a.html(n.message)},600),t()):(a.addClass("lead error"),a.html(n.error))}function i(){jQuery.post(merlin_params.ajaxurl,{action:"merlin_child_theme",wpnonce:merlin_params.wpnonce},e).fail(e)}var t,o=n(".merlin__body"),a=n("#child-theme-text");return{init:function(e){t=function(){setTimeout(function(){n(".merlin__body").addClass("js--finished")},1500),o.removeClass(drawer_opened),setTimeout(function(){n(".merlin__body").addClass("exiting")},3500),setTimeout(function(){window.location.href=e.href},4e3)},i()}}}function t(){function e(n){"undefined"!=typeof n.done?(setTimeout(function(){a.addClass("lead")},0),setTimeout(function(){a.addClass("success"),a.html(n.message)},600),t()):(a.addClass("lead error"),a.html(n.error))}function i(){childThemeName=n("#theme_license_key").val(),jQuery.post(merlin_params.ajaxurl,{action:"merlin_activate_license",wpnonce:merlin_params.wpnonce,cThemeName:childThemeName},e).fail(e)}var t,o=n(".merlin__body"),a=n("#child-theme-text");return{init:function(e){t=function(){setTimeout(function(){n(".merlin__body").addClass("js--finished")},1500),o.removeClass(drawer_opened),setTimeout(function(){n(".merlin__body").addClass("exiting")},3500),setTimeout(function(){window.location.href=e.href},4e3)},i()}}}function o(){function e(n){"object"==typeof n&&"undefined"!=typeof n.message?(a.find("span").text(n.message),"undefined"!=typeof n.url?n.hash==l?(a.find("span").text("failed"),t()):(l=n.hash,jQuery.post(n.url,n,function(n){i()}).fail(e)):("undefined"!=typeof n.done,t())):(a.find("span").text("Success"),t())}function i(){d&&jQuery.post(merlin_params.ajaxurl,{action:"merlin_plugins",wpnonce:merlin_params.wpnonce,slug:d},e).fail(e)}function t(){var e=!1;a&&(a.data("done_item")||(r++,a.data("done_item",1)),a.find(".spinner").css("visibility","hidden"));var t=n(".merlin__drawer--install-plugins li");t.each(function(){""==d||e?(d=n(this).data("slug"),a=n(this),i(),e=!1):n(this).data("slug")==d&&(e=!0)}),r>=t.length&&o()}var o,a,s=n(".merlin__body"),r=0,d="",l="";return{init:function(e){n(".merlin__drawer--install-plugins").addClass("installing"),o=function(){setTimeout(function(){n(".merlin__body").addClass("js--finished")},1e3),s.removeClass(drawer_opened),setTimeout(function(){n(".merlin__body").addClass("exiting")},3e3),setTimeout(function(){window.location.href=e.href},3500)},t()}}}function a(){function e(n){var i=a.find("label");"object"==typeof n&&"undefined"!=typeof n.message?(i.addClass(n.message.toLowerCase()),"undefined"!=typeof n.url?n.hash===l?(i.addClass("status--failed"),t()):(l=n.hash,jQuery.post(n.url,n,e).fail(e)):("undefined"!=typeof n.done,t())):(console.log(n),i.addClass("status--error"),t())}function i(){if(d){var n=a.find("input:checkbox");n.is(":checked")?jQuery.post(merlin_params.ajaxurl,{action:"merlin_content",wpnonce:merlin_params.wpnonce,content:d},e).fail(e):(a.addClass("skipping"),setTimeout(t,300))}}function t(){var e=!1;a&&(a.data("done_item")||(r++,a.data("done_item",1)),a.find(".spinner").css("visibility","hidden"));var t=n(".merlin__drawer--import-content__list-item");n(".merlin__drawer--import-content__list-item input:checked"),t.each(function(){""==d||e?(d=n(this).data("content"),a=n(this),i(),e=!1):n(this).data("content")==d&&(e=!0)}),r>=t.length&&o()}var o,a,s=n(".merlin__body"),r=0,d="",l="";return{init:function(e){n(".merlin__drawer--import-content").addClass("installing"),n(".merlin__drawer--import-content").find("input").prop("disabled",!0),o=function(){setTimeout(function(){s.removeClass(drawer_opened)},500),setTimeout(function(){n(".merlin__body").addClass("js--finished")},1500),setTimeout(function(){n(".merlin__body").addClass("exiting")},3400),setTimeout(function(){window.location.href=e.href},4e3)},t()}}}function s(n){var e=jQuery(n);if("yes"==e.data("done-loading"))return!1;var i=!1;return e.is("input")||e.is("button")?"val":"text",e.data("done-loading","yes"),e.addClass("merlin__button--loading"),{done:function(){i=!0,e.attr("disabled",!1)}}}var r,d={install_child:function(n){var e=new i;e.init(n)},activate_license:function(n){var e=new t;e.init(n)},install_plugins:function(n){var e=new o;e.init(n)},install_content:function(n){var e=new a;e.init(n)}};return{init:function(){r=this,n(e)},callback:function(n){console.log(n),console.log(this)}}}(jQuery);Merlin.init(); \ No newline at end of file +var Merlin=function(n){function e(){var e=n(".merlin__body"),i=(n(".merlin__body--loading"),n(".merlin__body--exiting"),n("#merlin__drawer-trigger"));drawer_opened="merlin__drawer--open",setTimeout(function(){e.addClass("loaded")},100),i.on("click",function(){e.toggleClass(drawer_opened)}),n(".merlin__button--proceed:not(.merlin__button--closer)").click(function(n){n.preventDefault();var i=this.getAttribute("href");e.addClass("exiting"),setTimeout(function(){window.location=i},400)}),n(".merlin__button--closer").on("click",function(n){e.removeClass(drawer_opened),n.preventDefault();var i=this.getAttribute("href");setTimeout(function(){e.addClass("exiting")},600),setTimeout(function(){window.location=i},1100)}),n(".button-next").on("click",function(e){e.preventDefault();var i=s(this);if(!i)return!1;var t=n(this).data("callback");return t&&"undefined"!=typeof d[t]?(d[t](this),!1):!0})}function i(){function e(n){"undefined"!=typeof n.done?(setTimeout(function(){a.addClass("lead")},0),setTimeout(function(){a.addClass("success"),a.html(n.message)},600),t()):(a.addClass("lead error"),a.html(n.error))}function i(){jQuery.post(merlin_params.ajaxurl,{action:"merlin_child_theme",wpnonce:merlin_params.wpnonce},e).fail(e)}var t,o=n(".merlin__body"),a=n("#child-theme-text");return{init:function(e){t=function(){setTimeout(function(){n(".merlin__body").addClass("js--finished")},1500),o.removeClass(drawer_opened),setTimeout(function(){n(".merlin__body").addClass("exiting")},3500),setTimeout(function(){window.location.href=e.href},4e3)},i()}}}function t(){function e(n){"undefined"!=typeof n.done?(setTimeout(function(){a.addClass("lead")},0),setTimeout(function(){a.addClass("success"),a.html(n.message)},600),t()):(a.addClass("lead error"),a.html(n.error))}function i(){childThemeName=n("#theme_license_key").val(),jQuery.post(merlin_params.ajaxurl,{action:"merlin_activate_license",wpnonce:merlin_params.wpnonce,cThemeName:childThemeName},e).fail(e)}var t,o=n(".merlin__body"),a=n("#child-theme-text");return{init:function(e){t=function(){setTimeout(function(){n(".merlin__body").addClass("js--finished")},1500),o.removeClass(drawer_opened),setTimeout(function(){n(".merlin__body").addClass("exiting")},3500),setTimeout(function(){window.location.href=e.href},4e3)},i()}}}function o(){function e(n){"object"==typeof n&&"undefined"!=typeof n.message?(a.find("span").text(n.message),"undefined"!=typeof n.url?n.hash==l?(a.find("span").text("failed"),t()):(l=n.hash,jQuery.post(n.url,n,function(n){i()}).fail(e)):("undefined"!=typeof n.done,t())):(a.find("span").text("Success"),t())}function i(){d&&jQuery.post(merlin_params.ajaxurl,{action:"merlin_plugins",wpnonce:merlin_params.wpnonce,slug:d},e).fail(e)}function t(){var e=!1;a&&(a.data("done_item")||(r++,a.data("done_item",1)),a.find(".spinner").css("visibility","hidden"));var t=n(".merlin__drawer--install-plugins li");t.each(function(){""==d||e?(d=n(this).data("slug"),a=n(this),i(),e=!1):n(this).data("slug")==d&&(e=!0)}),r>=t.length&&o()}var o,a,s=n(".merlin__body"),r=0,d="",l="";return{init:function(e){n(".merlin__drawer--install-plugins").addClass("installing"),o=function(){setTimeout(function(){n(".merlin__body").addClass("js--finished")},1e3),s.removeClass(drawer_opened),setTimeout(function(){n(".merlin__body").addClass("exiting")},3e3),setTimeout(function(){window.location.href=e.href},3500)},t()}}}function a(){function e(n){var i=a.find("label");"object"==typeof n&&"undefined"!=typeof n.message?(i.addClass(n.message.toLowerCase()),"undefined"!=typeof n.url?n.hash===l?(i.addClass("status--failed"),t()):(l=n.hash,jQuery.post(n.url,n,e).fail(e)):("undefined"!=typeof n.done,t())):(console.log(n),i.addClass("status--error"),t())}function i(){if(d){var n=a.find("input:checkbox");n.is(":checked")?jQuery.post(merlin_params.ajaxurl,{action:"merlin_content",wpnonce:merlin_params.wpnonce,content:d},e).fail(e):(a.addClass("skipping"),setTimeout(t,300))}}function t(){var e=!1;a&&(a.data("done_item")||(r++,a.data("done_item",1)),a.find(".spinner").css("visibility","hidden"));var t=n(".merlin__drawer--import-content__list-item");n(".merlin__drawer--import-content__list-item input:checked");t.each(function(){""==d||e?(d=n(this).data("content"),a=n(this),i(),e=!1):n(this).data("content")==d&&(e=!0)}),r>=t.length&&o()}var o,a,s=n(".merlin__body"),r=0,d="",l="";return{init:function(e){n(".merlin__drawer--import-content").addClass("installing"),n(".merlin__drawer--import-content").find("input").prop("disabled",!0),o=function(){setTimeout(function(){s.removeClass(drawer_opened)},500),setTimeout(function(){n(".merlin__body").addClass("js--finished")},1500),setTimeout(function(){n(".merlin__body").addClass("exiting")},3400),setTimeout(function(){window.location.href=e.href},4e3)},t()}}}function s(n){var e=jQuery(n);if("yes"==e.data("done-loading"))return!1;var i=!1;e.is("input")||e.is("button")?"val":"text";return e.data("done-loading","yes"),e.addClass("merlin__button--loading"),{done:function(){i=!0,e.attr("disabled",!1)}}}var r,d={install_child:function(n){var e=new i;e.init(n)},activate_license:function(n){var e=new t;e.init(n)},install_plugins:function(n){var e=new o;e.init(n)},install_content:function(n){var e=new a;e.init(n)}};return{init:function(){r=this,n(e)},callback:function(n){console.log(n),console.log(this)}}}(jQuery);Merlin.init();var Merlin=function(n){function e(){var e=n(".merlin__body"),i=(n(".merlin__body--loading"),n(".merlin__body--exiting"),n("#merlin__drawer-trigger"));drawer_opened="merlin__drawer--open",setTimeout(function(){e.addClass("loaded")},100),i.on("click",function(){e.toggleClass(drawer_opened)}),n(".merlin__button--proceed:not(.merlin__button--closer)").click(function(n){n.preventDefault();var i=this.getAttribute("href");e.addClass("exiting"),setTimeout(function(){window.location=i},400)}),n(".merlin__button--closer").on("click",function(n){e.removeClass(drawer_opened),n.preventDefault();var i=this.getAttribute("href");setTimeout(function(){e.addClass("exiting")},600),setTimeout(function(){window.location=i},1100)}),n(".button-next").on("click",function(e){e.preventDefault();var i=s(this);if(!i)return!1;var t=n(this).data("callback");return t&&"undefined"!=typeof d[t]?(d[t](this),!1):!0})}function i(){function e(n){"undefined"!=typeof n.done?(setTimeout(function(){a.addClass("lead")},0),setTimeout(function(){a.addClass("success"),a.html(n.message)},600),t()):(a.addClass("lead error"),a.html(n.error))}function i(){jQuery.post(merlin_params.ajaxurl,{action:"merlin_child_theme",wpnonce:merlin_params.wpnonce},e).fail(e)}var t,o=n(".merlin__body"),a=n("#child-theme-text");return{init:function(e){t=function(){setTimeout(function(){n(".merlin__body").addClass("js--finished")},1500),o.removeClass(drawer_opened),setTimeout(function(){n(".merlin__body").addClass("exiting")},3500),setTimeout(function(){window.location.href=e.href},4e3)},i()}}}function t(){function e(n){"undefined"!=typeof n.done?(setTimeout(function(){a.addClass("lead")},0),setTimeout(function(){a.addClass("success"),a.html(n.message)},600),t()):(a.addClass("lead error"),a.html(n.error))}function i(){childThemeName=n("#theme_license_key").val(),jQuery.post(merlin_params.ajaxurl,{action:"merlin_activate_license",wpnonce:merlin_params.wpnonce,cThemeName:childThemeName},e).fail(e)}var t,o=n(".merlin__body"),a=n("#child-theme-text");return{init:function(e){t=function(){setTimeout(function(){n(".merlin__body").addClass("js--finished")},1500),o.removeClass(drawer_opened),setTimeout(function(){n(".merlin__body").addClass("exiting")},3500),setTimeout(function(){window.location.href=e.href},4e3)},i()}}}function o(){function e(n){"object"==typeof n&&"undefined"!=typeof n.message?(a.find("span").text(n.message),"undefined"!=typeof n.url?n.hash==l?(a.find("span").text("failed"),t()):(l=n.hash,jQuery.post(n.url,n,function(n){i()}).fail(e)):("undefined"!=typeof n.done,t())):(a.find("span").text("Success"),t())}function i(){d&&jQuery.post(merlin_params.ajaxurl,{action:"merlin_plugins",wpnonce:merlin_params.wpnonce,slug:d},e).fail(e)}function t(){var e=!1;a&&(a.data("done_item")||(r++,a.data("done_item",1)),a.find(".spinner").css("visibility","hidden"));var t=n(".merlin__drawer--install-plugins li");t.each(function(){""==d||e?(d=n(this).data("slug"),a=n(this),i(),e=!1):n(this).data("slug")==d&&(e=!0)}),r>=t.length&&o()}var o,a,s=n(".merlin__body"),r=0,d="",l="";return{init:function(e){n(".merlin__drawer--install-plugins").addClass("installing"),o=function(){setTimeout(function(){n(".merlin__body").addClass("js--finished")},1e3),s.removeClass(drawer_opened),setTimeout(function(){n(".merlin__body").addClass("exiting")},3e3),setTimeout(function(){window.location.href=e.href},3500)},t()}}}function a(){function e(n){var i=a.find("label");"object"==typeof n&&"undefined"!=typeof n.message?(i.addClass(n.message.toLowerCase()),"undefined"!=typeof n.url?n.hash===l?(i.addClass("status--failed"),t()):(l=n.hash,jQuery.post(n.url,n,e).fail(e)):("undefined"!=typeof n.done,t())):(console.log(n),i.addClass("status--error"),t())}function i(){if(d){var n=a.find("input:checkbox");n.is(":checked")?jQuery.post(merlin_params.ajaxurl,{action:"merlin_content",wpnonce:merlin_params.wpnonce,content:d},e).fail(e):(a.addClass("skipping"),setTimeout(t,300))}}function t(){var e=!1;a&&(a.data("done_item")||(r++,a.data("done_item",1)),a.find(".spinner").css("visibility","hidden"));var t=n(".merlin__drawer--import-content__list-item");n(".merlin__drawer--import-content__list-item input:checked"),t.each(function(){""==d||e?(d=n(this).data("content"),a=n(this),i(),e=!1):n(this).data("content")==d&&(e=!0)}),r>=t.length&&o()}var o,a,s=n(".merlin__body"),r=0,d="",l="";return{init:function(e){n(".merlin__drawer--import-content").addClass("installing"),n(".merlin__drawer--import-content").find("input").prop("disabled",!0),o=function(){setTimeout(function(){s.removeClass(drawer_opened)},500),setTimeout(function(){n(".merlin__body").addClass("js--finished")},1500),setTimeout(function(){n(".merlin__body").addClass("exiting")},3400),setTimeout(function(){window.location.href=e.href},4e3)},t()}}}function s(n){var e=jQuery(n);if("yes"==e.data("done-loading"))return!1;var i=!1;return e.is("input")||e.is("button")?"val":"text",e.data("done-loading","yes"),e.addClass("merlin__button--loading"),{done:function(){i=!0,e.attr("disabled",!1)}}}var r,d={install_child:function(n){var e=new i;e.init(n)},activate_license:function(n){var e=new t;e.init(n)},install_plugins:function(n){var e=new o;e.init(n)},install_content:function(n){var e=new a;e.init(n)}};return{init:function(){r=this,n(e)},callback:function(n){console.log(n),console.log(this)}}}(jQuery);Merlin.init();var Merlin=function(n){function e(){var e=n(".merlin__body"),i=(n(".merlin__body--loading"),n(".merlin__body--exiting"),n("#merlin__drawer-trigger"));drawer_opened="merlin__drawer--open",setTimeout(function(){e.addClass("loaded")},100),i.on("click",function(){e.toggleClass(drawer_opened)}),n(".merlin__button--proceed:not(.merlin__button--closer)").click(function(n){n.preventDefault();var i=this.getAttribute("href");e.addClass("exiting"),setTimeout(function(){window.location=i},400)}),n(".merlin__button--closer").on("click",function(n){e.removeClass(drawer_opened),n.preventDefault();var i=this.getAttribute("href");setTimeout(function(){e.addClass("exiting")},600),setTimeout(function(){window.location=i},1100)}),n(".button-next").on("click",function(e){e.preventDefault();var i=s(this);if(!i)return!1;var t=n(this).data("callback");return t&&"undefined"!=typeof d[t]?(d[t](this),!1):!0})}function i(){function e(n){"undefined"!=typeof n.done?(setTimeout(function(){a.addClass("lead")},0),setTimeout(function(){a.addClass("success"),a.html(n.message)},600),t()):(a.addClass("lead error"),a.html(n.error))}function i(){jQuery.post(merlin_params.ajaxurl,{action:"merlin_child_theme",wpnonce:merlin_params.wpnonce},e).fail(e)}var t,o=n(".merlin__body"),a=n("#child-theme-text");return{init:function(e){t=function(){setTimeout(function(){n(".merlin__body").addClass("js--finished")},1500),o.removeClass(drawer_opened),setTimeout(function(){n(".merlin__body").addClass("exiting")},3500),setTimeout(function(){window.location.href=e.href},4e3)},i()}}}function t(){function e(n){"undefined"!=typeof n.done?(setTimeout(function(){a.addClass("lead")},0),setTimeout(function(){a.addClass("success"),a.html(n.message)},600),t()):(a.addClass("lead error"),a.html(n.error))}function i(){childThemeName=n("#theme_license_key").val(),jQuery.post(merlin_params.ajaxurl,{action:"merlin_activate_license",wpnonce:merlin_params.wpnonce,cThemeName:childThemeName},e).fail(e)}var t,o=n(".merlin__body"),a=n("#child-theme-text");return{init:function(e){t=function(){setTimeout(function(){n(".merlin__body").addClass("js--finished")},1500),o.removeClass(drawer_opened),setTimeout(function(){n(".merlin__body").addClass("exiting")},3500),setTimeout(function(){window.location.href=e.href},4e3)},i()}}}function o(){function e(n){"object"==typeof n&&"undefined"!=typeof n.message?(a.find("span").text(n.message),"undefined"!=typeof n.url?n.hash==l?(a.find("span").text("failed"),t()):(l=n.hash,jQuery.post(n.url,n,function(n){i()}).fail(e)):("undefined"!=typeof n.done,t())):(a.find("span").text("Success"),t())}function i(){d&&jQuery.post(merlin_params.ajaxurl,{action:"merlin_plugins",wpnonce:merlin_params.wpnonce,slug:d},e).fail(e)}function t(){var e=!1;a&&(a.data("done_item")||(r++,a.data("done_item",1)),a.find(".spinner").css("visibility","hidden"));var t=n(".merlin__drawer--install-plugins li");t.each(function(){""==d||e?(d=n(this).data("slug"),a=n(this),i(),e=!1):n(this).data("slug")==d&&(e=!0)}),r>=t.length&&o()}var o,a,s=n(".merlin__body"),r=0,d="",l="";return{init:function(e){n(".merlin__drawer--install-plugins").addClass("installing"),o=function(){setTimeout(function(){n(".merlin__body").addClass("js--finished")},1e3),s.removeClass(drawer_opened),setTimeout(function(){n(".merlin__body").addClass("exiting")},3e3),setTimeout(function(){window.location.href=e.href},3500)},t()}}}function a(){function e(n){var i=a.find("label");"object"==typeof n&&"undefined"!=typeof n.message?(i.addClass(n.message.toLowerCase()),"undefined"!=typeof n.url?n.hash===l?(i.addClass("status--failed"),t()):(l=n.hash,jQuery.post(n.url,n,e).fail(e)):("undefined"!=typeof n.done,t())):(console.log(n),i.addClass("status--error"),t())}function i(){if(d){var n=a.find("input:checkbox");n.is(":checked")?jQuery.post(merlin_params.ajaxurl,{action:"merlin_content",wpnonce:merlin_params.wpnonce,content:d},e).fail(e):(a.addClass("skipping"),setTimeout(t,300))}}function t(){var e=!1;a&&(a.data("done_item")||(r++,a.data("done_item",1)),a.find(".spinner").css("visibility","hidden"));var t=n(".merlin__drawer--import-content__list-item");n(".merlin__drawer--import-content__list-item input:checked"),t.each(function(){""==d||e?(d=n(this).data("content"),a=n(this),i(),e=!1):n(this).data("content")==d&&(e=!0)}),r>=t.length&&o()}var o,a,s=n(".merlin__body"),r=0,d="",l="";return{init:function(e){n(".merlin__drawer--import-content").addClass("installing"),n(".merlin__drawer--import-content").find("input").prop("disabled",!0),o=function(){setTimeout(function(){s.removeClass(drawer_opened)},500),setTimeout(function(){n(".merlin__body").addClass("js--finished")},1500),setTimeout(function(){n(".merlin__body").addClass("exiting")},3400),setTimeout(function(){window.location.href=e.href},4e3)},t()}}}function s(n){var e=jQuery(n);if("yes"==e.data("done-loading"))return!1;var i=!1;return e.is("input")||e.is("button")?"val":"text",e.data("done-loading","yes"),e.addClass("merlin__button--loading"),{done:function(){i=!0,e.attr("disabled",!1)}}}var r,d={install_child:function(n){var e=new i;e.init(n)},activate_license:function(n){var e=new t;e.init(n)},install_plugins:function(n){var e=new o;e.init(n)},install_content:function(n){var e=new a;e.init(n)}};return{init:function(){r=this,n(e)},callback:function(n){console.log(n),console.log(this)}}}(jQuery);Merlin.init(); \ No newline at end of file diff --git a/dist/merlin.zip b/dist/merlin.zip index 2970b5a..4192ca9 100644 Binary files a/dist/merlin.zip and b/dist/merlin.zip differ diff --git a/package.json b/package.json index e5deb12..3a142e7 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "Merlin WP", "slug": "merlin-wp", "textdomain": "merlin-wp", - "version": "1.2", + "version": "0.1", "theme_uri": "https://merlinwp.com", "author": "Rich Tabor ", "author_uri": "https://merlinwp.com",