Add 'Join team' and 'Decline' buttons
This commit is contained in:
@@ -1060,16 +1060,25 @@ define([
|
|||||||
errorBlock = h('div.alert.alert-danger', {style: 'display: none;'}),
|
errorBlock = h('div.alert.alert-danger', {style: 'display: none;'}),
|
||||||
div
|
div
|
||||||
]);
|
]);
|
||||||
var inviteDiv = h('div');
|
var declineButton = h('button.btn.btn-danger', Messages.friendRequest_decline);
|
||||||
|
var acceptButton = h('button.btn.btn-primary', 'JOIN TEAM'); // XXX
|
||||||
|
var inviteDiv = h('div', [
|
||||||
|
h('nav', [
|
||||||
|
declineButton,
|
||||||
|
acceptButton
|
||||||
|
])
|
||||||
|
]);
|
||||||
var $inviteDiv = $(inviteDiv);
|
var $inviteDiv = $(inviteDiv);
|
||||||
|
|
||||||
|
$(declineButton).click(function() {
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
var process = function (pw) {
|
var process = function (pw) {
|
||||||
$inviteDiv.empty();
|
$inviteDiv.empty();
|
||||||
var bytes64;
|
var bytes64;
|
||||||
|
|
||||||
|
|
||||||
var button = h('button', 'XXX');
|
|
||||||
button.onclick = function () {
|
|
||||||
nThen(function (waitFor) {
|
nThen(function (waitFor) {
|
||||||
$inviteDiv.append(h('div', [
|
$inviteDiv.append(h('div', [
|
||||||
h('i.fa.fa-spin.fa-spinner'),
|
h('i.fa.fa-spin.fa-spinner'),
|
||||||
@@ -1094,9 +1103,6 @@ define([
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$inviteDiv.append(button);
|
|
||||||
};
|
|
||||||
|
|
||||||
nThen(function (waitFor) {
|
nThen(function (waitFor) {
|
||||||
InviteInner.getPreviewContent(seeds, {
|
InviteInner.getPreviewContent(seeds, {
|
||||||
origin: privateData.origin
|
origin: privateData.origin
|
||||||
@@ -1149,22 +1155,24 @@ define([
|
|||||||
if (!password) { return; }
|
if (!password) { return; }
|
||||||
|
|
||||||
// If there is a password, display the password prompt
|
// If there is a password, display the password prompt
|
||||||
$inviteDiv.append(h('p', 'Please enter the invitation password to continue...')); // XXX
|
|
||||||
var pwInput = UI.passwordInput();
|
var pwInput = UI.passwordInput();
|
||||||
var submitPw = h('button.btn.btn-secondary', Messages.password_submit);
|
$(acceptButton).click(function () {
|
||||||
$(submitPw).click(function () {
|
|
||||||
var val = $(pwInput).find('input').val();
|
var val = $(pwInput).find('input').val();
|
||||||
if (!val) { return; }
|
if (!val) { return; }
|
||||||
process(val);
|
process(val);
|
||||||
});
|
});
|
||||||
$inviteDiv.append(pwInput);
|
$inviteDiv.prepend(h('div', [
|
||||||
$inviteDiv.append(submitPw);
|
h('p', 'Please enter the invitation password to continue...'),
|
||||||
|
pwInput
|
||||||
|
])); // XXX
|
||||||
waitFor.abort();
|
waitFor.abort();
|
||||||
}).nThen(function () {
|
}).nThen(function () {
|
||||||
// No password, display the invitation proposal
|
// No password, display the invitation proposal
|
||||||
|
$(acceptButton).click(function () {
|
||||||
process('');
|
process('');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
var redrawTeam = function (common) {
|
var redrawTeam = function (common) {
|
||||||
if (!APP.team) { return; }
|
if (!APP.team) { return; }
|
||||||
|
|||||||
Reference in New Issue
Block a user