Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/domains/ecom1.picotech.app/public_html_ecom1/Modules/CMS/Resources/assets/js/ drwxr-xr-x | |
| Viewing file: Select action/file-type: "use strict";
$("#pageName").on("keyup", function () {
let slug = $(this)
.val()
.toLowerCase()
.replace(/ /g, "-")
.replace(/[^\w-]+/g, "");
$("#pageSlug").val(slug);
});
const updateFormFields = (form, data, values) => {
values.forEach((item) => {
if (item.type == "val") {
$(form).find(item.id).val(data[item.key]);
} else if (item.type == "prop") {
$(form)
.find(item.id)
.prop("checked", data[item.key] == item.val);
}
});
};
$(document).on('click', ".delete-section-btn", function () {
$(".delete-loading").removeClass("d-none");
$("#internal_form").attr("action", deletePageUrl.replace("__id__", tempId));
$("#internal_form").trigger("submit");
});
$(document).on('click', ".delete-button", function () {
tempId = $(this).data("id");
$("#confirmDelete").modal("show");
});
$(".default_c").on("change", function () {
if (!$(".status_c").is(":checked")) {
$(this).prop("checked", false);
}
});
$(".status_c").on("change", function () {
if (!$(this).is(":checked")) {
$(".default_c").prop("checked", false);
}
});
$(document).on("click", ".has-spinner-loader", function () {
let button = $(this);
if (button.closest("form").length > 0) {
setTimeout(() => {
let btn = button;
if (btn.closest("form").find(".error").length < 1) {
btn.append(
'<div class="spinner-border spinner-border-sm ml-2" role="status"><span class="sr-only">Loading...</span></div>'
);
btn.addClass("disabled-btn");
}
}, 50);
} else {
$(this).append(
'<div class="spinner-border spinner-border-sm ml-2" role="status"><span class="sr-only">Loading...</span></div>'
);
$(this).addClass("disabled-btn");
}
});
window.onpageshow = function (event) {
if (event.persisted) {
$(".disabled-btn").removeClass("disabled-btn");
$(".spinner-border").remove();
}
};
$(document).on('click', '.homepage-container .editable', function() {
tempId = $(this).data('id');
let page = pages.find(page => page.id == tempId);
updateFormFields(updateForm, page, [{
id: '#pageName',
type: 'val',
key: 'name'
},
{
id: '#pageSlug',
type: 'val',
key: 'slug'
},
{
id: '#switch-1',
type: 'prop',
key: 'status',
val: 'Active'
},
{
id: '#switch-2',
type: 'prop',
key: 'default',
val: 1
}
]);
updateForm.attr('action', updatePageUrl.replace('__id__', tempId));
$('#updatePage').modal('show');
});
$(document).on('click', '.pages-container .editable', function() {
tempId = $(this).data('id');
let page = pages.find(page => page.id == tempId);
updateForm.attr('action', updatePageUrl.replace('__id__', tempId));
updateFormFields(updateForm, page, [{
id: '#pageName',
type: 'val',
key: 'name'
},
{
id: '#pageSlug',
type: 'val',
key: 'slug'
},
{
id: '#switch-1',
type: 'prop',
key: 'status',
val: 'Active'
}
]);
$('#updatePage').modal('show');
});
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0045 ]-- |