Files
growstuff/app/javascript/application.js
T
Brenda Wallace e68c98fd38 Add JavaScript functionality for planting alternate names and tab navigation
- Implemented `planting_alternate_name.js` to load alternate names for crops in the planting form based on user input.
- Added `tab_navigation.js` to manage tab navigation and update the URL hash accordingly.

Update map rendering in member and place views

- Modified `_map.html.haml` to include a custom marker icon for member maps.
- Updated `index.html.haml` and `show.html.haml` to pass `places_map_data` to the map sections.

Refactor asset management in Rails application

- Removed Sprockets from the application configuration and adjusted asset paths.
- Updated asset precompilation settings and removed deprecated asset configurations from environment files.
- Added new build scripts for CSS and updated package dependencies in `package.json` for Bootstrap, Chart.js, and others.

Ensure React and CSS bundles are built before running tests

- Updated `react_bundle.rb` to check for the existence of both JavaScript and CSS bundles and build them if missing.
2026-10-20 23:55:33 +13:00

43 lines
1.4 KiB
JavaScript

// The site's jQuery-era scripts expect these as globals, and jQuery plugins
// attach to window.jQuery, so globals must be set before anything else loads.
import './globals';
import 'jquery-ujs';
import 'jquery-ui/dist/jquery-ui';
import 'bootstrap-datepicker';
import 'leaflet.markercluster';
import './site/append_date';
import './site/auto_suggest';
import './site/cropmap';
import './site/datepicker';
import './site/editable';
import './site/finish_toggle';
import './site/likes';
import './site/members';
import './site/navbar_search';
import './site/places';
import './site/planting_alternate_name';
import './site/tab_navigation';
document.addEventListener('DOMContentLoaded', function() {
var popoverTrigger = Array.prototype.slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'));
popoverTrigger.map(function(popoverTrigger2) {
return new bootstrap.Popover(popoverTrigger2);
});
var tooltipTrigger = Array.prototype.slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
tooltipTrigger.map(function(tooltipTrigger2) {
return new bootstrap.Tooltip(tooltipTrigger2);
});
});
// Tell the server which time zone the browser is in, so "today" and "yesterday"
// are the member's own days.
try {
document.cookie = 'timezone=' + encodeURIComponent(Intl.DateTimeFormat().resolvedOptions().timeZone) +
'; path=/; max-age=31536000; SameSite=Lax';
} catch (error) {
// No time zone to send: the server's is used.
}