t_wの輪郭

Feedlyでフォローするボタン

2020年7月25日

2020/7/25 22:11:00

1:30 就寝
10:00 起床
11:15 コーヒー
11:21 昼食 カレー
11:28 実装開始
12:59 実装完了
13:00 メモを残す
 ✅デライトの編集領域を勝手に広げてみる
 デライトの編集領域を勝手に広げるウェブエクステンションのコード
 実装完了
13:15 休憩
14:00 Workflowyをサイドバーに表示するアドオンを実装開始
15:30 Githubにアップロード、Firefoxのアドオンサイトに登録、メモを残す
16:00 休憩
17:00 夕食 カレー
18:06 散歩
18:50 帰宅
20:00 入浴
20:30 サバゲ準備
22:11 サバゲ準備完了



デライトに書くりもScrapboxに書く方が心理的に軽い。デライト編集領域は狭い
 
Stylusだけだと無理っぽい
html - Is there a way to get a textarea to stretch to fit its content without using PHP or JavaScript? - Stack Overflow
>Not really. This is normally done using javascript.
>there is a good discussion of ways of doing this here...
>Autosizing textarea using Prototype
 
Javascriptを実行できるWebExtensionを探す
→自前のWebExtensionを作ってやってしまう
 セキュリティ的に怖い && プログラミングがしたい

あれ

2020/7/25 16:28:00

目が疲れてきた。一日中ずっと引きこもってパソコンを触っている。ちょっと外出したほうが良さそう。雨降ってるので外出は中止。

<h1>pagescript.js</h1>
let debug = false;
debugLog = debug ? console.log.bind(null, "DEBUG: ") : ()=>{};

document.addEventListener("keydown", (event)=>{
  let textareaArray = Array.from(document.querySelectorAll("textarea"));
  debugLog("on keydown");
  textareaArray.map(textarea=>{
    textarea.style.height = "";
    textarea.style.height = textarea.scrollHeight + "px";
    debugLog("change textarea heigth=>",textarea.style.height);
  })
}, false);