Add ask popup (messages permanent deletion)

This commit is contained in:
RainLoop Team 2013-12-17 03:31:33 +04:00
parent 1e687f9a76
commit a112b0400e
18 changed files with 94 additions and 32 deletions

View file

@ -111,6 +111,10 @@ function MailBoxMessageListViewModel()
return RL.data().spamFolder() === this.messageListEndFolder();
}, this);
this.isSpamDisabled = ko.computed(function () {
return Consts.Values.UnuseOptionValue === RL.data().spamFolder();
}, this);
this.isTrashFolder = ko.computed(function () {
return RL.data().trashFolder() === this.messageListEndFolder();
}, this);
@ -187,6 +191,8 @@ function MailBoxMessageListViewModel()
}, this)
;
this.moveOrDeleteResponse = _.bind(this.moveOrDeleteResponse, this);
Knoin.constructorEnd(this);
}
@ -352,7 +358,7 @@ MailBoxMessageListViewModel.prototype.moveMessagesToFolder = function (sFromFold
bCopy = Utils.isUnd(bCopy) ? false : !!bCopy;
RL.remote()[bCopy ? 'messagesCopy' : 'messagesMove'](
_.bind(this.moveOrDeleteResponse, this),
this.moveOrDeleteResponse,
oFromFolder.fullNameRaw,
oToFolder.fullNameRaw,
aUidForRemove
@ -392,30 +398,48 @@ MailBoxMessageListViewModel.prototype.deleteSelectedMessageFromCurrentFolder = f
if (this.canBeMoved())
{
bUseFolder = Utils.isUnd(bUseFolder) ? true : !!bUseFolder;
var oTrashOrSpamFolder = RL.cache().getFolderFromCacheList(
Enums.FolderType.Spam === iType ? RL.data().spamFolder() : RL.data().trashFolder());
if (bUseFolder)
{
if ((Enums.FolderType.Spam === iType && Consts.Values.UnuseOptionValue === RL.data().spamFolder()) ||
(Enums.FolderType.Trash === iType && Consts.Values.UnuseOptionValue === RL.data().trashFolder()))
{
bUseFolder = false;
}
}
var
self = this,
aUIds = null,
sCurrentFolderFullNameRaw = RL.data().currentFolderFullNameRaw(),
oTrashOrSpamFolder = RL.cache().getFolderFromCacheList(
Enums.FolderType.Spam === iType ? RL.data().spamFolder() : RL.data().trashFolder())
;
if (!oTrashOrSpamFolder && bUseFolder)
{
kn.showScreenPopup(PopupsFolderSystemViewModel, [
Enums.FolderType.Spam === iType ? Enums.SetSystemFoldersNotification.Spam : Enums.SetSystemFoldersNotification.Trash]);
}
else if (!bUseFolder || (oTrashOrSpamFolder && (Consts.Values.UnuseOptionValue === oTrashOrSpamFolder.fullNameRaw ||
RL.data().currentFolderFullNameRaw() === oTrashOrSpamFolder.fullNameRaw)))
else if (!bUseFolder || (oTrashOrSpamFolder && RL.data().currentFolderFullNameRaw() === oTrashOrSpamFolder.fullNameRaw))
{
RL.remote().messagesDelete(
_.bind(this.moveOrDeleteResponse, this),
RL.data().currentFolderFullNameRaw(),
RL.data().messageListCheckedOrSelectedUidsWithSubMails()
);
aUIds = RL.data().messageListCheckedOrSelectedUidsWithSubMails();
kn.showScreenPopup(PopupsAskViewModel, [Utils.i18n('POPUPS_ASK/DESC_WANT_DELETE_MESSAGES'), function () {
this.removeCheckedOrSelectedMessagesFromList();
RL.remote().messagesDelete(
self.moveOrDeleteResponse,
sCurrentFolderFullNameRaw,
aUIds
);
self.removeCheckedOrSelectedMessagesFromList();
}]);
}
else if (oTrashOrSpamFolder)
{
RL.remote().messagesMove(
_.bind(this.moveOrDeleteResponse, this),
RL.data().currentFolderFullNameRaw(),
this.moveOrDeleteResponse,
sCurrentFolderFullNameRaw,
oTrashOrSpamFolder.fullNameRaw,
RL.data().messageListCheckedOrSelectedUidsWithSubMails()
);

View file

@ -2,7 +2,7 @@
"name": "RainLoop",
"title": "RainLoop Webmail",
"version": "1.5.1",
"release": "550",
"release": "553",
"description": "Simple, modern & fast web-based email client",
"homepage": "http://rainloop.net",
"main": "Gruntfile.js",

View file

@ -26,8 +26,8 @@
<i class="icon-trash icon-white"></i>
<span data-bind="text: 1 < messageListCheckedOrSelectedUidsWithSubMails().length ? ' (' + messageListCheckedOrSelectedUidsWithSubMails().length + ')' : ''"></span>
</a>
<span style="font-size:10px;">&nbsp;</span>
<a class="btn buttonSpam" data-placement="bottom" data-bind="visible: !isSpamFolder(), command: spamCommand, tooltip: 'MESSAGE_LIST/BUTTON_SPAM'">
<span style="font-size:10px;" data-bind="visible: !isSpamFolder() && !isSpamDisabled()">&nbsp;</span>
<a class="btn buttonSpam" data-placement="bottom" data-bind="visible: !isSpamFolder() && !isSpamDisabled(), command: spamCommand, tooltip: 'MESSAGE_LIST/BUTTON_SPAM'">
<i class="icon-bug"></i>
</a>
</div>

View file

@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "Geben Sie bitte mindestens einen Empfänger an"
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?"
[POPUPS_LANGUAGES]
TITLE_LANGUAGES = "Choose language"

View file

@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "Please specify at least one recipient"
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?"
[POPUPS_LANGUAGES]
TITLE_LANGUAGES = "Choose language"

View file

@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "Por favor especifique al menos un destinatario"
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?"
[POPUPS_LANGUAGES]
TITLE_LANGUAGES = "Choose language"

View file

@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "S'il vous plaît spécifier au moins un destinataire"
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?"
[POPUPS_LANGUAGES]
TITLE_LANGUAGES = "Choisir la langue"

View file

@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "Vinsamlegast taktu fram að minnsta kosti einn viðtakand
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?"
[POPUPS_LANGUAGES]
TITLE_LANGUAGES = "Choose language"

View file

@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "수신인을 한 명 이상 선택하세요"
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?"
[POPUPS_LANGUAGES]
TITLE_LANGUAGES = "사용할 언어를 선택하세요"

View file

@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "Pievienojat vismaz vienu saņēmēju"
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?"
[POPUPS_LANGUAGES]
TITLE_LANGUAGES = "Choose language"

View file

@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "Gelieve minstens 1 ontvanger aan te duiden"
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?"
[POPUPS_LANGUAGES]
TITLE_LANGUAGES = "Kies uw taal"

View file

@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "Wprowadź co najmniej jednego odbiorcę"
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?"
[POPUPS_LANGUAGES]
TITLE_LANGUAGES = "Choose language"

View file

@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "Por favor, especifique pelo menos um destinatário"
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?"
[POPUPS_LANGUAGES]
TITLE_LANGUAGES = "Choose language"

View file

@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "Por favor, especifique pelo menos um destinatário"
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?"
[POPUPS_LANGUAGES]
TITLE_LANGUAGES = "Choose language"

View file

@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "Укажите как минимум одного пол
BUTTON_YES = "Да"
BUTTON_NO = "Нет"
DESC_WANT_CLOSE_THIS_WINDOW = "Вы уверены, что хотите закрыть это окно?"
DESC_WANT_DELETE_MESSAGES = "Вы уверены, что хотите удалить сообщение(я)?"
[POPUPS_LANGUAGES]
TITLE_LANGUAGES = "Выберите язык"

View file

@ -177,6 +177,7 @@ EMPTY_TO_ERROR_DESC = "请至少选择一位接收人"
BUTTON_YES = "Yes"
BUTTON_NO = "No"
DESC_WANT_CLOSE_THIS_WINDOW = "Are you sure you want to close this window?"
DESC_WANT_DELETE_MESSAGES = "Are you sure you want to delete this message(s)?"
[POPUPS_LANGUAGES]
TITLE_LANGUAGES = "选择语言"

View file

@ -10966,6 +10966,10 @@ function MailBoxMessageListViewModel()
return RL.data().spamFolder() === this.messageListEndFolder();
}, this);
this.isSpamDisabled = ko.computed(function () {
return Consts.Values.UnuseOptionValue === RL.data().spamFolder();
}, this);
this.isTrashFolder = ko.computed(function () {
return RL.data().trashFolder() === this.messageListEndFolder();
}, this);
@ -11042,6 +11046,8 @@ function MailBoxMessageListViewModel()
}, this)
;
this.moveOrDeleteResponse = _.bind(this.moveOrDeleteResponse, this);
Knoin.constructorEnd(this);
}
@ -11207,7 +11213,7 @@ MailBoxMessageListViewModel.prototype.moveMessagesToFolder = function (sFromFold
bCopy = Utils.isUnd(bCopy) ? false : !!bCopy;
RL.remote()[bCopy ? 'messagesCopy' : 'messagesMove'](
_.bind(this.moveOrDeleteResponse, this),
this.moveOrDeleteResponse,
oFromFolder.fullNameRaw,
oToFolder.fullNameRaw,
aUidForRemove
@ -11247,30 +11253,48 @@ MailBoxMessageListViewModel.prototype.deleteSelectedMessageFromCurrentFolder = f
if (this.canBeMoved())
{
bUseFolder = Utils.isUnd(bUseFolder) ? true : !!bUseFolder;
var oTrashOrSpamFolder = RL.cache().getFolderFromCacheList(
Enums.FolderType.Spam === iType ? RL.data().spamFolder() : RL.data().trashFolder());
if (bUseFolder)
{
if ((Enums.FolderType.Spam === iType && Consts.Values.UnuseOptionValue === RL.data().spamFolder()) ||
(Enums.FolderType.Trash === iType && Consts.Values.UnuseOptionValue === RL.data().trashFolder()))
{
bUseFolder = false;
}
}
var
self = this,
aUIds = null,
sCurrentFolderFullNameRaw = RL.data().currentFolderFullNameRaw(),
oTrashOrSpamFolder = RL.cache().getFolderFromCacheList(
Enums.FolderType.Spam === iType ? RL.data().spamFolder() : RL.data().trashFolder())
;
if (!oTrashOrSpamFolder && bUseFolder)
{
kn.showScreenPopup(PopupsFolderSystemViewModel, [
Enums.FolderType.Spam === iType ? Enums.SetSystemFoldersNotification.Spam : Enums.SetSystemFoldersNotification.Trash]);
}
else if (!bUseFolder || (oTrashOrSpamFolder && (Consts.Values.UnuseOptionValue === oTrashOrSpamFolder.fullNameRaw ||
RL.data().currentFolderFullNameRaw() === oTrashOrSpamFolder.fullNameRaw)))
else if (!bUseFolder || (oTrashOrSpamFolder && RL.data().currentFolderFullNameRaw() === oTrashOrSpamFolder.fullNameRaw))
{
RL.remote().messagesDelete(
_.bind(this.moveOrDeleteResponse, this),
RL.data().currentFolderFullNameRaw(),
RL.data().messageListCheckedOrSelectedUidsWithSubMails()
);
aUIds = RL.data().messageListCheckedOrSelectedUidsWithSubMails();
kn.showScreenPopup(PopupsAskViewModel, [Utils.i18n('POPUPS_ASK/DESC_WANT_DELETE_MESSAGES'), function () {
this.removeCheckedOrSelectedMessagesFromList();
RL.remote().messagesDelete(
self.moveOrDeleteResponse,
sCurrentFolderFullNameRaw,
aUIds
);
self.removeCheckedOrSelectedMessagesFromList();
}]);
}
else if (oTrashOrSpamFolder)
{
RL.remote().messagesMove(
_.bind(this.moveOrDeleteResponse, this),
RL.data().currentFolderFullNameRaw(),
this.moveOrDeleteResponse,
sCurrentFolderFullNameRaw,
oTrashOrSpamFolder.fullNameRaw,
RL.data().messageListCheckedOrSelectedUidsWithSubMails()
);

File diff suppressed because one or more lines are too long