Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
144 lines (143 loc) · 4.38 KB
/
Copy pathindex.html
File metadata and controls
144 lines (143 loc) · 4.38 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<html>
<head>
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="oauth.js"></script>
<script type="text/javascript" src="./src/onedrive-file-picker.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/Tony-Ren-Dev/Tony-Ren-Dev.github.io/master/src/styles/onedrive-file-pricker.css">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700,300' rel='stylesheet' type='text/css'>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<style>
html, body {
height: 100%;
}
body {
font-family: 'Open Sans', Arial, sans-serif;
background-color: #f4fbfe;
margin: 0;
padding: 0;
}
.container {
margin-bottom: 3em;
width:50%;
min-width: 540px;
margin: 0 auto;
min-height: 65vh;
}
.header {
background-color: #294a6b;
color: white;
font-size: 130%;
padding: .6em 2em .3em;
}
h3 {
font-weight: 300;
font-size: 1.5em;
margin: .5em 0 .8em;
}
.content {
padding: 2em 2em 0;
position: relative;
color: #34567b;
min-height: 60vh;
}
.text-center {
text-align: center;
}
.button {
background: #00adff;
color: #fff;
border: none;
padding: 1em;
transition: all .2s ease-in-out;
}
.button:hover {
background-color: #0079b3;
cursor: pointer;
}
.header .button {
font-size: .7em;
font-weight: bold;
background-color: #ef4800;
text-transform: uppercase;
box-shadow: 0 0 5px rgba(0,0,0,0.35);
border-radius: 2px;
}
.header .button:hover {
background-color: #dd1c00;
}
.margin-bottom {
margin-bottom: 20px;
}
.metadata pre {
overflow: auto;
background-color: #fff;
border: 1px solid #cbddf0;
border-radius: 3px;
padding: .5em;
color: #213f7D;
}
.title {
width: 7em;
display: inline-block;
line-height: 1.9em;
color: #1e2538;
}
.team {
margin-bottom: 1em;
font-size: .8em;
text-align: center;
}
a, a:visited {
color: #00adff;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
@media (max-width:1020px) {
.container {
margin: 0;
width: auto;
}
}
</style>
</head>
<body>
<div class="header text-center">
<h3>OneDrive JavaScript File Picker</h3>
<div class="margin-bottom text-center">
<input class="odfp-button button" type="submit" onclick="openPicker()" value="Open Picker »"/>
</div>
</div>
<div class="container">
<div class="content">
<div id="result">
<div class="action"><span class="title">User action</span><span class="data"></span></div>
<div class="filename"><span class="title">Filename</span><span class="data"></span></div>
<div class="metadata"><pre class="prettyprint" style="display:none;"></pre></div>
</div>
</div>
<div class="team">developed by the <a href="www.nuxeo.com/" alt="nuxeo.com">nuxeo team</a></div>
</div>
<script type="text/javascript">
function openPicker() {
getToken().then(function(token) {
var baseURL = 'https://tonyren-my.sharepoint.com/_api/v2.0';
return new OneDriveFilePicker({ 'accessToken': token, 'baseURL': baseURL }).select();
}).then(function(result) {
$("#result .action span.data").html(result.action);
$("#result .filename span.data").html('');
$('#result .metadata pre').html('');
$('#result .metadata pre').hide();
if (result.action === 'select') {
$("#result .filename span.data").html(result.item.name);
$('#result .metadata pre').html(JSON.stringify(result.item, null, ' '));
$('#result .metadata pre').show();
}
});
}
</script>
<span id="browser-sync-binding"></span>
</body>
</html>