Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var language_code = urlParams.locale && urlParams.locale.split('-', 1)[0];
if (language_code != 'en') {
// A few language codes are different in GraphHopper and Flatpickr.
var flatpickr_locale;
switch (language_code) {
case 'ca': // Catalan
flatpickr_locale = 'cat';
break;
case 'el': // Greek
flatpickr_locale = 'gr';
break;
default:
flatpickr_locale = language_code;
}
if (Flatpickr.l10ns.hasOwnProperty(flatpickr_locale)) {
Flatpickr.localize(Flatpickr.l10ns[flatpickr_locale]);
}
}
$(window).resize(function () {
mapLayer.adjustMapSize();
});
$("#locationpoints").sortable({
items: ".pointDiv",
cursor: "n-resize",
containment: "parent",
handle: ".pointFlag",
update: function (event, ui) {
var origin_index = $(ui.item[0]).data('index');
sortable_items = $("#locationpoints > div.pointDiv");
$(sortable_items).each(function (index) {
var data_index = $(this).data('index');
locale(locale) {
this.destroy();
Flatpickr.localize(i18n[locale]);
this.init();
},
min() {
export function localize () {
for (var i = 0; i < arguments.length; ++i) {
var locale = arguments[i]
var flatpickrLocale = FlatpickrLocaleConversions[locale] || locale
if (flatpickr.l10ns[flatpickrLocale]) {
flatpickr.localize(flatpickr.l10ns[flatpickrLocale])
break
}
}
}
import flatpickr from "flatpickr";
import { French } from "flatpickr/dist/l10n/fr.js";
export * from "./js/index.js";
import "../node_modules/select2/dist/js/i18n/fr.js";
import locale from "./vendor-i18n/fr_FR/tlp.fr.js";
import overrideSelect2 from "./vendor-overrides/select2.js";
flatpickr.localize(French);
function frenchSelect2(element, options) {
options.language = options.language || locale;
return overrideSelect2(element, options);
}
export { locale, frenchSelect2 as select2 };
(function ($) {
window.locale = $('html').attr('lang')
if (window.locale !== 'en') {
flatpickr.localize(require(`flatpickr/dist/l10n/${window.locale}`)[window.locale])
}
/**
* Place the CSRF token as a header on all pages for access in AJAX requests
*/
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
})
/**
* Swal confirm dialog
*/
$.confirmSwal = (target, callback) => {
window.swal({