diff options
author | Robin McCorkell <rmccorkell@owncloud.com> | 2015-08-12 20:03:11 +0100 |
---|---|---|
committer | Robin McCorkell <rmccorkell@owncloud.com> | 2015-08-19 10:05:11 +0100 |
commit | 1eeca031f863a652d07ebfa2f75339232bf60dc1 (patch) | |
tree | 2f4b046e3506d4e9e385415bf01961f9b9978d97 /apps/files_external/js | |
parent | 272a46ebe1a5e195a078dde74f5f2ad941923d9e (diff) | |
download | nextcloud-server-1eeca031f863a652d07ebfa2f75339232bf60dc1.tar.gz nextcloud-server-1eeca031f863a652d07ebfa2f75339232bf60dc1.zip |
Split backend identifiers from the class name
Prior to this, the storage class name was stored in mount.json under the
"class" parameter, and the auth mechanism class name under the
"authMechanism" parameter. This decouples the class name from the
identifier used to retrieve the backend or auth mechanism.
Now, backends/auth mechanisms have a unique identifier, which is saved in
the "backend" or "authMechanism" parameter in mount.json respectively.
An identifier is considered unique for the object it references, but the
underlying class may change (e.g. files_external gets pulled into core
and namespaces are modified).
Diffstat (limited to 'apps/files_external/js')
-rw-r--r-- | apps/files_external/js/settings.js | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js index 7240c246ea7..7288f90fa77 100644 --- a/apps/files_external/js/settings.js +++ b/apps/files_external/js/settings.js @@ -214,18 +214,18 @@ StorageConfig.prototype = { mountPoint: '', /** - * Backend class name + * Backend * * @type string */ - backendClass: null, + backend: null, /** - * Authentication mechanism class name + * Authentication mechanism * * @type string */ - authMechanismClass: null, + authMechanism: null, /** * Backend-specific configuration @@ -279,8 +279,8 @@ StorageConfig.prototype = { getData: function() { var data = { mountPoint: this.mountPoint, - backendClass: this.backendClass, - authMechanismClass: this.authMechanismClass, + backend: this.backend, + authMechanism: this.authMechanism, backendOptions: this.backendOptions }; if (this.id) { @@ -704,14 +704,14 @@ MountConfigListView.prototype = { $el.find('tbody').append($tr.clone()); $el.find('tbody tr').last().find('.mountPoint input').val(''); var selected = $target.find('option:selected').text(); - var backendClass = $target.val(); + var backend = $target.val(); $tr.find('.backend').text(selected); if ($tr.find('.mountPoint input').val() === '') { $tr.find('.mountPoint input').val(this._suggestMountPoint(selected)); } - $tr.addClass(backendClass); - $tr.find('.backend').data('class', backendClass); - var backendConfiguration = this._allBackends[backendClass]; + $tr.addClass(backend); + $tr.find('.backend').data('class', backend); + var backendConfiguration = this._allBackends[backend]; var selectAuthMechanism = $('<select class="selectAuthMechanism"></select>'); $.each(this._allAuthMechanisms, function(authClass, authMechanism) { @@ -730,7 +730,7 @@ MountConfigListView.prototype = { var priorityEl = $('<input type="hidden" class="priority" value="' + backendConfiguration['priority'] + '" />'); $tr.append(priorityEl); - if (backendConfiguration['custom'] && $el.find('tbody tr.'+backendClass.replace(/\\/g, '\\\\')).length === 1) { + if (backendConfiguration['custom'] && $el.find('tbody tr.'+backend.replace(/\\/g, '\\\\')).length === 1) { OC.addScript('files_external', backendConfiguration['custom']); } $td.children().not('[type=hidden]').first().focus(); @@ -747,12 +747,12 @@ MountConfigListView.prototype = { var $target = $(event.target); var $tr = $target.closest('tr'); - var authMechanismClass = $target.val(); - var authMechanism = this._allAuthMechanisms[authMechanismClass]; + var authMechanism = $target.val(); + var authMechanismConfiguration = this._allAuthMechanisms[authMechanism]; var $td = $tr.find('td.configuration'); $td.find('.auth-param').remove(); - $.each(authMechanism['configuration'], _.partial( + $.each(authMechanismConfiguration['configuration'], _.partial( this.writeParameterInput, $td, _, _, ['auth-param'] )); }, @@ -792,8 +792,8 @@ MountConfigListView.prototype = { } var storage = new this._storageConfigClass(storageId); storage.mountPoint = $tr.find('.mountPoint input').val(); - storage.backendClass = $tr.find('.backend').data('class'); - storage.authMechanismClass = $tr.find('.selectAuthMechanism').val(); + storage.backend = $tr.find('.backend').data('class'); + storage.authMechanism = $tr.find('.selectAuthMechanism').val(); var classOptions = {}; var configuration = $tr.find('.configuration input'); |