Skip to content
This repository was archived by the owner on Mar 30, 2020. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions src/javascript/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,12 @@ SYMPHONY.remote.hello().then(function(data) {
// Track each entity
setTimeout(function () {
this.track({instanceId: instanceId, entityData: entityData});
}.bind(this), 5000);
}.bind(this), 1000);

// Render the countdown every 5 seconds
// Render the countdown every 1 seconds
this.interval = setInterval(function () {
this.tick(instanceId)
}.bind(this), 5000);
}.bind(this), 1000);
return this.getTimeData(entityData);
}
},
Expand All @@ -216,15 +216,16 @@ SYMPHONY.remote.hello().then(function(data) {
return {
// Use a custom template to utilise data sent with the message in entityData in our messageML message
template: `<messageML>
<img src="https://www.wallstreetoasis.com/files/sy_500x100.png"/>
<card>
<h1>Countdown timer v<text id="version"/></h1>
<div>The time until <b><text id="countdown"/></b> is <text id="concat"/></div>
<header>Time remaining until <b><text id="countdown"/></b> : <text id="concat"/></header>
</card>
</messageML>`,
data: {
concat: diff.yrs + " years, " + diff.days + " days, " +
diff.hrs + " hrs, " + diff.min + " minutes, and " + diff.sec + " seconds",
concat: "<span class='tempo-bg-color--theme-primary'>" + diff.yrs + "</span> years," +
" <span class='tempo-bg-color--theme-primary'>" + diff.days + "</span> days, " +
diff.hrs + "</span> hrs," +
" <span class='tempo-bg-color--theme-primary'>" + diff.min + "</span> minutes," +
" and <span class='tempo-bg-color--theme-accent'>" + diff.sec + "</span> seconds",
countdown: (until.getMonth() + 1) + "/" + until.getDate() + "/" + until.getFullYear(),
version: entityData.version
},
Expand All @@ -233,4 +234,4 @@ SYMPHONY.remote.hello().then(function(data) {
}
});
}.bind(this))
}.bind(this));
}.bind(this));