small update

This commit is contained in:
Ave
2023-01-22 23:02:25 -05:00
parent 83cd3c886c
commit 5e57389ef9
4 changed files with 90 additions and 81 deletions
+1
View File
@@ -5,6 +5,7 @@
#quick-search {
text-align: center;
}
#quick-search button {
padding: 6.5px;
font-size: 9pt;
+62 -57
View File
@@ -1,72 +1,77 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Microsoft Software Download Listing lets you browse and download products from Microsoft Software Download.">
<meta property="twitter:card" content="summary_large_image">
<meta property="og:site_name" content="Microsoft Software Download Listing">
<meta property="og:title" content="Microsoft Software Download Listing">
<meta property="og:type" content="website">
<meta property="og:description" content="Microsoft Software Download Listing lets you browse and download products from Microsoft Software Download.">
<meta property="og:image" content="https://eraseyourknees.github.io/msdl/img/cover.png">
<meta property="og:url" content="https://eraseyourknees.github.io/msdl/">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description"
content="Microsoft Software Download Listing lets you browse and download products from Microsoft Software Download.">
<title>Microsoft Software Download Listing</title>
<meta property="twitter:card" content="summary_large_image">
<meta property="og:site_name" content="Microsoft Software Download Listing">
<meta property="og:title" content="Microsoft Software Download Listing">
<meta property="og:type" content="website">
<meta property="og:description"
content="Microsoft Software Download Listing lets you browse and download products from Microsoft Software Download.">
<meta property="og:image" content="https://ave9858.github.io/msdl/img/cover.png">
<meta property="og:url" content="https://ave9858.github.io/msdl/">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css">
<link rel="stylesheet" href="css/style.css">
<script defer src="js/msdl.js"></script>
</head>
<body>
<h1>Microsoft Software Download Listing</h1>
<title>Microsoft Software Download Listing</title>
<a href="https://github.com/ave9858/msdl">
<b>Source code on GitHub</b>
</a>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css">
<link rel="stylesheet" href="css/style.css">
<script defer src="js/msdl.js"></script>
</head>
<noscript>
<p>This page requires JavaScript to work.</p>
</noscript>
<body>
<h1>Microsoft Software Download Listing</h1>
<div id="products-list">
<h2>Select product</h2>
<input id="search-products" type="search" placeholder="Search with regex..." onInput="updateResults();">
<div id="quick-search">
📌
<button onClick="setSearch('Windows 8\\.1');">Windows 8.1</button>
<button onClick="setSearch('Windows 10 22H2');">Latest Windows 10</button>
<button onClick="setSearch('Windows 11 22H2');">Latest Windows 11</button>
</div>
<table style="table-layout: auto;">
<thead>
<tr>
<th>Product</th>
<th>ID</th>
</tr>
</thead>
<tbody id="products-table-body"></tbody>
</table>
<a href="https://github.com/ave9858/msdl">
<b>Source code on GitHub</b>
</a>
<noscript>
<p>This page requires JavaScript to work.</p>
</noscript>
<div id="products-list">
<h2>Select product</h2>
<input id="search-products" type="search" placeholder="Search with regex..." onInput="updateResults();">
<div id="quick-search">
📌
<button onClick="setSearch('Windows 8\\.1');">Windows 8.1</button>
<button onClick="setSearch('Windows 10 22H2');">Latest Windows 10</button>
<button onClick="setSearch('Windows 11 22H2');">Latest Windows 11</button>
</div>
<table style="table-layout: auto;">
<thead>
<tr>
<th>Product</th>
<th>ID</th>
</tr>
</thead>
<tbody id="products-table-body"></tbody>
</table>
</div>
<div id="msdl-ms-content"></div>
<div id="msdl-ms-content"></div>
<div id="msdl-please-wait">
<h2>Please wait...</h2>
<p>Please wait while the data you requested is being retrieved.</p>
</div>
<div id="msdl-please-wait">
<h2>Please wait...</h2>
<p>Please wait while the data you requested is being retrieved.</p>
</div>
<div id="msdl-processing-error">
<h2>Error</h2>
<p>An error has occurred while processing your request.</p>
</div>
<div id="msdl-processing-error">
<h2>Error</h2>
<p>An error has occurred while processing your request.</p>
</div>
<div id="back-to-products">
<hr>
<button onClick="backToProducts();">Go back to the product list</button>
</div>
<div id="back-to-products">
<hr>
<button onClick="backToProducts();">Go back to the product list</button>
</div>
<input id="msdl-session-id" type="hidden">
</body>
<input id="msdl-session-id" type="hidden">
</body>
</html>
+26 -23
View File
@@ -14,14 +14,14 @@ var msdlXhr = new XMLHttpRequest();
var availableProducts = {};
function uuidv4() {
return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, c =>
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
);
}
function updateVars() {
var id = document.getElementById('product-languages').value;
if(id == "") {
if (id == "") {
document.getElementById('submit-sku').disabled = 1;
return;
}
@@ -35,9 +35,8 @@ function updateVars() {
function checkForError(content) {
var errorMessage = document.getElementById('errorModalMessage');
if(errorMessage) {
if (errorMessage) {
processingError.style.display = "block";
content.style.display = "none";
return true;
}
@@ -75,16 +74,16 @@ function fixLanguageList() {
}
function onLanguageXhrChange() {
if(!(this.readyState == 4 && this.status == 200))
if (!(this.readyState == 4 && this.status == 200))
return;
if(pleaseWait.style.display != "block")
if (pleaseWait.style.display != "block")
return;
pleaseWait.style.display = "none";
msContent.style.display = "block";
if(!updateContent(msContent, this.responseText))
if (!updateContent(msContent, this.responseText))
return;
fixLanguageList();
@@ -92,16 +91,16 @@ function onLanguageXhrChange() {
}
function onDownloadsXhrChange() {
if(!(this.readyState == 4 && this.status == 200))
if (!(this.readyState == 4 && this.status == 200))
return;
if(pleaseWait.style.display != "block")
if (pleaseWait.style.display != "block")
return;
pleaseWait.style.display = "none";
msContent.style.display = "block";
if(!updateContent(msContent, this.responseText))
if (!updateContent(msContent, this.responseText))
return;
}
@@ -109,7 +108,7 @@ function getLanguages(productId) {
msContent.style.display = "none";
pleaseWait.style.display = "block";
var url = langsUrl + "&productEditionId=" + encodeURIComponent(productId) +
var url = langsUrl + "&productEditionId=" + encodeURIComponent(productId) +
"&sessionId=" + encodeURIComponent(sessionId.value);
msdlXhr.abort();
@@ -125,7 +124,7 @@ function getDownload() {
var id = updateVars();
var url = downUrl + "&skuId=" + encodeURIComponent(id['id']) +
"&language=" + encodeURIComponent(id['language'])+
"&language=" + encodeURIComponent(id['language']) +
"&sessionId=" + encodeURIComponent(sessionId.value);
msdlXhr.abort();
@@ -146,7 +145,11 @@ function prepareDownload(id) {
backToProductsDiv.style.display = 'block';
sessionId.value = uuidv4();
fetch('https://vlscppe.microsoft.com/tags?org_id=y6jn8c31&session_id=' + encodeURIComponent(sessionId.value)).then(() => { getLanguages(id) }, () => { getLanguages(id) });
const xhr = new XMLHttpRequest();
xhr.onreadystatechange = () => { getLanguages(id) };
xhr.open("GET", "https://vlscppe.microsoft.com/fp/tags?org_id=y6jn8c31&session_id=" + sessionId.value, true);
xhr.send();
}
function addTableElement(table, value, data) {
@@ -170,10 +173,10 @@ function createTable(data, search) {
table.innerHTML = "";
for(value in data) {
if(data[value].match(regex) == null)
for (value in data) {
if (data[value].match(regex) == null)
continue;
addTableElement(table, value, data);
}
}
@@ -191,7 +194,7 @@ function setSearch(query) {
function checkHash() {
var hash = window.location.hash;
if(hash.length == 0)
if (hash.length == 0)
return
prepareDownload(hash.substring(1))
@@ -199,7 +202,7 @@ function checkHash() {
function preparePage(resp) {
var products = JSON.parse(resp);
if(!products['products']) {
if (!products['products']) {
pleaseWait.style.display = 'none';
processingError.style.display = 'block';
return;
@@ -216,11 +219,11 @@ function preparePage(resp) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if(this.readyState != 4)
xhr.onreadystatechange = function () {
if (this.readyState != 4)
return;
if(this.status != 200) {
if (this.status != 200) {
pleaseWait.style.display = 'none';
processingError.style.display = 'block';
return;
+1 -1
View File
@@ -4,7 +4,7 @@ Microsoft Software Download Listing lets you browse and download products from M
Products list
-------------
The list of products available on the page is available in the `data/products.json` file. This file can be generated and updated with the [msdls](https://github.com/eraseyourknees/msdls) script.
The list of products available on the page is available in the `data/products.json` file. This file can be generated and updated with the [msdls](https://github.com/ave9858/msdls) script.
License
-------