-
Notifications
You must be signed in to change notification settings - Fork 0
/
dialog.html
36 lines (32 loc) · 838 Bytes
/
dialog.html
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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons.css">
<script>
function openDialog(){
google.script.run.showPicker();
}
function getProperties(){
google.script.run
.withSuccessHandler(fillBox)
.withFailureHandler(showError)
.getProperty("name");
}
function fillBox(theText){
document.getElementById('fileName').value = theText;
}
function showError(err){
console.log(err);
window.alert("An error has occured: " & err);
}
</script>
</head>
<body onload = "getProperties()">
<div>
<button onclick='openDialog()'>Open Dialog</button>
<input type="text" id="fileName"><br>
<p id='result'></p>
</div>
<script src="https://apis.google.com/js/api.js?onload=onApiLoad"></script>
</body>
</html>