mc-cms-namelessmc/dev/scripts/postinstall.js
Tadhg Boyle b13c29e5e4
Reactions revamp & profile widgets (#3272)
* Initial work on reactions revamp and profile widgets

* Remove unneeded changes

* Remove unneeded change

* fix style

* Render emojis in reaction list StaffCP

* wip minecraft account profile widget, sticky widgets on profile page

* Add server name and IP to last seen

* remove

* rename to reaction score to match member list

* align reactions table contents center

* fix

* wip - nicer abstraction, widgets never query db, skin 3d viewer (undecided)

* wip - make reaction modals ajax, copy new reaction bar to profile posts

* wip reaction modals

* wip proper sorting

* wip modals

* wip get reaction submission working on profile wall posts

* add back helpful and creative default reactions

* reduce query amount on view topic

* remove debug statement

* wip

* wip

* simplify ProfileWidget pages

* Revert forum dropdown

* fix css syntax

* fix emoji title and alt being strange

* add back order input

* sort widgets by order in list

* fix settings link always showing

* phpdoc

* add widget name to exception

* insert default widget data if not found

* missing end if

* properly cache forum news per-group

* fix

* fix cache key, news permission check

* fix styling

* wip

* respect reaction ordering

* wip

* wip

* support custom reaction scores, update member list to properly calculate

* don't hardcode words

* wip

* allow multiple reactions

* redirect to post

* code style

* phpstan

* wip

* remove hardcoded terms + fix copy

* use npm for skinview3d

* create ReactionContext and refactor

* fix cache

* docblocks

* fix spelling

* pr amendments
2023-06-21 18:19:46 +01:00

94 lines
2 KiB
JavaScript

const fse = require('fs-extra');
console.log('Copying assets to core/assets/vendor...')
// Define assets to be copied here
const publicAssets = {
'@fortawesome': [
'fontawesome-free/css/all.min.css',
'fontawesome-free/webfonts'
],
'bootstrap': [
'dist/css/bootstrap.min.css',
'dist/css/bootstrap.min.css.map',
'dist/js/bootstrap.bundle.min.js',
'dist/js/bootstrap.bundle.min.js.map',
],
'bootstrap-colorpicker': [
'dist',
],
'chart.js': [
'dist/Chart.min.js',
'dist/Chart.min.css',
],
'codemirror': [
'lib/codemirror.css',
'lib/codemirror.js',
'mode/smarty/smarty.js',
'mode/javascript/javascript.js',
'mode/css/css.js',
'mode/htmlmixed/htmlmixed.js',
],
'datatables.net': [
'js/jquery.dataTables.min.js',
],
'datatables.net-bs4': [
'css/dataTables.bootstrap4.css',
'js/dataTables.bootstrap4.min.js',
],
'dropzone': [
'dist/min/dropzone.min.css',
'dist/min/dropzone.min.js',
],
'fomantic-ui': [
'dist/semantic.min.css',
'dist/semantic.min.js',
'dist/themes/default',
],
'image-picker': [
'image-picker/image-picker.css',
'image-picker/image-picker.min.js',
],
'jquery': [
'dist/jquery.min.js',
],
'jquery-ui-dist': [
'jquery-ui.min.js',
],
'jquery.cookie': [
'jquery.cookie.js',
],
'moment': [
'min/moment.min.js',
'min/moment.min.js.map',
],
'select2': [
'dist/js/select2.min.js',
'dist/css/select2.min.css',
],
'tinymce': [
'icons',
'plugins',
'skins',
'themes',
'tinymce.min.js',
],
'skinview3d': [
'bundles/skinview3d.bundle.js',
'bundles/skinview3d.bundle.js.map',
'assets/minecraft.woff2',
],
};
fse.emptyDirSync('core/assets/vendor');
Object.keys(publicAssets).forEach((name) => {
publicAssets[name].forEach((asset) => {
const fullPath = `${name}/${asset}`;
console.log(`Copying ${fullPath}...`);
fse.copySync(
`node_modules/${fullPath}`,
`core/assets/vendor/${fullPath}`
);
});
});