aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshyPHP <s9e.dev@gmail.com>2016-12-27 21:48:01 +0100
committerJoshyPHP <s9e.dev@gmail.com>2016-12-27 21:48:01 +0100
commitf111e70fc3959d979e61e8134fcaefb670b32603 (patch)
treea5aafadecd9918479c8c88b852ef05580a4a1bc7
parentcb406258fe13f593035f0cd29e5835752985629c (diff)
downloadforums-f111e70fc3959d979e61e8134fcaefb670b32603.tar
forums-f111e70fc3959d979e61e8134fcaefb670b32603.tar.gz
forums-f111e70fc3959d979e61e8134fcaefb670b32603.tar.bz2
forums-f111e70fc3959d979e61e8134fcaefb670b32603.tar.xz
forums-f111e70fc3959d979e61e8134fcaefb670b32603.zip
[ticket/14914] Made emoji scale in size with text
PHPBB3-14914
-rw-r--r--phpBB/phpbb/textformatter/s9e/factory.php4
-rw-r--r--phpBB/styles/prosilver/theme/common.css7
-rw-r--r--tests/text_formatter/s9e/default_formatting_test.php2
3 files changed, 10 insertions, 3 deletions
diff --git a/phpBB/phpbb/textformatter/s9e/factory.php b/phpBB/phpbb/textformatter/s9e/factory.php
index a310c67359..55149b8e63 100644
--- a/phpBB/phpbb/textformatter/s9e/factory.php
+++ b/phpBB/phpbb/textformatter/s9e/factory.php
@@ -348,10 +348,10 @@ class factory implements \phpbb\textformatter\cache_interface
$configurator->registeredVars['max_img_width'] = 0;
// Load the Emoji plugin and modify its tag's template to obey viewsmilies
- $configurator->Emoji->setImageSize(18);
+ $configurator->Emoji->omitImageSize();
$configurator->Emoji->useSVG();
$tag = $configurator->Emoji->getTag();
- $tag->template = '<xsl:choose><xsl:when test="$S_VIEWSMILIES">' . str_replace('class="emoji"', 'class="smilies"', $tag->template) . '</xsl:when><xsl:otherwise><xsl:value-of select="."/></xsl:otherwise></xsl:choose>';
+ $tag->template = '<xsl:choose><xsl:when test="$S_VIEWSMILIES">' . str_replace('class="emoji"', 'class="emoji smilies"', $tag->template) . '</xsl:when><xsl:otherwise><xsl:value-of select="."/></xsl:otherwise></xsl:choose>';
/**
* Modify the s9e\TextFormatter configurator after the default settings are set
diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css
index 9da5cfe3be..8505ac13f9 100644
--- a/phpBB/styles/prosilver/theme/common.css
+++ b/phpBB/styles/prosilver/theme/common.css
@@ -1047,6 +1047,13 @@ ul.linklist:after,
display: block;
}
+.emoji {
+ min-height: 18px;
+ min-width: 18px;
+ height: 1em;
+ width: 1em;
+}
+
.smilies {
vertical-align: text-bottom;
}
diff --git a/tests/text_formatter/s9e/default_formatting_test.php b/tests/text_formatter/s9e/default_formatting_test.php
index e25c3246b5..a0c57214e4 100644
--- a/tests/text_formatter/s9e/default_formatting_test.php
+++ b/tests/text_formatter/s9e/default_formatting_test.php
@@ -298,7 +298,7 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case
),
array(
"Emoji: \xF0\x9F\x98\x80",
- 'Emoji: <img alt="' . "\xF0\x9F\x98\x80" . '" class="smilies" draggable="false" width="18" height="18" src="//cdn.jsdelivr.net/emojione/assets/svg/1f600.svg">'
+ 'Emoji: <img alt="' . "\xF0\x9F\x98\x80" . '" class="emoji smilies" draggable="false" src="//cdn.jsdelivr.net/emojione/assets/svg/1f600.svg">'
),
array(
"Emoji: \xF0\x9F\x98\x80",