install
This commit is contained in:
66
public/assets/js/app.js
Normal file
66
public/assets/js/app.js
Normal file
@@ -0,0 +1,66 @@
|
||||
document.addEventListener('DOMContentLoaded', event => {
|
||||
const phone = document.getElementById('phone');
|
||||
|
||||
(phone) ? new Inputmask("+(\\9\\93)-99-99-99-99").mask(phone) : ''
|
||||
|
||||
CookieConsent.run({
|
||||
categories: {
|
||||
necessary: {
|
||||
enabled: true, // this category is enabled by default
|
||||
readOnly: true // this category cannot be disabled
|
||||
},
|
||||
analytics: {}
|
||||
},
|
||||
|
||||
guiOptions: {
|
||||
consentModal: {
|
||||
layout: 'cloud inline',
|
||||
position: 'bottom center'
|
||||
}
|
||||
},
|
||||
|
||||
language: {
|
||||
default: 'en',
|
||||
translations: {
|
||||
en: {
|
||||
consentModal: {
|
||||
title: 'We use cookies',
|
||||
description: "We use cookies to enhance your browsing experience and provide personalized content. By clicking 'Accept All Cookies,' you consent to the use of all cookies on our website. You can also manage your cookie preferences by selecting 'Cookie Settings.' For more information about how we use cookies and your options, please see our Privacy Policy.",
|
||||
acceptAllBtn: 'Accept all',
|
||||
acceptNecessaryBtn: 'Reject all',
|
||||
showPreferencesBtn: 'Manage Individual preferences'
|
||||
},
|
||||
preferencesModal: {
|
||||
title: 'Manage cookie preferences',
|
||||
acceptAllBtn: 'Accept all',
|
||||
acceptNecessaryBtn: 'Reject all',
|
||||
savePreferencesBtn: 'Accept current selection',
|
||||
closeIconLabel: 'Close modal',
|
||||
sections: [
|
||||
{
|
||||
title: 'Somebody said ... cookies?',
|
||||
description: 'I want one!'
|
||||
},
|
||||
{
|
||||
title: 'Strictly Necessary cookies',
|
||||
description: 'These cookies are essential for the proper functioning of the website and cannot be disabled.',
|
||||
|
||||
//this field will generate a toggle linked to the 'necessary' category
|
||||
linkedCategory: 'necessary'
|
||||
},
|
||||
{
|
||||
title: 'Performance and Analytics',
|
||||
description: 'These cookies collect information about how you use our website. All of the data is anonymized and cannot be used to identify you.',
|
||||
linkedCategory: 'analytics'
|
||||
},
|
||||
{
|
||||
title: 'More information',
|
||||
description: 'For any queries in relation to my policy on cookies and your choices, please <a href="#contact-page">contact us</a>'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
1
public/assets/js/cookieconsent.js
Normal file
1
public/assets/js/cookieconsent.js
Normal file
File diff suppressed because one or more lines are too long
97
public/assets/js/fn.js
Normal file
97
public/assets/js/fn.js
Normal file
@@ -0,0 +1,97 @@
|
||||
function $_ID(id) {
|
||||
return document.getElementById(id)
|
||||
}
|
||||
|
||||
function hide(element) {
|
||||
element.classList.add('d-none')
|
||||
}
|
||||
|
||||
function show(element) {
|
||||
element.classList.remove('d-none')
|
||||
}
|
||||
|
||||
function getFormData(event) {
|
||||
return Object.fromEntries(new FormData(event.target).entries())
|
||||
}
|
||||
|
||||
function loopObject(obj, callback) {
|
||||
for (let [key, value] of Object.entries(obj)) {
|
||||
callback({ key, value })
|
||||
}
|
||||
}
|
||||
|
||||
function ready(callback) {
|
||||
document.addEventListener('DOMContentLoaded', callback);
|
||||
}
|
||||
|
||||
async function postData(url = '', data = {}) {
|
||||
const response = await fetch(url, {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
cache: 'no-cache',
|
||||
credentials: 'same-origin',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
},
|
||||
referrerPolicy: 'no-referrer',
|
||||
body: JSON.stringify(data)
|
||||
})
|
||||
|
||||
return response.json()
|
||||
}
|
||||
|
||||
function addValidationClasses(item) {
|
||||
if (! item) {
|
||||
return
|
||||
}
|
||||
|
||||
$_ID(item.key).classList.add('form-input-border-error', 'form-control-bordered', 'form-control-bordered-error')
|
||||
$_ID(`${item.key}-error-box`).innerHTML = `<strong>${item.value}</strong>`
|
||||
}
|
||||
|
||||
function removeValidationClasess() {
|
||||
Array.from(document.getElementsByClassName('form-input-border-error')).forEach(element => {
|
||||
element.classList.remove('form-input-border-error', 'form-control-bordered', 'form-control-bordered-error')
|
||||
})
|
||||
|
||||
Array.from(document.getElementsByClassName('error-box')).forEach(element => {
|
||||
element.innerHTML = ''
|
||||
})
|
||||
}
|
||||
|
||||
function showVerificationCodeBox() {
|
||||
$_ID('verification-code-box').classList.remove('hidden')
|
||||
$_ID('verification-code-box').insertAdjacentHTML('beforeend', `
|
||||
<input
|
||||
class="form-control form-input form-input-bordered w-full"
|
||||
id="verification"
|
||||
type="text"
|
||||
name="verification"
|
||||
value=""
|
||||
>
|
||||
<input type="hidden" name="step-verification" value="1">
|
||||
|
||||
<span id="verification-error-box" class="text-red-500 text-italic error-box"></span>
|
||||
`)
|
||||
}
|
||||
|
||||
function showPasswordBox() {
|
||||
$_ID('username-box').classList.add('hidden')
|
||||
$_ID('verification-code-box').innerHTML = ''
|
||||
|
||||
$_ID('reset-password-container').classList.remove('hidden')
|
||||
|
||||
$_ID('password-box').insertAdjacentHTML('beforeend', `
|
||||
<input class="form-control form-input form-input-bordered w-full" id="password" type="password" name="password">
|
||||
<input type="hidden" name="step-password" value="1">
|
||||
|
||||
<span id="password-error-box" class="text-red-500 text-italic error-box"></span>
|
||||
`)
|
||||
$_ID('password-confirm-box').insertAdjacentHTML('beforeend', `
|
||||
<input class="form-control form-input form-input-bordered w-full" id="password_confirmation" type="password" name="password_confirmation">
|
||||
|
||||
<span id="password_confirmation-error-box" class="text-red-500 text-italic error-box"></span>
|
||||
`)
|
||||
}
|
||||
1
public/assets/js/inputmask.min.js
vendored
Normal file
1
public/assets/js/inputmask.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
public/assets/js/sweetalert2.js
Normal file
2
public/assets/js/sweetalert2.js
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user