In case of presentation we are getting an empty value in response
to .uno:CharFontName. While this looks like a bug in LOKit, no harm
in putting a check for empty values here.
In ES5 argument to Object.keys must be an object otherwise it
throws an exception.
Change-Id: I5c2f7963544fda55bab3f314f1b098b3c9e3bd0b
Currently, it does get fired, it seems, and vertical scrollbar
does get adjusted automatically according to new size, but
horizontal scrollbar doesn't for some reason/bug. Lets explicitly
tell the plugin to update on every resize we do.
Change-Id: I706228302cb43fb22cf54acfe1b990d3e66d5281
Text documents have a single coordinate system, so they
only render in part 0. For others, each page/slide/tab
is a part.
Change-Id: I3c61f4482e5bb535e41ea699147c8c258ca6fb93
Reviewed-on: https://gerrit.libreoffice.org/24850
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
'Standard', and 'Default' styles seem to containing same values
anyways. If we do not have 'Default', use 'Standard' ones.
Change-Id: I4402f78fb54c77a7cf6d9868210cb97a9e2c4580
Upon creating an .odp file from owncloud, 'Default' styles are
not created which leads to a js error as variable styles go
undefined later in the script.
Change-Id: I30caf980bd924e6329559b36b1f0a5fbe60ecc4b
... otherwise, shift + space combination would select the whole
row in calc even while editing. After this, row selection feature
using shift + space would only work while we are not editing,
that is, when text cursor is not visible.
Change-Id: I07ddf045d023487d70fa632edd7c173ed1df610d
And use these directly from debug/document/loleaflet.html instead
of CDN. Helpful for development when no internet connection.
License: MIT
Change-Id: I4d2086ffc9e9e646164c70481ae74e6c1f7a7062
Invalidation for spreadsheet and presentation
are part-sensitive. The handler will take
care of this distinction and construct the correct
invalidate command.
Also, set active flag before firing invalidation.
Change-Id: I9e897750e0768b54cc1521d47d69b5dbb1a36244
Reviewed-on: https://gerrit.libreoffice.org/24779
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
The handles imply (and indeed are designed for) changing the
selection by dragging them around. Viewers can't change the
selection, so no reason to give them the selection handles either.
Change-Id: Ifa793ac982fd48be877e7ed7709f70890d8de194
Reviewed-on: https://gerrit.libreoffice.org/24770
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
This message is already sent from CalcTilelayer.js.
Change-Id: I9f84d5f365dbfea38061e206d5d52e2201be22ed
Reviewed-on: https://gerrit.libreoffice.org/24769
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Make sure to sync both lokit and viewers as to which
part is being edited when a previously-viewer takes
editing.
Change-Id: Ia70f647a26029447bb4360633f79233fa9596059
Reviewed-on: https://gerrit.libreoffice.org/24768
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
This leads to row/column offsets because the document view would
ignore the scroll but row/col header would be scrolled.
Change-Id: Ieec25429dbf698e710ce1f9765c51756f2a75032
In case of spreadsheets, zooming in and then switching
the sheet to a new one will leave the new sheet in a situation
where panning would not be possible. This is because of incorrect
maximum bounds set on the map.
Further, this often leads to row/col offsets in spreadsheets
because document view is bound under these MaxBounds but row/col
are not.
Change-Id: I468d2fee5424e11c93a0a707fde96e687061fb89
We use 180x180 px as thumbnail size, and 2px border for selected
thumbnail on top of that which makes its 184x180.
.parts-preview needs to be expanded to 214px for
mCustomScrollbar to work properly without hiding any thumbnails
including borders. With all of this, we also need to shift
impress document offset to 214px from left to make all things fit
nicely.
Change-Id: I446918403cd43fe61f0ebfb358e6a2051014b28a
Hide the spreadsheet-toolbar by default, and only show when we
are confirmed that its a spreadsheet, instead of doing
vice-versa.
Change-Id: Iddaca0fb272dbe8dd8b6e73157eb4733762d8a8a
Use w2overlay instead of w2popup. The former adjusts itself in
the visible screen region and fixes, and does not introduce any
additional scrollbars for the lifetime of the popup message.
The w2overlay gets removed with mouse events. So instead of
'mousedown' events originally, use 'mouseup', so that there is no
succeeding mouse events to switch the overlay off.
Also point the overlay pointer towards the button, not the label.
Change-Id: Ic6c22fecc2e32075c27b6f4647373c28d2f635ae
On Windows, AltGr events are treated as Alt + Ctrl. Use the
'location' property to distinguish from plain Alt + Ctrl.
It is not present in 'keypress' event, so use
the previous invocation of Alt + Ctrl to detect whether AltGr was
used or not.
Change-Id: Id6b64b6fc0a5300ea5362880536d3b926eb0acce
Reviewed-on: https://gerrit.libreoffice.org/24400
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Reviewed-by: pranavk <pranavk@collabora.com>
Treating empty item as an object expects `id` attribute on which
toString method would be invoked. In case of object without `id`, it
would throw an error trying to call toString on undefined
attribute.
Change-Id: I44e591044487b0d236760cc79438ccfcf0f53846
Socket._onSocketClose is always called on error, and
it displays an error message already.
Change-Id: Ib8d740bbbf45d0d705abe8e2cb3b600b133c2979
Reviewed-on: https://gerrit.libreoffice.org/24351
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
We should also reconsider message queueing altogether.
If we lose connection we should not have any expectation
to recover at the same state when the document is shared.
In fact it could be dangerous to send those last messages
before losing connection, lest they modify a more
recent version of the document (after others' changes).
Change-Id: I9077c1db5fe1535f1fc85436580b10c751bac2ee
Reviewed-on: https://gerrit.libreoffice.org/24348
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
The invalidatetiles is normally a notification coming from
LOK and it signifies that the tiles in quesion need
rendering anew. Issuing this internally from the Kit
removes TileCache images unnecessarily.
Furthermore, since this message is always sent in response
useractive message, there is no need in issuing it from
WSD when loleaflet is perfectly capable of issuing it
itself (internally).
Change-Id: Ia97de6d803745dca3f6e73100f2d921dbbdf76f6
Reviewed-on: https://gerrit.libreoffice.org/24316
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Instead of asking for individual tiles, try to find rectangular areas in the
tile requests, and ask for the large rectangles using tilecombine, instead of
asking for individual tiles.
For some reason, text cursor gets stuck making it impossible to
type in the document. This only happens with firefox + owncloud.
Lets keep the editlock state separately in map, and do not yet
mix the permissions with editlock state.
Change-Id: If4193d08b7228cde510321ec5b4c892b8617d8a7
It is still possible to access them directly via loleaflet/dist/<something>,
but such use can lead to unexpected behaviour due to various caching in the
browsers etc.
It is incorrect to add the <div> elements with parent as w2ui
toolbar outside of onRefresh() method because toolbar can
refresh multiple times during its lifetime meaning that all such
added elements will be removed after first refresh breaking the
font/back color feedback javascript code.
Hence, this also fixes the font/back color feedback.
Change-Id: Iacd4f8a5c8ebb64e5bba5e7f05ceef8b77051534
Do not distinguish between normal shutdown or abnormal shutdown.
Also remove 'disconnect' frame to indicate normal shutdown.
Change-Id: I98fd9f5a219feb1097c57302dba14e08ad9bf143
Time increment is handled on client-side, server only sends the
elapsed time during first page-load.
Change-Id: I73e98fd95ca9f391b625a8dcfc7e3490878c6a40
Also delete the admin-src from there. It is not supposed to be
under git. This is generated during make from all the files in
src/admin
Change-Id: Ib1c8b637c40bf7bec7924a9582262f50fb093e47
These are exported objects which lint complains about.
/* eslint exported */ doesn't seem to work well here.
Change-Id: I2b55d1ddeca84a89b72b3bcc05be22f078563456
Please note that this is just a workaround because there is no
consistent pattern between LO sending us programmatic, UI names.
During the initial command value event, we get programmatic names
from it. During the state change event, we get UI names for
Writer, but programmatic ones for others.
Change-Id: I7e69e1d437b22a34e54d2026b76e81951c4cc601
To run loadtest, point the browser to:
file:///abs/path/to/loleaflet/spec/loadtest.html
To run the sample, point the browser to:
file:///abs/path/to/loleaflet/debug/document/document_simple_example.html?file_path=/abs/doc/path/test.odt&host=wss://localhost:9980
Change-Id: If3e9aa2fc321e734ad912158b06ecb3370e37418
Reviewed-on: https://gerrit.libreoffice.org/23454
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Use same port (9989) for all client connections. This includes
admin panel, static file serving and normal client websocket
connections.
Change-Id: Idcfd7dd8925523c36e884717c41a3b6a827f6ff3
Better to put all admin related content in a separate directory
rather than mixing it with other files in dist/
Change-Id: I328ff95cf23251ff91bb438c3b9be923ccc2017f
Better to put all admin related content in a separate directory
rather than mixing it with other files in dist/
Change-Id: I328ff95cf23251ff91bb438c3b9be923ccc2017f
This is to distinguish the deliberate close of connection, and timeout,
connection drop, or forced close.
When the last session is closed non-deliberately, force a save so that the
edits are not lost.
Library for creating graphs: D3.js
License: BSD
Currently only being served by a CDN, not copied into the source
tree.
Change-Id: Ib99ec9011da489fc42799c3610612a8c3c8e5c2b
... so by selecting and dragging the mouse we do not intend to
look closer what is there, which is an expected behavior for
maps, but doesn't fit well for us.
Change-Id: Ib7e838038fff9310e40912f251cb89c7eb0baaee
And then combine into one during build for distributing. We would
also want to minify the combined JS file but that is for later.
This come up rather early than anticipated, but good for us.
Change-Id: I74feb4955c5d47f0e9e817b410726ad219add485
Additionally, move jquery <script> tags up because we need jquery
to add context menu to table rows as soon as page is opened
(socket is opened, in this case).
Change-Id: Ic6e28486fb96f119e7d41168fc0039265f15a087
Lets have a new websocket class for each websocket type we want
in admin console inheriting from single abstract base class.
This, hopefully, would provide us with extensibility and ease of
managing files in future. Right now, there is only one class with
very less complexity, hence all the code is in one file.
As the complexity increases, we would need to separate all these
classes in different files, concat and compress them before moving
to dist/
Also rename dashboard.html to admin.html
Change-Id: I34b9b2817fe4a0e6ee2913c017d2694a17ab978c
Reviewed-on: https://gerrit.libreoffice.org/22904
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
This broke after we changed 'searchAll' to 'highlightAll'.
Change-Id: I257b20a458a9ad3334b5e20fc110d0932eb63733
Reviewed-on: https://gerrit.libreoffice.org/22508
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
This is required because we want to test on which page search is
found, and we can not do it before we get results for
partpagerectangles.
Change-Id: I6f927ae27b91e62d86a8e46dc9c21ee9aa913894
Reviewed-on: https://gerrit.libreoffice.org/22507
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Work based on bootstrap: http://getbootstrap.com/
License: MIT
Change-Id: I6a114e8dd688339c809ff27d97d0065647700971
Reviewed-on: https://gerrit.libreoffice.org/22824
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
State changed event from LOK for impress documents is
prefixed with the template name followed by the style name. Lets
strip the template name for the time being till we support it in
the UI.
Also LOK emits some form of internal names in state change event
which is different from the internal names supplied to us in
intial .uno:StyleApply. For consistency, convert these names to
our original form of internal names.
Change-Id: I95d3d8aa29238fc326887cdfc9b22eb4e429d1bb
Reviewed-on: https://gerrit.libreoffice.org/22814
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Since the data scraped from the LO translation module is a
mapping between the UI names (not internal ones) to different
languages, the plan is to first set the locale explicitly to
'libreoffice' so that l10n framework gives us corresponding UI
names from programmatic names, and then to use the specified locale to
translate these UI names to respective languages.
Change-Id: I64f7c9b4927e5effe328cb7b42582b45d44167d9
Reviewed-on: https://gerrit.libreoffice.org/22813
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
An abstract class to request an access token, given
an authorization grant. The class should be
specialized for each authentication/authorization
type we support.
Currently it's not enabled in the code as it's
an early stage in developing an general API.
Change-Id: I4f2efd376d575640bd3e17c7257994020b11bbe8
Reviewed-on: https://gerrit.libreoffice.org/22512
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
'Outline' is localized, 'Outline x', where x = number, is not.
Lets treat outline levels as special case so that we could get
their localized form also.
Change-Id: I96d1a0d715e5859f9d0f2da2c00c06232621555b
Reviewed-on: https://gerrit.libreoffice.org/22354
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
The .po files imported from LO has some codes that browsers don't
recognize. Change them so that browsers recognize them.
Change-Id: Icf37812a579be171af33a62096b2326d6a66e3a4
Reviewed-on: https://gerrit.libreoffice.org/22370
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Translation of styles for writer, impress and calc
in all languages taken from LibreOffice translation submodule.
Change-Id: Id533463f63523cade53435d66ff85a90fc15736b
Reviewed-on: https://gerrit.libreoffice.org/22353
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Lets enable them only after we add support for templates/layouts
in the UI.
Change-Id: I82bc855b4313e9dc9b925473b64e498002c42700
Reviewed-on: https://gerrit.libreoffice.org/22225
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
This is enough, so that e.g. pagedown jumps down about a visual page
correctly.
Areas where this could be improved further in the future:
- Currently the visual area is only updated on zoom change. Perhaps it
would be better to update it when the visual area really changes, i.e.
on scroll or resize. But the cost of this only makes sense if
something on the server side needs the correct position or width as
well, not only the height (as pgdown does).
- Currently the visual area is sent only before a key command (if it's
dirty), is there a use-case when sending it also before e.g. a mouse
click is also useful?
Earlier both 'zoomend' and 'zoomlevelchange' triggered
Control.Zoom._updateDisabled.
Removing 'zoomend' let us fire 'zoomlevelchange' when the zoom level
is set (map.setZoom).
Change-Id: Ifde4977f39ca924bbcb7621d16f6169088d2c608
The meaning of the cursorURL option is changed: now it does not
represent anymore the full URL including protocol and server but only
the path local to the server.
Map option curosr.HotSpot has been removed since not requested.
cursorURL option has been documented in reference.html.
Change-Id: I9ccc4756ade469018837af08b1d32a3fabddc958
When the user clicks on the background text color control while
editing a text document, loleaflet enter in highlighting mode (exactly
as Wrieter does).
In order to notify that loleaflet has switched to highlighting mode
the cursor changes is shape to a small bottle in the act of dropping
ink.
Change-Id: Ic9a5a636df9fd6071e38edc7e0fc2e11e037a517
The previous work changed the behaviour of searchAll so that it does not
create a real selection, but instead adds additional mean of highlight, so
that it is possible to show all the results, and travel them at the same time.
The usage is now:
* call once the highlightAll()
* and then traverse the results using search()
Steps for reproducing the problem:
1) try to select some multi-line text
2) still holding the mouse button pressed move the mouse pointer
outside the browser window
3) release the mouse button
4) move the cursor back over the map.
Expected result: the selection should not change any more after the
mouse button has been released.
Real result: the selection changes when you move the mouse.
The same happens when you move the mouse pointer out of the tiles
covering, even if we are still inside the html document element area
where the map is embedded.
A similar issue occurs in view only mode when you drag the document: in
this case the problem occurs only when you move the mouse pointer out of
the tiles covering, but still inside the html document element area
where the map is embedded.
The behaviour described above is due to the fact that the map container
receives mouse events only when the mouse pointer is over the map.
The implemented fix checks for mouseout events which occur between a
tile element and a non-tile element (such as the the resize-detector
iframe, the scroll-bar container, the selection cursor marker). When
such an event occurs handlers for mousemove and mouseup events are
attached to the HTML document element and to the resize-detector iframe.
In the same way when a mouseover event occurs between a tile element and
a non-tile element such handlers are removed.
It was needed to attach handlers to the resize-detector iframe too since
the HTML document element seems to not be able to receive mouse events
that occur inside the iframe area.
A side effect of this fix is that now the text selection goes on
changing as far as the mouse button is not released even when the mouse
pointer is moved out of the tiles covering.
Since for an iframe the coordinates embedded in a mouse event are
relative to the iframe area, it was needed to implement a workaround in
order to avoid sudden changes in the current selection or in the
document position when the mouse pointer moves out of the map.