171239cb6SGreg Roach/** 271239cb6SGreg Roach * webtrees: online genealogy 3242a7862SGreg Roach * Copyright (C) 2019 webtrees development team 471239cb6SGreg Roach * This program is free software: you can redistribute it and/or modify 571239cb6SGreg Roach * it under the terms of the GNU General Public License as published by 671239cb6SGreg Roach * the Free Software Foundation, either version 3 of the License, or 771239cb6SGreg Roach * (at your option) any later version. 871239cb6SGreg Roach * This program is distributed in the hope that it will be useful, 971239cb6SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 1071239cb6SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1171239cb6SGreg Roach * GNU General Public License for more details. 1271239cb6SGreg Roach * You should have received a copy of the GNU General Public License 1371239cb6SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>. 1471239cb6SGreg Roach */ 1571239cb6SGreg Roach 16efd89170SGreg Roachimport $ from 'jquery'; 1771239cb6SGreg Roach 18efd89170SGreg Roachimport 'popper.js'; 19efd89170SGreg Roachimport 'bootstrap'; 20efd89170SGreg Roachimport 'datatables.net'; 2171239cb6SGreg Roach 2208362db4SGreg Roach// Just import the subset of icons that we use in resources/views/icons/ 23efd89170SGreg Roachimport { dom, library } from '@fortawesome/fontawesome-svg-core'; 2408362db4SGreg Roachimport { 2580993423SGreg Roach // For resources/views/icons/* 2608362db4SGreg Roach faBell, faCopy, faEnvelope, faFile, faFileAlt, faFileImage, faFolder, faKeyboard, 27efd89170SGreg Roach faMinusSquare, faPlusSquare, faStar, faStickyNote, faTrashAlt, faUser 28efd89170SGreg Roach} from '@fortawesome/free-regular-svg-icons'; 29efd89170SGreg Roachimport { 30efd89170SGreg Roach // For resources/views/icons/* 31efd89170SGreg Roach faArrowDown, faArrowLeft, faArrowRight, faArrowUp, faArrowsAltV, faBan, faBars, 32efd89170SGreg Roach faCalendar, faCheck, faCodeBranch, faDownload, faExclamationTriangle, faGenderless, 33efd89170SGreg Roach faGripHorizontal, faGripLines, faHistory, faInfoCircle, faLanguage, faLink, faList, 34efd89170SGreg Roach faLock, faMagic, faMap, faMapMarkerAlt, faMars, faMedkit, faPaintBrush, faPause, faPencilAlt, 35efd89170SGreg Roach faPlay, faPlus, faPuzzlePiece, faQuestionCircle, faRedo, faSearch, faSearchMinus, faSearchPlus, 36efd89170SGreg Roach faSitemap, faSortAmountDown, faStepForward, faStop, faSyncAlt, faThList, faThumbtack, 37efd89170SGreg Roach faTimes, faTransgender, faTree, faUniversity, faUnlink, faUpload, faUsers, faVenus, faWrench, 38efd89170SGreg Roach // For the BeautifyMarker library 39efd89170SGreg Roach faBabyCarriage, faBullseye, faHome, faIndustry, faInfinity, faStarOfDavid, faWater 40efd89170SGreg Roach} from '@fortawesome/free-solid-svg-icons'; 41efd89170SGreg Roachimport 'corejs-typeahead'; 42efd89170SGreg Roach 43efd89170SGreg Roachimport 'datatables.net-bs4'; 44efd89170SGreg Roach 45efd89170SGreg Roachimport Sortable from 'sortablejs'; 46efd89170SGreg Roach 47efd89170SGreg Roachimport 'select2'; 48efd89170SGreg Roach// import "select2/dist/js/i18n/*.js"; 49efd89170SGreg Roach 50efd89170SGreg Roachimport 'select2/dist/js/i18n/af.js'; 51efd89170SGreg Roachimport 'select2/dist/js/i18n/ar.js'; 52efd89170SGreg Roachimport 'select2/dist/js/i18n/az.js'; 53efd89170SGreg Roachimport 'select2/dist/js/i18n/bg.js'; 54efd89170SGreg Roachimport 'select2/dist/js/i18n/bn.js'; 55efd89170SGreg Roachimport 'select2/dist/js/i18n/bs.js'; 56efd89170SGreg Roachimport 'select2/dist/js/i18n/ca.js'; 57efd89170SGreg Roachimport 'select2/dist/js/i18n/cs.js'; 58efd89170SGreg Roachimport 'select2/dist/js/i18n/da.js'; 59efd89170SGreg Roachimport 'select2/dist/js/i18n/de.js'; 60efd89170SGreg Roachimport 'select2/dist/js/i18n/dsb.js'; 61efd89170SGreg Roachimport 'select2/dist/js/i18n/el.js'; 62efd89170SGreg Roachimport 'select2/dist/js/i18n/en.js'; 63efd89170SGreg Roachimport 'select2/dist/js/i18n/es.js'; 64efd89170SGreg Roachimport 'select2/dist/js/i18n/et.js'; 65efd89170SGreg Roachimport 'select2/dist/js/i18n/eu.js'; 66efd89170SGreg Roachimport 'select2/dist/js/i18n/fa.js'; 67efd89170SGreg Roachimport 'select2/dist/js/i18n/fi.js'; 68efd89170SGreg Roachimport 'select2/dist/js/i18n/fr.js'; 69efd89170SGreg Roachimport 'select2/dist/js/i18n/gl.js'; 70efd89170SGreg Roachimport 'select2/dist/js/i18n/he.js'; 71efd89170SGreg Roachimport 'select2/dist/js/i18n/hi.js'; 72efd89170SGreg Roachimport 'select2/dist/js/i18n/hr.js'; 73efd89170SGreg Roachimport 'select2/dist/js/i18n/hsb.js'; 74efd89170SGreg Roachimport 'select2/dist/js/i18n/hu.js'; 75efd89170SGreg Roachimport 'select2/dist/js/i18n/hy.js'; 76efd89170SGreg Roachimport 'select2/dist/js/i18n/id.js'; 77efd89170SGreg Roachimport 'select2/dist/js/i18n/is.js'; 78efd89170SGreg Roachimport 'select2/dist/js/i18n/it.js'; 79efd89170SGreg Roachimport 'select2/dist/js/i18n/ja.js'; 80efd89170SGreg Roachimport 'select2/dist/js/i18n/ka.js'; 81efd89170SGreg Roachimport 'select2/dist/js/i18n/km.js'; 82efd89170SGreg Roachimport 'select2/dist/js/i18n/ko.js'; 83efd89170SGreg Roachimport 'select2/dist/js/i18n/lt.js'; 84efd89170SGreg Roachimport 'select2/dist/js/i18n/lv.js'; 85efd89170SGreg Roachimport 'select2/dist/js/i18n/mk.js'; 86efd89170SGreg Roachimport 'select2/dist/js/i18n/ms.js'; 87efd89170SGreg Roachimport 'select2/dist/js/i18n/nb.js'; 88efd89170SGreg Roachimport 'select2/dist/js/i18n/ne.js'; 89efd89170SGreg Roachimport 'select2/dist/js/i18n/nl.js'; 90efd89170SGreg Roachimport 'select2/dist/js/i18n/pl.js'; 91efd89170SGreg Roachimport 'select2/dist/js/i18n/ps.js'; 92efd89170SGreg Roachimport 'select2/dist/js/i18n/pt-BR.js'; 93efd89170SGreg Roachimport 'select2/dist/js/i18n/pt.js'; 94efd89170SGreg Roachimport 'select2/dist/js/i18n/ro.js'; 95efd89170SGreg Roachimport 'select2/dist/js/i18n/ru.js'; 96efd89170SGreg Roachimport 'select2/dist/js/i18n/sk.js'; 97efd89170SGreg Roachimport 'select2/dist/js/i18n/sl.js'; 98efd89170SGreg Roachimport 'select2/dist/js/i18n/sq.js'; 99efd89170SGreg Roachimport 'select2/dist/js/i18n/sr-Cyrl.js'; 100efd89170SGreg Roachimport 'select2/dist/js/i18n/sr.js'; 101efd89170SGreg Roachimport 'select2/dist/js/i18n/sv.js'; 102efd89170SGreg Roachimport 'select2/dist/js/i18n/th.js'; 103efd89170SGreg Roachimport 'select2/dist/js/i18n/tk.js'; 104efd89170SGreg Roachimport 'select2/dist/js/i18n/tr.js'; 105efd89170SGreg Roachimport 'select2/dist/js/i18n/uk.js'; 106efd89170SGreg Roachimport 'select2/dist/js/i18n/vi.js'; 107efd89170SGreg Roachimport 'select2/dist/js/i18n/zh-CN.js'; 108efd89170SGreg Roachimport 'select2/dist/js/i18n/zh-TW.js'; 109efd89170SGreg Roach 110efd89170SGreg Roachimport 'hideshowpassword'; 111efd89170SGreg Roach 112efd89170SGreg Roachimport 'moment'; 113efd89170SGreg Roach 114efd89170SGreg Roachimport 'jquery-colorbox'; 115efd89170SGreg Roach 116efd89170SGreg Roachimport 'wheelzoom'; 117efd89170SGreg Roach 118efd89170SGreg Roachimport 'leaflet'; 119efd89170SGreg Roachimport 'leaflet.markercluster'; 120efd89170SGreg Roachimport 'beautifymarker'; 121caa53803SDavid Druryimport 'leaflet-control-geocoder'; 122efd89170SGreg Roach 123efd89170SGreg Roachwindow.$ = window.jQuery = $; 124efd89170SGreg Roach 12508362db4SGreg Roachlibrary.add( 12680993423SGreg Roach // For resources/views/icons/* 12708362db4SGreg Roach faBell, faCopy, faEnvelope, faFile, faFileAlt, faFileImage, faFolder, faKeyboard, 128efd89170SGreg Roach faMap, faMinusSquare, faPlusSquare, faStar, faStickyNote, faTrashAlt, faUser 12908362db4SGreg Roach); 13008362db4SGreg Roachlibrary.add( 13180993423SGreg Roach // For resources/views/icons/* 13208362db4SGreg Roach faArrowDown, faArrowLeft, faArrowRight, faArrowUp, faArrowsAltV, faBan, faBars, 13308362db4SGreg Roach faCalendar, faCheck, faCodeBranch, faDownload, faExclamationTriangle, faGenderless, 13408362db4SGreg Roach faGripHorizontal, faGripLines, faHistory, faInfoCircle, faLanguage, faLink, faList, 135bae49aecSGreg Roach faLock, faMagic, faMap, faMapMarkerAlt, faMars, faMedkit, faPaintBrush, faPause, faPencilAlt, 136cee3bd8fSGreg Roach faPlay, faPlus, faPuzzlePiece, faQuestionCircle, faRedo, faSearch, faSearchMinus, faSearchPlus, 13708362db4SGreg Roach faSitemap, faSortAmountDown, faStepForward, faStop, faSyncAlt, faThList, faThumbtack, 13880993423SGreg Roach faTimes, faTransgender, faTree, faUniversity, faUnlink, faUpload, faUsers, faVenus, faWrench, 13980993423SGreg Roach // For the BeautifyMarker library 140efd89170SGreg Roach faBabyCarriage, faBullseye, faHome, faIndustry, faInfinity, faStarOfDavid, faWater 14108362db4SGreg Roach); 14208362db4SGreg Roachdom.watch(); 14308362db4SGreg Roach 144efd89170SGreg Roachwindow.Bloodhound = require('corejs-typeahead/dist/bloodhound.min.js'); 14571239cb6SGreg Roach 14671239cb6SGreg Roach// See https://github.com/RubaXa/Sortable/issues/1229 14775b444f7SGreg Roach// window.Sortable = require('sortablejs'); 14875b444f7SGreg Roachwindow.Sortable = Sortable; 149*bda1784dSGreg Roach 150*bda1784dSGreg Roach// Add RTL support for dropdown menu - see https://github.com/fisharebest/webtrees/issues/3332 151*bda1784dSGreg Roach$('html[dir=rtl] .dropdown').on('shown.bs.dropdown', function (event) { 152*bda1784dSGreg Roach let menu = event.target.querySelector('.dropdown-menu'); 153*bda1784dSGreg Roach // Bootstrap sets these *after* the event has fired, so wait before updating them. 154*bda1784dSGreg Roach setTimeout(function () { 155*bda1784dSGreg Roach menu.style.right='0'; 156*bda1784dSGreg Roach menu.style.left=''; 157*bda1784dSGreg Roach }, 1); 158*bda1784dSGreg Roach});