Skip to content

Commit

Permalink
web: Disable the copy notes button when using custom palette
Browse files Browse the repository at this point in the history
  • Loading branch information
liamappelbe committed Feb 5, 2024
1 parent 7e9ffa7 commit 96efe20
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions thumb.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
let domAdvancedWrap = null;
let domInputView = null;
let domOutputView = null;
let domCopyOrDownload = null;
let domOnlyDownload = null;
let ctxInput = null;
let ctxOutput = null;
let inputImage = null;
Expand All @@ -59,12 +61,15 @@
domAdvancedWrap = document.getElementById("advanced_wrap");
domInputView = document.getElementById("input_view");
domOutputView = document.getElementById("output_view");
domCopyOrDownload = document.getElementById("copy_or_download");
domOnlyDownload = document.getElementById("only_download");
ctxInput = domInputView.getContext("2d");
ctxOutput = domOutputView.getContext("2d");

ctxOutput.imageSmoothingEnabled = false;

hitCountRequest('thumb', '-1a9p7wtyt50p3');
onChange();
}
window.addEventListener("load", onLoad);

Expand Down Expand Up @@ -194,8 +199,19 @@
}
}

function setDownloadMessage() {
if (domCustomPal.checked) {
domCopyOrDownload.classList.add('hidden');
domOnlyDownload.classList.remove('hidden');
} else {
domCopyOrDownload.classList.remove('hidden');
domOnlyDownload.classList.add('hidden');
}
}

function onChange() {
setChannelWeightLabels(domSpace.value);
setDownloadMessage();
if (inputImage == null) return;
runThumbnailGenerator(inputImage);
}
Expand Down Expand Up @@ -380,8 +396,13 @@ <h1>OS Thumbnail Generator</h1>
</span>
</div>
<br/><br/>
<a onclick="copyNotes()">Copy the notes to the clipboard</a> or
<a onclick="downloadFile()">download the sequence file</a>
<div id="copy_or_download" class="hidden">
<a onclick="copyNotes()">Copy the notes to the clipboard</a> or
<a onclick="downloadFile()">download the sequence file</a>
</div>
<div id="only_download">
<a onclick="downloadFile()">Download the sequence file</a>
</div>
</div>
</div>
</body>
Expand Down

0 comments on commit 96efe20

Please sign in to comment.