From 65795cfef5b89b0e5df9ebb5fe81a95c459c0687 Mon Sep 17 00:00:00 2001 From: Guy Van Sanden Date: Thu, 16 Apr 2026 14:24:32 +0200 Subject: [PATCH] Simplify: Use CSS in info.xml that always loads --- appinfo/info.xml | 5 ++++- css/minimalprofile.css | 2 ++ lib/AppInfo/Application.php | 18 ------------------ 3 files changed, 6 insertions(+), 19 deletions(-) create mode 100644 css/minimalprofile.css diff --git a/appinfo/info.xml b/appinfo/info.xml index 05deb77..41a58b1 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -4,7 +4,7 @@ Minimal Profile Hides profile fields to create a minimal user profile Allows administrators to hide profile fields like pronouns, social links, etc. - 1.0.5 + 1.0.8 AGPL Your Name MinimalProfile @@ -14,4 +14,7 @@ + + css/minimalprofile.css + \ No newline at end of file diff --git a/css/minimalprofile.css b/css/minimalprofile.css new file mode 100644 index 0000000..e5f682d --- /dev/null +++ b/css/minimalprofile.css @@ -0,0 +1,2 @@ +/* Hide profile fields */ +.personal-settings-setting-box:has(#account-property-pronouns) { display: none !important; } \ No newline at end of file diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 5e7d715..7c7d987 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -8,9 +8,6 @@ use OCP\AppFramework\App; use OCP\AppFramework\Bootstrap\IBootContext; use OCP\AppFramework\Bootstrap\IBootstrap; use OCP\AppFramework\Bootstrap\IRegistrationContext; -use OCP\AppFramework\Http\TemplateResponse; -use OCP\EventDispatcher\Event; -use OCP\EventDispatcher\IEventListener; class Application extends App implements IBootstrap { @@ -21,23 +18,8 @@ class Application extends App implements IBootstrap { } public function register(IRegistrationContext $context): void { - $context->registerEventListener( - TemplateResponse::EVENT_LOAD_ADDITIONAL_SCRIPTS, - LoadScriptsListener::class - ); } public function boot(IBootContext $context): void { } -} - -class LoadScriptsListener implements IEventListener { - - public function handle(Event $event): void { - if (!$event instanceof TemplateResponse) { - return; - } - - $event->addScript('minimalprofile'); - } } \ No newline at end of file