From 4250688856d92214c6ca6e332947e8b9f70a30ba Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 30 Oct 2017 18:49:28 +0100 Subject: [PATCH] Migrate profile to use sframe --- customize.dist/pages.js | 2 +- customize.dist/src/less2/main.less | 1 + www/common/sframe-common-interface.js | 1 + www/common/sframe-protocol.js | 4 + www/profile/index.html | 50 ++- www/profile/main.js | 595 ++++---------------------- www/profile/main.less | 143 ------- 7 files changed, 120 insertions(+), 676 deletions(-) delete mode 100644 www/profile/main.less diff --git a/customize.dist/pages.js b/customize.dist/pages.js index 793f2133e..7f9583828 100644 --- a/customize.dist/pages.js +++ b/customize.dist/pages.js @@ -728,7 +728,7 @@ define([ Pages['/profile/'] = Pages['/profile/index.html'] = function () { return [ - h('div#toolbar'), + h('div#cp-toolbar'), h('div#container'), loadingScreen() ]; diff --git a/customize.dist/src/less2/main.less b/customize.dist/src/less2/main.less index c000248ba..38c242b10 100644 --- a/customize.dist/src/less2/main.less +++ b/customize.dist/src/less2/main.less @@ -34,4 +34,5 @@ body.cp-app-contacts { @import "../../../contacts/app-contacts.less"; } body.cp-app-poll { @import "../../../poll/app-poll.less"; } body.cp-app-whiteboard { @import "../../../whiteboard/app-whiteboard.less"; } body.cp-app-todo { @import "../../../todo/app-todo.less"; } +body.cp-app-profile { @import "../../../profile/app-profile.less"; } diff --git a/www/common/sframe-common-interface.js b/www/common/sframe-common-interface.js index e023e8f11..70c79fae4 100644 --- a/www/common/sframe-common-interface.js +++ b/www/common/sframe-common-interface.js @@ -339,6 +339,7 @@ define([ $img.attr('src', src); $img.attr('data-crypto-key', 'cryptpad:' + cryptKey); UI.displayMediatagImage(Common, $img, function (err, $image, img) { + if (err) { return void console.error(err); } var w = img.width; var h = img.height; if (w>h) { diff --git a/www/common/sframe-protocol.js b/www/common/sframe-protocol.js index d568592ed..846502120 100644 --- a/www/common/sframe-protocol.js +++ b/www/common/sframe-protocol.js @@ -168,4 +168,8 @@ define({ // in the drive at registration. 'Q_MERGE_ANON_DRIVE': true, + // Add or remove the avatar from the profile. + // We have to pin/unpin the avatar and store/remove the value from the user object + 'Q_PROFILE_AVATAR_ADD': true, + 'Q_PROFILE_AVATAR_REMOVE': true }); diff --git a/www/profile/index.html b/www/profile/index.html index 5200564ce..e3f7eacc4 100644 --- a/www/profile/index.html +++ b/www/profile/index.html @@ -1,20 +1,38 @@ - - + - CryptPad: Zero Knowledge, Collaborative Real Time Editing + CryptPad - - - - - - - + + + + - - - + +