2019-11-01 13:40:30 +01:00
|
|
|
/*
|
2020-02-22 18:14:36 +01:00
|
|
|
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
|
2019-11-01 13:40:30 +01:00
|
|
|
*
|
2020-02-22 18:14:36 +01:00
|
|
|
* Copyright (C) 2019 - 2020 Jan Böhmer (https://github.com/jbtronics)
|
2019-11-01 13:40:30 +01:00
|
|
|
*
|
2020-02-22 18:14:36 +01:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as published
|
|
|
|
* by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2019-11-01 13:40:30 +01:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2020-02-22 18:14:36 +01:00
|
|
|
* GNU Affero General Public License for more details.
|
2019-11-01 13:40:30 +01:00
|
|
|
*
|
2020-02-22 18:14:36 +01:00
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2019-11-01 13:40:30 +01:00
|
|
|
*/
|
|
|
|
|
2019-02-24 18:05:06 +01:00
|
|
|
/*
|
|
|
|
* 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 require will output into a single css file (app.css in this case)
|
2019-03-24 19:55:39 +01:00
|
|
|
|
2019-02-24 18:05:06 +01:00
|
|
|
require('../css/app.css');
|
|
|
|
|
|
|
|
// Need jQuery? Install it with "yarn add jquery", then uncomment to require it.
|
|
|
|
const $ = require('jquery');
|
|
|
|
|
2019-10-13 17:48:18 +02:00
|
|
|
//Only include javascript
|
|
|
|
|
|
|
|
|
2019-02-24 18:05:06 +01:00
|
|
|
|
|
|
|
import '@fortawesome/fontawesome-free/css/all.css'
|
|
|
|
|
2019-03-05 23:52:45 +01:00
|
|
|
import 'datatables.net-bs4/css/dataTables.bootstrap4.css'
|
|
|
|
import 'datatables.net-buttons-bs4/css/buttons.bootstrap4.css'
|
2019-03-12 19:09:22 +01:00
|
|
|
import 'datatables.net-fixedheader-bs4/css/fixedHeader.bootstrap4.css'
|
|
|
|
import 'datatables.net-select-bs4/css/select.bootstrap4.css'
|
2019-03-14 12:56:55 +01:00
|
|
|
import 'bootstrap-select/dist/css/bootstrap-select.css'
|
2019-03-05 23:52:45 +01:00
|
|
|
|
2019-04-05 17:49:02 +02:00
|
|
|
import "patternfly-bootstrap-treeview/src/css/bootstrap-treeview.css"
|
2019-03-24 15:25:40 +01:00
|
|
|
|
2019-04-13 18:24:53 +02:00
|
|
|
import "bootstrap-fileinput/css/fileinput.css"
|
|
|
|
|
2019-10-13 17:48:18 +02:00
|
|
|
require('bootstrap');
|
|
|
|
|
2019-03-05 23:52:45 +01:00
|
|
|
//require( 'jszip' );
|
|
|
|
//#require( 'pdfmake' );
|
|
|
|
require( 'datatables.net-bs4' );
|
|
|
|
require( 'datatables.net-buttons-bs4' );
|
|
|
|
require( 'datatables.net-buttons/js/buttons.colVis.js' );
|
|
|
|
require( 'datatables.net-buttons/js/buttons.html5.js' );
|
|
|
|
require( 'datatables.net-buttons/js/buttons.print.js' );
|
|
|
|
//require( 'datatables.net-colreorder-bs4' )();
|
|
|
|
require( 'datatables.net-fixedheader-bs4' );
|
|
|
|
require( 'datatables.net-select-bs4' );
|
2019-09-06 18:37:03 +02:00
|
|
|
require('datatables.net-colreorder-bs4');
|
2020-01-04 22:09:37 +01:00
|
|
|
require('datatables.net-colreorder-bs4');
|
|
|
|
require('datatables.net-responsive-bs4');
|
|
|
|
require('datatables.net-responsive-bs4/css/responsive.bootstrap4.css');
|
2019-03-24 15:25:40 +01:00
|
|
|
require('bootstrap-select');
|
2019-03-24 20:25:27 +01:00
|
|
|
require('jquery-form');
|
2019-10-02 17:28:40 +02:00
|
|
|
require('corejs-typeahead/dist/typeahead.bundle.min');
|
|
|
|
window.Bloodhound = require('corejs-typeahead/dist/bloodhound.js');
|
2019-03-05 23:52:45 +01:00
|
|
|
|
|
|
|
//Define jquery globally
|
|
|
|
window.$ = window.jQuery = require("jquery");
|
|
|
|
|
2019-04-13 18:24:53 +02:00
|
|
|
require('patternfly-bootstrap-treeview/src/js/bootstrap-treeview');
|
|
|
|
|
|
|
|
require('bootstrap-fileinput');
|
2019-04-05 17:49:02 +02:00
|
|
|
|
2019-03-26 15:49:50 +01:00
|
|
|
require('./datatables.js');
|
|
|
|
|
2019-10-12 17:41:13 +02:00
|
|
|
window.bootbox = require('bootbox');
|
|
|
|
|
|
|
|
require("marked");
|
|
|
|
window.DOMPurify = require("dompurify");
|
2019-04-06 18:38:36 +02:00
|
|
|
|
2019-08-19 14:07:00 +02:00
|
|
|
// Includes required for tag input
|
|
|
|
require('./tagsinput.js');
|
2019-09-10 17:12:56 +02:00
|
|
|
require('../css/tagsinput.css');
|
|
|
|
|
|
|
|
//Tristate checkbox support
|
|
|
|
require('./jquery.tristate.js');
|
2019-03-24 15:25:40 +01:00
|
|
|
|
2019-11-30 22:28:14 +01:00
|
|
|
require('darkmode-js');
|
|
|
|
|
2019-12-27 18:21:12 +01:00
|
|
|
window.ClipboardJS = require('clipboard');
|
|
|
|
|
2019-12-23 17:20:28 +01:00
|
|
|
window.QRCode = require('qrcode');
|
|
|
|
|
2019-03-24 19:55:39 +01:00
|
|
|
require('../ts_src/ajax_ui');
|
|
|
|
import {ajaxUI} from "../ts_src/ajax_ui";
|
|
|
|
|
|
|
|
window.ajaxUI = ajaxUI;
|
|
|
|
|
2019-03-26 16:34:14 +01:00
|
|
|
//Require all events;
|
|
|
|
require('../ts_src/event_listeners');
|
|
|
|
|
|
|
|
|
2019-11-30 22:28:14 +01:00
|
|
|
//Register darkmode (we must do it here, TS does not support ES6 constructor...
|
|
|
|
try {
|
|
|
|
//The browser needs to support mix blend mode
|
|
|
|
if(typeof window.getComputedStyle(document.body).mixBlendMode !== 'undefined') {
|
|
|
|
const darkmode = new Darkmode();
|
|
|
|
|
|
|
|
$(document).on("ajaxUI:start ajaxUI:reload", function () {
|
|
|
|
//Show darkmode toggle to user
|
|
|
|
$('#toggleDarkmodeContainer, #toggleDarkmodeSeparator').removeAttr('hidden');
|
|
|
|
$('#toggleDarkmode').prop('checked', darkmode.isActivated());
|
|
|
|
$('#toggleDarkmode').change(function () {
|
|
|
|
darkmode.toggle();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
//Ignore all errors (for compatibiltiy with old browsers)
|
|
|
|
}
|
|
|
|
|
2019-03-26 16:34:14 +01:00
|
|
|
//Start AjaxUI AFTER all event has been registered
|
2019-03-24 19:55:39 +01:00
|
|
|
$(document).ready(ajaxUI.start());
|
|
|
|
|
2019-03-26 16:34:14 +01:00
|
|
|
|
|
|
|
|
2019-03-24 15:25:40 +01:00
|
|
|
//console.log('Hello Webpack Encore! Edit me in assets/js/app.js');
|