f2a259ce66
• re-organize file structure with one directory per dialog • add index.html file per dialog • add bootstrap styling and dynamic cdn loading • clean up react code and stylesheet npm setup script update adds force flag "setup": "rm -f .clasp.json ..." Update README.md Move clasp to devDependencies update dynamic cdn urls Add repository field
28 lines
893 B
JavaScript
28 lines
893 B
JavaScript
export const onOpen = () => {
|
|
SpreadsheetApp.getUi()
|
|
.createMenu('My Sample React Project') // edit me!
|
|
.addItem('Sheet Editor', 'openDialog')
|
|
.addItem('Sheet Editor (Bootstrap)', 'openDialogBootstrap')
|
|
.addItem('About me', 'openAboutSidebar')
|
|
.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);
|
|
};
|