Commit Graph

170 Commits

Author SHA1 Message Date
JC Brand
a9d1e5c235 Don't use forEach on nodeList objects (not supported by all browsers). 2017-08-08 15:32:53 +02:00
JC Brand
0a47f60f94 Emit new event `afterMessagesFetched` 2017-07-21 15:09:50 +02:00
JC Brand
e4ebcc8f71 emoji: various css and html changes to improve ui/ux in converse and inverse 2017-07-16 15:04:54 +02:00
JC Brand
ffdd4e25f3 emoji: remember category and skin tone selection 2017-07-16 14:12:17 +02:00
JC Brand
8c4f6ffe03 emoji: Listen for clicks on a larger surface area 2017-07-16 13:41:01 +02:00
JC Brand
e3d2abf0ec emoji: Make sure emojis are also rendered for ascii emoticons 2017-07-16 12:50:59 +02:00
JC Brand
49f26d8e49 emoji: Allow the assets path of Emojione to be overridden 2017-07-16 12:30:40 +02:00
JC Brand
f8c6467feb emoji: Show only one skin-tone at a time (including the "neutral" one) 2017-07-16 12:29:09 +02:00
JC Brand
3ebe41384d emoji: Remember scroll position when rerendering the emoji picker 2017-07-16 12:29:09 +02:00
JC Brand
9a5f2fce61 emoji: Add a skin-tone picker to the emoji toolbar 2017-07-16 12:29:09 +02:00
JC Brand
12510a9689 emoji: Fix rendering of emojione images 2017-07-16 12:29:05 +02:00
JC Brand
972c31be1d emoji: Allow the option of using emojione (now that we sanitize) 2017-07-16 12:29:02 +02:00
JC Brand
284e884766 Add js-xss and use it to sanitize message HTML 2017-07-15 19:15:48 +02:00
JC Brand
f69e39dc8b Reuse code for submitting a message 2017-07-15 15:58:11 +02:00
JC Brand
cf1e8f2921 Fix failing test for emoji picker 2017-07-15 15:16:38 +02:00
JC Brand
4ea50de927 Use emoji instead of emoticon 2017-07-15 15:14:47 +02:00
JC Brand
b2a118ca9e Refactor slide methods in utils and use them for toolbar menus 2017-07-15 11:03:22 +02:00
JC Brand
ce2548c838 Remove the visible_toolbar_buttons.emoticons config option
in favor of `visible_toolbar_buttons.emoji`.
2017-07-15 08:17:41 +02:00
JC Brand
67578c9747 Merge branch 'master' into emoji 2017-07-15 07:16:37 +02:00
JC Brand
6ef0536e31 Some work on using es6 promises 2017-07-10 21:14:48 +02:00
JC Brand
9a9eae3fcf Use esnext to auto-generate es2015 syntax 2017-07-10 17:46:22 +02:00
JC Brand
40e7ee1ae6 Initial stab at using ES2015
Mostly replaced ``var`` with ``let`` and ``const``.
Also added a few arrow functions.
2017-07-10 12:49:20 +02:00
JC Brand
5ab1693136 logging: Add deprecation warning for updateSettings
and also use the Strophe.LogLevel levels for logging in general.
2017-07-05 11:33:55 +02:00
JC Brand
f81a94baf1 Move updateSettings to the private API.
Also add an API method for exposing new promises.

Update the plugin and API documentation, specifically concerning the above
changes.
2017-07-05 11:03:13 +02:00
JC Brand
4e467044d3 Some usability fixes around the toolbar and emojis 2017-06-24 11:34:01 +02:00
JC Brand
70f56b31f4 Merge branch 'master' into emoji 2017-06-24 11:04:19 +02:00
JC Brand
36e078c9f6 utils: Rename saveWithFallback to safeSave 2017-06-23 20:17:58 +02:00
JC Brand
3e8e770517 chatview: use utils.isPersistableModel 2017-06-23 18:19:20 +02:00
JC Brand
02e5921415 Fix problem of stuck/hanging tests on TravisCI 2017-06-19 15:05:22 +02:00
JC Brand
10ae9a5ea4 Remove the ability to use emojione for rendering emoji
Creates an XSS opening.
2017-06-17 01:01:52 +02:00
JC Brand
ca53a8d8ef Add support for Emojis 2017-06-17 01:01:52 +02:00
JC Brand
076af0970f Make spinner into a template 2017-06-14 19:43:02 +02:00
JC Brand
e1dace59ae Bugfix. Don't scroll down on archived messages
when already scrolled up.
2017-06-14 19:43:02 +02:00
JC Brand
0d22f5c33c Bugfix. Make sure to only append after a single message. 2017-06-14 19:43:02 +02:00
JC Brand
fcbeff4c72 Better check to know whether we can save the model 2017-06-06 22:12:54 +02:00
JC Brand
4f94a1f193 Refactor code that increments unread messages counter
Removed the "fetching_messages" hack.
2017-05-16 11:18:58 +02:00
JC Brand
c5383ac22f chatview: trigger 'add' event when fetching messages
Otherwise they don't appear when reloading the page.

