mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
61 lines
1.0 KiB
JavaScript
61 lines
1.0 KiB
JavaScript
|
jQuery.fn.updateWithText = function(text, speed)
|
||
|
{
|
||
|
var dummy = $('<div/>').html(text);
|
||
|
|
||
|
if ($(this).html() != dummy.html())
|
||
|
{
|
||
|
$(this).fadeOut(speed/2, function() {
|
||
|
$(this).html(text);
|
||
|
$(this).fadeIn(speed/2, function() {
|
||
|
//done
|
||
|
});
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
jQuery.fn.outerHTML = function(s) {
|
||
|
return s
|
||
|
? this.before(s).remove()
|
||
|
: jQuery("<p>").append(this.eq(0).clone()).html();
|
||
|
};
|
||
|
|
||
|
function roundVal(temp)
|
||
|
{
|
||
|
return Math.round(temp * 10) / 10;
|
||
|
}
|
||
|
|
||
|
jQuery(document).ready(function($) {
|
||
|
|
||
|
var eventList = [];
|
||
|
|
||
|
var lastCompliment;
|
||
|
var compliment;
|
||
|
|
||
|
moment.locale(config.lang);
|
||
|
|
||
|
//connect do Xbee monitor
|
||
|
// var socket = io.connect('http://rpi-alarm.local:8082');
|
||
|
// socket.on('dishwasher', function (dishwasherReady) {
|
||
|
// if (dishwasherReady) {
|
||
|
// $('.dishwasher').fadeIn(2000);
|
||
|
// $('.lower-third').fadeOut(2000);
|
||
|
// } else {
|
||
|
// $('.dishwasher').fadeOut(2000);
|
||
|
// $('.lower-third').fadeIn(2000);
|
||
|
// }
|
||
|
// });
|
||
|
|
||
|
version.init();
|
||
|
|
||
|
time.init();
|
||
|
|
||
|
calendar.init();
|
||
|
|
||
|
compliments.init();
|
||
|
|
||
|
weather.init();
|
||
|
|
||
|
news.init();
|
||
|
|
||
|
});
|