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,134 @@
'use strict';
var Base = require('../base');
/**
* Abstraction around settings do not track panel
* @constructor
* @param {Marionette.Client} client for operations.
*/
function LanguagePanel(client) {
// Call the Base constructor to initiate base class.
Base.call(this, client, null, LanguagePanel.Selectors);
}
module.exports = LanguagePanel;
LanguagePanel.Selectors = {
'languagePanel': '#languages',
'body': 'body',
'header': 'gaia-header',
'languageChangeSelect': '#languages select[name="language.current"]',
'languageLabel': 'p[data-l10n-id="language"]',
'languageRegionDateLabel': '#region-date'
};
LanguagePanel.prototype = {
__proto__: Base.prototype,
// The \u202a, \u202b and \u202c are special Unicode formatting codes which
// force the direction of the text between them. They are added by
// LanguageList.wrapBidi to ensure proper display of all language names.
_languageMap: {
english: {
label: 'Language',
desc: '\u202aEnglish (US)\u202c',
dayRules: /Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday/
},
accented: {
label: 'Ŀȧȧƞɠŭŭȧȧɠḗḗ',
desc: '\u202aƤȧȧƈķȧȧɠḗḗḓ Ȧȧƈƈḗḗƞŧḗḗḓ\u202c',
dayRules: new RegExp(
'lundi|' +
'mardi|' +
'mercredi|' +
'jeudi|' +
'vendredi|' +
'samedi|' +
'dimanche')
},
bidi: {
label: '\u202e˥ɐuƃnɐƃǝ\u202c',
desc: '\u202b\u202eԀɐɔʞɐƃǝp\u202c \u202eԐıpı\u202c\u202c',
dayRules: new RegExp(
'الاثنين|' +
'الثلاثاء|' +
'الأربعاء|' +
'الخميس|' +
'الجمعة|' +
'السبت|' +
'الأحد')
}
},
get regionDateLabel() {
return this.findElement('languageRegionDateLabel').text();
},
get currentLanguageFromMozSettings() {
return this.client.settings.get('language.current');
},
get currentLanguageLabel() {
return this.findElement('languageLabel').text();
},
get currentLanguage() {
var languageLabel = this.currentLanguageLabel;
var realLanguage;
for (var languageKey in this._languageMap) {
if (this._languageMap[languageKey].label === languageLabel) {
realLanguage = languageKey;
break;
}
}
return realLanguage;
},
set currentLanguage(value) {
if (this._languageMap[value]) {
var oldLanguage = this.currentLanguage;
this.tapSelectOption('languageChangeSelect',
this._languageMap[value].desc);
this.client.waitFor(function() {
var newLanguage = this.currentLanguage;
return oldLanguage !== newLanguage;
}.bind(this));
}
},
setupDefaultLanguage: function() {
if (this.currentLanguage !== 'english') {
this.currentLanguage = 'english';
}
},
isSampleFormatTranslated: function(languageKey) {
if (this._languageMap[languageKey]) {
var rule = this._languageMap[languageKey].dayRules;
if (this.regionDateLabel.match(rule)) {
return true;
}
}
return false;
},
back: function() {
var parentSection = this.waitForElement('languagePanel');
var bodyWidth = this.findElement('body').size().width;
this.client.switchToShadowRoot(this.findElement('header'));
this.client.findElement('[action="back"] button').tap();
this.client.switchToShadowRoot();
this.client.waitFor(function() {
var loc = parentSection.location();
return Math.abs(loc.x) >= bodyWidth;
});
}
};