[Libreoffice-commits] online.git: Branch 'libreoffice-5-3' - 2 commits - loleaflet/dist

Henry Castro hcastro at collabora.com
Mon Mar 27 01:22:21 UTC 2017


 loleaflet/dist/toolbar/toolbar.js |   24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

New commits:
commit 9a9b6e05c115a8bc766f6330080f5c30db00736c
Author: Henry Castro <hcastro at collabora.com>
Date:   Tue Dec 20 14:41:37 2016 -0400

    tdf#103776: Hide/Deactivate "Document repair" button
    
    (cherry picked from commit 9450f3938c16a35a7d261c31d830781782697797)
    
    Change-Id: I1a4077534327aea8032fe9d48d951a824cb81113
    Reviewed-on: https://gerrit.libreoffice.org/35478
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index 1cefc8ae..819404f5 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -1060,6 +1060,14 @@ map.on('commandstatechanged', function (e) {
 			}
 		}
 	}
+
+	if (id === 'undo' || id === 'redo') {
+		if (toolbar.get('undo').disabled && toolbar.get('redo').disabled) {
+			toolbar.disable('repair');
+		} else {
+			toolbar.enable('repair');
+		}
+	}
 });
 
 map.on('search', function (e) {
commit 2c32ca0ecc361e1b38a91f5c855ca6594cad4057
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Fri Jan 6 14:42:27 2017 +0530

    loleaflet: Make id of these toolbar items consistent with others
    
    We assume that id of the toolbar item is lowercase(unocommand),
    so lets keep it consistent too for alignment buttons.
    
    This also makes alignment buttons toggle except for spreadsheet
    where alignment of cell text happens via a different uno command,
    HorizontalAlignment.
    
    Change-Id: Ibacf06bd99435cd24b27c7870173a2519b167af1
    Reviewed-on: https://gerrit.libreoffice.org/35477
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index 23c62410..1cefc8ae 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -368,10 +368,10 @@ $(function () {
 			{type: 'html',  id: 'backcolor-html', html: '<input id="backColorPicker" style="display:none;">'},
 			{type: 'button',  id: 'backcolor', img: 'backcolor', hint: _('Highlighting')},
 			{type: 'break'},
-			{type: 'button',  id: 'alignleft',  img: 'alignleft', hint: _('Align left'), uno: 'LeftPara', unosheet: 'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", "value":"1"}}'},
-			{type: 'button',  id: 'alignhorizontal',  img: 'alignhorizontal', hint: _('Center horizontally'), uno: 'CenterPara', unosheet: 'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", "value":"2"}}'},
-			{type: 'button',  id: 'alignright',  img: 'alignright', hint: _('Align right'), uno: 'RightPara', unosheet: 'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", "value":"3"}}'},
-			{type: 'button',  id: 'alignblock',  img: 'alignblock', hint: _('Justified'), uno: 'JustifyPara', unosheet: 'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", "value":"4"}}'},
+			{type: 'button',  id: 'leftpara',  img: 'alignleft', hint: _('Align left'), uno: 'LeftPara', unosheet: 'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", "value":"1"}}'},
+			{type: 'button',  id: 'centerpara',  img: 'alignhorizontal', hint: _('Center horizontally'), uno: 'CenterPara', unosheet: 'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", "value":"2"}}'},
+			{type: 'button',  id: 'rightpara',  img: 'alignright', hint: _('Align right'), uno: 'RightPara', unosheet: 'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", "value":"3"}}'},
+			{type: 'button',  id: 'justifypara',  img: 'alignblock', hint: _('Justified'), uno: 'JustifyPara', unosheet: 'HorizontalAlignment {"HorizontalAlignment":{"type":"unsigned short", "value":"4"}}'},
 			{type: 'break',  id: 'wraptextseparator'},
 			{type: 'button',  id: 'wraptext',  img: 'wraptext', hint: _('Wrap Text'), uno: 'WrapText'},
 			{type: 'button',  id: 'togglemergecells',  img: 'togglemergecells', hint: _('Merge and Center Cells'), uno: 'ToggleMergeCells'},
@@ -588,6 +588,11 @@ function toLocalePattern (pattern, regex, text, sub1, sub2) {
 	return text;
 }
 
+function unoCmdToToolbarId(commandname)
+{
+	return commandname.toLowerCase().substr(5);
+}
+
 function selectItem(item, func)
 {
 	var index = -1;
@@ -873,6 +878,7 @@ map.on('commandstatechanged', function (e) {
 	var found = false;
 	var value, color, div;
 	var matches;
+
 	if (commandName === '.uno:AssignLayout') {
 		$('.styles-select').val(state).trigger('change');
 	} else if (commandName === '.uno:StyleApply') {
@@ -1016,7 +1022,7 @@ map.on('commandstatechanged', function (e) {
 		$('#PageStatus').html(state ? state : '    &nbsp');
 	}
 
-	var id = commandName.toLowerCase().substr(5);
+	var id = unoCmdToToolbarId(commandName);
 	if (typeof formatButtons[id] !== 'undefined') {
 		if (state === 'true') {
 			toolbar.enable(id);


More information about the Libreoffice-commits mailing list