I'm not completely happy with the resulting workaround to avoid that messages
restored from sessionStorage increment the unread messages counter, but it'll
have to do for now.
2017-05-15 18:37:54 +02:00
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
4b46ec3f8c #591 Unread message counter is reset when the chatbox is closed (#867)
* chatview: disable handling onMessageAdded when fetching messages during initialization

* update CHANGES.md
2017-05-01 13:05:58 +02:00
JC Brand
f3d29e016e Show unread messages counter next to roster contacts 2017-04-24 15:57:22 +02:00
JC Brand
0bab19fafd Render help messages via templates. 2017-04-21 18:35:34 +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
1a40b7aefb TypeError: converse.log is not a function 2017-04-20 08:55:51 +02:00
JC Brand
1e100a67e3 Catch error when destroying 2017-04-19 15:40:27 +02:00
JC Brand
de2f33f333 Send button must be translateable and should type "submit" 2017-04-11 07:32:17 +00:00
JC Brand
9ecb3e227f Bugfix. Better check to see if spinner is already active 2017-04-04 11:21:25 +00:00
JC Brand
09251f32c8 Remove the english translation files. No need for them. 2017-03-31 02:26:35 +00:00
JC Brand
a4be25e05c Fix time format to show seconds instead of month 2017-03-31 02:01:53 +00:00
Anshul Singhal
99647438ac Adds the send button at bottom of chatbox (#796)
Fixes #796 New config option: `show_send_button`

* Adds show_send_button setting to docs

* Change log updated

* Improves send button CSS, style fixes and documentation corrections

* Adds missing setting in rendering template for headlines
2017-03-30 12:40:17 +02:00
Soumit Bose
c976f3f079 Fixed typing status for typing from different devices (#802) 2017-03-16 16:28:59 +01:00
Soumit Bose
2c5ecd7120 Make messages' time format configurable (#797)
Fixes #675 

* Made time format configurable

* Made changes to values of time_format

* Removed user restrictions on time format

* Added documentation for time-format config

* Edited changes.md

* Edited config doc

* Modified time-format explanation

* Added link to moment

* Added test to check rendered time

* Edited CHANGES and removeunncessary lines from time format checking spec

* Removed unncessary spaces
2017-03-12 11:32:38 +01:00
JC Brand
f24e7c0905 Remove scrollDownMessageHeight. Fix failing test 2017-03-03 15:12:48 +01:00
JC Brand
0bc0072fea chatview: Mark whether scrolling was automatic
so that we don't confuse it with the case where it was manual.
2017-03-03 14:55:03 +01:00
JC Brand
2c88545b28 Fix edge case with /me messages. Show in italics. 2017-02-28 07:58:17 +00:00
JC Brand
21fbb7b7ac Fix failing test by making sure chatroom gets destroyed 2017-02-27 21:21:38 +00:00
JC Brand
08fc0823de More scrolling improvements 2017-02-25 22:26:54 +00:00
JC Brand
2998ef818a Chat rooms weren't being scrolled down after page reload 2017-02-25 07:48:28 +00: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
f83043e5ab Fix reference to missing parameter. 2017-02-17 22:07:11 +01:00
JC Brand
65fa39dd81 Properly fix and test the /me command 2017-02-15 21:03:02 +00:00
JC Brand
a033899946 Fix leaky abstraction of MUC 2017-02-15 20:30:32 +00:00
JC Brand
70d385bc28 Use AMD-aware cryptojs from NPM. Update to 0.2.16 2017-02-15 10:02:15 +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
5f67797202 Fixes #749 2017-02-13 14:00:05 +00:00
JC Brand
63888dd454 Fix failing tests 2017-02-02 21:55:05 +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
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
8d69357b52 Debounce scrollDown 2017-02-02 16:06:49 +01:00
JC Brand
bcbeb8da6c Case-insensitive matching of moderation commands.
Also add `/subject` as alias to `/topic`
2017-02-02 14:56:56 +01:00
JC Brand
081f075aa9 Add eslint with lodash checking and apply its suggestions 2017-02-01 14:02:18 +01:00
JC Brand
7ad39cfdb9 Fetch the room information before opening the room. 2016-12-05 06:07:01 +00: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
02864fd175 Don't assume the parent is the top-level message element. 2016-11-02 13:42:20 +00:00
JC Brand
151a476084 Find more cases of children that should be find. 2016-11-02 13:38:42 +00:00
JC Brand
ed01081240 Use $.find instead of $.children
To allow for better template customization.
2016-11-02 13:33:20 +00:00
JC Brand
0d4993ef86 Merge branch 'master' of github.com:jcbrand/converse.js 2016-11-02 13:13:34 +00:00
JC Brand
ec9ed96568 Remove {{message}} interpolation.
It's not used and confuses people. Instead the message gets inserted via
`$.text`, to avoid injection attacks.
2016-11-02 11:10:07 +00:00
JC Brand
b6c88b92fd Don't listen exclusively for keypress in a textarea
Could be a different element as well.
2016-10-28 13:32:35 +00:00
JC Brand
6f1ac50893 Move leaky MUC abstractions out of converse-chatview.js
In the process also updated `updateSettings` to allow merging.
2016-10-27 14:56:31 +02:00
JC Brand
01c3a50cc2 Add code to generically and recursively update user settings.
Also moved chatview specific settings.
2016-10-26 14:14:49 +02:00
JC Brand
2d6d4df1f1 Use requestAnimationFrame instead of setTimeout
For better performance.
2016-10-17 13:16:41 +02:00
JC Brand
862af642ff Move avatar markup to a template and make size configurable 2016-10-14 23:42:54 +02:00
JC Brand
90d1071df0 Load templates in the respective plugins 2016-09-23 12:35:01 +02:00
JC Brand
600f98afcb Attempt to mitigate against performance degrading attacks. 2016-09-12 13:13:57 +02:00
JC Brand
89e5bd7c54 Update to pluggable.js 0.0.2 2016-08-31 10:39:11 +00:00
JC Brand
31f0e069ab Decided to use 30secs instead of 20. 2016-08-18 10:19:43 +00:00
JC Brand
4d28ae3c11 Tweak timeouts regarding status notifications.
Send a <paused/> notification after 10 seconds, instead of 20.
Auto-remove a typing notification in the chat box after 20 secs instead of 10.

This is to avoid situations where the status notification gets
auto-removed while the typer keeps on typing without long enough breaks in
between for <pause/> states, thereby causing the recipient to not be aware that
they're still typing.
2016-08-18 09:28:48 +00:00
JC Brand
6ac4f2601d Fixes #677 Chatbox does not open after close
Problem was a race condition between hide and show methods.
Solution was to not hide the chat box during the initialize method.
2016-08-12 20:38:39 +00:00
JC Brand
fe46f2ee77 Chat state notifications are now also sent out from chat rooms. 2016-08-12 12:52:33 +00:00
JC Brand
a1e24c95c9 Add nickname to chat message when clicking on room occupant.
Allows you to easily mention someone in your message.
2016-07-26 09:31:23 +00:00
JC Brand
d6ef4fc5ca Add method hook for adding more attrs to send to the message template 2016-07-01 14:27:26 +02:00
JC Brand
be122af3ed Add tests for rendering of error messages. 2016-06-23 08:56:15 +02:00
JC Brand
e06a34a905 Some initial work on show messages with type "error" 2016-06-22 18:47:07 +02:00
JC Brand
9e8674ef55 Rename ChatBoxView.insertIntoPage to ChatBoxView.insertIntoDOM
to ensure naming consistency, we have the same method on `ChatRoomView`.
2016-06-22 15:54:22 +02:00
JC Brand
b90ad3aa6e Don't check visibility before hiding.
In some cases the element is not visible,but we want to set 'display: None'
regardless, for example in cases where you only want one single chat of
multiple to be visible at any one time, while hiding it behind a sidebar.
2016-06-17 17:43:09 +02:00
JC Brand
705c043852 Fixes concerning tab visibility 2016-06-17 09:30:47 +00:00
JC Brand
249fb0fec5 Don't increment messages counter for MAM messages. 2016-06-16 10:39:08 +02: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