Moves the logo files to logo

Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
This commit is contained in:
Michael Weimann 2018-08-28 15:58:27 +02:00 committed by Roeland Jago Douma
parent 92049c3ceb
commit d855c38e07
No known key found for this signature in database
GPG Key ID: F941078878347C0C
19 changed files with 35 additions and 41 deletions

View File

@ -80,12 +80,13 @@ class ImageManager {
}
switch ($key) {
case 'logo-blue':
// the blue logo is only available as svg
return $this->urlGenerator->getAbsoluteURL('svg/core/logo/logo/0082C9') . '?v=' . $cacheBusterCounter;
case 'logo':
case 'logoheader':
case 'favicon':
return $this->urlGenerator->imagePath('core', 'logo.png') . '?v=' . $cacheBusterCounter;
case 'logo-blue':
return $this->urlGenerator->imagePath('core', 'logo-blue.png') . '?v=' . $cacheBusterCounter;
return $this->urlGenerator->imagePath('core', 'logo/logo.png') . '?v=' . $cacheBusterCounter;
case 'background':
return $this->urlGenerator->imagePath('core', 'background.png') . '?v=' . $cacheBusterCounter;
}

View File

@ -217,9 +217,9 @@ class ThemingDefaults extends \OC_Defaults {
if(!$logo || !$logoExists) {
if($useSvg) {
$logo = $this->urlGenerator->imagePath('core', 'logo.svg');
$logo = $this->urlGenerator->imagePath('core', 'logo/logo.svg');
} else {
$logo = $this->urlGenerator->imagePath('core', 'logo.png');
$logo = $this->urlGenerator->imagePath('core', 'logo/logo.png');
}
return $logo . '?v=' . $cacheBusterCounter;
}
@ -312,9 +312,9 @@ class ThemingDefaults extends \OC_Defaults {
$primaryColor = $this->getColorPrimary();
$luminance = $this->util->calculateLuminance($primaryColor);
if ($logoMime === '' & $luminance > 0.8) {
return $this->imageManager->getImageUrl('logo-blue');
return $this->imageManager->getImageUrl('logo-blue', true);
} else {
return $this->imageManager->getImageUrl('logo');
return $this->imageManager->getImageUrl('logo', true);
}
}

View File

@ -144,9 +144,9 @@ class ImageManagerTest extends TestCase {
->willReturnOnConsecutiveCalls(0, false);
$this->urlGenerator->expects($this->once())
->method('imagePath')
->with('core', 'logo.png')
->willReturn('logo.png');
$this->assertEquals('logo.png?v=0', $this->imageManager->getImageUrl('logo'));
->with('core', 'logo/logo.png')
->willReturn('logo/logo.png');
$this->assertEquals('logo/logo.png?v=0', $this->imageManager->getImageUrl('logo'));
}
public function testGetImageUrlAbsolute() {

View File

@ -593,11 +593,11 @@ class ThemingDefaultsTest extends TestCase {
}
public function testGetLogoDefaultWithSvg() {
$this->getLogoHelper('logo.svg', true);
$this->getLogoHelper('logo/logo.svg', true);
}
public function testGetLogoDefaultWithoutSvg() {
$this->getLogoHelper('logo.png', false);
$this->getLogoHelper('logo/logo.png', false);
}
public function testGetLogoCustom() {

View File

@ -194,7 +194,7 @@ class LoginController extends Controller {
Util::addHeader('meta', ['property' => 'og:site_name', 'content' => Util::sanitizeHTML($this->defaults->getName())]);
Util::addHeader('meta', ['property' => 'og:url', 'content' => $this->urlGenerator->getAbsoluteURL('/')]);
Util::addHeader('meta', ['property' => 'og:type', 'content' => 'website']);
Util::addHeader('meta', ['property' => 'og:image', 'content' => $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core','favicon-touch.png'))]);
Util::addHeader('meta', ['property' => 'og:image', 'content' => $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'favicon-touch.png'))]);
return new TemplateResponse(
$this->appName, 'login', $parameters, 'guest'

View File

@ -91,7 +91,7 @@ class SvgController extends Controller {
$appRootPath = $this->appManager->getAppPath($app);
$appPath = substr($appRootPath, strlen($this->serverRoot));
if (!$appPath) {
return new NotFoundResponse();
}
@ -119,8 +119,7 @@ class SvgController extends Controller {
}
// add fill (fill is not present on black elements)
$fillRe = '/<((circle|rect|path)((?!fill)[a-z0-9 =".\-#():;])+)\/>/mi';
$fillRe = '/<((circle|rect|path)((!fill)[a-z0-9 =".\-#():;])+)\/>/mi';
$svg = preg_replace($fillRe, '<$1 fill="#' . $color . '"/>', $svg);
// replace any fill or stroke colors

View File

@ -69,7 +69,7 @@ body {
}
#header .logo {
background-image: url('../img/logo.svg?v=1');
background-image: url('../img/logo/logo.svg?v=1');
background-repeat: no-repeat;
background-size: 175px;
background-position: center;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="128" width="256" viewBox="0 0 256 128" ><g stroke="#fff" stroke-width="22" fill="none"><circle cy="64" cx="40" r="26"/><circle cy="64" cx="216" r="26"/><circle cy="64" cx="128" r="46"/></g></svg>

Before

Width:  |  Height:  |  Size: 258 B

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -12,7 +12,7 @@
width="256"
viewBox="0 0 256 128"
id="svg10"
sodipodi:docname="logo-blue.svg"
sodipodi:docname="logo.svg"
inkscape:version="0.92.3 (2405546, 2018-03-11)">
<metadata
id="metadata16">
@ -22,7 +22,6 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
@ -43,7 +42,7 @@
showgrid="false"
inkscape:zoom="1.4296875"
inkscape:cx="128"
inkscape:cy="64"
inkscape:cy="91.978142"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@ -52,25 +51,21 @@
stroke="#fff"
stroke-width="22"
fill="none"
id="g8"
style="stroke:#0082c9;stroke-opacity:1">
id="g8">
<circle
cy="64"
cx="40"
r="26"
id="circle2"
style="stroke:#0082c9;stroke-opacity:1" />
id="circle2" />
<circle
cy="64"
cx="216"
r="26"
id="circle4"
style="stroke:#0082c9;stroke-opacity:1" />
id="circle4" />
<circle
cy="64"
cx="128"
r="46"
id="circle6"
style="stroke:#0082c9;stroke-opacity:1" />
id="circle6" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -315,9 +315,9 @@ class OC_Defaults {
}
if($useSvg) {
$logo = \OC::$server->getURLGenerator()->imagePath('core', 'logo.svg');
$logo = \OC::$server->getURLGenerator()->imagePath('core', 'logo/logo.svg');
} else {
$logo = \OC::$server->getURLGenerator()->imagePath('core', 'logo.png');
$logo = \OC::$server->getURLGenerator()->imagePath('core', 'logo/logo.png');
}
return $logo . '?v=' . hash('sha1', implode('.', \OCP\Util::getVersion()));
}

View File

@ -60,7 +60,7 @@ class ScannerTest extends \Test\TestCase {
$this->assertEquals($cachedData['mimetype'], 'text/plain');
$this->assertNotEquals($cachedData['parent'], -1); //parent folders should be scanned automatically
$data = file_get_contents(\OC::$SERVERROOT . '/core/img/logo.png');
$data = file_get_contents(\OC::$SERVERROOT . '/core/img/logo/logo.png');
$this->storage->file_put_contents('foo.png', $data);
$this->scanner->scanFile('foo.png');
@ -98,7 +98,7 @@ class ScannerTest extends \Test\TestCase {
private function fillTestFolders() {
$textData = "dummy file data\n";
$imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo.png');
$imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo/logo.png');
$this->storage->mkdir('folder');
$this->storage->file_put_contents('foo.txt', $textData);
$this->storage->file_put_contents('foo.png', $imgData);

View File

@ -42,7 +42,7 @@ class UpdaterLegacyTest extends \Test\TestCase {
$this->storage = new \OC\Files\Storage\Temporary(array());
$textData = "dummy file data\n";
$imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo.png');
$imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo/logo.png');
$this->storage->mkdir('folder');
$this->storage->file_put_contents('foo.txt', $textData);
$this->storage->file_put_contents('foo.png', $imgData);
@ -84,7 +84,7 @@ class UpdaterLegacyTest extends \Test\TestCase {
public function testWrite() {
$textSize = strlen("dummy file data\n");
$imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo.png');
$imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo/logo.png');
$this->cache->put('foo.txt', array('mtime' => 100, 'storage_mtime' => 150));
$rootCachedData = $this->cache->get('');
$this->assertEquals(3 * $textSize + $imageSize, $rootCachedData['size']);
@ -145,7 +145,7 @@ class UpdaterLegacyTest extends \Test\TestCase {
public function testDelete() {
$textSize = strlen("dummy file data\n");
$imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo.png');
$imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo/logo.png');
$rootCachedData = $this->cache->get('');
$oldEtag = $rootCachedData['etag'];
$this->assertEquals(3 * $textSize + $imageSize, $rootCachedData['size']);
@ -206,7 +206,7 @@ class UpdaterLegacyTest extends \Test\TestCase {
public function testRename() {
$textSize = strlen("dummy file data\n");
$imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo.png');
$imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo/logo.png');
$rootCachedData = $this->cache->get('');
$this->assertEquals(3 * $textSize + $imageSize, $rootCachedData['size']);

View File

@ -179,7 +179,7 @@ class WatcherTest extends \Test\TestCase {
private function getTestStorage($scan = true) {
$storage = new \OC\Files\Storage\Temporary(array());
$textData = "dummy file data\n";
$imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo.png');
$imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo/logo.png');
$storage->mkdir('folder');
$storage->file_put_contents('foo.txt', $textData);
$storage->file_put_contents('foo.png', $imgData);

View File

@ -38,7 +38,7 @@ class NoopScannerTest extends \Test\TestCase {
private function fillTestFolders() {
$textData = "dummy file data\n";
$imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo.png');
$imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo/logo.png');
$this->storage->mkdir('folder');
$this->storage->file_put_contents('foo.txt', $textData);
$this->storage->file_put_contents('foo.png', $imgData);

View File

@ -142,7 +142,7 @@ class ViewTest extends \Test\TestCase {
Filesystem::mount($storage2, array(), $root . '/substorage');
Filesystem::mount($storage3, array(), $root . '/folder/anotherstorage');
$textSize = strlen("dummy file data\n");
$imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo.png');
$imageSize = filesize(\OC::$SERVERROOT . '/core/img/logo/logo.png');
$storageSize = $textSize * 2 + $imageSize;
$storageInfo = $storage3->getCache()->get('');
@ -658,7 +658,7 @@ class ViewTest extends \Test\TestCase {
*/
$storage = new $class(array());
$textData = "dummy file data\n";
$imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo.png');
$imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo/logo.png');
$storage->mkdir('folder');
$storage->file_put_contents('foo.txt', $textData);
$storage->file_put_contents('foo.png', $imgData);