support null image encoder
This commit is contained in:
parent
6000b2ee0f
commit
b9ad8322dd
17 changed files with 214 additions and 44 deletions
|
@ -1,26 +1,97 @@
|
|||
(function () {
|
||||
|
||||
Dashboard.importCss('themes/halloween/style.css');
|
||||
|
||||
var lastSound = 0;
|
||||
var iconCreated;
|
||||
var destroyed;
|
||||
var currentSound;
|
||||
var cancelKey = 'cancelHalloween';
|
||||
var cancelValue = '5';
|
||||
|
||||
function onPageShow() {
|
||||
var page = this;
|
||||
|
||||
if (!$.browser.mobile) {
|
||||
if (!destroyed) {
|
||||
|
||||
if (!page.classList.contains('itemDetailPage')) {
|
||||
Backdrops.setBackdropUrl(page, 'themes/halloween/bg.jpg');
|
||||
if (appStorage.getItem(cancelKey) == cancelValue) {
|
||||
|
||||
destroyed = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (lastSound == 0) {
|
||||
playSound('http://github.com/MediaBrowser/Emby.Resources/raw/master/themes/halloween/monsterparadefade.mp3', .1);
|
||||
} else if ((new Date().getTime() - lastSound) > 30000) {
|
||||
playSound('http://github.com/MediaBrowser/Emby.Resources/raw/master/themes/halloween/howl.wav');
|
||||
Dashboard.importCss('themes/halloween/style.css');
|
||||
|
||||
if (!$.browser.mobile) {
|
||||
|
||||
if (!page.classList.contains('itemDetailPage')) {
|
||||
Backdrops.setBackdropUrl(page, 'themes/halloween/bg.jpg');
|
||||
}
|
||||
|
||||
if (lastSound == 0) {
|
||||
playSound('http://github.com/MediaBrowser/Emby.Resources/raw/master/themes/halloween/monsterparadefade.mp3', .1);
|
||||
} else if ((new Date().getTime() - lastSound) > 30000) {
|
||||
playSound('http://github.com/MediaBrowser/Emby.Resources/raw/master/themes/halloween/howl.wav');
|
||||
}
|
||||
}
|
||||
|
||||
addIcon();
|
||||
}
|
||||
}
|
||||
|
||||
function addIcon() {
|
||||
|
||||
if (iconCreated) {
|
||||
return;
|
||||
}
|
||||
|
||||
iconCreated = true;
|
||||
|
||||
var elem = document.createElement('paper-icon-button');
|
||||
elem.icon = 'info';
|
||||
elem.classList.add('halloweenInfoButton');
|
||||
$(elem).on('click', onIconClick);
|
||||
|
||||
var viewMenuSecondary = document.querySelector('.viewMenuSecondary');
|
||||
|
||||
if (viewMenuSecondary) {
|
||||
viewMenuSecondary.insertBefore(elem, viewMenuSecondary.childNodes[0]);
|
||||
}
|
||||
}
|
||||
|
||||
function onIconClick() {
|
||||
|
||||
Dashboard.dialog({
|
||||
|
||||
title: "Happy Halloween",
|
||||
message: "Happy Halloween from the Emby Team. We hope your Halloween is spooktacular! Would you like to allow the Halloween theme to continue?",
|
||||
callback: function (result) {
|
||||
|
||||
if (result == 1) {
|
||||
destroyTheme();
|
||||
}
|
||||
},
|
||||
|
||||
buttons: [Globalize.translate('ButtonYes'), Globalize.translate('ButtonNo')]
|
||||
});
|
||||
}
|
||||
|
||||
function destroyTheme() {
|
||||
|
||||
destroyed = true;
|
||||
|
||||
var halloweenInfoButton = document.querySelector('.halloweenInfoButton');
|
||||
if (halloweenInfoButton) {
|
||||
halloweenInfoButton.parentNode.removeChild(halloweenInfoButton);
|
||||
}
|
||||
|
||||
if (currentSound) {
|
||||
currentSound.stop();
|
||||
}
|
||||
|
||||
Dashboard.removeStylesheet('themes/halloween/style.css');
|
||||
Backdrops.clear();
|
||||
appStorage.setItem(cancelKey, cancelValue);
|
||||
}
|
||||
|
||||
pageClassOn('pageshow', "libraryPage", onPageShow);
|
||||
|
||||
if ($($.mobile.activePage)[0].classList.contains('libraryPage')) {
|
||||
|
@ -37,6 +108,7 @@
|
|||
});
|
||||
|
||||
sound.play();
|
||||
currentSound = sound;
|
||||
lastSound = new Date().getTime();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue