Enable drag & upload in code2 and prepare filepicker
This commit is contained in:
63
www/filepicker/inner.js
Normal file
63
www/filepicker/inner.js
Normal file
@@ -0,0 +1,63 @@
|
||||
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();
|
||||
});
|
||||
Reference in New Issue
Block a user