- Fixed: flo-data fix not showing for new line.
- All space type char (eg. new line, tab) is converted to space
- Rest of the invalid characters are removed
This commit is contained in:
sairajzero 2021-11-03 17:48:51 +05:30
parent 42874ad6b9
commit 2f9cdfb8cd

View File

@ -2856,16 +2856,8 @@
}) })
function checkFloData(){ function checkFloData(){
isFloDataChanged = false isFloDataChanged = false
const floDataText = sentFloData.value.trim() const floDataText = sentFloData.value;
let isValid = true if(/^[\x20-\x7E]*$/.test(floDataText)){
for(char of floDataText){
// if(/^[a-z0-9\s!"#$%&'()*+,.\/:;<=>?@\[\]^_`{|}~-]*$/i.test(char)){
if(!/^[\x20-\x7E\s]+/.test(char)){
isValid = false
break;
}
}
if(isValid){
sendFloDataButton.classList.remove('hide-completely') sendFloDataButton.classList.remove('hide-completely')
fixFloDataButton.classList.add('hide-completely') fixFloDataButton.classList.add('hide-completely')
floDataStaus.textContent = '' floDataStaus.textContent = ''
@ -2875,8 +2867,8 @@
} }
} }
function removeInvalid(){ function removeInvalid(){
const floDataText = sentFloData.value.trim() const floDataText = sentFloData.value;
sentFloData.value = floDataText.replace(/[^\x20-\x7E]*/gm, '') sentFloData.value = floDataText.replace(/\s/g, " ").replace(/[^\x20-\x7E]/g, '');
checkFloData() checkFloData()
} }
</script> </script>