From: Cyperghost Date: Wed, 17 Jan 2024 14:29:24 +0000 (+0100) Subject: Revert "Rename resultsRequireVoteField" X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a29d2a9306d4da7a80f8d12e3b9142f640a79065;p=GitHub%2FWoltLab%2FWCF.git Revert "Rename resultsRequireVoteField" This reverts commit c56309ed91f2d04d7a0eee56a33ea2d019eb5551. --- diff --git a/ts/WoltLabSuite/Core/Ui/Poll/Editor.ts b/ts/WoltLabSuite/Core/Ui/Poll/Editor.ts index bba4f82771..c59dcf7f56 100644 --- a/ts/WoltLabSuite/Core/Ui/Poll/Editor.ts +++ b/ts/WoltLabSuite/Core/Ui/Poll/Editor.ts @@ -64,7 +64,8 @@ class UiPollEditor { private readonly options: UiPollEditorOptions; private readonly optionList: HTMLOListElement; private readonly questionField: HTMLInputElement; - private readonly resultsRequireVoteField: HTMLInputElement; + private readonly resultsRequireVoteNoField: HTMLInputElement | null; + private readonly resultsRequireVoteYesField: HTMLInputElement; private readonly sortByVotesField: HTMLInputElement; private readonly wysiwygId: string; @@ -92,9 +93,12 @@ class UiPollEditor { this.maxVotesField = document.getElementById(this.wysiwygId + "Poll_maxVotes") as HTMLInputElement; this.isChangeableYesField = document.getElementById(this.wysiwygId + "Poll_isChangeable") as HTMLInputElement; this.isPublicField = document.getElementById(this.wysiwygId + "Poll_isPublic") as HTMLInputElement; - this.resultsRequireVoteField = document.getElementById( + this.resultsRequireVoteYesField = document.getElementById( this.wysiwygId + "Poll_resultsRequireVote", ) as HTMLInputElement; + this.resultsRequireVoteNoField = document.getElementById( + this.wysiwygId + "Poll_resultsRequireVote_no", + ) as HTMLInputElement; this.sortByVotesField = document.getElementById(this.wysiwygId + "Poll_sortByVotes") as HTMLInputElement; this.optionCount = 0; @@ -296,7 +300,8 @@ class UiPollEditor { this.maxVotesField.value = "1"; this.isChangeableYesField.checked = false; this.isPublicField.checked = false; - this.resultsRequireVoteField.checked = false; + this.resultsRequireVoteYesField.checked = false; + if (this.resultsRequireVoteNoField) this.resultsRequireVoteNoField.checked = true; this.sortByVotesField.checked = false; EventHandler.fire("com.woltlab.wcf.poll.editor", "reset", { @@ -338,7 +343,7 @@ class UiPollEditor { data.pollIsChangeable = true; } - if (this.resultsRequireVoteField.checked) { + if (this.resultsRequireVoteYesField.checked) { data.pollResultsRequireVote = true; } @@ -401,7 +406,7 @@ class UiPollEditor { [this.maxVotesField.id]: this.maxVotesField.value, [this.isChangeableYesField.id]: !!this.isChangeableYesField.checked, [this.isPublicField.id]: !!this.isPublicField.checked, - [this.resultsRequireVoteField.id]: !!this.resultsRequireVoteField.checked, + [this.resultsRequireVoteYesField.id]: !!this.resultsRequireVoteYesField.checked, [this.sortByVotesField.id]: !!this.sortByVotesField.checked, }; } diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Poll/Editor.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Poll/Editor.js index 896196bec8..0b11bff28c 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Poll/Editor.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Poll/Editor.js @@ -23,7 +23,8 @@ define(["require", "exports", "tslib", "../../Core", "../../Language", "../Sorta options; optionList; questionField; - resultsRequireVoteField; + resultsRequireVoteNoField; + resultsRequireVoteYesField; sortByVotesField; wysiwygId; constructor(containerId, pollOptions, wysiwygId, options) { @@ -46,7 +47,8 @@ define(["require", "exports", "tslib", "../../Core", "../../Language", "../Sorta this.maxVotesField = document.getElementById(this.wysiwygId + "Poll_maxVotes"); this.isChangeableYesField = document.getElementById(this.wysiwygId + "Poll_isChangeable"); this.isPublicField = document.getElementById(this.wysiwygId + "Poll_isPublic"); - this.resultsRequireVoteField = document.getElementById(this.wysiwygId + "Poll_resultsRequireVote"); + this.resultsRequireVoteYesField = document.getElementById(this.wysiwygId + "Poll_resultsRequireVote"); + this.resultsRequireVoteNoField = document.getElementById(this.wysiwygId + "Poll_resultsRequireVote_no"); this.sortByVotesField = document.getElementById(this.wysiwygId + "Poll_sortByVotes"); this.optionCount = 0; this.options = Core.extend({ @@ -212,7 +214,9 @@ define(["require", "exports", "tslib", "../../Core", "../../Language", "../Sorta this.maxVotesField.value = "1"; this.isChangeableYesField.checked = false; this.isPublicField.checked = false; - this.resultsRequireVoteField.checked = false; + this.resultsRequireVoteYesField.checked = false; + if (this.resultsRequireVoteNoField) + this.resultsRequireVoteNoField.checked = true; this.sortByVotesField.checked = false; EventHandler.fire("com.woltlab.wcf.poll.editor", "reset", { pollEditor: this, @@ -249,7 +253,7 @@ define(["require", "exports", "tslib", "../../Core", "../../Language", "../Sorta if (this.isChangeableYesField.checked) { data.pollIsChangeable = true; } - if (this.resultsRequireVoteField.checked) { + if (this.resultsRequireVoteYesField.checked) { data.pollResultsRequireVote = true; } if (this.sortByVotesField.checked) { @@ -305,7 +309,7 @@ define(["require", "exports", "tslib", "../../Core", "../../Language", "../Sorta [this.maxVotesField.id]: this.maxVotesField.value, [this.isChangeableYesField.id]: !!this.isChangeableYesField.checked, [this.isPublicField.id]: !!this.isPublicField.checked, - [this.resultsRequireVoteField.id]: !!this.resultsRequireVoteField.checked, + [this.resultsRequireVoteYesField.id]: !!this.resultsRequireVoteYesField.checked, [this.sortByVotesField.id]: !!this.sortByVotesField.checked, }; }