-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
48 lines (45 loc) · 1.34 KB
/
index.html
File metadata and controls
48 lines (45 loc) · 1.34 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
<!DOCTYPE html>
<html lang="zh" style="height: 100%;">
<head>
<meta charset="UTF-8">
<title>Kfoffice</title>
<script type="text/javascript" src="http://onlyoffice.kfcoding.com/web-apps/apps/api/documents/api.js"></script>
</head>
<body style="height: 100%; margin: 0; overflow: hidden;">
<div id="placeholder" style="height: 100%"></div>
<script type="text/javascript">
let params = new URLSearchParams(window.location.search);
let url = params.get('url');
let fileType = url.split('.').pop();
let name = url.split('/').pop();
let documentType = 'presentation';
let arr = url.split('/');
let filename = arr.pop();
let path = arr.pop();
let filepath = path + '/' + filename;
let mode = params.get('mode') == 'edit' ? 'edit' : 'view';
let config = {
"document": {
"fileType": fileType,
"key": new Date().getTime() + '',
"title": name,
"url": url,
"permissions": {
"comment": false,
"download": true,
"edit": mode == 'edit' ? true : false,
"modifyFilter": false,
"review": false
}
},
"documentType": documentType,
"editorConfig": {
lang: 'zh_CN',
mode: mode,
"callbackUrl": "http://kfoffice.kfcoding.com/track?filename=" + filepath
}
};
window.docEditor = new DocsAPI.DocEditor("placeholder", config);
</script>
</body>
</html>