From 2b84a27cdc33608d5712845aaa1ac057e5ae490c Mon Sep 17 00:00:00 2001 From: Cutls Date: Sun, 1 Sep 2019 21:27:18 +0900 Subject: [PATCH] TheDesk Usain (18.9.2) --- app/js/post/emoji.js | 28 ++++++++++++---------- app/js/post/suggest.js | 42 ++++++++++++++++++++++----------- app/js/tl/poll.js | 12 ++++++---- app/js/ui/post-box.js | 7 ++++-- app/package.json | 2 +- app/view/make/index.sample.html | 10 ++++---- app/view/make/make.js | 2 +- 7 files changed, 65 insertions(+), 38 deletions(-) diff --git a/app/js/post/emoji.js b/app/js/post/emoji.js index 0ff2b131..3f9ecd58 100644 --- a/app/js/post/emoji.js +++ b/app/js/post/emoji.js @@ -14,12 +14,14 @@ function emojiToggle(reaction) { $("#emoji").removeClass("hide") $("#right-side").show() $("#right-side").css("width", "300px") - $("#left-side").css("width","calc(100% - 300px)") - var width = localStorage.getItem("postbox-width").replace("px", "") * 1 + 300; - if (!width) { - width = 600 - } - $("#post-box").css("width", width + "px") + $("#left-side").css("width", "calc(100% - 300px)") + var width = localStorage.getItem("postbox-width"); + if (width) { + width = width.replace("px", "") * 1 + 300 + } else { + width = 600 + } + $("#post-box").css("width", width + "px") $("#suggest").html(""); if (!localStorage.getItem("emoji_" + acct_id)) { var html = @@ -34,12 +36,14 @@ function emojiToggle(reaction) { $("#right-side").css("width", "300px") $("#emoji").addClass("hide") $("#suggest").html(""); - $("#left-side").css("width","100%") - var width = localStorage.getItem("postbox-width").replace("px", "") * 1; - if (!width) { - width = 300 - } - $("#post-box").css("width", width + "px") + $("#left-side").css("width", "100%") + var width = localStorage.getItem("postbox-width"); + if (width) { + width = width.replace("px", "") * 1 + } else { + width = 300 + } + $("#post-box").css("width", width + "px") } diff --git a/app/js/post/suggest.js b/app/js/post/suggest.js index 3b407b7a..b8f97405 100644 --- a/app/js/post/suggest.js +++ b/app/js/post/suggest.js @@ -20,8 +20,10 @@ input.addEventListener("focus", function () { $("#right-side").hide() $("#right-side").css("width", "300px") $("#left-side").css("width", "100%") - var width = localStorage.getItem("postbox-width").replace("px", "") * 1; - if (!width) { + var width = localStorage.getItem("postbox-width"); + if (width) { + width = width.replace("px", "") * 1 + } else { width = 300 } $("#post-box").css("width", width + "px") @@ -51,8 +53,10 @@ input.addEventListener("focus", function () { $("#right-side").show() $("#right-side").css("width", "200px") $("#left-side").css("width", "calc(100% - 200px)") - var width = localStorage.getItem("postbox-width").replace("px", "") * 1 + 200; - if (!width) { + var width = localStorage.getItem("postbox-width"); + if (width) { + width = width.replace("px", "") * 1 + 200 + } else { width = 600 } $("#post-box").css("width", width + "px") @@ -63,8 +67,10 @@ input.addEventListener("focus", function () { $("#right-side").hide() $("#right-side").css("width", "300px") $("#left-side").css("width", "100%") - var width = localStorage.getItem("postbox-width").replace("px", "") * 1; - if (!width) { + var width = localStorage.getItem("postbox-width"); + if (width) { + width = width.replace("px", "") * 1 + } else { width = 300 } $("#post-box").css("width", width + "px") @@ -85,8 +91,10 @@ input.addEventListener("focus", function () { $("#right-side").hide() $("#right-side").css("width", "300px") $("#left-side").css("width", "100%") - var width = localStorage.getItem("postbox-width").replace("px", "") * 1; - if (!width) { + var width = localStorage.getItem("postbox-width"); + if (width) { + width = width.replace("px", "") * 1 + } else { width = 300 } $("#post-box").css("width", width + "px") @@ -149,8 +157,10 @@ input.addEventListener("focus", function () { $("#right-side").show() $("#right-side").css("width", "200px") $("#left-side").css("width", "calc(100% - 200px)") - var width = localStorage.getItem("postbox-width").replace("px", "") * 1 + 200; - if (!width) { + var width = localStorage.getItem("postbox-width"); + if (width) { + width = width.replace("px", "") * 1 + 200 + } else { width = 600 } $("#post-box").css("width", width + "px") @@ -172,8 +182,10 @@ input.addEventListener("focus", function () { $("#right-side").show() $("#right-side").css("width", "200px") $("#left-side").css("width", "calc(100% - 200px)") - var width = localStorage.getItem("postbox-width").replace("px", "") * 1 + 200; - if (!width) { + var width = localStorage.getItem("postbox-width"); + if (width) { + width = width.replace("px", "") * 1 + 200 + } else { width = 600 } $("#post-box").css("width", width + "px") @@ -185,8 +197,10 @@ input.addEventListener("focus", function () { $("#right-side").hide() $("#right-side").css("width", "300px") $("#left-side").css("width", "100%") - var width = localStorage.getItem("postbox-width").replace("px", "") * 1; - if (!width) { + var width = localStorage.getItem("postbox-width"); + if (width) { + width = width.replace("px", "") * 1 + } else { width = 300 } $("#post-box").css("width", width + "px") diff --git a/app/js/tl/poll.js b/app/js/tl/poll.js index eaa6270c..a9e67235 100644 --- a/app/js/tl/poll.js +++ b/app/js/tl/poll.js @@ -4,8 +4,10 @@ function pollToggle() { $("#right-side").show() $("#right-side").css("width", "300px") $("#left-side").css("width", "calc(100% - 300px)") - var width = localStorage.getItem("postbox-width").replace("px", "") * 1 + 300; - if (!width) { + var width = localStorage.getItem("postbox-width"); + if (width) { + width = width.replace("px", "") * 1 + 300 + } else { width = 600 } $("#post-box").css("width", width + "px") @@ -15,8 +17,10 @@ function pollToggle() { $("#right-side").hide() $("#left-side").css("width", "100%") $("#right-side").css("width", "300px") - var width = localStorage.getItem("postbox-width").replace("px", "") * 1; - if (!width) { + var width = localStorage.getItem("postbox-width"); + if (width) { + width = width.replace("px", "") * 1 + } else { width = 300 } $("#post-box").css("width", width + "px") diff --git a/app/js/ui/post-box.js b/app/js/ui/post-box.js index dfdbcf57..2c27ea73 100644 --- a/app/js/ui/post-box.js +++ b/app/js/ui/post-box.js @@ -4,8 +4,10 @@ function hide() { $("#right-side").hide() $("#right-side").css("width", "300px") $("#left-side").css("width", "100%") - var width = localStorage.getItem("postbox-width").replace("px", "") * 1; - if (!width) { + var width = localStorage.getItem("postbox-width"); + if(width){ + width = width.replace("px", "") * 1 + } else { width = 300 } $("#post-box").css("width", width) @@ -79,6 +81,7 @@ $(function () { minHeight: 150, minWidth: 100, stop: function (event, ui) { + $("#textarea").blur() localStorage.setItem("postbox-width", ui.size.width); } }); diff --git a/app/package.json b/app/package.json index 2b5ba5f5..dc2999e4 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "thedesk", - "version": "18.9.1", + "version": "18.9.2", "description": "TheDesk is a Mastodon client for PC.", "repository": "https://github.com/cutls/TheDesk", "main": "main.js", diff --git a/app/view/make/index.sample.html b/app/view/make/index.sample.html index 21fc9925..e25a3de0 100644 --- a/app/view/make/index.sample.html +++ b/app/view/make/index.sample.html @@ -231,9 +231,9 @@
-
+
-
+
@@emojiWarn@@ @@refreshEmoji@@
@@ -288,7 +288,7 @@
-
+
@@ -675,11 +675,13 @@ HP
GitHub

-