create parent pom to improve the maintanace

This commit is contained in:
HeinrichAD
2023-06-09 14:51:26 +02:00
committed by PlantUML
parent f6fa448ed8
commit 98dfd1763a
4 changed files with 695 additions and 1197 deletions

View File

@@ -43,11 +43,11 @@ var r=n.substring(n.lastIndexOf(".")+1).toLowerCase();k=["txt","puml","plantuml"
return{type:p,isDiagramCode:h,valid:p||h}}function e(h,t){function p(k){var n=new FormData;n.append("diagram",k,k.name);return makeRequest("POST","metadata",{data:n,responseType:"json",headers:{Accept:"application/json"}})}f.classList.add("wait");return(new Promise(function(k,n){if(t.type)p(h).then(function(r){setEditorValue(document.editor,r.decoded);k()},function(r){r=r.response;l.innerText=r.message||r;n()});else if(t.isDiagramCode){var q=new FileReader;q.onload=function(r){setEditorValue(document.editor,
r.target.result)};q.readAsText(h);k()}else l.innerText="File not supported. Only PNG and SVG diagram images as well as PlantUML code text files are supported.",n()})).then(function(){return b()},function(){}).finally(function(){return f.classList.remove("wait")})}var f=document.getElementById("diagram-import"),g=document.getElementById("diagram-import-input"),m=document.getElementById("diagram-import-ok-btn"),l=document.getElementById("diagram-import-error-message");window.addEventListener("dragenter",
function(h){h.stopPropagation();h.preventDefault();isVisible(f)||a(!1)},!1);g.addEventListener("dragenter",function(h){return h.target.classList.add("drop-able")},!1);g.addEventListener("dragover",function(h){h.stopPropagation();h.preventDefault();null!==h.dataTransfer&&(h.dataTransfer.dropEffect="copy")},!1);g.addEventListener("dragexit",function(h){return h.target.classList.remove("drop-able")},!1);g.addEventListener("drop",function(h){function t(){h.stopPropagation();h.preventDefault()}var p=h.dataTransfer.files||
h.target.files;if(!p||1>p.length)return t();p=p[0];var k=d(p);if(!k.valid)return t();"true"!==f.dataset.isOpenManually&&(t(),e(p,k))},!1);m.addEventListener("click",function(){var h=g.files[0];e(h,d(h))});registerModalListener("diagram-import",a,b)}
h.target.files;if(!p||1>p.length)return t();p=p[0];var k=d(p);if(!k.valid)return t();"true"!==f.dataset.isOpenManually&&(t(),e(p,k))},!1);g.addEventListener("change",function(h){return c(h.target)});m.addEventListener("click",function(){var h=g.files[0];e(h,d(h))});registerModalListener("diagram-import",a,b)}
var $jscomp$destructuring$var16=function(){var a={};return{registerModalListener:function(b,c,d){a[b]={fnOpen:c,fnClose:d}},openModal:function(b){var c=$jscomp.getRestArguments.apply(1,arguments),d,e=null==(d=a[b])?void 0:d.fnOpen;e?e.apply(null,$jscomp.arrayFromIterable(c)):setVisibility(document.getElementById(b),!0,!0)},closeModal:function(b){var c=$jscomp.getRestArguments.apply(1,arguments),d,e=null==(d=a[b])?void 0:d.fnClose;e?e.apply(null,$jscomp.arrayFromIterable(c)):setVisibility(document.getElementById(b),
!1)}}}(),registerModalListener=$jscomp$destructuring$var16.registerModalListener,openModal=$jscomp$destructuring$var16.openModal,closeModal=$jscomp$destructuring$var16.closeModal;
function initModals(a){function b(c){"Escape"===c.key||"Esc"===c.key?(c.preventDefault(),closeModal(c.target.closest(".modal").id)):"Enter"===c.key&&(c.preventDefault(),(c=modal.querySelector('input.ok[type\x3d"button"]'))&&!c.disabled&&c.click())}document.querySelectorAll(".modal").forEach(function(c){c.addEventListener("keydown",b,!1)});initSettings();"previewer"!==a&&(initDiagramExport(),initDiagramImport())}function isModalOpen(a){return isVisible(document.getElementById(a))}
function closeAllModals(){document.querySelectorAll(".modal").forEach(function(a){return closeModal(a.id)})}
function initModals(a){function b(c){"Escape"===c.key||"Esc"===c.key?(c.preventDefault(),closeModal(c.target.closest(".modal").id)):"Enter"===c.key&&(c.preventDefault(),(c=c.target.closest(".modal").querySelector('input.ok[type\x3d"button"]'))&&!c.disabled&&c.click())}document.querySelectorAll(".modal").forEach(function(c){c.addEventListener("keydown",b,!1)});initSettings();"previewer"!==a&&(initDiagramExport(),initDiagramImport())}
function isModalOpen(a){return isVisible(document.getElementById(a))}function closeAllModals(){document.querySelectorAll(".modal").forEach(function(a){return closeModal(a.id)})}
function initSettings(){function a(){setVisibility(document.getElementById("settings"),!0,!0);b.value=document.appConfig.theme;c.value=document.appConfig.diagramPreviewType;d.value=document.appConfig.editorWatcherTimeout;setEditorValue(document.settingsEditor,JSON.stringify(document.appConfig.editorCreateOptions,null," "))}var b=document.getElementById("theme"),c=document.getElementById("diagramPreviewType"),d=document.getElementById("editorWatcherTimeout");document.settingsEditor=monaco.editor.create(document.getElementById("settings-monaco-editor"),
Object.assign({},{language:"json"},document.appConfig.editorCreateOptions));b.addEventListener("change",function(e){e=e.target.value;var f=document.settingsEditor.getValue();setEditorValue(document.settingsEditor,f.replace(new RegExp('("theme"\\s*:\\s*)"'+("dark"===e?"vs":"vs-dark")+'"',"gm"),'$1"'+("dark"===e?"vs-dark":"vs")+'"'))});document.getElementById("settings-ok-btn").addEventListener("click",function(){var e=Object.assign({},document.appConfig);e.theme=b.value;e.editorWatcherTimeout=d.value;
e.diagramPreviewType=c.value;e.editorCreateOptions=JSON.parse(document.settingsEditor.getValue());updateConfig(e);closeModal("settings")});window.addEventListener("keydown",function(e){","===e.key&&(isMac?e.metaKey:e.ctrlKey)&&(e.preventDefault(),isModalOpen("settings")||a())},!1);registerModalListener("settings",a)}