fixed the dum js biz so our asset collection might work :^)

9343b78 · gmorell · 2022-07-17 04:01

18 files +101 -10

Files changed

modified apps/room_sanctum/assets/css/app.css
+8 −0
@@ -84,6 +84,14 @@
84 84 cursor: pointer;
85 85 }
86 86
87 +.p {
88 + color: #201D65;
89 + background-color: #7B79B5;
90 + toast-color: #38357F;
91 + foo-color: #ACABD5;
92 + cream-color: #feffe7;
93 +}
94 +
87 95 .fade-in-scale {
88 96 animation: 0.2s ease-in 0s normal forwards 1 fade-in-scale-keys;
89 97 }
modified apps/room_sanctum/assets/js/app.js
+1 −1
@@ -73,7 +73,7 @@ Hooks.mkMap = {
73 73 let liveSocket = new LiveSocket("/live", Socket, {params: {_csrf_token: csrfToken}, hooks: Hooks})
74 74
75 75 // Show progress bar on live navigation and form submits
76 −topbar.config({barColors: {0: "#29d"}, shadowColor: "rgba(0, 0, 0, .3)"})
76 +topbar.config({barColors: {0: "#22f"}, shadowColor: "rgba(0, 0, 0, .3)"})
77 77 window.addEventListener("phx:page-loading-start", info => topbar.show())
78 78 window.addEventListener("phx:page-loading-stop", info => topbar.hide())
79 79
renamed
+0 −0

No textual hunks.

renamed
+0 −0

No textual hunks.

added apps/room_sanctum/assets/vendor/leaflet-centermarker.js
+90 −0
@@ -0,0 +1,90 @@
1 +/**
2 + * Leaflet.CenterMarker v1.0
3 + *
4 + * Author: Jonatan Heyman <http://heyman.info>
5 + */
6 +
7 +(function(window) {
8 + var LiftedMarker = L.Control.extend({
9 + _container: null,
10 +
11 + onAdd: function(map) {
12 + var container = L.DomUtil.create("div");
13 + container.style.position = "absolute";
14 + container.style.marginLeft = 0;
15 + container.style.marginTop = 0;
16 + container.style.display = "none";
17 +
18 + function resize() {
19 + container.style.left = Math.round(map.getSize().x/2) + "px";
20 + container.style.top = Math.round(map.getSize().y/2) + "px";
21 + }
22 + resize();
23 + map.on("resize", resize);
24 +
25 + container.append(this.options.marker.getIcon().createShadow());
26 + container.append(this.options.marker.getIcon().createIcon());
27 + this._container = container;
28 + return this._container;
29 + },
30 +
31 + hide: function() {
32 + this._container.style.display = "none";
33 + },
34 +
35 + show: function() {
36 + this._container.style.display = "block";
37 + }
38 + });
39 +
40 + L.CenterMarker = L.Marker.extend({
41 + options: {},
42 + _addedToMap: false,
43 + _liftedMarker: null,
44 +
45 + initialize: function(map, options) {
46 + // call super
47 + L.Marker.prototype.initialize.call(this, map.getCenter(), this.options);
48 + this.addTo(map);
49 + },
50 +
51 + onAdd: function(map) {
52 + // super
53 + L.Marker.prototype.onAdd.call(this, map);
54 +
55 + if (!this._addedToMap) {
56 + this._addedToMap = true;
57 + var marker = this;
58 + var map = this._map;
59 + marker._liftedMarker = new LiftedMarker({position:"topleft", marker:marker});
60 + marker._liftedMarker.addTo(map);
61 + map.on("dragstart", function(ev) {
62 + //console.log("dragstart", map.getCenter());
63 + marker._liftedMarker.show();
64 + marker.hide()
65 + });
66 + map.on("dragend", function(ev) {
67 + //console.log("dragend", map.getCenter());
68 + marker.setLatLng(map.getCenter());
69 + marker.show();
70 + marker._liftedMarker.hide();
71 + marker.fire("newposition");
72 + });
73 + }
74 + },
75 +
76 + hide: function() {
77 + this._icon.style.display = "none";
78 + this._shadow.style.display = "none";
79 + },
80 +
81 + show: function() {
82 + this._icon.style.display = "block";
83 + this._shadow.style.display = "block";
84 + }
85 + });
86 +
87 + L.centerMarker = function (latlng, options) {
88 + return new L.CenterMarker(latlng, options);
89 + };
90 +})(window);
modified apps/room_sanctum/priv/repo/migrations/20220606035410_create_gbfs_station_information.exs
+1 −8
@@ -1,15 +1,8 @@
1 1 defmodule RoomSanctum.Repo.Migrations.CreateGbfsStationInformation do
2 2 use Ecto.Migration
3 3
4 − def up do
5 − execute "CREATE EXTENSION IF NOT EXISTS postgis"
6 − end
7 −
8 − def down do
9 − execute "DROP EXTENSION IF EXISTS postgis"
10 − end
11 −
12 4 def change do
5 + execute "CREATE EXTENSION IF NOT EXISTS postgis"
13 6 create table(:gbfs_station_information) do
14 7 add :source_id, references(:cfg_sources, on_delete: :delete_all), null: false
15 8 add :station_id, :string
modified config/config.exs
+1 −1
@@ -44,7 +44,7 @@ config :esbuild,
44 44 default: [
45 45 args:
46 46 ~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/*),
47 − cd: Path.expand("../assets", __DIR__),
47 + cd: Path.expand("../apps/room_sanctum/assets", __DIR__),
48 48 env: %{
49 49 "NODE_PATH" => Path.expand("../deps", __DIR__)
50 50 }

Parents: a4b619c