multiple entrypoints
This commit is contained in:
@@ -3,6 +3,7 @@ import * as publicFunctions from './sheets-utilities.js';
|
||||
// Expose public functions
|
||||
global.onOpen = publicFunctions.onOpen;
|
||||
global.openDialog = publicFunctions.openDialog;
|
||||
global.openAboutSidebar = publicFunctions.openAboutSidebar;
|
||||
global.getSheetsData = publicFunctions.getSheetsData;
|
||||
global.addSheet = publicFunctions.addSheet;
|
||||
global.deleteSheet = publicFunctions.deleteSheet;
|
||||
|
||||
@@ -3,11 +3,12 @@ const onOpen = () => {
|
||||
SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
|
||||
.createMenu('Custom scripts')
|
||||
.addItem('Edit sheets [sample React project]', 'openDialog')
|
||||
.addItem('About me', 'openAboutSidebar')
|
||||
.addToUi();
|
||||
};
|
||||
|
||||
const openDialog = () => {
|
||||
let html = HtmlService.createHtmlOutputFromFile('dialog')
|
||||
let html = HtmlService.createHtmlOutputFromFile('main')
|
||||
.setWidth(400)
|
||||
.setHeight(600);
|
||||
SpreadsheetApp
|
||||
@@ -15,6 +16,13 @@ const openDialog = () => {
|
||||
.showModalDialog(html, 'Sheet Editor');
|
||||
};
|
||||
|
||||
const openAboutSidebar = () => {
|
||||
let html = HtmlService.createHtmlOutputFromFile('about');
|
||||
SpreadsheetApp
|
||||
.getUi()
|
||||
.showSidebar(html);
|
||||
};
|
||||
|
||||
const getSheets = () => SpreadsheetApp
|
||||
.getActive()
|
||||
.getSheets();
|
||||
@@ -61,6 +69,7 @@ const setActiveSheet = (sheetName) => {
|
||||
export {
|
||||
onOpen,
|
||||
openDialog,
|
||||
openAboutSidebar,
|
||||
getSheetsData,
|
||||
addSheet,
|
||||
deleteSheet,
|
||||
|
||||
Reference in New Issue
Block a user