mirror of https://github.com/xwiki-labs/cryptpad
64 lines
1.7 KiB
JavaScript
64 lines
1.7 KiB
JavaScript
![]() |
define([
|
||
|
'jquery',
|
||
|
'/bower_components/chainpad-crypto/crypto.js',
|
||
|
'/bower_components/textpatcher/TextPatcher.js',
|
||
|
'/bower_components/chainpad-json-validator/json-ot.js',
|
||
|
'/common/cryptpad-common.js',
|
||
|
'/bower_components/nthen/index.js',
|
||
|
'/common/sframe-common.js',
|
||
|
|
||
|
'css!/bower_components/bootstrap/dist/css/bootstrap.min.css',
|
||
|
'css!/bower_components/components-font-awesome/css/font-awesome.min.css',
|
||
|
'less!/customize/src/less/cryptpad.less',
|
||
|
'less!/customize/src/less/toolbar.less',
|
||
|
'less!/common/file-dialog.less',
|
||
|
], function (
|
||
|
$,
|
||
|
Crypto,
|
||
|
TextPatcher,
|
||
|
JsonOT,
|
||
|
Cryptpad,
|
||
|
nThen,
|
||
|
SFCommon)
|
||
|
{
|
||
|
var Messages = Cryptpad.Messages;
|
||
|
|
||
|
var APP = window.APP = {
|
||
|
Cryptpad: Cryptpad,
|
||
|
};
|
||
|
|
||
|
var onConnectError = function () {
|
||
|
Cryptpad.errorLoadingScreen(Messages.websocketError);
|
||
|
};
|
||
|
|
||
|
var andThen = function (common) {
|
||
|
//var metadataMgr = common.getMetadataMgr();
|
||
|
var $body = $('body');
|
||
|
var cfg = {
|
||
|
$body: $body,
|
||
|
common: common
|
||
|
};
|
||
|
common.createFileDialog(cfg);
|
||
|
Cryptpad.removeLoadingScreen();
|
||
|
};
|
||
|
|
||
|
var main = function () {
|
||
|
var common;
|
||
|
|
||
|
nThen(function (waitFor) {
|
||
|
$(waitFor(function () {
|
||
|
Cryptpad.addLoadingScreen();
|
||
|
}));
|
||
|
SFCommon.create(waitFor(function (c) { APP.common = common = c; }));
|
||
|
}).nThen(function (/*waitFor*/) {
|
||
|
Cryptpad.onError(function (info) {
|
||
|
if (info && info.type === "store") {
|
||
|
onConnectError();
|
||
|
}
|
||
|
});
|
||
|
andThen(common);
|
||
|
});
|
||
|
};
|
||
|
main();
|
||
|
});
|