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
ee3da4e4
Commit
ee3da4e4
authored
Mar 21, 2013
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show the controlbox toggle by default.
Also, make sure RosterItems localstorage is user specifici
parent
df931af2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
24 deletions
+31
-24
base.css
base.css
+4
-0
converse.css
converse.css
+0
-4
converse.js
converse.js
+21
-20
index.html
index.html
+6
-0
No files found.
base.css
View file @
ee3da4e4
...
@@ -2,3 +2,7 @@ body {
...
@@ -2,3 +2,7 @@ body {
font
:
100%
Arial
,
FreeSans
,
sans-serif
;
font
:
100%
Arial
,
FreeSans
,
sans-serif
;
font-family
:
"Helvetica Neue"
,
Arial
,
FreeSans
,
sans-serif
;
font-family
:
"Helvetica Neue"
,
Arial
,
FreeSans
,
sans-serif
;
}
}
a
{
text-decoration
:
none
;
}
converse.css
View file @
ee3da4e4
...
@@ -25,10 +25,6 @@
...
@@ -25,10 +25,6 @@
height
:
1.1em
;
height
:
1.1em
;
}
}
#toggle-online-users
{
display
:
none
;
}
#connecting-to-chat
{
#connecting-to-chat
{
background
:
url(images/spinner.gif)
no-repeat
left
;
background
:
url(images/spinner.gif)
no-repeat
left
;
padding-left
:
1.4em
;
padding-left
:
1.4em
;
...
...
converse.js
View file @
ee3da4e4
...
@@ -1247,6 +1247,7 @@
...
@@ -1247,6 +1247,7 @@
controlbox
.
roomspanel
=
new
xmppchat
.
RoomsPanel
().
render
();
controlbox
.
roomspanel
=
new
xmppchat
.
RoomsPanel
().
render
();
// Add the roster
// Add the roster
xmppchat
.
roster
=
new
xmppchat
.
RosterItems
();
xmppchat
.
roster
=
new
xmppchat
.
RosterItems
();
xmppchat
.
roster
.
localStorage
=
new
Backbone
.
LocalStorage
(
hex_sha1
(
xmppchat
.
connection
.
bare_jid
));
xmppchat
.
rosterview
=
new
xmppchat
.
RosterView
({
'
model
'
:
xmppchat
.
roster
});
xmppchat
.
rosterview
=
new
xmppchat
.
RosterView
({
'
model
'
:
xmppchat
.
roster
});
xmppchat
.
rosterview
.
$el
.
appendTo
(
controlbox
.
contactspanel
.
$el
);
xmppchat
.
rosterview
.
$el
.
appendTo
(
controlbox
.
contactspanel
.
$el
);
xmppchat
.
roster
.
fetch
({
add
:
true
});
// Gets the cached roster items from localstorage
xmppchat
.
roster
.
fetch
({
add
:
true
});
// Gets the cached roster items from localstorage
...
@@ -1412,7 +1413,6 @@
...
@@ -1412,7 +1413,6 @@
}
}
xmppchat
.
RosterItems
=
Backbone
.
Collection
.
extend
({
xmppchat
.
RosterItems
=
Backbone
.
Collection
.
extend
({
localStorage
:
new
Backbone
.
LocalStorage
(
"
conversejs.rosterItems
"
),
model
:
xmppchat
.
RosterItem
,
model
:
xmppchat
.
RosterItem
,
comparator
:
function
(
rosteritem
)
{
comparator
:
function
(
rosteritem
)
{
var
chat_status
=
rosteritem
.
get
(
'
chat_status
'
),
var
chat_status
=
rosteritem
.
get
(
'
chat_status
'
),
...
@@ -2035,6 +2035,7 @@
...
@@ -2035,6 +2035,7 @@
console
.
log
(
'
Error
'
);
console
.
log
(
'
Error
'
);
}
else
if
(
status
===
Strophe
.
Status
.
CONNECTING
)
{
}
else
if
(
status
===
Strophe
.
Status
.
CONNECTING
)
{
console
.
log
(
'
Connecting
'
);
console
.
log
(
'
Connecting
'
);
$
(
document
).
trigger
(
'
jarnxmpp.connecting
'
);
}
else
if
(
status
===
Strophe
.
Status
.
CONNFAIL
)
{
}
else
if
(
status
===
Strophe
.
Status
.
CONNFAIL
)
{
console
.
log
(
'
Connection Failed
'
);
console
.
log
(
'
Connection Failed
'
);
}
else
if
(
status
===
Strophe
.
Status
.
AUTHENTICATING
)
{
}
else
if
(
status
===
Strophe
.
Status
.
AUTHENTICATING
)
{
...
@@ -2060,10 +2061,8 @@
...
@@ -2060,10 +2061,8 @@
// --------------
// --------------
$
(
document
).
ready
(
$
.
proxy
(
function
()
{
$
(
document
).
ready
(
$
.
proxy
(
function
()
{
var
chatdata
=
$
(
'
div#collective-xmpp-chat-data
'
),
var
chatdata
=
$
(
'
div#collective-xmpp-chat-data
'
),
$connecting
=
$
(
'
span#connecting-to-chat
'
),
$connecting
=
$
(
'
span#connecting-to-chat
'
)
.
hide
()
,
$toggle
=
$
(
'
a#toggle-online-users
'
);
$toggle
=
$
(
'
a#toggle-online-users
'
);
$toggle
.
unbind
(
'
click
'
);
this
.
username
=
chatdata
.
attr
(
'
username
'
);
this
.
username
=
chatdata
.
attr
(
'
username
'
);
this
.
fullname
=
chatdata
.
attr
(
'
fullname
'
);
this
.
fullname
=
chatdata
.
attr
(
'
fullname
'
);
this
.
auto_subscribe
=
chatdata
.
attr
(
'
auto_subscribe
'
)
===
"
True
"
||
false
;
this
.
auto_subscribe
=
chatdata
.
attr
(
'
auto_subscribe
'
)
===
"
True
"
||
false
;
...
@@ -2071,6 +2070,20 @@
...
@@ -2071,6 +2070,20 @@
this
.
chatboxesview
=
new
this
.
ChatBoxesView
({
this
.
chatboxesview
=
new
this
.
ChatBoxesView
({
model
:
new
this
.
ChatBoxes
()
model
:
new
this
.
ChatBoxes
()
});
});
$toggle
.
bind
(
'
click
'
,
$
.
proxy
(
function
(
e
)
{
e
.
preventDefault
();
if
(
$
(
"
div#controlbox
"
).
is
(
'
:visible
'
))
{
this
.
chatboxesview
.
closeChat
(
'
controlbox
'
);
}
else
{
this
.
chatboxesview
.
showChat
(
'
controlbox
'
);
}
},
this
));
$
(
document
).
bind
(
'
jarnxmpp.connecting
'
,
$
.
proxy
(
function
(
ev
,
conn
)
{
$toggle
.
hide
(
function
()
{
$connecting
.
show
();
});
},
this
));
$
(
document
).
bind
(
'
jarnxmpp.disconnected
'
,
$
.
proxy
(
function
(
ev
,
conn
)
{
$
(
document
).
bind
(
'
jarnxmpp.disconnected
'
,
$
.
proxy
(
function
(
ev
,
conn
)
{
$toggle
.
hide
();
$toggle
.
hide
();
...
@@ -2088,7 +2101,7 @@
...
@@ -2088,7 +2101,7 @@
this
.
connection
.
bare_jid
=
Strophe
.
getBareJidFromJid
(
this
.
connection
.
jid
);
this
.
connection
.
bare_jid
=
Strophe
.
getBareJidFromJid
(
this
.
connection
.
jid
);
this
.
connection
.
domain
=
Strophe
.
getDomainFromJid
(
this
.
connection
.
jid
);
this
.
connection
.
domain
=
Strophe
.
getDomainFromJid
(
this
.
connection
.
jid
);
this
.
connection
.
muc_domain
=
'
conference.
'
+
this
.
connection
.
domain
;
this
.
connection
.
muc_domain
=
'
conference.
'
+
this
.
connection
.
domain
;
this
.
storage
=
new
this
.
ClientStorage
(
this
.
connection
.
bare_jid
);
this
.
storage
=
new
this
.
ClientStorage
(
hex_sha1
(
this
.
connection
.
bare_jid
)
);
this
.
chatboxesview
.
onConnected
();
this
.
chatboxesview
.
onConnected
();
...
@@ -2121,21 +2134,9 @@
...
@@ -2121,21 +2134,9 @@
});
});
},
this
));
},
this
));
// Controlbox toggler
$connecting
.
hide
();
if
(
$toggle
.
length
)
{
$toggle
.
show
();
$connecting
.
hide
();
$toggle
.
show
();
$toggle
.
bind
(
'
click
'
,
$
.
proxy
(
function
(
e
)
{
e
.
preventDefault
();
if
(
$
(
"
div#controlbox
"
).
is
(
'
:visible
'
))
{
this
.
chatboxesview
.
closeChat
(
'
controlbox
'
);
}
else
{
this
.
chatboxesview
.
showChat
(
'
controlbox
'
);
}
},
this
));
}
else
{
this
.
chatboxesview
.
showChat
(
'
controlbox
'
);
}
},
this
));
},
this
));
},
xmppchat
));
},
xmppchat
));
...
...
index.html
View file @
ee3da4e4
...
@@ -10,5 +10,11 @@
...
@@ -10,5 +10,11 @@
<body>
<body>
<h1>
Converse.js Demo Page
</h1>
<h1>
Converse.js Demo Page
</h1>
<div
id=
"collective-xmpp-chat-data"
></div>
<div
id=
"collective-xmpp-chat-data"
></div>
<div
id=
"toggle-controlbox"
>
<a
href=
"#"
class=
"chat"
id=
"toggle-online-users"
>
<span
i18n:translate=
""
>
Online Users
</span>
(
<strong
id=
"online-count"
>
0
</strong>
)
</a>
<span
id=
"connecting-to-chat"
i18n:translate=
""
>
Connecting to chat ...
</span>
</div>
</body>
</body>
</html>
</html>
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