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({