This repository has been archived on 2024-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
augie/webapp/assets/js/app.js

32 lines
910 B
JavaScript
Raw Normal View History

2019-11-29 17:55:52 +13: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.
2019-12-02 18:42:51 +13:00
import css from "../css/app.scss"
2019-11-29 17:55:52 +13:00
// webpack automatically bundles all modules in your
// entry points. Those entry points can be configured
// in "webpack.config.js".
//
// Import dependencies
//
import "phoenix_html"
// Import local files
//
// Local files can be imported directly using relative paths, for example:
// import socket from "./socket"
2019-12-01 17:11:36 +13:00
import { Socket } from "phoenix"
import LiveSocket from "phoenix_live_view"
2020-03-08 15:05:20 +13:00
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content");
let liveSocket = new LiveSocket("/live", Socket, { params: { _csrf_token: csrfToken } });
2019-12-01 17:11:36 +13:00
liveSocket.connect()
2019-12-02 18:42:51 +13:00
import jQuery from "jquery";
window.$ = jQuery;
import "what-input"
import "foundation-sites/js/foundation"
$(document).foundation();