Internet explorer does not support the "ChildNode.remove()" method, so
the node needs to be removed through its parent (which is also supported
by the rest of browsers).
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Some operations on the virtual list, like reloading it, updating the
visible elements or scrolling to certain element, require that the
container is visible. Before those operations messed with the state of
the virtual list when called with a hidden container, but now they are
simply ignored.
Adding new elements is still possible while the virtual list is hidden,
but "reload()" must be explicitly called once the container is visible
again for the added elements to be loaded. Like in a regular "reload()",
if the width has not changed there is no need to reload all the
elements; only those that were added while the container was hidden will
be added in that case.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
In some cases there is no event to listen to for a change that affects
the chat view, so it is not possible to explicitly save the scroll
position when that change happens. Now the virtual list keeps track of
the last known scroll position, and the chat view allows restoring to an
arbitrary scroll position besides the saved one. This makes possible,
for example, to restore to the last scroll position before the chat view
was hidden (as long as it is possible to detect that the chat view is
shown again, even if it was not possible to detect that it was hidden).
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Rooms associated to a file are persistent rooms, but they do not have
any persistent participants, not even an owner (participants join and
leave in each session). Thus these rooms should not be removed even if
they are empty.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The rooms associated to a file are public rooms, so anyone could join
them provided she knows its token. Thus, now it is enforced that only
participants with direct access to the file can join the room.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
When setting a room in the internal signaling a poller is started that
synchronizes the room data periodically; that poller should be stopped
when the room is left.
Note, however, that the poller should not be stopped when leaving the
current room if it was initialized for a room collection instead.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The CSS rules specific to the autocomplete list for mentions in the chat
view were applied to any other autocomplete list. In the main Talk UI
this is not a problem, as that is the only autocomplete list, but it
could be when using the Talk chat view in other components, like the
Files app.
The autocomplete list is created as a child of the body element itself,
so to limit the CSS rules only to the chat view it is not possible to
just prepend "#chatView" to the rules. Instead, now each item has a CSS
class (hopefully :-) ) unique to the chat view.
Unfortunately, it does not seem to be possible to ensure that the rules
defined in "autocomplete.scss" will not collide/override rules defined
in other apps, as customizing the CSS classes in ".atwho-view" so the
rules are applied only when it belongs to the chat view does not seem to
be possible (except, maybe, with some hacks).
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
"CommentsTabView" is a legacy name from the original import of the code
from the Comments app; besides being a better fit, "ChatView" also
ensures that the CSS rules will not conflict with those from the
Comments app when the Talk UI is used in the Files app.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
In Nextcloud 15 the default Content Security Policy disallows unsafe
eval expressions, so Handlebars templates can no longer be compiled at
runtime.
For the time being that default Content Security Policy was lifted for
Talk so "Handlebars.compile" could still be used. However, this only
applies to Talk itself; when using Talk components in other apps they
must abide to the Content Security Policy of those apps. As CallButton
is going to be used in the Files app it has been moved to precompiled
Handlebars templates (which are still compatible with the regular Talk
UI).
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
In Nextcloud 15 the default Content Security Policy disallows unsafe
eval expressions, so Handlebars templates can no longer be compiled at
runtime.
For the time being that default Content Security Policy was lifted for
Talk so "Handlebars.compile" could still be used. However, this only
applies to Talk itself; when using Talk components in other apps they
must abide to the Content Security Policy of those apps. As the
RichObjectStringParser is going to be used in the Files app it has been
moved to precompiled Handlebars templates (which are still compatible
with the regular Talk UI).
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Although the RichObjectStringParser is not a view as such its
functionality is closedly tied to views, so the views folder is a better
place to live in.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
In Nextcloud 15 the default Content Security Policy disallows unsafe
eval expressions, so Handlebars templates can no longer be compiled at
runtime.
For the time being that default Content Security Policy was lifted for
Talk so "Handlebars.compile" could still be used. However, this only
applies to Talk itself; when using Talk components in other apps they
must abide to the Content Security Policy of those apps. As ChatView is
going to be used in the Files app it has been moved to precompiled
Handlebars templates (which are still compatible with the regular Talk
UI).
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
"guest.scss" in server sets the "width" and "margin-top" properties of
".wrapper" elements to position the main content of the public share
authentication page. However, as the selector used in the rule is too
broad it is also applied to the internal wrapper of the virtual list, so
the properties need to be reset in that case.
Besides that, the padding of the message list is ignored when using the
virtual list, so that padding needs to be applied through the "left" and
"right" properties of the internal wrapper of the virtual list.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Now if the source templates were modified but their compiled versions
were not updated the Drone job will fail.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>