Commit graph

233 commits

Author SHA1 Message Date
Henry Castro
c537bea938 loleaflet: import Autolinker.js library
The file was imported from node_modules/autolinker/dist/Autolinker.js
the main reason is to analyze the source code, debug and patch
if necessary

To get the source code from npm repository

	make libs

Change-Id: I3eea7cc6e8d61623398d77ed74e751ccd861252b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89150
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Henry Castro <hcastro@collabora.com>
2020-02-21 00:49:04 +01:00
Henry Castro
87ff57fe5b loleaflet: import json2.js library
The file was imported from node_modules/json-js/json2.js
the main reason is to analyze the source code, debug and patch
if necessary

To get the source code from npm repository

	make libs

Change-Id: I7d80646704b368f6961c75f1dabaabecde2527e6
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89146
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Henry Castro <hcastro@collabora.com>
2020-02-20 18:32:48 +01:00
Henry Castro
a75c8f3e71 loleaflet: import select2.js library
The file was imported fromnode_modules/select2/dist/js/select2.js
the main reason is to analyze the source code, debug and patch
if necessary

To get the source code from npm repository

	make libs

Change-Id: Ibe0fd718d1dd6157d463a304c56fd6475821a0eb
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89110
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Henry Castro <hcastro@collabora.com>
2020-02-20 17:37:14 +01:00
Henry Castro
05d433b500 loleaflet: import vex.combined.js library
The file was imported from node_modules/vex-js/dist/js/vex.combined.js
the main reason is to analyze the source code, debug and patch
if necessary

To get the source code from npm repository

    make libs

Change-Id: I59e466e925d43bf4c599305898c656f69ec195d9
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89099
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Henry Castro <hcastro@collabora.com>
2020-02-20 14:51:54 +01:00
Henry Castro
5cc7ba2d77 loleaflet: import sanitize-url.js library
The file was imported from node_modules/@braintree/sanitize-url/index.js
the main reason is to analyze the source code, debug and patch
if necessary

To obtain the source code from npm repository

make libs

To bundle the file sanitize-url.js

browserify braintree-sanitize-url/index.js --standalone sanitizeUrl > sanitize-url.js

Change-Id: I7869a1349648ae1f8f2194859ebb398b1a73733e
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89055
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Henry Castro <hcastro@collabora.com>
2020-02-20 13:20:44 +01:00
Henry Castro
8ce1846e5e loleaflet: import l10n.js library
The file was imported from node_modules/l10n-for-node/l10n.js,
the main reason is to analyze the source code, debug and patch
if necessary

To obtain the source code from npm repository

make libs

Change-Id: I7bd4d400c504f57a94566e187c6d26361aed8bd0
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89043
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Henry Castro <hcastro@collabora.com>
2020-02-19 17:32:10 +01:00
Henry Castro
e10e9335c5 loleaflet: allow browser detection when loading html page
Move the code related to browser detection immediately
when loading html page to be accessible to all javascript libraries

Change-Id: I442cf5ab8e9452bffa5a760768e8a3e38c1c3c21
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88744
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Henry Castro <hcastro@collabora.com>
2020-02-17 15:59:15 +01:00
Henry Castro
bb6f13d94d w2ui: remove unused components
w2ui is bundled with: w2grid, w2layout, w2popup,
w2tabs, w2sidebar, w2fields, w2form

But they are not used in desktop nor mobile and
it is preferable to remove the dead code to reduce
bundle size, parse with mobile devices.

If in a near future, these components are used,
still we can restore the components.

Change-Id: I522f01a73217635acc9828a54006111fa196636d
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88735
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2020-02-17 14:57:19 +01:00
Tamás Zolnai
8081afc8e0 eslint: Enable "semi" rule as an error.
This checks whether all statements end with a semicolon.
We already use this rule in the code, so I enable to check
this rule by eslint to keep the code consistent.

Change-Id: I5ea46376d2b6fb488224d4d69e4d117139763a8c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87154
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2020-01-21 18:32:33 +01:00
Henry Castro
e9d11f4a66 loleaflet: simplify "prevent default 'contextmenu' action"
The mobile and desktop prevents default 'contextmenu' action

Change-Id: I89171c955c153b2fceaad92970e2eaf039cb8527
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86373
Reviewed-by: Henry Castro <hcastro@collabora.com>
Tested-by: Henry Castro <hcastro@collabora.com>
2020-01-08 18:21:14 +01:00
Tor Lillqvist
152a20df3a Revert "tdf#129374: Make the overlay wider on iOS if it seems necessary"
There is a better fix coming.

This reverts commit ce7ad16087.
2020-01-08 16:29:45 +02:00
Pedro Pinto Silva
a4b146ec51 Mobile: w2ui scroll elements:
- Enable and adjust elements when on mobile so they are visible but discreet (without covering icons)
- Make them not clickable when on mobile (thus avoiding unwanted scrolled due to users mistaps
- Make their parent aware of the ongoing scrolling and call w2ui resize on it (thus making the left and right indicator showing and hiding as we please)
- Test and adjust so this changes do affect affect the click listening on desktop etc

Change-Id: Ic35dadb71e7fd6ae3ff2fad3e52d5219e7520c55
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86364
Reviewed-by: Pedro Pinto da Silva <pedro.silva@collabora.com>
Tested-by: Pedro Pinto da Silva <pedro.silva@collabora.com>
2020-01-07 17:36:21 +01:00
Tor Lillqvist
ce7ad16087 tdf#129374: Make the overlay wider on iOS if it seems necessary
Horrible hack, but works for the specific case described in the bug at
least.

Change-Id: I55150d84dc892ece69540fdc0d06bc277891c1fa
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86328
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
2020-01-07 11:28:52 +01:00
Marco Cecchetti
fa4bd90339 loleaflet: check if LOCALIZATIONS is defined on mobile app
Change-Id: I066670f3bde7f028ae01624a3b475bc0939f2c31
Reviewed-on: https://gerrit.libreoffice.org/85634
Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Tested-by: Marco Cecchetti <marco.cecchetti@collabora.com>
2019-12-20 20:33:09 +01:00
Jan Holesovsky
0cd43ead59 android: Make the localization work for the JS pieces.
To have the menu translated.

Change-Id: I8d4d90d260aa3fcd80a8eb68515b22c58c9b3e18
Reviewed-on: https://gerrit.libreoffice.org/84931
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2019-12-11 11:49:37 +01:00
Marco Cecchetti
f4dd7ef0dc fixing 2 minor console errors
Change-Id: Ie2449e33dd47511b2d8a65e1f929e69fece8a567
Reviewed-on: https://gerrit.libreoffice.org/84901
Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Tested-by: Marco Cecchetti <marco.cecchetti@collabora.com>
2019-12-10 22:08:01 +01:00
Pedro Pinto Silva
3aa715260d Toolbar: background color and text color: Color appears now as a bottom stripe
Change-Id: If338b10ce3e117a8f43b9bb920820c3d1de324af
Reviewed-on: https://gerrit.libreoffice.org/84415
Reviewed-by: Pedro Pinto da Silva <pedro.silva@collabora.com>
Tested-by: Pedro Pinto da Silva <pedro.silva@collabora.com>
2019-12-04 14:58:41 +01:00
Henry Castro
2644c113c2 mCustomScrollbar: add event listener to pointer or touch events
Some mobile devices support both pointer and touch events,
so if we add event listener it will fire 2 times.

Change-Id: Ida9862e9ee24e47ccbe3963b5c4ff18a173fffe0
Reviewed-on: https://gerrit.libreoffice.org/82799
Reviewed-by: Henry Castro <hcastro@collabora.com>
Tested-by: Henry Castro <hcastro@collabora.com>
2019-11-16 19:28:31 +01:00
Henry Castro
59d3c2d20d mCustomScrollbar: remove unnecessary access to Window top property
When the frame is null, it is referring to a container frame window that
it is always not accessible.

Change-Id: Ie96a05327928b2b72ce5577409e368061b2afa1e
Reviewed-on: https://gerrit.libreoffice.org/82798
Reviewed-by: Henry Castro <hcastro@collabora.com>
Tested-by: Henry Castro <hcastro@collabora.com>
2019-11-16 19:28:13 +01:00
Henry Castro
cb7813ef35 mCustomScrollbar: reduce the number of _coordinates function calls
The _coordinates function is called several times to compute
the same coordinate value.

Change-Id: I6e187b74709515ddde77d60649e564cb2b484fb4
Reviewed-on: https://gerrit.libreoffice.org/82797
Reviewed-by: Henry Castro <hcastro@collabora.com>
Tested-by: Henry Castro <hcastro@collabora.com>
2019-11-16 19:28:01 +01:00
Henry Castro
3e2ec0854d loleaflet: add missing parameters when early websocket connection
Add some missing parameters when the "websocket" is connected after
loleaflet.html while "bundle.js" is downloading and ready to execute.

Change-Id: I36995a3c82ce17fa5a81923e8d6d785f0c1c7742
Reviewed-on: https://gerrit.libreoffice.org/82546
Reviewed-by: Henry Castro <hcastro@collabora.com>
Tested-by: Henry Castro <hcastro@collabora.com>
2019-11-15 15:49:52 +01:00
Tor Lillqvist
8c5b61b41e tdf#126973: Don't do anything in the tooltip show and hide functions on iOS
I have no understanding of what this code does and how it works but
this seems to fix the problem described in the bug.

Change-Id: I7188745b5c77d9e065828336b7dd6524aedc1dce
Reviewed-on: https://gerrit.libreoffice.org/81079
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
(cherry picked from commit b95a22a740bccbd50d6cf49ad0b5fdbd1d489a90)
2019-11-05 17:00:51 +02:00
Tor Lillqvist
6ca47a7ab0 For a mobile app, call window.postMobileError() in window.onerror()
Sadly it doesn't seem to work, though, at least on iOS, if I as a test
re-introduce the error that was fixed by
2ddd8d7c81. But maybe it will work for
other uncaught errors. Clearly it is better than letting the code
attempt do the XMLHttpRequest thing which is totally wrong and
pointless in an app.

Change-Id: I7b6e95556603b680527a0516f54e24dc10e96b21
2019-10-31 10:24:01 +02:00
Tor Lillqvist
6892259703 tdf#126971: Fix localisation of tunnelled dialogs in the iOS app
This used to work fine, but at some stage it had regressed. I did not
bother bisecting to find the culprit. Anyway, now the JS part needs to
send a lang parameter in the load message, too, for the corrent
language to be used in the tunnelled dialogs. (Likely it affects also
other things in core.)

Change-Id: I339cddb28357978414669964106cb6fa472c967f
Reviewed-on: https://gerrit.libreoffice.org/77599
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/79023
2019-09-16 17:36:53 +02:00
Henry Castro
2872bc7be9 post logs JavaScript runtime errors to the loolwsd server
Change-Id: Ic8ccff52d2f051ea6d31b6d2bfe08fc08ea4d8c2
Reviewed-on: https://gerrit.libreoffice.org/77849
Reviewed-by: Henry Castro <hcastro@collabora.com>
Tested-by: Henry Castro <hcastro@collabora.com>
2019-08-20 18:24:04 +02:00
Jan Holesovsky
22720ee7d1 Avoid a TypeError.
I've been getting this on Android, but suspect it can be a general
problem:

loleaflet.html?file_path=/storage/emulated/0/Documents/untitled.odt&closebutton=1&permission=edit:165 Uncaught TypeError: Right-hand side of 'instanceof' is not an object
    at global.FakeWebSocket.global.socket.onmessage (loleaflet.html?file_path=/storage/emulated/0/Documents/untitled.odt&closebutton=1&permission=edit:165)
    at <anonymous>:1:25

Change-Id: Ifa6a6b15843e0c8235b920cea07324db59282074
2019-06-20 14:13:29 +02:00
Henry Castro
ee7e1f136a Revert "loleaflet: move jquery.contextMenu.js to loleaflet/js"
This is no longer required because d6fe8ff085

This reverts commit 2ea141c02f.
2019-05-10 10:05:06 -04:00
Henry Castro
2ea141c02f loleaflet: move jquery.contextMenu.js to loleaflet/js
for next patch I require to modify the contextMenu
to trigger on touch start event.

I should do updating archived-packages, but ...

Change-Id: I20f1fbda1e7e60f97cd790c055599edcf8da9d1a
2019-05-02 18:19:59 -04:00
Szymon Kłos
cff5791f2e Prevent view from jumping on zoom in/out on mobile
Change-Id: I29262d518d61a4a06d66271033c958e56ff16a2b
Reviewed-on: https://gerrit.libreoffice.org/70592
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Tested-by: Tor Lillqvist <tml@collabora.com>
(cherry picked from commit 42a739a7bc53f9992056de4e00db90a5e613c04c)
Reviewed-on: https://gerrit.libreoffice.org/70887
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
2019-04-17 16:28:55 +02:00
Szymon Kłos
6cc7bad2e0 Calc scrolling with selection fix
Scrolling with selected sheet was endless.
This change allows scrolling using mouse wheel
when scrollbar is close to the end of screen
and prevents from doubled updates.

Extension of work done before in:
ec24337b11

Change-Id: Id76818158c0d9988b323ec52a408efd5ae6a9da5
Reviewed-on: https://gerrit.libreoffice.org/70266
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Tested-by: Szymon Kłos <szymon.klos@collabora.com>
2019-04-05 10:59:21 +02:00
Henry Castro
68be4badb2 loleaflet: fix the prototype property of a constructor L.Socket
Change-Id: Ie0086b6e1129fa9aaba416e44d49829fe605ded6
2019-03-30 16:58:08 -04:00
Jan Holesovsky
345df913de Revert "loleaflet: remove jquery-ui.js"
This is needed for the functionality of the dialogs.

This reverts commit e81441f63b.
2019-03-20 09:44:39 +01:00
Jan Holesovsky
e5ecc92659 Revert "loleaflet: execute l10n.js script after html parsing"
This reverts commit e512924544.

Change-Id: I9b322b45cd13b69c4438d48227237dd8062aee05
2019-03-15 18:24:25 +01:00
Jan Holesovsky
cbc85953e8 Revert "loleaflet: set format unix l10n.js"
This reverts commit ab2051cd50.
2019-03-15 18:24:25 +01:00
Jan Holesovsky
b842679e9a Revert "loleaflet: load l10n files according to parameter "lang""
This reverts commit 668b837c70.
2019-03-15 18:24:25 +01:00
Jan Holesovsky
47b77f8d60 Revert "loleaflet: fix String.locale assignment"
This reverts commit 304852ccd5.
2019-03-15 17:25:53 +01:00
Jan Holesovsky
5fe925f18f Revert "loleaflet: remove client side L10n"
This reverts commit c9685387b9.

Change-Id: Ie11c04ffad8260c3c1d6357f18dd9f2a42912859
2019-03-15 17:25:41 +01:00
Jan Holesovsky
9fa34e5a7f Revert "Try to make l10n work again in the iOS app"
This reverts commit 318efba053.
2019-03-15 17:23:28 +01:00
Jan Holesovsky
1a899cc8b9 Revert "I was misinformed: The _ function *is* needed also in normal Online"
This reverts commit 29626c36a3.
2019-03-15 17:23:14 +01:00
Jan Holesovsky
4e4da1eb92 Revert "loleaflet: verify if "toLocaleString" function exists"
This reverts commit 52b03a2d1a.
2019-03-15 17:23:00 +01:00
Henry Castro
746a81c0f0 loleaflet: fix "failed: WebSocket is closed before...
the connection is established"

Change-Id: Icb44f1a9fe75ac995f9a771d0a0f052c55339df3
2019-03-12 14:58:19 -04:00
Henry Castro
315fc0b3e8 loleaflet: move main.js to src/ directory
Simplify building loleaflet.

Change-Id: I3cdc6455b21e683b0331997766badd606c6aca43
2019-03-11 17:30:07 -04:00
Henry Castro
c1ba96f951 loleaflet: move toolbar.js to src/control directory
Simplify building loleaflet.

TODO. Convert to L.Control.Toolbar

Change-Id: I6abedd19caa6f0c22267c661e67480507dcd8336
2019-03-11 14:51:56 -04:00
Henry Castro
2774a04833 loleaflet: improve early "websocket" connection
Normally the "websocket" is created and start a connection when browser
evaluate "bundle.js" after download it.
So we create an early "websocket" connection after the browser parse
"loleaflet.html" and start receiving tiles to improve load page
performance

Change-Id: I56fca7a2da39031222c1d43781825997221385a1
2019-03-07 14:13:52 -04:00
Henry Castro
52b03a2d1a loleaflet: verify if "toLocaleString" function exists
This API has not been standarized yet

Change-Id: I63e1ac88dc660675420af266766163dbe13d31ce
2019-03-07 10:22:12 -04:00
Tor Lillqvist
29626c36a3 I was misinformed: The _ function *is* needed also in normal Online
Not all calls to the _ function are magically replaced by the
FileServer, but only those that pass an explicit string literal.

Change-Id: I9917c569f0471551ade9e46ee9f87b4f326f581e
2019-03-06 17:00:01 +02:00
Tor Lillqvist
f5791f9e1f Send the HULLO message to the mobile app native code already in global.js
Apparently the connect() function in Socket.js is now dead code?

Now the iOS app seems to work as before.

Change-Id: Ib6c2b9a08e818ec8f4b5dbdfbf75f507c4bb7069
2019-03-06 15:30:49 +02:00
Tor Lillqvist
318efba053 Try to make l10n work again in the iOS app
In real Online, after recent commits localisation of messages in our
JavaScript is handled in the FileServer code. Calls to the _ function
in JavaScript being served are replaced with the translated string. We
can't do that in the mobile apps (without some re-work, and I doubt we
want to spend time on that now, there are more pressing problems). In
real Online, the _ function in global.js thus actually dead code.

But in the mobile apps, we don't have any FileServer, and we do want
the _ function to work as before, and we do want to include the
l10n-all.js file in the bundle.js.

Of course, if profiling eventually indicates that doing that *is* a
problem from performance and/or memory usage point of view, we do need
to re-work this. But for now I just want things to roughly work as
they did in the iOS app.

Change-Id: Ib77020010867e7aabaf68bbb892d150d15708213
2019-03-06 14:17:53 +02:00
Tor Lillqvist
039913499b We need the FakeWebSocket code for the mobile apps here, too
We don't use (real) WebSockets for anything at all in the mobile apps.

Is the WebSocket (and FakeWebSocket) code in Socket.js still relevant?
Has it been superseded by what is now in global.js? Good question.
Next question please.

Change-Id: Ief4209b738ba1f0c1a8c496ae53bedcb1f7e14f9
2019-03-06 13:32:59 +02:00
Henry Castro
e81441f63b loleaflet: remove jquery-ui.js
This library is not used, reduce bundle size

Change-Id: I925ed1335a46f78ba74af55582261a86376d7aca
2019-03-05 23:42:24 -04:00