[Libreoffice-commits] online.git: loleaflet/css loleaflet/src scripts/unocommands.py
Szymon KÅos (via logerrit)
logerrit at kemper.freedesktop.org
Thu Aug 6 06:16:38 UTC 2020
loleaflet/css/notebookbar.css | 25 -
loleaflet/src/control/Control.NotebookbarWriter.js | 461 ++++++++++++++++++++-
loleaflet/src/layer/tile/TileLayer.js | 1
loleaflet/src/unocommands.js | 11
scripts/unocommands.py | 20
5 files changed, 505 insertions(+), 13 deletions(-)
New commits:
commit 9dd57f8fe1355059156310af8eb0ac26b800c61e
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Aug 5 15:54:28 2020 +0200
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Thu Aug 6 08:16:19 2020 +0200
notebookbar: customize Insert tab in Writer
Change-Id: I531854b4c7361fe5802a64016886feab5cda8979
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100177
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/loleaflet/css/notebookbar.css b/loleaflet/css/notebookbar.css
index 70805ca81..ef1aa46e1 100644
--- a/loleaflet/css/notebookbar.css
+++ b/loleaflet/css/notebookbar.css
@@ -190,7 +190,9 @@ div[id*='Row'].notebookbar, div[id*='Column'].notebookbar, #SendToBack.notebookb
}
/* avoid bug with arrow in new line when window is small */
-#LineSpacing.notebookbar, #InsertGraphic.notebookbar, #BasicShapes.notebookbar, #InsertTable.notebookbar {
+#LineSpacing.notebookbar,
+#table-Home-Section-Insert #table-LineB9 #InsertGraphic.notebookbar,
+#table-Home-Section-Insert #table-GroupB20 #InsertTable.notebookbar {
width: 50px;
}
@@ -397,13 +399,20 @@ div[id*='Row'].notebookbar, div[id*='Column'].notebookbar, #SendToBack.notebookb
/* Insert Tab */
#InsertReferenceField.notebookbar,
-#InsertSection.notebookbar,
-#table-Insert {
+#InsertSection.notebookbar {
margin-top: 5px;
}
-#table-shapes6 #BasicShapes.notebookbar {
- margin-top: 10px;
+#table-Insert {
+ margin-top: 15px;
+}
+
+#table-Insert #InsertTable.notebookbar {
+ width: 130px;
+}
+
+#table-Insert #BasicShapes.notebookbar {
+ width: 170px;
}
#table-Insert-Section-Pagebreak #InsertPagebreak.notebookbar img,
@@ -412,8 +421,6 @@ div[id*='Row'].notebookbar, div[id*='Column'].notebookbar, #SendToBack.notebookb
#table-Insert-Section-Image #InsertGraphic.notebookbar img,
#HyperlinkDialog.notebookbar img,
#InsertFieldCtrl.notebookbar img,
-#DrawText.notebookbar img,
-#VerticalText.notebookbar img,
#BasicShapes.notebookbar img,
#table-Insert-Section-Symbol #CharmapControl.notebookbar img
{
@@ -464,8 +471,8 @@ div[id*='Row'].notebookbar, div[id*='Column'].notebookbar, #SendToBack.notebookb
}
#InsertMultiIndex.notebookbar img,
-#InsertFootnote.notebookbar img,
-#InsertReferenceField.notebookbar img,
+#table-Reference-Section-Reference #InsertFootnote.notebookbar img,
+#table-Reference-Section-Reference #InsertReferenceField.notebookbar img,
#InsertAuthoritiesEntry.notebookbar img,
#UpdateAll.notebookbar img
{
diff --git a/loleaflet/src/control/Control.NotebookbarWriter.js b/loleaflet/src/control/Control.NotebookbarWriter.js
index 4bd748a97..eb3002beb 100644
--- a/loleaflet/src/control/Control.NotebookbarWriter.js
+++ b/loleaflet/src/control/Control.NotebookbarWriter.js
@@ -21,8 +21,8 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
},
{
'text': _('~Insert'),
- 'id': '3',
- 'name': 'InsertLabel'
+ 'id': '-4',
+ 'name': 'Insert'
},
{
'text': _('~Layout'),
@@ -77,6 +77,10 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
case 'Format':
this.loadTab(this.getFormatTab());
break;
+
+ case 'Insert':
+ this.loadTab(this.getInsertTab());
+ break;
}
},
@@ -2076,6 +2080,459 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
}
]
};
+ },
+
+ getInsertTab: 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',
+ 'children': [
+ {
+ 'id': '',
+ 'type': 'tabpage',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'id': 'Insert Tab',
+ 'type': 'container',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'id': 'Insert',
+ 'type': 'container',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'id': 'SectionBottom70',
+ 'type': 'toolbox',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'type': 'bigtoolitem',
+ 'text': _UNO('.uno:InsertPagebreak', 'text'),
+ 'command': '.uno:InsertPagebreak'
+ }
+ ]
+ },
+ {
+ 'id': 'Insert-Section-Pagebreak1',
+ 'type': 'container',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'id': 'GroupB29',
+ 'type': 'container',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'id': 'LineA15',
+ 'type': 'toolbox',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'type': 'toolitem',
+ 'text': _UNO('.uno:TitlePageDialog', 'text'),
+ 'command': '.uno:TitlePageDialog'
+ }
+ ]
+ },
+ {
+ 'id': 'LineB16',
+ 'type': 'toolbox',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'type': 'toolitem',
+ 'text': _UNO('.uno:InsertSection', 'text'),
+ 'command': '.uno:InsertSection'
+ }
+ ]
+ }
+ ],
+ 'vertical': 'true'
+ }
+ ],
+ 'vertical': 'false'
+ },
+ {
+ 'id': 'Insert-Section-Endnote',
+ 'type': 'container',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'id': 'GroupB292',
+ 'type': 'container',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'id': 'LineA152',
+ 'type': 'toolbox',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'type': 'toolitem',
+ 'text': _UNO('.uno:InsertFootnote', 'text'),
+ 'command': '.uno:InsertFootnote'
+ }
+ ]
+ },
+ {
+ 'id': 'LineB162',
+ 'type': 'toolbox',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'type': 'toolitem',
+ 'text': _UNO('.uno:InsertEndnote', 'text'),
+ 'command': '.uno:InsertEndnote'
+ }
+ ]
+ }
+ ],
+ 'vertical': 'true'
+ }
+ ],
+ 'vertical': 'false'
+ },
+ {
+ 'id': 'Insert-Section-HeaderFoorter',
+ 'type': 'container',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'id': 'GroupB291',
+ 'type': 'container',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'id': 'LineA151',
+ 'type': 'toolbox',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'type': 'toolitem',
+ 'text': _UNO('.uno:InsertPageHeader', 'text'),
+ 'command': '.uno:InsertPageHeader'
+ }
+ ]
+ },
+ {
+ 'id': 'LineB161',
+ 'type': 'toolbox',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'type': 'toolitem',
+ 'text': _UNO('.uno:InsertPageFooter', 'text'),
+ 'command': '.uno:InsertPageFooter'
+ }
+ ]
+ }
+ ],
+ 'vertical': 'true'
+ }
+ ],
+ 'vertical': 'false'
+ },
+ {
+ 'id': 'Insert-Section-Table',
+ 'type': 'container',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'id': 'SectionBottom12',
+ 'type': 'toolbox',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'type': 'bigtoolitem',
+ 'text': _UNO('.uno:InsertTable', 'text'),
+ 'command': '.uno:InsertTable'
+ }
+ ]
+ }
+ ],
+ 'vertical': 'false'
+ },
+ {
+ 'id': 'Insert-Section-Table1',
+ 'type': 'container',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'id': 'LineA11',
+ 'type': 'toolbox',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'type': 'bigtoolitem',
+ 'text': _UNO('.uno:InsertObjectChart'),
+ 'command': '.uno:InsertObjectChart'
+ }
+ ]
+ }
+ ],
+ 'vertical': 'false'
+ },
+ {
+ 'id': 'Insert-Section-Image',
+ 'type': 'container',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'id': 'SectionBottom65',
+ 'type': 'toolbox',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'type': 'bigtoolitem',
+ 'text': _UNO('.uno:InsertGraphic'),
+ 'command': '.uno:InsertGraphic'
+ }
+ ]
+ }
+ ],
+ 'vertical': 'false'
+ },
+ {
+ 'id': 'Insert-Section-Bookmark',
+ 'type': 'container',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'id': 'SectionBottom14',
+ 'type': 'toolbox',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'type': 'bigtoolitem',
+ 'text': _UNO('.uno:HyperlinkDialog'),
+ 'command': '.uno:HyperlinkDialog'
+ }
+ ]
+ }
+ ],
+ 'vertical': 'false'
+ },
+ {
+ 'id': 'Insert-Section-Bookmark1',
+ 'type': 'container',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'id': 'GroupB27',
+ 'type': 'container',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'id': 'LineA13',
+ 'type': 'toolbox',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'type': 'toolitem',
+ 'text': _UNO('.uno:InsertBookmark', 'text'),
+ 'command': '.uno:InsertBookmark'
+ }
+ ]
+ },
+ {
+ 'id': 'LineB14',
+ 'type': 'toolbox',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'type': 'toolitem',
+ 'text': _UNO('.uno:InsertReferenceField', 'text'),
+ 'command': '.uno:InsertReferenceField'
+ }
+ ]
+ }
+ ],
+ 'vertical': 'true'
+ }
+ ],
+ 'vertical': 'false'
+ },
+ {
+ 'id': 'SectionBottom11',
+ 'type': 'toolbox',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'type': 'bigtoolitem',
+ 'text': _UNO('.uno:InsertFieldCtrl', 'text'),
+ 'command': '.uno:InsertFieldCtrl'
+ }
+ ]
+ },
+ {
+ 'id': 'Insert-Text',
+ 'type': 'container',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'id': 'GroupB293',
+ 'type': 'container',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'id': 'LineA153',
+ 'type': 'toolbox',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'type': 'toolitem',
+ 'text': _UNO('.uno:DrawText'),
+ 'command': '.uno:DrawText'
+ }
+ ]
+ },
+ {
+ 'id': 'LineB163',
+ 'type': 'toolbox',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'type': 'toolitem',
+ 'text': _UNO('.uno:VerticalText', 'text'),
+ 'command': '.uno:VerticalText'
+ }
+ ]
+ }
+ ],
+ 'vertical': 'true'
+ }
+ ],
+ 'vertical': 'false'
+ },
+ {
+ 'id': 'Insert-Section-Draw2',
+ 'type': 'container',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'id': 'shapes6',
+ 'type': 'toolbox',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'type': 'bigtoolitem',
+ 'text': _UNO('.uno:BasicShapes'),
+ 'command': '.uno:BasicShapes'
+ }
+ ]
+ }
+ ],
+ 'vertical': 'false'
+ },
+ {
+ 'id': 'Insert-Section-Symbol',
+ 'type': 'container',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'id': 'SectionBottom105',
+ 'type': 'toolbox',
+ 'text': '',
+ 'enabled': 'true',
+ 'children': [
+ {
+ 'type': 'bigtoolitem',
+ 'text': _UNO('.uno:CharmapControl'),
+ 'command': '.uno:CharmapControl'
+ }
+ ]
+ }
+ ],
+ 'vertical': 'false'
+ }
+ ],
+ 'vertical': 'false'
+ }
+ ],
+ 'vertical': 'false'
+ }
+ ]
+ }
+ ],
+ 'tabs': [],
+ 'selected': '-4'
+ }
+ ],
+ 'vertical': 'true',
+ 'left': '0',
+ 'top': '0'
+ }
+ ]
+ }
+ ],
+ 'vertical': 'true'
+ }
+ ]
+ };
}
});
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index e0f1b8d37..ad3d0a598 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1010,6 +1010,7 @@ L.TileLayer = L.GridLayer.extend({
},
_onJSDialogMsg: function (textMsg) {
+ console.log(textMsg);
if (window.mode.isMobile()) {
var msgData = JSON.parse(textMsg.substring('jsdialog:'.length + 1));
if (msgData.type == 'borderwindow')
diff --git a/loleaflet/src/unocommands.js b/loleaflet/src/unocommands.js
index 0d12241c6..5f52158ca 100644
--- a/loleaflet/src/unocommands.js
+++ b/loleaflet/src/unocommands.js
@@ -13,6 +13,7 @@ var unoCommandsArray = {
AutoFormatMenu:{text:{menu:_('AutoCorr~ect'),},},
BackColor:{text:{menu:_('Highlight Color'),},},
BackgroundColor:{global:{menu:_('Background Color'),},},
+ BasicShapes:{global:{context:_('Basic Shapes'),menu:_('Basic Shapes'),},},
Bold:{global:{menu:_('Bold'),},},
BringToFront:{global:{menu:_('~Bring to Front'),},},
CenterPara:{global:{context:_('Align Center'),menu:_('Center'),},},
@@ -23,6 +24,7 @@ var unoCommandsArray = {
ChangeCaseToToggleCase:{global:{menu:_('~tOGGLE cASE'),},},
ChangeCaseToUpper:{global:{menu:_('~UPPERCASE'),},},
ChangesMenu:{global:{menu:_('Track Chan~ges'),},},
+ CharmapControl:{global:{context:_('Insert Special Characters'),menu:_('Symbol'),},},
ClearOutline:{global:{menu:_('~Remove Outline'),},},
ColorScaleFormatDialog:{spreadsheet:{menu:_('Color Scale...'),},},
CommonAlignBottom:{global:{menu:_('Bottom'),},},
@@ -76,6 +78,7 @@ var unoCommandsArray = {
DiagramData:{global:{menu:_('~Data Table...'),},},
DiagramType:{global:{menu:_('Chart T~ype...'),},},
DownSearch:{global:{menu:_('Find Next'),},},
+ DrawText:{global:{context:_('Insert Text Box'),menu:_('~Text Box'),},},
DuplicateSlide:{presentation:{menu:_('Duplicate ~Slide'),},},
EditHeaderAndFooter:{spreadsheet:{menu:_('~Headers and Footers...'),},},
EditMenu:{global:{menu:_('~Edit'),},},
@@ -139,6 +142,7 @@ var unoCommandsArray = {
InsertAuthoritiesEntry:{text:{menu:_('~Bibliography Entry...'),},},
InsertAxis:{global:{menu:_('Insert Axis'),},},
InsertAxisTitle:{global:{menu:_('Insert Axis Title'),},},
+ InsertBookmark:{text:{context:_('Insert Bookmark'),menu:_('Bookmar~k...'),},},
InsertBreakMenu:{spreadsheet:{menu:_('Insert Page ~Break'),},},
InsertColumnBreak:{spreadsheet:{menu:_('~Column Break'),},text:{menu:_('Insert Column Break'),},},
InsertColumnsAfter:{presentation:{menu:_('Insert Column After'),},spreadsheet:{context:_('Insert Columns ~After'),menu:_('Columns ~After'),},text:{menu:_('Columns ~After'),},},
@@ -150,9 +154,10 @@ var unoCommandsArray = {
InsertDateField:{text:{menu:_('~Date'),},},
InsertDateFieldFix:{presentation:{menu:_('~Date (fixed)'),},},
InsertDateFieldVar:{presentation:{menu:_('Dat~e (variable)'),},},
- InsertEndnote:{text:{menu:_('~Endnote'),},},
+ InsertEndnote:{text:{context:_('Insert Endnote'),menu:_('~Endnote'),},},
InsertField:{text:{menu:_('~More Fields...'),},},
- InsertFootnote:{text:{menu:_('~Footnote'),},},
+ InsertFieldCtrl:{text:{context:_('Insert Field'),menu:_('Fiel~d'),},},
+ InsertFootnote:{text:{context:_('Insert Footnote'),menu:_('~Footnote'),},},
InsertGraphic:{global:{context:_('Insert Image...'),menu:_('~Image...'),},},
InsertHardHyphen:{global:{menu:_('Non-br~eaking hyphen'),},},
InsertHeaderFooterMenu:{text:{menu:_('He~ader and Footer'),},},
@@ -172,6 +177,7 @@ var unoCommandsArray = {
InsertPageNumberField:{global:{menu:_('~Page Numbers...'),},text:{menu:_('~Page Number'),},},
InsertPagebreak:{text:{menu:_('~Page Break'),},},
InsertRLM:{global:{menu:_('~Right-to-left mark'),},},
+ InsertReferenceField:{text:{context:_('Insert Cross-reference'),menu:_('Cross-reference...'),},},
InsertRemoveAxes:{global:{menu:_('Insert/Delete Axes...'),},},
InsertRowBreak:{spreadsheet:{menu:_('~Row Break'),},},
InsertRowsAfter:{presentation:{menu:_('Insert Row Below'),},spreadsheet:{context:_('Insert Rows ~Below'),menu:_('Rows ~Below'),},text:{menu:_('Rows ~Below'),},},
@@ -328,6 +334,7 @@ var unoCommandsArray = {
UpSearch:{global:{menu:_('Find Previous'),},},
UpdateCurIndex:{text:{context:_('Update index'),menu:_('Current ~Index'),},},
Validation:{spreadsheet:{menu:_('~Validity...'),},},
+ VerticalText:{global:{context:_('Insert Vertical Text'),menu:_('Vertical Text'),},},
View3D:{global:{menu:_('~3D View...'),},},
ViewMenu:{global:{menu:_('~View'),},},
Watermark:{text:{menu:_('Watermark...'),},},
diff --git a/scripts/unocommands.py b/scripts/unocommands.py
index 549216c7f..fe5ebd6b7 100755
--- a/scripts/unocommands.py
+++ b/scripts/unocommands.py
@@ -144,6 +144,26 @@ def extractToolbarCommands(path):
if line.find("_UNO(") >= 0:
commands += commandFromMenuLine(line)
+ f = open(path + '/loleaflet/src/control/Control.Notebookbar.js', 'r')
+ for line in f:
+ if line.find("_UNO(") >= 0:
+ commands += commandFromMenuLine(line)
+
+ f = open(path + '/loleaflet/src/control/Control.NotebookbarWriter.js', 'r')
+ for line in f:
+ if line.find("_UNO(") >= 0:
+ commands += commandFromMenuLine(line)
+
+ f = open(path + '/loleaflet/src/control/Control.NotebookbarCalc.js', 'r')
+ for line in f:
+ if line.find("_UNO(") >= 0:
+ commands += commandFromMenuLine(line)
+
+ f = open(path + '/loleaflet/src/control/Control.NotebookbarImpress.js', 'r')
+ for line in f:
+ if line.find("_UNO(") >= 0:
+ commands += commandFromMenuLine(line)
+
f = open(path + '/loleaflet/src/control/Control.PresentationBar.js', 'r')
for line in f:
if line.find("_UNO(") >= 0:
More information about the Libreoffice-commits
mailing list