diff --git a/customize.dist/src/less2/include/toolbar.less b/customize.dist/src/less2/include/toolbar.less index 8e7879fce..d78fccade 100644 --- a/customize.dist/src/less2/include/toolbar.less +++ b/customize.dist/src/less2/include/toolbar.less @@ -71,6 +71,7 @@ button { height: @toolbar_line-height !important; outline: 0; + border-radius: @variables_radius; color: @toolbar-color; .toolbar_button; font: normal normal normal 14px/1 FontAwesome; diff --git a/customize.dist/translations/messages.js b/customize.dist/translations/messages.js index df4096367..833c4631e 100644 --- a/customize.dist/translations/messages.js +++ b/customize.dist/translations/messages.js @@ -13,6 +13,8 @@ define(['/common/translations/messages.js'], function (Messages) { // Replace the existing keys in your copied file here: // Messages.button_newpad = "New Rich Text Document"; + Messages.profile_remove_avatar = "Remove this avatar"; // XXX + return Messages; }); diff --git a/lib/http-worker.js b/lib/http-worker.js index 161dac8be..1aae2ee44 100644 --- a/lib/http-worker.js +++ b/lib/http-worker.js @@ -360,7 +360,9 @@ app.use('/block/', function (req, res, next) { // identified by base64-encoded public keys // skip everything else, ie. /block/placeholder.txt if (typeof(name) !== 'string' || name.length !== 44) { - return void next(); + return void res.status(404).json({ + error: "INVALID_ID", + }); } var authorization = req.headers.authorization; diff --git a/www/bounce/main.js b/www/bounce/main.js index e8d658602..ac4a10968 100644 --- a/www/bounce/main.js +++ b/www/bounce/main.js @@ -60,20 +60,9 @@ define(['/api/config'], function (ApiConfig) { window.location.href = target.href; }; - // Local URLs don't require any warning and can navigate directly without user input. - if (target.host === host.host) { return void go(); } - - // It's annoying to be prompted that you are leaving the platform to visit its docs - // but marking the docs domain as trusted undermines third-party admins' autonomy. - // If we ever abandon the cryptpad.fr domain someone could squat it and abuse this trust. - // If the docs domain is a subdomain of the current one then redirect automatically. - // We might make the docs domain configurable at some point in the future. - if (target.host === 'docs.cryptpad.org' && target.host.endsWith(host.host)) { - return void go(); - } - - // Everything else requires user input, so we load the platform's translations. + // Everything else may require user input, so we load the platform's translations. // FIXME: this seems to infer language preferences from the browser instead of the user's account preferences + require([ '/customize/messages.js', ], function (Messages) { @@ -86,6 +75,18 @@ define(['/api/config'], function (ApiConfig) { return void reject(); } + // Local URLs don't require any warning and can navigate directly without user input. + if (target.host === host.host) { return void go(); } + + // It's annoying to be prompted that you are leaving the platform to visit its docs + // but marking the docs domain as trusted undermines third-party admins' autonomy. + // If we ever abandon the cryptpad.fr domain someone could squat it and abuse this trust. + // If the docs domain is a subdomain of the current one then redirect automatically. + // We might make the docs domain configurable at some point in the future. + if (target.host === 'docs.cryptpad.org' && target.host.endsWith(host.host)) { + return void go(); + } + // The provided URL will navigate the user away from the outer domain. var question = Messages._getKey('bounce_confirm', [host.hostname, target.href]); // Confirm that they want to leave, then navigate or reject based on their choice. diff --git a/www/profile/app-profile.less b/www/profile/app-profile.less index 924102787..832354551 100644 --- a/www/profile/app-profile.less +++ b/www/profile/app-profile.less @@ -6,6 +6,7 @@ @import (reference) '../../customize/src/less2/include/framework.less'; @import (reference) '../../customize/src/less2/include/sidebar-layout.less'; +@import (reference) '../../customize/src/less2/include/variables.less'; &.cp-app-profile { @@ -21,36 +22,38 @@ display: none !important; } + #cp-app-profile-header { display: flex; + flex-flow: row wrap; + justify-content: center; #cp-app-profile-rightside { flex: 1; display: flex; flex-flow: column; align-items: start; + max-width: 100%; } } #cp-app-profile-avatar { - width: 300px; - //height: 350px; margin: 10px; margin-right: 20px; text-align: center; + max-width: 300px; + max-height: 300px; + margin-bottom: 3.5rem; &> span { display: inline-block; text-align: center; - height: 300px; - width: 300px; - border: 1px solid @cp_profile-border; border-radius: 4px; overflow: hidden; position: relative; .cp-app-profile-avatar-delete { right: 0; position: absolute; - opacity: 0.7; + opacity: 1; &:hover { - opacity: 1; + opacity: 0.7; } } } @@ -58,6 +61,7 @@ max-width: 100%; max-height: 100%; vertical-align: top; + border-radius: @variables_radius_L; } media-tag { height: 100%; @@ -79,11 +83,18 @@ margin: 5px !important; } } + .cp-app-profile-resizer { text-align: center; } - #cp-app-profile-displayname, #cp-app-profile-link { - margin: 10px 0; + .cp-app-profile-displayname { + margin-top: 1rem; + } + .cp-app-profile-section:empty { + display: none; + } + .cp-app-profile-displayname, .cp-app-profile-link, .cp-app-profile-section { + margin-bottom: 1rem; input { width: 100%; font-size: 20px; @@ -108,7 +119,8 @@ } .cp-app-profile-link { font-size: 25px; - vertical-align: middle; + display: inline; + overflow-wrap: anywhere; } .cp-app-profile-displayname, .cp-app-profile-link { line-height: 40px; @@ -127,8 +139,19 @@ & > button:empty { margin-left: 25px !important; } + @media screen and (max-width: @browser_media-medium-screen) { + .cp-app-profile-link-code { + min-width: 0; + } + } } + div.cp-app-profile-mute-container.cp-app-profile-section { + p { + margin-bottom: 0; + } + + } .cp-app-profile-friend { display: flex; align-items: center; @@ -146,22 +169,16 @@ #cp-app-profile-invite-button { float: right; } - .cp-app-profile-viewprofile-button { - margin-bottom: 5px !important; - } #cp-app-profile-description { position: relative; font-size: 16px; - margin-bottom: 20px; + //margin-bottom: 20px; .cp-app-profile-description-code { display: none; } - .cp-app-profile-description-rendered { - border: 1px solid @cp_profile-border; - padding: 0 15px; - &:empty { - display: none; - } + #cp-app-profile-description-info { + overflow-wrap: anywhere; + margin-top: 1rem; } .cp-app-profile-description-ok, .cp-app-profile-description-spin { position: absolute; @@ -178,6 +195,7 @@ font-family: monospace; font-size: 16px; line-height: initial; + max-width: 31rem; pre { margin: 0; font-family: inherit; @@ -194,7 +212,6 @@ justify-content: center; } .cp-app-profile-mute-container { - margin-top: 5px; p { margin-top: 5px; font-size: 13px; diff --git a/www/profile/inner.js b/www/profile/inner.js index f46e09315..2b55f26aa 100644 --- a/www/profile/inner.js +++ b/www/profile/inner.js @@ -96,6 +96,7 @@ define([ var HEADER_ID = "cp-app-profile-header"; var HEADER_RIGHT_ID = "cp-app-profile-rightside"; var VIEW_PROFILE_BUTTON = 'cp-app-profile-viewprofile-button'; + var PROFILE_SECTION = "cp-app-profile-section"; var common; var sFrameChan; @@ -108,25 +109,32 @@ define([ var hash = common.getMetadataMgr().getPrivateData().hashes.viewHash; var url = APP.origin + '/profile/#' + hash; - $('