You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

371 lines
6.4 KiB

Web Push Notifications (#3243) * feat: Register push subscription * feat: Notify when mentioned * feat: Boost, favourite, reply, follow, follow request * feat: Notification interaction * feat: Handle change of public key * feat: Unsubscribe if things go wrong * feat: Do not send normal notifications if push is enabled * feat: Focus client if open * refactor: Move push logic to WebPushSubscription * feat: Better title and body * feat: Localize messages * chore: Fix lint errors * feat: Settings * refactor: Lazy load * fix: Check if push settings exist * feat: Device-based preferences * refactor: Simplify logic * refactor: Pull request feedback * refactor: Pull request feedback * refactor: Create /api/web/push_subscriptions endpoint * feat: Spec PushSubscriptionController * refactor: WebPushSubscription => Web::PushSubscription * feat: Spec Web::PushSubscription * feat: Display first media attachment * feat: Support direction * fix: Stuff broken while rebasing * refactor: Integration with session activations * refactor: Cleanup * refactor: Simplify implementation * feat: Set VAPID keys via environment * chore: Comments * fix: Crash when no alerts * fix: Set VAPID keys in testing environment * fix: Follow link * feat: Notification actions * fix: Delete previous subscription * chore: Temporary logs * refactor: Move migration to a later date * fix: Fetch the correct session activation and misc bugs * refactor: Move migration to a later date * fix: Remove follow request (no notifications) * feat: Send administrator contact to push service * feat: Set time-to-live * fix: Do not show sensitive images * fix: Reducer crash in error handling * feat: Add badge * chore: Fix lint error * fix: Checkbox label overlap * fix: Check for payload support * fix: Rename action "type" (crash in latest Chrome) * feat: Action to expand notification * fix: Lint errors * fix: Unescape notification body * fix: Do not allow boosting if the status is hidden * feat: Add VAPID keys to the production sample environment * fix: Strip HTML tags from status * refactor: Better error messages * refactor: Handle browser not implementing the VAPID protocol (Samsung Internet) * fix: Error when target_status is nil * fix: Handle lack of image * fix: Delete reference to invalid subscriptions * feat: Better error handling * fix: Unescape HTML characters after tags are striped * refactor: Simpify code * fix: Modify to work with #4091 * Sort strings alphabetically * i18n: Updated Polish translation it annoys me that it's not fully localized :P * refactor: Use current_session in PushSubscriptionController * fix: Rebase mistake * fix: Set cacheName to mastodon * refactor: Pull request feedback * refactor: Remove logging statements * chore(yarn): Fix conflicts with master * chore(yarn): Copy latest from master * chore(yarn): Readd offline-plugin * refactor: Use save! and update! * refactor: Send notifications async * fix: Allow retry when push fails * fix: Save track for failed pushes * fix: Minify sw.js * fix: Remove account_id from fabricator
7 years ago
4 years ago
4 years ago
  1. body.rtl {
  2. direction: rtl;
  3. .column-header > button {
  4. text-align: right;
  5. padding-left: 0;
  6. padding-right: 15px;
  7. }
  8. .radio-button__input {
  9. margin-right: 0;
  10. margin-left: 10px;
  11. }
  12. .display-name {
  13. text-align: right;
  14. }
  15. .notification__message {
  16. margin-left: 0;
  17. margin-right: 68px;
  18. }
  19. .drawer__inner__mastodon > img {
  20. transform: scaleX(-1);
  21. }
  22. .notification__favourite-icon-wrapper {
  23. left: auto;
  24. right: -26px;
  25. }
  26. .column-link__icon,
  27. .column-header__icon {
  28. margin-right: 0;
  29. margin-left: 5px;
  30. }
  31. .compose-form .character-counter__wrapper {
  32. margin-right: 0;
  33. margin-left: 4px;
  34. }
  35. .boost-modal__status-time {
  36. float: left;
  37. }
  38. .navigation-bar__profile {
  39. margin-left: 0;
  40. margin-right: 8px;
  41. }
  42. .search__input {
  43. padding-right: 10px;
  44. padding-left: 30px;
  45. }
  46. .search__icon .fa {
  47. right: auto;
  48. left: 10px;
  49. }
  50. .columns-area {
  51. direction: rtl;
  52. }
  53. .column-header__buttons {
  54. left: 0;
  55. right: auto;
  56. margin-left: 0;
  57. margin-right: -15px;
  58. }
  59. .column-inline-form .icon-button {
  60. margin-left: 0;
  61. margin-right: 5px;
  62. }
  63. .column-header__links .text-btn {
  64. margin-left: 10px;
  65. margin-right: 0;
  66. }
  67. .account__avatar-wrapper {
  68. float: right;
  69. }
  70. .column-header__back-button {
  71. padding-left: 5px;
  72. padding-right: 0;
  73. }
  74. .column-header__setting-arrows {
  75. float: left;
  76. .column-header__setting-btn {
  77. &:first-child {
  78. padding-left: 7px;
  79. padding-right: 5px;
  80. }
  81. &:last-child {
  82. padding-right: 7px;
  83. padding-left: 5px;
  84. margin-right: 5px;
  85. margin-left: 0;
  86. }
  87. }
  88. }
  89. .setting-toggle__label {
  90. margin-left: 0;
  91. margin-right: 8px;
  92. }
  93. .setting-meta__label {
  94. float: left;
  95. }
  96. .status__avatar {
  97. margin-left: 10px;
  98. margin-right: 0;
  99. // Those are used for public pages
  100. left: auto;
  101. right: 10px;
  102. }
  103. .activity-stream .status.light {
  104. padding-left: 10px;
  105. padding-right: 68px;
  106. }
  107. .status__info .status__display-name,
  108. .activity-stream .status.light .status__display-name {
  109. padding-left: 25px;
  110. padding-right: 0;
  111. }
  112. .activity-stream .pre-header {
  113. padding-right: 68px;
  114. padding-left: 0;
  115. }
  116. .status__prepend {
  117. margin-left: 0;
  118. margin-right: 58px;
  119. }
  120. .status__prepend-icon-wrapper {
  121. left: auto;
  122. right: -26px;
  123. }
  124. .activity-stream .pre-header .pre-header__icon {
  125. left: auto;
  126. right: 42px;
  127. }
  128. .account__header__tabs__buttons > .icon-button {
  129. margin-right: 0;
  130. margin-left: 8px;
  131. }
  132. .account__avatar-overlay-overlay {
  133. right: auto;
  134. left: 0;
  135. }
  136. .column-back-button--slim-button {
  137. right: auto;
  138. left: 0;
  139. }
  140. .status__relative-time,
  141. .activity-stream .status.light .status__header .status__meta {
  142. float: left;
  143. text-align: left;
  144. }
  145. .status__action-bar {
  146. &__counter {
  147. margin-right: 0;
  148. margin-left: 11px;
  149. .status__action-bar-button {
  150. margin-right: 0;
  151. margin-left: 4px;
  152. }
  153. }
  154. }
  155. .status__action-bar-button {
  156. float: right;
  157. margin-right: 0;
  158. margin-left: 18px;
  159. }
  160. .status__action-bar-dropdown {
  161. float: right;
  162. }
  163. .privacy-dropdown__dropdown {
  164. margin-left: 0;
  165. margin-right: 40px;
  166. }
  167. .privacy-dropdown__option__icon {
  168. margin-left: 10px;
  169. margin-right: 0;
  170. }
  171. .detailed-status__display-name .display-name {
  172. text-align: right;
  173. }
  174. .detailed-status__display-avatar {
  175. margin-right: 0;
  176. margin-left: 10px;
  177. float: right;
  178. }
  179. .detailed-status__favorites,
  180. .detailed-status__reblogs {
  181. margin-left: 0;
  182. margin-right: 6px;
  183. }
  184. .fa-ul {
  185. margin-left: 2.14285714em;
  186. }
  187. .fa-li {
  188. left: auto;
  189. right: -2.14285714em;
  190. }
  191. .admin-wrapper {
  192. direction: rtl;
  193. }
  194. .admin-wrapper .sidebar ul a i.fa,
  195. a.table-action-link i.fa {
  196. margin-right: 0;
  197. margin-left: 5px;
  198. }
  199. .simple_form .check_boxes .checkbox label {
  200. padding-left: 0;
  201. padding-right: 25px;
  202. }
  203. .simple_form .input.with_label.boolean label.checkbox {
  204. padding-left: 25px;
  205. padding-right: 0;
  206. }
  207. .simple_form .check_boxes .checkbox input[type='checkbox'],
  208. .simple_form .input.boolean input[type='checkbox'] {
  209. left: auto;
  210. right: 0;
  211. }
  212. .simple_form .input.radio_buttons .radio {
  213. left: auto;
  214. right: 0;
  215. }
  216. .simple_form .input.radio_buttons .radio > label {
  217. padding-right: 28px;
  218. padding-left: 0;
  219. }
  220. .simple_form .input-with-append .input input {
  221. padding-left: 142px;
  222. padding-right: 0;
  223. }
  224. .simple_form .input.boolean label.checkbox {
  225. left: auto;
  226. right: 0;
  227. }
  228. .simple_form .input.boolean .label_input,
  229. .simple_form .input.boolean .hint {
  230. padding-left: 0;
  231. padding-right: 28px;
  232. }
  233. .simple_form .label_input__append {
  234. right: auto;
  235. left: 3px;
  236. &::after {
  237. right: auto;
  238. left: 0;
  239. background-image: linear-gradient(
  240. to left,
  241. rgba(darken($ui-base-color, 10%), 0),
  242. darken($ui-base-color, 10%)
  243. );
  244. }
  245. }
  246. .simple_form select {
  247. background: darken($ui-base-color, 10%)
  248. url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14.933 18.467' height='19.698' width='15.929'><path d='M3.467 14.967l-3.393-3.5H14.86l-3.392 3.5c-1.866 1.925-3.666 3.5-4 3.5-.335 0-2.135-1.575-4-3.5zm.266-11.234L7.467 0 11.2 3.733l3.733 3.734H0l3.733-3.734z' fill='#{hex-color(lighten($ui-base-color, 12%))}'/></svg>")
  249. no-repeat left 8px center / auto 16px;
  250. }
  251. .table th,
  252. .table td {
  253. text-align: right;
  254. }
  255. .filters .filter-subset {
  256. margin-right: 0;
  257. margin-left: 45px;
  258. }
  259. @media screen and (min-width: 631px) {
  260. .column,
  261. .drawer {
  262. padding-left: 5px;
  263. padding-right: 5px;
  264. &:first-child {
  265. padding-left: 5px;
  266. padding-right: 10px;
  267. }
  268. }
  269. .columns-area > div {
  270. .column,
  271. .drawer {
  272. padding-left: 5px;
  273. padding-right: 5px;
  274. }
  275. }
  276. }
  277. .columns-area--mobile .column,
  278. .columns-area--mobile .drawer {
  279. padding-left: 0;
  280. padding-right: 0;
  281. }
  282. .card__bar .display-name {
  283. margin-left: 0;
  284. margin-right: 15px;
  285. text-align: right;
  286. }
  287. .fa-chevron-left::before {
  288. content: '\F054';
  289. }
  290. .fa-chevron-right::before {
  291. content: '\F053';
  292. }
  293. .column-back-button__icon {
  294. margin-right: 0;
  295. margin-left: 5px;
  296. }
  297. .simple_form .input.radio_buttons .radio > label input {
  298. left: auto;
  299. right: 0;
  300. }
  301. }