change electron hide/show elements
bump rev 4.7.0
This commit is contained in:
parent
95fbd885de
commit
c7a205fb25
7 changed files with 17 additions and 16 deletions
|
|
@ -78,12 +78,15 @@ function createWindow() {
|
||||||
if (url.endsWith('/mesh') || url.endsWith('/mesh/')) {
|
if (url.endsWith('/mesh') || url.endsWith('/mesh/')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (url.endsWith('/void') || url.endsWith('/void/')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
shell.openExternal(url);
|
shell.openExternal(url);
|
||||||
});
|
});
|
||||||
|
|
||||||
webContents.on('did-finish-load', () => {
|
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) {
|
if (devel) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "grid-apps",
|
"name": "grid-apps",
|
||||||
"version": "4.6.3",
|
"version": "4.7.0",
|
||||||
"description": "grid.space 3d slicing & modeling tools",
|
"description": "grid.space 3d slicing & modeling tools",
|
||||||
"author": "Stewart Allen <sa@grid.space>",
|
"author": "Stewart Allen <sa@grid.space>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,12 @@ function tr(key, fallback) {
|
||||||
return api.language?.current?.[key] || fallback || key;
|
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 = {
|
const attr = {
|
||||||
...(id ? { id } : {}),
|
...(id ? { id } : {}),
|
||||||
...(title ? { title } : {}),
|
...(title ? { title } : {}),
|
||||||
...(className ? { class: className } : {}),
|
...(className ? { class: className } : {}),
|
||||||
|
...(onclick ? { onclick } : {}),
|
||||||
...on(actions, id)
|
...on(actions, id)
|
||||||
};
|
};
|
||||||
const lblAttr = {
|
const lblAttr = {
|
||||||
|
|
@ -122,8 +123,8 @@ function scalePanel(actions) {
|
||||||
|
|
||||||
function content(actions) {
|
function content(actions) {
|
||||||
return [
|
return [
|
||||||
div({ class: 'menubar-appname', _: 'Kiri:Moto' }),
|
div({ class: 'menubar-appname el-app-hide', _: 'Kiri:Moto' }),
|
||||||
div({ class: 'menubar-separator' }),
|
div({ class: 'menubar-separator el-app-hide' }),
|
||||||
div({ class: 'f-row top-menu grow' }, [
|
div({ class: 'f-row top-menu grow' }, [
|
||||||
topMenu(actions, {
|
topMenu(actions, {
|
||||||
text: 'files', lk: 'fe_menu', items: [
|
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' }),
|
menuItem(actions, { id: 'mesh-export-stl', lk: 'export-stl', text: 'save as STL', iconClass: 'fas fa-dice-d20' }),
|
||||||
hr(),
|
hr(),
|
||||||
menuItem(actions, { id: 'app-export', lk: 'rc_xpws', text: 'export work', iconClass: 'fas fa-download' }),
|
menuItem(actions, { id: 'app-export', lk: 'rc_xpws', text: 'export work', iconClass: 'fas fa-download' }),
|
||||||
hr(),
|
hr({ class: "app-hide" }),
|
||||||
menuItem(actions, { id: 'app-quit', lk: 'quit', text: 'quit', className: 'hide' })
|
menuItem(actions, { id: 'app-quit', lk: 'quit', text: 'quit', className: 'hide', onclick() { window.close() } })
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
topMenu(actions, {
|
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' })
|
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' }, [
|
div({ class: 'f-row top-menu' }, [
|
||||||
toolbarToolNozzle()
|
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-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-tools', lk: 'tools', text: 'tools', iconClass: 'fas fa-tools' }),
|
||||||
menuItem(actions, { id: 'set-prefs', lk: 'prefs', text: 'prefs', iconClass: 'fa-solid fa-square-check' }),
|
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: 'install', lk: 'install', text: 'install' }),
|
||||||
menuItem(actions, { id: 'uninstall', lk: 'uninstall', text: 'uninstall', className: 'hide' })
|
menuItem(actions, { id: 'uninstall', lk: 'uninstall', text: 'uninstall', className: 'hide' })
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -50,10 +50,7 @@ async function checkReady() {
|
||||||
if (api.electron) {
|
if (api.electron) {
|
||||||
$('install').classList.add('hide');
|
$('install').classList.add('hide');
|
||||||
$('app-quit').classList.remove('hide');
|
$('app-quit').classList.remove('hide');
|
||||||
const appNameText = $('app-name-text') || document.querySelector('.menubar-appname');
|
[...document.getElementsByClassName('el-app-hide')].forEach(el => el.classList.add('hide'));
|
||||||
if (appNameText) appNameText.innerText = "More Info";
|
|
||||||
const topSep = $('top-sep');
|
|
||||||
if (topSep) topSep.style.display = 'flex';
|
|
||||||
} else if (bootctrl) {
|
} else if (bootctrl) {
|
||||||
$('install').classList.add('hide');
|
$('install').classList.add('hide');
|
||||||
$('uninstall').classList.remove('hide');
|
$('uninstall').classList.remove('hide');
|
||||||
|
|
@ -62,6 +59,7 @@ async function checkReady() {
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
[...document.getElementsByClassName('app-hide')].forEach(el => el.classList.add('hide'));
|
||||||
$('install').onclick = () => {
|
$('install').onclick = () => {
|
||||||
location.replace('/boot');
|
location.replace('/boot');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
const terms = {
|
const terms = {
|
||||||
COPYRIGHT: "Copyright (C) Stewart Allen <sa@grid.space> - All Rights Reserved",
|
COPYRIGHT: "Copyright (C) Stewart Allen <sa@grid.space> - All Rights Reserved",
|
||||||
LICENSE: "See the license.md file included with the source distribution",
|
LICENSE: "See the license.md file included with the source distribution",
|
||||||
VERSION: "4.6.3"
|
VERSION: "4.7.0"
|
||||||
};
|
};
|
||||||
|
|
||||||
export const beta = 0;
|
export const beta = 0;
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
<div id="curtain" class="j-center a-center"><img id="loading">Kiri:Moto is Loading</div>
|
<div id="curtain" class="j-center a-center"><img id="loading">Kiri:Moto is Loading</div>
|
||||||
|
|
||||||
<!-- when running iframed, provide a separator between the menu bar and enclosing page -->
|
<!-- when running iframed, provide a separator between the menu bar and enclosing page -->
|
||||||
<div id="top-sep"></div>
|
<div id="top-sep" class="el-app-hide"></div>
|
||||||
|
|
||||||
<!-- top menu bar -->
|
<!-- top menu bar -->
|
||||||
<div id="menubar" class="f-row"></div>
|
<div id="menubar" class="f-row"></div>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "Kiri:Moto 4.6.3",
|
"name": "Kiri:Moto 4.7.0",
|
||||||
"short_name": "Kiri:Moto",
|
"short_name": "Kiri:Moto",
|
||||||
"description": "Slicer for 3D printers, CNC mills, laser cutters and more",
|
"description": "Slicer for 3D printers, CNC mills, laser cutters and more",
|
||||||
"start_url": "/boot/index.html",
|
"start_url": "/boot/index.html",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue