2023-10-20 14:35:26 +00:00
|
|
|
// SPDX-FileCopyrightText: 2023 XWiki CryptPad Team <contact@cryptpad.org> and contributors
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
2017-08-28 10:25:05 +00:00
|
|
|
// Load #1, load as little as possible because we are in a race to get the loading screen up.
|
2014-10-31 15:42:58 +00:00
|
|
|
define([
|
2023-01-07 11:49:46 +00:00
|
|
|
'/components/nthen/index.js',
|
2017-08-28 10:25:05 +00:00
|
|
|
'/api/config',
|
2017-12-01 15:05:20 +00:00
|
|
|
'/common/dom-ready.js',
|
2017-08-30 09:10:57 +00:00
|
|
|
'/common/sframe-common-outer.js'
|
2020-11-04 10:22:31 +00:00
|
|
|
], function (nThen, ApiConfig, DomReady, SFCommonO) {
|
2017-08-28 10:25:05 +00:00
|
|
|
|
2023-01-16 20:22:57 +00:00
|
|
|
var isIntegration = Boolean(window.CP_integration_outer);
|
|
|
|
var integration = window.CP_integration_outer || {};
|
|
|
|
|
2020-01-27 11:18:25 +00:00
|
|
|
var hash, href;
|
2017-08-28 10:25:05 +00:00
|
|
|
nThen(function (waitFor) {
|
2017-12-01 15:05:20 +00:00
|
|
|
DomReady.onReady(waitFor());
|
2017-08-28 10:25:05 +00:00
|
|
|
}).nThen(function (waitFor) {
|
2023-01-16 20:22:57 +00:00
|
|
|
var obj = SFCommonO.initIframe(waitFor, true, integration.pathname);
|
2020-11-04 10:22:31 +00:00
|
|
|
href = obj.href;
|
|
|
|
hash = obj.hash;
|
2023-01-16 20:22:57 +00:00
|
|
|
if (isIntegration) {
|
|
|
|
href = integration.href;
|
|
|
|
hash = integration.hash;
|
|
|
|
}
|
2017-08-28 10:25:05 +00:00
|
|
|
}).nThen(function (/*waitFor*/) {
|
2018-01-08 16:36:44 +00:00
|
|
|
SFCommonO.start({
|
2023-01-16 20:22:57 +00:00
|
|
|
cache: !isIntegration,
|
2021-03-08 09:59:54 +00:00
|
|
|
noDrive: true,
|
2020-01-27 11:18:25 +00:00
|
|
|
hash: hash,
|
|
|
|
href: href,
|
2023-01-16 20:22:57 +00:00
|
|
|
useCreationScreen: !isIntegration,
|
|
|
|
messaging: true,
|
2023-01-19 15:10:55 +00:00
|
|
|
integration: isIntegration,
|
2023-01-24 15:58:23 +00:00
|
|
|
integrationUtils: integration.utils,
|
2023-01-26 17:40:31 +00:00
|
|
|
integrationConfig: integration.config || {},
|
2023-01-19 15:10:55 +00:00
|
|
|
initialState: integration.initialState || undefined
|
2018-01-08 16:36:44 +00:00
|
|
|
});
|
2017-02-17 14:39:34 +00:00
|
|
|
});
|
2017-12-01 15:05:20 +00:00
|
|
|
});
|