-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCode.gs
61 lines (46 loc) · 1.6 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
function onOpen() {
menu_init();
//menu_instantArticles();
}
////////////////////////////////////////////////////////////////////////////////
function showDialogForFbLoginWithNextAction(nextFunction) {
var ui = SpreadsheetApp.getUi();
var template = HtmlService.createTemplateFromFile('dialog-fb-login-t');
template.postLoginAction = nextFunction;
var html = HtmlService
.createHtmlOutput(template.evaluate())
.setWidth(300)
//.setHeight(130)
.setHeight(180)
;
ui.showModalDialog(html, 'Facebook Login');
}
function showSidebarForInstantArticles() {
var ui = SpreadsheetApp.getUi();
var template = HtmlService.createTemplateFromFile('sidebar-ia-insights-t');
template.me = fetchMeInfo();
var html = HtmlService
.createHtmlOutput(template.evaluate())
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL)
.setTitle('Instant Articles Insights Reporting')
;
ui.showSidebar(html);
}
function saveReport() {
SpreadsheetApp.getActiveSpreadsheet().duplicateActiveSheet();
//SpreadsheetApp.getActiveSpreadsheet().renameActiveSheet("Saved Report");
}
////////////////////////////////////////////////////////////////////////////////
function getUserProperties() {
var userProperties = PropertiesService.getUserProperties();
var allProperties = userProperties.getProperties();
// // Remove items from the "oauth2.*" namespace.
// Object.keys(allProperties).map(function (key) {
// if (key.match(/^oauth2\./)) {
// delete allProperties[key];
// }
// });
// // return allProperties;
//return JSON.parse(allProperties['fb.ia']);
return allProperties;
}