Merge branch 'staging' of github.com:xwiki-labs/cryptpad into staging

This commit is contained in:
Caleb James DeLisle
2017-12-05 18:32:29 +01:00
54 changed files with 2418 additions and 1586 deletions

View File

@@ -2,17 +2,15 @@
define([
'/bower_components/nthen/index.js',
'/api/config',
'jquery',
'/common/dom-ready.js',
'/common/requireconfig.js',
'/common/sframe-common-outer.js',
'/common/outer/network-config.js',
'/bower_components/netflux-websocket/netflux-client.js',
], function (nThen, ApiConfig, $, RequireConfig, SFCommonO, NetConfig, Netflux) {
], function (nThen, ApiConfig, DomReady, RequireConfig, SFCommonO) {
var requireConfig = RequireConfig();
// Loaded in load #2
nThen(function (waitFor) {
$(waitFor());
DomReady.onReady(waitFor());
}).nThen(function (waitFor) {
var req = {
cfg: requireConfig,
@@ -21,7 +19,7 @@ define([
};
window.rc = requireConfig;
window.apiconf = ApiConfig;
$('#sbox-iframe').attr('src',
document.getElementById('sbox-iframe').setAttribute('src',
ApiConfig.httpSafeOrigin + '/drive/inner.html?' + requireConfig.urlArgs +
'#' + encodeURIComponent(JSON.stringify(req)));
@@ -38,10 +36,10 @@ define([
};
window.addEventListener('message', onMsg);
}).nThen(function (/*waitFor*/) {
var getSecrets = function (Cryptpad, Utils) {
var getSecrets = function (Cryptpad, Utils, cb) {
var hash = window.location.hash.slice(1) || Utils.LocalStore.getUserHash() ||
Utils.LocalStore.getFSHash();
return Utils.Hash.getSecrets('drive', hash);
cb(null, Utils.Hash.getSecrets('drive', hash));
};
var addRpc = function (sframeChan, Cryptpad, Utils) {
sframeChan.on('EV_BURN_ANON_DRIVE', function () {
@@ -51,13 +49,13 @@ define([
window.location.reload();
});
};
Netflux.connect(NetConfig.getWebsocketURL()).then(function (network) {
//Netflux.connect(NetConfig.getWebsocketURL()).then(function (network) {
SFCommonO.start({
getSecrets: getSecrets,
newNetwork: network,
//newNetwork: network,
noHash: true,
addRpc: addRpc
});
}, function (err) { console.error(err); });
//}, function (err) { console.error(err); });
});
});

View File

@@ -70,7 +70,7 @@ define([
module.test = function (assert) {
var config = {
Cryptpad: Cryptpad,
pinPads: Cryptpad.pinPads,
workgroup: false,
testMode: true,
loggedIn: false
@@ -325,7 +325,12 @@ define([
var fo = FO.init(files, config);
fo.fixFiles();
var data = Cryptpad.makePad(href5, 'Title5');
var data = {
href: href5,
title: 'Title5',
atime: +new Date(),
ctime: +new Date()
};
var res;
var id5;
// pushData is synchronous in test mode (no pinning)