snipe-it/resources/assets/js/bootstrap.js

63 lines
1.7 KiB
JavaScript
Raw Normal View History

window._ = require('lodash');
2016-03-25 01:18:05 -07:00
2017-01-11 01:27:02 -08:00
/**
* 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.
*/
//window.$ = window.jQuery = require('jquery');
/**
* jQuery UI is loaded here and then the tooltip is assigned another funtion name
* This resolves the issue of jquery-ui & bootstrap tooltip conflict
*/
require('jquery-ui');
jQuery.fn.uitooltip = jQuery.fn.tooltip;
/**
* Load boostrap
*/
require('bootstrap-less');
2016-03-25 01:18:05 -07:00
2017-01-11 01:27:02 -08:00
/**
* Vue is a modern JavaScript library for building interactive web interfaces
* using reactive data binding and reusable components. Vue's API is clean
* and simple, leaving you to focus on building your next great project.
*/
2016-03-25 01:18:05 -07:00
window.Vue = require('vue').default;
Importer mapping - v1 (#3677) * Move importer to an inline-template, allows for translations and easier passing of data from laravel to vue. * Pull the modal out into a dedicated partial, move importer to views/importer. * Add document of CSV->importer mappings. Reorganize some code. Progress. * Add header_row and first_row to imports table, and process upon uploading a file * Use an expandable table row instead of a modal for import processing. This should allow for field mapping interaction easier. * Fix import processing after moving method. * Frontend importer mapping improvements. Invert display so we show found columns and allow users to select an importer field to map to. Also implement sample data based on first row of csv. * Update select2. Maintain selected items properly. * Backend support for importing. Only works on the web importer currently. Definitely needs testing and polish. * We no longer use vue-modal plugin. * Add a column to track field mappings to the imports table. * Cleanup/rename methods+refactor * Save field mappings and import type when attempting an import, and repopulate these values when returning to the page. * Update debugbar to fix a bug in the debugbar code. * Fix asset tag detection. Also rename findMatch to be a bit clearer as to what it does. Remove logging to file of imports for http imports because it eats an incredible amouint of memory. This commit also moves imports out of the hardware namespace and into their own webcontroller and route prefix, remove dead code from AssetController as a result. * Dynamically limit options for select2 based on import type selected, and group them by item type. * Add user importer. Still need to implement emailing of passwords to new users, and probably test a bit more. This also bumps the memory limit for web imports up as well, I need to profile memory usage here before too long. * Query the db to find user matches rather than search the array. Performance is much much better. * Speed/memory improvements in importers. Move to querying the db rather than maintaining an array for all importers. Also only store the id of items when we import, rather than the full model. It saves a decent amount of memory. * Remove grouping of items in select2 With the values being set dynamically, the grouping is redundant. It also caused a regression with automatically guessing/matching field names. This is starting to get close. * Remove debug line on every create. * Switch migration to be text field instead of json field for compatibility with older mysql/mariadb * Fix asset import regression matching email address. * Rearrange travis order in attempt to fix null settings. * Use auth::id instead of fetching it off the user. Fixes a null object reference during seeding.
2017-06-21 16:37:37 -07:00
window.eventHub = new Vue();
require('vue-resource');
2016-03-25 01:18:05 -07:00
2017-01-11 01:27:02 -08:00
/**
* We'll register a HTTP interceptor to attach the "CSRF" header to each of
* the outgoing requests issued by this application. The CSRF middleware
* included with Laravel will automatically verify the header's value.
*/
2016-03-25 01:18:05 -07:00
Vue.http.interceptors.push(function (request, next) {
2017-01-11 01:27:02 -08:00
request.headers.set('X-CSRF-TOKEN', Laravel.csrfToken);
2016-03-25 01:18:05 -07:00
2017-01-11 01:27:02 -08:00
next();
});
2016-03-25 01:18:05 -07:00
// require('admin-lte');
// require('chart.js');
// require('jquery-form-validator'); //says something about dependency
2017-01-11 01:27:02 -08:00
/**
* Echo exposes an expressive API for subscribing to channels and listening
* for events that are broadcast by Laravel. Echo and event broadcasting
* allows your team to easily build robust real-time web applications.
*/
2016-03-25 01:18:05 -07:00
2017-01-11 01:27:02 -08:00
// import Echo from "laravel-echo"
2016-03-25 01:18:05 -07:00
2017-01-11 01:27:02 -08:00
// window.Echo = new Echo({
// broadcaster: 'pusher',
// key: 'your-pusher-key'
// });
2016-03-25 01:18:05 -07:00