PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 2.8.16
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v2.8.16
3.13.3 3.13.2 3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 All 261 releases
wpfunnels / admin / modules / template-library / Components / StepImporter.vue

StepImporter.vue in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 2.8.16, at admin/modules/template-library/Components/StepImporter.vue

178 lines 9.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <template>
2 <div id="wpfnl-create-steps_inner-content" class="wpfnl-create-step_inner-content">
3 <div class="not-clickable-overlay">
4 <span class="import-message">Creating Step...</span>
5 </div>
6
7 <div id="wpfnl-create-step__template-wrapper" class="wpfnl-create-step__template-wrapper template-library-modal__body">
8
9 <div class="steps-template__filter-wrapper">
10 <span class="wpfnl-modal-close" @click="hideStepImporter">
11 <svg width="15" height="15" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">>
12 <path d="M13.25 14C13.25 14.4142 13.5858 14.75 14 14.75C14.4142 14.75 14.75 14.4142 14.75 14H13.25ZM1 5L0.46967 4.46967C0.255171 4.68417 0.191005 5.00676 0.30709 5.28701C0.423176 5.56727 0.696653 5.75 1 5.75L1 5ZM5.53033 1.53033C5.82322 1.23744 5.82322 0.762563 5.53033 0.46967C5.23744 0.176777 4.76256 0.176777 4.46967 0.46967L5.53033 1.53033ZM4.46967 9.53033C4.76256 9.82322 5.23744 9.82322 5.53033 9.53033C5.82322 9.23744 5.82322 8.76256 5.53033 8.46967L4.46967 9.53033ZM1.53033 4.46967C1.23744 4.17678 0.762563 4.17678 0.46967 4.46967C0.176777 4.76256 0.176777 5.23744 0.46967 5.53033L1.53033 4.46967ZM14.75 14V8H13.25V14H14.75ZM14.75 8C14.75 5.92893 13.0711 4.25 11 4.25V5.75C12.2426 5.75 13.25 6.75736 13.25 8H14.75ZM11 4.25H1V5.75H11V4.25ZM1.53033 5.53033L5.53033 1.53033L4.46967 0.46967L0.46967 4.46967L1.53033 5.53033ZM5.53033 8.46967L1.53033 4.46967L0.46967 5.53033L4.46967 9.53033L5.53033 8.46967Z" fill="#7A8B9A"/>
13 </svg>
14 </span>
15
16 <StepCategorySelect :categories="stepCategories" :active-category="activeStepCategory" @doStepCatFilter="doStepCatFilter"/>
17
18 <ul class="pro-free__filter">
19 <li data-filter="all" :class="stepTemplateType == 'all' ? 'active' : '' " @click="doStepFreeProFilter('all')">all</li>
20 <li data-filter="free" :class="stepTemplateType == 'free' ? 'active' : '' " @click="doStepFreeProFilter('free')">free</li>
21 <li data-filter="pro" :class="stepTemplateType == 'pro' ? 'active' : '' " @click="doStepFreeProFilter('pro')">
22 <svg width="20" height="14" viewBox="0 0 20 14" fill="none" xmlns="http://www.w3.org/2000/svg">>
23 <path fill-rule="evenodd" clip-rule="evenodd" d="M10 1L14 7L19 3L17 13H3L1 3L6 7L10 1Z" stroke="#7A8B9A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
24 </svg>
25 Premium
26 </li>
27 </ul>
28
29 <!-- <div class="wpfnl-template__serarch-field">
30 <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-search" width="32" height="32" viewBox="0 0 28 28" stroke-width="1.5" stroke="#7A8B9A" fill="none" stroke-linecap="round" stroke-linejoin="round">
31 <path stroke="none" d="M0 0h24v24H0z" fill="none"/>
32 <circle cx="10" cy="10" r="7" />
33 <line x1="21" y1="21" x2="15" y2="15" />
34 </svg>
35
36 <input type="search" name="step-template-search" placeholder="Search">
37 </div> -->
38 </div>
39
40
41 <ul class="wpfnl-create-step__filter-nav" id="wpfnl-create-step__filter-nav">
42 <li :class="{ active : activeItem == 'landing' }" id="create-step-landing" data-filter="landing" @click="doStepFilter">Landing</li>
43 <li :class="{ active : activeItem == 'checkout' }" id="create-step-checkout" data-filter="checkout" @click="doStepFilter" :disabled="'lead'==this.funnelType">Checkout</li>
44 <li :class="{ active : activeItem == 'thankyou' }" id="create-step-thankyou" data-filter="thankyou" @click="doStepFilter" >Thankyou</li>
45
46 <!-- for upsell check if pro activated or not -->
47 <li v-if="!isPro" class="disabled">
48 Upsell
49 <a :href="proUrl " target="_blank" title="Click to Upgrade Pro">
50 <span class="pro-tag">coming soon</span>
51 </a>
52 </li>
53 <li v-else :class="{ active : activeItem == 'upsell' }" data-filter="upsell" :id="isPro ? 'create-step-upsell' : ''" @click="doStepFilter" :disabled="'lead'==this.funnelType">Upsell</li>
54
55 <!-- for downsell check if pro activated or not -->
56 <li v-if="!isPro" class="disabled">
57 Downsell
58 <a :href="proUrl " target="_blank" title="Click to Upgrade Pro">
59 <span class="pro-tag">coming soon</span>
60 </a>
61 </li>
62 <li v-else data-filter="downsell" :class="{ active : activeItem == 'downsell' }" :id="isPro ? 'create-step-downsell' : ''" @click="doStepFilter" :disabled="'lead'==this.funnelType">Downsell </li>
63 </ul>
64
65 <div class="wpfnl-step__templates-wrapper-before">
66 <div class="wpfnl-step__templates-wrapper">
67 <div class="wpfnl-step__single-template create__from-scratch">
68 <a href="#" id="wpfnl-create-step" class="btn-default" :data-step-type="activeStep" :data-funnel-id="funnelID" @click="createStep" v-bind:style='{"pointer-events" : (disabled? "none" : "" )}'>Start From scratch</a>
69
70 <div class="template-preview-image">
71 <div class="step-image-wrapper">
72 </div>
73 </div>
74 <div class="step-template-info">
75 <span class="title">title</span>
76 </div>
77 </div>
78
79 <SingleStep
80 v-for="(step, index) in steps"
81 :step="step"
82 :key="index"
83 :funnelID="funnelID"
84 :activeStep="activeStep"
85 v-if="activeStep === step?.step_type"
86 />
87 </div>
88 </div>
89 </div>
90 </div>
91 </template>
92 <script>
93 import SingleStep from './SingleStep.vue'
94 import StepCategorySelect from './StepCategorySelect.vue'
95 var j = jQuery.noConflict();
96 export default {
97 name: 'StepImporter',
98 components: {
99 SingleStep,
100 StepCategorySelect
101 },
102 props: {
103 steps: Array,
104 categories: Array,
105 activeStepCategory: String,
106 activeStep: String,
107 stepTemplateType: String,
108 stepCategories: Array,
109 },
110 data: function () {
111 return {
112 activeClass : '',
113 activeCat : 'all',
114 isPro : window.template_library_object.is_pro,
115 proUrl : window.template_library_object.pro_url,
116 funnelID : window.template_library_object.funnel_id,
117 funnelType : window.WPFunnelVars.individual_funnel_type,
118 activeItem : 'landing',
119 disabled: false,
120 }
121 },
122 methods: {
123 doStepFilter: function (e) {
124 this.$emit('setActiveStep', e.currentTarget.getAttribute('data-filter') )
125 this.$emit('doStepFilter', e.currentTarget.getAttribute('data-filter') )
126 this.activeItem = e.currentTarget.getAttribute('data-filter');
127 },
128 doStepCatFilter: function (value) {
129 this.$emit('doStepCatFilter', value )
130 },
131 doStepFreeProFilter: function (value) {
132 this.$emit('doStepFreeProFilter', value )
133 },
134
135 createStep: function (e) {
136 e.preventDefault()
137
138 j('.wpfnl-create-step_inner-content .not-clickable-overlay .import-message').css("display", "inline-block");
139 j('.wpfnl-create-step_inner-content .not-clickable-overlay').css({
140 "background-color": "rgba(0, 0, 0, 0.3)",
141 "display": "flex"
142 });
143
144 this.disabled = true;
145 var that = this,
146 payload = {
147 'funnel_id' : window.template_library_object.funnel_id,
148 'step_type' : this.activeItem,
149 };
150 wpAjaxHelperRequest( "create-step", payload )
151 .success( function( response ) {
152 payload.step_id = response.step_id;
153 payload.step_edit_link = response.step_edit_link;
154 payload.step_view_link = response.step_view_link;
155 that.$emit('hideStepImporter');
156 that.$emit('renderNode', payload);
157 that.disabled = false;
158 j('.wpfnl-create-step_inner-content .not-clickable-overlay .import-message').css("display", "none");
159 j('.wpfnl-create-step_inner-content .not-clickable-overlay').css({
160 "display": "none"
161 });
162 })
163 .error( function( response ) {
164 console.log(response)
165 });
166 },
167 renderNode: function (data) {
168 this.$emit('renderNode', data )
169 },
170
171 hideStepImporter: function (e) {
172 e.preventDefault();
173 this.$emit('hideStepImporter');
174 }
175 }
176 }
177 </script>
178