refactoring, cleanup
This commit is contained in:
parent
9f4d56b627
commit
0c7c1e6484
1
app.py
1
app.py
@ -120,6 +120,7 @@ def monster_stats(monster_name):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Add this route for fetching breeding combinations
|
# Add this route for fetching breeding combinations
|
||||||
@app.route("/breeds")
|
@app.route("/breeds")
|
||||||
def get_breeding_combinations():
|
def get_breeding_combinations():
|
||||||
|
@ -1,15 +1,9 @@
|
|||||||
document.addEventListener("DOMContentLoaded", function () {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
const familyDropdown = document.getElementById("familyDropdown");
|
const familyDropdown = document.getElementById("familyDropdown");
|
||||||
const monsterDropdown = document.getElementById("monsterDropdown");
|
const monsterDropdown = document.getElementById("monsterDropdown");
|
||||||
//const parent = document.getElementById("parent")
|
|
||||||
|
|
||||||
// Implementing Family Icon Grid in place of family dropdown
|
|
||||||
//const familyGrid = document.getElementById("familyGrid")
|
|
||||||
|
|
||||||
// Initialize dropdowns
|
// Initialize dropdowns
|
||||||
updateMonstersDropdownByFamily();
|
updateMonsterDropdownByFamily();
|
||||||
// Initialize Family Grid();
|
|
||||||
// populateFamilyGrid();
|
|
||||||
|
|
||||||
// Fetch families data from the server and populate families dropdown
|
// Fetch families data from the server and populate families dropdown
|
||||||
fetch("/get_families")
|
fetch("/get_families")
|
||||||
@ -21,22 +15,11 @@ document.addEventListener("DOMContentLoaded", function () {
|
|||||||
|
|
||||||
// Listeners for Dropdown Changes
|
// Listeners for Dropdown Changes
|
||||||
familyDropdown.addEventListener("change", function () {
|
familyDropdown.addEventListener("change", function () {
|
||||||
updateMonstersDropdownByFamily();
|
updateMonsterDropdownByFamily();
|
||||||
});
|
});
|
||||||
|
|
||||||
monsterDropdown.addEventListener("change", function () {
|
monsterDropdown.addEventListener("change", function () {
|
||||||
updateIframes();
|
updateIframes();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Listener for a click on the one of the family icons
|
|
||||||
//familyGrid.addEventListener("click", function() {
|
|
||||||
// updateMonsterGrid(); // Need a function for this too...
|
|
||||||
//});
|
|
||||||
|
|
||||||
// Listener for a click on a breeding parent
|
|
||||||
//parent.addEventListener("click", function() {
|
|
||||||
// updateMonstersDropdownBySelected();
|
|
||||||
// updateIFrames();
|
|
||||||
//});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function updateMonstersDropdownByFamily() {
|
function updateMonsterDropdownByFamily() {
|
||||||
const selectedFamily = familyDropdown.value;
|
const selectedFamily = familyDropdown.value;
|
||||||
|
|
||||||
// Fetch monsters data from the server based on the selected family
|
// Fetch monsters data from the server based on the selected family
|
@ -2,8 +2,11 @@
|
|||||||
// const selectedMonster = parent.value;
|
// const selectedMonster = parent.value;
|
||||||
//
|
//
|
||||||
// // Fetch monsters data from the server based on the selected monster
|
// // Fetch monsters data from the server based on the selected monster
|
||||||
// fetch(`/monster/${selectedMonster}`)
|
// fetch(`/monster_info_json/${selectedMonster}`)
|
||||||
// .then(response => response.json())
|
// .then(response => response.json())
|
||||||
// .then(data => populateDropdown(monsterDropdown, data))
|
// .then(data => populateDropdown(monsterDropdown, data))
|
||||||
// .catch(error => console.error("Error fetching monsters:", error));
|
// .catch(error => console.error("Error fetching monsters:", error));
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
// I was using this to try to update the page when a monster
|
||||||
|
// in the breeding page is clicked
|
@ -42,5 +42,8 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
{% for file in js_files %}
|
||||||
|
<script src="{{ url_for('static', filename='js/' + file) }}"></script>
|
||||||
|
{% endfor %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
Reference in New Issue
Block a user