pinokiod 3.49.0 → 3.50.0
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 +1 -1
- package/server/views/columns.ejs +13 -16
- package/server/views/rows.ejs +13 -0
package/package.json
CHANGED
package/server/views/columns.ejs
CHANGED
|
@@ -13,6 +13,18 @@ body {
|
|
|
13
13
|
display: grid;
|
|
14
14
|
grid-template-columns: var(--col0, 1fr) 6px var(--col1, 1fr);
|
|
15
15
|
gap: 0px;
|
|
16
|
+
position: relative;
|
|
17
|
+
}
|
|
18
|
+
#dragger {
|
|
19
|
+
-webkit-app-region: drag;
|
|
20
|
+
cursor: drag;
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: 0;
|
|
23
|
+
left: 0;
|
|
24
|
+
right: 0;
|
|
25
|
+
height: 20px;
|
|
26
|
+
width: 100%;
|
|
27
|
+
z-index: 1000000000000;
|
|
16
28
|
}
|
|
17
29
|
body iframe {
|
|
18
30
|
border: none;
|
|
@@ -57,6 +69,7 @@ body.resizing {
|
|
|
57
69
|
<script src="/window_storage.js"></script>
|
|
58
70
|
</head>
|
|
59
71
|
<body class='<%=theme%>'>
|
|
72
|
+
<div id='dragger'></div>
|
|
60
73
|
<iframe id='col0' data-src="<%=src%>"></iframe>
|
|
61
74
|
<div id="gutter" class="gutter" tabindex="0" role="separator" aria-orientation="vertical" aria-label="Resize panels" aria-valuemin="120" aria-valuemax="0" aria-valuenow="0"></div>
|
|
62
75
|
<iframe id='col1' data-src="<%=src%>"></iframe>
|
|
@@ -82,7 +95,6 @@ body.resizing {
|
|
|
82
95
|
const urlKeyFor = (paneName) => `paneUrl:${paneName}`;
|
|
83
96
|
|
|
84
97
|
function setColumns(leftPx) {
|
|
85
|
-
console.log("setColumns", leftPx)
|
|
86
98
|
document.body.style.gridTemplateColumns = `${leftPx}px ${GUTTER}px 1fr`;
|
|
87
99
|
}
|
|
88
100
|
|
|
@@ -109,7 +121,6 @@ body.resizing {
|
|
|
109
121
|
}
|
|
110
122
|
|
|
111
123
|
function applyFromRatio(ratio) {
|
|
112
|
-
console.log("applyFromRatio", ratio)
|
|
113
124
|
const total = computeTotal();
|
|
114
125
|
let leftPx = clamp(Math.round(total * ratio), MIN, total - MIN);
|
|
115
126
|
setColumns(leftPx);
|
|
@@ -171,10 +182,8 @@ body.resizing {
|
|
|
171
182
|
let overlay = null;
|
|
172
183
|
|
|
173
184
|
function refreshLayout (splitKey) {
|
|
174
|
-
console.log("refreshLayout", splitKey)
|
|
175
185
|
let val = windowStorage.getItem(splitKey)
|
|
176
186
|
let id = splitKey.replace("splitRatio:", "")
|
|
177
|
-
console.log({ id, val })
|
|
178
187
|
if (val === "1" || val === "0") {
|
|
179
188
|
if (val === "1") {
|
|
180
189
|
id_to_hide = id + ".1"
|
|
@@ -187,20 +196,15 @@ body.resizing {
|
|
|
187
196
|
document.querySelector("#gutter").remove()
|
|
188
197
|
}
|
|
189
198
|
let existing_iframe = document.querySelector("iframe")
|
|
190
|
-
console.log("1")
|
|
191
199
|
if (existing_iframe) {
|
|
192
|
-
console.log("2")
|
|
193
200
|
document.body.className = "single"
|
|
194
201
|
} else {
|
|
195
|
-
console.log("3")
|
|
196
202
|
if (window.parent) {
|
|
197
|
-
console.log("4")
|
|
198
203
|
// if all child iframes have been removed, remove self
|
|
199
204
|
window.parent.postMessage({
|
|
200
205
|
e: "close"
|
|
201
206
|
}, "*")
|
|
202
207
|
} else {
|
|
203
|
-
console.log("5")
|
|
204
208
|
// if this is the top window, everything has been removed, so just redirect to home
|
|
205
209
|
location.href = "/"
|
|
206
210
|
}
|
|
@@ -286,17 +290,13 @@ body.resizing {
|
|
|
286
290
|
// Initialize from saved ratio if available and set ARIA
|
|
287
291
|
try {
|
|
288
292
|
const saved = parseFloat(windowStorage.getItem(splitKey) || '');
|
|
289
|
-
console.log({ saved })
|
|
290
293
|
if (!Number.isNaN(saved) && saved > 0 && saved < 1) {
|
|
291
|
-
console.log("> 1")
|
|
292
294
|
applyFromRatio(saved);
|
|
293
295
|
} else {
|
|
294
|
-
console.log("> 2")
|
|
295
296
|
updateAria(left.getBoundingClientRect().width, computeTotal());
|
|
296
297
|
refreshLayout(splitKey)
|
|
297
298
|
}
|
|
298
299
|
} catch (_) {
|
|
299
|
-
console.log("> 3")
|
|
300
300
|
updateAria(left.getBoundingClientRect().width, computeTotal());
|
|
301
301
|
}
|
|
302
302
|
|
|
@@ -334,11 +334,8 @@ body.resizing {
|
|
|
334
334
|
return
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
-
console.log('Message received from iframe:', sourceFrameId);
|
|
338
|
-
|
|
339
337
|
// Or use this approach to loop through all iframes
|
|
340
338
|
const iframes = document.querySelectorAll('iframe');
|
|
341
|
-
console.log({ splitKey })
|
|
342
339
|
for (let iframe of iframes) {
|
|
343
340
|
if (event.source === iframe.contentWindow) {
|
|
344
341
|
if (iframe.id === "col0") {
|
package/server/views/rows.ejs
CHANGED
|
@@ -13,6 +13,18 @@ body {
|
|
|
13
13
|
display: grid;
|
|
14
14
|
grid-template-rows: var(--row0, 1fr) 6px var(--row1, 1fr);
|
|
15
15
|
gap: 0px;
|
|
16
|
+
position: relative;
|
|
17
|
+
}
|
|
18
|
+
#dragger {
|
|
19
|
+
-webkit-app-region: drag;
|
|
20
|
+
cursor: drag;
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: 0;
|
|
23
|
+
left: 0;
|
|
24
|
+
right: 0;
|
|
25
|
+
height: 20px;
|
|
26
|
+
width: 100%;
|
|
27
|
+
z-index: 1000000000000;
|
|
16
28
|
}
|
|
17
29
|
body iframe {
|
|
18
30
|
border: none;
|
|
@@ -57,6 +69,7 @@ body.resizing {
|
|
|
57
69
|
<script src="/window_storage.js"></script>
|
|
58
70
|
</head>
|
|
59
71
|
<body class='<%=theme%>'>
|
|
72
|
+
<div id='dragger'></div>
|
|
60
73
|
<iframe id='row0' data-src="<%=src%>"></iframe>
|
|
61
74
|
<div id="gutter" class="gutter" tabindex="0" role="separator" aria-orientation="horizontal" aria-label="Resize panels" aria-valuemin="120" aria-valuemax="0" aria-valuenow="0"></div>
|
|
62
75
|
<iframe id='row1' data-src="<%=src%>"></iframe>
|