From f29f11848d84b6f6ce8cd1dd01e2d7d9a0341675 Mon Sep 17 00:00:00 2001 From: Evilcoder Date: Thu, 18 Jul 2024 19:42:44 +0200 Subject: [PATCH] Added oreon lime r1 packages and made the whole thing responsive --- CSS/style.css | 77 ++++++++++++++++++++++++++++++++- JS/mainstream(r1)-script.js | 48 ++++++++++++++++++++ JS/security-script.js | 45 +++++++++++++++++++ Oreon-lime-(R1)/mainstream.html | 46 ++++++++++++++++++++ Oreon-lime-(R1)/security.html | 45 +++++++++++++++++++ Oreon-lime-(R2)/mainstream.html | 12 +++++ Oreon-lime-(R2)/source.html | 12 +++++ index.html | 15 ++++++- src/main.ts | 0 9 files changed, 297 insertions(+), 3 deletions(-) create mode 100644 JS/mainstream(r1)-script.js create mode 100644 JS/security-script.js create mode 100644 Oreon-lime-(R1)/mainstream.html create mode 100644 Oreon-lime-(R1)/security.html create mode 100644 src/main.ts diff --git a/CSS/style.css b/CSS/style.css index 9747c5b..d264f9e 100644 --- a/CSS/style.css +++ b/CSS/style.css @@ -13,7 +13,49 @@ h1, h2, a, p { flex-direction: row; align-items: center; } - +.dropbtn { + background-color: rgb(63, 173, 63); + color: white; + padding: 16px; + font-size: 16px; + border: none; + display: none; +} +.dropbtn i { + color: black; +} +.dropdown { + position: relative; + display: inline-block; +} + +.dropdown-content { + display: none; + position: absolute; + background-color: black; + min-width: 160px; + box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); + z-index: 1; +} + +.dropdown-content a { + color: white; + padding: 12px 16px; + text-decoration: none; + display: block; +} + +.dropdown-content a:hover { + background-color: gray; +} +.dropdown:hover .dropdown-content { + display: block; + padding-right: 20px; +} + +.dropdown:hover .dropbtn { + background-color: grey; +} .hdr a { color: white; text-decoration: none; @@ -84,4 +126,37 @@ h1, h2, a, p { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; +} + +@media screen and (max-width: 850px) { + .packages { + display: flex; + flex-direction: column; + } + .package { + width: 350px; + margin-left: 20px; + } + .dropbtn { + display: block; + } + .edit-cont { + display: flex; + flex-direction: column; + } + .edit-btn { + width: 300px; + } + .hdr { + display: flex; + flex-direction: row; + align-items: center; + height: 90px; + } + .logo { + width: 350px; + } + .hdr nav { + display: none; + } } \ No newline at end of file diff --git a/JS/mainstream(r1)-script.js b/JS/mainstream(r1)-script.js new file mode 100644 index 0000000..32dc7f8 --- /dev/null +++ b/JS/mainstream(r1)-script.js @@ -0,0 +1,48 @@ +function doCORSRequest(options, printResult) { + var x = new XMLHttpRequest(); + var proxy_url = 'https://api.allorigins.win/get?url='; + var target_url = encodeURIComponent(options.url); + x.open(options.method, proxy_url + target_url); + x.onload = x.onerror = function() { + var response = JSON.parse(x.responseText); + printResult( + options.method + ' ' + options.url + '\n' + + x.status + ' ' + x.statusText + '\n\n' + + (response.contents || '') + ); + }; + + x.send(options.data); +} + +doCORSRequest({ + method: "GET", + url: "https://packages.boostyconnect.com/oreonproject/oreon-lime/", +}, function printResult(res) { + console.log('Response:', res); + + try { + const parser = new DOMParser(); + const doc = parser.parseFromString(res, "text/html"); + const links = doc.querySelectorAll("a"); + links.forEach((link) => { + const forbidden_links = ["Name", "Last modified", "Size", "Description", "Parent Directory"]; + if (!forbidden_links.includes(link.innerHTML.trim())) { + const link_e = document.createElement("a"); + const new_href = link.href + .replace("http://127.0.0.1:5500/", "https://packages.boostyconnect.com/oreonproject/oreon-lime/") + .replace("/Oreon-lime-(R1)", ""); + + link_e.href = new_href; + link_e.innerHTML = link.innerHTML; + link_e.className = "package"; + link_e.target = "_blank"; + document.getElementById("packages").appendChild(link_e); + console.log('Original URL:', link.href); + console.log('Modified URL:', new_href); + } + }); + } catch (e) { + console.error('Parsing error:', e); + } +}); diff --git a/JS/security-script.js b/JS/security-script.js new file mode 100644 index 0000000..ab64a23 --- /dev/null +++ b/JS/security-script.js @@ -0,0 +1,45 @@ +function doCORSRequest(options, printResult) { + var x = new XMLHttpRequest(); + var proxy_url = 'https://api.allorigins.win/get?url='; + var target_url = encodeURIComponent(options.url); + x.open(options.method, proxy_url + target_url); + x.onload = x.onerror = function() { + var response = JSON.parse(x.responseText); + printResult( + options.method + ' ' + options.url + '\n' + + x.status + ' ' + x.statusText + '\n\n' + + (response.contents || '') + ); + }; + + x.send(options.data); +} + +doCORSRequest({ + method: "GET", + url: "https://packages.boostyconnect.com/oreonproject/oreon-security/", +}, function printResult(res) { + console.log('Response:', res); + + try { + const parser = new DOMParser(); + const doc = parser.parseFromString(res, "text/html"); + const links = doc.querySelectorAll("a"); + links.forEach((link) => { + const forbidden_links = ["Name", "Last modified", "Size", "Destination", "Description", "Parent Directory"]; + if (!forbidden_links.includes(link.innerHTML)) { + const link_e = document.createElement("a"); + const new_href = link.href.replace("http://127.0.0.1:5500/", "https://packages.boostyconnect.com/oreonproject/oreon-security/").replace("/Oreon-lime-(R1)", ""); + + link_e.href = new_href; + link_e.innerHTML = link.innerHTML; + link_e.className = "package"; + link_e.target = "_blank"; + document.getElementById("packages").appendChild(link_e); + console.log(link.href); + } + }); + } catch (e) { + console.error('Parsing error:', e); + } +}); \ No newline at end of file diff --git a/Oreon-lime-(R1)/mainstream.html b/Oreon-lime-(R1)/mainstream.html new file mode 100644 index 0000000..af247f1 --- /dev/null +++ b/Oreon-lime-(R1)/mainstream.html @@ -0,0 +1,46 @@ + + + + + + Document + + + + + + + + + + + + + +
+ +

BCPackage

+ +
+ +
+
+

Oreon lime (R1)

+

Mainstream packages

+
+
+
+ + \ No newline at end of file diff --git a/Oreon-lime-(R1)/security.html b/Oreon-lime-(R1)/security.html new file mode 100644 index 0000000..a229fac --- /dev/null +++ b/Oreon-lime-(R1)/security.html @@ -0,0 +1,45 @@ + + + + + + Document + + + + + + + + + + + + + +
+ +

BCPackage

+ +
+
+
+

Oreon lime (R1)

+

Security packages

+
+
+
+ + \ No newline at end of file diff --git a/Oreon-lime-(R2)/mainstream.html b/Oreon-lime-(R2)/mainstream.html index 743ef9b..66e56de 100644 --- a/Oreon-lime-(R2)/mainstream.html +++ b/Oreon-lime-(R2)/mainstream.html @@ -12,9 +12,21 @@ + + +
+

BCPackage

+ +

BCPackage

+ +

BCPackage