[Libreoffice-commits] online.git: loleaflet/.eslintignore loleaflet/src

Pranav Kant pranavk at collabora.com
Thu Feb 18 19:33:58 UTC 2016


 loleaflet/.eslintignore                       |    1 +
 loleaflet/src/control/Control.Presentation.js |    2 +-
 loleaflet/src/control/Control.Styles.js       |    3 ++-
 loleaflet/src/control/Control.Tabs.js         |   15 +++++++++------
 loleaflet/src/control/Parts.js                |   24 ++++++++++++++++--------
 loleaflet/src/core/Socket.js                  |    1 +
 6 files changed, 30 insertions(+), 16 deletions(-)

New commits:
commit 10fcfdd210cbebdb9d5d3d6604aac07ff0c60ea5
Author: Pranav Kant <pranavk at collabora.com>
Date:   Fri Feb 19 01:02:17 2016 +0530

    loleaflet: Fix all ESLint errors
    
    And we are now finally in a clean state.
    
    Change-Id: Ifd949d925cc758a007d036e1de9df7dafd911c40

diff --git a/loleaflet/.eslintignore b/loleaflet/.eslintignore
index 546fb41..9474c51 100644
--- a/loleaflet/.eslintignore
+++ b/loleaflet/.eslintignore
@@ -1 +1,2 @@
 src/scrollbar
+src/contextMenu
diff --git a/loleaflet/src/control/Control.Presentation.js b/loleaflet/src/control/Control.Presentation.js
index c5b0b9e..e75cdad 100644
--- a/loleaflet/src/control/Control.Presentation.js
+++ b/loleaflet/src/control/Control.Presentation.js
@@ -2,7 +2,7 @@
  * L.Control.Presentation is used for common commands for slides.
  */
 
-/* global vex */
+/* global vex _ */
 L.Control.Presentation = L.Control.extend({
 	options: {
 		position: 'topleft'
diff --git a/loleaflet/src/control/Control.Styles.js b/loleaflet/src/control/Control.Styles.js
index 0691f4f..02965a5 100644
--- a/loleaflet/src/control/Control.Styles.js
+++ b/loleaflet/src/control/Control.Styles.js
@@ -84,8 +84,9 @@ L.Control.Styles = L.Control.extend({
 						var outlineLevel = style.split('Outline')[1];
 						var localeString = 'Outline'.toLocaleString() + outlineLevel;
 						item.innerHTML = localeString;
-					} else
+					} else {
 						item.innerHTML = style.toLocaleString();
+					}
 				});
 			}
 		}
diff --git a/loleaflet/src/control/Control.Tabs.js b/loleaflet/src/control/Control.Tabs.js
index b8022cb..4a27aa2 100644
--- a/loleaflet/src/control/Control.Tabs.js
+++ b/loleaflet/src/control/Control.Tabs.js
@@ -2,7 +2,7 @@
  * L.Control.Tabs is used to switch sheets in Calc
  */
 
-/* global $ */
+/* global $ vex _ */
 L.Control.Tabs = L.Control.extend({
 	onAdd: function (map) {
 		this._tabsInitialized = false;
@@ -15,10 +15,12 @@ L.Control.Tabs = L.Control.extend({
 			callback: function(key, options) {
 				var nPos = parseInt(options.$trigger.attr('id').split('spreadsheet-tab')[1]);
 
-				if (key === 'insertsheetbefore')
+				if (key === 'insertsheetbefore') {
 					map.insertPage(nPos);
-				if (key === 'insertsheetafter')
+				}
+				if (key === 'insertsheetafter') {
 					map.insertPage(nPos + 1);
+				}
 			},
 			items: {
 				'insertsheetbefore': {name: _('Insert sheet before this')},
@@ -29,19 +31,20 @@ L.Control.Tabs = L.Control.extend({
 							vex.dialog.confirm({
 								message: _('Are you sure you want to delete this sheet?'),
 								callback: function(data) {
-									if (data)
+									if (data) {
 										map.deletePage(nPos);
+									}
 								}
 							});
 						}
 				 },
 				'renamesheet': {name: _('Rename sheet'),
-							callback: function(key, options){
+							callback: function(key, options) {
 							var nPos = parseInt(options.$trigger.attr('id').split('spreadsheet-tab')[1]);
 							vex.dialog.open({
 								message: _('Enter new sheet name'),
 								input: '<input name="sheetname" type="text" required />',
-								callback: function(data){
+								callback: function(data) {
 									map.renamePage(data.sheetname, nPos);
 								}
 							});
diff --git a/loleaflet/src/control/Parts.js b/loleaflet/src/control/Parts.js
index 3ddc9fc..8325e7c 100644
--- a/loleaflet/src/control/Parts.js
+++ b/loleaflet/src/control/Parts.js
@@ -149,8 +149,9 @@ L.Map.include({
 	},
 
 	insertPage: function(nPos) {
-		if (this.getDocType() === 'presentation')
+		if (this.getDocType() === 'presentation') {
 			this._socket.sendMessage('uno .uno:InsertPage');
+		}
 		else if (this.getDocType() === 'spreadsheet') {
 			var command = {
 				'Name': {
@@ -165,8 +166,9 @@ L.Map.include({
 
 			this._socket.sendMessage('uno .uno:Insert ' + JSON.stringify(command));
 		}
-		else
+		else {
 			return;
+		}
 
 		var docLayer = this._docLayer;
 
@@ -178,10 +180,12 @@ L.Map.include({
 		docLayer._parts++;
 
 		// Since we know which part we want to set, use the index (instead of 'next', 'prev')
-		if (typeof nPos === 'number')
+		if (typeof nPos === 'number') {
 			this.setPart(nPos);
-		else
+		}
+		else {
 			this.setPart('next');
+		}
 	},
 
 	duplicatePage: function() {
@@ -201,8 +205,9 @@ L.Map.include({
 	},
 
 	deletePage: function (nPos) {
-		if (this.getDocType() === 'presentation' )
+		if (this.getDocType() === 'presentation') {
 			this._socket.sendMessage('uno .uno:DeletePage');
+		}
 		else if (this.getDocType() === 'spreadsheet') {
 			var command = {
 				'Index': {
@@ -213,8 +218,9 @@ L.Map.include({
 
 			this._socket.sendMessage('uno .uno:Remove ' + JSON.stringify(command));
 		}
-		else
+		else {
 			return;
+		}
 
 		var docLayer = this._docLayer;
 		// TO DO: Deleting all the pages causes problem.
@@ -232,10 +238,12 @@ L.Map.include({
 			docLayer._selectedPart--;
 		}
 
-		if (typeof nPos === 'number')
+		if (typeof nPos === 'number') {
 			this.setPart(nPos);
-		else
+		}
+		else {
 			this.setPart(docLayer._selectedPart);
+		}
 	},
 
 	renamePage: function (name, nPos) {
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index af793a6..d3ed85b 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -2,6 +2,7 @@
  * L.Socket contains methods for the communication with the server
  */
 
+/* global _ */
 L.Socket = L.Class.extend({
 	ProtocolVersionNumber: '0.1',
 


More information about the Libreoffice-commits mailing list