chore(fx-57): Use Fx 57 logo for everyone. (#5729) r=@philbooth
Remove all gating logic and just use the new logo. fixes #5719
This commit is contained in:
Родитель
2555763191
Коммит
a4e0fb1d1e
Двоичные данные
app/images/firefox.png
Двоичные данные
app/images/firefox.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 5.1 KiB |
Двоичные данные
app/images/firefox@2x.png
Двоичные данные
app/images/firefox@2x.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 12 KiB |
|
@ -83,7 +83,6 @@
|
|||
this.addSearchParamStyles();
|
||||
this.addFxiOSSyncStyles();
|
||||
this.addGetUserMediaStyles();
|
||||
this.addFx57Styles();
|
||||
},
|
||||
|
||||
addJSStyle: function () {
|
||||
|
@ -143,15 +142,6 @@
|
|||
} else {
|
||||
this._addClass('no-getusermedia');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Add the `fx-57` class to the body if in Fx >= 57.
|
||||
*/
|
||||
addFx57Styles: function () {
|
||||
if (this.environment.isFx57OrAbove() || this.environment.isFxiOS10OrAbove()) {
|
||||
this._addClass('fx-57');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -108,40 +108,6 @@
|
|||
return /FxiOS/.test(this.window.navigator.userAgent);
|
||||
},
|
||||
|
||||
/**
|
||||
* Is the user in Firefox for iOS 10 or above?
|
||||
*
|
||||
* @param {String} [userAgent=navigator.userAgent] UA string
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isFxiOS10OrAbove: function (userAgent) {
|
||||
var fxRegExp = /FxiOS\/(\d{2,}\.\d{1,})/;
|
||||
var matches = fxRegExp.exec(userAgent || this.window.navigator.userAgent);
|
||||
|
||||
if (matches && matches[1]) {
|
||||
return parseFloat(matches[1]) >= 10;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Is the user in Firefox (Desktop or Android) 57 or above?
|
||||
*
|
||||
* @param {String} [userAgent=navigator.userAgent] UA string
|
||||
* @returns {Boolean}
|
||||
*/
|
||||
isFx57OrAbove: function (userAgent) {
|
||||
var fxRegExp = /Firefox\/(\d{2,}\.\d{1,})$/;
|
||||
var matches = fxRegExp.exec(userAgent || this.window.navigator.userAgent);
|
||||
|
||||
if (matches && matches[1]) {
|
||||
return parseFloat(matches[1]) >= 57;
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
hasSendBeacon: function () {
|
||||
return typeof this.window.navigator.sendBeacon === 'function';
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#fox-logo {
|
||||
|
||||
@include hidpi-background-image('firefox', 80px 85px);
|
||||
background-position: center top;
|
||||
background-image: image-url('firefox-logo.svg');
|
||||
background-position: center -1px;
|
||||
background-repeat: no-repeat;
|
||||
opacity: 0;
|
||||
position: relative;
|
||||
|
@ -15,6 +15,7 @@
|
|||
}
|
||||
|
||||
@include respond-to('small') {
|
||||
background-position-y: 0;
|
||||
background-size: auto 55px;
|
||||
height: 55px;
|
||||
margin: 10px auto 0 auto;
|
||||
|
@ -26,14 +27,6 @@
|
|||
display: none;
|
||||
}
|
||||
|
||||
html.fx-57 & {
|
||||
background-image: image-url('firefox-logo.svg');
|
||||
background-position-y: -1px;
|
||||
@include respond-to('small') {
|
||||
background-position-y: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.static & {
|
||||
opacity: 1;
|
||||
}
|
||||
|
|
|
@ -36,16 +36,13 @@ body.settings #main-content.card {
|
|||
}
|
||||
|
||||
#fxa-manage-account {
|
||||
@include hidpi-background-image('firefox', 80px 85px);
|
||||
background-image: image-url('firefox-logo.svg');
|
||||
background-position-y: -5px;
|
||||
background-repeat: no-repeat;
|
||||
margin: 0;
|
||||
|
||||
html.fx-57 & {
|
||||
background-image: image-url('firefox-logo.svg');
|
||||
background-position-y: -5px;
|
||||
@include respond-to('small') {
|
||||
background-position-y: -4px;
|
||||
}
|
||||
@include respond-to('small') {
|
||||
background-position-y: -4px;
|
||||
}
|
||||
|
||||
html[dir='ltr'] & {
|
||||
|
|
|
@ -178,41 +178,6 @@ define(function (require, exports, module) {
|
|||
});
|
||||
});
|
||||
|
||||
describe('addFx57Styles', () => {
|
||||
it('adds `fx-57` if UA is Fx >= 57', () => {
|
||||
sinon.stub(environment, 'isFx57OrAbove').callsFake(() => true);
|
||||
sinon.stub(environment, 'isFxiOS10OrAbove').callsFake(() => false);
|
||||
|
||||
startupStyles.addFx57Styles();
|
||||
assert.isTrue(/fx-57/.test(startupStyles.getClassName()));
|
||||
});
|
||||
|
||||
it('does not add `fx-57` if UA is Fx <= 56', () => {
|
||||
sinon.stub(environment, 'isFx57OrAbove').callsFake(() => false);
|
||||
sinon.stub(environment, 'isFxiOS10OrAbove').callsFake(() => false);
|
||||
|
||||
startupStyles.addFx57Styles();
|
||||
assert.isFalse(/fx-57/.test(startupStyles.getClassName()));
|
||||
});
|
||||
|
||||
it('adds `fx-57` if UA is FxiOS >= 10', () => {
|
||||
sinon.stub(environment, 'isFx57OrAbove').callsFake(() => false);
|
||||
sinon.stub(environment, 'isFxiOS10OrAbove').callsFake(() => true);
|
||||
|
||||
startupStyles.addFx57Styles();
|
||||
assert.isTrue(/fx-57/.test(startupStyles.getClassName()));
|
||||
});
|
||||
|
||||
it('does not add `fx-57` if UA is FxiOS <= 9', () => {
|
||||
sinon.stub(environment, 'isFx57OrAbove').callsFake(() => false);
|
||||
sinon.stub(environment, 'isFxiOS10OrAbove').callsFake(() => false);
|
||||
|
||||
startupStyles.addFx57Styles();
|
||||
assert.isFalse(/fx-57/.test(startupStyles.getClassName()));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('initialize', function () {
|
||||
it('runs all the tests', function () {
|
||||
startupStyles.initialize();
|
||||
|
|
|
@ -159,40 +159,6 @@ define(function (require, exports, module) {
|
|||
});
|
||||
});
|
||||
|
||||
describe('isFxiOS10OrAbove', function () {
|
||||
it('returns `false` if on Fx 10 or above, false otw', function () {
|
||||
assert.isFalse(environment.isFxiOS10OrAbove('FxiOS/9.0'));
|
||||
assert.isTrue(environment.isFxiOS10OrAbove('FxiOS/10.0'));
|
||||
assert.isTrue(environment.isFxiOS10OrAbove('FxiOS/11.0'));
|
||||
assert.isFalse(environment.isFxiOS('Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:40.0) Gecko/20100101 Firefox/40.0'));
|
||||
});
|
||||
});
|
||||
|
||||
describe('isFx57OrAbove', () => {
|
||||
it('returns `true` if Fx Desktop 57 or above', () => {
|
||||
assert.isTrue(environment.isFx57OrAbove('Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:57.0) Gecko/20100101 Firefox/57.0'));
|
||||
assert.isTrue(environment.isFx57OrAbove('Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:58.0) Gecko/20100101 Firefox/58.0'));
|
||||
assert.isTrue(environment.isFx57OrAbove('Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:101.0) Gecko/20100101 Firefox/101.0'));
|
||||
assert.isTrue(environment.isFx57OrAbove('Mozilla/5.0 (Windows NT x.y; WOW64; rv:101.0) Gecko/20100101 Firefox/101.0'));
|
||||
});
|
||||
|
||||
it('returns `true` if Fx for Android 57 or above', () => {
|
||||
assert.isTrue(environment.isFx57OrAbove('Mozilla/5.0 (Android 4.4; Mobile; rv:57.0) Gecko/57.0 Firefox/57.0'));
|
||||
assert.isTrue(environment.isFx57OrAbove('Mozilla/5.0 (Android 4.4; Mobile; rv:57.0) Gecko/58.0 Firefox/58.0'));
|
||||
assert.isTrue(environment.isFx57OrAbove('Mozilla/5.0 (Android 4.4; Mobile; rv:57.0) Gecko/999.0 Firefox/999.0'));
|
||||
});
|
||||
|
||||
it('returns `false` otw', () => {
|
||||
assert.isFalse(environment.isFx57OrAbove('Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:40.0) Gecko/20100101 Firefox/40.0'));
|
||||
assert.isFalse(environment.isFx57OrAbove('Mozilla/5.0 (Windows NT x.y; WOW64; rv:10.0) Gecko/20100101 Firefox/10.0'));
|
||||
assert.isFalse(environment.isFx57OrAbove('Mozilla/5.0 (Android; Mobile; rv:40.0) Gecko/40.0 Firefox/40.0'));
|
||||
assert.isFalse(environment.isFx57OrAbove('Mozilla/5.0 (Android 4.4; Mobile; rv:41.0) Gecko/41.0 Firefox/41.0'));
|
||||
assert.isFalse(environment.isFx57OrAbove('Mozilla/5.0 (Android 4.4; Mobile; rv:56.0) Gecko/56.0 Firefox/56.0'));
|
||||
assert.isFalse(environment.isFx57OrAbove(
|
||||
'Mozilla/5.0 (iPod touch; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/600.1.4'));
|
||||
});
|
||||
});
|
||||
|
||||
describe('hasSendBeacon', function () {
|
||||
it('returns `true` if sendBeacon function exists', function () {
|
||||
windowMock.navigator.sendBeacon = function () {};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<!doctype html>
|
||||
<!--[if lt IE 10]> <html class="lt-ie10" dir="{{ lang_dir }}" lang="{{ lang }}"> <![endif]-->
|
||||
<!--[if gte IE 10]><!--> <html dir="{{ lang_dir }}" class="fx-57" lang="{{ lang }}"> <!--<![endif]-->
|
||||
<!--[if gte IE 10]><!--> <html dir="{{ lang_dir }}" lang="{{ lang }}"> <!--<![endif]-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<!doctype html>
|
||||
<!--[if lt IE 10]> <html class="lt-ie10" dir="{{ lang_dir }}" lang="{{ lang }}"> <![endif]-->
|
||||
<!--[if gte IE 10]><!--> <html dir="{{ lang_dir }}" class="fx-57" lang="{{ lang }}"> <!--<![endif]-->
|
||||
<!--[if gte IE 10]><!--> <html dir="{{ lang_dir }}" lang="{{ lang }}"> <!--<![endif]-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
|
|
Загрузка…
Ссылка в новой задаче