xref: /webtrees/resources/js/vendor.js (revision 52672e95f9626642591e18327ff0eaa0bf5c2806)
1/**
2 * webtrees: online genealogy
3 * Copyright (C) 2023 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, faCalendar,
47  faCaretDown, faCaretUp, faCheck, faCodeBranch, faCompress, faDatabase, faDownload, faExclamationTriangle,
48  faExpand, faGenderless, faGripHorizontal, faGripLines, faHistory, faInfoCircle, faLanguage,
49  faLink, faList, faLock, faMagic, faMap, faMapMarkerAlt, faMars, faMedkit, faPaintBrush, faPause,
50  faPencilAlt, faPlay, faPlus, faPuzzlePiece, faQuestionCircle, faRedo, faSearch, faSearchLocation,
51  faSearchMinus, faSearchPlus, faServer, faShareAlt, faSitemap, faSortAmountDown, faStepForward, faStop,
52  faSyncAlt, faTags, faThList, faThumbtack, faTimes, faTransgender, faTree, faUndo, faUniversity,
53  faUnlink, faUpload, faUsers, faVenus, faWrench,
54  // For the BeautifyMarker library
55  faBabyCarriage, faBullseye, faHome, faIndustry, faInfinity, faStarOfDavid, faWater
56} from '@fortawesome/free-solid-svg-icons';
57import 'corejs-typeahead';
58
59import 'datatables.net-bs5';
60
61import Sortable from 'sortablejs';
62
63import TomSelect from 'tom-select/dist/js/tom-select.base.js';
64TomSelect.define('caret_position', require('tom-select/dist/js/plugins/caret_position.js'));
65TomSelect.define('clear_button', require('tom-select/dist/js/plugins/clear_button.js'));
66TomSelect.define('dropdown_input', require('tom-select/dist/js/plugins/dropdown_input.js'));
67TomSelect.define('remove_button', require('tom-select/dist/js/plugins/remove_button.js'));
68TomSelect.define('virtual_scroll', require('tom-select/dist/js/plugins/virtual_scroll.js'));
69
70window.TomSelect = TomSelect;
71
72import 'hideshowpassword';
73
74import 'moment';
75
76import 'jquery-colorbox';
77import 'pinch-zoom-element';
78
79import 'leaflet';
80import 'leaflet.markercluster';
81import 'beautifymarker';
82import 'leaflet-control-geocoder';
83import 'leaflet.control.layers.tree';
84import 'leaflet-bing-layer';
85
86window.$ = window.jQuery = $;
87
88library.add(
89  // For resources/views/icons/*
90  faBell, faCopy, faEnvelope, faFile, faFileAlt, faFileImage, faFolder, faKeyboard,
91  faMap, faMinusSquare, faPlusSquare, faStar, faStickyNote, faTags, faTrashAlt, faUser
92);
93library.add(
94  // For resources/views/icons/*
95  faArrowDown, faArrowLeft, faArrowRight, faArrowUp, faArrowsAltV, faBan, faBars, faCalendar,
96  faCaretDown, faCaretUp, faCheck, faCodeBranch, faCompress, faDatabase, faDownload, faExclamationTriangle,
97  faExpand, faGenderless, faGripHorizontal, faGripLines, faHistory, faInfoCircle, faLanguage,
98  faLink, faList, faLock, faMagic, faMap, faMapMarkerAlt, faMars, faMedkit, faPaintBrush, faPause,
99  faPencilAlt, faPlay, faPlus, faPuzzlePiece, faQuestionCircle, faRedo, faSearch, faSearchLocation,
100  faSearchMinus, faSearchPlus, faServer, faShareAlt, faSitemap, faSortAmountDown, faStepForward, faStop,
101  faSyncAlt, faTags, faThList, faThumbtack, faTimes, faTransgender, faTree, faUndo, faUniversity,
102  faUnlink, faUpload, faUsers, faVenus, faWrench,
103  // For the BeautifyMarker library
104  faBabyCarriage, faBullseye, faHome, faIndustry, faInfinity, faStarOfDavid, faWater
105);
106dom.watch();
107
108window.Bloodhound = require('corejs-typeahead/dist/bloodhound.min.js');
109
110// See https://github.com/RubaXa/Sortable/issues/1229
111// window.Sortable = require('sortablejs');
112window.Sortable = Sortable;
113