loleaflet/dist/toolbar/toolbar.js        |   16 +---------------
 loleaflet/src/control/Control.Menubar.js |   25 +++++++++----------------
 loleaflet/src/control/Toolbar.js         |   27 +++++++++++++++++++++++++++
 3 files changed, 37 insertions(+), 31 deletions(-)

New commits:
commit b460769eedd47cdbe3694db140acdafa61f5d86f
Author: Pranav Kant <pran...@collabora.com>
Date:   Tue Jun 21 19:16:20 2016 +0530

    loleaflet: 'Keyboard shortcuts' in new 'Help' menubar item
    
    Change-Id: I0a924505970e9ed13ea45ebc85ef14a618646b2d

diff --git a/loleaflet/dist/toolbar/toolbar.js 
b/loleaflet/dist/toolbar/toolbar.js
index 67f7ee3..9417931 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -211,21 +211,7 @@ function onClick(id) {
                resizeToolbar();
        }
        else if (id === 'help') {
-               var w = window.innerWidth / 2;
-               var h = window.innerHeight / 2;
-               $.modal('<iframe src="/loleaflet/dist/loleaflet-help.html" 
width="' + w + '" height="' + h + '" style="border:0">', {
-                       overlayClose:true,
-                       opacity: 80,
-                       overlayCss: {
-                               backgroundColor : '#000'
-                       },
-                       containerCss: {
-                               overflow : 'hidden',
-                               backgroundColor : '#fff',
-                               padding : '20px',
-                               border : '2px solid #000'
-                       }
-               });
+               map.showLOKeyboardHelp();
        }
        else if (id === 'close') {
                window.parent.postMessage('close', '*');
diff --git a/loleaflet/src/control/Control.Menubar.js 
b/loleaflet/src/control/Control.Menubar.js
index 8ac4e25..b62a1a2 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -46,7 +46,8 @@ L.Control.Menubar = L.Control.extend({
                                                                                
                                                                                
                {name: _('Cell'), type: 'unocommand', uno: '.uno:EntireCell'}]},
                                                                                
                  {name: _('Merge cells'), type: 'unocommand', uno: 
'.uno:MergeCells'}]
                        },
-                       {name: _('Help'), type: 'menu', menu: [{name: 
_('About'), id: 'about', type: 'action'}]
+                       {name: _('Help'), type: 'menu', menu: [{name: 
_('Keyboard shortcuts'), id: 'keyboard-shortcuts', type: 'action'},
+                                                              {name: 
_('About'), id: 'about', type: 'action'}]
                        }
                ],
 
@@ -90,7 +91,8 @@ L.Control.Menubar = L.Control.extend({
                                                                                
                 {type: 'separator'},
                                                                                
                 {name: _('Fullscreen presentation'), id: 
'fullscreen-presentation', type: 'action'}]
                        },
-                       {name: _('Help'), type: 'menu', menu: [{name: 
_('About'), id: 'about', type: 'action'}]
+                       {name: _('Help'), type: 'menu', menu: [{name: 
_('Keyboard shortcuts'), id: 'keyboard-shortcuts', type: 'action'},
+                                                              {name: 
_('About'), id: 'about', type: 'action'}]
                        }
                ],
 
@@ -128,7 +130,8 @@ L.Control.Menubar = L.Control.extend({
                                                                                
                 {name: _('Delete row'), type: 'unocommand', uno: 
'.uno:DeleteRows'},
                                                                                
                 {name: _('Delete column'), type: 'unocommand', uno: 
'.uno:DeleteColumns'}]
                        },
-                       {name: _('Help'), type: 'menu', menu: [{name: 
_('About'), id: 'about', type: 'action'}]
+                       {name: _('Help'), type: 'menu', menu: [{name: 
_('Keyboard shortcuts'), id: 'keyboard-shortcuts', type: 'action'},
+                                                              {name: 
_('About'), id: 'about', type: 'action'}]
                        }
                ],
 
@@ -298,19 +301,9 @@ L.Control.Menubar = L.Control.extend({
                                callback: this._onDeleteSlide
                        }, this);
                } else if (id === 'about') {
-                       $('#about-dialog').modal({
-                               overlayClose:true,
-                               opacity: 80,
-                               overlayCss: {
-                                       backgroundColor : '#000'
-                               },
-                               containerCss: {
-                                       overflow : 'hidden',
-                                       backgroundColor : '#fff',
-                                       padding : '20px',
-                                       border : '2px solid #000'
-                               }
-                       });
+                       map.showLOAboutDialog();
+               } else if (id === 'keyboard-shortcuts') {
+                       map.showLOKeyboardHelp();
                }
        },
 
diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index 5ec6050..3f6f220 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -1,6 +1,8 @@
 /*
  * Toolbar handler
  */
+
+/* global $ window */
 L.Map.include({
 
        // a mapping of uno commands to more readable toolbar items
@@ -9,6 +11,20 @@ L.Map.include({
                '.uno:CharFontName'
        ],
 
+       _modalDialogOptions: {
+               overlayClose:true,
+               opacity: 80,
+               overlayCss: {
+                       backgroundColor : '#000'
+               },
+               containerCss: {
+                       overflow : 'hidden',
+                       backgroundColor : '#fff',
+                       padding : '20px',
+                       border : '2px solid #000'
+               }
+       },
+
        applyFont: function (fontName) {
                if (this.getPermission() === 'edit') {
                        var msg = 'uno .uno:CharFontName {' +
@@ -135,5 +151,16 @@ L.Map.include({
 
        renderFont: function (fontName) {
                this._socket.sendMessage('renderfont font=' + 
window.encodeURIComponent(fontName));
+       },
+
+       showLOKeyboardHelp: function() {
+               var w = window.innerWidth / 2;
+               var h = window.innerHeight / 2;
+               $.modal('<iframe src="/loleaflet/dist/loleaflet-help.html" 
width="' + w + '" height="' + h + '" style="border:0">',
+                       this._modalDialogOptions);
+       },
+
+       showLOAboutDialog: function() {
+               $('#about-dialog').modal(this._modalDialogOptions);
        }
 });
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to