diff --git a/brutaldon/static/js/brutaldon-enhancements.js b/brutaldon/static/js/brutaldon-enhancements.js index 8d5bcbe..defdaf3 100644 --- a/brutaldon/static/js/brutaldon-enhancements.js +++ b/brutaldon/static/js/brutaldon-enhancements.js @@ -93,3 +93,36 @@ function expandCWButtonPrepare() }); }; } + +function fileButtonUpdaters() +{ + var file1 = document.getElementById("id_media_file_1"); + file1.onchange = function(){ + if (file1.files.length > 0) + { + document.getElementById('media_filename_1').innerHTML = file1.files[0].name; + } + }; + var file2 = document.getElementById("id_media_file_2"); + file2.onchange = function(){ + if (file2.files.length > 0) + { + document.getElementById('media_filename_2').innerHTML = file2.files[0].name; + } + }; + var file3 = document.getElementById("id_media_file_3"); + file3.onchange = function(){ + if (file3.files.length > 0) + { + document.getElementById('media_filename_3').innerHTML = file3.files[0].name; + } + }; + var file4 = document.getElementById("id_media_file_4"); + file4.onchange = function(){ + if (file4.files.length > 0) + { + document.getElementById('media_filename_4').innerHTML = file4.files[0].name; + } + }; + +} diff --git a/brutaldon/templates/main/post_partial.html b/brutaldon/templates/main/post_partial.html index 9c91391..c1f04c4 100644 --- a/brutaldon/templates/main/post_partial.html +++ b/brutaldon/templates/main/post_partial.html @@ -5,7 +5,7 @@ {% elif redraft %}
{% else %} - + {% endif %} {% csrf_token %} @@ -54,7 +54,7 @@ -
+
{% render_field form.media_text_1 class+="input mousetrap" placeholder="Describe attachment" %}
@@ -73,7 +73,7 @@ -
+
{% render_field form.media_text_2 class+="input mousetrap" placeholder="Describe attachment" %}
@@ -92,7 +92,7 @@ -
+
{% render_field form.media_text_3 class+="input mousetrap" placeholder="Describe attachment" %}
@@ -110,7 +110,7 @@ -
+
{% render_field form.media_text_4 class+="input mousetrap" placeholder="Describe attachment" %}
@@ -126,37 +126,10 @@ class="level-item emoji-link" title="custom emoji reference">😊 -
- - {% if not preferences.theme.is_brutalist %} - - {% endif %} +{% if not preferences.theme.is_brutalist %} + +{% endif %} +