Commit 8c20388b authored by JC Brand's avatar JC Brand

Merge branch 'groups-refactor'

Conflicts:
	index.html
parents d24c1610 0c7252f9
......@@ -8,6 +8,7 @@
.svn/
.project
.pydevproject
Backbone.Overview
node_modules
components
docs/doctrees/environment.pickle
......
......@@ -9,13 +9,6 @@ deactivate () {
unset _OLD_VIRTUAL_PATH
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
hash -r
fi
if [ -n "$_OLD_VIRTUAL_PS1" ] ; then
PS1="$_OLD_VIRTUAL_PS1"
export PS1
......@@ -32,7 +25,7 @@ deactivate () {
# unset irrelavent variables
deactivate nondestructive
VIRTUAL_ENV="/home/jc/dev/converse.js"
VIRTUAL_ENV="~/converse.js"
export VIRTUAL_ENV
_OLD_VIRTUAL_PATH="$PATH"
......@@ -54,10 +47,3 @@ if [ -z "$VIRTUAL_ENV_DISABLE_PROMPT" ] ; then
fi
export PS1
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
hash -r
fi
This diff is collapsed.
......@@ -38,8 +38,14 @@
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-closed:before {
content: "\25ba";
}
.icon-opened:before {
content: "\25bc";
}
.icon-checkmark:before {
content: "\e600";
content: "\2713";
}
#conversejs .icon-home:before {
content: "\e000";
......@@ -812,8 +818,7 @@ dl.add-converse-contact {
top: 1px;
}
#conversejs .controlbox-pane dt {
margin: 0;
padding-top: 0.5em;
padding: 3px;
}
#conversejs .chatroom-form-container {
height: 100%;
......@@ -847,11 +852,11 @@ dl.add-converse-contact {
#conversejs .chatroom-form label select {
float: right;
}
#conversejs #converse-roster dd.odd {
#converse-roster dd.odd {
background-color: #DCEAC5;
/* Make this difference */
}
#conversejs #converse-roster dd.current-xmpp-contact span {
#converse-roster dd.current-xmpp-contact span {
font-size: 16px;
float: left;
color: #4f4f4f;
......@@ -860,18 +865,25 @@ dl.add-converse-contact {
margin-left: 0.5em;
float: right;
}
#conversejs #converse-roster dd a,
#conversejs #converse-roster dd span {
#converse-roster dd a,
#converse-roster dd span {
text-shadow: 0 1px 0 #fafafa;
display: inline-block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
#conversejs #converse-roster dd span {
#conversejs #converse-roster span.req-contact-name {
width: 65%;
}
#conversejs #converse-roster span.pending-contact-name,
#conversejs #converse-roster a.open-chat {
width: 80%;
}
#converse-roster dd span {
padding: 0 5px 0 0;
}
#conversejs #converse-roster {
#converse-roster {
overflow-y: auto;
overflow-x: hidden;
width: 100%;
......@@ -880,6 +892,9 @@ dl.add-converse-contact {
height: 254px;
height: calc(100% - 70px);
}
#converse-roster .group-toggle {
color: #666;
}
#conversejs dd.available-chatroom {
overflow-x: hidden;
text-overflow: ellipsis;
......@@ -889,8 +904,8 @@ dl.add-converse-contact {
#conversejs dd.available-chatroom a.open-room {
width: 148px;
}
#conversejs #available-chatrooms dt,
#conversejs #converse-roster dt {
#available-chatrooms dt,
#converse-roster dt {
font-weight: normal;
font-size: 13px;
color: #666;
......@@ -898,7 +913,7 @@ dl.add-converse-contact {
padding: 0.3em 0 0 0.5em;
text-shadow: 0 1px 0 #fafafa;
}
#conversejs #converse-roster dt {
#converse-roster dt {
display: none;
}
#conversejs .room-info {
......@@ -950,6 +965,11 @@ dl.add-converse-contact {
#conversejs #converse-roster dd {
line-height: 16px;
}
#conversejs .group-toggle {
display: block;
width: 100%;
}
#conversejs .roster-group:hover,
#conversejs dd.available-chatroom:hover,
#conversejs #converse-roster dd:hover {
background-color: #eee;
......@@ -967,9 +987,6 @@ dl.add-converse-contact {
#conversejs #converse-roster dd:hover a.remove-xmpp-contact {
display: inline-block;
}
#conversejs #converse-roster a.open-chat {
width: 80%;
}
#conversejs .chatbox,
#conversejs .chatroom {
height: 25px;
......@@ -1287,6 +1304,9 @@ input.custom-xmpp-status {
#conversejs .chatbox .dropdown dd ul li:hover {
background-color: #bed6e5;
}
#conversejs .chatbox .dropdown dd.search-xmpp ul li:hover {
background-color: #bed6e5;
}
#conversejs .xmpp-status-menu li a {
width: 100%;
}
......
......@@ -20,10 +20,14 @@ Changelog
Message forwarding was before a default behavior but is now optional (and disabled by default). [jcbrand]
* Newly opened chat boxes always appear immediately left of the controlbox. [jcbrand]
* #71 Chat boxes and rooms can be minimized. [jcbrand]
* #83 Roster contacts can be shown according to their groups. [jcbrand]
Note: Converse.js can show users under groups if you have assigned them
already via another client or server configuration. There is not yet a way
to assign contacts to groups from within converse.js itself.
* #123 Show converse.js in the resource assigned to a user. [jcbrand]
* #130 Fixed bootstrap conflicts. [jcbrand]
* #132 Support for `XEP-0280: Message Carbons <https://xmpp.org/extensions/xep-0280.html'>`_.
Configured via `message_carbons <https://conversejs.org/docs/html/index.html#message_carbons>`_ [hejazee]
Configured via `message_carbons <https://conversejs.org/docs/html/index.html#message_carbons>`_ [hejazee]
* #176 Add support for caching in sessionStorage as opposed to localStorage. [jcbrand]
* #180 RID and SID undefined [g8g3]
* #191 No messages history [heban]
......
......@@ -30,7 +30,7 @@ subscription and subscribes back.
<presence type="subscribed" to="contact1@localhost"/>
<presence type="subscribe" to="contact1@localhost"/>
Contact2 receives a roster update
IF Contact1 is still online and likewise subscribes back, Contact2 will receive a roster update
::
<iq type="set" to="contact2@localhost">
......@@ -39,6 +39,13 @@ Contact2 receives a roster update
</query>
</iq>
ELSE, Contact 2 will receive a roster update (but not an IQ stanza)
::
ask = null
subscription = "from"
Contact1's converse.js client will automatically
approve.
......
......@@ -784,8 +784,6 @@ Here are the different events that are emitted:
+----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+
| **roster** | When the roster is updated. | ``converse.on('roster', function (items) { ... });`` |
+----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+
| **rosterViewUpdated** | Whenever the roster view (i.e. the rendered HTML) has changed. | ``converse.on('rosterViewUpdated', function (items) { ... });`` |
+----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+
| **callButtonClicked** | When a call button (i.e. with class .toggle-call) on a chat box has been clicked. | ``converse.on('callButtonClicked', function (connection, model) { ... });`` |
+----------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+
| **chatBoxOpened** | When a chat box has been opened. | ``converse.on('chatBoxOpened', function (chatbox) { ... });`` |
......@@ -1003,6 +1001,18 @@ values as ``jid``, ``sid``, ``rid``.
Additionally, you have to specify ``bosh_service_url``.
roster_groups
-------------
Default: ``false``
If set to ``true``, converse.js will show any roster groups you might have
configured.
.. Note ::
It's currently not possible to use converse.js to assign contacts to groups.
Converse.js can only show users and groups that were previously configured
elsewhere.
show_controlbox_by_default
--------------------------
......
......@@ -150,6 +150,3 @@ p {
.fs1 {
font-size: 32px;
}
.fs2 {
font-size: 32px;
}
This diff is collapsed.
......@@ -12,6 +12,8 @@
<glyph unicode="&#x2364;" d="M256-32c141.385 0 256 114.615 256 256s-114.615 256-256 256-256-114.615-256-256 114.615-256 256-256zM256 432c114.875 0 208-93.125 208-208s-93.125-208-208-208-208 93.125-208 208 93.125 208 208 208zM192 128c0 35.346 28.654 64 64 64s64-28.654 64-64c0-35.346-28.654-64-64-64s-64 28.654-64 64zM320 304c0-26.51 14.327-48 32-48s32 21.49 32 48c0 26.51-14.327 48-32 48s-32-21.49-32-48zM128 304c0-26.51 14.327-48 32-48s32 21.49 32 48c0 26.51-14.327 48-32 48s-32-21.49-32-48z" />
<glyph unicode="&#x2368;" d="M256-32c141.385 0 256 114.615 256 256s-114.615 256-256 256-256-114.615-256-256 114.615-256 256-256zM256 432c114.875 0 208-93.125 208-208s-93.125-208-208-208-208 93.125-208 208 93.125 208 208 208zM128 320c0-17.673 14.327-32 32-32s32 14.327 32 32c0 17.673-14.327 32-32 32s-32-14.327-32-32zM320 320c0-17.673 14.327-32 32-32s32 14.327 32 32c0 17.673-14.327 32-32 32s-32-14.327-32-32zM363.053 160h32.432c4.623-36.253-16.226-72.265-51.979-85.28-41.452-15.088-87.45 6.358-102.54 47.808-9.054 24.872-36.653 37.741-61.524 28.686-22.781-8.294-35.478-32.149-30.494-55.212h-32.43c-4.621 36.254 16.225 72.264 51.978 85.28 41.452 15.089 87.451-6.358 102.541-47.807 9.052-24.874 36.653-37.741 61.522-28.686 22.781 8.292 35.478 32.149 30.494 55.211z" />
<glyph unicode="&#x2369;" d="M256-32c141.385 0 256 114.615 256 256s-114.615 256-256 256-256-114.615-256-256 114.615-256 256-256zM256 432c114.875 0 208-93.125 208-208s-93.125-208-208-208-208 93.125-208 208 93.125 208 208 208zM372.87 179.19l11.244-38.388-218.504-64.001-11.244 38.388zM128 320c0 17.673 14.327 32 32 32s32-14.327 32-32c0-17.673-14.327-32-32-32s-32 14.327-32 32zM320 320c0 17.673 14.327 32 32 32s32-14.327 32-32c0-17.673-14.327-32-32-32s-32 14.327-32 32z" />
<glyph unicode="&#x25ba;" d="M96 416l320-192-320-192z" />
<glyph unicode="&#x25bc;" d="M448 384l-192-320-192 320z" />
<glyph unicode="&#x25d9;" d="M490.594 399.946c-71.816 10.325-151.166 16.054-234.593 16.054-83.43 0-162.778-5.729-234.597-16.054-13.765-53.863-21.404-113.375-21.404-175.946 0-62.57 7.639-122.083 21.404-175.945 71.819-10.326 151.168-16.055 234.597-16.055 83.427 0 162.776 5.729 234.593 16.055 13.766 53.862 21.406 113.375 21.406 175.945 0 62.571-7.64 122.083-21.406 175.946zM192.001 128v192l160-96-160-96z" />
<glyph unicode="&#x25fb;" d="M256 384c-27.466 0-53.994-4.331-78.847-12.871-23.356-8.027-44.153-19.372-61.814-33.722-33.107-26.899-51.339-61.492-51.339-97.407 0-20.149 5.594-39.689 16.626-58.076 11.376-18.96 28.491-36.293 49.494-50.126 15.178-9.996 25.39-25.974 28.088-43.947 0.9-5.992 1.464-12.044 1.685-18.062 3.735 3.097 7.375 6.423 10.94 9.988 12.077 12.076 28.39 18.745 45.251 18.745 2.684 0 5.381-0.168 8.078-0.512 10.487-1.333 21.199-2.010 31.838-2.010 27.467 0 53.994 4.33 78.847 12.871 23.356 8.027 44.153 19.372 61.814 33.722 33.107 26.898 51.339 61.492 51.339 97.407s-18.232 70.508-51.339 97.407c-17.661 14.349-38.458 25.695-61.814 33.722-24.853 8.54-51.38 12.871-78.847 12.871zM256 448v0c141.385 0 256-93.125 256-208s-114.615-208-256-208c-13.578 0-26.905 0.867-39.912 2.522-54.989-54.989-120.625-64.85-184.088-66.298v13.458c34.268 16.789 64 47.37 64 82.318 0 4.877-0.379 9.665-1.082 14.348-57.898 38.132-94.918 96.377-94.918 161.652 0 114.875 114.615 208 256 208z" />
<glyph unicode="&#x25fc;" d="M256 448c141.385 0 256-93.125 256-208s-114.615-208-256-208c-13.578 0-26.905 0.867-39.912 2.522-54.989-54.989-120.625-64.85-184.088-66.298v13.458c34.268 16.789 64 47.37 64 82.318 0 4.877-0.379 9.665-1.082 14.348-57.898 38.132-94.918 96.377-94.918 161.652 0 114.875 114.615 208 256 208z" />
......@@ -31,6 +33,7 @@
<glyph unicode="&#x270e;" d="M432 480c44.182 0 80-35.817 80-80 0-18.010-5.955-34.629-16-48l-32-32-112 112 32 32c13.371 10.045 29.989 16 48 16zM32 112l-32-144 144 32 296 296-112 112-296-296zM357.789 298.211l-224-224-27.578 27.578 224 224 27.578-27.578z" />
<glyph unicode="&#x270f;" d="M480 352c17.673 0 32 14.327 32 32v64h-64v32h-416c-17.6 0-32-14.399-32-32v-448c0-17.6 14.398-32 32-32h416v128h32c17.673 0 32 14.327 32 32v64h-64v32h32c17.673 0 32 14.327 32 32v64h-64v32h32zM288 351.835c35.255 0 63.835-28.58 63.835-63.835s-28.58-63.835-63.835-63.835c-35.255 0-63.835 28.58-63.835 63.835s28.58 63.835 63.835 63.835zM128 0h-32v448h32v-448zM384 96h-192v32c0 35.347 28.654 64 64 64v0h64c35.348 0 64-28.653 64-64v-32z" />
<glyph unicode="&#x2710;" d="M449.18 448h-385.18v-64h-46.82c-8.8 0-17.18-6.264-17.18-15.064v-32c0-8.8 8.38-16.936 17.18-16.936h46.82v-32h-46.82c-8.8 0-17.18-6.264-17.18-15.064v-32c0-8.8 8.38-16.936 17.18-16.936h46.82v-32h-46.82c-8.8 0-17.18-6.264-17.18-15.064v-32c0-8.799 8.38-16.936 17.18-16.936h46.82v-32h-46.82c-8.8 0-17.18-6.264-17.18-15.064v-32c0-8.8 8.38-16.936 17.18-16.936h46.82v-64h385.18c17.674 0 30.82 15.263 30.82 32.936v416c0 17.673-13.146 31.064-30.82 31.064zM160 0h-64v32h17.18c8.8 0 14.82 8.136 14.82 16.936v32c0 8.801-6.021 15.064-14.82 15.064h-17.18v32h17.18c8.8 0 14.82 8.136 14.82 16.936v32c0 8.801-6.021 15.064-14.82 15.064h-17.18v32h17.18c8.8 0 14.82 8.136 14.82 16.936v32c0 8.801-6.021 15.064-14.82 15.064h-17.18v32h17.18c8.8 0 14.82 8.136 14.82 16.936v32c0 8.801-6.020 15.064-14.82 15.064h-17.18v32h64v-416z" />
<glyph unicode="&#x2713;" d="M432 416l-240-240-112 112-80-80 192-192 320 320z" />
<glyph unicode="&#x2715;" d="M507.331 68.67c-0.002 0.002-0.004 0.004-0.006 0.005l-155.322 155.325 155.322 155.325c0.002 0.002 0.004 0.003 0.006 0.005 1.672 1.673 2.881 3.627 3.656 5.708 2.123 5.688 0.912 12.341-3.662 16.915l-73.373 73.373c-4.574 4.573-11.225 5.783-16.914 3.66-2.080-0.775-4.035-1.984-5.709-3.655 0-0.002-0.002-0.003-0.004-0.005l-155.324-155.326-155.324 155.325c-0.002 0.002-0.003 0.003-0.005 0.005-1.673 1.671-3.627 2.88-5.707 3.655-5.69 2.124-12.341 0.913-16.915-3.66l-73.374-73.374c-4.574-4.574-5.784-11.226-3.661-16.914 0.776-2.080 1.985-4.036 3.656-5.708 0.002-0.001 0.003-0.003 0.005-0.005l155.325-155.324-155.325-155.326c-0.001-0.002-0.003-0.003-0.004-0.005-1.671-1.673-2.88-3.627-3.657-5.707-2.124-5.688-0.913-12.341 3.661-16.915l73.374-73.373c4.575-4.574 11.226-5.784 16.915-3.661 2.080 0.776 4.035 1.985 5.708 3.656 0.001 0.002 0.003 0.003 0.005 0.005l155.324 155.325 155.324-155.325c0.002-0.001 0.004-0.003 0.006-0.004 1.674-1.672 3.627-2.881 5.707-3.657 5.689-2.123 12.342-0.913 16.914 3.661l73.373 73.374c4.574 4.574 5.785 11.227 3.662 16.915-0.776 2.080-1.985 4.034-3.657 5.707z" />
<glyph unicode="&#x2718;" d="M0 224c0-141.385 114.615-256 256-256s256 114.615 256 256-114.614 256-256 256c-141.385 0-256-114.615-256-256zM448 224c0-36.618-10.256-70.84-28.044-99.956l-263.911 263.912c29.115 17.789 63.337 28.044 99.955 28.044 106.038 0 192-85.961 192-192zM64 224c0 36.618 10.256 70.839 28.045 99.956l263.911-263.912c-29.117-17.789-63.338-28.044-99.956-28.044-106.038 0-192 85.961-192 192z" />
<glyph unicode="&#x271a;" d="M496 288h-176v176c0 8.836-7.164 16-16 16h-96c-8.836 0-16-7.164-16-16v-176h-176c-8.836 0-16-7.164-16-16v-96c0-8.836 7.164-16 16-16h176v-176c0-8.836 7.164-16 16-16h96c8.836 0 16 7.164 16 16v176h176c8.836 0 16 7.164 16 16v96c0 8.836-7.164 16-16 16z" />
......@@ -92,5 +95,4 @@
<glyph unicode="&#xe058;" d="M256 480c-141.385 0-256-114.615-256-256s114.615-256 256-256 256 114.615 256 256-114.615 256-256 256zM384 306.745l-82.744-82.745 82.744-82.744v-45.256h-45.256l-82.744 82.744-82.745-82.744h-45.255v45.256l82.745 82.744-82.745 82.745v45.255h45.255l82.745-82.745 82.744 82.745h45.256v-45.255z" />
<glyph unicode="&#xe059;" d="M256 480c-141.385 0-256-114.615-256-256s114.615-256 256-256 256 114.615 256 256-114.615 256-256 256zM224 384h64v-64h-64v64zM320 64h-128v32h32v128h-32v32h96v-160h32v-32z" />
<glyph unicode="&#xe05a;" d="M0 272v-96c0-8.836 7.164-16 16-16h480c8.836 0 16 7.164 16 16v96c0 8.836-7.164 16-16 16h-480c-8.836 0-16-7.164-16-16z" />
<glyph unicode="&#xe600;" d="M432 416l-240-240-112 112-80-80 192-192 320 320z" />
</font></defs></svg>
\ No newline at end of file
This diff is collapsed.
@font-face {
font-family: 'icomoon';
src:url('fonts/icomoon.eot?7poj4t');
src:url('fonts/icomoon.eot?#iefix7poj4t') format('embedded-opentype'),
url('fonts/icomoon.woff?7poj4t') format('woff'),
url('fonts/icomoon.ttf?7poj4t') format('truetype'),
url('fonts/icomoon.svg?7poj4t#icomoon') format('svg');
src:url('fonts/icomoon.eot?-m2p76k');
src:url('fonts/icomoon.eot?#iefix-m2p76k') format('embedded-opentype'),
url('fonts/icomoon.woff?-m2p76k') format('woff'),
url('fonts/icomoon.ttf?-m2p76k') format('truetype'),
url('fonts/icomoon.svg?-m2p76k#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}
......@@ -23,8 +23,14 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-closed:before {
content: "\25ba";
}
.icon-opened:before {
content: "\25bc";
}
.icon-checkmark:before {
content: "\e600";
content: "\2713";
}
.icon-home:before {
content: "\e000";
......@@ -38,7 +44,7 @@
.icon-camera2:before {
content: "\2616";
}
.icon-play:before {
.icon-play22:before {
content: "\25d9";
}
.icon-music:before {
......
......@@ -226,13 +226,14 @@
allow_otr: true,
auto_list_rooms: false,
auto_subscribe: false,
bosh_service_url: 'https://bind.opkode.com', // Please use this connection manager only for testing purposes
bosh_service_url: 'https://bind.conversejs.org', // Please use this connection manager only for testing purposes
debug: true ,
hide_muc_server: false,
i18n: locales['en'], // Refer to ./locale/locales.js to see which locales are supported
prebind: false,
show_controlbox_by_default: true,
xhr_user_search: false,
roster_groups: true
});
});
</script>
......
......@@ -46,8 +46,14 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-closed:before {
content: "\25ba";
}
.icon-opened:before {
content: "\25bc";
}
.icon-checkmark:before {
content: "\e600";
content: "\2713";
}
#conversejs .icon-home:before {
content: "\e000";
......@@ -897,8 +903,7 @@ dl.add-converse-contact {
}
#conversejs .controlbox-pane dt {
margin: 0;
padding-top: 0.5em;
padding: 3px;
}
#conversejs .chatroom-form-container {
......@@ -939,11 +944,11 @@ dl.add-converse-contact {
float: right;
}
#conversejs #converse-roster dd.odd {
#converse-roster dd.odd {
background-color: #DCEAC5; /* Make this difference */
}
#conversejs #converse-roster dd.current-xmpp-contact span {
#converse-roster dd.current-xmpp-contact span {
font-size: 16px;
float: left;
color: rgb(79, 79, 79);
......@@ -954,8 +959,8 @@ dl.add-converse-contact {
float: right;
}
#conversejs #converse-roster dd a,
#conversejs #converse-roster dd span {
#converse-roster dd a,
#converse-roster dd span {
text-shadow: 0 1px 0 rgba(250, 250, 250, 1);
display: inline-block;
overflow: hidden;
......@@ -963,11 +968,20 @@ dl.add-converse-contact {
text-overflow: ellipsis;
}
#conversejs #converse-roster dd span {
#conversejs #converse-roster span.req-contact-name {
width: 65%;
}
#conversejs #converse-roster span.pending-contact-name,
#conversejs #converse-roster a.open-chat {
width: 80%;
}
#converse-roster dd span {
padding: 0 5px 0 0;
}
#conversejs #converse-roster {
#converse-roster {
overflow-y: auto;
overflow-x: hidden;
width: 100%;
......@@ -977,6 +991,10 @@ dl.add-converse-contact {
height: ~"calc(100% - 70px)";
}
#converse-roster .group-toggle {
color: #666;
}
#conversejs dd.available-chatroom {
overflow-x: hidden;
text-overflow: ellipsis;
......@@ -988,8 +1006,8 @@ dl.add-converse-contact {
width: 148px;
}
#conversejs #available-chatrooms dt,
#conversejs #converse-roster dt {
#available-chatrooms dt,
#converse-roster dt {
font-weight: normal;
font-size: 13px;
color: #666;
......@@ -998,7 +1016,7 @@ dl.add-converse-contact {
text-shadow: 0 1px 0 rgba(250, 250, 250, 1);
}
#conversejs #converse-roster dt {
#converse-roster dt {
display: none;
}
......@@ -1060,6 +1078,12 @@ dl.add-converse-contact {
line-height: 16px;
}
#conversejs .group-toggle {
display: block;
width: 100%;
}
#conversejs .roster-group:hover,
#conversejs dd.available-chatroom:hover,
#conversejs #converse-roster dd:hover {
background-color: #eee;
......@@ -1081,10 +1105,6 @@ dl.add-converse-contact {
display: inline-block;
}
#conversejs #converse-roster a.open-chat {
width: 80%;
}
#conversejs .chatbox,
#conversejs .chatroom {
height: 25px;
......@@ -1462,6 +1482,10 @@ input.custom-xmpp-status {
background-color: #bed6e5;
}
#conversejs .chatbox .dropdown dd.search-xmpp ul li:hover {
background-color: #bed6e5;
}
#conversejs .xmpp-status-menu li a {
width: 100%;
}
......
This diff is collapsed.
......@@ -13,7 +13,7 @@
runs(function () {
utils.closeAllChatBoxes();
utils.removeControlBox();
converse.roster.browserStorage._clear();
utils.clearBrowserStorage();
utils.initConverse();
utils.createContacts();
utils.openControlBox();
......@@ -22,23 +22,19 @@
});
it("is created when you click on a roster item", $.proxy(function () {
var i, $el, click, jid, view, chatboxview;
var i, $el, click, jid, chatboxview;
// openControlBox was called earlier, so the controlbox is
// visible, but no other chat boxes have been created.
expect(this.chatboxes.length).toEqual(1);
spyOn(this.chatboxviews, 'trimChats');
expect($("#conversejs .chatbox").length).toBe(1); // Controlbox is open
var online_contacts = this.rosterview.$el.find('dt#xmpp-contacts').siblings('dd.current-xmpp-contact').find('a.open-chat');
var online_contacts = this.rosterview.$el.find('dt.roster-group').siblings('dd.current-xmpp-contact').find('a.open-chat');
for (i=0; i<online_contacts.length; i++) {
$el = $(online_contacts[i]);
jid = $el.text().replace(/ /g,'.').toLowerCase() + '@localhost';
view = this.rosterview.get(jid);
spyOn(view, 'openChat').andCallThrough();
view.delegateEvents(); // We need to rebind all events otherwise our spy won't be called
$el.click();
chatboxview = this.chatboxviews.get(jid);
expect(view.openChat).toHaveBeenCalled();
expect(this.chatboxes.length).toEqual(i+2);
expect(this.chatboxviews.trimChats).toHaveBeenCalled();
// Check that new chat boxes are created to the left of the
......@@ -49,7 +45,7 @@
}, converse));
it("can be trimmed to conserve space", $.proxy(function () {
var i, $el, click, jid, key, view, chatbox, chatboxview;
var i, $el, click, jid, key, chatbox, chatboxview;
// openControlBox was called earlier, so the controlbox is
// visible, but no other chat boxes have been created.
var trimmed_chatboxes = converse.minimized_chats;
......@@ -60,11 +56,10 @@
expect($("#conversejs .chatbox").length).toBe(1); // Controlbox is open
// Test that they can be trimmed
var online_contacts = this.rosterview.$el.find('dt#xmpp-contacts').siblings('dd.current-xmpp-contact').find('a.open-chat');
var online_contacts = this.rosterview.$el.find('dt.roster-group').siblings('dd.current-xmpp-contact').find('a.open-chat');
for (i=0; i<online_contacts.length; i++) {
$el = $(online_contacts[i]);
jid = $el.text().replace(/ /g,'.').toLowerCase() + '@localhost';
view = this.rosterview.get(jid);
$el.click();
expect(this.chatboxviews.trimChats).toHaveBeenCalled();
......@@ -96,7 +91,7 @@
it("is focused if its already open and you click on its corresponding roster item", $.proxy(function () {
var contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@localhost';
var i, $el, click, jid, view, chatboxview, chatbox;
var i, $el, click, jid, chatboxview, chatbox;
// openControlBox was called earlier, so the controlbox is
// visible, but no other chat boxes have been created.
expect(this.chatboxes.length).toEqual(1);
......@@ -105,11 +100,7 @@
spyOn(chatboxview, 'focus');
$el = this.rosterview.$el.find('a.open-chat:contains("'+chatbox.get('fullname')+'")');
jid = $el.text().replace(/ /g,'.').toLowerCase() + '@localhost';
view = this.rosterview.get(jid);
spyOn(view, 'openChat').andCallThrough();
view.delegateEvents(); // We need to rebind all events otherwise our spy won't be called
$el.click();
expect(view.openChat).toHaveBeenCalled();
expect(this.chatboxes.length).toEqual(2);
expect(chatboxview.focus).toHaveBeenCalled();
}, converse));
......
This diff is collapsed.
......@@ -10,7 +10,6 @@ define("converse-templates", [
"tpl!src/templates/chatrooms_tab",
"tpl!src/templates/chats_panel",
"tpl!src/templates/choose_status",
"tpl!src/templates/contacts",
"tpl!src/templates/contacts_panel",
"tpl!src/templates/contacts_tab",
"tpl!src/templates/controlbox",
......@@ -19,6 +18,7 @@ define("converse-templates", [
"tpl!src/templates/form_checkbox",
"tpl!src/templates/form_input",
"tpl!src/templates/form_select",
"tpl!src/templates/group_header",
"tpl!src/templates/info",
"tpl!src/templates/login_panel",
"tpl!src/templates/login_tab",
......@@ -35,9 +35,9 @@ define("converse-templates", [
"tpl!src/templates/roster_item",
"tpl!src/templates/select_option",
"tpl!src/templates/status_option",
"tpl!src/templates/toggle_chats",
"tpl!src/templates/toolbar",
"tpl!src/templates/trimmed_chat",
"tpl!src/templates/toggle_chats"
"tpl!src/templates/trimmed_chat"
], function () {
return {
action: arguments[0],
......@@ -51,15 +51,15 @@ define("converse-templates", [
chatrooms_tab: arguments[8],
chats_panel: arguments[9],
choose_status: arguments[10],
contacts: arguments[11],
contacts_panel: arguments[12],
contacts_tab: arguments[13],
controlbox: arguments[14],
controlbox_toggle: arguments[15],
field: arguments[16],
form_checkbox: arguments[17],
form_input: arguments[18],
form_select: arguments[19],
contacts_panel: arguments[11],
contacts_tab: arguments[12],
controlbox: arguments[13],
controlbox_toggle: arguments[14],
field: arguments[15],
form_checkbox: arguments[16],
form_input: arguments[17],
form_select: arguments[18],
group_header: arguments[19],
info: arguments[20],
login_panel: arguments[21],
login_tab: arguments[22],
......@@ -76,8 +76,8 @@ define("converse-templates", [
roster_item: arguments[33],
select_option: arguments[34],
status_option: arguments[35],
toolbar: arguments[36],
trimmed_chat: arguments[37],
toggle_chats: arguments[38]
toggle_chats: arguments[36],
toolbar: arguments[37],
trimmed_chat: arguments[38]
};
});
<dt id="xmpp-contacts">{{label_contacts}}</dt>
<a href="#" class="group-toggle icon-{{toggle_state}}" title="{{desc_group_toggle}}">{{label_group}}</a>
<span>{{fullname}}</span> <a class="remove-xmpp-contact icon-remove" title="{{desc_remove}}" href="#"></a>
<span class="pending-contact-name">{{fullname}}</span> <a class="remove-xmpp-contact icon-remove" title="{{desc_remove}}" href="#"></a>
<dt id="pending-xmpp-contacts">{{label_pending_contacts}}</dt>
<dt id="pending-xmpp-contacts"><a href="#" class="group-toggle icon-{{toggle_state}}" title="{{desc_group_toggle}}">{{label_pending_contacts}}</a></dt>
<span>{{fullname}}</span>
<span class="req-contact-name">{{fullname}}</span>
<span class="request-actions">
<a class="accept-xmpp-request icon-checkmark" title="{{desc_accept}}" href="#"></a>
<a class="decline-xmpp-request icon-close" title="{{desc_decline}}" href="#"></a>
......
<dt id="xmpp-contact-requests">{{label_contact_requests}}</dt>
<dt id="xmpp-contact-requests"><a href="#" class="group-toggle icon-{{toggle_state}}" title="{{desc_group_toggle}}">{{label_contact_requests}}</a></dt>
......@@ -80,13 +80,21 @@
var i = 0, jid, views = [];
for (i; i<amount; i++) {
jid = mock.cur_names[i].replace(/ /g,'.').toLowerCase() + '@localhost';
views[i] = converse.rosterview.get(jid).openChat(mock.event);
views[i] = converse.roster.get(jid).trigger("open");
}
return views;
};
utils.openChatBoxFor = function (jid) {
return converse.rosterview.get(jid).openChat(mock.event);
return converse.roster.get(jid).trigger("open");
};
utils.removeRosterContacts = function () {
var model;
while (converse.rosterview.model.length) {
model = converse.rosterview.model.pop();
converse.rosterview.model.remove(model);
}
};
utils.clearBrowserStorage = function () {
......@@ -129,7 +137,6 @@
converse.roster.create({
ask: ask,
fullname: names[i],
is_last: i===(names.length-1),
jid: names[i].replace(/ /g,'.').toLowerCase() + '@localhost',
requesting: requesting,
subscription: subscription
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment