diff --git a/www/admin/inner.js b/www/admin/inner.js index b0dfffa46..be0ff68af 100644 --- a/www/admin/inner.js +++ b/www/admin/inner.js @@ -53,14 +53,18 @@ define([ 'general': [ // Msg.admin_cat_general 'cp-admin-flush-cache', 'cp-admin-update-limit', - 'cp-admin-archive', - 'cp-admin-unarchive', 'cp-admin-registration', 'cp-admin-email', + + 'cp-admin-name', + 'cp-admin-description', + 'cp-admin-jurisdiction', ], 'quota': [ // Msg.admin_cat_quota 'cp-admin-defaultlimit', 'cp-admin-setlimit', + 'cp-admin-archive', + 'cp-admin-unarchive', 'cp-admin-getquota', 'cp-admin-getlimits', ], @@ -93,10 +97,6 @@ define([ //'cp-admin-provide-aggregate-statistics', 'cp-admin-list-my-instance', - 'cp-admin-name', - 'cp-admin-description', - 'cp-admin-jurisdiction', - 'cp-admin-consent-to-contact', 'cp-admin-remove-donate-button', 'cp-admin-instance-purpose', @@ -151,8 +151,6 @@ define([ return $div; }; - Messages.admin_archiveReason = "// XXX REASON"; // XXX - var archiveForm = function (archive, $div, $button) { var label = h('label', { for: 'cp-admin-archive' }, Messages.admin_archiveInput); var input = h('input#cp-admin-archive', { @@ -168,11 +166,10 @@ define([ }); var input3 = h('input', { id: 'cp-admin-archive-reason', - placeholder: Messages.admin_archiveReason, }); var label3 = h('label', { for: 'cp-admin-archive-reason', - }, Messages.admin_archiveReason); + }, Messages.admin_archiveNote); var $pw = $(input2); $pw.addClass('cp-admin-pw'); @@ -377,8 +374,8 @@ define([ create['email'] = function () { var key = 'email'; - var $div = makeBlock(key, true); // Msg.admin_emailHint, Msg.admin_emailTitle, Msg.admin_emailButton - var $button = $div.find('button'); + var $div = makeBlock(key, true); // Msg.admin_emailHint, Msg.admin_emailTitle, Msg.admin_emailButton // XXX drop 'emailButton' + var $button = $div.find('button').text(Messages.settings_save); var input = h('input', { type: 'email', @@ -414,15 +411,10 @@ define([ return $div; }; - Messages.admin_jurisdictionHint = 'Jurisdiction hint'; // XXX - Messages.admin_jurisdictionTitle = 'Jurisdiction title'; // XXX - Messages.admin_jurisdictionButton = 'Jurisdiction button'; // XXX - Messages.admin_jurisdictionPlaceholder = 'Jurisdiction placeholder'; // XXX - create['jurisdiction'] = function () { var key = 'jurisdiction'; var $div = makeBlock(key, true); // Msg.admin_jurisdictionHint, Msg.admin_jurisdictionTitle, Msg.admin_jurisdictionButton - var $button = $div.find('button').addClass('cp-listing-action'); + var $button = $div.find('button').addClass('cp-listing-action').text(Messages.settings_save); var input = h('input.cp-listing-info', { type: 'text', @@ -434,12 +426,12 @@ define([ var spinner = UI.makeSpinner($(innerDiv)); $button.click(function () { - if (!$input.val()) { return; } + if (!$input.val()) { return; } // XXX spinner.spin(); $button.attr('disabled', 'disabled'); sFrameChan.query('Q_ADMIN_RPC', { cmd: 'ADMIN_DECREE', - data: ['SET_INSTANCE_JURISDICTION', [$input.val()]] // XXX not implemented + data: ['SET_INSTANCE_JURISDICTION', [$input.val()]] // XXX }, function (e, response) { $button.removeAttr('disabled'); if (e || response.error) { @@ -450,7 +442,7 @@ define([ return; } spinner.done(); - UI.log(Messages.saved); + UI.log(Messages._getKey('ui_saved', [Messages.admin_jurisdictionTitle])); }); }); @@ -459,21 +451,16 @@ define([ return $div; }; - Messages.admin_nameHint = 'instance name hint'; // XXX - Messages.admin_nameTitle = 'instance name title'; // XXX - Messages.admin_nameButton = 'instance name button'; // XXX - Messages.admin_namePlaceholder = 'instance name placeholder'; // XXX - create['name'] = function () { var key = 'name'; var $div = makeBlock(key, true); // Msg.admin_nameHint, Msg.admin_nameTitle, Msg.admin_nameButton - var $button = $div.find('button').addClass('cp-listing-action'); + var $button = $div.find('button').addClass('cp-listing-action').text(Messages.settings_save); var input = h('input.cp-listing-info', { type: 'text', - value: APP.instanceStatus.instanceName || '', - placeholder: Messages.admin_namePlaceholder, + value: APP.instanceStatus.instanceName || ApiConfig.httpUnsafeOrigin || '', + placeholder: ApiConfig.httpUnsafeOrigin, //Messages.admin_namePlaceholder, // XXX style: 'margin-bottom: 5px;', }); var $input = $(input); @@ -481,7 +468,7 @@ define([ var spinner = UI.makeSpinner($(innerDiv)); $button.click(function () { - if (!$input.val()) { return; } + if (!$input.val()) { return; } // XXX spinner.spin(); $button.attr('disabled', 'disabled'); sFrameChan.query('Q_ADMIN_RPC', { @@ -497,7 +484,7 @@ define([ return; } spinner.done(); - UI.log(Messages.saved); + UI.log(Messages._getKey('ui_saved', [Messages.admin_nameTitle])); }); }); @@ -506,21 +493,15 @@ define([ return $div; }; - - Messages.admin_descriptionHint = 'Description hint'; // XXX - Messages.admin_descriptionTitle = 'Description title'; // XXX - Messages.admin_descriptionButton = 'Description button'; // XXX - Messages.admin_descriptionPlaceholder = 'Description placeholder'; // XXX - create['description'] = function () { var key = 'description'; var $div = makeBlock(key, true); var textarea = h('textarea.cp-admin-description-text.cp-listing-info', { // XXX use something from UI elements? - placeholder: Messages.admin_descriptionPlaceholder, + placeholder: Messages.home_host || '', // XXX }, APP.instanceStatus.instanceDescription || ''); - var $button = $div.find('button'); + var $button = $div.find('button').text(Messages.settings_save); $button.addClass('cp-listing-action'); @@ -535,7 +516,7 @@ define([ var spinner = UI.makeSpinner($(innerDiv)); $button.click(function () { - if (!$input.val()) { return; } + if (!$input.val()) { return; } // XXX spinner.spin(); $button.attr('disabled', 'disabled'); sFrameChan.query('Q_ADMIN_RPC', { @@ -551,7 +532,7 @@ define([ return; } spinner.done(); - UI.log(Messages.saved); + UI.log(Messages._getKey('ui_saved', [Messages.admin_descriptionTitle])); }); }); diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index d7b401fa2..01e19f0ef 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1639,11 +1639,6 @@ define([ return $container; }; - Messages.info_termsFlavour = "XXX terms flavour"; // XXX - Messages.info_imprintFlavour = "XXX imprint flavour"; // XXX - Messages.info_roadmapFlavour = "XXX roadmap flavour"; // XXX - Messages.info_sourceFlavour = "XXX source flavour"; // XXX - UIElements.displayInfoMenu = function (Common, metadataMgr) { //var padType = metadataMgr.getMetadata().type; var priv = metadataMgr.getPrivateData(); @@ -1674,18 +1669,8 @@ define([ var legalLine = template(Messages.info_imprintFlavour, Pages.imprintLink); var privacyLine = template(Messages.info_privacyFlavour, Pages.privacyLink); - var faqLine = template(Messages.help_genericMore, Pages.docsLink); - - // XXX terms var termsLine = template(Messages.info_termsFlavour, Pages.termsLink); - - // XXX imprint - var imprintLine = template(Messages.info_imprintFlavour, Pages.imprintLink); - - // XXX roadmap - var roadmapLine = template(Messages.info_roadmapFlavour, Pages.roadmapLink); - var sourceLine = template(Messages.info_sourceFlavour, Pages.sourceLink); var content = h('div.cp-info-menu-container', [ @@ -1697,13 +1682,11 @@ define([ h('span', Pages.versionString) ]), h('hr'), - legalLine, - privacyLine, - termsLine, // XXX - imprintLine, // XXX faqLine, - roadmapLine, // XXX - sourceLine, // XXX + termsLine, + privacyLine, + legalLine, + sourceLine, ]); $(content).find('a').attr('target', '_blank'); diff --git a/www/support/ui.js b/www/support/ui.js index 6683ca6ad..2d1e13017 100644 --- a/www/support/ui.js +++ b/www/support/ui.js @@ -182,7 +182,7 @@ define([ return $select; }; - Messages.support_warning_prompt = "We may require additional information depending on the nature of your issue. Choose the most relevant category for suggestions."; + Messages.support_warning_prompt = "We may require additional information depending on the nature of your issue. Choose the most relevant category for suggestions."; // XXX Messages.support_warning_account = "CryptPad administrators are unable to identify accounts, teams, folders, and files by their names. Please provide their identifiers if your issue relates to one of these features."; // XXX Messages.support_warning_data = 'What data was lost? Is it entirely gone or only corrupted? Is it backed up? Can you provide a link to the content or at least its document id?'; // XXX