35a641d0f7
- Create local dev environment - Add gas-client and google-apps-script-webpack-dev-server packages for development - Add dev/ wrapper app - Update webpack config to support development environment - Redesigned READMEs - Support typescript - Update npm scripts - Organize and update .gitignore file - Add .vscode settings for clasp files - Remove tracking for files in dist/
29 lines
910 B
JavaScript
29 lines
910 B
JavaScript
export const onOpen = () => {
|
|
const menu = SpreadsheetApp.getUi()
|
|
.createMenu('My Sample React Project') // edit me!
|
|
.addItem('Sheet Editor', 'openDialog')
|
|
.addItem('Sheet Editor (Bootstrap)', 'openDialogBootstrap')
|
|
.addItem('About me', 'openAboutSidebar');
|
|
|
|
menu.addToUi();
|
|
};
|
|
|
|
export const openDialog = () => {
|
|
const html = HtmlService.createHtmlOutputFromFile('dialog-demo')
|
|
.setWidth(600)
|
|
.setHeight(600);
|
|
SpreadsheetApp.getUi().showModalDialog(html, 'Sheet Editor');
|
|
};
|
|
|
|
export const openDialogBootstrap = () => {
|
|
const html = HtmlService.createHtmlOutputFromFile('dialog-demo-bootstrap')
|
|
.setWidth(600)
|
|
.setHeight(600);
|
|
SpreadsheetApp.getUi().showModalDialog(html, 'Sheet Editor (Bootstrap)');
|
|
};
|
|
|
|
export const openAboutSidebar = () => {
|
|
const html = HtmlService.createHtmlOutputFromFile('sidebar-about-page');
|
|
SpreadsheetApp.getUi().showSidebar(html);
|
|
};
|