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
4c924a66
Commit
4c924a66
authored
May 21, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split bookmarks plugin into headless and views
Fixes #1577
parent
0e49ebf6
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
249 deletions
+25
-249
src/converse-bookmark-views.js
src/converse-bookmark-views.js
+12
-241
src/converse-roomslist.js
src/converse-roomslist.js
+3
-3
src/converse.js
src/converse.js
+3
-2
src/headless/converse-bookmarks.js
src/headless/converse-bookmarks.js
+4
-2
src/headless/converse-core.js
src/headless/converse-core.js
+2
-1
src/headless/headless.js
src/headless/headless.js
+1
-0
No files found.
src/converse-bookmarks.js
→
src/converse-bookmark
-view
s.js
View file @
4c924a66
This diff is collapsed.
Click to expand it.
src/converse-roomslist.js
View file @
4c924a66
...
...
@@ -48,7 +48,7 @@ converse.plugins.add('converse-roomslist', {
comparator
(
room
)
{
if
(
room
.
get
(
'
bookmarked
'
))
{
const
bookmark
=
_
.
head
(
_converse
.
bookmarks
view
.
model
.
where
({
'
jid
'
:
room
.
get
(
'
jid
'
)}));
const
bookmark
=
_
.
head
(
_converse
.
bookmarks
.
where
({
'
jid
'
:
room
.
get
(
'
jid
'
)}));
return
bookmark
.
get
(
'
name
'
);
}
else
{
return
room
.
get
(
'
name
'
);
...
...
@@ -139,8 +139,8 @@ converse.plugins.add('converse-roomslist', {
},
getRoomsListElementName
()
{
if
(
this
.
model
.
get
(
'
bookmarked
'
)
&&
_converse
.
bookmarks
view
)
{
const
bookmark
=
_
.
head
(
_converse
.
bookmarks
view
.
model
.
where
({
'
jid
'
:
this
.
model
.
get
(
'
jid
'
)}));
if
(
this
.
model
.
get
(
'
bookmarked
'
)
&&
_converse
.
bookmarks
)
{
const
bookmark
=
_
.
head
(
_converse
.
bookmarks
.
where
({
'
jid
'
:
this
.
model
.
get
(
'
jid
'
)}));
return
bookmark
.
get
(
'
name
'
);
}
else
{
return
this
.
model
.
get
(
'
name
'
);
...
...
src/converse.js
View file @
4c924a66
...
...
@@ -8,8 +8,9 @@ import "@converse/headless/converse-mam"; // XEP-0313 Message Archiv
import
"
@converse/headless/converse-ping
"
;
// XEP-0199 XMPP Ping
import
"
@converse/headless/converse-pubsub
"
;
// XEP-0060 PubSub
import
"
@converse/headless/converse-vcard
"
;
// XEP-0054 VCard-temp
import
"
@converse/headless/converse-bookmarks
"
;
// XEP-0048 Bookmarks
import
"
converse-autocomplete
"
;
import
"
converse-bookmark
s
"
;
//
XEP-0048 Bookmarks
import
"
converse-bookmark
-views
"
;
// Views for
XEP-0048 Bookmarks
import
"
converse-chatview
"
;
// Renders standalone chat boxes for single user chat
import
"
converse-controlbox
"
;
// The control box
import
"
converse-dragresize
"
;
// Allows chat boxes to be resized by dragging them
...
...
@@ -31,7 +32,7 @@ import converse from "@converse/headless/converse-core";
const
WHITELISTED_PLUGINS
=
[
'
converse-autocomplete
'
,
'
converse-bookmarks
'
,
'
converse-bookmark
-view
s
'
,
'
converse-chatboxviews
'
,
'
converse-chatview
'
,
'
converse-controlbox
'
,
...
...
src/headless/converse-bookmarks.js
View file @
4c924a66
// Converse.js (A browser based XMPP chat client)
// https://conversejs.org
//
// Copyright (c) 201
2-2017
, Jan-Carel Brand <jc@opkode.com>
// Copyright (c) 201
9
, Jan-Carel Brand <jc@opkode.com>
// Licensed under the Mozilla Public License (MPLv2)
//
/*global define */
...
...
@@ -65,6 +65,8 @@ converse.plugins.add('converse-bookmarks', {
allow_public_bookmarks
:
false
});
_converse
.
api
.
promises
.
add
(
'
bookmarksInitialized
'
);
/**
* Check if the user has a bookmark with a saved nickanme
* for this groupchat and return it.
...
...
@@ -72,7 +74,7 @@ converse.plugins.add('converse-bookmarks', {
* @method _converse#getNicknameFromBookmark
*/
_converse
.
getNicknameFromBookmark
=
function
(
jid
)
{
if
(
_converse
.
bookmarks
||
!
_converse
.
allow_bookmarks
)
{
if
(
!
_converse
.
bookmarks
||
!
_converse
.
allow_bookmarks
)
{
return
null
;
}
const
bookmark
=
_converse
.
bookmarks
.
findWhere
({
'
jid
'
:
jid
});
...
...
src/headless/converse-core.js
View file @
4c924a66
...
...
@@ -86,6 +86,7 @@ pluggable.enable(_converse, '_converse', 'pluggable');
// These are just the @converse/headless plugins, for the full converse,
// the other plugins are whitelisted in src/converse.js
_converse
.
core_plugins
=
[
'
converse-bookmarks
'
,
'
converse-caps
'
,
'
converse-chatboxes
'
,
'
converse-disco
'
,
...
...
@@ -352,7 +353,7 @@ function initPlugins() {
{
'
_converse
'
:
_converse
},
whitelist
,
_converse
.
blacklisted_plugins
);
/**
* Triggered once all plugins have been initialized. This is a useful event if you want to
* register event handlers but would like your own handlers to be overridable by
...
...
src/headless/headless.js
View file @
4c924a66
...
...
@@ -3,6 +3,7 @@
* Any of the following components may be removed if they're not needed.
*/
import
"
./converse-pubsub
"
;
// XEP-0199 XMPP Ping
import
"
./converse-bookmarks
"
;
// XEP-0199 XMPP Ping
import
"
./converse-chatboxes
"
;
// Backbone Collection and Models for chat boxes
import
"
./converse-disco
"
;
// Service discovery plugin
import
"
./converse-mam
"
;
// XEP-0313 Message Archive Management
...
...
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