refactor fe-0001, add 0003-en_3pp

This commit is contained in:
41666 2024-04-06 16:34:32 -04:00
parent 94093fac04
commit c7b88d3672
4 changed files with 1322 additions and 70 deletions

View file

@ -12,3 +12,5 @@ _none_
- 0001-confirm-favorite: opens a "confirmation" modal on favorites, identical to reposts. (TODO: undo formatting changes) - 0001-confirm-favorite: opens a "confirmation" modal on favorites, identical to reposts. (TODO: undo formatting changes)
- 0002-move-notifications: moves toast notifications to the bottom of the screen - 0002-move-notifications: moves toast notifications to the bottom of the screen
- 0003-en_3pp: adds "English (3rd Person)" locale
- If you want to use this without the patch, copy this over the one's en.json: https://codeberg.org/tachikoma/tachikoma-fe/src/branch/0003-en_3pp/src/i18n/en_3pp.json

View file

@ -1,96 +1,61 @@
diff --git a/src/components/favorite_button/favorite_button.js b/src/components/favorite_button/favorite_button.js diff --git a/src/components/favorite_button/favorite_button.js b/src/components/favorite_button/favorite_button.js
index d15699f7..e5f1a3c5 100644 index d15699f7..cca8a479 100644
--- a/src/components/favorite_button/favorite_button.js --- a/src/components/favorite_button/favorite_button.js
+++ b/src/components/favorite_button/favorite_button.js +++ b/src/components/favorite_button/favorite_button.js
@@ -1,41 +1,60 @@ @@ -1,4 +1,5 @@
-import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
-import { library } from '@fortawesome/fontawesome-svg-core' +import ConfirmModal from '../confirm_modal/confirm_modal.vue'
-import { faStar } from '@fortawesome/free-solid-svg-icons' import { library } from '@fortawesome/fontawesome-svg-core'
-import { import { faStar } from '@fortawesome/free-solid-svg-icons'
- faStar as faStarRegular import {
-} from '@fortawesome/free-regular-svg-icons' @@ -12,13 +13,24 @@ library.add(
+import ConfirmModal from "../confirm_modal/confirm_modal.vue";
+import { mapGetters } from "vuex";
+import { library } from "@fortawesome/fontawesome-svg-core";
+import { faStar } from "@fortawesome/free-solid-svg-icons";
+import { faStar as faStarRegular } from "@fortawesome/free-regular-svg-icons";
-library.add(
- faStar,
- faStarRegular
-)
+library.add(faStar, faStarRegular);
const FavoriteButton = { const FavoriteButton = {
- props: ['status', 'loggedIn'], props: ['status', 'loggedIn'],
- data () {
+ props: ["status", "loggedIn"],
+ components: { + components: {
+ ConfirmModal, + ConfirmModal
+ }, + },
+ data() { data () {
return { return {
- animated: false - animated: false
- }
+ animated: false, + animated: false,
+ showingConfirmDialog: false, + showingConfirmDialog: false
+ }; }
}, },
methods: { methods: {
- favorite () { favorite () {
+ favorite() { + if (!this.status.repeated && this.shouldConfirmFavorite) {
+ if (!this.status.favorited && this.shouldConfirmFavorite) { + this.showConfirmDialog()
+ this.showConfirmDialog();
+ } else { + } else {
+ this.doFavorite(); + this.doFavorite()
+ } + }
+ }, + },
+ doFavorite () { + doFavorite () {
if (!this.status.favorited) { if (!this.status.favorited) {
- this.$store.dispatch('favorite', { id: this.status.id }) this.$store.dispatch('favorite', { id: this.status.id })
+ this.$store.dispatch("favorite", { id: this.status.id });
} else { } else {
- this.$store.dispatch('unfavorite', { id: this.status.id }) @@ -28,12 +40,21 @@ const FavoriteButton = {
+ this.$store.dispatch("unfavorite", { id: this.status.id });
}
- this.animated = true
+ this.animated = true;
setTimeout(() => { setTimeout(() => {
- this.animated = false this.animated = false
- }, 500) }, 500)
- }
+ this.animated = false;
+ }, 500);
+ this.hideConfirmDialog();
+ }, + },
+ showConfirmDialog () { + showConfirmDialog () {
+ this.showingConfirmDialog = true; + this.showingConfirmDialog = true
+ }, + },
+ hideConfirmDialog () { + hideConfirmDialog () {
+ this.showingConfirmDialog = false; + this.showingConfirmDialog = false
+ }, }
}, },
computed: { computed: {
- ...mapGetters(['mergedConfig']), ...mapGetters(['mergedConfig']),
- remoteInteractionLink () { remoteInteractionLink () {
- return this.$store.getters.remoteInteractionLink({ statusId: this.status.id }) return this.$store.getters.remoteInteractionLink({ statusId: this.status.id })
- }
- }
-}
+ ...mapGetters(["mergedConfig"]),
+ shouldConfirmFavorite() {
+ return this.mergedConfig.modalOnFavorite;
+ }, + },
+ remoteInteractionLink() { + shouldConfirmRepeat () {
+ return this.$store.getters.remoteInteractionLink({ + return this.mergedConfig.modalOnRepeat
+ statusId: this.status.id, }
+ }); }
+ }, }
+ },
+};
-export default FavoriteButton
+export default FavoriteButton;
diff --git a/src/components/favorite_button/favorite_button.vue b/src/components/favorite_button/favorite_button.vue diff --git a/src/components/favorite_button/favorite_button.vue b/src/components/favorite_button/favorite_button.vue
index 16bf441e..06ed7d59 100644 index 16bf441e..06ed7d59 100644
--- a/src/components/favorite_button/favorite_button.vue --- a/src/components/favorite_button/favorite_button.vue
@ -130,6 +95,29 @@ index 64950f8a..b09c6d9f 100644
<li> <li>
<BooleanSetting path="modalOnUnfollow"> <BooleanSetting path="modalOnUnfollow">
{{ $t('settings.confirm_dialogs_unfollow') }} {{ $t('settings.confirm_dialogs_unfollow') }}
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 965cddb0..ed140e5a 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -510,6 +510,7 @@
"confirm_dialogs_deny_follow": "Rejecting a follow request",
"confirm_dialogs_mute": "Muting someone",
"confirm_dialogs_repeat": "Repeating a post",
+ "confirm_dialogs_favorite": "Favoriting a post",
"confirm_dialogs_unfollow": "Unfollowing someone",
"confirm_new_password": "Confirm new password",
"confirmation_dialogs": "Confirmation options",
@@ -975,6 +976,10 @@
"expand": "Expand",
"external_source": "External source",
"favorites": "Favorites",
+ "favorite_confirm": "Do you really want to favorite this post?",
+ "favorite_confirm_accept_button": "Yes, favorite it",
+ "favorite_confirm_cancel_button": "No, don't favorite",
+ "favorite_confirm_title": "Confirm favorite",
"hide_attachment": "Hide attachment",
"hide_content": "Hide content",
"hide_full_subject": "Hide full content warning",
diff --git a/src/modules/config.js b/src/modules/config.js diff --git a/src/modules/config.js b/src/modules/config.js
index 551b5bb6..0e78c749 100644 index 551b5bb6..0e78c749 100644
--- a/src/modules/config.js --- a/src/modules/config.js

1261
akkoma-fe/0003-en_3pp.patch Normal file

File diff suppressed because it is too large Load diff

View file

@ -73,6 +73,7 @@
patches = [ patches = [
./akkoma-fe/0001-confirm-favorite.patch ./akkoma-fe/0001-confirm-favorite.patch
./akkoma-fe/0002-move-notifications.patch ./akkoma-fe/0002-move-notifications.patch
./akkoma-fe/0003-en_3pp.patch
]; ];
patchFlags = "-p1 -F5"; patchFlags = "-p1 -F5";
}); });