Skip to content

Commit 08d4462

Browse files
committed
7.11 Ported GBFAL new updated structure
1 parent 27e8d33 commit 08d4462

File tree

5 files changed

+389
-29
lines changed

5 files changed

+389
-29
lines changed

css/style.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,13 @@ a:active {
479479
font-size: 1em;
480480
}
481481

482+
.updated-header {
483+
min-width: 100%;
484+
max-width: 100%;
485+
text-align: center;
486+
font-size: 25px;
487+
}
488+
482489
/* mobile stuff */
483490
@media (hover: none) {
484491
body {
@@ -657,4 +664,8 @@ a:active {
657664
height: 120px;
658665
margin: 5px;
659666
}
667+
668+
.updated-header {
669+
font-size: 40px;
670+
}
660671
}

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<body onload="init()">
3131
<a href="index.html"><img id="titleheader" src="assets/ui/header.png" alt="header"></a>
3232
<div id="header">
33-
<div>v7.10</div>
33+
<div>v7.11</div>
3434
<div id="timestamp"></div>
3535
</div>
3636
<div id="issues" style="display:none">
@@ -40,7 +40,7 @@ <h3>Known Issues</h3>
4040
<div>
4141
<button class="tabbutton" id="tab-index" onclick="openTab('index')"><img class="btn-icon" src="assets/ui/icon/index.png" />Index</button>
4242
<button class="tabbutton" id="tab-view" onclick="openTab('view')" style="display:none"><img class="btn-icon" src="assets/ui/icon/view.png" />Player</button>
43-
<button class="tabbutton" id="tab-new" onclick="openTab('new')"><img class="btn-icon" src="assets/ui/icon/new.png" />Newest</button>
43+
<button class="tabbutton" id="tab-new" onclick="openTab('new')"><img class="btn-icon" src="assets/ui/icon/new.png" />Updated</button>
4444
<button class="tabbutton" id="tab-history" onclick="openTab('history')"><img class="btn-icon" src="assets/ui/icon/history.png" />History</button>
4545
<button class="tabbutton" id="tab-bookmark" onclick="openTab('bookmark')"><img class="btn-icon" src="assets/ui/icon/bookmark.png" />Bookmarks</button>
4646
<button class="tabbutton" id="tab-about" onclick="openTab('about')"><img class="btn-icon" src="assets/ui/icon/about.png" />About</button>

index.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ var Game = LOCAL ? // Game variable used by GBF scripts
100100
};
101101
var debug_path = null;
102102
// global variables
103-
var index = {} // data index (loaded from data.json)
103+
var updated = {}; // latest updated elements
104+
var index = {}; // data index (loaded from data.json)
104105
var timestamp = Date.now(); // timestamp (loaded from changelog.json)
105106
var lastsearches = []; // history
106107
var bookmarks = []; // bookmarks
@@ -205,9 +206,7 @@ function initChangelog(unusued)
205206
{
206207
let json = JSON.parse(this.response);
207208
if(json.hasOwnProperty("new"))
208-
{
209-
updated = json["new"].reverse();
210-
}
209+
updated = json["new"]
211210
timestamp = json.timestamp;
212211
setInterval(clock, 1000);
213212
}
@@ -223,11 +222,18 @@ function initIndex(unused)
223222
try
224223
{
225224
index = JSON.parse(this.response);
226-
// init updated, bookmark, history ...
227-
if(updated.length > 0) // init Updated list
225+
// init Updated list
226+
let new_node = document.getElementById('new');
227+
for(const [key, value] of Object.entries(updated))
228228
{
229-
updateList(document.getElementById('new'), updated);
229+
let div = document.createElement("div");
230+
div.classList.add("mobile-big");
231+
div.classList.add("updated-header");
232+
div.innerText = key;
233+
new_node.appendChild(div);
234+
updateList(new_node, value.reverse(), false);
230235
}
236+
// init bookmark, history ...
231237
updateHistory(null, null);
232238
toggleBookmark(null, null);
233239
}
@@ -709,9 +715,10 @@ function failJSON(id)
709715
document.getElementById('output').innerHTML = "Error: Couldn't load ID " + id;
710716
}
711717

712-
function updateList(node, elems) // update a list of elements
718+
function updateList(node, elems, clear_node = true) // update a list of elements
713719
{
714-
node.innerHTML = "";
720+
if(clear_node)
721+
node.innerHTML = "";
715722
for(let e of elems)
716723
{
717724
switch(e[1])

0 commit comments

Comments
 (0)