From 24946c01a05ca66c0111fa201b1a2b8be2ef6382 Mon Sep 17 00:00:00 2001 From: John Cleaver Date: Fri, 15 Apr 2016 20:50:37 -0400 Subject: [PATCH 1/4] Added fucntions to save and load the hideCompleted setting. --- main.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.js b/main.js index 1bd331c..14bb874 100644 --- a/main.js +++ b/main.js @@ -35,6 +35,10 @@ var v = new Vue({ if(spoilers !== null && spoilers !== ""){ this.spoilers = JSON.parse(spoilers); } + hideCompleted = localStorage.getItem('hideCompleted') + if(hideCompleted !== null && hideCompleted !== ""){ + this.hideCompleted = hideCompleted; + } }, computed: { user_data_serialized: function(){ @@ -105,6 +109,10 @@ var v = new Vue({ change_skill: function(new_skill){ this.active_skill = new_skill; }, + toggleHideCompleted: function(){ + this.hideCompleted = !this.hideCompleted; + localStorage.setItem('hideCompleted', this.hideCompleted); + }, addItemToBundle: function(bundleId, itemId, itemPosition){ this.user_data[bundleId].push({item: itemId, position: itemPosition}); }, From 269437b00910995ec71f0a6e3ebbc0c1b8916655 Mon Sep 17 00:00:00 2001 From: John Cleaver Date: Fri, 15 Apr 2016 20:50:53 -0400 Subject: [PATCH 2/4] Switched to using the new functions. --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 5677a19..870e9ed 100644 --- a/index.html +++ b/index.html @@ -73,7 +73,7 @@
- + From 239279490077ed442443ce0c86b9a21b4797adb0 Mon Sep 17 00:00:00 2001 From: John Cleaver Date: Fri, 15 Apr 2016 20:55:22 -0400 Subject: [PATCH 3/4] Added functions to save and load hideSpoilers. --- main.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 14bb874..943e109 100644 --- a/main.js +++ b/main.js @@ -35,10 +35,14 @@ var v = new Vue({ if(spoilers !== null && spoilers !== ""){ this.spoilers = JSON.parse(spoilers); } - hideCompleted = localStorage.getItem('hideCompleted') + hideCompleted = localStorage.getItem('hideCompleted'); if(hideCompleted !== null && hideCompleted !== ""){ this.hideCompleted = hideCompleted; } + hideSpoilers = localStorage.getItem('hideSpoilers'); + if(hideSpoilers !== null && hideSpoilers !== ""){ + this.hideSpoilers = hideSpoilers; + } }, computed: { user_data_serialized: function(){ @@ -113,6 +117,10 @@ var v = new Vue({ this.hideCompleted = !this.hideCompleted; localStorage.setItem('hideCompleted', this.hideCompleted); }, + toggleHideSpoilers: function(){ + this.hideSpoilers = !this.hideSpoilers; + localStorage.setItem('hideSpoilers', this.hideSpoilers); + }, addItemToBundle: function(bundleId, itemId, itemPosition){ this.user_data[bundleId].push({item: itemId, position: itemPosition}); }, From dc9509a2876a9db70034280629bf4d093a15a8d4 Mon Sep 17 00:00:00 2001 From: John Cleaver Date: Fri, 15 Apr 2016 20:55:45 -0400 Subject: [PATCH 4/4] Updated hide spoilers button to use the new save and load functions. --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 870e9ed..280105c 100644 --- a/index.html +++ b/index.html @@ -84,7 +84,7 @@

- +