|
|
@ -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)
|
|
|
|