Commit graph

2984 commits

Author SHA1 Message Date
Andras Timar
2e035ee2cc loleaflet: fix wrong uno command name for opening hyperlink 2016-05-31 14:50:39 +02:00
Andras Timar
a5d79702a7 loleaflet: bccu#1862 remove Table -> Delete -> Table from impress menu
Apparently it does not work. In desktop version I cannot delete a table by
Select All + Cut, or Select All + Delete/Backspace key. Only Select All +
Delete Rows/Columns works...
2016-05-31 11:22:20 +02:00
Pranav Kant
7e1d3fe87e loleaflet: Consistency
Change-Id: I5962af5731199cf507da0eece0adc7b480f48ce0
2016-05-31 14:33:31 +05:30
Pranav Kant
d9019a2e79 loleaflet: Reuse html canvas spinner for slideshows
Move the spinner initialization to a separate class L.LOUtil.
Other similar LO related functions should also go there.

Also remove superfluous class leaflet-slideshow-spinner. It was
not being used anyway due to wrong spelling.

Change-Id: Ie8fac0391a9c6a3771900539e8f08d1b73b9be28
2016-05-31 14:30:22 +05:30
Ashod Nakashian
886af28bc2 loolwsd: improved random directory generator
Change-Id: Ic4ea88ba77549cc4ccba83c27fffdffcdeebb984
Reviewed-on: https://gerrit.libreoffice.org/25698
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-31 04:24:25 +00:00
Ashod Nakashian
8f3dcbcfb6 loolwsd: more secure random directories
Util::createRandomDirectory now uses /dev/urandom
(and a complex pseudo-random generator where missing)
to generate 64-byte long, Base64-encoded, names.

This should provide ample security compared to 64-bit
pseudo-random numbers hex-encoded, as was the case.

Change-Id: I714810a9fb03b5dcdbad7a15305940bf7457149e
Reviewed-on: https://gerrit.libreoffice.org/25696
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-31 00:57:52 +00:00
Henry Castro
58580a45ce loolwsd: test: update unit test getPartHashCodes 2016-05-30 20:26:40 -04:00
Henry Castro
0fe4c89e55 loleaflet: adjust partName and partHash 2016-05-30 20:23:54 -04:00
Henry Castro
19acaecfc7 loolwsd: bccu#1748, status: message send both ...
the partnames and hashes (for presentations)
2016-05-30 20:20:26 -04:00
Andras Timar
c542fedd0c loolwsd: add robots.txt (compliance) 2016-05-30 17:40:52 +02:00
Ashod Nakashian
c005f765bf loolwsd: reuse the same callback for now
Change-Id: I0f5ff42ed8c3ab422909d185089bfc31d5bb298b
Reviewed-on: https://gerrit.libreoffice.org/25663
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-30 11:29:10 +00:00
Ashod Nakashian
335611b0ff loolwsd: don't unlock too soon
Since rendering moved to centralized WSD<->Kit
processing, it runs on a different thread than
those processing the communication between
ClientSession and ChildSession. This introduces
a new race between events and tile rendering.

The shared ChildSession lock prevents this race
such that no events are processed while a tile
is rendered and, more importantly, response
is prepared and sent back. That preparation
could be lengthy due to png compression.

The typical race happens when two keystrokes
are entered in quick succession such that the
same tile is invalidated while it's rendered.
If the invalidation is processed in parallel
to rendering, it will find no cached image to
remove. It will reach the client, who will
request a new tile. Meanwhile, the first tile
is rendered and cached. By the time the second
request arrives we have a cache hit, albeit on
an outdated tile, missing the second character.

By locking until the tile response is sent we
ensure that the invalidate event will follow
it, and by then the image will have been cached.
The invalidation then removes the cached image
and the second tile request is forced to place
a new tile render request.

There is some inefficiency, it would seem, but
that is not really true, as Core is really
sequential anyway and we shouldn't process
events in parallel in the first place.

Change-Id: Id8170a41a7e69bca6ac8b520029b7cdb2d96c880
Reviewed-on: https://gerrit.libreoffice.org/25662
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-30 11:28:43 +00:00
Ashod Nakashian
763eee7040 loolwsd: batch tiles by row
Change-Id: Ib5ca8e1457d4e23aa09968f90ccd3bf10d189815
Reviewed-on: https://gerrit.libreoffice.org/25661
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-30 11:28:24 +00:00
Pranav Kant
08636e6c67 bccu#1768: loleaflet: Disable row/col headers menu while viewing
Change-Id: I89e0853b2a5e59ecf3e33c785991c5589d9c0864
2016-05-30 16:52:43 +05:30
Henry Castro
c24ee3669f loolwsd: deallocates more memory 2016-05-29 20:36:18 -04:00
Andras Timar
a4c8ceb1ac loleaflet: bccu#1856 disable View - Full screen on Edge, too 2016-05-30 00:43:04 +02:00
Andras Timar
6b57831673 loleaflet: fix js lint error 2016-05-30 00:29:47 +02:00
Andras Timar
1395d604dd loleaflet: bccu#1804 related: do not try to localize user defined style names 2016-05-30 00:13:19 +02:00
Henry Castro
2731e1fc02 loleaflet: bccu#1804 Style listbox does not get css styling 2016-05-29 17:19:51 -04:00
Andras Timar
c0098e5edd loleaflet: bccu#1836 disable View - Full screen menu item in IE11 2016-05-29 22:11:12 +02:00
Ashod Nakashian
e7078ef49b loolwsd: keep private things private
Reviewed-on: https://gerrit.libreoffice.org/25619
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
(cherry picked from commit 95b4807e05d0edd8caaa191b2230e363f15523bb)

Change-Id: I8fff570c9033bdc5694cec5a7056e9efc9de967a
Reviewed-on: https://gerrit.libreoffice.org/25624
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-29 17:34:40 +00:00
Ashod Nakashian
c4ae6da86f loolwsd: bccu#1687 - leaking loolkit processes
When conversion fails we still have to put
something in the save-as queue to avoid
hanging WSD forever.

Reviewed-on: https://gerrit.libreoffice.org/25618
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
(cherry picked from commit 0c6887c744fcd811728de43a971ee9c964d86e8e)

Change-Id: Ibc518bc922ee40f579a71e07571b21d9e633d998
Reviewed-on: https://gerrit.libreoffice.org/25623
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2016-05-29 16:48:10 +00:00
Andras Timar
055ab8d317 loleaflet: typo dcoument->document 2016-05-29 18:25:11 +02:00
Pranav Kant
3516f31031 bccu#1841 - Remove selection uno commands from impress menubar
... temporarily, till we have them.

Change-Id: I5f35e54a33a7a1c96359de59e326a286af655ddf
2016-05-29 15:16:12 +05:30
Pranav Kant
6831385c05 bccu#1850 - Help shadows all but menu bar
Change-Id: I156fde8e70421292e0bd134340eb01e1950853b7
2016-05-29 15:14:01 +05:30
Pranav Kant
eaf3461873 loleaflet: fix indent errors reported by bumped eslint
Change-Id: I49e274e1d4869d9d0a39342d9c3b64747a1fc870
2016-05-29 14:59:52 +05:30
Pranav Kant
6e45f4fbfb loleaflet: Bump eslint version to 2.8.0
Adjust config file, .eslintrc, accordingly; remove deprecated
options

Change-Id: I113606c5d1fdc4c46216b1fa340c957fd0e69308
2016-05-29 14:59:52 +05:30
Pranav Kant
3414ab2754 loleaflet: linting: fix errors in toolbar.js
Such a huge confusing diff is mainly due to moving of functions from bottom
to top because a function should be defined before it is used.

Other changes include using single quotes for strings, and other
minor style fixes.

Change-Id: Ieb8e5054a9c8113ec211973e086111d91759f80b
2016-05-29 14:58:38 +05:30
Pranav Kant
a7d3a8e9c3 loleaflet: Enable toolbar linting
Till now we have only been linting our src/ directory. toolbar.js
is the only file we edit directly in dist/. Lets keep a check on
it too.

Change-Id: I3e8a6e675a1d0c508339db1363600b5fe8f9c2cd
2016-05-29 14:36:25 +05:30
Pranav Kant
7460884df4 loleaflet: Remove superfluous entries
All files in dist/ are ignored already by our linting tool.
There's no point in list them here.

