diff --git a/src/App.js b/src/App.js index 6637a08e..5310d504 100644 --- a/src/App.js +++ b/src/App.js @@ -12,6 +12,7 @@ import DesktopNav from './components/desktop_nav/desktop_nav.vue' import UserReportingModal from './components/user_reporting_modal/user_reporting_modal.vue' import EditStatusModal from './components/edit_status_modal/edit_status_modal.vue' import PostStatusModal from './components/post_status_modal/post_status_modal.vue' +import StatusHistoryModal from './components/status_history_modal/status_history_modal.vue' import GlobalNoticeList from './components/global_notice_list/global_notice_list.vue' import { windowWidth, windowHeight } from './services/window_utils/window_utils' import { mapGetters } from 'vuex' @@ -35,6 +36,7 @@ export default { UserReportingModal, PostStatusModal, EditStatusModal, + StatusHistoryModal, GlobalNoticeList }, data: () => ({ diff --git a/src/App.vue b/src/App.vue index 1e2cd343..7aad1a65 100644 --- a/src/App.vue +++ b/src/App.vue @@ -59,6 +59,7 @@ + diff --git a/src/components/extra_buttons/extra_buttons.js b/src/components/extra_buttons/extra_buttons.js index 2a375a80..27b9b7c9 100644 --- a/src/components/extra_buttons/extra_buttons.js +++ b/src/components/extra_buttons/extra_buttons.js @@ -7,7 +7,8 @@ import { faEyeSlash, faThumbtack, faShareAlt, - faExternalLinkAlt + faExternalLinkAlt, + faHistory } from '@fortawesome/free-solid-svg-icons' import { faBookmark as faBookmarkReg, @@ -22,7 +23,8 @@ library.add( faThumbtack, faShareAlt, faExternalLinkAlt, - faFlag + faFlag, + faHistory ) const ExtraButtons = { @@ -114,6 +116,20 @@ const ExtraButtons = { visibility: this.status.visibility, statusContentType: data.content_type })) + }, + showStatusHistory () { + let originalStatus = {} + Object.assign(originalStatus, this.status) + delete originalStatus.attachments + delete originalStatus.created_at + delete originalStatus.emojis + delete originalStatus.text + delete originalStatus.raw_html + delete originalStatus.nsfw + delete originalStatus.poll + delete originalStatus.summary + delete originalStatus.summary_raw_html + this.$store.dispatch('openStatusHistoryModal', originalStatus) } }, computed: { @@ -147,6 +163,9 @@ const ExtraButtons = { }, shouldConfirmDelete () { return this.$store.getters.mergedConfig.modalOnDelete + }, + isEdited () { + return this.status.edited_at !== null } } } diff --git a/src/components/extra_buttons/extra_buttons.vue b/src/components/extra_buttons/extra_buttons.vue index b3ccb370..b10ceb2b 100644 --- a/src/components/extra_buttons/extra_buttons.vue +++ b/src/components/extra_buttons/extra_buttons.vue @@ -84,6 +84,17 @@ icon="pen" />{{ $t("status.edit") }} +