defined static structure as src/apps/dashboard/static/apps/scripts/dashboard.js for Jasmine testing purposes; efforts to get past textInput=null have thus far been frustrated

This commit is contained in:
Disco DeDisco
2026-01-25 22:40:57 -05:00
parent eb237f95ec
commit d8da9051ff
5 changed files with 18 additions and 22 deletions

2
.gitignore vendored
View File

@@ -11,7 +11,7 @@ db.sqlite3
db.sqlite3-journal
container.db.sqlite3
media
static
src/static
# If your build process includes running collectstatic, then you probably don't need or want to include staticfiles/
# in your Git repository. Update and uncomment the following line accordingly.

View File

@@ -0,0 +1,9 @@
console.log("apps/scripts/dashboard.js loading");
const initialize = () => {
console.log("initialize called!");
const textInput = document.querySelector("id_text");
textInput.oninput = () => {
const errorMsg = document.querySelector(".invalid-feedback");
errorMsg.style.display = "none";
};
};

View File

@@ -1,6 +0,0 @@
{% extends "core/base.html" %}
{% block title_text %}Start a new to-do list{% endblock title_text %}
{% block header_text %}Start a new to-do list{% endblock header_text %}
{% block form_action %}{% url "new_list" %}{% endblock form_action %}

View File

@@ -1,15 +0,0 @@
{% extends "core/base.html" %}
{% block title_text %}Your to-do list{% endblock title_text %}
{% block header_text %}Your to-do list{% endblock header_text %}
{% block form_action %}{% url "view_list" list.id %}{% endblock form_action %}
{% block table %}
<table id="id_list_table" class="table">
{% for item in list.item_set.all %}
<tr><td>{{ forloop.counter }}. {{ item.text }}</td></tr>
{% endfor %}
</table>
{% endblock table %}

View File

@@ -51,4 +51,12 @@
src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.8/js/bootstrap.min.js"
></script>
<script>
const textInput = document.querySelector('#id_text');
textInput.oninput = () => {
const errorMsg = document.querySelector(".invalid-feedback");
errorMsg.style.display = "none";
}
</script>
</html>