From: Alexander Ebert Date: Mon, 5 Sep 2016 09:26:18 +0000 (+0200) Subject: Added proper support for HD smilies X-Git-Tag: 3.0.0_Beta_1~313 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d4da0d92d193f6586681f8470a4632e1bb3fabf3;p=GitHub%2FWoltLab%2FWCF.git Added proper support for HD smilies --- diff --git a/com.woltlab.wcf/smiley.xml b/com.woltlab.wcf/smiley.xml index 148459597b..4c0fab48dd 100644 --- a/com.woltlab.wcf/smiley.xml +++ b/com.woltlab.wcf/smiley.xml @@ -3,155 +3,188 @@ smile - images/smilies/smile_emojione.png + images/smilies/emojione/263a.png + images/smilies/emojione/263a@2x.png sad - images/smilies/sad_emojione.png + images/smilies/emojione/2639.png + images/smilies/emojione/2639@2x.png wink - images/smilies/wink_emojione.png + images/smilies/emojione/1f609.png + images/smilies/emojione/1f609@2x.png tongue - images/smilies/tongue_emojione.png + images/smilies/emojione/1f61b.png + images/smilies/emojione/1f61b@2x.png grin - images/smilies/grin_emojione.png + images/smilies/emojione/1f600.png + images/smilies/emojione/1f600@2x.png biggrin - images/smilies/biggrin_emojione.png + images/smilies/emojione/1f601.png + images/smilies/emojione/1f601@2x.png crying - images/smilies/crying_emojione.png + images/smilies/emojione/1f62d.png + images/smilies/emojione/1f62d@2x.png angry - images/smilies/angry_emojione.png + images/smilies/emojione/1f620.png + images/smilies/emojione/1f620@2x.png .< >_<]]> kiss - images/smilies/kiss_emojione.png + images/smilies/emojione/1f618.png + images/smilies/emojione/1f618@2x.png mellow - images/smilies/mellow_emojione.png + images/smilies/emojione/1f610.png + images/smilies/emojione/1f610@2x.png w00t - images/smilies/w00t_emojione.png + images/smilies/emojione/1f62f.png + images/smilies/emojione/1f62f@2x.png scared - images/smilies/scared_emojione.png + images/smilies/emojione/1f631.png + images/smilies/emojione/1f631@2x.png sick - images/smilies/sick_emojione.png + images/smilies/emojione/1f922.png + images/smilies/emojione/1f922@2x.png tired - images/smilies/tired_emojione.png + images/smilies/emojione/1f62b.png + images/smilies/emojione/1f62b@2x.png unsure - images/smilies/unsure_emojione.png + images/smilies/emojione/1f914.png + images/smilies/emojione/1f914@2x.png wacko - images/smilies/wacko_emojione.png + images/smilies/emojione/1f635.png + images/smilies/emojione/1f635@2x.png pinch - images/smilies/pinch_emojione.png + images/smilies/emojione/1f612.png + images/smilies/emojione/1f612@2x.png cool - images/smilies/cool_emojione.png + images/smilies/emojione/1f60e.png + images/smilies/emojione/1f60e@2x.png confused - images/smilies/confused_emojione.png + images/smilies/emojione/1f614.png + images/smilies/emojione/1f614@2x.png Huh - images/smilies/huh_emojione.png + images/smilies/emojione/1f62e.png + images/smilies/emojione/1f62e@2x.png rolleyes - images/smilies/rolleyes_emojione.png + images/smilies/emojione/1f644.png + images/smilies/emojione/1f644@2x.png love - images/smilies/love_emojione.png + images/smilies/emojione/1f60d.png + images/smilies/emojione/1f60d@2x.png blink - images/smilies/blink_emojione.png + images/smilies/emojione/1f615.png + images/smilies/emojione/1f615@2x.png cursing - images/smilies/cursing_emojione.png + images/smilies/emojione/1f621.png + images/smilies/emojione/1f621@2x.png thumbdown - images/smilies/thumbdown_emojione.png + images/smilies/emojione/1f44e.png + images/smilies/emojione/1f44e@2x.png thumbup - images/smilies/thumbup_emojione.png + images/smilies/emojione/1f44d.png + images/smilies/emojione/1f44d@2x.png sleeping - images/smilies/sleeping_emojione.png + images/smilies/emojione/1f634.png + images/smilies/emojione/1f634@2x.png whistling - images/smilies/whistling_emojione.png + images/smilies/emojione/1f61e.png + images/smilies/emojione/1f61e@2x.png evil - images/smilies/evil_emojione.png + images/smilies/emojione/1f608.png + images/smilies/emojione/1f608@2x.png saint - images/smilies/saint_emojione.png + images/smilies/emojione/1f607.png + images/smilies/emojione/1f607@2x.png heart - images/smilies/heart_emojione.png + images/smilies/emojione/2764.png + images/smilies/emojione/2764@2x.png attention - images/smilies/attention_emojione.png + images/smilies/emojione/2757.png + images/smilies/emojione/2757@2x.png question - images/smilies/question_emojione.png + images/smilies/emojione/2753.png + images/smilies/emojione/2753@2x.png diff --git a/com.woltlab.wcf/templates/__messageFormSmilies.tpl b/com.woltlab.wcf/templates/__messageFormSmilies.tpl index 1d38ab5842..bb49b5f545 100644 --- a/com.woltlab.wcf/templates/__messageFormSmilies.tpl +++ b/com.woltlab.wcf/templates/__messageFormSmilies.tpl @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/wcfsetup/install/files/acp/templates/smileyAdd.tpl b/wcfsetup/install/files/acp/templates/smileyAdd.tpl index e77787827e..391495a1cd 100644 --- a/wcfsetup/install/files/acp/templates/smileyAdd.tpl +++ b/wcfsetup/install/files/acp/templates/smileyAdd.tpl @@ -109,49 +109,100 @@

{lang}wcf.acp.smiley.smileyFile{/lang}

