-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCode.gs
43 lines (34 loc) · 890 Bytes
/
Code.gs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//Google Triggers
//https://developers.google.com/apps-script/add-ons/concepts/editor-triggers
function onOpen() {
try{
SlidesApp.getUi().createMenu('Math Equations')
.addItem('Menu', 'showSidebar')
.addToUi();
Logger.log("onOpen - [worked]");
}
catch(e){
Logger.log("onOpen - [failed] %s",e.error)
}
}
function onInstall(){
Logger.log("onInstall")
onOpen();
}
//end google triggers
function doGet() {
return HtmlService
.createTemplateFromFile('index')
.evaluate();
}
function showSidebar() {
Logger.log("showSidebar")
var html = doGet().setTitle('Math Equations UI').setWidth(300); //max is 300
SlidesApp.getUi() // Or DocumentApp or FormApp.
.showSidebar(html);
}
//used in html to include other html files
function include(filename) {
return HtmlService.createHtmlOutputFromFile(filename)
.getContent();
}