From 310d79728447ecf69f18d0b61a527397bd961888 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Tue, 1 Sep 2015 19:29:55 +0200 Subject: Add versions tab to files sidebar - move versions to a tab in the files sidebar - added mechanism to auto-update the row in the FileList whenever values are set to the FileInfoModel given to the sidebar - updated tags/favorite action to make use of that new mechanism --- apps/files_versions/lib/hooks.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'apps/files_versions/lib') diff --git a/apps/files_versions/lib/hooks.php b/apps/files_versions/lib/hooks.php index ccd89a4a14f..5ef2cc3c7d0 100644 --- a/apps/files_versions/lib/hooks.php +++ b/apps/files_versions/lib/hooks.php @@ -43,6 +43,9 @@ class Hooks { \OCP\Util::connectHook('OC_Filesystem', 'post_copy', 'OCA\Files_Versions\Hooks', 'copy_hook'); \OCP\Util::connectHook('OC_Filesystem', 'rename', 'OCA\Files_Versions\Hooks', 'pre_renameOrCopy_hook'); \OCP\Util::connectHook('OC_Filesystem', 'copy', 'OCA\Files_Versions\Hooks', 'pre_renameOrCopy_hook'); + + $eventDispatcher = \OC::$server->getEventDispatcher(); + $eventDispatcher->addListener('OCA\Files::loadAdditionalScripts', ['OCA\Files_Versions\Hooks', 'onLoadFilesAppScripts']); } /** @@ -154,4 +157,13 @@ class Hooks { } } + /** + * Load additional scripts when the files app is visible + */ + public static function onLoadFilesAppScripts() { + \OCP\Util::addScript('files_versions', 'versionmodel'); + \OCP\Util::addScript('files_versions', 'versioncollection'); + \OCP\Util::addScript('files_versions', 'versionstabview'); + \OCP\Util::addScript('files_versions', 'filesplugin'); + } } -- cgit v1.2.3