31 lines
826 B
HTML
31 lines
826 B
HTML
<script type='text/javascript'
|
|
src='https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js'>
|
|
</script>
|
|
|
|
<script>
|
|
var previous = null;
|
|
var current = null;
|
|
var formNotChanged = true;
|
|
(function checkJobs() {
|
|
console.log('polling');
|
|
console.log(formNotChanged)
|
|
$.getJSON(window.location.protocol + '//'+window.location.host + '/rowers/list-jobs/', function(json) {
|
|
current = JSON.stringify(json);
|
|
$('form').each(function() {
|
|
$(this).change(function() {
|
|
formNotChanged = false;
|
|
console.log("Form Changed");
|
|
console.log(formNotChanged)
|
|
});
|
|
});
|
|
if (previous && current && previous !== current && formNotChanged) {
|
|
console.log('refresh');
|
|
location.reload();
|
|
};
|
|
previous = current;
|
|
});
|
|
setTimeout(checkJobs, 15000);
|
|
}());
|
|
|
|
</script>
|