Файловый менеджер - Редактировать - /home/clickysoft/public_html/somni.clickysoft.net/public/js/edit-profile.js
Назад
$(function () { $('.edit-btn').on('click', function () { $('.profile-fields input:not(.specific-disabled)').prop("disabled", false); $('.profile-fields textarea').prop("disabled", false); $('.edit-btn').prop("disabled", true); $('.save-changes-btn').prop("disabled", false); $('.cancel-btn').addClass('active'); $('.custom-select').removeClass('disable-field'); }); $('.cancel-btn').on('click', function () { $('.profile-fields input:not(.specific-disabled)').prop("disabled", true); $('.profile-fields textarea').prop("disabled", true); $('.edit-btn').prop("disabled", false); $('.cancel-btn').removeClass('active'); $('.save-changes-btn').prop("disabled", true); $('.custom-select').addClass('disable-field'); }); // profile-image function readURL(input) { // console.log('in function'); var maxSize = 3 * 1024 * 1024; // 3 MB in bytes if (input.files && input.files[0]) { // console.log('first if'); if (input.files.length > 0) { // console.log('Second If'); var fileSize = input.files[0].size; if (fileSize > maxSize) { // console.log('Thirs If'); input.value = ""; swalPop('error','Too Large','File size exceeds the limit (3 MB).'); // return 0; // fileSizeError.textContent = 'File size exceeds the limit (3 MB).'; // fileInput.value = ''; // Clear the file input }else{ // console.log('else'); var reader = new FileReader(); reader.onload = function (e) { $('#imagePreview').css('background-image', 'url(' + e.target.result + ')'); $('#imagePreview').hide(); $('#imagePreview').fadeIn(650); } reader.readAsDataURL(input.files[0]); } } } } $("#imageUpload").change(function () { // console.log('Upload') readURL(this); }); // profile image uploader end // Function to close all select options function closeSelectOptions() { $(".select-options").slideUp(); $('.select-arrow').removeClass('active') } $(".select-selected, .select-arrow").on("click", function (e) { e.stopPropagation(); const $customSelect = $(this).closest(".custom-select"); const $selectOptions = $customSelect.find(".select-options"); $(this).next('.select-arrow').toggleClass('active'); // Toggle the options panel with a slide animation $selectOptions.slideToggle(); }); $(".select-option").on("click", function () { const value = $(this).data("value"); const text = $(this).text(); const $customSelect = $(this).closest(".custom-select"); const isMultiple = $customSelect.data("multiple"); if (isMultiple) { $(this).toggleClass("selected"); const selectedOptions = $customSelect .find(".select-option.selected") .map(function () { return $(this).data("value"); }) .get(); $customSelect.find(".select-selected").text(selectedOptions.join(", ")); $customSelect.find(".select-selected").attr("data-value", selectedOptions.join(", ")); selectValidation();//IF NULL } else { $customSelect.find(".select-selected").text(text); $customSelect.find(".select-selected").attr("data-value", value); closeSelectOptions(); // Close the options panel selectValidation(); // You can customize the behavior when an option is selected here // console.log("Selected Value:", value); } }); // Close the dropdowns when clicking outside $(document).on("click", function () { closeSelectOptions(); }); // Prevent clicks inside the dropdown from closing it $(".select-options").on("click", function (e) { e.stopPropagation(); }); // custom select end // $('#profile_edit_form').on('submit',function(e){ // e.preventDefault(); // showLoading(); // // var formData = $(this).serialize(); // var formData = new FormData($(this)[0]); // $.ajax({ // url: '/update/profile', // type: 'post', // dataType: 'json', // data: formData, // processData: false, // contentType: false, // success: function(response){ // swal.close(); // if(response.data){ // TopEndPopUp('success', response.message) // }else{ // TopEndPopUp('warning',response.message) // } // $('.profile-fields input:not(.specific-disabled)').prop("disabled", true); // $('.profile-fields textarea').prop("disabled", true); // $('.edit-btn').prop("disabled", false); // $('.cancel-btn').removeClass('active'); // $('.custom-select').addClass('disable-field'); // }, // error: function(XMLHttpRequest, textStatus, errorThrown) { // swal.close() // TopEndPopUp('warning',errorThrown) // } // }); // }); });
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка