Commit graph

338 commits

Author SHA1 Message Date
Pranam Lashkari
a2fca1f9bc leaflet: fixed missing tooltips in mobile
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I43599d44cdec827acb588dee30c80e07f8f9386e
2021-10-19 12:26:40 +02:00
Gökay ŞATIR
87b98a4b59 Add viewedRectangle global variable.
Signed-off-by: Gökay ŞATIR <gokaysatir@gmail.com>
Change-Id: Id0f2afe8cc750d867a33dada7134f7b7d93a11c3
2021-10-09 14:19:49 +03:00
Gökay ŞATIR
7472bffff9 Comment: Set a variable while focused.
Signed-off-by: Gökay ŞATIR <gokaysatir@gmail.com>
Change-Id: I4c9cbfcd4762e15c8716881fba776e77dbc195c0
2021-10-09 11:07:54 +03:00
NickWingate
ae3dc2bff7 Remove IE11 conditional in ResizeObserverPolyfill.js
Signed-off-by: NickWingate <nicholas.wingate03@gmail.com>
Change-Id: I8c9088655396410d2bd529f33ce9962d399ef2ba
2021-09-16 14:59:30 +03:00
NickWingate
774393ded3 Remove IE11 conditional from global.js
In global.ProxySocket(uri) function

Signed-off-by: NickWingate <nicholas.wingate03@gmail.com>
Change-Id: I96f5d92484df41d1424b7808ee2bb6f9a5c71fde
2021-09-16 14:59:30 +03:00
Ashod Nakashian
293081a631 leaflet: centralize wopiSrc URL forming
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 5c1fb316ba87569f514794bc59a0d73e706c9fc8)

Change-Id: I5e9d2d539fbed5cd0f95fb96fb8db3480b2b0cca
2021-09-13 09:40:09 -04:00
Ashod Nakashian
758fd9e7d5 leaflet: move wopiSrc into window and central URL maker
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 642150dfabeb95a6ffaed2e4e703c413e5648c98)

Change-Id: I4e6cda1d4edb192af01977cd4b847ebd01ba3599
2021-09-13 09:40:09 -04:00
Ashod Nakashian
9854cee355 leaflet: makeWsUrl
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 29cb20031e2dfdd8be03cfc87cb684d6fd66923d)

Change-Id: Ie1a6eeb35149a2d30acb237c7719f3154de00bc5
2021-09-13 09:40:09 -04:00
Ashod Nakashian
89e1335e8a leaflet: makeURL -> makeHttpUrl
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit bf92c6d11af38249736759c60f74bd13a1235e9b)

Change-Id: Ib922279c2369b6136ba38ed76ab7eea8775dc833
2021-09-13 09:40:09 -04:00
Ashod Nakashian
731eeff718 leaflet: move map.options.serviceRoot to window.serviceRoot
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit ec40f709639e645c71949a97002b3e787859d495)

Change-Id: I95435c65023f220999e9c47ac6c4d84caf2d0185
2021-09-13 09:40:09 -04:00
Ashod Nakashian
3349043635 leaflet: replicate options.webserver in window.webserver
Change-Id: I205a3f072d0985121e84f87bbf86b310ced08c51
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 7ffe8db0482cc66ac0f79eb33d4ae96de9da4eca)
2021-09-13 09:40:09 -04:00
Ashod Nakashian
e363273e22 leaflet: support hexifying the body of the lool URI
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit cfa7972289e9c71b56c81722aedc14189f842475)

Change-Id: Iebf214a1bba76dd44fe2c160a0749675aa5b140a
2021-09-13 09:40:09 -04:00
Ashod Nakashian
81eb4cdbe4 leaflet: move url manipulation to helper
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
(cherry picked from commit 08971dc27f7db72f870af16ecb7732c1bd93debe)

