Commit Graph

92 Commits

Author SHA1 Message Date
Novokreshchenov Konstantin
7c057910a8 Inconsistent unread messages count updating #873 (#874)
* Consistent unread messages count updating on ChatBoxView, Minimized ChatBoxView, RosterView and page's title

* Add tests for checking unread messages count updates in different GUI parts

* Update docs/CHANGES.md

* document windowStateChanged event in events.rst
2017-05-03 09:06:28 +02:00
Novokreshchenov Konstantin
dfd86d6c35 #567 Unreaded message count reset on page load (#856)
* save unread message count (num_unread) to server

* update CHANGES.md
2017-04-24 22:34:08 +02:00
Novokreshchenov Konstantin
bf1e612768 support opening chat in minimized mode initially (#855) 2017-04-23 15:38:48 +02:00
JC Brand
3ea43c6a0f Use noConflict to avoid polluting globale namespace
with lodash and Backbone.
2017-04-21 18:06:27 +02:00
JC Brand
9817aedea7 No need to set templates on the _converse object.
If it's needed in another plugin, it can simply be `require`'d.
2017-02-19 11:12:26 +01:00
JC Brand
bc8e3e1a01 Return a Backbone.View object instead of a wrapper
When returning chat boxes via the API.

We can do this now because these API methods are only available to
(whitelisted) plugins.
2017-02-14 15:10:46 +00:00
JC Brand
fe6a9ca748 Merge converse-api and converse-core
Otherwise `require('converse-core')` can be called, exposing the inner converse
object.
2017-02-14 14:35:52 +00:00
JC Brand
f73a1d3fc0 Don't name the modules.
According to the require.js docs this shouldn't be done.
http://requirejs.org/docs/whyamd.html#namedmodules
2017-02-13 14:37:17 +00:00
JC Brand
0424df9edc Rename the closured converse object to _converse
to indicate that it's private and to differentiate it from the outer "global"
converse object.
2017-02-02 20:43:48 +00:00
JC Brand
83feebb229 Two plugins changes
- Remove the `plugins.remove` API method.
- Throw an error when attempting to register multiple plugins with the same name.
2017-02-02 18:54:15 +00:00
JC Brand
9b48b2d6bd Update plugins to not depend on converse-core
To illustrate that this is not necessary (and also not possible with
non-bundled plugins).
2017-02-02 18:34:13 +00:00
JC Brand
b7b9711296 Rename the closured converse object to _converse
to indicate that it's private and to differentiate it from the outer "global"
converse object.
2017-02-02 18:34:13 +00:00
JC Brand
647ee1ff04 Replace jQuery-based event emitter with Backbone.Events 2017-02-02 18:30:43 +00:00
JC Brand
081f075aa9 Add eslint with lodash checking and apply its suggestions 2017-02-01 14:02:18 +01:00
JC Brand
9510bdc152 Remove minimized chats when logging out. 2017-02-01 10:49:12 +00:00
JC Brand
910e9bddcd Refactoring in MUC
What started as an attempt to fix a bug in parseXUserElement, turned into
another large refactoring of MUC code, and it's not clear how to break this up
into multiple atomic commits. So I'm just pushing it all.

At least there are two new tests added to the suite.
2016-12-02 18:41:05 +01:00
JC Brand
6abd805b52 Call trimChats immediately, not only after the element is visible
Since the element will already be taking up space (due to the
`opacity:0` property being used, instead of `display:none`).
2016-11-30 11:21:19 +01:00
JC Brand
9edc97101b Don't maximize minimized rooms when calling rooms.open 2016-11-30 11:03:28 +01:00
JC Brand
a5f76abcf1 Updates #729. Minimized chat boxes don't stay hidden
Bug got introduced during fix for #677

Eventually had to do a significant refactoring, to more consistently use the
`hidden` class instead of `display: None`. (relevant for #695)
2016-11-22 17:42:58 +01:00
JC Brand
06cbd5cdd0 Use the chats_panel.html template in converse-minimize.js
To which it's actually applicable (instead of core).
2016-11-22 17:39:36 +01:00
JC Brand
90d1071df0 Load templates in the respective plugins 2016-09-23 12:35:01 +02:00
JC Brand
89e5bd7c54 Update to pluggable.js 0.0.2 2016-08-31 10:39:11 +00:00
JC Brand
7de76924b4 Create the minimized_chats obj during _initialization
and don't remove during `_tearDown`.

Fixes bug in `trimChats` when logging in again and `converse.minimized_chats`
is undefined.
2016-07-05 06:21:25 +00:00
JC Brand
6258cfa089 Check the "closed" state of the controlbox
when trimming chats.
2016-06-10 08:26:38 +00:00
JC Brand
62c170273e Allow plugins to have optional dependencies.
This change refactors out the plugin code from converse-core into
src/converse-puggable.js

Additionally, plugins now have an optional attribute `optional_dependencies`
which is an array of dependencies which are "nice-to-have" but not essential.

Work has also been done to ensure that a plugins' dependencies are first loaded
before the plugin itself.
2016-06-10 08:26:29 +00:00
JC Brand
6d766f684f Scroll down when maximizing a chat
Otherwise maximized chats are scrolled to the top, showing the oldest messages.

Ideally we'd probably like to remember the scroll position, and show that, but
this would require some significant refactoring.
2016-04-05 11:54:50 +00:00
JC Brand
38322c7795 Hide the minimized chats toggle immediately
Otherwise the hide event can prevent a consecutive show event.
This bug becomes apparent when maximizing a minimized chat in a screen with not
enough space.

Another box will have to be minimized, which causes first a hide and then a
show event on the minimized chats toggle.
2016-04-05 11:49:34 +00:00
JC Brand
94693f2d02 Some refactoring to fix issues with how/when chat rooms are shown
- Don't call show in a room's initialize method (instead let the code be more
  similar to normal chats, in that it should listen to the "show" trigger).
- Rename chatBoxShouldBeShown to chatBoxMayBeShown
- Implement auto_join for rooms only once boxes have been fetched already.
2016-04-05 11:23:16 +00:00
JC Brand
a6c3b46237 Move the drag-resize code into a separate component. 2016-04-01 12:46:19 +00:00
JC Brand
a9a9368439 Bugifx. rooms weren't shown if converse-minimize was disabled. 2016-03-31 15:01:27 +00:00
JC Brand
4c6bd1f49c Cleaner separation between minimize/trimming feature and core
One visible effect is that when this component is now removed,
minimize buttons are not visible on the chat boxes.

updates #622
2016-03-31 08:40:25 +00:00
JC Brand
8e3c97ae61 Some fixes to minimization of chats. Updates #622
Don't call trimChats in onChatBoxAdded event. Reduntant because it will be
called after maximization and after being shown.

Add new method getShownChats and don't trim if only one or zero chats are being
shown.

Don't trim chats when in responsive mode.

Don't call trimChats unnecessarily in the render method of the trimmed chats
thingy.
2016-03-30 12:18:45 +00:00
JC Brand
2869485c1e Fixes to trimming of chats.
- Don't trim if not connected.
- Move trimChats call to converse-minimized
- Immediately hide view to avoid race conditions.
2016-03-28 14:59:23 +00:00
JC Brand
8f601e8c94 Found more stuff in core that should go to converse-minimize 2016-03-28 14:08:50 +00:00
JC Brand
ed4b9a85cc Remove ChatBox views when they get closed.
Previously views were only hidden, but not removed. This was an unnecessary
"optimization" which introduced unnecessary complexity.

Problem solved was that closing minimized chats didn't dereference the model
for hidden "normal" chat views, causing an exception to be raised when trying
to log out.
2016-03-28 12:23:36 +00:00
JC Brand
b18059fc04 Bugfix. We no longer use the 'chatroom' bool 2016-03-21 11:33:34 +00:00
JC Brand
8e18d736b4 fixed indentation of comments 2016-03-19 22:16:00 +00:00
JC Brand
5651f76373 Bugfix. onConnected overrides need to return promise. 2016-03-16 10:10:50 +00:00
JC Brand
49d58d321c Fix timing bug with minimized_chats not being available in time 2016-03-14 17:20:21 +00:00
JC Brand
eff2335624 Bugfix. Wrong function signature 2016-03-14 17:07:01 +00:00
JC Brand
45bc7f1180 Remove the need to depend on converse-controlbox and converse-chatview 2016-03-14 17:03:14 +00:00
JC Brand
7039dbe01b Move chat minimization to a separate plugin 2016-03-14 16:38:43 +00:00