adjust or remove comments

pull/1/head
ansuz 4 years ago
parent 34e02a23e7
commit 75a316e70d

@ -85,7 +85,7 @@ define([
Pages.docsLink = footLink('https://docs.cryptpad.fr', 'docs_link'); Pages.docsLink = footLink('https://docs.cryptpad.fr', 'docs_link');
Pages.infopageFooter = function () { Pages.infopageFooter = function () {
var terms = footLink('/terms.html', 'footer_tos'); // XXX var terms = footLink('/terms.html', 'footer_tos'); // FIXME this should be configurable like the other legal pages
var legalFooter; var legalFooter;
// only display the legal part of the footer if it has content // only display the legal part of the footer if it has content

@ -14,14 +14,13 @@ Data.getMetadataRaw = function (Env, channel /* channelName */, _cb) {
// return synthetic metadata for admin broadcast channels as a safety net // return synthetic metadata for admin broadcast channels as a safety net
// in case anybody manages to write metadata // in case anybody manages to write metadata
/* if (channel.length === HK.ADMIN_CHANNEL_LENGTH) {
if (channel.length === HK.ADMIN_CHANNEL_LENGTH) { // XXX
return void cb(void 0, { return void cb(void 0, {
channel: channel, channel: channel,
creation: +new Date(), creation: +new Date(),
owners: Env.admins, owners: Env.admins,
}); });
} */ }
var cached = Env.metadata_cache[channel]; var cached = Env.metadata_cache[channel];
if (HK.isMetadataMessage(cached)) { if (HK.isMetadataMessage(cached)) {
@ -152,7 +151,7 @@ Data.setMetadata = function (Env, safeKey, data, cb, Server) {
const metadata_cache = Env.metadata_cache; const metadata_cache = Env.metadata_cache;
// update the cached metadata // update the cached metadata
metadata_cache[channel] = metadata; // XXX guard against malicious takeover of the broadcast channel metadata_cache[channel] = metadata;
// it's easy to check if the channel is restricted // it's easy to check if the channel is restricted
const isRestricted = metadata.restricted; const isRestricted = metadata.restricted;

@ -139,6 +139,8 @@ var args_isMaintenance = function (args) {
(args[0] === "" || (isNumber(args[0].end) && isNumber(args[0].start))); (args[0] === "" || (isNumber(args[0].end) && isNumber(args[0].start)));
}; };
// we anticipate that we'll add language-specific surveys in the future
// whenever that happens we can relax validation a bit to support more formats
var makeBroadcastSetter = function (attr, validation) { var makeBroadcastSetter = function (attr, validation) {
return function (Env, args) { return function (Env, args) {
if ((validation && !validation(args)) && !args_isString(args)) { if ((validation && !validation(args)) && !args_isString(args)) {
@ -156,7 +158,7 @@ var makeBroadcastSetter = function (attr, validation) {
commands.SET_LAST_BROADCAST_HASH = makeBroadcastSetter('lastBroadcastHash'); commands.SET_LAST_BROADCAST_HASH = makeBroadcastSetter('lastBroadcastHash');
// CryptPad_AsyncStore.rpc.send('ADMIN', [ 'ADMIN_DECREE', ['SET_SURVEY_URL', [url]]], console.log) // CryptPad_AsyncStore.rpc.send('ADMIN', [ 'ADMIN_DECREE', ['SET_SURVEY_URL', [url]]], console.log)
commands.SET_SURVEY_URL = makeBroadcastSetter('surveyURL'); // XXX anticipate language-specific surveys commands.SET_SURVEY_URL = makeBroadcastSetter('surveyURL');
// CryptPad_AsyncStore.rpc.send('ADMIN', [ 'ADMIN_DECREE', ['SET_MAINTENANCE', [{start: +Date, end: +Date}]]], console.log) // CryptPad_AsyncStore.rpc.send('ADMIN', [ 'ADMIN_DECREE', ['SET_MAINTENANCE', [{start: +Date, end: +Date}]]], console.log)
// CryptPad_AsyncStore.rpc.send('ADMIN', [ 'ADMIN_DECREE', ['SET_MAINTENANCE', [""]]], console.log) // CryptPad_AsyncStore.rpc.send('ADMIN', [ 'ADMIN_DECREE', ['SET_MAINTENANCE', [""]]], console.log)

@ -1203,7 +1203,7 @@ define([
} }
if (error) { if (error) {
console.error('One of the selected languages has no data'); console.error('One of the selected languages has no data');
return false; // XXX better error handling? return false;
} }
return { return {
defaultLanguage: defaultLanguage, defaultLanguage: defaultLanguage,
@ -1213,7 +1213,7 @@ define([
var send = function (data) { var send = function (data) {
$button.prop('disabled', 'disabled'); $button.prop('disabled', 'disabled');
data.time = +new Date(); // XXX not used anymore? //data.time = +new Date(); // FIXME not used anymore?
common.mailbox.sendTo('BROADCAST_CUSTOM', data, {}, function (err) { common.mailbox.sendTo('BROADCAST_CUSTOM', data, {}, function (err) {
if (err) { if (err) {
$button.prop('disabled', ''); $button.prop('disabled', '');
@ -1233,7 +1233,7 @@ define([
send(data); send(data);
}); });
UI.confirmButton(removeButton, { // XXX table jank UI.confirmButton(removeButton, {
classes: 'btn-danger', classes: 'btn-danger',
}, function () { }, function () {
if (!activeUid) { return; } if (!activeUid) { return; }

@ -739,6 +739,7 @@ define([
} }
}); });
}; };
// TODO: make it such that the confirmButton's width does not change
UI.confirmButton = function (originalBtn, config, _cb) { UI.confirmButton = function (originalBtn, config, _cb) {
config = config || {}; config = config || {};
var cb = Util.mkAsync(_cb); var cb = Util.mkAsync(_cb);

Loading…
Cancel
Save