Skip to content

Commit

Permalink
backwards compatibility changes made
Browse files Browse the repository at this point in the history
resolves #33
  • Loading branch information
xTVaser committed Dec 2, 2017
1 parent 4cd739d commit f9d7339
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frontend/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
<body>
<div class="container">
<div class="row text-center">
<p>Current Version - 1.0.0</p>
<a href="http://www.github.com">Click Here to See Latest Release Notes</a>
<p>Current Version - 1.0.0
<a href="http://www.github.com">Click Here to See Latest Release Notes</a>
</p>
</div>
<br>
<div class="row text-center">
<p>
<b>---> Major changes done to the configuration page, click Find Games again, and resave your settings to update!
Expand All @@ -32,7 +32,7 @@
<p>To use this extension, enter a title for the panel, your Speedrun.com Name and click "Find Games", then click
"Save"
</p>
<p>All the other configuration options are optional and just for customization purposes.</p>
<p><i>All the other configuration options are optional and just for customization purposes.</i></p>
</div>
<br>
<div class="col-md-6">
Expand Down
3 changes: 3 additions & 0 deletions frontend/css/config.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ ul.config {
#gamesHeader h3 {
text-align: center;
}
#errorDialog h3 {
text-align: center;
}

h1.config {
margin-bottom: 2em;
Expand Down
27 changes: 27 additions & 0 deletions frontend/js/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand All @@ -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++) {
Expand All @@ -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++) {
Expand Down
27 changes: 27 additions & 0 deletions frontend/js/viewer_preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand All @@ -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++) {
Expand All @@ -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++) {
Expand Down

0 comments on commit f9d7339

Please sign in to comment.