From 46fba195dae72eea0100f2a7c1a7c8e50d9a8560 Mon Sep 17 00:00:00 2001 From: Tamas Kocsis Date: Fri, 4 Sep 2020 17:57:56 +0200 Subject: [PATCH] Merge js, css --- src/Ui/media/all.css | 5 +++-- src/Ui/media/all.js | 23 +++++++++++++++-------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/Ui/media/all.css b/src/Ui/media/all.css index 6e4173c2..8f4b459c 100644 --- a/src/Ui/media/all.css +++ b/src/Ui/media/all.css @@ -123,13 +123,14 @@ a { color: black } /* Infopanel */ +.infopanel-container { width: 100%; height: 100%; overflow: hidden; position: absolute; display: none; } +.infopanel-container.visible { display: block; } .infopanel { - position: absolute; z-index: 999; padding: 15px 15px; bottom: 25px; right: 50px; border: 1px solid #eff3fe; display: none; + position: absolute; z-index: 999; padding: 15px 15px; bottom: 25px; right: 50px; border: 1px solid #eff3fe; font-family: 'Lucida Grande', 'Segoe UI', Helvetica, Arial, sans-serif; -webkit-box-shadow: 0px 10px 55px rgba(58, 39, 176, 0.17); -moz-box-shadow: 0px 10px 55px rgba(58, 39, 176, 0.17); -o-box-shadow: 0px 10px 55px rgba(58, 39, 176, 0.17); -ms-box-shadow: 0px 10px 55px rgba(58, 39, 176, 0.17); box-shadow: 0px 10px 55px rgba(58, 39, 176, 0.17) ; background-color: white; border-left: 4px solid #9a61f8; border-top-left-radius: 4px; border-bottom-left-radius: 4px; -webkit-transition: all 0.8s cubic-bezier(0.215, 0.61, 0.355, 1); -moz-transition: all 0.8s cubic-bezier(0.215, 0.61, 0.355, 1); -o-transition: all 0.8s cubic-bezier(0.215, 0.61, 0.355, 1); -ms-transition: all 0.8s cubic-bezier(0.215, 0.61, 0.355, 1); transition: all 0.8s cubic-bezier(0.215, 0.61, 0.355, 1) ; } -.infopanel.visible { display: block; } .infopanel.closed { -webkit-box-shadow: none; -moz-box-shadow: none; -o-box-shadow: none; -ms-box-shadow: none; box-shadow: none ; -webkit-transform: translateX(100%); -moz-transform: translateX(100%); -o-transform: translateX(100%); -ms-transform: translateX(100%); transform: translateX(100%) ; right: 0px; cursor: pointer; } .infopanel .message { font-size: 13px; line-height: 15px; display: inline-block; vertical-align: -9px; } .infopanel .message .line { max-width: 200px; display: inline-block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } diff --git a/src/Ui/media/all.js b/src/Ui/media/all.js index 47d94f9c..de9ecd79 100644 --- a/src/Ui/media/all.js +++ b/src/Ui/media/all.js @@ -556,7 +556,7 @@ $.extend( $.easing, if (closed == null) { closed = false; } - this.elem.addClass("visible"); + this.elem.parent().addClass("visible"); if (closed) { return this.close(); } else { @@ -585,7 +585,7 @@ $.extend( $.easing, }; Infopanel.prototype.hide = function() { - return this.elem.removeClass("visible"); + return this.elem.parent().removeClass("visible"); }; Infopanel.prototype.close = function() { @@ -635,13 +635,14 @@ $.extend( $.easing, this.showScreen(); } this.timer_hide = null; + this.timer_set = null; } Loading.prototype.setProgress = function(percent) { if (this.timer_hide) { clearInterval(this.timer_hide); } - return RateLimit(500, function() { + return this.timer_set = RateLimit(500, function() { return $(".progressbar").css({ "transform": "scaleX(" + (parseInt(percent * 100) / 100) + ")" }).css("opacity", "1").css("display", "block"); @@ -650,6 +651,9 @@ $.extend( $.easing, Loading.prototype.hideProgress = function() { this.log("hideProgress"); + if (this.timer_set) { + clearInterval(this.timer_set); + } return this.timer_hide = setTimeout(((function(_this) { return function() { return $(".progressbar").css({ @@ -775,6 +779,7 @@ $.extend( $.easing, }).call(this); + /* ---- Notifications.coffee ---- */ @@ -971,6 +976,7 @@ $.extend( $.easing, this.opener_tested = false; this.announcer_line = null; this.web_notifications = {}; + this.is_title_changed = false; this.allowed_event_constructors = [window.MouseEvent, window.KeyboardEvent, window.PointerEvent]; window.onload = this.onPageLoad; window.onhashchange = (function(_this) { @@ -1147,7 +1153,9 @@ $.extend( $.easing, } else if (cmd === "wrapperSetViewport") { return this.actionSetViewport(message); } else if (cmd === "wrapperSetTitle") { - return $("head title").text(message.params); + this.log("wrapperSetTitle", message.params); + $("head title").text(message.params); + return this.is_title_changed = true; } else if (cmd === "wrapperReload") { return this.actionReload(message); } else if (cmd === "wrapperGetLocalStorage") { @@ -1682,7 +1690,7 @@ $.extend( $.easing, } if (this.ws.ws.readyState === 1 && !this.site_info) { return this.reloadSiteInfo(); - } else if (this.site_info && (((ref = this.site_info.content) != null ? ref.title : void 0) != null)) { + } else if (this.site_info && (((ref = this.site_info.content) != null ? ref.title : void 0) != null) && !this.is_title_changed) { window.document.title = this.site_info.content.title + " - ZeroNet"; return this.log("Setting title to", window.document.title); } @@ -1724,7 +1732,7 @@ $.extend( $.easing, }); }); } - if (((ref = site_info.content) != null ? ref.title : void 0) != null) { + if ((((ref = site_info.content) != null ? ref.title : void 0) != null) && !_this.is_title_changed) { window.document.title = site_info.content.title + " - ZeroNet"; return _this.log("Setting title to", window.document.title); } @@ -1744,7 +1752,7 @@ $.extend( $.easing, if (!this.site_info) { this.reloadSiteInfo(); } - if (site_info.content) { + if (site_info.content && !this.is_title_changed) { window.document.title = site_info.content.title + " - ZeroNet"; this.log("Required file " + window.file_inner_path + " done, setting title to", window.document.title); } @@ -1996,7 +2004,6 @@ $.extend( $.easing, }).call(this); - /* ---- WrapperZeroFrame.coffee ---- */