about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarcin Mikołajczak <me@mkljczk.pl>2020-12-15 02:04:56 +0100
committerGitHub <noreply@github.com>2020-12-15 02:04:56 +0100
commit9342705e6bfc4f0e4f999bd3c1bb70d425fcb598 (patch)
treed39cbc411602e9850f771995aa874f7f513d2add
parent47e507fa61be6dc39dd9821e1d07c33e993cc246 (diff)
Add app shortcuts (#15234)
* Add app shortcuts

Signed-off-by: mkljczk <me@mkljczk.pl>

* Fix codeclimate issues

Signed-off-by: mkljczk <me@mkljczk.pl>

* Change shortcuts

Signed-off-by: mkljczk <me@mkljczk.pl>

* More consistent new-status icon

Signed-off-by: mkljczk <me@mkljczk.pl>
-rw-r--r--app/serializers/manifest_serializer.rb40
-rw-r--r--public/shortcuts/direct.pngbin0 -> 3045 bytes
-rw-r--r--public/shortcuts/new-status.pngbin0 -> 3031 bytes
-rw-r--r--public/shortcuts/notifications.pngbin0 -> 3067 bytes
-rw-r--r--public/shortcuts/profile.pngbin0 -> 4190 bytes
5 files changed, 39 insertions, 1 deletions
diff --git a/app/serializers/manifest_serializer.rb b/app/serializers/manifest_serializer.rb
index 21ec0d4be..dafe8f55b 100644
--- a/app/serializers/manifest_serializer.rb
+++ b/app/serializers/manifest_serializer.rb
@@ -7,7 +7,7 @@ class ManifestSerializer < ActiveModel::Serializer
   attributes :name, :short_name, :description,
              :icons, :theme_color, :background_color,
              :display, :start_url, :scope,
-             :share_target
+             :share_target, :shortcuts
 
   def name
     object.site_title
@@ -64,4 +64,42 @@ class ManifestSerializer < ActiveModel::Serializer
       },
     }
   end
+
+  def shortcuts
+    [
+      {
+        name: 'New toot',
+        url: '/web/statuses/new',
+        icons: [
+          {
+            src: '/shortcuts/new-status.png',
+            type: 'image/png',
+            sizes: '192x192',
+          },
+        ],
+      },
+      {
+        name: 'Notifications',
+        url: '/web/notifications',
+        icons: [
+          {
+            src: '/shortcuts/notifications.png',
+            type: 'image/png',
+            sizes: '192x192',
+          },
+        ],
+      },
+      {
+        name: 'Direct messages',
+        url: '/web/timelines/direct',
+        icons: [
+          {
+            src: '/shortcuts/direct.png',
+            type: 'image/png',
+            sizes: '192x192',
+          },
+        ],
+      },
+    ]
+  end
 end
diff --git a/public/shortcuts/direct.png b/public/shortcuts/direct.png
new file mode 100644
index 000000000..e8772c00e
--- /dev/null
+++ b/public/shortcuts/direct.png
Binary files differdiff --git a/public/shortcuts/new-status.png b/public/shortcuts/new-status.png
new file mode 100644
index 000000000..b7095f3c4
--- /dev/null
+++ b/public/shortcuts/new-status.png
Binary files differdiff --git a/public/shortcuts/notifications.png b/public/shortcuts/notifications.png
new file mode 100644
index 000000000..6b9d45718
--- /dev/null
+++ b/public/shortcuts/notifications.png
Binary files differdiff --git a/public/shortcuts/profile.png b/public/shortcuts/profile.png
new file mode 100644
index 000000000..0b3bf517d
--- /dev/null
+++ b/public/shortcuts/profile.png
Binary files differ