summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-05-08 11:18:54 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2020-05-08 14:02:21 +0200
commit9d5c80c6fdcbdfab2d37e963dd36fe7643076b35 (patch)
tree85e736f7a9cffb2b5fcacb20f697b1b73436b278
parentnotebookbar: add shortcuts toolbar (diff)
downloadonline-9d5c80c6fdcbdfab2d37e963dd36fe7643076b35.tar.gz
online-9d5c80c6fdcbdfab2d37e963dd36fe7643076b35.zip
notebookbar: custom shortcuts for impress
Change-Id: I5a2803091522e20416a6ba05f968590d7d105b0a Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93708 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r--loleaflet/images/lc_presentation.svg1
-rw-r--r--loleaflet/src/control/Control.NotebookbarBuilder.js11
-rw-r--r--loleaflet/src/control/Control.NotebookbarImpress.js31
3 files changed, 42 insertions, 1 deletions
diff --git a/loleaflet/images/lc_presentation.svg b/loleaflet/images/lc_presentation.svg
new file mode 100644
index 0000000000..f7d561a225
--- /dev/null
+++ b/loleaflet/images/lc_presentation.svg
@@ -0,0 +1 @@
+<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m2 6v15h11.601562a5.5 5.5 0 0 1 -.390624-1h-10.210938v-13h18v6.607422a5.5 5.5 0 0 1 1 .652344v-8.259766z" fill="#808080"/><path d="m1 3h22v2h-22z" fill="#4d82b8"/><path d="m3 7v13h10.210938a5.5 5.5 0 0 1 -.210938-1.5 5.5 5.5 0 0 1 5.5-5.5 5.5 5.5 0 0 1 2.5.607422v-6.607422z" fill="#fff"/><path d="m18.5 14a4.5 4.5 0 0 0 -4.5 4.5 4.5 4.5 0 0 0 4.5 4.5 4.5 4.5 0 0 0 4.5-4.5 4.5 4.5 0 0 0 -4.5-4.5zm0 1a3.5 3.5 0 0 1 3.5 3.5 3.5 3.5 0 0 1 -3.5 3.5 3.5 3.5 0 0 1 -3.5-3.5 3.5 3.5 0 0 1 3.5-3.5z" fill="#808080"/><circle cx="18.5" cy="18.5" fill="#fff" r="3.5"/><path d="m17 21 4-2.5-4-2.5z" fill="#4d82b8" fill-rule="evenodd"/><path d="m5 9h14v2h-14z" fill="#eac282"/></svg> \ No newline at end of file
diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js b/loleaflet/src/control/Control.NotebookbarBuilder.js
index 237e9c497c..4a91b8e56c 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -40,6 +40,7 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
this._toolitemHandlers['.uno:BasicShapes'] = this._shapesControl;
this._toolitemHandlers['.uno:ConditionalFormatMenu'] = this._conditionalFormatControl;
this._toolitemHandlers['.uno:SetDefault'] = this._clearFormattingControl;
+ this._toolitemHandlers['.uno:Presentation'] = this._startPresentationControl;
this._toolitemHandlers['.uno:SelectWidth'] = function() {};
this._toolitemHandlers['.uno:SetOutline'] = function() {};
@@ -91,7 +92,6 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
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() {};
@@ -380,6 +380,15 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
});
},
+ _startPresentationControl: function(parentContainer, data, builder) {
+ var control = builder._unoToolButton(parentContainer, data, builder);
+
+ $(control.container).unbind('click');
+ $(control.container).click(function () {
+ builder.map.fire('fullscreen');
+ });
+ },
+
build: function(parent, data, hasVerticalParent, parentHasManyChildren) {
this._amendJSDialogData(data);
diff --git a/loleaflet/src/control/Control.NotebookbarImpress.js b/loleaflet/src/control/Control.NotebookbarImpress.js
index d1a9830148..f36ae85113 100644
--- a/loleaflet/src/control/Control.NotebookbarImpress.js
+++ b/loleaflet/src/control/Control.NotebookbarImpress.js
@@ -6,6 +6,37 @@
/* global */
L.Control.NotebookbarImpress = L.Control.NotebookbarWriter.extend({
+ getShortcutsBarData: function() {
+ return [
+ {
+ 'id': 'shortcutstoolbox',
+ 'type': 'toolbox',
+ 'children': [
+ {
+ 'type': 'toolitem',
+ 'text': 'Save',
+ 'command': '.uno:Save'
+ },
+ {
+ 'type': 'toolitem',
+ 'text': 'Start Presentation',
+ 'command': '.uno:Presentation'
+ },
+ {
+ 'type': 'toolitem',
+ 'text': 'Undo',
+ 'command': '.uno:Undo'
+ },
+ {
+ 'type': 'toolitem',
+ 'text': 'Redo',
+ 'command': '.uno:Redo'
+ }
+ ]
+ }
+ ];
+ },
+
selectedTab: function(tabText) {
switch (tabText) {
case 'HomeLabel':