Commit graph

4320 commits

Author SHA1 Message Date
Szymon Kłos
a0c0e1601e remove-w2ui: permission mode indicator without hover effect
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ibd540c00a7aaf53b0a831847ae0eb57137e418c4
2024-03-29 01:40:29 +01:00
Szymon Kłos
6a452d9023 remove-w2ui: convert status bar to JSDialog
- move plain html controls into HTMLContent widget
- reuse scrollable bar from notebookbar
- use dynamically loaded menu entries in MenuButton
- allow to update MenuButton which contains menu id in the id

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I2b77479520c03420fefeb32dd09d6b34279e5686
2024-03-29 01:40:29 +01:00
Szymon Kłos
a091d1970c remove-w2ui: reuse user list from notebookbar
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Id3bb9615385e9951dd53d591f71389975fa8ace9
2024-03-29 01:40:29 +01:00
Henry Castro
652d52f7df browser: fix scroll tab when loading document
If the element 'spreadsheet-tab-scroll' does not exist
when loads document, then scroll to the selected tab.

Change-Id: Iec86225f7ea97a149d455210921daaf91a4e761a
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-03-29 01:43:39 +05:30
Gökay Şatır
b6a1df0c9d Show cursor in readonly mode.
Add a guard for potentially undefined functions in scroll section.
Allow arrow and home, end keys in readonly mode.

Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: Ie695ebf2cd14f49fbb4db2b9ba8f81df5b289591
2024-03-28 12:44:53 +03:00
Szymon Kłos
6f44bbc600 Fix error on hide tooltip
Tooltip can be modified only when was already initialized.
Sometimes we tried to hide it without initilization.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I6f4a18acef6be2d3c00548f8b4408c7876d6bdfa
2024-03-28 07:51:42 +01:00
Henry Castro
5c7f26ed22 browser: ignore validation of hidden inputs
"An invalid form control with name='' is not focusable."

Change-Id: Ic81d91748371147beed6cbc7b43cc569412760ba
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-03-27 09:05:22 -04:00
Pedro Pinto Silva
ea566ce757 Modals should always be placed on top of tooltips
Before this commit, already opened ui-tooltips were being placed on top
of everything, including modal dailogs. Fix that, set jquery css
line to the same z-index used by non-modal dialogs.

Additionally: update browser/README file so it documents this change
and clean up vex legacy bits.

Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: Ie7123822d96c594433ac197aeb9c651aa9b14461
2024-03-27 13:23:48 +01:00
Pedro Pinto Silva
b8a0eb472a Comment (Annotation): Fix inconsistent width
Before this commit annotations could have different widths. A comment
with a very short text - not filling a line - would result in a
abnormal narrow annotation card, screenshot of the observed bug:
https://archive.org/download/collabora-online-comment-width-bug/collabora-online-comment-width-bug.png

Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Change-Id: I7d51ebf53d5eb9e1361c59cee9ce9ba19e703299
2024-03-27 13:23:31 +01:00
Henry Castro
f66b820f39 drop additional activation of dark theme
we now load the document in the initial theme, so we don't need
this additional activation of the dark theme.

Change-Id: I523dda19cacd6fd3f81cd86ee554aacd5f73edea
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-03-27 11:45:08 +00:00
Darshan-upadhyay1110
201fbb5064 Create icon url before calling set image
- icon url passed inside `setImage` function was wrong
- line spacing icons are not correctly
- this patch will correct the url before setImage
Signed-off-by: Darshan-upadhyay1110 <darshan.upadhyay@collabora.com>
Change-Id: Ie733c79c4edae404d934953eaea20632bc18f8da
2024-03-27 12:29:20 +01:00
Gülşah Köse
941134cb45 Fix permanent tooltips on dialogs
Position and Size dialog of the shape has a rotation angle widget in
rotation tab. User can drag move instead only one click on the rotation
angle widget. It causes a permanent tooltip on document. So It is better
to handle mousedown instead click to close tooltip.

Signed-off-by: Gülşah Köse <gulsah.kose@collabora.com>
Change-Id: Idbea0bb8a56568a92f3f4d4c9ee6df1da01b7c24
2024-03-27 12:25:33 +01:00
Szymon Kłos
9923e69595 jsdialog: move helpers for scrollable bars to separate file
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I33454bc7d6a8f0c7e2346e36364fa39ba97f826c
2024-03-27 11:15:05 +01:00
Szymon Kłos
7e77251093 jsdialog: implement vertical separator
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I4225583e19dba332aff9f71ebec01cd84359ca98
2024-03-27 11:15:05 +01:00
Szymon Kłos
9e8010354b jsdialog: create spacer widget for toolbar
it allows to stretch content

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ie0fb906478e08165ae9e9412d9265bfdd64024bc
2024-03-27 11:15:05 +01:00
Szymon Kłos
fcd431f3e2 jsdialog: move container widgets to own file
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ice18e1d861140b20c1b161032fb89d0e107ca18e
2024-03-27 11:15:05 +01:00
Skyler Grey
bca4cbc15b Fix LOUtil.checkIfImageExists reprocessing errors
Previously, we would sometimes get the same error event mulitple times,
leading to us erroneously believing that an image which loaded correctly
was invalid. This caused images to sometimes disappear, particularly
when switching to dark mode.

Additionally, some images are critical to layout so even if they fail to
load we should not 'display: none' them. We can set their src to an
invisible pixel to get a similar effect. We must assume that they have
their width/height correctly set elsewhere or things such as the broken
image would also break the layout.

Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Change-Id: Id8e52416a60d394a00669e266595344eaa3376d2
2024-03-27 09:44:09 +00:00
Skyler Grey
3718221c5a Revert "userlist: Stop hiding images if load failed"
This reverts commit 1bb727c25fd96f279fde8effd250fee29535723c, which is
change ID I16172a4d3148390896e3d475b7810598d94ceb27

The commit was a quick fix for an issue where we would sometimes process
image errors multiple times, leading to us hiding them. In the next
commit, I modify checkIfImageExists to avoid this issue entirely,
meaning that the fix is no longer needed.

The dark mode SVG added in it was a duplicate of the light SVG so can
also be removed.

Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Change-Id: Ia5ea01f34a8b38472c885e5a8b7b227006bf9935
2024-03-27 09:44:09 +00:00
Pranam Lashkari
422ba3e333 annotation: fix calc mobile comment not visible
Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I37dc47e7daf991c1b2bb771fc1a96e939edd270d
2024-03-27 14:41:16 +05:30
Marco Cecchetti
959f9b5467 calc: fix regression due to core commit: 8f7dd2340b7
The core commit 'show cell cursor on in place editing' introduced a
regression: cell cursor messages grabs focus from the formula bar when
used for editing. The regression was causing the failure of
desktop/calc/focus_spec.js cypress unit test.

Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: If4274cc510af065feb7aa13806a86746302b22b2
2024-03-27 09:12:48 +01:00
Marco Cecchetti
acefa3f357 calc: fixed bogus cell view cursor overlay
On switching tab not clear other view messages saved for replay.
Added cypress unit tests for checking the cell view cursor bounds.

Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: I788828783a86038bb9d7f26648925b0e03bd560a
2024-03-26 20:34:45 +01:00
Skyler Grey
3685faad68 impress: comment movement: Fix undefined _map error
In Iea4d16918b054d355e6d8695e0dc1d6ededd6793, a regression was
introduced where we would check for a specific property of _map when
dragging anything. This was needed only in calc to determine the RTLness
of the sheet. Unfortunately, _map can sometimes be undefined (such as
when dragging around a comment in impress).

By moving the RTL check so it only executes if there is a map, we can
avoid this error, but the check will still run where it needs to.

Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Change-Id: I9994a3957e37975360126fab33ba08e807d723dd
2024-03-26 17:31:15 +00:00
Henry Castro
5210cf752f browser: fix dialog warning alerts
* Enable security.enable_macros_execution in coolwsd.xml.
* Open a file with a macro.
* Click Help.

Expected result: the popup dialog should not close

Change-Id: I3981c1ddbb3782dd9ee43dc0c9dce282d2f21392
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-03-26 09:20:18 -04:00
Szymon Kłos
c6d37405dc Format correctly tooltips
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Idf471bcd7753e6c18218dcaae4babc6cd423eab8
2024-03-25 20:25:01 +01:00
Andras Timar
0e3086ecc2 remove an unused image
It was part of the removed Vereign document signing feature.

Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I46e40c10f19a1f6bc821b51553d2a8276d2407fb
2024-03-25 17:46:23 +01:00
Skyler Grey
397c14841a Scroll: Cleanup dead code
Some code in this file is unused. In particular, the conditions to
fulfill touch scrolling will never be met since
I9016fc15ad3ccb3664af348fdcdca006495b0778, and the _performScroll
handler is never called. Let's delete it!

Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Change-Id: Id34380f09300935dcb74435d8d94104d235f6f21
2024-03-25 11:24:26 +00:00
Skyler Grey
de4d4c6e18 ScrollSection: fix panning with RTL
Previously we did not take into account whether something was RTL when
scrolling it with ScrollSection. By introduing a new isRTL function to
check this, we can do something different (in this case scrolling the
other direction) if we are controlling an element that should be RTL.

