generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Default version if absent; wrong version reloads page
Modifies `updateVersion` function to return "gh-pages" when no version is present. Modifies `updateVersion` function to reload page when wrong version is present. Co-authored-by: Stephen Brennan <[email protected]> Signed-off-by: sswastik02 <[email protected]>
- Loading branch information
1 parent
29f1c83
commit 4597fc8
Showing
1 changed file
with
21 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,19 +9,32 @@ | |
<link rel="icon" type="image/png" href="tux-sm.png"> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous"> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script> | ||
<!-- Popperjs (required by tempus dominus)--> | ||
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" integrity="sha256-BRqBN7dYgABqtY9Hd4ynE+1slnEw+roEPFzQ7TRRfcg=" crossorigin="anonymous"></script> | ||
<!-- Tempus Dominus JavaScript --> | ||
<script src="https://cdn.jsdelivr.net/npm/@eonasdan/[email protected]/dist/js/tempus-dominus.min.js" crossorigin="anonymous"></script> | ||
<!-- Tempus Dominus Styles --> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@eonasdan/[email protected]/dist/css/tempus-dominus.min.css" crossorigin="anonymous"> | ||
<!-- FontAwesome for calendar icon --> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"> | ||
</head> | ||
<body> | ||
|
||
<div class="modal fade" id="versionModal" tabindex="-1" aria-labelledby="versionModalLabel" aria-hidden="true"> | ||
<div class="modal-dialog"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h5 class="modal-title" id="versionModalLabel">Select Version</h5> | ||
<h5 class="modal-title" id="versionModalLabel">Select Date of Snapshot</h5> | ||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> | ||
</div> | ||
<div class="modal-body"> | ||
<select class="form-control" id="versionModalSelector"> | ||
</select> | ||
<label for="datetimepicker1">Select Date:</label> | ||
<div class="input-group date" id="datetimepicker1" data-target-input="nearest"> | ||
<input type="text" class="form-control datetimepicker-input" data-target="#datetimepicker1"/> | ||
<div class="input-group-append" data-target="#datetimepicker1" data-toggle="datetimepicker"> | ||
<div class="input-group-text"><i class="fa fa-calendar"></i></div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> | ||
|
@@ -107,11 +120,11 @@ <h5 class="modal-title" id="versionModalLabel">Select Version</h5> | |
alert("Invalid Version. Please add a valid version") | ||
params.delete("version") | ||
url = window.location.pathname + (params.toString())?`?${params.toString()}`:'' | ||
window.history.pushState({}, '', url) | ||
window.location.href = url; | ||
return | ||
} | ||
var version = params.get("version") | ||
if(!version) return | ||
var version = params.get("version"); | ||
if(!version) return "gh-pages"; | ||
sp.innerHTML = `Distribution Kernel Configs (version: ${version})` | ||
return version | ||
} | ||
|
@@ -152,7 +165,7 @@ <h5 class="modal-title" id="versionModalLabel">Select Version</h5> | |
for (cn of sortedConfigs) { | ||
const configurationElem = document.createElement("th"); | ||
if (cn === "UTS_RELEASE") { | ||
configurationElem.innerText += cn; // fake config | ||
// configurationElem.innerText += cn; // fake config | ||
} else { | ||
const configLink = document.createElement("a"); | ||
configLink.href = "https://cateee.net/lkddb/web-lkddb/" + cn + ".html"; | ||
|
@@ -203,8 +216,7 @@ <h5 class="modal-title" id="versionModalLabel">Select Version</h5> | |
} | ||
|
||
if (pushState) { | ||
let qs = new URLSearchParams(); | ||
for (cn of selectedConfigs) { | ||
let qs = new URLSearchParams(); for (cn of selectedConfigs) { | ||
qs.append("config", cn); | ||
} | ||
history.pushState(null, "", "?" + qs.toString()) | ||
|