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 @@ + + +
+ + +