1
0
mirror of https://github.com/Stirling-Tools/Stirling-PDF.git synced 2024-11-05 15:30:11 +01:00

minor changes

This commit is contained in:
Anthony Stirling 2024-01-01 13:46:09 +00:00
parent 76e6a23674
commit cd3cc15888
2 changed files with 614 additions and 603 deletions

View File

@ -368,7 +368,7 @@
parameterInput = document.createElement('input'); parameterInput = document.createElement('input');
parameterInput.type = 'text'; parameterInput.type = 'text';
parameterInput.className = "form-control"; parameterInput.className = "form-control";
parameterInput.value = "FileInputPathToBeInputtedManuallyOffline"; parameterInput.value = "FileInputPathToBeInputtedManuallyForOffline";
} else { } else {
parameterInput = document.createElement('input'); parameterInput = document.createElement('input');
parameterInput.type = 'text'; parameterInput.type = 'text';
@ -390,8 +390,9 @@
break; break;
case 'array': case 'array':
case 'object': case 'object':
//TODO compare to doc and check if fileInput array? parameter.schema.format === 'binary'
parameterInput = document.createElement('textarea'); parameterInput = document.createElement('textarea');
parameterInput.placeholder = `Enter a JSON formatted ${parameter.schema.type}`; parameterInput.placeholder = `Enter a JSON formatted ${parameter.schema.type}, If this is a fileInput, it is not currently supported`;
parameterInput.className = "form-control"; parameterInput.className = "form-control";
break; break;
default: default:
@ -449,11 +450,15 @@
break; break;
case 'array': case 'array':
case 'object': case 'object':
if (value === null || value === '') {
settings[parameter.name] = '';
} else {
try { try {
settings[parameter.name] = JSON.parse(value); settings[parameter.name] = JSON.parse(value);
} catch (err) { } catch (err) {
console.error(`Invalid JSON format for ${parameter.name}`); console.error(`Invalid JSON format for ${parameter.name}`);
} }
}
break; break;
default: default:
settings[parameter.name] = value; settings[parameter.name] = value;
@ -464,7 +469,7 @@
//pipelineSettingsModal.style.display = "none"; //pipelineSettingsModal.style.display = "none";
}); });
pipelineSettingsContent.appendChild(saveButton); pipelineSettingsContent.appendChild(saveButton);
saveButton.click();
//pipelineSettingsModal.style.display = "block"; //pipelineSettingsModal.style.display = "block";
//pipelineSettingsModal.getElementsByClassName("close")[0].onclick = function() { //pipelineSettingsModal.getElementsByClassName("close")[0].onclick = function() {
@ -477,8 +482,16 @@
// } // }
//} //}
} }
showpipelineSettingsModal(selectedOperation);
updateConfigInDropdown(); updateConfigInDropdown();
hideOrShowPipelineHeader(); hideOrShowPipelineHeader();
}); });
function updateConfigInDropdown() { function updateConfigInDropdown() {

View File

@ -102,8 +102,6 @@
<h3>Todo</h3> <h3>Todo</h3>
<ul> <ul>
<li>Fix operation adding requering settings to be openned and
saved instead of saving defaults</li>
<li>Translation support</li> <li>Translation support</li>
<li>Save to browser/Account</li> <li>Save to browser/Account</li>
<li>offline mode checks and testing</li> <li>offline mode checks and testing</li>