xref: /webtrees/resources/js/vendor.js (revision 4a9a60957058ca2a34e30a0d6f783e1540606590)
1/**
2 * webtrees: online genealogy
3 * Copyright (C) 2022 webtrees development team
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 */
15
16import $ from 'jquery';
17
18import '@popperjs/core';
19import { Alert, Button, Carousel, Collapse, Dropdown, Modal, Offcanvas, Popover, ScrollSpy, Tab, Toast, Tooltip } from 'bootstrap';
20window.bootstrap = {
21  Alert: Alert,
22  Button: Button,
23  Carousel: Carousel,
24  Collapse: Collapse,
25  Dropdown: Dropdown,
26  Modal: Modal,
27  Offcanvas: Offcanvas,
28  Popover: Popover,
29  ScrollSpy: ScrollSpy,
30  Tab: Tab,
31  Toast: Toast,
32  Tooltip: Tooltip,
33};
34
35import 'datatables.net';
36
37// Just import the subset of icons that we use in resources/views/icons/
38import { dom, library } from '@fortawesome/fontawesome-svg-core';
39import {
40  // For resources/views/icons/*
41  faBell, faCopy, faEnvelope, faFile, faFileAlt, faFileImage, faFolder, faKeyboard,
42  faMinusSquare, faPlusSquare, faStar, faStickyNote, faTrashAlt, faUser
43} from '@fortawesome/free-regular-svg-icons';
44import {
45  // For resources/views/icons/*
46  faArrowDown, faArrowLeft, faArrowRight, faArrowUp, faArrowsAltV, faBan, faBars,
47  faCalendar, faCaretDown, faCaretUp, faCheck, faCodeBranch, faDownload, faExclamationTriangle, faGenderless,
48  faGripHorizontal, faGripLines, faHistory, faInfoCircle, faLanguage, faLink, faList,
49  faLock, faMagic, faMap, faMapMarkerAlt, faMars, faMedkit, faPaintBrush, faPause, faPencilAlt,
50  faPlay, faPlus, faPuzzlePiece, faQuestionCircle, faRedo, faSearch, faSearchLocation, faSearchMinus, faSearchPlus, faShareAlt,
51  faSitemap, faSortAmountDown, faStepForward, faStop, faSyncAlt, faTags, faThList, faThumbtack,
52  faTimes, faTransgender, faTree, faUniversity, faUnlink, faUpload, faUsers, faVenus, faWrench,
53  // For the BeautifyMarker library
54  faBabyCarriage, faBullseye, faHome, faIndustry, faInfinity, faStarOfDavid, faWater
55} from '@fortawesome/free-solid-svg-icons';
56import 'corejs-typeahead';
57
58import 'datatables.net-bs5';
59
60import Sortable from 'sortablejs';
61
62import TomSelect from 'tom-select/dist/js/tom-select.base.js';
63TomSelect.define('caret_position', require('tom-select/dist/js/plugins/caret_position.js'));
64TomSelect.define('clear_button', require('tom-select/dist/js/plugins/clear_button.js'));
65TomSelect.define('dropdown_input', require('tom-select/dist/js/plugins/dropdown_input.js'));
66TomSelect.define('remove_button', require('tom-select/dist/js/plugins/remove_button.js'));
67TomSelect.define('virtual_scroll', require('tom-select/dist/js/plugins/virtual_scroll.js'));
68
69window.TomSelect = TomSelect;
70
71import 'hideshowpassword';
72
73import 'moment';
74
75import 'jquery-colorbox';
76import 'pinch-zoom-element';
77
78import 'leaflet';
79import 'leaflet.markercluster';
80import 'beautifymarker';
81import 'leaflet-control-geocoder';
82import 'leaflet.control.layers.tree';
83import 'leaflet-bing-layer';
84
85window.$ = window.jQuery = $;
86
87library.add(
88  // For resources/views/icons/*
89  faBell, faCopy, faEnvelope, faFile, faFileAlt, faFileImage, faFolder, faKeyboard,
90  faMap, faMinusSquare, faPlusSquare, faStar, faStickyNote, faTags, faTrashAlt, faUser
91);
92library.add(
93  // For resources/views/icons/*
94  faArrowDown, faArrowLeft, faArrowRight, faArrowUp, faArrowsAltV, faBan, faBars,
95  faCalendar, faCaretDown, faCaretUp, faCheck, faCodeBranch, faDownload, faExclamationTriangle, faGenderless,
96  faGripHorizontal, faGripLines, faHistory, faInfoCircle, faLanguage, faLink, faList,
97  faLock, faMagic, faMap, faMapMarkerAlt, faMars, faMedkit, faPaintBrush, faPause, faPencilAlt,
98  faPlay, faPlus, faPuzzlePiece, faQuestionCircle, faRedo, faSearch, faSearchLocation, faSearchMinus, faSearchPlus, faShareAlt,
99  faSitemap, faSortAmountDown, faStepForward, faStop, faSyncAlt, faThList, faThumbtack,
100  faTimes, faTransgender, faTree, faUniversity, faUnlink, faUpload, faUsers, faVenus, faWrench,
101  // For the BeautifyMarker library
102  faBabyCarriage, faBullseye, faHome, faIndustry, faInfinity, faStarOfDavid, faWater
103);
104dom.watch();
105
106window.Bloodhound = require('corejs-typeahead/dist/bloodhound.min.js');
107
108// See https://github.com/RubaXa/Sortable/issues/1229
109// window.Sortable = require('sortablejs');
110window.Sortable = Sortable;
111