[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-2-1' - 2 commits - loleaflet/dist loleaflet/src

Henry Castro hcastro at collabora.com
Wed Oct 4 03:39:54 UTC 2017


 loleaflet/dist/toolbar/toolbar.js        |    6 ++---
 loleaflet/src/control/Control.Menubar.js |   32 ++++++++++++++++++++++---------
 2 files changed, 26 insertions(+), 12 deletions(-)

New commits:
commit 20bfde7bb27e7c77013135f565c366e7fad56ba0
Author: Henry Castro <hcastro at collabora.com>
Date:   Tue Oct 3 20:09:54 2017 -0400

    loleaflet: add more menus for the Writer spell checking
    
    Change-Id: I3ef19021f0cb44aa2c34c84af08f2af2d11b25a2

diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index 8744585d..501d678c 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -175,7 +175,13 @@ L.Control.Menubar = L.Control.extend({
 			{name: _('Tools'), id: 'tools', type: 'menu', menu: [
 				{name: _('Automatic Spell Checking'), type: 'unocommand', uno: '.uno:SpellOnline'},
 				{name: _('Language'), type: 'menu', menu: [
-					{name: _('Reset to Default Language'), id: 'resetlanguage', type: 'unocommand', uno:'.uno:LanguageStatus?Language:string=Default_RESET_LANGUAGES'}]}
+					{name: _('For Selection'), type: 'menu', menu: [
+						{name: _('Reset to Default Language'), id: 'resetselection', type: 'unocommand', uno: '.uno:LanguageStatus?Language:string=Current_RESET_LANGUAGES'}]},
+					{name: _('For Paragraph'), type: 'menu', menu: [
+						{name: _('Reset to Default Language'), id: 'resetparagraph', type: 'unocommand', uno: '.uno:LanguageStatus?Language:string=Paragraph_RESET_LANGUAGES'}]},
+					{name: _('For all Text'), type: 'menu', menu: [
+						{name: _('Reset to Default Language'), id: 'resetlanguage', type: 'unocommand', uno:'.uno:LanguageStatus?Language:string=Default_RESET_LANGUAGES'}]}
+				]}
 			]},
 			{name: _('Help'), id: 'help', type: 'menu', menu: [
 				{name: _('Keyboard shortcuts'), id: 'keyboard-shortcuts', type: 'action'},
@@ -343,17 +349,25 @@ L.Control.Menubar = L.Control.extend({
 		this._menubarCont.insertBefore(liItem, this._menubarCont.firstChild);
 	},
 
+	_createLangMenuItem: function (lang, command) {
+		var liItem, aItem;
+		liItem = L.DomUtil.create('li', '');
+		aItem = L.DomUtil.create('a', '', liItem);
+		$(aItem).text(lang);
+		$(aItem).data('type', 'unocommand');
+		$(aItem).data('uno', '.uno:LanguageStatus?Language:string=' + command);
+		return liItem;
+	},
+
 	_onInitMenu: function (e) {
 		if (e.commandName === '.uno:LanguageStatus') {
-			var liItem, aItem;
-			$menuParent = $('#menu-resetlanguage').parent();
+			$menuSelection = $('#menu-resetselection').parent();
+			$menuParagraph = $('#menu-resetparagraph').parent();
+			$menuDefault = $('#menu-resetlanguage').parent();
 			for (var lang in e.commandValues) {
-				liItem = L.DomUtil.create('li', '');
-				aItem = L.DomUtil.create('a', '', liItem);
-				$(aItem).text(e.commandValues[lang]);
-				$(aItem).data('type', 'unocommand');
-				$(aItem).data('uno', '.uno:LanguageStatus?Language:string=' + encodeURIComponent('Default_' + e.commandValues[lang]));
-				$menuParent.append(liItem);
+				$menuSelection.append(this._createLangMenuItem(e.commandValues[lang], encodeURIComponent('Current_' + e.commandValues[lang])));
+				$menuParagraph.append(this._createLangMenuItem(e.commandValues[lang], encodeURIComponent('Paragraph_' + e.commandValues[lang])));
+				$menuDefault.append(this._createLangMenuItem(e.commandValues[lang], encodeURIComponent('Default_' + e.commandValues[lang])));
 			}
 		}
 	},
commit 83889ab84c82b9d457d045433645e4040f8447e1
Author: Henry Castro <hcastro at collabora.com>
Date:   Tue Oct 3 19:54:16 2017 -0400

    loleaflet: change position of the language status bar item
    
    Change-Id: If5f7ad59e3ef4694313c086ad473af0cc377ea9c

diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index 0cd61a09..09c81ccc 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -660,9 +660,6 @@ $(function () {
 			{type: 'button',  id: 'cancelsearch', img: 'cancel', hint: _('Cancel the search'), hidden: true},
 			{type: 'html',  id: 'left'},
 			{type: 'html',  id: 'right'},
-			{type: 'html',  id: 'LanguageStatus',
-			 html: '<div id="LanguageStatus" class="loleaflet-font" title="'+_('Text Language')+ '" style="padding: 5px 5px;">    &nbsp</div>' },
-			{type: 'break', id: 'languagestatusbreak'},
 			{type: 'html',    id: 'modifiedstatuslabel', html: '<div id="modifiedstatuslabel" class="loleaflet-font"></div>'},
 			{type: 'break', id: 'modifiedstatuslabelbreak'},
 			{type: 'drop', id: 'userlist', text: _('No users'), html: '<div id="userlist_container"><table id="userlist_table"><tbody></tbody></table></div>' },
@@ -1019,6 +1016,9 @@ map.on('doclayerinit', function () {
 			{type: 'break', id:'break6'},
 			{type: 'html',  id: 'SelectionMode',
 				html: '<div id="StatusSelectionMode" class="loleaflet-font" title="'+_('Selection Mode')+ '" style="padding: 5px 5px;">    &nbsp</div>' },
+			{type: 'break', id:'break7'},
+			{type: 'html',  id: 'LanguageStatus',
+				html: '<div id="LanguageStatus" class="loleaflet-font" title="'+_('Text Language')+ '" style="padding: 5px 5px;">    &nbsp</div>' }
 		]);
 
 		// Remove irrelevant toolbars


More information about the Libreoffice-commits mailing list