Client now sends setclientpart only when it wants to change
the current part number, but not when it is updating
the current part when it receives setpart from the server.
When switching parts (either by the keyboard or mouse)
LoKit sends a notification of the current part and
invalidates tiles. As a reaction to that the client
cancels its tiles and requests new tiles for the
new part. In addition, it sends setclientpart
back with the new part number.
This works fine, except when the client switches
between parts quickly (as when randomly pressing
page-up and page-down quickly in impress), by
the time LoKit receives the second request the
client would have reacted to switching the first
by sending setclientpart for the first. This
will result in a resonance back and forth ad
infinitum (or when the client goes inactive).
The client shouldn't echo back the part number
which the LoKit has told it (it should only send it
to explicitly set it itself). But the server should
be smart enough to remove duplicate setpart
notifications from the client queue. This reduces
the chances of an ocillation like that to happen.
Change-Id: Ia8a1bb25e427ab910129340ce599e3743983463b
Reviewed-on: https://gerrit.libreoffice.org/36598
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Retry up to 10 times with a delay of 1 second in between.
Also, show the user a message (after first reconnection
fails) that the document is unloading to try again
(but of course we auto-retry anyway).
Change-Id: I616d7643f146a6d5b7ccda7bb2aa567e3a9efe47
Reviewed-on: https://gerrit.libreoffice.org/36596
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
This box-shadow interferes with direct comment children and breaks the
root-children comment block UI. Lets remove the shadow for now.
Change-Id: Idda659bcfca76093c148400b2ab311bc39861e84
Change the layouting algorithm to check for comment relationship and set
the layout bounds accordingly.
Change-Id: I67cc32092d8cf2c1bbc0d677258387739bfc638e
And few other improvemnts inluding:
* use svg instead of png for the menu
* add title (caption) for the Accept / Reject change.
Change-Id: Ic7e781d7e93d319f766b387a8eddfa70c1920760
Some older browsers don't have meta tag support for CSP. Lets put all of
the CSP in response headers to be compatible with oldies.
Change-Id: I7f0d7c294e492b3c69ebea6fbd820d6558b9c3b3
This is actually not a displaced cursor, but displaced tiles map pane.
It happens when the user refreshes the the document page and
before the document finishes loading, switches to some other tab and
then get back to the document when the document load finishes. In such
circumstances, due to browsers not emitting the 'resize' event (probably
because it didn't have the focus when the map loaded) we return
incorrect/unexpected map center. Because 'resize' event sets this._initialCenter to
null, so map.getCenter() never returns this._initialCenter and instead
return this.layerPointToLatLng(this._getCenterLayerPoint()) which seems
to be the correct thing to return here.
The reason that the displaced cursor is not
observed when user doesn't switch to other tabs is because of the
browsers emitting the 'resize' event before we set the map transforms.
Nevertheless, in some circumstances it is quite possible that this
event, 'resize', is processed after we set the transforms even though
user hasn't switched the tabs but probability of this is very less which
justifies this bug's hard-to-reproduce nature when user doesn't change
the tabs.
Instead of making sure that 'resize' event is triggered before we set
the transforms, removing this block of code that returns unexpected
return value (which we never seem to use anywhere anyhow) seems more
sensible thing to do.
Change-Id: Iff532a902e6100be7f39c204cbf2f28f1a7f6a49
Reviewed-on: https://gerrit.libreoffice.org/36458
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
Don't show the "This is embarrassing" popup before
first trying to reconnect at least once.
In most cases reconnection is successful transparently.
However, if necessary, we could add some delay to
reconnecting to give the server time to recover,
but without good reason for this complication it's
unwarranted. Server-recycling reconnections have
such a delay.
Change-Id: Ic8e32c451429a24f8362431672057145a492a23f
Reviewed-on: https://gerrit.libreoffice.org/36328
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
We need to be able to create iframes sometimes with same origin as ours,
eg: when loading the 'loading' page during slideshow or downloading the
file (in different formats). The 'blob:' is only used for printing
purposes.
Change-Id: I93666ee45e707997969e151af5142efeeca0d177
Unfortunately, our dependencies (various plugins etc.) still make heavy
use of inline event handlers, so not possible get rid of all of them in
our bundled js. This is the reason we still have to use 'unsafe-inline'
in our CSP.
Change-Id: I519dec0834606ab3c56e090c882a93160ddcb52c
LO core doesn't output any change tracking information for spreadsheets
which results in sending an empty 'commandvalues: ' message to
loleaflet. While the actual fix for it would go in LO core, lets handle
this empty case for now in loleaflet, so that we don't throw any runtime
JS exceptions.
Change-Id: Id2b66b8e7f1c87b074d3e72168e0ca3c3c0d345d
This reverts commit 0c5efd80ad.
Change tracking options are already available in the menubar, lets bin
them from the toolbar
Change-Id: Ie340957eb1e615429a54be9cb0639db146e6d7a1
The row parameter type was an unsigned short.
Change-Id: I81bfd5211ebc6c380014d0cd2a2b1d3b8c252749
Reviewed-on: https://gerrit.libreoffice.org/36086
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
For big spreadsheet (> 100k rows) when the doc width is extended the
horizontal scroll-bar is not updated, causing to not be able toscroll
the document up to the whole width.
This was due to the fact that the old doc height was obtained through
L.DomUtil.getStyle, but the precision of the retrieved value is 6
digits only.
Change-Id: I430b08dd4c864cec09b62c61420414ad306da225
If user wants to take something out of the document, he/she needs to
make use of keyboard shortcuts to do the same.
Change-Id: Id8237e0bfcb311d1a1465645042f160f7e1d8fb6
We always want internal document copy/paste to work and always want to
do a richtext copy/paste whenever possible.
Change-Id: I54705293bd34bc284ceff815ebdf556c7ca1587c
Container will automatically adjust its width as according to the width
of the containing child table or other elements.
Change-Id: I0a18dc5263d05eb8c67d342d4acf5f7c4bae128c
To instruct the loleaflet iframe to not dim the document, it needs to
send the message in following format :
{
MessageId: 'Set_Settings',
SendTime: 1329014075000,
Values: {
AlwaysActive: true
}
}
Similarly, set AlwaysActive to false to active dimming the screen again.
Change-Id: Icb5d615268e4da2c3ed2f22df8c0f3e52f370a70
Use the redline descriptions, such as, "Insert 'text'" etc. as captions
in change tracking sidebar objects.
Change-Id: I6c99f3b45725620b8888da77b0b8b4ebcdda10d2
... as one can now easily comment on the change using the new popped up
sidebar object that gets added to DOM when a new redline is added.
Change-Id: Icb048672b0b3fe2a0490b64e05539095ffcb3715
Impress does not send anchor position property of the annotation object, so tweak the code
to set the cursor position
Change-Id: I12e365ed600a53b5a2c1bcb0ef52dec078a258f2
Modify callback is emitted even when the content changes, it doesn't
just signify a change in anchor position
Change-Id: I287efc6cd5f170a68ed73b303c50d55e6bfd45e8
after 1 sec, if it wasn't removed by a tile update.
From commit bc19f90dd4
(Don't send a tile that hasn't changed even if client asks for it),
blue color of the requested tiles isn't removed completely.
Change-Id: I0f4c152f61c2b0f70f1b7c23bd63d3e0bc80ec74
There is still one known problem - for some reason, when a spreasheet is
opened in readonly mode, the ViewRowColumnHeader request sent to server
has height=0 leading to server sending no rows information back to client.
Though the problem gets resolved when one scrolls the spreadsheet
window, but something to fix.
Change-Id: I2aefafd1a93c1bc5a9ad8581edb83018ec9a3f07
We no longer tell the clinet "This is embarrassing..."
when we disconnect and unload an idle document. Instead,
the client UI remains greyed out so the user can resume
as if it was inactive (and reload the document in this case).
Also, we now always send the "close: " message prior
to shutting down a client websocket. This is more
reasonable and consistent when we intentionally disconnect,
so clients can rely on it to signal intent and give reason.
Otherwise, a disconnection without this application-level
message should be unexpected and is therefore reasonable
to show the "This is embarrassing..." message.
Change-Id: Ic7439bcc9267be155586ccd5d122e9fe60225516
For now we assume configurations of more than 50
documents are not for dev or demo. This is because
loading 50 documents will require a reasonably
sized server and is beyond the default of 10.
Change-Id: I099206d7d35a88102c1834ea9015b85810a3f190
Reviewed-on: https://gerrit.libreoffice.org/33670
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
... instead of using HorizontalAlignment command with different
parameters to do a cell alignment. The state change events for
that would add further complexity here. Lets keep using separate
UNO commands for alignment.
Additonally, change a typo, 'alignblock' -> 'justifypara' when
hiding the toolbar buttons on 'doclayerinit' event - we don't
want to show justify alignment button for spreadsheets.
Change-Id: Iaf7406af9e3172b3fa9d41b3dac6d1e2677f0db8
Don't give extra pixels to scrollbars and reduce the document
area that is visible on the screen. Instead put these scrollbars
on top of the content and show them only when user hovers over
the scrollbar.
Change-Id: I7f7b34d0efde24bfad04324f5dfe3e3e35c752fc
Open them from the right edge of the popup to the left and wrap
them inside wrappers to make it possible.
Change-Id: Ib97fe6a3e306c8cc8612304b53ec42607234d5a7
Easy solution is move the popup to open from its right edge
instead of the left.
This also overrides overflow: hidden from w2ui-toolbar class,
that doesn't seem to have any side-effect, hopefully there really
isn't.
Change-Id: Iab258cf7e3473b178aa9acdb746b51a5ca582b46
Reduce it to 1000, its sufficient and also allow inactive overlay
to come over the popup, not under it as was before this commit.
Change-Id: If078dc929027dfb938000c5a0135c83704da7d6f
Also do not segfault in the event.
Change-Id: I80c4c5c0d1d5f1a4cde9a6a3458f69a3df9dc647
Reviewed-on: https://gerrit.libreoffice.org/33140
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
- Change from textarea to input (type="text") to prevent Firefox
to auto-capitalize.
- Clean the text input content after each word so that the soft
keyboard spellcheck suggestions are correct and that backspace
doesn't delete long IME suggestions before it has effect.
- Workaround on Chrome Android 'space' and applying spell-check
corrections.
This seems to be superfluous. w2ui library automatically set the
width of the toolbar overriding this value always.
Change-Id: Ia87018533f99769ef1dc48463ac58d32cbf40d9d
There was a race condition here between our toolbar doing its
stuff and loolwsd sending us websocket messages, noticeable on
slow networks.
Change-Id: I5ae174e94561dd427d22389e443c80b2a6be4ec4
Primary reason we are bringing it back is because in mobile mode
userlist icon goes to the right most edge of the screen which
leads to userlist popup not being shown (which seems to be the
bug in library we are using)
Change-Id: Ie5b93c41f54ffeeb8615f90fa0e71c74de5ed92c
I started changing the cases for all the parameters to use similar
code as for the 'hash=' one: Check the parameter name with
startsWith() instead of fragile substring() function call where the
length parameter must match the length of a string literal that the
substring() result is compared to.
But then I got bored and gave up. It would be even better to not have
to tediously check for all defined parameter names, but instead just
parse each parameter using the same code that sets the property whose
name we found. Except that we have special cases where the parameter
name in the protocol doesn't match our coresponding property name, and
those that consist of a list of comma-separated values.
Maybe we indeed should just switch to JSON (or some binary
representation of JSON or somesuch).
Change-Id: Ibcdb26d7228b75f6f23c186f0b17cb46a12f3cec
The server tells the client the hash of each tile it sends (calculated
from the contents of the tile, not its PNG encoding). When the client
asks for a tile to be refreshed, it tells the server what the hash of
the existing tile is. If the server notices that the tile contents
hasn't actually changed, it doesn't PNG encode it and doesn't send it
to the client.
The intent is that this will reduce load on the server and also avoid
unnecessary tile traffic.
Change-Id: Ia06ca68655ea984ed4319f24f4470afda322eccf
Reduce userlist text to now only show the number of users in
mobile mode instead of 'x users' string. Drop the 'Document
saved' string notification.
Change-Id: Ife20a5fcea01301601912c734dae6c3d6504c4f5
Using !important always is not a good idea. You can't override an
!important with another !important and we have started to face
such situations now where we want to adjust element's alignment
based on media-screen width. Instead lets fix the specificity to
make this work.
.parts-preview-document or .spreadsheet-document would be
0-0-1-0. Use #document-container.parts-preview-document to
increase its specificity to 0-1-1-0 so that we can do without the
!important flag and use !important flag for media-screen blocks.
Change-Id: I1d15df492cdc7cd1cd09c3b43c8ea84295a07205
Slide sorter and presentation toolbar are now contained in a
presentation-controls-wrapper and alignment values are now
factored out and only present in the container now.
Also, position the presentation-toolbar absolutely outside of
container so that slidesorter scrollbar doesn't go behind the
toolbar hindering some view of the slide thumbnails.
This would also make the job of hiding/showing the whole control
easier.
Change-Id: I080e854906ef0635aba02cfeb687bf87463ef756
Most of these can easily be accessed from the menu bar. Lets keep
only most commonly used and simple toolbar items here.
Change-Id: If9ad379c6491b907a980e0ef5b4a46a60266fafe
We can now directly use sm-simple.css from node_modules in its
pristine form and then use custom css rules to override to make
it look like LO menu bar instead of directly making changes in
sm-simple.css
Change-Id: I0773ca27fdf549d5c7df0bc781dfc019225d7cb6
Shortcircuiting when the part doesn't match is
much faster than intersecting rects first.
Change-Id: I9038eb5cafd141e75e8b18a5308b30216e4c9653
Reviewed-on: https://gerrit.libreoffice.org/32918
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
We assume that id of the toolbar item is lowercase(unocommand),
so lets keep it consistent too for alignment buttons.
This also makes alignment buttons toggle except for spreadsheet
where alignment of cell text happens via a different uno command,
HorizontalAlignment.
Change-Id: Ibacf06bd99435cd24b27c7870173a2519b167af1
Reviewed-on: https://gerrit.libreoffice.org/32774
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
This are converted to 'cut', 'paste' events which are
automatically handled by us using uno commands, so avoid
double-handling them.
Change-Id: If97e9f4efabbb929e7a5dd87c1228ee6a0df9e61
Nothing adds any prefetch= parameter to a message anywhere any longer.
Presumably this went away in 5d6ab6e8dc.
Thus also the preFetch field is dead.
Change-Id: Ide586a702277e77c9b7bf37edd01def4aaf3ace1
Automatically initialize formatButtons internal object to
preclude the possibility of one forgetting to enter the id of the
button in formatButtons object.
Fix 'id' of default numbering/bullet button after which it is
correctly showing the state now.
Change-Id: I57247e1b0e6d462153a47d31a883ceb04ecff74b
Reviewed-on: https://gerrit.libreoffice.org/32101
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
It is insertannotation, not just annotation
Change-Id: I1bc01e87da963d0e07d670ffec261e33b45062d2
Reviewed-on: https://gerrit.libreoffice.org/32096
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
If we get a true/false, assume its enabled.
Change-Id: I364c7cd611481757b674877ed44ac6ee0f6b0e58
Reviewed-on: https://gerrit.libreoffice.org/32089
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
... as these are now printed only when compiled with
--enable-debug, so they shouldn't be polluting the release build.
Change-Id: I3169fb39cea298b001a4d576632a1634ff35e004
loleaflet_logging defaults to true with compiled with
--enable-debug otherwise false.
Browser will print additional debug info when this property is
set to true.
Change-Id: Id9fabf134bd8d19fa1a09ca8c0987df46d4f1a4c
After all, why would you have the console open unless when debugging
(even just following console.log() output), so it is
counter-productive to have the code behave differently in that case.
Change-Id: I2aa7cf095e249a4c87f920aa0f1911be76a348ca
(The greying-out without focus happens, as before, already after 30
seconds.)
Factor out the dimming code to a separate function _dim. When we have
focus, check once a minute if ten minutes has passed without user
activity. Keep track of when last user activity happened.
There is a bug left: When greyed-out while having focus, you need to
click on the background layer, not in the layer with the 'Inactive
document ...' text, to wake it up.
Change-Id: I19160a82f5de860fc609dad391b168acfba560ce
window.PointerEvent is available even on non-touch devices in
chrome and Edge (and maybe others too, firefox doesn't have it).
So it results in L.Browser.pointer resulting in true on Chrome,
Edge while false in firefox which leads to click event not
working on these browsers.
Fallout from a0036f24ba
Change-Id: I73b5824882e1cc1f87cdfbc9e7e31f22320367b1
MS Edge seems to be very problematic when one tries to load the
pdf blob into the print iframe and issue a print command to it.
Lets fallback to print prompt as we have in firefox
Change-Id: I97fc394d0053030231c524efb6bf808d32a9aa07
Removing this._printIframe may still cause leakage here as
this._printIframe is overwritten everytime user issues a print
command.
Change-Id: I06f45604940380b809bc262f07b9b6a8aa7d9a87
Top level make would now build loleaflet too if necessary.
Respect value of ENABLE_DEBUG and if present add debug-info to
generated js bundles too.
Add new rule, clean-local in loleaflet.
Change-Id: I3a9b727824f2877fc72719a8bfdeebed5448cb7d
This always takes ~2 seconds irrespective of whether node_modules
needs updating or not. Lets add appropriate dependencies and save
these precious 2 seconds.
Change-Id: Ided4ff334316c16521e5ea7a69d15736a1cc170f