Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oaphi/menuapp
Google Apps Script utility library for building custom menus
https://github.com/oaphi/menuapp
custom-menus google-apps-script menu utility-library
Last synced: about 1 month ago
JSON representation
Google Apps Script utility library for building custom menus
- Host: GitHub
- URL: https://github.com/oaphi/menuapp
- Owner: Oaphi
- License: mit
- Created: 2020-09-11T02:32:56.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-08-26T23:04:48.000Z (about 1 year ago)
- Last Synced: 2024-10-04T23:01:14.366Z (about 2 months ago)
- Topics: custom-menus, google-apps-script, menu, utility-library
- Language: TypeScript
- Homepage:
- Size: 447 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![clasp](https://img.shields.io/badge/built%20with-clasp-4285f4.svg)](https://github.com/google/clasp)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)# MenuApp
MenuApp is a small library for building custom menus from JSON configuration.
```javascript
const menu = MenuApp.buildMenu({
type: MenuApp.DocTypes.DOCUMENT,
title: "My Menu",
items: [
{
title: "My Action",
action: runMyAction.name,
},
MenuApp.createActionItem("Item from function", myCallback),
{
title: "Submenu",
items: [
{
title: "My Second Action",
actions: "MyLib.doSomething",
},
MenuApp.createSeparatorItem(),
],
},
],
append: true,
});
```The library exposes two utility enums accessible via `.`:
Parent document type: `DocTypes`
| Value |
| ------------ |
| SPREADSHEET |
| PRESENTATION |
| FORM |
| DOCUMENT |Menu item type (required if adding a special items): `ItemTypes`
| Value |
| --------- |
| MENU |
| ITEM |
| SEPARATOR |# Install
> Latest library version: 19
If developing locally, add the project info to manifest file's `dependencies.libraries` list:
| Field | Required | Value |
| ----------------- | -------- | ------------------------------------------------------------------------ |
| `libraryId` | yes | `1wr0xwr-RgfP0j9acfpJy2ESd3q4oqgM2bt0mgOemhRGS-U2N1XDxRuYk` |
| `version` | yes | Library version you want to use |
| `userSymbol` | no | The library name, `MenuApp` by default |
| `developmentMode` | no | Include the library in dev mode (will use any latest _unstable_ version) |Sample JSON object to add:
```json
{
"libraryId": "1wr0xwr-RgfP0j9acfpJy2ESd3q4oqgM2bt0mgOemhRGS-U2N1XDxRuYk",
"userSymbol": "MenuApp",
"version": "19",
"developmentMode": false
}
```Otherwise, use the new online editor UI to add the library (the id is the same as in `libraryId`):
![adding library via the online editor](./assets/library.png)