diff --git a/brutaldon/static/css/brutaldon-dark.css b/brutaldon/static/css/brutaldon-dark.css index e043440..2152bff 100644 --- a/brutaldon/static/css/brutaldon-dark.css +++ b/brutaldon/static/css/brutaldon-dark.css @@ -172,3 +172,18 @@ emoji-link 95% {left: 120%;} to {left: 100%;} } + +#status_count +{ + margin-left: 90%; + margin-top: 1rem; + background-color: #888; + color: #FFF; + float: right; + padding: 0.5ex; + border-radius: 5px; + min-height: 1.5rem; + min-width: 1.5rem; + font-size: 0.8em; + text-align: right; +} diff --git a/brutaldon/static/css/brutaldon.css b/brutaldon/static/css/brutaldon.css index 0b3a38c..450a898 100644 --- a/brutaldon/static/css/brutaldon.css +++ b/brutaldon/static/css/brutaldon.css @@ -143,3 +143,18 @@ emoji-link 95% {left: 120%;} to {left: 100%;} } + +#status_count +{ + margin-left: 90%; + margin-top: 1rem; + background-color: #888; + color: #FFF; + float: right; + padding: 0.5ex; + border-radius: 5px; + min-height: 1.5rem; + min-width: 1.5rem; + font-size: 0.8em; + text-align: right; +} diff --git a/brutaldon/static/js/brutaldon-enhancements.js b/brutaldon/static/js/brutaldon-enhancements.js index 6d7099d..957447f 100644 --- a/brutaldon/static/js/brutaldon-enhancements.js +++ b/brutaldon/static/js/brutaldon-enhancements.js @@ -130,3 +130,19 @@ function fileButtonUpdaters() }; } + +function characterCountSetup() +{ + $("#status_count").text(characterCount()); + $("#id_status").keyup(function(){ + $("#status_count").text(characterCount()); + }); + $("#id_spoiler_text").keyup(function(){ + $("#status_count").text(characterCount()); + }); +} + +function characterCount() +{ + return $("#id_status").val().length + $("#id_spoiler_text").val().length; +} diff --git a/brutaldon/templates/main/post_minimal_partial.html b/brutaldon/templates/main/post_minimal_partial.html index d1bd963..3745583 100644 --- a/brutaldon/templates/main/post_minimal_partial.html +++ b/brutaldon/templates/main/post_minimal_partial.html @@ -19,6 +19,7 @@