Browse Source

Improved messages delete

Closes #620
master
Igor Zhukov 10 years ago
parent
commit
b9aef94e5a
  1. 10
      app/js/controllers.js
  2. 2
      app/js/locales/en-us.json
  3. 6
      app/partials/desktop/confirm_modal.html

10
app/js/controllers.js

@ -1239,9 +1239,13 @@ angular.module('myApp.controllers', ['myApp.i18n'])
angular.forEach($scope.selectedMsgs, function (t, messageID) { angular.forEach($scope.selectedMsgs, function (t, messageID) {
selectedMessageIDs.push(messageID); selectedMessageIDs.push(messageID);
}); });
AppMessagesManager.deleteMessages(selectedMessageIDs).then(function () { if (selectedMessageIDs.length) {
selectedCancel(); ErrorService.confirm({type: 'MESSAGES_DELETE', count: selectedMessageIDs.length}).then(function () {
}); AppMessagesManager.deleteMessages(selectedMessageIDs).then(function () {
selectedCancel();
});
});
}
} }
} }

2
app/js/locales/en-us.json

@ -132,6 +132,7 @@
"confirm_modal_clipboard_file_send": "Are you sure to send file(s) from clipboard?", "confirm_modal_clipboard_file_send": "Are you sure to send file(s) from clipboard?",
"confirm_modal_clipboard_X_files_send": "{'one': 'Are you sure to send file from clipboard?', 'other': 'Are you sure to send {} files from clipboard?'}", "confirm_modal_clipboard_X_files_send": "{'one': 'Are you sure to send file from clipboard?', 'other': 'Are you sure to send {} files from clipboard?'}",
"confirm_modal_message_delete": "Are you sure you want to delete the message?", "confirm_modal_message_delete": "Are you sure you want to delete the message?",
"confirm_modal_X_messages_delete": "{'one': 'Are you sure you want to delete the message?', 'other': 'Are you sure you want to delete {} messages?'}",
"confirm_modal_photo_delete": "Are you sure you want to delete the photo?", "confirm_modal_photo_delete": "Are you sure you want to delete the photo?",
"confirm_modal_contacts_import": "Telegram will now sync your contacts in order to find your friends.", "confirm_modal_contacts_import": "Telegram will now sync your contacts in order to find your friends.",
"confirm_modal_login_phone_correct": "Is this phone number correct?", "confirm_modal_login_phone_correct": "Is this phone number correct?",
@ -149,6 +150,7 @@
"confirm_modal_clipboard_files_send_submit": "Send", "confirm_modal_clipboard_files_send_submit": "Send",
"confirm_modal_clipboard_file_send_submit": "Send", "confirm_modal_clipboard_file_send_submit": "Send",
"confirm_modal_message_delete_submit": "Delete", "confirm_modal_message_delete_submit": "Delete",
"confirm_modal_messages_delete_submit": "Delete",
"confirm_modal_photo_delete_submit": "Delete", "confirm_modal_photo_delete_submit": "Delete",
"confirm_modal_forward_message_submit": "Forward message", "confirm_modal_forward_message_submit": "Forward message",
"confirm_modal_share_photo_submit": "Forward photo", "confirm_modal_share_photo_submit": "Forward photo",

6
app/partials/desktop/confirm_modal.html

@ -15,6 +15,11 @@
</span> </span>
<span ng-switch-when="FILE_CLIPBOARD_PASTE" my-i18n="confirm_modal_clipboard_file_send"></span> <span ng-switch-when="FILE_CLIPBOARD_PASTE" my-i18n="confirm_modal_clipboard_file_send"></span>
<span ng-switch-when="MESSAGE_DELETE" my-i18n="confirm_modal_message_delete"></span> <span ng-switch-when="MESSAGE_DELETE" my-i18n="confirm_modal_message_delete"></span>
<span ng-switch-when="MESSAGES_DELETE">
<ng-pluralize count="count"
when="confirm_modal_X_messages_delete">
</ng-pluralize>
</span>
<span ng-switch-when="PHOTO_DELETE" my-i18n="confirm_modal_photo_delete"></span> <span ng-switch-when="PHOTO_DELETE" my-i18n="confirm_modal_photo_delete"></span>
<span ng-switch-when="CONTACTS_IMPORT_PERFORM" my-i18n="confirm_modal_contacts_import"></span> <span ng-switch-when="CONTACTS_IMPORT_PERFORM" my-i18n="confirm_modal_contacts_import"></span>
<div ng-switch-when="LOGIN_PHONE_CORRECT"> <div ng-switch-when="LOGIN_PHONE_CORRECT">
@ -56,6 +61,7 @@
<span ng-switch-when="FILES_CLIPBOARD_PASTE" my-i18n="confirm_modal_clipboard_files_send_submit"></span> <span ng-switch-when="FILES_CLIPBOARD_PASTE" my-i18n="confirm_modal_clipboard_files_send_submit"></span>
<span ng-switch-when="FILE_CLIPBOARD_PASTE" my-i18n="confirm_modal_clipboard_file_send_submit"></span> <span ng-switch-when="FILE_CLIPBOARD_PASTE" my-i18n="confirm_modal_clipboard_file_send_submit"></span>
<span ng-switch-when="MESSAGE_DELETE" my-i18n="confirm_modal_message_delete_submit"></span> <span ng-switch-when="MESSAGE_DELETE" my-i18n="confirm_modal_message_delete_submit"></span>
<span ng-switch-when="MESSAGES_DELETE" my-i18n="confirm_modal_messages_delete_submit"></span>
<span ng-switch-when="PHOTO_DELETE" my-i18n="confirm_modal_photo_delete_submit"></span> <span ng-switch-when="PHOTO_DELETE" my-i18n="confirm_modal_photo_delete_submit"></span>
<span ng-switch-when="FORWARD_PEER" my-i18n="confirm_modal_forward_message_submit"></span> <span ng-switch-when="FORWARD_PEER" my-i18n="confirm_modal_forward_message_submit"></span>
<span ng-switch-when="PHOTO_SHARE_PEER" my-i18n="confirm_modal_share_photo_submit"></span> <span ng-switch-when="PHOTO_SHARE_PEER" my-i18n="confirm_modal_share_photo_submit"></span>

Loading…
Cancel
Save