Skip to content

Commit

Permalink
Review cleanup pt. 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jpetto committed Feb 11, 2015
1 parent ebd4760 commit d0cea3c
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ <h2>{{ _('Thanks for signing up!') }}</h2>
{{ _('See who’s tracking your web browsing and block them with Ghostery.') }}
</p>

<iframe class="addon" data-src="//addons-dev.allizom.org/static/html/mozorg/ghostery.html" frameborder="0" scrolling="no"></iframe>
<iframe class="addon" data-src="//addons.mozilla.org/static/html/mozorg/ghostery.html" frameborder="0" scrolling="no"></iframe>
</li>
</ul>
</div>{#-- /#fxa-extra --#}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h2 id="heading2">

<div class="iframe-wrapper">
<div class="iframe-overlay">{{ _('Added to toolbar') }}</div>
<iframe class="addon" data-src="//addons-dev.allizom.org/static/html/mozorg/ghostery.html" frameborder="0" scrolling="no"></iframe>
<iframe class="addon" data-src="//addons.mozilla.org/static/html/mozorg/ghostery.html" frameborder="0" scrolling="no"></iframe>
</div>

<div id="yt-ghostery" class="youtube"></div>
Expand All @@ -96,7 +96,7 @@ <h2 id="heading2">

<div class="iframe-wrapper">
<div class="iframe-overlay">{{ _('Added to toolbar') }}</div>
<iframe class="addon" data-src="//addons-dev.allizom.org/static/html/mozorg/lightbeam.html" frameborder="0" scrolling="no"></iframe>
<iframe class="addon" data-src="//addons.mozilla.org/static/html/mozorg/lightbeam.html" frameborder="0" scrolling="no"></iframe>
</div>

<div id="yt-lightbeam" class="youtube"></div>
Expand Down
14 changes: 13 additions & 1 deletion bedrock/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,19 @@ def facebook_tab_url_lazy():
OPTIMIZELY_PROJECT_ID = None

# Fx Accounts Relier Service Client ID
# TODO: Update when available! Currently using creds for demo5 & URLs for FxA dev
# Prod, stage, & dev all have these set in their local.py files.
# For local testing, override in your own local.py.

# For demo servers & localhost:
# FXA_RELIER_CONTENT_HOST = 'https://stable.dev.lcip.org'
# FXA_RELIER_CONTENT_OAUTH = 'https://oauth-stable.dev.lcip.org/v1'
#
# Client IDs:
# localhost:8000: efc5413fa614224e
# demo5: 591e9db45a43f7e9
#
# Additional dev IDs can be created here:
# https://developer.mozilla.org/en-US/Firefox_Accounts_OAuth_Dashboard
FXA_RELIER_CLIENT_ID = '591e9db45a43f7e9'
FXA_RELIER_CONTENT_HOST = 'https://stable.dev.lcip.org'
FXA_RELIER_CONTENT_OAUTH = 'https://oauth-stable.dev.lcip.org/v1'
Expand Down
3 changes: 0 additions & 3 deletions media/css/firefox/australis/growth-firstrun-test1.less
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
}
}

#fxa-value-prop-intro {
}

#fxa-value-prop-verified {
display: none;
}
Expand Down
26 changes: 15 additions & 11 deletions media/js/firefox/australis/growth-firstrun-test1.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

// store client ID for FxA integration
var fxaClient;
var fxaClientID;
var fxaRelier;

// function expression vars
var initFxA;
Expand Down Expand Up @@ -52,14 +52,12 @@
// grab FxA settings from data-* attributes
$fxaExtra = $('#fxa-extra');

Mozilla.FXA_RELIER = {
clientId: $fxaExtra.attr('data-fxa-client-id'),
contentHost: $fxaExtra.attr('data-fxa-content-host'),
contentOauth: $fxaExtra.attr('data-fxa-content-oauth')
fxaRelier = {
clientId: $fxaExtra.data('fxa-client-id'),
contentHost: $fxaExtra.data('fxa-content-host'),
contentOauth: $fxaExtra.data('fxa-content-oauth')
};

fxaClientID = Mozilla.FXA_RELIER.clientId;

// determine whether or not to show doorhanger (50% of users)
showDoorhanger = Math.random() >= 0.5;

Expand Down Expand Up @@ -92,9 +90,9 @@

initFxA = function() {
// set up FxA client
fxaClient = new window.FxaRelierClient(fxaClientID, {
contentHost: Mozilla.FXA_RELIER.contentHost,
oauthHost: Mozilla.FXA_RELIER.contentOauth
fxaClient = new window.FxaRelierClient(fxaRelier.clientId, {
contentHost: fxaRelier.contentHost,
oauthHost: fxaRelier.contentOauth
});

// conjure FxA lightbox
Expand Down Expand Up @@ -122,8 +120,14 @@
$fxaDelayedCTAs.addClass('visible noiframe');
}
}, function(err) {
// on error, get rid of overlay and fall back to default content
// on error (or click of X in iframe), get rid of overlay and fall back to default content
$fxaOverlay.remove();

// link directly to Firefox Accounts when clicking the Sync CTA button
Mozilla.UITour.getConfiguration('sync', function() {
$('.sync-cta').on('click', '.button', trackSyncClick);
});

toggleDefaultContent(true);
});
};
Expand Down
8 changes: 7 additions & 1 deletion media/js/firefox/australis/growth-firstrun-test2.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function onYouTubeIframeAPIReady() {

var $document;
var pageId = $('body').prop('id');
var $outerWrapper = $('#outer-wrapper');
var tour;
var installedAddons;

Expand Down Expand Up @@ -43,6 +44,9 @@ function onYouTubeIframeAPIReady() {
gaTrack(['_trackEvent', pageId + ' Page Interactions - New Firefox Tour', 'button click', 'Get Started with Sync'], goToAccounts);
};

// in case UITour fails
$outerWrapper.show();

// Only run experiment content if user is on Firefox 35 for desktop and has not just submitted email form
if (window.isFirefox() && !window.isFirefoxMobile() && window.getFirefoxMasterVersion() >= 35 && window.location.hash !== '#footer-email-form') {
$document = $(document);
Expand All @@ -59,7 +63,7 @@ function onYouTubeIframeAPIReady() {

closeTour = function() {
// show default #outer-wrapper
$('#outer-wrapper').show();
$outerWrapper.show();
tour.doCloseTour();

Mozilla.syncAnimation();
Expand Down Expand Up @@ -150,6 +154,8 @@ function onYouTubeIframeAPIReady() {

// Query if the UITour API is working before we start the tour
Mozilla.UITour.getConfiguration('sync', function() {
$outerWrapper.hide();

// wire up default content sync button
$('.sync-cta').on('click', '.button', trackSyncClick);

Expand Down

0 comments on commit d0cea3c

Please sign in to comment.