- -
-
- {if $uploadedFilename} - - - {/if} - - - {if $errorField == 'fileUpload'} - - {if $errorType == 'empty'} - {lang}wcf.global.form.error.empty{/lang} - {else} - {lang}wcf.acp.smiley.fileUpload.error.{@$errorType}{/lang} - {/if} - - {/if} - {lang}wcf.acp.smiley.fileUpload.description{/lang} -
- - - -
-
- - - {if $errorField == 'smileyPath'} - - {if $errorType == 'empty'} - {lang}wcf.global.form.error.empty{/lang} - {else} - {lang}wcf.acp.smiley.smileyPath.error.{@$errorType}{/lang} - {/if} - - {/if} - {lang}wcf.acp.smiley.smileyPath.description{/lang} -
- +
+
+
+
+ {if $uploadedFilename} + + {/if} + + + {if $errorField == 'fileUpload'} + + {if $errorType == 'empty'} + {lang}wcf.global.form.error.empty{/lang} + {else} + {lang}wcf.acp.smiley.fileUpload.error.{@$errorType}{/lang} + {/if} + + {/if} + {lang}wcf.acp.smiley.fileUpload.description{/lang} +
+
+ +
+
+
+ + + {if $errorField == 'smileyPath'} + + {if $errorType == 'empty'} + {lang}wcf.global.form.error.empty{/lang} + {else} + {lang}wcf.acp.smiley.smileyPath.error.{@$errorType}{/lang} + {/if} + + {/if} + {lang}wcf.acp.smiley.smileyPath.description{/lang} +
+
+
{event name='smileyFileFields'}
+
+
+

{lang}wcf.acp.smiley.smileyFile2x{/lang}

+

{lang}wcf.acp.smiley.smileyFile2x.description{/lang}

