This repository has been archived by the owner on Jan 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1630 from christopheschwyzer/issue-1630
Breaking: Update favicons
- Loading branch information
Showing
41 changed files
with
124 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"name": "{$render->getSite()->getName()}", | ||
"icons": [ | ||
{ | ||
"src": "{resourceUrl path='img/meta/android-chrome-36x36.png' type='layout'}", | ||
"sizes": "36x36", | ||
"type": "image/png", | ||
"density": "0.75" | ||
}, | ||
{ | ||
"src": "{resourceUrl path='img/meta/android-chrome-48x48.png' type='layout'}", | ||
"sizes": "48x48", | ||
"type": "image/png", | ||
"density": "1.0" | ||
}, | ||
{ | ||
"src": "{resourceUrl path='img/meta/android-chrome-72x72.png' type='layout'}", | ||
"sizes": "72x72", | ||
"type": "image/png", | ||
"density": "1.5" | ||
}, | ||
{ | ||
"src": "{resourceUrl path='img/meta/android-chrome-96x96.png' type='layout'}", | ||
"sizes": "96x96", | ||
"type": "image/png", | ||
"density": "2.0" | ||
}, | ||
{ | ||
"src": "{resourceUrl path='img/meta/android-chrome-144x144.png' type='layout'}", | ||
"sizes": "144x144", | ||
"type": "image/png", | ||
"density": "3.0" | ||
}, | ||
{ | ||
"src": "{resourceUrl path='img/meta/android-chrome-192x192.png' type='layout'}", | ||
"sizes": "192x192", | ||
"type": "image/png", | ||
"density": "4.0" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
function smarty_function_lessVariable(array $params, Smarty_Internal_Template $template) { | ||
/** @var CM_Frontend_Render $render */ | ||
$render = $template->smarty->getTemplateVars('render'); | ||
$variableName = (string) $params['name']; | ||
|
||
$assetCss = new CM_Asset_Css($render); | ||
$assetCss->addVariables(); | ||
$assetCss->add('foo:@' . $variableName); | ||
|
||
$css = $assetCss->get(true); | ||
|
||
if (!preg_match('/^foo:(.+);$/', $css, $matches)) { | ||
throw new CM_Exception_Invalid('Cannot detect variable `' . $variableName . '` from CSS `' . $css . '`.'); | ||
} | ||
return $matches[1]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
tests/library/CM/SmartyPlugins/function.lessVariableTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
require_once CM_Util::getModulePath('CM') . 'library/CM/SmartyPlugins/function.lessVariable.php'; | ||
|
||
class smarty_function_lessVariableTest extends CMTest_TestCase { | ||
|
||
/** @var Smarty_Internal_Template */ | ||
private $_template; | ||
|
||
public function setUp() { | ||
$smarty = new Smarty(); | ||
$render = new CM_Frontend_Render(); | ||
$this->_template = $smarty->createTemplate('string:'); | ||
$this->_template->assignGlobal('render', $render); | ||
} | ||
|
||
public function testColor() { | ||
$this->assertSame('#2d78e2', smarty_function_lessVariable(['name' => 'colorBrand'], $this->_template)); | ||
} | ||
|
||
public function testSize() { | ||
$this->assertSame('14px', smarty_function_lessVariable(['name' => 'fontSize'], $this->_template)); | ||
} | ||
|
||
/** | ||
* @expectedException CM_Exception_Invalid | ||
* @expectedExceptionMessage Cannot detect variable | ||
*/ | ||
public function testInvalidName() { | ||
smarty_function_lessVariable(['name' => 'helloworld'], $this->_template); | ||
} | ||
} |