1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update ssdp handler

This commit is contained in:
Luke Pulverenti 2016-10-19 02:27:02 -04:00
parent 63147d64a7
commit 4cad3ad8b0
13 changed files with 80 additions and 143 deletions

View file

@ -71,7 +71,7 @@ button {
.cardBox {
padding: 0 !important;
margin: 0;
margin: 2px;
transition: none;
border: 3px solid transparent;
/* Needed in case cardBox is a button */
@ -91,10 +91,6 @@ button {
transform: scale(1.16, 1.16);
}
.cardBox-mobile {
margin: 2px;
}
.card:focus {
position: relative !important;
z-index: 10 !important;
@ -202,6 +198,11 @@ button {
}
.coveredImage-img {
width: 100%;
height: 100%;
}
.coveredImage-noscale-img {
max-height: none;
max-width: none;
}

View file

@ -2,32 +2,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
function (datetime, imageLoader, connectionManager, itemHelper, mediaInfo, focusManager, indicators, globalize, layoutManager, appHost, dom) {
'use strict';
// Regular Expressions for parsing tags and attributes
var SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
// Match everything outside of normal chars and " (quote character)
NON_ALPHANUMERIC_REGEXP = /([^\#-~| |!])/g;
/**
* Escapes all potentially dangerous characters, so that the
* resulting string can be safely inserted into attribute or
* element text.
* @param value
* @returns {string} escaped text
*/
function htmlEncode(value) {
return value.
replace(/&/g, '&').
replace(SURROGATE_PAIR_REGEXP, function (value) {
var hi = value.charCodeAt(0);
var low = value.charCodeAt(1);
return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';
}).
replace(NON_ALPHANUMERIC_REGEXP, function (value) {
return '&#' + value.charCodeAt(0) + ';';
}).
replace(/</g, '&lt;').
replace(/>/g, '&gt;');
}
var devicePixelRatio = window.devicePixelRatio || 1;
function getCardsHtml(items, options) {
@ -1202,9 +1177,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
var separateCardBox = scalable;
var cardBoxClass = options.cardLayout ? 'cardBox visualCardBox' : 'cardBox';
if (!layoutManager.tv) {
cardBoxClass += ' cardBox-mobile';
} else {
if (layoutManager.tv) {
cardBoxClass += ' cardBox-focustransform';
}
@ -1300,8 +1273,12 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
var imgClass = 'cardImage cardImage-img lazy';
if (coveredImage) {
if (devicePixelRatio === 1) {
imgClass += ' coveredImage-noscale-img';
} else {
imgClass += ' coveredImage-img';
}
}
cardImageContainerOpen += '<img crossOrigin="Anonymous" class="' + imgClass + '" data-vibrant="' + cardFooterId + '" data-swatch="db" data-src="' + imgUrl + '" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" />';
} else {

View file

@ -176,7 +176,8 @@ define(['visibleinviewport', 'imageFetcher', 'layoutManager', 'events', 'browser
url = url.split('?')[0];
var cacheKey = 'vibrant21';
var cacheKey = 'vibrant25';
//cacheKey = 'vibrant' + new Date().getTime();
return cacheKey + url;
}

View file

@ -155,7 +155,6 @@ define(['appStorage', 'browser'], function (appStorage, browser) {
return features;
}();
var appInfo;
var version = window.dashboardVersion || '3.0';

View file

@ -98,6 +98,11 @@
var commands = [];
commands.push({
name: globalize.translate('ButtonRemoteControl'),
id: 'remotecontrol'
});
// manage server, metadata manager, reports, sync to other devices
if (currentUser.Policy.IsAdministrator) {
commands.push({
@ -118,11 +123,6 @@
});
}
commands.push({
name: globalize.translate('ButtonRemoteControl'),
id: 'remotecontrol'
});
if (Dashboard.isConnectMode()) {
commands.push({
name: globalize.translate('HeaderSelectServer'),

View file

@ -1,9 +1,7 @@
define([], function () {
function goNext() {
require(['scripts/wizardcontroller'], function (wizardcontroller) {
wizardcontroller.navigateToService();
});
Dashboard.navigate('wizardagreement.html');
}
function loadDownloadInfo(view) {

View file

@ -2588,13 +2588,6 @@ var AppInfo = {};
anonymous: true
});
defineRoute({
path: '/wizardservice.html',
dependencies: ['dashboardcss'],
autoFocus: false,
anonymous: true
});
defineRoute({
path: '/wizardsettings.html',
dependencies: ['dashboardcss'],

View file

@ -6,7 +6,7 @@
apiClient.getJSON(apiClient.getUrl('Startup/Info')).then(function (info) {
if (info.HasMediaEncoder) {
navigateToService();
Dashboard.navigate('wizardagreement.html');
} else {
Dashboard.navigate('wizardcomponents.html');
@ -14,22 +14,7 @@
});
}
function navigateToService() {
var apiClient = ApiClient;
apiClient.getJSON(apiClient.getUrl('Startup/Info')).then(function (info) {
if (info.SupportsRunningAsService) {
Dashboard.navigate('wizardservice.html');
} else {
Dashboard.navigate('wizardagreement.html');
}
});
}
return {
navigateToComponents: navigateToComponents,
navigateToService: navigateToService
navigateToComponents: navigateToComponents
};
});

View file

@ -1,13 +0,0 @@
define(['jQuery'], function ($) {
$(document).on('pageinit', "#wizardServicePage", function () {
var page = this;
$('#btnNextPage', page).on('click', function () {
Dashboard.navigate('wizardagreement.html');
});
});
});

View file

@ -15,8 +15,8 @@
color: #FF9100 !important;
}
paper-button[raised].more {
background: #FF9100;
.button-submit, .button-accent {
background: #FF9100 !important;
}
.channelTimeslotHeader, .timeslotHeader {
@ -26,3 +26,16 @@ paper-button[raised].more {
.channelTimeslotHeader {
border-right-color: #FF9100 !important;
}
.emby-tab-button-active, .ui-body-b .emby-tab-button-active {
color: #FF9100 !important;
border-color: #FF9100 !important;
}
.darkDrawer .sidebarLink.selectedSidebarLink, .darkDrawer .selectedMediaFolder {
color: #FF9100 !important;
}
.visualCardBox-cardFooter {
color: #FF9100;
}

View file

@ -1,4 +1,4 @@
(function () {
define(['appSettings', 'backdrop', 'browser', 'globalize', 'css!./style.css', 'paper-icon-button-light'], function (appSettings, backdrop, browser, globalize) {
var lastSound = 0;
var iconCreated;
@ -12,18 +12,16 @@
if (!destroyed) {
if (appStorage.getItem(cancelKey) == cancelValue) {
if (appSettings.get(cancelKey) == cancelValue) {
destroyed = true;
return;
}
require(['css!themes/halloween/style.css']);
if (!browserInfo.mobile) {
if (!browser.mobile) {
if (!page.classList.contains('itemDetailPage')) {
Backdrops.setBackdropUrl(page, 'themes/halloween/bg.jpg');
backdrop.setBackdrop('themes/halloween/bg.jpg');
}
if (lastSound == 0) {
@ -45,37 +43,45 @@
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]);
var html = '<button is="paper-icon-button-light" class="halloweenInfoButton"><i class="md-icon">info</i></button>';
viewMenuSecondary.insertAdjacentHTML('afterbegin', html);
viewMenuSecondary.querySelector('.halloweenInfoButton').addEventListener('click', onIconClick);
}
}
function onIconClick() {
// todo: switch this to action sheet
require(['dialog'], function (dialog) {
dialog({
//require(['dialog'], function (dialog) {
// dialog({
title: "Happy Halloween",
text: "Happy Halloween from the Emby Team. We hope your Halloween is spooktacular! Would you like to allow the Halloween theme to continue?",
// 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) {
buttons: [
{
id: 'yes',
name: globalize.translate('ButtonYes'),
type: 'submit'
},
{
id: 'no',
name: globalize.translate('ButtonNo'),
type: 'cancel'
}
]
// if (result == 1) {
// destroyTheme();
// }
// },
// buttons: [Globalize.translate('ButtonYes'), Globalize.translate('ButtonNo')]
// });
//});
}).then(function (result) {
if (result == 'no') {
destroyTheme();
}
});
});
}
function destroyTheme() {
@ -92,15 +98,15 @@
}
Dashboard.removeStylesheet('themes/halloween/style.css');
Backdrops.clear();
appStorage.setItem(cancelKey, cancelValue);
backdrop.clear();
appSettings.set(cancelKey, cancelValue);
}
pageClassOn('pageshow', "libraryPage", onPageShow);
if ($($.mobile.activePage)[0].classList.contains('libraryPage')) {
onPageShow.call($($.mobile.activePage)[0]);
}
//if ($($.mobile.activePage)[0].classList.contains('libraryPage')) {
// onPageShow.call($($.mobile.activePage)[0]);
//}
function playSound(path, volume) {
@ -117,4 +123,4 @@
});
}
})();
});

View file

@ -10,7 +10,7 @@
<p style="margin:2em 0;">${WizardCompleted}</p>
<p style="margin:2em 0;" class="appLinks">
<a href="http://www.amazon.com/Emby-Mobile/dp/B017OSA1QS" target="_blank">
<a href="https://www.amazon.com/Emby-Mobile/dp/B00GVH9O0I" target="_blank">
<img src="css/images/clients/amazon.png" title="Android via Amazon App Store" />
</a>
<a href="https://play.google.com/store/apps/details?id=com.mb.android&hl=en" target="_blank">
@ -19,7 +19,7 @@
<a href="https://itunes.apple.com/us/app/emby/id992180193?ls=1&mt=8" target="_blank">
<img src="css/images/clients/ios.png" title="iOS" />
</a>
<a href="https://www.roku.com/channels#!details/44191/emby" target="_blank">
<a href="https://channelstore.roku.com/details/44191/emby" target="_blank">
<img src="css/images/clients/roku.jpg" title="Roku" />
</a>
<a href="http://www.windowsphone.com/s?appid=f4971ed9-f651-4bf6-84bb-94fd98613b86" target="_blank">
@ -28,10 +28,10 @@
<a href="http://apps.microsoft.com/windows/en-us/app/media-browser/ad55a2f0-9897-47bd-8944-bed3aefd5d06" target="_blank">
<img src="css/images/clients/windowsrt.png" title="Windows 8.1" />
</a>
<a href="http://emby.media" target="_blank" title="Windows Media Center">
<a href="https://emby.media/emby-for-windows-media-center.html" target="_blank" title="Windows Media Center">
<img src="css/images/clients/mbc.png" />
</a>
<a href="http://emby.media/download" target="_blank" title="Kodi">
<a href="https://emby.media/emby-for-kodi.html" target="_blank" title="Kodi">
<img src="css/images/clients/kodi.png" />
</a>
</p>

View file

@ -1,23 +0,0 @@
<div id="wizardServicePage" data-role="page" class="page standalonePage wizardPage" data-require="scripts/wizardservice,emby-button">
<div data-role="content">
<div class="ui-corner-all ui-shadow wizardContent">
<h1>
${LabelWindowsService}
</h1>
<p style="margin-top:2em;">${AWindowsServiceHasBeenInstalled}</p>
<p>${WindowsServiceIntro1}</p>
<p>${WindowsServiceIntro2}</p>
<div class="wizardNavigation">
<button is="emby-button" type="button" class="raised button-cancel" onclick="history.back();"><i class="md-icon">arrow_back</i><span>${LabelPrevious}</span></button>
<button is="emby-button" type="button" id="btnNextPage" class="raised button-submit"><span>${LabelNext}</span><i class="md-icon">arrow_forward</i></button>
</div>
</div>
</div>
</div>