Skip to content

Commit 4403b49

Browse files
committed
deploy: 67cebe8
1 parent e5091e9 commit 4403b49

File tree

2,562 files changed

+55072
-176948
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,562 files changed

+55072
-176948
lines changed

coreutils/artifacts.js

Lines changed: 245 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
/* Code modified from the blender website
2+
* https://www.blender.org/wp-content/themes/bthree/assets/js/get_os.js?x82196
3+
*/
4+
5+
let options = {
6+
windows64: "x86_64-pc-windows",
7+
windows32: "i686-pc-windows",
8+
windowsArm: "aarch64-pc-windows",
9+
10+
mac64: "x86_64-apple",
11+
mac32: "i686-apple",
12+
macSilicon: "aarch64-apple",
13+
14+
linux64: "x86_64-unknown-linux",
15+
linux32: "i686-unknown-linux",
16+
linuxArm: "aarch64-unknown-linux",
17+
18+
// ios: "ios",
19+
// android: "linux-android",
20+
// freebsd: "freebsd",
21+
};
22+
23+
function isAppleSilicon() {
24+
try {
25+
var glcontext = document.createElement("canvas").getContext("webgl");
26+
var debugrenderer = glcontext
27+
? glcontext.getExtension("WEBGL_debug_renderer_info")
28+
: null;
29+
var renderername =
30+
(debugrenderer &&
31+
glcontext.getParameter(debugrenderer.UNMASKED_RENDERER_WEBGL)) ||
32+
"";
33+
if (renderername.match(/Apple M/) || renderername.match(/Apple GPU/)) {
34+
return true;
35+
}
36+
37+
return false;
38+
} catch (e) {}
39+
}
40+
41+
function getOS() {
42+
var OS = options.windows64.default;
43+
var userAgent = navigator.userAgent;
44+
var platform = navigator.platform;
45+
46+
if (navigator.appVersion.includes("Win")) {
47+
if (
48+
!userAgent.includes("Windows NT 5.0") &&
49+
!userAgent.includes("Windows NT 5.1") &&
50+
(userAgent.indexOf("Win64") > -1 ||
51+
platform == "Win64" ||
52+
userAgent.indexOf("x86_64") > -1 ||
53+
userAgent.indexOf("x86_64") > -1 ||
54+
userAgent.indexOf("amd64") > -1 ||
55+
userAgent.indexOf("AMD64") > -1 ||
56+
userAgent.indexOf("WOW64") > -1)
57+
) {
58+
OS = options.windows64;
59+
} else {
60+
if (
61+
window.external &&
62+
window.external.getHostEnvironmentValue &&
63+
window.external
64+
.getHostEnvironmentValue("os-architecture")
65+
.includes("ARM64")
66+
) {
67+
OS = options.windowsArm;
68+
} else {
69+
try {
70+
var canvas = document.createElement("canvas");
71+
var gl = canvas.getContext("webgl");
72+
73+
var debugInfo = gl.getExtension("WEBGL_debug_renderer_info");
74+
var renderer = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
75+
if (renderer.includes("Qualcomm")) OS = options.windowsArm;
76+
} catch (e) {}
77+
}
78+
}
79+
}
80+
81+
//MacOS, MacOS X, macOS
82+
if (navigator.appVersion.includes("Mac")) {
83+
if (
84+
navigator.userAgent.includes("OS X 10.5") ||
85+
navigator.userAgent.includes("OS X 10.6")
86+
) {
87+
OS = options.mac32;
88+
} else {
89+
OS = options.mac64;
90+
91+
const isSilicon = isAppleSilicon();
92+
if (isSilicon) {
93+
OS = options.macSilicon;
94+
}
95+
}
96+
}
97+
98+
// linux
99+
if (platform.includes("Linux")) {
100+
OS = options.linux64;
101+
// FIXME: Can we find out whether linux 32-bit or ARM are used?
102+
}
103+
104+
// if (
105+
// userAgent.includes("iPad") ||
106+
// userAgent.includes("iPhone") ||
107+
// userAgent.includes("iPod")
108+
// ) {
109+
// OS = options.ios;
110+
// }
111+
// if (platform.toLocaleLowerCase().includes("freebsd")) {
112+
// OS = options.freebsd;
113+
// }
114+
115+
return OS;
116+
}
117+
118+
let os = getOS();
119+
window.os = os;
120+
121+
// Unhide and hydrate selector with events
122+
const archSelect = document.querySelector(".arch-select");
123+
if (archSelect) {
124+
archSelect.classList.remove("hidden");
125+
const selector = document.querySelector("#install-arch-select");
126+
if (selector) {
127+
selector.addEventListener("change", onArchChange);
128+
}
129+
}
130+
131+
// Hydrate tab buttons with events
132+
Array.from(document.querySelectorAll(".install-tab[data-id]")).forEach((tab) => {
133+
tab.addEventListener("click", onTabClick);
134+
});
135+
136+
function onArchChange(evt) {
137+
// Get target
138+
const target = evt.currentTarget.value;
139+
// Find corresponding installer lists
140+
const newContentEl = document.querySelector(`.arch[data-arch=${target}]`);
141+
const oldContentEl = document.querySelector(`.arch[data-arch]:not(.hidden)`);
142+
// Hide old content element (if applicable)
143+
if (oldContentEl) {
144+
oldContentEl.classList.add("hidden");
145+
}
146+
// Show new content element
147+
newContentEl.classList.remove("hidden");
148+
// Show the first tab's content if nothing was selected before
149+
if (newContentEl.querySelectorAll(".install-tab.selected").length === 0) {
150+
const firstContentChild = newContentEl.querySelector(".install-content:first-of-type");
151+
const firstTabChild = newContentEl.querySelector(".install-tab:first-of-type");
152+
firstContentChild.classList.remove("hidden");
153+
if (firstTabChild) {
154+
firstTabChild.classList.add("selected");
155+
}
156+
}
157+
// Hide "no OS detected" message
158+
const noDetectEl = document.querySelector(".no-autodetect");
159+
noDetectEl.classList.add("hidden");
160+
// Hide Mac hint
161+
document.querySelector(".mac-switch").classList.add("hidden");
162+
}
163+
164+
function onTabClick(evt) {
165+
// Get target and ID
166+
const {triple, id} = evt.currentTarget.dataset;
167+
if (triple) {
168+
// Find corresponding content elements
169+
const newContentEl = document.querySelector(`.install-content[data-id="${String(id)}"][data-triple=${triple}]`);
170+
const oldContentEl = document.querySelector(`.install-content[data-triple=${triple}][data-id]:not(.hidden)`);
171+
// Find old tab to unselect
172+
const oldTabEl = document.querySelector(`.install-tab[data-triple=${triple}].selected`);
173+
// Hide old content element
174+
if (oldContentEl && oldTabEl) {
175+
oldContentEl.classList.add("hidden");
176+
oldTabEl.classList.remove("selected");
177+
}
178+
179+
// Unhide new content element
180+
newContentEl.classList.remove("hidden");
181+
// Select new tab element
182+
evt.currentTarget.classList.add("selected");
183+
}
184+
}
185+
186+
const allPlatforms = Array.from(document.querySelectorAll(`.arch[data-arch]`));
187+
let hit = allPlatforms.find(
188+
(a) => {
189+
// Show Intel Mac downloads if no M1 Mac downloads are available
190+
if (
191+
a.attributes["data-arch"].value.includes(options.mac64) &&
192+
os.includes(options.macSilicon) &&
193+
!allPlatforms.find(p => p.attributes["data-arch"].value.includes(options.macSilicon))) {
194+
// Unhide hint
195+
document.querySelector(".mac-switch").classList.remove("hidden");
196+
return true;
197+
}
198+
return a.attributes["data-arch"].value.includes(os);
199+
}
200+
);
201+
202+
if (hit) {
203+
hit.classList.remove("hidden");
204+
const selectEl = document.querySelector("#install-arch-select");
205+
selectEl.value = hit.dataset.arch;
206+
const firstContentChild = hit.querySelector(".install-content:first-of-type");
207+
const firstTabChild = hit.querySelector(".install-tab:first-of-type");
208+
firstContentChild.classList.remove("hidden");
209+
if (firstTabChild) {
210+
firstTabChild.classList.add("selected");
211+
}
212+
} else {
213+
const noDetectEl = document.querySelector(".no-autodetect");
214+
if (noDetectEl) {
215+
const noDetectElDetails = document.querySelector(".no-autodetect-details");
216+
if (noDetectElDetails) {
217+
noDetectElDetails.innerHTML = `We detected you're on ${os} but there don't seem to be installers for that. `
218+
}
219+
noDetectEl.classList.remove("hidden");
220+
}
221+
}
222+
223+
let copyButtons = Array.from(document.querySelectorAll("[data-copy]"));
224+
if (copyButtons.length) {
225+
copyButtons.forEach(function (element) {
226+
element.addEventListener("click", () => {
227+
navigator.clipboard.writeText(element.attributes["data-copy"].value);
228+
});
229+
});
230+
}
231+
232+
// Toggle for pre releases
233+
const checkbox = document.getElementById("show-prereleases");
234+
235+
if (checkbox) {
236+
checkbox.addEventListener("click", () => {
237+
const all = document.getElementsByClassName("pre-release");
238+
239+
if (all) {
240+
for (var item of all) {
241+
item.classList.toggle("hidden");
242+
}
243+
}
244+
});
245+
}

coreutils/book/.nojekyll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This file makes sure that Github Pages doesn't process mdBook's output.

coreutils/book/404.html

Lines changed: 194 additions & 0 deletions
Large diffs are not rendered by default.

coreutils/book/FontAwesome/css/font-awesome.css

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
162 KB
Binary file not shown.
162 KB
Binary file not shown.

0 commit comments

Comments
 (0)