optimize webpack and other minor changes
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"root": true,
|
||||
"parser": "babel-eslint",
|
||||
"extends": ["eslint:recommended", "google"],
|
||||
"plugins": ["googleappsscript"],
|
||||
"extends": ["airbnb-base", "prettier"],
|
||||
"plugins": ["googleappsscript", "prettier"],
|
||||
"env": {
|
||||
"googleappsscript/googleappsscript": true
|
||||
},
|
||||
@@ -12,6 +12,7 @@
|
||||
"global": true
|
||||
},
|
||||
"rules": {
|
||||
"import/prefer-default-export": 0
|
||||
"import/prefer-default-export": 0,
|
||||
"prettier/prettier": "error"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import * as publicFunctions from './sheets-utilities.js';
|
||||
import * as publicFunctions from './sheets-utilities';
|
||||
|
||||
// Expose public functions
|
||||
global.onOpen = publicFunctions.onOpen;
|
||||
|
||||
@@ -11,25 +11,18 @@ const openDialog = () => {
|
||||
const html = HtmlService.createHtmlOutputFromFile('main')
|
||||
.setWidth(400)
|
||||
.setHeight(600);
|
||||
SpreadsheetApp
|
||||
.getUi() // Or DocumentApp or FormApp.
|
||||
SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
|
||||
.showModalDialog(html, 'Sheet Editor');
|
||||
};
|
||||
|
||||
const openAboutSidebar = () => {
|
||||
const html = HtmlService.createHtmlOutputFromFile('about');
|
||||
SpreadsheetApp
|
||||
.getUi()
|
||||
.showSidebar(html);
|
||||
SpreadsheetApp.getUi().showSidebar(html);
|
||||
};
|
||||
|
||||
const getSheets = () => SpreadsheetApp
|
||||
.getActive()
|
||||
.getSheets();
|
||||
const getSheets = () => SpreadsheetApp.getActive().getSheets();
|
||||
|
||||
const getActiveSheetName = () => SpreadsheetApp
|
||||
.getActive()
|
||||
.getSheetName();
|
||||
const getActiveSheetName = () => SpreadsheetApp.getActive().getSheetName();
|
||||
|
||||
const getSheetsData = () => {
|
||||
const activeSheetName = getActiveSheetName();
|
||||
@@ -43,24 +36,19 @@ const getSheetsData = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const addSheet = (sheetTitle) => {
|
||||
SpreadsheetApp
|
||||
.getActive()
|
||||
.insertSheet(sheetTitle);
|
||||
const addSheet = sheetTitle => {
|
||||
SpreadsheetApp.getActive().insertSheet(sheetTitle);
|
||||
return getSheetsData();
|
||||
};
|
||||
|
||||
const deleteSheet = (sheetIndex) => {
|
||||
const deleteSheet = sheetIndex => {
|
||||
const sheets = getSheets();
|
||||
SpreadsheetApp
|
||||
.getActive()
|
||||
.deleteSheet(sheets[sheetIndex]);
|
||||
SpreadsheetApp.getActive().deleteSheet(sheets[sheetIndex]);
|
||||
return getSheetsData();
|
||||
};
|
||||
|
||||
const setActiveSheet = (sheetName) => {
|
||||
SpreadsheetApp
|
||||
.getActive()
|
||||
const setActiveSheet = sheetName => {
|
||||
SpreadsheetApp.getActive()
|
||||
.getSheetByName(sheetName)
|
||||
.activate();
|
||||
return getSheetsData();
|
||||
|
||||
Reference in New Issue
Block a user