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

settings.js « js « files_external « apps - github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9a558ad6e43d07fa1e8195136a961f1ed8e3e4f6 (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
$(document).ready(function(){

	function applicableChange(applicable) {
		if (applicable == 'Global') {
			
		}
		console.log(applicable);
	}

	$('#selectStorage').live('change', function() {
		var tr = $(this).parent().parent();
		$('#externalStorage tbody').last().append($(tr).clone());
		var selected = $(this).val();
		$(this).parent().text(selected);
		var backends = $(this).data('configurations').split(';');
		var configuration = [];
		// Find selected backend configuration parameters
		$.each(backends, function(index, backend) {
			if (backend.split(':')[0] == selected) {
				configuration = backend.split(':')[1].split(',');
				// 				break;
			}
		});
		var td = $(tr).find('td.configuration');
		$.each(configuration, function(index, config) {
			if (config.indexOf('*') != -1) {
				td.append('<input type="password" placeholder="'+config.substring(1)+'" />');
			} else {
				td.append('<input type="text" placeholder="'+config+'" />');
			}
		});
		$(tr).find('td').last().attr('class', 'remove');
		$(tr).removeAttr('id');
		$(this).remove();
	});

	$('td.remove>img').live('click', function() {
		$(this).parent().parent().remove();
		// TODO remove storage
	});

	$('#externalStorage select[multiple]').each(function(index,element){
		applyMultiplySelect($(element));
	});

	function applyMultiplySelect(element) {
		var checkHandeler=false;
		element.multiSelect({
			oncheck:applicableChange,
			onuncheck:applicableChange,
			minWidth: 120,
		});
	}

	$('#allowUserMounting').bind('change', function() {
		// TODO save setting
	});

});