We need to introduce a function, as whether we are using RTL can change
over the lifetime of the ScrollSection

Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Change-Id: If4261a3e32375f6127241b846b97a3b4ac29eb0b
2024-03-25 11:24:26 +00:00
Skyler Grey
0a134f2a7a Draggable, TouchGesture: Fix panning with RTL
Previously when we were in RTL mode panning would be flipped. This
commit unflips it

Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Change-Id: Iea4d16918b054d355e6d8695e0dc1d6ededd6793
2024-03-25 11:24:26 +00:00
Szymon Kłos
ae5e33b30c remove-w2ui: convert presentation toolbar to JSDialogs
- it is on the left below slides list
- handle disabled state in CSS for regular unotoolbuttons

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Iebff6e7db0234a4f61c532397bab697c1071595d
2024-03-25 10:48:46 +01:00
Szymon Kłos
5355042687 remove-w2ui: convert sheets toolbar to JSDialog
- SheetsBar is on the bottom in Calc, with buttons + tabs
- add callabck for edit field - only fired after ENTER
  this fixes issue from FormulaBar conversion to JSDialog
- fix cypress mobile
- simplify CSS

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I7a286c87564e5ee0a89055ab4faa4daef9af31f5
2024-03-23 18:46:16 +01:00
Szymon Kłos
8777d33f34 dispatcher: fix print action
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: Ia92483fa900bde5b05383f72199b820a2b178c10
2024-03-23 18:46:16 +01:00
Gökay Şatır
c402ecd41a Introduce docdispatcher.js.
In order to handle commands in a more structured way.

Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: If7e2aed089cda1df59b2bf2b454b540d36391df0
2024-03-23 18:46:16 +01:00
Gökay Şatır
f44e0e0e3c Make use of shortcutDescriptors more.
In order to simplify keypress handling.

Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I2c5cfce5cb97ca8bbbbc28368deae708060bfbcc
2024-03-23 18:46:16 +01:00
Gökay Şatır
fadaa38985 Move the shortcut handler upper in the handler function.
To distinguish it from the local variables that it's not using.

Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: I1d1fe3a6506afd43cbfc8b1084a4d321f5d743d1
2024-03-23 18:46:16 +01:00
Gökay Şatır
10786103b1 Merge cmd into ctrl.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com>
Change-Id: Ie242d77bb3af20558d71cb0139d92ff069a8e794
2024-03-23 18:46:16 +01:00
Skyler Grey
391d68fc61 userlist: Stop hiding images if load failed
Previously there was no dark mode user SVG, which led to a failed load.

Additionally, we were using L.LOUtil.checkIfImageExists which sometimes
hides the image if it is unable to substitute it for a light mode one.
This caused the layout to fail as avatars were required to properly
space everything else.

By changing this so we provide both a dark and light mode user image, we
can avoid using the function which problematically hides the images in
this case.

Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Change-Id: I16172a4d3148390896e3d475b7810598d94ceb27
2024-03-22 15:49:00 +01:00
Skyler Grey
0163b4498e following-ui: dark: Make borders and text visible
Previously the borders and text of the following chip were hardcoded to
be black, but this doesn't work excellently in dark mode. Using the css
variable will make the text and user border always be a color that can
be read.

It may be sensible for us to also change the pool of following border
colors as they are all very dark, but that can wait for a future PR.

Signed-off-by: Skyler Grey <skyler.grey@collabora.com>
Change-Id: Ia2dcdf24ae12f5d45f59ef7ba3c2ed8e4ab5acf4
2024-03-22 15:49:00 +01:00
Andras Timar
6686aaa01a Remove unused viamapi-client.js file
It was part of the removed Vereign document signing feature.

Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ibe8a31102eaefcfba1898ad2f31226c24e12f330
2024-03-21 10:09:29 +00:00
Pranam Lashkari
581ce772ee fixed js console error
problem:
in impress get into textbox editing and then try to drag and move text box,
you get js error because map is null

regression from 9cf64b0726

Signed-off-by: Pranam Lashkari <lpranam@collabora.com>
Change-Id: I586c5f242241aa50f62c49371c994aeb7c370525
2024-03-21 13:58:03 +05:30
Darshan-upadhyay1110
868ba940aa accessebility: replace <span> tag with header tag in modal(js dialog) title
- The title of the modal window is currently marked with a <span> tag instead of an appropriate heading
tag (such as <h2> , <h3> , etc.).
 - This affects the semantic structure of the page and makes it difficult for
users with assistive technologies like screen readers to effectively navigate the page.
- The modal title is not recognized as such, which hinders orientation and understanding of the content.

- Solution:
    - replace <span> tag with <h2>(header tag) for `ui-dialog-title`.
    - to make font-size consistent added css rule for `ui-dialog-title`.

Note: this will change all js dialog title withg header tags ( not only specific to writer but also effeted for every document type)
Signed-off-by: Darshan-upadhyay1110 <darshan.upadhyay@collabora.com>
Change-Id: I5a1e276c3a129400aa5834e186a263db95f01833
2024-03-21 10:59:42 +05:30
Neil Guertin
9e5f6c17dc Fix copy-plain-container in cypress tests
Container was showing in cypress mobile tests.
In Calc, this blocked clicks from reaching the top left cell.

Signed-off-by: Neil Guertin <neil.guertin@collabora.com>
Change-Id: I7ceab551b7247962d9517f52560e6e03646511bf
2024-03-20 08:46:49 -04:00
Miklos Vajna
b14f3fffff cool#8465 clipboard: improve handling of plain text copy, complex case
In case the selection is complex (not simple), we used to just request
HTML, and then the browser converted that to plain text, which has the
downsides already mentioned in commit
7f9de46688 (cool#8465 clipboard: improve
handling of plain text copy, simple case, 2024-03-08).

Steps to support this:

1) Clipboard.js now asks for the text/html,text/plain;charset=utf-8 MIME
   types.

2) wsd: ClientRequestDispatcher::handleClipboardRequest() now maps this
   to DocumentBroker::CLIP_REQUEST_GET_HTML_PLAIN_ONLY

3) ClientSession::handleClipboardRequest() maps this to the HTML+plain
   text MIME type list.

4) kit: ChildSession::getClipboard() is now improved to take a list of
   MIME types, not just 1 or everything.

5) kit: ChildSession::getClipboard() now emits JSON in case not all, but
   multiple MIME types are requested.

6) wsd: ClientSession::postProcessCopyPayload() now knows how to
   postprocess clipboardcontent messages, which may or may not be JSON
   (it's JSON if more formats are requested explicitly, leaving the 1
   format or all format cases unchanged)

7) Control.DownloadProgress.js now handles the case when we get JSON and
   sets the core-provided plain text next to the HTML.

   Leave the handling of non-JSON case in, because this means we can
   copy from an old COOL server to a new one.

Note that this approach has the benefit that once the clipboard marker
is inserted, the length of the text/html format would change, which
means we can't parse the clipboard data till the marker is removed.
Emitting JSON for html+text means adding the marker keeps the ability to
parse the HTML and the plain text part of the clipboard in JS.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I67a1f669e8a638d34cc25a2f288a7b30884b9892
2024-03-20 10:21:59 +01:00
Szymon Kłos
d1e1f9d46d formulabar: make it a grid to not move on activation
this puts buttons and inputs at fixed positions so they
don't move when we enter formula editing mode

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I2dd99e3ac233b66847af0165359d15fb50a10a97
2024-03-19 17:39:24 +01:00
Szymon Kłos
bde997dfa8 remove-w2ui: use JSDialog for formulabar
- remove w2toolbar
- use JSDialog instead
- remove Leaflet class, use ES6 class

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I94fd17983cd727eefdd5b43f5b93d4319f15f3b0
2024-03-19 17:39:24 +01:00
Rashesh Padia
464358ca70 fix: data loss when shutting down while using typer
- Docbroker only uploads the document when the document is already saved and
  there are no further modifications.
- But when using typer once dockerbroker saves the document and tries to upload
  there are already new changes to the document. Therefore, docbroker keeps on
  saving this new changes and keeps on skiping the upload as there are new
  changes to the document; until it times out

Signed-off-by: Rashesh Padia <rashesh.padia@collabora.com>
Change-Id: I427d37a6228299006530daddebdf4365af63588b
2024-03-19 19:42:20 +05:30
Jaume Pujantell
bde21a35ab clipboard: do no compare wth invalid metapath
Copying from a document, closing it, reopening it and then pasting
did nothing.

The short-circuit for internal paste gave a false positive.

Signed-off-by: Jaume Pujantell <jaume.pujantell@collabora.com>
Change-Id: Ib21faf270d2ed03af2954f79bee8c1efbb0fd0ca
2024-03-19 14:19:06 +01:00
Szymon Kłos
355e6b30cd Add missing semicolon in getContentListRecursive
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I9ab0f302c8acfa272ac64434d64f64c3d09ad4f8
2024-03-19 10:51:42 +01:00
Szymon Kłos
26801321a8 notebookbar: a11y: open dropdown for MenuButtons
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I6fc7085975d13c144fdd543558c8fabfe2ed29b9
2024-03-19 10:51:42 +01:00
Szymon Kłos
4ef8fb4c9c jsdialog: allow to press dropdown arrow using keyboard in MenuButton
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I5a4c0e482fc632334a8041797368be3e6cf2e4e4
2024-03-19 10:51:42 +01:00
Szymon Kłos
b36af7d51f notebookbar: a11y: show accelerators for MenuButtons
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I1cec1f53153a35d50afee89906af1099df2a87cb
2024-03-19 10:51:42 +01:00