pinokiod 0.1.37 → 0.1.39
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/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -187,13 +187,15 @@ class Server {
|
|
|
187
187
|
}]
|
|
188
188
|
paths = []
|
|
189
189
|
for(let pathComponent of pathComponents) {
|
|
190
|
-
p = p + "/" + pathComponent
|
|
190
|
+
//p = p + "/" + pathComponent
|
|
191
|
+
_p = _p + "/" + pathComponent
|
|
191
192
|
//let pn = (pathComponent.startsWith("0x") ? Buffer.from(pathComponent.slice(2), "hex").toString() : "/ " + pathComponent)
|
|
192
193
|
let pn = "/ " + pathComponent
|
|
193
194
|
paths.push({
|
|
194
195
|
//name: "/ " + pathComponent,
|
|
195
196
|
name: pn,
|
|
196
|
-
path: p
|
|
197
|
+
//path: p
|
|
198
|
+
path: _p
|
|
197
199
|
})
|
|
198
200
|
}
|
|
199
201
|
let gitRemote = ""
|
|
@@ -787,7 +789,7 @@ class Server {
|
|
|
787
789
|
let p = path.resolve(filepath, file.name)
|
|
788
790
|
let md = await fs.promises.readFile(p, "utf8")
|
|
789
791
|
readme = marked.parse(md, {
|
|
790
|
-
baseUrl: req._parsedUrl.pathname.replace(/^\/
|
|
792
|
+
baseUrl: req._parsedUrl.pathname.replace(/^\/_api/, "/raw/") + "/"
|
|
791
793
|
//baseUrl: req.originalUrl + "/"
|
|
792
794
|
})
|
|
793
795
|
}
|
|
@@ -961,8 +963,8 @@ class Server {
|
|
|
961
963
|
console.log("ITEMS", items)
|
|
962
964
|
|
|
963
965
|
|
|
964
|
-
|
|
965
|
-
|
|
966
|
+
// let U = `${_p}/${pathComponents.join("/")}`
|
|
967
|
+
// console.log("*******", { filepath, pathComponents, U })
|
|
966
968
|
|
|
967
969
|
|
|
968
970
|
res.render("index", {
|
|
@@ -1018,8 +1020,8 @@ class Server {
|
|
|
1018
1020
|
//description: x.path,
|
|
1019
1021
|
description,
|
|
1020
1022
|
//url: p + "/" + x.name,
|
|
1021
|
-
|
|
1022
|
-
url: `${U}/${x.name}`,
|
|
1023
|
+
url: _p + "/" + x.name,
|
|
1024
|
+
// url: `${U}/${x.name}`,
|
|
1023
1025
|
browser_url: "/pinokio/browser/" + x.name
|
|
1024
1026
|
}
|
|
1025
1027
|
}),
|
package/server/public/nav.js
CHANGED
|
@@ -12,7 +12,9 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
12
12
|
// forward.classList.add("disabled")
|
|
13
13
|
// }
|
|
14
14
|
//}
|
|
15
|
-
document.querySelector("#new-window")
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
if (document.querySelector("#new-window")) {
|
|
16
|
+
document.querySelector("#new-window").addEventListener("click", (e) => {
|
|
17
|
+
window.open("/", "_blank", "self")
|
|
18
|
+
})
|
|
19
|
+
}
|
|
18
20
|
})
|
package/server/public/style.css
CHANGED
|
@@ -1295,6 +1295,7 @@ body.dark #new-window {
|
|
|
1295
1295
|
*/
|
|
1296
1296
|
}
|
|
1297
1297
|
#new-window {
|
|
1298
|
+
cursor: pointer;
|
|
1298
1299
|
padding: 10px;
|
|
1299
1300
|
background: none;
|
|
1300
1301
|
border: none;
|
|
@@ -1427,4 +1428,5 @@ body.dark header .home {
|
|
|
1427
1428
|
header .home {
|
|
1428
1429
|
color: var(--light-color);
|
|
1429
1430
|
padding: 10px;
|
|
1431
|
+
cursor: pointer;
|
|
1430
1432
|
}
|
package/server/views/editor.ejs
CHANGED
|
@@ -738,11 +738,9 @@ const reloadMemory = async () => {
|
|
|
738
738
|
<!--
|
|
739
739
|
<button class='btn' id='source' data-editor-url="<%=editorUrl%>">Navigate</button>
|
|
740
740
|
-->
|
|
741
|
-
<!--
|
|
742
741
|
<div id='save' class='btn disabled'>
|
|
743
742
|
<span class='save'><i class="fa-solid fa-check"></i> Save</span>
|
|
744
743
|
</div>
|
|
745
|
-
-->
|
|
746
744
|
<% if (memory.length > 0) { %>
|
|
747
745
|
<div class='memory'>
|
|
748
746
|
<table>
|
package/server/views/frame.ejs
CHANGED
package/server/views/index.ejs
CHANGED
|
@@ -100,13 +100,13 @@
|
|
|
100
100
|
<a class='btn2' href='https://twitter.com/cocktailpeanut' target="_blank"><div><i class="fa-brands fa-twitter"></i></div><div>Twitter</div></a>
|
|
101
101
|
<a class='btn2' href="/?mode=settings"><div><i class="fa-solid fa-gear"></i></div><div>Settings</div></a>
|
|
102
102
|
</div>
|
|
103
|
+
<button id='new-window' title='open a new window'><i class="fa-solid fa-plus"></i></button>
|
|
103
104
|
<% } %>
|
|
104
105
|
<!--
|
|
105
106
|
<a class='nav-button path' href='https://discord.gg/TQdNwadtE4' target="_blank"><i class="fa-brands fa-discord"></i></a>
|
|
106
107
|
<a class='nav-button path' href='https://twitter.com/cocktailpeanut' target="_blank"><i class="fa-brands fa-twitter"></i></a>
|
|
107
108
|
<a class='nav-button path' href="/?mode=settings"><i class="fa-solid fa-gear"></i></a>
|
|
108
109
|
-->
|
|
109
|
-
<button id='new-window' title='open a new window'><i class="fa-solid fa-plus"></i></button>
|
|
110
110
|
</h1>
|
|
111
111
|
<% if (false) { %>
|
|
112
112
|
<% if (paths.length > 3) { %>
|