Commit Graph

127 Commits

Author SHA1 Message Date
JC Brand
53df5d6b49 Fix whitelisting and dependencies on the headline plugins 2019-11-22 14:38:09 +01:00
JC Brand
caadb24310 Refactor logging out into its own module
So that we don't need to `_converse` obj in order to log messages
2019-11-22 13:50:36 +01:00
JC Brand
879e165ae5 Refactoring
- Move headless one-on-one chat functionality into converse-chat
- Split converse-headline into converse-headlines and converse-headlines-views
- Add api in `_converse.api.chatboxes` for creating chatboxes
- Add `_converse.api.controlbox.get` method
2019-11-04 15:05:50 +01:00
JC Brand
9934fa7191 New event minimizedChatViewInitialized 2019-10-22 18:33:56 +02:00
JC Brand
50b77e8608 Fixes #1733 2019-10-13 19:48:39 +02:00
JC Brand
82bce1e946 Move creation of browserStorage into a separate method
This is in anticipation of the localforage/IndexDB merge
2019-10-11 20:40:31 +02:00
JC Brand
9d77a4ef97 Fixes #129 Add support for XEP-0156.
Only XML is supported for now.
2019-10-11 17:46:13 +02:00
JC Brand
8780f7a128 Fix linting errors (no-unused-vars) 2019-10-09 16:27:58 +02:00
JC Brand
768ed4a577 Replace lodash methods with built-ins, convert docstrings to JSDoc 2019-09-07 23:14:33 +02:00
JC Brand
cc91f3751e Add listenTo instead of on to avoid memory leaks 2019-09-06 16:04:06 +02:00
JC Brand
93de11d167 Dynamically load the dayjs translation.
Also, remove the Promise polyfill. We don't support browsers which don't support promises.
2019-08-23 14:03:52 +02:00
Réda Housni Alaoui
c2db667321 Shadow dom: TypeError: Cannot read property 'parentElement' of null caused by MinimizedChatsToggleView 2019-08-02 16:30:25 +02:00
JC Brand
550d0ae31b Bugfix. Chat state should be set to active on chat maximized 2019-08-02 11:15:17 +02:00
JC Brand
2546622da3 Trigger events when resizing starts 2019-07-25 06:46:05 +02:00
JC Brand
38d1e4e3d2 Bugfix. Sometimes when trimming chats, minimized chats go off screen 2019-07-12 12:50:20 +02:00
JC Brand
2849adf857 Stop debouncing show
Instead optimize in other ways.

Also:
- Don't fade in when `animate` is false.
- `trimChats` now gets called in `afterShown`.
- Add now event `beforeShowingChatView`
2019-07-12 12:42:41 +02:00
JC Brand
d95a7987ce Fix linting errors and add @module jsdoc directives 2019-07-11 10:48:52 +02:00
JC Brand
ded9945ed9 MUC: Don't send XEP-0085 CSNs when we don't have voice
Includes some refactoring:

- Don't send an `active` chat state notification when entering a MUC
  I can't think of a good reason why this might be necessary or desired.
- Move `setChatState` form the view to the model
- Remove unused method `handleChatStateNotification`
- Don't store `role` and `affiliation` for the current user on the
  ChatRoom object, but instead on the ChatRoomOccupant object representing
  the user.
2019-07-10 14:24:00 +02:00
JC Brand
824b2c81b4 converse-minimize: Rename view methods to clarify
that they are in response to a change and not meant as an API.
2019-06-26 16:52:51 +02:00
JC Brand
bbe2a62295 converse-muc: Create info and error messages on the model
instead of on the view.
2019-06-12 06:27:07 +02:00
JC Brand
dc58e6d47f Make teardown a function 2019-06-03 09:43:24 +02:00
JC Brand
7a18f59f8f Simplify rendering of trimmed chats
Also fix issue where trimmed headline chatboxes don't show the proper
color
2019-05-29 13:28:45 +02:00
JC Brand
2d507c68c9 Always debounce trimChats 2019-05-24 16:02:07 +02:00
JC Brand
1ef29bee4e Use composition instead of overrides 2019-05-24 16:02:07 +02:00
JC Brand
b876500865 Update to latest backbone.overview 2019-05-23 14:44:10 +02:00
JC Brand
c3dac272f8 Replace moment with DayJS 2019-05-06 14:27:18 +02:00
JC Brand
9528276be2 Use native Date methods instead of moment
- Use native `getTime` method instead of moment's `valueOf`
- Use toISOString() instead of moment().format()
  This makes the code timezone independent since we're now globally using UTC.
2019-05-06 10:28:03 +02:00
JC Brand
34469425d6 Use Object.assign instead of _.extend 2019-04-29 09:07:15 +02:00
JC Brand
ee78ec1333 Add force parameter to _converse.chats.open
This changes the API method's current behavior by not automatically
maximizing (in `overlayed` view mode) or bringing a background chat into
foreground (in `fullscreen` view mode). Instead `force` needs to be set
to `true` for that to happen.
2019-04-16 16:42:15 +02:00
JC Brand
4eb6df92c6 Bugfix. Controlbox closed state not remembered
in overlay view mode.

Also refactored a bit to put the method, which determines whether a
chatbox may be shown, on the chatbox itself.
2019-04-16 13:38:46 +02:00
JC Brand
eb67f10371 Handle case where there isn't a MUC close button 2019-04-05 14:04:00 +02:00
JC Brand
63a0c63927 Fix bugs with moving events 2019-03-29 21:56:56 +01:00
JC Brand
f897703565 Rename emit to trigger for consistency with Backbone.Events 2019-03-29 21:56:56 +01:00
JC Brand
f6335dcabe Document fired events with JSDoc 2019-03-29 21:04:33 +01:00
JC Brand
d41a7a14c3 Use API to emit and listen to events 2019-03-29 14:16:07 +01:00
Emmanuel Gil Peyrot
b7ae9f212c Replace http: with https: in conversejs.org links 2019-03-04 17:47:45 +01:00
JC Brand
c026dc8a86 New copyright year 2019-02-18 20:23:18 +01:00
JC Brand
9233087548 Don't hash web storage ids.
Makes debugging more difficult and uses up extra CPU cycles for no real security benefit.
2019-02-18 20:23:18 +01:00
JC Brand
38d7723bee Don't call trimChats when not in overlayed mode 2018-12-17 15:18:36 +01:00
JC Brand
6c3990ac86 Trying to fix trimChats is not a function on Travis 2018-12-17 11:50:56 +01:00
JC Brand
d5e89655dc Still check the view mode since the trimChats method is debounced 2018-12-16 11:32:19 +01:00
JC Brand
6ec183451d Remove global event listener when appropriate.
Otherwise trimChats called in `fullscreen` tests (due to being
registered in a previous test)
2018-12-15 20:01:19 +01:00
JC Brand
2857293ad1 Fix failing tests by waiting and slightly improve code 2018-12-06 13:10:34 +01:00
JC Brand
d341c6a13b Revert "Use getter to lazily create Strophe.Connection"
This reverts commit 7af73c3471.

Doesn't look like the right approach for adding support for XEP-0156.
Work on that will continue in a branch in the meantime.
2018-11-20 17:31:53 +01:00
JC Brand
7af73c3471 Use getter to lazily create Strophe.Connection 2018-11-18 18:05:47 +01:00
JC Brand
6519083414 Revert to explicit Promise-based code.
* src/converse-controlbox.js

    async/await causes many tests here to fail due to the controlbox toggle
    now apparently showing up a little later (and the tests don't wait for
    it to happen).

* src/converse-minimize.js

    We get timeout issues in tests.

* src/headless/converse-chatboxes.js

    We get a stack overflow while running tests.
2018-10-26 12:53:01 +02:00
Emmanuel Gil Peyrot
35b7dbe389 Convert a few functions to async/await. 2018-10-24 21:23:32 +02:00
JC Brand
6904f9a897 Use es2015 modules instead of UMD 2018-10-23 12:25:58 +02:00
cmrd Senya
8ba8eb02fa Update main converse.js package to use @converse/headless
* Update moved dependencies references to @converse/headless
* Remove unused webpack resolve aliases
2018-10-22 12:44:38 +02:00
JC Brand
023249f62e Render profile avatar as canvas.
We now have uniform avatar rendering for the profile, messages and
chatboxes.

By rendering as canvas, we can avoid stretching the image.

In the process I also moved the ChatBoxViews collection into its own
plugin `converse-chatboxviews` and placed the AvatarAware views there.

fixes #1157
2018-09-06 15:33:13 +02:00