Finished settings

This commit is contained in:
2020-12-29 00:39:20 +01:00
parent bbe7b5849a
commit 5c17a540ee
15 changed files with 199 additions and 51 deletions
+26 -4
View File
@@ -1,5 +1,6 @@
var xmlhttp = new XMLHttpRequest();
var page = 1;
var maxpage = 1;
var url = "./splitter.php?format=json&page=";
updateBrowser();
@@ -34,17 +35,38 @@ function nextPage() {
updateBrowser();
}
function changeBrowser(mapsets)
function firstPage() {
page = 1;
updateBrowser();
}
function lastPage() {
page = maxpage;
updateBrowser();
}
function changeBrowser(response)
{
var browser = document.getElementById("browser");
var output = "<div>Page " + page.toString() + "</div>";
if (!response.page)
{
return;
}
if (response.maxpage)
{
maxpage = response.maxpage;
}
var output = "<div>Page " + page.toString() + "/" + response.maxpage.toString() + "</div>";
var mapsetTemplate = `{{ MAIN_BROWSER_TEMPLATE_MAPSET }}`;
var template = `{{ MAIN_BROWSER_TEMPLATE_DIFFICULTY }}`;
for (var mapsetKey of Object.keys(mapsets))
for (var mapsetKey of Object.keys(response.mapsets))
{
var mapset = mapsets[mapsetKey];
var mapset = response.mapsets[mapsetKey];
var subOutput = "";
var summary = true;
+1 -1
View File
@@ -2,5 +2,5 @@
<details class="mapset">
\{\{ MAP_DIFFICULTIES \}\}
</details>
<a href="./?repack&key=\{\{ MAPSET_KEY \}\}">REPACK</a>
<a href="./?repack&key=\{\{ MAPSET_KEY \}\}">[ REPACK ]</a>
</div>
+7 -2
View File
@@ -16,8 +16,13 @@
</div>
<div class="main-item">
<h2 id="a">Browser</h2>
<a onclick="prevPage()">[ Previous ]</a> &nbsp;
<a onclick="nextPage()">[ Next ]</a>
<div class="browser-navbar">
<a onclick="firstPage()">[ &lt;&lt; First ]</a> &nbsp;
<a onclick="prevPage()">[ &lt; Previous ]</a> &nbsp;
<a onclick="nextPage()">[ Next &gt; ]</a> &nbsp;
<a onclick="lastPage()">[ Last &gt;&gt; ]</a> &nbsp;
</div>
<div id="pagenumber"></div>
<div id="browser" class="browser">
<!-- todo JS -->
</div>
+1
View File
@@ -0,0 +1 @@
Check your session/osz/ folder for the exported files.
+1
View File
@@ -0,0 +1 @@
<input type="submit" form="cancelform" value="Cancel" />
+11
View File
@@ -0,0 +1,11 @@
<div class="warn">
<h2>SETTINGS</h2>
<form method="POST" action="./?settings">
<label for="osu_folder">osu! folder: </label>
<input type="text" id="osu_folder" name="osu_folder" placeholder="C:\Games\osu!" /><br />
<p style="font-size:0.9em">(Use a fully qualified real path preferably without symlinks. Relative paths are supported in theory, but try to use absolute paths.)</p>
{{ SETTINGS_BACK }}
<input type="submit" value="Save" />
</form>
<form id="cancelform" method="GET" action="./"></form>
</div>
+11
View File
@@ -110,4 +110,15 @@ details.mapset summary::-webkit-details-marker {
.mapset[open] summary .map {
background-color: #444444;
}
.warn h2 {
margin: 0;
text-align: center;
}
.warn {
max-width: 400px;
margin: auto;
margin-top: 30px;
border: 1px solid white;
padding: 10px;
}
+6
View File
@@ -0,0 +1,6 @@
<div class="warn">
<h2>WARNING!</h2>
<p>Repacking all beatmaps will take a LONG time. Are you sure you want to continue?</p>
<p style="text-align:center;"><a href="{{ WARN_FORWARD_LINK }}">[ Yes ]</a> &nbsp;&nbsp; <a href="./?">[ No ]</a></p>
<p style="font-size:0.9em">(The repacking will start after clicking the "yes" button. If you are unsure whether you clicked it, check your session/osz/ folder; there should be some .osz files already.)</p>
</div>