Skip to content

Commit

Permalink
Removed un-necessary changes from table.js
Browse files Browse the repository at this point in the history
  • Loading branch information
chandrikarj authored Jan 6, 2025
1 parent ae25e3a commit 7d8e059
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions apps/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -714,21 +714,8 @@ function fileNameChange() {
const fileName = fileNameInput.val();
let newFileName = fileName.split(' ').join('_');
fileNameInput.val(newFileName);
let fileParts = newFileName.split('.');
let fileExtension = fileParts.length > 1 ? fileParts.reverse()[0].toLowerCase() : null;
if (!fileExtension) {
fileNameInput.addClass('is-invalid');
let fDiv = document.createElement('div');
fDiv.classList.add('invalid-feedback');
fDiv.id = 'filename-feedback0';
fDiv.textContent = 'The file name you provided is incompatible. File names should follow this format "filename.ext"';
if (fileNameInput.parent().children().length === 1) {
fileNameInput.parent().append(fDiv);
} else {
document.getElementById('filename-feedback0').innerHTML = '';
document.getElementById('filename-feedback0').append(fDiv);
}
} else if (!allowedExtensions.includes(fileExtension)) {
let fileExtension = newFileName.toLowerCase().split('.').reverse()[0];
if (!allowedExtensions.includes(fileExtension)) {
fileNameInput.addClass('is-invalid');
let fDiv = document.createElement('div');
fDiv.classList.add('invalid-feedback');
Expand All @@ -747,8 +734,6 @@ function fileNameChange() {
}
}
}


function switchToFile() {
$('.urlUploadClass').css('display', 'none');
$('.fileInputClass').css('display', 'block');
Expand Down

0 comments on commit 7d8e059

Please sign in to comment.