Skip to content
Snippets Groups Projects
Unverified Commit ae590d9c authored by Marcelo Schmidt's avatar Marcelo Schmidt
Browse files

Fix #3103

Show correct menus on mobile
parent 9e9d00c3
No related merge requests found
Showing
with 44 additions and 21 deletions
......@@ -805,8 +805,12 @@
"Remove_as_owner" : "Remove as owner",
"Remove_custom_oauth" : "Remove custom oauth",
"Remove_from_room" : "Remove from room",
"Report_sent" : "Report sent",
"Remove_someone_from_room" : "Remove someone from the room",
"Removed" : "Removed",
"Report_Abuse" : "Report Abuse",
"Report_exclamation_mark" : "Report!",
"Report_this_message_question_mark" : "Report this message?",
"Require_password_change" : "Require password change",
"Resend_verification_email" : "Resend verification email",
"Reset" : "Reset",
......@@ -944,6 +948,7 @@
"Sync_Users" : "Sync Users",
"Test_Connection" : "Test Connection",
"Test_Desktop_Notifications" : "Test Desktop Notifications",
"Thank_you_exclamation_mark" : "Thank you!",
"Thank_you_for_your_feedback" : "Thank you for your feedback",
"The_application_name_is_required" : "The application name is required",
"The_channel_name_is_required" : "The channel name is required",
......@@ -1096,6 +1101,7 @@
"WebRTC_Servers_Description" : "A list of STUN and TURN servers separated by comma.<br/>Username, password and port are allowed in the format `username:password@stun:host:port` or `username:password@turn:host:port`.",
"Welcome" : "Welcome <em>%s</em>.",
"Welcome_to_the" : "Welcome to the",
"Why_do_you_want_to_report_question_mark" : "Why do you want to report?",
"will_be_able_to" : "will be able to",
"Yes" : "Yes",
"Yes_clear_all" : "Yes, clear all!",
......@@ -1120,6 +1126,7 @@
"You_need_to_type_in_your_password_in_order_to_do_this" : "You need to type in your password in order to do this!",
"You_need_to_type_in_your_username_in_order_to_do_this" : "You need to type in your username in order to do this!",
"You_need_to_verifiy_your_email_address_to_get_notications" : "You need to verifiy your email address to get notifications",
"You_need_to_write_something" : "You need to write something!",
"You_should_name_it_to_easily_manage_your_integrations" : "You should name it to easily manage your integrations.",
"You_will_not_be_able_to_recover" : "You will not be able to recover this message!",
"You_will_not_be_able_to_recover_file" : "You will not be able to recover this file!",
......
......@@ -738,7 +738,7 @@
"Past_Chats" : "Bate-papo últimos",
"Payload" : "Payload",
"People" : "Pessoas",
"Permalink" : "permalink",
"Permalink" : "Permalink",
"Permissions" : "Permissões",
"Pin_Message" : "Fixar Mensagem",
"Pinned_a_message" : "Fixou uma mensagem:",
......
......@@ -5,6 +5,9 @@ Template.mentionsFlexTab.helpers
messages: ->
return MentionedMessage.find { rid: @rid }, { sort: { ts: -1 } }
message: ->
return _.extend(this, { customClass: 'mentions' })
notReadySubscription: ->
return 'notready' unless Template.instance().subscriptionsReady()
......
......@@ -12,7 +12,7 @@
</div>
<ul class="mentioned-messages-list list clearfix">
{{#each messages}}
{{#nrr nrrargs 'message' .}}{{/nrr}}
{{#nrr nrrargs 'message' message}}{{/nrr}}
{{/each}}
{{#if hasMore}}
<li class="load-more">
......
......@@ -5,6 +5,9 @@ Template.pinnedMessages.helpers
messages: ->
return PinnedMessage.find { rid: @rid }, { sort: { ts: -1 } }
message: ->
return _.extend(this, { customClass: 'pinned' })
hasMore: ->
return Template.instance().hasMore.get()
......
......@@ -12,7 +12,7 @@
</div>
<ul class="list clearfix">
{{#each messages}}
{{#nrr nrrargs 'message' .}}{{/nrr}}
{{#nrr nrrargs 'message' message}}{{/nrr}}
{{/each}}
{{#if hasMore}}
<li class="load-more">
......
......@@ -5,6 +5,9 @@ Template.starredMessages.helpers
messages: ->
return StarredMessage.find { rid: @rid }, { sort: { ts: -1 } }
message: ->
return _.extend(this, { customClass: 'starred' })
hasMore: ->
return Template.instance().hasMore.get()
......
......@@ -12,7 +12,7 @@
</div>
<ul class="list clearfix">
{{#each messages}}
{{#nrr nrrargs 'message' .}}{{/nrr}}
{{#nrr nrrargs 'message' message}}{{/nrr}}
{{/each}}
{{#if hasMore}}
<li class="load-more">
......
......@@ -30,6 +30,9 @@ Template.messageSearch.helpers
ready: ->
return Template.instance().ready.get()
message: ->
return _.extend(this, { customClass: 'search' })
Template.messageSearch.events
"keydown #message-search": (e) ->
if e.keyCode is 13
......
......@@ -23,7 +23,7 @@
{{#if currentSearchTerm}}
{{#if searchResultMessages}}
{{#each searchResultMessages}}
{{#nrr nrrargs 'message' .}}{{/nrr}}
{{#nrr nrrargs 'message' message}}{{/nrr}}
{{/each}}
{{#if hasMore}}
<li class="load-more">
......
<template name="message">
<li id="{{_id}}" class="message {{isSequential}} {{system}} {{t}} {{own}} {{isTemp}} {{chatops}}" data-username="{{u.username}}" data-groupable="{{isGroupable}}" data-date="{{date}}" data-timestamp="{{timestamp}}">
<li id="{{_id}}" class="message {{isSequential}} {{system}} {{t}} {{own}} {{isTemp}} {{chatops}} {{customClass}}" data-username="{{u.username}}" data-groupable="{{isGroupable}}" data-date="{{date}}" data-timestamp="{{timestamp}}">
{{#if avatar}}
{{#if avatarFromUsername}}
<button class="thumb user-card-message" data-username="{{u.username}}" tabindex="1">{{> avatar username=avatarFromUsername}}</button>
......
......@@ -6,8 +6,7 @@
options =
'androidTheme': window.plugins.actionsheet.ANDROID_THEMES.THEME_HOLO_LIGHT
'buttonLabels': [
'Report Abuse'
'Copy Message'
TAPi18n.__('Report Abuse')
]
androidEnableCancelButton: true
addCancelButtonWithLabel: TAPi18n.__('Cancel')
......@@ -15,10 +14,19 @@
buttonActions = [
mobileMessageMenu.reportAbuse
mobileMessageMenu.copyMessage
]
buttons = RocketChat.MessageAction.getButtons message, 'message-mobile'
context = 'message-mobile'
if $(e.currentTarget).hasClass('pinned')
context = 'pinned'
if $(e.currentTarget).hasClass('starred')
context = 'starred'
if $(e.currentTarget).hasClass('mentions')
context = 'mentions'
if $(e.currentTarget).hasClass('search')
context = 'search'
buttons = RocketChat.MessageAction.getButtons message, context
for button in buttons
if button.id is 'delete-message'
options.addDestructiveButtonWithLabel = TAPi18n.__(button.i18nLabel)
......@@ -31,19 +39,15 @@
if buttonActions[buttonIndex-1]?
buttonActions[buttonIndex-1].call scope, e, template, message
copyMessage: (e, t, message) ->
cordova.plugins.clipboard.copy(message.msg)
console.log 'copyMessage', message.msg
reportAbuse: (e, t, message) ->
swal {
title: 'Report this message?'
text: message.html
inputPlaceholder: 'Why do you want to report?'
title: TAPi18n.__('Report_this_message_question_mark')
text: message.msg
inputPlaceholder: TAPi18n.__('Why_do_you_want_to_report_question_mark')
type: 'input'
showCancelButton: true
confirmButtonColor: '#DD6B55'
confirmButtonText: "Report!"
confirmButtonText: TAPi18n.__("Report_exclamation_mark")
cancelButtonText: TAPi18n.__('Cancel')
closeOnConfirm: false
html: false
......@@ -52,14 +56,14 @@
return false
if inputValue is ""
swal.showInputError("You need to write something!")
swal.showInputError(TAPi18n.__("You_need_to_write_something"))
return false
Meteor.call 'reportMessage', message, inputValue
swal
title: "Report sent"
text: "Thank you!"
title: TAPi18n.__("Report_sent")
text: TAPi18n("Thank_you_exclamation_mark")
type: 'success'
timer: 1000
showConfirmButton: false
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment