mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 04:45:17 +00:00
move news into its own folder and file
This commit is contained in:
30
js/main.js
30
js/main.js
@@ -26,9 +26,6 @@ function roundVal(temp)
|
||||
|
||||
jQuery(document).ready(function($) {
|
||||
|
||||
var news = [];
|
||||
var newsIndex = 0;
|
||||
|
||||
var eventList = [];
|
||||
|
||||
var lastCompliment;
|
||||
@@ -180,31 +177,6 @@ jQuery(document).ready(function($) {
|
||||
|
||||
weather.init();
|
||||
|
||||
(function fetchNews() {
|
||||
$.feedToJson({
|
||||
feed: feed,
|
||||
success: function(data){
|
||||
news = [];
|
||||
for (var i in data.item) {
|
||||
var item = data.item[i];
|
||||
news.push(item.title);
|
||||
}
|
||||
}
|
||||
});
|
||||
setTimeout(function() {
|
||||
fetchNews();
|
||||
}, 60000);
|
||||
})();
|
||||
|
||||
(function showNews() {
|
||||
var newsItem = news[newsIndex];
|
||||
$('.news').updateWithText(newsItem,2000);
|
||||
|
||||
newsIndex--;
|
||||
if (newsIndex < 0) newsIndex = news.length - 1;
|
||||
setTimeout(function() {
|
||||
showNews();
|
||||
}, 5500);
|
||||
})();
|
||||
news.init();
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user