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
d8963a8a
Commit
d8963a8a
authored
May 07, 2017
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bookmarks: New setting `hide_open_bookmarks`
parent
0bd0798e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
2 deletions
+27
-2
docs/source/configuration.rst
docs/source/configuration.rst
+16
-0
src/converse-bookmarks.js
src/converse-bookmarks.js
+11
-2
No files found.
docs/source/configuration.rst
View file @
d8963a8a
...
...
@@ -579,6 +579,22 @@ hide_offline_users
If set to ``true``, then don't show offline users.
hide_open_bookmarks
-------------------
* Default: ``false``
This setting applies to the ``converse-bookmarks`` plugin and specfically the
list of bookmarks shown in the ``Rooms`` tab of the control box.
By default all bookmarks are shown in that list, if this setting is set to
``true``, then only bookmarks for rooms not currently open (i.e. that the
current user hasn't joined), are shown.
Makes sense to set this to ``true`` when also using the non-core
``converse-roomslist`` plugin, which shows a list of currently open (i.e.
"joined") rooms.
include_offline_state
---------------------
...
...
src/converse-bookmarks.js
View file @
d8963a8a
...
...
@@ -194,7 +194,8 @@
// Refer to docs/source/configuration.rst for explanations of these
// configuration settings.
this
.
updateSettings
({
allow_bookmarks
:
true
allow_bookmarks
:
true
,
hide_open_bookmarks
:
false
});
_converse
.
Bookmark
=
Backbone
.
Model
;
...
...
@@ -360,6 +361,8 @@
initialize
:
function
()
{
this
.
model
.
on
(
'
add
'
,
this
.
renderBookmarkListElement
,
this
);
this
.
model
.
on
(
'
remove
'
,
this
.
removeBookmarkListElement
,
this
);
_converse
.
chatboxes
.
on
(
'
add
'
,
this
.
renderBookmarkListElement
,
this
);
_converse
.
chatboxes
.
on
(
'
remove
'
,
this
.
renderBookmarkListElement
,
this
);
var
cachekey
=
'
converse.room-bookmarks
'
+
_converse
.
bare_jid
+
'
-list-model
'
;
this
.
list_model
=
new
_converse
.
BookmarksList
();
...
...
@@ -398,6 +401,11 @@
},
renderBookmarkListElement
:
function
(
item
)
{
if
(
_converse
.
hide_open_bookmarks
&&
_converse
.
chatboxes
.
where
({
'
jid
'
:
item
.
get
(
'
jid
'
)}).
length
)
{
this
.
removeBookmarkListElement
(
item
);
return
;
}
var
div
=
document
.
createElement
(
'
div
'
);
div
.
innerHTML
=
tpl_bookmark
({
'
bookmarked
'
:
true
,
...
...
@@ -430,7 +438,7 @@
if
(
el
)
{
list_el
.
removeChild
(
el
);
}
if
(
this
.
model
.
length
===
0
)
{
if
(
list_el
.
childElementCount
===
0
)
{
this
.
hide
();
}
},
...
...
@@ -460,6 +468,7 @@
{
'
model
'
:
_converse
.
bookmarks
}
);
});
_converse
.
emit
(
'
bookmarksInitialized
'
);
};
_converse
.
on
(
'
chatBoxesFetched
'
,
initBookmarks
);
...
...
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