summaryrefslogtreecommitdiffstats
path: root/apps/files_versions/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-09-01 19:29:55 +0200
committerVincent Petry <pvince81@owncloud.com>2015-09-03 16:47:24 +0200
commit310d79728447ecf69f18d0b61a527397bd961888 (patch)
tree805b2a0a40ed5ce7acb58afb90ad7c18e760e037 /apps/files_versions/lib
parente9e42fff61a922f11a3b1014d810562537950b6a (diff)
downloadnextcloud-server-310d79728447ecf69f18d0b61a527397bd961888.tar.gz
nextcloud-server-310d79728447ecf69f18d0b61a527397bd961888.zip
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
Diffstat (limited to 'apps/files_versions/lib')
-rw-r--r--apps/files_versions/lib/hooks.php12
1 files changed, 12 insertions, 0 deletions
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');
+ }
}