2020-09-12 18:43:17 -04:00
|
|
|
// We need to import the CSS so that webpack will load it.
|
|
|
|
// The MiniCssExtractPlugin is used to separate it out into
|
|
|
|
// its own CSS file.
|
2021-02-24 11:46:13 -05:00
|
|
|
import "../css/app.scss";
|
2020-09-12 18:43:17 -04:00
|
|
|
|
2021-02-25 16:03:03 -05:00
|
|
|
// Import icons for sprite-loader
|
2021-02-25 22:34:46 -05:00
|
|
|
// navbar brand icon
|
2021-03-15 15:46:59 -04:00
|
|
|
import "../node_modules/bootstrap-icons/icons/calendar2-week.svg"; // brand
|
2021-03-01 13:33:54 -05:00
|
|
|
// menus etc
|
|
|
|
import "../node_modules/bootstrap-icons/icons/person-circle.svg"; // accounts menu
|
|
|
|
import "../node_modules/bootstrap-icons/icons/person-plus.svg"; // new user / register
|
2021-03-09 11:06:23 -05:00
|
|
|
import "../node_modules/bootstrap-icons/icons/door-open.svg"; // log in
|
|
|
|
import "../node_modules/bootstrap-icons/icons/door-closed.svg"; // log out
|
2021-03-02 10:35:36 -05:00
|
|
|
import "../node_modules/bootstrap-icons/icons/sliders.svg"; // new user / register
|
2021-03-01 13:33:54 -05:00
|
|
|
// forms etc
|
2021-03-04 22:03:27 -05:00
|
|
|
import "../node_modules/bootstrap-icons/icons/at.svg"; // email field
|
|
|
|
import "../node_modules/bootstrap-icons/icons/key.svg"; // new password field
|
|
|
|
import "../node_modules/bootstrap-icons/icons/key-fill.svg"; // pw confirm field
|
|
|
|
import "../node_modules/bootstrap-icons/icons/lock.svg"; // current pw field
|
2021-03-07 17:17:16 -05:00
|
|
|
import "../node_modules/bootstrap-icons/icons/shield.svg"; // role
|
2021-03-04 22:03:27 -05:00
|
|
|
// live tables
|
2021-03-09 10:22:05 -05:00
|
|
|
import "../node_modules/bootstrap-icons/icons/arrow-down-up.svg"; // sort
|
|
|
|
import "../node_modules/bootstrap-icons/icons/funnel.svg"; // filter
|
|
|
|
import "../node_modules/bootstrap-icons/icons/x-circle-fill.svg"; // clear filter
|
2021-03-04 22:03:27 -05:00
|
|
|
import "../node_modules/bootstrap-icons/icons/sort-down-alt.svg";
|
|
|
|
import "../node_modules/bootstrap-icons/icons/sort-up-alt.svg";
|
|
|
|
import "../node_modules/bootstrap-icons/icons/chevron-left.svg";
|
|
|
|
import "../node_modules/bootstrap-icons/icons/chevron-right.svg";
|
|
|
|
import "../node_modules/bootstrap-icons/icons/pencil.svg";
|
|
|
|
import "../node_modules/bootstrap-icons/icons/trash.svg";
|
|
|
|
// page headers
|
|
|
|
import "../node_modules/bootstrap-icons/icons/shield-lock.svg"; // reset password
|
|
|
|
import "../node_modules/bootstrap-icons/icons/arrow-repeat.svg"; // resend confirmation
|
|
|
|
import "../node_modules/@mdi/svg/svg/head-question-outline.svg"; // forgot password
|
|
|
|
import "../node_modules/bootstrap-icons/icons/people.svg"; // users management
|
2021-03-06 20:16:56 -05:00
|
|
|
// calendar/event icons
|
2021-03-15 15:46:59 -04:00
|
|
|
import "../node_modules/bootstrap-icons/icons/calendar2.svg";
|
|
|
|
import "../node_modules/bootstrap-icons/icons/calendar2-plus.svg";
|
2021-03-20 12:45:50 -04:00
|
|
|
import "../node_modules/bootstrap-icons/icons/calendar2-date.svg";
|
2021-03-15 15:46:59 -04:00
|
|
|
import "../node_modules/bootstrap-icons/icons/calendar2-event.svg";
|
|
|
|
import "../node_modules/bootstrap-icons/icons/calendar2-range.svg";
|
2021-03-11 13:30:30 -05:00
|
|
|
import "../node_modules/bootstrap-icons/icons/clock-history.svg"; // shift template
|
|
|
|
import "../node_modules/bootstrap-icons/icons/tag.svg";
|
|
|
|
import "../node_modules/bootstrap-icons/icons/hourglass.svg";
|
|
|
|
import "../node_modules/bootstrap-icons/icons/map.svg";
|
|
|
|
import "../node_modules/bootstrap-icons/icons/geo.svg";
|
|
|
|
import "../node_modules/bootstrap-icons/icons/justify-left.svg";
|
|
|
|
import "../node_modules/bootstrap-icons/icons/plus-circle-dotted.svg";
|
2021-03-11 14:05:22 -05:00
|
|
|
import "../node_modules/bootstrap-icons/icons/clipboard-plus.svg";
|
2021-03-11 16:39:02 -05:00
|
|
|
import "../node_modules/bootstrap-icons/icons/star.svg";
|
|
|
|
import "../node_modules/bootstrap-icons/icons/star-fill.svg";
|
2021-03-15 15:46:59 -04:00
|
|
|
import "../node_modules/bootstrap-icons/icons/binoculars.svg";
|
|
|
|
import "../node_modules/bootstrap-icons/icons/binoculars-fill.svg";
|
|
|
|
import "../node_modules/bootstrap-icons/icons/eraser.svg";
|
|
|
|
import "../node_modules/bootstrap-icons/icons/save.svg";
|
|
|
|
import "../node_modules/bootstrap-icons/icons/asterisk.svg";
|
2021-03-20 12:45:50 -04:00
|
|
|
import "../node_modules/bootstrap-icons/icons/card-list.svg";
|
2021-03-23 11:54:49 -04:00
|
|
|
import "../node_modules/bootstrap-icons/icons/file-earmark-spreadsheet.svg";
|
2021-03-24 19:35:49 -04:00
|
|
|
import "../node_modules/bootstrap-icons/icons/box-arrow-in-left.svg";
|
2021-03-25 15:28:39 -04:00
|
|
|
import "../node_modules/bootstrap-icons/icons/link.svg";
|
|
|
|
import "../node_modules/bootstrap-icons/icons/link-45deg.svg";
|
2021-02-25 16:03:03 -05:00
|
|
|
|
2020-09-12 18:43:17 -04:00
|
|
|
// webpack automatically bundles all modules in your
|
|
|
|
// entry points. Those entry points can be configured
|
|
|
|
// in "webpack.config.js".
|
|
|
|
//
|
|
|
|
// Import deps with the dep name or local files with a relative path, for example:
|
|
|
|
//
|
|
|
|
// import {Socket} from "phoenix"
|
|
|
|
// import socket from "./socket"
|
|
|
|
//
|
2021-02-24 11:46:13 -05:00
|
|
|
import "phoenix_html";
|
|
|
|
import { Socket } from "phoenix";
|
|
|
|
import topbar from "topbar";
|
|
|
|
import { LiveSocket } from "phoenix_live_view";
|
2020-09-12 18:43:17 -04:00
|
|
|
|
2021-02-25 15:27:31 -05:00
|
|
|
// Bootstrap v5 js imports
|
2021-03-03 16:07:59 -05:00
|
|
|
import "bootstrap/js/dist/alert";
|
2021-02-25 15:39:38 -05:00
|
|
|
import "bootstrap/js/dist/collapse";
|
|
|
|
import "bootstrap/js/dist/dropdown";
|
2021-03-03 16:07:59 -05:00
|
|
|
// Bootstrap helpers
|
2021-02-26 12:07:33 -05:00
|
|
|
import "./_hamburger-helper";
|
2021-03-01 16:29:19 -05:00
|
|
|
import "./_form-validity";
|
2021-03-03 16:07:59 -05:00
|
|
|
// Bootstrap-liveview helpers
|
2021-02-26 12:07:33 -05:00
|
|
|
import { AlertRemover } from "./_alert-remover";
|
2021-03-03 16:07:59 -05:00
|
|
|
import { BsModal } from "./_bs_modal";
|
2021-03-15 15:46:59 -04:00
|
|
|
import { BsCollapse } from "./_bs_collapse";
|
2021-02-25 15:27:31 -05:00
|
|
|
|
|
|
|
// LiveSocket setup
|
2021-02-26 12:07:33 -05:00
|
|
|
let Hooks = {};
|
|
|
|
Hooks.AlertRemover = AlertRemover;
|
2021-03-03 16:07:59 -05:00
|
|
|
Hooks.BsModal = BsModal;
|
2021-03-15 15:46:59 -04:00
|
|
|
Hooks.BsCollapse = BsCollapse;
|
2021-02-24 11:46:13 -05:00
|
|
|
let csrfToken = document
|
|
|
|
.querySelector("meta[name='csrf-token']")
|
|
|
|
.getAttribute("content");
|
|
|
|
let liveSocket = new LiveSocket("/live", Socket, {
|
|
|
|
params: { _csrf_token: csrfToken },
|
2021-02-26 12:07:33 -05:00
|
|
|
hooks: Hooks,
|
2021-02-24 11:46:13 -05:00
|
|
|
});
|
2020-09-12 18:43:17 -04:00
|
|
|
|
|
|
|
// Show progress bar on live navigation and form submits
|
2021-02-24 11:46:13 -05:00
|
|
|
topbar.config({ barColors: { 0: "#29d" }, shadowColor: "rgba(0, 0, 0, .3)" });
|
|
|
|
window.addEventListener("phx:page-loading-start", (info) => topbar.show());
|
|
|
|
window.addEventListener("phx:page-loading-stop", (info) => topbar.hide());
|
2020-09-12 18:43:17 -04:00
|
|
|
|
|
|
|
// connect if there are any LiveViews on the page
|
2021-02-24 11:46:13 -05:00
|
|
|
liveSocket.connect();
|
2020-09-12 18:43:17 -04:00
|
|
|
|
|
|
|
// expose liveSocket on window for web console debug logs and latency simulation:
|
|
|
|
// >> liveSocket.enableDebug()
|
|
|
|
// >> liveSocket.enableLatencySim(1000) // enabled for duration of browser session
|
|
|
|
// >> liveSocket.disableLatencySim()
|
2021-02-24 11:46:13 -05:00
|
|
|
window.liveSocket = liveSocket;
|