add "copy shareable link" button to "profile" page

pull/1/head
yflory 5 years ago
parent 7816c17cb5
commit c7ca50c934

@ -122,9 +122,13 @@
#cp-app-profile-invite-button {
float: right;
}
#cp-app-profile-viewprofile-button {
.cp-app-profile-viewprofile-button {
margin-bottom: 20px;
float: right;
margin-left: 5px;
&> span {
margin-left: 10px;
}
}
#cp-app-profile-description {
position: relative;

@ -9,6 +9,7 @@ define([
'/common/common-interface.js',
'/common/common-ui-elements.js',
'/common/common-realtime.js',
'/common/clipboard.js',
'/common/hyperscript.js',
'/customize/messages.js',
'/customize/application_config.js',
@ -36,6 +37,7 @@ define([
UI,
UIElements,
Realtime,
Clipboard,
h,
Messages,
AppConfig,
@ -96,15 +98,20 @@ define([
var hash = common.getMetadataMgr().getPrivateData().hashes.viewHash;
var url = APP.origin + '/profile/#' + hash;
var $button = $('<button>', {
'class': 'btn btn-success',
id: VIEW_PROFILE_BUTTON,
})
.text(Messages.profile_viewMyProfile)
.click(function () {
$('<button>', {
'class': 'btn btn-success '+VIEW_PROFILE_BUTTON,
}).text(Messages.profile_viewMyProfile).click(function () {
window.open(url, '_blank');
});
$container.append($button);
}).appendTo($container);
$('<button>', {
'class': 'btn btn-success '+VIEW_PROFILE_BUTTON,
}).append(h('i.fa.fa-shhare-alt'))
.append(h('span', Messages.shareButton))
.click(function () {
var success = Clipboard.copy(url);
if (success) { UI.log(Messages.shareSuccess); }
}).appendTo($container);
};
var addDisplayName = function ($container) {

Loading…
Cancel
Save