Skip to content

Commit c09e4c8

Browse files
committed
testing NO menu in electron
1 parent 3fc34b1 commit c09e4c8

File tree

14 files changed

+235
-160
lines changed

14 files changed

+235
-160
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ $ docker run -d --name EASYEDIT -p 3024:3024 gcclinux/easyedit:1.3.8
5555

5656
## *Latest Example implementing custom tables...*
5757

58-
<a><img src="screenshots/sample006.png" alt="Example" width="500" height="400"> <img src="screenshots/sample012.png" alt="Example" width="500" height="400"></a>
58+
<a><img src="screenshots/013.png" alt="Example" width="600" height="400"></a>
5959

6060
## *Example Gantt graph as code*
6161
```mermaid

about/about.css

Lines changed: 26 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,31 @@
11
body {
2-
font-family: Arial, sans-serif;
3-
background-color: rgb(143, 246, 246);
2+
font-family: Arial, Helvetica, sans-serif;
3+
background: linear-gradient(180deg, #f6f8fa 0%, #e9eef2 100%);
4+
margin: 0;
5+
color: #111;
46
}
5-
6-
.popup {
7-
border-radius: 100px;
8-
width: 550px;
9-
padding: 5px;
10-
padding-top: 20px;
11-
padding-bottom: 20px;
12-
border: 1px solid #ccc;
13-
background-color: #dbd8d8;
14-
position: fixed;
15-
top: 50%;
16-
left: 50%;
17-
transform: translate(-50%, -50%);
18-
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
19-
text-align: center;
20-
}
21-
22-
.popup h2 {
23-
margin-top: 0;
24-
}
25-
26-
.popup a {
27-
color: #007bff;
28-
text-decoration: none;
29-
}
30-
31-
.popup a:hover {
32-
text-decoration: underline;
33-
}
34-
35-
#closeBtn {
36-
margin-top: 20px;
37-
padding: 10px 20px;
38-
background-color: #007bff;
39-
color: #fff;
40-
border: none;
41-
cursor: pointer;
7+
.about-popup {
8+
width: min(1100px, 96%);
9+
margin: 40px auto;
10+
background: #ffffff;
11+
border-radius: 10px;
12+
box-shadow: 0 10px 30px rgba(16,24,40,0.14);
13+
padding: 28px;
4214
}
15+
.about-hero { display:flex; gap:20px; align-items:center }
16+
.about-hero-logo img { width:96px; height:96px; object-fit:contain }
17+
.about-title { margin:0; font-size:28px }
18+
.about-subtitle { color:#555; margin-top:6px }
19+
.about-badges { margin-top:8px }
20+
.badge { display:inline-block; background:#f1f5f9; color:#111; padding:6px 10px; margin-right:6px; border-radius:6px; font-size:13px }
21+
.about-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:14px; margin-top:18px }
22+
.about-card { background: rgba(0,0,0,0.02); padding:12px; border:2px solid rgba(0,0,0,0.06); border-radius:8px }
23+
.about-actions { display:flex; justify-content:flex-end; margin-top:16px }
24+
.btn.primary { background:#0b84ff; color:#fff; padding:8px 12px; border-radius:6px; border:none; cursor:pointer }
25+
.muted { color:#666 }
4326

44-
#closeBtn:hover {
45-
background-color: #0056b3;
27+
@media (max-width:1024px) {
28+
.about-grid { grid-template-columns:1fr }
29+
.about-hero { flex-direction:row; gap:12px }
30+
.about-title { font-size:20px }
4631
}

about/about.html

Lines changed: 49 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,58 @@
66
<link rel="icon" href="icon.png" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
88
<title>EasyEdit Info</title>
9-
<link rel="stylesheet" href="about.css">
9+
<link rel="stylesheet" href="shared.css">
1010
</head>
1111

1212
<body>
13-
<div id="popup" class="popup">
14-
<img src="../public/easyedit128.png" alt="EasyEdit Logo"
15-
style="display: block; margin-left: auto; margin-right: auto;">
16-
<p>EasyEdit is an easy markdown editor that allows you to create Markdown (MD) and preview it in real-time. You
17-
can save, load .md files and export to HTML & PDF.</p>
18-
<p><i>EasyEdit is a free and open-source project. You can use it for free and modify it as you like.</i></p>
19-
<p>Developed by: <a href="https://github.com/gcclinux" target="_blank">Ricardo Wagemaker</a>
20-
<br>Contributed by: <a href="https://github.com/Lewish1998" target="_blank">Lewis Halstead</a></p>
21-
<p>GitHub: <a href="https://github.com/gcclinux/EasyEdit"
22-
target="_blank">https://github.com/gcclinux/EasyEdit</a></p>
23-
<p>License: MIT<br>
24-
Current Version: <b id="version"></b>
25-
</p>
26-
<button id="closeBtn">OK</button>
27-
</div>
13+
<div id="popup" class="about-popup">
14+
<div class="about-hero">
15+
<div class="about-hero-logo">
16+
<img src="../public/easyedit128.png" alt="EasyEdit Logo">
17+
</div>
18+
<div class="about-hero-text">
19+
<h1 class="about-title">EasyEdit</h1>
20+
<div class="about-subtitle">Simple. Fast. Markdown‑first notes with live preview.</div>
21+
<div class="about-badges">
22+
<span class="badge">Markdown</span>
23+
<span class="badge">Templates</span>
24+
<span class="badge">Mermaid</span>
25+
<span class="badge">Export</span>
26+
</div>
27+
</div>
28+
</div>
29+
30+
<div class="about-grid">
31+
<div class="about-card">
32+
<h3>What it is</h3>
33+
<p><strong>EasyEdit</strong> helps you capture thoughts quickly using familiar Markdown. See your formatting instantly in the live preview and keep focus with a clean layout.</p>
34+
</div>
35+
<div class="about-card">
36+
<h3>What it does</h3>
37+
<ul>
38+
<li>Ready-made templates: Meeting Notes, Project Plan, Study Notes, Travel Log, Workout Log, Daily Journal.</li>
39+
<li>Insert tables, icons, images, links, tasks, footnotes, and Mermaid diagrams.</li>
40+
<li>Export to Markdown or TXT; print the rendered preview.</li>
41+
<li>Resize editor/preview split; switch themes.</li>
42+
</ul>
43+
</div>
44+
<div class="about-card">
45+
<h3>Why you’ll like it</h3>
46+
<p>It’s fast, minimal, and gets out of your way — great for journaling, meeting notes, and planning.</p>
47+
</div>
48+
<div class="about-card">
49+
<h3>Credits</h3>
50+
<p>Built with care by <strong>Ricardo Wagemaker</strong>.<br><span class="muted">Last updated: 26 September 2025</span></p>
51+
<p>Contributions: <a href="https://github.com/Lewish1998" target="_blank">Lewis Halstead</a></p>
52+
<p>GitHub: <a href="https://github.com/gcclinux/EasyEdit" target="_blank">gcclinux/EasyEdit</a></p>
53+
<p>License: MIT<br>Version: <b id="version"></b></p>
54+
</div>
55+
</div>
56+
57+
<div class="about-actions">
58+
<button id="closeBtn" class="btn primary">Close</button>
59+
</div>
60+
</div>
2861
<script src="about.js"></script>
2962
</body>
3063

about/about.js

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,42 @@
11
// Author: Ricardo Wagemaker
22

3-
const path = require('path');
4-
const fs = require('fs');
3+
document.addEventListener('DOMContentLoaded', () => {
4+
// Safe close button hookup
5+
const closeBtn = document.getElementById('closeBtn');
6+
if (closeBtn) {
7+
closeBtn.addEventListener('click', () => {
8+
try { window.close(); } catch (e) { /* ignore */ }
9+
});
10+
}
511

6-
// fucntion to close the window
7-
document.getElementById('closeBtn').addEventListener('click', function() {
8-
window.close();
9-
});
12+
// Populate version if possible. In Electron (or Node-enabled contexts) we can read package.json.
13+
const versionEl = document.getElementById('version');
14+
if (!versionEl) return;
1015

11-
// Set version number
12-
const packageJsonPath = path.join(__dirname, '../package.json');
13-
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
14-
15-
// Retrieve the version from package.json
16-
var version = packageJson.version;
17-
document.getElementById('version').textContent = version;
16+
try {
17+
// require may not be available in a plain browser; guard it
18+
// eslint-disable-next-line no-undef
19+
const path = require('path');
20+
// eslint-disable-next-line no-undef
21+
const fs = require('fs');
22+
const packageJsonPath = path.join(__dirname, '../package.json');
23+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
24+
const version = packageJson.version || 'unknown';
25+
versionEl.textContent = version;
26+
} catch (err) {
27+
// Fallback: try to fetch package.json over HTTP (if served), else use 'unknown'
28+
(async () => {
29+
try {
30+
const resp = await fetch('/package.json');
31+
if (resp.ok) {
32+
const pkg = await resp.json();
33+
versionEl.textContent = pkg.version || 'unknown';
34+
return;
35+
}
36+
} catch (e) {
37+
// ignore
38+
}
39+
versionEl.textContent = 'unknown';
40+
})();
41+
}
42+
});

about/shared.css

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* Shared stylesheet for About and Release pages */
2+
body {
3+
font-family: Arial, Helvetica, sans-serif;
4+
background: linear-gradient(180deg, #f6f8fa 0%, #e9eef2 100%);
5+
margin: 0;
6+
color: #111;
7+
}
8+
.about-popup {
9+
width: min(1100px, 96%);
10+
margin: 40px auto;
11+
background: #ffffff;
12+
border-radius: 10px;
13+
box-shadow: 0 10px 30px rgba(16,24,40,0.14);
14+
padding: 28px;
15+
}
16+
.about-hero { display:flex; gap:20px; align-items:center }
17+
.about-hero-logo img { width:96px; height:96px; object-fit:contain }
18+
.about-title { margin:0; font-size:28px }
19+
.about-subtitle { color:#555; margin-top:6px }
20+
.about-badges { margin-top:8px }
21+
.badge { display:inline-block; background:#f1f5f9; color:#111; padding:6px 10px; margin-right:6px; border-radius:6px; font-size:13px }
22+
.about-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:14px; margin-top:18px }
23+
.about-card { background: rgba(0,0,0,0.02); padding:12px; border:2px solid rgba(0,0,0,0.06); border-radius:8px }
24+
.about-actions { display:flex; justify-content:flex-end; margin-top:16px }
25+
.btn.primary { background:#0b84ff; color:#fff; padding:8px 12px; border-radius:6px; border:none; cursor:pointer }
26+
.muted { color:#666 }
27+
28+
@media (max-width:1024px) {
29+
.about-grid { grid-template-columns:1fr }
30+
.about-hero { flex-direction:row; gap:12px }
31+
.about-title { font-size:20px }
32+
}

main.cjs

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,19 @@ async function createMainWindow() {
111111

112112
mainWindow = new BrowserWindow(windowOptions);
113113

114+
// Ensure the application menu is removed and the window menu bar is hidden.
115+
// This is a temporary measure to disable the Electron menubar entirely.
116+
try {
117+
// Clear any application menu that may have been set previously.
118+
Menu.setApplicationMenu(null);
119+
// Hide the menu bar on the main window (works on Windows/Linux).
120+
if (mainWindow && typeof mainWindow.setMenuBarVisibility === 'function') {
121+
mainWindow.setMenuBarVisibility(false);
122+
}
123+
} catch (err) {
124+
console.error('Failed to remove/hide application menu:', err);
125+
}
126+
114127
// ensure we save bounds when window is closed
115128
mainWindow.on('close', () => {
116129
try {
@@ -351,8 +364,8 @@ function createMenuTemplate() {
351364
click: () => {
352365
const iconPath = path.join(__dirname, 'public', process.platform === 'win32' ? 'icon.ico' : 'icon.png');
353366
releaseWindow = new BrowserWindow({
354-
width: 600,
355-
height: 480,
367+
width: 1270,
368+
height: 600,
356369
modal: true,
357370
icon: iconPath,
358371
parent: mainWindow,
@@ -380,8 +393,8 @@ function createMenuTemplate() {
380393
click: () => {
381394
const iconPath = path.join(__dirname, 'public', process.platform === 'win32' ? 'icon.ico' : 'icon.png');
382395
const aboutWindow = new BrowserWindow({
383-
width: 600,
384-
height: 550,
396+
width: 1270,
397+
height: 860,
385398
modal: true,
386399
icon: iconPath,
387400
parent: mainWindow,
@@ -409,7 +422,9 @@ function setupMenu() {
409422
// App lifecycle management
410423
app.whenReady().then(async () => {
411424
await createMainWindow();
412-
setupMenu();
425+
// Temporarily disable the application menu. To re-enable, uncomment the
426+
// call to setupMenu() below.
427+
// setupMenu();
413428
setupIPCHandlers();
414429

415430
// Handle command line file opening

release/release.css

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)