mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 04:45:17 +00:00
auto reloader
This commit is contained in:
18
js/main.js
18
js/main.js
@@ -24,6 +24,23 @@ jQuery(document).ready(function($) {
|
||||
var news = [];
|
||||
var newsIndex = 0;
|
||||
|
||||
(function checkVersion()
|
||||
{
|
||||
$.getJSON('githash.php', {}, function(json, textStatus) {
|
||||
if (json) {
|
||||
if (json.gitHash != gitHash) {
|
||||
console.log('refresh');
|
||||
location.reload();
|
||||
} else {
|
||||
console.log('up to date');
|
||||
}
|
||||
}
|
||||
});
|
||||
setTimeout(function() {
|
||||
checkVersion();
|
||||
}, 3000);
|
||||
})();
|
||||
|
||||
(function updateTime()
|
||||
{
|
||||
var now = new Date();
|
||||
@@ -95,7 +112,6 @@ jQuery(document).ready(function($) {
|
||||
}, 60000);
|
||||
})();
|
||||
|
||||
|
||||
(function fetchNews() {
|
||||
$.feedToJson({
|
||||
feed:'http://feeds.nos.nl/nosjournaal?format=rss',
|
||||
|
Reference in New Issue
Block a user