mirror of
https://github.com/nextcloud/server.git
synced 2026-04-27 01:00:20 -04:00
Properly emit Viewer event on files and files_sharing
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
parent
1125f1767c
commit
f74876eb3c
3 changed files with 17 additions and 0 deletions
|
|
@ -39,6 +39,7 @@ namespace OCA\Files\Controller;
|
|||
use OCA\Files\Activity\Helper;
|
||||
use OCA\Files\Event\LoadAdditionalScriptsEvent;
|
||||
use OCA\Files\Event\LoadSidebar;
|
||||
use OCA\Viewer\Event\LoadViewer;
|
||||
use OCP\App\IAppManager;
|
||||
use OCP\AppFramework\Controller;
|
||||
use OCP\AppFramework\Http\ContentSecurityPolicy;
|
||||
|
|
@ -281,6 +282,10 @@ class ViewController extends Controller {
|
|||
$this->eventDispatcher->dispatch(LoadAdditionalScriptsEvent::class, $event);
|
||||
|
||||
$this->eventDispatcher->dispatch(LoadSidebar::class, new LoadSidebar());
|
||||
// Load Viewer scripts
|
||||
if (class_exists(LoadViewer::class)) {
|
||||
$this->eventDispatcher->dispatch(LoadViewer::class, new LoadViewer());
|
||||
}
|
||||
|
||||
$params = [];
|
||||
$params['usedSpacePercent'] = (int) $storageInfo['relative'];
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ use OC_Util;
|
|||
use OC\Security\CSP\ContentSecurityPolicy;
|
||||
use OCA\FederatedFileSharing\FederatedShareProvider;
|
||||
use OCA\Files_Sharing\Activity\Providers\Downloads;
|
||||
use OCA\Viewer\Event\LoadViewer;
|
||||
use OCP\AppFramework\AuthPublicShareController;
|
||||
use OCP\AppFramework\Http\NotFoundResponse;
|
||||
use OCP\AppFramework\Http\Template\ExternalShareMenuAction;
|
||||
|
|
@ -453,6 +454,11 @@ class ShareController extends AuthPublicShareController {
|
|||
\OCP\Util::addScript('files', 'filelist');
|
||||
\OCP\Util::addScript('files', 'keyboardshortcuts');
|
||||
\OCP\Util::addScript('files', 'operationprogressbar');
|
||||
|
||||
// Load Viewer scripts
|
||||
if (class_exists(LoadViewer::class)) {
|
||||
$this->eventDispatcher->dispatch(LoadViewer::class, new LoadViewer());
|
||||
}
|
||||
}
|
||||
|
||||
// OpenGraph Support: http://ogp.me/
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
*/
|
||||
use OCA\Files\Event\LoadAdditionalScriptsEvent;
|
||||
use OCA\Files\Event\LoadSidebar;
|
||||
use OCA\Viewer\Event\LoadViewer;
|
||||
use OCP\EventDispatcher\GenericEvent;
|
||||
|
||||
// Check if we are a user
|
||||
|
|
@ -44,4 +45,9 @@ $eventDispatcher->dispatch('\OCP\Collaboration\Resources::loadAdditionalScripts'
|
|||
$eventDispatcher->dispatch(LoadAdditionalScriptsEvent::class, new LoadAdditionalScriptsEvent());
|
||||
$eventDispatcher->dispatch(LoadSidebar::class, new LoadSidebar());
|
||||
|
||||
// Load Viewer scripts
|
||||
if (class_exists(LoadViewer::class)) {
|
||||
$eventDispatcher->dispatch(LoadViewer::class, new LoadViewer());
|
||||
}
|
||||
|
||||
$tmpl->printPage();
|
||||
|
|
|
|||
Loading…
Reference in a new issue