diff --git a/.gitignore b/.gitignore index 92120648f..8cf5cb829 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,8 @@ public/rides/ public/teaser/ public/users/ +node_modules + # Backup entities generated with doctrine:generate:entities command **/Entity/*~ criticalmass.iml @@ -59,3 +61,14 @@ docker ###> liip/imagine-bundle ### /public/media/cache/ ###< liip/imagine-bundle ### + +###> phpstan/phpstan ### +phpstan.neon +###< phpstan/phpstan ### + +###> symfony/webpack-encore-bundle ### +/node_modules/ +/public/build/ +npm-debug.log +yarn-error.log +###< symfony/webpack-encore-bundle ### diff --git a/assets/app.js b/assets/app.js new file mode 100644 index 000000000..0224bf8df --- /dev/null +++ b/assets/app.js @@ -0,0 +1,10 @@ +import './bootstrap.js'; +/* + * Welcome to your app's main JavaScript file! + * + * We recommend including the built version of this JavaScript file + * (and its CSS file) in your base layout (base.html.twig). + */ + +// any CSS you import will output into a single css file (app.css in this case) +import './styles/app.css'; diff --git a/assets/bootstrap.js b/assets/bootstrap.js new file mode 100644 index 000000000..c26293e2c --- /dev/null +++ b/assets/bootstrap.js @@ -0,0 +1,10 @@ +import { startStimulusApp } from '@symfony/stimulus-bridge'; + +// Registers Stimulus controllers from controllers.json and in the controllers/ directory +export const app = startStimulusApp(require.context( + '@symfony/stimulus-bridge/lazy-controller-loader!./controllers', + true, + /\.[jt]sx?$/ +)); +// register any custom, 3rd party controllers here +// app.register('some_controller_name', SomeImportedController); diff --git a/assets/controllers.json b/assets/controllers.json new file mode 100644 index 000000000..29ea244b4 --- /dev/null +++ b/assets/controllers.json @@ -0,0 +1,15 @@ +{ + "controllers": { + "@symfony/ux-turbo": { + "turbo-core": { + "enabled": true, + "fetch": "eager" + }, + "mercure-turbo-stream": { + "enabled": false, + "fetch": "eager" + } + } + }, + "entrypoints": [] +} diff --git a/assets/controllers/hello_controller.js b/assets/controllers/hello_controller.js new file mode 100644 index 000000000..e847027bd --- /dev/null +++ b/assets/controllers/hello_controller.js @@ -0,0 +1,16 @@ +import { Controller } from '@hotwired/stimulus'; + +/* + * This is an example Stimulus controller! + * + * Any element with a data-controller="hello" attribute will cause + * this controller to be executed. The name "hello" comes from the filename: + * hello_controller.js -> "hello" + * + * Delete this file or adapt it for your use! + */ +export default class extends Controller { + connect() { + this.element.textContent = 'Hello Stimulus! Edit me in assets/controllers/hello_controller.js'; + } +} diff --git a/assets/js/CriticalMass.js b/assets/js/CriticalMass.js index 63be8bb8f..d4cc9b7f3 100644 --- a/assets/js/CriticalMass.js +++ b/assets/js/CriticalMass.js @@ -1,6 +1,7 @@ var CriticalMass = CriticalMass || {}; CriticalMass.loadModule = function (name, context, options, callback) { + console.log(name); require([name], function (Module) { var module = new Module(context, options); @@ -13,6 +14,9 @@ CriticalMass.loadModule = function (name, context, options, callback) { require.config({ baseUrl: '/js/', shim: { + 'bootstrap.bundle': { + deps: ['jquery'] + }, 'leaflet-sleep': { deps: ['leaflet'], exports: 'L.Map.Sleep' @@ -47,4 +51,4 @@ require.config({ exports: 'Bloodhound' } } -}); +}); \ No newline at end of file diff --git a/assets/js/modules/map/Map.js b/assets/js/modules/map/Map.js index 79e196441..594e0675b 100644 --- a/assets/js/modules/map/Map.js +++ b/assets/js/modules/map/Map.js @@ -1,5 +1,5 @@ //define(['leaflet', 'CityMarker', 'LocationMarker', 'L.Control.Locate', 'Leaflet.Sleep'], function () { -define(['leaflet', 'CityMarker', 'LocationMarker'], function () { +define(['jquery', 'leaflet', 'CityMarker', 'LocationMarker'], function ($, L) { Map = function (mapId, settings) { this._mapId = mapId; diff --git a/assets/js/modules/modal/CloseModalButton.js b/assets/js/modules/modal/CloseModalButton.js index ba8fa8b4a..836720b6a 100644 --- a/assets/js/modules/modal/CloseModalButton.js +++ b/assets/js/modules/modal/CloseModalButton.js @@ -6,7 +6,7 @@ define([], function () { CloseModalButton.prototype._html = null; CloseModalButton.prototype.render = function () { - this._html = ''; + this._html = ''; this._$button = $(this._html); diff --git a/assets/js/modules/modal/Modal.js b/assets/js/modules/modal/Modal.js index 65d3c314b..ed4aa13a8 100644 --- a/assets/js/modules/modal/Modal.js +++ b/assets/js/modules/modal/Modal.js @@ -96,10 +96,12 @@ define([], function () { '