xref: /webtrees/resources/js/vendor.js (revision e95f22dbac3bcdbcaeca3553ed0a8dec8ab0c71d)
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, faExpand, 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, faUndo, 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
87import fscreen from 'fscreen';
88window.fscreen = fscreen;
89
90library.add(
91  // For resources/views/icons/*
92  faBell, faCopy, faEnvelope, faFile, faFileAlt, faFileImage, faFolder, faKeyboard,
93  faMap, faMinusSquare, faPlusSquare, faStar, faStickyNote, faTags, faTrashAlt, faUser
94);
95library.add(
96  // For resources/views/icons/*
97  faArrowDown, faArrowLeft, faArrowRight, faArrowUp, faArrowsAltV, faBan, faBars,
98  faCalendar, faCaretDown, faCaretUp, faCheck, faCodeBranch, faDownload, faExclamationTriangle, faExpand, faGenderless,
99  faGripHorizontal, faGripLines, faHistory, faInfoCircle, faLanguage, faLink, faList,
100  faLock, faMagic, faMap, faMapMarkerAlt, faMars, faMedkit, faPaintBrush, faPause, faPencilAlt,
101  faPlay, faPlus, faPuzzlePiece, faQuestionCircle, faRedo, faSearch, faSearchLocation, faSearchMinus, faSearchPlus, faShareAlt,
102  faSitemap, faSortAmountDown, faStepForward, faStop, faSyncAlt, faThList, faThumbtack,
103  faTimes, faTransgender, faTree, faUndo, faUniversity, faUnlink, faUpload, faUsers, faVenus, faWrench,
104  // For the BeautifyMarker library
105  faBabyCarriage, faBullseye, faHome, faIndustry, faInfinity, faStarOfDavid, faWater
106);
107dom.watch();
108
109window.Bloodhound = require('corejs-typeahead/dist/bloodhound.min.js');
110
111// See https://github.com/RubaXa/Sortable/issues/1229
112// window.Sortable = require('sortablejs');
113window.Sortable = Sortable;
114