mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 20:49:20 +03:00
PreRelease 1.8.3
This commit is contained in:
parent
39566292af
commit
0ea982671b
40 changed files with 712 additions and 370 deletions
|
|
@ -34,8 +34,17 @@
|
|||
this.loginError = ko.observable(false);
|
||||
this.passwordError = ko.observable(false);
|
||||
|
||||
this.loginErrorAnimation = ko.observable(false).extend({'falseTimeout': 500});
|
||||
this.passwordErrorAnimation = ko.observable(false).extend({'falseTimeout': 500});
|
||||
|
||||
this.loginFocus = ko.observable(false);
|
||||
|
||||
this.formHidden = ko.observable(false);
|
||||
|
||||
this.formError = ko.computed(function () {
|
||||
return this.loginErrorAnimation() || this.passwordErrorAnimation();
|
||||
}, this);
|
||||
|
||||
this.login.subscribe(function () {
|
||||
this.loginError(false);
|
||||
}, this);
|
||||
|
|
@ -44,6 +53,14 @@
|
|||
this.passwordError(false);
|
||||
}, this);
|
||||
|
||||
this.loginError.subscribe(function (bV) {
|
||||
this.loginErrorAnimation(!!bV);
|
||||
}, this);
|
||||
|
||||
this.passwordError.subscribe(function (bV) {
|
||||
this.passwordErrorAnimation(!!bV);
|
||||
}, this);
|
||||
|
||||
this.submitRequest = ko.observable(false);
|
||||
this.submitError = ko.observable('');
|
||||
|
||||
|
|
@ -51,6 +68,9 @@
|
|||
|
||||
Utils.triggerAutocompleteInputChange();
|
||||
|
||||
this.loginError(false);
|
||||
this.passwordError(false);
|
||||
|
||||
this.loginError('' === Utils.trim(this.login()));
|
||||
this.passwordError('' === Utils.trim(this.password()));
|
||||
|
||||
|
|
@ -67,6 +87,7 @@
|
|||
{
|
||||
if (oData.Result)
|
||||
{
|
||||
this.formHidden(true);
|
||||
require('App/Admin').loginAndLogoutReload(true);
|
||||
}
|
||||
else if (oData.ErrorCode)
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@
|
|||
};
|
||||
|
||||
/**
|
||||
* @returns {boolean}
|
||||
* @return {boolean}
|
||||
*/
|
||||
ActivatePopupView.prototype.validateSubscriptionKey = function ()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -995,7 +995,7 @@
|
|||
*
|
||||
* @param {Array} aList
|
||||
* @param {boolean} bFriendly
|
||||
* @returns {string}
|
||||
* @return {string}
|
||||
*/
|
||||
ComposePopupView.prototype.emailArrayToStringLineHelper = function (aList, bFriendly)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
|
||||
this.additionalCode = ko.observable('');
|
||||
this.additionalCode.error = ko.observable(false);
|
||||
this.additionalCode.errorAnimation = ko.observable(false).extend({'falseTimeout': 500});
|
||||
this.additionalCode.focused = ko.observable(false);
|
||||
this.additionalCode.visibility = ko.observable(false);
|
||||
this.additionalCodeSignMe = ko.observable(false);
|
||||
|
|
@ -56,6 +57,16 @@
|
|||
this.emailError = ko.observable(false);
|
||||
this.passwordError = ko.observable(false);
|
||||
|
||||
this.emailErrorAnimation = ko.observable(false).extend({'falseTimeout': 500});
|
||||
this.passwordErrorAnimation = ko.observable(false).extend({'falseTimeout': 500});
|
||||
|
||||
this.formHidden = ko.observable(false);
|
||||
|
||||
this.formError = ko.computed(function () {
|
||||
return this.emailErrorAnimation() || this.passwordErrorAnimation() ||
|
||||
(this.additionalCode.visibility() && this.additionalCode.errorAnimation());
|
||||
}, this);
|
||||
|
||||
this.emailFocus = ko.observable(false);
|
||||
this.passwordFocus = ko.observable(false);
|
||||
this.submitFocus = ko.observable(false);
|
||||
|
|
@ -78,6 +89,18 @@
|
|||
this.additionalCode.error(false);
|
||||
}, this);
|
||||
|
||||
this.emailError.subscribe(function (bV) {
|
||||
this.emailErrorAnimation(!!bV);
|
||||
}, this);
|
||||
|
||||
this.passwordError.subscribe(function (bV) {
|
||||
this.passwordErrorAnimation(!!bV);
|
||||
}, this);
|
||||
|
||||
this.additionalCode.error.subscribe(function (bV) {
|
||||
this.additionalCode.errorAnimation(!!bV);
|
||||
}, this);
|
||||
|
||||
this.submitRequest = ko.observable(false);
|
||||
this.submitError = ko.observable('');
|
||||
this.submitErrorAddidional = ko.observable('');
|
||||
|
|
@ -115,16 +138,34 @@
|
|||
|
||||
Utils.triggerAutocompleteInputChange();
|
||||
|
||||
this.emailError(false);
|
||||
this.passwordError(false);
|
||||
|
||||
this.emailError('' === Utils.trim(this.email()));
|
||||
this.passwordError('' === Utils.trim(this.password()));
|
||||
|
||||
if (this.additionalCode.visibility())
|
||||
{
|
||||
this.additionalCode.error(false);
|
||||
this.additionalCode.error('' === Utils.trim(this.additionalCode()));
|
||||
}
|
||||
|
||||
if (this.emailError() || this.passwordError() || this.additionalCode.error())
|
||||
if (this.emailError() || this.passwordError() ||
|
||||
(this.additionalCode.visibility() && this.additionalCode.error()))
|
||||
{
|
||||
switch (true)
|
||||
{
|
||||
case this.emailError():
|
||||
this.emailFocus(true);
|
||||
break;
|
||||
case this.passwordError():
|
||||
this.passwordFocus(true);
|
||||
break;
|
||||
case this.additionalCode.visibility() && this.additionalCode.error():
|
||||
this.additionalCode.focused(true);
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -172,10 +213,12 @@
|
|||
}
|
||||
else if (oData.Admin)
|
||||
{
|
||||
this.formHidden(true);
|
||||
require('App/User').redirectToAdminPanel();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.formHidden(true);
|
||||
require('App/User').loginAndLogoutReload(false);
|
||||
}
|
||||
}
|
||||
|
|
@ -339,6 +382,8 @@
|
|||
if (0 === iErrorCode)
|
||||
{
|
||||
self.submitRequest(true);
|
||||
self.formHidden(true);
|
||||
|
||||
require('App/User').loginAndLogoutReload(false);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -374,7 +374,7 @@
|
|||
};
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
* @return {string}
|
||||
*/
|
||||
MessageListMailBoxUserView.prototype.printableMessageCountForDeletion = function ()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -82,6 +82,10 @@
|
|||
this.allowAttachmnetControls = ko.observable(false);
|
||||
this.showAttachmnetControls = ko.observable(false);
|
||||
|
||||
this.downloadAsZipLoading = ko.observable(false);
|
||||
this.saveToOwnCloudLoading = ko.observable(false);
|
||||
this.saveToDropboxLoading = ko.observable(false);
|
||||
|
||||
this.showAttachmnetControls.subscribe(function (bV) {
|
||||
if (this.message())
|
||||
{
|
||||
|
|
@ -115,12 +119,6 @@
|
|||
this.moreDropdownTrigger = ko.observable(false);
|
||||
this.messageDomFocused = ko.observable(false).extend({'rateLimit': 0});
|
||||
|
||||
// TODO
|
||||
// ko.computed(function () {
|
||||
// window.console.log('focus:' + AppStore.focusedState() + ', dom:' +
|
||||
// this.messageDomFocused() + ', key:' + Globals.keyScope() + ' ~ ' + Globals.keyScopeReal());
|
||||
// }, this).extend({'throttle': 1});
|
||||
|
||||
this.messageVisibility = ko.computed(function () {
|
||||
return !this.messageLoadingThrottle() && !!this.message();
|
||||
}, this);
|
||||
|
|
@ -759,9 +757,20 @@
|
|||
}
|
||||
|
||||
var oAttachment = ko.dataFor(this);
|
||||
if (oAttachment && oAttachment.isMp3() && Audio.supported)
|
||||
if (oAttachment && Audio.supported)
|
||||
{
|
||||
Audio.playMp3(oAttachment.linkDownload(), oAttachment.fileName);
|
||||
switch (true)
|
||||
{
|
||||
case Audio.supportedMp3 && oAttachment.isMp3():
|
||||
Audio.playMp3(oAttachment.linkDownload(), oAttachment.fileName);
|
||||
break;
|
||||
case Audio.supportedOgg && oAttachment.isOgg():
|
||||
Audio.playOgg(oAttachment.linkDownload(), oAttachment.fileName);
|
||||
break;
|
||||
case Audio.supportedWav && oAttachment.isWav():
|
||||
Audio.playWav(oAttachment.linkDownload(), oAttachment.fileName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
})
|
||||
.on('click', '.thread-list .more-threads', function (e) {
|
||||
|
|
@ -1107,6 +1116,40 @@
|
|||
}
|
||||
};
|
||||
|
||||
MessageViewMailBoxUserView.prototype.getAttachmentsHashes = function ()
|
||||
{
|
||||
return _.compact(_.map(this.message() ? this.message().attachments() : [], function (oItem) {
|
||||
return oItem && oItem.checked() ? oItem.download : '';
|
||||
}));
|
||||
};
|
||||
|
||||
MessageViewMailBoxUserView.prototype.downloadAsZip = function ()
|
||||
{
|
||||
var aHashes = this.getAttachmentsHashes();
|
||||
if (0 < aHashes.length)
|
||||
{
|
||||
Promises.attachmentsActions('Zip', aHashes, this.downloadAsZipLoading);
|
||||
}
|
||||
};
|
||||
|
||||
MessageViewMailBoxUserView.prototype.saveToOwnCloud = function ()
|
||||
{
|
||||
var aHashes = this.getAttachmentsHashes();
|
||||
if (0 < aHashes.length)
|
||||
{
|
||||
Promises.attachmentsActions('OwnCloud', aHashes, this.saveToOwnCloudLoading);
|
||||
}
|
||||
};
|
||||
|
||||
MessageViewMailBoxUserView.prototype.saveToDropbox = function ()
|
||||
{
|
||||
var aHashes = this.getAttachmentsHashes();
|
||||
if (0 < aHashes.length)
|
||||
{
|
||||
Promises.attachmentsActions('Dropbox', aHashes, this.saveToDropboxLoading);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {MessageModel} oMessage
|
||||
*/
|
||||
|
|
@ -1119,7 +1162,7 @@
|
|||
};
|
||||
|
||||
/**
|
||||
* @returns {string}
|
||||
* @return {string}
|
||||
*/
|
||||
MessageViewMailBoxUserView.prototype.printableCheckedMessageCount = function ()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue