summaryrefslogtreecommitdiffstats
path: root/apps/files_external/js
diff options
context:
space:
mode:
authorMichael Gapczynski <GapczynskiM@gmail.com>2012-05-24 11:06:03 -0400
committerMichael Gapczynski <GapczynskiM@gmail.com>2012-05-24 11:06:03 -0400
commitbee724c53e243bda82c9490154fcd13079e41082 (patch)
tree7009eecbea6507412354f2e10d3563150a9ce128 /apps/files_external/js
parent970124a90b1d20382699680e90eeb52f70cab62c (diff)
downloadnextcloud-server-bee724c53e243bda82c9490154fcd13079e41082.tar.gz
nextcloud-server-bee724c53e243bda82c9490154fcd13079e41082.zip
Initial work on UI for mounting external storage
Diffstat (limited to 'apps/files_external/js')
-rw-r--r--apps/files_external/js/settings.js59
1 files changed, 59 insertions, 0 deletions
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js
new file mode 100644
index 00000000000..9a558ad6e43
--- /dev/null
+++ b/apps/files_external/js/settings.js
@@ -0,0 +1,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
+ });
+
+}); \ No newline at end of file