Renamed "regular" to "recurring" in the description editor.

This commit is contained in:
依瑪貓 2023-03-21 17:43:38 +08:00
parent 8818b46e01
commit 5dccf99a55
2 changed files with 15 additions and 15 deletions

View File

@ -102,7 +102,7 @@ class DescriptionEditor {
/** /**
* The tab planes * The tab planes
* @type {{general: GeneralTagTab, travel: GeneralTripTab, bus: BusTripTab, regular: RegularPaymentTab, annotation: AnnotationTab}} * @type {{general: GeneralTagTab, travel: GeneralTripTab, bus: BusTripTab, recurring: RecurringTransactionTab, annotation: AnnotationTab}}
*/ */
tabPlanes = {}; tabPlanes = {};
@ -125,7 +125,7 @@ class DescriptionEditor {
// noinspection JSValidateTypes // noinspection JSValidateTypes
this.#accountButtons = Array.from(document.getElementsByClassName(this.prefix + "-account")); this.#accountButtons = Array.from(document.getElementsByClassName(this.prefix + "-account"));
for (const cls of [GeneralTagTab, GeneralTripTab, BusTripTab, RegularPaymentTab, AnnotationTab]) { for (const cls of [GeneralTagTab, GeneralTripTab, BusTripTab, RecurringTransactionTab, AnnotationTab]) {
const tab = new cls(this); const tab = new cls(this);
this.tabPlanes[tab.tabId()] = tab; this.tabPlanes[tab.tabId()] = tab;
} }
@ -985,17 +985,17 @@ class BusTripTab extends TagTabPlane {
} }
/** /**
* The regular payment tab plane. * The recurring transaction tab plane.
* *
* @private * @private
*/ */
class RegularPaymentTab extends TabPlane { class RecurringTransactionTab extends TabPlane {
/** /**
* The payment buttons * The transaction buttons
* @type {HTMLButtonElement[]} * @type {HTMLButtonElement[]}
*/ */
#payments; #transactions;
// noinspection JSValidateTypes // noinspection JSValidateTypes
/** /**
@ -1007,7 +1007,7 @@ class RegularPaymentTab extends TabPlane {
constructor(editor) { constructor(editor) {
super(editor); super(editor);
// noinspection JSValidateTypes // noinspection JSValidateTypes
this.#payments = Array.from(document.getElementsByClassName(this.prefix + "-payment")); this.#transactions = Array.from(document.getElementsByClassName(this.prefix + "-transaction"));
} }
/** /**
@ -1017,7 +1017,7 @@ class RegularPaymentTab extends TabPlane {
* @abstract * @abstract
*/ */
tabId() { tabId() {
return "regular"; return "recurring";
}; };
/** /**
@ -1026,9 +1026,9 @@ class RegularPaymentTab extends TabPlane {
* @override * @override
*/ */
reset() { reset() {
for (const payment of this.#payments) { for (const transaction of this.#transactions) {
payment.classList.remove("btn-primary"); transaction.classList.remove("btn-primary");
payment.classList.add("btn-outline-primary"); transaction.classList.add("btn-outline-primary");
} }
} }

View File

@ -55,8 +55,8 @@ First written: 2023/2/28
</span> </span>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<span id="accounting-description-editor-{{ description_editor.debit_credit }}-regular-tab" class="nav-link accounting-clickable" aria-current="false"> <span id="accounting-description-editor-{{ description_editor.debit_credit }}-recurring-tab" class="nav-link accounting-clickable" aria-current="false">
{{ A_("Regular") }} {{ A_("Recurring") }}
</span> </span>
</li> </li>
<li class="nav-item"> <li class="nav-item">
@ -154,8 +154,8 @@ First written: 2023/2/28
</div> </div>
</div> </div>
{# A regular income or payment #} {# A recurring transaction #}
<div id="accounting-description-editor-{{ description_editor.debit_credit }}-regular-page" class="d-none" aria-current="false" aria-labelledby="accounting-description-editor-{{ description_editor.debit_credit }}-regular-tab"> <div id="accounting-description-editor-{{ description_editor.debit_credit }}-recurring-page" class="d-none" aria-current="false" aria-labelledby="accounting-description-editor-{{ description_editor.debit_credit }}-recurring-tab">
{# TODO: To be done #} {# TODO: To be done #}
</div> </div>