Skip to content

Commit

Permalink
fixed broken inline vars
Browse files Browse the repository at this point in the history
  • Loading branch information
ThinLiquid committed Aug 18, 2024
1 parent 97fd385 commit 1552a6e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
26 changes: 12 additions & 14 deletions root.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
<window-control type="maximize"></window-control>
</window-controls>
<window-title>
{{ page - title }}
{{ page-title }}
</window-title>
</window-titlebar>
<window-content>
Expand Down Expand Up @@ -221,11 +221,9 @@
commit - hash
}}"
>
{{ commit - hash - short }}
{{ commit-hash-short }}
</a>
<small style="margin-top: 5px; display: block">{{
commit - message
}}</small>
<small style="margin-top: 5px; display: block">{{ commit-message }}</small>
</div>
</window-content>
</window>
Expand All @@ -237,16 +235,16 @@
var player
function pauseButton() {
button = document.getElementById('play')
if (player.togglePause()) button.innerHTML = 'Pause'
else button.innerHTML = 'Play'
if (player.togglePause()) button.innerText = 'Pause'
else button.innerText = 'Play'
}

function setMetadata(filename) {
var metadata = player.metadata()
if (metadata['title'] != '') {
document.getElementById('title').innerHTML = metadata['title']
document.getElementById('title').innerText = metadata['title']
} else {
document.getElementById('title').innerHTML = filename
document.getElementById('title').innerText = filename
}

var subsongs = player.subsongs()
Expand All @@ -271,7 +269,7 @@
updateDuration()

var stack = stackSave()
document.getElementById('library-version').innerHTML =
document.getElementById('library-version').innerText =
'Library version: libopenmpt ' +
UTF8ToString(
libopenmpt._openmpt_get_string(asciiToStack('library_version'))
Expand All @@ -296,12 +294,12 @@
if (seconds < 10) {
seconds = '0' + seconds
}
document.getElementById('duration').innerHTML = minutes + ':' + seconds
document.getElementById('duration').innerText = minutes + ':' + seconds
document.getElementById('seekbar').max = sec_num
}

if (typeof ChiptuneAudioContext == 'undefined') {
document.getElementById('play').innerHTML =
document.getElementById('play').innerText =
'The player requires a recent web browser with HTML5 audio context support.'
}
function initPlayer() {
Expand All @@ -311,9 +309,9 @@
path = '/audio/{{ modfile }}'
player.load(path, function (buffer) {
if (player.play(buffer)) {
document.getElementById('play').innerHTML = 'Pause'
document.getElementById('play').innerText = 'Pause'
} else {
document.getElementById('play').innerHTML = 'Play'
document.getElementById('play').innerText = 'Play'
}
setMetadata(document.getElementById('modfilename').innerHTML)
setInterval(progress, 500)
Expand Down
3 changes: 2 additions & 1 deletion scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,13 @@ const format = async (filename: string, data: string) => {
.replaceAll("{{ title }}", filename.endsWith("index.md") ? '' : `${json.meta.title} | `)
.replaceAll("{{ page-title }}", json.meta.title)
.replaceAll("{{ description }}", json.meta.description)
.replace("{{ content }}", md)
.replaceAll("{{ commit-hash }}", commitHash)
.replaceAll("{{ commit-hash-short }}", commitHash.slice(0, 7))
.replaceAll("{{ commit-branch }}", commitBranch)
.replaceAll("{{ commit-message }}", commitMessage)
.replace("{{ modfile }}", json.meta.modfile ?? 'gemini-bleeps.mod')
.replace("{{ content }}", md)


const beautified = await prettier.format(page, { parser: "html", htmlWhitespaceSensitivity: "ignore", printWidth: Infinity });

Expand Down
4 changes: 2 additions & 2 deletions src/public/scripts/chiptune2.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ ChiptuneJsPlayer.prototype.load = function(input, callback) {
xhr.responseType = 'arraybuffer';
xhr.onprogress = (e) => {
if (e.lengthComputable) {
document.getElementById("play").innerHTML = `Loading... ${Math.floor((e.loaded / e.total) * 100)}%`;
document.getElementById("play").innerText = `Loading... ${Math.floor((e.loaded / e.total) * 100)}%`;
}
};
xhr.onload = (e) => {
Expand All @@ -133,7 +133,7 @@ ChiptuneJsPlayer.prototype.load = function(input, callback) {
this.fireEvent('onError', {type: 'onxhr'});
};
xhr.onerror = () => {
document.getElementById("play").innerHTML = "Error while downloading file for playback :-(";
document.getElementById("play").innerText = "Error while downloading file for playback :-(";
this.fireEvent('onError', {type: 'onxhr'});
};
xhr.onabort = () => {
Expand Down

0 comments on commit 1552a6e

Please sign in to comment.