This commit is contained in:
Azgaar 2020-06-19 00:00:55 +03:00
parent 9c8594e085
commit 52b6986a10
4 changed files with 14 additions and 4 deletions

View file

@ -418,6 +418,7 @@ const nth = n => n+(["st","nd","rd"][((n+90)%100-10)%10-1]||"th");
// conjunct array: [A,B,C] => "A, B and C"
function list(array) {
if (!Intl.ListFormat) return array.join(", ");
const conjunction = new Intl.ListFormat(window.lang || "en", {style:"long", type:"conjunction"});
return conjunction.format(array);
}
@ -574,7 +575,12 @@ function getAbsolutePath(href) {
// open URL in a new tab or window
function openURL(url) {
window.open(url, '_blank');
window.open(url, "_blank");
}
// open project wiki-page
function wiki(page) {
window.open("https://github.com/Azgaar/Fantasy-Map-Generator/wiki/" + page, "_blank");
}
// wrap URL into html a element