Backed out changeset 0b20196061d7 (bug 1276054) for browser_UITour_pocket.js failures.

This commit is contained in:
Ryan VanderMeulen 2016-06-24 15:41:09 -04:00
Родитель ad739df391
Коммит 3b8f6019c4
4 изменённых файлов: 33 добавлений и 53 удалений

Просмотреть файл

@ -128,24 +128,6 @@ var pktUI = (function() {
* Show the sign-up panel
*/
function showSignUp() {
// AB test: Direct logged-out users to tab vs panel
if (pktApi.getSignupPanelTabTestVariant() == 'tab')
{
let site = Services.prefs.getCharPref("extensions.pocket.site");
openTabWithUrl('https://' + site + '/firefox_learnmore?src=ff_ext&s=ffi&t=buttonclick', true);
// force the panel closed before it opens
// wrapped in setTimeout to avoid race condition after logging out
// if this test goes to 100%, we should move this logic up before
// the panel is actually opened
setTimeout(function() {
getPanel().hidePopup();
}, 0);
return;
}
// Control: Show panel as normal
getFirefoxAccountSignedInUser(function(userdata)
{
var fxasignedin = (typeof userdata == 'object' && userdata !== null) ? '1' : '0';
@ -156,7 +138,7 @@ var pktUI = (function() {
{
startheight = overflowMenuHeight;
}
else
else if (pktApi.getSignupAB().indexOf('storyboard') > -1)
{
startheight = 460;
if (fxasignedin == '1')
@ -164,6 +146,13 @@ var pktUI = (function() {
startheight = 406;
}
}
else
{
if (fxasignedin == '1')
{
startheight = 436;
}
}
var variant;
if (inOverflowMenu)
{
@ -171,17 +160,16 @@ var pktUI = (function() {
}
else
{
variant = 'storyboard_lm';
variant = pktApi.getSignupAB();
}
var panelId = showPanel("about:pocket-signup?pockethost=" + Services.prefs.getCharPref("extensions.pocket.site") + "&fxasignedin=" + fxasignedin + "&variant=" + variant + '&inoverflowmenu=' + inOverflowMenu + "&locale=" + getUILocale(), {
onShow: function() {
},
onHide: panelDidHide,
width: inOverflowMenu ? overflowMenuWidth : 300,
height: startheight
});
});
});
}
/**

Просмотреть файл

@ -104,7 +104,7 @@ PKT_SIGNUP_OVERLAY.prototype = {
this.dictJSON.variant = (this.variant ? this.variant : 'undefined');
this.dictJSON.variant += this.fxasignedin ? '_fxa' : '_nonfxa';
this.dictJSON.pockethost = this.pockethost;
this.dictJSON.showlearnmore = true;
this.dictJSON.showlearnmore = (this.variant.indexOf('_lm') > -1 || this.variant == 'storyboard' || this.variant == 'hero') ? 1 : 0;
// extra modifier class for collapsed state
if (this.inoverflowmenu)
@ -119,14 +119,14 @@ PKT_SIGNUP_OVERLAY.prototype = {
}
// Create actual content
if (this.variant == 'overflow')
{
$('body').append(Handlebars.templates.signup_shell(this.dictJSON));
}
else
{
$('body').append(Handlebars.templates.signupstoryboard_shell(this.dictJSON));
}
if (this.variant == 'storyboard' || this.variant == 'storyboard_lm' || this.variant == 'storyboard_nlm')
{
$('body').append(Handlebars.templates.signupstoryboard_shell(this.dictJSON));
}
else
{
$('body').append(Handlebars.templates.signup_shell(this.dictJSON));
}
// tell background we're ready

Просмотреть файл

@ -609,32 +609,24 @@ var pktApi = (function() {
/**
* Helper function to get current signup AB group the user is in
*/
function getSignupPanelTabTestVariant() {
return getSimpleTestOption('panelTab', 0.1, 'tab');
}
function getSimpleTestOption(testName, threshold, testOptionName) {
// Get the test from preferences if we've already assigned the user to a test
var settingName = 'test.' + testName;
var assignedValue = getSetting(settingName);
// If not assigned yet, pick and store a value
if (!assignedValue)
function getSignupAB() {
var setting = getSetting('signupAB');
if (!setting || setting.includes('hero'))
{
if (Math.random() <= threshold) {
assignedValue = testOptionName;
var rand = (Math.floor(Math.random()*100+1));
if (rand > 90)
{
setting = 'storyboard_nlm';
}
else {
assignedValue = 'control';
else
{
setting = 'storyboard_lm';
}
setSetting('test.'+testName, assignedValue);
setSetting('signupAB',setting);
}
return assignedValue;
return setting;
}
/**
* Public functions
*/
@ -649,6 +641,6 @@ var pktApi = (function() {
isPremiumUser: isPremiumUser,
getSuggestedTagsForItem: getSuggestedTagsForItem,
getSuggestedTagsForURL: getSuggestedTagsForURL,
getSignupPanelTabTestVariant: getSignupPanelTabTestVariant,
getSignupAB: getSignupAB
};
}());

Просмотреть файл

@ -10,7 +10,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>firefox@getpocket.com</em:id>
<em:version>1.0.4</em:version>
<em:version>1.0.3b1</em:version>
<em:type>2</em:type>
<em:bootstrap>true</em:bootstrap>