logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/

extra_buttons.vue (6417B)


  1. <template>
  2. <Popover
  3. class="ExtraButtons"
  4. trigger="click"
  5. :trigger-attrs="triggerAttrs"
  6. placement="top"
  7. :offset="{ y: 5 }"
  8. :bound-to="{ x: 'container' }"
  9. remove-padding
  10. @show="onShow"
  11. @close="onClose"
  12. >
  13. <template #content="{close}">
  14. <div
  15. :id="`popup-menu-${randomSeed}`"
  16. class="dropdown-menu"
  17. role="menu"
  18. >
  19. <button
  20. v-if="canMute && !status.thread_muted"
  21. class="menu-item dropdown-item dropdown-item-icon"
  22. role="menuitem"
  23. @click.prevent="muteConversation"
  24. >
  25. <FAIcon
  26. fixed-width
  27. icon="eye-slash"
  28. /><span>{{ $t("status.mute_conversation") }}</span>
  29. </button>
  30. <button
  31. v-if="canMute && status.thread_muted"
  32. class="menu-item dropdown-item dropdown-item-icon"
  33. role="menuitem"
  34. @click.prevent="unmuteConversation"
  35. >
  36. <FAIcon
  37. fixed-width
  38. icon="eye-slash"
  39. /><span>{{ $t("status.unmute_conversation") }}</span>
  40. </button>
  41. <button
  42. v-if="!status.pinned && canPin"
  43. class="menu-item dropdown-item dropdown-item-icon"
  44. role="menuitem"
  45. @click.prevent="pinStatus"
  46. @click="close"
  47. >
  48. <FAIcon
  49. fixed-width
  50. icon="thumbtack"
  51. /><span>{{ $t("status.pin") }}</span>
  52. </button>
  53. <button
  54. v-if="status.pinned && canPin"
  55. class="menu-item dropdown-item dropdown-item-icon"
  56. role="menuitem"
  57. @click.prevent="unpinStatus"
  58. @click="close"
  59. >
  60. <FAIcon
  61. fixed-width
  62. icon="thumbtack"
  63. /><span>{{ $t("status.unpin") }}</span>
  64. </button>
  65. <template v-if="canBookmark">
  66. <button
  67. v-if="!status.bookmarked"
  68. class="menu-item dropdown-item dropdown-item-icon"
  69. role="menuitem"
  70. @click.prevent="bookmarkStatus"
  71. @click="close"
  72. >
  73. <FAIcon
  74. fixed-width
  75. :icon="['far', 'bookmark']"
  76. /><span>{{ $t("status.bookmark") }}</span>
  77. </button>
  78. <button
  79. v-if="status.bookmarked"
  80. class="menu-item dropdown-item dropdown-item-icon"
  81. role="menuitem"
  82. @click.prevent="unbookmarkStatus"
  83. @click="close"
  84. >
  85. <FAIcon
  86. fixed-width
  87. icon="bookmark"
  88. /><span>{{ $t("status.unbookmark") }}</span>
  89. </button>
  90. </template>
  91. <button
  92. v-if="ownStatus && editingAvailable"
  93. class="menu-item dropdown-item dropdown-item-icon"
  94. role="menuitem"
  95. @click.prevent="editStatus"
  96. @click="close"
  97. >
  98. <FAIcon
  99. fixed-width
  100. icon="pen"
  101. /><span>{{ $t("status.edit") }}</span>
  102. </button>
  103. <button
  104. v-if="isEdited && editingAvailable"
  105. class="menu-item dropdown-item dropdown-item-icon"
  106. role="menuitem"
  107. @click.prevent="showStatusHistory"
  108. @click="close"
  109. >
  110. <FAIcon
  111. fixed-width
  112. icon="history"
  113. /><span>{{ $t("status.status_history") }}</span>
  114. </button>
  115. <button
  116. v-if="canDelete"
  117. class="menu-item dropdown-item dropdown-item-icon"
  118. role="menuitem"
  119. @click.prevent="deleteStatus"
  120. @click="close"
  121. >
  122. <FAIcon
  123. fixed-width
  124. icon="times"
  125. /><span>{{ $t("status.delete") }}</span>
  126. </button>
  127. <button
  128. class="menu-item dropdown-item dropdown-item-icon"
  129. role="menuitem"
  130. @click.prevent="copyLink"
  131. @click="close"
  132. >
  133. <FAIcon
  134. fixed-width
  135. icon="share-alt"
  136. /><span>{{ $t("status.copy_link") }}</span>
  137. </button>
  138. <a
  139. v-if="!status.is_local"
  140. class="menu-item dropdown-item dropdown-item-icon"
  141. role="menuitem"
  142. title="Source"
  143. :href="status.external_url"
  144. target="_blank"
  145. >
  146. <FAIcon
  147. fixed-width
  148. icon="external-link-alt"
  149. /><span>{{ $t("status.external_source") }}</span>
  150. </a>
  151. <button
  152. class="menu-item dropdown-item dropdown-item-icon"
  153. role="menuitem"
  154. @click.prevent="reportStatus"
  155. @click="close"
  156. >
  157. <FAIcon
  158. fixed-width
  159. :icon="['far', 'flag']"
  160. /><span>{{ $t("user_card.report") }}</span>
  161. </button>
  162. </div>
  163. </template>
  164. <template #trigger>
  165. <span class="button-unstyled popover-trigger">
  166. <FALayers class="fa-old-padding-layer">
  167. <FAIcon
  168. class="fa-scale-110 "
  169. icon="ellipsis-h"
  170. />
  171. <FAIcon
  172. v-show="!expanded"
  173. class="focus-marker"
  174. transform="shrink-6 up-8 right-16"
  175. icon="plus"
  176. />
  177. <FAIcon
  178. v-show="expanded"
  179. class="focus-marker"
  180. transform="shrink-6 up-8 right-16"
  181. icon="times"
  182. />
  183. </FALayers>
  184. </span>
  185. <teleport to="#modal">
  186. <ConfirmModal
  187. v-if="showingDeleteDialog"
  188. :title="$t('status.delete_confirm_title')"
  189. :cancel-text="$t('status.delete_confirm_cancel_button')"
  190. :confirm-text="$t('status.delete_confirm_accept_button')"
  191. @cancelled="hideDeleteStatusConfirmDialog"
  192. @accepted="doDeleteStatus"
  193. >
  194. {{ $t('status.delete_confirm') }}
  195. </ConfirmModal>
  196. </teleport>
  197. </template>
  198. </Popover>
  199. </template>
  200. <script src="./extra_buttons.js"></script>
  201. <style lang="scss">
  202. @import "../../mixins";
  203. .ExtraButtons {
  204. .popover-trigger {
  205. position: static;
  206. padding: 10px;
  207. margin: -10px;
  208. &:hover .svg-inline--fa {
  209. color: var(--text);
  210. }
  211. }
  212. .popover-trigger-button {
  213. /* override of popover internal stuff */
  214. width: auto;
  215. @include unfocused-style {
  216. .focus-marker {
  217. visibility: hidden;
  218. }
  219. }
  220. @include focused-style {
  221. .focus-marker {
  222. visibility: visible;
  223. }
  224. }
  225. }
  226. }
  227. </style>