Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify js files #7098

Merged
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .babelrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env"]
}
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
parser: '@babel/eslint-parser',
extends: ['eslint:recommended']
}
4 changes: 3 additions & 1 deletion UPGRADE-4.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ If you still need it, please set it up on your own!

Frontend dependencies are handled with NPM. Bower is not used anymore.

A lot of assets that were previously public are handled with NPM and placed in a private `node_modules/` directory.
A lot of assets that were previously public are handled with NPM and placed in a private `node_modules/` directory.
From these dependencies, only the necessary files are exposed publicly through Webpack Encore.

The `jquery-ui` dependency was fully included before, but now we only include the sortable widget (JavaScript and CSS), the rest of this dependency is not exposed. If you are adding more JavaScript or CSS using another widget of `jquery-ui` please include it yourself.

Please check the `src/Resources/public/dist` and the documentation to see the used CSS, JavaScript, images and fonts.

If you are customising (specially removing standard JavaScript or CSS) assets, this will affect you.
Expand Down
39 changes: 39 additions & 0 deletions assets/js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Any SCSS/CSS you require will output into a single css file (app.css in this case)
import '../scss/app.scss';

// Require jQuery normally
import $ from 'jquery';

// Create global $ and jQuery variables to be used outside this script
// eslint-disable-next-line
global.$ = global.jQuery = $;

import 'jquery.scrollto';

// Only using sortable widget from jquery-ui library
import 'jquery-ui/ui/widget';
import 'jquery-ui/ui/widgets/sortable';
import 'bootstrap';
import 'moment';

// Eonasdan Bootstrap DateTimePicker in its version 3 does not
// provide the scss or plain css, it only provides the less version
// of its source files, that's why it is not included it via npm.
import '../vendor/bootstrap-datetimepicker.min';
jordisala1991 marked this conversation as resolved.
Show resolved Hide resolved
import 'jquery-form';

// Boostrap 3 JavaScript for the x-editable library
import 'x-editable/dist/bootstrap3-editable/js/bootstrap-editable';

// Full version of Select2, needed because SonataAdmin needs
// compat dropdownCss and it only comes on the full version
import 'select2/dist/js/select2.full';
import 'admin-lte';
import 'icheck';
import 'jquery-slimscroll';

// jQuery waypoints version and sticky shortcut
import 'waypoints/lib/jquery.waypoints';
import 'waypoints/lib/shortcuts/sticky';
import 'readmore-js';
import 'masonry-layout';
11 changes: 10 additions & 1 deletion assets/scss/app.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
@import "~bootstrap/dist/css/bootstrap.css";
@import "~font-awesome/scss/font-awesome";

// Basic AdminLTE styles without any plugins,
// because they conflict with Select2 v4
@import "~admin-lte/dist/css/alt/AdminLTE-without-plugins.css";
@import "~icheck/skins/square/blue.css";

// Eonasdan Bootstrap DateTimePicker in its version 3 does not
// provide the scss or plain css, it only provides the less version
// of its source files, that's why it is not included it via npm.
@import "../vendor/bootstrap-datetimepicker.css";
@import "../vendor/jquery-ui.css";

// Only use sortable widget from jquery-ui library
jordisala1991 marked this conversation as resolved.
Show resolved Hide resolved
@import "~jquery-ui/themes/base/sortable.css";
jordisala1991 marked this conversation as resolved.
Show resolved Hide resolved
@import "~select2/dist/css/select2.css";
@import "~select2-bootstrap-theme/dist/select2-bootstrap.css";

// Boostrap 3 styles for the x-editable library
@import "~x-editable/dist/bootstrap3-editable/css/bootstrap-editable.css";

// SonataAdmin custom styles
@import "./styles";
@import "./layout";
@import "./tree";
Expand Down
3 changes: 2 additions & 1 deletion assets/vendor/bootstrap-datetimepicker.min.js

Large diffs are not rendered by default.

Binary file removed assets/vendor/images/animated-overlay.gif
Binary file not shown.
Binary file removed assets/vendor/images/ui-bg_flat_0_aaaaaa_40x100.png
Binary file not shown.
Binary file removed assets/vendor/images/ui-bg_flat_75_ffffff_40x100.png
Binary file not shown.
Binary file removed assets/vendor/images/ui-bg_glass_55_fbf9ee_1x400.png
Binary file not shown.
Binary file removed assets/vendor/images/ui-bg_glass_65_ffffff_1x400.png
Binary file not shown.
Binary file removed assets/vendor/images/ui-bg_glass_75_dadada_1x400.png
Binary file not shown.
Binary file removed assets/vendor/images/ui-bg_glass_75_e6e6e6_1x400.png
Binary file not shown.
Binary file removed assets/vendor/images/ui-bg_glass_95_fef1ec_1x400.png
Binary file not shown.
Binary file not shown.
Binary file removed assets/vendor/images/ui-icons_222222_256x240.png
Binary file not shown.
Binary file removed assets/vendor/images/ui-icons_2e83ff_256x240.png
Binary file not shown.
Binary file removed assets/vendor/images/ui-icons_454545_256x240.png
Binary file not shown.
Binary file removed assets/vendor/images/ui-icons_888888_256x240.png
Binary file not shown.
Binary file removed assets/vendor/images/ui-icons_cd0a0a_256x240.png
Binary file not shown.
7 changes: 0 additions & 7 deletions assets/vendor/jquery-ui-i18n.min.js

This file was deleted.

Loading