Skip to content

Commit d10945b

Browse files
committed
move assets
1 parent 9aa5548 commit d10945b

36 files changed

+113
-70
lines changed
File renamed without changes.
File renamed without changes.

public/data/locations.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{
3+
"id": 1,
4+
"name": "Map Center",
5+
"lat": 43.071584,
6+
"lng": -89.380120
7+
}, {
8+
"id": 2,
9+
"name": "Monona Terrace Convention Center",
10+
"lat": 43.071584,
11+
"lng": -89.380120
12+
}, {
13+
"id": 3,
14+
"name": "Ionic HQ",
15+
"lat": 43.074395,
16+
"lng": -89.381056
17+
}, {
18+
"id": 4,
19+
"name": "Afterparty - Brocach Irish Pub",
20+
"lat": 43.07336,
21+
"lng": -89.38335
22+
}
23+
]
File renamed without changes.
File renamed without changes.

src/api/data/locations.json

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/api/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
import locations from './data/locations.json';
2-
3-
export async function getLocations() {
4-
return Promise.resolve(locations);
5-
}
61

72
export const loadLocalStore = () => {
83
try {

src/store/modules/locations.ts

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,41 @@
11
import { Module } from 'vuex';
22

33
export interface Location {
4+
id: number;
45
name?: string;
56
lat: number;
67
lng: number;
78
}
89

910
export interface LocationState {
10-
mapCenter: Location,
11+
mapCenterId: number
1112
locations: Location[]
1213
}
1314

1415
const locationStore: Module<LocationState, {}> = {
1516
state: {
16-
mapCenter: {
17-
lat: 43.071584,
18-
lng: -89.380120,
19-
},
17+
mapCenterId: 1,
2018
locations: []
19+
},
20+
mutations: {
21+
updateLocations(state, locations: Location[]) {
22+
state.locations = locations;
23+
},
24+
},
25+
actions: {
26+
async loadLocationData({ commit }) {
27+
const response = await fetch('/data/locations.json');
28+
const data = await response.json();
29+
commit('updateSpeakers', data);
30+
}
31+
},
32+
getters: {
33+
mapCenter(state) {
34+
return state.locations.find(l => l.id === state.mapCenterId)
35+
},
36+
allLocations(state) {
37+
return state.locations.filter(l => l.id !== state.mapCenterId)
38+
}
2139
}
2240
};
2341

src/store/modules/sessions.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ const defaultState: SessionState = {
3535
const sessionStore: Module<SessionState, {}> = {
3636
state: defaultState,
3737
mutations: {
38+
updateSessions(state, sessions: Session[]) {
39+
state.sessions = sessions;
40+
},
3841
setSearchText(state, searchText: string) {
3942
state.searchText = searchText;
4043
},
@@ -62,6 +65,11 @@ const sessionStore: Module<SessionState, {}> = {
6265
}
6366
},
6467
actions: {
68+
async loadSessionData({ commit }) {
69+
const response = await fetch('/data/sessions.json');
70+
const data = await response.json();
71+
commit('updateSessions', data);
72+
},
6573
setSearchText({ commit }, searchText: string) {
6674
commit('setSearchText', searchText)
6775
},

src/store/modules/speakers.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,22 @@ export interface SpeakerState {
1515
speakers: Speaker[]
1616
}
1717

18-
1918
const speakerStore: Module<SpeakerState, {}> = {
2019
state: {
2120
speakers: []
2221
},
22+
mutations: {
23+
updateSpeakers(state, speakers: Speaker[]) {
24+
state.speakers = speakers;
25+
},
26+
},
27+
actions: {
28+
async loadSpeakerData({ commit }) {
29+
const response = await fetch('/data/speakers.json');
30+
const data = await response.json();
31+
commit('updateSpeakers', data);
32+
}
33+
},
2334
getters: {
2435
allSpeakers(state) {
2536
return state.speakers.concat().sort((a, b) => {

src/views/About.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<ion-content>
1818
<div class="about-header">
19-
<img src="../assets/img/ionic-logo-white.svg" alt="ionic logo">
19+
<img src="/assets/img/ionic-logo-white.svg" alt="ionic logo">
2020
</div>
2121
<div padding class="about-info">
2222
<h4>Ionic Conference</h4>

src/views/Login.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
<ion-buttons slot="start">
66
<ion-menu-button></ion-menu-button>
77
</ion-buttons>
8-
98
<ion-title>Login</ion-title>
109
</ion-toolbar>
1110
</ion-header>
1211

1312
<ion-content>
1413
<div class="login-logo">
15-
<img src="../assets/img/appicon.svg" alt="Ionic logo">
14+
<img src="/assets/img/appicon.svg" alt="Ionic logo">
1615
</div>
1716

1817
<form novalidate>

src/views/Map.vue

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</ion-header>
1111

1212
<ion-content>
13-
<div class="map-canvas"></div>
13+
<div ref="map" class="map-canvas"></div>
1414
</ion-content>
1515
</div>
1616
</template>
@@ -32,40 +32,42 @@
3232

3333
<script lang="ts">
3434
import { Component, Prop, Vue } from 'vue-property-decorator';
35+
import { mapGetters } from 'vuex';
3536
36-
@Component
37+
@Component({
38+
computed: mapGetters(['mapCenter', 'allLocations'])
39+
})
3740
export default class Login extends Vue {
41+
mounted() {
42+
this.$store.dispatch('loadLocationData');
43+
44+
const mapEle = this.$refs.map;
3845
39-
ionViewDidEnter() {
4046
/*
41-
this.confData.getMap().subscribe((mapData: any) => {
42-
const mapEle = this.mapElement.nativeElement;
47+
const map = new google.maps.Map(mapEle, {
48+
center: this.$store.getters.mapCenter,
49+
zoom: 16
50+
});
4351
44-
const map = new google.maps.Map(mapEle, {
45-
center: mapData.find((d: any) => d.center),
46-
zoom: 16
52+
mapData.forEach((markerData: any) => {
53+
const infoWindow = new google.maps.InfoWindow({
54+
content: `<h5>${markerData.name}</h5>`
4755
});
4856
49-
mapData.forEach((markerData: any) => {
50-
const infoWindow = new google.maps.InfoWindow({
51-
content: `<h5>${markerData.name}</h5>`
52-
});
53-
54-
const marker = new google.maps.Marker({
55-
position: markerData,
56-
map,
57-
title: markerData.name
58-
});
59-
60-
marker.addListener('click', () => {
61-
infoWindow.open(map, marker);
62-
});
57+
const marker = new google.maps.Marker({
58+
position: markerData,
59+
map,
60+
title: markerData.name
6361
});
6462
65-
google.maps.event.addListenerOnce(map, 'idle', () => {
66-
mapEle.classList.add('show-map');
63+
marker.addListener('click', () => {
64+
infoWindow.open(map, marker);
6765
});
6866
});
67+
68+
google.maps.event.addListenerOnce(map, 'idle', () => {
69+
mapEle.classList.add('show-map');
70+
});
6971
*/
7072
}
7173
}

src/views/SessionList.vue

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636
</ion-label>
3737
</ion-item-divider>
3838

39-
<ion-item-sliding v-for="session in group.sessions" :track="session.tracks[0] | lowercase" :key="session">
39+
<ion-item-sliding v-for="session in group.sessions" :key="session.id">
4040
<ion-item button @click="goToSessionDetail(session)">
4141
<ion-label>
4242
<h3>{{session.name}}</h3>
4343
<p>
44-
{{session.timeStart}} &mdash; {{session.timeEnd}}: {{session.location}}
44+
{{session.dateTimeStart}} &mdash; {{session.dateTimeEnd}}: {{session.location}}
4545
</p>
4646
</ion-label>
4747
</ion-item>
@@ -100,13 +100,19 @@
100100
<script lang="ts">
101101
import { Component, Prop, Vue } from 'vue-property-decorator';
102102
import { mapGetters } from 'vuex';
103-
import { Speaker } from '../store/modules/speakers';
103+
import { Session } from '../store/modules/sessions';
104104
105105
@Component({
106-
computed: mapGetters(['groupedByStartTime'])
106+
computed: mapGetters(['groupedByStartTime', 'allSpeakers'])
107107
})
108108
export default class SessionList extends Vue {
109+
mounted() {
110+
this.$store.dispatch('loadSessionData');
111+
this.$store.dispatch('loadSpeakerData');
112+
}
109113
segment = 'all';
110114
queryText = '';
115+
goToSessionDetail(session: Session) {
116+
}
111117
}
112118
</script>

src/views/Signup.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<ion-content>
1313
<div class="signup-logo">
14-
<img src="../assets/img/appicon.svg" alt="Ionic Logo">
14+
<img src="/assets/img/appicon.svg" alt="Ionic Logo">
1515
</div>
1616
<form>
1717
<ion-list lines="none">

src/views/SpeakerList.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@
8989
computed: mapGetters(['allSpeakers'])
9090
})
9191
export default class SpeakerList extends Vue {
92-
computed() {
92+
mounted() {
93+
this.$store.dispatch('loadSessionData');
94+
this.$store.dispatch('loadSpeakerData');
9395
}
9496
goToSpeakerDetail(speaker: Speaker) {
9597

src/views/Support.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<ion-content>
1313
<div class="support-logo">
14-
<img src="../assets/img/appicon.svg" alt="Ionic Logo">
14+
<img src="/assets/img/appicon.svg" alt="Ionic Logo">
1515
</div>
1616
<form novalidate @submit="submit(submitForm)">
1717
<ion-list lines="none">

src/views/Tutorial.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<ion-content>
1212
<ion-slides @ionSlideDidChange="onSlideChangeStart($event)" pager="false">
1313
<ion-slide>
14-
<img src="../assets/img/ica-slidebox-img-1.png" class="slide-image" />
14+
<img src="/assets/img/ica-slidebox-img-1.png" class="slide-image" />
1515
<h2 class="slide-title">
1616
Welcome to
1717
<b>ICA</b>
@@ -24,23 +24,23 @@
2424
</ion-slide>
2525

2626
<ion-slide>
27-
<img src="../assets/img/ica-slidebox-img-2.png" class="slide-image" />
27+
<img src="/assets/img/ica-slidebox-img-2.png" class="slide-image" />
2828
<h2 class="slide-title">What is Ionic?</h2>
2929
<p>
3030
<b>Ionic Framework</b> is an open source SDK that enables developers to build high quality mobile apps with web technologies
3131
like HTML, CSS, and JavaScript.</p>
3232
</ion-slide>
3333

3434
<ion-slide>
35-
<img src="../assets/img/ica-slidebox-img-3.png" class="slide-image" />
35+
<img src="/assets/img/ica-slidebox-img-3.png" class="slide-image" />
3636
<h2 class="slide-title">What is Ionic Pro?</h2>
3737
<p>
3838
<b>Ionic Pro</b> is a powerful set of services and features built on top of Ionic Framework that brings a totally new
3939
level of app development agility to mobile dev teams.</p>
4040
</ion-slide>
4141

4242
<ion-slide>
43-
<img src="../assets/img/ica-slidebox-img-4.png" class="slide-image" />
43+
<img src="/assets/img/ica-slidebox-img-4.png" class="slide-image" />
4444
<h2 class="slide-title">Ready to Play?</h2>
4545
<ion-button fill="clear" @click="endTutorial()">
4646
Continue

0 commit comments

Comments
 (0)