Skip to content

Commit

Permalink
Merge pull request #4871 from Dobby233Liu/gh-pages-v240302
Browse files Browse the repository at this point in the history
gh-pages: Fix wiki index.html, and other misc. changes
  • Loading branch information
joncampbell123 authored Mar 5, 2024
2 parents 9b4fe1e + 7d6c180 commit 5503e33
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 30 deletions.
2 changes: 1 addition & 1 deletion _includes/head_common.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="icon" type="image/x-icon" href="{{ '/images/favicon.ico' | relative_url }}">
<link rel="icon" type="image/x-icon" href="{{ '/favicon.ico' | relative_url }}">
<link rel="stylesheet" type="text/css" media="screen" href="{{ '/css/style.css' | relative_url }}">
<meta name="viewport" content="width=device-width, initial-scale=1">
33 changes: 20 additions & 13 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,12 @@ header {
background: -o-linear-gradient(top, #373737, #333399);
background: linear-gradient(to bottom, #373737, #333399);
margin: 0;
padding: 20px 10px;
padding: 20px 0;
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
gap: 2em;
}

header > * {
Expand All @@ -257,7 +259,6 @@ header > * {

header > :nth-child(1) {
text-align: center;
flex-basis: 12.5em;
}
header > :nth-child(1) a:has(#dosbox-x-logo) {
display: block;
Expand All @@ -283,14 +284,9 @@ header > :nth-child(2) > :last-child {
padding-bottom: 0;
}

@media (max-width: 480px) {
header {
flex-direction: column;
align-items: flex-start;
gap: 1em;
}
header > :nth-child(1) {
flex-basis: 90px;
@media (max-width: 560px) {
#project_tagline {
display: none;
}
}

Expand Down Expand Up @@ -421,7 +417,7 @@ table.align-left > tbody > tr > td {
display: flex;
height: 100%;
padding: 0.5em 1em;
gap: 0.5em;
gap: 0.75em;
flex-wrap: wrap;
justify-content: center;
}
Expand Down Expand Up @@ -453,14 +449,25 @@ h4.release-date {

html:has(.wiki-index-html),
.wiki-index-html {
max-height: 100vh;
width: 100%; height: 100%;
}
.wiki-index-html nav {
background-color: #F8F8F7;
text-align: center;
}
.wiki-index-html main {
overflow: hidden;
position: relative;
}
.wiki-index-html main > iframe {
display: block;
}
#wiki-try-reloading {
position: absolute;
top: 50%; left: 50%;
transform: translate(-50%, -50%);
text-align: center; vertical-align: middle;
z-index: -1;
color: #555; opacity: 0.8;
}

#builds {
Expand Down
File renamed without changes.
Binary file removed images/ttfdn2.png
Binary file not shown.
9 changes: 5 additions & 4 deletions js/wiki_fake_spa.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

let contentDir = location.pathname;
contentDir = contentDir.substring(0, contentDir.lastIndexOf("/") + 1);
let contentDirUrl = location.protocol + "//" + location.host + contentDir;

function changeHash() {
let bottomLocation = frame.contentWindow.location;
if (bottomLocation.host != location.host || !bottomLocation.pathname.startsWith(contentDir))
return;
let relUrl = "#" + encodeURIComponent(decodeURIComponent(
// FIXME: Is this even correct?
let relUrl = "#" + encodeURI(decodeURIComponent(
bottomLocation.pathname.substring(contentDir.length) + bottomLocation.search + bottomLocation.hash
));
if (location.hash != relUrl) {
Expand All @@ -29,8 +29,9 @@
}
function changeBottomUrl() {
let bottomLocation = frame.contentWindow.location;
let dest = location.hash.substring(1);
let destUrl = new URL(dest, contentDirUrl), destUrlWithHtmlExt = new URL(dest, contentDirUrl);
let dest = contentDir + location.hash.substring(1);
let serverRoot = location.protocol + "//" + location.host;
let destUrl = new URL(dest, serverRoot), destUrlWithHtmlExt = destUrl;
if (!dest.includes("/") && !destUrlWithHtmlExt.pathname.endsWith(".html"))
destUrlWithHtmlExt.pathname += ".html";
if (destUrl.href != bottomLocation.href && destUrlWithHtmlExt.href != bottomLocation.href)
Expand Down
14 changes: 2 additions & 12 deletions wiki/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@
<head>
{%- include head_common.html -%}
<title>DOSBox-X Wiki</title>
<style>
#wiki-try-reloading {
position: fixed;
text-align: center; vertical-align: middle;
top: 50%; left: 50%;
transform: translate(-50%, -50%);
z-index: -1;
color: #555; opacity: 0.8;
}
</style>
</head>

<body class="wiki-index-html">
Expand All @@ -39,10 +29,10 @@
</nav>
<main>
<span id="wiki-try-reloading">If the contents don't load, try reloading the page.</span>
<noscript><iframe name="bottom" src="./Home" title="Wiki contents" sandbox="allow-same-origin allow-scripts" width="100%" height="100%"></iframe></noscript>
<noscript><iframe name="bottom" src="./Home" title="Wiki contents" sandbox="allow-same-origin allow-scripts allow-top-navigation" width="100%" height="100%"></iframe></noscript>
</main>
<template id="empty-iframe">
<iframe name="bottom" title="Wiki contents" sandbox="allow-same-origin allow-scripts" width="100%" height="100%"></iframe>
<iframe name="bottom" title="Wiki contents" sandbox="allow-same-origin allow-scripts allow-top-navigation" width="100%" height="100%"></iframe>
</template>
<script type="text/javascript" src="{{ '/js/wiki_fake_spa.js' | relative_url }}"></script>
</body>
Expand Down

0 comments on commit 5503e33

Please sign in to comment.