loleaflet/css/notebookbar.css                       |    6 
 loleaflet/src/control/Control.Menubar.js            |    2 
 loleaflet/src/control/Control.NotebookbarBuilder.js |    9 
 loleaflet/src/control/Control.NotebookbarCalc.js    |  280 +++++++++++++++++++-
 4 files changed, 295 insertions(+), 2 deletions(-)

New commits:
commit 9719e6c4ef3f33b60a696adda2fda3574c5d856c
Author:     Pedro Pinto Silva <pedro.si...@collabora.com>
AuthorDate: Mon Aug 3 12:24:27 2020 +0200
Commit:     Pedro Silva <pedro.si...@collabora.com>
CommitDate: Tue Aug 4 14:01:11 2020 +0200

    NotebookbarCalc: Add Layout and Data tabs,
    
    Change-Id: I0dedbcf9c361969e1134406e2f782cf21aa585e4
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99997
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Pedro Silva <pedro.si...@collabora.com>

diff --git a/loleaflet/css/notebookbar.css b/loleaflet/css/notebookbar.css
index 07d494bed..22991e442 100644
--- a/loleaflet/css/notebookbar.css
+++ b/loleaflet/css/notebookbar.css
@@ -611,6 +611,12 @@ div[id*='Row'].notebookbar, div[id*='Column'].notebookbar, 
#SendToBack.notebookb
        width: 32px !important;
 }
 
+/* Sheet Tab */
+
+#table-Sheet-Section.notebookbar {
+       margin-top: 10px;
+}
+
 /* Impress */
 
 /* Home Tab */
diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 8838a3efd..f5e0818e5 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -409,7 +409,7 @@ L.Control.Menubar = L.Control.extend({
                                {type: 'separator'},
                                {name: _UNO('.uno:HyperlinkDialog'), id: 
'inserthyperlink', type: 'action'},
                                {uno: '.uno:InsertSymbol'},
-                               {uno: '.uno:EditHeaderAndFooter'}
+                               {uno: '.uno:EditHeaderAndFooter'} /*todo: add 
to Control.Notebookbar.Calc.js (as Insert tab)*/
                        ]},
                        {name: _UNO('.uno:FormatMenu', 'spreadsheet'), id: 
'format', type: 'menu', menu: [
                                {uno: '.uno:ResetAttributes'},
diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js 
b/loleaflet/src/control/Control.NotebookbarBuilder.js
index cd9fae8f1..7d88c0512 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -149,6 +149,15 @@ L.Control.NotebookbarBuilder = 
L.Control.JSDialogBuilder.extend({
                this._toolitemHandlers['.uno:Paste'] = function() {};
                this._toolitemHandlers['.uno:DataDataPilotRun'] = function() {};
 
+               /*Calc: Data Tab*/
+               this._toolitemHandlers['.uno:DataProvider'] = function() {};
+               this._toolitemHandlers['.uno:ManageXMLSource'] = function() {};
+               this._toolitemHandlers['.uno:DataStreams'] = function() {};
+               this._toolitemHandlers['.uno:InsertExternalDataSource'] = 
function() {};
+               this._toolitemHandlers['.uno:RecalcPivotTable'] = function() {};
+               this._toolitemHandlers['.uno:DataProviderRefresh'] = function() 
{};
+               this._toolitemHandlers['.uno:Calculate'] = function() {};
+
                this._toolitemHandlers['vnd.sun.star.findbar:FocusToFindbar'] = 
function() {};
        },
 
diff --git a/loleaflet/src/control/Control.NotebookbarCalc.js 
b/loleaflet/src/control/Control.NotebookbarCalc.js
index b806bb4b8..e15a695f8 100644
--- a/loleaflet/src/control/Control.NotebookbarCalc.js
+++ b/loleaflet/src/control/Control.NotebookbarCalc.js
@@ -5,7 +5,7 @@
 
 /* global _ _UNO */
 L.Control.NotebookbarCalc = L.Control.NotebookbarWriter.extend({
-       
+
        getTabs: function() {
                return [
                        {
@@ -24,6 +24,16 @@ L.Control.NotebookbarCalc = 
L.Control.NotebookbarWriter.extend({
                                'id': '3',
                                'name': 'InsertLabel'
                        },
+                       {
+                               'text': _('~Sheet'),
+                               'id': '-3',
+                               'name': 'Sheet'
+                       },
+                       {
+                               'text': _('~Data'),
+                               'id': '5',
+                               'name': 'DataLabel'
+                       },
                        {
                                'text': _('~Review'),
                                'id': '6',
@@ -37,6 +47,23 @@ L.Control.NotebookbarCalc = 
L.Control.NotebookbarWriter.extend({
                ];
        },
 
+       selectedTab: function(tabName) {
+               switch (tabName) {
+               case 'File':
+                       this.loadTab(this.getFileTab());
+                       break;
+
+               case 'Help':
+                       this.loadTab(this.getHelpTab());
+                       break;
+
+               case 'Sheet':
+                       this.loadTab(this.getSheetTab());
+                       break;
+
+               }
+       },
+
        getFileTab: function() {
                var hasRevisionHistory = L.Params.revHistoryEnabled;
                var hasPrint = !this._map['wopi'].HidePrintOption;
@@ -1797,6 +1824,257 @@ L.Control.NotebookbarCalc = 
L.Control.NotebookbarWriter.extend({
                                }
                        ]
                };
+       },
+
+       getSheetTab: function() {
+               return {
+                       'id': '',
+                       'type': 'control',
+                       'text': '',
+                       'enabled': 'true',
+                       'children': [
+                               {
+                                       'id': '',
+                                       'type': 'container',
+                                       'text': '',
+                                       'enabled': 'true',
+                                       'children': [
+                                               {
+                                                       'id': 'NotebookBar',
+                                                       'type': 'grid',
+                                                       'text': '',
+                                                       'enabled': 'true',
+                                                       'children': [
+                                                               {
+                                                                       'id': 
'box',
+                                                                       'type': 
'container',
+                                                                       'text': 
'',
+                                                                       
'enabled': 'true',
+                                                                       
'children': [
+                                                                               
{
+                                                                               
        'id': 'ContextContainer',
+                                                                               
        'type': 'tabcontrol',
+                                                                               
        'text': '',
+                                                                               
        'enabled': 'true',
+                                                                               
        'selected': '-3',
+                                                                               
        'children': [
+                                                                               
                {
+                                                                               
                        'id': '',
+                                                                               
                        'type': 'tabpage',
+                                                                               
                        'text': '',
+                                                                               
                        'enabled': 'true',
+                                                                               
                        'children': [
+                                                                               
                                {
+                                                                               
                                        'id': 'Sheet Tab',
+                                                                               
                                        'type': 'container',
+                                                                               
                                        'text': '',
+                                                                               
                                        'enabled': 'true',
+                                                                               
                                        'children': [
+                                                                               
                                                {
+                                                                               
                                                        'id': 'Sheet',
+                                                                               
                                                        'type': 'container',
+                                                                               
                                                        'text': '',
+                                                                               
                                                        'enabled': 'true',
+                                                                               
                                                        'children': [
+                                                                               
                                                                {
+                                                                               
                                                                        'id': 
'Sheet-Section',
+                                                                               
                                                                        'type': 
'container',
+                                                                               
                                                                        'text': 
'',
+                                                                               
                                                                        
'enabled': 'true',
+                                                                               
                                                                        
'children': [
+                                                                               
                                                                                
{
+                                                                               
                                                                                
        'id': 'rows-Section',
+                                                                               
                                                                                
        'type': 'container',
+                                                                               
                                                                                
        'text': '',
+                                                                               
                                                                                
        'enabled': 'true',
+                                                                               
                                                                                
        'vertical': 'true',
+                                                                               
                                                                                
        'children': [
+                                                                               
                                                                                
                {
+                                                                               
                                                                                
                        'id': 'Section7',
+                                                                               
                                                                                
                        'type': 'toolbox',
+                                                                               
                                                                                
                        'text': '',
+                                                                               
                                                                                
                        'enabled': 'true',
+                                                                               
                                                                                
                        'children': [
+                                                                               
                                                                                
                                {
+                                                                               
                                                                                
                                        'type': 'toolitem',
+                                                                               
                                                                                
                                        'text': _('Insert Rows Above'),
+                                                                               
                                                                                
                                        'command': '.uno:InsertRowsBefore'
+                                                                               
                                                                                
                                }
+                                                                               
                                                                                
                        ]
+                                                                               
                                                                                
                },
+                                                                               
                                                                                
                {
+                                                                               
                                                                                
                        'id': 'Section10',
+                                                                               
                                                                                
                        'type': 'toolbox',
+                                                                               
                                                                                
                        'text': '',
+                                                                               
                                                                                
                        'enabled': 'true',
+                                                                               
                                                                                
                        'children': [
+                                                                               
                                                                                
                                {
+                                                                               
                                                                                
                                        'type': 'toolitem',
+                                                                               
                                                                                
                                        'text': _('Insert Rows Below'),
+                                                                               
                                                                                
                                        'command': '.uno:InsertRowsAfter'
+                                                                               
                                                                                
                                }
+                                                                               
                                                                                
                        ]
+                                                                               
                                                                                
                }
+                                                                               
                                                                                
        ]
+                                                                               
                                                                                
},
+                                                                               
                                                                                
{
+                                                                               
                                                                                
        'id': 'columns-Section',
+                                                                               
                                                                                
        'type': 'container',
+                                                                               
                                                                                
        'text': '',
+                                                                               
                                                                                
        'enabled': 'true',
+                                                                               
                                                                                
        'vertical': 'true',
+                                                                               
                                                                                
        'children': [
+                                                                               
                                                                                
                {
+                                                                               
                                                                                
                        'id': 'Section8',
+                                                                               
                                                                                
                        'type': 'toolbox',
+                                                                               
                                                                                
                        'text': '',
+                                                                               
                                                                                
                        'enabled': 'true',
+                                                                               
                                                                                
                        'children': [
+                                                                               
                                                                                
                                {
+                                                                               
                                                                                
                                        'type': 'toolitem',
+                                                                               
                                                                                
                                        'text': _('Insert Columns Before'),
+                                                                               
                                                                                
                                        'command': '.uno:InsertColumnsBefore'
+                                                                               
                                                                                
                                }
+                                                                               
                                                                                
                        ]
+                                                                               
                                                                                
                },
+                                                                               
                                                                                
                {
+                                                                               
                                                                                
                        'id': 'Section9',
+                                                                               
                                                                                
                        'type': 'toolbox',
+                                                                               
                                                                                
                        'text': '',
+                                                                               
                                                                                
                        'enabled': 'true',
+                                                                               
                                                                                
                        'children': [
+                                                                               
                                                                                
                                {
+                                                                               
                                                                                
                                        'type': 'toolitem',
+                                                                               
                                                                                
                                        'text': _('Insert Columns After'),
+                                                                               
                                                                                
                                        'command': '.uno:InsertColumnsAfter'
+                                                                               
                                                                                
                                }
+                                                                               
                                                                                
                        ]
+                                                                               
                                                                                
                }
+                                                                               
                                                                                
        ]
+                                                                               
                                                                                
},
+                                                                               
                                                                                
{
+                                                                               
                                                                                
        'id': 'break-Section',
+                                                                               
                                                                                
        'type': 'container',
+                                                                               
                                                                                
        'text': '',
+                                                                               
                                                                                
        'enabled': 'true',
+                                                                               
                                                                                
        'vertical': 'true',
+                                                                               
                                                                                
        'children': [
+                                                                               
                                                                                
                {
+                                                                               
                                                                                
                        'id': 'Section7',
+                                                                               
                                                                                
                        'type': 'toolbox',
+                                                                               
                                                                                
                        'text': '',
+                                                                               
                                                                                
                        'enabled': 'true',
+                                                                               
                                                                                
                        'children': [
+                                                                               
                                                                                
                                {
+                                                                               
                                                                                
                                        'type': 'toolitem',
+                                                                               
                                                                                
                                        'text': _('Insert Row Break'),
+                                                                               
                                                                                
                                        'command': '.uno:InsertRowBreak'
+                                                                               
                                                                                
                                }
+                                                                               
                                                                                
                        ]
+                                                                               
                                                                                
                },
+                                                                               
                                                                                
                {
+                                                                               
                                                                                
                        'id': 'Section10',
+                                                                               
                                                                                
                        'type': 'toolbox',
+                                                                               
                                                                                
                        'text': '',
+                                                                               
                                                                                
                        'enabled': 'true',
+                                                                               
                                                                                
                        'children': [
+                                                                               
                                                                                
                                {
+                                                                               
                                                                                
                                        'type': 'toolitem',
+                                                                               
                                                                                
                                        'text': _('Insert Column Break'),
+                                                                               
                                                                                
                                        'command': '.uno:InsertColumnBreak'
+                                                                               
                                                                                
                                }
+                                                                               
                                                                                
                        ]
+                                                                               
                                                                                
                }
+                                                                               
                                                                                
        ]
+                                                                               
                                                                                
},
+                                                                               
                                                                                
{
+                                                                               
                                                                                
        'id': 'delete-Section',
+                                                                               
                                                                                
        'type': 'container',
+                                                                               
                                                                                
        'text': '',
+                                                                               
                                                                                
        'enabled': 'true',
+                                                                               
                                                                                
        'vertical': 'true',
+                                                                               
                                                                                
        'children': [
+                                                                               
                                                                                
                {
+                                                                               
                                                                                
                        'id': 'Section7',
+                                                                               
                                                                                
                        'type': 'toolbox',
+                                                                               
                                                                                
                        'text': '',
+                                                                               
                                                                                
                        'enabled': 'true',
+                                                                               
                                                                                
                        'children': [
+                                                                               
                                                                                
                                {
+                                                                               
                                                                                
                                        'type': 'toolitem',
+                                                                               
                                                                                
                                        'text': _('Delete Rows'),
+                                                                               
                                                                                
                                        'command': '.uno:DeleteRows'
+                                                                               
                                                                                
                                }
+                                                                               
                                                                                
                        ]
+                                                                               
                                                                                
                },
+                                                                               
                                                                                
                {
+                                                                               
                                                                                
                        'id': 'Section10',
+                                                                               
                                                                                
                        'type': 'toolbox',
+                                                                               
                                                                                
                        'text': '',
+                                                                               
                                                                                
                        'enabled': 'true',
+                                                                               
                                                                                
                        'children': [
+                                                                               
                                                                                
                                {
+                                                                               
                                                                                
                                        'type': 'toolitem',
+                                                                               
                                                                                
                                        'text': _('Delete Columns'),
+                                                                               
                                                                                
                                        'command': '.uno:DeleteColumns'
+                                                                               
                                                                                
                                }
+                                                                               
                                                                                
                        ]
+                                                                               
                                                                                
                }
+                                                                               
                                                                                
        ]
+                                                                               
                                                                                
},
+                                                                               
                                                                                
{
+                                                                               
                                                                                
        'id': 'deletebreak-Section',
+                                                                               
                                                                                
        'type': 'container',
+                                                                               
                                                                                
        'text': '',
+                                                                               
                                                                                
        'enabled': 'true',
+                                                                               
                                                                                
        'vertical': 'true',
+                                                                               
                                                                                
        'children': [
+                                                                               
                                                                                
                {
+                                                                               
                                                                                
                        'id': 'Section7',
+                                                                               
                                                                                
                        'type': 'toolbox',
+                                                                               
                                                                                
                        'text': '',
+                                                                               
                                                                                
                        'enabled': 'true',
+                                                                               
                                                                                
                        'children': [
+                                                                               
                                                                                
                                {
+                                                                               
                                                                                
                                        'type': 'toolitem',
+                                                                               
                                                                                
                                        'text': _('Remove Row Break'),
+                                                                               
                                                                                
                                        'command': '.uno:DeleteRowbreak'
+                                                                               
                                                                                
                                }
+                                                                               
                                                                                
                        ]
+                                                                               
                                                                                
                },
+                                                                               
                                                                                
                {
+                                                                               
                                                                                
                        'id': 'Section10',
+                                                                               
                                                                                
                        'type': 'toolbox',
+                                                                               
                                                                                
                        'text': '',
+                                                                               
                                                                                
                        'enabled': 'true',
+                                                                               
                                                                                
                        'children': [
+                                                                               
                                                                                
                                {
+                                                                               
                                                                                
                                        'type': 'toolitem',
+                                                                               
                                                                                
                                        'text': _('Remove Column Break'),
+                                                                               
                                                                                
                                        'command': '.uno:DeleteColumnbreak'
+                                                                               
                                                                                
                                }
+                                                                               
                                                                                
                        ]
+                                                                               
                                                                                
                }
+                                                                               
                                                                                
        ]
+                                                                               
                                                                                
},
+                                                                               
                                                                        ]
+                                                                               
                                                                }
+                                                                               
                                                        ]
+                                                                               
                                                }
+                                                                               
                                        ]
+                                                                               
                                }
+                                                                               
                        ]
+                                                                               
                }
+                                                                               
        ]
+                                                                               
}
+                                                                       ]
+                                                               }
+                                                       ]
+                                               }
+                                       ]
+                               }
+                       ]
+               };
        }
 });
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to