123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- Number.prototype.currency = function() { return '$' + this.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,') };
- function seconds_to_time(s) {
- var duration = moment.duration(s, 'seconds');
- return duration.format("DD-hh:mm");
- }
- function ts_to_remaining(ts) {
- return moment.unix(ts).fromNow();
- }
- function log() {
- console.log('LOG >>>', arguments);
- }
- function get_items() {
- fetch('db.json')
- .then(function(response) {
- return response.json();
- })
- .then(function(myJson) {
- app.items = myJson;
- });
- }
- var app = new Vue({
- el: '#app',
- data: {
- title: "egunner",
- items: [],
- debug: false
- },
- mounted: function () {
- // hide splash
- var splash = document.getElementById("splash");
- splash.style.display = "none";
-
- // unhide main container after mount
- this.$el.style.display = "block";
- },
- computed: {
- },
-
- methods: {
- },
-
- watch: {
- },
-
- });
- get_items();
- window.setInterval(function(){
- console.log('refresh');
- get_items();
- }, 5000);
|