+
+ +
+
+
+
+ {if $uploadedFilename2x} + + {/if} + + + {if $errorField == 'fileUpload2x'} + + {if $errorType == 'empty'} + {lang}wcf.global.form.error.empty{/lang} + {else} + {lang}wcf.acp.smiley.fileUpload.error.{@$errorType}{/lang} + {/if} + + {/if} + {lang}wcf.acp.smiley.fileUpload.description{/lang} +
+
+ +
+
+
+ + + {if $errorField == 'smileyPath2x'} + + {if $errorType == 'empty'} + {lang}wcf.global.form.error.empty{/lang} + {else} + {lang}wcf.acp.smiley.smileyPath.error.{@$errorType}{/lang} + {/if} + + {/if} + {lang}wcf.acp.smiley.smileyPath.description{/lang} +
+
+
+ + {event name='smileyFile2xFields'} +
+ {event name='sections'}
diff --git a/wcfsetup/install/files/acp/templates/smileyList.tpl b/wcfsetup/install/files/acp/templates/smileyList.tpl index 9b216af2bd..efd6889daf 100644 --- a/wcfsetup/install/files/acp/templates/smileyList.tpl +++ b/wcfsetup/install/files/acp/templates/smileyList.tpl @@ -47,7 +47,7 @@ {foreach from=$objects item=smiley}
  • - {lang}{$smiley->smileyTitle}{/lang} {$smiley->smileyCode}{foreach from=$smiley->getAliases() item='alias'} {$alias}{/foreach} + {@$smiley->getHtml()} {lang}{$smiley->smileyTitle}{/lang} {$smiley->smileyCode}{foreach from=$smiley->getAliases() item='alias'} {$alias}{/foreach} diff --git a/wcfsetup/install/files/images/smilies/angry_emojione.png b/wcfsetup/install/files/images/smilies/angry_emojione.png deleted file mode 100644 index cfc4a6ecde..0000000000 Binary files a/wcfsetup/install/files/images/smilies/angry_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/attention_emojione.png b/wcfsetup/install/files/images/smilies/attention_emojione.png deleted file mode 100644 index 2c14406422..0000000000 Binary files a/wcfsetup/install/files/images/smilies/attention_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/biggrin_emojione.png b/wcfsetup/install/files/images/smilies/biggrin_emojione.png deleted file mode 100644 index 418d94c811..0000000000 Binary files a/wcfsetup/install/files/images/smilies/biggrin_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/blink_emojione.png b/wcfsetup/install/files/images/smilies/blink_emojione.png deleted file mode 100644 index bd0ac55ec8..0000000000 Binary files a/wcfsetup/install/files/images/smilies/blink_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/confused_emojione.png b/wcfsetup/install/files/images/smilies/confused_emojione.png deleted file mode 100644 index cad0e23132..0000000000 Binary files a/wcfsetup/install/files/images/smilies/confused_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/cool_emojione.png b/wcfsetup/install/files/images/smilies/cool_emojione.png deleted file mode 100644 index 2001173511..0000000000 Binary files a/wcfsetup/install/files/images/smilies/cool_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/crying_emojione.png b/wcfsetup/install/files/images/smilies/crying_emojione.png deleted file mode 100644 index 52e3517a1e..0000000000 Binary files a/wcfsetup/install/files/images/smilies/crying_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/cursing_emojione.png b/wcfsetup/install/files/images/smilies/cursing_emojione.png deleted file mode 100644 index 9d739bd40a..0000000000 Binary files a/wcfsetup/install/files/images/smilies/cursing_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f44d.png b/wcfsetup/install/files/images/smilies/emojione/1f44d.png new file mode 100644 index 0000000000..5f6781d22c Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f44d.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f44d@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f44d@2x.png new file mode 100644 index 0000000000..5ae9f8c810 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f44d@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f44e.png b/wcfsetup/install/files/images/smilies/emojione/1f44e.png new file mode 100644 index 0000000000..53816ecb65 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f44e.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f44e@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f44e@2x.png new file mode 100644 index 0000000000..f879f3fc1d Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f44e@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f600.png b/wcfsetup/install/files/images/smilies/emojione/1f600.png new file mode 100644 index 0000000000..23384e09a1 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f600.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f600@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f600@2x.png new file mode 100644 index 0000000000..a8c8d122af Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f600@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f601.png b/wcfsetup/install/files/images/smilies/emojione/1f601.png new file mode 100644 index 0000000000..94b1e1e06e Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f601.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f601@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f601@2x.png new file mode 100644 index 0000000000..f352311a1e Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f601@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f607.png b/wcfsetup/install/files/images/smilies/emojione/1f607.png new file mode 100644 index 0000000000..78a9f36aea Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f607.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f607@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f607@2x.png new file mode 100644 index 0000000000..18afe6bd5e Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f607@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f608.png b/wcfsetup/install/files/images/smilies/emojione/1f608.png new file mode 100644 index 0000000000..fd21b0a0ee Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f608.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f608@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f608@2x.png new file mode 100644 index 0000000000..bc3ef30d33 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f608@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f609.png b/wcfsetup/install/files/images/smilies/emojione/1f609.png new file mode 100644 index 0000000000..dbc444e1cc Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f609.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f609@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f609@2x.png new file mode 100644 index 0000000000..b7d6f8f74d Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f609@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f60d.png b/wcfsetup/install/files/images/smilies/emojione/1f60d.png new file mode 100644 index 0000000000..c97b62f260 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f60d.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f60d@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f60d@2x.png new file mode 100644 index 0000000000..e0efa2bfaf Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f60d@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f60e.png b/wcfsetup/install/files/images/smilies/emojione/1f60e.png new file mode 100644 index 0000000000..7d7a272100 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f60e.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f60e@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f60e@2x.png new file mode 100644 index 0000000000..18fe7617d4 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f60e@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f610.png b/wcfsetup/install/files/images/smilies/emojione/1f610.png new file mode 100644 index 0000000000..477d18d1a6 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f610.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f610@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f610@2x.png new file mode 100644 index 0000000000..48fd14ddbb Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f610@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f612.png b/wcfsetup/install/files/images/smilies/emojione/1f612.png new file mode 100644 index 0000000000..adff311e15 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f612.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f612@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f612@2x.png new file mode 100644 index 0000000000..d6fe5663e3 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f612@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f614.png b/wcfsetup/install/files/images/smilies/emojione/1f614.png new file mode 100644 index 0000000000..b30a9a7ec0 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f614.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f614@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f614@2x.png new file mode 100644 index 0000000000..69cee20db0 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f614@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f615.png b/wcfsetup/install/files/images/smilies/emojione/1f615.png new file mode 100644 index 0000000000..fa0af7c174 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f615.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f615@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f615@2x.png new file mode 100644 index 0000000000..47aef54b6a Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f615@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f618.png b/wcfsetup/install/files/images/smilies/emojione/1f618.png new file mode 100644 index 0000000000..2272b5d3f8 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f618.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f618@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f618@2x.png new file mode 100644 index 0000000000..e281cdc11f Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f618@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f61b.png b/wcfsetup/install/files/images/smilies/emojione/1f61b.png new file mode 100644 index 0000000000..c6bc09b337 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f61b.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f61b@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f61b@2x.png new file mode 100644 index 0000000000..9ed02b47e0 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f61b@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f61e.png b/wcfsetup/install/files/images/smilies/emojione/1f61e.png new file mode 100644 index 0000000000..e7cea82897 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f61e.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f61e@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f61e@2x.png new file mode 100644 index 0000000000..37dcd75dcc Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f61e@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f620.png b/wcfsetup/install/files/images/smilies/emojione/1f620.png new file mode 100644 index 0000000000..5365338049 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f620.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f620@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f620@2x.png new file mode 100644 index 0000000000..4cc2e773f2 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f620@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f621.png b/wcfsetup/install/files/images/smilies/emojione/1f621.png new file mode 100644 index 0000000000..9baef4dc69 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f621.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f621@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f621@2x.png new file mode 100644 index 0000000000..1ff2b970bc Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f621@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f62b.png b/wcfsetup/install/files/images/smilies/emojione/1f62b.png new file mode 100644 index 0000000000..43eadbdf13 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f62b.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f62b@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f62b@2x.png new file mode 100644 index 0000000000..e22de4fb6c Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f62b@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f62d.png b/wcfsetup/install/files/images/smilies/emojione/1f62d.png new file mode 100644 index 0000000000..fd0c7a40b6 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f62d.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f62d@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f62d@2x.png new file mode 100644 index 0000000000..bba321a5c6 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f62d@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f62e.png b/wcfsetup/install/files/images/smilies/emojione/1f62e.png new file mode 100644 index 0000000000..f4b9889014 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f62e.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f62e@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f62e@2x.png new file mode 100644 index 0000000000..c92819f9aa Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f62e@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f62f.png b/wcfsetup/install/files/images/smilies/emojione/1f62f.png new file mode 100644 index 0000000000..74d4dd1704 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f62f.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f62f@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f62f@2x.png new file mode 100644 index 0000000000..576bd7e78b Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f62f@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f631.png b/wcfsetup/install/files/images/smilies/emojione/1f631.png new file mode 100644 index 0000000000..7b184e53c5 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f631.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f631@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f631@2x.png new file mode 100644 index 0000000000..fbc35ea3e9 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f631@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f634.png b/wcfsetup/install/files/images/smilies/emojione/1f634.png new file mode 100644 index 0000000000..d77594ce9e Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f634.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f634@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f634@2x.png new file mode 100644 index 0000000000..f80fe49aa1 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f634@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f635.png b/wcfsetup/install/files/images/smilies/emojione/1f635.png new file mode 100644 index 0000000000..d6912ece01 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f635.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f635@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f635@2x.png new file mode 100644 index 0000000000..d669be4e75 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f635@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f644.png b/wcfsetup/install/files/images/smilies/emojione/1f644.png new file mode 100644 index 0000000000..f0799a90bb Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f644.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f644@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f644@2x.png new file mode 100644 index 0000000000..382dc111a6 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f644@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f914.png b/wcfsetup/install/files/images/smilies/emojione/1f914.png new file mode 100644 index 0000000000..2b6df3fbf5 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f914.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f914@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f914@2x.png new file mode 100644 index 0000000000..3aefd41a52 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f914@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f922.png b/wcfsetup/install/files/images/smilies/emojione/1f922.png new file mode 100644 index 0000000000..fcc2ed26cf Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f922.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/1f922@2x.png b/wcfsetup/install/files/images/smilies/emojione/1f922@2x.png new file mode 100644 index 0000000000..61382e651f Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/1f922@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/2639.png b/wcfsetup/install/files/images/smilies/emojione/2639.png new file mode 100644 index 0000000000..b668c086e4 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/2639.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/2639@2x.png b/wcfsetup/install/files/images/smilies/emojione/2639@2x.png new file mode 100644 index 0000000000..36ff6186b9 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/2639@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/263a.png b/wcfsetup/install/files/images/smilies/emojione/263a.png new file mode 100644 index 0000000000..cecd35e616 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/263a.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/263a@2x.png b/wcfsetup/install/files/images/smilies/emojione/263a@2x.png new file mode 100644 index 0000000000..97aa5fc18f Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/263a@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/2753.png b/wcfsetup/install/files/images/smilies/emojione/2753.png new file mode 100644 index 0000000000..c341f0dc4c Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/2753.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/2753@2x.png b/wcfsetup/install/files/images/smilies/emojione/2753@2x.png new file mode 100644 index 0000000000..fcea3f20f0 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/2753@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/2757.png b/wcfsetup/install/files/images/smilies/emojione/2757.png new file mode 100644 index 0000000000..98626415d0 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/2757.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/2757@2x.png b/wcfsetup/install/files/images/smilies/emojione/2757@2x.png new file mode 100644 index 0000000000..0cace6f3f9 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/2757@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/2764.png b/wcfsetup/install/files/images/smilies/emojione/2764.png new file mode 100644 index 0000000000..1c84b8e92e Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/2764.png differ diff --git a/wcfsetup/install/files/images/smilies/emojione/2764@2x.png b/wcfsetup/install/files/images/smilies/emojione/2764@2x.png new file mode 100644 index 0000000000..f4fcdf7e45 Binary files /dev/null and b/wcfsetup/install/files/images/smilies/emojione/2764@2x.png differ diff --git a/wcfsetup/install/files/images/smilies/evil_emojione.png b/wcfsetup/install/files/images/smilies/evil_emojione.png deleted file mode 100644 index cc2c5f1ec7..0000000000 Binary files a/wcfsetup/install/files/images/smilies/evil_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/grin_emojione.png b/wcfsetup/install/files/images/smilies/grin_emojione.png deleted file mode 100644 index 30957a6596..0000000000 Binary files a/wcfsetup/install/files/images/smilies/grin_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/heart_emojione.png b/wcfsetup/install/files/images/smilies/heart_emojione.png deleted file mode 100644 index 638cb72dc4..0000000000 Binary files a/wcfsetup/install/files/images/smilies/heart_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/huh_emojione.png b/wcfsetup/install/files/images/smilies/huh_emojione.png deleted file mode 100644 index f99026a3bc..0000000000 Binary files a/wcfsetup/install/files/images/smilies/huh_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/kiss_emojione.png b/wcfsetup/install/files/images/smilies/kiss_emojione.png deleted file mode 100644 index 0ff808fd61..0000000000 Binary files a/wcfsetup/install/files/images/smilies/kiss_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/love_emojione.png b/wcfsetup/install/files/images/smilies/love_emojione.png deleted file mode 100644 index 73fbee29d4..0000000000 Binary files a/wcfsetup/install/files/images/smilies/love_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/mellow_emojione.png b/wcfsetup/install/files/images/smilies/mellow_emojione.png deleted file mode 100644 index 065d193afe..0000000000 Binary files a/wcfsetup/install/files/images/smilies/mellow_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/pinch_emojione.png b/wcfsetup/install/files/images/smilies/pinch_emojione.png deleted file mode 100644 index 2954017f6c..0000000000 Binary files a/wcfsetup/install/files/images/smilies/pinch_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/question_emojione.png b/wcfsetup/install/files/images/smilies/question_emojione.png deleted file mode 100644 index 5a58f3458a..0000000000 Binary files a/wcfsetup/install/files/images/smilies/question_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/rolleyes_emojione.png b/wcfsetup/install/files/images/smilies/rolleyes_emojione.png deleted file mode 100644 index 2f77b9fc3b..0000000000 Binary files a/wcfsetup/install/files/images/smilies/rolleyes_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/sad_emojione.png b/wcfsetup/install/files/images/smilies/sad_emojione.png deleted file mode 100644 index 6ae71f233b..0000000000 Binary files a/wcfsetup/install/files/images/smilies/sad_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/saint_emojione.png b/wcfsetup/install/files/images/smilies/saint_emojione.png deleted file mode 100644 index 57f5151124..0000000000 Binary files a/wcfsetup/install/files/images/smilies/saint_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/scared_emojione.png b/wcfsetup/install/files/images/smilies/scared_emojione.png deleted file mode 100644 index eb8b347cef..0000000000 Binary files a/wcfsetup/install/files/images/smilies/scared_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/sick_emojione.png b/wcfsetup/install/files/images/smilies/sick_emojione.png deleted file mode 100644 index a566c109c2..0000000000 Binary files a/wcfsetup/install/files/images/smilies/sick_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/sleeping_emojione.png b/wcfsetup/install/files/images/smilies/sleeping_emojione.png deleted file mode 100644 index 9ecf600d6d..0000000000 Binary files a/wcfsetup/install/files/images/smilies/sleeping_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/smile_emojione.png b/wcfsetup/install/files/images/smilies/smile_emojione.png deleted file mode 100644 index e9e53c03d4..0000000000 Binary files a/wcfsetup/install/files/images/smilies/smile_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/thumbdown_emojione.png b/wcfsetup/install/files/images/smilies/thumbdown_emojione.png deleted file mode 100644 index b63da2f20a..0000000000 Binary files a/wcfsetup/install/files/images/smilies/thumbdown_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/thumbsup_emojione.png b/wcfsetup/install/files/images/smilies/thumbsup_emojione.png deleted file mode 100644 index 5bba6dc6d5..0000000000 Binary files a/wcfsetup/install/files/images/smilies/thumbsup_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/thumbup_emojione.png b/wcfsetup/install/files/images/smilies/thumbup_emojione.png deleted file mode 100644 index f9e6f13a34..0000000000 Binary files a/wcfsetup/install/files/images/smilies/thumbup_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/tired_emojione.png b/wcfsetup/install/files/images/smilies/tired_emojione.png deleted file mode 100644 index 490fb56695..0000000000 Binary files a/wcfsetup/install/files/images/smilies/tired_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/tongue_emojione.png b/wcfsetup/install/files/images/smilies/tongue_emojione.png deleted file mode 100644 index 25757341f9..0000000000 Binary files a/wcfsetup/install/files/images/smilies/tongue_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/unsure_emojione.png b/wcfsetup/install/files/images/smilies/unsure_emojione.png deleted file mode 100644 index 7074afcf5b..0000000000 Binary files a/wcfsetup/install/files/images/smilies/unsure_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/w00t_emojione.png b/wcfsetup/install/files/images/smilies/w00t_emojione.png deleted file mode 100644 index c3bea9f251..0000000000 Binary files a/wcfsetup/install/files/images/smilies/w00t_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/wacko_emojione.png b/wcfsetup/install/files/images/smilies/wacko_emojione.png deleted file mode 100644 index f0dae7b789..0000000000 Binary files a/wcfsetup/install/files/images/smilies/wacko_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/whistling_emojione.png b/wcfsetup/install/files/images/smilies/whistling_emojione.png deleted file mode 100644 index 39d325fd8e..0000000000 Binary files a/wcfsetup/install/files/images/smilies/whistling_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/images/smilies/wink_emojione.png b/wcfsetup/install/files/images/smilies/wink_emojione.png deleted file mode 100644 index 7ea7810a37..0000000000 Binary files a/wcfsetup/install/files/images/smilies/wink_emojione.png and /dev/null differ diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabSmiley.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabSmiley.js index 6d2b7f5f7e..3b82fdc12a 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabSmiley.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabSmiley.js @@ -11,7 +11,7 @@ $.Redactor.prototype.WoltLabSmiley = function() { _insert: function(data) { this.buffer.set(); - this.insert.html('' + data.code + ''); + this.insert.html(data.img.cloneNode().outerHTML); } } }; diff --git a/wcfsetup/install/files/js/WCF.Message.js b/wcfsetup/install/files/js/WCF.Message.js index 5c60d3921a..dc489546a4 100644 --- a/wcfsetup/install/files/js/WCF.Message.js +++ b/wcfsetup/install/files/js/WCF.Message.js @@ -719,8 +719,7 @@ WCF.Message.Smilies = Class.extend({ require(['EventHandler'], (function(EventHandler) { EventHandler.fire('com.woltlab.wcf.redactor2', 'insertSmiley_' + this._editorId, { - code: elData(event.currentTarget, 'smiley-code'), - path: elData(event.currentTarget, 'smiley-path') + img: event.currentTarget.children[0] }); }).bind(this)); } diff --git a/wcfsetup/install/files/lib/acp/form/SmileyAddForm.class.php b/wcfsetup/install/files/lib/acp/form/SmileyAddForm.class.php index 853c702b5a..507d72409a 100644 --- a/wcfsetup/install/files/lib/acp/form/SmileyAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/SmileyAddForm.class.php @@ -48,7 +48,7 @@ class SmileyAddForm extends AbstractForm { public $smileyCode = ''; /** - * showorder value + * show order value * @var integer */ public $showOrder = 0; @@ -77,6 +77,12 @@ class SmileyAddForm extends AbstractForm { */ public $smileyPath = ''; + /** + * path to the smiley file (2x) + * @var string + */ + public $smileyPath2x = ''; + /** * node tree with available smiley categories * @var CategoryNodeTree @@ -85,16 +91,28 @@ class SmileyAddForm extends AbstractForm { /** * data of the uploaded smiley file - * @var array() + * @var array */ public $fileUpload = []; + /** + * data of the uploaded smiley file (2x) + * @var array + */ + public $fileUpload2x = []; + /** * temporary name of the uploaded smiley file * @var string */ public $uploadedFilename = ''; + /** + * temporary name of the uploaded smiley file (2x) + * @var string + */ + public $uploadedFilename2x = ''; + /** * @inheritDoc */ @@ -111,8 +129,10 @@ class SmileyAddForm extends AbstractForm { 'smileyCode' => $this->smileyCode, 'aliases' => $this->aliases, 'smileyPath' => $this->smileyPath, + 'smileyPath2x' => $this->smileyPath2x, 'categoryNodeList' => $this->categoryNodeTree->getIterator(), - 'uploadedFilename' => $this->uploadedFilename + 'uploadedFilename' => $this->uploadedFilename, + 'uploadedFilename2x' => $this->uploadedFilename2x ]); } @@ -151,6 +171,9 @@ class SmileyAddForm extends AbstractForm { if (isset($_POST['smileyPath'])) $this->smileyPath = FileUtil::removeLeadingSlash(StringUtil::trim($_POST['smileyPath'])); if (isset($_POST['uploadedFilename'])) $this->uploadedFilename = StringUtil::trim($_POST['uploadedFilename']); if (isset($_FILES['fileUpload'])) $this->fileUpload = $_FILES['fileUpload']; + if (isset($_POST['smileyPath2x'])) $this->smileyPath2x = FileUtil::removeLeadingSlash(StringUtil::trim($_POST['smileyPath2x'])); + if (isset($_POST['uploadedFilename2x'])) $this->uploadedFilename2x = StringUtil::trim($_POST['uploadedFilename2x']); + if (isset($_FILES['fileUpload2x'])) $this->fileUpload2x = $_FILES['fileUpload2x']; } /** @@ -165,11 +188,13 @@ class SmileyAddForm extends AbstractForm { 'smileyCode' => $this->smileyCode, 'aliases' => $this->aliases, 'smileyPath' => $this->smileyPath, + 'smileyPath2x' => $this->smileyPath2x, 'showOrder' => $this->showOrder, 'categoryID' => $this->categoryID ?: null, 'packageID' => 1 ]), - 'fileLocation' => $this->uploadedFilename ? WCF_DIR.'images/smilies/'.$this->uploadedFilename : '' + 'fileLocation' => $this->uploadedFilename ? WCF_DIR.'images/smilies/'.$this->uploadedFilename : '', + 'fileLocation2x' => $this->uploadedFilename2x ? WCF_DIR.'images/smilies/'.$this->uploadedFilename2x : '' ]); $this->objectAction->executeAction(); $returnValues = $this->objectAction->getReturnValues(); @@ -189,9 +214,9 @@ class SmileyAddForm extends AbstractForm { $this->smileyCode = ''; $this->categoryID = 0; $this->showOrder = 0; - $this->smileyPath = ''; + $this->smileyPath = $this->smileyPath2x = ''; $this->aliases = ''; - $this->uploadedFilename = ''; + $this->uploadedFilename = $this->uploadedFilename2x = ''; I18nHandler::getInstance()->reset(); @@ -239,6 +264,32 @@ class SmileyAddForm extends AbstractForm { } } + if ($this->uploadedFilename2x) { + if (!file_exists(WCF_DIR.'images/smilies/'.$this->uploadedFilename2x)) { + $this->uploadedFilename2x = ''; + throw new UserInputException('fileUpload2x', 'uploadFailed'); + } + } + else if (!empty($this->fileUpload2x['name'])) { + if (!getimagesize($this->fileUpload2x['tmp_name'])) { + $this->uploadedFilename2x = ''; + throw new UserInputException('fileUpload2x', 'noImage'); + } + + do { + $this->uploadedFilename2x = StringUtil::getRandomID().'.'.mb_strtolower(mb_substr($this->fileUpload2x['name'], mb_strrpos($this->fileUpload2x['name'], '.') + 1)); + } + while (file_exists(WCF_DIR.'images/smilies/'.$this->uploadedFilename2x)); + + if (!@move_uploaded_file($this->fileUpload2x['tmp_name'], WCF_DIR.'images/smilies/'.$this->uploadedFilename2x)) { + $this->uploadedFilename2x = ''; + throw new UserInputException('fileUpload2x', 'uploadFailed'); + } + } + else if ($this->smileyPath2x && !is_file(WCF_DIR.$this->smileyPath2x)) { + throw new UserInputException('smileyPath2x', 'notFound'); + } + // validate title if (!I18nHandler::getInstance()->validateValue('smileyTitle')) { if (I18nHandler::getInstance()->isPlainValue('smileyTitle')) { diff --git a/wcfsetup/install/files/lib/acp/form/SmileyEditForm.class.php b/wcfsetup/install/files/lib/acp/form/SmileyEditForm.class.php index 560e968d30..4564dcfa65 100644 --- a/wcfsetup/install/files/lib/acp/form/SmileyEditForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/SmileyEditForm.class.php @@ -73,10 +73,12 @@ class SmileyEditForm extends SmileyAddForm { 'smileyCode' => $this->smileyCode, 'aliases' => $this->aliases, 'smileyPath' => $this->smileyPath, + 'smileyPath2x' => $this->smileyPath2x, 'showOrder' => $this->showOrder, 'categoryID' => $this->categoryID ?: null ]), - 'fileLocation' => $this->uploadedFilename ? WCF_DIR.'images/smilies/'.$this->uploadedFilename : '' + 'fileLocation' => $this->uploadedFilename ? WCF_DIR.'images/smilies/'.$this->uploadedFilename : '', + 'fileLocation2x' => $this->uploadedFilename2x ? WCF_DIR.'images/smilies/'.$this->uploadedFilename2x : '' ]); $this->objectAction->executeAction(); @@ -101,6 +103,7 @@ class SmileyEditForm extends SmileyAddForm { $this->smileyCode = $this->smiley->smileyCode; $this->aliases = $this->smiley->aliases; $this->smileyPath = $this->smiley->smileyPath; + $this->smileyPath2x = $this->smiley->smileyPath2x; $this->showOrder = $this->smiley->showOrder; $this->categoryID = $this->smiley->categoryID; } diff --git a/wcfsetup/install/files/lib/data/smiley/Smiley.class.php b/wcfsetup/install/files/lib/data/smiley/Smiley.class.php index bd6a491c0b..704e388f01 100644 --- a/wcfsetup/install/files/lib/data/smiley/Smiley.class.php +++ b/wcfsetup/install/files/lib/data/smiley/Smiley.class.php @@ -15,13 +15,18 @@ use wcf\util\StringUtil; * @property-read integer $smileyID unique id of the smiley * @property-read integer $packageID id of the package which delivers the smiley * @property-read integer|null $categoryID id of the category the smiley belongs to or `null` if it belongs to the default category - * @property-read string $smileyPath path to the smiley file relative to wcf's defsult path + * @property-read string $smileyPath path to the smiley file relative to wcf's default path + * @property-read string $smileyPath2x path to the smiley file relative to wcf's default path (2x version) * @property-read string $smileyTitle title of the smiley * @property-read string $smileyCode code used for displaying the smiley * @property-read string $aliases alternative codes used for displaying the smiley * @property-read integer $showOrder position of the smiley in relation to the other smileys in the same category */ class Smiley extends DatabaseObject { + protected $height; + + public $smileyCodes; + /** * Returns the url to this smiley. * @@ -31,6 +36,10 @@ class Smiley extends DatabaseObject { return WCF::getPath().$this->smileyPath; } + public function getURL2x() { + return ($this->smileyPath2x) ? WCF::getPath().$this->smileyPath2x : ''; + } + /** * Returns all aliases for this smiley. * @@ -41,4 +50,28 @@ class Smiley extends DatabaseObject { return explode("\n", StringUtil::unifyNewlines($this->aliases)); } + + public function getHeight() { + if ($this->height === null) { + $this->height = 0; + + $file = WCF_DIR . $this->smileyPath; + if (file_exists($file) && preg_match('~\.(gif|jpe?g|png)$~', $file)) { + $data = getimagesize($file); + if ($data !== false) { + // index '1' contains the height of the image + $this->height = $data[1]; + } + } + } + + return $this->height; + } + + public function getHtml() { + $srcset = ($this->smileyPath2x) ? ' srcset="' . StringUtil::encodeHTML($this->getURL2x()) . ' 2x"' : ''; + $style = ($this->getHeight()) ? ' style="height: ' . $this->getHeight() . 'px"' : ''; + + return '' . StringUtil::encodeHTML($this->smileyCode) . ''; + } } diff --git a/wcfsetup/install/files/lib/data/smiley/SmileyAction.class.php b/wcfsetup/install/files/lib/data/smiley/SmileyAction.class.php index 2ee0764aed..748f6cd186 100644 --- a/wcfsetup/install/files/lib/data/smiley/SmileyAction.class.php +++ b/wcfsetup/install/files/lib/data/smiley/SmileyAction.class.php @@ -46,14 +46,25 @@ class SmileyAction extends AbstractDatabaseObjectAction implements ISortableActi /** @var Smiley $smiley */ $smiley = parent::create(); + $data = []; if (!empty($this->parameters['fileLocation'])) { $smileyFilename = 'smiley'.$smiley->smileyID.'.'.mb_strtolower(mb_substr($this->parameters['fileLocation'], mb_strrpos($this->parameters['fileLocation'], '.') + 1)); @rename($this->parameters['fileLocation'], WCF_DIR.'images/smilies/'.$smileyFilename); + $data['smileyPath'] = 'images/smilies/'.$smileyFilename; + + + } + if (!empty($this->parameters['fileLocation2x'])) { + $smileyFilename2x = 'smiley'.$smiley->smileyID.'@2x.'.mb_strtolower(mb_substr($this->parameters['fileLocation2x'], mb_strrpos($this->parameters['fileLocation2x'], '.') + 1)); + @rename($this->parameters['fileLocation2x'], WCF_DIR.'images/smilies/'.$smileyFilename2x); + + $data['smileyPath2x'] = 'images/smilies/'.$smileyFilename2x; + } + + if (!empty($data)) { $smileyEditor = new SmileyEditor($smiley); - $smileyEditor->update([ - 'smileyPath' => 'images/smilies/'.$smileyFilename - ]); + $smileyEditor->update($data); $smiley = new Smiley($smiley->smileyID); } @@ -69,12 +80,21 @@ class SmileyAction extends AbstractDatabaseObjectAction implements ISortableActi $this->readObjects(); } - if (count($this->objects) == 1 && !empty($this->parameters['fileLocation'])) { - $smiley = reset($this->objects); - $smileyFilename = 'smiley'.$smiley->smileyID.'.'.mb_strtolower(mb_substr($this->parameters['fileLocation'], mb_strrpos($this->parameters['fileLocation'], '.') + 1)); - @rename($this->parameters['fileLocation'], WCF_DIR.'images/smilies/'.$smileyFilename); - - $this->parameters['data']['smileyPath'] = 'images/smilies/'.$smileyFilename; + if (count($this->objects) == 1) { + if (!empty($this->parameters['fileLocation'])) { + $smiley = reset($this->objects); + $smileyFilename = 'smiley' . $smiley->smileyID . '.' . mb_strtolower(mb_substr($this->parameters['fileLocation'], mb_strrpos($this->parameters['fileLocation'], '.') + 1)); + @rename($this->parameters['fileLocation'], WCF_DIR . 'images/smilies/' . $smileyFilename); + + $this->parameters['data']['smileyPath'] = 'images/smilies/' . $smileyFilename; + } + if (!empty($this->parameters['fileLocation2x'])) { + $smiley = reset($this->objects); + $smileyFilename2x = 'smiley' . $smiley->smileyID . '@2x.' . mb_strtolower(mb_substr($this->parameters['fileLocation2x'], mb_strrpos($this->parameters['fileLocation2x'], '.') + 1)); + @rename($this->parameters['fileLocation2x'], WCF_DIR . 'images/smilies/' . $smileyFilename2x); + + $this->parameters['data']['smileyPath2x'] = 'images/smilies/' . $smileyFilename2x; + } } parent::update(); diff --git a/wcfsetup/install/files/lib/data/smiley/SmileyCache.class.php b/wcfsetup/install/files/lib/data/smiley/SmileyCache.class.php index b4942d274a..d9280e5301 100644 --- a/wcfsetup/install/files/lib/data/smiley/SmileyCache.class.php +++ b/wcfsetup/install/files/lib/data/smiley/SmileyCache.class.php @@ -21,6 +21,8 @@ class SmileyCache extends SingletonFactory { */ protected $cachedSmilies = []; + protected $cachedSmileyByCode = []; + /** * cached smiley categories * @var SmileyCategory[] @@ -39,6 +41,7 @@ class SmileyCache extends SingletonFactory { protected function init() { // get smiley cache $this->cachedSmilies = SmileyCacheBuilder::getInstance()->getData([], 'smilies'); + $this->cachedSmileyByCode = SmileyCacheBuilder::getInstance()->getData([], 'codes'); $smileyCategories = CategoryHandler::getInstance()->getCategories('com.woltlab.wcf.bbcode.smiley'); $this->cachedCategories[null] = new SmileyCategory(new Category(null, [ @@ -64,6 +67,14 @@ class SmileyCache extends SingletonFactory { return $this->cachedSmilies; } + public function getSmileyByCode($code) { + if (isset($this->cachedSmileyByCode[$code])) { + return $this->cachedSmileyByCode[$code]; + } + + return null; + } + /** * Returns all smiley categories. * diff --git a/wcfsetup/install/files/lib/system/bbcode/SimpleMessageParser.class.php b/wcfsetup/install/files/lib/system/bbcode/SimpleMessageParser.class.php index 3be450ed3a..7196737972 100644 --- a/wcfsetup/install/files/lib/system/bbcode/SimpleMessageParser.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/SimpleMessageParser.class.php @@ -61,7 +61,7 @@ class SimpleMessageParser extends SingletonFactory { /** @var Smiley $smiley */ foreach ($categorySmilies as $smiley) { foreach ($smiley->smileyCodes as $smileyCode) { - $this->smilies[$smileyCode] = ''.StringUtil::encodeHTML($smiley->smileyCode).''; + $this->smilies[$smileyCode] = $smiley->getHtml(); } } } diff --git a/wcfsetup/install/files/lib/system/cache/builder/SmileyCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/SmileyCacheBuilder.class.php index 0146422a99..fad1de0078 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/SmileyCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/SmileyCacheBuilder.class.php @@ -16,7 +16,7 @@ class SmileyCacheBuilder extends AbstractCacheBuilder { * @inheritDoc */ protected function rebuild(array $parameters) { - $data = ['smilies' => []]; + $data = ['codes' => [], 'smilies' => []]; // get smilies $sql = "SELECT * @@ -30,7 +30,14 @@ class SmileyCacheBuilder extends AbstractCacheBuilder { $object->smileyCodes = $object->getAliases(); $object->smileyCodes[] = $object->smileyCode; + // this call will cause the image height to be added to the cache + $object->getHeight(); + $data['smilies'][$object->categoryID][$object->smileyID] = $object; + + foreach ($object->smileyCodes as $smileyCode) { + $data['codes'][$smileyCode] = $object; + } } return $data; diff --git a/wcfsetup/install/files/lib/system/html/input/filter/MessageHtmlInputFilter.class.php b/wcfsetup/install/files/lib/system/html/input/filter/MessageHtmlInputFilter.class.php index 88ea19e562..0253362cfb 100644 --- a/wcfsetup/install/files/lib/system/html/input/filter/MessageHtmlInputFilter.class.php +++ b/wcfsetup/install/files/lib/system/html/input/filter/MessageHtmlInputFilter.class.php @@ -93,6 +93,7 @@ class MessageHtmlInputFilter implements IHtmlInputFilter { // add data-attachment-id="" for $definition->addAttribute('img', 'data-attachment-id', 'Number'); + $definition->addAttribute('img', 'srcset', 'Text'); $parameters = [ 'config' => $config, diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeImg.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeImg.class.php index 2980b210e6..9739473e07 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeImg.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeImg.class.php @@ -1,5 +1,7 @@ getAttribute('class'); - if (!preg_match('~\bwoltlabAttachment\b~', $class)) { - continue; + if (preg_match('~\bwoltlabAttachment\b~', $class)) { + $this->handleAttachment($element, $class); } - - $attachmentID = intval($element->getAttribute('data-attachment-id')); - if (!$attachmentID) { - continue; - } - - $float = 'none'; - $thumbnail = false; - - if (strpos($element->getAttribute('src'), 'thumbnail=1') !== false) { - $thumbnail = true; - } - - if (preg_match('~\bmessageFloatObject(?PLeft|Right)\b~', $class, $matches)) { - $float = ($matches['float'] === 'Left') ? 'left' : 'right'; + else if (preg_match('~\bsmiley\b~', $class)) { + $this->handleSmiley($element); } + } + } + + protected function handleAttachment(\DOMElement $element, $class) { + $attachmentID = intval($element->getAttribute('data-attachment-id')); + if (!$attachmentID) { + return; + } + + $float = 'none'; + $thumbnail = false; + + if (strpos($element->getAttribute('src'), 'thumbnail=1') !== false) { + $thumbnail = true; + } + + if (preg_match('~\bmessageFloatObject(?PLeft|Right)\b~', $class, $matches)) { + $float = ($matches['float'] === 'Left') ? 'left' : 'right'; + } + + $attributes = [ + $attachmentID, + $float, + $thumbnail + ]; + + $newElement = $element->ownerDocument->createElement('woltlab-metacode'); + $newElement->setAttribute('data-name', 'attach'); + $newElement->setAttribute('data-attributes', base64_encode(JSON::encode($attributes))); + DOMUtil::replaceElement($element, $newElement, false); + } + + protected function handleSmiley(\DOMElement $element) { + $code = $element->getAttribute('alt'); + + /** @var Smiley $smiley */ + $smiley = SmileyCache::getInstance()->getSmileyByCode($code); + if ($smiley === null) { + $element->parentNode->insertBefore($element->ownerDocument->createTextNode($code), $element); + $element->parentNode->removeChild($element); + } + else { + // enforce database values for src, srcset and style + $element->setAttribute('src', $smiley->getURL()); - $attributes = [ - $attachmentID, - $float, - $thumbnail - ]; + if ($smiley->getHeight()) $element->setAttribute('style', 'height: ' . $smiley->getHeight() . 'px'); + else $element->removeAttribute('style'); - $newElement = $element->ownerDocument->createElement('woltlab-metacode'); - $newElement->setAttribute('data-name', 'attach'); - $newElement->setAttribute('data-attributes', base64_encode(JSON::encode($attributes))); - DOMUtil::replaceElement($element, $newElement, false); + if ($smiley->smileyPath2x) $element->setAttribute('srcset', $smiley->getURL2x() . ' 2x'); + else $element->removeAttribute('srcset'); } } } diff --git a/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeImg.class.php b/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeImg.class.php index 99a3a7d271..d2d9885d71 100644 --- a/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeImg.class.php +++ b/wcfsetup/install/files/lib/system/html/output/node/HtmlOutputNodeImg.class.php @@ -1,5 +1,7 @@ getAttribute('src'); - if ($src) { - $element->setAttribute('src', $this->getProxyLink($src)); + $class = $element->getAttribute('class'); + if (preg_match('~\bsmiley\b~', $class)) { + $code = $element->getAttribute('alt'); + + /** @var Smiley $smiley */ + $smiley = SmileyCache::getInstance()->getSmileyByCode($code); + if ($smiley === null) { + // output as raw code instead + $element->parentNode->insertBefore($element->ownerDocument->createTextNode($code), $element); + $element->parentNode->removeChild($element); + } + else { + // enforce database values for src, srcset and style + $element->setAttribute('src', $smiley->getURL()); + + if ($smiley->getHeight()) $element->setAttribute('style', 'height: ' . $smiley->getHeight() . 'px'); + else $element->removeAttribute('style'); + + if ($smiley->smileyPath2x) $element->setAttribute('srcset', $smiley->getURL2x() . ' 2x'); + else $element->removeAttribute('srcset'); + } + } + else if (MODULE_IMAGE_PROXY) { + $src = $element->getAttribute('src'); + if ($src) { + $element->setAttribute('src', $this->getProxyLink($src)); + } } } } diff --git a/wcfsetup/install/files/lib/system/package/plugin/SmileyPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/SmileyPackageInstallationPlugin.class.php index 0c2c288bd9..aee184d4d2 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/SmileyPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/SmileyPackageInstallationPlugin.class.php @@ -53,6 +53,7 @@ class SmileyPackageInstallationPlugin extends AbstractXMLPackageInstallationPlug 'smileyCode' => $data['attributes']['name'], 'smileyTitle' => $data['elements']['title'], 'smileyPath' => $data['elements']['path'], + 'smileyPath2x' => isset($data['elements']['path2x']) ? $data['elements']['path2x'] : '', 'aliases' => isset($data['elements']['aliases']) ? $data['elements']['aliases'] : '', 'showOrder' => $showOrder ]; diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index f177265568..7cd8fd36df 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -1544,6 +1544,8 @@ GmbH=Gesellschaft mit beschränkter Haftung]]> getPath()}“ interpretiert.]]> + + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index fc5f4ed284..b862d9b1c5 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -1516,6 +1516,8 @@ GmbH=Gesellschaft mit beschränkter Haftung]]> getPath()}”.]]> + + diff --git a/wcfsetup/setup/db/install.sql b/wcfsetup/setup/db/install.sql index c36ed4cae9..6ba2f05043 100644 --- a/wcfsetup/setup/db/install.sql +++ b/wcfsetup/setup/db/install.sql @@ -1119,6 +1119,7 @@ CREATE TABLE wcf1_smiley ( packageID INT(10) NOT NULL, categoryID INT(10), smileyPath VARCHAR(255) NOT NULL DEFAULT '', + smileyPath2x VARCHAR(255) NOT NULL DEFAULT '', smileyTitle VARCHAR(255) NOT NULL DEFAULT '', smileyCode VARCHAR(191) NOT NULL DEFAULT '', aliases TEXT NOT NULL,