Welcome to mirror list, hosted at ThFree Co, Russian Federation.

filesplugin.js « src « systemtags « apps - github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ac6fe4174b658c6f0f01cdab7bbd1dfbeb355b04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
 * Copyright (c) 2015 Vincent Petry <pvince81@owncloud.com>
 *
 * This file is licensed under the Affero General Public License version 3
 * or later.
 *
 * See the COPYING-README file.
 *
 */

(function() {
	OCA.SystemTags = _.extend({}, OCA.SystemTags)
	if (!OCA.SystemTags) {
		/**
		 * @namespace
		 */
		OCA.SystemTags = {}
	}

	/**
	 * @namespace
	 */
	OCA.SystemTags.FilesPlugin = {
		ignoreLists: [
			'trashbin',
			'files.public',
		],

		attach(fileList) {
			if (this.ignoreLists.indexOf(fileList.id) >= 0) {
				return
			}

			// only create and attach once
			// FIXME: this should likely be done on a different code path now
			// for the sidebar to only have it registered once
			if (!OCA.SystemTags.View) {
				const systemTagsInfoView = new OCA.SystemTags.SystemTagsInfoView()
				fileList.registerDetailView(systemTagsInfoView)
				OCA.SystemTags.View = systemTagsInfoView
			}
		},
	}

})()

OC.Plugins.register('OCA.Files.FileList', OCA.SystemTags.FilesPlugin)