diff --git a/.gitignore b/.gitignore index d78c9a1..3197285 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ bin dist MiniWarteschlangensimulator.exe +MiniWarteschlangensimulator_Linux_MacOS.zip desktop-app/2_Sign.bat \ No newline at end of file diff --git a/desktop-app/0_Prepare.bat b/desktop-app/0_Prepare.bat index 3b1c085..087f176 100644 --- a/desktop-app/0_Prepare.bat +++ b/desktop-app/0_Prepare.bat @@ -2,4 +2,5 @@ cd .. call neu.cmd create myapp mkdir bin move myapp\bin\*.* bin -rmdir /S /Q myapp \ No newline at end of file +rmdir /S /Q myapp +cd desktop-app \ No newline at end of file diff --git a/desktop-app/1_Test.bat b/desktop-app/1_Test.bat index 7d1fdb3..ee5b821 100644 --- a/desktop-app/1_Test.bat +++ b/desktop-app/1_Test.bat @@ -1,2 +1,3 @@ cd .. -call neu.cmd run \ No newline at end of file +call neu.cmd run +cd desktop-app \ No newline at end of file diff --git a/desktop-app/2_Build.bat b/desktop-app/2_Build.bat index b163120..5796750 100644 --- a/desktop-app/2_Build.bat +++ b/desktop-app/2_Build.bat @@ -1,8 +1,11 @@ cd .. del MiniWarteschlangensimulator.exe +del MiniWarteschlangensimulator_Linux_MacOS.zip call neu.cmd build --release cd desktop-app "C:\Program Files (x86)\NSIS\makensis.exe" Launcher.nsi move MiniWarteschlangensimulator.exe .. cd .. -rmdir /S /Q dist \ No newline at end of file +move .\dist\MiniWarteschlangensimulator-release.zip MiniWarteschlangensimulator_Linux_MacOS.zip +rmdir /S /Q dist +cd desktop-app \ No newline at end of file diff --git a/desktop-app/3_Clean.bat b/desktop-app/3_Clean.bat index 69ab57b..946f7b6 100644 --- a/desktop-app/3_Clean.bat +++ b/desktop-app/3_Clean.bat @@ -1,3 +1,4 @@ cd .. rmdir /S /Q bin -rmdir /S /Q .tmp \ No newline at end of file +rmdir /S /Q .tmp +cd desktop-app \ No newline at end of file diff --git a/desktop-app/Launcher.nsi b/desktop-app/Launcher.nsi index dc58715..d17391a 100644 --- a/desktop-app/Launcher.nsi +++ b/desktop-app/Launcher.nsi @@ -1,4 +1,5 @@ !define PrgName "MiniWarteschlangensimulator" +!define PrgTempPathName "MiniWarteschlangensimulator" !define PrgFileName "MiniWarteschlangensimulator" !define PrgIcon "..\docs\favicon.ico" !define Copyright "Alexander Herzog" @@ -26,13 +27,13 @@ ShowInstDetails nevershow RequestExecutionLevel user Section "" - SetOutPath "$TEMP\${PrgName}" + SetOutPath "$TEMP\${PrgTempPathName}" File "..\dist\MiniWarteschlangensimulator\MiniWarteschlangensimulator-win_x64.exe" File "..\dist\MiniWarteschlangensimulator\resources.neu" ; File "..\dist\MiniWarteschlangensimulator\WebView2Loader.dll" - ExecWait "$TEMP\${PrgName}\MiniWarteschlangensimulator-win_x64.exe" + ExecWait "$TEMP\${PrgTempPathName}\MiniWarteschlangensimulator-win_x64.exe" - RmDir /r "$TEMP\${PrgName}" + RmDir /r "$TEMP\${PrgTempPathName}" SectionEnd \ No newline at end of file diff --git a/docs/libs/neutralino.js b/docs/libs/neutralino.js index ec431d1..4fa03f5 100644 --- a/docs/libs/neutralino.js +++ b/docs/libs/neutralino.js @@ -1 +1 @@ -var Neutralino=function(e){"use strict";function t(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{u(o.next(e))}catch(e){r(e)}}function a(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((o=o.apply(e,t||[])).next())}))}function n(e,t){let n=new CustomEvent(e,{detail:t});return window.dispatchEvent(n),Promise.resolve({success:!0,message:"Message dispatched"})}let o,i={},r=[],s={};function a(){window.NL_TOKEN&&sessionStorage.setItem("NL_TOKEN",window.NL_TOKEN),o=new WebSocket(`ws://${window.location.hostname}:${window.NL_PORT}`),function(){if(Neutralino.events.on("ready",(()=>t(this,void 0,void 0,(function*(){if(yield c(r),!window.NL_EXTENABLED)return;let e=yield Neutralino.extensions.getStats();for(let t of e.connected)n("extensionReady",t)})))),Neutralino.events.on("extClientConnect",(e=>{n("extensionReady",e.detail)})),!window.NL_EXTENABLED)return;Neutralino.events.on("extensionReady",(e=>t(this,void 0,void 0,(function*(){e.detail in s&&(yield c(s[e.detail]),delete s[e.detail])}))))}(),function(){o.addEventListener("message",(e=>{var t,r;const s=JSON.parse(e.data);s.id&&s.id in i?((null===(t=s.data)||void 0===t?void 0:t.error)?(i[s.id].reject(s.data.error),"NE_RT_INVTOKN"==s.data.error.code&&(o.close(),document.body.innerText="",document.write("NE_RT_INVTOKN: Neutralinojs application configuration prevents accepting native calls from this client."))):(null===(r=s.data)||void 0===r?void 0:r.success)&&i[s.id].resolve(s.data.hasOwnProperty("returnValue")?s.data.returnValue:s.data),delete i[s.id]):s.event&&n(s.event,s.data)})),o.addEventListener("open",(e=>t(this,void 0,void 0,(function*(){n("ready")})))),o.addEventListener("close",(e=>t(this,void 0,void 0,(function*(){n("serverOffline",{code:"NE_CL_NSEROFF",message:"Neutralino server is offline. Try restarting the application"})}))))}()}function u(e,t){return new Promise(((n,s)=>{if((null==o?void 0:o.readyState)!=WebSocket.OPEN)return a={method:e,data:t,resolve:n,reject:s},void r.push(a);var a;const u="10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))),c=window.NL_TOKEN||sessionStorage.getItem("NL_TOKEN")||"";i[u]={resolve:n,reject:s},o.send(JSON.stringify({id:u,method:e,data:t,accessToken:c}))}))}function c(e){return t(this,void 0,void 0,(function*(){for(;e.length>0;){let t=e.shift();try{let e=yield u(t.method,t.data);t.resolve(e)}catch(e){t.reject(e)}}}))}function d(e){let t=new Uint8Array(e),n="";for(let e of t)n+=String.fromCharCode(e);return window.btoa(n)}var l,f,p={__proto__:null,createDirectory:function(e){return u("filesystem.createDirectory",{path:e})},removeDirectory:function(e){return u("filesystem.removeDirectory",{path:e})},writeFile:function(e,t){return u("filesystem.writeFile",{path:e,data:t})},appendFile:function(e,t){return u("filesystem.appendFile",{path:e,data:t})},writeBinaryFile:function(e,t){return u("filesystem.writeBinaryFile",{path:e,data:d(t)})},appendBinaryFile:function(e,t){return u("filesystem.appendBinaryFile",{path:e,data:d(t)})},readFile:function(e,t){return u("filesystem.readFile",Object.assign({path:e},t))},readBinaryFile:function(e,t){return new Promise(((n,o)=>{u("filesystem.readBinaryFile",Object.assign({path:e},t)).then((e=>{let t=window.atob(e),o=t.length,i=new Uint8Array(o);for(let e=0;e{o(e)}))}))},openFile:function(e){return u("filesystem.openFile",{path:e})},updateOpenedFile:function(e,t,n){return u("filesystem.updateOpenedFile",{id:e,event:t,data:n})},getOpenedFileInfo:function(e){return u("filesystem.getOpenedFileInfo",{id:e})},removeFile:function(e){return u("filesystem.removeFile",{path:e})},readDirectory:function(e){return u("filesystem.readDirectory",{path:e})},copyFile:function(e,t){return u("filesystem.copyFile",{source:e,destination:t})},moveFile:function(e,t){return u("filesystem.moveFile",{source:e,destination:t})},getStats:function(e){return u("filesystem.getStats",{path:e})}};!function(e){e.WARNING="WARNING",e.ERROR="ERROR",e.INFO="INFO",e.QUESTION="QUESTION"}(l||(l={})),function(e){e.OK="OK",e.OK_CANCEL="OK_CANCEL",e.YES_NO="YES_NO",e.YES_NO_CANCEL="YES_NO_CANCEL",e.RETRY_CANCEL="RETRY_CANCEL",e.ABORT_RETRY_IGNORE="ABORT_RETRY_IGNORE"}(f||(f={}));var g={__proto__:null,get Icon(){return l},get MessageBoxChoice(){return f},execCommand:function(e,t){return u("os.execCommand",Object.assign({command:e},t))},spawnProcess:function(e){return u("os.spawnProcess",{command:e})},updateSpawnedProcess:function(e,t,n){return u("os.updateSpawnedProcess",{id:e,event:t,data:n})},getSpawnedProcesses:function(){return u("os.getSpawnedProcesses")},getEnv:function(e){return u("os.getEnv",{key:e})},getEnvs:function(){return u("os.getEnvs")},showOpenDialog:function(e,t){return u("os.showOpenDialog",Object.assign({title:e},t))},showFolderDialog:function(e,t){return u("os.showFolderDialog",Object.assign({title:e},t))},showSaveDialog:function(e,t){return u("os.showSaveDialog",Object.assign({title:e},t))},showNotification:function(e,t,n){return u("os.showNotification",{title:e,content:t,icon:n})},showMessageBox:function(e,t,n,o){return u("os.showMessageBox",{title:e,content:t,choice:n,icon:o})},setTray:function(e){return u("os.setTray",e)},open:function(e){return u("os.open",{url:e})},getPath:function(e){return u("os.getPath",{name:e})}};var w={__proto__:null,getMemoryInfo:function(){return u("computer.getMemoryInfo")},getArch:function(){return u("computer.getArch")},getKernelInfo:function(){return u("computer.getKernelInfo")},getOSInfo:function(){return u("computer.getOSInfo")},getCPUInfo:function(){return u("computer.getCPUInfo")},getDisplays:function(){return u("computer.getDisplays")},getMousePosition:function(){return u("computer.getMousePosition")}};var m,v={__proto__:null,setData:function(e,t){return u("storage.setData",{key:e,data:t})},getData:function(e){return u("storage.getData",{key:e})},getKeys:function(){return u("storage.getKeys")}};!function(e){e.WARNING="WARNING",e.ERROR="ERROR",e.INFO="INFO"}(m||(m={}));var _={__proto__:null,get LoggerType(){return m},log:function(e,t){return u("debug.log",{message:e,type:t})}};var N={__proto__:null,exit:function(e){return u("app.exit",{code:e})},killProcess:function(){return u("app.killProcess")},restartProcess:function(e){return new Promise((n=>t(this,void 0,void 0,(function*(){let t=window.NL_ARGS.reduce(((e,t)=>e+=" "+t),"");(null==e?void 0:e.args)&&(t+=" "+e.args),yield Neutralino.os.execCommand(t,{background:!0}),Neutralino.app.exit(),n()}))))},getConfig:function(){return u("app.getConfig")},broadcast:function(e,t){return u("app.broadcast",{event:e,data:t})}};const h=new WeakMap;var y={__proto__:null,setTitle:function(e){return u("window.setTitle",{title:e})},getTitle:function(){return u("window.getTitle")},maximize:function(){return u("window.maximize")},unmaximize:function(){return u("window.unmaximize")},isMaximized:function(){return u("window.isMaximized")},minimize:function(){return u("window.minimize")},setFullScreen:function(){return u("window.setFullScreen")},exitFullScreen:function(){return u("window.exitFullScreen")},isFullScreen:function(){return u("window.isFullScreen")},show:function(){return u("window.show")},hide:function(){return u("window.hide")},isVisible:function(){return u("window.isVisible")},focus:function(){return u("window.focus")},setIcon:function(e){return u("window.setIcon",{icon:e})},move:function(e,t){return u("window.move",{x:e,y:t})},setDraggableRegion:function(e){return new Promise(((n,o)=>{const i=e instanceof Element?e:document.getElementById(e);let r=0,s=0;if(!i)return o({code:"NE_WD_DOMNOTF",message:"Unable to find DOM element"});if(h.has(i))return o({code:"NE_WD_ALRDREL",message:"This DOM element is already an active draggable region"});function a(e){return t(this,void 0,void 0,(function*(){yield Neutralino.window.move(e.screenX-r,e.screenY-s)}))}function u(e){0===e.button&&(r=e.clientX,s=e.clientY,i.addEventListener("pointermove",a),i.setPointerCapture(e.pointerId))}function c(e){i.removeEventListener("pointermove",a),i.releasePointerCapture(e.pointerId)}i.addEventListener("pointerdown",u),i.addEventListener("pointerup",c),h.set(i,{pointerdown:u,pointerup:c}),n({success:!0,message:"Draggable region was activated"})}))},unsetDraggableRegion:function(e){return new Promise(((t,n)=>{const o=e instanceof Element?e:document.getElementById(e);if(!o)return n({code:"NE_WD_DOMNOTF",message:"Unable to find DOM element"});if(!h.has(o))return n({code:"NE_WD_NOTDRRE",message:"DOM element is not an active draggable region"});const{pointerdown:i,pointerup:r}=h.get(o);o.removeEventListener("pointerdown",i),o.removeEventListener("pointerup",r),h.delete(o),t({success:!0,message:"Draggable region was deactivated"})}))},setSize:function(e){return new Promise(((n,o)=>t(this,void 0,void 0,(function*(){let t=yield Neutralino.window.getSize();u("window.setSize",e=Object.assign(Object.assign({},t),e)).then((e=>{n(e)})).catch((e=>{o(e)}))}))))},getSize:function(){return u("window.getSize")},getPosition:function(){return u("window.getPosition")},setAlwaysOnTop:function(e){return u("window.setAlwaysOnTop",{onTop:e})},create:function(e,t){return new Promise(((n,o)=>{function i(e){return"string"!=typeof e||(e=e.trim()).includes(" ")&&(e=`"${e}"`),e}let r=window.NL_ARGS.reduce(((e,t,n)=>((t.includes("--path=")||t.includes("--debug-mode")||t.includes("--load-dir-res")||0==n)&&(e+=" "+i(t)),e)),"");r+=" --url="+i(e);for(let e in t){if("processArgs"==e)continue;r+=` --window${e.replace(/[A-Z]|^[a-z]/g,(e=>"-"+e.toLowerCase()))}=${i(t[e])}`}t&&t.processArgs&&(r+=" "+t.processArgs),Neutralino.os.execCommand(r,{background:!0}).then((e=>{n(e)})).catch((e=>{o(e)}))}))}};var E={__proto__:null,broadcast:function(e,t){return u("events.broadcast",{event:e,data:t})},on:function(e,t){return window.addEventListener(e,t),Promise.resolve({success:!0,message:"Event listener added"})},off:function(e,t){return window.removeEventListener(e,t),Promise.resolve({success:!0,message:"Event listener removed"})},dispatch:n};var O={__proto__:null,dispatch:function(e,n,o){return new Promise(((i,r)=>t(this,void 0,void 0,(function*(){let t=yield Neutralino.extensions.getStats();if(t.loaded.includes(e))if(t.connected.includes(e))try{let t=yield u("extensions.dispatch",{extensionId:e,event:n,data:o});i(t)}catch(e){r(e)}else!function(e,t){e in s?s[e].push(t):s[e]=[t]}(e,{method:"extensions.dispatch",data:{extensionId:e,event:n,data:o},resolve:i,reject:r});else r({code:"NE_EX_EXTNOTL",message:`${e} is not loaded`})}))))},broadcast:function(e,t){return u("extensions.broadcast",{event:e,data:t})},getStats:function(){return u("extensions.getStats")}};let R=null;var T={__proto__:null,checkForUpdates:function(e){return new Promise(((n,o)=>t(this,void 0,void 0,(function*(){if(!e)return o({code:"NE_RT_NATRTER",message:"Missing require parameter: url"});try{let t=yield fetch(e);R=JSON.parse(yield t.text()),!function(e){return!!(e.applicationId&&e.applicationId==window.NL_APPID&&e.version&&e.resourcesURL)}(R)?o({code:"NE_UP_CUPDMER",message:"Invalid update manifest or mismatching applicationId"}):n(R)}catch(e){o({code:"NE_UP_CUPDERR",message:"Unable to fetch update manifest"})}}))))},install:function(){return new Promise(((e,n)=>t(this,void 0,void 0,(function*(){if(!R)return n({code:"NE_UP_UPDNOUF",message:"No update manifest loaded"});try{let t=yield fetch(R.resourcesURL),n=yield t.arrayBuffer();yield Neutralino.filesystem.writeBinaryFile(window.NL_PATH+"/resources.neu",n),e({success:!0,message:"Update installed. Restart the process to see updates"})}catch(e){n({code:"NE_UP_UPDINER",message:"Update installation error"})}}))))}};var S={__proto__:null,readText:function(e,t){return u("clipboard.readText",{key:e,data:t})},writeText:function(e){return u("clipboard.writeText",{data:e})}};var b={__proto__:null,getMethods:function(){return u("custom.getMethods")}};let P=!1;return e.app=N,e.clipboard=S,e.computer=w,e.custom=b,e.debug=_,e.events=E,e.extensions=O,e.filesystem=p,e.init=function(e={}){if(e=Object.assign({exportCustomMethods:!0},e),!P){if(a(),window.NL_ARGS.find((e=>"--neu-dev-auto-reload"==e))&&Neutralino.events.on("neuDev_reloadApp",(()=>t(this,void 0,void 0,(function*(){yield Neutralino.debug.log("Reloading the application..."),location.reload()})))),e.exportCustomMethods&&window.NL_CMETHODS&&window.NL_CMETHODS.length>0)for(let e of window.NL_CMETHODS)Neutralino.custom[e]=(...t)=>{let n={};for(let[e,o]of t.entries())n="object"!=typeof o||Array.isArray(o)||null==o?Object.assign(Object.assign({},n),{["arg"+e]:o}):Object.assign(Object.assign({},n),o);return u("custom."+e,n)};window.NL_CVERSION="3.8.0",window.NL_CCOMMIT="07c0015dca56609e465d7f260f4e8310615d37c3",P=!0}},e.os=g,e.storage=v,e.updater=T,e.window=y,e}({}); +var Neutralino=function(e){"use strict";function t(e,t,n,o){return new(n||(n=Promise))((function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((o=o.apply(e,t||[])).next())}))}function n(){return f("extensions.getStats")}var o={__proto__:null,dispatch:function(e,o,i){return new Promise(((r,s)=>t(this,void 0,void 0,(function*(){let t=yield n();if(t.loaded.includes(e))if(t.connected.includes(e))try{let t=yield f("extensions.dispatch",{extensionId:e,event:o,data:i});r(t)}catch(e){s(e)}else!function(e,t){e in d?d[e].push(t):d[e]=[t]}(e,{method:"extensions.dispatch",data:{extensionId:e,event:o,data:i},resolve:r,reject:s});else s({code:"NE_EX_EXTNOTL",message:`${e} is not loaded`})}))))},broadcast:function(e,t){return f("extensions.broadcast",{event:e,data:t})},getStats:n};function i(e,t){return window.addEventListener(e,t),Promise.resolve({success:!0,message:"Event listener added"})}function r(e,t){let n=new CustomEvent(e,{detail:t});return window.dispatchEvent(n),Promise.resolve({success:!0,message:"Message dispatched"})}function s(e){let t=window.atob(e),n=t.length,o=new Uint8Array(n);for(let e=0;et(this,void 0,void 0,(function*(){if(yield p(u),!window.NL_EXTENABLED)return;let e=yield n();for(let t of e.connected)r("extensionReady",t)})))),i("extClientConnect",(e=>{r("extensionReady",e.detail)})),!window.NL_EXTENABLED)return;i("extensionReady",(e=>t(this,void 0,void 0,(function*(){e.detail in d&&(yield p(d[e.detail]),delete d[e.detail])}))))}(),function(){a.addEventListener("message",(e=>{var t,n,o;const i=JSON.parse(e.data);i.id&&i.id in c?((null===(t=i.data)||void 0===t?void 0:t.error)?(c[i.id].reject(i.data.error),"NE_RT_INVTOKN"==i.data.error.code&&(a.close(),document.body.innerText="",document.write("NE_RT_INVTOKN: Neutralinojs application cannot execute native methods since NL_TOKEN is invalid."))):(null===(n=i.data)||void 0===n?void 0:n.success)&&c[i.id].resolve(i.data.hasOwnProperty("returnValue")?i.data.returnValue:i.data),delete c[i.id]):i.event&&("openedFile"==i.event&&"dataBinary"==(null===(o=null==i?void 0:i.data)||void 0===o?void 0:o.action)&&(i.data.data=s(i.data.data)),r(i.event,i.data))})),a.addEventListener("open",(e=>t(this,void 0,void 0,(function*(){r("ready")})))),a.addEventListener("close",(e=>t(this,void 0,void 0,(function*(){r("serverOffline",{code:"NE_CL_NSEROFF",message:"Neutralino server is offline. Try restarting the application"})})))),a.addEventListener("error",(e=>t(this,void 0,void 0,(function*(){document.body.innerText="",document.write("NE_CL_IVCTOKN: Neutralinojs application cannot connect with the framework core using NL_TOKEN.")}))))}()}function f(e,t){return new Promise(((n,o)=>{if((null==a?void 0:a.readyState)!=WebSocket.OPEN)return i={method:e,data:t,resolve:n,reject:o},void u.push(i);var i;const r="10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))),s=w();c[r]={resolve:n,reject:o},a.send(JSON.stringify({id:r,method:e,data:t,accessToken:s}))}))}function p(e){return t(this,void 0,void 0,(function*(){for(;e.length>0;){let t=e.shift();try{let e=yield f(t.method,t.data);t.resolve(e)}catch(e){t.reject(e)}}}))}function w(){return window.NL_TOKEN||sessionStorage.getItem("NL_TOKEN")||""}function g(e,t){return f("filesystem.writeBinaryFile",{path:e,data:m(t)})}function m(e){let t=new Uint8Array(e),n="";for(let e of t)n+=String.fromCharCode(e);return window.btoa(n)}var v,_,h={__proto__:null,createDirectory:function(e){return f("filesystem.createDirectory",{path:e})},remove:function(e){return f("filesystem.remove",{path:e})},writeFile:function(e,t){return f("filesystem.writeFile",{path:e,data:t})},appendFile:function(e,t){return f("filesystem.appendFile",{path:e,data:t})},writeBinaryFile:g,appendBinaryFile:function(e,t){return f("filesystem.appendBinaryFile",{path:e,data:m(t)})},readFile:function(e,t){return f("filesystem.readFile",Object.assign({path:e},t))},readBinaryFile:function(e,t){return new Promise(((n,o)=>{f("filesystem.readBinaryFile",Object.assign({path:e},t)).then((e=>{n(s(e))})).catch((e=>{o(e)}))}))},openFile:function(e){return f("filesystem.openFile",{path:e})},createWatcher:function(e){return f("filesystem.createWatcher",{path:e})},removeWatcher:function(e){return f("filesystem.removeWatcher",{id:e})},getWatchers:function(){return f("filesystem.getWatchers")},updateOpenedFile:function(e,t,n){return f("filesystem.updateOpenedFile",{id:e,event:t,data:n})},getOpenedFileInfo:function(e){return f("filesystem.getOpenedFileInfo",{id:e})},readDirectory:function(e,t){return f("filesystem.readDirectory",Object.assign({path:e},t))},copy:function(e,t){return f("filesystem.copy",{source:e,destination:t})},move:function(e,t){return f("filesystem.move",{source:e,destination:t})},getStats:function(e){return f("filesystem.getStats",{path:e})}};function N(e,t){return f("os.execCommand",Object.assign({command:e},t))}!function(e){e.WARNING="WARNING",e.ERROR="ERROR",e.INFO="INFO",e.QUESTION="QUESTION"}(v||(v={})),function(e){e.OK="OK",e.OK_CANCEL="OK_CANCEL",e.YES_NO="YES_NO",e.YES_NO_CANCEL="YES_NO_CANCEL",e.RETRY_CANCEL="RETRY_CANCEL",e.ABORT_RETRY_IGNORE="ABORT_RETRY_IGNORE"}(_||(_={}));var y={__proto__:null,get Icon(){return v},get MessageBoxChoice(){return _},execCommand:N,spawnProcess:function(e,t){return f("os.spawnProcess",{command:e,cwd:t})},updateSpawnedProcess:function(e,t,n){return f("os.updateSpawnedProcess",{id:e,event:t,data:n})},getSpawnedProcesses:function(){return f("os.getSpawnedProcesses")},getEnv:function(e){return f("os.getEnv",{key:e})},getEnvs:function(){return f("os.getEnvs")},showOpenDialog:function(e,t){return f("os.showOpenDialog",Object.assign({title:e},t))},showFolderDialog:function(e,t){return f("os.showFolderDialog",Object.assign({title:e},t))},showSaveDialog:function(e,t){return f("os.showSaveDialog",Object.assign({title:e},t))},showNotification:function(e,t,n){return f("os.showNotification",{title:e,content:t,icon:n})},showMessageBox:function(e,t,n,o){return f("os.showMessageBox",{title:e,content:t,choice:n,icon:o})},setTray:function(e){return f("os.setTray",e)},open:function(e){return f("os.open",{url:e})},getPath:function(e){return f("os.getPath",{name:e})}};var E={__proto__:null,getMemoryInfo:function(){return f("computer.getMemoryInfo")},getArch:function(){return f("computer.getArch")},getKernelInfo:function(){return f("computer.getKernelInfo")},getOSInfo:function(){return f("computer.getOSInfo")},getCPUInfo:function(){return f("computer.getCPUInfo")},getDisplays:function(){return f("computer.getDisplays")},getMousePosition:function(){return f("computer.getMousePosition")}};var O,R={__proto__:null,setData:function(e,t){return f("storage.setData",{key:e,data:t})},getData:function(e){return f("storage.getData",{key:e})},getKeys:function(){return f("storage.getKeys")}};function T(e,t){return f("debug.log",{message:e,type:t})}!function(e){e.WARNING="WARNING",e.ERROR="ERROR",e.INFO="INFO"}(O||(O={}));var b={__proto__:null,get LoggerType(){return O},log:T};function P(e){return f("app.exit",{code:e})}var L={__proto__:null,exit:P,killProcess:function(){return f("app.killProcess")},restartProcess:function(e){return new Promise((n=>t(this,void 0,void 0,(function*(){let t=window.NL_ARGS.reduce(((e,t)=>(t.includes(" ")&&(t=`"${t}"`),e+=" "+t)),"");(null==e?void 0:e.args)&&(t+=" "+e.args),yield N(t,{background:!0}),P(),n()}))))},getConfig:function(){return f("app.getConfig")},broadcast:function(e,t){return f("app.broadcast",{event:e,data:t})},readProcessInput:function(e){return f("app.readProcessInput",{readAll:e})},writeProcessOutput:function(e){return f("app.writeProcessOutput",{data:e})},writeProcessError:function(e){return f("app.writeProcessError",{data:e})}};const S=new WeakMap;function I(e,t){return f("window.move",{x:e,y:t})}function D(){return f("window.getSize")}var C={__proto__:null,setTitle:function(e){return f("window.setTitle",{title:e})},getTitle:function(){return f("window.getTitle")},maximize:function(){return f("window.maximize")},unmaximize:function(){return f("window.unmaximize")},isMaximized:function(){return f("window.isMaximized")},minimize:function(){return f("window.minimize")},setFullScreen:function(){return f("window.setFullScreen")},exitFullScreen:function(){return f("window.exitFullScreen")},isFullScreen:function(){return f("window.isFullScreen")},show:function(){return f("window.show")},hide:function(){return f("window.hide")},isVisible:function(){return f("window.isVisible")},focus:function(){return f("window.focus")},setIcon:function(e){return f("window.setIcon",{icon:e})},move:I,center:function(){return f("window.center")},setDraggableRegion:function(e){return new Promise(((n,o)=>{const i=e instanceof Element?e:document.getElementById(e);let r=0,s=0,a=0,c=!1,u=performance.now();if(!i)return o({code:"NE_WD_DOMNOTF",message:"Unable to find DOM element"});if(S.has(i))return o({code:"NE_WD_ALRDREL",message:"This DOM element is already an active draggable region"});function d(e){return t(this,void 0,void 0,(function*(){if(c){const t=performance.now(),n=t-u;if(n<5)return;return u=t-(n-5),void(yield I(e.screenX-r,e.screenY-s))}a=Math.sqrt(e.movementX*e.movementX+e.movementY*e.movementY),a>=10&&(c=!0,i.setPointerCapture(e.pointerId))}))}function l(e){0===e.button&&(r=e.clientX,s=e.clientY,i.addEventListener("pointermove",d))}function f(e){i.removeEventListener("pointermove",d),i.releasePointerCapture(e.pointerId)}i.addEventListener("pointerdown",l),i.addEventListener("pointerup",f),S.set(i,{pointerdown:l,pointerup:f}),n({success:!0,message:"Draggable region was activated"})}))},unsetDraggableRegion:function(e){return new Promise(((t,n)=>{const o=e instanceof Element?e:document.getElementById(e);if(!o)return n({code:"NE_WD_DOMNOTF",message:"Unable to find DOM element"});if(!S.has(o))return n({code:"NE_WD_NOTDRRE",message:"DOM element is not an active draggable region"});const{pointerdown:i,pointerup:r}=S.get(o);o.removeEventListener("pointerdown",i),o.removeEventListener("pointerup",r),S.delete(o),t({success:!0,message:"Draggable region was deactivated"})}))},setSize:function(e){return new Promise(((n,o)=>t(this,void 0,void 0,(function*(){let t=yield D();f("window.setSize",e=Object.assign(Object.assign({},t),e)).then((e=>{n(e)})).catch((e=>{o(e)}))}))))},getSize:D,getPosition:function(){return f("window.getPosition")},setAlwaysOnTop:function(e){return f("window.setAlwaysOnTop",{onTop:e})},create:function(e,t){return new Promise(((n,o)=>{function i(e){return"string"!=typeof e||(e=e.trim()).includes(" ")&&(e=`"${e}"`),e}t=Object.assign(Object.assign({},t),{useSavedState:!1});let r=window.NL_ARGS.reduce(((e,t,n)=>((t.includes("--path=")||t.includes("--debug-mode")||t.includes("--load-dir-res")||0==n)&&(e+=" "+i(t)),e)),"");r+=" --url="+i(e);for(let e in t){if("processArgs"==e)continue;r+=` --window${e.replace(/[A-Z]|^[a-z]/g,(e=>"-"+e.toLowerCase()))}=${i(t[e])}`}t&&t.processArgs&&(r+=" "+t.processArgs),N(r,{background:!0}).then((e=>{n(e)})).catch((e=>{o(e)}))}))}};var x={__proto__:null,broadcast:function(e,t){return f("events.broadcast",{event:e,data:t})},on:i,off:function(e,t){return window.removeEventListener(e,t),Promise.resolve({success:!0,message:"Event listener removed"})},dispatch:r};let A=null;var F={__proto__:null,checkForUpdates:function(e){return new Promise(((n,o)=>t(this,void 0,void 0,(function*(){if(!e)return o({code:"NE_RT_NATRTER",message:"Missing require parameter: url"});try{let t=yield fetch(e);A=JSON.parse(yield t.text()),!function(e){return!!(e.applicationId&&e.applicationId==window.NL_APPID&&e.version&&e.resourcesURL)}(A)?o({code:"NE_UP_CUPDMER",message:"Invalid update manifest or mismatching applicationId"}):n(A)}catch(e){o({code:"NE_UP_CUPDERR",message:"Unable to fetch update manifest"})}}))))},install:function(){return new Promise(((e,n)=>t(this,void 0,void 0,(function*(){if(!A)return n({code:"NE_UP_UPDNOUF",message:"No update manifest loaded"});try{let t=yield fetch(A.resourcesURL),n=yield t.arrayBuffer();yield g(window.NL_PATH+"/resources.neu",n),e({success:!0,message:"Update installed. Restart the process to see updates"})}catch(e){n({code:"NE_UP_UPDINER",message:"Update installation error"})}}))))}};var M={__proto__:null,readText:function(e,t){return f("clipboard.readText",{key:e,data:t})},writeText:function(e){return f("clipboard.writeText",{data:e})}};var j={__proto__:null,getMethods:function(){return f("custom.getMethods")}};let U=!1;return e.app=L,e.clipboard=M,e.computer=E,e.custom=j,e.debug=b,e.events=x,e.extensions=o,e.filesystem=h,e.init=function(e={}){if(e=Object.assign({exportCustomMethods:!0},e),!U){if(l(),window.NL_ARGS.find((e=>"--neu-dev-auto-reload"==e))&&i("neuDev_reloadApp",(()=>t(this,void 0,void 0,(function*(){yield T("Reloading the application..."),location.reload()})))),e.exportCustomMethods&&window.NL_CMETHODS&&window.NL_CMETHODS.length>0)for(let e of window.NL_CMETHODS)Neutralino.custom[e]=(...t)=>{let n={};for(let[e,o]of t.entries())n="object"!=typeof o||Array.isArray(o)||null==o?Object.assign(Object.assign({},n),{["arg"+e]:o}):Object.assign(Object.assign({},n),o);return f("custom."+e,n)};window.NL_CVERSION="5.0.1",window.NL_CCOMMIT="8f0ed4cf6418bf0980a76e63d7b7813de112d16b",U=!0}},e.os=y,e.storage=R,e.updater=F,e.window=C,e}({}); diff --git a/neutralino.config.json b/neutralino.config.json index c2b17e1..2c972ec 100644 --- a/neutralino.config.json +++ b/neutralino.config.json @@ -17,7 +17,7 @@ "app.*", "os.*", "filesystem.*", - "window.*", + "window.*", "debug.log" ], "modes": { @@ -44,7 +44,7 @@ "binaryName": "MiniWarteschlangensimulator", "resourcesPath": "/docs/", "clientLibrary": "docs/libs/neutralino.js", - "binaryVersion": "4.14.1", - "clientVersion": "3.8.0" + "binaryVersion": "5.0.0", + "clientVersion": "5.0.1" } } \ No newline at end of file