PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.17.14
Shortcodes and extra features for Phlox theme v2.17.14
2.17.20 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.6 1.0.9 1.1.0 1.3.0 1.3.1 1.3.10 1.3.14 1.3.2 1.3.3 1.3.6 1.4.0 1.4.1 1.4.2 1.5.0 1.5.2 1.6.0 1.6.2 1.6.4 1.7.0 1.7.2 2.10.0 2.10.1 2.10.3 2.10.5 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.2 2.12.0 2.14.0 2.15.0 2.15.2 2.15.4 2.15.5 2.15.6 2.15.7 2.15.8 2.15.9 2.16.0 2.16.1 2.16.2 2.16.3 2.16.4 2.17.0 2.17.1 2.17.12 2.17.13 2.17.14 2.17.15 2.17.16 2.17.2 2.17.3 2.17.4 2.17.5 2.17.6 2.17.8 2.17.9 2.4.12 2.4.13 2.4.14 2.4.16 2.4.18 2.4.19 2.4.9 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.15 2.5.16 2.5.17 2.5.19 2.5.2 2.5.20 2.5.3 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.10 2.6.12 2.6.13 2.6.14 2.6.15 2.6.16 2.6.17 2.6.19 2.6.2 2.6.20 2.6.4 2.6.5 2.6.7 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.9 2.9.0 2.9.12 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.19 2.9.2 2.9.20 2.9.21 2.9.22 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8
auxin-elements / public / assets / js / scripts.js
auxin-elements / public / assets / js Last commit date
index.php 9 years ago plugins.js 6 months ago plugins.min.js 7 years ago scripts.js 1 year ago
scripts.js
303 lines
1 ;(function($, window, document, undefined){
2 var AuxinRemoveCartContent = function() {
3 // Remove cart content
4 $(document).on( 'click', '.aux-remove-cart-content', function(e) {
5 e.preventDefault();
6
7 var $thisbutton = $(this);
8 var product_id = $(this).data("product_id");
9 var cart_item_key= $(this).data("cart_item_key");
10 var verify_nonce = $(this).data("verify_nonce");
11 var $cartBoxEl = $(this).closest('.aux-cart-wrapper').addClass('aux-cart-remove-in-progress');
12
13 if ( typeof auxin_cart_options === 'undefined' ) {
14 auxin_cart_options = '';
15 }
16
17 $.ajax({
18 type: 'POST',
19 dataType: 'json',
20 url: auxin.ajax_url,
21 data: {
22 action: "auxels_remove_from_cart",
23 product_id: product_id,
24 cart_item_key: cart_item_key,
25 verify_nonce: verify_nonce,
26 args : auxin_cart_options,
27 },
28 success: function( response ){
29 // Remove old notification
30 $(".woocommerce-message, .woocommerce-error").remove();
31 // Start Notifications
32 if( response.success ) {
33 $('.aux-hidden-blocks').append( response.data.notif );
34
35 if( parseInt(response.data.total) === 0 ) {
36 $('.aux-card-dropdown').html(response.data.empty);
37 $('.aux-cart-contents').find('span').remove();
38 } else {
39 $('.aux-card-item').filter(function(){
40 return $(this).data('cart_item_key') == cart_item_key;
41 }).remove();
42 $('.aux-cart-contents').find('span').text(response.data.count);
43 }
44 $(".aux-cart-subtotal").each(function() {
45 $(this).find('.woocommerce-Price-amount').html(response.data.total);
46 });
47 $cartBoxEl.removeClass('aux-cart-remove-in-progress');
48
49 $( document.body ).trigger( 'removed_from_cart', [ response.data.fragments, response.data.cart_hash, $thisbutton, response.data.items ] );
50 } else {
51 $('.aux-hidden-blocks').append( response.data );
52 }
53 // check to be sure offcanvas cart style is always visible in mobile
54 $('#offcart .aux-cart-wrapper .aux-card-dropdown').removeClass('aux-phone-off');
55 }
56 });
57
58 });
59 };
60
61 var AuxinAjaxAddToCart = function() {
62 // Add Content to Cart
63 $(document).on( 'click', '.aux-ajax-add-to-cart', function(e) {
64 var $thisbutton = $(this);
65 var productType = $(this).data("product-type");
66
67 if ( productType !== 'simple' ) {
68 return;
69 }
70
71 $thisbutton.removeClass( 'added' );
72 $thisbutton.addClass( 'loading' );
73
74 if ( typeof auxin_cart_options === 'undefined' ) {
75 auxin_cart_options = '';
76 }
77
78 e.preventDefault();
79
80 var product_id = $(this).data("product_id");
81 var quantity = $(this).data("quantity");
82 var verify_nonce = $(this).data("verify_nonce");
83 var $cartBoxEl = $('.aux-cart-wrapper');
84 var hasAnimation = $cartBoxEl.hasClass('aux-basket-animation') ? true : false;
85
86 $cartBoxEl.trigger('AuxCartInProgress');
87
88 if ( $(this).parents('.aux-shop-quicklook-modal') ) {
89 quantity = $(this).parents('.aux-shop-quicklook-modal').find('.quantity input').val();
90 }
91
92 var data = {};
93
94 $.each( $thisbutton.data(), function( key, value ) {
95 data[ key ] = value;
96 });
97
98 // Fetch data attributes in $thisbutton. Give preference to data-attributes because they can be directly modified by javascript
99 // while `.data` are jquery specific memory stores.
100 $.each( $thisbutton[0].dataset, function( key, value ) {
101 data[ key ] = value;
102 });
103
104 // Trigger event.
105 $( document.body ).trigger( 'adding_to_cart', [ $thisbutton, data ] );
106
107 $.ajax({
108 type: 'POST',
109 dataType: 'json',
110 url: auxin.ajax_url,
111 data: {
112 action : "auxels_add_to_cart",
113 args : auxin_cart_options,
114 product_id : product_id,
115 quantity : quantity,
116 verify_nonce: verify_nonce
117 },
118 success: function( response ){
119 // Remove old notification
120 $(".woocommerce-message, .woocommerce-error").remove();
121 // Start Notifications
122 if( response.success ) {
123 $('.aux-hidden-blocks').append( response.data.notif );
124
125 setTimeout( function(){
126 if ( hasAnimation ) {
127 // $cartBoxEl.on('AuxCartProgressAnimationDone', function(e) {
128 $cartBoxEl.find('.aux-card-dropdown').html( response.data.items );
129 $cartBoxEl.find('.aux-shopping-basket').html( response.data.total );
130 $cartBoxEl.trigger('AuxCartUpdated');
131 $( document.body ).trigger( 'added_to_cart', [ response.data.fragments, response.data.cart_hash, $thisbutton ] );
132 // });
133 } else {
134 $cartBoxEl.find('.aux-card-dropdown').html( response.data.items );
135 $cartBoxEl.find('.aux-shopping-basket').html( response.data.total );
136 $cartBoxEl.trigger('AuxCartUpdated');
137 $( document.body ).trigger( 'added_to_cart', [ response.data.fragments, response.data.cart_hash, $thisbutton, response.data.items ] );
138 }
139 // check to be sure offcanvas cart style is always visible in mobile
140 $('#offcart .aux-cart-wrapper .aux-card-dropdown').removeClass('aux-phone-off');
141 }, 150);
142 } else {
143 $('.aux-hidden-blocks').append( response.data );
144 }
145
146 }
147
148 });
149
150 });
151
152 $(document.body).on( 'wc_fragments_refreshed', function(){
153
154 var $cartBoxEl = $('.aux-cart-wrapper');
155 var hasAnimation = $cartBoxEl.hasClass('aux-basket-animation') ? true : false;
156
157 if ( typeof auxin_cart_options === 'undefined' ) {
158 auxin_cart_options = '';
159 }
160
161 $.ajax({
162 type: 'POST',
163 dataType: 'json',
164 url: auxin.ajax_url,
165 data: {
166 action : "auxels_get_refreshed_fragments",
167 args : auxin_cart_options,
168 },
169 success: function( response ){
170 // Remove old notification
171 $(".woocommerce-message, .woocommerce-error").remove();
172 // Start Notifications
173 if( response.success ) {
174
175 setTimeout( function(){
176 if ( hasAnimation ) {
177 $cartBoxEl.find('.aux-card-dropdown').html( response.data.items );
178 $cartBoxEl.find('.aux-shopping-basket').html( response.data.total );
179 $cartBoxEl.trigger('AuxCartUpdated');
180 } else {
181 $cartBoxEl.find('.aux-card-dropdown').html( response.data.items );
182 $cartBoxEl.find('.aux-shopping-basket').html( response.data.total );
183 $cartBoxEl.trigger('AuxCartUpdated');
184 }
185 }, 150);
186 } else {
187 $('.aux-hidden-blocks').append( response.data );
188 }
189
190 }
191
192 });
193
194 });
195
196 };
197
198 var AjaxRecentProductsPagination = function () {
199 $('a.page-numbers').on('click', function (e) {
200 if ( !$(this).parents('.aux-widget-recent-products').length) {
201 return;
202 }
203 e.preventDefault();
204 var $widgetWrapper = $(this).parents('.elementor-widget-container').length ? $(this).parents('.elementor-widget-container') : $(this).parents('.elementor-widget'),
205 widgetData = $widgetWrapper.find('.aux-recent-products-wrapper').data('widget-data'),
206 paged = $(this).data('paged');
207
208 $widgetWrapper.find('.aux-widget-recent-products').addClass('loading');
209 $widgetWrapper.find('.aux-isotope-animated .aux-items-loading').removeClass('aux-loading-hide');
210 $.ajax({
211 url: auxin.ajax_url,
212 type: 'GET',
213 data: {
214 action: 'aux_the_recent_products',
215 data: widgetData,
216 paged: paged,
217 auxinNonce: auxin.nonce
218 }
219 }).done(function (response) {
220 if (response) {
221 $widgetWrapper.empty();
222 $widgetWrapper.append(response);
223 $(document).trigger('auxin_the_recent_products_widget_updated');
224 }
225 });
226 });
227 }
228
229 var AuxinSelectEelement = function () {
230
231 $('.aux-select-element').each(function () {
232 var $element = $(this);
233 var action = $element.data('action');
234 if (action == 'click') {
235 $element.find('.current').on('click', function () {
236 $(this).siblings('.list').toggleClass('show');
237 })
238
239 } else {
240 $element.hover(function () {
241 $element.find('.list').addClass('show');
242 }, function () {
243 $element.find('.list').removeClass('show');
244 }
245 );
246 }
247
248 $element.find('.option').on('click', function () {
249 var markup = $(this).html();
250 $element.find('.current .selected').html(markup);
251 $element.find('.list').toggleClass('show');
252 });
253
254 $(document).on('click', function (e) {
255 if (!$(e.target).parents('.aux-select-element').length) {
256 $element.find('.list').removeClass('show');
257 }
258 });
259 })
260 }
261
262 $(document).ready(function(){
263 AuxinRemoveCartContent();
264 AuxinAjaxAddToCart();
265 AjaxRecentProductsPagination();
266 $(document).on('auxin_the_recent_products_widget_updated', function () {
267 AjaxRecentProductsPagination();
268 });
269
270 AuxinSelectEelement();
271 });
272
273 $.fn.AuxinCartAnimationHandler = function() {
274 $headerCartWrapper = $(this).find('.aux-cart-wrapper');
275 $headerCartWrapper.trigger('AuxCartProgressAnimationDone');
276
277 if ( ! $headerCartWrapper.hasClass('aux-basket-animation') ) {
278 return
279 }
280
281 $headerCartWrapper.on('AuxCartInProgress', function(e) {
282 $headerCartWrapper.addClass('aux-cart-in-progress');
283 });
284
285 $headerCartWrapper.on('animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd', function(e) {
286 if ( e.originalEvent.animationName === 'FillBasket') {
287 $headerCartWrapper.removeClass('aux-cart-in-progress');
288 $headerCartWrapper.trigger('AuxCartProgressAnimationDone');
289 }
290 });
291
292 $headerCartWrapper.on('AuxCartUpdated', function(e) {
293 $headerCartWrapper.addClass('aux-cart-updated-animation');
294 });
295 }
296
297 $('body').AuxinCartAnimationHandler();
298
299 $(document.body).on( 'wc_cart_emptied', function(){
300 $('.aux-shopping-basket .aux-cart-contents span').html('0');
301 });
302
303 })(jQuery,window,document);