Merge branch 'master' of gitlab.com:hugvey/hugvey
This commit is contained in:
commit
08e3805819
3 changed files with 25 additions and 7 deletions
|
@ -9,5 +9,5 @@ cutelog
|
||||||
tornado
|
tornado
|
||||||
shortuuid
|
shortuuid
|
||||||
python-osc
|
python-osc
|
||||||
|
sox
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,10 @@ class Timeline{
|
||||||
startDate.setMinutes(startDate.getMinutes()-1);
|
startDate.setMinutes(startDate.getMinutes()-1);
|
||||||
let endDate = new Date();
|
let endDate = new Date();
|
||||||
endDate.setMinutes(endDate.getMinutes()+20);
|
endDate.setMinutes(endDate.getMinutes()+20);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//follow the timeline or not if checkbox is checked
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
tl.setWindow(startDate, endDate);
|
tl.setWindow(startDate, endDate);
|
||||||
}, 500);
|
}, 500);
|
||||||
|
@ -47,6 +51,19 @@ class Timeline{
|
||||||
tl.moveTo(new Date());
|
tl.moveTo(new Date());
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
|
var checkbox = document.getElementById('follow_checkbox')
|
||||||
|
|
||||||
|
checkbox.addEventListener('change', (event) => {
|
||||||
|
if (event.target.checked) {
|
||||||
|
this.moveInterval = setInterval(function(){
|
||||||
|
// skip movement if not visible
|
||||||
|
tl.moveTo(new Date());
|
||||||
|
}, 1000);
|
||||||
|
} else {
|
||||||
|
clearInterval(this.moveInterval)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
ws.addEventListener( 'message', this);
|
ws.addEventListener( 'message', this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,6 +71,7 @@ font-size: 4.5pt;
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body id='timeline'>
|
<body id='timeline'>
|
||||||
|
<input id="follow_checkbox" type="checkbox" name="follow" value="follow" checked> Follow timeline<br>
|
||||||
<div id='line'></div>
|
<div id='line'></div>
|
||||||
|
|
||||||
<script type='application/javascript' src="/js/hugvey_timeline.js"></script>
|
<script type='application/javascript' src="/js/hugvey_timeline.js"></script>
|
||||||
|
|
Loading…
Reference in a new issue