Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2594 from christopheschwyzer/simplify-favicons
Browse files Browse the repository at this point in the history
FB-122 Update favicon/touch icons
  • Loading branch information
Christophe Schwyzer authored Mar 13, 2017
2 parents 640db96 + 1a2d505 commit 05566d5
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 43 deletions.
11 changes: 0 additions & 11 deletions layout/default/View/Document/default.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,11 @@
<meta name="apple-mobile-web-app-title" content="{$render->getSite()->getName()|escape}">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="msapplication-tap-highlight" content="no">
<meta name="msapplication-TileColor" content="{block name='tileColor'}{lessVariable name='colorBrand'}{/block}">
<meta name="msapplication-TileImage" content="{resourceUrl path='img/meta/square-144-transparent.png' type='layout'}">
<meta name="msapplication-config" content="{resourceUrl path='browserconfig.xml' type='layout'}">
<meta name="theme-color" content="{block name='themeColor'}{lessVariable name='colorBrand'}{/block}">

{**
* See https://developer.apple.com/library/prerelease/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html
*}
<link rel="apple-touch-icon" sizes="76x76" href="{resourceUrl path='img/meta/square-76.png' type='layout'}">
<link rel="apple-touch-icon" sizes="120x120" href="{resourceUrl path='img/meta/square-120.png' type='layout'}">
<link rel="apple-touch-icon" sizes="152x152" href="{resourceUrl path='img/meta/square-152.png' type='layout'}">
<link rel="apple-touch-icon" sizes="167x167" href="{resourceUrl path='img/meta/square-167.png' type='layout'}">
<link rel="apple-touch-icon" sizes="180x180" href="{resourceUrl path='img/meta/square-180.png' type='layout'}">

<link rel="icon" type="image/png" href="{resourceUrl path='img/meta/square-32.png' type='layout'}" sizes="32x32">
<link rel="icon" type="image/png" href="{resourceUrl path='img/meta/square-96.png' type='layout'}" sizes="96x96">
<link rel="icon" type="image/png" href="{resourceUrl path='img/meta/square-16.png' type='layout'}" sizes="16x16">

<link rel="manifest" href="{resourceUrl path='manifest.json' type='layout' sameOrigin=true}">
Expand Down
3 changes: 0 additions & 3 deletions layout/default/resource/browserconfig.xml.smarty
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="{resourceUrl path='img/meta/tile-small-128x128-transparent.png' type='layout'}"/>
<square150x150logo src="{resourceUrl path='img/meta/tile-medium-270x270-transparent.png' type='layout'}"/>
<square310x310logo src="{resourceUrl path='img/meta/tile-large-558x558-transparent.png' type='layout'}"/>
<wide310x150logo src="{resourceUrl path='img/meta/tile-wide-558x270-transparent.png' type='layout'}"/>
<TileColor>{block name='tileColor'}{lessVariable name='colorBrand'}{/block}</TileColor>
</tile>
</msapplication>
Expand Down
15 changes: 0 additions & 15 deletions layout/default/resource/manifest.json.smarty
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,11 @@
"background_color": "{lessVariable name='colorBrand'}",
"theme_color": "{lessVariable name='colorBrand'}",
"icons": [
{
"src": "{resourceUrl path='img/meta/square-144.png' type='layout'}",
"sizes": "144x144",
"type": "image/png"
},
{
"src": "{resourceUrl path='img/meta/square-192.png' type='layout'}",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "{resourceUrl path='img/meta/square-256.png' type='layout'}",
"sizes": "256x256",
"type": "image/png"
},
{
"src": "{resourceUrl path='img/meta/square-384.png' type='layout'}",
"sizes": "384x384",
"type": "image/png"
},
{
"src": "{resourceUrl path='img/meta/square-512.png' type='layout'}",
"sizes": "512x512",
Expand Down
1 change: 1 addition & 0 deletions layout/default/variables.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Special
@colorBrand: #2d78e2;
@colorFaviconBg: @colorBrand;
@colorOnline: #008845;
@colorOk: #008845;
@colorNotice: #ea8e0b;
Expand Down
14 changes: 1 addition & 13 deletions library/CM/Frontend/Cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class CM_Frontend_Cli extends CM_Cli_Runnable_Abstract {

const FAVICON_SVG_FILENAME = 'favicon.svg';
const FAVICON_BACKGROUND_LESS_VARIABLE = 'colorBrand';
const FAVICON_BACKGROUND_LESS_VARIABLE = 'colorFaviconBg';

public function iconRefresh() {
/** @var CM_File[] $svgFileList */
Expand Down Expand Up @@ -109,26 +109,14 @@ private function _getFaviconConfigList() {
// Favicon & Apple Touch Icons
'square-16.png' => ['width' => 16, 'height' => 16],
'square-32.png' => ['width' => 32, 'height' => 32],
'square-76.png' => ['width' => 76, 'height' => 76],
'square-96.png' => ['width' => 96, 'height' => 96],
'square-120.png' => ['width' => 120, 'height' => 120],
'square-144.png' => ['width' => 144, 'height' => 144],
'square-144-transparent.png' => ['width' => 144, 'height' => 144, 'transparent' => true],
'square-152.png' => ['width' => 152, 'height' => 152],
'square-167.png' => ['width' => 167, 'height' => 167],
'square-180.png' => ['width' => 180, 'height' => 180],

// Android Chrome
'square-192.png' => ['width' => 192, 'height' => 192],
'square-256.png' => ['width' => 256, 'height' => 256],
'square-384.png' => ['width' => 384, 'height' => 384],
'square-512.png' => ['width' => 512, 'height' => 512],

// MS Tiles
'tile-small-128x128-transparent.png' => ['width' => 128, 'height' => 128, 'transparent' => true, 'iconSize' => 0.5],
'tile-medium-270x270-transparent.png' => ['width' => 270, 'height' => 270, 'transparent' => true, 'iconSize' => 0.5],
'tile-large-558x558-transparent.png' => ['width' => 558, 'height' => 558, 'transparent' => true, 'iconSize' => 0.5],
'tile-wide-558x270-transparent.png' => ['width' => 558, 'height' => 270, 'transparent' => true, 'iconSize' => 0.5],

// Push Notification
'push-notification-icon.png' => ['width' => 192, 'height' => 192],
Expand Down
2 changes: 1 addition & 1 deletion tests/library/CM/Http/Response/Resource/LayoutTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function testSmartyTemplate() {
$this->assertContains('Content-Type: application/xml', $response->getHeaders());
$this->assertContains('Cache-Control: max-age=31536000', $response->getHeaders());
$this->assertContains('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 31536000), $response->getHeaders());
$imgUrl = $render->getUrlResource('layout', 'img/meta/tile-small-128x128-transparent.png');
$imgUrl = $render->getUrlResource('layout', 'img/meta/tile-medium-270x270-transparent.png');
$this->assertContains("src=\"{$imgUrl}\"", $response->getContent());

$exception = $this->catchException(function () use ($render) {
Expand Down

0 comments on commit 05566d5

Please sign in to comment.