Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
67
gaia/apps/email/js/cards/setup_fix_mixin.js
Executable file
67
gaia/apps/email/js/cards/setup_fix_mixin.js
Executable file
|
|
@ -0,0 +1,67 @@
|
|||
/**
|
||||
* Mixin for the setup_fix_* cases.
|
||||
*/
|
||||
'use strict';
|
||||
define(function(require) {
|
||||
|
||||
var mozL10n = require('l10n!'),
|
||||
cards = require('cards');
|
||||
|
||||
return {
|
||||
extraClasses: ['anim-fade', 'anim-overlay'],
|
||||
|
||||
onArgs: function(args) {
|
||||
this.account = args.account;
|
||||
this.whichSide = args.whichSide; // incoming or outgoing
|
||||
this.restoreCard = args.restoreCard;
|
||||
|
||||
var type = this.account.type;
|
||||
// In the case of IMAP/POP3, they _might_ have two different
|
||||
// passwords, one for IMAP/POP3 and one for SMTP. We need to clarify
|
||||
// which one we're asking for. (It does not need l10n because it's a
|
||||
// protocol.)
|
||||
if (type === 'imap+smtp' || type === 'pop3+smtp') {
|
||||
var l10nString = null;
|
||||
if (this.whichSide === 'incoming') {
|
||||
if (type === 'imap+smtp') {
|
||||
l10nString = 'settings-account-clarify-imap';
|
||||
} else {
|
||||
l10nString = 'settings-account-clarify-pop3';
|
||||
}
|
||||
} else {
|
||||
l10nString = 'settings-account-clarify-smtp';
|
||||
}
|
||||
mozL10n.setAttributes(this.accountNode, l10nString,
|
||||
{ 'account-name': this.account.name });
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Assume we will be successful; update the password, trigger a reauth
|
||||
* attempt, then close the card.
|
||||
*/
|
||||
onUsePassword: function() {
|
||||
var password = this.passwordNode.value;
|
||||
if (password) {
|
||||
this.account.modifyAccount(this.whichSide === 'incoming' ?
|
||||
{ password: password } :
|
||||
{ outgoingPassword: password },
|
||||
this.proceed.bind(this));
|
||||
} else {
|
||||
this.proceed();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* After potentially modifying the account, continue onward.
|
||||
*/
|
||||
proceed: function() {
|
||||
this.account.clearProblems();
|
||||
cards.removeCardAndSuccessors(this, 'animate', 1, this.restoreCard);
|
||||
},
|
||||
|
||||
die: function() {
|
||||
// no special cleanup required
|
||||
}
|
||||
};
|
||||
});
|
||||
Loading…
Reference in a new issue