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
d0d4b2e5
Commit
d0d4b2e5
authored
8 years ago
by
Karl Prieb
Browse files
Options
Downloads
Patches
Plain Diff
fix message action menu on cordova
parent
9a090d16
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/rocketchat-ui/package.js
+1
-0
1 addition, 0 deletions
packages/rocketchat-ui/package.js
packages/rocketchat-ui/views/app/mobileMessageMenu.js
+76
-0
76 additions, 0 deletions
packages/rocketchat-ui/views/app/mobileMessageMenu.js
with
77 additions
and
0 deletions
packages/rocketchat-ui/package.js
+
1
−
0
View file @
d0d4b2e5
...
...
@@ -98,6 +98,7 @@ Package.onUse(function(api) {
api
.
addFiles
(
'
views/404/roomNotFound.coffee
'
,
'
client
'
);
api
.
addFiles
(
'
views/app/burger.coffee
'
,
'
client
'
);
api
.
addFiles
(
'
views/app/home.coffee
'
,
'
client
'
);
api
.
addFiles
(
'
views/app/mobileMessageMenu.js
'
,
'
client
'
);
api
.
addFiles
(
'
views/app/privateHistory.coffee
'
,
'
client
'
);
api
.
addFiles
(
'
views/app/room.coffee
'
,
'
client
'
);
api
.
addFiles
(
'
views/app/roomSearch.coffee
'
,
'
client
'
);
...
...
This diff is collapsed.
Click to expand it.
packages/rocketchat-ui/views/app/mobileMessageMenu.js
0 → 100644
+
76
−
0
View file @
d0d4b2e5
const
mobileMessageMenu
=
{
show
(
message
,
template
,
e
,
scope
)
{
if
(
!
window
.
plugins
.
actionsheet
)
{
return
false
;
}
const
options
=
{
'
androidTheme
'
:
window
.
plugins
.
actionsheet
.
ANDROID_THEMES
.
THEME_HOLO_LIGHT
,
'
buttonLabels
'
:
[
TAPi18n
.
__
(
'
Report Abuse
'
)
],
androidEnableCancelButton
:
true
,
addCancelButtonWithLabel
:
TAPi18n
.
__
(
'
Cancel
'
)
};
const
buttonActions
=
[
mobileMessageMenu
.
reportAbuse
];
const
buttons
=
RocketChat
.
MessageAction
.
getButtons
(
message
,
message
.
customClass
||
'
message-mobile
'
);
for
(
let
i
=
0
,
len
=
buttons
.
length
;
i
<
len
;
i
++
)
{
if
(
buttons
[
i
].
id
===
'
delete-message
'
)
{
options
.
addDestructiveButtonWithLabel
=
TAPi18n
.
__
(
buttons
[
i
].
i18nLabel
);
buttonActions
.
unshift
(
buttons
[
i
].
action
);
}
else
{
buttonActions
.
push
(
buttons
[
i
].
action
);
options
.
buttonLabels
.
push
(
TAPi18n
.
__
(
buttons
[
i
].
i18nLabel
));
}
}
window
.
plugins
.
actionsheet
.
show
(
options
,
(
buttonIndex
)
=>
{
if
(
buttonActions
[
buttonIndex
-
1
]
!=
null
)
{
return
buttonActions
[
buttonIndex
-
1
].
call
(
scope
,
e
,
template
,
message
);
}
});
},
reportAbuse
:
(
e
,
t
,
message
)
=>
{
swal
({
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
:
TAPi18n
.
__
(
'
Report_exclamation_mark
'
),
cancelButtonText
:
TAPi18n
.
__
(
'
Cancel
'
),
closeOnConfirm
:
false
,
html
:
false
},
(
inputValue
)
=>
{
if
(
inputValue
===
false
)
{
return
false
;
}
if
(
inputValue
===
''
)
{
swal
.
showInputError
(
TAPi18n
.
__
(
'
You_need_to_write_something
'
));
return
false
;
}
Meteor
.
call
(
'
reportMessage
'
,
message
,
inputValue
);
swal
({
title
:
TAPi18n
.
__
(
'
Report_sent
'
),
text
:
TAPi18n
.
__
(
'
Thank_you_exclamation_mark
'
),
type
:
'
success
'
,
timer
:
1000
,
showConfirmButton
:
false
});
});
}
};
this
.
mobileMessageMenu
=
mobileMessageMenu
;
console
.
log
(
'
mobileMessageMenu
'
);
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