Change-Id: I2a3f5fe548b4303afa21cf2cf6cf361198edb61f
2021-09-13 09:40:09 -04:00
Rash419
cf17f4ac33 loleaflet: when user select existing color in colorPicker it comes on first position in recentRow
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I200789fc5aa9cd5a6fc8a0bc311cbe71dde33e42
2021-08-19 14:43:06 +05:30
Rash419
a8aa6ebe9b loleaflet: store recent and custom colors locally
Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I85fe51d4c7a839b9743df6c739e4d0a02daacf40
2021-08-18 15:13:39 +05:30
Rash419
526b32bb98 loleaflet: added recent color section in colorPicker
cypress: updated the test with respect to changes

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I31c5d93260551986d43722ab606c4b9eee1de913
2021-08-10 09:41:54 +02:00
Henry Castro
7972485509 loleaflet: simplify logException
Change-Id: I31bc41ba519f3bd5e5b873a836f6c8ed5bd842d5
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-08-06 16:19:27 -04:00
Gökay ŞATIR
e6d53967c1 Remove unused global variable.
I added it to use for PDF view but didn't need, let's remove what's unused.

Signed-off-by: Gökay ŞATIR <gokaysatir@gmail.com>
Change-Id: I7d052ad5297e3a52c3ac52b9cd7aeb6270d32d6b
2021-07-25 11:58:34 +03:00
Gökay ŞATIR
05d0ccf5a5 Add global multipliers for conversions.
twipsToPixels and pixelsToTwips are added.

Signed-off-by: Gökay ŞATIR <gokaysatir@gmail.com>
Change-Id: I794a7c4ee826510f3bf1b97b4a456bf05ec2f3ae
2021-07-25 11:58:34 +03:00
Gökay ŞATIR
01505278a6 KitHelper: Get page rectangles with status message.
Signed-off-by: Gökay ŞATIR <gokaysatir@gmail.com>
Change-Id: I6a6140d46c16c5ebd9ae1c80a441a7129ad1ada5
2021-07-25 11:58:34 +03:00
Gökay ŞATIR
57c1611083 Use global app.dpiScale variable instead of local copies.
Signed-off-by: Gökay ŞATIR <gokaysatir@gmail.com>
Change-Id: I2ce695076343320ec16f02d058af3caf2dbd6d03
2021-07-21 17:37:43 +03:00
Mert Tumer
0470b0e7f9 Additional control for ResizeObserver for NodeJS tests
ResizeObserver is not defined for JSDOM as well
Better to check that not only for IE11.

Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
Change-Id: Idb080f1a320c291dca71a73e76b8d754a76e1108
2021-07-12 20:35:32 +03:00
Gökay Şatır
ded14a96c5 IE11 compatibility changes.
Signed-off-by: Gökay Şatır <gokay.satir@collabora.com>
Change-Id: If595e742ecef633741892c4a714f74d93e97c6a9
2021-07-09 21:05:40 +03:00
Gökay Şatır
9bc9dcc0f9 Make dpiScale variable global.
Signed-off-by: Gökay Şatır <gokay.satir@collabora.com>
Change-Id: I3405a4b2d03a7b0bc28cc6d6e2f36f62331003ff
2021-07-09 21:05:40 +03:00
Gökay Şatır
bc54b1d12c Calc: Add cellCursor global variable.
Signed-off-by: Gökay Şatır <gokay.satir@collabora.com>
Change-Id: I8314367ed87742cedd02f0c60cee1ad9b748b4ec
2021-07-09 21:05:40 +03:00
Gökay Şatır
e8dd0a10a0 global.js: Remove wrong comment from file.
Signed-off-by: Gökay Şatır <gokay.satir@collabora.com>
Change-Id: I50641161171879b6a44a4179f93853562be5603f
2021-07-09 21:05:40 +03:00
Gökay Şatır
8d4873fe35 Use global variables.
Signed-off-by: Gökay Şatır <gokay.satir@collabora.com>
Change-Id: I345923efa8375c6be731ceb37508cffc6d02b365
2021-07-09 21:05:40 +03:00
Gökay Şatır
58d8606c4c Improve global variable declaration.
Signed-off-by: Gökay Şatır <gokay.satir@collabora.com>
Change-Id: I2b926faf8405a6c689ad7d8659707583d93883e9
2021-07-09 21:05:40 +03:00
Gökay Şatır
73ae1a5431 w2ui: Remove workaround code.
It was blocking other components.

Signed-off-by: Gökay Şatır <gokay.satir@collabora.com>
Change-Id: Ic5039fc8f3896395121b60ea068ca15a247a1cc6
2021-07-09 21:05:40 +03:00
Tor Lillqvist
bd0c225c9f Revert "Make it possible to generate Trace Events already when loading the document"
Makes unit-rendering-options fail reliably.

This reverts commit 175c9c5b2a.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: Id05c911991baaae0dbc52678a192fc01639352e0
2021-07-07 12:38:11 +03:00
Tor Lillqvist
175c9c5b2a Make it possible to generate Trace Events already when loading the document
By passing a traceevent=yes query parameter in the URL. Note that if
Trace Event generation is not enabled in loolwsd.xml this will have no
effect.

It is a bit silly to notice this query parameter only in loleaflet and
then send the information back to the server. Would be better if the
server noticed it itself before sending the URL to loleaflet.

While at it, let's not bother ever enabling Trace Event generation in
the WSD process. That is not what we are interested in.

Signed-off-by: Tor Lillqvist <tml@collabora.com>
Change-Id: I985bfd1e2dbd14aa5a55b386b4762fb64bcb4008
2021-07-07 09:28:02 +03:00
Henry Castro
ef2d14c494 loleaflet: introduce console.logException
log javascript exceptions to server side

Change-Id: I3f31a052ede8dbb467ddba9dc18a1020b38a16a3
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-06-14 14:17:46 -04:00
Henry Castro
d7fa80854d loleaflet: fix app.definitions instance of Socket
Change-Id: I9aad1f792c7a2c07e9e9fa95c0d6b80aa0eef44a
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-06-14 14:17:46 -04:00
Henry Castro
d751e37e1d loleaflet: introduce logServer function
required to log exceptions

Change-Id: Ic63b31080b252042284b2826e82d4c5300e17f6d
Signed-off-by: Henry Castro <hcastro@collabora.com>
2021-06-14 14:17:46 -04:00
Tor Lillqvist
1d4d7505fe Include the timestamps also in the loolclient message sent here
I had missed that we can send it from two different spots in the code.

Change-Id: Ic67a041ad2156df5f720ca9bc695870e43d60568
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-05-19 13:33:26 +03:00
Pedro Pinto Silva
73c39da36d Status bar: Do not crop showbusy message
- Fix #2343
  - Do not crop contents
	- Centered message (vertically and horizontally)

Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: Icc40a09d1690f683135ac16b274d237c81aab827
2021-05-12 16:45:30 +02:00
Mike Kaganski
6393e9d077 Properly process URLs with existing query
URLs from host may already contain a query, like

  http://server.tld/foo/wopi/files/bar?desktop=baz

Previously, we simply appended '?' and then our parameters, resulting in

  http://server.tld/foo/wopi/files/bar?desktop=baz?access_token=...

which later was processed as if the question mark and following parameter
were part of previous parameter's value, so proper 'access_token' parameter
was missing.

This checks if the URL contains '?', and uses proper separator accordingly.

Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: I1a237c0e47e1eea3704ef7d4a8a596283ea2a241
2021-05-12 15:09:00 +02:00
Tor Lillqvist
4e0b03f651 Let the server tell loleaflet whether trace events can be collected or not
Instead of requiring that information in the query string of the loleaflet.html URL.

Change-Id: I8c41e87c7f561561adeb03ec34ce0c19fe9d7fa5
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-05-10 16:44:07 +03:00
Tor Lillqvist
9da0145280 Add an --enable-trace-event-logging option to loolwsd
It enables turning Trace Event recording on (and off again). The
option is passed down to the client through loleaflet.html, and to the
KIT processes. If the option is not used, the new JS functions that
send trace events to the server turn into no-ops to avoid wasting
bandwidth.

It is always on in a "make run".

Change-Id: Iafe1919ccba7c376137d3e0568b857e20780bbc8
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-05-10 12:39:07 +03:00
Tor Lillqvist
fc19f64bfc Fix UTF-8 decoding and fix handling of non-BMP codepoints for IE11
The UTF-8 decoder here was buggy, and additionally it tried to feed
the Unicode codepoints it had constructed directly to
String.fromCharCode() even if that function takes UTF-16 units, not
Unicode codepoints.

The function in question is used only on IE11, apparently, so
presumably the problems had not been noticed.

