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

pull/1/head
yflory 4 years ago
commit bac6641bb1

@ -391,21 +391,32 @@ define([
assert(function (cb, msg) { assert(function (cb, msg) {
setWarningClass(msg); setWarningClass(msg);
var printMessage = function (value) {
msg.appendChild(h('span', [ msg.appendChild(h('span', [
"You haven't opted out of participation in Google's ", "This instance hasn't opted out of participation in Google's ",
code('FLoC'), code('FLoC'),
" targeted advertizing network. This can be done by adding a ", " targeted advertizing network. ",
"This can be done by setting a ",
code('permissions-policy'), code('permissions-policy'),
" HTTP header with a value of ", " HTTP header with a value of ",
code('interest-cohort=()'), code('"interest-cohort=()"'),
" in your reverse proxy's configuration. See the provided NGINX configuration file for an example. ", " in the configuration of its reverse proxy instead of the current value (",
code(value),
"). See the provided NGINX configuration file for an example. ",
h('p', [ h('p', [
link("https://www.eff.org/deeplinks/2021/04/am-i-floced-launch", 'Learn more'), link("https://www.eff.org/deeplinks/2021/04/am-i-floced-launch", 'Learn more'),
]), ]),
])); ]));
};
$.ajax('/?'+ (+new Date()), { $.ajax('/?'+ (+new Date()), {
complete: function (xhr) { complete: function (xhr) {
cb(xhr.getResponseHeader('permissions-policy') === 'interest-cohort=()'); var header = xhr.getResponseHeader('permissions-policy');
printMessage(JSON.stringify(header));
cb(header === 'interest-cohort=()' || header);
}, },
}); });
}); });
@ -735,11 +746,18 @@ define([
}; };
var failureReport = function (obj) { var failureReport = function (obj) {
var printableValue = obj.output;
try {
printableValue = JSON.stringify(obj.output);
} catch (err) {
console.error(err);
}
return h('div.error', [ return h('div.error', [
h('h5', obj.message), h('h5', obj.message),
h('table', [ h('table', [
row(["Failed test number", obj.test + 1]), row(["Failed test number", obj.test + 1]),
row(["Returned value", obj.output]), row(["Returned value", code(printableValue)]),
]), ]),
]); ]);
}; };

@ -1045,8 +1045,10 @@ define([
var privateDat = common.getMetadataMgr().getPrivateData(); var privateDat = common.getMetadataMgr().getPrivateData();
var origin = privateDat.fileHost || privateDat.origin; var origin = privateDat.fileHost || privateDat.origin;
var src = data.src = data.src.slice(0,1) === '/' ? origin + data.src : data.src; var src = data.src = data.src.slice(0,1) === '/' ? origin + data.src : data.src;
cfg.embed($('<media-tag src="' + src + cfg.embed(h('media-tag', {
'" data-crypto-key="cryptpad:' + data.key + '"></media-tag>'), data); src: src,
'data-crypto-key': 'cryptpad:' + data.key,
}), data);
}); });
} }

@ -92,7 +92,12 @@ define([
if (!obj || obj.error) { return; } if (!obj || obj.error) { return; }
Object.keys(obj || {}).forEach(function (id) { Object.keys(obj || {}).forEach(function (id) {
var t = obj[id]; var t = obj[id];
var _keys = t.keys.drive || {}; var _keys = {};
try {
_keys = t.keys.drive || {};
} catch (err) {
console.error(err);
}
_keys.id = id; _keys.id = id;
if (!_keys.edPrivate) { return; } if (!_keys.edPrivate) { return; }
keys.push(t.keys.drive); keys.push(t.keys.drive);

Loading…
Cancel
Save