pinokiod 1.0.33 → 1.0.34

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "1.0.33",
3
+ "version": "1.0.34",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -509,26 +509,35 @@ const renderCursor = () => {
509
509
  target.classList.add("cursor")
510
510
  }
511
511
  const nav = (type) => {
512
- if (location.hash && location.hash.length > 0) {
513
- // let id = getTarget(location.hash.slice(1))
514
- // let target = document.querySelector("aside [target='" + id + "']")
515
- let id = location.hash.slice(1)
516
- let type = id[0]
517
- let index = id.slice(1)
518
- let target = document.querySelector(`aside .${type} [data-index='${index}']`)
519
- let targetFrame = document.querySelector(`iframe[name='${target.target}']`)
520
- console.log({ target, targetFrame })
521
- if (type === "back") {
522
- targetFrame.contentWindow.history.back()
523
- } else if (type === "forward") {
524
- targetFrame.contentWindow.history.forward()
525
- }
526
- /*
527
- targetFrame.contentWindow.postMessage({
528
- action: type
529
- }, "*")
530
- */
512
+ let targetFrame = document.querySelector("iframe:not(.hidden)")
513
+ if (type === "back") {
514
+ targetFrame.contentWindow.history.back()
515
+ } else if (type === "forward") {
516
+ targetFrame.contentWindow.history.forward()
531
517
  }
518
+
519
+
520
+
521
+ // if (location.hash && location.hash.length > 0) {
522
+ //// let id = getTarget(location.hash.slice(1))
523
+ //// let target = document.querySelector("aside [target='" + id + "']")
524
+ // let id = location.hash.slice(1)
525
+ // let type = id[0]
526
+ // let index = id.slice(1)
527
+ // let target = document.querySelector(`aside .${type} [data-index='${index}']`)
528
+ // let targetFrame = document.querySelector(`iframe[name='${target.target}']`)
529
+ // console.log({ target, targetFrame })
530
+ // if (type === "back") {
531
+ // targetFrame.contentWindow.history.back()
532
+ // } else if (type === "forward") {
533
+ // targetFrame.contentWindow.history.forward()
534
+ // }
535
+ // /*
536
+ // targetFrame.contentWindow.postMessage({
537
+ // action: type
538
+ // }, "*")
539
+ // */
540
+ // }
532
541
  }
533
542
  const renderSelection = (e, force) => {
534
543
  console.log("# 1")
@@ -823,11 +832,15 @@ renderSelection()
823
832
  console.log("loaded after", loaded)
824
833
  Reporter()
825
834
  document.querySelector("#reload").addEventListener("click", (e) => {
835
+ /*
826
836
  // get selected
827
837
  let target = document.querySelector(".selected").target
828
838
  location.hash = target
829
839
  // force refresh
830
840
  renderSelection(null, true)
841
+ */
842
+ let frame = document.querySelector("iframe:not(.hidden)")
843
+ frame.contentWindow.location.reload();
831
844
  })
832
845
  document.querySelector("#back").addEventListener("click", (e) => {
833
846
  nav("back")