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:
OverSu 2026-09-30 23:13:03 +02:00
commit b38dea0597
25901 changed files with 9982925 additions and 369 deletions

View file

@ -0,0 +1,68 @@
'use strict';
/*jshint node: true, browser: true */
/*global marionetteScriptFinished */
/**
* Manipulates email's data APIs in the app.
*/
function EmailData(client) {
this.client = client;
}
module.exports = EmailData;
EmailData.prototype = {
/**
* Gets the current account for the given account ID. Just returns the
* _wireRep as that will survive the serialization hops.
* @param {String} accountId
* @return {Object} the account._wireRep object, or undefined if not found.
*/
getCurrentAccount: function() {
var client = this.client;
return client.executeAsyncScript(function() {
var model = window.wrappedJSObject.require('model_create').defaultModel;
model.latest('account', function(account) {
marionetteScriptFinished(account._wireRep);
});
});
},
/**
* Gets the current account for the given account ID. Just returns the
* _wireRep as that will survive the serialization hops.
* @param {String} accountId
* @return {Object} the account._wireRep object, or undefined if not found.
*/
waitForCurrentAccountUpdate: function(key, value) {
var client = this.client;
return client.executeAsyncScript(function(key, value) {
var account,
model = window.wrappedJSObject.require('model_create').defaultModel,
acctsSlice = model.api.viewAccounts(false);
function checkDone() {
if (account[key] === value) {
acctsSlice.die();
marionetteScriptFinished(true);
}
}
acctsSlice.oncomplete = function() {
account = acctsSlice.defaultAccount;
checkDone();
};
acctsSlice.onchange = function(item) {
if (account) {
if (account.id === item.id) {
checkDone();
}
}
};
}, [key, value]);
}
};
require('./debug')('email_data', EmailData.prototype);