Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-libclient
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-libclient
Commits
df55e7dd
Unverified
Commit
df55e7dd
authored
Oct 22, 2019
by
Sébastien Blin
Browse files
Options
Downloads
Patches
Plain Diff
chatview: add video widget button
Change-Id: I46fb136b15f2be8428b05a63583b3246c6937fb2
parent
5999c504
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/web-chatview/chatview.html
+7
-1
7 additions, 1 deletion
src/web-chatview/chatview.html
src/web-chatview/chatview.js
+28
-0
28 additions, 0 deletions
src/web-chatview/chatview.js
with
35 additions
and
1 deletion
src/web-chatview/chatview.html
+
7
−
1
View file @
df55e7dd
...
@@ -91,12 +91,18 @@
...
@@ -91,12 +91,18 @@
</div>
</div>
<div
id=
"file_image_send_container"
></div>
<div
id=
"file_image_send_container"
></div>
<div
id=
"sendMessage"
>
<div
id=
"sendMessage"
>
<div
id=
"sendFileButton"
class=
"nav-button action-button"
onclick=
"selectFileToSend()"
title=
"select file to send"
>
<div
id=
"sendFileButton"
class=
"nav-button action-button"
onclick=
"selectFileToSend()"
>
<svg
class=
"svgicon"
xmlns=
"http://www.w3.org/2000/svg"
width=
"24"
height=
"24"
viewBox=
"0 0 24 24"
>
<svg
class=
"svgicon"
xmlns=
"http://www.w3.org/2000/svg"
width=
"24"
height=
"24"
viewBox=
"0 0 24 24"
>
<path
d=
"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"
/>
<path
d=
"M16.5 6v11.5c0 2.21-1.79 4-4 4s-4-1.79-4-4V5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5v10.5c0 .55-.45 1-1 1s-1-.45-1-1V6H10v9.5c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5V5c0-2.21-1.79-4-4-4S7 2.79 7 5v12.5c0 3.04 2.46 5.5 5.5 5.5s5.5-2.46 5.5-5.5V6h-1.5z"
/>
<path
d=
"M0 0h24v24H0z"
fill=
"none"
/>
<path
d=
"M0 0h24v24H0z"
fill=
"none"
/>
</svg>
</svg>
</div>
</div>
<div
id=
"videoRecordButton"
class=
"nav-button action-button nav-right"
onclick=
"videoRecord()"
>
<svg
class=
"svgicon"
xmlns=
"http://www.w3.org/2000/svg"
width=
"24"
height=
"24"
viewBox=
"0 0 24 24"
>
<path
fill=
"none"
d=
"M0 0h24v24H0V0z"
/>
<path
d=
"M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4zM14 13h-3v3H9v-3H6v-2h3V8h2v3h3v2z"
/>
</svg>
</div>
<textarea
id=
"message"
autofocus
placeholder=
"Type a message"
onkeyup=
"grow_text_area()"
onkeydown=
"process_messagebar_keydown()"
<textarea
id=
"message"
autofocus
placeholder=
"Type a message"
onkeyup=
"grow_text_area()"
onkeydown=
"process_messagebar_keydown()"
rows=
"1"
></textarea>
rows=
"1"
></textarea>
<div
id=
"sendButton"
class=
"nav-button action-button"
onclick=
"sendMessage(); grow_text_area()"
>
<div
id=
"sendButton"
class=
"nav-button action-button"
onclick=
"sendMessage(); grow_text_area()"
>
...
...
This diff is collapsed.
Click to expand it.
src/web-chatview/chatview.js
+
28
−
0
View file @
df55e7dd
...
@@ -44,6 +44,7 @@ const optionsButton = document.getElementById("optionsButton")
...
@@ -44,6 +44,7 @@ const optionsButton = document.getElementById("optionsButton")
const
backToBottomBtn
=
document
.
getElementById
(
"
back_to_bottom_button
"
)
const
backToBottomBtn
=
document
.
getElementById
(
"
back_to_bottom_button
"
)
const
backToBottomBtnContainer
=
document
.
getElementById
(
"
back_to_bottom_button_container
"
)
const
backToBottomBtnContainer
=
document
.
getElementById
(
"
back_to_bottom_button_container
"
)
const
sendFileButton
=
document
.
getElementById
(
"
sendFileButton
"
)
const
sendFileButton
=
document
.
getElementById
(
"
sendFileButton
"
)
const
videoRecordButton
=
document
.
getElementById
(
"
videoRecordButton
"
)
const
aliasField
=
document
.
getElementById
(
"
nav-contactid-alias
"
)
const
aliasField
=
document
.
getElementById
(
"
nav-contactid-alias
"
)
const
bestIdField
=
document
.
getElementById
(
"
nav-contactid-bestId
"
)
const
bestIdField
=
document
.
getElementById
(
"
nav-contactid-bestId
"
)
const
idField
=
document
.
getElementById
(
"
nav-contactid
"
)
const
idField
=
document
.
getElementById
(
"
nav-contactid
"
)
...
@@ -126,6 +127,7 @@ function set_titles() {
...
@@ -126,6 +127,7 @@ function set_titles() {
optionsButton
.
title
=
"
Options
"
optionsButton
.
title
=
"
Options
"
backToBottomBtn
.
innerHTML
=
"
'Jump to latest' ▼
"
backToBottomBtn
.
innerHTML
=
"
'Jump to latest' ▼
"
sendFileButton
.
title
=
"
Send File
"
sendFileButton
.
title
=
"
Send File
"
videoRecordButton
.
title
=
"
Record video clip
"
acceptButton
.
title
=
"
Accept
"
acceptButton
.
title
=
"
Accept
"
refuseButton
.
title
=
"
Refuse
"
refuseButton
.
title
=
"
Refuse
"
blockButton
.
title
=
"
Block
"
blockButton
.
title
=
"
Block
"
...
@@ -139,6 +141,7 @@ function set_titles() {
...
@@ -139,6 +141,7 @@ function set_titles() {
optionsButton
.
title
=
i18n
.
gettext
(
"
Options
"
)
optionsButton
.
title
=
i18n
.
gettext
(
"
Options
"
)
backToBottomBtn
.
innerHTML
=
`
${
i18n
.
gettext
(
"
Jump to latest
"
)}
▼`
backToBottomBtn
.
innerHTML
=
`
${
i18n
.
gettext
(
"
Jump to latest
"
)}
▼`
sendFileButton
.
title
=
i18n
.
gettext
(
"
Send File
"
)
sendFileButton
.
title
=
i18n
.
gettext
(
"
Send File
"
)
videoRecordButton
.
title
=
i18n
.
gettext
(
"
Record video clip
"
)
acceptButton
.
title
=
i18n
.
gettext
(
"
Accept
"
)
acceptButton
.
title
=
i18n
.
gettext
(
"
Accept
"
)
refuseButton
.
title
=
i18n
.
gettext
(
"
Refuse
"
)
refuseButton
.
title
=
i18n
.
gettext
(
"
Refuse
"
)
blockButton
.
title
=
i18n
.
gettext
(
"
Block
"
)
blockButton
.
title
=
i18n
.
gettext
(
"
Block
"
)
...
@@ -350,6 +353,21 @@ function displayNavbar(isVisible) {
...
@@ -350,6 +353,21 @@ function displayNavbar(isVisible) {
}
}
}
}
/**
* Hide or show record controls, and update body top padding accordingly.
*
* @param isVisible whether navbar should be displayed or not
*/
/* exported displayRecordControls */
function
displayRecordControls
(
isVisible
)
{
if
(
isVisible
)
{
videoRecordButton
.
classList
.
remove
(
"
hiddenState
"
)
}
else
{
videoRecordButton
.
classList
.
add
(
"
hiddenState
"
)
}
}
/**
/**
* Hide or show message bar, and update body bottom padding accordingly.
* Hide or show message bar, and update body bottom padding accordingly.
*
*
...
@@ -628,6 +646,16 @@ function selectFileToSend() {
...
@@ -628,6 +646,16 @@ function selectFileToSend() {
}
}
}
}
/* exported sendFile */
function
videoRecord
()
{
if
(
use_qt
)
{
window
.
jsbridge
.
videoRecord
()
}
else
{
var
rect
=
videoRecordButton
.
getBoundingClientRect
()
window
.
prompt
(
`VIDEO_RECORD:
${
rect
.
left
+
rect
.
width
/
2
}
x
${
rect
.
top
}
`
)
}
}
/**
/**
* Clear all messages.
* Clear all messages.
*/
*/
...
...
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