Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
8cb303a5
Unverified
Commit
8cb303a5
authored
7 years ago
by
Rodrigo Nascimento
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #8648 from RocketChat/fix-audio-message-icon
[FIX] Audio message icon
parents
591b15a6
1dc7f721
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/rocketchat-ui-message/startup/messageBoxActions.js
+12
-8
12 additions, 8 deletions
packages/rocketchat-ui-message/startup/messageBoxActions.js
packages/rocketchat-ui/client/views/app/popover.js
+9
-2
9 additions, 2 deletions
packages/rocketchat-ui/client/views/app/popover.js
with
21 additions
and
10 deletions
packages/rocketchat-ui-message/startup/messageBoxActions.js
+
12
−
8
View file @
8cb303a5
/* globals fileUpload chatMessages AudioRecorder device */
/* globals fileUpload chatMessages AudioRecorder device
popover
*/
import
mime
from
'
mime-type/with-db
'
;
import
{
VRecDialog
}
from
'
meteor/rocketchat:ui-vrecord
'
;
...
...
@@ -18,13 +18,15 @@ RocketChat.messageBox.actions.add('Create_new', 'Audio_message', {
condition
:
()
=>
(
navigator
.
getUserMedia
||
navigator
.
webkitGetUserMedia
)
&&
RocketChat
.
settings
.
get
(
'
FileUpload_Enabled
'
)
&&
RocketChat
.
settings
.
get
(
'
Message_AudioRecorderEnabled
'
)
&&
(
!
RocketChat
.
settings
.
get
(
'
FileUpload_MediaTypeWhiteList
'
)
||
RocketChat
.
settings
.
get
(
'
FileUpload_MediaTypeWhiteList
'
).
match
(
/audio
\/
wav|audio
\/\*
/i
)),
action
({
event
,
element
})
{
event
.
preventDefault
();
const
icon
=
element
;
const
icon
=
element
.
querySelector
(
'
.rc-icon
'
);
if
(
chatMessages
[
RocketChat
.
openedRoom
].
recording
)
{
return
AudioRecorder
.
stop
(
function
(
blob
)
{
AudioRecorder
.
stop
(
function
(
blob
)
{
popover
.
close
();
icon
.
style
.
color
=
''
;
icon
.
classList
.
remove
(
'
pulse
'
);
chatMessages
[
RocketChat
.
openedRoom
].
recording
=
false
;
return
fileUpload
([
fileUpload
([
{
file
:
blob
,
type
:
'
audio
'
,
...
...
@@ -32,9 +34,11 @@ RocketChat.messageBox.actions.add('Create_new', 'Audio_message', {
}
]);
});
return
false
;
}
chatMessages
[
RocketChat
.
openedRoom
].
recording
=
true
;
return
AudioRecorder
.
start
(
function
()
{
AudioRecorder
.
start
(
function
()
{
icon
.
classList
.
add
(
'
pulse
'
);
icon
.
style
.
color
=
'
red
'
;
});
...
...
@@ -71,7 +75,7 @@ RocketChat.messageBox.actions.add('Add_files_from', 'Computer', {
name
:
file
.
name
};
});
return
fileUpload
(
filesToUpload
);
fileUpload
(
filesToUpload
);
},
{
once
:
true
});
input
.
remove
();
...
...
@@ -87,7 +91,7 @@ RocketChat.messageBox.actions.add('Share', 'My_location', {
const
latitude
=
position
.
coords
.
latitude
;
const
longitude
=
position
.
coords
.
longitude
;
const
text
=
`<div class="location-preview"><img style="height: 250px; width: 250px;" src="https://maps.googleapis.com/maps/api/staticmap?zoom=14&size=250x250&markers=color:gray%7Clabel:%7C
${
latitude
}
,
${
longitude
}
&key=
${
RocketChat
.
settings
.
get
(
'
MapView_GMapsAPIKey
'
)
}
" /></div>`
;
return
swal
({
swal
({
title
:
t
(
'
Share_Location_Title
'
),
text
,
showCancelButton
:
true
,
...
...
@@ -98,7 +102,7 @@ RocketChat.messageBox.actions.add('Share', 'My_location', {
if
(
isConfirm
!==
true
)
{
return
;
}
return
Meteor
.
call
(
'
sendMessage
'
,
{
Meteor
.
call
(
'
sendMessage
'
,
{
_id
:
Random
.
id
(),
rid
,
msg
:
''
,
...
...
This diff is collapsed.
Click to expand it.
packages/rocketchat-ui/client/views/app/popover.js
+
9
−
2
View file @
8cb303a5
...
...
@@ -6,6 +6,10 @@ this.popover = {
this
.
renderedPopover
=
Blaze
.
renderWithData
(
Template
.
popover
,
config
,
document
.
body
);
},
close
()
{
if
(
!
this
.
renderedPopover
)
{
return
false
;
}
Blaze
.
remove
(
this
.
renderedPopover
);
const
activeElement
=
this
.
renderedPopover
.
dataVar
.
curValue
.
activeElement
;
...
...
@@ -81,10 +85,13 @@ Template.popover.onRendered(function() {
Template
.
popover
.
events
({
'
click [data-type="messagebox-action"]
'
(
event
,
t
)
{
const
action
=
RocketChat
.
messageBox
.
actions
.
getById
(
event
.
currentTarget
.
dataset
.
id
);
const
id
=
event
.
currentTarget
.
dataset
.
id
;
const
action
=
RocketChat
.
messageBox
.
actions
.
getById
(
id
);
if
((
action
[
0
]
!=
null
?
action
[
0
].
action
:
undefined
)
!=
null
)
{
action
[
0
].
action
({
rid
:
t
.
data
.
data
.
rid
,
messageBox
:
document
.
querySelector
(
'
.rc-message-box
'
),
element
:
event
.
currentTarget
,
event
});
popover
.
close
();
if
(
id
!==
'
audio-message
'
)
{
popover
.
close
();
}
}
},
'
click [data-type="message-action"]
'
(
e
,
t
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment