[Libreoffice-commits] online.git: loleaflet/src

2020-05-08 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.Notebookbar.js|   16 
 loleaflet/src/control/Control.NotebookbarCalc.js|3 ++-
 loleaflet/src/control/Control.NotebookbarImpress.js |6 --
 loleaflet/src/control/Control.NotebookbarWriter.js  |6 --
 loleaflet/src/layer/tile/TileLayer.js   |7 +++
 5 files changed, 33 insertions(+), 5 deletions(-)

New commits:
commit 5fd446863bec4f6cb61a58852135d27188792b8a
Author: Szymon Kłos 
AuthorDate: Fri May 8 15:18:19 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 8 16:26:20 2020 +0200

notebookbar: switch tab on context change

Change-Id: Ib485cfdbd06291de6b03a544fe0975f61823bf24
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93731
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.Notebookbar.js 
b/loleaflet/src/control/Control.Notebookbar.js
index 2be2c8443..7b62e1123 100644
--- a/loleaflet/src/control/Control.Notebookbar.js
+++ b/loleaflet/src/control/Control.Notebookbar.js
@@ -13,6 +13,8 @@ L.Control.Notebookbar = L.Control.extend({
 
this.createScrollButtons();
this.setupResizeHandler();
+
+   this.map.on('contextchange', this.onContextChange, this);
},
 
clearNotebookbar: function() {
@@ -129,4 +131,18 @@ L.Control.Notebookbar = L.Control.extend({
$(window).resize(handler);
$('.notebookbar-scroll-wrapper').scroll(handler);
},
+
+   onContextChange: function(event) {
+   var tabs = this.getTabs();
+   for (var tab in tabs) {
+   if (tabs[tab].context) {
+   var contexts = tabs[tab].context.split('|');
+   for (var context in contexts) {
+   if (contexts[context] === 
event.context) {
+   
this.selectedTab(tabs[tab].name);
+   }
+   }
+   }
+   }
+   }
 });
diff --git a/loleaflet/src/control/Control.NotebookbarCalc.js 
b/loleaflet/src/control/Control.NotebookbarCalc.js
index 08a7875cc..9dc98d183 100644
--- a/loleaflet/src/control/Control.NotebookbarCalc.js
+++ b/loleaflet/src/control/Control.NotebookbarCalc.js
@@ -27,7 +27,8 @@ L.Control.NotebookbarCalc = 
L.Control.NotebookbarWriter.extend({
{
'text': '~Home',
'id': '2',
-   'name': 'HomeLabel'
+   'name': 'HomeLabel',
+   'context': 'default|Cell'
},
{
'text': '~Insert',
diff --git a/loleaflet/src/control/Control.NotebookbarImpress.js 
b/loleaflet/src/control/Control.NotebookbarImpress.js
index f36ae8511..1ece53d51 100644
--- a/loleaflet/src/control/Control.NotebookbarImpress.js
+++ b/loleaflet/src/control/Control.NotebookbarImpress.js
@@ -62,7 +62,8 @@ L.Control.NotebookbarImpress = 
L.Control.NotebookbarWriter.extend({
{
'text': '~Home',
'id': '2',
-   'name': 'HomeLabel'
+   'name': 'HomeLabel',
+   'context': 'default|DrawText'
},
{
'text': '~Insert',
@@ -77,7 +78,8 @@ L.Control.NotebookbarImpress = 
L.Control.NotebookbarWriter.extend({
{
'text': '~Table',
'id': '8',
-   'name': 'TableLabel'
+   'name': 'TableLabel',
+   'context': 'Table'
}
];
},
diff --git a/loleaflet/src/control/Control.NotebookbarWriter.js 
b/loleaflet/src/control/Control.NotebookbarWriter.js
index 5351b1d08..a67461274 100644
--- a/loleaflet/src/control/Control.NotebookbarWriter.js
+++ b/loleaflet/src/control/Control.NotebookbarWriter.js
@@ -39,7 +39,8 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
{
'text': '~Home',
'id': '2',
-   'name': 'HomeLabel'
+   'name': 'HomeLabel',
+   'context': 'default|Text'
},
{
'text': '~Insert',
@@ -64,7 +65,8 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
{
'text': '~Table',
'id': '8',
-  

[Libreoffice-commits] online.git: loleaflet/src

2020-05-08 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.NotebookbarBuilder.js |   16 
 1 file changed, 16 insertions(+)

New commits:
commit 0197763d6f02ddb39b0f017b174582905ca75390
Author: Szymon Kłos 
AuthorDate: Fri May 8 11:24:10 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 8 15:22:24 2020 +0200

notebookbar: use proper save action

Change-Id: I83f777f2d47c554365a8aa0305be9b5ef0cb4650
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93709
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js 
b/loleaflet/src/control/Control.NotebookbarBuilder.js
index 4a91b8e56..809af3c35 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -41,6 +41,7 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
this._toolitemHandlers['.uno:ConditionalFormatMenu'] = 
this._conditionalFormatControl;
this._toolitemHandlers['.uno:SetDefault'] = 
this._clearFormattingControl;
this._toolitemHandlers['.uno:Presentation'] = 
this._startPresentationControl;
+   this._toolitemHandlers['.uno:Save'] = this._saveControl;
 
this._toolitemHandlers['.uno:SelectWidth'] = function() {};
this._toolitemHandlers['.uno:SetOutline'] = function() {};
@@ -389,6 +390,21 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
});
},
 
+   _saveControl: function(parentContainer, data, builder) {
+   var control = builder._unoToolButton(parentContainer, data, 
builder);
+
+   $(control.container).unbind('click');
+   $(control.container).click(function () {
+   // Save only when not read-only.
+   if (builder.map._permission !== 'readonly') {
+   builder.map.fire('postMessage', {msgId: 
'UI_Save'});
+   if 
(!builder.map._disableDefaultAction['UI_Save']) {
+   builder.map.save(false, false);
+   }
+   }
+   });
+   },
+
build: function(parent, data, hasVerticalParent, parentHasManyChildren) 
{
this._amendJSDialogData(data);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-08 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.NotebookbarBuilder.js |   17 +
 1 file changed, 17 insertions(+)

New commits:
commit 999b3de1ccef58535c84f9671435dee4264a59e2
Author: Szymon Kłos 
AuthorDate: Thu May 7 13:17:50 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 8 09:36:45 2020 +0200

notebookbar: hide unsupported items in impress

Change-Id: I54e4a15c32ef5876dd74df185cddf9341d9b8718
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93691
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js 
b/loleaflet/src/control/Control.NotebookbarBuilder.js
index 85fc98816..237e9c497 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -39,6 +39,7 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
this._toolitemHandlers['.uno:Paste'] = 
this._clipboardButtonControl;
this._toolitemHandlers['.uno:BasicShapes'] = 
this._shapesControl;
this._toolitemHandlers['.uno:ConditionalFormatMenu'] = 
this._conditionalFormatControl;
+   this._toolitemHandlers['.uno:SetDefault'] = 
this._clearFormattingControl;
 
this._toolitemHandlers['.uno:SelectWidth'] = function() {};
this._toolitemHandlers['.uno:SetOutline'] = function() {};
@@ -88,6 +89,22 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
this._toolitemHandlers['.uno:HideAllNotes'] = function() {};
this._toolitemHandlers['.uno:ShareDocument'] = function() {};
this._toolitemHandlers['.uno:EditDoc'] = function() {};
+   this._toolitemHandlers['.uno:AssignLayout'] = function() {};
+   this._toolitemHandlers['.uno:ConnectorToolbox'] = function() {};
+   this._toolitemHandlers['.uno:Presentation'] = function() {};
+   this._toolitemHandlers['.uno:PresentationCurrentSlide'] = 
function() {};
+   this._toolitemHandlers['.uno:PresentationLayout'] = function() 
{};
+   this._toolitemHandlers['.uno:FontworkGalleryFloater'] = 
function() {};
+   this._toolitemHandlers['.uno:CapturePoint'] = function() {};
+   this._toolitemHandlers['.uno:Objects3DToolbox'] = function() {};
+   this._toolitemHandlers['.uno:InsertMath'] = function() {};
+   this._toolitemHandlers['.uno:ShowAnnotations'] = function() {};
+   this._toolitemHandlers['.uno:DeleteAnnotation'] = function() {};
+   this._toolitemHandlers['.uno:NextAnnotation'] = function() {};
+   this._toolitemHandlers['.uno:PreviousAnnotation'] = function() 
{};
+   this._toolitemHandlers['.uno:AnimationEffects'] = function() {};
+   this._toolitemHandlers['.uno:OptimizeTable'] = function() {};
+   this._toolitemHandlers['.uno:TableDesign'] = function() {};
this._toolitemHandlers['vnd.sun.star.findbar:FocusToFindbar'] = 
function() {};
},
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-07 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.NotebookbarBuilder.js |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit e6cd3a0f35a28ae7efab281b2f881f515a0a083f
Author: Szymon Kłos 
AuthorDate: Wed May 6 16:59:17 2020 +0200
Commit: Szymon Kłos 
CommitDate: Thu May 7 15:33:47 2020 +0200

notebookbar: hide unsupported items in calc

Change-Id: Ib45c2aeca3bc921ce0fbdb469399d32ab3d4da1f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93620
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js 
b/loleaflet/src/control/Control.NotebookbarBuilder.js
index a07d5b3a1..85fc98816 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -82,6 +82,12 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
this._toolitemHandlers['.uno:DeleteComment'] = function() {};
this._toolitemHandlers['.uno:CompareDocuments'] = function() {};
this._toolitemHandlers['.uno:MergeDocuments'] = function() {};
+   this._toolitemHandlers['.uno:FunctionBox'] = function() {};
+   this._toolitemHandlers['.uno:EditAnnotation'] = function() {};
+   this._toolitemHandlers['.uno:ShowAllNotes'] = function() {};
+   this._toolitemHandlers['.uno:HideAllNotes'] = function() {};
+   this._toolitemHandlers['.uno:ShareDocument'] = function() {};
+   this._toolitemHandlers['.uno:EditDoc'] = function() {};
this._toolitemHandlers['vnd.sun.star.findbar:FocusToFindbar'] = 
function() {};
},
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-07 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.Notebookbar.js   |1 
 loleaflet/src/control/Control.NotebookbarWriter.js | 3382 -
 2 files changed, 3374 insertions(+), 9 deletions(-)

New commits:
commit 229b4f8121900556e2fb8aefa851acce72038107
Author: Szymon Kłos 
AuthorDate: Mon May 4 09:08:42 2020 +0200
Commit: Szymon Kłos 
CommitDate: Thu May 7 10:55:03 2020 +0200

notebookbar: add tabs data for writer

Change-Id: I62b0dbab881f8f77bb5fa3ce40bd93f8c8f79ffb
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93399
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.Notebookbar.js 
b/loleaflet/src/control/Control.Notebookbar.js
index 0fca7d1ca..f19d124f9 100644
--- a/loleaflet/src/control/Control.Notebookbar.js
+++ b/loleaflet/src/control/Control.Notebookbar.js
@@ -23,7 +23,6 @@ L.Control.Notebookbar = L.Control.extend({
 
loadTab: function(tabJSON) {
this.clearNotebookbar();
-   tabJSON = JSON.parse(tabJSON);
var builder = new L.control.notebookbarBuilder({mobileWizard: 
this, map: this.map, cssClass: 'notebookbar'});
 
var parent = $('#toolbar-up').get(0);
diff --git a/loleaflet/src/control/Control.NotebookbarWriter.js 
b/loleaflet/src/control/Control.NotebookbarWriter.js
index 17a443fee..5351b1d08 100644
--- a/loleaflet/src/control/Control.NotebookbarWriter.js
+++ b/loleaflet/src/control/Control.NotebookbarWriter.js
@@ -19,7 +19,7 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
case 'LayoutLabel':
this.loadTab(this.getLayoutTab());
break;
-   
+
case 'ReferencesLabel':
this.loadTab(this.getReferencesTab());
break;
@@ -33,7 +33,7 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
break;
}
},
-   
+
getTabs: function() {
return [
{
@@ -70,27 +70,3393 @@ L.Control.NotebookbarWriter = 
L.Control.Notebookbar.extend({
},
 
getHomeTab: function() {
-   return '';
+   return {
+   'id': 'NotebookBar',
+   'type': 'notebookbar',
+   'children': [
+   {
+   'id': 'box',
+   'type': 'container',
+   'children': [
+   {
+   'id': 
'ContextContainer',
+   'type': 'tabcontrol',
+   'children': [
+   {
+   'id': 
'',
+   'type': 
'tabpage',
+   
'children': [
+   
{
+   
'id': 'HomeBox',
+   
'type': 'container',
+   
'children': [
+   
{
+   
'id': 'Home-PasteBox',
+   
'type': 'container',
+   
'children': [
+   
{
+   
'id': 'FileSection7',
+   
'type': 'container',
+   
'children': [
+   
{
+   
'id': 'SectionBottom87',
+  

[Libreoffice-commits] online.git: loleaflet/src

2020-05-06 Thread Andras Timar (via logerrit)
 loleaflet/src/control/Control.DocumentNameInput.js |   14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

New commits:
commit 824331364c3d3d4521f7ba85a71990600df17f81
Author: Andras Timar 
AuthorDate: Wed May 6 17:20:59 2020 +0200
Commit: Andras Timar 
CommitDate: Wed May 6 17:45:26 2020 +0200

Android: fix that app shows temporary file name "LibreOffice..."

Change-Id: I5505b52f2fcf62ab8c99d0e5c7667a5e913b62dd
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93577
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.DocumentNameInput.js 
b/loleaflet/src/control/Control.DocumentNameInput.js
index 3e2b20ec2..e11d6bf95 100644
--- a/loleaflet/src/control/Control.DocumentNameInput.js
+++ b/loleaflet/src/control/Control.DocumentNameInput.js
@@ -52,22 +52,20 @@ L.Control.DocumentNameInput = L.Control.extend({
this.documentNameCancel();
}
},
-   
+
onDocumentNameFocus: function() {
// hide the caret in the main document
this.map._onLostFocus();
},
 
onDocLayerInit: function() {
-   if (window.mode.isMobile() || window.mode.isTablet()) {
-   if (!window.ThisIsAMobileApp)
-   $('#document-name-input').hide();
-   else
-   $('#document-name-input').show();
+   // FIXME: Android app would display a temporary filename, not 
the actual filename
+   if (window.ThisIsTheAndroidApp) {
+   $('#document-name-input').hide();
} else {
$('#document-name-input').show();
}
-   
+
if (window.ThisIsAMobileApp) {
// We can now set the document name in the menu bar
$('#document-name-input').prop('disabled', false);
@@ -88,7 +86,7 @@ L.Control.DocumentNameInput = L.Control.extend({
// set the document name into the name field
$('#document-name-input').val(e.BaseFileName);
}
-   
+
if (e.UserCanNotWriteRelative === false) {
// Save As allowed
$('#document-name-input').prop('disabled', false);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-06 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.MobileWizard.js |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit d7f66bf318291a7288ce56a413e009cde79fe0d4
Author: Szymon Kłos 
AuthorDate: Wed May 6 13:03:35 2020 +0200
Commit: Szymon Kłos 
CommitDate: Wed May 6 15:31:07 2020 +0200

Always show slide sorter above mobile wizard in impress

Bugfix: when menu was opened in impress before
mobile wizard then slide sorter was missing.
This patch makes it visible.

Change-Id: Iad5efc156796458402f859e5c3b3245872f33017
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93561
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.MobileWizard.js 
b/loleaflet/src/control/Control.MobileWizard.js
index fa04d7b77..3f59a0606 100644
--- a/loleaflet/src/control/Control.MobileWizard.js
+++ b/loleaflet/src/control/Control.MobileWizard.js
@@ -327,6 +327,9 @@ L.Control.MobileWizard = L.Control.extend({
this._lastSidebarData = dataString;
}
 
+   if (this.map.getDocType() === 'presentation')
+   $('#mobile-wizard-header').show();
+
this._isActive = true;
var currentPath = null;
var lastScrollPosition = null;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-06 Thread Pranam Lashkari (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |7 ---
 1 file changed, 7 deletions(-)

New commits:
commit 070c5ce5688df6b755e2f99d3c4fd834ea813f12
Author: Pranam Lashkari 
AuthorDate: Thu Apr 30 15:51:16 2020 +0530
Commit: Andras Timar 
CommitDate: Wed May 6 13:14:24 2020 +0200

leaflet: resolved Choosing Solid transparency for a shape makes no 
difference

Change-Id: Iac72fbe4b31f0844df469c87c2ead598ed0cbe1a
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93202
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index ce201afdd..2390d11e1 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1120,13 +1120,6 @@ L.Control.JSDialogBuilder = L.Control.extend({
return String(state.replace(',', '.') / 100.0);
}
break;
-
-   case 'transtype':
-   state = 
items.getItemValue('.uno:FillFloatTransparence');
-   if (state) {
-   return 
builder._gradientStyleToLabel(state.style);
-   }
-   break;
}
 
return null;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-06 Thread Tomaž Vajngerl (via logerrit)
 loleaflet/src/control/Ruler.js |   24 ++--
 1 file changed, 14 insertions(+), 10 deletions(-)

New commits:
commit 73a62f189855a2e502fbeff716b6745bbd3f0cbb
Author: Tomaž Vajngerl 
AuthorDate: Wed May 6 09:32:18 2020 +0200
Commit: Andras Timar 
CommitDate: Wed May 6 13:05:17 2020 +0200

ruler: workaround adding a tab-stop on mobile

On mobile, don't show a menu, but add the tab-stop immediately
when long-press event is sent.

Change-Id: Iedd019a40a891d57467d333239b9cb79317cda2d
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93547
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js
index 7d41d7e66..3c849aaad 100644
--- a/loleaflet/src/control/Ruler.js
+++ b/loleaflet/src/control/Ruler.js
@@ -533,17 +533,21 @@ L.Control.Ruler = L.Control.extend({
_onTabstopContainerLongPress: function(event) {
var pointX = event.center.x - 
event.target.getBoundingClientRect().left;
this.currentPositionInTwips = 
this._map._docLayer._pixelsToTwips({x: pointX, y:0}).x;
-
-   $.contextMenu({
-   selector: '.loleaflet-ruler-tabstopcontainer',
-   className: 'loleaflet-font',
-   items: {
-   inserttabstop: {
-   name: _('Insert tabstop'),
-   callback: 
(this._insertTabstop).bind(this)
+   if (window.mode.isMobile() || window.mode.isTablet()) {
+   this._insertTabstop();
+   }
+   else {
+   $.contextMenu({
+   selector: '.loleaflet-ruler-tabstopcontainer',
+   className: 'loleaflet-font',
+   items: {
+   inserttabstop: {
+   name: _('Insert tabstop'),
+   callback: 
(this._insertTabstop).bind(this)
+   }
}
-   }
-   });
+   });
+   }
},
 
_insertTabstop: function() {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-06 Thread Szymon Kłos (via logerrit)
 loleaflet/src/map/handler/Map.TouchGesture.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f30f66efafca73386f56dc3723a05660b3d16f5e
Author: Szymon Kłos 
AuthorDate: Tue Mar 31 12:14:40 2020 +0200
Commit: Szymon Kłos 
CommitDate: Wed May 6 09:59:36 2020 +0200

jsdialog: close mobilewizard before all dialogs

Mobilewizard has reference to the last window so in
case of message box it will be closed first.
This prevent us from closing parent window before child
as we close all windows in closePopups.

Change-Id: I9887b56374f2fc7e1cabb46d97e2c8ee03511596
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93517
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js 
b/loleaflet/src/map/handler/Map.TouchGesture.js
index cff7eeffe..2a17360e2 100644
--- a/loleaflet/src/map/handler/Map.TouchGesture.js
+++ b/loleaflet/src/map/handler/Map.TouchGesture.js
@@ -309,7 +309,6 @@ L.Map.TouchGesture = L.Handler.extend({
return;
}
 
-   this._map.fire('closepopups');
this._map.fire('closemobilewizard');
 
// The validity dropdown marker icon (exists only in calc) 
needs to be notified of tap events if it is the target.
@@ -320,6 +319,7 @@ L.Map.TouchGesture = L.Handler.extend({
return;
}
 
+   this._map.fire('closepopups');
this._map.fire('editorgotfocus');
 
var docLayer = this._map._docLayer;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-05 Thread Marco Cecchetti (via logerrit)
 loleaflet/src/control/Control.LokDialog.js |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit ac0c36f26fa9725e893e92a63d16b9cf02412cd9
Author: Marco Cecchetti 
AuthorDate: Tue May 5 23:12:20 2020 +0200
Commit: Marco Cecchetti 
CommitDate: Wed May 6 00:03:32 2020 +0200

leaflet: calc: handle calc formula bar offset position (mobile case)

Change-Id: I54f39760761f48bda1dee0eec65f723979c2f3dd
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93520
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Marco Cecchetti 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 6841c5087..43a8ee7f4 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -1198,6 +1198,8 @@ L.Control.LokDialog = L.Control.extend({
endHandle.isDragged = false;
 
var point = L.DomEvent.getMousePosition(ev.srcEvent, 
handles);
+   point.x += that._calcInputBar.left;
+   point.y += that._calcInputBar.top;
 
that._postWindowMouseEvent('buttondown', id, point.x, 
point.y, 1, 1, 0);
that._postWindowMouseEvent('buttonup', id, point.x, 
point.y, 1, 1, 0);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-05 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |1 +
 1 file changed, 1 insertion(+)

New commits:
commit f4fe439043e9ad4d7be20afc43dd36b76ccad2c5
Author: Szymon Kłos 
AuthorDate: Tue Mar 31 12:17:20 2020 +0200
Commit: Szymon Kłos 
CommitDate: Tue May 5 21:04:22 2020 +0200

jsdialog: show ok button in message boxes

Change-Id: I4f57b6cc0275875150a6cd1c944e2d12394a59a4
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93516
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 5084bf66a..ce201afdd 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -128,6 +128,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
this._controlHandlers['edit'] = this._editControl;
this._controlHandlers['multilineedit'] = 
this._multiLineEditControl;
this._controlHandlers['pushbutton'] = this._pushbuttonControl;
+   this._controlHandlers['okbutton'] = this._pushbuttonControl;
this._controlHandlers['combobox'] = this._comboboxControl;
this._controlHandlers['comboboxentry'] = this._comboboxEntry;
this._controlHandlers['listbox'] = this._listboxControl;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-05 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 361edbbf6dbcd40e60a32a16973d3aef472b0470
Author: Szymon Kłos 
AuthorDate: Tue Mar 24 14:53:35 2020 +0100
Commit: Szymon Kłos 
CommitDate: Tue May 5 20:34:36 2020 +0200

jsdialog: handle treelistbox

Change-Id: I89da1b60591f8a83413b0d25ec75812120ab5f11
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93465
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index d96b52d03..4263e6ce1 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -151,6 +151,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
this._controlHandlers['divcontainer'] = 
this._divContainerHandler;
this._controlHandlers['colorlistbox'] = this._colorControl;
this._controlHandlers['borderstyle'] = this._borderControl;
+   this._controlHandlers['treelistbox'] = this._listboxControl;
 
this._controlHandlers['mainmenu'] = this._containerHandler;
this._controlHandlers['submenu'] = this._subMenuHandler;
@@ -1373,14 +1374,17 @@ L.Control.JSDialogBuilder = L.Control.extend({
 
var title = data.text;
var valueNode = null;
+   var selectedEntryIsString = false;
if (data.selectedEntries) {
+   selectedEntryIsString = 
isNaN(parseInt(data.selectedEntries[0]));
if (title && title.length) {
var value = 
data.entries[data.selectedEntries[0]];
valueNode = L.DomUtil.create('div', '', null);
valueNode.innerHTML = value;
-   } else {
+   } else if (selectedEntryIsString)
+   title = 
builder._cleanText(data.selectedEntries[0]);
+   else
title = data.entries[data.selectedEntries[0]];
-   }
}
title = builder._cleanText(title);
data.text = title;
@@ -1389,6 +1393,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
for (var index in data.entries) {
var style = 'ui-combobox-text';
if ((data.selectedEntries && index == 
data.selectedEntries[0])
+   || (data.selectedEntries && 
selectedEntryIsString && data.entries[index] === data.selectedEntries[0])
|| data.entries[index] == title) {
style += ' selected';
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-05 Thread Marco Cecchetti (via logerrit)
 loleaflet/src/control/Control.LokDialog.js |   46 ++---
 1 file changed, 29 insertions(+), 17 deletions(-)

New commits:
commit 25501927dc81811a6414b7df3c79412328223fe2
Author: Marco Cecchetti 
AuthorDate: Sat May 2 15:13:58 2020 +0200
Commit: Marco Cecchetti 
CommitDate: Tue May 5 11:53:49 2020 +0200

leaflet: calc: handle calc formula bar offset position

Change-Id: I5c48c51aa49247a4452580e9619a0f2db8d740ec
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93404
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Marco Cecchetti 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 9c92895b2..6841c5087 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -294,7 +294,7 @@ L.Control.LokDialog = L.Control.extend({
this._launchDialog(e.id, left, top, width, 
height, e.title);
} else if (e.winType === 'calc-input-win') {
lines = parseInt(e.lines);
-   this._launchCalcInputBar(e.id, width, height, 
lines);
+   this._launchCalcInputBar(e.id, left, top, 
width, height, lines);
} else if (e.winType === 'deck') {
if (!window.mode.isMobile()) {
this._launchSidebar(e.id, width, 
height);
@@ -368,7 +368,9 @@ L.Control.LokDialog = L.Control.extend({
this._launchSidebar(e.id, width, height);
} else if (e.winType === 'calc-input-win' || 
this.isCalcInputBar(e.id)) {
lines = parseInt(e.lines);
-   this._launchCalcInputBar(e.id, width, height, 
lines);
+   left = left | this._calcInputBar.left;
+   top = top | this._calcInputBar.top;
+   this._launchCalcInputBar(e.id, left, top, 
width, height, lines);
}
else {
$('#' + strId).remove();
@@ -804,21 +806,22 @@ L.Control.LokDialog = L.Control.extend({
this._sendPaintWindow(id, this._createRectStr(id));
},
 
-   _launchCalcInputBar: function(id, width, height, textLines) {
-   console.log('_launchCalcInputBar: start: id: ' + id + ', width: 
' + width + ', height: ' + height + ', textLines: ' + textLines);
+   _launchCalcInputBar: function(id, left, top, width, height, textLines) {
+   console.log('_launchCalcInputBar: start: id: ' + id + ', left: 
' + left + ', top: ' + top
+   + ', width: ' + width + ', height: ' + height + ', 
textLines: ' + textLines);
if (!this._calcInputBar || this._calcInputBar.id !== id) {
if (this._calcInputBar)
$('#' + this._calcInputBar.strId).remove();
-   this._createCalcInputbar(id, width, height, textLines);
+   this._createCalcInputbar(id, left, top, width, height, 
textLines);
} else {
// Update in-place. We will resize during rendering.
-   this._adjustCalcInputBar(id, width, height, textLines);
+   this._adjustCalcInputBar(id, left, top, width, height, 
textLines);
}
 
console.log('_launchCalcInputBar: end');
},
 
-   _adjustCalcInputBar: function(id, width, height, textLines) {
+   _adjustCalcInputBar: function(id, left, top, width, height, textLines) {
if (this._calcInputBar) {
var oldHeight = this._calcInputBar.height;
var delta = height - oldHeight;
@@ -827,17 +830,17 @@ L.Control.LokDialog = L.Control.extend({
 
// Recreate the input-bar.
$('#' + this._calcInputBar.strId).remove();
-   this._createCalcInputbar(id, width, height, 
textLines);
+   this._createCalcInputbar(id, left, top, width, 
height, textLines);
 
// Resize the container.
var documentContainer = 
L.DomUtil.get('document-container');
if (documentContainer) {
-   var top = documentContainer.offsetTop;
+   var offsetTop = 
documentContainer.offsetTop;
var noTopProp = true;
var props = 
documentContainer.style.cssText.split(';');
for (var i = 0; i < props.length; ++i) {
if (prop

[Libreoffice-commits] online.git: loleaflet/src

2020-05-04 Thread Aron Budea (via logerrit)
 loleaflet/src/map/Clipboard.js |3 ---
 loleaflet/src/map/Map.js   |4 
 2 files changed, 7 deletions(-)

New commits:
commit d85426df88231b2dba012a645cb1ec7cee3efffc
Author: Aron Budea 
AuthorDate: Tue May 5 00:48:33 2020 +0200
Commit: Aron Budea 
CommitDate: Tue May 5 01:10:31 2020 +0200

Revert "tdf#132125: Pasting into comment pastes...

...into document instead"

It wasn't pasting in correct format when there was no comment,
and the fix has to be extended to Calc/Impress as well.

This reverts commit 9baea8eb9b32e7554a5c81af10eb5e354b6da1d8.

Change-Id: I694700aab0a12d9f2eda5e99b84bfc7e679d7b9c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93450
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/loleaflet/src/map/Clipboard.js b/loleaflet/src/map/Clipboard.js
index b7c45e939..700369d29 100644
--- a/loleaflet/src/map/Clipboard.js
+++ b/loleaflet/src/map/Clipboard.js
@@ -656,9 +656,6 @@ L.Clipboard = L.Class.extend({
if (isAnyVexDialogActive() && !this._map.hasFocus())
return;
 
-   if (this._map.isEditingAnnotation())
-   return;
-
// If the focus is in the search box, paste there.
if (this._map.isSearching())
return;
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 3b2b3b719..982cde654 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -966,10 +966,6 @@ L.Map = L.Evented.extend({
return this._isSearching;
},
 
-   isEditingAnnotation: function() {
-   return this._docLayer._annotations.isEdit();
-   },
-
_fireInitComplete: function (condition) {
if (this.initComplete) {
return;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-04 Thread Henry Castro (via logerrit)
 loleaflet/src/map/handler/Map.WOPI.js |8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

New commits:
commit 0d23d91fe3b8e25fd0c2c1049df2e31ac98369ed
Author: Henry Castro 
AuthorDate: Mon May 4 11:07:01 2020 -0400
Commit: Henry Castro 
CommitDate: Mon May 4 18:01:36 2020 +0200

loleaflet: fix the regular expression to match the ancestor's origin

A better fix to allow the ancestor frame does not block uploading images
from cloud storage for FireFox and IE browsers

Change-Id: Id69c4e0d1479f7c098e7774bdb220a631dc25855
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93430
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 
Reviewed-by: Michael Meeks 

diff --git a/loleaflet/src/map/handler/Map.WOPI.js 
b/loleaflet/src/map/handler/Map.WOPI.js
index a65a6030b..da79219e8 100644
--- a/loleaflet/src/map/handler/Map.WOPI.js
+++ b/loleaflet/src/map/handler/Map.WOPI.js
@@ -166,7 +166,7 @@ L.Map.WOPI = L.Handler.extend({
this._allowedOrigins = ancestors;
// convert to JS regexps from localhost:* to 
https*://localhost:.*
for (i = 0; i < ancestors.length; i++) {
-   this._allowedOrigins[i] = 'https*://' + 
ancestors[i].replace(/:\*/, ':.*');
+   this._allowedOrigins[i] = '(http|https)://' + 
ancestors[i].replace(/:\*/, ':?.*');
}
}
 
@@ -189,12 +189,6 @@ L.Map.WOPI = L.Handler.extend({
return true;
}
 
-   var origin = window.location.protocol + '//' + 
window.location.hostname;
-   if (origin === e.origin) {
-   this._cachedGoodOrigin = e.origin;
-   return true;
-   }
-
return false;
},
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-04 Thread Muhammet Kara (via logerrit)
 loleaflet/src/control/Toolbar.js |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 8eb191036287084034f4d127bbdf3d147330ebf9
Author: Muhammet Kara 
AuthorDate: Mon May 4 17:09:26 2020 +0300
Commit: Muhammet Kara 
CommitDate: Mon May 4 17:26:35 2020 +0200

Welcome: prevent the welcome message being circumvented

* Repro:
- Open a document on a welcome-message-enabled system
- You'll get the message at this point, don't accept it
- Close the app or browser, or navigate away
- Open the file again
-> No message, session opens

* Now the cookie is created only when the dialog is closed

Change-Id: Ifa3eb45a24747212a3b741c7a5277e16c70ed44e
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93426
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Muhammet Kara 

diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index 61d63eed3..c30abc500 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -345,7 +345,7 @@ L.Map.include({
},
 
// show the actual welcome dialog with the given data
-   _showWelcomeDialogVex: function(data) {
+   _showWelcomeDialogVex: function(data, calledFromMenu) {
var w;
var iw = window.innerWidth;
var hasDismissBtn = window.enableWelcomeMessageButton;
@@ -400,6 +400,12 @@ L.Map.include({
$('.vex-overlay').css({ 'pointer-events': 
'none'});
},
beforeClose: function () {
+   if (!calledFromMenu) {
+   var WSDVerCookie = 'WSDWelcomeVersion=' 
+ map._socket.WSDServer.Version;
+   // Cookie will not expire for a year, 
and it will not be sent to other domains
+   WSDVerCookie += '; max-age=31536000; 
SameSite=Strict; path=/loleaflet';
+   document.cookie = WSDVerCookie;
+   }
map.focus();
map.enable(true);
}
@@ -414,13 +420,7 @@ L.Map.include({
var map = this;
$.get(welcomeLocation)
.done(function(data) {
-   map._showWelcomeDialogVex(data);
-   if (!calledFromMenu) {
-   var WSDVerCookie = 'WSDWelcomeVersion=' 
+ map._socket.WSDServer.Version;
-   // Cookie will not expire for a year, 
and it will not be sent to other domains
-   WSDVerCookie += '; max-age=31536000; 
SameSite=Strict; path=/loleaflet';
-   document.cookie = WSDVerCookie;
-   }
+   map._showWelcomeDialogVex(data, calledFromMenu);
})
.fail(function() {
// Welcome dialog disabled in loolwsd.xml or 
nonexistant for some other reason
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-04 Thread Pranam Lashkari (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |2 +-
 loleaflet/src/core/Util.js   |7 +++
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 85f09360d8f3d4b68f7f533d4cef5203fc58413f
Author: Pranam Lashkari 
AuthorDate: Wed Jan 29 02:35:02 2020 +0530
Commit: Michael Meeks 
CommitDate: Mon May 4 13:59:47 2020 +0200

Follow up for  be48005

substr method replaced with startsWith for more readability and optimisation

Change-Id: I205a843359942ef7dea92333eaf2076ab2080983
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87661
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 7573c1376..e10211306 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1891,7 +1891,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
}
 
var icon = null;
-   var commandName = data.command && data.command.substring(0, 
'.uno:'.length) === '.uno:' ? data.command.substring('.uno:'.length) : data.id;
+   var commandName = data.command && 
data.command.startsWith('.uno:') ? data.command.substring('.uno:'.length) : 
data.id;
if (commandName && commandName.length && 
L.LOUtil.existsIconForCommand(commandName, builder.map.getDocType())) {
var iconName = 
builder._generateMenuIconName(commandName);
var iconSpan = L.DomUtil.create('span', 
'menu-entry-icon ' + iconName, menuEntry);
diff --git a/loleaflet/src/core/Util.js b/loleaflet/src/core/Util.js
index e504c92c5..0ea2b0ff6 100644
--- a/loleaflet/src/core/Util.js
+++ b/loleaflet/src/core/Util.js
@@ -244,6 +244,13 @@ L.Util = {
L.Util.MIN_SAFE_INTEGER = -L.Util.MAX_SAFE_INTEGER;
 })();
 
+if (!String.prototype.startsWith) {
+   String.prototype.startsWith = function(searchString, position) {
+   position = position || 0;
+   return this.substr(position, searchString.length) === 
searchString;
+   };
+}
+
 // shortcuts for most used utility functions
 L.extend = L.Util.extend;
 L.bind = L.Util.bind;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-04 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.NotebookbarBuilder.js |4 
 1 file changed, 4 insertions(+)

New commits:
commit 389a5e8674edc527a22e083a5350d9a925752db6
Author: Szymon Kłos 
AuthorDate: Mon May 4 09:40:40 2020 +0200
Commit: Szymon Kłos 
CommitDate: Mon May 4 10:27:13 2020 +0200

notebookbar: hide unsupported items from review tab

Change-Id: I730a68b46e0a7a896a068e5e2fff4e7d5ea3dc86
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93400
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js 
b/loleaflet/src/control/Control.NotebookbarBuilder.js
index a651b7255..011cc61bb 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -77,6 +77,10 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
this._toolitemHandlers['.uno:LineStyle'] = function() {};
this._toolitemHandlers['.uno:InsertFormula'] = function() {};
this._toolitemHandlers['.uno:AutoSum'] = function() {};
+   this._toolitemHandlers['.uno:ReplyComment'] = function() {};
+   this._toolitemHandlers['.uno:DeleteComment'] = function() {};
+   this._toolitemHandlers['.uno:CompareDocuments'] = function() {};
+   this._toolitemHandlers['.uno:MergeDocuments'] = function() {};
this._toolitemHandlers['vnd.sun.star.findbar:FocusToFindbar'] = 
function() {};
},
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-02 Thread Ashod Nakashian (via logerrit)
 loleaflet/src/control/Control.LokDialog.js |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit 2ccb0c2b0a84242251f440c1f18bfba9dc1b7f84
Author: Ashod Nakashian 
AuthorDate: Mon Apr 27 10:01:14 2020 -0400
Commit: Andras Timar 
CommitDate: Sat May 2 22:59:26 2020 +0200

leaflet: re-align child popups to avoid trimming

When a child's origin is such that its width
overflows its parent, we move it left such that
it fits the parent and doesn't get trimmed.

Change-Id: Ica8e0e9c8ce994aeb00704eb38ce3485db7cbd59
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92995
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index dd0a78113..9c92895b2 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -1513,6 +1513,17 @@ L.Control.LokDialog = L.Control.extend({
if (!canvas)
return; // no floating window to paint to
 
+   // Make sure the child is not trimmed on the right.
+   var width = this._dialogs[parentId].childwidth;
+   var left = this._dialogs[parentId].childx;
+   var dialogContainer = L.DomUtil.get(strId).parentNode;
+   if (left + width > dialogContainer.clientWidth) {
+   // Align the right of the child to the right of the 
parent.
+   left -= Math.max(0, (left + width) - 
dialogContainer.clientWidth);
+   this._dialogs[parentId].childx = left;
+   L.DomUtil.setStyle(canvas, 'left', left + 'px');
+   }
+
// The image is rendered per the HiDPI scale we used
// while requesting rendering the image. Here we
// set the canvas to have the actual size, while
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-01 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.NotebookbarBuilder.js |   28 +++-
 1 file changed, 27 insertions(+), 1 deletion(-)

New commits:
commit 7af518127b7fe90370433156a04a2b47b78e10f7
Author: Szymon Kłos 
AuthorDate: Wed Apr 29 07:45:08 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 1 19:46:09 2020 +0200

notebookbar: insert graphic menu

Change-Id: If14b2fdacc7e317eed0a557669a8bdf8c5ab69cf
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93288
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js 
b/loleaflet/src/control/Control.NotebookbarBuilder.js
index 34e08d834..3751ec75f 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -3,7 +3,7 @@
  * L.Control.NotebookbarBuilder
  */
 
-/* global $ _ */
+/* global $ _ _UNO */
 L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
 
_customizeOptions: function() {
@@ -29,6 +29,7 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
this._toolitemHandlers['.uno:FillColor'] = this._colorControl;
 
this._toolitemHandlers['.uno:InsertTable'] = 
this._insertTableControl;
+   this._toolitemHandlers['.uno:InsertGraphic'] = 
this._insertGraphicControl;
 
this._toolitemHandlers['.uno:SelectWidth'] = function() {};
 
@@ -195,6 +196,31 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
});
},
 
+   _insertGraphicControl: function(parentContainer, data, builder) {
+   var control = builder._unoToolButton(parentContainer, data, 
builder);
+
+   $(control.container).unbind('click');
+   $(control.container).click(function () {
+   if (builder.map['wopi'].EnableInsertRemoteImage) {
+   $(control.container).w2menu({
+   items: [
+   {id: 'localgraphic', text: 
_('Insert Local Image')},
+   {id: 'remotegraphic', text: 
_UNO('.uno:InsertGraphic', '', true)}
+   ],
+   onSelect: function (event) {
+   if (event.item.id === 
'localgraphic') {
+   
L.DomUtil.get('insertgraphic').click();
+   } else if (event.item.id === 
'remotegraphic') {
+   
builder.map.fire('postMessage', {msgId: 'UI_InsertGraphic'});
+   }
+   }
+   });
+   } else {
+   L.DomUtil.get('insertgraphic').click();
+   }
+   });
+   },
+
build: function(parent, data, hasVerticalParent, parentHasManyChildren) 
{
this._amendJSDialogData(data);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-01 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.Notebookbar.js|   30 
 loleaflet/src/control/Control.NotebookbarBuilder.js |7 
 2 files changed, 37 insertions(+)

New commits:
commit b60009ed2b8f507111920c893dd5ea01d2b8d66b
Author: Szymon Kłos 
AuthorDate: Tue Apr 28 08:46:49 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 1 18:34:18 2020 +0200

notebookbar: override visible tabs

Change-Id: Ib71a8d75e3b6355d9ffa0a6be1eb695c01f0b1ff
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93284
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.Notebookbar.js 
b/loleaflet/src/control/Control.Notebookbar.js
index 087823cce..c2c9b4049 100644
--- a/loleaflet/src/control/Control.Notebookbar.js
+++ b/loleaflet/src/control/Control.Notebookbar.js
@@ -63,6 +63,36 @@ L.Control.Notebookbar = L.Control.extend({
break;
}
},
+   
+   getTabs: function() {
+   return [
+   {
+   'text': '~Home',
+   'id': '2',
+   'name': 'HomeLabel'
+   },
+   {
+   'text': '~Insert',
+   'id': '3',
+   'name': 'InsertLabel'
+   },
+   {
+   'text': '~Layout',
+   'id': '4',
+   'name': 'LayoutLabel'
+   },
+   {
+   'text': 'Reference~s',
+   'id': '5',
+   'name': 'ReferencesLabel'
+   },
+   {
+   'text': '~Table',
+   'id': '8',
+   'name': 'TableLabel'
+   }
+   ];
+   },
 
// required, called by builder, not needed in this container
setCurrentScrollPosition: function() {},
diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js 
b/loleaflet/src/control/Control.NotebookbarBuilder.js
index 40c8ecc7d..34e08d834 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -14,6 +14,8 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
_overrideHandlers: function() {
this._controlHandlers['combobox'] = this._comboboxControl;
this._controlHandlers['listbox'] = this._comboboxControl;
+   this._controlHandlers['tabcontrol'] = 
this._overridenTabsControlHandler;
+
this._controlHandlers['pushbutton'] = function() { return 
false; };
this._controlHandlers['spinfield'] = function() { return false; 
};
 
@@ -107,6 +109,11 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
return false;
},
 
+   _overridenTabsControlHandler: function(parentContainer, data, builder) {
+   data.tabs = builder.wizard.getTabs();
+   return builder._tabsControlHandler(parentContainer, data, 
builder);
+   },
+
_colorControl: function(parentContainer, data, builder) {
var commandOverride = data.command === '.uno:Color';
if (commandOverride)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-01 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.NotebookbarBuilder.js |   31 ++--
 1 file changed, 29 insertions(+), 2 deletions(-)

New commits:
commit 64e3da9b35e7dc48cf10f6587ecbb21eb5a3e405
Author: Szymon Kłos 
AuthorDate: Tue Apr 28 15:41:40 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 1 18:30:15 2020 +0200

notebookbar: update font properties comboboxes

Change-Id: Ifb67f09587122b5e49c67e471dab038fa788ffd6
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93286
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js 
b/loleaflet/src/control/Control.NotebookbarBuilder.js
index a09435469..40c8ecc7d 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -33,19 +33,42 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
this._toolitemHandlers['vnd.sun.star.findbar:FocusToFindbar'] = 
function() {};
},
 
+   onCommandStateChanged: function(e) {
+   var commandName = e.commandName;
+   var state = e.state;
+
+   if (commandName === '.uno:CharFontName') {
+   $('#fontnamecombobox').val(state).trigger('change');
+   } else if (commandName === '.uno:FontHeight') {
+   $('#fontsizecombobox').val(state).trigger('change');
+   } else if (commandName === '.uno:StyleApply') {
+   $('#applystyle').val(state).trigger('change');
+   }
+   },
+
_setupComboboxSelectionHandler: function(combobox, id, builder) {
+   var items = builder.map['stateChangeHandler'];
+
if (id === 'fontnamecombobox') {
$(combobox).on('select2:select', function (e) {
var font = e.target.value;
builder.map.applyFont(font);
builder.map.focus();
});
-   } else if (id === 'fontsizecombobox') {
+
+   var state = items.getItemValue('.uno:CharFontName');
+   $(combobox).val(state).trigger('change');
+   }
+   else if (id === 'fontsizecombobox') {
$(combobox).on('select2:select', function (e) {
builder.map.applyFontSize(e.target.value);
builder.map.focus();
});
-   } else if (id === 'applystyle') {
+
+   state = items.getItemValue('.uno:FontHeight');
+   $(combobox).val(state).trigger('change');
+   }
+   else if (id === 'applystyle') {
$(combobox).on('select2:select', function (e) {
var style = e.target.value;
var docType = builder.map.getDocType();
@@ -61,6 +84,9 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
 
builder.map.focus();
});
+
+   state = items.getItemValue('.uno:StyleApply');
+   $(combobox).val(state).trigger('change');
}
},
 
@@ -242,5 +268,6 @@ L.control.notebookbarBuilder = function (options) {
builder._setup(options);
builder._overrideHandlers();
builder._customizeOptions();
+   options.map.on('commandstatechanged', builder.onCommandStateChanged, 
builder);
return builder;
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-01 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 42313f8bbce7db2c7180a476032f1c7cdb141cd9
Author: Szymon Kłos 
AuthorDate: Tue Apr 28 16:05:03 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 1 18:27:08 2020 +0200

notebookbar: encode spaces in uno command parameters

Change-Id: Id98b95a7c60974cb93ee6f7facc9dc5f885033a1
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93287
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index dcb1531bf..b6c3591bd 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -195,7 +195,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
builder.wizard.setCurrentScrollPosition();
 
if (objectType == 'toolbutton' && eventType == 'click') {
-   builder.map.sendUnoCommand(data);
+   // encode spaces
+   var encodedCommand = data.replace(' ', '%20');
+   builder.map.sendUnoCommand(encodedCommand);
} else if (object) {
data = typeof data === 'string' ? data.replace('"', 
'\\"') : data;
var message = 'dialogevent ' + (window.sidebarId !== 
undefined ? window.sidebarId : -1) +
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-01 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |   10 +-
 loleaflet/src/control/Control.Notebookbar.js |   11 ++-
 2 files changed, 11 insertions(+), 10 deletions(-)

New commits:
commit d0f5989994701f6fe3aadf038798a78dadc8aad5
Author: Szymon Kłos 
AuthorDate: Fri Apr 24 12:44:05 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 1 17:40:04 2020 +0200

jsdialog: identify tabs by id not label

Change-Id: Ia695020b5c8afadff8031983c29c527c2ed177dd
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93273
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 675a084d1..dcb1531bf 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -605,7 +605,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
return false;
},
 
-   _createTabClick: function(builder, t, tabs, contentDivs, labels)
+   _createTabClick: function(builder, t, tabs, contentDivs, tabIds)
{
return function() {
$(tabs[t]).addClass('selected');
@@ -617,7 +617,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
}
}
$(contentDivs[t]).show();
-   builder.wizard.selectedTab(labels[t]);
+   builder.wizard.selectedTab(tabIds[t]);
};
},
 
@@ -629,7 +629,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 
var tabs = [];
var contentDivs = [];
-   var labels = [];
+   var tabIds = [];
for (var tabIdx = 0; tabIdx < data.tabs.length; 
tabIdx++) {
var item = data.tabs[tabIdx];
 
@@ -640,10 +640,10 @@ L.Control.JSDialogBuilder = L.Control.extend({
if (data.selected == data.tabs[tabIdx].id)
$(tab).addClass('selected');
tabs[tabIdx] = tab;
+   tabIds[tabIdx] = tab.id;
 
var label = L.DomUtil.create('span', 
'ui-tab-content ' + builder.options.cssClass + ' unolabel', tab);
label.innerHTML = title;
-   labels[tabIdx] = title;
 
var contentDiv = L.DomUtil.create('div', 
'ui-content level-' + builder._currentDepth + ' ' + builder.options.cssClass, 
contentsContainer);
contentDiv.title = title;
@@ -659,7 +659,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
// to get capture of 't' right has to 
be a sub fn.
var fn = function(id) {
return function() {
-   
builder._createTabClick(builder, id, tabs, contentDivs, labels)();
+   
builder._createTabClick(builder, id, tabs, contentDivs, tabIds)();

builder.callback('tabcontrol', 'selecttab', tabsContainer, id, builder);
};
};
diff --git a/loleaflet/src/control/Control.Notebookbar.js 
b/loleaflet/src/control/Control.Notebookbar.js
index ad36e4972..43a680834 100644
--- a/loleaflet/src/control/Control.Notebookbar.js
+++ b/loleaflet/src/control/Control.Notebookbar.js
@@ -32,24 +32,25 @@ L.Control.Notebookbar = L.Control.extend({
},
 
selectedTab: function(tabText) {
+   console.log(tabText);
switch (tabText) {
-   case 'Home':
+   case 'HomeLabel':
this.loadTab(this.getHomeTab());
break;
 
-   case 'Insert':
+   case 'InsertLabel':
this.loadTab(this.getInsertTab());
break;
 
-   case 'Layout':
+   case 'LayoutLabel':
this.loadTab(this.getLayoutTab());
break;

-   case 'References':
+   case 'ReferencesLabel':
this.loadTab(this.getReferencesTab());
break;
 
-   case 'Table':
+   case 'TableLabel':
this.loadTab(this.getTableTab());
break;
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-01 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.Notebookbar.js |   22 --
 1 file changed, 20 insertions(+), 2 deletions(-)

New commits:
commit 8b2084928bb0147b12dc3b87f3c1dec203516428
Author: Szymon Kłos 
AuthorDate: Thu Apr 23 13:08:49 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 1 17:38:22 2020 +0200

notebookbar: load selected tab

Change-Id: Ic2741f972c96342abb2916111d52d8e0c3823349
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93270
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.Notebookbar.js 
b/loleaflet/src/control/Control.Notebookbar.js
index cdab92abe..70bb35edd 100644
--- a/loleaflet/src/control/Control.Notebookbar.js
+++ b/loleaflet/src/control/Control.Notebookbar.js
@@ -12,15 +12,33 @@ L.Control.Notebookbar = L.Control.extend({
onAdd: function (map) {
this.map = map;
 
-   var homeTab = JSON.parse(this.getHomeTab());
+   this.loadTab(this.getHomeTab());
+   },
+
+   clearNotebookbar: function() {
+   $('.root-container.notebookbar').remove();
+   $('.ui-tabs.notebookbar').remove();
+   },
+
+   loadTab: function(tabJSON) {
+   this.clearNotebookbar();
+   tabJSON = JSON.parse(tabJSON);
var builder = new L.control.notebookbarBuilder({mobileWizard: 
this, map: this.map, cssClass: 'notebookbar'});
-   builder.build($('#toolbar-wrapper').get(0), [homeTab]);
+   builder.build($('#toolbar-wrapper').get(0), [tabJSON]);
},
 
setTabs: function(tabs) {
$('nav').prepend(tabs);
},
 
+   selectedTab: function(tabText) {
+   switch (tabText) {
+   case 'Home':
+   this.loadTab(this.getHomeTab());
+   break;
+   }
+   },
+
// required, called by builder, not needed in this container
setCurrentScrollPosition: function() {},
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-01 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit fc5ff5776faedf07d64c226c7155364009a6871b
Author: Szymon Kłos 
AuthorDate: Fri Apr 24 12:26:54 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 1 17:11:34 2020 +0200

notebookbar: show tooltip when label is not shown

Change-Id: If10a04e41775f828abc232e0cc19f70ddd48333b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93272
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index c6f138cd5..675a084d1 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1530,6 +1530,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
var label = L.DomUtil.create('span', 
'ui-content unolabel', div);
label.for = buttonId;
label.innerHTML = data.text;
+   } else {
+   div.title = data.text;
+   $(div).tooltip();
}
 
var updateFunction = function() {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-01 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.NotebookbarBuilder.js |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit a098b3410699e341e607e0b270ee397e032ac9d0
Author: Szymon Kłos 
AuthorDate: Thu Apr 23 12:38:40 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 1 16:33:35 2020 +0200

notebookbar: hide unknown items

Change-Id: I3dd6a825afc87328f519305329ca7e41ac6ff14c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93269
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js 
b/loleaflet/src/control/Control.NotebookbarBuilder.js
index c2b0b97ff..c92cb856e 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -12,8 +12,9 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
},
 
_overrideHandlers: function() {
-   this._controlHandlers['combobox'] = function() {return false;};
-   this._controlHandlers['listbox'] = function() {return false;};
+   this._controlHandlers['combobox'] = function() { return false; 
};
+   this._controlHandlers['listbox'] = function() { return false; };
+   this._controlHandlers['pushbutton'] = function() { return 
false; };
 
this._toolitemHandlers['.uno:XLineColor'] = function() {};
this._toolitemHandlers['.uno:SelectWidth'] = function() {};
@@ -24,6 +25,7 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
this._toolitemHandlers['.uno:FrameLineColor'] = function() {};
this._toolitemHandlers['.uno:Color'] = function() {};
this._toolitemHandlers['.uno:FillColor'] = function() {};
+   this._toolitemHandlers['vnd.sun.star.findbar:FocusToFindbar'] = 
function() {};
},
 
build: function(parent, data, hasVerticalParent, parentHasManyChildren) 
{
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-01 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js|   20 +--
 loleaflet/src/control/Control.NotebookbarBuilder.js |   54 +---
 2 files changed, 19 insertions(+), 55 deletions(-)

New commits:
commit 0995fb5a54510a2ceb13edb2b2f8ef2221c2951e
Author: Szymon Kłos 
AuthorDate: Thu Apr 23 12:27:39 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 1 15:28:26 2020 +0200

notebookbar: use options to modify building

Change-Id: I8c6c21c4605201a5393a8f8cd0640774b62d074b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93265
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index ce7e24da7..de526eeeb 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -9,7 +9,15 @@
 L.Control.JSDialogBuilder = L.Control.extend({
 
options: {
-   cssClass: 'mobile-wizard'
+   // reference to map
+   map: null,
+   // reference to the parent container
+   mobileWizard: null,
+   // css class name added to the html nodes
+   cssClass: 'mobile-wizard',
+
+   // create only icon without label
+   noLabelsForUnoButtons: false
},
 
/* Handler is a function which takes three parameters:
@@ -1505,7 +1513,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
_unoToolButton: function(parentContainer, data, builder) {
var button = null;
 
-   var div = this._createIdentifiable('div', 'unotoolbutton ' + 
builder.cssClass + ' ui-content unospan', parentContainer, data);
+   var div = this._createIdentifiable('div', 'unotoolbutton ' + 
builder.options.cssClass + ' ui-content unospan', parentContainer, data);
 
if (data.command) {
var id = data.command.substr('.uno:'.length);
@@ -1518,9 +1526,11 @@ L.Control.JSDialogBuilder = L.Control.extend({
button.src = icon;
button.id = buttonId;
 
-   var label = L.DomUtil.create('span', 'ui-content 
unolabel', div);
-   label.for = buttonId;
-   label.innerHTML = data.text;
+   if (builder.options.noLabelsForUnoButtons !== true) {
+   var label = L.DomUtil.create('span', 
'ui-content unolabel', div);
+   label.for = buttonId;
+   label.innerHTML = data.text;
+   }
 
var updateFunction = function() {
var items = builder.map['stateChangeHandler'];
diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js 
b/loleaflet/src/control/Control.NotebookbarBuilder.js
index 2a0b7b8cf..4c200ec04 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -6,8 +6,9 @@
 /* global $ */
 L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
 
-   onAdd: function (map) {
-   this.map = map;
+   _customizeOptions: function() {
+   this.options.noLabelsForUnoButtons = true;
+   this.options.cssClass = 'notebookbar';
},
 
_overrideHandlers: function() {
@@ -26,54 +27,6 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
this._toolitemHandlers['.uno:ResetAttributes'] = function() {};
},
 
-   _unoToolButton: function(parentContainer, data, builder) {
-   var button = null;
-
-   var div = this._createIdentifiable('div', 'unotoolbutton ' + 
builder.options.cssClass + ' ui-content unospan', parentContainer, data);
-
-   if (data.command) {
-   var id = data.command.substr('.uno:'.length);
-   div.id = id;
-
-   var icon = builder._createIconPath(data.command);
-   var buttonId = id + 'img';
-
-   button = L.DomUtil.create('img', 'ui-content 
unobutton', div);
-   button.src = icon;
-   button.id = buttonId;
-
-   var updateFunction = function() {
-   var items = builder.map['stateChangeHandler'];
-   var state = items.getItemValue(data.command);
-
-   if (state && state === 'true')
-   $(button).addClass('selected');
-   else
-   $(button).removeClass('selected');
-   };
-
-   updateFunction();
-
-   builder.map.on('commandstatechanged', function(e) {
- 

[Libreoffice-commits] online.git: loleaflet/src

2020-05-01 Thread Henry Castro (via logerrit)
 loleaflet/src/map/handler/Map.WOPI.js |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit faf381d0516e188a7ea86d71be9c11fa585656ad
Author: Henry Castro 
AuthorDate: Wed Apr 29 12:09:26 2020 -0400
Commit: Henry Castro 
CommitDate: Fri May 1 14:42:36 2020 +0200

loleaflet: fix the location origin from parent window

Firefox and IE browser fails to get access to
execute actions from parent windows when insert
image from cloud storage.

Change-Id: I3abfc6ecdf28f4c44bbc154af4a77f4c013c1001
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93169
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 

diff --git a/loleaflet/src/map/handler/Map.WOPI.js 
b/loleaflet/src/map/handler/Map.WOPI.js
index b3a4a2fc6..a65a6030b 100644
--- a/loleaflet/src/map/handler/Map.WOPI.js
+++ b/loleaflet/src/map/handler/Map.WOPI.js
@@ -189,6 +189,12 @@ L.Map.WOPI = L.Handler.extend({
return true;
}
 
+   var origin = window.location.protocol + '//' + 
window.location.hostname;
+   if (origin === e.origin) {
+   this._cachedGoodOrigin = e.origin;
+   return true;
+   }
+
return false;
},
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-01 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.NotebookbarBuilder.js |   17 +
 1 file changed, 17 insertions(+)

New commits:
commit 5c1dbc5fe709d74e846acf6472e35d0b1f84df81
Author: Szymon Kłos 
AuthorDate: Wed Apr 22 15:46:43 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 1 14:22:54 2020 +0200

notebookbar: override control handlers

Change-Id: I1873d0eacfa99a4bb968e8b7456886a2791bafce
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93257
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js 
b/loleaflet/src/control/Control.NotebookbarBuilder.js
index 4d26d0e7a..bb2d968e2 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -10,6 +10,22 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
this.map = map;
},
 
+   _overrideHandlers: function() {
+   this._controlHandlers['combobox'] = undefined;
+   this._controlHandlers['listbox'] = undefined;
+
+   this._toolitemHandlers['.uno:XLineColor'] = undefined;
+   this._toolitemHandlers['.uno:SelectWidth'] = undefined;
+   this._toolitemHandlers['.uno:FontColor'] = undefined;
+   this._toolitemHandlers['.uno:BackColor'] = undefined;
+   this._toolitemHandlers['.uno:CharBackColor'] = undefined;
+   this._toolitemHandlers['.uno:BackgroundColor'] = undefined;
+   this._toolitemHandlers['.uno:FrameLineColor'] = undefined;
+   this._toolitemHandlers['.uno:Color'] = undefined;
+   this._toolitemHandlers['.uno:FillColor'] = undefined;
+   this._toolitemHandlers['.uno:ResetAttributes'] = undefined;
+   },
+
build: function(parent, data, hasVerticalParent) {
this._amendJSDialogData(data);
 
@@ -70,5 +86,6 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
 L.control.notebookbarBuilder = function (options) {
var builder = new L.Control.NotebookbarBuilder(options);
builder._setup(options);
+   builder._overrideHandlers();
return builder;
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-01 Thread Aron Budea (via logerrit)
 loleaflet/src/map/Clipboard.js |3 +++
 loleaflet/src/map/Map.js   |4 
 2 files changed, 7 insertions(+)

New commits:
commit 9baea8eb9b32e7554a5c81af10eb5e354b6da1d8
Author: Aron Budea 
AuthorDate: Wed Apr 29 04:08:55 2020 +0200
Commit: Aron Budea 
CommitDate: Fri May 1 14:10:15 2020 +0200

tdf#132125: Pasting into comment pastes into document instead

Ignore paste event when editing comments.
Fix is similar to 5bc28a9d3047e47c5b7210522e9d5729524c1f0e

Change-Id: I12644ca32a99557703eef63dc1b5670e68a22813
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93114
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/loleaflet/src/map/Clipboard.js b/loleaflet/src/map/Clipboard.js
index 700369d29..b7c45e939 100644
--- a/loleaflet/src/map/Clipboard.js
+++ b/loleaflet/src/map/Clipboard.js
@@ -656,6 +656,9 @@ L.Clipboard = L.Class.extend({
if (isAnyVexDialogActive() && !this._map.hasFocus())
return;
 
+   if (this._map.isEditingAnnotation())
+   return;
+
// If the focus is in the search box, paste there.
if (this._map.isSearching())
return;
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 982cde654..3b2b3b719 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -966,6 +966,10 @@ L.Map = L.Evented.extend({
return this._isSearching;
},
 
+   isEditingAnnotation: function() {
+   return this._docLayer._annotations.isEdit();
+   },
+
_fireInitComplete: function (condition) {
if (this.initComplete) {
return;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-01 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.UIManager.js |5 +
 1 file changed, 5 insertions(+)

New commits:
commit cd041d0739cd928a21db4763b765a961205d7a19
Author: Szymon Kłos 
AuthorDate: Wed Apr 22 12:50:10 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 1 13:07:26 2020 +0200

notebookbar: more space for notebookbar

Change-Id: Idf0735a7282bda5b7bc0166e82acbcd2e589a289
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93252
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.UIManager.js 
b/loleaflet/src/control/Control.UIManager.js
index 8ac35bb50..f9dd3d7c9 100644
--- a/loleaflet/src/control/Control.UIManager.js
+++ b/loleaflet/src/control/Control.UIManager.js
@@ -67,6 +67,11 @@ L.Control.UIManager = L.Control.extend({
this.map.addControl(L.control.searchBar());
} else if (window.enableNotebookbar) {
this.map.addControl(L.control.notebookbar({docType: 
docType}));
+
+   
this.moveObjectVertically($('#spreadsheet-row-column-frame'), 36);
+   this.moveObjectVertically($('#document-container'), 77);
+   
this.moveObjectVertically($('#presentation-controls-wrapper'), 36);
+   this.moveObjectVertically($('#sidebar-dock-wrapper'), 
36);
}
 
if (docType === 'spreadsheet') {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-01 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.NotebookbarBuilder.js |   25 ++--
 1 file changed, 13 insertions(+), 12 deletions(-)

New commits:
commit 8fb074b6bf52ed447abedd134d7d12bd1b66fc79
Author: Szymon Kłos 
AuthorDate: Wed Apr 22 14:58:58 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 1 12:59:17 2020 +0200

notebookbar: build also vertical containers

Change-Id: Ifb7d964cf524767243efa850fb236186a3f2924f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93256
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js 
b/loleaflet/src/control/Control.NotebookbarBuilder.js
index 810f86074..4d26d0e7a 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -10,35 +10,36 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
this.map = map;
},
 
-   build: function(parent, data) {
+   build: function(parent, data, hasVerticalParent) {
this._amendJSDialogData(data);
 
-   if (data.length > 1) {
-   var table = L.DomUtil.create('table', '', parent);
-   var tr = L.DomUtil.create('tr', '', table);
-   } else {
-   tr = parent;
-   }
+   var containerToInsert = parent;
 
for (var childIndex in data) {
var childData = data[childIndex];
if (!childData)
continue;
 
-   var td = (data.length > 1) ? L.DomUtil.create('td', '', 
tr) : tr;
+   if (!hasVerticalParent)
+   var td = L.DomUtil.create('td', '', 
containerToInsert);
+   else {
+   containerToInsert = L.DomUtil.create('tr', '', 
parent);
+   td = L.DomUtil.create('td', '', 
containerToInsert);
+   }
+
+   var isVertical = childData.vertical === 'true' ? true : 
false;
 
this._parentize(childData);
var childType = childData.type;
var processChildren = true;
-   var needsToCreateContainer =
-   childType == 'panel' || childType == 'frame';
 
if ((childData.id === undefined || childData.id === '' 
|| childData.id === null)
&& (childType == 'checkbox' || childType == 
'radiobutton')) {
continue;
}
 
-   var childObject = needsToCreateContainer ? 
L.DomUtil.createWithId('div', childData.id, td) : td;
+   var table = L.DomUtil.create('table', '', td);
+   var childObject = L.DomUtil.create('tr', '', table);
 
var handler = this._controlHandlers[childType];
var twoPanelsAsChildren =
@@ -56,7 +57,7 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
console.warn('Unsupported control type: 
\"' + childType + '\"');
 
if (processChildren && childData.children != 
undefined)
-   this.build(childObject, 
childData.children);
+   this.build(childObject, 
childData.children, isVertical);
else if (childData.visible && 
(childData.visible === false || childData.visible === 'false')) {
$('#' + 
childData.id).addClass('hidden-from-event');
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-05-01 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.NotebookbarBuilder.js |   56 +++-
 1 file changed, 54 insertions(+), 2 deletions(-)

New commits:
commit e1a02812f93fbcd546514487e6cda875097bfe24
Author: Szymon Kłos 
AuthorDate: Wed Apr 22 12:33:37 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri May 1 12:19:56 2020 +0200

notebookbar: build horizontally

Change-Id: I7772dbf6f15a4ed9feeb506b3100d756736db700
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93053
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js 
b/loleaflet/src/control/Control.NotebookbarBuilder.js
index a07987c31..470e7259f 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -3,15 +3,67 @@
  * L.Control.NotebookbarBuilder
  */
 
-/* global */
+/* global $ */
 L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
 
onAdd: function (map) {
this.map = map;
},
 
+   build: function(parent, data) {
+   this._amendJSDialogData(data);
+
+   var table = L.DomUtil.create('table', '', parent);
+   var tr = L.DomUtil.create('tr', '', table);
+
+   for (var childIndex in data) {
+   var childData = data[childIndex];
+   if (!childData)
+   continue;
+
+   var td = L.DomUtil.create('td', '', tr);
+
+   this._parentize(childData);
+   var childType = childData.type;
+   var processChildren = true;
+   var needsToCreateContainer =
+   childType == 'panel' || childType == 'frame';
+
+   if ((childData.id === undefined || childData.id === '' 
|| childData.id === null)
+   && (childType == 'checkbox' || childType == 
'radiobutton')) {
+   continue;
+   }
+
+   var childObject = needsToCreateContainer ? 
L.DomUtil.createWithId('div', childData.id, td) : td;
+
+   var handler = this._controlHandlers[childType];
+   var twoPanelsAsChildren =
+   childData.children && childData.children.length == 2
+   && childData.children[0] && 
childData.children[0].type == 'panel'
+   && childData.children[1] && 
childData.children[1].type == 'panel';
+
+   if (twoPanelsAsChildren) {
+   handler = this._controlHandlers['paneltabs'];
+   processChildren = handler(childObject, 
childData.children, this);
+   } else {
+   if (handler)
+   processChildren = handler(childObject, 
childData, this);
+   else
+   console.warn('Unsupported control type: 
\"' + childType + '\"');
+
+   if (processChildren && childData.children != 
undefined)
+   this.build(childObject, 
childData.children);
+   else if (childData.visible && 
(childData.visible === false || childData.visible === 'false')) {
+   $('#' + 
childData.id).addClass('hidden-from-event');
+   }
+   }
+   }
+   }
+
 });
 
 L.control.notebookbarBuilder = function (options) {
-   return new L.Control.NotebookbarBuilder(options);
+   var builder = new L.Control.NotebookbarBuilder(options);
+   builder._setup(options);
+   return builder;
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-30 Thread Dennis Francis (via logerrit)
 loleaflet/src/control/Control.LokDialog.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1a4322a940073c2a4f461f971a3f04ced65007b1
Author: Dennis Francis 
AuthorDate: Fri May 1 02:23:30 2020 +0530
Commit: Dennis Francis 
CommitDate: Fri May 1 04:30:23 2020 +0200

loleaflet: mobile: center the dialog horizontally

Before this the dialogs (in mobile) like 'autofilter/validation list' were
not centered horizontally and looked awkward. However as for vertical
positioning, it is correctly glued to the top of the map as said in
the comments.

Change-Id: I2f31075742ac8f40b3fd4d4016dbfef635b5f805
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93238
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index bcdf1f4fa..dd0a78113 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -1238,7 +1238,7 @@ L.Control.LokDialog = L.Control.extend({
// on mobile, force the positioning to the top, so that it is 
not
// covered by the virtual keyboard
if (window.mode.isMobile()) {
-   $(dialogContainer).dialog('option', 'position', { my: 
'left top', at: 'let top', of: '#document-container' });
+   $(dialogContainer).dialog('option', 'position', { my: 
'center top', at: 'center top', of: '#document-container' });
transformation.origin = 'center top';
transformation.translate.y = 0;
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-30 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/TileLayer.js |3 +++
 loleaflet/src/map/handler/Map.TouchGesture.js |9 +
 2 files changed, 12 insertions(+)

New commits:
commit 485e849459f998a6aea0e5978562a9b05f458c85
Author: Dennis Francis 
AuthorDate: Thu Apr 30 18:07:06 2020 +0530
Commit: Dennis Francis 
CommitDate: Fri May 1 04:22:31 2020 +0200

The validity dropdown button should react to taps too

Change-Id: I5c689106a2d995c37f28d652e8b0e39c0644ec8b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93212
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 2918f8bf0..9836590ba 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -338,6 +338,9 @@ L.TileLayer = L.GridLayer.extend({
this._cellResizeMarkerEnd.on('dragstart drag dragend', 
this._onCellResizeMarkerDrag, this);
this._cellAutofillMarker.on('dragstart drag dragend', 
this._onCellResizeMarkerDrag, this);
this._dropDownButton.on('click', this._onDropDownButtonClick, 
this);
+   // The 'tap' events are not broadcasted by L.Map.TouchGesture, 
A specialized 'dropdownmarkertapped' event is
+   // generated just for the validity-dropdown-icon.
+   map.on('dropdownmarkertapped', this._onDropDownButtonClick, 
this);
 
map.setPermission(this.options.permission);
 
diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js 
b/loleaflet/src/map/handler/Map.TouchGesture.js
index 6120a8d1a..cff7eeffe 100644
--- a/loleaflet/src/map/handler/Map.TouchGesture.js
+++ b/loleaflet/src/map/handler/Map.TouchGesture.js
@@ -311,6 +311,15 @@ L.Map.TouchGesture = L.Handler.extend({
 
this._map.fire('closepopups');
this._map.fire('closemobilewizard');
+
+   // The validity dropdown marker icon (exists only in calc) 
needs to be notified of tap events if it is the target.
+   var dropDownMarkers = 
document.getElementsByClassName('leaflet-marker-icon 
spreadsheet-drop-down-marker');
+   if (dropDownMarkers.length == 1 && dropDownMarkers[0] && 
e.target && e.target == dropDownMarkers[0]) {
+   this._map.fire('dropdownmarkertapped');
+   // don't send the mouse-event to core
+   return;
+   }
+
this._map.fire('editorgotfocus');
 
var docLayer = this._map._docLayer;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-30 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/TileLayer.js |   14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

New commits:
commit 2e0f1402028d60344247605223e8a63fed70e7d4
Author: Dennis Francis 
AuthorDate: Thu Apr 30 17:28:39 2020 +0530
Commit: Dennis Francis 
CommitDate: Fri May 1 04:16:09 2020 +0200

fix validation dropdown icon size

There is no need to have a 'maxHeight' for the icon as we don't mirror
the core's button anymore. The height of the icon follows the cell height,
and lets make the width follow it too, so that the icon is nicely
scaled with zoom (the icon used has a 1:1 aspect ratio).

Change-Id: I175ad98f6a1306fabd003eee7fda9652f5835995
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93211
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index adf022776..2918f8bf0 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -3038,18 +3038,12 @@ L.TileLayer = L.GridLayer.extend({
this._map.removeLayer(this._dropDownButton);
},
 
-   _getDropDownMarker: function (height) {
-   if (height) {
-   var maxHeight = 27; // it matches the max height of the 
same control in core
-   var topMargin = 0;
-   if (height > maxHeight) {
-   topMargin = height - maxHeight;
-   height = maxHeight;
-   }
+   _getDropDownMarker: function (dropDownSize) {
+   if (dropDownSize) {
var icon =  L.divIcon({
className: 'spreadsheet-drop-down-marker',
-   iconSize: [undefined, height],
-   iconAnchor: [0, -topMargin]
+   iconSize: [dropDownSize, dropDownSize],
+   iconAnchor: [0, 0]
});
this._dropDownButton.setIcon(icon);
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-30 Thread Dennis Francis (via logerrit)
 loleaflet/src/layer/tile/TileLayer.js |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 903488a7821872234c5f6b8cce5325ca97ef829a
Author: Dennis Francis 
AuthorDate: Thu Apr 30 11:46:16 2020 +0530
Commit: Dennis Francis 
CommitDate: Fri May 1 04:13:09 2020 +0200

Lets make 'dropdown marker' icon active

Before this, the dropdown marker icon was just trying to mirror the
exact shape and position of the validity list button in core.
It is a lot easier just to have the js icon according to our
styling and in its click handler, sent '.uno:DataSelect' command to
core. It saves us the trouble of mirroring the core's button which
apparently is not zoom adjusted. With non-default dpiscale, it takes
more effort to mirror it exactly.

Change-Id: Ibe15293e9052dfacf01be94ed4950d1842e46c4b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93210
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Dennis Francis 

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 7662b71a2..adf022776 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -156,7 +156,7 @@ L.TileLayer = L.GridLayer.extend({
className: 'spreadsheet-drop-down-marker',
iconSize: null
}),
-   interactive: false
+   interactive: true
});
 
this._cellResizeMarkerStart = L.marker(new L.LatLng(0, 0), {
@@ -337,6 +337,7 @@ L.TileLayer = L.GridLayer.extend({
this._cellResizeMarkerStart.on('dragstart drag dragend', 
this._onCellResizeMarkerDrag, this);
this._cellResizeMarkerEnd.on('dragstart drag dragend', 
this._onCellResizeMarkerDrag, this);
this._cellAutofillMarker.on('dragstart drag dragend', 
this._onCellResizeMarkerDrag, this);
+   this._dropDownButton.on('click', this._onDropDownButtonClick, 
this);
 
map.setPermission(this.options.permission);
 
@@ -2830,6 +2831,12 @@ L.TileLayer = L.GridLayer.extend({
}
},
 
+   _onDropDownButtonClick: function () {
+   if (this._validatedCellXY && this._cellCursorXY && 
this._validatedCellXY.equals(this._cellCursorXY)) {
+   this._map.sendUnoCommand('.uno:DataSelect');
+   }
+   },
+
// Update group layer selection handler.
_onUpdateGraphicSelection: function () {
if (this._graphicSelection && 
!this._isEmptyRectangle(this._graphicSelection)) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-29 Thread Marco Cecchetti (via logerrit)
 loleaflet/src/control/Control.LokDialog.js |   38 +++--
 1 file changed, 25 insertions(+), 13 deletions(-)

New commits:
commit f089599742fbccf0324cfac1fe4563342889fce4
Author: Marco Cecchetti 
AuthorDate: Mon Apr 20 13:51:46 2020 +0200
Commit: Marco Cecchetti 
CommitDate: Wed Apr 29 13:29:05 2020 +0200

leaflet: calc: add inputbar_multiline class when input bar is expanded

Change-Id: I4d9ac5480af37b42402f5597d3500754655055ab
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92692
Tested-by: Marco Cecchetti 
Reviewed-by: Marco Cecchetti 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 42e3fdbc8..bcdf1f4fa 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -282,6 +282,8 @@ L.Control.LokDialog = L.Control.extend({
top = parseInt(e.position.split(',')[1]);
}
 
+   var lines = 0;
+
if (e.title && typeof brandProductName !== 'undefined') {
e.title = e.title.replace('Collabora Office', 
brandProductName);
}
@@ -291,7 +293,8 @@ L.Control.LokDialog = L.Control.extend({
// When left/top are invalid, the dialog shows 
in the center.
this._launchDialog(e.id, left, top, width, 
height, e.title);
} else if (e.winType === 'calc-input-win') {
-   this._launchCalcInputBar(e.id, width, height);
+   lines = parseInt(e.lines);
+   this._launchCalcInputBar(e.id, width, height, 
lines);
} else if (e.winType === 'deck') {
if (!window.mode.isMobile()) {
this._launchSidebar(e.id, width, 
height);
@@ -360,11 +363,13 @@ L.Control.LokDialog = L.Control.extend({
} else if (e.action === 'size_changed') {
// FIXME: we don't really have to destroy and launch 
the dialog again but do it for
// now because the size sent to us previously in 
'created' cb is not correct
-   if (e.winType  === 'deck' || this._isSidebar(e.id)) {
+   if (e.winType === 'deck' || this._isSidebar(e.id)) {
$('#' + strId).remove();
this._launchSidebar(e.id, width, height);
-   } else if (e.winType  === 'calc-input-win' || 
this.isCalcInputBar(e.id))
-   this._launchCalcInputBar(e.id, width, height);
+   } else if (e.winType === 'calc-input-win' || 
this.isCalcInputBar(e.id)) {
+   lines = parseInt(e.lines);
+   this._launchCalcInputBar(e.id, width, height, 
lines);
+   }
else {
$('#' + strId).remove();
this._launchDialog(e.id, null, null, width, 
height, this._dialogs[parseInt(e.id)].title);
@@ -799,21 +804,21 @@ L.Control.LokDialog = L.Control.extend({
this._sendPaintWindow(id, this._createRectStr(id));
},
 
-   _launchCalcInputBar: function(id, width, height) {
-   console.log('_launchCalcInputBar: start: id: ' + id + ', width: 
' + width + ', height: ' + height);
-   if (!this._calcInputBar || this._calcInputBar.id != id) {
+   _launchCalcInputBar: function(id, width, height, textLines) {
+   console.log('_launchCalcInputBar: start: id: ' + id + ', width: 
' + width + ', height: ' + height + ', textLines: ' + textLines);
+   if (!this._calcInputBar || this._calcInputBar.id !== id) {
if (this._calcInputBar)
$('#' + this._calcInputBar.strId).remove();
-   this._createCalcInputbar(id, width, height);
+   this._createCalcInputbar(id, width, height, textLines);
} else {
// Update in-place. We will resize during rendering.
-   this._adjustCalcInputBar(id, width, height);
+   this._adjustCalcInputBar(id, width, height, textLines);
}
 
console.log('_launchCalcInputBar: end');
},
 
-   _adjustCalcInputBar: function(id, width, height) {
+   _adjustCalcInputBar: function(id, width, height, textLines) {
if (this._calcInputBar) {
var oldHeight = this._calcInputBar.height;
var delta = height - oldHeight;
@@ -822,7 +827,7 @@ L.Control.LokDialog = L.Control.extend({
 
// Recreate the input-bar.
$('#' + this._calcInp

[Libreoffice-commits] online.git: loleaflet/src

2020-04-29 Thread Marco Cecchetti (via logerrit)
 loleaflet/src/control/Control.LokDialog.js |  196 -
 1 file changed, 136 insertions(+), 60 deletions(-)

New commits:
commit 4c3708e076665351115b1f674519ac74a9080904
Author: Marco Cecchetti 
AuthorDate: Tue Apr 21 13:03:34 2020 +0200
Commit: Marco Cecchetti 
CommitDate: Wed Apr 29 13:28:31 2020 +0200

leaflet: calc: formula bar: improve selection handling

This patch provides some improvements for the single input line case:

- start selection handle is visible only if the current visible line
is the first selected line
- end selection handle is visible only if the current visible line is
the last selected line
- by dragging the selection handles is possible to switch to
previous/next line

Change-Id: I168163306420d57d7d074682f7a8c3303a79da82
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92123
Tested-by: Marco Cecchetti 
Reviewed-by: Marco Cecchetti 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 0c76b1d13..42e3fdbc8 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -381,6 +381,7 @@ L.Control.LokDialog = L.Control.extend({
} else if (e.action === 'text_selection') {
if (this._isOpen(e.id)) {
var rectangles = [];
+   var startHandleVisible, endHandleVisible;
if (e.rectangles) {
var dataList = 
e.rectangles.match(/\d+/g);
if (dataList != null) {
@@ -394,7 +395,14 @@ L.Control.LokDialog = L.Control.extend({
}
}
}
-   this._updateTextSelection(e.id, rectangles);
+
+   if (e.startHandleVisible) {
+   startHandleVisible = 
e.startHandleVisible === 'true';
+   }
+   if (e.endHandleVisible) {
+   endHandleVisible = e.endHandleVisible 
=== 'true';
+   }
+   this._updateTextSelection(e.id, rectangles, 
startHandleVisible, endHandleVisible);
}
} else if (e.action === 'title_changed') {
if (e.title && this._dialogs[parseInt(e.id)]) {
@@ -455,18 +463,26 @@ L.Control.LokDialog = L.Control.extend({
L.DomUtil.addClass(cursor, 'blinking-cursor');
},
 
-   _updateTextSelection: function(dlgId, rectangles) {
+   _updateTextSelection: function(dlgId, rectangles, startHandleVisible, 
endHandleVisible) {
var strId = this._toIntId(dlgId);
var selections = this._dialogs[strId].textSelection.rectangles;
L.DomUtil.empty(selections);
var handles = this._dialogs[strId].textSelection.handles;
-   var startHandle = 
this._dialogs[strId].textSelection.startHandle;
-   var endHandle = this._dialogs[strId].textSelection.endHandle;
+   var startHandle, endHandle;
+   if (startHandleVisible) {
+   startHandle = 
this._dialogs[strId].textSelection.startHandle;
+   } else if (handles.start) {
+   L.DomUtil.remove(handles.start);
+   handles.start = null;
+   }
+   if (endHandleVisible) {
+   endHandle = 
this._dialogs[strId].textSelection.endHandle;
+   }  else if (handles.end) {
+   L.DomUtil.remove(handles.end);
+   handles.end = null;
+   }
 
if (!rectangles || rectangles.length < 1) {
-   if (!startHandle.isDragged && !endHandle.isDragged) {
-   L.DomUtil.empty(handles);
-   }
return;
}
 
@@ -480,34 +496,43 @@ L.Control.LokDialog = L.Control.extend({
L.DomUtil.setStyle(container, 'top', rect.y + 'px');
}
 
-   var startRect = rectangles[0];
-   var endRect  = rectangles[rectangles.length - 1];
-   if (startRect.width < 1 || endRect.width < 1)
-   return;
-   startRect = {x: startRect.x, y: startRect.y, width: 1, height: 
startRect.height};
-   endRect = {x: endRect.x + endRect.width - 1, y: endRect.y, 
width: 1, height: endRect.height};
-   var startPos = L.point(startRect.x, startRect.y + 
startRect.height);
-   startPos = startPos.subtract(L.point(0, 2));
-   startHandle.lastPos = startPos;
-   

[Libreoffice-commits] online.git: loleaflet/src

2020-04-29 Thread Marco Cecchetti (via logerrit)
 loleaflet/src/layer/tile/TileLayer.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1f289b1a4ddba9313f9cffb7f8cc6cae307c8bc7
Author: Marco Cecchetti 
AuthorDate: Fri Apr 10 15:02:47 2020 +0200
Commit: Marco Cecchetti 
CommitDate: Wed Apr 29 13:28:48 2020 +0200

leaflet: calc: focused input bar: sheet doesn't get focus on first click

When the formula bar has focus, the user needs to click twice on the
grid in order to have the document get focus.

Change-Id: I743aae7294c1fd6f0bf6abfbfcfcbfa1a41c70a5
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92124
Tested-by: Marco Cecchetti 
Reviewed-by: Marco Cecchetti 

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 1650c4def..7662b71a2 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2081,7 +2081,7 @@ L.TileLayer = L.GridLayer.extend({
 
_postMouseEvent: function(type, x, y, count, buttons, modifier) {
 
-   if (this._map.calcInputBarHasFocus()) {
+   if (this._map.calcInputBarHasFocus() && type === 'move') {
// When the Formula-bar has the focus, sending
// mouse move with the document coordinates
// hides the cursor (lost focus?). This is clearly
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-29 Thread Marco Cecchetti (via logerrit)
 loleaflet/src/control/Control.LokDialog.js |   16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 07f493a89f04bad517c99f8b29952662e9abfe66
Author: Marco Cecchetti 
AuthorDate: Thu Apr 2 16:20:52 2020 +0200
Commit: Marco Cecchetti 
CommitDate: Wed Apr 29 13:28:12 2020 +0200

leaflet: calc: move prev next line when input bar is a single line

This patch enables the ability to move to the previous or next line by
panning when the cell content is more than a single line and the input
bar is a not expanded.

Change-Id: I5e5035d17dbbc62f9ce83ec86e5037fafc2cac24
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92122
Tested-by: Marco Cecchetti 
Reviewed-by: Marco Cecchetti 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 7a12317e2..0c76b1d13 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -536,6 +536,21 @@ L.Control.LokDialog = L.Control.extend({
var handles = this._calcInputBar.textSelection.handles;
var startHandle = handles.children[0];
var endHandle = handles.children[1];
+   var dragEnd = e.type === 'mouseup' || e.type === 'mouseout' || 
e.type === 'panend';
+
+   if ((!startHandle || !startHandle.isDragged) && (!endHandle || 
!endHandle.isDragged) && dragEnd) {
+   var code = 0;
+   if (e.deltaX > 30 || e.deltaY > 20)
+   code = 1025; // ArrowUp
+   else if (e.deltaX < -30 || e.deltaY < -20)
+   code = 1024; // ArrowDown
+   if (code) {
+   this._map._docLayer.postKeyboardEvent('input', 
0, code);
+   this._map._textInput._emptyArea();
+   this._map._docLayer.postKeyboardEvent('up', 0, 
code);
+   }
+   }
+
if (!endHandle || !startHandle)
return;
 
@@ -547,7 +562,6 @@ L.Control.LokDialog = L.Control.extend({
if (!draggedHandle)
return;
 
-   var dragEnd = e.type === 'mouseup' || e.type === 'mouseout' || 
e.type === 'panend';
if (dragEnd)
draggedHandle.isDragged = false;
var mousePos = L.DomEvent.getMousePosition(e.pointers ? 
e.srcEvent : e, handles);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-28 Thread Pranam Lashkari (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |   23 ---
 1 file changed, 23 deletions(-)

New commits:
commit 87ae6340050e60d467379c190ffc5f7623ae7e5b
Author: Pranam Lashkari 
AuthorDate: Mon Apr 27 17:22:10 2020 +0530
Commit: Szymon Kłos 
CommitDate: Wed Apr 29 07:26:44 2020 +0200

leaflet: resolved shape fill displaying incorrect style

in mobile wizard shape fill displayed pattern even when selected bitmap

Change-Id: I0fb5bf85d9344128bdb59dad849561dba7d28458
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93000
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 4b8138933..a9a4fd1aa 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -997,29 +997,6 @@ L.Control.JSDialogBuilder = L.Control.extend({
}
break;
 
-   case 'fillstylearea':
-   state = items.getItemValue('.uno:FillStyle');
-   if (state) {
-   switch (state) {
-   case 'NONE':
-   return _('None');
-
-   case 'SOLID':
-   return _('Color');
-
-   case 'GRADIENT':
-   return _('Gradient');
-
-   case 'HATCH':
-   return _('Hatching');
-
-   case 'BITMAP':
-   // FIXME: can be bitmap or pattern, for 
now we cant import bitmap
-   return _('Pattern');
-   }
-   }
-   break;
-
case 'fillattr':
state = items.getItemValue('.uno:FillPageColor');
if (state) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-28 Thread Henry Castro (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |   28 +++
 1 file changed, 28 insertions(+)

New commits:
commit 4d82903a269ca2c38ebbd913d5027f2da8d9bc37
Author: Henry Castro 
AuthorDate: Thu Apr 23 12:09:56 2020 -0400
Commit: Henry Castro 
CommitDate: Tue Apr 28 15:06:06 2020 +0200

jsdialog: add metric field handler

Change-Id: I87212e56cdfa3c85ddfa56e8aa0f814290fa49d6
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92799
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 96decadca..4b8138933 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -109,6 +109,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
this._controlHandlers['radiobutton'] = this._radiobuttonControl;
this._controlHandlers['checkbox'] = this._checkboxControl;
this._controlHandlers['spinfield'] = this._spinfieldControl;
+   this._controlHandlers['metricfield'] = this._metricfieldControl;
this._controlHandlers['edit'] = this._editControl;
this._controlHandlers['multilineedit'] = 
this._multiLineEditControl;
this._controlHandlers['pushbutton'] = this._pushbuttonControl;
@@ -1172,6 +1173,33 @@ L.Control.JSDialogBuilder = L.Control.extend({
return false;
},
 
+   _metricfieldControl: function(parentContainer, data, builder, 
customCallback) {
+   var value;
+   var controls = 
L.Control.JSDialogBuilder.baseSpinField(parentContainer, data, builder, 
customCallback);
+
+   // It listens server state changes using GetControlState
+   // to avoid unit conversion
+   builder.map.on('commandstatechanged', function(e) {
+   value = e.state[data.id];
+   if (value) {
+   value = parseFloat(value);
+   $(controls.spinfield).attr('value', value);
+   }
+   }, this);
+
+   controls.spinfield.addEventListener('change', function() {
+   if (customCallback)
+   customCallback();
+   else
+   builder.callback('spinfield', 'value', 
controls.container, this.value, builder);
+   });
+
+   value = parseFloat(data.value);
+   $(controls.spinfield).attr('value', value);
+
+   return false;
+   },
+
_editControl: function(parentContainer, data, builder, callback) {
var edit = L.DomUtil.create('input', 'ui-edit mobile-wizard', 
parentContainer);
edit.value = builder._cleanText(data.text);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-28 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 0ec16cf344d302c1148695931fcdd80232596575
Author: Szymon Kłos 
AuthorDate: Tue Mar 17 15:17:57 2020 +0100
Commit: Szymon Kłos 
CommitDate: Tue Apr 28 11:44:42 2020 +0200

jsdialog: textarea without cursor is a paragraph

Change-Id: Ida85000fb93ebad5c871ccb20ea69ed86a03b645
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93043
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 85dcf5a48..96decadca 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1198,8 +1198,17 @@ L.Control.JSDialogBuilder = L.Control.extend({
},
 
_multiLineEditControl: function(parentContainer, data, builder, 
callback) {
-   var edit = L.DomUtil.create('textarea', '', parentContainer);
-   edit.value = builder._cleanText(data.text);
+   var controlType = 'textarea';
+   if (data.cursor && data.cursor === 'false')
+   controlType = 'p';
+
+   var edit = L.DomUtil.create(controlType, '', parentContainer);
+
+   if (controlType === 'textarea')
+   edit.value = builder._cleanText(data.text);
+   else
+   edit.innerHTML = builder._cleanText(data.text);
+
edit.id = data.id;
 
if (data.enabled == 'false')
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-28 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 052c2809e5dd7154f5e56c4f645edbda3976e303
Author: Szymon Kłos 
AuthorDate: Thu Mar 19 14:02:21 2020 +0100
Commit: Szymon Kłos 
CommitDate: Tue Apr 28 11:41:45 2020 +0200

jsdialog: add custom text for select range button

Change-Id: Id8a28b3dbb83d4b41507b530448f88d4b2abac83
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93042
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 57e6ed607..85dcf5a48 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1218,9 +1218,17 @@ L.Control.JSDialogBuilder = L.Control.extend({
return false;
},
 
+   _customPushButtonTextForId: function(buttonId) {
+   if (buttonId == 'validref')
+   return _('Select range');
+
+   return '';
+   },
+
_pushbuttonControl: function(parentContainer, data, builder, 
customCallback) {
var pushbutton = L.DomUtil.create('button', '', 
parentContainer);
-   pushbutton.innerHTML = builder._cleanText(data.text);
+   var customText = builder._customPushButtonTextForId(data.id);
+   pushbutton.innerHTML = customText !== '' ? customText : 
builder._cleanText(data.text);
pushbutton.id = data.id;
 
if (data.enabled == 'false')
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-28 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |   80 ++-
 1 file changed, 77 insertions(+), 3 deletions(-)

New commits:
commit 3b4297726ff36cb7f2362db6e7bc9aeabf7c2908
Author: Szymon Kłos 
AuthorDate: Fri Feb 28 15:08:56 2020 +0100
Commit: Szymon Kłos 
CommitDate: Tue Apr 28 10:28:51 2020 +0200

jsdialog: implement full combobox

Change-Id: I02432c39ffb78906466efe407118a771de7001f1
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93027
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 8fe8c9c17..f01480645 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -114,7 +114,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
this._controlHandlers['pushbutton'] = this._pushbuttonControl;
this._controlHandlers['combobox'] = this._comboboxControl;
this._controlHandlers['comboboxentry'] = this._comboboxEntry;
-   this._controlHandlers['listbox'] = this._comboboxControl;
+   this._controlHandlers['listbox'] = this._listboxControl;
this._controlHandlers['valueset'] = this._valuesetControl;
this._controlHandlers['fixedtext'] = this._fixedtextControl;
this._controlHandlers['htmlcontrol'] = this._htmlControl;
@@ -1167,7 +1167,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
return false;
},
 
-   _editControl: function(parentContainer, data, builder) {
+   _editControl: function(parentContainer, data, builder, callback) {
var edit = L.DomUtil.create('input', '', parentContainer);
edit.value = builder._cleanText(data.text);
edit.id = data.id;
@@ -1176,7 +1176,14 @@ L.Control.JSDialogBuilder = L.Control.extend({
$(edit).attr('disabled', 'disabled');
 
edit.addEventListener('change', function() {
-   builder.callback('edit', 'change', edit, this.value, 
builder);
+   if (callback)
+   callback(this.value);
+   else
+   builder.callback('edit', 'change', edit, 
this.value, builder);
+   });
+
+   edit.addEventListener('click', function(e) {
+   e.stopPropagation();
});
 
if (data.hidden)
@@ -1235,7 +1242,74 @@ L.Control.JSDialogBuilder = L.Control.extend({
}
},
 
+   _explorableEditControl: function(parentContainer, data, builder) {
+   var sectionTitle = L.DomUtil.create('div', 'ui-header level-' + 
builder._currentDepth + ' mobile-wizard ui-widget', parentContainer);
+   $(sectionTitle).css('justify-content', 'space-between');
+   if (data && data.id)
+   sectionTitle.id = data.id;
+
+   var leftDiv = L.DomUtil.create('div', 'ui-header-left', 
sectionTitle);
+
+   var editCallback = function(value) {
+   builder.callback('combobox', 'change', data, value, 
builder);
+   };
+   builder._editControl(leftDiv, data, builder, editCallback);
+
+   var rightDiv = L.DomUtil.create('div', 'ui-header-right', 
sectionTitle);
+
+   var arrowSpan = L.DomUtil.create('span', 'sub-menu-arrow', 
rightDiv);
+   arrowSpan.innerHTML = '>';
+
+   var contentDiv = L.DomUtil.create('div', 'ui-content level-' + 
builder._currentDepth + ' mobile-wizard', parentContainer);
+   contentDiv.title = data.text;
+
+   var entries = [];
+   if (data.entries) {
+   for (var index in data.entries) {
+   var style = 'ui-combobox-text';
+   if ((data.selectedEntries && index == 
data.selectedEntries[0])
+   || data.entries[index] == data.text) {
+   style += ' selected';
+   }
+
+   var entry = { type: 'comboboxentry', text: 
data.entries[index], pos: index, parent: data, style: style };
+   entries.push(entry);
+   }
+   }
+
+   var contentNode = {type: 'container', children: entries};
+
+   builder._currentDepth++;
+   builder.build(contentDiv, [contentNode]);
+   builder._currentDepth--;
+
+   if (!data.nosubmenu)
+   {
+   $(contentDiv).hide();
+   if (builder.wizard) {
+   $(sectionTitle).click(function(event, data) {
+  

[Libreoffice-commits] online.git: loleaflet/src

2020-04-28 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |   53 +++
 1 file changed, 53 insertions(+)

New commits:
commit b0faa3cf59cb58586fb6adfed33bd494d673897c
Author: Szymon Kłos 
AuthorDate: Wed Mar 4 15:50:29 2020 +0100
Commit: Szymon Kłos 
CommitDate: Tue Apr 28 10:14:44 2020 +0200

jsdialog: tabcontrol widget

Change-Id: Ibe72a382e767869f94db4f8b475dfe2169fcc702
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93028
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 9f500751f..8fe8c9c17 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -122,6 +122,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
this._controlHandlers['frame'] = this._frameHandler;
this._controlHandlers['panel'] = this._panelHandler;
this._controlHandlers['calcfuncpanel'] = 
this._calcFuncListPanelHandler;
+   this._controlHandlers['tabcontrol'] = this._tabsControlHandler;
this._controlHandlers['paneltabs'] = this._panelTabsHandler;
this._controlHandlers['container'] = this._containerHandler;
this._controlHandlers['window'] = this._containerHandler;
@@ -598,6 +599,58 @@ L.Control.JSDialogBuilder = L.Control.extend({
};
},
 
+   _tabsControlHandler: function(parentContainer, data, builder) {
+   if (data.tabs) {
+   var tabsContainer = L.DomUtil.create('div', 'ui-tabs 
mobile-wizard ui-widget');
+   tabsContainer.id = data.id;
+   var contentsContainer = L.DomUtil.create('div', 
'ui-tabs-content mobile-wizard ui-widget', parentContainer);
+
+   var tabs = [];
+   var contentDivs = [];
+   var labels = [];
+   for (var tabIdx = 0; tabIdx < data.tabs.length; 
tabIdx++) {
+   var item = data.tabs[tabIdx];
+
+   var title = builder._cleanText(item.text);
+
+   var tab = L.DomUtil.create('div', 'ui-tab 
mobile-wizard', tabsContainer);
+   tab.id = data.tabs[tabIdx].name;
+   if (data.selected == data.tabs[tabIdx].id)
+   $(tab).addClass('selected');
+   tabs[tabIdx] = tab;
+
+   var label = L.DomUtil.create('span', 
'ui-tab-content mobile-wizard unolabel', tab);
+   label.innerHTML = title;
+   labels[tabIdx] = title;
+
+   var contentDiv = L.DomUtil.create('div', 
'ui-content level-' + builder._currentDepth + ' mobile-wizard', 
contentsContainer);
+   contentDiv.title = title;
+
+   $(contentDiv).hide();
+   contentDivs[tabIdx] = contentDiv;
+   }
+
+   if (builder.wizard) {
+   builder.wizard.setTabs(tabsContainer);
+
+   for (var t = 0; t < tabs.length; t++) {
+   // to get capture of 't' right has to 
be a sub fn.
+   var fn = function(id) {
+   return function() {
+   
builder._createTabClick(builder, id, tabs, contentDivs, labels)();
+   
builder.callback('tabcontrol', 'selecttab', tabsContainer, id, builder);
+   };
+   };
+   $(tabs[t]).click(fn(t));
+   }
+   } else {
+   console.debug('Builder used outside of mobile 
wizard: please implement the click handler');
+   }
+   }
+
+   return true;
+   },
+
_panelTabsHandler: function(parentContainer, data, builder) {
var tabsContainer = L.DomUtil.create('div', 'ui-tabs 
mobile-wizard ui-widget');
var contentsContainer = L.DomUtil.create('div', 
'ui-tabs-content mobile-wizard ui-widget', parentContainer);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-28 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |   14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 70084f48dd14667df15ef6022d423eda01e8b729
Author: Szymon Kłos 
AuthorDate: Tue Feb 25 10:50:43 2020 +0100
Commit: Szymon Kłos 
CommitDate: Tue Apr 28 10:13:29 2020 +0200

jsdialog: build frame also without title

Change-Id: Id5f94eb90756419305ab5d593791663ecb5eb41b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93026
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 225e92ad9..9f500751f 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -548,10 +548,13 @@ L.Control.JSDialogBuilder = L.Control.extend({
},
 
_frameHandler: function(parentContainer, data, builder) {
-   data.text = builder._cleanText(data.children[0].text);
-   var contentNode = data.children[1];
-
-   builder._explorableEntry(parentContainer, data, contentNode, 
builder);
+   if (data.children.length > 1) {
+   data.text = builder._cleanText(data.children[0].text);
+   var contentNode = data.children[1];
+   builder._explorableEntry(parentContainer, data, 
contentNode, builder);
+   } else {
+   return true;
+   }
 
return false;
},
@@ -1823,6 +1826,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
build: function(parent, data) {
this._amendJSDialogData(data);
for (var childIndex in data) {
+   if (!data[childIndex])
+   continue;
+
var childData = data[childIndex];
if (!childData)
continue;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-28 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |   22 ++
 1 file changed, 22 insertions(+)

New commits:
commit 1cf7c3a46ce7b80164a8c16aab035e3c5156f083
Author: Szymon Kłos 
AuthorDate: Fri Mar 6 12:30:35 2020 +0100
Commit: Szymon Kłos 
CommitDate: Tue Apr 28 10:12:47 2020 +0200

jsdialog: implemented multilineedit control

Change-Id: I1cda88437357f80cafbdcdbee03832af806a55d6
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93030
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 5bc0ac9ba..225e92ad9 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -110,6 +110,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
this._controlHandlers['checkbox'] = this._checkboxControl;
this._controlHandlers['spinfield'] = this._spinfieldControl;
this._controlHandlers['edit'] = this._editControl;
+   this._controlHandlers['multilineedit'] = 
this._multiLineEditControl;
this._controlHandlers['pushbutton'] = this._pushbuttonControl;
this._controlHandlers['combobox'] = this._comboboxControl;
this._controlHandlers['comboboxentry'] = this._comboboxEntry;
@@ -1128,6 +1129,27 @@ L.Control.JSDialogBuilder = L.Control.extend({
return false;
},
 
+   _multiLineEditControl: function(parentContainer, data, builder, 
callback) {
+   var edit = L.DomUtil.create('textarea', '', parentContainer);
+   edit.value = builder._cleanText(data.text);
+   edit.id = data.id;
+
+   if (data.enabled == 'false')
+   $(edit).attr('disabled', 'disabled');
+
+   edit.addEventListener('change', function() {
+   if (callback)
+   callback(this.value);
+   else
+   builder.callback('edit', 'change', edit, 
this.value, builder);
+   });
+
+   if (data.hidden)
+   $(edit).hide();
+
+   return false;
+   },
+
_pushbuttonControl: function(parentContainer, data, builder, 
customCallback) {
var pushbutton = L.DomUtil.create('button', '', 
parentContainer);
pushbutton.innerHTML = builder._cleanText(data.text);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-27 Thread Henry Castro (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |  163 +++
 1 file changed, 85 insertions(+), 78 deletions(-)

New commits:
commit d0ca14d40484aad01e1c5964537131fe3ae280a0
Author: Henry Castro 
AuthorDate: Wed Apr 22 19:55:13 2020 -0400
Commit: Henry Castro 
CommitDate: Tue Apr 28 03:13:38 2020 +0200

jsdialog: create a static base spinfiled function

The next patch will re-use to implement metric field control

Change-Id: Iebfb2584fe4771e8a98eac1fc5b63768013b817a
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92798
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index e27220fa1..5bc0ac9ba 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -23,6 +23,83 @@ L.Control.JSDialogBuilder = L.Control.extend({
 
_currentDepth: 0,
 
+   statics: {
+   baseSpinField: function(parentContainer, data, builder, 
customCallback) {
+   var controls = {};
+   if (data.label) {
+   var fixedTextData = { text: data.label };
+   builder._fixedtextControl(parentContainer, 
fixedTextData, builder);
+   }
+
+   var div = L.DomUtil.create('div', 'spinfieldcontainer', 
parentContainer);
+   div.id = data.id;
+   controls['container'] = div;
+
+   var commandName = data.id ? 
data.id.substring('.uno:'.length) : data.id;
+   if (commandName && commandName.length && 
L.LOUtil.existsIconForCommand(commandName, builder.map.getDocType())) {
+   var image = L.DomUtil.create('img', 
'spinfieldimage', div);
+   var icon = builder._createIconPath(data.id);
+   image.src = icon;
+   icon.alt = '';
+   }
+
+   var spinfield = L.DomUtil.create('input', 'spinfield', 
div);
+   spinfield.type = 'number';
+   controls['spinfield'] = spinfield;
+
+   if (data.unit) {
+   var unit = L.DomUtil.create('span', 
'spinfieldunit', div);
+   unit.innerHTML = 
builder._unitToVisibleString(data.unit);
+   }
+
+   var controlsContainer = L.DomUtil.create('div', 
'spinfieldcontrols', div);
+   var minus = L.DomUtil.create('div', 'minus', 
controlsContainer);
+   minus.innerHTML = '-';
+
+   var plus = L.DomUtil.create('div', 'plus', 
controlsContainer);
+   plus.innerHTML = '+';
+
+   if (data.min != undefined)
+   $(spinfield).attr('min', data.min);
+
+   if (data.max != undefined)
+   $(spinfield).attr('max', data.max);
+
+   if (data.enabled == 'false') {
+   $(spinfield).attr('disabled', 'disabled');
+   $(image).addClass('disabled');
+   }
+
+   if (data.readOnly === true)
+   $(spinfield).attr('readOnly', 'true');
+
+   if (data.hidden)
+   $(spinfield).hide();
+
+   plus.addEventListener('click', function() {
+   var attrdisabled = 
$(spinfield).attr('disabled');
+   if (attrdisabled !== 'disabled') {
+   if (customCallback)
+   customCallback('spinfield', 
'plus', div, this.value, builder);
+   else
+   builder.callback('spinfield', 
'plus', div, this.value, builder);
+   }
+   });
+
+   minus.addEventListener('click', function() {
+   var attrdisabled = 
$(spinfield).attr('disabled');
+   if (attrdisabled !== 'disabled') {
+   if (customCallback)
+   customCallback('spinfield', 
'minus', div, this.value, builder);
+   else
+   builder.callback('spinfield', 
'minus', div, this.value, builder);
+   }
+   });
+
+   return controls;
+   }
+   },
+
_setup: function(options) {
th

[Libreoffice-commits] online.git: loleaflet/src

2020-04-24 Thread Pranam Lashkari (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit 2a3f5f0fc3445f099192c9e39fea184f184feddf
Author: Pranam Lashkari 
AuthorDate: Fri Apr 24 11:32:59 2020 +0530
Commit: Andras Timar 
CommitDate: Fri Apr 24 20:07:13 2020 +0200

leaflet: removed color name from the title

removed color name from title of slidebackground color/gradient picker in 
mobile wizard

Change-Id: I92a6b3b5df9e6f826b903951b575c8497f5faf3a
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92832
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 97f416d25..e27220fa1 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1537,13 +1537,12 @@ L.Control.JSDialogBuilder = L.Control.extend({
valueNode.style.backgroundColor = selectedColor;
if (titleSpan) {
if (data.id === 'fillattr')
-   titleSpan.innerHTML = _('Background 
Color');
+   data.text = _('Background Color');
else if (data.id === 'fillattr2')
-   titleSpan.innerHTML = _('Gradient 
Start');
+   data.text = _('Gradient Start');
else if (data.id === 'fillattr3')
-   titleSpan.innerHTML = _('Gradient End');
-   else
-   titleSpan.innerHTML = data.text;
+   data.text = _('Gradient End');
+   titleSpan.innerHTML = data.text;
}
}.bind(this);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-23 Thread mert (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |   89 +++
 loleaflet/src/control/Control.MobileWizard.js|   23 -
 2 files changed, 62 insertions(+), 50 deletions(-)

New commits:
commit d9cbd9d6f673dc70bcaa873a51dd30a9e4f5be4e
Author: mert 
AuthorDate: Thu Apr 23 14:56:26 2020 +0300
Commit: Andras Timar 
CommitDate: Thu Apr 23 19:35:06 2020 +0200

mobilewizard: fix number format doesn't update properly

Change-Id: I852dd79d9658f676e86b22cb1cb145264c9de2fe
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92762
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 4deb8e296..97f416d25 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -252,33 +252,20 @@ L.Control.JSDialogBuilder = L.Control.extend({
return false;
},
 
-   _updateListBox: function(builder, contentDiv, contentNode, 
sectionTitle, data, state) {
-   if ($(sectionTitle).find('.entry-value')[0])
-   sectionTitle = 
$($(sectionTitle).find('.entry-value')).get(0);
-   else
-   sectionTitle = 
$(sectionTitle).find('.ui-header-left').find('span')[0];
-
+   _updateListBox: function(builder, sectionTitle, data, state) {
if (!sectionTitle)
return;
 
-   $(contentDiv).find('.selected').removeClass('selected');
-
-   var hasChildren = $(contentDiv).children().length > 0 && 
contentNode.children && contentNode.children.length > 0;
var updateBy = builder._getListBoxUpdateType(data.id);
-   if (updateBy === 'index') {
+
+   if (updateBy === 'index')
sectionTitle.innerHTML = data.entries[state];
-   data.selectedEntries[0] = state;
-   contentDiv.title = data.entries[state];
-   if (hasChildren) {
-   
$($(contentDiv).children().get(state)).addClass('selected');
-   }
-   } else if (updateBy === 'value') {
+   else if (updateBy === 'value')
sectionTitle.innerHTML = state;
-   if (hasChildren) {
-   $(contentDiv).find('p').filter(function() {
-   return $(this).text() === state;
-   }).addClass('selected');
-   }
+
+   if (builder.refreshSidebar) {
+   builder.wizard._refreshSidebar(0);
+   builder.refreshSidebar = false;
}
},
 
@@ -301,6 +288,13 @@ L.Control.JSDialogBuilder = L.Control.extend({
}
var titleSpan = L.DomUtil.create('span', titleClass, leftDiv);
 
+   if (!valueNode && data.command) {
+   var items = builder.map['stateChangeHandler'];
+   var val = items.getItemValue(data.command);
+   if (val)
+   valueNode = L.DomUtil.create('div', '', null);
+   }
+
var rightDiv = L.DomUtil.create('div', 'ui-header-right', 
sectionTitle);
if (valueNode) {
var valueDiv = L.DomUtil.create('div', 'entry-value', 
rightDiv);
@@ -310,36 +304,14 @@ L.Control.JSDialogBuilder = L.Control.extend({
var arrowSpan = L.DomUtil.create('span', 'sub-menu-arrow', 
rightDiv);
arrowSpan.innerHTML = '>';
 
-   var contentDiv = L.DomUtil.create('div', 'ui-content level-' + 
builder._currentDepth + ' mobile-wizard', parentContainer);
-   contentDiv.title = data.text;
-
-   builder._currentDepth++;
-   builder.build(contentDiv, [contentNode]);
-   builder._currentDepth--;
-
-   if (!data.nosubmenu)
-   {
-   $(contentDiv).hide();
-   if (builder.wizard) {
-   $(sectionTitle).click(function(event, data) {
-   builder.wizard.goLevelDown(contentDiv, 
data);
-   if (contentNode.onshow)
-   contentNode.onshow();
-   });
-   } else {
-   console.debug('Builder used outside of mobile 
wizard: please implement the click handler');
-   }
-   }
-   else
-   $(sectionTitle).hide();
-
var updateFunction = function(titleSpan) {
var state = null;
if (data.id)

[Libreoffice-commits] online.git: loleaflet/src

2020-04-23 Thread Pranam Lashkari (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit def23685476f0878e2e283f3b49330494c4cfb51
Author: Pranam Lashkari 
AuthorDate: Thu Apr 23 15:15:09 2020 +0530
Commit: Andras Timar 
CommitDate: Thu Apr 23 18:09:47 2020 +0200

leaflet: slide background color/gradient name replaced

color names are replaced with descriptive names
i.e: background color, gradient start, gradient end

Change-Id: I4d8a8bec6f180efa3874275f6ed0aeec33369bb1
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92750
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index c9a410feb..4deb8e296 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1538,8 +1538,16 @@ L.Control.JSDialogBuilder = L.Control.extend({
var updateFunction = function (titleSpan) {
selectedColor = builder._getCurrentColor(data, builder);
valueNode.style.backgroundColor = selectedColor;
-   if (titleSpan)
-   titleSpan.innerHTML = data.text;
+   if (titleSpan) {
+   if (data.id === 'fillattr')
+   titleSpan.innerHTML = _('Background 
Color');
+   else if (data.id === 'fillattr2')
+   titleSpan.innerHTML = _('Gradient 
Start');
+   else if (data.id === 'fillattr3')
+   titleSpan.innerHTML = _('Gradient End');
+   else
+   titleSpan.innerHTML = data.text;
+   }
}.bind(this);
 
updateFunction(null);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-23 Thread Pranam Lashkari (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 15c2235d160bdbbc163d0d370d46cb5a61a62acf
Author: Pranam Lashkari 
AuthorDate: Thu Apr 23 13:57:09 2020 +0530
Commit: Szymon Kłos 
CommitDate: Thu Apr 23 13:21:04 2020 +0200

leaflet: changed ID of shape fill style

Change-Id: Ib8ad95cf265afbee88f02c3d7746a030e44bbf7c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92743
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index f2cb686c6..323f69bd7 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -862,7 +862,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
}
break;
 
-   case 'fillstyle':
+   case 'fillstylearea':
state = items.getItemValue('.uno:FillStyle');
if (state) {
switch (state) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-23 Thread Pranam Lashkari (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |   31 ---
 1 file changed, 27 insertions(+), 4 deletions(-)

New commits:
commit 313db8a8cd33e2a9c98daf9d6b70cdfb5af5175b
Author: Pranam Lashkari 
AuthorDate: Tue Apr 21 14:49:13 2020 +0530
Commit: Szymon Kłos 
CommitDate: Thu Apr 23 13:19:48 2020 +0200

leaflet: resolved impress slide background gradient not changing

Change-Id: If71b380859c202327a533b121af45232682e52df
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92088
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index f5f92bb6f..f2cb686c6 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -886,10 +886,23 @@ L.Control.JSDialogBuilder = L.Control.extend({
break;
 
case 'fillattr':
-   var hatch = items.getItemValue('.uno:FillHatch');
-   var bitmap = items.getItemValue('.uno:FillBitmap');
-   if (hatch || bitmap) {
-   // TODO
+   state = items.getItemValue('.uno:FillPageColor');
+   if (state) {
+   return state;
+   }
+   break;
+
+   case 'fillattr2':
+   state = items.getItemValue('.uno:FillPageGradient');
+   if (state) {
+   return state.startcolor;
+   }
+   break;
+
+   case 'fillattr3':
+   state = items.getItemValue('.uno:FillPageGradient');
+   if (state) {
+   return state.endcolor;
}
break;
 
@@ -1397,6 +1410,16 @@ L.Control.JSDialogBuilder = L.Control.extend({
} else if (data.id === 'fillattr') {

builder.map.sendUnoCommand('.uno:FillPageColor?Color:string=' + color);
return;
+   } else if (data.id === 'fillattr2') {
+   gradientItem = 
builder.map['stateChangeHandler'].getItemValue('.uno:FillPageGradient');
+   gradientItem.startcolor = color;
+   
builder.map.sendUnoCommand('.uno:FillPageGradient?FillPageGradientJSON:string=' 
+ JSON.stringify(gradientItem));
+   return;
+   } else if (data.id === 'fillattr3') {
+   gradientItem = 
builder.map['stateChangeHandler'].getItemValue('.uno:FillPageGradient');
+   gradientItem.endcolor = color;
+   
builder.map.sendUnoCommand('.uno:FillPageGradient?FillPageGradientJSON:string=' 
+ JSON.stringify(gradientItem));
+   return;
}
 
var command = data.command + '?Color:string=' + color;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-22 Thread Tomaž Vajngerl (via logerrit)
 loleaflet/src/control/Control.StatusBar.js |6 ++
 loleaflet/src/map/Map.js   |2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 288d99847e3427d30a1380dbd08cfaceb20c8b21
Author: Tomaž Vajngerl 
AuthorDate: Tue Apr 21 16:45:51 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Wed Apr 22 11:47:19 2020 +0200

loleaflet: decrease min zoom to 1 => 20%

In some cases on tablets in impress we want even smaller document
sizes as otherwise the document doesn't fit on the screen.

Change-Id: Ice00f122bae1401755c5094c23202a208468fe50
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92640
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 

diff --git a/loleaflet/src/control/Control.StatusBar.js 
b/loleaflet/src/control/Control.StatusBar.js
index 056975769..dd12ec836 100644
--- a/loleaflet/src/control/Control.StatusBar.js
+++ b/loleaflet/src/control/Control.StatusBar.js
@@ -200,6 +200,9 @@ L.Control.StatusBar = L.Control.extend({
selected: 'zoom100',
mobile: false,
items: [
+   { id: 'zoom20', text: 
'20', scale: 1},
+   { id: 'zoom25', text: 
'25', scale: 2},
+   { id: 'zoom30', text: 
'30', scale: 3},
{ id: 'zoom35', text: 
'35', scale: 4},
{ id: 'zoom40', text: 
'40', scale: 5},
{ id: 'zoom50', text: 
'50', scale: 6},
@@ -257,6 +260,9 @@ L.Control.StatusBar = L.Control.extend({
var zoomPercent = 100;
var zoomSelected = null;
switch (that.map.getZoom()) {
+   case 1:  zoomPercent =  20; zoomSelected = 'zoom20'; 
break;  // 0.2102
+   case 2:  zoomPercent =  25; zoomSelected = 'zoom25'; 
break;  // 0.2500
+   case 3:  zoomPercent =  30; zoomSelected = 'zoom30'; 
break;  // 0.2973
case 4:  zoomPercent =  35; zoomSelected = 'zoom35'; 
break;  // 0.3535
case 5:  zoomPercent =  40; zoomSelected = 'zoom40'; 
break;  // 0.4204
case 6:  zoomPercent =  50; zoomSelected = 'zoom50'; 
break;  // 0.5
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index d457f4076..39dcf46d2 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -23,7 +23,7 @@ L.Map = L.Evented.extend({
// is approximately 1.2. Thus 4 corresponds to six steps of 
division by pow(2,1/4) =
// 35%. 18 corresponds to 8 steps of multiplication by 
pow(2,1/4) = 400%. The
// percentages available are then rounded to the nearest five 
percent.
-   minZoom: 4,
+   minZoom: 1,
maxZoom: 18,
maxBounds: L.latLngBounds([0, 0], [-100, 100]),
fadeAnimation: false, // Not useful for typing.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-22 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.StatusBar.js  |7 +++
 loleaflet/src/control/Control.TopToolbar.js |7 +++
 loleaflet/src/control/Control.UIManager.js  |   15 ---
 3 files changed, 14 insertions(+), 15 deletions(-)

New commits:
commit 829a0c7fa3d7a4168d67e3b7bd439c62b39e5d2e
Author: Szymon Kłos 
AuthorDate: Wed Apr 22 09:28:11 2020 +0200
Commit: Szymon Kłos 
CommitDate: Wed Apr 22 10:20:15 2020 +0200

Move toolbars resizing to the internal implementation

Change-Id: I7afa916f03c4d6d4dd4b863d6ff65b1936fe32f0
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92671
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.StatusBar.js 
b/loleaflet/src/control/Control.StatusBar.js
index 2f1a7a44f..056975769 100644
--- a/loleaflet/src/control/Control.StatusBar.js
+++ b/loleaflet/src/control/Control.StatusBar.js
@@ -15,6 +15,13 @@ L.Control.StatusBar = L.Control.extend({
map.on('commandvalues', this.onCommandValues, this);
map.on('commandstatechanged', this.onCommandStateChanged, this);
this.create();
+
+   $(window).resize(function() {
+   if ($(window).width() !== map.getSize().x) {
+   var statusbar = w2ui['actionbar'];
+   statusbar.resize();
+   }
+   });
},
 
hideTooltip: function(toolbar, id) {
diff --git a/loleaflet/src/control/Control.TopToolbar.js 
b/loleaflet/src/control/Control.TopToolbar.js
index bb13a1fb4..06fdd038f 100644
--- a/loleaflet/src/control/Control.TopToolbar.js
+++ b/loleaflet/src/control/Control.TopToolbar.js
@@ -22,6 +22,13 @@ L.Control.TopToolbar = L.Control.extend({
if (!window.mode.isMobile()) {
map.on('updatetoolbarcommandvalues', 
this.updateCommandValues, this);
}
+
+   $(window).resize(function() {
+   if ($(window).width() !== map.getSize().x) {
+   var toolbar = w2ui['editbar'];
+   toolbar.resize();
+   }
+   });
},
 
onFontSizeSelect: function(e) {
diff --git a/loleaflet/src/control/Control.UIManager.js 
b/loleaflet/src/control/Control.UIManager.js
index f3cad662e..88124c491 100644
--- a/loleaflet/src/control/Control.UIManager.js
+++ b/loleaflet/src/control/Control.UIManager.js
@@ -15,8 +15,6 @@ L.Control.UIManager = L.Control.extend({
// UI initialization
 
initializeBasicUI: function() {
-   var that = this;
-
var menubar = L.control.menubar();
this.map.menubar = menubar;
this.map.addControl(menubar);
@@ -54,10 +52,6 @@ L.Control.UIManager = L.Control.extend({
w2utils.unlock(w2ui['actionbar'].box);
}
});
-
-   $(window).resize(function() {
-   that.resizeToolbars();
-   });
},
 
initializeSpecializedUI: function(docType) {
@@ -173,15 +167,6 @@ L.Control.UIManager = L.Control.extend({
this.map.invalidateSize();
},
 
-   resizeToolbars: function() {
-   if ($(window).width() !== this.map.getSize().x) {
-   var toolbarUp = w2ui['editbar'];
-   var statusbar = w2ui['actionbar'];
-   toolbarUp.resize();
-   statusbar.resize();
-   }
-   },
-
// Helper functions
 
moveObjectVertically: function(obj, diff) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-22 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.MobileBottomBar.js |2 ++
 loleaflet/src/control/Control.MobileTopBar.js|   20 +++-
 loleaflet/src/control/Control.PresentationBar.js |   21 +
 loleaflet/src/control/Control.Toolbar.js |   10 ++
 loleaflet/src/control/Control.TopToolbar.js  |3 +++
 5 files changed, 47 insertions(+), 9 deletions(-)

New commits:
commit 799235eb38a8fdbf43a07463f2fecbc9893ab1e7
Author: Szymon Kłos 
AuthorDate: Wed Apr 22 09:15:03 2020 +0200
Commit: Szymon Kłos 
CommitDate: Wed Apr 22 10:06:18 2020 +0200

Move command state updates handler to toolbar implementations

Change-Id: I3b9b4a7c05a0c6f40f86f6a69ea8873a1120180c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92670
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.MobileBottomBar.js 
b/loleaflet/src/control/Control.MobileBottomBar.js
index 078e8d880..8a11179b9 100644
--- a/loleaflet/src/control/Control.MobileBottomBar.js
+++ b/loleaflet/src/control/Control.MobileBottomBar.js
@@ -17,6 +17,8 @@ L.Control.MobileBottomBar = L.Control.extend({
onAdd: function (map) {
this.map = map;
this.create();
+
+   map.on('commandstatechanged', window.onCommandStateChanged);
},
 
getToolItems: function(docType) {
diff --git a/loleaflet/src/control/Control.MobileTopBar.js 
b/loleaflet/src/control/Control.MobileTopBar.js
index 76874fb9c..8543a3221 100644
--- a/loleaflet/src/control/Control.MobileTopBar.js
+++ b/loleaflet/src/control/Control.MobileTopBar.js
@@ -19,6 +19,7 @@ L.Control.MobileTopBar = L.Control.extend({
this.create();
 
map.on('updatepermission', this.onUpdatePermission, this);
+   map.on('commandstatechanged', this.onCommandStateChanged, this);
},
 
getToolItems: function(docType) {
@@ -184,7 +185,24 @@ L.Control.MobileTopBar = L.Control.extend({
});
}
}
-   }
+   },
+
+   onCommandStateChanged: function(e) {
+   var commandName = e.commandName;
+   var state = e.state;
+
+   if (this.map._permission === 'edit' && (state === 'enabled' || 
state === 'disabled')) {
+   var id = window.unoCmdToToolbarId(commandName);
+   var toolbar = w2ui['actionbar'];
+
+   if (state === 'enabled') {
+   toolbar.enable(id);
+   } else {
+   toolbar.uncheck(id);
+   toolbar.disable(id);
+   }
+   }
+   },
 });
 
 L.control.mobileTopBar = function (docType) {
diff --git a/loleaflet/src/control/Control.PresentationBar.js 
b/loleaflet/src/control/Control.PresentationBar.js
index 9cf159bd5..eeb3cfac8 100644
--- a/loleaflet/src/control/Control.PresentationBar.js
+++ b/loleaflet/src/control/Control.PresentationBar.js
@@ -16,6 +16,7 @@ L.Control.PresentationBar = L.Control.extend({
map.on('wopiprops', this.onWopiProps, this);
map.on('doclayerinit', this.onDocLayerInit, this);
map.on('updatepermission', this.onUpdatePermission, this);
+   map.on('commandstatechanged', this.onCommandStateChanged, this);
},
 
create: function() {
@@ -149,6 +150,26 @@ L.Control.PresentationBar = L.Control.extend({
}
}
},
+
+   onCommandStateChanged: function(e) {
+   var commandName = e.commandName;
+   var state = e.state;
+
+   if (this.map._permission === 'edit' && (state === 'enabled' || 
state === 'disabled')) {
+   var id = window.unoCmdToToolbarId(commandName);
+
+   if (id === 'deletepage' || id === 'insertpage' || id 
=== 'duplicatepage') {
+   var toolbar = w2ui['presentation-toolbar'];
+
+   if (state === 'enabled') {
+   toolbar.enable(id);
+   } else {
+   toolbar.uncheck(id);
+   toolbar.disable(id);
+   }
+   }
+   }
+   },
 });
 
 L.control.presentationBar = function (options) {
diff --git a/loleaflet/src/control/Control.Toolbar.js 
b/loleaflet/src/control/Control.Toolbar.js
index 021065f43..bdfbbee9e 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -733,7 +733,6 @@ function onWopiProps(e) {
 
 function onCommandStateChanged(e) {
var toolbar = w2ui['editbar'];
-   var statusbar = w2ui['actionbar'];
var commandName = e.commandName;
var state = 

[Libreoffice-commits] online.git: loleaflet/src

2020-04-21 Thread Tamás Zolnai (via logerrit)
 loleaflet/src/control/Control.Toolbar.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 57e225bb9b4c58228db8a75938f2f7024d700a0b
Author: Tamás Zolnai 
AuthorDate: Tue Apr 21 16:45:47 2020 +0200
Commit: Tamás Zolnai 
CommitDate: Tue Apr 21 19:35:46 2020 +0200

mobile: fix 'enable property of undefined' error.

Caught by cypress tests.
We don't have 'presentation-toolbar' on mobile.

Change-Id: I95440dbd505202183f936fc3e4f962c6a0199257
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92646
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tamás Zolnai 

diff --git a/loleaflet/src/control/Control.Toolbar.js 
b/loleaflet/src/control/Control.Toolbar.js
index 0dc0264d6..a70d4d78e 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -922,7 +922,7 @@ function onCommandStateChanged(e) {
if (window.mode.isMobile()) {
toolbarUp = statusbar;
}
-   if (map.getDocType() === 'presentation' && (id === 'deletepage' 
|| id === 'insertpage' || id === 'duplicatepage')) {
+   else if (map.getDocType() === 'presentation' && (id === 
'deletepage' || id === 'insertpage' || id === 'duplicatepage')) {
toolbarUp = w2ui['presentation-toolbar'];
}
if (state === 'enabled') {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-21 Thread Pranam Lashkari (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit f07f29080ab9b8bb26c340520c6ed15ec75c16a9
Author: Pranam Lashkari 
AuthorDate: Thu Apr 9 05:25:11 2020 +0530
Commit: Szymon Kłos 
CommitDate: Tue Apr 21 12:17:17 2020 +0200

leaflet: resolved impress slide background color not changing

Change-Id: Ia55a9c1f9bc5a51e6599755bfaf37d9788c9f7c3
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91943
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 09ffdb6eb..f5f92bb6f 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1394,6 +1394,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
gradientItem.endcolor = color;

builder.map.sendUnoCommand('.uno:FillGradient?FillGradientJSON:string=' + 
JSON.stringify(gradientItem));
return;
+   } else if (data.id === 'fillattr') {
+   
builder.map.sendUnoCommand('.uno:FillPageColor?Color:string=' + color);
+   return;
}
 
var command = data.command + '?Color:string=' + color;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-20 Thread Muhammet Kara (via logerrit)
 loleaflet/src/control/Toolbar.js |   30 ++
 1 file changed, 26 insertions(+), 4 deletions(-)

New commits:
commit fca73e16b92e7b2932c6ae98566f548e52165f48
Author: Muhammet Kara 
AuthorDate: Sat Apr 18 00:36:08 2020 +0300
Commit: Muhammet Kara 
CommitDate: Tue Apr 21 00:23:32 2020 +0200

Welcome: Add the dismiss/accept button

Now that we have the value of window.enableWelcomeMessageButton
coming from the loolwsd.xml, we can optionally enable/disable
the dismiss/accept button.

Using vex.dialog.open instead of vex.open to be able to
have the 'buttons' option.

Because the vex-dialog-message class displays the message
all-bold (very ugly) on mobile, we change it to vex-content,
just after opening the dialog.

We also limit the max height of the dialog to avoid double
scroll-bars.

Change-Id: I0c4d1cba303da49d23342a74538c7f340c4bcf1b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92465
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Muhammet Kara 

diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index 8def69a6b..61d63eed3 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -348,6 +348,8 @@ L.Map.include({
_showWelcomeDialogVex: function(data) {
var w;
var iw = window.innerWidth;
+   var hasDismissBtn = window.enableWelcomeMessageButton;
+
if (iw < 768) {
w = iw - 30;
}
@@ -358,21 +360,41 @@ L.Map.include({
w = iw / 5 + 590;
}
 
+   if (hasDismissBtn) {
+   var ih = window.innerHeight;
+   var h = ih / 2;
+   if (iw < 768) {
+   h = ih - 170; // Hopefully enough padding to 
avoid extra scroll-bar on mobile,
+   }
+   var containerDiv = '';
+   containerDiv += data;
+   containerDiv += '';
+   data = containerDiv;
+   }
+
// show the dialog
var map = this;
-   vex.open({
-   unsafeContent: data,
-   showCloseButton: true,
+   vex.dialog.open({
+   unsafeMessage: data,
+   showCloseButton: !hasDismissBtn,
escapeButtonCloses: false,
overlayClosesOnClick: false,
closeAllOnPopState: false,
-   buttons: {},
+   focusFirstInput: false, // Needed to avoid auto-scroll 
to the bottom
+   buttons: !hasDismissBtn ? {} : [
+   $.extend({}, vex.dialog.buttons.YES, { text: 
_('I understand the risks') }),
+   ],
afterOpen: function() {
var $vexContent = $(this.contentEl);
this.contentEl.style.width = w + 'px';
map.enable(false);
 
$vexContent.attr('tabindex', -1);
+   // Work-around to avoid the ugly all-bold 
dialog message on mobile
+   if (window.mode.isMobile()) {
+   var dlgMsg = 
document.getElementsByClassName('vex-dialog-message')[0];
+   dlgMsg.setAttribute('class', 
'vex-content');
+   }
$vexContent.focus();
// workaround for 
https://github.com/HubSpot/vex/issues/43
$('.vex-overlay').css({ 'pointer-events': 
'none'});
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-20 Thread Muhammet Kara (via logerrit)
 loleaflet/src/control/Toolbar.js |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 1c296d5947df4c7a17a6035c4406df917c1c2f79
Author: Muhammet Kara 
AuthorDate: Mon Apr 20 17:18:08 2020 +0300
Commit: Muhammet Kara 
CommitDate: Mon Apr 20 16:36:04 2020 +0200

Welcome: Prevent a million cookies during development

By default, cookies are stored with full path of
the web app, and we have an extension made of the
hash of the build. So each new commit means a new
web app for the browser, causing many cookies stored,
and the welcome dialog being shown after each commit.

From now on, we will be storing our cookies to the
'/loleaflet' path.

Change-Id: I4cb25ab0a53c4743cb929a7f6c20ab019da29409
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92575
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Muhammet Kara 

diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index 3ed636444..8def69a6b 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -396,14 +396,14 @@ L.Map.include({
if (!calledFromMenu) {
var WSDVerCookie = 'WSDWelcomeVersion=' 
+ map._socket.WSDServer.Version;
// Cookie will not expire for a year, 
and it will not be sent to other domains
-   WSDVerCookie += '; max-age=31536000; 
SameSite=Strict';
+   WSDVerCookie += '; max-age=31536000; 
SameSite=Strict; path=/loleaflet';
document.cookie = WSDVerCookie;
}
})
.fail(function() {
// Welcome dialog disabled in loolwsd.xml or 
nonexistant for some other reason
// Let's check back in a day (60 x 60 x 24 = 
86400 seconds)
-   var welcomeDisabledCookie = 
'WSDWelcomeDisabled=true; max-age=86400; SameSite=Strict';
+   var welcomeDisabledCookie = 
'WSDWelcomeDisabled=true; max-age=86400; SameSite=Strict; path=/loleaflet';
document.cookie = welcomeDisabledCookie;
 
if (calledFromMenu)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-20 Thread Tomaž Vajngerl (via logerrit)
 loleaflet/src/map/Map.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9885fc136e022f55b2e139cfe81efc352e9932f1
Author: Tomaž Vajngerl 
AuthorDate: Mon Apr 20 10:45:06 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Mon Apr 20 12:46:43 2020 +0200

ruler: show ruler for all tablets, not only iOS

Change-Id: If127220052bf956c88e4b927a882a1d049e91dac
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92551
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 860117cc5..d457f4076 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -200,7 +200,7 @@ L.Map = L.Evented.extend({
if (!this.initComplete) {
this._fireInitComplete('doclayerinit');
}
-   if (((window.ThisIsTheiOSApp && window.mode.isTablet()) 
|| window.mode.isDesktop()) && this._docLayer._docType == 'text') {
+   if ((window.mode.isTablet() || window.mode.isDesktop()) 
&& this._docLayer._docType == 'text') {
var interactiveRuler = this._permission === 
'edit' ? true : false;
L.control.ruler({position:'topleft', 
interactive:interactiveRuler}).addTo(this);
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-20 Thread Tomaž Vajngerl (via logerrit)
 loleaflet/src/control/Ruler.js |   54 +
 1 file changed, 33 insertions(+), 21 deletions(-)

New commits:
commit ad19d910caf70eacd547172a06d105d2410ef633
Author: Tomaž Vajngerl 
AuthorDate: Mon Apr 20 09:59:34 2020 +0200
Commit: Tomaž Vajngerl 
CommitDate: Mon Apr 20 12:45:22 2020 +0200

ruler: make sure touch and mouse events don't cause an error

We need to make sure we don't accidentally get into either a
touch or mouse event codepath, which would cause an error as the
events and cases differe a bit. For example touch event has no
'button' member, which means a touch 'panstart' event would be
ignored in every case, which would then cause an error in
'panmove' and 'panend' because some variable wouldn't be set.

Change-Id: I08e4850b735f753639f7001b736c2883cf2d683f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92550
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 

diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js
index e4251fd4d..7d41d7e66 100644
--- a/loleaflet/src/control/Ruler.js
+++ b/loleaflet/src/control/Ruler.js
@@ -406,27 +406,30 @@ L.Control.Ruler = L.Control.extend({
tabstopContainer = event.currentTarget;
pointX = event.layerX;
}
-
-   if (event.button === 2) {
-   this.currentPositionInTwips = 
this._map._docLayer._pixelsToTwips({x: pointX, y:0}).x;
-
-   $.contextMenu({
-   selector: '.loleaflet-ruler-tabstopcontainer',
-   className: 'loleaflet-font',
-   items: {
-   inserttabstop: {
-   name: _('Insert tabstop'),
-   callback: 
(this._insertTabstop).bind(this)
+   tabstopContainer.tabStopMarkerBeingDragged = null;
+
+   // Check what to do when a mouse buttons is clicked, ignore 
touch
+   if (event.type !== 'panstart') {
+   // right-click inside tabstop container
+   if (event.button === 2) {
+   this.currentPositionInTwips = 
this._map._docLayer._pixelsToTwips({x: pointX, y:0}).x;
+   $.contextMenu({
+   selector: 
'.loleaflet-ruler-tabstopcontainer',
+   className: 'loleaflet-font',
+   items: {
+   inserttabstop: {
+   name: _('Insert 
tabstop'),
+   callback: 
(this._insertTabstop).bind(this)
+   }
}
-   }
-   });
-
-   event.stopPropagation();
-   return;
-   }
-   else if (event.button !== 0) {
-   event.stopPropagation(); // prevent handling of the 
mother event elsewhere
-   return;
+   });
+   event.stopPropagation();
+   return;
+   }
+   else if (event.button !== 0) {
+   event.stopPropagation(); // prevent handling of 
the mother event elsewhere
+   return;
+   }
}
 
// check if we hit any tabstop
@@ -473,10 +476,15 @@ L.Control.Ruler = L.Control.extend({
pointX = event.layerX;
}
 
+   if (tabstopContainer === null)
+   return;
+   var marker = tabstopContainer.tabStopMarkerBeingDragged;
+   if (marker === null)
+   return;
+
//console.log('===> _moveTabstop ' + event.type);
 
var pixelDiff = pointX - 
tabstopContainer.tabStopInitialPosiiton;
-   var marker = tabstopContainer.tabStopMarkerBeingDragged;
marker.style.left = (marker.tabStopLocation.left + pixelDiff) + 
'px';
},
 
@@ -494,7 +502,11 @@ L.Control.Ruler = L.Control.extend({
pointX = event.layerX;
}
 
+   if (tabstopContainer === null)
+   return;
var marker = tabstopContainer.tabStopMarkerBeingDragged;
+   if (marker === null)
+   return;
 
if (event.type == 'mouseout') {
marker.style.left = (marker.tabStopLocation.left) + 
'px';
__

[Libreoffice-commits] online.git: loleaflet/src

2020-04-20 Thread Pranam Lashkari (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 3b393ac4fc38f6d19d3ef52a9a4ec9266d20949b
Author: Pranam Lashkari 
AuthorDate: Mon Apr 20 10:02:22 2020 +0530
Commit: Szymon Kłos 
CommitDate: Mon Apr 20 09:54:58 2020 +0200

leaflet: resolved FillGradient command never being sent

Change-Id: I1abfd8a6a977d402ad8fd3b2382dcb74bbd291cc
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92515
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 6d54c071f..09ffdb6eb 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1387,11 +1387,13 @@ L.Control.JSDialogBuilder = L.Control.extend({
if (data.id === 'fillgrad1') {
gradientItem = 
builder.map['stateChangeHandler'].getItemValue('.uno:FillGradient');
gradientItem.startcolor = color;
-   return '.uno:FillGradient?FillGradientJSON:string=' + 
JSON.stringify(gradientItem);
+   
builder.map.sendUnoCommand('.uno:FillGradient?FillGradientJSON:string=' + 
JSON.stringify(gradientItem));
+   return;
} else if (data.id === 'fillgrad2') {
gradientItem = 
builder.map['stateChangeHandler'].getItemValue('.uno:FillGradient');
gradientItem.endcolor = color;
-   return '.uno:FillGradient?FillGradientJSON:string=' + 
JSON.stringify(gradientItem);
+   
builder.map.sendUnoCommand('.uno:FillGradient?FillGradientJSON:string=' + 
JSON.stringify(gradientItem));
+   return;
}
 
var command = data.command + '?Color:string=' + color;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-17 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.Menubar.js   |4 -
 loleaflet/src/control/Control.Toolbar.js   |2 
 loleaflet/src/control/Control.UIManager.js |   94 -
 loleaflet/src/map/Map.js   |   83 -
 loleaflet/src/map/handler/Map.WOPI.js  |8 +-
 5 files changed, 101 insertions(+), 90 deletions(-)

New commits:
commit 3a1cd33c9091b7d38a4b467b8e38b9ddface25c8
Author: Szymon Kłos 
AuthorDate: Fri Apr 17 12:28:03 2020 +0200
Commit: Szymon Kłos 
CommitDate: Fri Apr 17 15:59:17 2020 +0200

Move ruler & menubar toggling to UIManager

Change-Id: Idaaa90e48bcfb3620e78ad8e4c859eacdb4ff7cc
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92416
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index b0c042d9e..ec5d49457 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -1027,7 +1027,7 @@ L.Control.Menubar = L.Control.extend({

self.options.allowedViewModeActions.splice(index, 1);
}
} else if (id === 'showruler') {
-   if (self._map.isRulerVisible()) 
{
+   if 
(self._map.uiManager.isRulerVisible()) {

$(aItem).addClass(constChecked);
} else {

$(aItem).removeClass(constChecked);
@@ -1156,7 +1156,7 @@ L.Control.Menubar = L.Control.extend({
} else if (id === 'fullscreen') {
L.toggleFullScreen();
} else if (id === 'showruler') {
-   this._map.toggleRuler();
+   this._map.uiManager.toggleRuler();
} else if (id === 'fullscreen-presentation' && 
this._map.getDocType() === 'presentation') {
this._map.fire('fullscreen');
} else if (id === 'insertpage') {
diff --git a/loleaflet/src/control/Control.Toolbar.js 
b/loleaflet/src/control/Control.Toolbar.js
index ece25efcb..0dc0264d6 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -127,7 +127,7 @@ function onClick(e, id, item) {
onColorPick(id, e.color);
}
else if (id === 'fold' || id === 'hamburger-tablet') {
-   map.toggleMenubar();
+   map.uiManager.toggleMenubar();
}
else if (id === 'close' || id === 'closemobile') {
if (window.ThisIsAMobileApp) {
diff --git a/loleaflet/src/control/Control.UIManager.js 
b/loleaflet/src/control/Control.UIManager.js
index a75481b9f..8e4967481 100644
--- a/loleaflet/src/control/Control.UIManager.js
+++ b/loleaflet/src/control/Control.UIManager.js
@@ -1,6 +1,7 @@
 /* -*- js-indent-level: 8 -*- */
 /*
- * L.Control.UIManager
+ * L.Control.UIManager - initializes the UI elements like toolbars, menubar or 
ruler
+ and allows to controll them (show/hide)
  */
 
 /* global $ setupToolbar w2ui w2utils */
@@ -11,6 +12,8 @@ L.Control.UIManager = L.Control.extend({
map.on('updatepermission', this.onUpdatePermission, this);
},
 
+   // UI initialization
+
initializeBasicUI: function() {
var that = this;
 
@@ -81,6 +84,80 @@ L.Control.UIManager = L.Control.extend({
}
},
 
+   // Menubar
+
+   showMenubar: function() {
+   if (!this.isMenubarHidden())
+   return;
+   $('.main-nav').show();
+   if (L.Params.closeButtonEnabled && !window.mode.isTablet()) {
+   $('#closebuttonwrapper').show();
+   }
+
+   var obj = $('.unfold');
+   obj.removeClass('w2ui-icon unfold');
+   obj.addClass('w2ui-icon fold');
+
+   this.moveObjectVertically($('#spreadsheet-row-column-frame'), 
36);
+   this.moveObjectVertically($('#document-container'), 36);
+   this.moveObjectVertically($('#presentation-controls-wrapper'), 
36);
+   this.moveObjectVertically($('#sidebar-dock-wrapper'), 36);
+   },
+
+   hideMenubar: function() {
+   if (this.isMenubarHidden())
+   return;
+   $('.main-nav').hide();
+   if (L.Params.closeButtonEnabled) {
+   $('#closebuttonwrapper').hide();
+   }
+
+   var obj = $('.fold');
+   obj.removeClass('w2ui-icon fold');
+   obj.addClass('w2ui-icon unfold');
+
+   this.moveObjectVertically($('#spreads

[Libreoffice-commits] online.git: loleaflet/src

2020-04-16 Thread Ashod Nakashian (via logerrit)
 loleaflet/src/control/Control.LokDialog.js |   52 +++--
 1 file changed, 42 insertions(+), 10 deletions(-)

New commits:
commit 08b6151b24bd646a789780c75f14f0e395ee169c
Author: Ashod Nakashian 
AuthorDate: Sat Mar 28 19:34:11 2020 -0400
Commit: Ashod Nakashian 
CommitDate: Fri Apr 17 02:34:28 2020 +0200

leaflet: update the formula-bar in-place

This avoids flicker and unnecessary CPU utilization, and
makes Cypress tests more reliable, since destroying an
HTML element can fail tests, even if they are created
right after (it becomes a matter of random timing whether
a test that checks the presence of such an element passes
or fails).

Change-Id: I57f7afa26831c79d85b740fbc0894a7c30f380fe
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91539
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Ashod Nakashian 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 00abd0925..63ed3f4a8 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -127,6 +127,8 @@ L.Control.LokDialog = L.Control.extend({
},
 
_dialogs: {},
+   _currentDeck: null, // The sidebar.
+   _calcInputBar: null, // The Formula-Bar.
 
_docLoaded: function(e) {
if (!e.status) {
@@ -358,13 +360,15 @@ L.Control.LokDialog = L.Control.extend({
} else if (e.action === 'size_changed') {
// FIXME: we don't really have to destroy and launch 
the dialog again but do it for
// now because the size sent to us previously in 
'created' cb is not correct
-   $('#' + strId).remove();
-   if (e.winType  === 'deck' || this._isSidebar(e.id))
+   if (e.winType  === 'deck' || this._isSidebar(e.id)) {
+   $('#' + strId).remove();
this._launchSidebar(e.id, width, height);
-   else if (e.winType  === 'calc-input-win' || 
this.isCalcInputBar(e.id))
+   } else if (e.winType  === 'calc-input-win' || 
this.isCalcInputBar(e.id))
this._launchCalcInputBar(e.id, width, height);
-   else
+   else {
+   $('#' + strId).remove();
this._launchDialog(e.id, null, null, width, 
height, this._dialogs[parseInt(e.id)].title);
+   }
} else if (e.action === 'cursor_invalidate') {
if (this._isOpen(e.id) && !!e.rectangle) {
rectangle = e.rectangle.split(',');
@@ -709,20 +713,30 @@ L.Control.LokDialog = L.Control.extend({
 
_launchCalcInputBar: function(id, width, height) {
console.log('_launchCalcInputBar: start: id: ' + id + ', width: 
' + width + ', height: ' + height);
-   if (this._calcInputBar) {
-   this._adjustCalcInputBarHeight(id, height);
+   if (!this._calcInputBar || this._calcInputBar.id != id) {
+   if (this._calcInputBar)
+   $('#' + this._calcInputBar.strId).remove();
+   this._createCalcInputbar(id, width, height);
+   } else {
+   // Update in-place. We will resize during rendering.
+   this._adjustCalcInputBar(id, width, height);
}
 
-   this._createCalcInputbar(id, width, height);
console.log('_launchCalcInputBar: end');
},
 
-   _adjustCalcInputBarHeight: function(id, height) {
+   _adjustCalcInputBar: function(id, width, height) {
if (this._calcInputBar) {
var oldHeight = this._calcInputBar.height;
var delta = height - oldHeight;
if (delta !== 0) {
-   console.log('_adjustCalcInputBarHeight: start: 
id: ' + id + ', height: ' + oldHeight + ' -> ' + height);
+   console.log('_adjustCalcInputBar: start: id: ' 
+ id + ', height: ' + oldHeight + ' -> ' + height);
+
+   // Recreate the input-bar.
+   $('#' + this._calcInputBar.strId).remove();
+   this._createCalcInputbar(id, width, height);
+
+   // Resize the container.
var documentContainer = 
L.DomUtil.get('document-container');
if (documentContainer) {
var top = documentContainer.offsetTop;
@@ -765,6 +779,22 @@ L.Control.LokDialog = L.Control.extend({
$('.funcwizard').css('top', 
$('#spreadsheet-row-column-frame').

[Libreoffice-commits] online.git: loleaflet/src

2020-04-16 Thread Ashod Nakashian (via logerrit)
 loleaflet/src/control/Control.LokDialog.js |   29 +
 1 file changed, 21 insertions(+), 8 deletions(-)

New commits:
commit ebfa3f82fac2922a71c61eefd006c9a0f3c2d98f
Author: Ashod Nakashian 
AuthorDate: Sat Mar 28 15:45:01 2020 -0400
Commit: Ashod Nakashian 
CommitDate: Fri Apr 17 02:34:12 2020 +0200

leaflet: refactor _launchCalcInputBar()

Preparing to avoid re-creating the input-bar
on every update message. This will not just avoid
flicker and unnecessary CPU utilization, but
it will make Cypress tests more reliable, since
destroying an HTML element can fail tests, even
if they are created right after (it becomes a
matter of random timing whether a test that checks
the presence of such an element passes or fails).

Change-Id: I8ff887578ebd719b05bb62059d3f0a0bbb929898
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91538
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Ashod Nakashian 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index c4326dc41..00abd0925 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -708,12 +708,21 @@ L.Control.LokDialog = L.Control.extend({
},
 
_launchCalcInputBar: function(id, width, height) {
-   console.log('_launchCalcInputBar: start: id: ' + id + ', width: 
' + width);
+   console.log('_launchCalcInputBar: start: id: ' + id + ', width: 
' + width + ', height: ' + height);
+   if (this._calcInputBar) {
+   this._adjustCalcInputBarHeight(id, height);
+   }
+
+   this._createCalcInputbar(id, width, height);
+   console.log('_launchCalcInputBar: end');
+   },
+
+   _adjustCalcInputBarHeight: function(id, height) {
if (this._calcInputBar) {
var oldHeight = this._calcInputBar.height;
var delta = height - oldHeight;
-   this._onCalcInputBarClose(this._calcInputBar.id);
if (delta !== 0) {
+   console.log('_adjustCalcInputBarHeight: start: 
id: ' + id + ', height: ' + oldHeight + ' -> ' + height);
var documentContainer = 
L.DomUtil.get('document-container');
if (documentContainer) {
var top = documentContainer.offsetTop;
@@ -754,9 +763,13 @@ L.Control.LokDialog = L.Control.extend({
}
}
$('.funcwizard').css('top', 
$('#spreadsheet-row-column-frame').css('top'));
+   console.log('_adjustCalcInputBarHeight: end');
}
}
+   },
 
+   _createCalcInputbar: function(id, width, height) {
+   console.log('_createCalcInputBar: start: id: ' + id + ', width: 
' + width + ', height: ' + height);
var strId = this._toStrId(id);
 
$('#calc-inputbar-wrapper').css({display: 'block'});
@@ -820,11 +833,11 @@ L.Control.LokDialog = L.Control.extend({
this._setupCalcInputBarGestures(id, handles, startHandle, 
endHandle);
 
this._calcInputBar = this._dialogs[id];
-   console.log('_launchCalcInputBar: end');
+   console.log('_createCalcInputBar: end');
},
 
_launchSidebar: function(id, width, height) {
-
+   console.log('_launchSidebar: start: id: ' + id + ', width: ' + 
width + ', height: ' + height);
if ((window.mode.isMobile() || window.mode.isTablet())
&& this._map._permission != 'edit')
return;
@@ -1339,7 +1352,7 @@ L.Control.LokDialog = L.Control.extend({
if (parentId in that._dialogs) {
// We might have closed the dialog by the time 
we render.
that._dialogs[parentId].isPainting = false;
-   if (!that._isSidebar(parentId) && 
!that.isCalcInputBar(parentId))
+   if (!that._isSidebar(parentId) && 
!isCalcInputBar)
that._map.fire('changefocuswidget', 
{winId: parentId, dialog: that});
}
};
@@ -1403,7 +1416,7 @@ L.Control.LokDialog = L.Control.extend({
if (spreadsheetRowColumnFrame)
spreadsheetRowColumnFrame.style.right = 
width.toString() + 'px';
 
-   this._adjustCalcInputBar(deckOffset);
+   this._resizeCalcInputBar(deckOffset);
this._adjustTabsBar(width);
// If we didn't have the focus, don't steal it form the editor.
if ($('#' + this._currentDeck.st

[Libreoffice-commits] online.git: loleaflet/src

2020-04-16 Thread Muhammet Kara (via logerrit)
 loleaflet/src/control/Control.Menubar.js |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 69b0df7578c6c7aa203dbf355c38e3cb91c09506
Author: Muhammet Kara 
AuthorDate: Thu Apr 16 12:49:01 2020 +0300
Commit: Muhammet Kara 
CommitDate: Thu Apr 16 13:45:53 2020 +0200

Welcome: Re-add the Latest Updates to the menu

Since we now have the window.enableWelcomeMessage value

Change-Id: I2870c9d0ab025182788e1f6e131b0f8ef260c299
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92351
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Muhammet Kara 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 8d77a6dc3..3d3f8307c 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -241,6 +241,7 @@ L.Control.Menubar = L.Control.extend({
{name: _('Online Help'), id: 'online-help', 
type: 'action', iosapp: false},
{name: _('Keyboard shortcuts'), id: 
'keyboard-shortcuts', type: 'action', iosapp: false},
{name: _('Report an issue'), id: 
'report-an-issue', type: 'action', iosapp: false},
+   {name: _('Latest Updates'), id: 
'latest-updates', type: 'action', iosapp: false},
{name: _('About'), id: 'about', type: 'action'}]
},
{name: _('Last modification'), id: 'last-mod', type: 
'action', tablet: false}
@@ -342,6 +343,7 @@ L.Control.Menubar = L.Control.extend({
{name: _('Online Help'), id: 'online-help', 
type: 'action', iosapp: false},
{name: _('Keyboard shortcuts'), id: 
'keyboard-shortcuts', type: 'action', iosapp: false},
{name: _('Report an issue'), id: 
'report-an-issue', type: 'action', iosapp: false},
+   {name: _('Latest Updates'), id: 
'latest-updates', type: 'action', iosapp: false},
{name: _('About'), id: 'about', type: 'action'}]
},
{name: _('Last modification'), id: 'last-mod', type: 
'action', tablet: false}
@@ -458,6 +460,7 @@ L.Control.Menubar = L.Control.extend({
{name: _('Online Help'), id: 'online-help', 
type: 'action', iosapp: false},
{name: _('Keyboard shortcuts'), id: 
'keyboard-shortcuts', type: 'action', iosapp: false},
{name: _('Report an issue'), id: 
'report-an-issue', type: 'action', iosapp: false},
+   {name: _('Latest Updates'), id: 
'latest-updates', type: 'action', iosapp: false},
{name: _('About'), id: 'about', type: 'action'}]
},
{name: _('Last modification'), id: 'last-mod', type: 
'action', tablet: false}
@@ -510,6 +513,7 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:ShowResolvedAnnotations', 
'text'), id: 'showresolved', type: 'action'},
]
},
+   {name: _('Latest Updates'), id: 'latest-updates', type: 
'action', iosapp: false},
{name: _('About'), id: 'about', type: 'action'},
],
 
@@ -556,6 +560,7 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:FullScreen', 'presentation'), id: 
'fullscreen', type: 'action', mobileapp: false},
{uno: '.uno:SpellOnline'},
{name: _('Fullscreen presentation'), id: 
'fullscreen-presentation', type: 'action'},
+   {name: _('Latest Updates'), id: 'latest-updates', type: 
'action', iosapp: false},
{name: _('About'), id: 'about', type: 'action'},
],
 
@@ -619,6 +624,7 @@ L.Control.Menubar = L.Control.extend({
]},
{uno: '.uno:SpellOnline'},
{name: _UNO('.uno:FullScreen', 'spreadsheet'), id: 
'fullscreen', type: 'action', mobileapp: false},
+   {name: _('Latest Updates'), id: 'latest-updates', type: 
'action', iosapp: false},
{name: _('About'), id: 'about', type: 'action'},
],
 
@@ -706,7 +712,7 @@ L.Control.Menubar = L.Control.extend({
'downloadas-odp', 'downloadas-ppt', 'downloadas-pptx', 
'print', // file menu
'downloadas-ods', 'downloadas-xls', 'downloadas-xlsx', 
'closedocument', // file menu
'fullscreen', 'zoomin', 'zoomout', 'zoomreset', 
'showresolved', // view menu
-   'about', 'keyboard-shortcuts', 'online-help', 
'report-an-issue' // help menu
+

[Libreoffice-commits] online.git: loleaflet/src

2020-04-16 Thread Jan Holesovsky (via logerrit)
 loleaflet/src/control/Toolbar.js |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 9251393183e46b2da64adaccef48905ee0cf88a8
Author: Jan Holesovsky 
AuthorDate: Thu Apr 16 11:00:29 2020 +0200
Commit: Jan Holesovsky 
CommitDate: Thu Apr 16 11:37:27 2020 +0200

Welcome: Disable the easy dismissing of the welcome screen.

Change-Id: I8d12a197c90e578a1015f3fb6a2a471bf1114bf7
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92340
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index 4e17dece2..3ed636444 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -363,8 +363,8 @@ L.Map.include({
vex.open({
unsafeContent: data,
showCloseButton: true,
-   escapeButtonCloses: true,
-   overlayClosesOnClick: true,
+   escapeButtonCloses: false,
+   overlayClosesOnClick: false,
closeAllOnPopState: false,
buttons: {},
afterOpen: function() {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-16 Thread Jan Holesovsky (via logerrit)
 loleaflet/src/control/Control.Menubar.js |   10 +-
 1 file changed, 1 insertion(+), 9 deletions(-)

New commits:
commit 99b6f4a9bb3d5472e820ec6412e582f9a7f054aa
Author: Jan Holesovsky 
AuthorDate: Wed Apr 15 16:02:45 2020 +0200
Commit: Jan Holesovsky 
CommitDate: Thu Apr 16 11:35:08 2020 +0200

Welcome: Kill the Latest Updates from the menu.

For the moment, we are missing a way to disable it when the feature is
switched off in loolwsd.xml; so let's just avoid it for the moment.

Change-Id: Ic0cde3ef3c415c9ac7009e4db285b04560018b74
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92276
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index ac4a19766..8d77a6dc3 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -241,7 +241,6 @@ L.Control.Menubar = L.Control.extend({
{name: _('Online Help'), id: 'online-help', 
type: 'action', iosapp: false},
{name: _('Keyboard shortcuts'), id: 
'keyboard-shortcuts', type: 'action', iosapp: false},
{name: _('Report an issue'), id: 
'report-an-issue', type: 'action', iosapp: false},
-   {name: _('Latest Updates'), id: 
'latest-updates', type: 'action'},
{name: _('About'), id: 'about', type: 'action'}]
},
{name: _('Last modification'), id: 'last-mod', type: 
'action', tablet: false}
@@ -343,7 +342,6 @@ L.Control.Menubar = L.Control.extend({
{name: _('Online Help'), id: 'online-help', 
type: 'action', iosapp: false},
{name: _('Keyboard shortcuts'), id: 
'keyboard-shortcuts', type: 'action', iosapp: false},
{name: _('Report an issue'), id: 
'report-an-issue', type: 'action', iosapp: false},
-   {name: _('Latest Updates'), id: 
'latest-updates', type: 'action'},
{name: _('About'), id: 'about', type: 'action'}]
},
{name: _('Last modification'), id: 'last-mod', type: 
'action', tablet: false}
@@ -460,7 +458,6 @@ L.Control.Menubar = L.Control.extend({
{name: _('Online Help'), id: 'online-help', 
type: 'action', iosapp: false},
{name: _('Keyboard shortcuts'), id: 
'keyboard-shortcuts', type: 'action', iosapp: false},
{name: _('Report an issue'), id: 
'report-an-issue', type: 'action', iosapp: false},
-   {name: _('Latest Updates'), id: 
'latest-updates', type: 'action'},
{name: _('About'), id: 'about', type: 'action'}]
},
{name: _('Last modification'), id: 'last-mod', type: 
'action', tablet: false}
@@ -513,7 +510,6 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:ShowResolvedAnnotations', 
'text'), id: 'showresolved', type: 'action'},
]
},
-   {name: _('Latest Updates'), id: 'latest-updates', type: 
'action'},
{name: _('About'), id: 'about', type: 'action'},
],
 
@@ -560,7 +556,6 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:FullScreen', 'presentation'), id: 
'fullscreen', type: 'action', mobileapp: false},
{uno: '.uno:SpellOnline'},
{name: _('Fullscreen presentation'), id: 
'fullscreen-presentation', type: 'action'},
-   {name: _('Latest Updates'), id: 'latest-updates', type: 
'action'},
{name: _('About'), id: 'about', type: 'action'},
],
 
@@ -624,7 +619,6 @@ L.Control.Menubar = L.Control.extend({
]},
{uno: '.uno:SpellOnline'},
{name: _UNO('.uno:FullScreen', 'spreadsheet'), id: 
'fullscreen', type: 'action', mobileapp: false},
-   {name: _('Latest Updates'), id: 'latest-updates', type: 
'action'},
{name: _('About'), id: 'about', type: 'action'},
],
 
@@ -712,7 +706,7 @@ L.Control.Menubar = L.Control.extend({
'downloadas-odp', 'downloadas-ppt', 'downloadas-pptx', 
'print', // file menu
'downloadas-ods', 'downloadas-xls', 'downloadas-xlsx', 
'closedocument', // file menu
'fullscreen', 'zoomin', 'zoomout', 'zoomreset', 
'showresolved', // view menu
-   'about', 'keyboard-shortcuts', 'latest-updates', 
'online-help', 'report-an-issue' // help menu
+  

[Libreoffice-commits] online.git: loleaflet/src

2020-04-16 Thread Jan Holesovsky (via logerrit)
 loleaflet/src/control/Control.Menubar.js |5 -
 loleaflet/src/control/Toolbar.js |   88 ++-
 2 files changed, 53 insertions(+), 40 deletions(-)

New commits:
commit 8133c44f6d2074eeab4e85c42f0d570b764b1cb9
Author: Jan Holesovsky 
AuthorDate: Wed Apr 15 13:13:27 2020 +0200
Commit: Jan Holesovsky 
CommitDate: Thu Apr 16 11:31:46 2020 +0200

Welcome: Rework to handle non-existing welcome message.

And do some small additional amendments, like decrease the retry timeout
to one day, don't hide the menu entry based on the About dialog, or
consistently name the cookies.

Change-Id: I4170161a44230b05333798dc68d8c3ffe07e26d4
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92267
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 1d31eee93..ac4a19766 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -1182,7 +1182,7 @@ L.Control.Menubar = L.Control.extend({
} else if (id === 'about') {
this._map.showLOAboutDialog();
} else if (id === 'latest-updates') {
-   this._map.showWelcomeDialog();
+   this._map.showWelcomeDialog(/*calledFromMenu=*/true);
} else if (id === 'report-an-issue') {

window.open('https://bugs.documentfoundation.org/enter_bug.cgi?product=LibreOffice%20Online',
 '_blank');
} else if (id === 'inserthyperlink') {
@@ -1305,9 +1305,6 @@ L.Control.Menubar = L.Control.extend({
if (menuItem.id === 'about' && (L.DomUtil.get('about-dialog') 
=== null)) {
return false;
}
-   if (menuItem.id === 'latest-updates' && 
(L.DomUtil.get('about-dialog') === null)) {
-   return false;
-   }
if (menuItem.id === 'signdocument' && 
(L.DomUtil.get('document-signing-bar') === null)) {
return false;
}
diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index 7ba6c0a14..e6f1a7e6f 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -344,7 +344,8 @@ L.Map.include({
});
},
 
-   showWelcomeDialog: function() {
+   // show the actual welcome dialog with the given data
+   _showWelcomeDialogVex: function(data) {
var w;
var iw = window.innerWidth;
if (iw < 768) {
@@ -356,43 +357,58 @@ L.Map.include({
else {
w = iw / 5 + 590;
}
+
+   // show the dialog
var map = this;
-   var welcomeLocation = 'welcome/welcome-' + String.locale + 
'.html';
-   $.get(welcomeLocation, function(data, textStatus) {
-   if (textStatus !== 'success') {
-   // Welcome dialog disabled in loolwsd.xml or 
nonexistant for some other reason
-   // Let's check back in a week (60 x 60 x 24 x 7 
= 604800 seconds)
-   var welcomeDisabledCookie = 
'loolWelcomeDisabled=true; max-age=604800; SameSite=Strict';
-   document.cookie = welcomeDisabledCookie;
-   return;
+   vex.open({
+   unsafeContent: data,
+   showCloseButton: true,
+   escapeButtonCloses: true,
+   overlayClosesOnClick: true,
+   closeAllOnPopState: false,
+   buttons: {},
+   afterOpen: function() {
+   var $vexContent = $(this.contentEl);
+   this.contentEl.style.width = w + 'px';
+   map.enable(false);
+
+   $vexContent.attr('tabindex', -1);
+   $vexContent.focus();
+   // workaround for 
https://github.com/HubSpot/vex/issues/43
+   $('.vex-overlay').css({ 'pointer-events': 
'none'});
+   },
+   beforeClose: function () {
+   map.focus();
+   map.enable(true);
}
-   var WSDVerCookie = 'WSDWelcomeVer=' + 
map._socket.WSDServer.Version;
-   // Cookie will not expire for a year, and it will not 
be sent to other domains
-   WSDVerCookie += '; max-age=31536000; SameSite=Strict';
-   vex.open({
-   unsafeContent: data,
-   showCloseButton: t

[Libreoffice-commits] online.git: loleaflet/src

2020-04-16 Thread Muhammet Kara (via logerrit)
 loleaflet/src/control/Control.Menubar.js |   13 -
 loleaflet/src/control/Toolbar.js |   76 +++
 loleaflet/src/layer/tile/TileLayer.js|3 +
 3 files changed, 91 insertions(+), 1 deletion(-)

New commits:
commit 7e9cd6e09310b337ed1040fae6c301f0e495dab1
Author: Muhammet Kara 
AuthorDate: Mon Mar 30 14:30:20 2020 +0300
Commit: Jan Holesovsky 
CommitDate: Thu Apr 16 11:30:50 2020 +0200

Welcome: Add Welcome dialog

 * Whenever a new version of Online is deployed,
   users will be shown a welcome dialog with latest updates,
   release notes etc.
 * Location of the content for the welcome dialog can be
   set up in loolwsd.xml, and that file will be served to
   the client by loolwsd (That part handled in a prior patch)
 * If the welcome dialog is disabled in the config, or the welcome
   file (at welcome/welcome-$LANG.html by default) does not exist,
   then we will disable the checks for a week
 * A command to show the welcome dialog has also been added under
   the help menu as 'Latest Updates'

Change-Id: I490f4ed92920bbcc9308a53014a3fb5a1d477a54
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92266
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 8d77a6dc3..1d31eee93 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -241,6 +241,7 @@ L.Control.Menubar = L.Control.extend({
{name: _('Online Help'), id: 'online-help', 
type: 'action', iosapp: false},
{name: _('Keyboard shortcuts'), id: 
'keyboard-shortcuts', type: 'action', iosapp: false},
{name: _('Report an issue'), id: 
'report-an-issue', type: 'action', iosapp: false},
+   {name: _('Latest Updates'), id: 
'latest-updates', type: 'action'},
{name: _('About'), id: 'about', type: 'action'}]
},
{name: _('Last modification'), id: 'last-mod', type: 
'action', tablet: false}
@@ -342,6 +343,7 @@ L.Control.Menubar = L.Control.extend({
{name: _('Online Help'), id: 'online-help', 
type: 'action', iosapp: false},
{name: _('Keyboard shortcuts'), id: 
'keyboard-shortcuts', type: 'action', iosapp: false},
{name: _('Report an issue'), id: 
'report-an-issue', type: 'action', iosapp: false},
+   {name: _('Latest Updates'), id: 
'latest-updates', type: 'action'},
{name: _('About'), id: 'about', type: 'action'}]
},
{name: _('Last modification'), id: 'last-mod', type: 
'action', tablet: false}
@@ -458,6 +460,7 @@ L.Control.Menubar = L.Control.extend({
{name: _('Online Help'), id: 'online-help', 
type: 'action', iosapp: false},
{name: _('Keyboard shortcuts'), id: 
'keyboard-shortcuts', type: 'action', iosapp: false},
{name: _('Report an issue'), id: 
'report-an-issue', type: 'action', iosapp: false},
+   {name: _('Latest Updates'), id: 
'latest-updates', type: 'action'},
{name: _('About'), id: 'about', type: 'action'}]
},
{name: _('Last modification'), id: 'last-mod', type: 
'action', tablet: false}
@@ -510,6 +513,7 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:ShowResolvedAnnotations', 
'text'), id: 'showresolved', type: 'action'},
]
},
+   {name: _('Latest Updates'), id: 'latest-updates', type: 
'action'},
{name: _('About'), id: 'about', type: 'action'},
],
 
@@ -556,6 +560,7 @@ L.Control.Menubar = L.Control.extend({
{name: _UNO('.uno:FullScreen', 'presentation'), id: 
'fullscreen', type: 'action', mobileapp: false},
{uno: '.uno:SpellOnline'},
{name: _('Fullscreen presentation'), id: 
'fullscreen-presentation', type: 'action'},
+   {name: _('Latest Updates'), id: 'latest-updates', type: 
'action'},
{name: _('About'), id: 'about', type: 'action'},
],
 
@@ -619,6 +624,7 @@ L.Control.Menubar = L.Control.extend({
]},
{uno: '.uno:SpellOnline'},
{name: _UNO('.uno:FullScreen', 'spreadsheet'), id: 
'fullscreen', type: 'action', mobileapp: false},
+   {name: _('Latest Updates'), id: 'latest-updates', type: 
'act

[Libreoffice-commits] online.git: loleaflet/src

2020-04-16 Thread Tor Lillqvist (via logerrit)
 loleaflet/src/control/Control.Menubar.js   |7 ---
 loleaflet/src/control/Control.StatusBar.js |3 ++-
 2 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 70f4f8b92e44d361c78dd323e147d23abba8b308
Author: Tor Lillqvist 
AuthorDate: Thu Apr 16 08:09:44 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Thu Apr 16 09:26:01 2020 +0200

Don't show zoom controls on tablets, either

On touch devices you use pinch gestures to zoom, not buttons or menus.
Displaying the alleged zoom percentage is fairly pointless as it
doesn't match physical paper size anyway.

Change-Id: Ieccfa9b5454a3ac71b0c31f6ab38ed6696304cc5
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92332
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 919a4ab3f..8d77a6dc3 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -56,7 +56,8 @@ L.Control.Menubar = L.Control.extend({
]},
{uno: '.uno:EditStyle'}
]},
-   {name: _UNO('.uno:ViewMenu', 'text'), id: 'view', type: 
'menu', menu: [
+   {name: _UNO('.uno:ViewMenu', 'text'), id: 'view', type: 
'menu',
+menu: (window.mode.isTablet() ? [] : [
{name: _UNO('.uno:FullScreen', 'text'), id: 
'fullscreen', type: 'action'},
{type: 'separator'},
{name: _UNO('.uno:ZoomPlus', 'text'), id: 
'zoomin', type: 'action'},
@@ -64,13 +65,13 @@ L.Control.Menubar = L.Control.extend({
{name: _('Reset zoom'), id: 'zoomreset', type: 
'action'},
{name: _('Show Ruler'), id: 'showruler', type: 
'action'},
{type: 'separator'},
+   ]).concat([
{uno: '.uno:ControlCodes'},
{type: 'separator'},
{name: _UNO('.uno:ShowResolvedAnnotations', 
'text'), id: 'showresolved', type: 'action'},
{type: 'separator'},
{uno: '.uno:Sidebar'},
-   ]
-   },
+   ])},
{name: _UNO('.uno:InsertMenu', 'text'), id: 'insert', 
type: 'menu', menu: [
{name: _('Local Image...'), id: 
'insertgraphic', type: 'action'},
{name: _UNO('.uno:InsertGraphic', 'text'), id: 
'insertgraphicremote', type: 'action'},
diff --git a/loleaflet/src/control/Control.StatusBar.js 
b/loleaflet/src/control/Control.StatusBar.js
index 26db62d11..ed5eb0353 100644
--- a/loleaflet/src/control/Control.StatusBar.js
+++ b/loleaflet/src/control/Control.StatusBar.js
@@ -186,6 +186,7 @@ L.Control.StatusBar = L.Control.extend({
{type: 'button',  id: 'prev', img: 
'prev', hint: _UNO('.uno:PageUp', 'text')},
{type: 'button',  id: 'next', img: 
'next', hint: _UNO('.uno:PageDown', 'text')},
{type: 'break', id: 'prevnextbreak'},
+   ].concat(window.mode.isTablet() ? [] : [
{type: 'button',  id: 'zoomreset', img: 
'zoomreset', hint: _('Reset zoom')},
{type: 'button',  id: 'zoomout', img: 
'zoomout', hint: _UNO('.uno:ZoomMinus')},
{type: 'menu-radio', id: 'zoom', text: 
'100',
@@ -210,7 +211,7 @@ L.Control.StatusBar = L.Control.extend({
]
},
{type: 'button',  id: 'zoomin', img: 
'zoomin', hint: _UNO('.uno:ZoomPlus')}
-   ],
+   ]),
onClick: function (e) {
that.hideTooltip(this, e.target);
that.onClick(e, e.target, e.item, 
e.subItem);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-15 Thread mert (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |  113 ++-
 1 file changed, 89 insertions(+), 24 deletions(-)

New commits:
commit db26ae326c0ba5c2cddcb1585ff7af1b139be842
Author: mert 
AuthorDate: Tue Apr 14 18:10:47 2020 +0300
Commit: Andras Timar 
CommitDate: Wed Apr 15 23:38:22 2020 +0200

mobilewizard: fix inconsistent state of items on Number Format

implemented listbox updates for numberformatcombobox and
fontsizecombobox to apply changes without reopening the
mobile wizard. This patch also fixes the update problem of
the checkbox items on number format page

Change-Id: Ib330531f766e5d1ff0744585f324a235f5ae3121
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92204
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 7ff08ce86..6d54c071f 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -242,6 +242,46 @@ L.Control.JSDialogBuilder = L.Control.extend({
return true;
},
 
+   _getListBoxUpdateType: function(id) {
+   if (id) {
+   if (id === 'numberformatcombobox')
+   return 'index';
+   else if (id === 'fontsizecombobox')
+   return 'value';
+   }
+   return false;
+   },
+
+   _updateListBox: function(builder, contentDiv, contentNode, 
sectionTitle, data, state) {
+   if ($(sectionTitle).find('.entry-value')[0])
+   sectionTitle = 
$($(sectionTitle).find('.entry-value')).get(0);
+   else
+   sectionTitle = 
$(sectionTitle).find('.ui-header-left').find('span')[0];
+
+   if (!sectionTitle)
+   return;
+
+   $(contentDiv).find('.selected').removeClass('selected');
+
+   var hasChildren = $(contentDiv).children().length > 0 && 
contentNode.children && contentNode.children.length > 0;
+   var updateBy = builder._getListBoxUpdateType(data.id);
+   if (updateBy === 'index') {
+   sectionTitle.innerHTML = data.entries[state];
+   data.selectedEntries[0] = state;
+   contentDiv.title = data.entries[state];
+   if (hasChildren) {
+   
$($(contentDiv).children().get(state)).addClass('selected');
+   }
+   } else if (updateBy === 'value') {
+   sectionTitle.innerHTML = state;
+   if (hasChildren) {
+   $(contentDiv).find('p').filter(function() {
+   return $(this).text() === state;
+   }).addClass('selected');
+   }
+   }
+   },
+
_explorableEntry: function(parentContainer, data, contentNode, builder, 
valueNode, iconPath, updateCallback) {
var sectionTitle = L.DomUtil.create('div', 'ui-header level-' + 
builder._currentDepth + ' mobile-wizard ui-widget', parentContainer);
$(sectionTitle).css('justify-content', 'space-between');
@@ -270,28 +310,6 @@ L.Control.JSDialogBuilder = L.Control.extend({
var arrowSpan = L.DomUtil.create('span', 'sub-menu-arrow', 
rightDiv);
arrowSpan.innerHTML = '>';
 
-   var updateFunction = function(titleSpan) {
-   var state = null;
-   if (data.id)
-   state = builder._getUnoStateForItemId(data.id, 
builder);
-
-   if (state) {
-   titleSpan.innerHTML = state;
-   } else {
-   titleSpan.innerHTML = data.text;
-   }
-   };
-
-   updateCallback ? updateCallback(titleSpan) : 
updateFunction(titleSpan);
-
-   builder.map.on('commandstatechanged', function(e) {
-   if (e.commandName === data.command || e.commandName === 
builder._mapWindowIdToUnoCommand(data.id))
-   if (updateCallback)
-   updateCallback(titleSpan);
-   else
-   updateFunction(titleSpan);
-   }, this);
-
var contentDiv = L.DomUtil.create('div', 'ui-content level-' + 
builder._currentDepth + ' mobile-wizard', parentContainer);
contentDiv.title = data.text;
 
@@ -314,6 +332,33 @@ L.Control.JSDialogBuilder = L.Control.extend({
}
else
$(sectionTitle).hide();
+
+   var updateFunction = fu

[Libreoffice-commits] online.git: loleaflet/src

2020-04-15 Thread Tor Lillqvist (via logerrit)
 loleaflet/src/control/Control.Toolbar.js |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 9a4c6a61e47703a91165805208ca026c49063698
Author: Tor Lillqvist 
AuthorDate: Wed Apr 15 18:09:39 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Apr 15 23:19:04 2020 +0200

Make the "X" closebutton work also in the mobile apps

In normal cases it will not show up, but due to what is arguably a
bug, it sometimes shows up anyway. For instance, when you use the app
in split view on a tablet. So make the button work also in a mobile
app by posting the same 'BYE' message as done for the "<" closemobile
button.

Change-Id: Ifdc687ab734fa5e092999d94bd19fe1572281af9
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92285
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/loleaflet/src/control/Control.Toolbar.js 
b/loleaflet/src/control/Control.Toolbar.js
index b546c7011..428b4c74b 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -1713,10 +1713,14 @@ function setupToolbar(e) {
}
 
$('#closebutton').click(function() {
-   map.fire('postMessage', {msgId: 'close', args: {EverModified: 
map._everModified, Deprecated: true}});
-   map.fire('postMessage', {msgId: 'UI_Close', args: 
{EverModified: map._everModified}});
-   if (!map._disableDefaultAction['UI_Close']) {
-   map.remove();
+   if (window.ThisIsAMobileApp) {
+   window.postMobileMessage('BYE');
+   } else {
+   map.fire('postMessage', {msgId: 'close', args: 
{EverModified: map._everModified, Deprecated: true}});
+   map.fire('postMessage', {msgId: 'UI_Close', args: 
{EverModified: map._everModified}});
+   if (!map._disableDefaultAction['UI_Close']) {
+   map.remove();
+   }
}
});
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-15 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.FormulaBar.js |   41 
 loleaflet/src/control/Control.Toolbar.js|   23 ---
 2 files changed, 64 deletions(-)

New commits:
commit 6aff5967da51546331060225e342a08ef5d9fee6
Author: Szymon Kłos 
AuthorDate: Wed Apr 15 13:49:15 2020 +0200
Commit: Szymon Kłos 
CommitDate: Wed Apr 15 17:07:34 2020 +0200

Remove unused formula bar code

Code is unused due to formulabar tunneling
b7743930cde9b9583490bbdc6d7b6b09d32cdccd

Change-Id: Ie8d51f48669e111bb8006fd8afafaa1eeaba52e2
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92270
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.FormulaBar.js 
b/loleaflet/src/control/Control.FormulaBar.js
index e90e3f141..fe7d8f838 100644
--- a/loleaflet/src/control/Control.FormulaBar.js
+++ b/loleaflet/src/control/Control.FormulaBar.js
@@ -119,47 +119,6 @@ L.Control.FormulaBar = L.Control.extend({
}
},
 
-   onFormulaInput: function(e) {
-   // keycode = 13 is 'enter'
-   if (e.keyCode === 13) {
-   // formula bar should not have focus anymore
-   this.map.focus();
-
-   // forward the 'enter' keystroke to map to deal with 
the formula entered
-   var data = {
-   originalEvent: e
-   };
-   this.map.fire('keypress', data);
-   } else if (e.keyCode === 27) { // 27 = esc key
-   this.map.sendUnoCommand('.uno:Cancel');
-   this.map.focus();
-   } else {
-   
this.map.cellEnterString(L.DomUtil.get('formulaInput').value);
-   }
-   },
-
-   onFormulaBarFocus: function() {
-   var formulabar = w2ui.formulabar;
-   formulabar.hide('sum');
-   formulabar.hide('function');
-   formulabar.show('cancelformula');
-   formulabar.show('acceptformula');
-   },
-
-   onFormulaBarBlur: function() {
-   // The timeout is needed because we want 'click' event on 
'cancel',
-   // 'accept' button to act before we hide these buttons because
-   // once hidden, click event won't be processed.
-   // TODO: Some better way to do it ?
-   setTimeout(function() {
-   var formulabar = w2ui.formulabar;
-   formulabar.show('sum');
-   formulabar.show('function');
-   formulabar.hide('cancelformula');
-   formulabar.hide('acceptformula');
-   }, 250);
-   },
-
onAddressInput: function(e) {
if (e.keyCode === 13) {
// address control should not have focus anymore
diff --git a/loleaflet/src/control/Control.Toolbar.js 
b/loleaflet/src/control/Control.Toolbar.js
index df1822d26..b546c7011 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -169,29 +169,6 @@ function onClick(e, id, item) {
else if (id === 'backgroundcolor' && typeof e.color !== 'undefined') {
onColorPick(id, e.color);
}
-   else if (id === 'sum') {
-   map.sendUnoCommand('.uno:AutoSum');
-   }
-   else if (id === 'function') {
-   L.DomUtil.get('formulaInput').value = '=';
-   L.DomUtil.get('formulaInput').focus();
-   map.cellEnterString(L.DomUtil.get('formulaInput').value);
-   }
-   else if (id === 'cancelformula') {
-   map.sendUnoCommand('.uno:Cancel');
-   w2ui['formulabar'].hide('acceptformula', 'cancelformula');
-   w2ui['formulabar'].show('sum', 'function');
-   }
-   else if (id === 'acceptformula') {
-   // focus on map, and press enter
-   map.focus();
-   map._docLayer.postKeyboardEvent('input',
-map.keyboard.keyCodes.enter,
-
map.keyboard._toUNOKeyCode(map.keyboard.keyCodes.enter));
-
-   w2ui['formulabar'].hide('acceptformula', 'cancelformula');
-   w2ui['formulabar'].show('sum', 'function');
-   }
else if (id === 'fold' || id === 'hamburger-tablet') {
map.toggleMenubar();
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-15 Thread Tor Lillqvist (via logerrit)
 loleaflet/src/control/Control.StatusBar.js |   35 +++--
 loleaflet/src/map/Map.js   |7 -
 2 files changed, 30 insertions(+), 12 deletions(-)

New commits:
commit 8c70e6a8f6fb8a36ade74ab4c6b4e5044e09064d
Author: Tor Lillqvist 
AuthorDate: Wed Apr 15 13:30:45 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Apr 15 14:05:58 2020 +0200

tdf#128507: Increase max zoom to 400%

Also add rounded-to-five labels for the already previously possible
two smallest zoom levels (35% and 40%).

Change-Id: I8c7293093e8fe70a4b50081a0a3ac4f96c8486ba
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92259
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/loleaflet/src/control/Control.StatusBar.js 
b/loleaflet/src/control/Control.StatusBar.js
index 544302d2d..bfe2866ae 100644
--- a/loleaflet/src/control/Control.StatusBar.js
+++ b/loleaflet/src/control/Control.StatusBar.js
@@ -266,6 +266,8 @@ L.Control.StatusBar = L.Control.extend({
selected: 'zoom100',
mobile: false,
items: [
+   { id: 'zoom35', text: 
'35', scale: 4},
+   { id: 'zoom40', text: 
'40', scale: 5},
{ id: 'zoom50', text: 
'50', scale: 6},
{ id: 'zoom60', text: 
'60', scale: 7},
{ id: 'zoom70', text: 
'70', scale: 8},
@@ -274,7 +276,11 @@ L.Control.StatusBar = L.Control.extend({
{ id: 'zoom120', text: 
'120', scale: 11},
{ id: 'zoom150', text: 
'150', scale: 12},
{ id: 'zoom175', text: 
'175', scale: 13},
-   { id: 'zoom200', text: 
'200', scale: 14}
+   { id: 'zoom200', text: 
'200', scale: 14},
+   { id: 'zoom235', text: 
'235', scale: 15},
+   { id: 'zoom280', text: 
'280', scale: 16},
+   { id: 'zoom335', text: 
'335', scale: 17},
+   { id: 'zoom400', text: 
'400', scale: 18},
]
},
{type: 'button',  id: 'zoomin', img: 
'zoomin', hint: _UNO('.uno:ZoomPlus')}
@@ -344,18 +350,25 @@ L.Control.StatusBar = L.Control.extend({
var zoomPercent = 100;
var zoomSelected = null;
switch (that.map.getZoom()) {
-   case 6:  zoomPercent =  50; zoomSelected = 'zoom50'; 
break;
-   case 7:  zoomPercent =  60; zoomSelected = 'zoom60'; 
break;
-   case 8:  zoomPercent =  70; zoomSelected = 'zoom70'; 
break;
-   case 9:  zoomPercent =  85; zoomSelected = 'zoom85'; 
break;
-   case 10: zoomPercent = 100; zoomSelected = 'zoom100'; 
break;
-   case 11: zoomPercent = 120; zoomSelected = 'zoom120'; 
break;
-   case 12: zoomPercent = 150; zoomSelected = 'zoom150'; 
break;
-   case 13: zoomPercent = 175; zoomSelected = 'zoom175'; 
break;
-   case 14: zoomPercent = 200; zoomSelected = 'zoom200'; 
break;
+   case 4:  zoomPercent =  35; zoomSelected = 'zoom35'; 
break;  // 0.3535
+   case 5:  zoomPercent =  40; zoomSelected = 'zoom40'; 
break;  // 0.4204
+   case 6:  zoomPercent =  50; zoomSelected = 'zoom50'; 
break;  // 0.5
+   case 7:  zoomPercent =  60; zoomSelected = 'zoom60'; 
break;  // 0.5946
+   case 8:  zoomPercent =  70; zoomSelected = 'zoom70'; 
break;  // 0.7071
+   case 9:  zoomPercent =  85; zoomSelected = 'zoom85'; 
break;  // 0.8409
+   case 10: zoomPercent = 100; zoomSelected = 'zoom100'; 
break; // 1
+   case 11: zoomPercent = 120; zoomSelected = 'zoom120'; 
break; // 1.1892
+   // Why do we call this 150% even if it is actually 
closer to 140%
+   case 12: zoomPercent = 150; zoomSelected = 'zoom150'; 
break; // 1.4142
+   case 13: zoomPercent = 170; zoomSelected = 'zoom170'; 
break; // 1.6818
+   case 14: zoomPercent = 200; zoomSelected = 'zoom200'; 
break; // 2
+ 

[Libreoffice-commits] online.git: loleaflet/src

2020-04-15 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.Toolbar.js |   31 +--
 1 file changed, 25 insertions(+), 6 deletions(-)

New commits:
commit 982e423140a2a30d4bddbdfa4d0cce94e0d1e4fa
Author: Szymon Kłos 
AuthorDate: Thu Apr 9 14:30:10 2020 +0200
Commit: Szymon Kłos 
CommitDate: Wed Apr 15 10:11:52 2020 +0200

Split toolbars creation into separate methods

Change-Id: Icc5d6d26f9613ee1c3b266980614c0b0284633d9
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91976
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/loleaflet/src/control/Control.Toolbar.js 
b/loleaflet/src/control/Control.Toolbar.js
index 7af0f6ce2..efda2cb25 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -832,7 +832,7 @@ function createToolbar() {
 // tablet:true means show it in normal Online from a tablet browser, and in a 
mobile app on a tablet
 // tablet:false means hide it in normal Online used from a tablet browser, and 
in a mobile app on a tablet
 
-function initNormalToolbar() {
+function createMainToolbar() {
var toolItems = [
{type: 'button',  id: 'closemobile',  img: 'closemobile', 
desktop: false, mobile: false, tablet: true, hidden: true},
{type: 'button',  id: 'save', img: 'save', hint: 
_UNO('.uno:Save')},
@@ -1014,8 +1014,10 @@ function initNormalToolbar() {
toolbar.bind('touchstart', function() {
w2ui['editbar'].touchStarted = true;
});
+}
 
-   toolbar = $('#formulabar');
+function createFormulaBar() {
+   var toolbar = $('#formulabar');
toolbar.w2toolbar({
name: 'formulabar',
tooltip: 'bottom',
@@ -1043,9 +1045,11 @@ function initNormalToolbar() {
w2ui.formulabar.on('resize', function(target, e) {
e.isCancelled = true;
});
+}
 
+function createSigningBar() {
if (L.DomUtil.get('document-signing-bar') !== null) {
-   toolbar = $('#document-signing-bar');
+   var toolbar = $('#document-signing-bar');
toolbar.w2toolbar({
name: 'document-signing-bar',
tooltip: 'bottom',
@@ -1061,8 +1065,10 @@ function initNormalToolbar() {
w2ui['document-signing-bar'].touchStarted = true;
});
}
+}
 
-   toolbar = $('#spreadsheet-toolbar');
+function createSpreadsheetToolbar() {
+   var toolbar = $('#spreadsheet-toolbar');
toolbar.w2toolbar({
name: 'spreadsheet-toolbar',
tooltip: 'bottom',
@@ -1082,8 +1088,10 @@ function initNormalToolbar() {
toolbar.bind('touchstart', function() {
w2ui['spreadsheet-toolbar'].touchStarted = true;
});
+}
 
-   toolbar = $('#presentation-toolbar');
+function createPresentationToolbar() {
+   var toolbar = $('#presentation-toolbar');
toolbar.w2toolbar({
name: 'presentation-toolbar',
tooltip: 'bottom',
@@ -1105,8 +1113,10 @@ function initNormalToolbar() {
toolbar.bind('touchstart', function() {
w2ui['presentation-toolbar'].touchStarted = true;
});
+}
 
-   toolbar = $('#toolbar-down');
+function createStatusBar() {
+   var toolbar = $('#toolbar-down');
if (!window.mode.isMobile()) {
toolbar.w2toolbar({
name: 'actionbar',
@@ -1194,6 +1204,15 @@ function initNormalToolbar() {
});
 }
 
+function initNormalToolbar() {
+   createMainToolbar();
+   createFormulaBar();
+   createSigningBar();
+   createSpreadsheetToolbar();
+   createPresentationToolbar();
+   createStatusBar();
+}
+
 function setupSearchInput() {
$('#search-input').off('input', onSearchInput).on('input', 
onSearchInput);
$('#search-input').off('keydown', onSearchKeyDown).on('keydown', 
onSearchKeyDown);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-14 Thread Jan Holesovsky (via logerrit)
 loleaflet/src/control/Control.MobileWizard.js |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 4d49156ff22267f1b7e6d88787bc81e7e6efc764
Author: Jan Holesovsky 
AuthorDate: Fri Apr 10 13:53:54 2020 +0200
Commit: Jan Holesovsky 
CommitDate: Tue Apr 14 19:51:31 2020 +0200

mobile: The mobile-wizard is mobile phone only.

Don't try to instantiate it on desktop or tablet.

Change-Id: I71bb0fa4e6fbd3edce0adbd803d858874640adca
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92034
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.MobileWizard.js 
b/loleaflet/src/control/Control.MobileWizard.js
index bb0b3d95d..c45f25753 100644
--- a/loleaflet/src/control/Control.MobileWizard.js
+++ b/loleaflet/src/control/Control.MobileWizard.js
@@ -25,6 +25,11 @@ L.Control.MobileWizard = L.Control.extend({
 
onAdd: function (map) {
this.map = map;
+
+   // for the moment, the mobile-wizard is mobile phone only
+   if (!window.mode.isMobile())
+   return;
+
map.on('mobilewizard', this._onMobileWizard, this);
map.on('closemobilewizard', this._hideWizard, this);
map.on('showwizardsidebar', this._showWizardSidebar, this);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-14 Thread Tor Lillqvist (via logerrit)
 loleaflet/src/control/Control.Menubar.js |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit ec4d2b0312c7c6b5b7d3fa84e7bd274c444ab1ce
Author: Tor Lillqvist 
AuthorDate: Tue Apr 14 11:40:08 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Tue Apr 14 12:08:10 2020 +0200

Use "Export as" instead of "Download as" also on tablets in the mobile apps

Change-Id: I7e0736f8d91e71516671c33aec42ed168c2e8da9
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92149
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92154

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 654a3ff5a..919a4ab3f 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -21,7 +21,7 @@ L.Control.Menubar = L.Control.extend({
{name: _('Share...'), id:'shareas', type: 
'action'},
{name: _UNO('.uno:Print', 'text'), id: 'print', 
type: 'action'},
{name: _('See revision history'), id: 
'rev-history', type: 'action'},
-   {name: _('Download as'), id: 'downloadas', 
type: 'menu', menu: [
+   {name: !window.ThisIsAMobileApp ? _('Download 
as') : _('Export as'), id: 'downloadas', type: 'menu', menu: [
{name: _('PDF Document (.pdf)'), id: 
'downloadas-pdf', type: 'action'},
{name: _('ODF text document (.odt)'), 
id: 'downloadas-odt', type: 'action'},
{name: _('Word 2003 Document (.doc)'), 
id: 'downloadas-doc', type: 'action'},
@@ -252,7 +252,7 @@ L.Control.Menubar = L.Control.extend({
{name: _('Share...'), id:'shareas', type: 
'action'},
{name: _UNO('.uno:Print', 'presentation'), id: 
'print', type: 'action'},
{name: _('See revision history'), id: 
'rev-history', type: 'action'},
-   {name: _('Download as'), id: 'downloadas', 
type: 'menu', menu: [
+   {name: !window.ThisIsAMobileApp ? _('Download 
as') : _('Export as'), id: 'downloadas', type: 'menu', menu: [
{name: _('PDF Document (.pdf)'), id: 
'downloadas-pdf', type: 'action'},
{name: _('ODF presentation (.odp)'), 
id: 'downloadas-odp', type: 'action'},
{name: _('PowerPoint 2003 Presentation 
(.ppt)'), id: 'downloadas-ppt', type: 'action'},
@@ -353,7 +353,7 @@ L.Control.Menubar = L.Control.extend({
{name: _('Share...'), id:'shareas', type: 
'action'},
{name: _UNO('.uno:Print', 'spreadsheet'), id: 
'print', type: 'action'},
{name: _('See revision history'), id: 
'rev-history', type: 'action'},
-   {name: _('Download as'), id:'downloadas', type: 
'menu', menu: [
+   {name: !window.ThisIsAMobileApp ? _('Download 
as') : _('Export as'), id:'downloadas', type: 'menu', menu: [
{name: _('PDF Document (.pdf)'), id: 
'downloadas-pdf', type: 'action'},
{name: _('ODF spreadsheet (.ods)'), id: 
'downloadas-ods', type: 'action'},
{name: _('Excel 2003 Spreadsheet 
(.xls)'), id: 'downloadas-xls', type: 'action'},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-14 Thread Tor Lillqvist (via logerrit)
 loleaflet/src/control/Control.Menubar.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c4f6be9e4c2160c95c8f56e3a6b9726fe38a6aad
Author: Tor Lillqvist 
AuthorDate: Tue Apr 14 11:42:30 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Tue Apr 14 11:52:49 2020 +0200

Enable EPUB export also on phones in the mobile apps

Change-Id: I6198db8c5bd33142c952783b2bb8edd4f3c15145
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92150
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92153

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 7841dc93e..654a3ff5a 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -477,7 +477,7 @@ L.Control.Menubar = L.Control.extend({
{name: _('Word 2003 Document (.doc)'), id: 
'downloadas-doc', type: 'action'},
{name: _('Word Document (.docx)'), id: 
'downloadas-docx', type: 'action'},
{name: _('Rich Text (.rtf)'), id: 
'downloadas-rtf', type: 'action'},
-   {name: _('EPUB (.epub)'), id: 
'downloadas-epub', type: 'action', mobileapp: false}
+   {name: _('EPUB (.epub)'), id: 
'downloadas-epub', type: 'action'}
]},
{name: _UNO('.uno:EditMenu', 'text'), id: 'editmenu', 
type: 'menu', menu: [
{uno: '.uno:Undo'},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-13 Thread Pranam Lashkari (via logerrit)
 loleaflet/src/control/Control.Menubar.js |4 
 1 file changed, 4 insertions(+)

New commits:
commit 22f8e63beb686715ed3f06f7e918a44c02c19064
Author: Pranam Lashkari 
AuthorDate: Mon Apr 13 14:59:15 2020 +0530
Commit: Andras Timar 
CommitDate: Tue Apr 14 08:52:57 2020 +0200

leaflet: show checked status for Track changes

show ticks for record and show option in mobile wizard

Change-Id: I8146a5d484ea7e7304c22e77a642d0b46f00bd91
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92108
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index dac5d07d2..7841dc93e 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -1549,6 +1549,10 @@ L.Control.Menubar = L.Control.extend({
if (state && state[style]) {
menuStructure['checked'] = true;
}
+   } else if (item.uno === '.uno:TrackChanges' || item.uno === 
'.uno:ShowTrackedChanges') {
+   if 
(this._map['stateChangeHandler'].getItemValue(item.uno) === 'true') {
+   menuStructure['checked'] = true;
+   }
}
 
if (item.menu)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-10 Thread Pranam Lashkari (via logerrit)
 loleaflet/src/layer/tile/TileLayer.js |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 298794d7b05db39b9f95f19693bea42388590b27
Author: Pranam Lashkari 
AuthorDate: Fri Apr 10 00:23:50 2020 +0530
Commit: Jan Holesovsky 
CommitDate: Fri Apr 10 13:00:39 2020 +0200

leaflet: resolved android crash issue due to unhandled exception

Change-Id: I2a2779df358bd629a3419e0e6ad3d9055a32800b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91997
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index a38f88049..6041f845a 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2144,15 +2144,15 @@ L.TileLayer = L.GridLayer.extend({
&& scroll !== false
&& !this._map.getBounds().contains(this._visibleCursor)
&& this._map._isCursorVisible
-   && this._map._clip._selectionType !== 'complex') {
+   && (!this._map._clip || this._map._clip._selectionType !== 
'complex')) {
 
var center = this._map.project(cursorPos);
center = 
center.subtract(this._map.getSize().divideBy(2));
center.x = Math.round(center.x < 0 ? 0 : center.x);
center.y = Math.round(center.y < 0 ? 0 : center.y);
if (!(this._selectionHandles.start && 
this._selectionHandles.start.isDragged) &&
-   !(this._selectionHandles.end && 
this._selectionHandles.end.isDragged) &&
-   !(docLayer._followEditor || docLayer._followUser)) {
+   !(this._selectionHandles.end && 
this._selectionHandles.end.isDragged) &&
+   !(docLayer._followEditor || 
docLayer._followUser)) {
this._map.fire('scrollto', {x: center.x, y: 
center.y, calledFromInvalidateCursorMsg: scroll !== undefined});
}
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-07 Thread mert (via logerrit)
 loleaflet/src/control/Control.Menubar.js |8 
 loleaflet/src/control/Control.Toolbar.js |8 +---
 loleaflet/src/main.js|2 +-
 3 files changed, 14 insertions(+), 4 deletions(-)

New commits:
commit f634264d89896be25f2853952241afe4e9d4c45c
Author: mert 
AuthorDate: Wed Mar 25 23:15:10 2020 +0300
Commit: Jan Holesovsky 
CommitDate: Tue Apr 7 20:28:40 2020 +0200

mobile: Add search in the readonly mode

Change-Id: I059b0337096f9eed21031724dbec22f29807a979
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91072
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index e2396faf5..f7aa69111 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -489,6 +489,7 @@ L.Control.Menubar = L.Control.extend({
{uno: '.uno:Paste'},
{uno: '.uno:SelectAll'}
]},
+   {name: _('Search'), id: 'searchdialog', type: 'action'},
{name: _UNO('.uno:ChangesMenu', 'text'), id: 
'changesmenu', type: 'menu', menu: [
{uno: '.uno:TrackChanges'},
{uno: '.uno:ShowTrackedChanges'},
@@ -535,6 +536,7 @@ L.Control.Menubar = L.Control.extend({
{uno: '.uno:Paste'},
{uno: '.uno:SelectAll'}
]},
+   {name: _('Search'), id: 'searchdialog', type: 'action'},
{name: _UNO('.uno:TableMenu', 'text'/*HACK should be 
'presentation', but not in xcu*/), id: 'tablemenu', type: 'menu', menu: [
{uno: '.uno:InsertRowsBefore'},
{uno: '.uno:InsertRowsAfter'},
@@ -580,6 +582,7 @@ L.Control.Menubar = L.Control.extend({
{uno: '.uno:Paste'},
{uno: '.uno:SelectAll'}
]},
+   {name: _('Search'), id: 'searchdialog', type: 'action'},
{name: _UNO('.uno:SheetMenu', 'spreadsheet'), id: 
'sheetmenu', type: 'menu', menu: [
{name: _UNO('.uno:InsertRowsMenu', 
'spreadsheet'), id: 'insertrowsmenu', type: 'menu', menu: [
{uno: '.uno:InsertRowsBefore'},
@@ -1194,6 +1197,11 @@ L.Control.Menubar = L.Control.extend({
}
} else if (id === 'repair') {
this._map._socket.sendMessage('commandvalues 
command=.uno:DocumentRepair');
+   } else if (id === 'searchdialog') {
+   $('#toolbar-down').hide();
+   $('#toolbar-search').show();
+   $('#mobile-edit-button').hide();
+   L.DomUtil.get('search-input').focus();
}
// Inform the host if asked
if (postmessage)
diff --git a/loleaflet/src/control/Control.Toolbar.js 
b/loleaflet/src/control/Control.Toolbar.js
index 6a61894df..21a434d56 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -186,7 +186,11 @@ function onClick(e, id, item, subItem) {
}
else if (id === 'hidesearchbar') {
$('#toolbar-search').hide();
-   $('#toolbar-down').show();
+   if (map._permission === 'edit')
+   $('#toolbar-down').show();
+   /** show edit button if only we are able to edit but in 
readonly mode */
+   if (window.docPermission  === 'edit' && map._permission === 
'readonly')
+   $('#mobile-edit-button').show();
}
else if (id === 'searchprev') {
map.search(L.DomUtil.get('search-input').value, true);
@@ -2304,7 +2308,6 @@ function onUpdatePermission(e) {
toolbar.enable(id);
});
}
-   $('#search-input').prop('disabled', false);
 
if (window.mode.isMobile()) {
$('#toolbar-down').show();
@@ -2347,7 +2350,6 @@ function onUpdatePermission(e) {
toolbar.disable(id);
});
}
-   $('#search-input').prop('disabled', true);
 
if (window.mode.isMobile()) {
$('#toolbar-down').hide();
diff --git a/loleaflet/src/main.js b/loleaflet/src/main.js
index 7fdbee43d..5b2799df6 100644
--- a/loleaflet/src/main.js
+++ b/loleaflet/src/main.js
@@ -49,7 +49,6 @@ if (wopiSrc != '') {
 }
 
 var notWopiButIframe = getParameterByName('NotWOPIButIframe') != '';
-
 var map = L.map('map', {
server: host,
doc: docURL,
@@ -90,6 +89,

[Libreoffice-commits] online.git: loleaflet/src

2020-04-07 Thread Tamás Zolnai (via logerrit)
 loleaflet/src/control/Ruler.js |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 35b3f0ea904fcb95f9d12a915bb41be80868ccf9
Author: Tamás Zolnai 
AuthorDate: Mon Apr 6 16:55:37 2020 +0200
Commit: Andras Timar 
CommitDate: Tue Apr 7 10:12:33 2020 +0200

cypress: mobile: fix exception related to currentTarget.

Change-Id: I672ceb28c6f14b8c08103d6c9677707b35cbdfc8
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91797
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js
index c190039cc..292e4d2b2 100644
--- a/loleaflet/src/control/Ruler.js
+++ b/loleaflet/src/control/Ruler.js
@@ -290,7 +290,7 @@ L.Control.Ruler = L.Control.extend({
 
// Are there any tab stops?
// e.currentTarget == this._rTSContainer, so yeah, we could use 
that, too.
-   if (e.currentTarget.tabStops.length === 0)
+   if (!e.currentTarget || e.currentTarget.tabStops.length === 0)
return;
 
// Check if "close enough" to one unambiguous tab stop
@@ -348,6 +348,9 @@ L.Control.Ruler = L.Control.extend({
},
 
_moveTabstop: function(e) {
+   if (!e.currentTarget)
+   return;
+
var pixelDiff = e.layerX - e.currentTarget.tabStopPrevPos;
var diff = this._map._docLayer._pixelsToTwips({x: pixelDiff, 
y:0}).x;
if (diff === 0)
@@ -398,6 +401,9 @@ L.Control.Ruler = L.Control.extend({
},
 
_endTabstopDrag: function(e) {
+   if (!e.currentTarget)
+   return;
+
// console.log('===> _endTabstopDrag ' + e.type);
if (window.ThisIsTheiOSApp) {
L.DomEvent.off(e.currentTarget, 'touchmove', 
this._moveTabstop, this);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-06 Thread Pranam Lashkari (via logerrit)
 loleaflet/src/layer/tile/TileLayer.js |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 212d707227a11955719ae0a238bc546935ea919c
Author: Pranam Lashkari 
AuthorDate: Tue Apr 7 00:38:50 2020 +0530
Commit: Andras Timar 
CommitDate: Mon Apr 6 21:47:10 2020 +0200

leaflet: stoped view jumping when deselecting shapes/images

cause of the problem: if the last position of the cursor
before selecting a complex object is out of view
then the page will scroll to that point.
This happens because scrolling takes place between
deselecting object and cursor position update

test failing problem with aba812f resolved

Change-Id: I7c1aea4a4a8b83cec9bd166adaa0e099ad16f070
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91781
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 3d3c86bf1..a38f88049 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2140,7 +2140,12 @@ L.TileLayer = L.GridLayer.extend({
var cursorPos = this._visibleCursor.getNorthWest();
var docLayer = this._map._docLayer;
 
-   if (!zoom && scroll !== false && 
!this._map.getBounds().contains(this._visibleCursor) && 
this._map._isCursorVisible) {
+   if (!zoom
+   && scroll !== false
+   && !this._map.getBounds().contains(this._visibleCursor)
+   && this._map._isCursorVisible
+   && this._map._clip._selectionType !== 'complex') {
+
var center = this._map.project(cursorPos);
center = 
center.subtract(this._map.getSize().divideBy(2));
center.x = Math.round(center.x < 0 ? 0 : center.x);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-06 Thread Tamás Zolnai (via logerrit)
 loleaflet/src/layer/tile/TileLayer.js |7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

New commits:
commit e86093ccd71defb0a40863206463be7d6160157d
Author: Tamás Zolnai 
AuthorDate: Mon Apr 6 15:49:50 2020 +0200
Commit: Tamás Zolnai 
CommitDate: Mon Apr 6 16:06:28 2020 +0200

Revert "leaflet: stoped view jumping when deselecting shapes/images"

This reverts commit aba812fc9f9df12bcf5acc2b8199160a92247624.

Change-Id: I06dab52595ccd8f565e465b1c6be4e4567e16e82
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91756
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tamás Zolnai 

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 163957670..3d3c86bf1 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2140,12 +2140,7 @@ L.TileLayer = L.GridLayer.extend({
var cursorPos = this._visibleCursor.getNorthWest();
var docLayer = this._map._docLayer;
 
-   if (!zoom
-   && scroll !== false
-   && !this._map.getBounds().contains(this._visibleCursor)
-   && this._map._isCursorVisible
-   && this._map._clip._selectionType === 'text') {
-
+   if (!zoom && scroll !== false && 
!this._map.getBounds().contains(this._visibleCursor) && 
this._map._isCursorVisible) {
var center = this._map.project(cursorPos);
center = 
center.subtract(this._map.getSize().divideBy(2));
center.x = Math.round(center.x < 0 ? 0 : center.x);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-06 Thread Pranam Lashkari (via logerrit)
 loleaflet/src/layer/tile/TileLayer.js |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit aba812fc9f9df12bcf5acc2b8199160a92247624
Author: Pranam Lashkari 
AuthorDate: Mon Apr 6 04:58:12 2020 +0530
Commit: Andras Timar 
CommitDate: Mon Apr 6 11:08:43 2020 +0200

leaflet: stoped view jumping when deselecting shapes/images

cause of the problem: if the last position of the cursor
before selecting a complex object is out of view
then the page will scroll to that point.
This happens because scrolling takes place between
deselecting object and cursor position update

Change-Id: I4046cf6728f7da32a4f6d89768e201982023afa9
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91734
Tested-by: Andras Timar 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 3d3c86bf1..163957670 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2140,7 +2140,12 @@ L.TileLayer = L.GridLayer.extend({
var cursorPos = this._visibleCursor.getNorthWest();
var docLayer = this._map._docLayer;
 
-   if (!zoom && scroll !== false && 
!this._map.getBounds().contains(this._visibleCursor) && 
this._map._isCursorVisible) {
+   if (!zoom
+   && scroll !== false
+   && !this._map.getBounds().contains(this._visibleCursor)
+   && this._map._isCursorVisible
+   && this._map._clip._selectionType === 'text') {
+
var center = this._map.project(cursorPos);
center = 
center.subtract(this._map.getSize().divideBy(2));
center.x = Math.round(center.x < 0 ? 0 : center.x);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-05 Thread Szymon Kłos (via logerrit)
 loleaflet/src/control/Control.LokDialog.js |   16 
 1 file changed, 16 insertions(+)

New commits:
commit fbaedcd212f8651b54ab2074dc0065c41580de60
Author: Szymon Kłos 
AuthorDate: Wed Apr 1 10:56:31 2020 +0200
Commit: Andras Timar 
CommitDate: Sun Apr 5 14:29:12 2020 +0200

Close child windows on dialog close

Fixes issue with crash when parent window was already closed
and then user tried to close child window.
Example: Tools -> Spelling and message box ("Spellcheck completed")

Change-Id: I30fef5adb33ba4208b1ee48f3bbced1cff2969d1
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91468
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 675526299..84c541e6b 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -1183,7 +1183,23 @@ L.Control.LokDialog = L.Control.extend({
console.log('_onCalcInputBarClose: end');
},
 
+   _closeChildWindows: function(dialogId) {
+   // child windows - with greater id number
+   var that = this;
+   var foundCurrent = false;
+
+   Object.keys(this._dialogs).forEach(function(id) {
+   if (foundCurrent && !that._isSidebar(id) && 
!that._isCalcInputBar(id))
+   that._onDialogClose(id, true);
+
+   if (id == dialogId)
+   foundCurrent = true;
+   });
+   },
+
_onDialogClose: function(dialogId, notifyBackend) {
+   this._closeChildWindows(dialogId);
+
if (window.ThisIsTheiOSApp)
w2ui['editbar'].enable('closemobile');
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-05 Thread gokaysatir (via logerrit)
 loleaflet/src/control/Control.Tabs.js |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit cd73939022c9d348384545f50cad501bc4e17fd0
Author: gokaysatir 
AuthorDate: Thu Apr 2 14:31:43 2020 +0300
Commit: Andras Timar 
CommitDate: Sun Apr 5 14:23:34 2020 +0200

calc-rename sheet-initially select existing name

Change-Id: Ifb4f28f5f60e7bd514b4fca4dddc000d19237e8b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91565
Tested-by: Michael Meeks 
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/loleaflet/src/control/Control.Tabs.js 
b/loleaflet/src/control/Control.Tabs.js
index 182a154c0..505fd51ce 100644
--- a/loleaflet/src/control/Control.Tabs.js
+++ b/loleaflet/src/control/Control.Tabs.js
@@ -218,7 +218,8 @@ L.Control.Tabs = L.Control.extend({
$.extend({}, vex.dialog.buttons.YES, { text: 
_('OK') }),
$.extend({}, vex.dialog.buttons.NO, { text: 
_('Cancel') })
],
-   input: '',
+   input: '',
+   afterOpen: function() { 
document.getElementById('rename-calc-sheet-modal').select(); },
callback: function(data) {
map.renamePage(data.sheetname, nPos);
}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-03 Thread Tamás Zolnai (via logerrit)
 loleaflet/src/layer/tile/TileLayer.js |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 05752cececa6707ad8edcd2e46b66480209b8ca7
Author: Tamás Zolnai 
AuthorDate: Fri Apr 3 16:50:10 2020 +0200
Commit: Tamás Zolnai 
CommitDate: Sat Apr 4 00:28:30 2020 +0200

mobile: fix type error in cell cursor handler code.

Added in:
9374a2883537d41d6994e5a77fd45bb5fbe9a0d7

getWest and getNorth is a float value, not a pair of values.
We don't need actual subtraction here.

Change-Id: I2ffa964863eefcdb2758e5e920563c31f22b77b8
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91646
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tamás Zolnai 

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index d5aa0c18d..3d3c86bf1 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1070,8 +1070,8 @@ L.TileLayer = L.GridLayer.extend({
}
else if (!this._isEmptyRectangle(this._cellCursor)) {
// This is needed for jumping view to cursor position 
on tab switch
-   horizontalDirection = sign(this._cellCursor.getWest() - 
L.Point(0, 0));
-   verticalDirection = sign(this._cellCursor.getNorth() - 
L.Point(0, 0));
+   horizontalDirection = sign(this._cellCursor.getWest());
+   verticalDirection = sign(this._cellCursor.getNorth());
}
 
var onPgUpDn = false;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-02 Thread Ashod Nakashian (via logerrit)
 loleaflet/src/layer/tile/TileLayer.js |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 04b0a7b651bc2d7f98b843b08c402411641513a3
Author: Ashod Nakashian 
AuthorDate: Thu Apr 2 08:09:28 2020 -0400
Commit: Ashod Nakashian 
CommitDate: Thu Apr 2 17:09:28 2020 +0200

leaflet: maintain focus when searching

When the focus is in the search box, we shouldn't
lose it, or hide the keyboard.

Change-Id: I05c4c3e384d840b2919106af1063978b6fe7fbfe
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91580
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Ashod Nakashian 

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 225bceddb..d5aa0c18d 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2184,7 +2184,8 @@ L.TileLayer = L.GridLayer.extend({
}
} else {
this._map._textInput.hideCursor();
-   if (this._map.editorHasFocus()) // Allow input if a 
dialog has the focus.
+   // Maintain input if a dialog or search-box has the 
focus.
+   if (this._map.editorHasFocus() && 
!this._map.isSearching())
this._map.focus(false);
}
},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-02 Thread Ashod Nakashian (via logerrit)
 loleaflet/src/map/Clipboard.js |4 
 1 file changed, 4 insertions(+)

New commits:
commit f96126fb69ff8feb3b5de6c55310f9926b89bf44
Author: Ashod Nakashian 
AuthorDate: Thu Apr 2 10:05:15 2020 -0400
Commit: Ashod Nakashian 
CommitDate: Thu Apr 2 17:08:22 2020 +0200

leaflet: support pasting in the search box

When pasting into the document a special handler
is used to manage the transfer of data. For the search
box we need to let the default handler do the right thing
and so we check that we aren't searching before we override
the paste handler logic, which explicitly pastes into the doc.

Change-Id: I570168d1aaf70c2a78403644e006ba9625ec68db
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91581
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Ashod Nakashian 

diff --git a/loleaflet/src/map/Clipboard.js b/loleaflet/src/map/Clipboard.js
index 218c3dfd0..df07abf4d 100644
--- a/loleaflet/src/map/Clipboard.js
+++ b/loleaflet/src/map/Clipboard.js
@@ -657,6 +657,10 @@ L.Clipboard = L.Class.extend({
if (isAnyVexDialogActive() && !this._map.hasFocus())
return;
 
+   // If the focus is in the search box, paste there.
+   if (this._map.isSearching())
+   return;
+
if (this._map._activeDialog)
ev.usePasteKeyEvent = true;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-02 Thread Ashod Nakashian (via logerrit)
 loleaflet/src/layer/tile/TileLayer.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a0c1bc05ecefc3606d35244a3faa42348752a216
Author: Ashod Nakashian 
AuthorDate: Thu Mar 26 07:32:39 2020 -0400
Commit: Ashod Nakashian 
CommitDate: Thu Apr 2 17:06:39 2020 +0200

leaflet: limit special case to only the Formula-Bar

Change-Id: If9c5bbe7f985a7bdac2d12c5136e0e93a1d41354
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91536
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Ashod Nakashian 

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index add537854..225bceddb 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2017,7 +2017,7 @@ L.TileLayer = L.GridLayer.extend({
 
_postMouseEvent: function(type, x, y, count, buttons, modifier) {
 
-   if (this.isCalc() && !this._map.editorHasFocus()) {
+   if (this._map.calcInputBarHasFocus()) {
// When the Formula-bar has the focus, sending
// mouse move with the document coordinates
// hides the cursor (lost focus?). This is clearly
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-02 Thread Henry Castro (via logerrit)
 loleaflet/src/control/Control.JSDialogBuilder.js |   39 ---
 1 file changed, 8 insertions(+), 31 deletions(-)

New commits:
commit 91b2e52ce2d2f78802faec1025c13bd1e438fae7
Author: Henry Castro 
AuthorDate: Fri Mar 27 20:02:16 2020 -0400
Commit: Henry Castro 
CommitDate: Thu Apr 2 15:43:54 2020 +0200

loleaflet: update position and size transformation values

Now the LO Core server sends the converted units formatted
text to update in client side when mobile wizard is visible.

Change-Id: I82416bb4712aa20bcddb409c1129da1aff521a34
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91266
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js 
b/loleaflet/src/control/Control.JSDialogBuilder.js
index 862c218a4..27c8f35d7 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -904,34 +904,6 @@ L.Control.JSDialogBuilder = L.Control.extend({
}
break;
 
-   case 'selectwidth':
-   state = items.getItemValue('.uno:Size');
-   if (state) {
-   return 
String(L.mm100thToInch(state.split('x')[0]).toFixed(2));
-   }
-   break;
-
-   case 'selectheight':
-   state = items.getItemValue('.uno:Size');
-   if (state) {
-   return 
String(L.mm100thToInch(state.split('x')[1]).toFixed(2));
-   }
-   break;
-
-   case 'horizontalpos':
-   state = items.getItemValue('.uno:Position');
-   if (state) {
-   return 
String(L.mm100thToInch(state.split('/')[0]).toFixed(2));
-   }
-   break;
-
-   case 'verticalpos':
-   state = items.getItemValue('.uno:Position');
-   if (state) {
-   return 
String(L.mm100thToInch(state.split('/')[1]).toFixed(2));
-   }
-   break;
-
case 'transtype':
state = 
items.getItemValue('.uno:FillFloatTransparence');
if (state) {
@@ -999,8 +971,11 @@ L.Control.JSDialogBuilder = L.Control.extend({
if (data.readOnly === true)
$(spinfield).attr('readOnly', 'true');
 
-   var updateFunction = function() {
-   var value = builder._getUnoStateForItemId(data.id, 
builder);
+   var updateFunction = function(e) {
+   var value = e ? e[data.id] : undefined;
+   if (!value) {
+   value = builder._getUnoStateForItemId(data.id, 
builder);
+   }
 
if (!value && data.text != undefined)
value = data.text;
@@ -1013,7 +988,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
updateFunction();
 
builder.map.on('commandstatechanged', function(e) {
-   if (e.commandName === 
builder._mapWindowIdToUnoCommand(data.id))
+   if (e.state[data.id]) {
+   updateFunction(e.state);
+   } else if (e.commandName === 
builder._mapWindowIdToUnoCommand(data.id))
updateFunction();
}, this);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-04-01 Thread Michael Meeks (via logerrit)
 loleaflet/src/layer/tile/TileLayer.js |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 3e67e434e4d4976939efbc71502fc573e8d417e7
Author: Michael Meeks 
AuthorDate: Wed Apr 1 14:44:59 2020 +0100
Commit: Andras Timar 
CommitDate: Wed Apr 1 18:10:23 2020 +0200

Avoid de-referencing non-existing marker.

This screws up cursors across views in some circumstances,
when there is no marker in one of the views.

Regression from 3b0478baab1e58a45fc723e9265942bf5d4c10fa

Change-Id: Ia1294d83801d656a919f97206b7b573a1b74b77f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91489
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/loleaflet/src/layer/tile/TileLayer.js 
b/loleaflet/src/layer/tile/TileLayer.js
index 5245d085f..add537854 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2230,7 +2230,8 @@ L.TileLayer = L.GridLayer.extend({
this._viewLayerGroup.removeLayer(viewCursorMarker);
}
 
-   this._viewCursors[viewId].marker.showCursorHeader();
+   if (this._viewCursors[viewId].marker)
+   this._viewCursors[viewId].marker.showCursorHeader();
},
 
updateAllViewCursors : function() {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: loleaflet/src

2020-03-31 Thread Tor Lillqvist (via logerrit)
 loleaflet/src/control/Control.Toolbar.js |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit b0c09e14daa89e7da35dd7b140632305fbb93f3c
Author: Tor Lillqvist 
AuthorDate: Tue Mar 31 20:14:23 2020 +0300
Commit: Tor Lillqvist 
CommitDate: Tue Mar 31 19:35:51 2020 +0200

Add a (commented-out) way to see the initial visualViewport scale and size

Ideally it should update as the device is rotated or the document
window is resized by Split View. We should have some field somehwere
where all kinds of debugging information, including this
visualViewport information, would be displayed by simply un-commenting
a single line.

Change-Id: I7d3960440272c03040e0f4ad5dd65f49d5a98780
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91437
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/loleaflet/src/control/Control.Toolbar.js 
b/loleaflet/src/control/Control.Toolbar.js
index 059dc28e5..f6606bdd5 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -1735,7 +1735,11 @@ function onDocLayerInit() {
$('#document-name-input').focus(function() { $(this).blur(); });
// Call decodecodeURIComponent twice: Reverse both our encoding 
and the encoding of
// the name in the file system.
-   
$('#document-name-input').val(decodeURIComponent(decodeURIComponent(map.options.doc.replace(/.*\//,
 '';
+   
$('#document-name-input').val(decodeURIComponent(decodeURIComponent(map.options.doc.replace(/.*\//,
 '')))
+ // To conveniently see the 
initial visualViewport scale and size, un-comment the following line.
+ // + ' (' + 
window.visualViewport.scale + '*' + window.visualViewport.width + 'x' + 
window.visualViewport.height + ')'
+ // TODO: Yes, it would be better 
to see it change as you rotate the device or invoke Split View.
+);
}
 
if (!window.ThisIsTheiOSApp && window.mode.isTablet()) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


<    1   2   3   4   5   6   7   8   9   10   >