Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
efa4120
IONOS: feat: add always_show_viewer app config value
printminion-co Aug 27, 2024
41171a5
fixup! IONOS: feat: add always_show_viewer app config value
printminion-co Jun 18, 2025
6c1b75d
IONOS: feat: add config module to expose alwaysShowViewer
printminion-co Aug 27, 2024
6fa056b
IONOS: feat: add default component stub
printminion-co Aug 27, 2024
854a60b
IONOS: feat: add default viewer
printminion-co Aug 28, 2024
69bf710
IONOS: feat: enable default viewer
printminion-co Aug 28, 2024
779f7e0
fixup! IONOS: feat: enable default viewer
printminion-co Jun 19, 2025
ccbf4f9
IONOS: feat: extract default mime type to config
printminion-co Sep 3, 2024
cb962de
IONOS: feat: properly implement default component
fracado Sep 2, 2024
c992384
IONOS: feat(Viewer): extract modal title as own method
printminion-co Sep 3, 2024
9bf0bf3
IONOS: feat(Viewer): ensure previous and next navigation works with d…
printminion-co Sep 2, 2024
9ca1c15
IONOS: feat(Viewer): hide file name in modal header when mime image s…
fracado Sep 2, 2024
643fec2
IONOS: fix(Viewer): remove directories from fileList
thlehmann-ionos Sep 11, 2024
577e6e4
IONOS: fix(Viewer): remove contextmenu view action for folders
bromiesTM Sep 12, 2024
cb8b7d5
IONOS: refactor: use config module, not magic string
thlehmann-ionos Sep 12, 2024
da0b25b
IONOS: fix: change default mimetype */* -> "all"
thlehmann-ionos Sep 12, 2024
56bdc73
IONOS: refactor(Images): rename preview load failed state variable
thlehmann-ionos Sep 12, 2024
81932db
IONOS: fix(Images): hide loading spinner on failed image load
thlehmann-ionos Sep 12, 2024
2d503e4
IONOS: feat(deps): use custom-npms for icons
printminion-co Dec 3, 2024
0b7eed4
IONOS: fix(Viewer): fix video load error
fracado Feb 14, 2025
e21af8d
IONOS: fix(Viewer): fix file filter for directories
fracado Feb 17, 2025
8ffe90b
IONOS: feat(Viewer): remove collabora documents from preview
fracado Apr 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lib/Listener/LoadViewerScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use OCA\Files\Event\LoadAdditionalScriptsEvent;
use OCA\Viewer\AppInfo\Application;
use OCA\Viewer\Event\LoadViewer;
use OCP\AppFramework\Services\IAppConfig;
use OCP\AppFramework\Services\IInitialState;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
Expand All @@ -23,24 +24,30 @@
class LoadViewerScript implements IEventListener {
private IInitialState $initialStateService;
private IPreview $previewManager;
private IAppConfig $appConfig;

public function __construct(
IInitialState $initialStateService,
IPreview $previewManager,
IAppConfig $appConfig,
) {
$this->initialStateService = $initialStateService;
$this->previewManager = $previewManager;
$this->appConfig = $appConfig;
}

public function handle(Event $event): void {
if (!($event instanceof LoadViewer || $event instanceof LoadAdditionalScriptsEvent)) {
return;
}

$alwaysShowViewer = $this->appConfig->getAppValue('always_show_viewer', 'no') === 'yes';

Util::addStyle(Application::APP_ID, 'viewer-init');
Util::addStyle(Application::APP_ID, 'viewer-main');
Util::addInitScript(Application::APP_ID, 'viewer-init');
Util::addScript(Application::APP_ID, 'viewer-main', 'files');
$this->initialStateService->provideInitialState('enabled_preview_providers', array_keys($this->previewManager->getProviders()));
$this->initialStateService->provideInitialState('always_show_viewer', $alwaysShowViewer);
}
}
Loading
Loading