PageSourceSearch

https://academy.qureca.com/wp-content/plugins/customize-my-account…/assets/js/frontend-unique.js?ver=4.5.0

js qureca.com collected 2026-10-03 20:37:49 UTC 10,647 bytes, 254 lines download raw bytes

1var $laz = jQuery.noConflict();
2(function( $laz ) {
3    'use strict';
4
5    $laz(function() {
6
7        $laz("li.wcmamtx_menu").hover(
8          function () {
9            $laz(this).addClass("current-dropdown");
10        },
11        function () {
12            $laz(this).removeClass("current-dropdown");
13        }
14        );
15
16    });
17})( jQuery );
18
19/*
20
21document.addEventListener('DOMContentLoaded', function () {
22
23    const widget = document.querySelector('.sb-account-widget');
24
25    if (!widget) {
26        return;
27    }
28
29    const trigger = widget.querySelector('.sb-account-trigger');
30
31    trigger.addEventListener('click', function (e) {
32
33        e.preventDefault();
34
35        widget.classList.toggle('active');
36
37    });
38
39    document.addEventListener('click', function (e) {
40
41        if (!widget.contains(e.target)) {
42            widget.classList.remove('active');
43        }
44
45    });
46
47});
48
49*/
50
51function wcmamtxBindAjaxLogin(overlay, ajaxUrl) {
52    var spinner = '<svg style="vertical-align:middle;animation:wcmamtx-spin .7s linear infinite" xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="none" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="3" opacity=".25"/><path d="M12 2a10 10 0 0 1 10 10" stroke="currentColor" stroke-width="3" stroke-linecap="round"/></svg>';
53
54    if (!document.getElementById('wcmamtx-spin-kf')) {
55        var kf = document.createElement('style');
56        kf.id = 'wcmamtx-spin-kf';
57        kf.textContent = '@keyframes wcmamtx-spin{to{transform:rotate(360deg)}}';
58        document.head.appendChild(kf);
59    }
60
61    function submitForm(form, action, onSuccess) {
62        form.addEventListener('submit', function (e) {
63            e.preventDefault();
64
65            var errorEl = form.querySelector('.wcmamtx-form-error');
66            if (!errorEl) {
67                errorEl = document.createElement('ul');
68                errorEl.className = 'woocommerce-error wcmamtx-form-error';
69                errorEl.setAttribute('role', 'alert');
70                form.insertBefore(errorEl, form.firstChild);
71            }
72            errorEl.innerHTML = '';
73            errorEl.style.display = 'none';
74
75            var btn = form.querySelector('[type="submit"]');
76            var btnOrig = btn ? btn.innerHTML : '';
77            if (btn) { btn.disabled = true; btn.innerHTML = spinner; }
78
79            var data = new FormData(form);
80            data.append('action', action);
81
82            fetch(ajaxUrl, { method: 'POST', body: data, credentials: 'same-origin' })
83                .then(function (r) { return r.json(); })
84                .then(function (res) {
85                    if (res.success) {
86                        onSuccess(res, form, btn, btnOrig);
87                    } else {
88                        errorEl.innerHTML = '<li>' + res.data.message + '</li>';
89                        errorEl.style.display = '';
90                        if (btn) { btn.disabled = false; btn.innerHTML = btnOrig; }
91                    }
92                })
93                .catch(function () {
94                    errorEl.innerHTML = '<li>Something went wrong. Please try again.</li>';
95                    errorEl.style.display = '';
96                    if (btn) { btn.disabled = false; btn.innerHTML = btnOrig; }
97                });
98        });
99    }
100
101    var loginForm = overlay.querySelector('form.woocommerce-form-login');
102    if (loginForm) {
103        submitForm(loginForm, 'wcmamtx_ajax_login', function (res) {
104            window.location.href = res.data.redirect;
105        });
106    }
107
108    var registerForm = overlay.querySelector('form.woocommerce-form-register');
109    if (registerForm) {
110        submitForm(registerForm, 'wcmamtx_ajax_register', function (res) {
111            window.location.href = res.data.redirect;
112        });
113    }
114
115    var lostForm = overlay.querySelector('form.woocommerce-ResetPassword');
116    if (lostForm) {
117        submitForm(lostForm, 'wcmamtx_ajax_lost_password', function (res, form, btn, btnOrig) {
118            var successEl = form.querySelector('.wcmamtx-form-success');
119            if (!successEl) {
120                successEl = document.createElement('div');
121                successEl.className = 'woocommerce-message wcmamtx-form-success';
122                form.insertBefore(successEl, form.firstChild);
123            }
124            successEl.textContent = res.data.message;
125            successEl.style.display = '';
126            if (btn) { btn.disabled = false; btn.innerHTML = btnOrig; }
127        });
128    }
129}
130
131function wcmamtxAutoInputIcons() {
132    var SVG = {
133        person:   '<circle cx="12" cy="8" r="5"/><path d="M20 21a8 8 0 1 0-16 0"/>',
134        email:    '<rect width="20" height="16" x="2" y="4" rx="2"/><path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/>',
135        lock:     '<rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/>',
136        phone:    '<path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07A19.5 19.5 0 0 1 4.14 13a19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 3 2.18h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L7.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 21 16.92z"/>',
137        location: '<path d="M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"/><circle cx="12" cy="10" r="3"/>',
138        globe:    '<circle cx="12" cy="12" r="10"/><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"/><path d="M2 12h20"/>',
139        building: '<rect width="16" height="20" x="4" y="2" rx="2" ry="2"/><path d="M9 22v-4h6v4"/><path d="M8 6h.01M16 6h.01M12 6h.01M12 10h.01M12 14h.01M16 10h.01M16 14h.01M8 10h.01M8 14h.01"/>',
140        calendar: '<rect width="18" height="18" x="3" y="4" rx="2" ry="2"/><line x1="16" x2="16" y1="2" y2="6"/><line x1="8" x2="8" y1="2" y2="6"/>
140<line x1="3" x2="21" y1="10" y2="10"/>',
141        hash:     '<line x1="4" x2="20" y1="9" y2="9"/><line x1="4" x2="20" y1="15" y2="15"/><line x1="10" x2="8" y1="3" y2="21"/><line x1="16" x2="14" y1="3" y2="21"/>',
142        list:     '<line x1="8" x2="21" y1="6" y2="6"/><line x1="8" x2="21" y1="12" y2="12"/><line x1="8" x2="21" y1="18" y2="18"/><line x1="3" x2="3.01" y1="6" y2="6"/><line x1="3" x2="3.01" y1="12" y2="12"/><line x1="3" x2="3.01" y1="18" y2="18"/>',
143    };
144
145    function pickIcon(el) {
146        var isSelect = el.tagName === 'SELECT';
147        var type = isSelect ? 'select' : (el.type || 'text');
148        var hint = ((el.name || '') + ' ' + (el.id || '') + ' ' + (el.placeholder || '')).toLowerCase();
149
150        if (type === 'password')                                         return 'lock';
151        if (type === 'email'   || /email/.test(hint))                   return 'email';
152        if (type === 'tel'     || /phone|mobile|tel/.test(hint))        return 'phone';
153        if (type === 'date'    || /\bdate\b|birth|dob/.test(hint))      return 'calendar';
154        if (type === 'number'  || /\b(qty|quantity|age|count)\b/.test(hint)) return 'hash';
155        if (/address|street|city|suburb|postcode|zip/.test(hint))       return 'location';
156        if (/country|nation/.test(hint))                                 return 'globe';
157        if (/company|organi[sz]ation|business/.test(hint))              return 'building';
158        if (type === 'url'     || /website|url/.test(hint))             return 'globe';
159        if (type === 'select')                                           return 'list';
160        if (/\b(name|user|first|last)\b/.test(hint))                    return 'person';
161        return 'person';
162    }
163
164    function makeSvg(key) {
165        return '<svg class="wcmamtx-input-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">' + SVG[key] + '</svg>';
166    }
167
168    var selector = '.wcmamtx_custom_login_register input[type="text"],'
169        + '.wcmamtx_custom_login_register input[type="email"],'
170        + '.wcmamtx_custom_login_register input[type="password"],'
171        + '.wcmamtx_custom_login_register input[type="tel"],'
172        + '.wcmamtx_custom_login_register input[type="number"],'
173        + '.wcmamtx_custom_login_register input[type="url"],'
174        + '.wcmamtx_custom_login_register input[type="date"],'
175        + '.wcmamtx_custom_login_register select';
176
177    document.querySelectorAll(selector).forEach(function (el) {
178        if (el.closest('.wcmamtx-input-wrap')) return;
179        var wrap = document.createElement('span');
180        wrap.className = 'wcmamtx-input-wrap';
181        wrap.innerHTML = makeSvg(pickIcon(el));
182        el.parentNode.insertBefore(wrap, el);
183        wrap.appendChild(el);
184    });
185}
186
187document.addEventListener("DOMContentLoaded", function () {
188
189    wcmamtxAutoInputIcons();
190
191    (function() {
192        var el = document.querySelector('#wp-admin-bar-wcmamtx_customize_myaccount > .ab-item');
193        if (!el) return;
194        var phrases = (window.wcmamtxAdminBar && window.wcmamtxAdminBar.phrases)
195            ? window.wcmamtxAdminBar.phrases
196            : ['Live My Account Customizer'];
197        var span = document.createElement('span');
198        span.style.cssText = 'transition:opacity .2s ease;display:inline;';
199        span.textContent = phrases[0];
200        Array.from(el.childNodes).forEach(function(n) { if (n.nodeType === 3) el.removeChild(n); });
201        el.appendChild(span);
202        var idx = 0;
203        setInterval(function() {
204            idx = (idx + 1) % phrases.length;
205            span.style.opacity = '0';
206            setTimeout(function() { span.textContent = phrases[idx]; span.style.opacity = '1'; }, 200);
207        }, 2500);
208    })();
209
210    const tabs = document.querySelectorAll(".wc-tab-btn");
211    const contents = document.querySelectorAll(".wc-tab-content");
212
213    tabs.forEach(tab => {
214
215        tab.addEventListener("click", function () {
216
217            tabs.forEach(btn =>
218                btn.classList.remove("active")
219            );
220
221            contents.forEach(content =>
222                content.classList.remove("active")
223            );
224
225            this.classList.add("active");
226
227            document
228                .getElementById(this.dataset.tab)
229                .classList.add("active");
230
231        });
232
233    });
234
235    document
236        .querySelectorAll(".toggle-password")
237        .forEach(toggle => {
238
239            toggle.addEventListener("click", function () {
240
241                const input =
242                    this.parentElement.querySelector("input");
243
244                if (input.type === "password") {
245                    input.type = "text";
246                } else {
247                    input.type = "password";
248                }
249
250            });
251
252        });
253
254});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.