-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
153 lines (132 loc) · 4.43 KB
/
index.php
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
145
146
147
148
149
150
151
152
153
<!DOCTYPE HTML>
<!--
Aerial by HTML5 UP
html5up.net | @ajlkn
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
<head>
<script src="https://code.jquery.com/jquery-2.2.4.js"></script>
<script src="https://static-cdn.kloudless.com/p/platform/sdk/kloudless.explorer.js"></script>
<script src="https://static-cdn.kloudless.com/p/platform/sdk/kloudless.explorer.js"></script>
<title>CLOUD MASTER</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
<link rel="stylesheet" href="assets/css/main.css" />
<!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
<!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
</head>
<body class="loading">
<div id="wrapper">
<div id="bg"></div>
<div id="overlay"></div>
<div id="main">
<!-- Header -->
<header id="header">
<h1>CLOUD MASTER</h1>
<p>Alif • Anisa • Kevin • Tegar</p>
<nav>
<ul>
<li><a id="chooser" href="#" class="icon fa-hdd-o"><span id="chooser" class="label">Upload</span>
</a></li>
<li>
<a id="saver" href="#" class="icon fa-cloud-upload"><span id="saver" class="label">Upload</span>
</a></li>
</ul>
</nav>
</header>
<!-- Footer -->
<footer id="footer">
<span class="copyright">© Design: <a href="http://html5up.net">xcode___</a>.</span>
</footer>
</div>
</div>
<!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->
<script>
window.onload = function() { document.body.className = ''; }
window.ontouchmove = function() { return false; }
window.onorientationchange = function() { document.body.scrollTop = 0; }
</script>
<script>
// File Explorer Configuration
var explorer = window.Kloudless.explorer({
// Chooser and Saver Options
app_id: 'iCZ_ICMy43H0NSoz0QbLvmyjzCHf2frAOPaBfWVgh9_vrFIM',
computer: true,
persist: "local",
services: ['all'],
display_backdrop: true,
create_folder: true,
can_upload_files:true,
retrieve_token: false,
tokens: [],
// Chooser options
multiselect: false,
link: true,
direct_link: false,
copy_to_upload_location: false,
upload_location_account: null,
upload_location_folder: null,
types: ['all'],
});
explorer.on('success', function(files) {
var text = JSON.stringify(files, null, 2);
var obj = JSON.parse(text);
var temp = new Object();
temp["url"] = obj[0].link;
temp["name"] = obj[0].name;
coba.push(temp);
window.open(obj[0].link);
});
// Initializing Chooser
explorer.choosify(document.getElementById('chooser'));
// Initializing Saver
var coba = [];
explorer.savify(document.getElementById('saver'), coba);
/********************************************************
The code below is used for setting event handlers
and not for initialization.
*********************************************************/
var events = {
'success': 'files',
'cancel': null,
'error': 'error',
'open': null,
'close': null,
'selected': 'files',
'addAccount': 'account',
'deleteAccount': 'account',
'startFileUpload': 'file',
'finishFileUpload': 'file'
}
for (var event in events) {
(function(evt) {
if (events[event]) {
explorer.on(evt, function(arg) {
printResult('Fired ' + evt + ' event.', true);
printResult(JSON.stringify(arg, null, 2), false);
});
} else {
explorer.on(evt, function() {
printResult('Fired ' + evt + ' event.', false);
});
}
})(event);
}
function printResult(result, clear) {
var eventContainer = document.getElementById('event-info');
// remove all elements
if (clear) {
while (eventContainer.lastChild) {
eventContainer.removeChild(
eventContainer.lastChild);
}
}
var eventJSON = document.createElement('pre');
eventJSON.appendChild(document.createTextNode(result));
eventContainer.appendChild(eventJSON);
}
</script>
</body>
</html>