From 879ce1c7c75d7431f38369823f5566cd8f72ee56 Mon Sep 17 00:00:00 2001 From: bartvdbraak Date: Fri, 26 Apr 2019 14:48:29 +0200 Subject: [PATCH] fix bugs --- index.html | 4 ++-- js/script.js | 26 ++++++++++++++++++++------ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index eef55a9..7799ea3 100644 --- a/index.html +++ b/index.html @@ -76,13 +76,13 @@
- +
-

Krystilia

+

diff --git a/js/script.js b/js/script.js index 884fbf7..f2079b5 100644 --- a/js/script.js +++ b/js/script.js @@ -1,3 +1,7 @@ +String.prototype.capitalize = function() { + return this.charAt(0).toUpperCase() + this.slice(1); +} + function setBlocklists() { $.getJSON( "data/monsters.json", {format: "json"}, function( data ) { @@ -14,8 +18,6 @@ function setBlocklists() { }) } - - $(document).ready(function() { setBlocklists(); applyChanges('krystilia'); @@ -60,8 +62,9 @@ function filterTasks(data) { } break; case 'Fossil Island Wyverns': - if ($("#wyverns").prop("checked") == true) { + if ($("#fossilwyverns").prop("checked") == true) { index_list.push(i) + console.log('1') } } @@ -76,16 +79,21 @@ function filterTasks(data) { $( ".blocktask" ).each(function( index ) { if ($(this).val().toUpperCase() == data[i].monster.toUpperCase()) { index_list.push(i) + console.log('2') } }); + // Quest unlocks + } + console.log(index_list) + + for (var i in index_list) { data.splice(i, 1) - console.log(i) } - console.log(data) + return data } @@ -97,15 +105,21 @@ function sumWeights(data) { return total } -var table; +var table, currentMaster; function deleteOldDataTable() { table = $('#master').DataTable() table.destroy(); } +function setMasterTitle(master) { + $("#mastertitle").text(master.capitalize()); +} + function applyChanges(master) { + currentMaster = master; deleteOldDataTable(); + setMasterTitle(master); $.getJSON( "data/"+master+".json", function( data ) {