Change-Id: I0a3a67796d85506196eb13be347b1ff59bcae02f
2016-05-29 14:36:25 +05:30
Andras Timar
9c1ff7ef96 loleaflet: decide UI language early 2016-05-29 00:04:35 +02:00
Andras Timar
c508bff8df loleaflet: updated translations 2016-05-28 23:13:35 +02:00
Andras Timar
5e7d1166de loleaflet: slide layout English string change, in order to find translations 2016-05-28 20:19:01 +02:00
Andras Timar
eaf01b2f4c loleaflet: l10n of slide layouts 2016-05-28 18:48:13 +02:00
Andras Timar
62abb2533d loleaflet: bccu#1854 add optional 'lang' parameter to loleaflet.html 2016-05-28 11:04:57 +02:00
Henry Castro
ffd5f7eb5c loleaflet: rename style to layout combobox 2016-05-27 23:51:32 -04:00
Henry Castro
b1172c6b24 loleaflet: bccu#1799 Apply Styles does not work in Presentation 2016-05-26 21:39:12 -04:00
Jan Holesovsky
74c4e08a5f Minor visual tweak of the insert table (more space on the right). 2016-05-26 20:03:00 +02:00
Andras Timar
3db3c3c0fc Pull translations from Pootle 2016-05-26 19:15:09 +02:00
Andras Timar
da0e2e7463 loleaflet: move insert table button to 1st position of its section
The top left corner of dropdown table widget is near to the mouse
position where the user clicks. If Insert table button is too close
to egde of screen, it cannot be drawn properly.
2016-05-26 13:27:57 +02:00
Faruk Uzun
e6ea503885 loleaflet: bccu#1829: Fix some insert table button issues
- Use css for highlight cells.
- Close insert-table dialog on mouse leave.
- Better GUI
- More jQuery

Change-Id: I35e25f4ff150e373e70e7b14aa434d1dc055746a
2016-05-26 15:42:18 +05:30
Pranav Kant
cdd6147f56 loleaflet: Rework toolbar resize; fix an infinite loop
Set the min-width of window to 600px so that all select list
boxes remain in main toolbar, and not go in toolbar-more.

While resizing the toolbar, if the user tries to reduce the
window width past the min-width set, we would run into an
infinite loop causing spike in browser CPU usage and eventually
crash. This used to happen earlier also before setting this
min-width with very small browser window size.

Also simplify the toolbar resize algorithm. Rather than using raw
jquery methods to move items from one toolbar to another, use
library's (w2ui) methods to add/remove items from toolbar. This
also requires the need of proper initialization of few buttons
such as color picker, table picker because moving item from one
toolbar to another strips off the initialization corresponding to
these toolbar buttons and these need to be reinitialized. Moving
such initialization to onRefresh, hence, would keep them
initialized whenever toolbar is resized.

This also solves one major problem with enabled/disabled state of
toolbar buttons. Since, now, we are actually moving the items
from one toolbar to another, we can enable/disable them using
toolbar's methods ie. enable(), disable().

Change-Id: I64fb0a9d7761f66701bc0e020d1dbad9e4defe29
2016-05-26 14:31:01 +05:30
Pranav Kant
d915fc9310 loleaflet: Init font/back color on refresh
When these buttons are moved from toolbar-up to up-more and then
back they are not initialized.

Change-Id: Idc8c342092f723c3e50308988f8b2c070e0c08ad
2016-05-26 14:31:01 +05:30
Pranav Kant
d04a92fcf3 loleaflet: Check if clicked item is in toolbar-up-more
Change-Id: I8758f0195fcc9a2676597637c11efc9476d5093b
2016-05-26 14:31:01 +05:30
Pranav Kant
586b159902 loleaflet: Clean-up toolbar; fix en/dis-able button states
Use an object to keep track of enabled/disabled state of buttons.
This also prevents us looping all the format buttons everytime a
commandstatechanged is received, so better algorithmic
complexity.

For sessions in view-only mode, keep storing the state of these
buttons in this object, and use the stored states to
enable/disable buttons when edit lock is taken.

While enabling/disabling the toolbar buttons, also check in
toolbar-more.

Change-Id: I6555fde6669e1a8ba349c3213280a627a05d80b7
2016-05-26 14:31:01 +05:30
Henry Castro
39fe4e5580 loolwsd: test: add testFontList 2016-05-25 19:57:35 -04:00
Henry Castro
4379d2fc3b loleaflet: bccu#1798 Choice of styles in listbox limited to a few in presentation 2016-05-25 19:34:46 -04:00
Andras Timar
7f55c00df0 loleaflet: added translations (ca,cy,de,el,es,fr,hu,is,nb,nn,pt-br,sv) 2016-05-25 23:23:02 +02:00
Andras Timar
fdaae06f8b loleaflet: use browser language codes
Reference: http://www.metamodpro.com/browser-language-codes
I did not remove codes, that are not listed, e.g. ca-valencia,
kmr-Latn etc. They may be added in the future to browsers.
2016-05-25 22:57:27 +02:00
Pranav Kant
f8d36417d2 loleaflet: Regain focus after menubar selection
Change-Id: Ia0a5c81f5fe948a3552cfb36b82f9346f1b4969a
2016-05-25 17:20:50 +05:30