Skip to content

Commit

Permalink
Scold users not using a compatible application (Bug 638005)
Browse files Browse the repository at this point in the history
  • Loading branch information
potch committed Mar 7, 2011
1 parent be53153 commit 5423003
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 5 deletions.
3 changes: 0 additions & 3 deletions apps/addons/templates/addons/mobile/button.html
Expand Up @@ -32,9 +32,6 @@
</a>
{% endfor %}
<ul class="badges">
{% if False %}
<li class="error">{{ _('Requires Newer Version of Firefox') }}</li>
{% endif %}
{% if settings.PERF_THRESHOLD and addon.ts_slowness >= settings.PERF_THRESHOLD %}
<li class="warning">{{ _('May Slow Down Your Browser') }}</li>
{% endif %}
Expand Down
3 changes: 3 additions & 0 deletions apps/addons/templates/addons/mobile/home.html
Expand Up @@ -5,6 +5,9 @@
{% block header %}
<header id="home-header">
{% include "mobile/header.html" %}
<div class="get-fx-message">
{{ _('You need Firefox to install addons. <a href="http://mozilla.com/firefox">Learn More&nbsp;&raquo;</a>') }}
</div>
<hgroup>
<h1 class="site-title">
{% set appicon = 'firefox' if request.APP == amo.MOBILE else request.APP.short %}
Expand Down
14 changes: 14 additions & 0 deletions media/css/zamboni/mobile.css
Expand Up @@ -434,6 +434,20 @@ header #home, header .back-link {
border-bottom-color: #444;
pointer-events: none;
}

.get-fx-message {
border: 1px solid #e3873b;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
background: #fcefb7 url(../../img/zamboni/icons/alert-32x32.png) 11px center no-repeat;
margin-top: 12px;
font-size: 105%;
clear: both;
display: none;
line-height: 1.1em;
padding: 12px 12px 10px 56px;
}
/************************************/
/* LISTVIEWS */
/************************************/
Expand Down
Binary file modified media/img/zamboni/icons/alert-32x32.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion media/js/zamboni/browser.js
Expand Up @@ -22,14 +22,16 @@ function BrowserUtils() {
// browser detection
var browser = {},
browserVersion = 0,
pattern, match, i;
pattern, match, i,
badBrowser = true;
for (i in userAgentStrings) {
if (userAgentStrings.hasOwnProperty(i)) {
pattern = userAgentStrings[i];
match = pattern.exec(navigator.userAgent);
browser[i] = !!(match && match.length === 3);
if (browser[i]) {
browserVersion = escape_(match[2]);
badBrowser = false;
}
}
}
Expand All @@ -53,6 +55,7 @@ function BrowserUtils() {
return {
"browser": browser,
"browserVersion": browserVersion,
"badBrowser": badBrowser,
"os": os,
"platform": platform,
"platformName": gettext(osStrings[platform])
Expand Down
4 changes: 4 additions & 0 deletions media/js/zamboni/init.js
Expand Up @@ -128,3 +128,7 @@ if (z.browser.firefox) {
} else {
z.fxBeta = false;
}

if (z.badBrowser) {
$(".get-fx-message").show();
}
6 changes: 5 additions & 1 deletion media/js/zamboni/mobile_buttons.js
Expand Up @@ -184,7 +184,7 @@
if (self.tooOld) errors.push("tooOld");
if (self.tooNew) errors.push("tooNew");
} else {
if (!appSupported) errors.push("badApp");
if (!appSupported && !z.badBrowser) errors.push("badApp");
if (!platformSupported) {
errors.push("badPlatform");
dom.buttons.hide().eq(0).show();
Expand All @@ -209,6 +209,10 @@
}
}

if (z.badBrowser) {
canInstall = false;
}

if (!canInstall) {
dom.buttons.addClass("disabled");
if (!dom.buttons.filter(":visible").length) {
Expand Down
3 changes: 3 additions & 0 deletions templates/mobile/base.html
Expand Up @@ -45,6 +45,9 @@ <h1 class="site-title">
</a>
</h1>
</hgroup>
<div class="get-fx-message">
{{ _('You need Firefox to install addons. <a href="http://mozilla.com/firefox">Learn More&nbsp;&raquo;</a>') }}
</div>
{% block back_link %}
<a href="{{ url('home') }}" id="home">
<svg width="18" height="16"><polygon fill="#447BC4" points="9,0 18,9 15,9 15,16 11,16 11,11 7,11 7,18 3,16 3,9 0,9"/></svg>
Expand Down

0 comments on commit 5423003

Please sign in to comment.