From f7a80da21b8941b1af61ecad6faf6352d761e447 Mon Sep 17 00:00:00 2001 From: Cutls Date: Thu, 21 Mar 2019 23:38:15 +0900 Subject: [PATCH] Uncrop setting --- app/css/tl.css | 1 + app/js/common/keyshortcut.js | 1 + app/js/tl/parse.js | 7 ++++++- app/language.js | 4 ++-- app/main.js | 2 +- app/view/make/language/setting.en.json | 1 + app/view/make/language/setting.ja.json | 1 + app/view/make/setting.sample.js | 2 +- 8 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/css/tl.css b/app/css/tl.css index 8b6934b9..5a12900b 100644 --- a/app/css/tl.css +++ b/app/css/tl.css @@ -275,6 +275,7 @@ grid-area: toot; .toot-img { object-fit: cover; width: 100%; + margin-right:1px; } .toot img:not(.emoji-img) { max-width: 100%; diff --git a/app/js/common/keyshortcut.js b/app/js/common/keyshortcut.js index 01bd2047..cf505ab1 100644 --- a/app/js/common/keyshortcut.js +++ b/app/js/common/keyshortcut.js @@ -92,6 +92,7 @@ $(function($) { if (e.keyCode === 88) { if (!$("#post-box").hasClass("appear")) { show(); + $('textarea').focus(); } else { hide(); } diff --git a/app/js/tl/parse.js b/app/js/tl/parse.js index 0aff8314..b29c91f3 100644 --- a/app/js/tl/parse.js +++ b/app/js/tl/parse.js @@ -33,6 +33,11 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { var ltr = localStorage.getItem("letters"); var gif = localStorage.getItem("gif"); var imh = localStorage.getItem("img-height"); + if(imh=="full"){ + imh="auto"; + }else{ + imh=imh+"px"; + } //独自ロケール var locale = localStorage.getItem("locale"); if(locale=="yes"){ @@ -510,7 +515,7 @@ function parse(obj, mix, acct_id, tlid, popup, mutefilter, type) { acct_id + '\')" id="' + id + '-image-' + key2 + '" data-url="' + url + '" data-type="' + media.type + '" class="img-parsed">'; + ' toot-img pointer" style="width:calc(' + cwdt + '% - 1px); height:'+imh+';">'; }); media_ids = media_ids.slice(0, -1) ; } else { diff --git a/app/language.js b/app/language.js index 4ed5df0d..92d547d4 100644 --- a/app/language.js +++ b/app/language.js @@ -1,5 +1,5 @@ // Create the Application's main menu -function templete(lang,mainWindow){ +function templete(lang,mainWindow,packaged){ const electron = require("electron"); const app = electron.app; const BrowserWindow = electron.BrowserWindow; @@ -95,7 +95,7 @@ function templete(lang,mainWindow){ { label: 'Toggle Developer Tools', accelerator: 'Alt+Command+I', - click: function() { mainWindow.toggleDevTools(); } + click: function() { if(!packaged){mainWindow.toggleDevTools();} } }, { label: dict.reload[lang], diff --git a/app/main.js b/app/main.js index dc169bbc..c555156d 100644 --- a/app/main.js +++ b/app/main.js @@ -138,7 +138,7 @@ function createWindow() { var platform=process.platform; var bit=process.arch; if(platform=="darwin"){ - Menu.setApplicationMenu(Menu.buildFromTemplate(language.template(lang,mainWindow))); + Menu.setApplicationMenu(Menu.buildFromTemplate(language.template(lang,mainWindow,false))); } } // Electronの初期化完了後に実行 diff --git a/app/view/make/language/setting.en.json b/app/view/make/language/setting.en.json index 7d04373d..08cc2a60 100644 --- a/app/view/make/language/setting.en.json +++ b/app/view/make/language/setting.en.json @@ -81,6 +81,7 @@ "letters":"letters", "or":"or", "imgheight":"Height of images", + "imgheightwarn":"Option:Set \"full\" to uncrop.", "ticker":"Enable #InstanceTicker", "tickerwarn":"Show colorful stickers about the server. About #InstanceTicker Copyright 2018 weepjp, kyori19.", "animation":"Animation of timelines", diff --git a/app/view/make/language/setting.ja.json b/app/view/make/language/setting.ja.json index f197cf22..4e0cc760 100644 --- a/app/view/make/language/setting.ja.json +++ b/app/view/make/language/setting.ja.json @@ -81,6 +81,7 @@ "letters":"文字", "or":"または", "imgheight":"画像の高さ", + "imgheightwarn":"オプション:「full」と指定すると全ての画像をクロップしません。", "ticker":"#InstanceTickerを使う", "tickerwarn":"トゥートした人の所属サーバーをわかりやすく彩ります(自サーバー以外のトゥート向け)。#InstanceTickerについて Copyright 2018 weepjp, kyori19.", "animation":"タイムラインのアニメーション", diff --git a/app/view/make/setting.sample.js b/app/view/make/setting.sample.js index 9f50f729..526862d0 100644 --- a/app/view/make/setting.sample.js +++ b/app/view/make/setting.sample.js @@ -263,7 +263,7 @@ var tlConstruction=[ setValue:200, text:{ head:"@@imgheight@@", - desc:"", + desc:'@@imgheightwarn@@', after:"px" } },{