diff --git a/app/css/post.css b/app/css/post.css index 9a1a8fc8..ee29ba6b 100644 --- a/app/css/post.css +++ b/app/css/post.css @@ -7,10 +7,10 @@ background-color: var(--postbox); border: thin solid gray; z-index: 501; - min-width: 300px; max-width: 100%; padding: 5px; border-radius: 5px; + overflow: hidden; } textarea { min-height: 100px !important; @@ -108,13 +108,18 @@ textarea { } #left-side { float: left; - width: 300px; + overflow-y: scroll; + overflow-x: hidden; + height: calc(100% - 32px); } #right-side { display: none; float: left; width: 300px; padding: 5px; + overflow-y: scroll; + overflow-x: hidden; + height: calc(100% - 32px); } #poll { } diff --git a/app/css/tl.css b/app/css/tl.css index abfb79ea..77f37184 100644 --- a/app/css/tl.css +++ b/app/css/tl.css @@ -285,11 +285,12 @@ iframe, text-overflow: ellipsis; overflow: hidden; } -.area-additional.acct-note p:not(:first-child) { +.area-toot.acct-note p:not(:first-child) { display: none; } -.area-additional.acct-note p:first-child:after { +.area-toot.acct-note p:first-child:after { content: "..."; + color: var(--gray) } .area-actions { diff --git a/app/js/post/emoji.js b/app/js/post/emoji.js index fdfa77ec..0ff2b131 100644 --- a/app/js/post/emoji.js +++ b/app/js/post/emoji.js @@ -13,6 +13,13 @@ function emojiToggle(reaction) { if ($("#emoji").hasClass("hide")) { $("#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") $("#suggest").html(""); if (!localStorage.getItem("emoji_" + acct_id)) { var html = @@ -23,9 +30,16 @@ function emojiToggle(reaction) { } } else { $("#poll").addClass("hide") + $("#right-side").hide() + $("#right-side").css("width", "300px") $("#emoji").addClass("hide") $("#suggest").html(""); - $("#right-side").hide() + $("#left-side").css("width","100%") + var width = localStorage.getItem("postbox-width").replace("px", "") * 1; + if (!width) { + width = 300 + } + $("#post-box").css("width", width + "px") } diff --git a/app/js/post/suggest.js b/app/js/post/suggest.js index a58a9dd6..a829f890 100644 --- a/app/js/post/suggest.js +++ b/app/js/post/suggest.js @@ -18,6 +18,13 @@ input.addEventListener("focus", function () { $("#suggest").html(""); if ($("#poll").hasClass("hide") && $("#emoji").hasClass("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) { + width = 300 + } + $("#post-box").css("width", width + "px") } return; } @@ -42,11 +49,25 @@ input.addEventListener("focus", function () { } if (ehtml != "") { $("#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) { + width = 600 + } + $("#post-box").css("width", width + "px") $("#poll").addClass("hide") $("#emoji").addClass("hide") } else { if ($("#poll").hasClass("hide") && $("#emoji").hasClass("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) { + width = 300 + } + $("#post-box").css("width", width + "px") } } $("#suggest").html(ehtml); @@ -62,6 +83,13 @@ input.addEventListener("focus", function () { $("#suggest").html(""); if ($("#poll").hasClass("hide") && $("#emoji").hasClass("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) { + width = 300 + } + $("#post-box").css("width", width + "px") } return; } @@ -119,6 +147,13 @@ input.addEventListener("focus", function () { }); $("#suggest").html(ins); $("#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) { + width = 600 + } + $("#post-box").css("width", width + "px") $("#poll").addClass("hide") $("#emoji").addClass("hide") } @@ -132,12 +167,26 @@ 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) { + width = 600 + } + $("#post-box").css("width", width + "px") $("#suggest").html(accts); $("#poll").addClass("hide") $("#emoji").addClass("hide") } else { if ($("#poll").hasClass("hide") && $("#emoji").hasClass("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) { + width = 300 + } + $("#post-box").css("width", width + "px") } } }); @@ -172,6 +221,13 @@ function tagInsert(code, del) { $("#textarea").focus(); if ($("#poll").hasClass("hide") && $("#emoji").hasClass("hide")) { $("#right-side").hide() + $("#right-side").css("width", "300px") + $("#left-side").css("width", "50%") + var width = localStorage.getItem("postbox-width").replace("px", "") * 1; + if (!width) { + width = 300 + } + $("#post-box").css("width", width + "px") } $("#suggest").html(""); } diff --git a/app/js/tl/parse.js b/app/js/tl/parse.js index c08a3240..550cf074 100644 --- a/app/js/tl/parse.js +++ b/app/js/tl/parse.js @@ -1039,7 +1039,7 @@ function userparse(obj, auth, acct_id, tlid, popup) { toot.acct + locked + '' + '' + '' + - '
' + toot.note.replace(/.+/g, "...") + '
' + + '
' + toot.note.replace(/.+/g, '...') + '
' + '
' + lang.lang_status_follow + ':' + toot.following_count + '
' + lang.lang_status_followers + ':' + toot.followers_count + diff --git a/app/js/tl/poll.js b/app/js/tl/poll.js index 03bd218d..f81ae580 100644 --- a/app/js/tl/poll.js +++ b/app/js/tl/poll.js @@ -2,9 +2,23 @@ function pollToggle() { if ($("#poll").hasClass("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") $("#poll").removeClass("hide") } else { $("#right-side").hide() + $("#left-side").css("width", "100%") + $("#right-side").css("width", "300px") + var width = localStorage.getItem("postbox-width").replace("px", "") * 1; + if (!width) { + width = 300 + } + $("#post-box").css("width", width + "px") $("#emoji").addClass("hide") $("#poll").addClass("hide") } diff --git a/app/js/ui/post-box.js b/app/js/ui/post-box.js index 54d68871..6cd2369f 100644 --- a/app/js/ui/post-box.js +++ b/app/js/ui/post-box.js @@ -2,6 +2,13 @@ //✕隠す 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) { + width = 300 + } + $("#post-box").css("width", width) $('#post-box').fadeOut() $("#post-box").removeClass("appear") $("#emoji").addClass("hide") @@ -38,6 +45,16 @@ function show() { } $('#post-box').css("left", left + "px") $('#post-box').css("top", top + "px") + var height = localStorage.getItem("postbox-height"); + var width = localStorage.getItem("postbox-width"); + if (height) { + $('#post-box').css("height", height + "px") + } + if (width) { + $('#post-box').css("width", width + "px") + } else { + $('#post-box').css("width", "300px") + } $('#post-box').fadeIn(); $('#textarea').characterCounter(); } @@ -62,6 +79,14 @@ $(function () { localStorage.setItem("postbox-top", top); } }); + $("#post-box").resizable({ + minHeight: 150, + minWidth: 100, + stop: function (event, ui) { + localStorage.setItem("postbox-height", ui.size.height); + localStorage.setItem("postbox-width", ui.size.width); + } + }); }); //コード受信 diff --git a/app/package.json b/app/package.json index fbeca077..8d2c7055 100644 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "thedesk", - "version": "18.8.3", + "version": "18.9.0", "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 85e202bb..2f0b8f1f 100644 --- a/app/view/make/index.sample.html +++ b/app/view/make/index.sample.html @@ -54,12 +54,12 @@
- +
-
+
@@ -135,7 +135,7 @@ Edit
-
+
@@ -679,20 +679,25 @@ HP
GitHub

-