Change-Id: I78f8ecea6ce6349e4121066774ae5c3fcfa87363
Signed-off-by: Tor Lillqvist <tml@collabora.com>
2021-04-01 13:37:55 +03:00
Gökay Şatır
ffd61d848f Move map._socket to window.app.socket
Signed-off-by: Gökay Şatır <gokay.satir@collabora.com>
Change-Id: Ia3f2b9d5d4516427d5b3b918cb4e5a503d9a79cf
2021-03-30 10:02:58 +03:00
Gökay Şatır
52759920a5 mCustomScrollBar: Remove.
It's not used anymore.

Signed-off-by: Gökay Şatır <gokay.satir@collabora.com>
Change-Id: I4424018e6b1820de0d86c9058207fe19f46e0c16
2021-03-03 14:04:11 +03:00
Ashod Nakashian
6d11e400a7 wsd: userName is optional
This resolves a dependency on userName
(a.k.a. UserFriendlyName) that was a source
of issues when missing.

It turns out that when it's missing but
spellOnline is set, an edge-case caused
an exception that failed loading.

The spellOnline value, in its turn, was
incorrectly set to "null" when in fact
it was missing. This resulted in online
spell-checking being active by default.
Perhaps this was intentional, but here
we don't change this behavior at all.
Instead, we avoid sending "null" when
it's missing, and by default we always
enable online spell-checking, unless
it is explicitly set to "false".

This way, the exception is not thrown
and spellOnline doesn't have invalid
values, while preserving the current
behavior.

Change-Id: I4a09ac44ff5d6147c715afa0fb34af9650da4afd
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2021-02-13 13:25:48 -05:00
umutbayramoglu
d08fda9749 Remove unused variables
Signed-off-by: umutbayramoglu <umut265@gmail.com>
Change-Id: I7c2565a01605846201cb4a35564eb52b52491fe8
2021-02-11 02:10:34 +03:00
Michael Meeks
136f20b386 Use jsdom to load and execute our CSS, HTML and JS.
Change-Id: Ia7414e1fd19bf7ebfa29274d1acac5cee4837341
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2021-01-16 12:18:47 +00:00
mert
5418b4b19b Make AutoSpellChecking option state remembered on first start
Change-Id: I25823025e35ba6f580b03834979fb0bea616bcc1
Signed-off-by: mert <mert.tumer@collabora.com>
2020-11-17 14:55:31 +03:00
Pranam Lashkari
43db7bf841 leaflet: removed all the path not using canvas renderer
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I4831d1226854424b22263aa15c02df1fe9454661
2020-11-10 12:01:48 +01:00
Ayhan Yalçınsoy
c1df79e229 loleaflet: Towards eslint 6.0.0 #396 - no-prototype-builtins
The "extends": "eslint:recommended" property in a configuration file enables this rule.

In ECMAScript 5.1, Object.create was added, which enables the creation of objects
with a specified [[Prototype]]. Object.create(null) is a common pattern used to create
objects that will be used as a Map. This can lead to errors when it is assumed that
objects will have properties from Object.prototype. This rule prevents calling some
Object.prototype methods directly from an object.

Additionally, objects can have properties that shadow the builtins on Object.prototype,
potentially causing unintended behavior or denial-of-service security vulnerabilities.
For example, it would be unsafe for a webserver to parse JSON input from a client and
call hasOwnProperty directly on the resulting object, because a malicious client could
send a JSON value like {"hasOwnProperty": 1} and cause the server to crash.

To avoid subtle bugs like this, it's better to always call these methods from Object.prototype.
For example, foo.hasOwnProperty("bar") should be replaced with Object.prototype.hasOwnProperty.call(foo, "bar").

See: https://eslint.org/docs/rules/no-prototype-builtins

Change-Id: Id7723f0f0ed81e074f56955f80eda3d70241294e
Signed-off-by: Ayhan Yalçınsoy <ayhanyalcinsoy@pisilinux.org>
2020-11-01 00:47:10 +03:00
Pranam Lashkari
002e1832c6 leaflet: added missing useCanvasLayer method
Change-Id: I8fa415ff28f0251ea31793f025b8e57b2a8d3744
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
2020-10-31 13:36:00 +05:30
pelinKuran
e6390089a2 Fix indentations as per eslint 4.0.0
Change-Id: I590f3275b0a40246494611a17a64e5c6519f1f14
2020-10-20 14:41:24 +03:00