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
dcf87368
Commit
dcf87368
authored
Jan 15, 2018
by
Weblate
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
b209c999
a1767ffe
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
59 deletions
+20
-59
package-lock.json
package-lock.json
+3
-1
src/converse-bookmarks.js
src/converse-bookmarks.js
+14
-9
src/converse-roomslist.js
src/converse-roomslist.js
+3
-49
No files found.
package-lock.json
View file @
dcf87368
...
@@ -930,7 +930,9 @@
...
@@ -930,7 +930,9 @@
}
}
},
},
"backbone.vdomview"
:
{
"backbone.vdomview"
:
{
"version"
:
"git+https://github.com/jcbrand/backbone.vdomview.git#e685de2ef5a810a87efe886b35c99ce0b3ab8f82"
,
"version"
:
"1.0.0"
,
"resolved"
:
"https://registry.npmjs.org/backbone.vdomview/-/backbone.vdomview-1.0.0.tgz"
,
"integrity"
:
"sha512-RuuA0acCspsTalZk/AF+AaZySJRa5Z1d6t1Oe8BSb3jDWXusS4ml+IE3QWZZvPnUj3D6QZr8mCxmwV4kNnmlLg=="
,
"dev"
:
true
,
"dev"
:
true
,
"requires"
:
{
"requires"
:
{
"backbone"
:
"1.3.3"
"backbone"
:
"1.3.3"
...
...
src/converse-bookmarks.js
View file @
dcf87368
...
@@ -383,9 +383,15 @@
...
@@ -383,9 +383,15 @@
_converse
.
log
(
'
Error while fetching bookmarks
'
,
Strophe
.
LogLevel
.
WARN
);
_converse
.
log
(
'
Error while fetching bookmarks
'
,
Strophe
.
LogLevel
.
WARN
);
_converse
.
log
(
iq
.
outerHTML
,
Strophe
.
LogLevel
.
DEBUG
);
_converse
.
log
(
iq
.
outerHTML
,
Strophe
.
LogLevel
.
DEBUG
);
if
(
!
_
.
isNil
(
deferred
))
{
if
(
!
_
.
isNil
(
deferred
))
{
if
(
iq
.
querySelector
(
'
error[type="cancel"] item-not-found
'
))
{
// Not an exception, the user simply doesn't have
// any bookmarks.
return
deferred
.
resolve
();
}
else
{
return
deferred
.
reject
(
new
Error
(
"
Could not fetch bookmarks
"
));
return
deferred
.
reject
(
new
Error
(
"
Could not fetch bookmarks
"
));
}
}
}
}
}
});
});
_converse
.
BookmarksList
=
Backbone
.
Model
.
extend
({
_converse
.
BookmarksList
=
Backbone
.
Model
.
extend
({
...
@@ -457,9 +463,12 @@
...
@@ -457,9 +463,12 @@
insertIntoControlBox
()
{
insertIntoControlBox
()
{
const
controlboxview
=
_converse
.
chatboxviews
.
get
(
'
controlbox
'
);
const
controlboxview
=
_converse
.
chatboxviews
.
get
(
'
controlbox
'
);
if
(
!
_
.
isUndefined
(
controlboxview
))
{
if
(
!
_
.
isUndefined
(
controlboxview
)
&&
const
chatrooms_el
=
controlboxview
.
el
.
querySelector
(
'
#chatrooms
'
);
!
document
.
body
.
contains
(
this
.
el
))
{
chatrooms_el
.
insertAdjacentElement
(
'
afterbegin
'
,
this
.
el
);
const
container
=
controlboxview
.
el
.
querySelector
(
'
#chatrooms
'
);
if
(
!
_
.
isNull
(
container
))
{
container
.
insertBefore
(
this
.
el
,
container
.
firstChild
);
}
}
}
},
},
...
@@ -533,11 +542,7 @@
...
@@ -533,11 +542,7 @@
if
(
!
_converse
.
allow_bookmarks
)
{
if
(
!
_converse
.
allow_bookmarks
)
{
return
;
return
;
}
}
if
(
_
.
isUndefined
(
_converse
.
bookmarksview
))
{
initBookmarks
();
initBookmarks
();
}
else
{
_converse
.
bookmarksview
.
render
();
}
};
};
_converse
.
on
(
'
reconnected
'
,
afterReconnection
);
_converse
.
on
(
'
reconnected
'
,
afterReconnection
);
}
}
...
...
src/converse-roomslist.js
View file @
dcf87368
...
@@ -107,7 +107,7 @@
...
@@ -107,7 +107,7 @@
},
},
getRoomsListElementName
()
{
getRoomsListElementName
()
{
if
(
this
.
model
.
get
(
'
bookmarked
'
))
{
if
(
this
.
model
.
get
(
'
bookmarked
'
)
&&
_converse
.
bookmarksview
)
{
const
bookmark
=
_
.
head
(
_converse
.
bookmarksview
.
model
.
where
({
'
jid
'
:
this
.
model
.
get
(
'
jid
'
)}));
const
bookmark
=
_
.
head
(
_converse
.
bookmarksview
.
model
.
where
({
'
jid
'
:
this
.
model
.
get
(
'
jid
'
)}));
return
bookmark
.
get
(
'
name
'
);
return
bookmark
.
get
(
'
name
'
);
}
else
{
}
else
{
...
@@ -160,8 +160,7 @@
...
@@ -160,8 +160,7 @@
},
},
render
()
{
render
()
{
this
.
el
.
innerHTML
=
this
.
el
.
innerHTML
=
tpl_rooms_list
({
tpl_rooms_list
({
'
toggle_state
'
:
this
.
list_model
.
get
(
'
toggle-state
'
),
'
toggle_state
'
:
this
.
list_model
.
get
(
'
toggle-state
'
),
'
desc_rooms
'
:
__
(
'
Click to toggle the rooms list
'
),
'
desc_rooms
'
:
__
(
'
Click to toggle the rooms list
'
),
'
label_rooms
'
:
__
(
'
Open Rooms
'
)
'
label_rooms
'
:
__
(
'
Open Rooms
'
)
...
@@ -202,33 +201,6 @@
...
@@ -202,33 +201,6 @@
}
}
},
},
renderRoomsListElement
(
item
)
{
if
(
item
.
get
(
'
type
'
)
!==
'
chatroom
'
)
{
return
;
}
this
.
removeRoomsListElement
(
item
);
let
name
,
bookmark
;
if
(
item
.
get
(
'
bookmarked
'
))
{
bookmark
=
_
.
head
(
_converse
.
bookmarksview
.
model
.
where
({
'
jid
'
:
item
.
get
(
'
jid
'
)}));
name
=
bookmark
.
get
(
'
name
'
);
}
else
{
name
=
item
.
get
(
'
name
'
);
}
const
div
=
document
.
createElement
(
'
div
'
);
div
.
innerHTML
=
tpl_rooms_list_item
(
_
.
extend
(
item
.
toJSON
(),
{
'
allow_bookmarks
'
:
_converse
.
allow_bookmarks
,
'
info_leave_room
'
:
__
(
'
Leave this room
'
),
'
info_remove_bookmark
'
:
__
(
'
Unbookmark this room
'
),
'
info_add_bookmark
'
:
__
(
'
Bookmark this room
'
),
'
info_title
'
:
__
(
'
Show more information on this room
'
),
'
name
'
:
name
,
'
open_title
'
:
__
(
'
Click to open this room
'
)
}));
this
.
el
.
querySelector
(
'
.open-rooms-list
'
).
appendChild
(
div
.
firstChild
);
this
.
show
();
},
showOrHide
(
item
)
{
showOrHide
(
item
)
{
if
(
!
this
.
model
.
models
.
length
)
{
if
(
!
this
.
model
.
models
.
length
)
{
u
.
hideElement
(
this
.
el
);
u
.
hideElement
(
this
.
el
);
...
@@ -240,17 +212,6 @@
...
@@ -240,17 +212,6 @@
removeBookmark
:
_converse
.
removeBookmarkViaEvent
,
removeBookmark
:
_converse
.
removeBookmarkViaEvent
,
addBookmark
:
_converse
.
addBookmarkViaEvent
,
addBookmark
:
_converse
.
addBookmarkViaEvent
,
removeRoomsListElement
(
item
)
{
const
list_el
=
this
.
el
.
querySelector
(
'
.open-rooms-list
'
);
const
el
=
_
.
head
(
sizzle
(
`.available-chatroom[data-room-jid="
${
item
.
get
(
'
jid
'
)}
"]`
,
list_el
));
if
(
el
)
{
list_el
.
removeChild
(
el
);
}
if
(
list_el
.
childElementCount
===
0
)
{
this
.
hide
();
}
},
toggleRoomsList
(
ev
)
{
toggleRoomsList
(
ev
)
{
if
(
ev
&&
ev
.
preventDefault
)
{
ev
.
preventDefault
();
}
if
(
ev
&&
ev
.
preventDefault
)
{
ev
.
preventDefault
();
}
const
el
=
ev
.
target
;
const
el
=
ev
.
target
;
...
@@ -289,14 +250,7 @@
...
@@ -289,14 +250,7 @@
}
}
});
});
const
afterReconnection
=
function
()
{
_converse
.
api
.
listen
.
on
(
'
reconnected
'
,
initRoomsListView
);
if
(
_
.
isUndefined
(
_converse
.
rooms_list_view
))
{
initRoomsListView
();
}
else
{
_converse
.
rooms_list_view
.
render
();
}
};
_converse
.
api
.
listen
.
on
(
'
reconnected
'
,
afterReconnection
);
}
}
});
});
}));
}));
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