@builder6/docs 0.15.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -0
- package/dist/app.module.d.ts +2 -0
- package/dist/app.module.js +44 -0
- package/dist/app.module.js.map +1 -0
- package/dist/docs/app.controller.d.ts +39 -0
- package/dist/docs/app.controller.js +102 -0
- package/dist/docs/app.controller.js.map +1 -0
- package/dist/docs/docs.controller.d.ts +751 -0
- package/dist/docs/docs.controller.js +472 -0
- package/dist/docs/docs.controller.js.map +1 -0
- package/dist/docs/docs.gateway.d.ts +10 -0
- package/dist/docs/docs.gateway.js +48 -0
- package/dist/docs/docs.gateway.js.map +1 -0
- package/dist/docs/docs.module.d.ts +2 -0
- package/dist/docs/docs.module.js +59 -0
- package/dist/docs/docs.module.js.map +1 -0
- package/dist/docs/docs.service.d.ts +159 -0
- package/dist/docs/docs.service.js +323 -0
- package/dist/docs/docs.service.js.map +1 -0
- package/dist/docs/dtos/rooms.dto.d.ts +15 -0
- package/dist/docs/dtos/rooms.dto.js +7 -0
- package/dist/docs/dtos/rooms.dto.js.map +1 -0
- package/dist/docs/editor.controller.d.ts +18 -0
- package/dist/docs/editor.controller.js +226 -0
- package/dist/docs/editor.controller.js.map +1 -0
- package/dist/docs/enums/index.d.ts +460 -0
- package/dist/docs/enums/index.js +44 -0
- package/dist/docs/enums/index.js.map +1 -0
- package/dist/docs/folders.service.d.ts +167 -0
- package/dist/docs/folders.service.js +410 -0
- package/dist/docs/folders.service.js.map +1 -0
- package/dist/docs/lib/getDocsClient.d.ts +1 -0
- package/dist/docs/lib/getDocsClient.js +19 -0
- package/dist/docs/lib/getDocsClient.js.map +1 -0
- package/dist/docs/people.controller.d.ts +102 -0
- package/dist/docs/people.controller.js +270 -0
- package/dist/docs/people.controller.js.map +1 -0
- package/dist/docs/permission.service.d.ts +139 -0
- package/dist/docs/permission.service.js +317 -0
- package/dist/docs/permission.service.js.map +1 -0
- package/dist/docs/rooms.controller.d.ts +337 -0
- package/dist/docs/rooms.controller.js +230 -0
- package/dist/docs/rooms.controller.js.map +1 -0
- package/dist/docs/settings.controller.d.ts +293 -0
- package/dist/docs/settings.controller.js +457 -0
- package/dist/docs/settings.controller.js.map +1 -0
- package/dist/docs/settings.service.d.ts +329 -0
- package/dist/docs/settings.service.js +1283 -0
- package/dist/docs/settings.service.js.map +1 -0
- package/dist/docs/system.service.d.ts +20 -0
- package/dist/docs/system.service.js +62 -0
- package/dist/docs/system.service.js.map +1 -0
- package/dist/filters/all-exceptions.filter.d.ts +5 -0
- package/dist/filters/all-exceptions.filter.js +61 -0
- package/dist/filters/all-exceptions.filter.js.map +1 -0
- package/dist/filters/unauthorized.filter.d.ts +7 -0
- package/dist/filters/unauthorized.filter.js +30 -0
- package/dist/filters/unauthorized.filter.js.map +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +43 -0
- package/dist/main.js.map +1 -0
- package/dist/plugin.module.d.ts +2 -0
- package/dist/plugin.module.js +21 -0
- package/dist/plugin.module.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +99 -0
- package/views/config.json +162 -0
- package/views/editor.ejs +457 -0
package/views/editor.ejs
ADDED
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head runat="server">
|
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
|
|
7
|
+
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
8
|
+
<meta name="mobile-web-app-capable" content="yes" />
|
|
9
|
+
<title><%- file.name %></title>
|
|
10
|
+
<link rel="icon"
|
|
11
|
+
href="/api/2.0/logo?logotype=3" />
|
|
12
|
+
<!-- <link rel="stylesheet" type="text/css" href="stylesheets/editor.css" /> -->
|
|
13
|
+
<style>
|
|
14
|
+
html {
|
|
15
|
+
height: 100%;
|
|
16
|
+
width: 100%;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
body {
|
|
20
|
+
background: #fff;
|
|
21
|
+
color: #333;
|
|
22
|
+
font-family: Arial, Tahoma,sans-serif;
|
|
23
|
+
font-size: 12px;
|
|
24
|
+
font-weight: normal;
|
|
25
|
+
height: 100%;
|
|
26
|
+
margin: 0;
|
|
27
|
+
overflow-y: hidden;
|
|
28
|
+
padding: 0;
|
|
29
|
+
text-decoration: none;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.form {
|
|
33
|
+
height: 100%;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
div {
|
|
37
|
+
margin: 0;
|
|
38
|
+
padding: 0;
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
41
|
+
</head>
|
|
42
|
+
<body>
|
|
43
|
+
<div class="form">
|
|
44
|
+
<div id="iframeEditor">
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
<script type="text/javascript" src="<%= apiUrl %>"></script>
|
|
48
|
+
<script type="text/javascript" language="javascript">
|
|
49
|
+
|
|
50
|
+
var docEditor;
|
|
51
|
+
var config;
|
|
52
|
+
let historyObject;
|
|
53
|
+
|
|
54
|
+
var innerAlert = function (message, inEditor) {
|
|
55
|
+
if (console && console.log)
|
|
56
|
+
console.log(message);
|
|
57
|
+
if (inEditor && docEditor)
|
|
58
|
+
docEditor.showMessage(message);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
var onAppReady = function () { // the application is loaded into the browser
|
|
62
|
+
innerAlert("Document editor ready");
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
var onDocumentStateChange = function (event) { // the document is modified
|
|
66
|
+
var title = document.title.replace(/\*$/g, "");
|
|
67
|
+
document.title = title + (event.data ? "*" : "");
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
var onRequestClose = function () { // close editor
|
|
71
|
+
docEditor.destroyEditor();
|
|
72
|
+
innerAlert("Document editor closed successfully");
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
var onMetaChange = function (event) { // the meta information of the document is changed via the meta command
|
|
76
|
+
if (event.data.favorite !== undefined) {
|
|
77
|
+
var favorite = !!event.data.favorite;
|
|
78
|
+
var title = document.title.replace(/^\☆/g, "");
|
|
79
|
+
document.title = (favorite ? "☆" : "") + title;
|
|
80
|
+
docEditor.setFavorite(favorite); // change the Favorite icon state
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
innerAlert("onMetaChange: " + JSON.stringify(event.data));
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
var onRequestEditRights = function () { // the user is trying to switch the document from the viewing into the editing mode
|
|
87
|
+
location.href = location.href.replace(RegExp("mode=\\w+\&?", "i"), "") + "&mode=edit";
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
var onRequestHistory = function (event) { // the user is trying to show the document version history
|
|
91
|
+
const fileName = "<%- file.name %>" || null;
|
|
92
|
+
const directUrl = "<%- file.directUrl %>" || null;
|
|
93
|
+
const data = {
|
|
94
|
+
fileName: fileName,
|
|
95
|
+
directUrl: directUrl
|
|
96
|
+
};
|
|
97
|
+
let xhr = new XMLHttpRequest();
|
|
98
|
+
xhr.open("POST", "/api/v6/onlyoffice/cms_files/<%- file._id%>/historyObj");
|
|
99
|
+
xhr.setRequestHeader("Content-Type", "application/json");
|
|
100
|
+
xhr.send(JSON.stringify(data));
|
|
101
|
+
xhr.onload = function () {
|
|
102
|
+
historyObject = JSON.parse(xhr.responseText);
|
|
103
|
+
docEditor.refreshHistory( // show the document version history
|
|
104
|
+
{
|
|
105
|
+
currentVersion: historyObject.countVersion,
|
|
106
|
+
history: historyObject.history
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
var onRequestHistoryData = function (event) { // the user is trying to click the specific document version in the document version history
|
|
112
|
+
const version = event.data;
|
|
113
|
+
docEditor.setHistoryData(historyObject.historyData[version-1]); // send the link to the document for viewing the version history
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
var onRequestHistoryClose = function (event){ // the user is trying to go back to the document from viewing the document version history
|
|
117
|
+
document.location.reload();
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
var onRequestRestore = function (event) { // the user is trying to restore file version
|
|
121
|
+
const version = event.data.version;
|
|
122
|
+
const historyInfo = historyObject.history[version-1];
|
|
123
|
+
const fileName = "<%- file.name %>" || null;
|
|
124
|
+
const directUrl = "<%- file.directUrl %>" || null;
|
|
125
|
+
const restoreData = {
|
|
126
|
+
version: version,
|
|
127
|
+
fileName: fileName,
|
|
128
|
+
};
|
|
129
|
+
let xhr = new XMLHttpRequest();
|
|
130
|
+
xhr.open("PUT", "/api/v6/onlyoffice/cms_files/<%- file._id%>/restore/"+historyInfo.fileId);
|
|
131
|
+
xhr.setRequestHeader('Content-Type', 'application/json');
|
|
132
|
+
xhr.send(JSON.stringify(restoreData));
|
|
133
|
+
xhr.onload = function () {
|
|
134
|
+
const response = JSON.parse(xhr.responseText);
|
|
135
|
+
if (response.success && !response.error) {
|
|
136
|
+
const dataForHistory = {
|
|
137
|
+
fileName: fileName,
|
|
138
|
+
directUrl: directUrl
|
|
139
|
+
};
|
|
140
|
+
let xhr = new XMLHttpRequest();
|
|
141
|
+
xhr.open("POST", "/api/v6/onlyoffice/cms_files/<%- file._id%>/historyObj");
|
|
142
|
+
xhr.setRequestHeader("Content-Type", "application/json");
|
|
143
|
+
xhr.send(JSON.stringify(dataForHistory));
|
|
144
|
+
xhr.onload = function () {
|
|
145
|
+
historyObject = JSON.parse(xhr.responseText);
|
|
146
|
+
docEditor.refreshHistory( // show the document version history
|
|
147
|
+
{
|
|
148
|
+
currentVersion: historyObject.countVersion,
|
|
149
|
+
history: historyObject.history
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
} else {
|
|
153
|
+
innerAlert(response.error);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
var onError = function (event) { // an error or some other specific event occurs
|
|
159
|
+
if (event)
|
|
160
|
+
innerAlert(event.data);
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
var onOutdatedVersion = function (event) { // the document is opened for editing with the old document.key value
|
|
164
|
+
location.reload(true);
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
// replace the link to the document which contains a bookmark
|
|
168
|
+
var replaceActionLink = function(href, linkParam) {
|
|
169
|
+
var link;
|
|
170
|
+
var actionIndex = href.indexOf("&actionLink=");
|
|
171
|
+
if (actionIndex != -1) {
|
|
172
|
+
var endIndex = href.indexOf("&", actionIndex + "&actionLink=".length);
|
|
173
|
+
if (endIndex != -1) {
|
|
174
|
+
link = href.substring(0, actionIndex) + href.substring(endIndex) + "&actionLink=" + encodeURIComponent(linkParam);
|
|
175
|
+
} else {
|
|
176
|
+
link = href.substring(0, actionIndex) + "&actionLink=" + encodeURIComponent(linkParam);
|
|
177
|
+
}
|
|
178
|
+
} else {
|
|
179
|
+
link = href + "&actionLink=" + encodeURIComponent(linkParam);
|
|
180
|
+
}
|
|
181
|
+
return link;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
var onMakeActionLink = function (event) { // the user is trying to get link for opening the document which contains a bookmark, scrolling to the bookmark position
|
|
185
|
+
var actionData = event.data;
|
|
186
|
+
var linkParam = JSON.stringify(actionData);
|
|
187
|
+
docEditor.setActionLink(replaceActionLink(location.href, linkParam)); // set the link to the document which contains a bookmark
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
var onRequestInsertImage = function(event) { // the user is trying to insert an image by clicking the Image from Storage button
|
|
191
|
+
var data = <%- JSON.stringify(dataInsertImage) %>;
|
|
192
|
+
data.c = event.data.c;
|
|
193
|
+
docEditor.insertImage(data); // insert an image into the file
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
var onRequestSelectDocument = function(event) { // the user is trying to select document by clicking the Document from Storage button
|
|
197
|
+
var data = <%- JSON.stringify(dataDocument) %>;
|
|
198
|
+
data.c = event.data.c;
|
|
199
|
+
docEditor.setRequestedDocument(data); // select a document
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
var onRequestSelectSpreadsheet = function (event) { // the user is trying to select recipients data by clicking the Mail merge button
|
|
203
|
+
var data = <%- JSON.stringify(dataSpreadsheet) %>;
|
|
204
|
+
data.c = event.data.c;
|
|
205
|
+
docEditor.setRequestedSpreadsheet(data); // insert recipient data for mail merge into the file
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
var onRequestUsers = function (event) {
|
|
209
|
+
if (event && event.data){
|
|
210
|
+
var c = event.data.c;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
switch (c) {
|
|
214
|
+
case "protect":
|
|
215
|
+
var users = <%- JSON.stringify(usersForProtect) %>;
|
|
216
|
+
break;
|
|
217
|
+
case "info":
|
|
218
|
+
users = [];
|
|
219
|
+
var allUsers = <%- JSON.stringify(usersInfo) %>;
|
|
220
|
+
for (var i = 0; i < event.data.id.length; i++) {
|
|
221
|
+
for (var j = 0; j < allUsers.length; j++) {
|
|
222
|
+
if (allUsers[j].id == event.data.id[i]) {
|
|
223
|
+
users.push(allUsers[j]);
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
break;
|
|
229
|
+
default:
|
|
230
|
+
users = <%- JSON.stringify(usersForMentions) %>;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
docEditor.setUsers({
|
|
234
|
+
"c": c,
|
|
235
|
+
"users": users,
|
|
236
|
+
});
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
var onRequestSendNotify = function(event) { // the user is mentioned in a comment
|
|
240
|
+
event.data.actionLink = replaceActionLink(location.href, JSON.stringify(event.data.actionLink));
|
|
241
|
+
var data = JSON.stringify(event.data);
|
|
242
|
+
innerAlert("onRequestSendNotify: " + data);
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
var onRequestOpen = function(event) { // user open external data source
|
|
246
|
+
innerAlert("onRequestOpen");
|
|
247
|
+
var windowName = event.data.windowName;
|
|
248
|
+
|
|
249
|
+
requestReference(event.data, function (data) {
|
|
250
|
+
if (data.error) {
|
|
251
|
+
var winEditor = window.open("", windowName);
|
|
252
|
+
winEditor.close();
|
|
253
|
+
innerAlert(data.error, true);
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
var link = data.link;
|
|
258
|
+
window.open(link, windowName);
|
|
259
|
+
});
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
var onRequestReferenceData = function(event) { // user refresh external data source
|
|
263
|
+
innerAlert("onRequestReferenceData");
|
|
264
|
+
|
|
265
|
+
requestReference(event.data, function (data) {
|
|
266
|
+
docEditor.setReferenceData(data);
|
|
267
|
+
});
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
var requestReference = function(data, callback) {
|
|
271
|
+
innerAlert(data);
|
|
272
|
+
|
|
273
|
+
data.directUrl = !!config.document.directUrl;
|
|
274
|
+
|
|
275
|
+
let xhr = new XMLHttpRequest();
|
|
276
|
+
xhr.open("POST", "reference");
|
|
277
|
+
xhr.setRequestHeader("Content-Type", "application/json");
|
|
278
|
+
xhr.send(JSON.stringify(data));
|
|
279
|
+
xhr.onload = function () {
|
|
280
|
+
innerAlert(xhr.responseText);
|
|
281
|
+
callback(JSON.parse(xhr.responseText));
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
var onRequestReferenceSource = function (event) {
|
|
286
|
+
innerAlert("onRequestReferenceSource");
|
|
287
|
+
let xhr = new XMLHttpRequest();
|
|
288
|
+
xhr.open("GET", "files/");
|
|
289
|
+
xhr.setRequestHeader("Content-Type", "application/json");
|
|
290
|
+
xhr.send();
|
|
291
|
+
xhr.onload = function () {
|
|
292
|
+
if (xhr.status === 200) {
|
|
293
|
+
innerAlert(JSON.parse(xhr.responseText));
|
|
294
|
+
let fileList = JSON.parse(xhr.responseText);
|
|
295
|
+
let firstXlsxName;
|
|
296
|
+
let file;
|
|
297
|
+
for (var i = 0; i < fileList.length; i++) {
|
|
298
|
+
file = fileList[i];
|
|
299
|
+
if (file["title"]) {
|
|
300
|
+
if (getFileExt(file["title"]) === "xlsx")
|
|
301
|
+
{
|
|
302
|
+
firstXlsxName = file["title"];
|
|
303
|
+
break;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
if (firstXlsxName) {
|
|
308
|
+
let data = {
|
|
309
|
+
directUrl : "<%- file.directUrl %>" || false,
|
|
310
|
+
path : firstXlsxName
|
|
311
|
+
};
|
|
312
|
+
let xhr = new XMLHttpRequest();
|
|
313
|
+
xhr.open("POST", "reference");
|
|
314
|
+
xhr.setRequestHeader("Content-Type", "application/json");
|
|
315
|
+
xhr.send(JSON.stringify(data));
|
|
316
|
+
xhr.onload = function () {
|
|
317
|
+
if (xhr.status === 200) {
|
|
318
|
+
docEditor.setReferenceSource(JSON.parse(xhr.responseText));
|
|
319
|
+
} else {
|
|
320
|
+
innerAlert("/reference - bad status");
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
} else {
|
|
324
|
+
innerAlert("No *.xlsx files");
|
|
325
|
+
}
|
|
326
|
+
} else {
|
|
327
|
+
innerAlert("/files - bad status");
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
var onRequestSaveAs = function (event) { // the user is trying to save file by clicking Save Copy as... button
|
|
333
|
+
var title = event.data.title;
|
|
334
|
+
var url = event.data.url;
|
|
335
|
+
var data = {
|
|
336
|
+
title: title,
|
|
337
|
+
url: url
|
|
338
|
+
}
|
|
339
|
+
let xhr = new XMLHttpRequest();
|
|
340
|
+
xhr.open("POST", "create");
|
|
341
|
+
xhr.setRequestHeader('Content-Type', 'application/json');
|
|
342
|
+
xhr.send(JSON.stringify(data));
|
|
343
|
+
xhr.onload = function () {
|
|
344
|
+
innerAlert(xhr.responseText);
|
|
345
|
+
innerAlert(JSON.parse(xhr.responseText).file, true);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
var onRequestRename = function(event) { // the user is trying to rename file by clicking Rename... button
|
|
350
|
+
innerAlert("onRequestRename: " + JSON.stringify(event.data));
|
|
351
|
+
|
|
352
|
+
var newfilename = event.data;
|
|
353
|
+
var data = {
|
|
354
|
+
newfilename: newfilename,
|
|
355
|
+
dockey: config.document.key,
|
|
356
|
+
ext: config.document.fileType
|
|
357
|
+
};
|
|
358
|
+
let xhr = new XMLHttpRequest();
|
|
359
|
+
xhr.open("POST", "rename");
|
|
360
|
+
xhr.setRequestHeader('Content-Type', 'application/json');
|
|
361
|
+
xhr.send(JSON.stringify(data));
|
|
362
|
+
xhr.onload = function () {
|
|
363
|
+
innerAlert(xhr.responseText);
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
var onRequestRefreshFile = function(event) {
|
|
368
|
+
let xhr = new XMLHttpRequest();
|
|
369
|
+
xhr.open("GET", "config?fileName=" + encodeURIComponent(config.document.title) +
|
|
370
|
+
"&directUrl=" + !!config.document.directUrl +
|
|
371
|
+
"&permissions=" + encodeURIComponent(JSON.stringify(config.document.permissions)));
|
|
372
|
+
xhr.send();
|
|
373
|
+
xhr.onload = function () {
|
|
374
|
+
innerAlert(xhr.responseText);
|
|
375
|
+
docEditor.refreshFile(JSON.parse(xhr.responseText));
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
var onDocumentReady = function(){
|
|
380
|
+
fixSize();
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
config = <%- JSON.stringify(config) %>;
|
|
384
|
+
config.events = {
|
|
385
|
+
"onAppReady": onAppReady,
|
|
386
|
+
"onDocumentReady": onDocumentReady,
|
|
387
|
+
"onDocumentStateChange": onDocumentStateChange,
|
|
388
|
+
"onError": onError,
|
|
389
|
+
"onOutdatedVersion": onOutdatedVersion,
|
|
390
|
+
"onMakeActionLink": onMakeActionLink,
|
|
391
|
+
"onMetaChange": onMetaChange,
|
|
392
|
+
"onRequestInsertImage": onRequestInsertImage,
|
|
393
|
+
"onRequestSelectDocument": onRequestSelectDocument,
|
|
394
|
+
"onRequestSelectSpreadsheet": onRequestSelectSpreadsheet,
|
|
395
|
+
"onRequestOpen": onRequestOpen,
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
config.events.onRequestClose = onRequestClose;
|
|
399
|
+
config.events.onRequestEditRights = onRequestEditRights;
|
|
400
|
+
config.events.onRequestHistory = onRequestHistory;
|
|
401
|
+
config.events.onRequestHistoryData = onRequestHistoryData;
|
|
402
|
+
config.events.onRequestRename = onRequestRename;
|
|
403
|
+
config.events.onRequestUsers = onRequestUsers;
|
|
404
|
+
config.events.onRequestSaveAs = onRequestSaveAs;
|
|
405
|
+
config.events.onRequestSendNotify = onRequestSendNotify;
|
|
406
|
+
config.events.onRequestReferenceData = onRequestReferenceData;
|
|
407
|
+
config.events.onRequestReferenceSource = onRequestReferenceSource;
|
|
408
|
+
config.events.onRequestRefreshFile = onRequestRefreshFile;
|
|
409
|
+
config.events.onRequestHistoryClose = onRequestHistoryClose;
|
|
410
|
+
config.events.onRequestRestore = onRequestRestore;
|
|
411
|
+
|
|
412
|
+
try {
|
|
413
|
+
var oformParam = new URL(window.location).searchParams.get("oform");
|
|
414
|
+
} catch (e) {}
|
|
415
|
+
if (oformParam == "false") {
|
|
416
|
+
config.document.options = config.document.options || {};
|
|
417
|
+
config.document.options["oform"] = false;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
var connectEditor = function () {
|
|
421
|
+
docEditor = new DocsAPI.DocEditor("iframeEditor", config);
|
|
422
|
+
fixSize();
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
// get the editor sizes
|
|
426
|
+
var fixSize = function () {
|
|
427
|
+
if (config.type !== "mobile") {
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
var wrapEl = document.getElementsByTagName("iframe");
|
|
431
|
+
if (wrapEl.length) {
|
|
432
|
+
wrapEl[0].style.height = screen.availHeight + "px";
|
|
433
|
+
window.scrollTo(0, -1);
|
|
434
|
+
wrapEl[0].style.height = window.innerHeight + "px";
|
|
435
|
+
}
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
const getFileExt = function (fileName) {
|
|
439
|
+
if (fileName.indexOf(".")) {
|
|
440
|
+
return fileName.split('.').reverse()[0];
|
|
441
|
+
}
|
|
442
|
+
return false;
|
|
443
|
+
};
|
|
444
|
+
|
|
445
|
+
if (window.addEventListener) {
|
|
446
|
+
window.addEventListener("load", connectEditor);
|
|
447
|
+
window.addEventListener("resize", fixSize);
|
|
448
|
+
window.addEventListener("orientationchange", fixSize);
|
|
449
|
+
} else if (window.attachEvent) {
|
|
450
|
+
window.attachEvent("onload", connectEditor);
|
|
451
|
+
window.attachEvent("onresize", fixSize);
|
|
452
|
+
window.attachEvent("orientationchange", fixSize);
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
</script>
|
|
456
|
+
</body>
|
|
457
|
+
</html>
|