]> source.dussan.org Git - nextcloud-server.git/commitdiff
feat(files_reminders): integrate load scripts
authorChristopher Ng <chrng8@gmail.com>
Thu, 3 Aug 2023 02:15:00 +0000 (19:15 -0700)
committerChristopher Ng <chrng8@gmail.com>
Wed, 9 Aug 2023 17:41:17 +0000 (10:41 -0700)
Signed-off-by: Christopher Ng <chrng8@gmail.com>
apps/files_reminders/composer/composer/autoload_classmap.php
apps/files_reminders/composer/composer/autoload_static.php
apps/files_reminders/composer/composer/installed.php
apps/files_reminders/lib/AppInfo/Application.php
apps/files_reminders/lib/Listener/LoadAdditionalScriptsListener.php [new file with mode: 0644]

index 4f81cd387da29dda57f48741d259dc03dc2a6a94..7442e9da201708c5a46307a2d9a73b715670bb2e 100644 (file)
@@ -16,6 +16,7 @@ return array(
     'OCA\\FilesReminders\\Db\\ReminderMapper' => $baseDir . '/../lib/Db/ReminderMapper.php',
     'OCA\\FilesReminders\\Exception\\NodeNotFoundException' => $baseDir . '/../lib/Exception/NodeNotFoundException.php',
     'OCA\\FilesReminders\\Exception\\UserNotFoundException' => $baseDir . '/../lib/Exception/UserNotFoundException.php',
+    'OCA\\FilesReminders\\Listener\\LoadAdditionalScriptsListener' => $baseDir . '/../lib/Listener/LoadAdditionalScriptsListener.php',
     'OCA\\FilesReminders\\Listener\\NodeDeletedListener' => $baseDir . '/../lib/Listener/NodeDeletedListener.php',
     'OCA\\FilesReminders\\Listener\\UserDeletedListener' => $baseDir . '/../lib/Listener/UserDeletedListener.php',
     'OCA\\FilesReminders\\Migration\\Version10000Date20230725162149' => $baseDir . '/../lib/Migration/Version10000Date20230725162149.php',
index eff14f8f56950628532c339102915016d1f98371..a533f769312891b4346ee283d89a22f3aa8f05f0 100644 (file)
@@ -31,6 +31,7 @@ class ComposerStaticInitFilesReminders
         'OCA\\FilesReminders\\Db\\ReminderMapper' => __DIR__ . '/..' . '/../lib/Db/ReminderMapper.php',
         'OCA\\FilesReminders\\Exception\\NodeNotFoundException' => __DIR__ . '/..' . '/../lib/Exception/NodeNotFoundException.php',
         'OCA\\FilesReminders\\Exception\\UserNotFoundException' => __DIR__ . '/..' . '/../lib/Exception/UserNotFoundException.php',
+        'OCA\\FilesReminders\\Listener\\LoadAdditionalScriptsListener' => __DIR__ . '/..' . '/../lib/Listener/LoadAdditionalScriptsListener.php',
         'OCA\\FilesReminders\\Listener\\NodeDeletedListener' => __DIR__ . '/..' . '/../lib/Listener/NodeDeletedListener.php',
         'OCA\\FilesReminders\\Listener\\UserDeletedListener' => __DIR__ . '/..' . '/../lib/Listener/UserDeletedListener.php',
         'OCA\\FilesReminders\\Migration\\Version10000Date20230725162149' => __DIR__ . '/..' . '/../lib/Migration/Version10000Date20230725162149.php',
index b962688d0b992b9e9287e12dbda09f9cfaf93f10..c398e796c3212da7a14d44eb8af957d3a3816359 100644 (file)
@@ -1,9 +1,9 @@
 <?php return array(
     'root' => array(
         'name' => '__root__',
-        'pretty_version' => 'dev-master',
-        'version' => 'dev-master',
-        'reference' => '5a11535c51ae0277f6bb0af048215e329b6068d0',
+        'pretty_version' => '1.0.0+no-version-set',
+        'version' => '1.0.0.0',
+        'reference' => NULL,
         'type' => 'library',
         'install_path' => __DIR__ . '/../',
         'aliases' => array(),
@@ -11,9 +11,9 @@
     ),
     'versions' => array(
         '__root__' => array(
-            'pretty_version' => 'dev-master',
-            'version' => 'dev-master',
-            'reference' => '5a11535c51ae0277f6bb0af048215e329b6068d0',
+            'pretty_version' => '1.0.0+no-version-set',
+            'version' => '1.0.0.0',
+            'reference' => NULL,
             'type' => 'library',
             'install_path' => __DIR__ . '/../',
             'aliases' => array(),
index d35bd5c5de2b3358ae3421401f572d4b0490d77d..56b0c97a7a26877c370c1a4917ed646e81bcd065 100644 (file)
@@ -26,6 +26,8 @@ declare(strict_types=1);
 
 namespace OCA\FilesReminders\AppInfo;
 
+use OCA\Files\Event\LoadAdditionalScriptsEvent;
+use OCA\FilesReminders\Listener\LoadAdditionalScriptsListener;
 use OCA\FilesReminders\Listener\NodeDeletedListener;
 use OCA\FilesReminders\Listener\UserDeletedListener;
 use OCA\FilesReminders\Notification\Notifier;
@@ -51,5 +53,7 @@ class Application extends App implements IBootstrap {
 
                $context->registerEventListener(NodeDeletedEvent::class, NodeDeletedListener::class);
                $context->registerEventListener(UserDeletedEvent::class, UserDeletedListener::class);
+
+               $context->registerEventListener(LoadAdditionalScriptsEvent::class, LoadAdditionalScriptsListener::class);
        }
 }
diff --git a/apps/files_reminders/lib/Listener/LoadAdditionalScriptsListener.php b/apps/files_reminders/lib/Listener/LoadAdditionalScriptsListener.php
new file mode 100644 (file)
index 0000000..9eadc51
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * @copyright 2023 Christopher Ng <chrng8@gmail.com>
+ *
+ * @author Christopher Ng <chrng8@gmail.com>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\FilesReminders\Listener;
+
+use OCA\Files\Event\LoadAdditionalScriptsEvent;
+use OCA\FilesReminders\AppInfo\Application;
+use OCP\EventDispatcher\Event;
+use OCP\EventDispatcher\IEventListener;
+use OCP\Util;
+
+class LoadAdditionalScriptsListener implements IEventListener {
+       public function handle(Event $event): void {
+               if (!($event instanceof LoadAdditionalScriptsEvent)) {
+                       return;
+               }
+
+               Util::addScript(Application::APP_ID, 'main');
+       }
+}