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
cd67e80a
Commit
cd67e80a
authored
Jul 26, 2012
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix. Make sure that boxes are displayed inline and set #chatpanel width to auto.
parent
f4a90cc9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
29 deletions
+33
-29
converse.js
converse.js
+33
-29
No files found.
converse.js
View file @
cd67e80a
...
...
@@ -143,10 +143,10 @@ xmppchat.ChatBoxView = Backbone.View.extend({
$chat_content
.
scrollTop
(
$chat_content
[
0
].
scrollHeight
);
},
insertStatusNotification
:
function
(
message
)
{
insertStatusNotification
:
function
(
user_id
,
message
)
{
var
$chat_content
=
this
.
$el
.
find
(
'
.chat-content
'
);
$chat_content
.
find
(
'
div.chat-event
'
).
remove
().
end
()
.
append
(
$
(
'
<div class="chat-event"></div>
'
).
text
(
this
.
model
.
get
(
'
user_id
'
)
+
'
'
+
message
));
.
append
(
$
(
'
<div class="chat-event"></div>
'
).
text
(
user_id
+
'
'
+
message
));
$chat_content
.
scrollTop
(
$chat_content
[
0
].
scrollHeight
);
},
...
...
@@ -168,7 +168,7 @@ xmppchat.ChatBoxView = Backbone.View.extend({
}
if
(
!
body
)
{
if
(
composing
.
length
>
0
)
{
this
.
insertStatusNotification
(
'
is typing
'
);
this
.
insertStatusNotification
(
user_id
,
'
is typing
'
);
return
;
}
}
else
{
...
...
@@ -314,11 +314,11 @@ xmppchat.ChatBoxView = Backbone.View.extend({
if
(
_
.
has
(
changed
.
changes
,
'
status
'
))
{
if
(
this
.
$el
.
is
(
'
:visible
'
))
{
if
(
item
.
get
(
'
status
'
)
===
'
offline
'
)
{
this
.
insertStatusNotification
(
'
has gone offline
'
);
this
.
insertStatusNotification
(
this
.
model
.
get
(
'
user_id
'
),
'
has gone offline
'
);
}
else
if
(
item
.
get
(
'
status
'
)
===
'
away
'
)
{
this
.
insertStatusNotification
(
'
has gone away
'
);
this
.
insertStatusNotification
(
this
.
model
.
get
(
'
user_id
'
),
'
has gone away
'
);
}
else
if
(
item
.
get
(
'
status
'
)
===
'
busy
'
)
{
this
.
insertStatusNotification
(
'
is busy
'
);
this
.
insertStatusNotification
(
this
.
model
.
get
(
'
user_id
'
),
'
is busy
'
);
}
else
if
(
item
.
get
(
'
status
'
)
===
'
online
'
)
{
this
.
$el
.
find
(
'
div.chat-event
'
).
remove
();
}
...
...
@@ -358,10 +358,11 @@ xmppchat.ChatBoxView = Backbone.View.extend({
},
show
:
function
()
{
var
that
=
this
;
$
(
this
.
el
).
show
(
'
fast
'
,
function
()
{
that
.
focus
();
});
this
.
$el
.
css
({
'
opacity
'
:
0
});
this
.
$el
.
css
({
'
display
'
:
'
inline
'
});
this
.
$el
.
animate
({
opacity
:
'
1
'
},
200
);
return
this
;
},
...
...
@@ -498,11 +499,6 @@ xmppchat.ControlBoxView = xmppchat.ChatBoxView.extend({
render
:
function
()
{
return
this
;
},
show
:
function
()
{
$
(
this
.
el
).
show
();
return
this
;
}
});
...
...
@@ -652,13 +648,14 @@ xmppchat.ChatRoomView = xmppchat.ChatBoxView.extend({
}
if
(
!
body
)
{
if
(
composing
.
length
>
0
)
{
this
.
insertStatusNotification
(
'
is typing
'
);
this
.
insertStatusNotification
(
sender
,
'
is typing
'
);
return
true
;
}
}
else
{
if
(
sender
===
this
.
model
.
get
(
'
nick
'
))
{
this
.
appendMessage
(
body
);
}
else
{
$chat_content
.
find
(
'
div.chat-event
'
).
remove
();
$chat_content
.
append
(
this
.
message_template
({
'
sender
'
:
'
them
'
,
...
...
@@ -685,6 +682,15 @@ xmppchat.ChatRoomView = xmppchat.ChatBoxView.extend({
return
true
;
},
show
:
function
()
{
this
.
$el
.
css
({
'
opacity
'
:
0
});
this
.
$el
.
css
({
'
display
'
:
'
inline
'
});
this
.
$el
.
animate
({
opacity
:
'
1
'
},
200
);
return
this
;
},
render
:
function
()
{
$
(
this
.
el
).
attr
(
'
id
'
,
this
.
model
.
get
(
'
box_id
'
));
$
(
this
.
el
).
html
(
this
.
template
(
this
.
model
.
toJSON
()));
...
...
@@ -766,15 +772,10 @@ xmppchat.ChatBoxesView = Backbone.View.extend({
if
(
view
.
isVisible
())
{
view
.
focus
();
}
else
{
if
(
jid
===
'
online-users-container
'
)
{
$
(
view
.
el
).
show
(
'
fast
'
,
function
()
{
view
.
el
.
focus
();
});
}
else
{
$
(
view
.
el
).
show
(
'
fast
'
,
function
()
{
view
.
el
.
focus
();
view
.
scrolldown
();
});
view
.
show
();
if
(
jid
!==
'
online-users-container
'
)
{
view
.
scrolldown
();
view
.
focus
();
}
view
.
addChatToCookie
();
}
...
...
@@ -850,6 +851,7 @@ xmppchat.RosterItemView = Backbone.View.extend({
modal
:
true
,
buttons
:
{
"
Remove
"
:
function
()
{
var
bare_jid
=
that
.
model
.
get
(
'
bare_jid
'
);
$
(
this
).
dialog
(
"
close
"
);
xmppchat
.
connection
.
roster
.
unauthorize
(
that
.
model
.
get
(
'
jid
'
));
xmppchat
.
roster
.
remove
(
bare_jid
);
...
...
@@ -913,11 +915,13 @@ xmppchat.RosterItemView = Backbone.View.extend({
ev
.
preventDefault
();
that
.
openChat
();
});
this
.
$el
.
find
(
'
a.remove-xmpp-contact
'
).
on
(
'
click
'
,
function
(
ev
)
{
ev
.
preventDefault
();
that
.
removeContact
();
});
}
// Event handlers
this
.
$el
.
find
(
'
a.remove-xmpp-contact
'
).
on
(
'
click
'
,
function
(
ev
)
{
ev
.
preventDefault
();
that
.
removeContact
();
});
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