소스 검색

Moves the logo files to logo

Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
Michael Weimann 5 년 전
부모
커밋
d855c38e07

+ 4 - 3
apps/theming/lib/ImageManager.php

@@ -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;
 		}

+ 4 - 4
apps/theming/lib/ThemingDefaults.php

@@ -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);
 		}
 	}
 

+ 3 - 3
apps/theming/tests/ImageManagerTest.php

@@ -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() {

+ 2 - 2
apps/theming/tests/ThemingDefaultsTest.php

@@ -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() {

+ 1 - 1
core/Controller/LoginController.php

@@ -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'

+ 2 - 3
core/Controller/SvgController.php

@@ -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

+ 1 - 1
core/css/guest.css

@@ -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;

BIN
core/img/logo-blue.png


+ 0 - 1
core/img/logo.svg

@@ -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>

+ 0 - 0
core/img/logo-icon-175px.png → core/img/logo/logo-icon-175px.png


+ 0 - 0
core/img/logo-mail.png → core/img/logo/logo-mail.png


+ 0 - 0
core/img/logo.png → core/img/logo/logo.png


+ 6 - 11
core/img/logo-blue.svg → core/img/logo/logo.svg

@@ -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>

+ 2 - 2
lib/private/legacy/defaults.php

@@ -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()));
 	}

+ 2 - 2
tests/lib/Files/Cache/ScannerTest.php

@@ -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);

+ 4 - 4
tests/lib/Files/Cache/UpdaterLegacyTest.php

@@ -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']);
 

+ 1 - 1
tests/lib/Files/Cache/WatcherTest.php

@@ -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);

+ 1 - 1
tests/lib/Files/ObjectStore/NoopScannerTest.php

@@ -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);

+ 2 - 2
tests/lib/Files/ViewTest.php

@@ -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);