From 8055dd32667277f60e962a7bc12aaacabf42adec Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Wed, 17 Jan 2024 11:53:13 +0100 Subject: [PATCH] Rename resultsRequireVoteField --- ts/WoltLabSuite/Core/Ui/Poll/Editor.ts | 15 +++++---------- .../files/js/WoltLabSuite/Core/Ui/Poll/Editor.js | 14 +++++--------- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/ts/WoltLabSuite/Core/Ui/Poll/Editor.ts b/ts/WoltLabSuite/Core/Ui/Poll/Editor.ts index c59dcf7f56..bba4f82771 100644 --- a/ts/WoltLabSuite/Core/Ui/Poll/Editor.ts +++ b/ts/WoltLabSuite/Core/Ui/Poll/Editor.ts @@ -64,8 +64,7 @@ class UiPollEditor { private readonly options: UiPollEditorOptions; private readonly optionList: HTMLOListElement; private readonly questionField: HTMLInputElement; - private readonly resultsRequireVoteNoField: HTMLInputElement | null; - private readonly resultsRequireVoteYesField: HTMLInputElement; + private readonly resultsRequireVoteField: HTMLInputElement; private readonly sortByVotesField: HTMLInputElement; private readonly wysiwygId: string; @@ -93,12 +92,9 @@ 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.resultsRequireVoteYesField = document.getElementById( + this.resultsRequireVoteField = 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; @@ -300,8 +296,7 @@ class UiPollEditor { this.maxVotesField.value = "1"; this.isChangeableYesField.checked = false; this.isPublicField.checked = false; - this.resultsRequireVoteYesField.checked = false; - if (this.resultsRequireVoteNoField) this.resultsRequireVoteNoField.checked = true; + this.resultsRequireVoteField.checked = false; this.sortByVotesField.checked = false; EventHandler.fire("com.woltlab.wcf.poll.editor", "reset", { @@ -343,7 +338,7 @@ class UiPollEditor { data.pollIsChangeable = true; } - if (this.resultsRequireVoteYesField.checked) { + if (this.resultsRequireVoteField.checked) { data.pollResultsRequireVote = true; } @@ -406,7 +401,7 @@ class UiPollEditor { [this.maxVotesField.id]: this.maxVotesField.value, [this.isChangeableYesField.id]: !!this.isChangeableYesField.checked, [this.isPublicField.id]: !!this.isPublicField.checked, - [this.resultsRequireVoteYesField.id]: !!this.resultsRequireVoteYesField.checked, + [this.resultsRequireVoteField.id]: !!this.resultsRequireVoteField.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 0b11bff28c..896196bec8 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Poll/Editor.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Poll/Editor.js @@ -23,8 +23,7 @@ define(["require", "exports", "tslib", "../../Core", "../../Language", "../Sorta options; optionList; questionField; - resultsRequireVoteNoField; - resultsRequireVoteYesField; + resultsRequireVoteField; sortByVotesField; wysiwygId; constructor(containerId, pollOptions, wysiwygId, options) { @@ -47,8 +46,7 @@ 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.resultsRequireVoteYesField = document.getElementById(this.wysiwygId + "Poll_resultsRequireVote"); - this.resultsRequireVoteNoField = document.getElementById(this.wysiwygId + "Poll_resultsRequireVote_no"); + this.resultsRequireVoteField = document.getElementById(this.wysiwygId + "Poll_resultsRequireVote"); this.sortByVotesField = document.getElementById(this.wysiwygId + "Poll_sortByVotes"); this.optionCount = 0; this.options = Core.extend({ @@ -214,9 +212,7 @@ define(["require", "exports", "tslib", "../../Core", "../../Language", "../Sorta this.maxVotesField.value = "1"; this.isChangeableYesField.checked = false; this.isPublicField.checked = false; - this.resultsRequireVoteYesField.checked = false; - if (this.resultsRequireVoteNoField) - this.resultsRequireVoteNoField.checked = true; + this.resultsRequireVoteField.checked = false; this.sortByVotesField.checked = false; EventHandler.fire("com.woltlab.wcf.poll.editor", "reset", { pollEditor: this, @@ -253,7 +249,7 @@ define(["require", "exports", "tslib", "../../Core", "../../Language", "../Sorta if (this.isChangeableYesField.checked) { data.pollIsChangeable = true; } - if (this.resultsRequireVoteYesField.checked) { + if (this.resultsRequireVoteField.checked) { data.pollResultsRequireVote = true; } if (this.sortByVotesField.checked) { @@ -309,7 +305,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.resultsRequireVoteYesField.id]: !!this.resultsRequireVoteYesField.checked, + [this.resultsRequireVoteField.id]: !!this.resultsRequireVoteField.checked, [this.sortByVotesField.id]: !!this.sortByVotesField.checked, }; } -- 2.20.1