From e7aa6925e55fc48092a5bb42893f16ea7feedb89 Mon Sep 17 00:00:00 2001
From: Chocobozzz <me@florianbigard.com>
Date: Thu, 20 Jan 2022 09:36:52 +0100
Subject: [PATCH] Support more filters

---
 .../client/login-client-plugin.js             | 13 +++++++
 .../client/signup-client-plugin.js            | 18 ++++++++++
 peertube-plugin-hello-world/package.json      | 36 ++++++++++++++-----
 3 files changed, 59 insertions(+), 8 deletions(-)
 create mode 100644 peertube-plugin-hello-world/client/signup-client-plugin.js

diff --git a/peertube-plugin-hello-world/client/login-client-plugin.js b/peertube-plugin-hello-world/client/login-client-plugin.js
index 42abe24..720f063 100644
--- a/peertube-plugin-hello-world/client/login-client-plugin.js
+++ b/peertube-plugin-hello-world/client/login-client-plugin.js
@@ -7,6 +7,19 @@ function register ({ registerHook, peertubeHelpers }) {
       document.querySelector('.looking-for-account > div').innerHTML = 'Hello'
     }
   })
+
+  registerHook({
+    target: 'filter:login.instance-about-plugin-panels.create.result',
+    handler: result => {
+      return result.concat([
+        {
+          id: 'riri',
+          title: 'Riri',
+          html: 'Riri <strong>Duck</strong>'
+        }
+      ])
+    }
+  })
 }
 
 export {
diff --git a/peertube-plugin-hello-world/client/signup-client-plugin.js b/peertube-plugin-hello-world/client/signup-client-plugin.js
new file mode 100644
index 0000000..4b608f1
--- /dev/null
+++ b/peertube-plugin-hello-world/client/signup-client-plugin.js
@@ -0,0 +1,18 @@
+function register ({ registerHook, peertubeHelpers }) {
+  registerHook({
+    target: 'filter:signup.instance-about-plugin-panels.create.result',
+    handler: result => {
+      return result.concat([
+        {
+          id: 'loulou',
+          title: 'Loulou',
+          html: 'Loulou <strong>Duck</strong>'
+        }
+      ])
+    }
+  })
+}
+
+export {
+  register
+}
diff --git a/peertube-plugin-hello-world/package.json b/peertube-plugin-hello-world/package.json
index 857617c..43f6e20 100644
--- a/peertube-plugin-hello-world/package.json
+++ b/peertube-plugin-hello-world/package.json
@@ -1,6 +1,6 @@
 {
   "name": "peertube-plugin-hello-world",
-  "version": "0.0.18",
+  "version": "0.0.19",
   "description": "Hello world PeerTube plugin example",
   "engine": {
     "peertube": ">=3.2.0"
@@ -23,31 +23,51 @@
   "clientScripts": [
     {
       "script": "client/common-client-plugin.js",
-      "scopes": [ "common" ]
+      "scopes": [
+        "common"
+      ]
     },
     {
       "script": "client/video-watch-client-plugin.js",
-      "scopes": [ "video-watch" ]
+      "scopes": [
+        "video-watch"
+      ]
     },
     {
       "script": "client/search-client-plugin.js",
-      "scopes": [ "search" ]
+      "scopes": [
+        "search"
+      ]
     },
     {
       "script": "client/login-client-plugin.js",
-      "scopes": [ "login" ]
+      "scopes": [
+        "login"
+      ]
+    },
+    {
+      "script": "client/signup-client-plugin.js",
+      "scopes": [
+        "signup"
+      ]
     },
     {
       "script": "client/embed-client-plugin.js",
-      "scopes": [ "embed" ]
+      "scopes": [
+        "embed"
+      ]
     },
     {
       "script": "client/video-edit-client-plugin.js",
-      "scopes": [ "video-edit" ]
+      "scopes": [
+        "video-edit"
+      ]
     },
     {
       "script": "client/admin-plugin-client-plugin.js",
-      "scopes": [ "admin-plugin" ]
+      "scopes": [
+        "admin-plugin"
+      ]
     }
   ],
   "translations": {