Split app.js into individual scripts
This commit is contained in:
parent
304c0d4ba6
commit
42564e085c
6 changed files with 59 additions and 25 deletions
|
@ -8,7 +8,6 @@
|
|||
// any CSS you import will output into a single css file (app.css in this case)
|
||||
import './styles/app.scss';
|
||||
|
||||
const $ = require('jquery');
|
||||
// start the Stimulus application
|
||||
require('bootstrap');
|
||||
|
||||
|
@ -18,27 +17,32 @@ import '@fortawesome/fontawesome-free/js/solid'
|
|||
import '@fortawesome/fontawesome-free/js/regular'
|
||||
import '@fortawesome/fontawesome-free/js/brands'
|
||||
|
||||
// Friendly captcha
|
||||
import { WidgetInstance } from 'friendly-challenge';
|
||||
|
||||
function doneCallback(solution) {
|
||||
$('#registration_form_captcha_solution').val(solution);
|
||||
}
|
||||
|
||||
const element = document.querySelector('#captcha');
|
||||
const options = {
|
||||
doneCallback: doneCallback,
|
||||
sitekey: 'FCMVL79DP1G5K1K0',
|
||||
}
|
||||
const widget = new WidgetInstance(element, options);
|
||||
widget.start()
|
||||
|
||||
// Dsiplay Filename when uploading
|
||||
document.querySelector('.custom-file-input').addEventListener('change', function (e) {
|
||||
var fileName = document.getElementById('offer_form_photo').files[0].name;
|
||||
var nextSibling = e.target.nextElementSibling
|
||||
nextSibling.innerText = fileName
|
||||
})
|
||||
|
||||
// Cookie-consent
|
||||
import 'cookie-notice/dist/cookie.notice.min.js'
|
||||
import 'cookie-notice/dist/cookie.notice.min';
|
||||
|
||||
new cookieNoticeJS({
|
||||
// Position for the cookie-notifier (default=bottom)
|
||||
'cookieNoticePosition': 'bottom',
|
||||
|
||||
// The message will be shown again in X days
|
||||
'expiresIn': 365,
|
||||
|
||||
// Specify a custom font family and size in pixels
|
||||
'fontFamily': 'inherit',
|
||||
'fontSize': '.9rem',
|
||||
|
||||
// Dismiss button background color
|
||||
'buttonBgColor': '#343a40',
|
||||
|
||||
// Dismiss button text color
|
||||
'buttonTextColor': '#fff',
|
||||
|
||||
// Notice background color
|
||||
'noticeBgColor': '#000',
|
||||
|
||||
// Notice text color
|
||||
'noticeTextColor': '#fff',
|
||||
|
||||
// Print debug output to the console (default=false)
|
||||
'debug': false
|
||||
});
|
Reference in a new issue