mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Load stimulus controllers properly
This commit is contained in:
parent
5cc5c53853
commit
f60ef33736
4 changed files with 18 additions and 41 deletions
|
@ -1,12 +0,0 @@
|
||||||
/*
|
|
||||||
* 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';
|
|
||||||
|
|
||||||
// start the Stimulus application
|
|
||||||
import './bootstrap';
|
|
|
@ -1,16 +0,0 @@
|
||||||
import { Controller } from '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';
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -26,15 +26,16 @@
|
||||||
|
|
||||||
// any CSS you require will output into a single css file (app.css in this case)
|
// any CSS you require will output into a single css file (app.css in this case)
|
||||||
|
|
||||||
require('../css/app.css');
|
// Main CSS files
|
||||||
|
import '../css/app.css';
|
||||||
|
|
||||||
|
// start the Stimulus application
|
||||||
|
import '../bootstrap';
|
||||||
|
|
||||||
// Need jQuery? Install it with "yarn add jquery", then uncomment to require it.
|
// Need jQuery? Install it with "yarn add jquery", then uncomment to require it.
|
||||||
const $ = require('jquery');
|
const $ = require('jquery');
|
||||||
|
|
||||||
//Only include javascript
|
//Only include javascript
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import '@fortawesome/fontawesome-free/css/all.css'
|
import '@fortawesome/fontawesome-free/css/all.css'
|
||||||
|
|
||||||
import 'datatables.net-bs4/css/dataTables.bootstrap4.css'
|
import 'datatables.net-bs4/css/dataTables.bootstrap4.css'
|
||||||
|
@ -47,8 +48,10 @@ import "patternfly-bootstrap-treeview/src/css/bootstrap-treeview.css"
|
||||||
|
|
||||||
import "bootstrap-fileinput/css/fileinput.css"
|
import "bootstrap-fileinput/css/fileinput.css"
|
||||||
|
|
||||||
require('bootstrap');
|
//import * as Turbo from "@hotwired/turbo"
|
||||||
|
|
||||||
|
require('bootstrap');
|
||||||
|
/**
|
||||||
//require( 'jszip' );
|
//require( 'jszip' );
|
||||||
//#require( 'pdfmake' );
|
//#require( 'pdfmake' );
|
||||||
require( 'datatables.net-bs4' );
|
require( 'datatables.net-bs4' );
|
||||||
|
@ -97,9 +100,9 @@ import 'katex/dist/katex.css';
|
||||||
window.ClipboardJS = require('clipboard');
|
window.ClipboardJS = require('clipboard');
|
||||||
|
|
||||||
require('../ts_src/ajax_ui');
|
require('../ts_src/ajax_ui');
|
||||||
import {ajaxUI} from "../ts_src/ajax_ui";
|
//import {ajaxUI} from "../ts_src/ajax_ui";
|
||||||
|
|
||||||
window.ajaxUI = ajaxUI;
|
//window.ajaxUI = ajaxUI;
|
||||||
|
|
||||||
//Require all events;
|
//Require all events;
|
||||||
require('../ts_src/event_listeners');
|
require('../ts_src/event_listeners');
|
||||||
|
@ -125,8 +128,8 @@ try {
|
||||||
}
|
}
|
||||||
|
|
||||||
//Start AjaxUI AFTER all event has been registered
|
//Start AjaxUI AFTER all event has been registered
|
||||||
$(document).ready(ajaxUI.start());
|
//$(document).ready(ajaxUI.start());
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
//console.log('Hello Webpack Encore! Edit me in assets/js/app.js');
|
//console.log('Hello Webpack Encore! Edit me in assets/js/app.js');
|
|
@ -47,6 +47,11 @@
|
||||||
|
|
||||||
{{ encore_entry_link_tags('app') }}
|
{{ encore_entry_link_tags('app') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block javascripts %}
|
||||||
|
{{ encore_entry_script_tags('app') }}
|
||||||
|
{{ encore_entry_script_tags('ru2ftwofactor') }}
|
||||||
|
{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
<body data-base-url="{{ url('homepage', {'_locale': app.request.locale}) }}">
|
<body data-base-url="{{ url('homepage', {'_locale': app.request.locale}) }}">
|
||||||
{% block body %}
|
{% block body %}
|
||||||
|
@ -119,9 +124,6 @@
|
||||||
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block javascripts %}
|
|
||||||
{{ encore_entry_script_tags('app') }}
|
|
||||||
{{ encore_entry_script_tags('ru2ftwofactor') }}
|
|
||||||
{% endblock %}
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue