aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
Commit message (Expand)AuthorAgeFilesLines
* BUILD-1351 Remove dogfood referencesMalena Ebert2022-04-141-1/+1
* [NO JIRA] Update QG badgeJeremy Davis2022-03-111-1/+1
* SONAR-15962 Remove check dependency github action workflowMathieu Suen2022-02-281-2/+0
* Prepare update license headers for 2022 [update headers]Pierre2022-01-281-1/+1
* replace travis.org with travis.com for build badgePierre Guillot2022-01-261-1/+1
* Add a link to our jobs in 'Contributing' sectionPierre Guillot2021-11-151-0/+2
* Fix license in header & footerPhilippe Perrin2021-02-091-1/+1
* added responsible disclosure guide to README.mdTobias Trabelsi2020-10-121-0/+1
* MMS-240 - Update readme content (#3169)Clint Cameron2020-09-241-6/+6
* README: Bump copyright yearDinesh Bolkensteyn2020-05-111-1/+1
* Document and upgrade Gradle pluginsSimon Brandhof2019-03-271-18/+9
* Fix license in HEADERSimon Brandhof2019-03-271-1/+1
* Add Quality gate badge to READMESimon Brandhof2019-03-271-1/+1
* Add contributing guide, revise related docsJanos Gyerik2019-03-261-5/+4
* Fix link to next.sonarqube.com in READMESimon Brandhof2019-03-061-1/+1
* Remove integration tests section from public READMESimon Brandhof2018-07-201-75/+0
* Replace Google group by community forum in READMESimon Brandhof2018-06-141-3/+3
* Add Gradle task printDependenciesSimon Brandhof2018-06-121-0/+7
* Fix buildDavid Rautureau2018-04-041-0/+6
* BUILD-612 Implement the check of source headersDavid Rautureau2018-04-041-0/+6
* Remove analysis badges from READMESimon Brandhof2018-03-221-1/+1
* Document how to open project in IDESimon Brandhof2018-03-121-0/+8
* Complete README of sourcesSimon Brandhof2018-03-101-9/+131
* update readme.md copyright from 2016 to 2017Fabian Beuke2017-02-121-1/+1
* Removed broken link to 'sonarqube.org/development'bartfastiel2017-01-021-2/+0
* changed reference links to a Links section to make them clickable on GitHub (...Janos Gyerik2016-05-191-4/+10
* Update README.mdGeoffrey Alexandre2016-02-251-2/+2
* Replace references to jira.codehaus.org by jira.sonarsource.comSimon Brandhof2015-05-291-1/+1
* Fix travis pill in READMESimon Brandhof2015-05-261-1/+1
* Use svg icon of travis buildStas Vilchik2015-05-131-1/+1
* Show build statusDavid Gageot2015-05-131-0/+4
* Sanitize READMESimon Brandhof2015-02-091-31/+2
* SONAR-6022 Update dead links pointing to documentationFabrice Bellingard2015-01-061-1/+1
* Remove old web dev modeSimon Brandhof2014-07-311-14/+0
* Update README.mdSimon Brandhof2014-07-151-3/+3
* Update README.mdSimon Brandhof2014-06-121-30/+2
* Fix URL of Git repositorySimon Brandhof2014-03-251-3/+2
* Update README.mdSimon Brandhof2014-02-271-1/+1
* SONAR-5080 speed-up startup of dev mode and document the installation of nodejsSimon Brandhof2014-02-271-29/+4
* Complete build section of readmeSimon Brandhof2013-09-111-0/+33
* Complete build section of readmeSimon Brandhof2013-09-111-0/+45
* Complete build section of readmeSimon Brandhof2013-09-111-2/+3
* Add build section to readmeSimon Brandhof2013-09-111-0/+5
* Update README.mdSimon Brandhof2013-09-111-11/+17
* Reverse previous testJulien Lancelot2012-11-191-2/+0
* Add space to test commitJulien Lancelot2012-11-191-0/+2
* My first commit in GIT :-)Olivier Gaudin2011-02-031-1/+1
* Add READMEEvgeny Mandrikov2011-01-111-0/+16
n value='backport/48050/stable28'>backport/48050/stable28 Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
summaryrefslogtreecommitdiffstats
path: root/settings/js/settings.js
blob: 13c56a8f53aa1c4de3afbb1d10abb3ec8fdef1bd (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/**
 * Copyright (c) 2014, Vincent Petry <pvince81@owncloud.com>
 * This file is licensed under the Affero General Public License version 3 or later.
 * See the COPYING-README file.
 */
OC.Settings = OC.Settings || {};
OC.Settings = _.extend(OC.Settings, {

	_cachedGroups: null,

	/**
	 * Setup selection box for group selection.
	 *
	 * Values need to be separated by a pipe "|" character.
	 * (mostly because a comma is more likely to be used
	 * for groups)
	 *
	 * @param $elements jQuery element (hidden input) to setup select2 on
	 * @param [extraOptions] extra options hash to pass to select2
	 */
	setupGroupsSelect: function($elements, extraOptions) {
		var self = this;
		if ($elements.length > 0) {
			// note: settings are saved through a "change" event registered
			// on all input fields
			$elements.select2(_.extend({
				placeholder: t('core', 'Groups'),
				allowClear: true,
				multiple: true,
				separator: '|',
				query: _.debounce(function(query) {
					var queryData = {};
					if (self._cachedGroups && query.term === '') {
						query.callback({results: self._cachedGroups});
						return;
					}
					if (query.term !== '') {
						queryData = {
							pattern: query.term,
							filterGroups: 1
						};
					}
					$.ajax({
						url: OC.generateUrl('/settings/ajax/grouplist'),
						data: queryData,
						dataType: 'json',
						success: function(data) {
							if (data.status === "success") {
								var results = [];

								// add groups
								$.each(data.data.adminGroups, function(i, group) {
									results.push({id:group.id, displayname:group.name});
								});
								$.each(data.data.groups, function(i, group) {
									results.push({id:group.id, displayname:group.name});
								});

								if (query.term === '') {
									// cache full list
									self._cachedGroups = results;
								}
								query.callback({results: results});
							} else {
								//FIXME add error handling
							}
						}
					});
				}, 100, true),
				id: function(element) {
					return element.id;
				},
				initSelection: function(element, callback) {
					var selection =
						_.map(($(element).val() || []).split('|').sort(),
							function(groupName) {
						return {
							id: groupName,
							displayname: groupName
						};
					});
					callback(selection);
				},
				formatResult: function (element) {
					return escapeHTML(element.displayname);
				},
				formatSelection: function (element) {
					return escapeHTML(element.displayname);
				},
				escapeMarkup: function(m) {
					// prevent double markup escape
					return m;
				}
			}, extraOptions || {}));
		}
	}
});