diff options
author | Arno Richter <oelna@oelna.de> | 2022-12-21 15:05:28 +0100 |
---|---|---|
committer | Arno Richter <oelna@oelna.de> | 2022-12-21 15:05:28 +0100 |
commit | 482fd7adee5e9e0990bf5904ed7d754d315de649 (patch) | |
tree | 7523a6f3482b6cb024624310f21fa7eeb05e9866 /microblog.js | |
parent | 057cace8b32e6c3d105695b517eae262071601f4 (diff) | |
download | microblog-482fd7adee5e9e0990bf5904ed7d754d315de649.tar.gz microblog-482fd7adee5e9e0990bf5904ed7d754d315de649.tar.bz2 microblog-482fd7adee5e9e0990bf5904ed7d754d315de649.zip |
first attempt at image attachments!
Diffstat (limited to 'microblog.js')
-rw-r--r-- | microblog.js | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/microblog.js b/microblog.js deleted file mode 100644 index 03e8d11..0000000 --- a/microblog.js +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; - -const textarea = document.querySelector('textarea[name="content"]'); -const charCount = document.querySelector('#count'); - -if (textarea) { - const maxCount = parseInt(textarea.getAttribute('maxlength')); - - if (textarea.value.length > 0) { - const textLength = [...textarea.value].length; - charCount.textContent = maxCount - textLength; - } else { - charCount.textContent = maxCount; - } - - textarea.addEventListener('input', function () { - const textLength = [...this.value].length; - - charCount.textContent = maxCount - textLength; - }, false); -} |