2015-10-12 23:31:20 -07:00
|
|
|
|
(function () {
|
|
|
|
|
|
|
|
|
|
Dashboard.importCss('themes/halloween/style.css');
|
|
|
|
|
|
2015-10-14 10:52:49 -07:00
|
|
|
|
var lastSound = 0;
|
2015-10-12 23:31:20 -07:00
|
|
|
|
|
|
|
|
|
function onPageShow() {
|
|
|
|
|
var page = this;
|
|
|
|
|
|
2015-10-14 15:35:32 -07:00
|
|
|
|
if (!$.browser.mobile) {
|
|
|
|
|
|
|
|
|
|
if (!page.classList.contains('itemDetailPage')) {
|
|
|
|
|
Backdrops.setBackdropUrl(page, 'themes/halloween/bg.jpg');
|
|
|
|
|
}
|
2015-10-14 10:52:49 -07:00
|
|
|
|
|
2015-10-14 15:35:32 -07:00
|
|
|
|
if (lastSound == 0) {
|
2015-10-16 11:55:35 -07:00
|
|
|
|
playSound('http://github.com/MediaBrowser/Emby.Resources/raw/master/themes/halloween/monsterparadefade.mp3', .1);
|
2015-10-14 15:35:32 -07:00
|
|
|
|
} else if ((new Date().getTime() - lastSound) > 30000) {
|
|
|
|
|
playSound('http://github.com/MediaBrowser/Emby.Resources/raw/master/themes/halloween/howl.wav');
|
|
|
|
|
}
|
2015-10-14 10:52:49 -07:00
|
|
|
|
}
|
2015-10-12 23:31:20 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pageClassOn('pageshow', "libraryPage", onPageShow);
|
|
|
|
|
|
|
|
|
|
if ($($.mobile.activePage)[0].classList.contains('libraryPage')) {
|
|
|
|
|
onPageShow.call($($.mobile.activePage)[0]);
|
|
|
|
|
}
|
|
|
|
|
|
2015-10-14 10:52:49 -07:00
|
|
|
|
function playSound(path, volume) {
|
|
|
|
|
|
|
|
|
|
require(['howler'], function (howler) {
|
|
|
|
|
|
|
|
|
|
var sound = new Howl({
|
|
|
|
|
urls: [path],
|
|
|
|
|
volume: volume || .3
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
sound.play();
|
|
|
|
|
lastSound = new Date().getTime();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2015-10-12 23:31:20 -07:00
|
|
|
|
})();
|