diff --git a/Hooks.php b/Hooks.php index 3d26498f3..62be237e9 100644 --- a/Hooks.php +++ b/Hooks.php @@ -591,7 +591,7 @@ class EchoHooks { // Load the styles for the Notifications badge $out->addModuleStyles( array( 'ext.echo.nojs', - 'oojs-ui.styles.icons-alerts' + 'ext.echo.badgeicons' ) ); } diff --git a/Resources.php b/Resources.php index ed261ef06..633b6428f 100644 --- a/Resources.php +++ b/Resources.php @@ -153,6 +153,17 @@ $wgResourceModules += array( 'echo-feedback', ), ), + + // HACK: OOUI has an icon pack for these, but it's unhelpfully large and we don't + // want to load more as render-blocking CSS than we have to (T112401) + 'ext.echo.badgeicons' => $echoResourceTemplate + array( + 'class' => 'ResourceLoaderOOUIImageModule', + 'position' => 'top', + 'name' => 'badgeicons', + 'rootPath' => 'icons', + 'selectorWithoutVariant' => '.oo-ui-icon-{name}', + 'selectorWithVariant' => '.oo-ui-image-{variant}.oo-ui-icon-{name}', + ), ); unset( $echoResourceTemplate ); diff --git a/modules/icons/apex/badgeicons.json b/modules/icons/apex/badgeicons.json new file mode 100644 index 000000000..4182a1a49 --- /dev/null +++ b/modules/icons/apex/badgeicons.json @@ -0,0 +1,14 @@ +{ + "prefix": "oo-ui-icon", + "images": { + "bell": { "file": "../bell.svg" }, + "bellOn": { "file": { + "ltr": "../bellOn-ltr.svg", + "rtl": "../bellOn-rtl.svg" + } }, + "speechBubble": { "file": { + "ltr": "../speechBubble-ltr.svg", + "rtl": "../speechBubble-rtl.svg" + } } + } +} diff --git a/modules/icons/bell.svg b/modules/icons/bell.svg new file mode 100644 index 000000000..787ed1419 --- /dev/null +++ b/modules/icons/bell.svg @@ -0,0 +1,4 @@ + + + + diff --git a/modules/icons/bellOn-ltr.svg b/modules/icons/bellOn-ltr.svg new file mode 100644 index 000000000..f68a8e0ef --- /dev/null +++ b/modules/icons/bellOn-ltr.svg @@ -0,0 +1,4 @@ + + + + diff --git a/modules/icons/bellOn-rtl.svg b/modules/icons/bellOn-rtl.svg new file mode 100644 index 000000000..ae0352907 --- /dev/null +++ b/modules/icons/bellOn-rtl.svg @@ -0,0 +1,4 @@ + + + + diff --git a/modules/icons/mediawiki/badgeicons.json b/modules/icons/mediawiki/badgeicons.json new file mode 100644 index 000000000..21c822011 --- /dev/null +++ b/modules/icons/mediawiki/badgeicons.json @@ -0,0 +1,20 @@ +{ + "prefix": "oo-ui-icon", + "variants": { + "invert": { + "color": "#FFFFFF", + "global": true + } + }, + "images": { + "bell": { "file": "../bell.svg" }, + "bellOn": { "file": { + "ltr": "../bellOn-ltr.svg", + "rtl": "../bellOn-rtl.svg" + } }, + "speechBubble": { "file": { + "ltr": "../speechBubble-ltr.svg", + "rtl": "../speechBubble-rtl.svg" + } } + } +} diff --git a/modules/icons/speechBubble-ltr.svg b/modules/icons/speechBubble-ltr.svg new file mode 100644 index 000000000..6e5eacd9c --- /dev/null +++ b/modules/icons/speechBubble-ltr.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/modules/icons/speechBubble-rtl.svg b/modules/icons/speechBubble-rtl.svg new file mode 100644 index 000000000..139c34ea0 --- /dev/null +++ b/modules/icons/speechBubble-rtl.svg @@ -0,0 +1,6 @@ + + + + + +