checkboxes event functions + docs

This commit is contained in:
ReznoRMichael 2021-02-15 23:09:29 +01:00
parent 8a365f6a84
commit f2eba3fbda
4 changed files with 16 additions and 11 deletions

File diff suppressed because one or more lines are too long

View file

@ -200,11 +200,13 @@
<div class="checkboxes"> <div class="checkboxes">
<label for="checkbox-hints" class="checkbox-label" title="Check to see an optional clue for your first playthrough based on your save's progress."> <label for="checkbox-hints" class="checkbox-label" title="Check to see an optional clue for your first playthrough based on your save's progress.">
<input type="checkbox" name="checkboxes" id="checkbox-hints" value="hints-off" onclick="CheckboxHintsToggle();"> <!-- <input type="checkbox" name="checkboxes" id="checkbox-hints" value="hints-off" onclick="CheckboxHintsToggle();"> -->
<input type="checkbox" name="checkboxes" id="checkbox-hints" value="hints-off">
<span class="checkmark"></span>Hints <span class="checkmark"></span>Hints
</label> </label>
<label for="checkbox-spoilers" class="checkbox-label" title="Check to show every item's locations and costs. Hidden by default."> <label for="checkbox-spoilers" class="checkbox-label" title="Check to show every item's locations and costs. Hidden by default.">
<input type="checkbox" name="checkboxes" id="checkbox-spoilers" value="spoilers-off" onclick="CheckboxSpoilersToggle();"> <!-- <input type="checkbox" name="checkboxes" id="checkbox-spoilers" value="spoilers-off" onclick="CheckboxSpoilersToggle();"> -->
<input type="checkbox" name="checkboxes" id="checkbox-spoilers" value="spoilers-off">
<span class="checkmark"></span>Spoilers <span class="checkmark"></span>Spoilers
</label> </label>
</div> </div>

View file

@ -85,11 +85,13 @@
<div class="checkboxes"> <div class="checkboxes">
<label for="checkbox-hints" class="checkbox-label" title="Check to see an optional clue for your first playthrough based on your save's progress."> <label for="checkbox-hints" class="checkbox-label" title="Check to see an optional clue for your first playthrough based on your save's progress.">
<input type="checkbox" name="checkboxes" id="checkbox-hints" value="hints-off" onclick="CheckboxHintsToggle();"> <!-- <input type="checkbox" name="checkboxes" id="checkbox-hints" value="hints-off" onclick="CheckboxHintsToggle();"> -->
<input type="checkbox" name="checkboxes" id="checkbox-hints" value="hints-off">
<span class="checkmark"></span>Hints <span class="checkmark"></span>Hints
</label> </label>
<label for="checkbox-spoilers" class="checkbox-label" title="Check to show every item's locations and costs. Hidden by default."> <label for="checkbox-spoilers" class="checkbox-label" title="Check to show every item's locations and costs. Hidden by default.">
<input type="checkbox" name="checkboxes" id="checkbox-spoilers" value="spoilers-off" onclick="CheckboxSpoilersToggle();"> <!-- <input type="checkbox" name="checkboxes" id="checkbox-spoilers" value="spoilers-off" onclick="CheckboxSpoilersToggle();"> -->
<input type="checkbox" name="checkboxes" id="checkbox-spoilers" value="spoilers-off">
<span class="checkmark"></span>Spoilers <span class="checkmark"></span>Spoilers
</label> </label>
</div> </div>

View file

@ -1160,7 +1160,6 @@ function CheckHintsTrue(divId, dataObject, playerData, worldData) {
*/ */
function HKReadTextArea(textAreaId = "") { function HKReadTextArea(textAreaId = "") {
console.log("HKReadTextArea()");
// refresh and prepare document for filling with data from the save // refresh and prepare document for filling with data from the save
InitialHTMLPopulate(HK.DIV_ID); InitialHTMLPopulate(HK.DIV_ID);
@ -1451,19 +1450,21 @@ document.getElementById("save-location-input").addEventListener("click", (e) =>
SelectCopyInputText(e, "save-location-input-tooltip", "Copied save file location to clipboard"); SelectCopyInputText(e, "save-location-input-tooltip", "Copied save file location to clipboard");
}, false); }, false);
// Choose File input field
document.getElementById("save-location-input").addEventListener("mouseout", () => { document.getElementById("save-location-input").addEventListener("mouseout", () => {
FillInnerHTML("save-location-input-tooltip", "Click once to copy to clipboard"); FillInnerHTML("save-location-input-tooltip", "Click once to copy to clipboard");
}, false); }, false);
// Make functions global so they can be used on click and change events (for Webpack) // Analyze Text button
// window.HKReadTextArea = HKReadTextArea;
window.CheckboxSpoilersToggle = CheckboxSpoilersToggle;
window.CheckboxHintsToggle = CheckboxHintsToggle;
document.getElementById("save-area-read").addEventListener("click", () => { document.getElementById("save-area-read").addEventListener("click", () => {
HKReadTextArea("save-area"); HKReadTextArea("save-area");
}, false); }, false);
// Checkboxes functions
document.getElementById("checkbox-hints").addEventListener("click", CheckboxHintsToggle, false);
document.getElementById("checkbox-spoilers").addEventListener("click", CheckboxSpoilersToggle, false);
export { export {
// to use in LoadSaveFile.js for auto-analyzing file after decoding
HKReadTextArea HKReadTextArea
}; };