From 8456a3cf6fcd2588c68ef39ad04b6c0a233d3f5d Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Mon, 10 Sep 2018 18:09:23 +0200 Subject: [PATCH] Moved emojis to assets --- includes/sys_template.php | 2 +- {public => resources/assets}/emojis/cry.gif | Bin {public => resources/assets}/emojis/evil.gif | Bin {public => resources/assets}/emojis/lol.gif | Bin {public => resources/assets}/emojis/mad.gif | Bin {public => resources/assets}/emojis/question.gif | Bin {public => resources/assets}/emojis/redface.gif | Bin {public => resources/assets}/emojis/rolleyes.gif | Bin {public => resources/assets}/emojis/sad.gif | Bin {public => resources/assets}/emojis/smile.gif | Bin {public => resources/assets}/emojis/wind.gif | Bin src/Http/Response.php | 2 +- webpack.config.js | 7 +++++++ 13 files changed, 9 insertions(+), 2 deletions(-) rename {public => resources/assets}/emojis/cry.gif (100%) rename {public => resources/assets}/emojis/evil.gif (100%) rename {public => resources/assets}/emojis/lol.gif (100%) rename {public => resources/assets}/emojis/mad.gif (100%) rename {public => resources/assets}/emojis/question.gif (100%) rename {public => resources/assets}/emojis/redface.gif (100%) rename {public => resources/assets}/emojis/rolleyes.gif (100%) rename {public => resources/assets}/emojis/sad.gif (100%) rename {public => resources/assets}/emojis/smile.gif (100%) rename {public => resources/assets}/emojis/wind.gif (100%) diff --git a/includes/sys_template.php b/includes/sys_template.php index 19b0c2fa..e764c6e3 100644 --- a/includes/sys_template.php +++ b/includes/sys_template.php @@ -482,7 +482,7 @@ function ReplaceSmilies($msg) ) { $msg = str_ireplace($search, sprintf( '', - sprintf($assets->getAsset('emojis/%s.gif'), $replace) + sprintf($assets->getAsset('assets/emojis/%s.gif'), $replace) ), $msg); } diff --git a/public/emojis/cry.gif b/resources/assets/emojis/cry.gif similarity index 100% rename from public/emojis/cry.gif rename to resources/assets/emojis/cry.gif diff --git a/public/emojis/evil.gif b/resources/assets/emojis/evil.gif similarity index 100% rename from public/emojis/evil.gif rename to resources/assets/emojis/evil.gif diff --git a/public/emojis/lol.gif b/resources/assets/emojis/lol.gif similarity index 100% rename from public/emojis/lol.gif rename to resources/assets/emojis/lol.gif diff --git a/public/emojis/mad.gif b/resources/assets/emojis/mad.gif similarity index 100% rename from public/emojis/mad.gif rename to resources/assets/emojis/mad.gif diff --git a/public/emojis/question.gif b/resources/assets/emojis/question.gif similarity index 100% rename from public/emojis/question.gif rename to resources/assets/emojis/question.gif diff --git a/public/emojis/redface.gif b/resources/assets/emojis/redface.gif similarity index 100% rename from public/emojis/redface.gif rename to resources/assets/emojis/redface.gif diff --git a/public/emojis/rolleyes.gif b/resources/assets/emojis/rolleyes.gif similarity index 100% rename from public/emojis/rolleyes.gif rename to resources/assets/emojis/rolleyes.gif diff --git a/public/emojis/sad.gif b/resources/assets/emojis/sad.gif similarity index 100% rename from public/emojis/sad.gif rename to resources/assets/emojis/sad.gif diff --git a/public/emojis/smile.gif b/resources/assets/emojis/smile.gif similarity index 100% rename from public/emojis/smile.gif rename to resources/assets/emojis/smile.gif diff --git a/public/emojis/wind.gif b/resources/assets/emojis/wind.gif similarity index 100% rename from public/emojis/wind.gif rename to resources/assets/emojis/wind.gif diff --git a/src/Http/Response.php b/src/Http/Response.php index d79ab98b..4edf644a 100644 --- a/src/Http/Response.php +++ b/src/Http/Response.php @@ -22,7 +22,7 @@ class Response extends SymfonyResponse implements ResponseInterface public function __construct( $content = '', int $status = 200, - array $headers = array(), + array $headers = [], Renderer $view = null ) { $this->view = $view; diff --git a/webpack.config.js b/webpack.config.js index 261c1c44..fd36b0f9 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -23,6 +23,11 @@ for (let i = 0; i < 7; i++) { themeEntries[`theme${i}`] = `./resources/assets/themes/theme${i}.less`; } +const emojis = {}; +for (let emoji of ['redface', 'wind', 'smile', 'sad', 'lol', 'cry', 'rolleyes', 'evil', 'mad', 'question']){ + emojis[`${emoji}`] = `./resources/assets/emojis/${emoji}.gif`; +} + module.exports = { context: __dirname, resolve: { @@ -31,6 +36,7 @@ module.exports = { entry: { ...themeEntries, vendor: './resources/assets/js/vendor.js', + ...emojis, }, output: { path: path.resolve('public/assets'), @@ -46,6 +52,7 @@ module.exports = { query: { cacheDirectory: true }, }, { test: /\.(eot|ttf|otf|svg|woff2?)(\?.*)?$/, loader: 'file-loader' }, + { test: /\.gif$/, loader: 'file-loader?name=emojis/[name].[ext]' }, { test: /\.json$/, loader: 'json-loader' }, { test: /\.css$/, loader: 'style-loader!css-loader' }, { test: /\.less$/, use: ExtractTextPlugin.extract({