瀏覽代碼

JS enhancements to encourage bottom-posting

master
Drew DeVault 3 年之前
父節點
當前提交
51498a2dc3
共有 2 個檔案被更改,包括 9 行新增0 行删除
  1. +1
    -0
      plugins/base/smtp.go
  2. +8
    -0
      themes/alps/assets/compose.js

+ 1
- 0
plugins/base/smtp.go 查看文件

@@ -26,6 +26,7 @@ func quote(r io.Reader) (string, error) {
if err := scanner.Err(); err != nil {
return "", fmt.Errorf("quote: failed to read original message: %s", err)
}
builder.WriteString("\n")
return builder.String(), nil
}



+ 8
- 0
themes/alps/assets/compose.js 查看文件

@@ -1,3 +1,11 @@
const textarea = document.querySelector("textarea.body");
if (window.location.pathname.endsWith("/reply")) {
// Auto-focus body and scroll to bottom
textarea.focus();
textarea.setSelectionRange(textarea.value.length, textarea.value.length);
textarea.scrollTop = textarea.scrollHeight;
}

const sendButton = document.getElementById("send-button"),
saveButton = document.getElementById("save-button");



Loading…
取消
儲存