From f9d73390db4014261a08c312aef5eb8ff0ffe52d Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Sat, 2 Dec 2017 00:17:26 -0500 Subject: [PATCH] backwards compatibility changes made resolves #33 --- frontend/config.html | 8 ++++---- frontend/css/config.css | 3 +++ frontend/js/viewer.js | 27 +++++++++++++++++++++++++++ frontend/js/viewer_preview.js | 27 +++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 4 deletions(-) diff --git a/frontend/config.html b/frontend/config.html index 07fa6f8..5280c69 100644 --- a/frontend/config.html +++ b/frontend/config.html @@ -18,10 +18,10 @@
-

Current Version - 1.0.0

- Click Here to See Latest Release Notes +

Current Version - 1.0.0 + Click Here to See Latest Release Notes +

-

---> Major changes done to the configuration page, click Find Games again, and resave your settings to update! @@ -32,7 +32,7 @@

To use this extension, enter a title for the panel, your Speedrun.com Name and click "Find Games", then click "Save"

-

All the other configuration options are optional and just for customization purposes.

+

All the other configuration options are optional and just for customization purposes.


diff --git a/frontend/css/config.css b/frontend/css/config.css index e4d98cd..9990478 100644 --- a/frontend/css/config.css +++ b/frontend/css/config.css @@ -27,6 +27,9 @@ ul.config { #gamesHeader h3 { text-align: center; } +#errorDialog h3 { + text-align: center; +} h1.config { margin-bottom: 2em; diff --git a/frontend/js/viewer.js b/frontend/js/viewer.js index 55d2bb4..1329b82 100644 --- a/frontend/js/viewer.js +++ b/frontend/js/viewer.js @@ -588,6 +588,15 @@ function secondsToTimeStr(seconds) { function sortCategories(expectedOrder, categories) { ordered = [] + // Backwards compatibility patch v0.3.0 -> 1.0.0 + if (expectedOrder == undefined) { + for (var i = 0; i < categories.length; i++) { + if (categories[i].isLevel == false && categories[i].isMisc == false) { + ordered.push(categories[i]) + } + } + return ordered + } for (var i = 0; i < expectedOrder.length; i++) { // Look for that value in categories for (var j = 0; j < categories.length; j++) { @@ -601,6 +610,15 @@ function sortCategories(expectedOrder, categories) { function sortMiscCategories(expectedOrder, categories) { ordered = [] + // Backwards compatibility patch v0.3.0 -> 1.0.0 + if (expectedOrder == undefined) { + for (var i = 0; i < categories.length; i++) { + if (categories[i].isLevel == false && categories[i].isMisc == true) { + ordered.push(categories[i]) + } + } + return ordered + } for (var i = 0; i < expectedOrder.length; i++) { // Look for that value in categories for (var j = 0; j < categories.length; j++) { @@ -614,6 +632,15 @@ function sortMiscCategories(expectedOrder, categories) { function sortLevels(expectedOrder, levels) { ordered = [] + // Backwards compatibility patch v0.3.0 -> 1.0.0 + if (expectedOrder == undefined) { + for (var i = 0; i < levels.length; i++) { + if (levels[i].isLevel == true) { + ordered.push(levels[i]) + } + } + return ordered + } for (var i = 0; i < expectedOrder.length; i++) { // Look for that value in categories for (var j = 0; j < levels.length; j++) { diff --git a/frontend/js/viewer_preview.js b/frontend/js/viewer_preview.js index 60c8935..04ee3d0 100644 --- a/frontend/js/viewer_preview.js +++ b/frontend/js/viewer_preview.js @@ -599,6 +599,15 @@ function secondsToTimeStr(seconds) { function sortCategories(expectedOrder, categories) { ordered = [] + // Backwards compatibility patch v0.3.0 -> 1.0.0 + if (expectedOrder == undefined) { + for (var i = 0; i < categories.length; i++) { + if (categories[i].isLevel == false && categories[i].isMisc == false) { + ordered.push(categories[i]) + } + } + return ordered + } for (var i = 0; i < expectedOrder.length; i++) { // Look for that value in categories for (var j = 0; j < categories.length; j++) { @@ -612,6 +621,15 @@ function sortCategories(expectedOrder, categories) { function sortMiscCategories(expectedOrder, categories) { ordered = [] + // Backwards compatibility patch v0.3.0 -> 1.0.0 + if (expectedOrder == undefined) { + for (var i = 0; i < categories.length; i++) { + if (categories[i].isLevel == false && categories[i].isMisc == true) { + ordered.push(categories[i]) + } + } + return ordered + } for (var i = 0; i < expectedOrder.length; i++) { // Look for that value in categories for (var j = 0; j < categories.length; j++) { @@ -625,6 +643,15 @@ function sortMiscCategories(expectedOrder, categories) { function sortLevels(expectedOrder, levels) { ordered = [] + // Backwards compatibility patch v0.3.0 -> 1.0.0 + if (expectedOrder == undefined) { + for (var i = 0; i < levels.length; i++) { + if (levels[i].isLevel == true) { + ordered.push(levels[i]) + } + } + return ordered + } for (var i = 0; i < expectedOrder.length; i++) { // Look for that value in categories for (var j = 0; j < levels.length; j++) {