From 754267e9dd25a3e952b9493e7f0d1c1855139d25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 4 Dec 2019 14:05:35 +0100 Subject: [PATCH] configure assets using function + use `runtime.js` --- CHANGELOG.md | 5 ++++ Resources/public/main.js | 36 +++++++++++++++++++++++ Resources/views/Login/login.html.twig | 3 +- Resources/views/layout.html.twig | 1 + chill.webpack.config.js | 42 +++++---------------------- 5 files changed, 51 insertions(+), 36 deletions(-) create mode 100644 Resources/public/main.js diff --git a/CHANGELOG.md b/CHANGELOG.md index efb9cabf0..7f3ffc53c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,7 @@ Version 1.5.10 - allow to group export in UI +<<<<<<< HEAD Version 1.5.11 ============== @@ -88,3 +89,7 @@ Master branch - fix search: usage of parenthesis - add DQL function REPLACE for replacing in strings: "REPLACE(string, 'from', 'to')" - add function to format phonenumber +- improve `chill_print_or_message` to support date time; +- add a module `show_hide` for javascript; +- load assets using functions ; +- load a `runtime.js` assets for objects shared by webpack ; diff --git a/Resources/public/main.js b/Resources/public/main.js new file mode 100644 index 000000000..ffbe55c46 --- /dev/null +++ b/Resources/public/main.js @@ -0,0 +1,36 @@ +// import jQuery +const $ = require('jquery'); +// create global $ and jQuery variables +global.$ = global.jQuery = $; + +const moment = require('moment'); +global.moment = moment; + +const pikaday = require('pikaday-jquery'); + +const select2 = require('select2'); +global.select2 = select2; + +// import js +import {chill} from './js/chill.js'; +global.chill = chill; + +// css +require('./sass/scratch.scss'); +require('./css/chillmain.css'); +require('./css/pikaday.css'); +require('./js/collection/collections.js'); +require('./modules/breadcrumb/index.js'); +require('./modules/download-report/index.js'); +//require('./css/scratch.css'); +//require('./css/select2/select2.css'); +require('select2/dist/css/select2.css'); +require('./modules/select_interactive_loading/index.js'); +require('./modules/export-list/export-list.scss'); + +// img +require('./img/favicon.ico'); +require('./img/logo-chill-sans-slogan_white.png'); +require('./img/logo-chill-outil-accompagnement_white.png'); + + diff --git a/Resources/views/Login/login.html.twig b/Resources/views/Login/login.html.twig index 7cdecef26..de57ba4d2 100644 --- a/Resources/views/Login/login.html.twig +++ b/Resources/views/Login/login.html.twig @@ -15,7 +15,6 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} - @@ -48,5 +47,7 @@ + + diff --git a/Resources/views/layout.html.twig b/Resources/views/layout.html.twig index 920badebb..9baba0fb5 100644 --- a/Resources/views/layout.html.twig +++ b/Resources/views/layout.html.twig @@ -142,6 +142,7 @@ {{ include('@ChillMain/Layout/_footer.html.twig') }} +