Version Description
10 August 2022 =
Tweak: Removed
Elementor\DB::is_built_with_elementor
deprecated method from Elementor 3.7.0.Fix: Post tab title tag issue
Fix: Infobox lord icon render issue
Download this release
Release Info
Developer | thehappymonster |
Plugin | Happy Addons for Elementor (Mega Menu, Post Grid, Woocommerce Product Grid, Table, Event Calendar, Slider Elementor Widget) |
Version | 3.6.3 |
Comparing to | |
See all releases |
Code changes from version 3.6.2 to 3.6.3
- assets/admin/js/dashboard.min.js +1 -1
- assets/admin/js/editor.min.js +1 -1
- assets/admin/js/template-library.min.js +1 -1
- assets/admin/js/wizard.min.js +1 -1
- changelog.txt +6 -0
- classes/ajax-handler.php +9 -3
- classes/cache-manager.php +2 -1
- classes/clone-handler.php +1 -1
- classes/widgets-manager.php +1 -1
- plugin.php +4 -4
- readme.txt +7 -1
- widgets/post-tab/widget.php +1 -0
assets/admin/js/dashboard.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
"use strict";!function(c,d){c(function(){var a=c(".ha-dashboard-tabs"),e=a.find(".ha-dashboard-tabs__nav"),i=a.find(".ha-dashboard-tabs__content"),s=c("#toplevel_page_happy-addons").find(".wp-submenu"),t=(e.on("click",".ha-dashboard-tabs__nav-item",function(a){var e=c(a.currentTarget),t=a.currentTarget.hash,n="#tab-content-"+t.substring(1),n=i.find(n);if(e.is(".nav-item-is--link"))return!0;a.preventDefault(),e.addClass("tab--is-active").siblings().removeClass("tab--is-active"),n.addClass("tab--is-active").siblings().removeClass("tab--is-active"),window.location.hash=t,s.find("a").filter(function(a,e){return t===e.hash}).parent().addClass("current").siblings().removeClass("current")}),window.location.hash&&(e.find('a[href="'+window.location.hash+'"]').click(),s.find("a").filter(function(a,e){return window.location.hash===e.hash}).parent().addClass("current").siblings().removeClass("current")),s.on("click","a",function(a){
|
1 |
+
"use strict";!function(c,d){c(function(){var a=c(".ha-dashboard-tabs"),e=a.find(".ha-dashboard-tabs__nav"),i=a.find(".ha-dashboard-tabs__content"),s=c("#toplevel_page_happy-addons").find(".wp-submenu"),t=(e.on("click",".ha-dashboard-tabs__nav-item",function(a){var e=c(a.currentTarget),t=a.currentTarget.hash,n="#tab-content-"+t.substring(1),n=i.find(n);if(e.is(".nav-item-is--link"))return!0;a.preventDefault(),e.addClass("tab--is-active").siblings().removeClass("tab--is-active"),n.addClass("tab--is-active").siblings().removeClass("tab--is-active"),window.location.hash=t,s.find("a").filter(function(a,e){return t===e.hash}).parent().addClass("current").siblings().removeClass("current")}),window.location.hash&&(e.find('a[href="'+window.location.hash+'"]').click(),s.find("a").filter(function(a,e){return window.location.hash===e.hash}).parent().addClass("current").siblings().removeClass("current")),s.on("click","a",function(a){if(!a.currentTarget.hash)return!0;a.preventDefault(),window.location.hash=a.currentTarget.hash,c(a.currentTarget).parent().addClass("current").siblings().removeClass("current"),e.find('a[href="'+a.currentTarget.hash+'"]').click()}),c("#ha-dashboard-form")),o=t.find(".ha-dashboard-widgets"),n=t.find(".ha-dashboard-btn--save"),r=(t.on("submit",function(a){a.preventDefault(),c.post({url:d.ajaxUrl,data:{nonce:d.nonce,action:d.action,data:t.serialize()},beforeSend:function(){n.text(".....").css("animation","animateTextIndent infinite 2.5s")},success:function(a){var e;a.success&&(e=setTimeout(function(){n.css("animation","").attr("disabled",!0).text(d.savedLabel),location.reload(),clearTimeout(e)},500))}})}),t.on("change keyup paste","input",function(){n.attr("disabled",!1).text(d.saveChangesLabel)}),c(".ha-action--btn").on("click",function(a){a.preventDefault();var a=c(this),e=a.data("filter"),a=a.data("action"),t=o.find(".ha-dashboard-widgets__item"),n=t.not(".item--is-pro"),i=t.filter(".item--is-pro"),s=t.not(".item--is-placeholder").find(":checkbox.ha-widget"),r=t.not(".item--is-placeholder").find(":checkbox.ha-feature");if(e)switch(e){case"free":n.show(),i.hide();break;case"pro":n.hide(),i.show();break;default:t.show()}a&&("enable"===a?s.prop("checked",!0):"disable"===a?s.prop("checked",!1):"enable_feature"===a?r.prop("checked",!0):"disable_feature"===a&&r.prop("checked",!1),s.trigger("change"),r.trigger("change"))}),c(".ha-feature-sub-title-a").magnificPopup({disableOn:700,type:"iframe",mainClass:"mfp-fade",removalDelay:160,preloader:!1,fixedContentPos:!1}),c(".btn-how-to-contribute").on("click",function(a){a.preventDefault(),c(this).next().show()}),c("#ha-dashboard-analytics-disable"));r.on("click",function(a){a.preventDefault(),c(this).next().val("true"),c.post({url:d.ajaxUrl,data:{nonce:d.nonce,action:d.action,data:t.serialize()},beforeSend:function(){r.text(".....").css("animation","animateTextIndent infinite 2.5s")},success:function(a){a.success&&location.reload()}})})})}(jQuery,window.HappyDashboard);
|
assets/admin/js/editor.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
"use strict";!function(i){window.haHasIconLibrary=function(){return elementor.helpers&&elementor.helpers.renderIcon},window.haGetFeatureLabel=function(e){var t=document.createElement("DIV");return t.innerHTML=e,20<(e=t.textContent||t.innerText||e).length?e.substring(0,20)+"...":e},window.haGetTranslated=function(e,t){return elementorCommon.translate(e,null,t,HappyAddonsEditor.i18n)},window.haGetButtonWithIcon=function(e,t){var n,
|
1 |
+
"use strict";!function(i){window.haHasIconLibrary=function(){return elementor.helpers&&elementor.helpers.renderIcon},window.haGetFeatureLabel=function(e){var t=document.createElement("DIV");return t.innerHTML=e,20<(e=t.textContent||t.innerText||e).length?e.substring(0,20)+"...":e},window.haGetTranslated=function(e,t){return elementorCommon.translate(e,null,t,HappyAddonsEditor.i18n)},window.haGetButtonWithIcon=function(e,t){var n,o,i,a,r,s=[];if(t=t||{},t=_.defaults(t,{oldIcon:"button_icon",iconPos:"button_icon_position",newIcon:"button_selected_icon",text:"button_text",link:"button_link",class:"ha-btn ha-btn--link",textClass:"ha-btn-text"}),_.isObject(e)){var d=e.model.attributes.settings.toJSON(),l=_.isUndefined(d[t.text])?"":d[t.text],c=!(_.isUndefined(d[t.oldIcon])||!d[t.oldIcon]),p=!(_.isUndefined(d[t.newIcon])||!_.isObject(d[t.newIcon])||!d[t.newIcon].value);if(l||p||c)return haHasIconLibrary()&&(n=elementor.helpers.renderIcon(e,d[t.newIcon],{"aria-hidden":!0,class:"ha-btn-icon"},"i","object"),o=elementor.helpers.isIconMigrated(d,t.newIcon)),e.addInlineEditingAttributes(t.text,"none"),e.addRenderAttribute(t.text,"class",t.textClass),e.addRenderAttribute("button","class",t.class),e.addRenderAttribute("button","href",d[t.link].url),(p||c)&&(haHasIconLibrary()&&n&&n.rendered&&(!c||o)?i="svg"===d[t.newIcon].library?'<span class="ha-btn-icon ha-btn-icon--svg">'+n.value+"</span>":n.value:c&&(i='<i class="ha-btn-icon '+t.oldIcon+'" aria-hidden="true"></i>')),!l||p||c?l||!p&&!c?l&&(p||c)&&("before"===d[t.iconPos]?(e.addRenderAttribute("button","class","ha-btn--icon-before"),a=i,r="<span "+e.getRenderAttributeString(t.text)+">"+l+"</span>"):(e.addRenderAttribute("button","class","ha-btn--icon-after"),r=i,a="<span "+e.getRenderAttributeString(t.text)+">"+l+"</span>"),s=["<a "+e.getRenderAttributeString("button")+">",a,r,"</a>"]):s=["<a "+e.getRenderAttributeString("button")+">",i,"</a>"]:s=["<a "+e.getRenderAttributeString("button")+">","<span "+e.getRenderAttributeString(t.text)+">",l,"</span>","</a>"],s.join("")}};elementor.on("panel:init",function(){var e,n;i("#elementor-panel-elements-search-input").on("keyup",_.debounce(function(){i("#elementor-panel-elements").find(".hm").parents(".elementor-element").addClass("is-ha-widget")},100)),"undefined"==typeof $e&&null===$e||(e={callback:function(){var e=elementor.settings.page.model.attributes.ha_grid;""===e?elementor.settings.page.model.setExternalChange("ha_grid","yes"):"yes"===e&&elementor.settings.page.model.setExternalChange("ha_grid","")}},$e.shortcuts.register("ctrl+shift+g",e),$e.shortcuts.register("cmd+shift+g",e)),(n=i("#"+(e="happy-addons-editor-dark-css"))).length||(n=i("<link>",{id:e,rel:"stylesheet",href:HappyAddonsEditor.dark_stylesheet_url})),elementor.settings.editorPreferences.model.on("change:ui_theme",function(e,t){"light"===t?n.remove():n.attr("media","auto"===t?"(prefers-color-scheme: dark)":"").appendTo(elementorCommon.elements.$body)})}),elementor.hooks.addFilter("panel/elements/regionViews",function(e){if(HappyAddonsEditor.hasPro||_.isEmpty(HappyAddonsEditor.placeholder_widgets))return e;var t,n="happy_addons_pro",o=e.elements.view,i=e.categories.view,a=e.elements.options.collection,r=e.categories.options.collection,s=[];return _.each(HappyAddonsEditor.placeholder_widgets,function(e,t){a.add({name:"ha-"+t,title:e.title,icon:e.icon,categories:[n],editable:!1})}),a.each(function(e){e.get("categories")[0]===n&&s.push(e)}),(t=r.findIndex({name:"happy_addons_category"}))&&r.add({name:"happy_addons_pro_category",title:"Happy Addons Pro",icon:"hm hm-happyaddons",defaultActive:!1,items:s},{at:t+1}),e.elements.view=o.extend({childView:o.prototype.childView.extend(r={className:function(){var e=this.constructor.__super__.className.call(this);return!this.isEditable()&&this.isHappyWidget()&&(e+=" ha-element--promotion"),e},isHappyWidget:function(){return 0===this.model.get("name").indexOf("ha-")},onMouseDown:function(){if(!this.isHappyWidget())return elementor.promotion.dialog.buttons[0].removeClass("ha-btn--promotion"),void this.constructor.__super__.onMouseDown.call(this);elementor.promotion.dialog.buttons[0].addClass("ha-btn--promotion"),elementor.promotion.showDialog({headerMessage:haGetTranslated("promotionDialogHeader",[this.model.get("title")]),message:haGetTranslated("promotionDialogMessage",[this.model.get("title")]),top:"-7",element:this.el,actionURL:"https://demo.happyaddons.com/"})}})}),e.categories.view=i.extend({childView:i.prototype.childView.extend({childView:i.prototype.childView.prototype.childView.extend(r)})}),e});var e=elementor.modules.controls.Select2.extend({onBeforeRender:function(){var n,o;this.container&&"section"===this.container.type&&(n=elementor.widgetsCache||elementor.config.widgets,o={},this.container.children.forEach(function(e){e.view.$childViewContainer.children("[data-widget_type]").each(function(e,t){t=(t=i(t).data("widget_type")).slice(0,t.lastIndexOf(".")),t=!_.isUndefined(n[t])&&n[t];t&&(o[t.widget_type]=t.title+" ("+t.widget_type+")")})}),this.model.set("options",o))}}),e=(elementor.addControlView("widget-list",e),elementor.modules.controls.BaseData.extend({getSelect2Placeholder:function(){return this.ui.select.children('option:first[value=""]').text()||this.model.get("placeholder")},getDependencyArgs:function(){var n=this,o=n.model.get("dynamic_params");return(o=_.isObject(o)?o:{}).control_dependency&&_.isObject(o.control_dependency)&&_.each(o.control_dependency,function(e,t){o[t]=n.container.settings.get(e)}),o},getSelect2DefaultOptions:function(){var t=this;return{allowClear:!0,placeholder:this.getSelect2Placeholder(),dir:elementorCommon.config.isRTL?"rtl":"ltr",minimumInputLength:1,ajax:{url:ajaxurl,dataType:"json",method:"POST",delay:250,data:function(e){e={nonce:HappyAddonsEditor.editor_nonce,action:"ha_process_dynamic_select",object_type:"post",query_term:e.term};return i.extend(e,t.model.get("dynamic_params"),t.getDependencyArgs())},processResults:function(e){if(!e.success||0===e.data.length)return{results:[{id:-1,text:"No results found",disabled:!0}]};var n=[];return _.each(e.data,function(e,t){n.push({id:t,text:e})}),{results:n}},cache:!0}}},getSelect2Options:function(){return i.extend(this.getSelect2DefaultOptions(),this.model.get("select2options"))},addLoadingSpinner:function(){this.$el.find(".elementor-control-title").after('<span class="elementor-control-spinner"> <i class="eicon-spinner eicon-animation-spin"></i> </span>')},onBeforeRender:function(){var n,e;this.isRendered||(e=(n=this).getControlValue(),_.isEmpty(e)||(_.isArray(e)||(e=[e]),e={nonce:HappyAddonsEditor.editor_nonce,action:"ha_process_dynamic_select",object_type:"post",saved_values:e},i.ajax({url:ajaxurl,type:"POST",data:i.extend(e,n.model.get("dynamic_params"),n.getDependencyArgs()),beforeSend:n.addLoadingSpinner.bind(this),success:function(e){var t;e.success&&0!==e.data.length&&(t=_.keys(e.data).map(function(e){return" "+i.trim(e)}),n.container.settings.set(n.model.get("name"),t),n.model.set("options",e.data),n.render())}})))},applySavedValue:function(){elementor.modules.controls.BaseData.prototype.applySavedValue.apply(this,arguments),this.ui.select.data("select2")?this.ui.select.trigger("change"):(this.ui.select.select2(this.getSelect2Options()),this.model.get("sortable")&&this.initSortable())},initSortable:function(){var e=this.$el.find("ul.select2-selection__rendered"),t=this;e.sortable({containment:"parent",update:function(){t._orderSortedOption(e),t.container.settings.setExternalChange(t.model.get("name"),t.ui.select.val()),t.model.set("options",t.ui.select.val())}})},_orderSortedOption:function(e){var o=this;e.children("li[title]").each(function(e,t){var n=o.ui.select.children("option").filter(function(){return i(this).html()==t.title});o._moveOptionToEnd(n)})},_moveOptionToEnd:function(e){var t=e.parent();e.detach(),t.append(e)},onBeforeDestroy:function(){this.ui.select.select2("destroy"),this.$el.remove()}}));elementor.addControlView("ha_advanced_select2",e)}(jQuery);
|
assets/admin/js/template-library.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(p,u,n){var h={Views:{},Models:{},Collections:{},Behaviors:{},Layout:null,Manager:null};h.Models.Template=Backbone.Model.extend({defaults:{template_id:0,title:"",type:"",thumbnail:"",url:"",tags:[],isPro:!1}}),h.Collections.Template=Backbone.Collection.extend({model:h.Models.Template}),h.Behaviors.InsertTemplate=Marionette.Behavior.extend({ui:{insertButton:".haTemplateLibrary__insert-button"},events:{"click @ui.insertButton":"onInsertButtonClick"},onInsertButtonClick:function(){n.library.insertTemplate({model:this.view.model})}}),h.Views.EmptyTemplateCollection=Marionette.ItemView.extend({id:"elementor-template-library-templates-empty",template:"#tmpl-haTemplateLibrary__empty",ui:{title:".elementor-template-library-blank-title",message:".elementor-template-library-blank-message"},modesStrings:{empty:{title:haGetTranslated("templatesEmptyTitle"),message:haGetTranslated("templatesEmptyMessage")},noResults:{title:haGetTranslated("templatesNoResultsTitle"),message:haGetTranslated("templatesNoResultsMessage")}},getCurrentMode:function(){return n.library.getFilter("text")?"noResults":"empty"},onRender:function(){var e=this.modesStrings[this.getCurrentMode()];this.ui.title.html(e.title),this.ui.message.html(e.message)}}),h.Views.Loading=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__loading",id:"haTemplateLibrary__loading"}),h.Views.Logo=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__header-logo",className:"haTemplateLibrary__header-logo",templateHelpers:function(){return{title:this.getOption("title")}}}),h.Views.BackButton=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__header-back",id:"elementor-template-library-header-preview-back",className:"haTemplateLibrary__header-back",events:function(){return{click:"onClick"}},onClick:function(){n.library.showTemplatesView()}}),h.Views.Menu=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__header-menu",id:"elementor-template-library-header-menu",className:"haTemplateLibrary__header-menu",templateHelpers:function(){return n.library.getTabs()},ui:{menuItem:".elementor-template-library-menu-item"},events:{"click @ui.menuItem":"onMenuItemClick"},onMenuItemClick:function(e){n.library.setFilter("tags",""),n.library.setFilter("text",""),n.library.setFilter("type",e.currentTarget.dataset.tab,!0),n.library.showTemplatesView()}}),h.Views.ResponsiveMenu=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__header-menu-responsive",id:"elementor-template-library-header-menu-responsive",className:"haTemplateLibrary__header-menu-responsive",ui:{items:"> .elementor-component-tab"},events:{"click @ui.items":"onTabItemClick"},onTabItemClick:function(e){var e=p(e.currentTarget),t=e.data("tab");n.library.channels.tabs.trigger("change:device",t,e)}}),h.Views.Actions=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__header-actions",id:"elementor-template-library-header-actions",ui:{sync:"#haTemplateLibrary__header-sync i"},events:{"click @ui.sync":"onSyncClick"},onSyncClick:function(){var e=this;e.ui.sync.addClass("eicon-animation-spin"),n.library.requestLibraryData({onUpdate:function(){e.ui.sync.removeClass("eicon-animation-spin"),n.library.updateBlocksView()},forceUpdate:!0,forceSync:!0})}}),h.Views.InsertWrapper=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__header-insert",id:"elementor-template-library-header-preview",behaviors:{insertTemplate:{behaviorClass:h.Behaviors.InsertTemplate}}}),h.Views.Preview=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__preview",className:"haTemplateLibrary__preview",ui:function(){return{iframe:"> iframe"}},onRender:function(){this.ui.iframe.attr("src",this.getOption("url")).hide();var e=this,t=(new h.Views.Loading).render();this.$el.append(t.el),this.ui.iframe.on("load",function(){e.$el.find("#haTemplateLibrary__loading").remove(),e.ui.iframe.show()})}}),h.Views.TemplateCollection=Marionette.CompositeView.extend({template:"#tmpl-haTemplateLibrary__templates",id:"haTemplateLibrary__templates",className:function(){return"haTemplateLibrary__templates haTemplateLibrary__templates--"+n.library.getFilter("type")},childViewContainer:"#haTemplateLibrary__templates-list",emptyView:function(){return new h.Views.EmptyTemplateCollection},ui:{templatesWindow:".haTemplateLibrary__templates-window",textFilter:"#haTemplateLibrary__search",tagsFilter:"#haTemplateLibrary__filter-tags",filterBar:"#haTemplateLibrary__toolbar-filter",counter:"#haTemplateLibrary__toolbar-counter"},events:{"input @ui.textFilter":"onTextFilterInput","click @ui.tagsFilter li":"onTagsFilterClick"},getChildView:function(e){return h.Views.Template},initialize:function(){this.listenTo(n.library.channels.templates,"filter:change",this._renderChildren)},filter:function(i){var e=n.library.getFilterTerms(),a=!0;return _.each(e,function(e,t){t=n.library.getFilter(t);if(t)return e.callback?((e=e.callback.call(i,t))||(a=!1),e):void 0}),a},setMasonrySkin:function(){var e;"section"===n.library.getFilter("type")&&(e=new elementorModules.utils.Masonry({container:this.$childViewContainer,items:this.$childViewContainer.children()}),this.$childViewContainer.imagesLoaded(e.run.bind(e)))},onRenderCollection:function(){this.setMasonrySkin(),this.updatePerfectScrollbar(),this.setTemplatesFoundText()},setTemplatesFoundText:function(){var e=n.library.getFilter("type"),t=this.children.length,i="<b>"+t+"</b>";i+="section"===e?" block":" "+e,1<t&&(i+="s"),this.ui.counter.html(i+=" found")},onTextFilterInput:function(){var e=this;_.defer(function(){n.library.setFilter("text",e.ui.textFilter.val())})},onTagsFilterClick:function(e){var e=p(e.currentTarget),t=e.data("tag");n.library.setFilter("tags",t),e.addClass("active").siblings().removeClass("active"),t=t?n.library.getTags()[t]:"Filter",this.ui.filterBar.find(".haTemplateLibrary__filter-btn").html(t+' <i class="eicon-caret-down"></i>')},updatePerfectScrollbar:function(){this.perfectScrollbar||(this.perfectScrollbar=new PerfectScrollbar(this.ui.templatesWindow[0],{suppressScrollX:!0})),this.perfectScrollbar.isRtl=!1,this.perfectScrollbar.update()},setTagsFilterHover:function(){var e=this;e.ui.filterBar.hoverIntent(function(){e.ui.tagsFilter.css("display","block"),e.ui.filterBar.find(".haTemplateLibrary__filter-btn i").addClass("eicon-caret-down").removeClass("eicon-caret-right")},function(){e.ui.tagsFilter.css("display","none"),e.ui.filterBar.find(".haTemplateLibrary__filter-btn i").addClass("eicon-caret-right").removeClass("eicon-caret-down")},{sensitivity:50,interval:150,timeout:100})},onRender:function(){this.setTagsFilterHover(),this.updatePerfectScrollbar()}}),h.Views.Template=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__template",className:"haTemplateLibrary__template",ui:{previewButton:".haTemplateLibrary__preview-button, .haTemplateLibrary__template-preview"},events:{"click @ui.previewButton":"onPreviewButtonClick"},behaviors:{insertTemplate:{behaviorClass:h.Behaviors.InsertTemplate}},onPreviewButtonClick:function(){n.library.showPreviewView(this.model)}}),h.Modal=elementorModules.common.views.modal.Layout.extend({getModalOptions:function(){return{id:"haTemplateLibrary__modal",hide:{onOutsideClick:!1,onEscKeyPress:!0,onBackgroundClick:!1}}},getTemplateActionButton:function(e){e=e.isPro&&!HappyAddonsEditor.hasPro?"pro-button":"insert-button",e=Marionette.TemplateCache.get("#tmpl-haTemplateLibrary__"+e);return Marionette.Renderer.render(e)},showLogo:function(e){this.getHeaderView().logoArea.show(new h.Views.Logo(e))},showDefaultHeader:function(){this.showLogo({title:"TEMPLATES"});var e=this.getHeaderView();e.tools.show(new h.Views.Actions),e.menuArea.show(new h.Views.Menu)},showPreviewView:function(e){var t=this.getHeaderView();t.menuArea.show(new h.Views.ResponsiveMenu),t.logoArea.show(new h.Views.BackButton),t.tools.show(new h.Views.InsertWrapper({model:e})),this.modalContent.show(new h.Views.Preview({url:e.get("url")}))},showTemplatesView:function(e){this.showDefaultHeader(),this.modalContent.show(new h.Views.TemplateCollection({collection:e}))}}),h.Manager=function(){var e,i,a,n,t,r=this,o=".elementor-add-new-section .elementor-add-section-drag-title",l='<div class="elementor-add-section-area-button elementor-add-ha-button"> <i class="hm hm-happyaddons"></i> </div>',s={desktop:"100%",tab:"768px",mobile:"360px"};function c(){var e=p(this).closest(".elementor-top-section"),i=e.data("id"),t=u.documents.getCurrent().container.children,e=e.prev(".elementor-add-section");t&&_.each(t,function(e,t){i===e.id&&(r.atIndex=t)}),e.find(".elementor-add-ha-button").length||e.find(o).before(l)}function m(e,t){t.addClass("elementor-active").siblings().removeClass("elementor-active");t=s[e]||s.desktop;p(".haTemplateLibrary__preview").css("width",t)}function d(){var i=window.elementor.$previewContents,a=setInterval(function(){var e,t;(t=(e=i).find(o)).length&&!e.find(".elementor-add-ha-button").length&&t.before(l),e.on("click.onAddElement",".elementor-editor-section-settings .elementor-editor-element-add",c),0<i.find(".elementor-add-new-section").length&&clearInterval(a)},100);i.on("click.onAddTemplateButton",".elementor-add-ha-button",r.showModal.bind(r)),this.channels.tabs.on("change:device",m)}this.atIndex=-1,this.channels={tabs:Backbone.Radio.channel("tabs"),templates:Backbone.Radio.channel("templates")},this.updateBlocksView=function(){r.setFilter("tags","",!0),r.setFilter("text","",!0),r.getModal().showTemplatesView(n)},this.setFilter=function(e,t,i){r.channels.templates.reply("filter:"+e,t),i||r.channels.templates.trigger("filter:change")},this.getFilter=function(e){return r.channels.templates.request("filter:"+e)},this.getFilterTerms=function(){return{tags:{callback:function(t){return _.any(this.get("tags"),function(e){return 0<=e.indexOf(t)})}},text:{callback:function(t){return t=t.toLowerCase(),0<=this.get("title").toLowerCase().indexOf(t)||_.any(this.get("tags"),function(e){return 0<=e.indexOf(t)})}},type:{callback:function(e){return this.get("type")===e}}}},this.showModal=function(){r.getModal().showModal(),r.showTemplatesView()},this.closeModal=function(){this.getModal().hideModal()},this.getModal=function(){return e=e||new h.Modal},this.init=function(){r.setFilter("type","section",!0),u.on("preview:loaded",d.bind(this))},this.getTabs=function(){var i=this.getFilter("type"),a={section:{title:"Blocks"},page:{title:"Pages"}};return _.each(a,function(e,t){i===t&&(a[i].active=!0)}),{tabs:a}},this.getTags=function(){return i},this.getTypeTags=function(){var e=r.getFilter("type");return a[e]},this.showTemplatesView=function(){r.setFilter("tags","",!0),r.setFilter("text","",!0),n?r.getModal().showTemplatesView(n):r.loadTemplates(function(){r.getModal().showTemplatesView(n)})},this.showPreviewView=function(e){r.getModal().showPreviewView(e)},this.loadTemplates=function(e){r.requestLibraryData({onBeforeUpdate:r.getModal().showLoadingView.bind(r.getModal()),onUpdate:function(){r.getModal().hideLoadingView(),e&&e()}})},this.requestLibraryData=function(t){var e;!n||t.forceUpdate?(t.onBeforeUpdate&&t.onBeforeUpdate(),e={data:{},success:function(e){n=new h.Collections.Template(e.templates),e.tags&&(i=e.tags),e.type_tags&&(a=e.type_tags),t.onUpdate&&t.onUpdate()}},t.forceSync&&(e.data.sync=!0),elementorCommon.ajax.addRequest("get_ha_library_data",e)):t.onUpdate&&t.onUpdate()},this.requestTemplateData=function(e,t){e={unique_id:e,data:{edit_mode:!0,display:!0,template_id:e}};t&&jQuery.extend(!0,e,t),elementorCommon.ajax.addRequest("get_ha_template_data",e)},this.insertTemplate=function(e){var i=e.model,a=this;a.getModal().showLoadingView(),a.requestTemplateData(i.get("template_id"),{success:function(e){a.getModal().hideLoadingView(),a.getModal().hideModal();var t={};-1!==a.atIndex&&(t.at=a.atIndex),$e.run("document/elements/import",{model:i,data:e,options:t}),a.atIndex=-1},error:function(e){a.showErrorDialog(e)},complete:function(e){a.getModal().hideLoadingView(),window.elementor.$previewContents.find(".elementor-add-section .elementor-add-section-close").click()}})},this.showErrorDialog=function(e){var t;"object"===_typeof(e)?(t="",_.each(e,function(e){t+="<div>"+e.message+".</div>"}),e=t):e?e+=".":e="<i><The error message is empty></i>",r.getErrorDialog().setMessage('The following error(s) occurred while processing the request:<div id="elementor-template-library-error-info">'+e+"</div>").show()},this.getErrorDialog=function(){return t=t||elementorCommon.dialogsManager.createWidget("alert",{id:"elementor-template-library-error-dialog",headerMessage:"An error occurred"})}},n.library=new h.Manager,n.library.init(),window.ha=n}(jQuery,window.elementor,window.ha||{});
|
1 |
+
"use strict";function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(p,u,n){var h={Views:{},Models:{},Collections:{},Behaviors:{},Layout:null,Manager:null};h.Models.Template=Backbone.Model.extend({defaults:{template_id:0,title:"",type:"",thumbnail:"",url:"",tags:[],isPro:!1}}),h.Collections.Template=Backbone.Collection.extend({model:h.Models.Template}),h.Behaviors.InsertTemplate=Marionette.Behavior.extend({ui:{insertButton:".haTemplateLibrary__insert-button"},events:{"click @ui.insertButton":"onInsertButtonClick"},onInsertButtonClick:function(){n.library.insertTemplate({model:this.view.model})}}),h.Views.EmptyTemplateCollection=Marionette.ItemView.extend({id:"elementor-template-library-templates-empty",template:"#tmpl-haTemplateLibrary__empty",ui:{title:".elementor-template-library-blank-title",message:".elementor-template-library-blank-message"},modesStrings:{empty:{title:haGetTranslated("templatesEmptyTitle"),message:haGetTranslated("templatesEmptyMessage")},noResults:{title:haGetTranslated("templatesNoResultsTitle"),message:haGetTranslated("templatesNoResultsMessage")}},getCurrentMode:function(){return n.library.getFilter("text")?"noResults":"empty"},onRender:function(){var e=this.modesStrings[this.getCurrentMode()];this.ui.title.html(e.title),this.ui.message.html(e.message)}}),h.Views.Loading=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__loading",id:"haTemplateLibrary__loading"}),h.Views.Logo=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__header-logo",className:"haTemplateLibrary__header-logo",templateHelpers:function(){return{title:this.getOption("title")}}}),h.Views.BackButton=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__header-back",id:"elementor-template-library-header-preview-back",className:"haTemplateLibrary__header-back",events:function(){return{click:"onClick"}},onClick:function(){n.library.showTemplatesView()}}),h.Views.Menu=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__header-menu",id:"elementor-template-library-header-menu",className:"haTemplateLibrary__header-menu",templateHelpers:function(){return n.library.getTabs()},ui:{menuItem:".elementor-template-library-menu-item"},events:{"click @ui.menuItem":"onMenuItemClick"},onMenuItemClick:function(e){n.library.setFilter("tags",""),n.library.setFilter("text",""),n.library.setFilter("type",e.currentTarget.dataset.tab,!0),n.library.showTemplatesView()}}),h.Views.ResponsiveMenu=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__header-menu-responsive",id:"elementor-template-library-header-menu-responsive",className:"haTemplateLibrary__header-menu-responsive",ui:{items:"> .elementor-component-tab"},events:{"click @ui.items":"onTabItemClick"},onTabItemClick:function(e){var e=p(e.currentTarget),t=e.data("tab");n.library.channels.tabs.trigger("change:device",t,e)}}),h.Views.Actions=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__header-actions",id:"elementor-template-library-header-actions",ui:{sync:"#haTemplateLibrary__header-sync i"},events:{"click @ui.sync":"onSyncClick"},onSyncClick:function(){var e=this;e.ui.sync.addClass("eicon-animation-spin"),n.library.requestLibraryData({onUpdate:function(){e.ui.sync.removeClass("eicon-animation-spin"),n.library.updateBlocksView()},forceUpdate:!0,forceSync:!0})}}),h.Views.InsertWrapper=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__header-insert",id:"elementor-template-library-header-preview",behaviors:{insertTemplate:{behaviorClass:h.Behaviors.InsertTemplate}}}),h.Views.Preview=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__preview",className:"haTemplateLibrary__preview",ui:function(){return{iframe:"> iframe"}},onRender:function(){this.ui.iframe.attr("src",this.getOption("url")).hide();var e=this,t=(new h.Views.Loading).render();this.$el.append(t.el),this.ui.iframe.on("load",function(){e.$el.find("#haTemplateLibrary__loading").remove(),e.ui.iframe.show()})}}),h.Views.TemplateCollection=Marionette.CompositeView.extend({template:"#tmpl-haTemplateLibrary__templates",id:"haTemplateLibrary__templates",className:function(){return"haTemplateLibrary__templates haTemplateLibrary__templates--"+n.library.getFilter("type")},childViewContainer:"#haTemplateLibrary__templates-list",emptyView:function(){return new h.Views.EmptyTemplateCollection},ui:{templatesWindow:".haTemplateLibrary__templates-window",textFilter:"#haTemplateLibrary__search",tagsFilter:"#haTemplateLibrary__filter-tags",filterBar:"#haTemplateLibrary__toolbar-filter",counter:"#haTemplateLibrary__toolbar-counter"},events:{"input @ui.textFilter":"onTextFilterInput","click @ui.tagsFilter li":"onTagsFilterClick"},getChildView:function(e){return h.Views.Template},initialize:function(){this.listenTo(n.library.channels.templates,"filter:change",this._renderChildren)},filter:function(i){var e=n.library.getFilterTerms(),a=!0;return _.each(e,function(e,t){t=n.library.getFilter(t);if(t)return e.callback?((e=e.callback.call(i,t))||(a=!1),e):void 0}),a},setMasonrySkin:function(){var e;"section"===n.library.getFilter("type")&&(e=new elementorModules.utils.Masonry({container:this.$childViewContainer,items:this.$childViewContainer.children()}),this.$childViewContainer.imagesLoaded(e.run.bind(e)))},onRenderCollection:function(){this.setMasonrySkin(),this.updatePerfectScrollbar(),this.setTemplatesFoundText()},setTemplatesFoundText:function(){var e=n.library.getFilter("type"),t=this.children.length,i="<b>"+t+"</b>";i+="section"===e?" block":" "+e,1<t&&(i+="s"),this.ui.counter.html(i+=" found")},onTextFilterInput:function(){var e=this;_.defer(function(){n.library.setFilter("text",e.ui.textFilter.val())})},onTagsFilterClick:function(e){var e=p(e.currentTarget),t=e.data("tag");n.library.setFilter("tags",t),e.addClass("active").siblings().removeClass("active"),t=t?n.library.getTags()[t]:"Filter",this.ui.filterBar.find(".haTemplateLibrary__filter-btn").html(t+' <i class="eicon-caret-down"></i>')},updatePerfectScrollbar:function(){this.perfectScrollbar||(this.perfectScrollbar=new PerfectScrollbar(this.ui.templatesWindow[0],{suppressScrollX:!0})),this.perfectScrollbar.isRtl=!1,this.perfectScrollbar.update()},setTagsFilterHover:function(){var e=this;e.ui.filterBar.hoverIntent(function(){e.ui.tagsFilter.css("display","block"),e.ui.filterBar.find(".haTemplateLibrary__filter-btn i").addClass("eicon-caret-down").removeClass("eicon-caret-right")},function(){e.ui.tagsFilter.css("display","none"),e.ui.filterBar.find(".haTemplateLibrary__filter-btn i").addClass("eicon-caret-right").removeClass("eicon-caret-down")},{sensitivity:50,interval:150,timeout:100})},onRender:function(){this.setTagsFilterHover(),this.updatePerfectScrollbar()}}),h.Views.Template=Marionette.ItemView.extend({template:"#tmpl-haTemplateLibrary__template",className:"haTemplateLibrary__template",ui:{previewButton:".haTemplateLibrary__preview-button, .haTemplateLibrary__template-preview"},events:{"click @ui.previewButton":"onPreviewButtonClick"},behaviors:{insertTemplate:{behaviorClass:h.Behaviors.InsertTemplate}},onPreviewButtonClick:function(){n.library.showPreviewView(this.model)}}),h.Modal=elementorModules.common.views.modal.Layout.extend({getModalOptions:function(){return{id:"haTemplateLibrary__modal",hide:{onOutsideClick:!1,onEscKeyPress:!0,onBackgroundClick:!1}}},getTemplateActionButton:function(e){e=e.isPro&&!HappyAddonsEditor.hasPro?"pro-button":"insert-button",e=Marionette.TemplateCache.get("#tmpl-haTemplateLibrary__"+e);return Marionette.Renderer.render(e)},showLogo:function(e){this.getHeaderView().logoArea.show(new h.Views.Logo(e))},showDefaultHeader:function(){this.showLogo({title:"TEMPLATES"});var e=this.getHeaderView();e.tools.show(new h.Views.Actions),e.menuArea.show(new h.Views.Menu)},showPreviewView:function(e){var t=this.getHeaderView();t.menuArea.show(new h.Views.ResponsiveMenu),t.logoArea.show(new h.Views.BackButton),t.tools.show(new h.Views.InsertWrapper({model:e})),this.modalContent.show(new h.Views.Preview({url:e.get("url")}))},showTemplatesView:function(e){this.showDefaultHeader(),this.modalContent.show(new h.Views.TemplateCollection({collection:e}))}}),h.Manager=function(){var e,i,a,n,t,r=this,o=".elementor-add-new-section .elementor-add-section-drag-title",l='<div class="elementor-add-section-area-button elementor-add-ha-button"> <i class="hm hm-happyaddons"></i> </div>',s={desktop:"100%",tab:"768px",mobile:"360px"};function c(){var e=p(this).closest(".elementor-top-section"),i=e.data("id"),t=u.documents.getCurrent().container.children,e=e.prev(".elementor-add-section");t&&_.each(t,function(e,t){i===e.id&&(r.atIndex=t)}),e.find(".elementor-add-ha-button").length||e.find(o).before(l)}function m(e,t){t.addClass("elementor-active").siblings().removeClass("elementor-active");t=s[e]||s.desktop;p(".haTemplateLibrary__preview").css("width",t)}function d(){var i=window.elementor.$previewContents,a=setInterval(function(){var e,t;(t=(e=i).find(o)).length&&!e.find(".elementor-add-ha-button").length&&t.before(l),e.on("click.onAddElement",".elementor-editor-section-settings .elementor-editor-element-add",c),0<i.find(".elementor-add-new-section").length&&clearInterval(a)},100);i.on("click.onAddTemplateButton",".elementor-add-ha-button",r.showModal.bind(r)),this.channels.tabs.on("change:device",m)}this.atIndex=-1,this.channels={tabs:Backbone.Radio.channel("tabs"),templates:Backbone.Radio.channel("templates")},this.updateBlocksView=function(){r.setFilter("tags","",!0),r.setFilter("text","",!0),r.getModal().showTemplatesView(n)},this.setFilter=function(e,t,i){r.channels.templates.reply("filter:"+e,t),i||r.channels.templates.trigger("filter:change")},this.getFilter=function(e){return r.channels.templates.request("filter:"+e)},this.getFilterTerms=function(){return{tags:{callback:function(t){return _.any(this.get("tags"),function(e){return 0<=e.indexOf(t)})}},text:{callback:function(t){return t=t.toLowerCase(),0<=this.get("title").toLowerCase().indexOf(t)||_.any(this.get("tags"),function(e){return 0<=e.indexOf(t)})}},type:{callback:function(e){return this.get("type")===e}}}},this.showModal=function(){r.getModal().showModal(),r.showTemplatesView()},this.closeModal=function(){this.getModal().hideModal()},this.getModal=function(){return e=e||new h.Modal},this.init=function(){r.setFilter("type","section",!0),u.on("preview:loaded",d.bind(this))},this.getTabs=function(){var i=this.getFilter("type"),a={section:{title:"Blocks"},page:{title:"Pages"}};return _.each(a,function(e,t){i===t&&(a[i].active=!0)}),{tabs:a}},this.getTags=function(){return i},this.getTypeTags=function(){var e=r.getFilter("type");return a[e]},this.showTemplatesView=function(){r.setFilter("tags","",!0),r.setFilter("text","",!0),n?r.getModal().showTemplatesView(n):r.loadTemplates(function(){r.getModal().showTemplatesView(n)})},this.showPreviewView=function(e){r.getModal().showPreviewView(e)},this.loadTemplates=function(e){r.requestLibraryData({onBeforeUpdate:r.getModal().showLoadingView.bind(r.getModal()),onUpdate:function(){r.getModal().hideLoadingView(),e&&e()}})},this.requestLibraryData=function(t){var e;n&&!t.forceUpdate?t.onUpdate&&t.onUpdate():(t.onBeforeUpdate&&t.onBeforeUpdate(),e={data:{},success:function(e){n=new h.Collections.Template(e.templates),e.tags&&(i=e.tags),e.type_tags&&(a=e.type_tags),t.onUpdate&&t.onUpdate()}},t.forceSync&&(e.data.sync=!0),elementorCommon.ajax.addRequest("get_ha_library_data",e))},this.requestTemplateData=function(e,t){e={unique_id:e,data:{edit_mode:!0,display:!0,template_id:e}};t&&jQuery.extend(!0,e,t),elementorCommon.ajax.addRequest("get_ha_template_data",e)},this.insertTemplate=function(e){var i=e.model,a=this;a.getModal().showLoadingView(),a.requestTemplateData(i.get("template_id"),{success:function(e){a.getModal().hideLoadingView(),a.getModal().hideModal();var t={};-1!==a.atIndex&&(t.at=a.atIndex),$e.run("document/elements/import",{model:i,data:e,options:t}),a.atIndex=-1},error:function(e){a.showErrorDialog(e)},complete:function(e){a.getModal().hideLoadingView(),window.elementor.$previewContents.find(".elementor-add-section .elementor-add-section-close").click()}})},this.showErrorDialog=function(e){var t;"object"===_typeof(e)?(t="",_.each(e,function(e){t+="<div>"+e.message+".</div>"}),e=t):e?e+=".":e="<i><The error message is empty></i>",r.getErrorDialog().setMessage('The following error(s) occurred while processing the request:<div id="elementor-template-library-error-info">'+e+"</div>").show()},this.getErrorDialog=function(){return t=t||elementorCommon.dialogsManager.createWidget("alert",{id:"elementor-template-library-error-dialog",headerMessage:"An error occurred"})}},n.library=new h.Manager,n.library.init(),window.ha=n}(jQuery,window.elementor,window.ha||{});
|
assets/admin/js/wizard.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
"use strict";function _createForOfIteratorHelper(e,t){var n,r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return r&&(e=r),n=0,{s:t=function(){},n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function asyncGeneratorStep(e,t,n,r,a,i,s){try{var o=e[i](s),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,a)}function _asyncToGenerator(o){return function(){var e=this,s=arguments;return new Promise(function(t,n){var r=o.apply(e,s);function a(e){asyncGeneratorStep(r,t,n,a,i,"next",e)}function i(e){asyncGeneratorStep(r,t,n,a,i,"throw",e)}a(void 0)})}}var Wizard={data:function(){return{loaded:!1,screen:0,hasCache:!1,currentPage:"welcome",userType:"normal",hasConsent:!0,steps:[{key:"welcome",name:"Welcome",isComplete:!1},{key:"widgets",name:"Widgets",isComplete:!1},{key:"features",name:"Features",isComplete:!1},{key:"bepro",name:"Be a pro!",isComplete:!1},{key:"contribute",name:"Contribute",isComplete:!1},{key:"congrats",name:"Congrats",isComplete:!1}],widgetList:[],disabledWidgets:[],featureList:[],disabledFeatures:[],settings:{welcome:{userType:null},widgets:[],features:null,contribute:!1,all:[],checkedWidgets:[]},widgetMore:!0}},mounted:function(){this.fetchCache(),this.getCurrentPage()},methods:{fetchWidgetData:function(){var n=this;return _asyncToGenerator(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=window.HappyWizard.apiBase+"/widgets/all/",e.next=3,fetch(t,{method:"GET",headers:{"X-WP-Nonce":window.HappyWizard.nonce}}).then(function(e){return e.json()}).then(function(e){e&&(n.widgetList=e.all,n.disabledWidgets=e.disabled)}).catch(function(e){console.error("Error:",e)});case 3:case"end":return e.stop()}},e)}))()},fetchCache:function(){var n=this;return _asyncToGenerator(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=window.HappyWizard.apiBase+"/wizard/cache",e.next=3,fetch(t,{method:"GET",headers:{"X-WP-Nonce":window.HappyWizard.nonce}}).then(function(e){return e.json()}).then(function(e){e.data?(e.data.steps&&(n.steps=e.data.steps),e.data.currentPage&&(n.currentPage=e.data.currentPage),e.data.userType&&(n.userType=e.data.userType),e.data.widgets&&(n.widgetList=e.data.widgets),e.data.widgets_disabled&&(n.disabledWidgets=e.data.widgets_disabled),e.data.features&&(n.featureList=e.data.features),e.data.features_disabled&&(n.disabledFeatures=e.data.features_disabled),n.loaded=!0):n.fetchPreset(n.userType)}).catch(function(e){console.error("Error:",e)});case 3:case"end":return e.stop()}},e)}))()},fetchPreset:function(n){var r=this;return _asyncToGenerator(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=window.HappyWizard.apiBase+"/wizard/preset/"+n,e.next=3,fetch(t,{method:"GET",headers:{"X-WP-Nonce":window.HappyWizard.nonce}}).then(function(e){return e.json()}).then(function(e){e&&(r.widgetList=e.widgets.all,r.disabledWidgets=e.widgets.disabled,r.featureList=e.features.all,r.disabledFeatures=e.features.disabled),r.loaded=!0}).catch(function(e){console.error("Error:",e)});case 3:case"end":return e.stop()}},e)}))()},saveWizardData:function(){var a=arguments,i=this;return _asyncToGenerator(regeneratorRuntime.mark(function e(){var t,n,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=0<a.length&&void 0!==a[0]?a[0]:"",n=window.HappyWizard.apiBase+"/wizard/save",r={widget:i.disabledWidgets,features:i.disabledFeatures,consent:i.consent?"yes":"no"},"cache"==t&&(n=window.HappyWizard.apiBase+"/wizard/save-cache",r={currentPage:i.currentPage,userType:i.userType,steps:i.steps,widgets:i.widgetList,widgets_disabled:i.disabledWidgets,features:i.featureList,features_disabled:i.disabledFeatures,consent:i.hasConsent?"yes":"no"}),e.next=6,fetch(n,{method:"POST",headers:{"X-WP-Nonce":window.HappyWizard.nonce},body:JSON.stringify(r),contentType:"application/json; charset=utf-8"}).then(function(e){return e.json()}).then(function(e){e&&200===e.status&&("cache"===t||window.open(window.HappyWizard.haAdmin,"_self"))}).catch(function(e){console.error("Error:",e)});case 6:case"end":return e.stop()}},e)}))()},endWizard:function(){return _asyncToGenerator(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(confirm("Head’s up. This action is non reversible and you won’t be able to see this wizard again. Proceed?"))return t=window.HappyWizard.apiBase+"/wizard/skip",e.next=5,fetch(t,{method:"POST",headers:{"X-WP-Nonce":window.HappyWizard.nonce}}).then(function(e){return e.json()}).then(function(e){e&&200===e.status&&window.open(window.HappyWizard.haAdmin,"_self")}).catch(function(e){console.error("Error:",e)});e.next=5;break;case 5:case"end":return e.stop()}},e)}))()},setUserType:function(e){this.userType=e,this.fetchPreset(e)},setTab:function(e){e&&("buypro"==e?window.open("https://happyaddons.com/go/get-pro","_blank").focus():"done"==e?this.saveWizardData():(this.setStepComplete(this.currentPage),this.currentPage=e,this.screen=e),this.saveWizardData("cache"))},setStepComplete:function(e){var t,n=_createForOfIteratorHelper(this.steps);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.key==e){r.isComplete=!0;break}}}catch(e){n.e(e)}finally{n.f()}},revealWidgetList:function(){this.widgetMore=!1},getCurrentPage:function(){var e,t=_createForOfIteratorHelper(this.steps);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(0==n.isComplete){this.currentPage=n.key;break}}}catch(e){t.e(e)}finally{t.f()}return this.currentPage},goNext:function(e){this.setTab(e)},allAdd:function(e){var t=this.widgetList[e],n=this;return Object.keys(t).forEach(function(e){t[e].is_active=!0,n.isActive(t[e].slug,!1)}),-1===this.settings.all.indexOf(e)&&this.settings.all.push(e),t},allRemove:function(r){var t=this.widgetList[r],n=this;return Object.keys(t).forEach(function(e){t[e].is_active=!1,n.isActive(t[e].slug,!0)}),this.settings.all=this.settings.all.filter(function(e,t,n){return e!=r}),t},isActive:function(r,e){!0===e?-1===this.disabledWidgets.indexOf(r)&&this.disabledWidgets.push(r):this.disabledWidgets=this.disabledWidgets.filter(function(e,t,n){return e!=r})},isFeatureActive:function(r,e){!0===e?-1===this.disabledFeatures.indexOf(r)&&this.disabledFeatures.push(r):this.disabledFeatures=this.disabledFeatures.filter(function(e,t,n){return e!=r})},makeTitle:function(e){e=e.replace(/-/g," ").replace("and","&");return e.charAt(0).toUpperCase()+e.slice(1)},makeLabel:function(e){return e?"PRO":"FREE"},sortByTitle:function(e){return e.sort(function(e,t){return e.title<t.title?-1:1})}},watch:{"settings.checkedWidgets":function(e){},"settings.all":function(e){},hasConsent:function(e){}},computed:{}},app=Vue.createApp(Wizard);app.config.globalProperties.window=window,app.component("ha-step",{props:{active:String,complete:Boolean,step:String,title:String,index:Number},emits:["setTab"],computed:{isActive:function(){return this.active==this.step}},methods:{handleClick:function(e){this.complete&&this.$emit("setTab",e)}},template:'<div class="ha-stepper__step" :class="{ \'is-complete\': this.complete, \'is-active\': this.isActive }" @click="handleClick(step)">\n\t<button class="ha-stepper__step-label-wrapper">\n\t\t<div class="ha-stepper__step-icon">\n\t\t\t<span class="ha-stepper__step-number">{{index}}</span>\n\t\t\t<svg width="15" height="11" viewBox="0 0 15 11" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t<path d="M5.09467 10.784L0.219661 5.98988C-0.0732203 5.70186 -0.0732203 5.23487 0.219661 4.94682L1.2803 3.90377C1.57318 3.61572 2.04808 3.61572 2.34096 3.90377L5.625 7.13326L12.659 0.216014C12.9519 -0.0720048 13.4268 -0.0720048 13.7197 0.216014L14.7803 1.25907C15.0732 1.54709 15.0732 2.01408 14.7803 2.30213L6.15533 10.784C5.86242 11.072 5.38755 11.072 5.09467 10.784Z" fill="white"/>\n\t\t\t</svg>\n\t\t</div>\n\t\t<div class="ha-stepper__step-text">\n\t\t\t<span class="ha-stepper__step-label">{{title}}</span>\n\t\t</div>\n\t</button>\n</div>\n<div class="ha-stepper__step-divider">\n<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M14.2218 4.80762C13.8313 4.4171 13.1981 4.4171 12.8076 4.80762C12.4171 5.19815 12.4171 5.83131 12.8076 6.22184L14.2218 4.80762ZM18.4853 10.4853L19.1924 11.1924L19.8995 10.4853L19.1924 9.77818L18.4853 10.4853ZM12.8076 14.7487C12.4171 15.1393 12.4171 15.7724 12.8076 16.163C13.1981 16.5535 13.8313 16.5535 14.2218 16.163L12.8076 14.7487ZM7.19238 4.80762C6.80186 4.4171 6.16869 4.4171 5.77817 4.80762C5.38764 5.19814 5.38764 5.83131 5.77817 6.22183L7.19238 4.80762ZM11.4558 10.4853L12.1629 11.1924L12.87 10.4853L12.1629 9.77818L11.4558 10.4853ZM5.77817 14.7487C5.38764 15.1393 5.38764 15.7724 5.77817 16.163C6.16869 16.5535 6.80186 16.5535 7.19238 16.163L5.77817 14.7487ZM12.8076 6.22184L17.7782 11.1924L19.1924 9.77818L14.2218 4.80762L12.8076 6.22184ZM17.7782 9.77818L12.8076 14.7487L14.2218 16.163L19.1924 11.1924L17.7782 9.77818ZM5.77817 6.22183L10.7487 11.1924L12.1629 9.77818L7.19238 4.80762L5.77817 6.22183ZM10.7487 9.77818L5.77817 14.7487L7.19238 16.163L12.1629 11.1924L10.7487 9.77818Z" fill="currentColor"/>\n</svg>\n</div>'}),app.component("ha-nav",{props:{prev:String,next:String,done:String,bepro:String},emits:["setTab"],template:'<div class="ha-setup-wizard__nav">\n <button class="ha-setup-wizard__nav_prev" v-if="prev" @click="$emit(\'setTab\',prev)">\n <svg width="12" height="8" viewBox="0 0 12 8" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 3.33333H2.55333L4.94 0.94L4 0L0 4L4 8L4.94 7.06L2.55333 4.66667H12V3.33333Z" fill="black"/>\n </svg>\n <span>Back</span>\n </button>\n\t\t<button class="ha-setup-wizard__nav_bepro" v-if="bepro" @click="$emit(\'setTab\',\'buypro\')">\n\t\t\t<svg width="20" height="16" viewBox="0 0 20 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t<path d="M19.8347 5.42149C19.8347 6.21488 19.1736 6.87603 18.3802 6.87603C18.2479 6.87603 18.2479 6.87603 18.1157 6.87603L15.8678 12.9587H3.96694L1.71901 6.87603C1.58678 6.87603 1.58678 6.87603 1.45455 6.87603C0.661157 6.87603 0 6.21488 0 5.42149C0 4.6281 0.661157 3.96694 1.45455 3.96694C2.24793 3.96694 2.90909 4.6281 2.90909 5.42149C2.90909 5.68595 2.90909 5.81818 2.77686 6.08264L5.02479 7.40496C5.55372 7.66942 6.08264 7.53719 6.34711 7.00826L8.99174 2.64463C8.59504 2.38017 8.46281 1.98347 8.46281 1.45455C8.46281 0.661157 9.12397 0 9.91736 0C10.7107 0 11.3719 0.661157 11.3719 1.45455C11.3719 1.98347 11.1074 2.38017 10.843 2.64463L13.3554 7.00826C13.6198 7.53719 14.281 7.66942 14.6777 7.40496L16.9256 6.08264C16.7934 5.95041 16.7934 5.68595 16.7934 5.42149C16.7934 4.6281 17.4545 3.96694 18.2479 3.96694C19.0413 3.96694 19.8347 4.6281 19.8347 5.42149ZM16.9256 14.4132V15.4711C16.9256 15.7355 16.6612 16 16.3967 16H3.43802C3.17355 16 2.90909 15.7355 2.90909 15.4711V14.4132C2.90909 14.1488 3.17355 13.8843 3.43802 13.8843H16.3967C16.6612 13.8843 16.9256 14.1488 16.9256 14.4132Z" fill="#FFC5C5"/>\n\t\t\t</svg>\t\t\n\t\t\t<span>Be A Pro</span>\n\t\t</button>\n <button class="ha-setup-wizard__nav_next" v-if="next" @click="$emit(\'setTab\',next)"><span>Next</span></button>\n <button class="ha-setup-wizard__nav_done" v-if="done" @click="$emit(\'setTab\',\'done\')"><span>Done</span></button>\n </div>\n\t'}),app.mount("#ha-setup-wizard");
|
1 |
+
"use strict";function _createForOfIteratorHelper(e,t){var n,r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return r&&(e=r),n=0,{s:t=function(){},n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function asyncGeneratorStep(e,t,n,r,a,i,s){try{var o=e[i](s),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,a)}function _asyncToGenerator(o){return function(){var e=this,s=arguments;return new Promise(function(t,n){var r=o.apply(e,s);function a(e){asyncGeneratorStep(r,t,n,a,i,"next",e)}function i(e){asyncGeneratorStep(r,t,n,a,i,"throw",e)}a(void 0)})}}var Wizard={data:function(){return{loaded:!1,screen:0,hasCache:!1,currentPage:"welcome",userType:"normal",hasConsent:!0,steps:[{key:"welcome",name:"Welcome",isComplete:!1},{key:"widgets",name:"Widgets",isComplete:!1},{key:"features",name:"Features",isComplete:!1},{key:"bepro",name:"Be a pro!",isComplete:!1},{key:"contribute",name:"Contribute",isComplete:!1},{key:"congrats",name:"Congrats",isComplete:!1}],widgetList:[],disabledWidgets:[],featureList:[],disabledFeatures:[],settings:{welcome:{userType:null},widgets:[],features:null,contribute:!1,all:[],checkedWidgets:[]},widgetMore:!0}},mounted:function(){this.fetchCache(),this.getCurrentPage()},methods:{fetchWidgetData:function(){var n=this;return _asyncToGenerator(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=window.HappyWizard.apiBase+"/widgets/all/",e.next=3,fetch(t,{method:"GET",headers:{"X-WP-Nonce":window.HappyWizard.nonce}}).then(function(e){return e.json()}).then(function(e){e&&(n.widgetList=e.all,n.disabledWidgets=e.disabled)}).catch(function(e){console.error("Error:",e)});case 3:case"end":return e.stop()}},e)}))()},fetchCache:function(){var n=this;return _asyncToGenerator(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=window.HappyWizard.apiBase+"/wizard/cache",e.next=3,fetch(t,{method:"GET",headers:{"X-WP-Nonce":window.HappyWizard.nonce}}).then(function(e){return e.json()}).then(function(e){e.data?(e.data.steps&&(n.steps=e.data.steps),e.data.currentPage&&(n.currentPage=e.data.currentPage),e.data.userType&&(n.userType=e.data.userType),e.data.widgets&&(n.widgetList=e.data.widgets),e.data.widgets_disabled&&(n.disabledWidgets=e.data.widgets_disabled),e.data.features&&(n.featureList=e.data.features),e.data.features_disabled&&(n.disabledFeatures=e.data.features_disabled),n.loaded=!0):n.fetchPreset(n.userType)}).catch(function(e){console.error("Error:",e)});case 3:case"end":return e.stop()}},e)}))()},fetchPreset:function(n){var r=this;return _asyncToGenerator(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=window.HappyWizard.apiBase+"/wizard/preset/"+n,e.next=3,fetch(t,{method:"GET",headers:{"X-WP-Nonce":window.HappyWizard.nonce}}).then(function(e){return e.json()}).then(function(e){e&&(r.widgetList=e.widgets.all,r.disabledWidgets=e.widgets.disabled,r.featureList=e.features.all,r.disabledFeatures=e.features.disabled),r.loaded=!0}).catch(function(e){console.error("Error:",e)});case 3:case"end":return e.stop()}},e)}))()},saveWizardData:function(){var a=arguments,i=this;return _asyncToGenerator(regeneratorRuntime.mark(function e(){var t,n,r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=0<a.length&&void 0!==a[0]?a[0]:"",n=window.HappyWizard.apiBase+"/wizard/save",r={widget:i.disabledWidgets,features:i.disabledFeatures,consent:i.consent?"yes":"no"},"cache"==t&&(n=window.HappyWizard.apiBase+"/wizard/save-cache",r={currentPage:i.currentPage,userType:i.userType,steps:i.steps,widgets:i.widgetList,widgets_disabled:i.disabledWidgets,features:i.featureList,features_disabled:i.disabledFeatures,consent:i.hasConsent?"yes":"no"}),e.next=6,fetch(n,{method:"POST",headers:{"X-WP-Nonce":window.HappyWizard.nonce},body:JSON.stringify(r),contentType:"application/json; charset=utf-8"}).then(function(e){return e.json()}).then(function(e){e&&200===e.status&&"cache"!==t&&window.open(window.HappyWizard.haAdmin,"_self")}).catch(function(e){console.error("Error:",e)});case 6:case"end":return e.stop()}},e)}))()},endWizard:function(){return _asyncToGenerator(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(confirm("Head’s up. This action is non reversible and you won’t be able to see this wizard again. Proceed?"))return t=window.HappyWizard.apiBase+"/wizard/skip",e.next=5,fetch(t,{method:"POST",headers:{"X-WP-Nonce":window.HappyWizard.nonce}}).then(function(e){return e.json()}).then(function(e){e&&200===e.status&&window.open(window.HappyWizard.haAdmin,"_self")}).catch(function(e){console.error("Error:",e)});e.next=5;break;case 5:case"end":return e.stop()}},e)}))()},setUserType:function(e){this.userType=e,this.fetchPreset(e)},setTab:function(e){e&&("buypro"==e?window.open("https://happyaddons.com/go/get-pro","_blank").focus():"done"==e?this.saveWizardData():(this.setStepComplete(this.currentPage),this.currentPage=e,this.screen=e),this.saveWizardData("cache"))},setStepComplete:function(e){var t,n=_createForOfIteratorHelper(this.steps);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.key==e){r.isComplete=!0;break}}}catch(e){n.e(e)}finally{n.f()}},revealWidgetList:function(){this.widgetMore=!1},getCurrentPage:function(){var e,t=_createForOfIteratorHelper(this.steps);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(0==n.isComplete){this.currentPage=n.key;break}}}catch(e){t.e(e)}finally{t.f()}return this.currentPage},goNext:function(e){this.setTab(e)},allAdd:function(e){var t=this.widgetList[e],n=this;return Object.keys(t).forEach(function(e){t[e].is_active=!0,n.isActive(t[e].slug,!1)}),-1===this.settings.all.indexOf(e)&&this.settings.all.push(e),t},allRemove:function(r){var t=this.widgetList[r],n=this;return Object.keys(t).forEach(function(e){t[e].is_active=!1,n.isActive(t[e].slug,!0)}),this.settings.all=this.settings.all.filter(function(e,t,n){return e!=r}),t},isActive:function(r,e){!0===e?-1===this.disabledWidgets.indexOf(r)&&this.disabledWidgets.push(r):this.disabledWidgets=this.disabledWidgets.filter(function(e,t,n){return e!=r})},isFeatureActive:function(r,e){!0===e?-1===this.disabledFeatures.indexOf(r)&&this.disabledFeatures.push(r):this.disabledFeatures=this.disabledFeatures.filter(function(e,t,n){return e!=r})},makeTitle:function(e){e=e.replace(/-/g," ").replace("and","&");return e.charAt(0).toUpperCase()+e.slice(1)},makeLabel:function(e){return e?"PRO":"FREE"},sortByTitle:function(e){return e.sort(function(e,t){return e.title<t.title?-1:1})}},watch:{"settings.checkedWidgets":function(e){},"settings.all":function(e){},hasConsent:function(e){}},computed:{}},app=Vue.createApp(Wizard);app.config.globalProperties.window=window,app.component("ha-step",{props:{active:String,complete:Boolean,step:String,title:String,index:Number},emits:["setTab"],computed:{isActive:function(){return this.active==this.step}},methods:{handleClick:function(e){this.complete&&this.$emit("setTab",e)}},template:'<div class="ha-stepper__step" :class="{ \'is-complete\': this.complete, \'is-active\': this.isActive }" @click="handleClick(step)">\n\t<button class="ha-stepper__step-label-wrapper">\n\t\t<div class="ha-stepper__step-icon">\n\t\t\t<span class="ha-stepper__step-number">{{index}}</span>\n\t\t\t<svg width="15" height="11" viewBox="0 0 15 11" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t<path d="M5.09467 10.784L0.219661 5.98988C-0.0732203 5.70186 -0.0732203 5.23487 0.219661 4.94682L1.2803 3.90377C1.57318 3.61572 2.04808 3.61572 2.34096 3.90377L5.625 7.13326L12.659 0.216014C12.9519 -0.0720048 13.4268 -0.0720048 13.7197 0.216014L14.7803 1.25907C15.0732 1.54709 15.0732 2.01408 14.7803 2.30213L6.15533 10.784C5.86242 11.072 5.38755 11.072 5.09467 10.784Z" fill="white"/>\n\t\t\t</svg>\n\t\t</div>\n\t\t<div class="ha-stepper__step-text">\n\t\t\t<span class="ha-stepper__step-label">{{title}}</span>\n\t\t</div>\n\t</button>\n</div>\n<div class="ha-stepper__step-divider">\n<svg width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M14.2218 4.80762C13.8313 4.4171 13.1981 4.4171 12.8076 4.80762C12.4171 5.19815 12.4171 5.83131 12.8076 6.22184L14.2218 4.80762ZM18.4853 10.4853L19.1924 11.1924L19.8995 10.4853L19.1924 9.77818L18.4853 10.4853ZM12.8076 14.7487C12.4171 15.1393 12.4171 15.7724 12.8076 16.163C13.1981 16.5535 13.8313 16.5535 14.2218 16.163L12.8076 14.7487ZM7.19238 4.80762C6.80186 4.4171 6.16869 4.4171 5.77817 4.80762C5.38764 5.19814 5.38764 5.83131 5.77817 6.22183L7.19238 4.80762ZM11.4558 10.4853L12.1629 11.1924L12.87 10.4853L12.1629 9.77818L11.4558 10.4853ZM5.77817 14.7487C5.38764 15.1393 5.38764 15.7724 5.77817 16.163C6.16869 16.5535 6.80186 16.5535 7.19238 16.163L5.77817 14.7487ZM12.8076 6.22184L17.7782 11.1924L19.1924 9.77818L14.2218 4.80762L12.8076 6.22184ZM17.7782 9.77818L12.8076 14.7487L14.2218 16.163L19.1924 11.1924L17.7782 9.77818ZM5.77817 6.22183L10.7487 11.1924L12.1629 9.77818L7.19238 4.80762L5.77817 6.22183ZM10.7487 9.77818L5.77817 14.7487L7.19238 16.163L12.1629 11.1924L10.7487 9.77818Z" fill="currentColor"/>\n</svg>\n</div>'}),app.component("ha-nav",{props:{prev:String,next:String,done:String,bepro:String},emits:["setTab"],template:'<div class="ha-setup-wizard__nav">\n <button class="ha-setup-wizard__nav_prev" v-if="prev" @click="$emit(\'setTab\',prev)">\n <svg width="12" height="8" viewBox="0 0 12 8" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M12 3.33333H2.55333L4.94 0.94L4 0L0 4L4 8L4.94 7.06L2.55333 4.66667H12V3.33333Z" fill="black"/>\n </svg>\n <span>Back</span>\n </button>\n\t\t<button class="ha-setup-wizard__nav_bepro" v-if="bepro" @click="$emit(\'setTab\',\'buypro\')">\n\t\t\t<svg width="20" height="16" viewBox="0 0 20 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t<path d="M19.8347 5.42149C19.8347 6.21488 19.1736 6.87603 18.3802 6.87603C18.2479 6.87603 18.2479 6.87603 18.1157 6.87603L15.8678 12.9587H3.96694L1.71901 6.87603C1.58678 6.87603 1.58678 6.87603 1.45455 6.87603C0.661157 6.87603 0 6.21488 0 5.42149C0 4.6281 0.661157 3.96694 1.45455 3.96694C2.24793 3.96694 2.90909 4.6281 2.90909 5.42149C2.90909 5.68595 2.90909 5.81818 2.77686 6.08264L5.02479 7.40496C5.55372 7.66942 6.08264 7.53719 6.34711 7.00826L8.99174 2.64463C8.59504 2.38017 8.46281 1.98347 8.46281 1.45455C8.46281 0.661157 9.12397 0 9.91736 0C10.7107 0 11.3719 0.661157 11.3719 1.45455C11.3719 1.98347 11.1074 2.38017 10.843 2.64463L13.3554 7.00826C13.6198 7.53719 14.281 7.66942 14.6777 7.40496L16.9256 6.08264C16.7934 5.95041 16.7934 5.68595 16.7934 5.42149C16.7934 4.6281 17.4545 3.96694 18.2479 3.96694C19.0413 3.96694 19.8347 4.6281 19.8347 5.42149ZM16.9256 14.4132V15.4711C16.9256 15.7355 16.6612 16 16.3967 16H3.43802C3.17355 16 2.90909 15.7355 2.90909 15.4711V14.4132C2.90909 14.1488 3.17355 13.8843 3.43802 13.8843H16.3967C16.6612 13.8843 16.9256 14.1488 16.9256 14.4132Z" fill="#FFC5C5"/>\n\t\t\t</svg>\t\t\n\t\t\t<span>Be A Pro</span>\n\t\t</button>\n <button class="ha-setup-wizard__nav_next" v-if="next" @click="$emit(\'setTab\',next)"><span>Next</span></button>\n <button class="ha-setup-wizard__nav_done" v-if="done" @click="$emit(\'setTab\',\'done\')"><span>Done</span></button>\n </div>\n\t'}),app.mount("#ha-setup-wizard");
|
changelog.txt
CHANGED
@@ -1,3 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
= 3.6.2 - 5 July 2022 =
|
2 |
|
3 |
- Tweak: Horizontal Timeline Title Link
|
1 |
+
= 3.6.3 - 10 August 2022 =
|
2 |
+
|
3 |
+
- Tweak: Removed `Elementor\DB::is_built_with_elementor` deprecated method from Elementor 3.7.0.
|
4 |
+
- Fix: Post tab title tag issue
|
5 |
+
- Fix: Infobox lord icon render issue
|
6 |
+
|
7 |
= 3.6.2 - 5 July 2022 =
|
8 |
|
9 |
- Tweak: Horizontal Timeline Title Link
|
classes/ajax-handler.php
CHANGED
@@ -224,6 +224,7 @@ class Ajax_Handler {
|
|
224 |
$taxonomy = $settings['taxonomy'];
|
225 |
$item_limit = $settings['item_limit'];
|
226 |
$excerpt = $settings['excerpt'];
|
|
|
227 |
$term_id = $_POST['term_id'];
|
228 |
|
229 |
$args = [
|
@@ -253,9 +254,14 @@ class Ajax_Handler {
|
|
253 |
<?php echo get_the_post_thumbnail( $post->ID, 'full' ); ?>
|
254 |
</a>
|
255 |
<?php endif; ?>
|
256 |
-
|
257 |
-
|
258 |
-
|
|
|
|
|
|
|
|
|
|
|
259 |
<div class="ha-post-tab-meta">
|
260 |
<span class="ha-post-tab-meta-author">
|
261 |
<i class="fa fa-user-o"></i>
|
224 |
$taxonomy = $settings['taxonomy'];
|
225 |
$item_limit = $settings['item_limit'];
|
226 |
$excerpt = $settings['excerpt'];
|
227 |
+
$title_tag = $settings['title_tag'];
|
228 |
$term_id = $_POST['term_id'];
|
229 |
|
230 |
$args = [
|
254 |
<?php echo get_the_post_thumbnail( $post->ID, 'full' ); ?>
|
255 |
</a>
|
256 |
<?php endif; ?>
|
257 |
+
<?php
|
258 |
+
printf(
|
259 |
+
'<%1$s class="ha-post-tab-title"><a href="%2$s">%3$s</a></%1$s>',
|
260 |
+
ha_escape_tags( $title_tag, 'h2' ),
|
261 |
+
esc_url( get_the_permalink( $post->ID ) ),
|
262 |
+
esc_html( $post->post_title )
|
263 |
+
);
|
264 |
+
?>
|
265 |
<div class="ha-post-tab-meta">
|
266 |
<span class="ha-post-tab-meta-author">
|
267 |
<i class="fa fa-user-o"></i>
|
classes/cache-manager.php
CHANGED
@@ -46,7 +46,8 @@ class Cache_Manager {
|
|
46 |
}
|
47 |
|
48 |
public static function is_built_with_elementor( $post_id ) {
|
49 |
-
return ha_elementor()->db->is_built_with_elementor( $post_id );
|
|
|
50 |
}
|
51 |
|
52 |
public static function should_enqueue( $post_id ) {
|
46 |
}
|
47 |
|
48 |
public static function is_built_with_elementor( $post_id ) {
|
49 |
+
// return ha_elementor()->db->is_built_with_elementor( $post_id );
|
50 |
+
return ha_elementor()->documents->get( $post_id )->is_built_with_elementor();
|
51 |
}
|
52 |
|
53 |
public static function should_enqueue( $post_id ) {
|
classes/clone-handler.php
CHANGED
@@ -217,7 +217,7 @@ class Clone_Handler {
|
|
217 |
public static function register_finder( Categories_Manager $categories_manager ) {
|
218 |
include_once HAPPY_ADDONS_DIR_PATH . 'classes/finder-edit.php';
|
219 |
|
220 |
-
$categories_manager->
|
221 |
}
|
222 |
|
223 |
}
|
217 |
public static function register_finder( Categories_Manager $categories_manager ) {
|
218 |
include_once HAPPY_ADDONS_DIR_PATH . 'classes/finder-edit.php';
|
219 |
|
220 |
+
$categories_manager->register( new Finder_Edit() );
|
221 |
}
|
222 |
|
223 |
}
|
classes/widgets-manager.php
CHANGED
@@ -478,7 +478,7 @@ class Widgets_Manager {
|
|
478 |
'js' => [],
|
479 |
'vendor' => [
|
480 |
'css' => [],
|
481 |
-
'js' => [],
|
482 |
],
|
483 |
],
|
484 |
'card' => [
|
478 |
'js' => [],
|
479 |
'vendor' => [
|
480 |
'css' => [],
|
481 |
+
'js' => [ 'lord-icon' ],
|
482 |
],
|
483 |
],
|
484 |
'card' => [
|
plugin.php
CHANGED
@@ -4,11 +4,11 @@
|
|
4 |
* Plugin Name: Happy Elementor Addons
|
5 |
* Plugin URI: https://happyaddons.com/
|
6 |
* Description: <a href="https://happyaddons.com/">Happy Addons for Elementor</a> Is the Best Elementor Addons Comes With 44+ Free Elementor Widgets Including Table Builder, Testimonial, Event Calendar,Slider,News Ticker, Image Grid, etc & Features Like Elementor Equal Height, Text Stroke, Shape Dividers, Floating Effect, Grid Layout, 500+ Elementor Icons, 450+ Template Packs & More.
|
7 |
-
* Version: 3.6.
|
8 |
* Author: weDevs
|
9 |
* Author URI: https://happyaddons.com/
|
10 |
-
* Elementor tested up to: 3.
|
11 |
-
* Elementor Pro tested up to: 3.7.
|
12 |
* License: GPLv2
|
13 |
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
14 |
* Text Domain: happy-elementor-addons
|
@@ -41,7 +41,7 @@ defined('ABSPATH') || die();
|
|
41 |
if ( defined( 'HAPPY_ADDONS_DEV' ) && true == HAPPY_ADDONS_DEV ) {
|
42 |
define('HAPPY_ADDONS_VERSION', time() );
|
43 |
} else {
|
44 |
-
define('HAPPY_ADDONS_VERSION', '3.6.
|
45 |
}
|
46 |
define('HAPPY_ADDONS__FILE__', __FILE__);
|
47 |
define('HAPPY_ADDONS_DIR_PATH', plugin_dir_path(HAPPY_ADDONS__FILE__));
|
4 |
* Plugin Name: Happy Elementor Addons
|
5 |
* Plugin URI: https://happyaddons.com/
|
6 |
* Description: <a href="https://happyaddons.com/">Happy Addons for Elementor</a> Is the Best Elementor Addons Comes With 44+ Free Elementor Widgets Including Table Builder, Testimonial, Event Calendar,Slider,News Ticker, Image Grid, etc & Features Like Elementor Equal Height, Text Stroke, Shape Dividers, Floating Effect, Grid Layout, 500+ Elementor Icons, 450+ Template Packs & More.
|
7 |
+
* Version: 3.6.3
|
8 |
* Author: weDevs
|
9 |
* Author URI: https://happyaddons.com/
|
10 |
+
* Elementor tested up to: 3.7.0
|
11 |
+
* Elementor Pro tested up to: 3.7.3
|
12 |
* License: GPLv2
|
13 |
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
14 |
* Text Domain: happy-elementor-addons
|
41 |
if ( defined( 'HAPPY_ADDONS_DEV' ) && true == HAPPY_ADDONS_DEV ) {
|
42 |
define('HAPPY_ADDONS_VERSION', time() );
|
43 |
} else {
|
44 |
+
define('HAPPY_ADDONS_VERSION', '3.6.3');
|
45 |
}
|
46 |
define('HAPPY_ADDONS__FILE__', __FILE__);
|
47 |
define('HAPPY_ADDONS_DIR_PATH', plugin_dir_path(HAPPY_ADDONS__FILE__));
|
readme.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
=== Happy Addons for Elementor (Mega Menu, Post Grid, Woocommerce Product Grid, Table, Event Calendar, Slider Elementor Widget) ===
|
2 |
Plugin Name: Happy Addons for Elementor (Mega Menu, Post Grid, Woocommerce Product Grid, Table, Event Calendar, Slider Elementor Widget)
|
3 |
-
Version: 3.6.
|
4 |
Author: weDevs
|
5 |
Author URI: https://happyaddons.com/
|
6 |
Contributors: happyaddons, thehappymonster, wedevs
|
@@ -549,6 +549,12 @@ For a more detailed explanation check out the following documentation
|
|
549 |
|
550 |
== Changelog ==
|
551 |
|
|
|
|
|
|
|
|
|
|
|
|
|
552 |
= 3.6.2 - 5 July 2022 =
|
553 |
|
554 |
- Tweak: Horizontal Timeline Title Link
|
1 |
=== Happy Addons for Elementor (Mega Menu, Post Grid, Woocommerce Product Grid, Table, Event Calendar, Slider Elementor Widget) ===
|
2 |
Plugin Name: Happy Addons for Elementor (Mega Menu, Post Grid, Woocommerce Product Grid, Table, Event Calendar, Slider Elementor Widget)
|
3 |
+
Version: 3.6.3
|
4 |
Author: weDevs
|
5 |
Author URI: https://happyaddons.com/
|
6 |
Contributors: happyaddons, thehappymonster, wedevs
|
549 |
|
550 |
== Changelog ==
|
551 |
|
552 |
+
= 3.6.3 - 10 August 2022 =
|
553 |
+
|
554 |
+
- Tweak: Removed `Elementor\DB::is_built_with_elementor` deprecated method from Elementor 3.7.0.
|
555 |
+
- Fix: Post tab title tag issue
|
556 |
+
- Fix: Infobox lord icon render issue
|
557 |
+
|
558 |
= 3.6.2 - 5 July 2022 =
|
559 |
|
560 |
- Tweak: Horizontal Timeline Title Link
|
widgets/post-tab/widget.php
CHANGED
@@ -905,6 +905,7 @@ class Post_Tab extends Base {
|
|
905 |
'taxonomy' => $taxonomy,
|
906 |
'item_limit' => $settings['item_limit'],
|
907 |
'excerpt' => $settings['excerpt'] ? $settings['excerpt'] : 'no',
|
|
|
908 |
];
|
909 |
$query_settings = json_encode( $query_settings, true );
|
910 |
|
905 |
'taxonomy' => $taxonomy,
|
906 |
'item_limit' => $settings['item_limit'],
|
907 |
'excerpt' => $settings['excerpt'] ? $settings['excerpt'] : 'no',
|
908 |
+
'title_tag' => $settings['title_tag'],
|
909 |
];
|
910 |
$query_settings = json_encode( $query_settings, true );
|
911 |
|