Browse Source

secret features

modals-to-spa
stingl 4 years ago
parent
commit
5cc2dfd0af
  1. BIN
      assets/audio/psycho.mp3
  2. 7
      index.html
  3. 18
      js/app.js

BIN
assets/audio/psycho.mp3

Binary file not shown.

7
index.html

@ -279,6 +279,13 @@
</label> </label>
</div> </div>
<br/> <br/>
<div class="form-group">
<label>
<input type="checkbox" class="form-control-checkbox" v-model="fun">
Secret Features
</label>
</div>
<br/>
<div class="form-group"> <div class="form-group">
<label>Design</label> <label>Design</label>
<select v-model="theme" class="form-control"> <select v-model="theme" class="form-control">

18
js/app.js

@ -17,7 +17,8 @@ const TimeTrack = {
portal: '', portal: '',
portals: null, portals: null,
importStringForPortals: '', importStringForPortals: '',
publicDB: false publicDB: false,
fun: false,
} }
}, },
mounted() { mounted() {
@ -67,6 +68,9 @@ const TimeTrack = {
let storedPortals = JSON.parse(localStorage.getItem('portals')); let storedPortals = JSON.parse(localStorage.getItem('portals'));
this.portals = storedPortals == null ? null : storedPortals; this.portals = storedPortals == null ? null : storedPortals;
let storedFun = localStorage.getItem('fun');
this.fun = storedFun == null ? false : storedFun;
}, },
updateStorage() { updateStorage() {
localStorage.setItem('tickets', JSON.stringify(this.tickets)); localStorage.setItem('tickets', JSON.stringify(this.tickets));
@ -75,6 +79,7 @@ const TimeTrack = {
localStorage.setItem('ticketSystemUrl', this.ticketSystemUrl); localStorage.setItem('ticketSystemUrl', this.ticketSystemUrl);
localStorage.setItem('showPT', this.showPT); localStorage.setItem('showPT', this.showPT);
localStorage.setItem('publicDB', this.publicDB); localStorage.setItem('publicDB', this.publicDB);
localStorage.setItem('fun', this.fun);
localStorage.setItem('theme', this.theme); localStorage.setItem('theme', this.theme);
localStorage.setItem('portal', this.portal); localStorage.setItem('portal', this.portal);
@ -100,6 +105,13 @@ const TimeTrack = {
ticket.trackingStarted = moment(); ticket.trackingStarted = moment();
ticket.tracking = true; ticket.tracking = true;
let noNoTickets = ['#1920', '#3110', '#2492', '#2419', '#1256'];
if (this.fun && noNoTickets.includes(ticket.number)) {
let psycho = new Audio('/timetrack/assets/audio/psycho.mp3');
psycho.play();
}
this.$forceUpdate(); this.$forceUpdate();
this.updateStorage(); this.updateStorage();
}, },
@ -367,6 +379,10 @@ const TimeTrack = {
theme() { theme() {
this.updateStorage(); this.updateStorage();
this.$forceUpdate(); this.$forceUpdate();
},
fun() {
this.updateStorage();
this.$forceUpdate();
} }
}, },
computed: { computed: {