|
26 | 26 |
|
27 | 27 | use OCA\Theming\Controller\ThemingController; |
28 | 28 | use OCA\Theming\Template; |
| 29 | +use OCA\Theming\Util; |
29 | 30 | use OCP\AppFramework\Http; |
30 | 31 | use OCP\AppFramework\Http\DataResponse; |
31 | 32 | use OCP\Files\IRootFolder; |
@@ -329,23 +330,17 @@ public function testGetStylesheetWithOnlyColor() { |
329 | 330 |
|
330 | 331 | $elementColor = '#000'; |
331 | 332 | $expectedCss = '#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: #000}' . "\n"; |
332 | | - $expectedCss .= sprintf('html:not(.ie):not(.edge) input[type="checkbox"].checkbox:checked:enabled:not(.checkbox--white) + label:before {' . |
| 333 | + $expectedCss .= sprintf('input[type="checkbox"].checkbox:checked:enabled:not(.checkbox--white) + label:before {' . |
333 | 334 | 'background-image:url(\'%s/core/img/actions/checkmark-white.svg\');' . |
334 | 335 | 'background-color: %s; background-position: center center; background-size:contain;' . |
335 | 336 | 'width:12px; height:12px; padding:0; margin:2px 6px 6px 2px; border-radius:1px;' . |
336 | 337 | "}\n", |
337 | 338 | \OC::$WEBROOT, |
338 | 339 | $elementColor |
339 | 340 | ); |
340 | | - $expectedCss .= sprintf('html:not(.ie):not(.edge) input[type="radio"].radio:checked:not(.radio--white):not(:disabled) + label:before {' . |
341 | | - '-webkit-mask-image: url(\'%s/core/img/actions/radio-checked-white.svg\');' . |
342 | | - '-webkit-mask-repeat: no-repeat;' . |
343 | | - 'background-color: %s;' . |
344 | | - 'background-image: none; '. |
345 | | - "}\n", |
346 | | - \OC::$WEBROOT, |
347 | | - $elementColor |
348 | | - ); |
| 341 | + $expectedCss .= 'input[type="radio"].radio:checked:not(.radio--white):not(:disabled) + label:before {' . |
| 342 | + 'background-image: url(\'data:image/svg+xml;base64,'.Util::generateRadioButton($elementColor).'\');' . |
| 343 | + "}\n"; |
349 | 344 | $expected = new Http\DataDownloadResponse($expectedCss, 'style', 'text/css'); |
350 | 345 | $expected->cacheFor(3600); |
351 | 346 | @$this->assertEquals($expected, $this->themingController->getStylesheet()); |
@@ -374,23 +369,17 @@ public function testGetStylesheetWithOnlyColorInvert() { |
374 | 369 | ->willReturn(''); |
375 | 370 | $elementColor = '#555555'; |
376 | 371 | $expectedCss = '#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: #fff}' . "\n"; |
377 | | - $expectedCss .= sprintf('html:not(.ie):not(.edge) input[type="checkbox"].checkbox:checked:enabled:not(.checkbox--white) + label:before {' . |
| 372 | + $expectedCss .= sprintf('input[type="checkbox"].checkbox:checked:enabled:not(.checkbox--white) + label:before {' . |
378 | 373 | 'background-image:url(\'%s/core/img/actions/checkmark-white.svg\');' . |
379 | 374 | 'background-color: %s; background-position: center center; background-size:contain;' . |
380 | 375 | 'width:12px; height:12px; padding:0; margin:2px 6px 6px 2px; border-radius:1px;' . |
381 | 376 | "}\n", |
382 | 377 | \OC::$WEBROOT, |
383 | 378 | $elementColor |
384 | 379 | ); |
385 | | - $expectedCss .= sprintf('html:not(.ie):not(.edge) input[type="radio"].radio:checked:not(.radio--white):not(:disabled) + label:before {' . |
386 | | - '-webkit-mask-image: url(\'%s/core/img/actions/radio-checked-white.svg\');' . |
387 | | - '-webkit-mask-repeat: no-repeat;' . |
388 | | - 'background-color: %s;' . |
389 | | - 'background-image: none; '. |
390 | | - "}\n", |
391 | | - \OC::$WEBROOT, |
392 | | - $elementColor |
393 | | - ); |
| 380 | + $expectedCss .= 'input[type="radio"].radio:checked:not(.radio--white):not(:disabled) + label:before {' . |
| 381 | + 'background-image: url(\'data:image/svg+xml;base64,'.Util::generateRadioButton($elementColor).'\');' . |
| 382 | + "}\n"; |
394 | 383 | $expectedCss .= '#header .header-appname, #expandDisplayName { color: #000000; }' . "\n" . |
395 | 384 | '#header .icon-caret { background-image: url(\'' . \OC::$WEBROOT . '/core/img/actions/caret-dark.svg\'); }' . "\n" . |
396 | 385 | '.searchbox input[type="search"] { background: transparent url(\'' . \OC::$WEBROOT . '/core/img/actions/search.svg\') no-repeat 6px center; color: #000; }' . "\n" . |
@@ -486,23 +475,17 @@ public function testGetStylesheetWithAllCombined() { |
486 | 475 |
|
487 | 476 | $elementColor = '#000'; |
488 | 477 | $expectedCss = '#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: #000}' . "\n"; |
489 | | - $expectedCss .= sprintf('html:not(.ie):not(.edge) input[type="checkbox"].checkbox:checked:enabled:not(.checkbox--white) + label:before {' . |
| 478 | + $expectedCss .= sprintf('input[type="checkbox"].checkbox:checked:enabled:not(.checkbox--white) + label:before {' . |
490 | 479 | 'background-image:url(\'%s/core/img/actions/checkmark-white.svg\');' . |
491 | 480 | 'background-color: %s; background-position: center center; background-size:contain;' . |
492 | 481 | 'width:12px; height:12px; padding:0; margin:2px 6px 6px 2px; border-radius:1px;' . |
493 | 482 | "}\n", |
494 | 483 | \OC::$WEBROOT, |
495 | 484 | $elementColor |
496 | 485 | ); |
497 | | - $expectedCss .= sprintf('html:not(.ie):not(.edge) input[type="radio"].radio:checked:not(.radio--white):not(:disabled) + label:before {' . |
498 | | - '-webkit-mask-image: url(\'%s/core/img/actions/radio-checked-white.svg\');' . |
499 | | - '-webkit-mask-repeat: no-repeat;' . |
500 | | - 'background-color: %s;' . |
501 | | - 'background-image: none; '. |
502 | | - "}\n", |
503 | | - \OC::$WEBROOT, |
504 | | - $elementColor |
505 | | - ); |
| 486 | + $expectedCss .= 'input[type="radio"].radio:checked:not(.radio--white):not(:disabled) + label:before {' . |
| 487 | + 'background-image: url(\'data:image/svg+xml;base64,'.Util::generateRadioButton($elementColor).'\');' . |
| 488 | + "}\n"; |
506 | 489 | $expectedCss .= '#header .logo {' . |
507 | 490 | 'background-image: url(\'./logo?v=0\')' . |
508 | 491 | '}' . "\n" . |
@@ -540,23 +523,17 @@ public function testGetStylesheetWithAllCombinedInverted() { |
540 | 523 |
|
541 | 524 | $elementColor = '#555555'; |
542 | 525 | $expectedCss = '#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: #fff}' . "\n"; |
543 | | - $expectedCss .= sprintf('html:not(.ie):not(.edge) input[type="checkbox"].checkbox:checked:enabled:not(.checkbox--white) + label:before {' . |
| 526 | + $expectedCss .= sprintf('input[type="checkbox"].checkbox:checked:enabled:not(.checkbox--white) + label:before {' . |
544 | 527 | 'background-image:url(\'%s/core/img/actions/checkmark-white.svg\');' . |
545 | 528 | 'background-color: %s; background-position: center center; background-size:contain;' . |
546 | 529 | 'width:12px; height:12px; padding:0; margin:2px 6px 6px 2px; border-radius:1px;' . |
547 | 530 | "}\n", |
548 | 531 | \OC::$WEBROOT, |
549 | 532 | $elementColor |
550 | 533 | ); |
551 | | - $expectedCss .= sprintf('html:not(.ie):not(.edge) input[type="radio"].radio:checked:not(.radio--white):not(:disabled) + label:before {' . |
552 | | - '-webkit-mask-image: url(\'%s/core/img/actions/radio-checked-white.svg\');' . |
553 | | - '-webkit-mask-repeat: no-repeat;' . |
554 | | - 'background-color: %s;' . |
555 | | - 'background-image: none; '. |
556 | | - "}\n", |
557 | | - \OC::$WEBROOT, |
558 | | - $elementColor |
559 | | - ); |
| 534 | + $expectedCss .= 'input[type="radio"].radio:checked:not(.radio--white):not(:disabled) + label:before {' . |
| 535 | + 'background-image: url(\'data:image/svg+xml;base64,'.Util::generateRadioButton($elementColor).'\');' . |
| 536 | + "}\n"; |
560 | 537 | $expectedCss .= '#header .logo {' . |
561 | 538 | 'background-image: url(\'./logo?v=0\')' . |
562 | 539 | '}' . "\n" . |
|
0 commit comments