From c7a205fb257d679006773d4b658b63c5b155d637 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Thu, 26 Feb 2026 13:19:34 -0500 Subject: [PATCH] change electron hide/show elements bump rev 4.7.0 --- app-el.js | 5 ++++- package.json | 2 +- src/kiri/app/menubar.js | 14 +++++++------- src/main/kiri.js | 6 ++---- src/moto/license.js | 2 +- web/kiri/index.html | 2 +- web/kiri/manifest.json | 2 +- 7 files changed, 17 insertions(+), 16 deletions(-) diff --git a/app-el.js b/app-el.js index 48c893ad..125df65a 100644 --- a/app-el.js +++ b/app-el.js @@ -78,12 +78,15 @@ function createWindow() { if (url.endsWith('/mesh') || url.endsWith('/mesh/')) { return; } + if (url.endsWith('/void') || url.endsWith('/void/')) { + return; + } event.preventDefault(); shell.openExternal(url); }); webContents.on('did-finish-load', () => { - mainWindow.webContents.executeJavaScript(`{ let x = document.getElementById('app-quit'); if (x) { x.onclick = () => window.close() } }; null;`); + // console.log('did finish load'); }); if (devel) { diff --git a/package.json b/package.json index d646998b..337edac4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grid-apps", - "version": "4.6.3", + "version": "4.7.0", "description": "grid.space 3d slicing & modeling tools", "author": "Stewart Allen ", "license": "MIT", diff --git a/src/kiri/app/menubar.js b/src/kiri/app/menubar.js index c01fff46..e3796807 100644 --- a/src/kiri/app/menubar.js +++ b/src/kiri/app/menubar.js @@ -17,11 +17,12 @@ function tr(key, fallback) { return api.language?.current?.[key] || fallback || key; } -function menuItem(actions, { id, lk, xlk, text, title, iconClass, className, children }) { +function menuItem(actions, { id, lk, xlk, text, title, iconClass, className, children, onclick }) { const attr = { ...(id ? { id } : {}), ...(title ? { title } : {}), ...(className ? { class: className } : {}), + ...(onclick ? { onclick } : {}), ...on(actions, id) }; const lblAttr = { @@ -122,8 +123,8 @@ function scalePanel(actions) { function content(actions) { return [ - div({ class: 'menubar-appname', _: 'Kiri:Moto' }), - div({ class: 'menubar-separator' }), + div({ class: 'menubar-appname el-app-hide', _: 'Kiri:Moto' }), + div({ class: 'menubar-separator el-app-hide' }), div({ class: 'f-row top-menu grow' }, [ topMenu(actions, { text: 'files', lk: 'fe_menu', items: [ @@ -139,8 +140,8 @@ function content(actions) { menuItem(actions, { id: 'mesh-export-stl', lk: 'export-stl', text: 'save as STL', iconClass: 'fas fa-dice-d20' }), hr(), menuItem(actions, { id: 'app-export', lk: 'rc_xpws', text: 'export work', iconClass: 'fas fa-download' }), - hr(), - menuItem(actions, { id: 'app-quit', lk: 'quit', text: 'quit', className: 'hide' }) + hr({ class: "app-hide" }), + menuItem(actions, { id: 'app-quit', lk: 'quit', text: 'quit', className: 'hide', onclick() { window.close() } }) ] }), topMenu(actions, { @@ -178,7 +179,6 @@ function content(actions) { menuItem(actions, { id: 'render-edges', lk: 're_edgs', text: 'toggle edges', iconClass: 'fa-regular fa-square' }) ] }), - // div({ class: 'menubar-separator' }), div({ class: 'f-row top-menu' }, [ toolbarToolNozzle() ]), @@ -207,7 +207,7 @@ function content(actions) { menuItem(actions, { id: 'set-profs', lk: 'profs', text: 'profiles', iconClass: 'fas fa-sliders-h' }), menuItem(actions, { id: 'set-tools', lk: 'tools', text: 'tools', iconClass: 'fas fa-tools' }), menuItem(actions, { id: 'set-prefs', lk: 'prefs', text: 'prefs', iconClass: 'fa-solid fa-square-check' }), - hr(), + hr({ class: "el-app-hide" }), menuItem(actions, { id: 'install', lk: 'install', text: 'install' }), menuItem(actions, { id: 'uninstall', lk: 'uninstall', text: 'uninstall', className: 'hide' }) ] diff --git a/src/main/kiri.js b/src/main/kiri.js index abee37e5..5c6d0195 100644 --- a/src/main/kiri.js +++ b/src/main/kiri.js @@ -50,10 +50,7 @@ async function checkReady() { if (api.electron) { $('install').classList.add('hide'); $('app-quit').classList.remove('hide'); - const appNameText = $('app-name-text') || document.querySelector('.menubar-appname'); - if (appNameText) appNameText.innerText = "More Info"; - const topSep = $('top-sep'); - if (topSep) topSep.style.display = 'flex'; + [...document.getElementsByClassName('el-app-hide')].forEach(el => el.classList.add('hide')); } else if (bootctrl) { $('install').classList.add('hide'); $('uninstall').classList.remove('hide'); @@ -62,6 +59,7 @@ async function checkReady() { location.reload(); } } else { + [...document.getElementsByClassName('app-hide')].forEach(el => el.classList.add('hide')); $('install').onclick = () => { location.replace('/boot'); } diff --git a/src/moto/license.js b/src/moto/license.js index 5609f638..e4944e0c 100644 --- a/src/moto/license.js +++ b/src/moto/license.js @@ -3,7 +3,7 @@ const terms = { COPYRIGHT: "Copyright (C) Stewart Allen - All Rights Reserved", LICENSE: "See the license.md file included with the source distribution", - VERSION: "4.6.3" + VERSION: "4.7.0" }; export const beta = 0; diff --git a/web/kiri/index.html b/web/kiri/index.html index f73239fd..fa07f592 100644 --- a/web/kiri/index.html +++ b/web/kiri/index.html @@ -46,7 +46,7 @@
Kiri:Moto is Loading
-
+
diff --git a/web/kiri/manifest.json b/web/kiri/manifest.json index 52a1db7d..a1223bfb 100644 --- a/web/kiri/manifest.json +++ b/web/kiri/manifest.json @@ -1,5 +1,5 @@ { - "name": "Kiri:Moto 4.6.3", + "name": "Kiri:Moto 4.7.0", "short_name": "Kiri:Moto", "description": "Slicer for 3D printers, CNC mills, laser cutters and more", "start_url": "/boot/index.html",