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 @@
{% render_field form.status class+="textarea is-primary mousetrap" rows="3" %}
+
@@ -38,4 +39,9 @@
+ {% if not preferences.theme.is_brutalist %} + + {% endif %} diff --git a/brutaldon/templates/main/post_partial.html b/brutaldon/templates/main/post_partial.html index c1f04c4..c5d851c 100644 --- a/brutaldon/templates/main/post_partial.html +++ b/brutaldon/templates/main/post_partial.html @@ -26,6 +26,7 @@
{% render_field form.status class+="textarea mousetrap is-primary" rows="4" %}
+
@@ -130,6 +131,7 @@ {% endif %}