Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
f2ef8c72
Commit
f2ef8c72
authored
Dec 29, 2020
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
controlbox: render the toggle via lit-html
parent
3f400981
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
src/plugins/controlbox/templates/toggle.html
src/plugins/controlbox/templates/toggle.html
+0
-1
src/plugins/controlbox/templates/toggle.js
src/plugins/controlbox/templates/toggle.js
+8
-0
src/plugins/controlbox/toggle.js
src/plugins/controlbox/toggle.js
+3
-5
No files found.
src/plugins/controlbox/templates/toggle.html
deleted
100644 → 0
View file @
3f400981
<span
class=
"toggle-feedback"
>
{{{o.label_toggle}}}
</span>
src/plugins/controlbox/templates/toggle.js
0 → 100644
View file @
f2ef8c72
import
{
html
}
from
"
lit-html
"
;
import
{
api
}
from
"
@converse/headless/core
"
;
import
{
__
}
from
'
i18n
'
;
export
default
()
=>
{
const
i18n_toggle
=
api
.
connection
.
connected
()
?
__
(
'
Chat Contacts
'
)
:
__
(
'
Toggle chat
'
);
return
html
`<span class="toggle-feedback">
${
i18n_toggle
}
</span>`
;
}
src/plugins/controlbox/toggle.js
View file @
f2ef8c72
import
log
from
"
@converse/headless/log
"
;
import
log
from
"
@converse/headless/log
"
;
import
tpl_controlbox_toggle
from
"
./templates/toggle.
html
"
;
import
tpl_controlbox_toggle
from
"
./templates/toggle.
js
"
;
import
{
View
}
from
"
@converse/skeletor/src/view
"
;
import
{
View
}
from
"
@converse/skeletor/src/view
"
;
import
{
__
}
from
'
../../i18n
'
;
import
{
_converse
,
api
,
converse
}
from
"
@converse/headless/core
"
;
import
{
_converse
,
api
,
converse
}
from
"
@converse/headless/core
"
;
import
{
addControlBox
}
from
'
./utils.js
'
;
import
{
addControlBox
}
from
'
./utils.js
'
;
import
{
render
}
from
'
lit-html
'
;
const
u
=
converse
.
env
.
utils
;
const
u
=
converse
.
env
.
utils
;
...
@@ -31,9 +31,7 @@ const ControlBoxToggle = View.extend({
...
@@ -31,9 +31,7 @@ const ControlBoxToggle = View.extend({
// the ControlBox or the Toggle must be shown. This prevents
// the ControlBox or the Toggle must be shown. This prevents
// artifacts (i.e. on page load the toggle is shown only to then
// artifacts (i.e. on page load the toggle is shown only to then
// seconds later be hidden in favor of the controlbox).
// seconds later be hidden in favor of the controlbox).
this
.
el
.
innerHTML
=
tpl_controlbox_toggle
({
render
(
tpl_controlbox_toggle
(),
this
.
el
);
'
label_toggle
'
:
api
.
connection
.
connected
()
?
__
(
'
Chat Contacts
'
)
:
__
(
'
Toggle chat
'
)
})
return
this
;
return
this
;
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment