Commit Graph

48 Commits

Author SHA1 Message Date
JC Brand
15c10376b0 Rename all templates to camelCase
To conform with naming conventions regarding functions, which the
templates are.
2023-02-15 14:29:07 +01:00
JC Brand
927add0707 Wrap requestUpdate in an arrow function
Otherwise parameters from the event handler might be passed in to it,
causing potential weirdness.
2022-09-16 10:26:21 +02:00
JC Brand
48f37aa1c0 Call initialize in CustomElement's connectedCallback method 2021-09-23 14:25:42 +02:00
JC Brand
efafc2d691 Allow media to be invidually shown/rendered...
even if the global configuration is to disallow it.

* When parsing, include all media URLs, not just the ones from allowed domains.
  That makes it possible to change allowed domains on-the-fly,
  while still allowing media in individual messages to be shown manually
  (via the message actions dropdown).
* Merge `embed_audio`, `embed_video` and `show_images_inline` into `render_media`
* Create new config settings for allowable domains for images, video and audio
* Check the URL domain against a whitelist for the message actions dropdown
2021-09-21 17:08:30 +02:00
JC Brand
e00bf3da36 Make sure unread messages are cleared when showing a chat 2021-06-23 17:18:32 +02:00
JC Brand
8907adc236 Move method to utils 2021-06-15 10:03:10 +02:00
JC Brand
c8304497b5 Remove onStatusMessageChanged handler
It's no longer necessary and calls a method that doesn't exist anymore.
2021-06-15 09:59:40 +02:00
JC Brand
68f0be996f Let chats be closed by calling close on the models
Instead of on the views/components.

We still have `close` methods on the components, but they are just
event handlers and not external API methods to be called by other code.
Instead `close` should be called on the model.
2021-06-15 09:59:40 +02:00
JC Brand
825e2643ae Use flex-direction: column-reverse
On the `<converse-chat-content>` element. This removes the need for all
the manual scrolling.

Firefox finally supports this feature. Unfortunately Firefox ESR doesn't
yet, but I can't wait anymore.
2021-06-07 19:26:16 +02:00
JC Brand
90dff612c7 Re-initialize chat components when jid attribute changes 2021-06-07 12:53:35 +02:00
JC Brand
e3612e8c62 Turn the chats into Lit components
Previously they were of type ElementView from @converse/skeletor

The ElementView component is merely a helper to allow us to eventually
migrate everything to Lit
2021-06-04 15:22:52 +02:00
JC Brand
f3efbba26c Create converse-message-form component
More work on making bottom panel sub-components declarative

- Handle auto-completion in the converse-muc-message-form element
- Make message limit indicator a component
- Rename template
2021-06-04 12:53:03 +02:00
JC Brand
58d96c8594 Use intersection observer to remember scrolling position 2021-06-03 18:24:55 +02:00
JC Brand
fe3e63d8c5 Declarative scrolling and rendering new messages indicator
- Increment `num_unread` when new messages appear while scrolled up
- Set scrolling state in model code (as opposed to view)
2021-06-03 14:16:03 +02:00
JC Brand
0756af2b30 Refactor chat close methods
- Remove the shared base-class method.
- Trigger `chatBoxClosed` on the model
- Send CSN from the model, not the view
2021-06-02 17:55:52 +02:00
JC Brand
06f03fc884 MUC: Store disconnection data on the session 2021-05-13 15:45:12 +02:00
JC Brand
18e3b618b4 Some light chat views refactoring
- Move `showModeratorToolsModal` method from view to utils
- Move `getNicknameRequiredTemplate` method from view to utils
- Move common `close` code to base class
2021-05-07 11:23:52 +02:00
Shaun Wu
9ea8653ef7 Upgrade to Webpack 3
Had to make various other changes due to incompatibilities.

- Use the new `lit` package instead of `lit-html` or `lit-element`
- Drop `haunted` since it breaks the rules by specifying `type: module`
  but then doesn't import with file extensions
- Use Sass Dart instead of node-sass (fixes #2445)
- Upgrade Karma
2021-04-30 13:50:50 +02:00
JC Brand
b2f09f64c3 Use API to get room 2021-04-19 15:23:58 +02:00
JC Brand
383f5c1d60 Extract affiliation-related methods out of the ChatRoom model
and put them together in a utils file
2021-04-14 10:44:31 +02:00
JC Brand
548021b556 Only add view to chatboxviews after this.model has been set
Otherwise race-conditions arise where `this.model` is undefined
2021-04-08 10:17:26 +02:00
JC Brand
e7ddd07d56 Remove unused method 2021-03-31 14:27:44 +02:00
JC Brand
ccd60f76c3 Cleanup
- Move top-level functinos to utils files
- Get rid of unused/obsolete overrides
- Only import components there where they're used
- Bump version in package.json
2021-03-26 10:58:51 +01:00
JC Brand
224336e232 Remove last backbone-like declarative event handler from the MUC view 2021-03-17 12:28:16 +01:00
JC Brand
8f21b020b1 Move method to view unread messages to relevant component 2021-03-17 11:20:13 +01:00
JC Brand
d8daedea0d Render the MUC view component declaratively 2021-03-15 12:34:56 +01:00
JC Brand
2dbe50fc97 Refactor converse-muc-sidebar
- To only take the MUC JID as attribute
- To be responsible for closing itself
2021-03-11 11:34:52 +01:00
JC Brand
349b6d616d Move functions for resizing the MUC sidebar to converse-muc-chatarea 2021-03-11 11:22:46 +01:00
JC Brand
4ca30c4b93 Create converse-muc-chatarea component 2021-03-11 10:26:09 +01:00
JC Brand
698ad90c43 Move insertIntoTextarea methods from view to bottom panel component
That way we further decouple the various components and make it easier
to use them indepenent of one another.
2021-03-04 15:53:04 +01:00
JC Brand
d335a11119 Move more muc templates to plugin folder and use dashes 2021-02-24 09:51:37 +01:00
JC Brand
a8a2bb4681 Componentize the chat headings 2021-02-12 14:32:55 +01:00
JC Brand
906fa93812 MUC: combine two methods doing roughly the same thing 2021-02-12 14:32:55 +01:00
JC Brand
9ce4092a7c Turn the bottom panel into a custom element 2021-02-12 14:32:55 +01:00
JC Brand
94bc087f50 Move MUC templates to the plugin folder 2021-02-11 20:25:20 +01:00
JC Brand
45e0ba7f9b Use this.listenTo instead of api.listen.on in components
So that event handlers are automatically deregistered when the component is dismounted.
2021-02-10 11:44:04 +01:00
JC Brand
78fb5935c7 Handle scrolling down in converse-chat-content component 2021-02-09 18:20:52 +01:00
JC Brand
95c14e5a26 Don't pass chatview object to converse-chat-content
and any child components.

This makes it easier to use these components independently of one
another and the overarching view.
2021-02-09 16:40:00 +01:00
JC Brand
f81292e955 Bugfix in window state change handler 2021-02-09 15:48:21 +01:00
JC Brand
790caf9f5a Render converse-chat-content declaratively 2021-02-09 15:48:21 +01:00
JC Brand
05c00c5e1c Call minimize on the model
Fix minimizing by listening to change event

Fixes around showing/hiding and minimizing/maximizing

Don't trigger a `show` event on the model to show a chat, instead rely
on the `hidden` attribute which causes a rerender and will show/hide
chats.
2021-02-09 15:48:21 +01:00
JC Brand
1949356ede Work on turning chat views into custom elements
The eventual goal is to avoid UI-related stanza processing if the relevant chats
aren't in the DOM.

With the current architecture, chatboxes are created (and the stanzas
related to them processed) even if `#conversejs` isn't in the DOM.

* Initial work on making controlbox an element
* Create a shared base class
* Ceate ChatBoxViews proxy
* Update sass now that certain classes are moved to converse-chats element
2021-02-09 15:48:21 +01:00
JC Brand
5feaab9a95 MUC: Add test for showing cached messages before entering 2021-02-02 15:12:31 +01:00
JC Brand
4349b016eb MUC: Only clear messages when MUC is left intentionally
by the user, and not as part of cleanup during logout or when leaving
automatically in order to receive XEP-0437 activity indicators.
2020-12-17 14:00:18 +01:00
JC Brand
2121766623 More RAI improvements
- Add test for incoming RAI message
- Only enable RAI if the user is affilated in MUC being left
- Handle error presence indicating a resouce-constraint
- Don't unregister stanza handlers in `leave`, since we still want to
  listen to RAI-related stanzas. Instead unregister upon the `destroy`
  event.
2020-12-17 13:04:24 +01:00
JC Brand
c457081597 WIP: Add support for XEP-437: Room Activity Indicators
- Send marker for last message before leaving and before subscribing to RAI
- clear cache of RAI-subscribed domains on reconnection
2020-12-14 13:11:24 +01:00
JC Brand
bb3f52d2f2 Move the autocomplete code into ./shared
And remove it as a plugin.
2020-12-10 11:17:57 +01:00
JC Brand
e8536ebc88 Move converse-muc-views plugin into own folder 2020-12-08 09:50:17 +01:00