pinokiod 3.74.0 → 3.76.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/index.js +0 -3
- package/server/public/common.js +41 -0
- package/server/public/style.css +4 -0
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -1574,7 +1574,6 @@ class Server {
|
|
|
1574
1574
|
// let list = this.getPeerInfo()
|
|
1575
1575
|
let list = this.getPeers()
|
|
1576
1576
|
|
|
1577
|
-
console.log("agent", req.agent)
|
|
1578
1577
|
if (meta) {
|
|
1579
1578
|
items = running.concat(notRunning)
|
|
1580
1579
|
res.render("index", {
|
|
@@ -2946,13 +2945,11 @@ class Server {
|
|
|
2946
2945
|
|
|
2947
2946
|
this.app.use((req, res, next) => {
|
|
2948
2947
|
const userAgent = req.get('User-Agent') || '';
|
|
2949
|
-
console.log("userAgent", userAgent)
|
|
2950
2948
|
if (userAgent.includes("Pinokio")) {
|
|
2951
2949
|
req.agent = "electron"
|
|
2952
2950
|
} else {
|
|
2953
2951
|
req.agent = "web"
|
|
2954
2952
|
}
|
|
2955
|
-
console.log("req.agent", req.agent)
|
|
2956
2953
|
next();
|
|
2957
2954
|
})
|
|
2958
2955
|
|
package/server/public/common.js
CHANGED
|
@@ -470,11 +470,52 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
470
470
|
});
|
|
471
471
|
|
|
472
472
|
function openDropdown() {
|
|
473
|
+
const isMinimized = document.body.classList.contains('minimized');
|
|
474
|
+
|
|
475
|
+
if (isMinimized) {
|
|
476
|
+
// Create a portal container for centered positioning
|
|
477
|
+
let portal = document.getElementById('dropdown-portal');
|
|
478
|
+
if (!portal) {
|
|
479
|
+
portal = document.createElement('div');
|
|
480
|
+
portal.id = 'dropdown-portal';
|
|
481
|
+
portal.style.cssText = `
|
|
482
|
+
position: fixed;
|
|
483
|
+
top: 0;
|
|
484
|
+
left: 0;
|
|
485
|
+
width: 100%;
|
|
486
|
+
height: 100%;
|
|
487
|
+
display: flex;
|
|
488
|
+
justify-content: center;
|
|
489
|
+
align-items: center;
|
|
490
|
+
z-index: 1000000000;
|
|
491
|
+
pointer-events: none;
|
|
492
|
+
`;
|
|
493
|
+
document.body.appendChild(portal);
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
// Move dropdown to portal and make it visible
|
|
497
|
+
portal.appendChild(dropdownContent);
|
|
498
|
+
dropdownContent.style.position = 'static';
|
|
499
|
+
dropdownContent.style.pointerEvents = 'auto';
|
|
500
|
+
}
|
|
501
|
+
|
|
473
502
|
dropdownContent.classList.add('show');
|
|
474
503
|
dropdown.classList.add('active');
|
|
475
504
|
}
|
|
476
505
|
|
|
477
506
|
function closeDropdown() {
|
|
507
|
+
const isMinimized = document.body.classList.contains('minimized');
|
|
508
|
+
|
|
509
|
+
if (isMinimized) {
|
|
510
|
+
// Move dropdown back to original container
|
|
511
|
+
const portal = document.getElementById('dropdown-portal');
|
|
512
|
+
if (portal && dropdownContent.parentElement === portal) {
|
|
513
|
+
dropdown.appendChild(dropdownContent);
|
|
514
|
+
dropdownContent.style.position = '';
|
|
515
|
+
dropdownContent.style.pointerEvents = '';
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
|
|
478
519
|
dropdownContent.classList.remove('show');
|
|
479
520
|
dropdown.classList.remove('active');
|
|
480
521
|
}
|