|
@@ -721,6 +721,11 @@
|
|
|
width: 100%;
|
|
|
}
|
|
|
|
|
|
+ .disabled{
|
|
|
+ pointer-events: none;
|
|
|
+ opacity: 0.5;
|
|
|
+ }
|
|
|
+
|
|
|
/* Offline blinking warning css */
|
|
|
@-moz-keyframes blink {
|
|
|
0% {
|
|
@@ -1076,11 +1081,12 @@
|
|
|
var downloadMode = false;
|
|
|
var lowMemoryMode = true;
|
|
|
|
|
|
- //Browser detection
|
|
|
+ //Browser and device detection
|
|
|
var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
|
var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
|
|
var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
|
|
|
var isMacOS = (navigator.appVersion.indexOf("Mac")!=-1);
|
|
|
+ var isTouchScreen = (('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0));
|
|
|
|
|
|
//Check and prepare localization
|
|
|
if (applocale){
|
|
@@ -1629,6 +1635,18 @@
|
|
|
closeFloatWindow(this,evt);
|
|
|
});
|
|
|
|
|
|
+ $(".dockleft").off("touchstart").on("touchstart",function(evt){
|
|
|
+ evt.preventDefault();
|
|
|
+ evt.stopImmediatePropagation();
|
|
|
+ dockWindowToLeft($(this).parent().parent().parent());
|
|
|
+ });
|
|
|
+
|
|
|
+ $(".dockright").off("touchstart").on("touchstart",function(evt){
|
|
|
+ evt.preventDefault();
|
|
|
+ evt.stopImmediatePropagation();
|
|
|
+ dockWindowToRight($(this).parent().parent().parent());
|
|
|
+ });
|
|
|
+
|
|
|
//floatWindow events for mouse
|
|
|
$(".maxtoggle").off("mousedown").on("mousedown",function(evt){
|
|
|
evt.preventDefault();
|
|
@@ -1648,6 +1666,18 @@
|
|
|
closeFloatWindow(this,evt);
|
|
|
});
|
|
|
|
|
|
+ $(".dockleft").off("mousedown").on("mousedown",function(evt){
|
|
|
+ evt.preventDefault();
|
|
|
+ evt.stopImmediatePropagation();
|
|
|
+ dockWindowToLeft($(this).parent().parent().parent());
|
|
|
+ });
|
|
|
+
|
|
|
+ $(".dockright").off("mousedown").on("mousedown",function(evt){
|
|
|
+ evt.preventDefault();
|
|
|
+ evt.stopImmediatePropagation();
|
|
|
+ dockWindowToRight($(this).parent().parent().parent());
|
|
|
+ });
|
|
|
+
|
|
|
//Float Window events for resizing
|
|
|
$(".iframewrapper").off("mousedown").on("mousedown", function(evt) {
|
|
|
evt.preventDefault();
|
|
@@ -2092,7 +2122,9 @@
|
|
|
clickDownOffset[0] = clickRatio * originalSize[0];
|
|
|
clickDownOffset[1] = 2;
|
|
|
//Restore the maximize icon
|
|
|
- $(object).find(".maxToogleButton").attr('src', "img/system/max.png")
|
|
|
+ $(object).find(".maxToogleButton").attr('src', "img/system/max.svg");
|
|
|
+ $(object).find(".dockright").removeClass("disabled");
|
|
|
+ $(object).find(".dockleft").removeClass("disabled");
|
|
|
}
|
|
|
|
|
|
$(object).css("left", event.pageX - clickDownOffset[0]);
|
|
@@ -2102,6 +2134,40 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
+ //Dock the window object to left
|
|
|
+ function dockWindowToLeft(object){
|
|
|
+ var originalSize = [$(object).width(), $(object).height(), $(object).offset().left, $(object).offset().top];
|
|
|
+ $(object).attr("orgsize", encodeURIComponent(JSON.stringify(originalSize)));
|
|
|
+ $(object).css({
|
|
|
+ width: "50%",
|
|
|
+ height: "calc(100% - 36px)",
|
|
|
+ left: "0px",
|
|
|
+ right: "auto",
|
|
|
+ top: "0px"
|
|
|
+ });
|
|
|
+ $(object).attr("max", "true");
|
|
|
+ $(object).find(".maxToogleButton").attr('src', "img/system/restore.svg");
|
|
|
+ $(object).find(".dockright").addClass("disabled");
|
|
|
+ $(object).find(".dockleft").addClass("disabled");
|
|
|
+ }
|
|
|
+
|
|
|
+ //Dock the window object to right
|
|
|
+ function dockWindowToRight(object){
|
|
|
+ var originalSize = [$(object).width(), $(object).height(), $(object).offset().left, $(object).offset().top];
|
|
|
+ $(object).attr("orgsize", encodeURIComponent(JSON.stringify(originalSize)));
|
|
|
+ $(object).css({
|
|
|
+ width: "50%",
|
|
|
+ height: "calc(100% - 36px)",
|
|
|
+ right: "0px",
|
|
|
+ left: "auto",
|
|
|
+ top: "0px"
|
|
|
+ });
|
|
|
+ $(object).attr("max", "true");
|
|
|
+ $(object).find(".maxToogleButton").attr('src', "img/system/restore.svg");
|
|
|
+ $(object).find(".dockright").addClass("disabled");
|
|
|
+ $(object).find(".dockleft").addClass("disabled");
|
|
|
+ }
|
|
|
+
|
|
|
function fwup(object, event) {
|
|
|
event = mapEventFromTouch(event);
|
|
|
if (movingWindow) {
|
|
@@ -2119,30 +2185,10 @@
|
|
|
var dockMode = false;
|
|
|
if (event.pageX < 10) {
|
|
|
//Dock to left
|
|
|
- var originalSize = [$(object).width(), $(object).height(), $(object).offset().left, $(object).offset().top];
|
|
|
- $(object).attr("orgsize", encodeURIComponent(JSON.stringify(originalSize)));
|
|
|
- $(object).css({
|
|
|
- width: "50%",
|
|
|
- height: "calc(100% - 36px)",
|
|
|
- left: "0px",
|
|
|
- right: "auto",
|
|
|
- top: "0px"
|
|
|
- });
|
|
|
- $(object).attr("max", "true");
|
|
|
- $(object).find(".maxToogleButton").attr('src', "img/system/restore.png");
|
|
|
+ dockWindowToLeft(object);
|
|
|
} else if (event.pageX > window.innerWidth - 10) {
|
|
|
//Dock to right
|
|
|
- var originalSize = [$(object).width(), $(object).height(), $(object).offset().left, $(object).offset().top];
|
|
|
- $(object).attr("orgsize", encodeURIComponent(JSON.stringify(originalSize)));
|
|
|
- $(object).css({
|
|
|
- width: "50%",
|
|
|
- height: "calc(100% - 36px)",
|
|
|
- right: "0px",
|
|
|
- left: "auto",
|
|
|
- top: "0px"
|
|
|
- });
|
|
|
- $(object).attr("max", "true");
|
|
|
- $(object).find(".maxToogleButton").attr('src', "img/system/restore.png");
|
|
|
+ dockWindowToRight(object);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -2199,7 +2245,9 @@
|
|
|
left: originalSize[2],
|
|
|
top: originalSize[3]
|
|
|
});
|
|
|
- $(fw).find(".maxToogleButton").attr('src', "img/system/max.png");
|
|
|
+ $(fw).find(".maxToogleButton").attr('src', "img/system/max.svg");
|
|
|
+ $(fw).find(".dockright").removeClass("disabled");
|
|
|
+ $(fw).find(".dockleft").removeClass("disabled");
|
|
|
} else {
|
|
|
//Maxmize
|
|
|
var originalSize = [$(fw).width(), $(fw).height(), $(fw).offset().left, $(fw).offset().top];
|
|
@@ -2211,7 +2259,7 @@
|
|
|
top: "0px"
|
|
|
});
|
|
|
$(fw).attr("max", "true");
|
|
|
- $(fw).find(".maxToogleButton").attr('src', "img/system/restore.png")
|
|
|
+ $(fw).find(".maxToogleButton").attr('src', "img/system/restore.svg")
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2456,20 +2504,31 @@
|
|
|
overWriteThemeColor = `background-color: ${hexToRgbA(desktopThemeColor, 0.85)}`;
|
|
|
}
|
|
|
|
|
|
+ //Updates 2022-06-24: Added touch screen docking buttons
|
|
|
+ let dockButtons = `<div class="buttons dockleft">
|
|
|
+ <img src="img/system/dleft.svg"></img>
|
|
|
+ </div>
|
|
|
+ <div class="buttons dockright">
|
|
|
+ <img src="img/system/dright.svg"></img>
|
|
|
+ </div>`;
|
|
|
+ if (!isTouchScreen){
|
|
|
+ dockButtons = "";
|
|
|
+ }
|
|
|
//Append the floatWindow into the body
|
|
|
$("body").append(`<div class="floatWindow" windowId="${uuid}" parent="${parentWindowID}" callback="${callbackFunctionName}" style="z-index:0; width:${width}px; height:${height}px; left:${left}px; top:${top}px;${backgroundStyle}">
|
|
|
<div class="controls fwdragger themeColorSolid" style="${overWriteThemeColor}">
|
|
|
<img class="moduleicon" src="${moduleIcon}"></img>
|
|
|
<div class="title">${title}</div>
|
|
|
<div class="fwcontrol">
|
|
|
- <div class="buttons mintoggle">
|
|
|
- <img src="img/system/min.png"></img>
|
|
|
+ ${dockButtons}
|
|
|
+ <div class="buttons mintoggle" style="margin-left: 1em;">
|
|
|
+ <img src="img/system/min.svg"></img>
|
|
|
</div>
|
|
|
<div class="buttons maxtoggle">
|
|
|
- <img class="maxToogleButton" src="img/system/max.png"></img>
|
|
|
+ <img class="maxToogleButton" src="img/system/max.svg"></img>
|
|
|
</div>
|
|
|
<div class="buttons closetoggle close">
|
|
|
- <img src="img/system/close.png"></img>
|
|
|
+ <img src="img/system/close.svg"></img>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -2613,9 +2672,17 @@
|
|
|
var targetfw = getFloatWindowByID(targetFWId);
|
|
|
if (resizble) {
|
|
|
$(targetfw).find(".maxtoggle").show();
|
|
|
+ if (isTouchScreen){
|
|
|
+ $(targetfw).find(".dockleft").show();
|
|
|
+ $(targetfw).find(".dockright").show();
|
|
|
+ }
|
|
|
$(targetfw).removeClass("fixedsize");
|
|
|
} else {
|
|
|
$(targetfw).find(".maxtoggle").hide();
|
|
|
+ if (isTouchScreen){
|
|
|
+ $(targetfw).find(".dockleft").hide();
|
|
|
+ $(targetfw).find(".dockright").hide();
|
|
|
+ }
|
|
|
$(targetfw).addClass("fixedsize");
|
|
|
}
|
|
|
}
|