-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
103 lines (103 loc) · 4.74 KB
/
index.html
File metadata and controls
103 lines (103 loc) · 4.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<title>Acme Commander</title>
<style>[href^="#"]:not(:focus):not(:hover) { text-decoration: none; }</style>
<h1>Orthodox file manager for modern Linux desktop. Two directory panels, SFTP access, familiar keyboard shortcuts.</h1>
<a href=https://user-images.githubusercontent.com/20999066/32144815-0734201e-bcc7-11e7-86c8-a990a9e7ff1e.png>
<img alt="Twin panel file manager Acme Commander screenshot" height=101 width=128 src=https://user-images.githubusercontent.com/20999066/32144815-0734201e-bcc7-11e7-86c8-a990a9e7ff1e.png style=float:left;margin-right:1em /></a>
<p><a href=https://github.com/makepost/acme-commander id=git>GitHub</a>
<a href=https://github.com/makepost/acme-commander/releases>Download</a>
<a href=https://github.com/makepost/acme-commander/issues style=color: red;>Report issue</a>
<a href=https://twitter.com/make_post/with_replies>Tweet feedback</a>
<a href=https://blogtrottr.com/?subscribe=https://github.com/makepost/acme-commander/commits.atom>Get email</a>
<a href=https://github.com/makepost/acme-commander/subscription>Follow talk</a>
<a href=https://github.com/makepost/acme-commander/blob/master/LICENSE>0BSD license</a>
<pre style=overflow-y:auto># Ubuntu Desktop 18.04 | <a href=https://github.com/makepost/acme-commander/blob/master/README.md#usage>Something else</a>
sudo apt update && sudo apt install git npm python-gtk2
echo prefix=~/.local >> ~/.npmrc
npm i -g acme-commander
acme-commander</pre><hr style=clear:left />
<script src=https://cdn.polyfill.io/v2/polyfill.js?features=default,fetch></script>
<script>/** @param {string} path @returns {any} */ function gh(path) {
var id = git.href.replace(/^.*\/(.*\/.*)$/, "$1");
return fetch("https://api.github.com/repos/" + id + path, {
headers: { Authorization: localStorage.Authorization }
}).then(function(res) {
return res.json();
});
}
/** @param {string} text @param {string} href */ function Link(text, href) {
var link = document.createElement("a");
return (link.href = href), (link.textContent = text), link;
}
/**
* @typedef Resource
* @property {{ committer: { date: string }, message: string }} commit
* @property {string} html_url
* @typedef Issue @property {string} html_url @property {string} title
*/
var $s = [gh("/issues?sort=updated")].concat(
[1, 2, 3, 4, 5].map(function(i) {
return gh("/commits?page=" + i + "&per_page=100");
})
);
Promise.all($s).then(function(/** @type {any[]} */ res) {
var issues = document.createElement("p");
issues.textContent = "Issues: ";
for (var i = 0; i < res[0].length; i++) {
/** @type {Issue} */ var issue = res[0][i];
issues.appendChild(Link(issue.title, issue.html_url));
issues.appendChild(document.createTextNode(" "));
}
document.body.appendChild(issues);
/** @type {any} */ var resources = [].concat.apply([], res.splice(1));
for (i = 0; i < resources.length; i++) {
/** @type {Resource} */ var resource = resources[i];
var lines = resource.commit.message.split("\n");
var hr = document.createElement("hr");
hr.id = lines[0]
.toLowerCase()
.split(/[^\w.]/)
.filter(Boolean)
.slice(0, 3)
.join("");
document.body.appendChild(hr);
title = document.createElement("p");
var link = Link(resource.commit.committer.date.split("T")[0], "#" + hr.id);
title.appendChild(link), title.append(" ");
link = Link(lines[0], resource.html_url.replace(/.{33}$/, ""));
if (/^v\d+\.\d+\.\d+$/.test(resource.commit.message)) {
link.href = git.href + "/tree/" + lines[0];
strong = document.createElement("strong");
strong.appendChild(link);
strong.appendChild(document.createTextNode(", source .tar.gz: "));
strong.appendChild(Link("Download", git.href + "/tarball/" + lines[0]));
title.appendChild(strong);
} else title.appendChild(link);
document.body.appendChild(title);
if (lines.length > 2) {
var msg = document.createElement("p");
msg.textContent = lines
.slice(2)
.join("\n")
.replace(/(.)\n(.)/g, "$1 $2");
msg.innerHTML = msg.innerHTML.replace(
/#(\d+)/g,
"<a href='" + git.href + "/issues/$1'>#$1</a>"
);
document.body.appendChild(msg);
}
}
document.body.appendChild(document.createElement("hr"));
document.body.appendChild(document.querySelectorAll("p")[0].cloneNode(!0));
document.querySelectorAll(location.hash || "html")[0].scrollIntoView();
var hrs = document.querySelectorAll("hr");
var scroll = Date.now();
document.addEventListener("scroll", function() {
if (Date.now() - 4e3 < scroll) return;
scroll = Date.now();
for (var j = hrs.length; --j; )
if (hrs[j].getBoundingClientRect().top < 1) {
history.replaceState({}, "", location.pathname + "#" + hrs[j].id);
break;
}
});
});</script>