cryptpad/www/poll/main.js

34 lines
977 B
JavaScript
Raw Normal View History

2023-10-20 22:35:26 +08:00
// SPDX-FileCopyrightText: 2023 XWiki CryptPad Team <contact@cryptpad.org> and contributors
//
// SPDX-License-Identifier: AGPL-3.0-or-later
2017-09-28 00:52:04 +08:00
// Load #1, load as little as possible because we are in a race to get the loading screen up.
define([
'/components/nthen/index.js',
2017-09-28 00:52:04 +08:00
'/api/config',
2017-12-01 23:05:20 +08:00
'/common/dom-ready.js',
2017-09-28 00:52:04 +08:00
'/common/sframe-common-outer.js',
2020-11-04 18:22:31 +08:00
], function (nThen, ApiConfig, DomReady, SFCommonO) {
2017-09-28 00:52:04 +08:00
// Loaded in load #2
2020-01-27 19:18:25 +08:00
var hash, href;
2017-09-28 00:52:04 +08:00
nThen(function (waitFor) {
2017-12-01 23:05:20 +08:00
DomReady.onReady(waitFor());
2017-09-28 00:52:04 +08:00
}).nThen(function (waitFor) {
2020-11-04 18:22:31 +08:00
var obj = SFCommonO.initIframe(waitFor, true);
href = obj.href;
hash = obj.hash;
if (!hash) {
window.location.href = '/form/';
waitFor.abort();
}
2017-09-28 00:52:04 +08:00
}).nThen(function (/*waitFor*/) {
SFCommonO.start({
2020-01-27 19:18:25 +08:00
hash: hash,
href: href,
2018-09-18 22:36:29 +08:00
useCreationScreen: true,
messaging: true
});
2017-09-28 00:52:04 +08:00
});
});