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 * Show the sign-up panel
*/ */
function showSignUp() { 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) getFirefoxAccountSignedInUser(function(userdata)
{ {
var fxasignedin = (typeof userdata == 'object' && userdata !== null) ? '1' : '0'; var fxasignedin = (typeof userdata == 'object' && userdata !== null) ? '1' : '0';
@ -156,7 +138,7 @@ var pktUI = (function() {
{ {
startheight = overflowMenuHeight; startheight = overflowMenuHeight;
} }
else else if (pktApi.getSignupAB().indexOf('storyboard') > -1)
{ {
startheight = 460; startheight = 460;
if (fxasignedin == '1') if (fxasignedin == '1')
@ -164,6 +146,13 @@ var pktUI = (function() {
startheight = 406; startheight = 406;
} }
} }
else
{
if (fxasignedin == '1')
{
startheight = 436;
}
}
var variant; var variant;
if (inOverflowMenu) if (inOverflowMenu)
{ {
@ -171,17 +160,16 @@ var pktUI = (function() {
} }
else 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(), { var panelId = showPanel("about:pocket-signup?pockethost=" + Services.prefs.getCharPref("extensions.pocket.site") + "&fxasignedin=" + fxasignedin + "&variant=" + variant + '&inoverflowmenu=' + inOverflowMenu + "&locale=" + getUILocale(), {
onShow: function() { onShow: function() {
}, },
onHide: panelDidHide, onHide: panelDidHide,
width: inOverflowMenu ? overflowMenuWidth : 300, width: inOverflowMenu ? overflowMenuWidth : 300,
height: startheight height: startheight
});
}); });
});
} }
/** /**

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

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

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

@ -609,32 +609,24 @@ var pktApi = (function() {
/** /**
* Helper function to get current signup AB group the user is in * Helper function to get current signup AB group the user is in
*/ */
function getSignupPanelTabTestVariant() { function getSignupAB() {
return getSimpleTestOption('panelTab', 0.1, 'tab'); var setting = getSetting('signupAB');
} if (!setting || setting.includes('hero'))
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)
{ {
if (Math.random() <= threshold) { var rand = (Math.floor(Math.random()*100+1));
assignedValue = testOptionName; if (rand > 90)
{
setting = 'storyboard_nlm';
} }
else { else
assignedValue = 'control'; {
setting = 'storyboard_lm';
} }
setSetting('signupAB',setting);
setSetting('test.'+testName, assignedValue);
} }
return setting;
return assignedValue;
} }
/** /**
* Public functions * Public functions
*/ */
@ -649,6 +641,6 @@ var pktApi = (function() {
isPremiumUser: isPremiumUser, isPremiumUser: isPremiumUser,
getSuggestedTagsForItem: getSuggestedTagsForItem, getSuggestedTagsForItem: getSuggestedTagsForItem,
getSuggestedTagsForURL: getSuggestedTagsForURL, getSuggestedTagsForURL: getSuggestedTagsForURL,
getSignupPanelTabTestVariant: getSignupPanelTabTestVariant, getSignupAB: getSignupAB
}; };
}()); }());

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

@ -10,7 +10,7 @@
<Description about="urn:mozilla:install-manifest"> <Description about="urn:mozilla:install-manifest">
<em:id>firefox@getpocket.com</em:id> <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:type>2</em:type>
<em:bootstrap>true</em:bootstrap> <em:bootstrap>true</em:bootstrap>