|
|
@ -1076,7 +1076,7 @@ define([
|
|
|
|
var $div = $(div);
|
|
|
|
var $div = $(div);
|
|
|
|
var errorBlock;
|
|
|
|
var errorBlock;
|
|
|
|
var c = [
|
|
|
|
var c = [
|
|
|
|
h('h2', Messages.team_inviteTitle || 'Team invitation'), // XXX
|
|
|
|
h('h2', Messages.team_inviteTitle),
|
|
|
|
errorBlock = h('div.alert.alert-danger',
|
|
|
|
errorBlock = h('div.alert.alert-danger',
|
|
|
|
wrongPassword ? undefined : {style: 'display: none;'},
|
|
|
|
wrongPassword ? undefined : {style: 'display: none;'},
|
|
|
|
wrongPassword ? Messages.drive_sfPasswordError : undefined),
|
|
|
|
wrongPassword ? Messages.drive_sfPasswordError : undefined),
|
|
|
@ -1089,7 +1089,7 @@ define([
|
|
|
|
var declineButton = h('button.btn.btn-danger', {
|
|
|
|
var declineButton = h('button.btn.btn-danger', {
|
|
|
|
style: 'display: none;'
|
|
|
|
style: 'display: none;'
|
|
|
|
}, Messages.friendRequest_decline);
|
|
|
|
}, Messages.friendRequest_decline);
|
|
|
|
var acceptButton = h('button.btn.btn-primary', Messages.team_inviteJoin || 'JOIN TEAM'); // XXX
|
|
|
|
var acceptButton = h('button.btn.btn-primary', Messages.team_inviteJoin);
|
|
|
|
var inviteDiv = h('div', [
|
|
|
|
var inviteDiv = h('div', [
|
|
|
|
h('nav', [
|
|
|
|
h('nav', [
|
|
|
|
declineButton,
|
|
|
|
declineButton,
|
|
|
@ -1112,7 +1112,7 @@ define([
|
|
|
|
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'),
|
|
|
|
spinnerText = h('span', Messages.team_invitePasswordLoading || 'Scrypt...') // XXX
|
|
|
|
spinnerText = h('span', Messages.team_invitePasswordLoading || 'Scrypt...')
|
|
|
|
]));
|
|
|
|
]));
|
|
|
|
$spinner = $(spinnerText);
|
|
|
|
$spinner = $(spinnerText);
|
|
|
|
setTimeout(waitFor(), 150);
|
|
|
|
setTimeout(waitFor(), 150);
|
|
|
@ -1122,7 +1122,7 @@ define([
|
|
|
|
bytes64 = bytes;
|
|
|
|
bytes64 = bytes;
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
}).nThen(function (waitFor) {
|
|
|
|
}).nThen(function (waitFor) {
|
|
|
|
$spinner.text(Messages.team_inviteGetData || 'get team data'); // XXX
|
|
|
|
$spinner.text(Messages.team_inviteGetData);
|
|
|
|
APP.module.execCommand('ACCEPT_LINK_INVITATION', {
|
|
|
|
APP.module.execCommand('ACCEPT_LINK_INVITATION', {
|
|
|
|
bytes64: bytes64,
|
|
|
|
bytes64: bytes64,
|
|
|
|
hash: hash,
|
|
|
|
hash: hash,
|
|
|
@ -1172,23 +1172,21 @@ define([
|
|
|
|
var sframeChan = common.getSframeChannel();
|
|
|
|
var sframeChan = common.getSframeChannel();
|
|
|
|
sframeChan.query('Q_ANON_GET_PREVIEW_CONTENT', { seeds: seeds }, waitFor(function (err, json) {
|
|
|
|
sframeChan.query('Q_ANON_GET_PREVIEW_CONTENT', { seeds: seeds }, waitFor(function (err, json) {
|
|
|
|
if (json && json.error) {
|
|
|
|
if (json && json.error) {
|
|
|
|
// XXX APP.module is not ready yet?
|
|
|
|
|
|
|
|
// err === DELETED: different message?
|
|
|
|
// err === DELETED: different message?
|
|
|
|
$(errorBlock).text(Messages.error + json.error).show(); // XXX
|
|
|
|
$(errorBlock).text(Messages.error + json.error).show(); // XXX
|
|
|
|
waitFor.abort();
|
|
|
|
waitFor.abort();
|
|
|
|
$div.empty();
|
|
|
|
$div.empty();
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
// XXX handle errors
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$div.empty();
|
|
|
|
$div.empty();
|
|
|
|
$div.append(h('div.cp-teams-invite-from', [
|
|
|
|
$div.append(h('div.cp-teams-invite-from', [
|
|
|
|
Messages.team_inviteFrom || 'From:', // XXX
|
|
|
|
Messages.team_inviteFrom || 'From:',
|
|
|
|
displayUser(common, json.author)
|
|
|
|
displayUser(common, json.author)
|
|
|
|
]));
|
|
|
|
]));
|
|
|
|
$div.append(UI.setHTML(h('p.cp-teams-invite-to'),
|
|
|
|
$div.append(UI.setHTML(h('p.cp-teams-invite-to'),
|
|
|
|
Messages._getKey('team_inviteFromMsg',
|
|
|
|
Messages._getKey('team_inviteFromMsg',
|
|
|
|
[Util.fixHTML(json.author.displayName),
|
|
|
|
[Util.fixHTML(json.author.displayName),
|
|
|
|
Util.fixHTML(json.teamName)]))); // XXX
|
|
|
|
Util.fixHTML(json.teamName)])));
|
|
|
|
if (json.message) {
|
|
|
|
if (json.message) {
|
|
|
|
$div.append(h('div.cp-teams-invite-message', json.message));
|
|
|
|
$div.append(h('div.cp-teams-invite-message', json.message));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1199,7 +1197,7 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
// If you're not logged in, display the login buttons
|
|
|
|
// If you're not logged in, display the login buttons
|
|
|
|
var anonLogin, anonRegister;
|
|
|
|
var anonLogin, anonRegister;
|
|
|
|
$div.append(h('p', Messages.team_invitePleaseLogin || 'Please log in or register to accept this invitation...')); // XXX
|
|
|
|
$div.append(h('p', Messages.team_invitePleaseLogin || 'Please log in or register to accept this invitation...'));
|
|
|
|
$div.append(h('div', [
|
|
|
|
$div.append(h('div', [
|
|
|
|
anonLogin = h('button.btn.btn-primary', Messages.login_login),
|
|
|
|
anonLogin = h('button.btn.btn-primary', Messages.login_login),
|
|
|
|
anonRegister = h('button.btn.btn-secondary', Messages.login_register),
|
|
|
|
anonRegister = h('button.btn.btn-secondary', Messages.login_register),
|
|
|
@ -1229,7 +1227,7 @@ define([
|
|
|
|
process(val);
|
|
|
|
process(val);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
$inviteDiv.prepend(h('div.cp-teams-invite-password', [
|
|
|
|
$inviteDiv.prepend(h('div.cp-teams-invite-password', [
|
|
|
|
h('p', Messages.team_inviteEnterPassword || 'Please enter the invitation password to continue...'), // XXX
|
|
|
|
h('p', Messages.team_inviteEnterPassword),
|
|
|
|
pwInput
|
|
|
|
pwInput
|
|
|
|
]));
|
|
|
|
]));
|
|
|
|
waitFor.abort();
|
|
|
|
waitFor.abort();
|
|
|
|