wip
This commit is contained in:
commit
ae480cf2f6
2768 files changed
+1485826
No files matched your search
@@ -0,0 +1 @@
|
||||
(()=>{"use strict";var e,t={964:(e,t,n)=>{var o={};function r(e,t){const n=Object.create(null),o=e.split(",");for(let e=0;e<o.length;e++)n[o[e]]=!0;return t?e=>!!n[e.toLowerCase()]:e=>!!n[e]}n.r(o),n.d(o,{BaseTransition:()=>xo,Comment:()=>hs,EffectScope:()=>de,Fragment:()=>fs,KeepAlive:()=>Io,ReactiveEffect:()=>Oe,Static:()=>ms,Suspense:()=>no,Teleport:()=>us,Text:()=>ds,Transition:()=>oc,TransitionGroup:()=>xc,VueElement:()=>Yi,assertNumber:()=>cn,callWithAsyncErrorHandling:()=>an,callWithErrorHandling:()=>ln,camelize:()=>ee,capitalize:()=>oe,cloneVNode:()=>Ls,compatUtils:()=>Ri,computed:()=>pi,createApp:()=>el,createBlock:()=>ws,createCommentVNode:()=>Bs,createElementBlock:()=>Es,createElementVNode:()=>As,createHydrationRenderer:()=>ts,createPropsRestProxy:()=>bi,createRenderer:()=>es,createSSRApp:()=>tl,createSlots:()=>pr,createStaticVNode:()=>$s,createTextVNode:()=>Fs,createVNode:()=>Vs,customRef:()=>Qt,defineAsyncComponent:()=>Ro,defineComponent:()=>No,defineCustomElement:()=>Gi,defineEmits:()=>di,defineExpose:()=>hi,defineProps:()=>fi,defineSSRCustomElement:()=>qi,devtools:()=>Nn,effect:()=>Pe,effectScope:()=>he,getCurrentInstance:()=>Js,getCurrentScope:()=>ge,getTransitionRawChildren:()=>Oo,guardReactiveProps:()=>Ms,h:()=>xi,handleError:()=>un,hydrate:()=>Qc,initCustomFormatter:()=>wi,initDirectivesForSSR:()=>rl,inject:()=>ao,isMemoSame:()=>Ti,isProxy:()=>Lt,isReactive:()=>Vt,isReadonly:()=>It,isRef:()=>Ht,isRuntimeOnly:()=>si,isShallow:()=>Mt,isVNode:()=>ks,markRaw:()=>$t,mergeDefaults:()=>_i,mergeProps:()=>Hs,nextTick:()=>bn,normalizeClass:()=>f,normalizeProps:()=>d,normalizeStyle:()=>c,onActivated:()=>Lo,onBeforeMount:()=>Wo,onBeforeUnmount:()=>qo,onBeforeUpdate:()=>Ko,onDeactivated:()=>Fo,onErrorCaptured:()=>Qo,onMounted:()=>zo,onRenderTracked:()=>Xo,onRenderTriggered:()=>Zo,onScopeDispose:()=>ve,onServerPrefetch:()=>Yo,onUnmounted:()=>Jo,onUpdated:()=>Go,openBlock:()=>ys,popScopeId:()=>Kn,provide:()=>lo,proxyRefs:()=>Zt,pushScopeId:()=>zn,queuePostFlushCb:()=>Cn,reactive:()=>Ot,readonly:()=>Pt,ref:()=>Wt,registerRuntimeCompiler:()=>ri,render:()=>Xc,renderList:()=>ur,renderSlot:()=>fr,resolveComponent:()=>rr,resolveDirective:()=>cr,resolveDynamicComponent:()=>ir,resolveFilter:()=>Pi,resolveTransitionHooks:()=>Eo,setBlockTracking:()=>xs,setDevtoolsHook:()=>Vn,setTransitionHooks:()=>To,shallowReactive:()=>Nt,shallowReadonly:()=>Rt,shallowRef:()=>zt,ssrContextKey:()=>Ci,ssrUtils:()=>Ni,stop:()=>Re,toDisplayString:()=>x,toHandlerKey:()=>re,toHandlers:()=>hr,toRaw:()=>Ft,toRef:()=>nn,toRefs:()=>en,transformVNodeArgs:()=>Os,triggerRef:()=>qt,unref:()=>Jt,useAttrs:()=>vi,useCssModule:()=>Zi,useCssVars:()=>Xi,useSSRContext:()=>Ei,useSlots:()=>gi,useTransitionState:()=>bo,vModelCheckbox:()=>Pc,vModelDynamic:()=>Fc,vModelRadio:()=>Ac,vModelSelect:()=>Vc,vModelText:()=>Nc,vShow:()=>zc,version:()=>Oi,warn:()=>sn,watch:()=>mo,watchEffect:()=>uo,watchPostEffect:()=>po,watchSyncEffect:()=>fo,withAsyncContext:()=>Si,withCtx:()=>qn,withDefaults:()=>mi,withDirectives:()=>er,withKeys:()=>Wc,withMemo:()=>ki,withModifiers:()=>jc,withScopeId:()=>Gn});const s={1:"TEXT",2:"CLASS",4:"STYLE",8:"PROPS",16:"FULL_PROPS",32:"HYDRATE_EVENTS",64:"STABLE_FRAGMENT",128:"KEYED_FRAGMENT",256:"UNKEYED_FRAGMENT",512:"NEED_PATCH",1024:"DYNAMIC_SLOTS",2048:"DEV_ROOT_FRAGMENT",[-1]:"HOISTED",[-2]:"BAIL"},i=r("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt");function c(e){if(M(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],r=U(o)?p(o):c(o);if(r)for(const e in r)t[e]=r[e]}return t}return U(e)||H(e)?e:void 0}const l=/;(?![^(]*\))/g,a=/:([^]+)/,u=/\/\*.*?\*\//gs;function p(e){const t={};return e.replace(u,"").split(l).forEach((e=>{if(e){const n=e.split(a);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function f(e){let t="";if(U(e))t=e;else if(M(e))for(let n=0;n<e.length;n++){const o=f(e[n]);o&&(t+=o+" ")}else if(H(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function d(e){if(!e)return null;let{class:t,style:n}=e;return t&&!U(t)&&(e.class=f(t)),n&&(e.style=c(n)),e}const h=r("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"),m=r("svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,fLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
||||
@@ -0,0 +1,2 @@
|
||||
/*! For license information please see cart-page-container.js.LICENSE.txt */
|
||||
(()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(){e=function(){return r};var r={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof d?e:d,a=Object.create(o.prototype),c=new O(n||[]);return i(a,"_invoke",{value:L(t,r,c)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=h;var f={};function d(){}function y(){}function v(){}var m={};l(m,c,(function(){return this}));var g=Object.getPrototypeOf,w=g&&g(g(k([])));w&&w!==n&&o.call(w,c)&&(m=w);var b=v.prototype=d.prototype=Object.create(m);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function S(e,r){function n(i,a,c,u){var s=p(e[i],e,a);if("throw"!==s.type){var l=s.arg,h=l.value;return h&&"object"==t(h)&&o.call(h,"__await")?r.resolve(h.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):r.resolve(h).then((function(t){l.value=t,c(l)}),(function(t){return n("throw",t,c,u)}))}u(s.arg)}var a;i(this,"_invoke",{value:function(t,e){function o(){return new r((function(r,o){n(t,e,r,o)}))}return a=a?a.then(o,o):o()}})}function L(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return j()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=P(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=p(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function P(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,P(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=p(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function k(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(o.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:j}}function j(){return{value:void 0,done:!0}}return y.prototype=v,i(b,"constructor",{value:v,configurable:!0}),i(v,"constructor",{value:y,configurable:!0}),y.displayName=l(v,s,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,l(t,s,"GeneratorFunction")),t.prototype=Object.create(b),t},r.awrap=function(t){return{__await:t}},x(S.prototype),l(S.prototype,u,(function(){return this})),r.AsyncIterator=S,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new S(h(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(b),l(b,s,"Generator"),l(b,c,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=k,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
||||
@@ -0,0 +1,2 @@
|
||||
/*! For license information please see cart-sidebar.js.LICENSE.txt */
|
||||
(()=>{"use strict";function t(r){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(r)}function r(){r=function(){return e};var e={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,r,e){t[r]=e.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function s(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{s({},"")}catch(t){s=function(t,r,e){return t[r]=e}}function l(t,r,e,n){var o=r&&r.prototype instanceof v?r:v,a=Object.create(o.prototype),c=new S(n||[]);return i(a,"_invoke",{value:E(t,e,c)}),a}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var p={};function v(){}function y(){}function d(){}var m={};s(m,c,(function(){return this}));var g=Object.getPrototypeOf,w=g&&g(g(k([])));w&&w!==n&&o.call(w,c)&&(m=w);var b=d.prototype=v.prototype=Object.create(m);function L(t){["next","throw","return"].forEach((function(r){s(t,r,(function(t){return this._invoke(r,t)}))}))}function x(r,e){function n(i,a,c,u){var f=h(r[i],r,a);if("throw"!==f.type){var s=f.arg,l=s.value;return l&&"object"==t(l)&&o.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):e.resolve(l).then((function(t){s.value=t,c(s)}),(function(t){return n("throw",t,c,u)}))}u(f.arg)}var a;i(this,"_invoke",{value:function(t,r){function o(){return new e((function(e,o){n(t,r,e,o)}))}return a=a?a.then(o,o):o()}})}function E(t,r,e){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return P()}for(e.method=o,e.arg=i;;){var a=e.delegate;if(a){var c=j(a,e);if(c){if(c===p)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===n)throw n="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);n="executing";var u=h(t,r,e);if("normal"===u.type){if(n=e.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:e.done}}"throw"===u.type&&(n="completed",e.method="throw",e.arg=u.arg)}}}function j(t,r){var e=r.method,n=t.iterator[e];if(void 0===n)return r.delegate=null,"throw"===e&&t.iterator.return&&(r.method="return",r.arg=void 0,j(t,r),"throw"===r.method)||"return"!==e&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+e+"' method")),p;var o=h(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,p):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function O(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function _(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function k(t){if(t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,n=function r(){for(;++e<t.length;)if(o.call(t,e))return r.value=t[e],r.done=!1,r;return r.value=void 0,r.done=!0,r};return n.next=n}}return{next:P}}function P(){return{value:void 0,done:!0}}return y.prototype=d,i(b,"constructor",{value:d,configurable:!0}),i(d,"constructor",{value:y,configurable:!0}),y.displayName=s(d,f,"GeneratorFunction"),e.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===y||"GeneratorFunction"===(r.displayName||r.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,f,"GeneratorFunction")),t.prototype=Object.create(b),t},e.awrap=function(t){return{__await:t}},L(x.prototype),s(x.prototype,u,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},L(b),s(b,f,"Generator"),s(b,c,(function(){return this})),s(b,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=k,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){this.done=!0;var t=this.tLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
||||
@@ -0,0 +1,3 @@
|
||||
$(function () {
|
||||
|
||||
})();
|
||||
@@ -0,0 +1,362 @@
|
||||
const Toast = Swal.mixin({
|
||||
toast: true,
|
||||
position: 'top-end',
|
||||
showConfirmButton: false,
|
||||
timer: 3000,
|
||||
timerProgressBar: true,
|
||||
didOpen: (toast) => {
|
||||
toast.addEventListener('mouseenter', Swal.stopTimer)
|
||||
toast.addEventListener('mouseleave', Swal.resumeTimer)
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function(e) {
|
||||
Event.listen('cartsUpdatedFromSidebar', event => {
|
||||
showProductShowButton();
|
||||
})
|
||||
|
||||
let pageURL = new URL(location);
|
||||
if (pageURL.searchParams.has('sorting')) {
|
||||
document.getElementById('SortBy').value = pageURL.searchParams.get('sorting');
|
||||
}
|
||||
|
||||
let productPerPageSelect = document.getElementById('show-product-count-select');
|
||||
|
||||
if (pageURL.searchParams.has('perPage')) {
|
||||
productPerPageSelect.value = pageURL.searchParams.get('perPage');
|
||||
} else {
|
||||
if (productPerPageSelect) {
|
||||
productPerPageSelect.value = 32;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function subscribeUserToNewsletter(event) {
|
||||
event.preventDefault();
|
||||
|
||||
$.ajax({
|
||||
method: event.target.method,
|
||||
url: event.target.action,
|
||||
data: Object.fromEntries(new FormData(event.target).entries()),
|
||||
success: (response) => {
|
||||
Swal.fire('Üstünlikli goşuldy', '', 'success');
|
||||
},
|
||||
error: (exception) => {
|
||||
Swal.fire('Üstünlikli goşuldy', '', 'success') ;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function loginAction(event) {
|
||||
event.preventDefault();
|
||||
|
||||
// let phoneINPUT = document.getElementById('PopupCustomerPhoneContainer');
|
||||
let verificationINPUT = document.getElementById('PopupCustomerVerificationCodeContainer');
|
||||
|
||||
$.ajax({
|
||||
method: event.target.method,
|
||||
url: window.Lara.routes.auth.twoFactor,
|
||||
data: Object.fromEntries(new FormData(event.target).entries()),
|
||||
success(response) {
|
||||
console.log({response});
|
||||
|
||||
if (response.message == 'Login') {
|
||||
window.location.reload(true);
|
||||
}
|
||||
|
||||
if (response.message != 'success') {
|
||||
return;
|
||||
}
|
||||
|
||||
verificationINPUT.classList.remove('d-none');
|
||||
verificationINPUT.setAttribute('required', 'required');
|
||||
},
|
||||
error(exception) {
|
||||
console.log({exception});
|
||||
// Swal.fire('Üstünlikli goşuldy', '', 'success') ;
|
||||
},
|
||||
done(data) {
|
||||
console.log({a: data});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateLikeCount() {
|
||||
let wishlistCount = document.getElementById('wishlist-count');
|
||||
// let sidebarWishlistCount = document.getElementById('sidebar-wishlist-count');
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: window.Lara.routes.products.likeCount,
|
||||
data: {_token: document.querySelector('meta[name=csrf-token]').getAttribute('value')},
|
||||
success: (response) => {
|
||||
wishlistCount.innerText = response.count;
|
||||
},
|
||||
error: (exception) => {
|
||||
console.log({exception});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function toggleProductLike(event, elem, id) {
|
||||
event.preventDefault();
|
||||
|
||||
if (! window.Lara.auth.status) {
|
||||
return;
|
||||
}
|
||||
|
||||
let formData = {
|
||||
id: id,
|
||||
_token: document.querySelector('meta[name=csrf-token]').getAttribute('value'),
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: window.Lara.routes.products.like,
|
||||
data: formData,
|
||||
success: (response) => {
|
||||
if (response.attached) {
|
||||
document.getElementById(id + '-favourite-icon-dislike')?.classList.add('d-none');
|
||||
document.getElementById(id + '-favourite-icon-like')?.classList.remove('d-none');
|
||||
|
||||
Toast.fire({
|
||||
icon: 'success',
|
||||
title: window.Lara.translations.favouries.liked
|
||||
})
|
||||
} else {
|
||||
document.getElementById(id + '-favourite-icon-dislike')?.classList.remove('d-none');
|
||||
document.getElementById(id + '-favourite-icon-like')?.classList.add('d-none');
|
||||
|
||||
Toast.fire({
|
||||
icon: 'info',
|
||||
title: window.Lara.translations.favouries.unliked
|
||||
})
|
||||
}
|
||||
|
||||
Event.fire('likesUpdated');
|
||||
},
|
||||
error: (exception) => {
|
||||
console.log({exception});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function toggleLikeProductShowButton(event, product_id) {
|
||||
let addToLikeButtonMessage = document.getElementById('add-to-like-button-message');
|
||||
let addedToLikeButtonMessage = document.getElementById('added-to-like-button-message');
|
||||
|
||||
toggleProductLike(event, event.target, product_id);
|
||||
|
||||
if (addToLikeButtonMessage.classList.contains('d-none')) {
|
||||
addToLikeButtonMessage.classList.remove('d-none');
|
||||
addToLikeButtonMessage.classList.add('d-flex');
|
||||
addedToLikeButtonMessage.classList.remove('d-flex');
|
||||
addedToLikeButtonMessage.classList.add('d-none');
|
||||
} else {
|
||||
addToLikeButtonMessage.classList.add('d-none');
|
||||
addToLikeButtonMessage.classList.remove('d-flex');
|
||||
addedToLikeButtonMessage.classList.add('d-flex');
|
||||
addedToLikeButtonMessage.classList.remove('d-none');
|
||||
}
|
||||
}
|
||||
|
||||
function addToCart(product_id, with_count) {
|
||||
if (! window.Lara.auth.status) {
|
||||
return;
|
||||
}
|
||||
|
||||
let quantity = with_count ? document.getElementById('product-quantity')?.value : null;
|
||||
|
||||
product_id = window.Lara.productOnCart ? window.Lara.productOnCart : product_id;
|
||||
|
||||
let formData = {
|
||||
product_id: product_id,
|
||||
_token: document.querySelector('meta[name=csrf-token]').getAttribute('value'),
|
||||
quantity: quantity
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: window.Lara.routes.carts.add,
|
||||
data: formData,
|
||||
success: (response) => {
|
||||
Event.fire('cartsUpdated');
|
||||
},
|
||||
error: (exception) => {
|
||||
if (exception.status == 422) {
|
||||
if (validationMessage = exception.responseJSON.data.validations['product_out_of_stock_count']) {
|
||||
alert(validationMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function removeCartItem(product_id) {
|
||||
if (! window.Lara.auth.status) {
|
||||
return;
|
||||
}
|
||||
|
||||
let formData = {
|
||||
product_id: product_id,
|
||||
_token: document.querySelector('meta[name=csrf-token]').getAttribute('value'),
|
||||
};
|
||||
|
||||
fetch(window.Lara.routes.carts.remove, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Accept': 'application/json, text/plain, */*',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
credentials: 'same-origin',
|
||||
body: JSON.stringify(formData)
|
||||
}).then(response => response.json())
|
||||
.then(data => {
|
||||
Event.fire('cartsUpdated');
|
||||
});
|
||||
}
|
||||
|
||||
function updateCart(product_id, increment_by_one) {
|
||||
if (! window.Lara.auth.status) {
|
||||
return;
|
||||
}
|
||||
|
||||
let quantity = new Number(document.getElementById('product-quantity')?.value);
|
||||
|
||||
if (increment_by_one || quantity == 0) {
|
||||
quantity += 1;
|
||||
}
|
||||
|
||||
let formData = {
|
||||
product_id: product_id,
|
||||
_token: document.querySelector('meta[name=csrf-token]').getAttribute('value'),
|
||||
quantity: quantity
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: window.Lara.routes.carts.update,
|
||||
data: formData,
|
||||
success: (response) => {
|
||||
Event.fire('cartsUpdated');
|
||||
},
|
||||
error: (exception) => {
|
||||
console.log({exception});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateProductShowButton() {
|
||||
let addToCartMessage = document.getElementById('add-to-cart-button-message');
|
||||
let removeFromCartMessage = document.getElementById('remove-from-cart-button-message');
|
||||
let removeTrashIcon = document.getElementById('remove-from-cart-trash');
|
||||
|
||||
addToCartMessage.classList.remove('d-flex');
|
||||
addToCartMessage.classList.add('d-none');
|
||||
removeFromCartMessage.classList.remove('d-none');
|
||||
removeFromCartMessage.classList.add('d-flex');
|
||||
removeTrashIcon.classList.remove('d-none');
|
||||
}
|
||||
|
||||
function showProductShowButton() {
|
||||
let addToCartMessage = document.getElementById('add-to-cart-button-message');
|
||||
let removeFromCartMessage = document.getElementById('remove-from-cart-button-message');
|
||||
let removeTrashIcon = document.getElementById('remove-from-cart-trash');
|
||||
let productQuantity = document.getElementById('product-quantity');
|
||||
|
||||
addToCartMessage.classList.remove('d-none');
|
||||
addToCartMessage.classList.add('d-flex');
|
||||
removeFromCartMessage.classList.remove('d-flex');
|
||||
removeFromCartMessage.classList.add('d-none');
|
||||
removeTrashIcon.classList.add('d-none');
|
||||
productQuantity.value = 1;
|
||||
}
|
||||
|
||||
function productShowCounterChanged(product_id, event) {
|
||||
let addToCartMessage = document.getElementById('add-to-cart-button-message');
|
||||
|
||||
if (! addToCartMessage.classList.contains('d-flex')) {
|
||||
updateCart(product_id, event.type == 'click');
|
||||
}
|
||||
}
|
||||
|
||||
async function postData(url = '', data = {}) {
|
||||
const response = await fetch(url, {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
cache: 'no-cache',
|
||||
credentials: 'same-origin',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
referrerPolicy: 'no-referrer',
|
||||
body: JSON.stringify(data)
|
||||
});
|
||||
|
||||
return response.json();
|
||||
}
|
||||
|
||||
async function globalSearch(q) {
|
||||
let response = await fetch(window.Lara.routes.app.globalSearch + '?q=' + q);
|
||||
|
||||
return response.json();
|
||||
}
|
||||
|
||||
function addSorting(value) {
|
||||
addUrlParam('sorting', value);
|
||||
}
|
||||
|
||||
function addUrlParam(key, value, update = true) {
|
||||
let pageURL = new URL(location);
|
||||
|
||||
pageURL.searchParams.delete(key)
|
||||
pageURL.searchParams.append(key, value);
|
||||
|
||||
if (update) {
|
||||
location.href = pageURL.href;
|
||||
}
|
||||
}
|
||||
|
||||
function sideScroll(element,direction,speed,distance,step){
|
||||
scrollAmount = 0;
|
||||
var slideTimer = setInterval(function(){
|
||||
if (direction == 'left'){
|
||||
element.scrollLeft -= step;
|
||||
} else {
|
||||
element.scrollLeft += step;
|
||||
}
|
||||
scrollAmount += step;
|
||||
if (scrollAmount >= distance) {
|
||||
window.clearInterval(slideTimer);
|
||||
}
|
||||
}, speed);
|
||||
}
|
||||
|
||||
|
||||
function scrollToClosest(position, elem, selector, points = 1000) {
|
||||
if (position == 'left') {
|
||||
let box = $(elem).parent().find(selector);
|
||||
|
||||
let x = ((box.width() / 2)) + box.scrollLeft();
|
||||
box.animate({
|
||||
scrollLeft: x,
|
||||
});
|
||||
|
||||
// $(elem).parent().find(selector).scrollLeft(-points);
|
||||
} else {
|
||||
// $(elem).parent().find(selector).scrollLeft(+points);
|
||||
}
|
||||
}
|
||||
|
||||
// function orderDeliveryTimeChanged(event) {
|
||||
// let clientTime = document.getElementById('order-client-time-container');
|
||||
|
||||
// if (event.target.value == 'standart') {
|
||||
// clientTime.classList.remove('d-none');
|
||||
// } else {
|
||||
// clientTime.classList.add('d-none');
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
createApp({data:function(){return{locale:window.Lara.locale,routes:window.Lara.routes,likedProducts:[],wishlist_count:0}},methods:{routeFor:function(t){return this.routes.products.show.replace("slug",t)},imageFor:function(t){return t+" 1x, "+t+" 2x"},getLikedProducts:function(){var t=this;fetch(this.routes.user.likesCount).then((function(t){return t.json()})).then((function(e){t.wishlist_count=e.count,document.getElementById("wishlist-count").innerText=e.count,Array.from(document.getElementsByClassName("favourites-icon-count")).forEach((function(t){t.innerText=e.count}))})),fetch(this.routes.user.likes).then((function(t){return t.json()})).then((function(e){t.likedProducts=e.data}))},clearWishlist:function(){this.likedProducts=[],this.wishlist_count=0,postData(this.routes.likes.clear,{_token:document.querySelector("meta[name=csrf-token]").getAttribute("value")}).then((function(t){return"success"==t.message?location.reload(!0):""}))}},mounted:function(){var t=this;window.Lara.auth.status&&this.getLikedProducts(),Event.listen("likesUpdated",(function(e){t.getLikedProducts()})),Event.listen("clearWishlist",(function(e){t.clearWishlist()}))}}).mount("#likes-sidebar");
|
||||
@@ -0,0 +1 @@
|
||||
createApp({data:function(){return{routes:window.Lara.routes,locale:window.Lara.locale,all_categories:window.Lara.navigation.categories,categories_dropdown_hidden:!0,categories_to_show:new Object,activeLinks:[]}},methods:{hideCategoryDropdown:function(){this.categories_dropdown_hidden=!0},showCategoriesDropdown:function(){this.categories_dropdown_hidden=!1},showCategoriesFor:function(o){var t=this;this.categories_to_show=this.all_categories.find((function(t){return t.id==o})),this.all_categories.forEach((function(o){return t.activeLinks[o.slug]=!1})),this.activeLinks[this.categories_to_show.slug]=!0},categoryShowRouteFor:function(o){return this.routes.categories.products.replace("slug",o)}},mounted:function(){var o=this;this.all_categories.forEach((function(t,e){0==e?(o.categories_to_show=t,o.activeLinks[t.slug]=!0):o.activeLinks[t.slug]=!1})),Event.listen("showCategoriesDropdownEvent",(function(){o.showCategoriesDropdown()}))}}).mount("#categories-navigation");
|
||||
@@ -0,0 +1 @@
|
||||
document.addEventListener("DOMContentLoaded",(function(){var e=document.getElementById("pagination-next"),a=document.querySelector('div[data-widget="carousel-container"]');if(e){var n=!1,t=!1;elementAppeared(e,(function(){if(!n&&!t){n=!0,e.innerText="Ýüklenilýär";var r=new URL(location.href);r.searchParams.set("page",new URL(e.href).searchParams.get("page")),r.searchParams.has("sorting")&&r.searchParams.set("sorting",r.searchParams.get("sorting")),history.pushState({},"",r.href),$.ajax(location.href,{success:function(r){r.pagination.next_page_url||(e.style.display="none",t=!0),e.href=r.pagination.next_page_url,a.insertAdjacentHTML("beforeend",r.products),n=!1,new LazyLoad({elements_selector:".lazyload",threshold:100})}})}}))}}));
|
||||
Reference in new issue
Block a user