diff options
author | Dylan Bolger <dylanbolger@Dylans-MacBook-Air.local> | 2018-03-21 12:19:35 -0500 |
---|---|---|
committer | Dylan Bolger <dylanbolger@Dylans-MacBook-Air.local> | 2018-03-21 12:19:35 -0500 |
commit | d938a333c208c67c890a9e4888d4cbabcc2b1e87 (patch) | |
tree | 4276d32ddacfffb6fb749d29e7824e17ab35f50b /cydia/depictions/changelog | |
parent | 44a20c7d9ecd8737baac8606f89ae68b62e05594 (diff) | |
download | personal-website-d938a333c208c67c890a9e4888d4cbabcc2b1e87.tar.xz personal-website-d938a333c208c67c890a9e4888d4cbabcc2b1e87.zip |
working on web
Diffstat (limited to 'cydia/depictions/changelog')
-rwxr-xr-x | cydia/depictions/changelog/index.html | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/cydia/depictions/changelog/index.html b/cydia/depictions/changelog/index.html new file mode 100755 index 0000000..1a97072 --- /dev/null +++ b/cydia/depictions/changelog/index.html @@ -0,0 +1,97 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <title>Cydia Tweak</title> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <link rel="icon" href="/CydiaIcon.png"> + + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css"> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> + + <style> + body { + background-color: #efeff4; + } + h1, h2 { + margin-left: 7px; + } + .badge-label { + border-radius:1em; + } + .panel, .alert { + border-radius: 0 !important; + } + .package-error { + display: none; + } + .latest-version { + vertical-align: middle; + } + </style> +</head> +<body> + <div class="container"> + <div class="package row"> + <div class="header"> + <h1 class="package-name"></h1> + </div> + </div> + + <div class="row alert alert-danger package-error"></div> + + <div class="package-info row package-versions"> + <h2>Changelogs</h2> + </div> + + </div> + <script> + $(document).ready(function() { + var dPackage = getParameterByName("p"); + + if (!dPackage) { + $(".package-error").text("This package doesn't seem to exist!").css("display", "block"); + $(".package-info").css("display", "none"); + $(".package-name").text("Not Found"); + return; + } + + $.getJSON("/packages/" + dPackage + ".json", function(data) { + document.title = data.name + " by " + data.author; + $(".package-name").text(data.name); + var latest = data.version; + var versions = Object.keys(data.changelog).reverse(); + for (var v in versions) { + var version = versions[v]; + var panel = $("<div class=\"panel panel-default\"></div>"); + panel.append("<div class=\"panel-heading\">" + version + "</div>"); + panel.append("<div class=\"panel-body changelog-list\"></div>"); + if (version === latest) { + panel.find(".panel-heading").append(" <div class=\"label label-primary badge-label latest-version\">LATEST</div>"); + } + var changes = data.changelog[version]; + for (var c in changes) { + var change = changes[c]; + panel.find(".changelog-list").append("<li>" + change + "</li>"); + } + $(".package-versions").append(panel); + } + + }) + .fail(function() { + $(".package-error").text("An error occurred while retrieving package info!").css("display", "block"); + $(".package-info").css("display", "none"); + $(".package-name").text("Repository Error"); + return; + }); + + function getParameterByName(name) { + name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), + results = regex.exec(location.search); + return results === null ? null : decodeURIComponent(results[1].replace(/\+/g, " ")); + } + }); + </script> +</body> +</html>
\ No newline at end of file |