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
d3090f80
Commit
d3090f80
authored
8 years ago
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remember which panel was open when reloading the page.
parent
e5b2acde
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
16 deletions
+50
-16
src/converse-controlbox.js
src/converse-controlbox.js
+21
-5
src/converse-core.js
src/converse-core.js
+8
-6
src/converse-muc.js
src/converse-muc.js
+12
-2
src/converse-register.js
src/converse-register.js
+1
-1
src/templates/chatrooms_tab.html
src/templates/chatrooms_tab.html
+4
-1
src/templates/contacts_tab.html
src/templates/contacts_tab.html
+4
-1
No files found.
src/converse-controlbox.js
View file @
d3090f80
...
...
@@ -58,6 +58,8 @@
converse
.
templates
.
search_contact
=
tpl_search_contact
;
converse
.
templates
.
status_option
=
tpl_status_option
;
var
USERS_PANEL_ID
=
'
users
'
;
// Strophe methods for building stanzas
var
Strophe
=
converse_api
.
env
.
Strophe
,
utils
=
converse_api
.
env
.
utils
;
...
...
@@ -323,6 +325,9 @@
},
renderContactsPanel
:
function
()
{
if
(
_
.
isUndefined
(
this
.
model
.
get
(
'
active-panel
'
)))
{
this
.
model
.
save
({
'
active-panel
'
:
USERS_PANEL_ID
});
}
this
.
contactspanel
=
new
converse
.
ContactsPanel
({
'
$parent
'
:
this
.
$el
.
find
(
'
.controlbox-panes
'
)
});
...
...
@@ -366,11 +371,12 @@
},
onControlBoxToggleHidden
:
function
()
{
var
that
=
this
;
this
.
$el
.
show
(
'
fast
'
,
function
()
{
converse
.
controlboxtoggle
.
updateOnlineCount
();
utils
.
refreshWebkit
();
converse
.
emit
(
'
controlBoxOpened
'
,
th
is
);
}
.
bind
(
this
)
);
converse
.
emit
(
'
controlBoxOpened
'
,
th
at
);
});
},
show
:
function
()
{
...
...
@@ -386,10 +392,13 @@
var
$tab
=
$
(
ev
.
target
),
$sibling
=
$tab
.
parent
().
siblings
(
'
li
'
).
children
(
'
a
'
),
$tab_panel
=
$
(
$tab
.
attr
(
'
href
'
));
$
(
$sibling
.
attr
(
'
href
'
)).
hide
(
);
$
(
$sibling
.
attr
(
'
href
'
)).
addClass
(
'
hidden
'
);
$sibling
.
removeClass
(
'
current
'
);
$tab
.
addClass
(
'
current
'
);
$tab_panel
.
show
();
$tab_panel
.
removeClass
(
'
hidden
'
);
if
(
converse
.
connection
.
connected
)
{
this
.
model
.
save
({
'
active-panel
'
:
$tab
.
data
(
'
id
'
)});
}
return
this
;
},
...
...
@@ -631,7 +640,11 @@
include_offline_state
:
converse
.
include_offline_state
,
allow_logout
:
converse
.
allow_logout
});
this
.
$tabs
.
append
(
converse
.
templates
.
contacts_tab
({
label_contacts
:
LABEL_CONTACTS
}));
var
controlbox
=
converse
.
chatboxes
.
get
(
'
controlbox
'
);
this
.
$tabs
.
append
(
converse
.
templates
.
contacts_tab
({
'
label_contacts
'
:
LABEL_CONTACTS
,
'
is_current
'
:
controlbox
.
get
(
'
active-panel
'
)
===
USERS_PANEL_ID
}));
if
(
converse
.
xhr_user_search
)
{
markup
=
converse
.
templates
.
search_contact
({
label_contact_name
:
__
(
'
Contact name
'
),
...
...
@@ -651,6 +664,9 @@
}
this
.
$el
.
html
(
widgets
);
this
.
$el
.
find
(
'
.search-xmpp ul
'
).
append
(
markup
);
if
(
controlbox
.
get
(
'
active-panel
'
)
!==
USERS_PANEL_ID
)
{
this
.
$el
.
addClass
(
'
hidden
'
);
}
return
this
;
},
...
...
This diff is collapsed.
Click to expand it.
src/converse-core.js
View file @
d3090f80
...
...
@@ -680,11 +680,7 @@
// XXX: Deprecate in favor of init_deferred
converse
.
callback
();
}
if
(
converse
.
connection
.
service
===
'
jasmine tests
'
)
{
init_deferred
.
resolve
(
converse
);
}
else
{
init_deferred
.
resolve
();
}
init_deferred
.
resolve
();
converse
.
emit
(
'
initialized
'
);
};
...
...
@@ -1961,7 +1957,13 @@
converse
.
emit
(
'
pluginsInitialized
'
);
converse
.
_initialize
();
converse
.
registerGlobalEventHandlers
();
return
init_deferred
.
promise
();
if
(
!
_
.
isUndefined
(
converse
.
connection
)
&&
converse
.
connection
.
service
===
'
jasmine tests
'
)
{
return
converse
;
}
else
{
return
init_deferred
.
promise
();
}
};
return
converse
;
}));
This diff is collapsed.
Click to expand it.
src/converse-muc.js
View file @
d3090f80
...
...
@@ -60,6 +60,8 @@
converse
.
templates
.
room_item
=
tpl_room_item
;
converse
.
templates
.
room_panel
=
tpl_room_panel
;
var
ROOMS_PANEL_ID
=
'
chatrooms
'
;
// Strophe methods for building stanzas
var
Strophe
=
converse_api
.
env
.
Strophe
,
$iq
=
converse_api
.
env
.
$iq
,
...
...
@@ -1434,9 +1436,17 @@
'
label_join
'
:
__
(
'
Join Room
'
),
'
label_show_rooms
'
:
__
(
'
Show rooms
'
)
})
)
.
hide
()
);
));
this
.
$tabs
=
this
.
$parent
.
parent
().
find
(
'
#controlbox-tabs
'
);
this
.
$tabs
.
append
(
converse
.
templates
.
chatrooms_tab
({
label_rooms
:
__
(
'
Rooms
'
)}));
var
controlbox
=
converse
.
chatboxes
.
get
(
'
controlbox
'
);
this
.
$tabs
.
append
(
converse
.
templates
.
chatrooms_tab
({
'
label_rooms
'
:
__
(
'
Rooms
'
),
'
is_current
'
:
controlbox
.
get
(
'
active-panel
'
)
===
ROOMS_PANEL_ID
}));
if
(
controlbox
.
get
(
'
active-panel
'
)
!==
ROOMS_PANEL_ID
)
{
this
.
$el
.
addClass
(
'
hidden
'
);
}
return
this
;
},
...
...
This diff is collapsed.
Click to expand it.
src/converse-register.js
View file @
d3090f80
...
...
@@ -81,7 +81,7 @@
'
$parent
'
:
this
.
$el
.
find
(
'
.controlbox-panes
'
),
'
model
'
:
this
});
this
.
registerpanel
.
render
().
$el
.
hide
(
);
this
.
registerpanel
.
render
().
$el
.
addClass
(
'
hidden
'
);
}
return
this
;
}
...
...
This diff is collapsed.
Click to expand it.
src/templates/chatrooms_tab.html
View file @
d3090f80
<li><a
class=
"s"
href=
"#chatrooms"
>
{{label_rooms}}
</a></li>
<li><a
class=
"s {[ if (is_current) { ]} current {[ } ]}"
data-id=
"chatrooms"
href=
"#chatrooms"
>
{{label_rooms}}
</a></li>
This diff is collapsed.
Click to expand it.
src/templates/contacts_tab.html
View file @
d3090f80
<li><a
class=
"s current"
href=
"#users"
>
{{label_contacts}}
</a></li>
<li><a
class=
"s {[ if (is_current) { ]} current {[ } ]}"
data-id=
"users"
href=
"#users"
>
{{label_contacts}}
</a></li>
This diff is collapsed.
Click to expand it.
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