Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
s-egge committed Dec 25, 2023
1 parent 328f433 commit 982a4cb
Show file tree
Hide file tree
Showing 58 changed files with 379 additions and 379 deletions.
8 changes: 4 additions & 4 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ export default {
components: {
navigbar
},
async created() {
async created () {
// On load, grab building/meter/map information from the API.
await this.$store.dispatch('map/loadMap')
// Also check if user is logged in.
this.$store.dispatch('user/user')
},
data() {
data () {
return {
transitionName: 'pageTo'
}
},
beforeDestroy() {},
beforeDestroy () {},
methods: {
disableScroll: function () {
this.$refs.main.$el.style.overflow = 'hidden'
Expand All @@ -44,7 +44,7 @@ export default {
this.$refs.main.$el.style.overflow = 'auto'
}
},
mounted() {
mounted () {
// This is the first-timer pop-up window
if (!document.cookie.split(';').some(cookieString => cookieString.includes('firstTimer'))) {
this.$msgbox({
Expand Down
10 changes: 5 additions & 5 deletions src/components/building_list/building_list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ export default {
components: {
viewCard
},
data() {
data () {
return {
search: '',
openName: '',
publicDir: true,
loading: true
}
},
async mounted() {
async mounted () {
if (this.buildingList) {
await this.$store.getters['map/promise']
if (this.$route.params.group && this.groups[this.$route.params.group]) {
Expand All @@ -81,13 +81,13 @@ export default {
},
computed: {
buildingList: {
get() {
get () {
return this.$route.path.includes('buildings')
}
},
groups: {
get() {
get () {
if (this.buildingList) {
let r = {}
// await this.$store.getters['map/promise']
Expand Down Expand Up @@ -160,7 +160,7 @@ export default {
}
},
methods: {
resetSearchInput() {
resetSearchInput () {
this.search = ''
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/components/building_list/view_card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<script>
export default {
props: ['id', 'building', 'plus'],
data() {
data () {
return {
api: process.env.VUE_APP_ROOT_API
}
},
mounted() {
mounted () {
if (this.media) {
this.$refs.card.style.background =
'linear-gradient(to bottom right, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.2)),url("https://osu-energy-images.s3-us-west-2.amazonaws.com/thumbnails/' +
Expand All @@ -26,7 +26,7 @@ export default {
computed: {
buildingOrStory: {
get() {
get () {
if (this.building) {
return this.$store.getters['map/building'](this.id)
} else {
Expand All @@ -35,17 +35,17 @@ export default {
}
},
media: {
get() {
get () {
return this.buildingOrStory.image
}
},
name: {
get() {
get () {
return this.buildingOrStory.name
}
},
description: {
get() {
get () {
return this.buildingOrStory.description
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/campaigns/campaign_building_list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@
<script>
export default {
props: ['path', 'loaded', 'value'],
data() {
data () {
return {
activePath: null
}
},
mounted() {
mounted () {
if (this.path) {
this.$emit('input', this.path + '/block_default')
}
},
computed: {
blocks: {
get() {
get () {
let blocks = this.$store.getters[this.path + '/blocks']
if (!blocks) {
return []
Expand Down
4 changes: 2 additions & 2 deletions src/components/campaigns/campaign_list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ export default {
components: {
campaignBlock
},
data() {
data () {
return {
loaded: false,
activePane: 'new',
currentCampaigns: [],
pastCampaigns: []
}
},
async mounted() {
async mounted () {
await this.$store.dispatch('campaigns/loadCampaigns')
this.loaded = true
for (let camp of this.$store.getters['campaigns/campaigns']) {
Expand Down
4 changes: 2 additions & 2 deletions src/components/campaigns/campaign_list_block.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
<script>
export default {
props: ['camp'],
data() {
data () {
return {
loaded: true,
mediaSource: ''
}
},
mounted() {
mounted () {
// Load the media content
this.$refs.imageContainer.$el.style.backgroundImage =
'url("https://osu-energy-images.s3-us-west-2.amazonaws.com/' + this.camp.media + '")'
Expand Down
4 changes: 2 additions & 2 deletions src/components/campaigns/campaign_reduction_tips.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
</template>
<script>
export default {
data() {
data () {
return {
hoverShow: null,
tips: [
Expand Down Expand Up @@ -95,7 +95,7 @@ export default {
]
}
},
created() {}
created () {}
}
</script>
<style scoped lang="scss">
Expand Down
18 changes: 9 additions & 9 deletions src/components/campaigns/main_campaign_view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default {
reductionTips,
switchButtons
},
data() {
data () {
return {
blockPath: '',
loaded: false, // Toggles the spinning circle loading animation on the graph and building list
Expand All @@ -97,7 +97,7 @@ export default {
},
computed: {
days: {
get() {
get () {
if (!this.campaignPath) return ''
let start = this.campaignStart
let end = this.campaignEnd
Expand All @@ -106,13 +106,13 @@ export default {
}
},
campaignStart: {
get() {
get () {
if (!this.campaignPath) return ''
return this.$store.getters[this.campaignPath + '/dateStart']
}
},
campaignEnd: {
get() {
get () {
if (!this.campaignPath) return ''
let end = this.$store.getters[this.campaignPath + '/dateEnd']
let current = new Date().getTime()
Expand All @@ -125,7 +125,7 @@ export default {
}
},
blocks: {
get() {
get () {
if (!this.campaignPath) return []
// We need to copy this or adding the default block will change the return value of
// the store
Expand All @@ -135,27 +135,27 @@ export default {
}
},
campaignPath: {
get() {
get () {
if (!this.$store.getters['campaigns/campaign'](this.$route.params.id)) {
return null
}
return this.$store.getters['campaigns/campaign'](this.$route.params.id).path
}
},
media: {
get() {
get () {
if (!this.campaignPath) return ''
return this.$store.getters[this.campaignPath + '/media']
}
},
name: {
get() {
get () {
if (!this.campaignPath) return ''
return this.$store.getters[this.campaignPath + '/name']
}
}
},
async mounted() {
async mounted () {
this.loaded = false
await this.$store.dispatch('campaigns/loadCampaigns')
await this.$store.dispatch(this.campaignPath + '/buildBlocks')
Expand Down
2 changes: 1 addition & 1 deletion src/components/charts/barchart.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export default {
}
}
},
mounted() {
mounted () {
this.renderChart(this.chartData, this.options)
},
watch: {
Expand Down
24 changes: 12 additions & 12 deletions src/components/charts/chartController.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ export default {
doughnutchart,
piechart
},
mounted() {
mounted () {
console.log(this.$route.path)
},
watch: {
path: function (value) {
this.updateChart()
}
},
data() {
data () {
return {
unsubscribe: null,
loading: true,
Expand All @@ -115,7 +115,7 @@ export default {
colors: ['#4A773C', '#00859B', '#FFB500', '#AA9D2E', '#D3832B', '#0D5257', '#7A6855', '#C4D6A4']
}
},
created() {
created () {
if (parseInt(this.randomColors) === 1) {
// DurstenFeld Shuffle
for (var i = this.colors.length - 1; i > 0; i--) {
Expand Down Expand Up @@ -163,30 +163,30 @@ export default {
})
},
computed: {
iframeClass() {
iframeClass () {
if (this.$route.path.startsWith('/map')) {
return 'scaled-iframe'
} else {
return 'building-iframe'
}
},
promise: {
get() {
get () {
return this.$store.getters[this.path + '/promise']
}
},
dateStart: {
get() {
get () {
return this.$store.getters[this.path + '/dateStart']
}
},
dateEnd: {
get() {
get () {
return this.$store.getters[this.path + '/dateEnd']
}
},
graphType: {
get() {
get () {
if (this.chartData) {
let noData = true
for (let set of this.chartData.datasets) {
Expand All @@ -203,7 +203,7 @@ export default {
}
},
chart: {
get() {
get () {
switch (this.graphType) {
case 1:
return this.$refs.linechart
Expand All @@ -219,7 +219,7 @@ export default {
}
}
},
beforeDestroy() {
beforeDestroy () {
this.unsubscribe()
},
methods: {
Expand Down Expand Up @@ -364,8 +364,8 @@ export default {
// may need a better way to differentiate charts, but this works for now
// and accounts for have two charts that are the same length
if (chart.backgroundColor != largestChart.backgroundColor) {
//loop through all data points in current chart and map x-value to largest chart
//also create a datapoint for the original x-value so that we can display it on tooltip hover
// loop through all data points in current chart and map x-value to largest chart
// also create a datapoint for the original x-value so that we can display it on tooltip hover
for (let i in chart.data) {
if (chart.data[i].y != null) {
chart.data[i].originalX = chart.data[i].x
Expand Down
2 changes: 1 addition & 1 deletion src/components/charts/doughnutchart.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default {
}
}
},
mounted() {
mounted () {
this.renderChart(this.chartData, this.options)
},
methods: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/charts/linechart.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export default {
}
}
},
mounted() {
mounted () {
this.renderChart(this.chartData, this.options)
},
watch: {},
Expand Down
2 changes: 1 addition & 1 deletion src/components/charts/piechart.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default {
}
}
},
mounted() {
mounted () {
this.renderChart(this.chartData, this.options)
},
watch: {
Expand Down
Loading

0 comments on commit 982a4cb

Please sign in to comment.