pinokiod 0.1.71 → 0.1.74

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.
@@ -102,7 +102,6 @@ class FS {
102
102
  ondata({ raw: "\r\ncreating a shared drive:\r\n" + JSON.stringify(req.params, null, 2).replace(/\n/g, "\r\n") })
103
103
 
104
104
  if (req.params.drive) {
105
- if (req.params.peers
106
105
  const drivePath = kernel.path("drive")
107
106
  const drive = new Pdrive(drivePath)
108
107
  for(const route in req.params.drive) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "0.1.71",
3
+ "version": "0.1.74",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -6,3 +6,13 @@ const refreshParent = (e) => {
6
6
  window.parent.postMessage(e, "*")
7
7
  }
8
8
  }
9
+ window.addEventListener('message', (event) => {
10
+ console.log("Message received from the child: ", event.data); // Message received from child
11
+ if (event.data && event.data.action) {
12
+ if (event.data.action === "back") {
13
+ history.back()
14
+ } else if (event.data.action === "forward") {
15
+ history.forward()
16
+ }
17
+ }
18
+ });
@@ -368,9 +368,11 @@ body.dark #new-tab {
368
368
  <div class='container'>
369
369
  <nav>
370
370
  <div class='hidden bar'>
371
+ <button class='btn2 logo' id='back'><i class="fa-solid fa-arrow-left"></i></button>
372
+ <button class='btn2 logo' id='forward'><i class="fa-solid fa-arrow-right"></i></button>
371
373
  <button class='btn2 logo' id='reload'><i class="fa-solid fa-rotate-right"></i></button>
372
374
  <div id='location'></div>
373
- <a class='btn2 hidden' id='open-browser' target="_blank" href=""><i class="fa-solid fa-square-arrow-up-right"></i> Browser</a>
375
+ <a class='btn2 hidden' id='open-browser' target="_blank" href=""><i class="fa-solid fa-square-arrow-up-right"></i> External Browser</a>
374
376
  </div>
375
377
  <!--
376
378
  <div class='flexible'></div>
@@ -416,6 +418,24 @@ const renderCursor = () => {
416
418
  console.log({ cursorIndex, target })
417
419
  target.classList.add("cursor")
418
420
  }
421
+ const nav = (type) => {
422
+ if (location.hash && location.hash.length > 0) {
423
+ let id = getTarget(location.hash.slice(1))
424
+ let target = document.querySelector("aside [target='" + id + "']")
425
+ let targetFrame = document.querySelector(`iframe[name='${target.target}']`)
426
+ console.log({ target, targetFrame })
427
+ if (type === "back") {
428
+ targetFrame.contentWindow.history.back()
429
+ } else if (type === "forward") {
430
+ targetFrame.contentWindow.history.forward()
431
+ }
432
+ /*
433
+ targetFrame.contentWindow.postMessage({
434
+ action: type
435
+ }, "*")
436
+ */
437
+ }
438
+ }
419
439
  const renderSelection = (e, force) => {
420
440
  console.log("# 1")
421
441
  if (location.hash && location.hash.length > 0) {
@@ -550,6 +570,12 @@ document.querySelector("#reload").addEventListener("click", (e) => {
550
570
  // force refresh
551
571
  renderSelection(null, true)
552
572
  })
573
+ document.querySelector("#back").addEventListener("click", (e) => {
574
+ nav("back")
575
+ })
576
+ document.querySelector("#forward").addEventListener("click", (e) => {
577
+ nav("forward")
578
+ })
553
579
 
554
580
  /*
555
581
  document.querySelector("#new-tab").addEventListener("click", async (e) => {
@@ -145,9 +145,9 @@ body main iframe {
145
145
  </header>
146
146
  <main>
147
147
  <% if (theme === "dark") { %>
148
- <iframe src="https://pinokio.computer/dark"></iframe>
148
+ <iframe name="<%=version.pinokiod%>" src="https://pinokio.computer/dark"></iframe>
149
149
  <% } else { %>
150
- <iframe src="https://pinokio.computer/app"></iframe>
150
+ <iframe name="<%=version.pinokiod%>" src="https://pinokio.computer/app"></iframe>
151
151
  <% } %>
152
152
  </main>
153
153
  <link href="/xterm.min.css" rel="stylesheet" />