xref: /webtrees/resources/js/vendor.js (revision c0f994788d49129732c9d6b4af375ff7d752abd9)
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
35// Just import the subset of icons that we use in resources/views/icons/
36import { dom, library } from '@fortawesome/fontawesome-svg-core';
37import {
38  // For resources/views/icons/*
39  faBell, faCopy, faEnvelope, faFile, faFileAlt, faFileImage, faFolder, faKeyboard,
40  faMinusSquare, faPlusSquare, faStar, faStickyNote, faTrashAlt, faUser
41} from '@fortawesome/free-regular-svg-icons';
42import {
43  // For resources/views/icons/*
44  faArrowDown, faArrowLeft, faArrowRight, faArrowUp, faArrowsAltV, faBan, faBars, faCalendar,
45  faCaretDown, faCaretUp, faCheck, faCodeBranch, faCompress, faDatabase, faDownload, faExclamationTriangle,
46  faExpand, faGenderless, faGripHorizontal, faGripLines, faHistory, faInfoCircle, faLanguage,
47  faLink, faList, faLock, faMagic, faMap, faMapMarkerAlt, faMars, faMedkit, faPaintBrush, faPause,
48  faPencilAlt, faPlay, faPlus, faPuzzlePiece, faQuestionCircle, faRedo, faSearch, faSearchLocation,
49  faSearchMinus, faSearchPlus, faServer, faShareAlt, faSitemap, faSortAmountDown, faStepForward, faStop,
50  faSyncAlt, faTags, faThList, faThumbtack, faTimes, faTransgender, faTree, faUndo, faUniversity,
51  faUnlink, faUpload, faUsers, faVenus, faWrench,
52  // For the BeautifyMarker library
53  faBabyCarriage, faBullseye, faHome, faIndustry, faInfinity, faStarOfDavid, faWater
54} from '@fortawesome/free-solid-svg-icons';
55import 'corejs-typeahead';
56
57import DataTable from 'datatables.net';
58import 'datatables.net-bs5';
59window.DataTable = DataTable;
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