Tentative fix for SRP problem and improved Attachments UI in card View

and Edit
This commit is contained in:
Dario Chiappetta 2015-11-25 10:39:50 +01:00
parent caca12d423
commit 8b7a438039
8 changed files with 57 additions and 25 deletions

View File

@ -1118,7 +1118,7 @@ div.attachmentQueueStatus {
width: 150px;
text-align: right; }
div.attachmentQueueStatus ul li .status .statusString {
font-size: .8em; }
font-size: 14px; }
div.attachmentQueueStatus ul li .status .processIcon {
margin-left: 1em; }
div.attachmentQueueStatus ul li .close a {
@ -1270,6 +1270,7 @@ div.cardContent {
-moz-flex: auto;
-ms-flex: auto;
flex: auto;
width: 100%;
display: -webkit-box;
display: -webkit-flex;
display: -moz-flex;
@ -3668,9 +3669,11 @@ div.cardList.narrow {
.cardAttachments .attachmentList li .progress .radialProgressIndicator.waiting .border {
fill: #aaa; }
.edit .cardDetailToolbar.commands div, .edit .cardDetailToolbar.commands ul {
display: none;
visibility: hidden; }
.edit {
width: 100%; }
.edit .cardDetailToolbar.commands div, .edit .cardDetailToolbar.commands ul {
display: none;
visibility: hidden; }
.cardDetailToolbar.edit li {
font-weight: 100; }

File diff suppressed because one or more lines are too long

View File

@ -517,7 +517,8 @@ Clipperz.log("<<< Connection.messageExceptionHandler")
'uploadAttachment': function(someArguments, aProgressCallback) {
return Clipperz.Async.callbacks("Connction.uploadAttachment", [
MochiKit.Base.method(this, 'message', 'echo', {'echo':"echo"}),
MochiKit.Base.method(this.proxy(), 'uploadAttachment', someArguments, aProgressCallback, this.sharedSecret()),
MochiKit.Base.bind(function(){ return this.sharedSecret()}, this),
MochiKit.Base.method(this.proxy(), 'uploadAttachment', someArguments, aProgressCallback/*, this.sharedSecret()*/),
], {trace:false});
// return this.proxy().uploadAttachment(someArguments, aProgressCallback, this.sharedSecret());
@ -526,7 +527,8 @@ Clipperz.log("<<< Connection.messageExceptionHandler")
'downloadAttachment': function(someArguments, aProgressCallback) {
return Clipperz.Async.callbacks("Connction.uploadAttachment", [
MochiKit.Base.method(this, 'message', 'echo', {'echo':"echo"}),
MochiKit.Base.method(this.proxy(), 'downloadAttachment', someArguments, aProgressCallback, this.sharedSecret()),
MochiKit.Base.bind(function(){ return this.sharedSecret()}, this),
MochiKit.Base.method(this.proxy(), 'downloadAttachment', someArguments, aProgressCallback/*, this.sharedSecret()*/),
], {trace:false});
// return this.proxy().downloadAttachment(someArguments, aProgressCallback, this.sharedSecret());

View File

@ -25,16 +25,16 @@ refer to http://www.clipperz.com.
Clipperz.Base.module('Clipperz.PM.UI');
Clipperz.PM.UI.AttachmentController = function(someParameters) {
this.MAX_SIMULTANEOUS_READ = 1;
this.MAX_SIMULTANEOUS_UPLOAD = 1;
this.MAX_SIMULTANEOUS_READ = 1;
this.MAX_SIMULTANEOUS_UPLOAD = 1;
this.MAX_SIMULTANEOUS_DOWNLOAD = 1;
this.MAX_SIMULTANEOUS_ENCRYPT = 1;
this.MAX_SIMULTANEOUS_DECRYPT = 1;
this.MAX_SIMULTANEOUS_ENCRYPT = 1;
this.MAX_SIMULTANEOUS_DECRYPT = 1;
this.LATEST_ENCRYPTION_VERSION = '1.0'; // Versions aren't handled completely yet!
this.fileQueue = [];
this.notifications = [];
this.fileQueue = [];
this.notifications = [];
this.operationsCount = null;
this.encryptedDocument = null;
@ -279,7 +279,7 @@ MochiKit.Base.update(Clipperz.PM.UI.AttachmentController.prototype, {
},
//=========================================================================
// Queue Processing
// Notifications
//=========================================================================
addNotification: function(aQueueElement) {

View File

@ -688,6 +688,7 @@ console.log("DROP"); //, anEvent);
var result;
var broken = (! aServerStatus && (! aStatus || aStatus == 'CANCELED' || aStatus == 'FAILED' || aStatus == 'DONE'));
var queueOperationsInProgress = (aStatus != 'DONE' && aStatus != 'CANCELED' && aStatus != 'FAILED');
result = null;
if (aStatus == 'UPLOADING' || aStatus == 'DOWNLOADING') {
@ -695,7 +696,7 @@ console.log("DROP"); //, anEvent);
'progress': aProgress,
'border': 1
});
} else if (! broken && aStatus != 'DONE' && aStatus != 'FAILED' && aServerStatus != 'AVAILABLE') {
} else if (! broken /* && aStatus != 'DONE' && aStatus != 'FAILED' */ && aServerStatus != 'AVAILABLE' && queueOperationsInProgress) {
result = Clipperz.PM.UI.Components.RadialProgressIndicator({
'progress': 0,
'border': 1,
@ -710,6 +711,7 @@ console.log("DROP"); //, anEvent);
var result;
var status = aStatus ? aStatus : false;
var queueOperationsInProgress = (status && (status != 'DONE' && status != 'CANCELED' && status != 'FAILED'));
result = null;
@ -730,8 +732,10 @@ console.log("DROP"); //, anEvent);
result = React.DOM.span({'className': 'broken'}, "failed");
break;
default:
result = React.DOM.span({'className': 'waiting'}, "waiting");
result = React.DOM.span({'className': 'waiting'}, "\u2b06waiting");
}
} else if (queueOperationsInProgress) {
result = React.DOM.span({'className': 'waiting'}, "\u2b07waiting");
}
return result;

View File

@ -266,6 +266,7 @@ Clipperz.PM.UI.Components.Cards.ViewClass = React.createClass({
var result;
var broken = (! aServerStatus && (! aStatus || aStatus == 'CANCELED' || aStatus == 'FAILED' || aStatus == 'DONE'));
var queueOperationsInProgress = (aStatus != 'DONE' && aStatus != 'CANCELED' && aStatus != 'FAILED');
result = null;
if (aStatus == 'UPLOADING' || aStatus == 'DOWNLOADING') {
@ -273,7 +274,7 @@ Clipperz.PM.UI.Components.Cards.ViewClass = React.createClass({
'progress': aProgress,
'border': 1
});
} else if (! broken && aStatus != 'DONE' && aServerStatus != 'AVAILABLE') {
} else if (! broken && queueOperationsInProgress /* && aServerStatus != 'AVAILABLE'*/) {
result = Clipperz.PM.UI.Components.RadialProgressIndicator({
'progress': 0,
'border': 1,
@ -288,6 +289,7 @@ Clipperz.PM.UI.Components.Cards.ViewClass = React.createClass({
var result;
var status = aStatus ? aStatus : false;
var queueOperationsInProgress = (status && (status != 'DONE' && status != 'CANCELED' && status != 'FAILED'));
result = null;
@ -308,8 +310,10 @@ Clipperz.PM.UI.Components.Cards.ViewClass = React.createClass({
result = React.DOM.span({'className': 'broken'}, "failed");
break;
default:
result = React.DOM.span({'className': 'waiting'}, "waiting");
result = React.DOM.span({'className': 'waiting'}, "\u2b06waiting");
}
} else if (queueOperationsInProgress) {
result = React.DOM.span({'className': 'waiting'}, "\u2b07waiting");
}
return result;
@ -318,19 +322,34 @@ Clipperz.PM.UI.Components.Cards.ViewClass = React.createClass({
renderAttachmentActions: function(aStatus, aServerStatus, anAttachment) {
var result;
var queueOperationsInProgress = (aStatus != 'DONE' && aStatus != 'CANCELED' && aStatus != 'FAILED');
result = null;
if (aStatus == 'DOWNLOADING') {
result = React.DOM.a({
'className': 'cancel',
'onClick': MochiKit.Base.method(this, 'handleCancelDownload', anAttachment)
}, "remove field");
} else if (aServerStatus == 'AVAILABLE') {
if (aServerStatus == 'AVAILABLE' && ! queueOperationsInProgress) {
result = React.DOM.a({
'className': 'download',
'onClick': MochiKit.Base.method(this, 'handleGetAttachment', anAttachment),
}, "\u2b07");
} else if (aServerStatus == 'AVAILABLE' && queueOperationsInProgress) {
result = React.DOM.a({
'className': 'cancel',
'onClick': MochiKit.Base.method(this, 'handleCancelDownload', anAttachment)
}, "remove field");
}
// result = null;
// if (aStatus == 'DOWNLOADING') {
// result = React.DOM.a({
// 'className': 'cancel',
// 'onClick': MochiKit.Base.method(this, 'handleCancelDownload', anAttachment)
// }, "remove field");
// } else if (aServerStatus == 'AVAILABLE' && ! queueOperationsInProgress) {
// result = React.DOM.a({
// 'className': 'download',
// 'onClick': MochiKit.Base.method(this, 'handleGetAttachment', anAttachment),
// }, "\u2b07");
// }
return result;
},

View File

@ -483,7 +483,7 @@ div.attachmentQueueStatus {
text-align: right;
.statusString {
font-size: .8em;
font-size: 14px;
}
.processIcon {
@ -666,6 +666,8 @@ div.cardContent {
@include flex(auto);
@include mask();
width:100%;
@include flexbox();
& > div.edit {
@include flex(auto);

View File

@ -536,6 +536,8 @@ $cardViewBasePadding: 10px;
}
.edit {
width:100%;
.cardDetailToolbar {
&.commands {
div, ul {