pinokiod 0.1.48 → 0.1.49

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": "0.1.48",
3
+ "version": "0.1.49",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -48,9 +48,7 @@ body.dark aside {
48
48
  aside {
49
49
  display: flex;
50
50
  flex-direction: column;
51
- /*
52
51
  width: 200px;
53
- */
54
52
  overflow: auto;
55
53
  box-sizing: border-box;
56
54
  }
@@ -215,7 +213,8 @@ body.dark .frame-link.selected {
215
213
  /*
216
214
  width: 100%;
217
215
  */
218
- margin-right: 5px;
216
+ word-break: break-word;
217
+ margin-right: 10px;
219
218
  }
220
219
  .frame-link .tab .flexible {
221
220
  min-width: 5px;
@@ -424,16 +423,6 @@ const renderSelection = (e, force) => {
424
423
  document.querySelector(".bar").classList.remove("hidden")
425
424
  let id = getTarget(location.hash.slice(1))
426
425
 
427
- //document.querySelector("#location").innerHTML = id
428
- document.querySelector("#location").innerHTML = location.hash.slice(1)
429
-
430
- if (location.hash.slice(1).startsWith("/")) {
431
- document.querySelector("#open-browser").classList.add("hidden")
432
- } else {
433
- document.querySelector("#open-browser").classList.remove("hidden")
434
- //document.querySelector("#open-browser").href = id
435
- document.querySelector("#open-browser").href = location.hash.slice(1)
436
- }
437
426
 
438
427
  // select the selected link
439
428
  // document.querySelectorAll(".frame-link").forEach((el) => {
@@ -452,7 +441,27 @@ const renderSelection = (e, force) => {
452
441
  }
453
442
  }
454
443
 
444
+
445
+ if (!target) {
446
+ // find target by id
447
+ target = document.querySelector("aside [target='" + id + "']")
448
+ }
449
+
450
+ debugger
455
451
  if (target) {
452
+
453
+ //document.querySelector("#location").innerHTML = id
454
+ document.querySelector("#location").innerHTML = location.hash.slice(1)
455
+
456
+ if (location.hash.slice(1).startsWith("/")) {
457
+ document.querySelector("#open-browser").classList.add("hidden")
458
+ } else {
459
+ document.querySelector("#open-browser").classList.remove("hidden")
460
+ //document.querySelector("#open-browser").href = id
461
+ document.querySelector("#open-browser").href = location.hash.slice(1)
462
+ }
463
+
464
+
456
465
  target.classList.add("selected")
457
466
 
458
467
  // select the iframe
@@ -474,9 +483,9 @@ const renderSelection = (e, force) => {
474
483
  }
475
484
  } else {
476
485
  if (force) {
477
- if (targetFrame.src !== target.href) {
486
+ // if (targetFrame.src !== target.href) {
478
487
  targetFrame.src = target.href
479
- }
488
+ // }
480
489
  }
481
490
  }
482
491
  } else {
@@ -499,6 +508,11 @@ const renderSelection = (e, force) => {
499
508
  document.querySelector("main").appendChild(frame)
500
509
  loaded[target.target] = true
501
510
  }
511
+ } else {
512
+ // couldn't find item,
513
+ // clear the hash
514
+ //
515
+ location.hash = ""
502
516
  }
503
517
  } else {
504
518
  document.querySelector(".bar").classList.add("hidden")