loleaflet: Fix all ESLint errors
And we are now finally in a clean state. Change-Id: Ifd949d925cc758a007d036e1de9df7dafd911c40
This commit is contained in:
parent
5332e3f48c
commit
10fcfdd210
6 changed files with 30 additions and 16 deletions
|
@ -1 +1,2 @@
|
|||
src/scrollbar
|
||||
src/contextMenu
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
* L.Socket contains methods for the communication with the server
|
||||
*/
|
||||
|
||||
/* global _ */
|
||||
L.Socket = L.Class.extend({
|
||||
ProtocolVersionNumber: '0.1',
|
||||
|
||||
|
|
Loading…
Reference in a new issue