worldwideweb 0.0.17 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/main.cjs +20 -6
- package/package.json +5 -1
package/main.cjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const { app, BrowserWindow, Menu } = require('electron')
|
|
4
|
+
const path = require('path')
|
|
5
|
+
const url = require('url')
|
|
4
6
|
|
|
5
|
-
function createWindow
|
|
7
|
+
function createWindow() {
|
|
6
8
|
const mainWindow = new BrowserWindow({
|
|
7
9
|
width: 1024,
|
|
8
10
|
height: 768,
|
|
@@ -11,7 +13,19 @@ function createWindow () {
|
|
|
11
13
|
}
|
|
12
14
|
})
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
const start = 'https://solidos.solidcommunity.net/public/Roadmap/Tasks/'
|
|
17
|
+
// mainWindow.loadURL('https://solidos.github.io/mashlib/dist/browse.html')
|
|
18
|
+
// Load a URL to start with
|
|
19
|
+
|
|
20
|
+
const uri = url.format({
|
|
21
|
+
pathname: path.join('https://', 'index.html'),
|
|
22
|
+
protocol: 'file:',
|
|
23
|
+
slashes: true,
|
|
24
|
+
query: { uri: start }
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
console.log('loading', uri)
|
|
28
|
+
mainWindow.loadURL('https://solidos.github.io/mashlib/dist/browse.html?uri=' + start)
|
|
15
29
|
|
|
16
30
|
const mainMenu = Menu.buildFromTemplate(menuTemplate)
|
|
17
31
|
Menu.setApplicationMenu(mainMenu)
|
|
@@ -23,7 +37,7 @@ const menuTemplate = [
|
|
|
23
37
|
submenu: [
|
|
24
38
|
{
|
|
25
39
|
label: 'Exit',
|
|
26
|
-
click
|
|
40
|
+
click() {
|
|
27
41
|
app.quit()
|
|
28
42
|
}
|
|
29
43
|
}
|
|
@@ -35,21 +49,21 @@ const menuTemplate = [
|
|
|
35
49
|
{
|
|
36
50
|
label: 'Back',
|
|
37
51
|
accelerator: 'CmdOrCtrl+[',
|
|
38
|
-
click
|
|
52
|
+
click(item, focusedWindow) {
|
|
39
53
|
if (focusedWindow) focusedWindow.webContents.goBack()
|
|
40
54
|
}
|
|
41
55
|
},
|
|
42
56
|
{
|
|
43
57
|
label: 'Forward',
|
|
44
58
|
accelerator: 'CmdOrCtrl+]',
|
|
45
|
-
click
|
|
59
|
+
click(item, focusedWindow) {
|
|
46
60
|
if (focusedWindow) focusedWindow.webContents.goForward()
|
|
47
61
|
}
|
|
48
62
|
},
|
|
49
63
|
{
|
|
50
64
|
label: 'Reload',
|
|
51
65
|
accelerator: 'CmdOrCtrl+R',
|
|
52
|
-
click
|
|
66
|
+
click(item, focusedWindow) {
|
|
53
67
|
if (focusedWindow) focusedWindow.reload()
|
|
54
68
|
}
|
|
55
69
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "worldwideweb",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"description": "WorldWideWeb browser in JavaScript",
|
|
5
5
|
"main": "main.cjs",
|
|
6
6
|
"scripts": {
|
|
@@ -27,5 +27,9 @@
|
|
|
27
27
|
"homepage": "https://github.com/melvincarvalho/worldwideweb#readme",
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"electron": "^24.2.0"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"path": "^0.12.7",
|
|
33
|
+
"url": "^0.11.0"
|
|
30
34
|
}
|
|
31
35
|
}
|