-
Notifications
You must be signed in to change notification settings - Fork 14
/
sidebar.html
61 lines (44 loc) · 1.51 KB
/
sidebar.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons.css">
<style>
.branding-below {
bottom: 56px;
top: 0;
}
</style>
<div class="sidebar branding-below">
<img src="http://n1.octostatic.com/o3web/home/logo_588_132.f015017db49492d7819b870b73552594.png" width="200" height="44"/>
<div class="block">
Upload the BOM data in your sheet to Octopart
</div>
<div class="block">
<button class="action" onclick="upload();">Upload</button>
</div>
<div id="upload-success" class="block" style="display: none">
<p>Your data has been uploaded to Octopart.</p>
<p>Finish your BOM setup <a href="" id="bom-link">here</a></p>
</div>
<div id="upload-failure" class="block" style="display: none">
<span class="error" id="bom-error"></span>
</div>
</div>
<div class="sidebar bottom">
<span class="gray"><img src="http://n1.octostatic.com/o3web/shared/bugbw.499689e6cb54db812141d2f985886084.png" width="16" height="16"/> Octopart</span>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
function onUploadSuccess(url) {
$("#bom-link").attr("href", url);
$("#upload-success").show();
}
function onUploadFailure(error) {
$("#bom-error").text(error);
$("#upload-failure").show();
}
function upload() {
$("#upload-success").hide();
$("#upload-failure").hide();
google.script.run.withSuccessHandler(onUploadSuccess)
.withFailureHandler(onUploadFailure)
.uploadBOM();
}
</script>