app.reporter.js
2.63 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
/*!
* Copyright (c) Ascensio System SIA 2024. All rights reserved
* Version: 7.4.1 (build:1)
*/
'use strict';
var reqerr;
(require.config({
baseUrl: '../../',
paths: {
jquery: '../vendor/jquery/jquery.min',
underscore: '../vendor/underscore/underscore-min',
xregexp: '../vendor/xregexp/xregexp-all-min',
socketio: '../vendor/socketio/socket.io.min',
allfonts: '../../sdkjs/common/AllFonts',
sdk: '../../sdkjs/slide/sdk-all-min',
},
shim: { underscore: { exports: '_' }, sdk: { deps: ['jquery', 'allfonts', 'xregexp', 'socketio'] } },
}),
require(['jquery'], function () {
var e = function (e) {
var o,
n = e.data;
try {
o = n;
} catch (e) {}
o &&
'file:open' == o.type &&
(function (e) {
var o = {};
e &&
((o = new Asc.asc_CDocInfo()).put_Id(e.key),
o.put_Url(e.url),
o.put_DirectUrl(e.directUrl),
o.put_Title(e.title),
o.put_Format(e.fileType),
o.put_VKey(e.vkey),
o.put_Options(e.options),
o.put_Token(e.token),
o.put_Permissions(e.permissions || {}),
t(e.title));
(r.preloadReporter(e),
r.SetThemesPath('../../../../sdkjs/slide/themes/'),
r.asc_setDocInfo(o),
r.asc_getEditorPermissions(),
r.asc_setViewMode(!0),
r._onAuth({ type: 'auth', result: 1 }),
AscCommon.g_oDocumentUrls.init(e.imageUrls),
e.buffer instanceof Uint8ClampedArray || (e.buffer = new Uint8ClampedArray(Object.values(e.buffer))));
r.onEndLoadFile({ bSerFormat: !0, data: e.buffer });
})(o.data);
};
// Always use window message listener for local deployment
window.attachEvent ? window.attachEvent('onmessage', e) : window.addEventListener('message', e, !1);
var r = new Asc.asc_docs_api({
'id-view': 'editor_sdk',
using: 'reporter',
skin: localStorage.getItem('ui-theme-id'),
}),
t = function (e) {
e && (window.document.title += ' - ' + e);
};
(r.asc_registerCallback('asc_onDocumentContentReady', function () {
(r.SetDrawingFreeze(!1), $('#loading-mask').hide().remove());
}),
r.asc_registerCallback('asc_onGetEditorPermissions', function (e) {
r.asc_LoadDocument();
}),
setTimeout(function () {
r.sendFromReporter('i:am:ready');
}, 0));
}, function (e) {
'timeout' == e.requireType &&
!reqerr &&
window.requireTimeourError &&
((reqerr = window.requireTimeourError()), window.alert(reqerr), window.location.reload());
}));