-
Notifications
You must be signed in to change notification settings - Fork 0
/
configDialogBox.gs
47 lines (41 loc) · 1.25 KB
/
configDialogBox.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
44
45
46
47
function onInstall(e) {
// set default properties
PropertiesService.getDocumentProperties().deleteAllProperties();
data = [{
"columnToWatch": 3,
"nbColumnsInRow": 4,
"defaultColor": "white",
"ignoreCase": "true",
"formatingRules": "Low:yellow, Medium:#ff8b00, High:red"
}];
setProperties(data);
// set onFormSubmit trigger
var sheet = SpreadsheetApp.getActive();
ScriptApp.newTrigger("onFormSubmit")
.forSpreadsheet(sheet)
.onFormSubmit()
.create();
// create menu items
onOpen(e);
}
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('ChangeRowsColors')
.addItem('Settings', 'showDialog')
.addItem('Parse all rows', 'showParseAllDialog')
.addToUi();
}
function showDialog() {
var html = HtmlService.createHtmlOutputFromFile('dialogBox')
.setWidth(530)
.setHeight(280);
SpreadsheetApp.getUi()
.showModalDialog(html, 'Plugin settings (ChangeRowsColors)');
}
function showParseAllDialog() {
var html = HtmlService.createHtmlOutputFromFile('parseAllDialogBox')
.setWidth(400)
.setHeight(100);
SpreadsheetApp.getUi()
.showModalDialog(html, 'Parse all rows (ChangeRowsColors)');
}