summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@owncloud.com>2016-02-08 21:45:20 +0000
committerRobin McCorkell <robin@mccorkell.me.uk>2016-05-03 11:30:02 +0100
commita09ef66eea12faf1055f642fa79e910773cb96a0 (patch)
tree877e4c542f5d840c0bf9c35011323c3cd8d0691c /apps/files_external
parent43abe2b64855d5acbde4ce4c58a4f543371bb001 (diff)
downloadnextcloud-server-a09ef66eea12faf1055f642fa79e910773cb96a0.tar.gz
nextcloud-server-a09ef66eea12faf1055f642fa79e910773cb96a0.zip
Change colour of input fields instead of printing 'Access granted'
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/css/settings.css4
-rw-r--r--apps/files_external/js/oauth1.js10
-rw-r--r--apps/files_external/js/oauth2.js13
3 files changed, 16 insertions, 11 deletions
diff --git a/apps/files_external/css/settings.css b/apps/files_external/css/settings.css
index 9338b8d3ee7..d6df4fa0747 100644
--- a/apps/files_external/css/settings.css
+++ b/apps/files_external/css/settings.css
@@ -45,6 +45,10 @@ td.mountPoint, td.backend { width:160px; }
margin-right: 6px;
}
+#externalStorage td.configuration input.disabled-success {
+ background-color: rgba(134, 255, 110, 0.9);
+}
+
#externalStorage td.applicable div.chzn-container {
position: relative;
diff --git a/apps/files_external/js/oauth1.js b/apps/files_external/js/oauth1.js
index 8c64f1189f4..79248a3e3b2 100644
--- a/apps/files_external/js/oauth1.js
+++ b/apps/files_external/js/oauth1.js
@@ -1,5 +1,9 @@
$(document).ready(function() {
+ function displayGranted($tr) {
+ $tr.find('.configuration input.auth-param').attr('disabled', 'disabled').addClass('disabled-success');
+ }
+
OCA.External.Settings.mountConfig.whenSelectAuthMechanism(function($tr, authMechanism, scheme, onCompletion) {
if (authMechanism === 'oauth1::oauth1') {
var config = $tr.find('.configuration');
@@ -13,8 +17,7 @@ $(document).ready(function() {
onCompletion.then(function() {
var configured = $tr.find('[data-parameter="configured"]');
if ($(configured).val() == 'true') {
- $tr.find('.configuration input.auth-param').attr('disabled', 'disabled');
- $tr.find('.configuration').append('<span id="access" style="padding-left:0.5em;">'+t('files_external', 'Access granted')+'</span>');
+ displayGranted($tr);
} else {
var app_key = $tr.find('.configuration [data-parameter="app_key"]').val();
var app_secret = $tr.find('.configuration [data-parameter="app_secret"]').val();
@@ -33,8 +36,7 @@ $(document).ready(function() {
$(configured).val('true');
OCA.External.Settings.mountConfig.saveStorageConfig($tr, function(status) {
if (status) {
- $tr.find('.configuration input.auth-param').attr('disabled', 'disabled');
- $tr.find('.configuration').append('<span id="access" style="padding-left:0.5em;">'+t('files_external', 'Access granted')+'</span>');
+ displayGranted($tr);
}
});
} else {
diff --git a/apps/files_external/js/oauth2.js b/apps/files_external/js/oauth2.js
index 64be9b1ed93..13b5162694e 100644
--- a/apps/files_external/js/oauth2.js
+++ b/apps/files_external/js/oauth2.js
@@ -1,5 +1,9 @@
$(document).ready(function() {
+ function displayGranted($tr) {
+ $tr.find('.configuration input.auth-param').attr('disabled', 'disabled').addClass('disabled-success');
+ }
+
OCA.External.Settings.mountConfig.whenSelectAuthMechanism(function($tr, authMechanism, scheme, onCompletion) {
if (authMechanism === 'oauth2::oauth2') {
var config = $tr.find('.configuration');
@@ -13,9 +17,7 @@ $(document).ready(function() {
onCompletion.then(function() {
var configured = $tr.find('[data-parameter="configured"]');
if ($(configured).val() == 'true') {
- $tr.find('.configuration input.auth-param').attr('disabled', 'disabled');
- $tr.find('.configuration').append($('<span/>').attr('id', 'access')
- .text(t('files_external', 'Access granted')));
+ displayGranted($tr);
} else {
var client_id = $tr.find('.configuration [data-parameter="client_id"]').val();
var client_secret = $tr.find('.configuration [data-parameter="client_secret"]')
@@ -43,10 +45,7 @@ $(document).ready(function() {
$(configured).val('true');
OCA.External.Settings.mountConfig.saveStorageConfig($tr, function(status) {
if (status) {
- $tr.find('.configuration input.auth-param').attr('disabled', 'disabled');
- $tr.find('.configuration').append($('<span/>')
- .attr('id', 'access')
- .text(t('files_external', 'Access granted')));
+ displayGranted($tr);
}
});
} else {