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
efa87768
Commit
efa87768
authored
Feb 18, 2017
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
By convention keep the render methods immediately after initialize
parent
61bee4c2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
33 deletions
+33
-33
src/converse-muc.js
src/converse-muc.js
+33
-33
No files found.
src/converse-muc.js
View file @
efa87768
...
...
@@ -365,29 +365,6 @@
});
},
createOccupantsView
:
function
()
{
/* Create the ChatRoomOccupantsView Backbone.View
*/
this
.
occupantsview
=
new
_converse
.
ChatRoomOccupantsView
({
model
:
new
_converse
.
ChatRoomOccupants
()
});
var
id
=
b64_sha1
(
'
converse.occupants
'
+
_converse
.
bare_jid
+
this
.
model
.
get
(
'
jid
'
));
this
.
occupantsview
.
model
.
browserStorage
=
new
Backbone
.
BrowserStorage
.
session
(
id
);
this
.
occupantsview
.
chatroomview
=
this
;
this
.
occupantsview
.
render
();
this
.
occupantsview
.
model
.
fetch
({
add
:
true
});
},
insertIntoDOM
:
function
()
{
var
view
=
_converse
.
chatboxviews
.
get
(
"
controlbox
"
);
if
(
view
)
{
this
.
$el
.
insertAfter
(
view
.
$el
);
}
else
{
$
(
'
#conversejs
'
).
prepend
(
this
.
$el
);
}
return
this
;
},
render
:
function
()
{
this
.
$el
.
attr
(
'
id
'
,
this
.
model
.
get
(
'
box_id
'
))
.
html
(
_converse
.
templates
.
chatroom
());
...
...
@@ -397,16 +374,6 @@
return
this
;
},
generateHeadingHTML
:
function
()
{
/* Returns the heading HTML to be rendered.
*/
return
_converse
.
templates
.
chatroom_head
(
_
.
extend
(
this
.
model
.
toJSON
(),
{
info_close
:
__
(
'
Close and leave this room
'
),
info_configure
:
__
(
'
Configure this room
'
),
}));
},
renderHeading
:
function
()
{
/* Render the heading UI of the chat room. */
this
.
el
.
querySelector
(
'
.chat-head-chatroom
'
).
innerHTML
=
this
.
generateHeadingHTML
();
...
...
@@ -432,6 +399,39 @@
return
this
;
},
createOccupantsView
:
function
()
{
/* Create the ChatRoomOccupantsView Backbone.View
*/
this
.
occupantsview
=
new
_converse
.
ChatRoomOccupantsView
({
model
:
new
_converse
.
ChatRoomOccupants
()
});
var
id
=
b64_sha1
(
'
converse.occupants
'
+
_converse
.
bare_jid
+
this
.
model
.
get
(
'
jid
'
));
this
.
occupantsview
.
model
.
browserStorage
=
new
Backbone
.
BrowserStorage
.
session
(
id
);
this
.
occupantsview
.
chatroomview
=
this
;
this
.
occupantsview
.
render
();
this
.
occupantsview
.
model
.
fetch
({
add
:
true
});
},
insertIntoDOM
:
function
()
{
var
view
=
_converse
.
chatboxviews
.
get
(
"
controlbox
"
);
if
(
view
)
{
this
.
$el
.
insertAfter
(
view
.
$el
);
}
else
{
$
(
'
#conversejs
'
).
prepend
(
this
.
$el
);
}
return
this
;
},
generateHeadingHTML
:
function
()
{
/* Returns the heading HTML to be rendered.
*/
return
_converse
.
templates
.
chatroom_head
(
_
.
extend
(
this
.
model
.
toJSON
(),
{
info_close
:
__
(
'
Close and leave this room
'
),
info_configure
:
__
(
'
Configure this room
'
),
}));
},
afterShown
:
function
()
{
/* Override from converse-chatview, specifically to avoid
* the 'active' chat state from being sent out prematurely.
...
...
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