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
c53da4c1
Commit
c53da4c1
authored
Jun 21, 2012
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store the user's xmpp status in the browser's session storage.
parent
c15a2e25
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
collective.xmpp.chat.js
collective.xmpp.chat.js
+17
-13
No files found.
collective.xmpp.chat.js
View file @
c53da4c1
...
...
@@ -131,11 +131,19 @@ var xmppchat = (function ($, console) {
obj
.
prepNewChat
=
function
(
chat
,
jid
)
{
// Some operations that need to be applied on a chatbox
// after it has been created.
var
chat_content
=
$
(
chat
).
find
(
'
.chat-content
'
);
var
chat_content
,
value
;
if
(
jid
===
'
online-users-container
'
)
{
value
=
jarnxmpp
.
Storage
.
get
(
'
xmpp-status
'
)
||
'
online
'
;
$
(
chat
).
find
(
'
#select-xmpp-status
'
).
val
(
value
);
}
else
{
chat_content
=
$
(
chat
).
find
(
'
.chat-content
'
);
$
(
chat
).
find
(
"
.chat-textarea
"
).
focus
();
if
(
chat_content
.
length
>
0
)
{
chat_content
.
scrollTop
(
chat_content
[
0
].
scrollHeight
);
}
}
if
(
!
(
jid
in
this
.
oc
(
this
.
chats
)))
{
this
.
chats
.
push
(
jid
);
}
...
...
@@ -417,16 +425,12 @@ $(document).ready(function () {
}
});
$
(
'
a.user-details-toggle
'
).
live
(
'
click
'
,
function
(
e
)
{
var
$field
=
$
(
'
[name="message"]:input
'
,
$
(
this
).
parent
()[
0
]),
jid
=
$field
.
attr
(
'
data-recipient
'
);
e
.
preventDefault
();
xmppchat
.
getChatbox
(
jid
,
function
()
{});
});
$
(
'
ul.tabs
'
).
tabs
(
'
div.panes > div
'
);
$
(
'
select#select-xmpp-status
'
).
bind
(
'
change
'
,
function
(
event
)
{
var
jid
=
jarnxmpp
.
connection
.
jid
;
$
(
document
).
trigger
(
'
xmppchat.send_presence
'
,
[
jid
,
event
.
target
.
value
]);
var
jid
=
jarnxmpp
.
connection
.
jid
,
value
=
event
.
target
.
value
;
$
(
document
).
trigger
(
'
xmppchat.send_presence
'
,
[
jid
,
value
]);
jarnxmpp
.
Storage
.
set
(
'
xmpp-status
'
,
value
);
});
});
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