Skip to content

Commit

Permalink
attempt to fix JS
Browse files Browse the repository at this point in the history
  • Loading branch information
Cocoa committed Mar 23, 2024
1 parent 106b69c commit a460215
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 79 deletions.
87 changes: 80 additions & 7 deletions resources/js/app.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,91 @@
import "@fortawesome/fontawesome-pro/scss/fontawesome.scss";
import "@fortawesome/fontawesome-pro/scss/light.scss";
import "@fortawesome/fontawesome-pro/scss/regular.scss";
import _ from 'lodash';
import Popper from 'popper.js';
import jQuery from 'jquery';
import 'bootstrap';
import axios from 'axios';
import simpleLightbox from 'simple-lightbox';
import Vue from 'vue';
import Pagination from './components/Pagination.vue';
import Search from './components/Search.vue';
import VueSelect from 'vue-select';
import Result from './components/Result.vue';
import { BFormRadioGroup } from 'bootstrap-vue';


/**
* First we will load all of this project's JavaScript dependencies which
* includes Vue and other libraries. It is a great starting point when
* building robust, powerful web applications using Vue and Laravel.
*/

require('./bootstrap');
/**
* We'll load jQuery and the Bootstrap jQuery plugin which provides support
* for JavaScript based Bootstrap features such as modals and tabs. This
* code may be modified to fit the specific needs of your application.
*/

try {
window.$ = window.jQuery = jQuery;

} catch (e) {}

/**
* We'll load the axios HTTP library which allows us to easily issue requests
* to our Laravel back-end. This library automatically handles sending the
* CSRF token as a header based on the value of the "XSRF" token cookie.
*/

window.axios = axios;

window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

/**
* Next we will register the CSRF Token as a common header with Axios so that
* all outgoing HTTP requests automatically have it attached. This is just
* a simple convenience so we don't have to attach every token manually.
*/

const token = document.head.querySelector('meta[name="csrf-token"]');

if (token) {
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
} else {
console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
}

/**
* Next we'll load chosen, for a nicer multi-select box with searching.
* This will just attach itself to any .form-control-chosen element.
*/

// window.chosen = require('chosen-js');

/**
* simple-lightbox is a lightweight lightbox interface, to make paging through
* item photos a little nicer. It will register on elements with 'data-lightbox="show"'
*/

window.SimpleLightbox = simpleLightbox;

/**
* Both chosen and simple-lightbox need to be initialized *after* the rest of the
* page has loaded - otherwise their elements may not be present yet.
*/

$(() => {
// $('.form-control-chosen').chosen();
$('[data-toggle="tooltip"]').tooltip();
let lightbox = new simpleLightbox({elements: '[data-lightbox="show"]'});
});

const image = document.head.querySelector('meta[name="default-image"]');

window.defaultImage = image ? image.content : '/images/default.png';


import Vue from 'vue';
import Pagination from './components/Pagination.vue';
import Search from './components/Search.vue';
import VueSelect from 'vue-select';
import Result from './components/Result.vue';
import { BFormRadioGroup } from 'bootstrap-vue';

/**
* Next, we will create a fresh Vue application instance and attach it to
Expand Down
72 changes: 0 additions & 72 deletions resources/js/bootstrap.js

This file was deleted.

0 comments on commit a460215

Please sign in to comment.