summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <morris.jobke@gmail.com>2013-10-13 13:03:02 -0700
committerMorris Jobke <morris.jobke@gmail.com>2013-10-13 13:03:02 -0700
commita021a12b3bafae23c992c38e3abc109cdc1ed420 (patch)
tree01f9fa310c3a964fe59e806388e962761268ac0b
parent3f54e3c783274c4d6b9ccd06bf434fdf0529d324 (diff)
parentbced346c3b07fc6549f216f4db20c52e827d3cfa (diff)
downloadnextcloud-server-a021a12b3bafae23c992c38e3abc109cdc1ed420.tar.gz
nextcloud-server-a021a12b3bafae23c992c38e3abc109cdc1ed420.zip
Merge pull request #5253 from owncloud/externalstorage-adminstatusindicator
Fixed external storage status indicator in admin page
-rw-r--r--apps/files_external/css/settings.css4
-rw-r--r--apps/files_external/js/settings.js51
-rw-r--r--core/css/styles.css1
-rw-r--r--core/img/loading-small.gifbin0 -> 1294 bytes
4 files changed, 30 insertions, 26 deletions
diff --git a/apps/files_external/css/settings.css b/apps/files_external/css/settings.css
index f2f40247b28..0ebae9d82be 100644
--- a/apps/files_external/css/settings.css
+++ b/apps/files_external/css/settings.css
@@ -4,7 +4,6 @@ td.status > span {
width: 16px;
vertical-align: text-bottom;
}
-
span.success {
background: #37ce02;
border-radius: 8px;
@@ -12,9 +11,6 @@ span.success {
span.error {
background: #ce3702;
}
-span.waiting {
- background: none;
-}
td.mountPoint, td.backend { width:10em; }
td.remove>img { visibility:hidden; padding-top:0.8em; }
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js
index 3e605c59a93..886c324e338 100644
--- a/apps/files_external/js/settings.js
+++ b/apps/files_external/js/settings.js
@@ -1,10 +1,23 @@
+(function(){
+
+function updateStatus(statusEl, result){
+ statusEl.removeClass('success error loading-small');
+ if (result && result.status == 'success' && result.data.message) {
+ statusEl.addClass('success');
+ return true;
+ } else {
+ statusEl.addClass('error');
+ return false;
+ }
+}
+
OC.MountConfig={
saveStorage:function(tr) {
var mountPoint = $(tr).find('.mountPoint input').val();
if (mountPoint == '') {
return false;
}
- var statusSpan = $(tr).find('.status span');
+ var statusSpan = $(tr).closest('tr').find('.status span');
var backendClass = $(tr).find('.backend').data('class');
var configuration = $(tr).find('.configuration input');
var addMountPoint = true;
@@ -58,6 +71,7 @@ OC.MountConfig={
}
users.push(applicable);
}
+ statusSpan.addClass('loading-small').removeClass('error success');
$.ajax({type: 'POST',
url: OC.filePath('files_external', 'ajax', 'addMountPoint.php'),
data: {
@@ -68,15 +82,11 @@ OC.MountConfig={
applicable: applicable,
isPersonal: isPersonal
},
- async: false,
success: function(result) {
- statusSpan.removeClass();
- if (result && result.status == 'success' && result.data.message) {
- status = true;
- statusSpan.addClass('success');
- } else {
- statusSpan.addClass('error');
- }
+ status = updateStatus(statusSpan, result);
+ },
+ error: function(result){
+ status = updateStatus(statusSpan, result);
}
});
});
@@ -93,8 +103,7 @@ OC.MountConfig={
mountType: mountType,
applicable: applicable,
isPersonal: isPersonal
- },
- async: false
+ }
});
});
var mountType = 'user';
@@ -108,14 +117,14 @@ OC.MountConfig={
mountType: mountType,
applicable: applicable,
isPersonal: isPersonal
- },
- async: false
+ }
});
});
} else {
var isPersonal = true;
var mountType = 'user';
var applicable = OC.currentUser;
+ statusSpan.addClass('loading-small').removeClass('error success');
$.ajax({type: 'POST',
url: OC.filePath('files_external', 'ajax', 'addMountPoint.php'),
data: {
@@ -126,15 +135,11 @@ OC.MountConfig={
applicable: applicable,
isPersonal: isPersonal
},
- async: false,
success: function(result) {
- statusSpan.removeClass();
- if (result && result.status == 'success' && result.data.message) {
- status = true;
- statusSpan.addClass('success');
- } else {
- statusSpan.addClass('error');
- }
+ status = updateStatus(statusSpan, result);
+ },
+ error: function(result){
+ status = updateStatus(statusSpan, result);
}
});
}
@@ -157,7 +162,7 @@ $(document).ready(function() {
$(tr).find('.mountPoint input').val(suggestMountPoint(selected));
}
$(tr).addClass(backendClass);
- $(tr).find('.status').append('<span class="waiting"></span>');
+ $(tr).find('.status').append('<span></span>');
$(tr).find('.backend').data('class', backendClass);
var configurations = $(this).data('configurations');
var td = $(tr).find('td.configuration');
@@ -293,3 +298,5 @@ $(document).ready(function() {
});
});
+
+})();
diff --git a/core/css/styles.css b/core/css/styles.css
index 1a521019d98..b919660779e 100644
--- a/core/css/styles.css
+++ b/core/css/styles.css
@@ -748,6 +748,7 @@ a.bookmarklet { background-color:#ddd; border:1px solid #ccc; padding:5px;paddin
span.ui-icon {float: left; margin: 3px 7px 30px 0;}
.loading { background: url('../img/loading.gif') no-repeat center; cursor: wait; }
+.loading-small { background: url('../img/loading-small.gif') no-repeat center; cursor: wait; }
.move2trash { /* decrease spinner size */
width: 16px;
height: 16px;
diff --git a/core/img/loading-small.gif b/core/img/loading-small.gif
new file mode 100644
index 00000000000..5025f0bedeb
--- /dev/null
+++ b/core/img/loading-small.gif
Binary files differ