diff --git a/.gitattributes b/.gitattributes index 44975c09eb1982aa4ac0a97f9f81f085d98d55fa..91d98e0840ca96c038dd4a96a28a9555b4a1dfac 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,6 +3,8 @@ /apps/accessibility/js/accessibility.js binary /apps/accessibility/js/accessibility.js.map binary +/apps/comments/js/*.js binary +/apps/comments/js/*.js.map binary /apps/files_sharing/js/additionalScripts.js binary /apps/files_sharing/js/additionalScripts.js.map binary /apps/files_versions/js/files_versions.js binary diff --git a/apps/comments/.l10nignore b/apps/comments/.l10nignore index 8b832897e3f99a8bc4df8ada259f4b110a75a90b..4137f3242556e7ea7c086627067de9dd6613bb8e 100644 --- a/apps/comments/.l10nignore +++ b/apps/comments/.l10nignore @@ -1,2 +1,3 @@ # compiled vue templates -js/templates.js +src/templates.js +js/comments.js diff --git a/apps/comments/js/comments.js b/apps/comments/js/comments.js new file mode 100644 index 0000000000000000000000000000000000000000..e9d75bb98351cccfa68eb53150d3664e112d4237 Binary files /dev/null and b/apps/comments/js/comments.js differ diff --git a/apps/comments/js/comments.js.map b/apps/comments/js/comments.js.map new file mode 100644 index 0000000000000000000000000000000000000000..919d91a14bb69aac5248d6f4521256ba77bb2c1e Binary files /dev/null and b/apps/comments/js/comments.js.map differ diff --git a/apps/comments/js/merged.json b/apps/comments/js/merged.json deleted file mode 100644 index 8f40b5621a66703b7ec83ff0dd9158857c67b2a0..0000000000000000000000000000000000000000 --- a/apps/comments/js/merged.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - "app.js", - "templates.js", - "commentmodel.js", - "commentcollection.js", - "commentsummarymodel.js", - "commentstabview.js", - "commentsmodifymenu.js", - "filesplugin.js", - "activitytabviewplugin.js", - "search.js", - "vendor/Caret.js/dist/jquery.caret.min.js", - "vendor/At.js/dist/js/jquery.atwho.min.js" -] diff --git a/apps/comments/lib/AppInfo/Application.php b/apps/comments/lib/AppInfo/Application.php index 52848f3d63da6c044802e9874c26f370a9cdd468..b44c1c519c836ec06c4ab34f3e155160a329b68c 100644 --- a/apps/comments/lib/AppInfo/Application.php +++ b/apps/comments/lib/AppInfo/Application.php @@ -61,9 +61,7 @@ class Application extends App { $dispatcher->addListener( 'OCA\Files::loadAdditionalScripts', function() { - Util::addScript('comments', 'merged'); - Util::addStyle('comments', 'autocomplete'); - Util::addStyle('comments', 'comments'); + Util::addScript('comments', 'comments'); } ); } diff --git a/apps/comments/js/activitytabviewplugin.js b/apps/comments/src/activitytabviewplugin.js similarity index 100% rename from apps/comments/js/activitytabviewplugin.js rename to apps/comments/src/activitytabviewplugin.js diff --git a/apps/comments/js/app.js b/apps/comments/src/app.js similarity index 100% rename from apps/comments/js/app.js rename to apps/comments/src/app.js diff --git a/apps/comments/js/commentcollection.js b/apps/comments/src/commentcollection.js similarity index 100% rename from apps/comments/js/commentcollection.js rename to apps/comments/src/commentcollection.js diff --git a/apps/comments/js/commentmodel.js b/apps/comments/src/commentmodel.js similarity index 100% rename from apps/comments/js/commentmodel.js rename to apps/comments/src/commentmodel.js diff --git a/apps/comments/src/comments.js b/apps/comments/src/comments.js new file mode 100644 index 0000000000000000000000000000000000000000..f0d4433674b930e25cfedfb0104204fa452aef8d --- /dev/null +++ b/apps/comments/src/comments.js @@ -0,0 +1,18 @@ +import './app' +import './templates' +import './commentmodel' +import './commentcollection' +import './commentsummarymodel' +import './commentstabview' +import './commentsmodifymenu' +import './filesplugin' +import './activitytabviewplugin' +import './search' + +import './vendor/Caret.js/dist/jquery.caret.min' +import './vendor/At.js/dist/js/jquery.atwho.min' + +import './style/autocomplete.scss' +import './style/comments.scss' + +window.OCA.Comments = OCA.Comments; diff --git a/apps/comments/js/commentsmodifymenu.js b/apps/comments/src/commentsmodifymenu.js similarity index 100% rename from apps/comments/js/commentsmodifymenu.js rename to apps/comments/src/commentsmodifymenu.js diff --git a/apps/comments/js/commentstabview.js b/apps/comments/src/commentstabview.js similarity index 100% rename from apps/comments/js/commentstabview.js rename to apps/comments/src/commentstabview.js diff --git a/apps/comments/js/commentsummarymodel.js b/apps/comments/src/commentsummarymodel.js similarity index 100% rename from apps/comments/js/commentsummarymodel.js rename to apps/comments/src/commentsummarymodel.js diff --git a/apps/comments/js/filesplugin.js b/apps/comments/src/filesplugin.js similarity index 100% rename from apps/comments/js/filesplugin.js rename to apps/comments/src/filesplugin.js diff --git a/apps/comments/js/search.js b/apps/comments/src/search.js similarity index 100% rename from apps/comments/js/search.js rename to apps/comments/src/search.js diff --git a/apps/comments/css/autocomplete.scss b/apps/comments/src/style/autocomplete.scss similarity index 100% rename from apps/comments/css/autocomplete.scss rename to apps/comments/src/style/autocomplete.scss diff --git a/apps/comments/css/comments.scss b/apps/comments/src/style/comments.scss similarity index 100% rename from apps/comments/css/comments.scss rename to apps/comments/src/style/comments.scss diff --git a/apps/comments/js/templates.js b/apps/comments/src/templates.js similarity index 100% rename from apps/comments/js/templates.js rename to apps/comments/src/templates.js diff --git a/apps/comments/js/templates/comment.handlebars b/apps/comments/src/templates/comment.handlebars similarity index 100% rename from apps/comments/js/templates/comment.handlebars rename to apps/comments/src/templates/comment.handlebars diff --git a/apps/comments/js/templates/commentsmodifymenu.handlebars b/apps/comments/src/templates/commentsmodifymenu.handlebars similarity index 100% rename from apps/comments/js/templates/commentsmodifymenu.handlebars rename to apps/comments/src/templates/commentsmodifymenu.handlebars diff --git a/apps/comments/js/templates/edit_comment.handlebars b/apps/comments/src/templates/edit_comment.handlebars similarity index 100% rename from apps/comments/js/templates/edit_comment.handlebars rename to apps/comments/src/templates/edit_comment.handlebars diff --git a/apps/comments/js/templates/filesplugin.handlebars b/apps/comments/src/templates/filesplugin.handlebars similarity index 100% rename from apps/comments/js/templates/filesplugin.handlebars rename to apps/comments/src/templates/filesplugin.handlebars diff --git a/apps/comments/js/templates/view.handlebars b/apps/comments/src/templates/view.handlebars similarity index 100% rename from apps/comments/js/templates/view.handlebars rename to apps/comments/src/templates/view.handlebars diff --git a/apps/comments/js/vendor/At.js/dist/js/jquery.atwho.min.js b/apps/comments/src/vendor/At.js/dist/js/jquery.atwho.min.js similarity index 100% rename from apps/comments/js/vendor/At.js/dist/js/jquery.atwho.min.js rename to apps/comments/src/vendor/At.js/dist/js/jquery.atwho.min.js diff --git a/apps/comments/js/vendor/Caret.js/dist/jquery.caret.min.js b/apps/comments/src/vendor/Caret.js/dist/jquery.caret.min.js similarity index 100% rename from apps/comments/js/vendor/Caret.js/dist/jquery.caret.min.js rename to apps/comments/src/vendor/Caret.js/dist/jquery.caret.min.js diff --git a/apps/comments/webpack.js b/apps/comments/webpack.js new file mode 100644 index 0000000000000000000000000000000000000000..dff1aa0518f35b4775ccc602829db6cf10f244cd --- /dev/null +++ b/apps/comments/webpack.js @@ -0,0 +1,40 @@ +const path = require('path'); + +module.exports = { + entry: path.join(__dirname, 'src', 'comments.js'), + output: { + path: path.resolve(__dirname, './js'), + publicPath: '/js/', + filename: 'comments.js' + }, + module: { + rules: [ + { + test: /\.css$/, + use: ['style-loader', 'css-loader'] + }, + { + test: /\.scss$/, + use: ['style-loader', 'css-loader', 'sass-loader'] + }, + { + test: /\.js$/, + loader: 'babel-loader', + exclude: /node_modules/ + }, + { + test: /\.(png|jpg|gif|svg)$/, + loader: 'file-loader', + options: { + name: '[name].[ext]?[hash]' + } + } + ] + }, + externals: { + jquery: 'jQuery' + }, + resolve: { + extensions: ['*', '.js'] + } +}; diff --git a/tests/karma.config.js b/tests/karma.config.js index e5a28b1f0ed87dd920201da7003b73bcafd83ad1..81627abba0a5e83105cc9f373876adfb27360917 100644 --- a/tests/karma.config.js +++ b/tests/karma.config.js @@ -77,17 +77,7 @@ module.exports = function(config) { { name: 'comments', srcFiles: [ - // need to enforce loading order... - 'apps/comments/js/app.js', - 'apps/comments/js/templates.js', - 'apps/comments/js/vendor/Caret.js/dist/jquery.caret.min.js', - 'apps/comments/js/vendor/At.js/dist/js/jquery.atwho.min.js', - 'apps/comments/js/commentmodel.js', - 'apps/comments/js/commentcollection.js', - 'apps/comments/js/commentsummarymodel.js', - 'apps/comments/js/commentsmodifymenu.js', - 'apps/comments/js/commentstabview.js', - 'apps/comments/js/filesplugin.js' + 'apps/comments/js/comments.js' ], testFiles: ['apps/comments/tests/js/**/*.js'] }, diff --git a/webpack.common.js b/webpack.common.js index 6d8660b3bcb5e907d01708bd471ecab7f0b76a4a..0fb8e72f7f33aa5f38e18a9967ad1892743569be 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -2,6 +2,7 @@ const core = require('./core/webpack') const settings = require('./settings/webpack') const accessibility = require('./apps/accessibility/webpack') +const comments = require('./apps/comments/webpack') const files_sharing = require('./apps/files_sharing/webpack') const files_trashbin = require('./apps/files_trashbin/webpack') const files_versions = require('./apps/files_versions/webpack') @@ -14,6 +15,7 @@ module.exports = [].concat( core, settings, accessibility, + comments, files_sharing, files_trashbin, files_versions,