Skip to content
This repository was archived by the owner on Mar 15, 2018. It is now read-only.

Commit a0ba873

Browse files
committed
Merge pull request #789 from cvan/fxa-css-locally
fix FxA migration popup for when HTML is served locally or from real packaged app (bug 1097409)
2 parents b6e1a9d + 534fcd5 commit a0ba873

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

src/app.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<link rel="dns-prefetch" href="//firefoxos.persona.org">
1414
<link rel="dns-prefetch" href="//static.login.persona.org">
1515
</head>
16-
<body data-languages="[&#34;bg&#34;, &#34;bn-BD&#34;, &#34;ca&#34;, &#34;cs&#34;, &#34;da&#34;, &#34;de&#34;, &#34;el&#34;, &#34;en-US&#34;, &#34;es&#34;, &#34;fr&#34;, &#34;ga-IE&#34;, &#34;hr&#34;, &#34;hu&#34;, &#34;it&#34;, &#34;ja&#34;, &#34;ko&#34;, &#34;mk&#34;, &#34;nb-NO&#34;, &#34;nl&#34;, &#34;pl&#34;, &#34;pt-BR&#34;, &#34;ro&#34;, &#34;ru&#34;, &#34;sk&#34;, &#34;sq&#34;, &#34;sr&#34;, &#34;sr-Latn&#34;, &#34;tr&#34;, &#34;zh-CN&#34;, &#34;zh-TW&#34;]">
16+
<body data-languages="[&#34;bg&#34;, &#34;bn-BD&#34;, &#34;ca&#34;, &#34;cs&#34;, &#34;da&#34;, &#34;de&#34;, &#34;el&#34;, &#34;en-US&#34;, &#34;es&#34;, &#34;fr&#34;, &#34;ga-IE&#34;, &#34;hr&#34;, &#34;hu&#34;, &#34;it&#34;, &#34;ja&#34;, &#34;ko&#34;, &#34;mk&#34;, &#34;nb-NO&#34;, &#34;nl&#34;, &#34;pl&#34;, &#34;pt-BR&#34;, &#34;ro&#34;, &#34;ru&#34;, &#34;sk&#34;, &#34;sq&#34;, &#34;sr&#34;, &#34;sr-Latn&#34;, &#34;tr&#34;, &#34;zh-CN&#34;, &#34;zh-TW&#34;]" data-local-html>
1717
<noscript><p>Sorry, you need JavaScript to access the Marketplace.</p></noscript>
1818

1919
<div id="splash-overlay">

src/dev.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<link rel="stylesheet" href="/media/css/search.styl.css">
5353
<link rel="stylesheet" href="/media/css/site-banner.styl.css">
5454
</head>
55-
<body class="overlayed" data-media="">
55+
<body class="overlayed" data-media="" data-local-html>
5656
<!-- If you want to simulate Marketplace website production-like environment, set data-media, data-build-id-js, data-repo and data-languages to non-empty values -->
5757

5858
<noscript><p>Sorry, you need JavaScript to access the Marketplace.</p></noscript>

src/media/js/settings.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ define('settings', ['l10n', 'settings_local', 'underscore'], function(l10n, sett
2424
app_name: 'fireplace',
2525
init_module: 'main',
2626
default_locale: 'en-US',
27-
api_url: 'http://' + window.location.hostname, // No trailing slash, please.
27+
api_url: 'http://' + window.location.hostname, // No trailing slash, please./
28+
local_html: document.body.hasAttribute('data-local-html'), // Exists or not.
2829

2930
fxa_css_path: '/media/css/fxa.css',
3031

src/media/js/views/fxa_popup.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,15 @@ define('views/fxa_popup',
2222
}
2323

2424
return function(builder, args, params) {
25-
var cssPath = utils.urlparams(urls.media(settings.fxa_css_path),
26-
{b: z.body.data('build-id-js')});
25+
var cssPath = settings.fxa_css_path;
26+
27+
// If HTML is being served from the server, prefix the URL with
28+
// the media URL.
29+
if (!settings.local_html) {
30+
cssPath = urls.media(cssPath);
31+
}
32+
33+
cssPath = utils.urlparams(cssPath, {b: z.body.data('build-id-js')});
2734

2835
// Ensure the splash screen stays up.
2936
z.body.attr('data-page-type', 'standalone-loading');

0 commit comments

Comments
 (0)