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

Merge pull request #224 from vitorsemeano/webpack_part5

Conversion to webpack - part5 - module resolution, data-require cleaned
This commit is contained in:
Joshua M. Boniface 2019-05-10 09:07:38 -04:00 committed by GitHub
commit a14b2b337c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
74 changed files with 1494 additions and 671 deletions

View file

@ -1,4 +1,4 @@
<div id="addPluginPage" data-role="page" class="page type-interior pluginConfigurationPage" data-backbutton="true" data-require="emby-select,emby-collapse,emby-button">
<div id="addPluginPage" data-role="page" class="page type-interior pluginConfigurationPage" data-backbutton="true">
<div>
<div class="content-primary">

View file

@ -1,7 +0,0 @@
.card-round:focus > .cardBox-focustransform {
transform: scale(1.26, 1.26);
}
.cardImageContainer-round, .cardImage-round {
border-radius: 1000px;
}

View file

@ -132,8 +132,7 @@ define(["loading", "libraryBrowser", "cardBuilder", "dom", "apphost", "imageLoad
overlayMoreButton: section.overlayMoreButton && !cardLayout,
action: section.action,
allowBottomPadding: !enableScrollX(),
cardLayout: cardLayout,
vibrant: supportsImageAnalysis && cardLayout
cardLayout: cardLayout
}), html += "</div>"
}
elem.innerHTML = html, imageLoader.lazyChildren(elem)

View file

@ -30,9 +30,7 @@ define(['lazyLoader', 'imageFetcher', 'layoutManager', 'browser', 'appSettings',
function fillImageElement(elem, source, enableEffects) {
imageFetcher.loadImage(elem, source).then(function () {
var fillingVibrant = false;//fillVibrant(elem, source);
if (enableFade && enableEffects !== false && !fillingVibrant) {
if (enableFade && enableEffects !== false) {
fadeIn(elem);
}
@ -40,131 +38,6 @@ define(['lazyLoader', 'imageFetcher', 'layoutManager', 'browser', 'appSettings',
});
}
function fillVibrant(img, url, canvas, canvasContext) {
var vibrantElement = img.getAttribute('data-vibrant');
if (!vibrantElement) {
return false;
}
if (window.Vibrant) {
fillVibrantOnLoaded(img, url, vibrantElement, canvas, canvasContext);
return true;
}
require(['vibrant'], function () {
fillVibrantOnLoaded(img, url, vibrantElement, canvas, canvasContext);
});
return true;
}
function fillVibrantOnLoaded(img, url, vibrantElement) {
vibrantElement = document.getElementById(vibrantElement);
if (!vibrantElement) {
return;
}
requestIdleCallback(function () {
//var now = new Date().getTime();
getVibrantInfoFromElement(img, url).then(function (vibrantInfo) {
var swatch = vibrantInfo.split('|');
//console.log('vibrant took ' + (new Date().getTime() - now) + 'ms');
if (swatch.length) {
var index = 0;
var style = vibrantElement.style;
style.backgroundColor = swatch[index];
style.color = swatch[index + 1];
var classList = vibrantElement.classList;
if (classList.contains('cardFooter')) {
classList.add('cardFooter-vibrant');
} else {
classList.add('vibrant');
}
}
});
});
/*
* Results into:
* Vibrant #7a4426
* Muted #7b9eae
* DarkVibrant #348945
* DarkMuted #141414
* LightVibrant #f3ccb4
*/
}
function getVibrantInfoFromElement(elem, url) {
return new Promise(function (resolve, reject) {
require(['vibrant'], function () {
if (elem.tagName === 'IMG') {
resolve(getVibrantInfo(elem, url));
return;
}
var img = new Image();
img.onload = function () {
resolve(getVibrantInfo(img, url));
};
img.src = url;
});
});
}
function getSettingsKey(url) {
var parts = url.split('://');
url = parts[parts.length - 1];
url = url.substring(url.indexOf('/') + 1);
url = url.split('?')[0];
var cacheKey = 'vibrant31';
//cacheKey = 'vibrant' + new Date().getTime();
return cacheKey + url;
}
function getCachedVibrantInfo(url) {
return appSettings.get(getSettingsKey(url));
}
function getVibrantInfo(img, url) {
var value = getCachedVibrantInfo(url);
if (value) {
return value;
}
var vibrant = new Vibrant(img);
var swatches = vibrant.swatches();
value = '';
var swatch = swatches.DarkVibrant;
value += getSwatchString(swatch);
appSettings.set(getSettingsKey(url), value);
return value;
}
function getSwatchString(swatch) {
if (swatch) {
return swatch.getHex() + '|' + swatch.getBodyTextColor() + '|' + swatch.getTitleTextColor();
}
return '||';
}
function fadeIn(elem) {
var cssClass = 'lazy-image-fadein';
@ -248,8 +121,6 @@ define(['lazyLoader', 'imageFetcher', 'layoutManager', 'browser', 'appSettings',
self.lazyImage = fillImage;
self.lazyChildren = lazyChildren;
self.getPrimaryImageAspectRatio = getPrimaryImageAspectRatio;
self.getCachedVibrantInfo = getCachedVibrantInfo;
self.getVibrantInfoFromElement = getVibrantInfoFromElement;
return self;
});

View file

@ -1,121 +1,262 @@
define(["browser", "dom", "layoutManager", "css!components/viewManager/viewContainer"], function(browser, dom, layoutManager) {
define(["browser", "dom", "layoutManager", "css!components/viewManager/viewContainer"], function (browser, dom, layoutManager) {
"use strict";
function setControllerClass(view, options) {
if (options.controllerFactory) return Promise.resolve();
if (options.controllerFactory) {
return Promise.resolve();
}
var controllerUrl = view.getAttribute("data-controller");
return controllerUrl ? (0 === controllerUrl.indexOf("__plugin/") && (controllerUrl = controllerUrl.substring("__plugin/".length)), controllerUrl = Dashboard.getConfigurationResourceUrl(controllerUrl), getRequirePromise([controllerUrl]).then(function(ControllerFactory) {
options.controllerFactory = ControllerFactory
})) : Promise.resolve()
if (controllerUrl) {
if (0 === controllerUrl.indexOf("__plugin/")) {
controllerUrl = controllerUrl.substring("__plugin/".length);
}
controllerUrl = Dashboard.getConfigurationResourceUrl(controllerUrl);
return getRequirePromise([controllerUrl]).then(function (ControllerFactory) {
options.controllerFactory = ControllerFactory;
});
}
return Promise.resolve();
}
function getRequirePromise(deps) {
return new Promise(function(resolve, reject) {
require(deps, resolve)
})
return new Promise(function (resolve, reject) {
require(deps, resolve);
});
}
function loadView(options) {
if (!options.cancel) {
var selected = selectedPageIndex,
previousAnimatable = -1 === selected ? null : allPages[selected],
pageIndex = selected + 1;
pageIndex >= pageContainerCount && (pageIndex = 0);
var isPluginpage = -1 !== options.url.toLowerCase().indexOf("/configurationpage"),
newViewInfo = normalizeNewView(options, isPluginpage),
newView = newViewInfo.elem,
dependencies = "string" == typeof newView ? null : newView.getAttribute("data-require");
return dependencies = dependencies ? dependencies.split(",") : [], isPluginpage && dependencies.push("legacy/dashboard"), newViewInfo.hasjQuerySelect && dependencies.push("legacy/selectmenu"), newViewInfo.hasjQueryChecked && dependencies.push("fnchecked"), newViewInfo.hasjQuery && dependencies.push("jQuery"), (isPluginpage || newView.classList && newView.classList.contains("type-interior")) && dependencies.push("dashboardcss"), new Promise(function(resolve, reject) {
dependencies.join(",");
require(dependencies, function() {
var currentPage = allPages[pageIndex];
currentPage && triggerDestroy(currentPage);
var view = newView;
"string" == typeof view && (view = document.createElement("div"), view.innerHTML = newView), view.classList.add("mainAnimatedPage"), currentPage ? newViewInfo.hasScript && window.$ ? (view = $(view).appendTo(mainAnimatedPages)[0], mainAnimatedPages.removeChild(currentPage)) : mainAnimatedPages.replaceChild(view, currentPage) : newViewInfo.hasScript && window.$ ? view = $(view).appendTo(mainAnimatedPages)[0] : mainAnimatedPages.appendChild(view), options.type && view.setAttribute("data-type", options.type);
var properties = [];
options.fullscreen && properties.push("fullscreen"), properties.length && view.setAttribute("data-properties", properties.join(","));
allPages[pageIndex] = view, setControllerClass(view, options).then(function() {
onBeforeChange && onBeforeChange(view, !1, options), beforeAnimate(allPages, pageIndex, selected), selectedPageIndex = pageIndex, currentUrls[pageIndex] = options.url, !options.cancel && previousAnimatable && afterAnimate(allPages, pageIndex), window.$ && ($.mobile = $.mobile || {}, $.mobile.activePage = view), resolve(view)
})
})
})
var selected = selectedPageIndex;
var previousAnimatable = -1 === selected ? null : allPages[selected];
var pageIndex = selected + 1;
if (pageIndex >= pageContainerCount) {
pageIndex = 0;
}
var isPluginpage = -1 !== options.url.toLowerCase().indexOf("/configurationpage");
var newViewInfo = normalizeNewView(options, isPluginpage);
var newView = newViewInfo.elem;
if (isPluginpage) {
require(["legacy/dashboard"]);
}
if (newViewInfo.hasjQuerySelect) {
require(["legacy/selectmenu"]);
}
if (newViewInfo.hasjQueryChecked) {
require(["fnchecked"]);
}
return new Promise(function (resolve) {
var currentPage = allPages[pageIndex];
if (currentPage) {
triggerDestroy(currentPage);
}
var view = newView;
if ("string" == typeof view) {
view = document.createElement("div");
view.innerHTML = newView;
}
view.classList.add("mainAnimatedPage");
if (currentPage) {
if (newViewInfo.hasScript && window.$) {
view = $(view).appendTo(mainAnimatedPages)[0];
mainAnimatedPages.removeChild(currentPage);
} else {
mainAnimatedPages.replaceChild(view, currentPage);
}
} else {
if (newViewInfo.hasScript && window.$) {
view = $(view).appendTo(mainAnimatedPages)[0];
} else {
mainAnimatedPages.appendChild(view);
}
}
if (options.type) {
view.setAttribute("data-type", options.type);
}
var properties = [];
if (options.fullscreen) {
properties.push("fullscreen");
}
if (properties.length) {
view.setAttribute("data-properties", properties.join(","));
}
allPages[pageIndex] = view;
setControllerClass(view, options).then(function () {
if (onBeforeChange) {
onBeforeChange(view, false, options);
}
beforeAnimate(allPages, pageIndex, selected);
selectedPageIndex = pageIndex;
currentUrls[pageIndex] = options.url;
if (!options.cancel && previousAnimatable) {
afterAnimate(allPages, pageIndex);
}
if (window.$) {
$.mobile = $.mobile || {};
$.mobile.activePage = view;
}
resolve(view);
});
});
}
}
function replaceAll(str, find, replace) {
return str.split(find).join(replace)
return str.split(find).join(replace);
}
function parseHtml(html, hasScript) {
hasScript && (html = replaceAll(html, "\x3c!--<script", "<script"), html = replaceAll(html, "<\/script>--\x3e", "<\/script>"));
if (hasScript) {
html = replaceAll(html, "\x3c!--<script", "<script");
html = replaceAll(html, "<\/script>--\x3e", "<\/script>");
}
var wrapper = document.createElement("div");
return wrapper.innerHTML = html, wrapper.querySelector('div[data-role="page"]')
wrapper.innerHTML = html;
return wrapper.querySelector('div[data-role="page"]');
}
function normalizeNewView(options, isPluginpage) {
var viewHtml = options.view;
if (-1 === viewHtml.indexOf('data-role="page"')) return viewHtml;
var hasScript = -1 !== viewHtml.indexOf("<script"),
elem = parseHtml(viewHtml, hasScript);
hasScript && (hasScript = null != elem.querySelector("script"));
var hasjQuery = !1,
hasjQuerySelect = !1,
hasjQueryChecked = !1;
return isPluginpage && (hasjQuery = -1 != viewHtml.indexOf("jQuery") || -1 != viewHtml.indexOf("$(") || -1 != viewHtml.indexOf("$."), hasjQueryChecked = -1 != viewHtml.indexOf(".checked("), hasjQuerySelect = -1 != viewHtml.indexOf(".selectmenu(")), {
if (-1 === viewHtml.indexOf('data-role="page"')) {
return viewHtml;
}
var hasScript = -1 !== viewHtml.indexOf("<script");
var elem = parseHtml(viewHtml, hasScript);
if (hasScript) {
hasScript = null != elem.querySelector("script");
}
var hasjQuery = false;
var hasjQuerySelect = false;
var hasjQueryChecked = false;
if (isPluginpage) {
hasjQuery = -1 != viewHtml.indexOf("jQuery") || -1 != viewHtml.indexOf("$(") || -1 != viewHtml.indexOf("$.");
hasjQueryChecked = -1 != viewHtml.indexOf(".checked(");
hasjQuerySelect = -1 != viewHtml.indexOf(".selectmenu(");
}
return {
elem: elem,
hasScript: hasScript,
hasjQuerySelect: hasjQuerySelect,
hasjQueryChecked: hasjQueryChecked,
hasjQuery: hasjQuery
}
};
}
function beforeAnimate(allPages, newPageIndex, oldPageIndex) {
for (var i = 0, length = allPages.length; i < length; i++) newPageIndex === i || oldPageIndex === i || allPages[i].classList.add("hide")
for (var index = 0, length = allPages.length; index < length; index++) {
if (newPageIndex !== index && oldPageIndex !== index) {
allPages[index].classList.add("hide");
}
}
}
function afterAnimate(allPages, newPageIndex) {
for (var i = 0, length = allPages.length; i < length; i++) newPageIndex === i || allPages[i].classList.add("hide")
for (var index = 0, length = allPages.length; index < length; index++) {
if (newPageIndex !== index) {
allPages[index].classList.add("hide");
}
}
}
function setOnBeforeChange(fn) {
onBeforeChange = fn
onBeforeChange = fn;
}
function tryRestoreView(options) {
var url = options.url,
index = currentUrls.indexOf(url);
var url = options.url;
var index = currentUrls.indexOf(url);
if (-1 !== index) {
var animatable = allPages[index],
view = animatable;
var animatable = allPages[index];
var view = animatable;
if (view) {
if (options.cancel) return;
var selected = selectedPageIndex,
previousAnimatable = -1 === selected ? null : allPages[selected];
return setControllerClass(view, options).then(function() {
return onBeforeChange && onBeforeChange(view, !0, options), beforeAnimate(allPages, index, selected), animatable.classList.remove("hide"), selectedPageIndex = index, !options.cancel && previousAnimatable && afterAnimate(allPages, index), window.$ && ($.mobile = $.mobile || {}, $.mobile.activePage = view), view
})
if (options.cancel) {
return;
}
var selected = selectedPageIndex;
var previousAnimatable = -1 === selected ? null : allPages[selected];
return setControllerClass(view, options).then(function () {
if (onBeforeChange) {
onBeforeChange(view, true, options);
}
beforeAnimate(allPages, index, selected);
animatable.classList.remove("hide");
selectedPageIndex = index;
if (!options.cancel && previousAnimatable) {
afterAnimate(allPages, index);
}
if (window.$) {
$.mobile = $.mobile || {};
$.mobile.activePage = view;
}
return view;
});
}
}
return Promise.reject()
return Promise.reject();
}
function triggerDestroy(view) {
view.dispatchEvent(new CustomEvent("viewdestroy", {}))
view.dispatchEvent(new CustomEvent("viewdestroy", {}));
}
function reset() {
allPages = [], currentUrls = [], mainAnimatedPages.innerHTML = "", selectedPageIndex = -1
}
var onBeforeChange, mainAnimatedPages = document.querySelector(".mainAnimatedPages"),
allPages = [],
currentUrls = [],
pageContainerCount = 3,
allPages = [];
currentUrls = [];
mainAnimatedPages.innerHTML = "";
selectedPageIndex = -1;
return reset(), mainAnimatedPages.classList.remove("hide"), {
}
var onBeforeChange;
var mainAnimatedPages = document.querySelector(".mainAnimatedPages");
var allPages = [];
var currentUrls = [];
var pageContainerCount = 3;
var selectedPageIndex = -1;
reset();
mainAnimatedPages.classList.remove("hide");
return {
loadView: loadView,
tryRestoreView: tryRestoreView,
reset: reset,
setOnBeforeChange: setOnBeforeChange
}
});
};
});

View file

@ -1,10 +1,10 @@
define(['viewcontainer', 'focusManager', 'queryString', 'layoutManager'], function (viewcontainer, focusManager, queryString, layoutManager) {
define(['viewContainer', 'focusManager', 'queryString', 'layoutManager'], function (viewContainer, focusManager, queryString, layoutManager) {
'use strict';
var currentView;
var dispatchPageEvents;
viewcontainer.setOnBeforeChange(function (newView, isRestored, options) {
viewContainer.setOnBeforeChange(function (newView, isRestored, options) {
var lastView = currentView;
if (lastView) {
@ -21,7 +21,7 @@ define(['viewcontainer', 'focusManager', 'queryString', 'layoutManager'], functi
if (!newView.initComplete) {
newView.initComplete = true;
if (options.controllerFactory) {
if (typeof options.controllerFactory === 'function') {
// Use controller method
var controller = new options.controllerFactory(newView, eventDetail.detail.params);
@ -125,7 +125,7 @@ define(['viewcontainer', 'focusManager', 'queryString', 'layoutManager'], functi
function resetCachedViews() {
// Reset all cached views whenever the skin changes
viewcontainer.reset();
viewContainer.reset();
}
document.addEventListener('skinunload', resetCachedViews);
@ -146,7 +146,7 @@ define(['viewcontainer', 'focusManager', 'queryString', 'layoutManager'], functi
return;
}
viewcontainer.loadView(options).then(function (view) {
viewContainer.loadView(options).then(function (view) {
onViewChange(view, options);
});
@ -163,7 +163,7 @@ define(['viewcontainer', 'focusManager', 'queryString', 'layoutManager'], functi
currentView.activeElement = document.activeElement;
}
return viewcontainer.tryRestoreView(options).then(function (view) {
return viewContainer.tryRestoreView(options).then(function (view) {
onViewChanging();
onViewChange(view, options, true);

View file

@ -0,0 +1,829 @@
define(["jQuery", "loading", "fnchecked", "emby-select", "emby-button", "emby-input", "emby-checkbox", "listViewStyle", "emby-button"], function ($, loading) {
"use strict";
function loadProfile(page) {
loading.show();
var promise1 = getProfile();
var promise2 = ApiClient.getUsers();
Promise.all([promise1, promise2]).then(function (responses) {
currentProfile = responses[0];
renderProfile(page, currentProfile, responses[1]);
loading.hide();
});
}
function getProfile() {
var id = getParameterByName("id");
var url = id ? "Dlna/Profiles/" + id : "Dlna/Profiles/Default";
return ApiClient.getJSON(ApiClient.getUrl(url));
}
function renderProfile(page, profile, users) {
$("#txtName", page).val(profile.Name);
$(".chkMediaType", page).each(function () {
this.checked = -1 != (profile.SupportedMediaTypes || "").split(",").indexOf(this.getAttribute("data-value"));
});
$("#chkEnableAlbumArtInDidl", page).checked(profile.EnableAlbumArtInDidl);
$("#chkEnableSingleImageLimit", page).checked(profile.EnableSingleAlbumArtLimit);
renderXmlDocumentAttributes(page, profile.XmlRootAttributes || []);
var idInfo = profile.Identification || {};
renderIdentificationHeaders(page, idInfo.Headers || []);
renderSubtitleProfiles(page, profile.SubtitleProfiles || []);
$("#txtInfoFriendlyName", page).val(profile.FriendlyName || "");
$("#txtInfoModelName", page).val(profile.ModelName || "");
$("#txtInfoModelNumber", page).val(profile.ModelNumber || "");
$("#txtInfoModelDescription", page).val(profile.ModelDescription || "");
$("#txtInfoModelUrl", page).val(profile.ModelUrl || "");
$("#txtInfoManufacturer", page).val(profile.Manufacturer || "");
$("#txtInfoManufacturerUrl", page).val(profile.ManufacturerUrl || "");
$("#txtInfoSerialNumber", page).val(profile.SerialNumber || "");
$("#txtIdFriendlyName", page).val(idInfo.FriendlyName || "");
$("#txtIdModelName", page).val(idInfo.ModelName || "");
$("#txtIdModelNumber", page).val(idInfo.ModelNumber || "");
$("#txtIdModelDescription", page).val(idInfo.ModelDescription || "");
$("#txtIdModelUrl", page).val(idInfo.ModelUrl || "");
$("#txtIdManufacturer", page).val(idInfo.Manufacturer || "");
$("#txtIdManufacturerUrl", page).val(idInfo.ManufacturerUrl || "");
$("#txtIdSerialNumber", page).val(idInfo.SerialNumber || "");
$("#txtIdDeviceDescription", page).val(idInfo.DeviceDescription || "");
$("#txtAlbumArtPn", page).val(profile.AlbumArtPn || "");
$("#txtAlbumArtMaxWidth", page).val(profile.MaxAlbumArtWidth || "");
$("#txtAlbumArtMaxHeight", page).val(profile.MaxAlbumArtHeight || "");
$("#txtIconMaxWidth", page).val(profile.MaxIconWidth || "");
$("#txtIconMaxHeight", page).val(profile.MaxIconHeight || "");
$("#chkIgnoreTranscodeByteRangeRequests", page).checked(profile.IgnoreTranscodeByteRangeRequests);
$("#txtMaxAllowedBitrate", page).val(profile.MaxStreamingBitrate || "");
$("#txtMusicStreamingTranscodingBitrate", page).val(profile.MusicStreamingTranscodingBitrate || "");
$("#chkRequiresPlainFolders", page).checked(profile.RequiresPlainFolders);
$("#chkRequiresPlainVideoItems", page).checked(profile.RequiresPlainVideoItems);
$("#txtProtocolInfo", page).val(profile.ProtocolInfo || "");
$("#txtXDlnaCap", page).val(profile.XDlnaCap || "");
$("#txtXDlnaDoc", page).val(profile.XDlnaDoc || "");
$("#txtSonyAggregationFlags", page).val(profile.SonyAggregationFlags || "");
profile.DirectPlayProfiles = profile.DirectPlayProfiles || [];
profile.TranscodingProfiles = profile.TranscodingProfiles || [];
profile.ContainerProfiles = profile.ContainerProfiles || [];
profile.CodecProfiles = profile.CodecProfiles || [];
profile.ResponseProfiles = profile.ResponseProfiles || [];
var usersHtml = "<option></option>" + users.map(function (u__w) {
return '<option value="' + u__w.Id + '">' + u__w.Name + "</option>";
}).join("");
$("#selectUser", page).html(usersHtml).val(profile.UserId || "");
renderSubProfiles(page, profile);
}
function renderIdentificationHeaders(page, headers) {
var index = 0;
var html = '<div class="paperList">' + headers.map(function (h__e) {
var li = '<div class="listItem">';
li += '<i class="md-icon listItemIcon">info</i>';
li += '<div class="listItemBody">';
li += '<h3 class="listItemBodyText">' + h__e.Name + ": " + (h__e.Value || "") + "</h3>";
li += '<div class="listItemBodyText secondary">' + (h__e.Match || "") + "</div>";
li += "</div>";
li += '<button type="button" is="paper-icon-button-light" class="btnDeleteIdentificationHeader listItemButton" data-index="' + index + '"><i class="md-icon">delete</i></button>';
li += "</div>";
index++;
return li;
}).join("") + "</div>";
var elem = $(".httpHeaderIdentificationList", page).html(html).trigger("create");
$(".btnDeleteIdentificationHeader", elem).on("click", function () {
var itemIndex = parseInt(this.getAttribute("data-index"));
currentProfile.Identification.Headers.splice(itemIndex, 1);
renderIdentificationHeaders(page, currentProfile.Identification.Headers);
});
}
function openPopup(elem) {
elem.classList.remove("hide");
}
function closePopup(elem) {
elem.classList.add("hide");
}
function editIdentificationHeader(page, header) {
isSubProfileNew = null == header;
header = header || {};
currentSubProfile = header;
var popup = $("#identificationHeaderPopup", page);
$("#txtIdentificationHeaderName", popup).val(header.Name || "");
$("#txtIdentificationHeaderValue", popup).val(header.Value || "");
$("#selectMatchType", popup).val(header.Match || "Equals");
openPopup(popup[0]);
}
function saveIdentificationHeader(page) {
currentSubProfile.Name = $("#txtIdentificationHeaderName", page).val();
currentSubProfile.Value = $("#txtIdentificationHeaderValue", page).val();
currentSubProfile.Match = $("#selectMatchType", page).val();
if (isSubProfileNew) {
currentProfile.Identification = currentProfile.Identification || {};
currentProfile.Identification.Headers = currentProfile.Identification.Headers || [];
currentProfile.Identification.Headers.push(currentSubProfile);
}
renderIdentificationHeaders(page, currentProfile.Identification.Headers);
currentSubProfile = null;
closePopup($("#identificationHeaderPopup", page)[0]);
}
function renderXmlDocumentAttributes(page, attribute) {
var html = '<div class="paperList">' + attribute.map(function (h__r) {
var li = '<div class="listItem">';
li += '<i class="md-icon listItemIcon">info</i>';
li += '<div class="listItemBody">';
li += '<h3 class="listItemBodyText">' + h__r.Name + " = " + (h__r.Value || "") + "</h3>";
li += "</div>";
li += '<button type="button" is="paper-icon-button-light" class="btnDeleteXmlAttribute listItemButton" data-index="0"><i class="md-icon">delete</i></button>';
return li += "</div>";
}).join("") + "</div>";
var elem = $(".xmlDocumentAttributeList", page).html(html).trigger("create");
$(".btnDeleteXmlAttribute", elem).on("click", function () {
var itemIndex = parseInt(this.getAttribute("data-index"));
currentProfile.XmlRootAttributes.splice(itemIndex, 1);
renderXmlDocumentAttributes(page, currentProfile.XmlRootAttributes);
});
}
function editXmlDocumentAttribute(page, attribute) {
isSubProfileNew = null == attribute;
attribute = attribute || {};
currentSubProfile = attribute;
var popup = $("#xmlAttributePopup", page);
$("#txtXmlAttributeName", popup).val(attribute.Name || "");
$("#txtXmlAttributeValue", popup).val(attribute.Value || "");
openPopup(popup[0]);
}
function saveXmlDocumentAttribute(page) {
currentSubProfile.Name = $("#txtXmlAttributeName", page).val();
currentSubProfile.Value = $("#txtXmlAttributeValue", page).val();
if (isSubProfileNew) {
currentProfile.XmlRootAttributes.push(currentSubProfile);
}
renderXmlDocumentAttributes(page, currentProfile.XmlRootAttributes);
currentSubProfile = null;
closePopup($("#xmlAttributePopup", page)[0]);
}
function renderSubtitleProfiles(page, profiles) {
var index = 0;
var html = '<div class="paperList">' + profiles.map(function (h__t) {
var li = '<div class="listItem lnkEditSubProfile" data-index="' + index + '">';
li += '<i class="md-icon listItemIcon">info</i>';
li += '<div class="listItemBody">';
li += '<h3 class="listItemBodyText">' + (h__t.Format || "") + "</h3>";
li += "</div>";
li += '<button type="button" is="paper-icon-button-light" class="btnDeleteProfile listItemButton" data-index="' + index + '"><i class="md-icon">delete</i></button>';
li += "</div>";
index++;
return li;
}).join("") + "</div>";
var elem = $(".subtitleProfileList", page).html(html).trigger("create");
$(".btnDeleteProfile", elem).on("click", function () {
var itemIndex = parseInt(this.getAttribute("data-index"));
currentProfile.SubtitleProfiles.splice(itemIndex, 1);
renderSubtitleProfiles(page, currentProfile.SubtitleProfiles);
});
$(".lnkEditSubProfile", elem).on("click", function () {
var itemIndex = parseInt(this.getAttribute("data-index"));
editSubtitleProfile(page, currentProfile.SubtitleProfiles[itemIndex]);
});
}
function editSubtitleProfile(page, profile) {
isSubProfileNew = null == profile;
profile = profile || {};
currentSubProfile = profile;
var popup = $("#subtitleProfilePopup", page);
$("#txtSubtitleProfileFormat", popup).val(profile.Format || "");
$("#selectSubtitleProfileMethod", popup).val(profile.Method || "");
$("#selectSubtitleProfileDidlMode", popup).val(profile.DidlMode || "");
openPopup(popup[0]);
}
function saveSubtitleProfile(page) {
currentSubProfile.Format = $("#txtSubtitleProfileFormat", page).val();
currentSubProfile.Method = $("#selectSubtitleProfileMethod", page).val();
currentSubProfile.DidlMode = $("#selectSubtitleProfileDidlMode", page).val();
if (isSubProfileNew) {
currentProfile.SubtitleProfiles.push(currentSubProfile);
}
renderSubtitleProfiles(page, currentProfile.SubtitleProfiles);
currentSubProfile = null;
closePopup($("#subtitleProfilePopup", page)[0]);
}
function renderSubProfiles(page, profile) {
renderDirectPlayProfiles(page, profile.DirectPlayProfiles);
renderTranscodingProfiles(page, profile.TranscodingProfiles);
renderContainerProfiles(page, profile.ContainerProfiles);
renderCodecProfiles(page, profile.CodecProfiles);
renderResponseProfiles(page, profile.ResponseProfiles);
}
function saveDirectPlayProfile(page) {
currentSubProfile.Type = $("#selectDirectPlayProfileType", page).val();
currentSubProfile.Container = $("#txtDirectPlayContainer", page).val();
currentSubProfile.AudioCodec = $("#txtDirectPlayAudioCodec", page).val();
currentSubProfile.VideoCodec = $("#txtDirectPlayVideoCodec", page).val();
if (isSubProfileNew) {
currentProfile.DirectPlayProfiles.push(currentSubProfile);
}
renderSubProfiles(page, currentProfile);
currentSubProfile = null;
closePopup($("#popupEditDirectPlayProfile", page)[0]);
}
function renderDirectPlayProfiles(page, profiles) {
var html = "";
html += '<ul data-role="listview" data-inset="true" data-split-icon="delete">';
var currentType;
for (var i__y = 0, length = profiles.length; i__y < length; i__y++) {
var profile = profiles[i__y];
if (profile.Type !== currentType) {
html += '<li data-role="list-divider">' + profile.Type + "</li>";
currentType = profile.Type;
}
html += "<li>";
html += '<a data-profileindex="' + i__y + '" class="lnkEditSubProfile" is="emby-linkbutton" href="#">';
html += "<p>" + Globalize.translate("ValueContainer").replace("{0}", profile.Container || allText) + "</p>";
if ("Video" == profile.Type) {
html += "<p>" + Globalize.translate("ValueVideoCodec").replace("{0}", profile.VideoCodec || allText) + "</p>";
html += "<p>" + Globalize.translate("ValueAudioCodec").replace("{0}", profile.AudioCodec || allText) + "</p>";
} else {
if ("Audio" == profile.Type) {
html += "<p>" + Globalize.translate("ValueCodec").replace("{0}", profile.AudioCodec || allText) + "</p>";
}
}
html += "</a>";
html += '<a is="emby-linkbutton" href="#" data-icon="delete" class="btnDeleteProfile" data-profileindex="' + i__y + '">Delete</a>';
html += "</li>";
}
html += "</ul>";
var elem = $(".directPlayProfiles", page).html(html).trigger("create");
$(".btnDeleteProfile", elem).on("click", function () {
var index = this.getAttribute("data-profileindex");
deleteDirectPlayProfile(page, index);
});
$(".lnkEditSubProfile", elem).on("click", function () {
var index = parseInt(this.getAttribute("data-profileindex"));
editDirectPlayProfile(page, currentProfile.DirectPlayProfiles[index]);
});
}
function deleteDirectPlayProfile(page, index) {
currentProfile.DirectPlayProfiles.splice(index, 1);
renderDirectPlayProfiles(page, currentProfile.DirectPlayProfiles);
}
function editDirectPlayProfile(page, directPlayProfile) {
isSubProfileNew = null == directPlayProfile;
directPlayProfile = directPlayProfile || {};
currentSubProfile = directPlayProfile;
var popup = $("#popupEditDirectPlayProfile", page);
$("#selectDirectPlayProfileType", popup).val(directPlayProfile.Type || "Video").trigger("change");
$("#txtDirectPlayContainer", popup).val(directPlayProfile.Container || "");
$("#txtDirectPlayAudioCodec", popup).val(directPlayProfile.AudioCodec || "");
$("#txtDirectPlayVideoCodec", popup).val(directPlayProfile.VideoCodec || "");
openPopup(popup[0]);
}
function renderTranscodingProfiles(page, profiles) {
var html = "";
html += '<ul data-role="listview" data-inset="true" data-split-icon="delete">';
var currentType;
for (var i__u = 0, length = profiles.length; i__u < length; i__u++) {
var profile = profiles[i__u];
if (profile.Type !== currentType) {
html += '<li data-role="list-divider">' + profile.Type + "</li>";
currentType = profile.Type;
}
html += "<li>";
html += '<a data-profileindex="' + i__u + '" class="lnkEditSubProfile" is="emby-linkbutton" href="#">';
html += "<p>Protocol: " + (profile.Protocol || "Http") + "</p>";
html += "<p>" + Globalize.translate("ValueContainer").replace("{0}", profile.Container || allText) + "</p>";
if ("Video" == profile.Type) {
html += "<p>" + Globalize.translate("ValueVideoCodec").replace("{0}", profile.VideoCodec || allText) + "</p>";
html += "<p>" + Globalize.translate("ValueAudioCodec").replace("{0}", profile.AudioCodec || allText) + "</p>";
} else {
if ("Audio" == profile.Type) {
html += "<p>" + Globalize.translate("ValueCodec").replace("{0}", profile.AudioCodec || allText) + "</p>";
}
}
html += "</a>";
html += '<a is="emby-linkbutton" href="#" data-icon="delete" class="btnDeleteProfile" data-profileindex="' + i__u + '">Delete</a>';
html += "</li>";
}
html += "</ul>";
var elem = $(".transcodingProfiles", page).html(html).trigger("create");
$(".btnDeleteProfile", elem).on("click", function () {
var index = this.getAttribute("data-profileindex");
deleteTranscodingProfile(page, index);
});
$(".lnkEditSubProfile", elem).on("click", function () {
var index = parseInt(this.getAttribute("data-profileindex"));
editTranscodingProfile(page, currentProfile.TranscodingProfiles[index]);
});
}
function editTranscodingProfile(page, transcodingProfile) {
isSubProfileNew = null == transcodingProfile;
transcodingProfile = transcodingProfile || {};
currentSubProfile = transcodingProfile;
var popup = $("#transcodingProfilePopup", page);
$("#selectTranscodingProfileType", popup).val(transcodingProfile.Type || "Video").trigger("change");
$("#txtTranscodingContainer", popup).val(transcodingProfile.Container || "");
$("#txtTranscodingAudioCodec", popup).val(transcodingProfile.AudioCodec || "");
$("#txtTranscodingVideoCodec", popup).val(transcodingProfile.VideoCodec || "");
$("#selectTranscodingProtocol", popup).val(transcodingProfile.Protocol || "Http");
$("#chkEnableMpegtsM2TsMode", popup).checked(transcodingProfile.EnableMpegtsM2TsMode || false);
$("#chkEstimateContentLength", popup).checked(transcodingProfile.EstimateContentLength || false);
$("#chkReportByteRangeRequests", popup).checked("Bytes" == transcodingProfile.TranscodeSeekInfo);
$(".radioTabButton:first", popup).trigger("click");
openPopup(popup[0]);
}
function deleteTranscodingProfile(page, index) {
currentProfile.TranscodingProfiles.splice(index, 1);
renderTranscodingProfiles(page, currentProfile.TranscodingProfiles);
}
function saveTranscodingProfile(page) {
currentSubProfile.Type = $("#selectTranscodingProfileType", page).val();
currentSubProfile.Container = $("#txtTranscodingContainer", page).val();
currentSubProfile.AudioCodec = $("#txtTranscodingAudioCodec", page).val();
currentSubProfile.VideoCodec = $("#txtTranscodingVideoCodec", page).val();
currentSubProfile.Protocol = $("#selectTranscodingProtocol", page).val();
currentSubProfile.Context = "Streaming";
currentSubProfile.EnableMpegtsM2TsMode = $("#chkEnableMpegtsM2TsMode", page).checked();
currentSubProfile.EstimateContentLength = $("#chkEstimateContentLength", page).checked();
currentSubProfile.TranscodeSeekInfo = $("#chkReportByteRangeRequests", page).checked() ? "Bytes" : "Auto";
if (isSubProfileNew) {
currentProfile.TranscodingProfiles.push(currentSubProfile);
}
renderSubProfiles(page, currentProfile);
currentSubProfile = null;
closePopup($("#transcodingProfilePopup", page)[0]);
}
function renderContainerProfiles(page, profiles) {
var html = "";
html += '<ul data-role="listview" data-inset="true" data-split-icon="delete">';
var currentType;
for (var i__i = 0, length = profiles.length; i__i < length; i__i++) {
var profile = profiles[i__i];
if (profile.Type !== currentType) {
html += '<li data-role="list-divider">' + profile.Type + "</li>";
currentType = profile.Type;
}
html += "<li>";
html += '<a data-profileindex="' + i__i + '" class="lnkEditSubProfile" is="emby-linkbutton" href="#">';
html += "<p>" + Globalize.translate("ValueContainer").replace("{0}", profile.Container || allText) + "</p>";
if (profile.Conditions && profile.Conditions.length) {
html += "<p>";
html += Globalize.translate("ValueConditions").replace("{0}", profile.Conditions.map(function (c__o) {
return c__o.Property;
}).join(", "));
html += "</p>";
}
html += "</a>";
html += '<a is="emby-linkbutton" href="#" data-icon="delete" class="btnDeleteProfile" data-profileindex="' + i__i + '">Delete</a>';
html += "</li>";
}
html += "</ul>";
var elem = $(".containerProfiles", page).html(html).trigger("create");
$(".btnDeleteProfile", elem).on("click", function () {
var index = this.getAttribute("data-profileindex");
deleteContainerProfile(page, index);
});
$(".lnkEditSubProfile", elem).on("click", function () {
var index = parseInt(this.getAttribute("data-profileindex"));
editContainerProfile(page, currentProfile.ContainerProfiles[index]);
});
}
function deleteContainerProfile(page, index) {
currentProfile.ContainerProfiles.splice(index, 1);
renderContainerProfiles(page, currentProfile.ContainerProfiles);
}
function editContainerProfile(page, containerProfile) {
isSubProfileNew = null == containerProfile;
containerProfile = containerProfile || {};
currentSubProfile = containerProfile;
var popup = $("#containerProfilePopup", page);
$("#selectContainerProfileType", popup).val(containerProfile.Type || "Video").trigger("change");
$("#txtContainerProfileContainer", popup).val(containerProfile.Container || "");
$(".radioTabButton:first", popup).trigger("click");
openPopup(popup[0]);
}
function saveContainerProfile(page) {
currentSubProfile.Type = $("#selectContainerProfileType", page).val();
currentSubProfile.Container = $("#txtContainerProfileContainer", page).val();
if (isSubProfileNew) {
currentProfile.ContainerProfiles.push(currentSubProfile);
}
renderSubProfiles(page, currentProfile);
currentSubProfile = null;
closePopup($("#containerProfilePopup", page)[0]);
}
function renderCodecProfiles(page, profiles) {
var html = "";
html += '<ul data-role="listview" data-inset="true" data-split-icon="delete">';
var currentType;
for (var i__p = 0, length = profiles.length; i__p < length; i__p++) {
var profile = profiles[i__p];
var type = profile.Type.replace("VideoAudio", "Video Audio");
if (type !== currentType) {
html += '<li data-role="list-divider">' + type + "</li>";
currentType = type;
}
html += "<li>";
html += '<a data-profileindex="' + i__p + '" class="lnkEditSubProfile" is="emby-linkbutton" href="#">';
html += "<p>" + Globalize.translate("ValueCodec").replace("{0}", profile.Codec || allText) + "</p>";
if (profile.Conditions && profile.Conditions.length) {
html += "<p>";
html += Globalize.translate("ValueConditions").replace("{0}", profile.Conditions.map(function (c__a) {
return c__a.Property;
}).join(", "));
html += "</p>";
}
html += "</a>";
html += '<a is="emby-linkbutton" href="#" data-icon="delete" class="btnDeleteProfile" data-profileindex="' + i__p + '">Delete</a>';
html += "</li>";
}
html += "</ul>";
var elem = $(".codecProfiles", page).html(html).trigger("create");
$(".btnDeleteProfile", elem).on("click", function () {
var index = this.getAttribute("data-profileindex");
deleteCodecProfile(page, index);
});
$(".lnkEditSubProfile", elem).on("click", function () {
var index = parseInt(this.getAttribute("data-profileindex"));
editCodecProfile(page, currentProfile.CodecProfiles[index]);
});
}
function deleteCodecProfile(page, index) {
currentProfile.CodecProfiles.splice(index, 1);
renderCodecProfiles(page, currentProfile.CodecProfiles);
}
function editCodecProfile(page, codecProfile) {
isSubProfileNew = null == codecProfile;
codecProfile = codecProfile || {};
currentSubProfile = codecProfile;
var popup = $("#codecProfilePopup", page);
$("#selectCodecProfileType", popup).val(codecProfile.Type || "Video").trigger("change");
$("#txtCodecProfileCodec", popup).val(codecProfile.Codec || "");
$(".radioTabButton:first", popup).trigger("click");
openPopup(popup[0]);
}
function saveCodecProfile(page) {
currentSubProfile.Type = $("#selectCodecProfileType", page).val();
currentSubProfile.Codec = $("#txtCodecProfileCodec", page).val();
if (isSubProfileNew) {
currentProfile.CodecProfiles.push(currentSubProfile);
}
renderSubProfiles(page, currentProfile);
currentSubProfile = null;
closePopup($("#codecProfilePopup", page)[0]);
}
function renderResponseProfiles(page, profiles) {
var html = "";
html += '<ul data-role="listview" data-inset="true" data-split-icon="delete">';
var currentType;
for (var i__s = 0, length = profiles.length; i__s < length; i__s++) {
var profile = profiles[i__s];
if (profile.Type !== currentType) {
html += '<li data-role="list-divider">' + profile.Type + "</li>";
currentType = profile.Type;
}
html += "<li>";
html += '<a data-profileindex="' + i__s + '" class="lnkEditSubProfile" is="emby-linkbutton" href="#">';
html += "<p>" + Globalize.translate("ValueContainer").replace("{0}", profile.Container || allText) + "</p>";
if ("Video" == profile.Type) {
html += "<p>" + Globalize.translate("ValueVideoCodec").replace("{0}", profile.VideoCodec || allText) + "</p>";
html += "<p>" + Globalize.translate("ValueAudioCodec").replace("{0}", profile.AudioCodec || allText) + "</p>";
} else {
if ("Audio" == profile.Type) {
html += "<p>" + Globalize.translate("ValueCodec").replace("{0}", profile.AudioCodec || allText) + "</p>";
}
}
if (profile.Conditions && profile.Conditions.length) {
html += "<p>";
html += Globalize.translate("ValueConditions").replace("{0}", profile.Conditions.map(function (c__d) {
return c__d.Property;
}).join(", "));
html += "</p>";
}
html += "</a>";
html += '<a is="emby-linkbutton" href="#" data-icon="delete" class="btnDeleteProfile" data-profileindex="' + i__s + '">Delete</a>';
html += "</li>";
}
html += "</ul>";
var elem = $(".mediaProfiles", page).html(html).trigger("create");
$(".btnDeleteProfile", elem).on("click", function () {
var index = this.getAttribute("data-profileindex");
deleteResponseProfile(page, index);
});
$(".lnkEditSubProfile", elem).on("click", function () {
var index = parseInt(this.getAttribute("data-profileindex"));
editResponseProfile(page, currentProfile.ResponseProfiles[index]);
});
}
function deleteResponseProfile(page, index) {
currentProfile.ResponseProfiles.splice(index, 1);
renderResponseProfiles(page, currentProfile.ResponseProfiles);
}
function editResponseProfile(page, responseProfile) {
isSubProfileNew = null == responseProfile;
responseProfile = responseProfile || {};
currentSubProfile = responseProfile;
var popup = $("#responseProfilePopup", page);
$("#selectResponseProfileType", popup).val(responseProfile.Type || "Video").trigger("change");
$("#txtResponseProfileContainer", popup).val(responseProfile.Container || "");
$("#txtResponseProfileAudioCodec", popup).val(responseProfile.AudioCodec || "");
$("#txtResponseProfileVideoCodec", popup).val(responseProfile.VideoCodec || "");
$(".radioTabButton:first", popup).trigger("click");
openPopup(popup[0]);
}
function saveResponseProfile(page) {
currentSubProfile.Type = $("#selectResponseProfileType", page).val();
currentSubProfile.Container = $("#txtResponseProfileContainer", page).val();
currentSubProfile.AudioCodec = $("#txtResponseProfileAudioCodec", page).val();
currentSubProfile.VideoCodec = $("#txtResponseProfileVideoCodec", page).val();
if (isSubProfileNew) {
currentProfile.ResponseProfiles.push(currentSubProfile);
}
renderSubProfiles(page, currentProfile);
currentSubProfile = null;
closePopup($("#responseProfilePopup", page)[0]);
}
function saveProfile(page, profile) {
updateProfile(page, profile);
var id = getParameterByName("id");
if (id) {
ApiClient.ajax({
type: "POST",
url: ApiClient.getUrl("Dlna/Profiles/" + id),
data: JSON.stringify(profile),
contentType: "application/json"
}).then(function () {
require(["toast"], function (toast) {
toast("Settings saved.");
});
}, Dashboard.processErrorResponse);
} else {
ApiClient.ajax({
type: "POST",
url: ApiClient.getUrl("Dlna/Profiles"),
data: JSON.stringify(profile),
contentType: "application/json"
}).then(function () {
Dashboard.navigate("dlnaprofiles.html");
}, Dashboard.processErrorResponse);
}
loading.hide();
}
function updateProfile(page, profile) {
profile.Name = $("#txtName", page).val();
profile.EnableAlbumArtInDidl = $("#chkEnableAlbumArtInDidl", page).checked();
profile.EnableSingleAlbumArtLimit = $("#chkEnableSingleImageLimit", page).checked();
profile.SupportedMediaTypes = $(".chkMediaType:checked", page).get().map(function (c__f) {
return c__f.getAttribute("data-value");
}).join(",");
profile.Identification = profile.Identification || {};
profile.FriendlyName = $("#txtInfoFriendlyName", page).val();
profile.ModelName = $("#txtInfoModelName", page).val();
profile.ModelNumber = $("#txtInfoModelNumber", page).val();
profile.ModelDescription = $("#txtInfoModelDescription", page).val();
profile.ModelUrl = $("#txtInfoModelUrl", page).val();
profile.Manufacturer = $("#txtInfoManufacturer", page).val();
profile.ManufacturerUrl = $("#txtInfoManufacturerUrl", page).val();
profile.SerialNumber = $("#txtInfoSerialNumber", page).val();
profile.Identification.FriendlyName = $("#txtIdFriendlyName", page).val();
profile.Identification.ModelName = $("#txtIdModelName", page).val();
profile.Identification.ModelNumber = $("#txtIdModelNumber", page).val();
profile.Identification.ModelDescription = $("#txtIdModelDescription", page).val();
profile.Identification.ModelUrl = $("#txtIdModelUrl", page).val();
profile.Identification.Manufacturer = $("#txtIdManufacturer", page).val();
profile.Identification.ManufacturerUrl = $("#txtIdManufacturerUrl", page).val();
profile.Identification.SerialNumber = $("#txtIdSerialNumber", page).val();
profile.Identification.DeviceDescription = $("#txtIdDeviceDescription", page).val();
profile.AlbumArtPn = $("#txtAlbumArtPn", page).val();
profile.MaxAlbumArtWidth = $("#txtAlbumArtMaxWidth", page).val();
profile.MaxAlbumArtHeight = $("#txtAlbumArtMaxHeight", page).val();
profile.MaxIconWidth = $("#txtIconMaxWidth", page).val();
profile.MaxIconHeight = $("#txtIconMaxHeight", page).val();
profile.RequiresPlainFolders = $("#chkRequiresPlainFolders", page).checked();
profile.RequiresPlainVideoItems = $("#chkRequiresPlainVideoItems", page).checked();
profile.IgnoreTranscodeByteRangeRequests = $("#chkIgnoreTranscodeByteRangeRequests", page).checked();
profile.MaxStreamingBitrate = $("#txtMaxAllowedBitrate", page).val();
profile.MusicStreamingTranscodingBitrate = $("#txtMusicStreamingTranscodingBitrate", page).val();
profile.ProtocolInfo = $("#txtProtocolInfo", page).val();
profile.XDlnaCap = $("#txtXDlnaCap", page).val();
profile.XDlnaDoc = $("#txtXDlnaDoc", page).val();
profile.SonyAggregationFlags = $("#txtSonyAggregationFlags", page).val();
profile.UserId = $("#selectUser", page).val();
}
var currentProfile;
var currentSubProfile;
var isSubProfileNew;
var allText = Globalize.translate("LabelAll");
$(document).on("pageinit", "#dlnaProfilePage", function () {
var page = this;
$(".radioTabButton", page).on("click", function () {
$(this).siblings().removeClass("ui-btn-active");
$(this).addClass("ui-btn-active");
var value = "A" == this.tagName ? this.getAttribute("data-value") : this.value;
var elem = $("." + value, page);
elem.siblings(".tabContent").hide();
elem.show();
});
$("#selectDirectPlayProfileType", page).on("change", function () {
if ("Video" == this.value) {
$("#fldDirectPlayVideoCodec", page).show();
} else {
$("#fldDirectPlayVideoCodec", page).hide();
}
if ("Photo" == this.value) {
$("#fldDirectPlayAudioCodec", page).hide();
} else {
$("#fldDirectPlayAudioCodec", page).show();
}
});
$("#selectTranscodingProfileType", page).on("change", function () {
if ("Video" == this.value) {
$("#fldTranscodingVideoCodec", page).show();
$("#fldTranscodingProtocol", page).show();
$("#fldEnableMpegtsM2TsMode", page).show();
} else {
$("#fldTranscodingVideoCodec", page).hide();
$("#fldTranscodingProtocol", page).hide();
$("#fldEnableMpegtsM2TsMode", page).hide();
}
if ("Photo" == this.value) {
$("#fldTranscodingAudioCodec", page).hide();
$("#fldEstimateContentLength", page).hide();
$("#fldReportByteRangeRequests", page).hide();
} else {
$("#fldTranscodingAudioCodec", page).show();
$("#fldEstimateContentLength", page).show();
$("#fldReportByteRangeRequests", page).show();
}
});
$("#selectResponseProfileType", page).on("change", function () {
if ("Video" == this.value) {
$("#fldResponseProfileVideoCodec", page).show();
} else {
$("#fldResponseProfileVideoCodec", page).hide();
}
if ("Photo" == this.value) {
$("#fldResponseProfileAudioCodec", page).hide();
} else {
$("#fldResponseProfileAudioCodec", page).show();
}
});
$(".btnAddDirectPlayProfile", page).on("click", function () {
editDirectPlayProfile(page);
});
$(".btnAddTranscodingProfile", page).on("click", function () {
editTranscodingProfile(page);
});
$(".btnAddContainerProfile", page).on("click", function () {
editContainerProfile(page);
});
$(".btnAddCodecProfile", page).on("click", function () {
editCodecProfile(page);
});
$(".btnAddResponseProfile", page).on("click", function () {
editResponseProfile(page);
});
$(".btnAddIdentificationHttpHeader", page).on("click", function () {
editIdentificationHeader(page);
});
$(".btnAddXmlDocumentAttribute", page).on("click", function () {
editXmlDocumentAttribute(page);
});
$(".btnAddSubtitleProfile", page).on("click", function () {
editSubtitleProfile(page);
});
$(".dlnaProfileForm").off("submit", DlnaProfilePage.onSubmit).on("submit", DlnaProfilePage.onSubmit);
$(".editDirectPlayProfileForm").off("submit", DlnaProfilePage.onDirectPlayFormSubmit).on("submit", DlnaProfilePage.onDirectPlayFormSubmit);
$(".transcodingProfileForm").off("submit", DlnaProfilePage.onTranscodingProfileFormSubmit).on("submit", DlnaProfilePage.onTranscodingProfileFormSubmit);
$(".containerProfileForm").off("submit", DlnaProfilePage.onContainerProfileFormSubmit).on("submit", DlnaProfilePage.onContainerProfileFormSubmit);
$(".codecProfileForm").off("submit", DlnaProfilePage.onCodecProfileFormSubmit).on("submit", DlnaProfilePage.onCodecProfileFormSubmit);
$(".editResponseProfileForm").off("submit", DlnaProfilePage.onResponseProfileFormSubmit).on("submit", DlnaProfilePage.onResponseProfileFormSubmit);
$(".identificationHeaderForm").off("submit", DlnaProfilePage.onIdentificationHeaderFormSubmit).on("submit", DlnaProfilePage.onIdentificationHeaderFormSubmit);
$(".xmlAttributeForm").off("submit", DlnaProfilePage.onXmlAttributeFormSubmit).on("submit", DlnaProfilePage.onXmlAttributeFormSubmit);
$(".subtitleProfileForm").off("submit", DlnaProfilePage.onSubtitleProfileFormSubmit).on("submit", DlnaProfilePage.onSubtitleProfileFormSubmit);
}).on("pageshow", "#dlnaProfilePage", function () {
var page = this;
$("#radioInfo", page).trigger("click");
loadProfile(page);
});
window.DlnaProfilePage = {
onSubmit: function () {
loading.show();
saveProfile($(this).parents(".page"), currentProfile);
return false;
},
onDirectPlayFormSubmit: function () {
saveDirectPlayProfile($(this).parents(".page"));
return false;
},
onTranscodingProfileFormSubmit: function () {
saveTranscodingProfile($(this).parents(".page"));
return false;
},
onContainerProfileFormSubmit: function () {
saveContainerProfile($(this).parents(".page"));
return false;
},
onCodecProfileFormSubmit: function () {
saveCodecProfile($(this).parents(".page"));
return false;
},
onResponseProfileFormSubmit: function () {
saveResponseProfile($(this).parents(".page"));
return false;
},
onIdentificationHeaderFormSubmit: function () {
saveIdentificationHeader($(this).parents(".page"));
return false;
},
onXmlAttributeFormSubmit: function () {
saveXmlDocumentAttribute($(this).parents(".page"));
return false;
},
onSubtitleProfileFormSubmit: function () {
saveSubtitleProfile($(this).parents(".page"));
return false;
}
};
});

View file

@ -54,6 +54,7 @@ define(["jQuery", "globalize", "loading", "libraryMenu", "listViewStyle", "emby-
name: globalize.translate("TabProfiles")
}]
}
$(document).on("pageshow", "#dlnaProfilesPage", function() {
libraryMenu.setTabs("dlna", 1, getTabs), loadProfiles(this)
})

View file

@ -1,4 +1,4 @@
define(["loading"], function(loading) {
define(["loading", "scripts/editorsidebar"], function(loading) {
"use strict";
function reload(context, itemId) {

View file

@ -69,6 +69,7 @@ define(["jQuery", "loading", "globalize", "dom"], function($, loading, globalize
-1 === c.getAttribute("data-types").split(",").indexOf(value) ? dom.parentWithTag(c, "LABEL").classList.add("hide") : (dom.parentWithTag(c, "LABEL").classList.remove("hide"), any = !0)
}), any ? context.querySelector(".decodingCodecsList").classList.remove("hide") : context.querySelector(".decodingCodecsList").classList.add("hide")
}
$(document).on("pageinit", "#encodingSettingsPage", function() {
var page = this;
page.querySelector("#selectVideoDecoder").addEventListener("change", function() {

View file

@ -167,7 +167,6 @@ define(["appRouter", "cardBuilder", "dom", "globalize", "connectionManager", "ap
action: section.action,
allowBottomPadding: !enableScrollX(),
cardLayout: cardLayout,
vibrant: supportsImageAnalysis && cardLayout,
leadingButtons: leadingButtons,
lines: lines
})

View file

@ -41,7 +41,6 @@ define(["browser", "layoutManager", "userSettings", "inputManager", "loading", "
overlayPlayButton: !supportsImageAnalysis,
allowBottomPadding: !enableScrollX(),
cardLayout: supportsImageAnalysis,
vibrant: supportsImageAnalysis,
coverImage: !0
}), imageLoader.lazyChildren(elem), loading.hide()
})
@ -78,7 +77,6 @@ define(["browser", "layoutManager", "userSettings", "inputManager", "loading", "
overlayMoreButton: !supportsImageAnalysis,
allowBottomPadding: !enableScrollX(),
cardLayout: supportsImageAnalysis,
vibrant: supportsImageAnalysis,
coverImage: !0
}), imageLoader.lazyChildren(itemsContainer)
})
@ -115,7 +113,6 @@ define(["browser", "layoutManager", "userSettings", "inputManager", "loading", "
overlayMoreButton: !supportsImageAnalysis,
allowBottomPadding: !enableScrollX(),
cardLayout: supportsImageAnalysis,
vibrant: supportsImageAnalysis,
coverImage: !0
}), imageLoader.lazyChildren(itemsContainer)
})

View file

@ -1,4 +1,4 @@
<div id="dlnaProfilePage" data-role="page" class="page type-interior dlnaPage withTabs" data-require="jQuery,emby-collapse,scripts/dlnaprofile,emby-button">
<div id="dlnaProfilePage" data-role="page" class="page type-interior dlnaPage withTabs">
<div data-role="content">
<div class="content-primary">

View file

@ -1,4 +1,4 @@
<div id="dlnaProfilesPage" data-role="page" class="page type-interior dlnaPage withTabs" data-require="scripts/dlnaprofiles,emby-button">
<div id="dlnaProfilesPage" data-role="page" class="page type-interior dlnaPage withTabs">
<div>
<div class="content-primary">

View file

@ -1,4 +1,4 @@
<div id="dlnaSettingsPage" data-role="page" class="page type-interior withTabs" data-require="scripts/dlnasettings,emby-select,emby-input,emby-checkbox,emby-button">
<div id="dlnaSettingsPage" data-role="page" class="page type-interior withTabs">
<div>
<div class="content-primary">

View file

@ -1,4 +1,4 @@
<div id="editItemMetadataPage" data-role="page" class="page libraryPage metadataEditorPage noSecondaryNavPage" data-title="${MetadataManager}" data-require="scripts/editorsidebar,controllers/edititemmetadata">
<div id="editItemMetadataPage" data-role="page" class="page libraryPage metadataEditorPage noSecondaryNavPage" data-title="${MetadataManager}">
<style>
#editItemMetadataPage .editMetadataForm {

View file

@ -1,4 +1,4 @@
<div id="encodingSettingsPage" data-role="page" class="page type-interior playbackConfigurationPage" data-require="scripts/encodingsettings,emby-input,emby-checkbox,emby-button,emby-select">
<div id="encodingSettingsPage" data-role="page" class="page type-interior playbackConfigurationPage">
<div>
<div class="content-primary">

View file

@ -55,7 +55,6 @@
width: 10px;
}
</style>
</head>
<body>
<div class="backdropContainer"></div>

View file

@ -1,4 +1,4 @@
<div id="mediaLibraryPage" data-role="page" class="page type-interior mediaLibraryPage librarySectionPage withTabs fullWidthContent" data-require="scripts/medialibrarypage">
<div id="mediaLibraryPage" data-role="page" class="page type-interior mediaLibraryPage librarySectionPage withTabs fullWidthContent">
<div>
<div class="content-primary">

View file

@ -1,4 +1,4 @@
<div id="liveTvGuideProviderPage" data-role="page" class="page type-interior liveTvSettingsPage" data-require="scripts/livetvguideprovider">
<div id="liveTvGuideProviderPage" data-role="page" class="page type-interior liveTvSettingsPage">
<div>
<div class="content-primary">

View file

@ -1,4 +1,4 @@
<div id="liveTvSettingsPage" data-role="page" class="page type-interior liveTvPage" data-require="scripts/livetvsettings,emby-checkbox,emby-input,emby-select,emby-collapse,emby-button">
<div id="liveTvSettingsPage" data-role="page" class="page type-interior liveTvPage">
<div>
<div class="content-primary">
<div class="verticalSection">

View file

@ -1,4 +1,4 @@
<div id="liveTvStatusPage" data-role="page" class="page type-interior liveTvSettingsPage" data-require="scripts/livetvstatus,emby-button">
<div id="liveTvStatusPage" data-role="page" class="page type-interior liveTvSettingsPage">
<div>
<div class="content-primary">
<div class="verticalSection verticalSection-extrabottompadding">

View file

@ -1,4 +1,4 @@
<div id="metadataImagesConfigurationPage" data-role="page" class="page type-interior metadataConfigurationPage withTabs" data-require="emby-collapse,scripts/metadataimagespage,emby-checkbox,emby-button,emby-input,emby-select">
<div id="metadataImagesConfigurationPage" data-role="page" class="page type-interior metadataConfigurationPage withTabs">
<div>

View file

@ -1,4 +1,4 @@
<div id="metadataNfoPage" data-role="page" class="page type-interior metadataConfigurationPage withTabs" data-require="scripts/metadatanfo,emby-checkbox,emby-button,emby-select">
<div id="metadataNfoPage" data-role="page" class="page type-interior metadataConfigurationPage withTabs">
<div>

View file

@ -1,4 +1,4 @@
<div id="notificationSettingPage" data-role="page" class="page type-interior notificationConfigurationPage withTabs" data-require="scripts/notificationsetting,emby-select,emby-input,emby-checkbox,emby-button">
<div id="notificationSettingPage" data-role="page" class="page type-interior notificationConfigurationPage withTabs">
<div>
<div class="content-primary">

View file

@ -1,4 +1,4 @@
<div id="playbackConfigurationPage" data-role="page" class="page type-interior playbackConfigurationPage withTabs" data-require="scripts/playbackconfiguration,emby-input,emby-button">
<div id="playbackConfigurationPage" data-role="page" class="page type-interior playbackConfigurationPage withTabs">
<div>
<div class="content-primary">

View file

@ -1,371 +0,0 @@
define(["jQuery", "loading", "fnchecked", "emby-select", "emby-button", "emby-input", "emby-checkbox", "listViewStyle", "emby-button"], function($, loading) {
"use strict";
function loadProfile(page) {
loading.show();
var promise1 = getProfile(),
promise2 = ApiClient.getUsers();
Promise.all([promise1, promise2]).then(function(responses) {
currentProfile = responses[0], renderProfile(page, currentProfile, responses[1]), loading.hide()
})
}
function getProfile() {
var id = getParameterByName("id"),
url = id ? "Dlna/Profiles/" + id : "Dlna/Profiles/Default";
return ApiClient.getJSON(ApiClient.getUrl(url))
}
function renderProfile(page, profile, users) {
$("#txtName", page).val(profile.Name), $(".chkMediaType", page).each(function() {
this.checked = -1 != (profile.SupportedMediaTypes || "").split(",").indexOf(this.getAttribute("data-value"))
}), $("#chkEnableAlbumArtInDidl", page).checked(profile.EnableAlbumArtInDidl), $("#chkEnableSingleImageLimit", page).checked(profile.EnableSingleAlbumArtLimit), renderXmlDocumentAttributes(page, profile.XmlRootAttributes || []);
var idInfo = profile.Identification || {};
renderIdentificationHeaders(page, idInfo.Headers || []), renderSubtitleProfiles(page, profile.SubtitleProfiles || []), $("#txtInfoFriendlyName", page).val(profile.FriendlyName || ""), $("#txtInfoModelName", page).val(profile.ModelName || ""), $("#txtInfoModelNumber", page).val(profile.ModelNumber || ""), $("#txtInfoModelDescription", page).val(profile.ModelDescription || ""), $("#txtInfoModelUrl", page).val(profile.ModelUrl || ""), $("#txtInfoManufacturer", page).val(profile.Manufacturer || ""), $("#txtInfoManufacturerUrl", page).val(profile.ManufacturerUrl || ""), $("#txtInfoSerialNumber", page).val(profile.SerialNumber || ""), $("#txtIdFriendlyName", page).val(idInfo.FriendlyName || ""), $("#txtIdModelName", page).val(idInfo.ModelName || ""), $("#txtIdModelNumber", page).val(idInfo.ModelNumber || ""), $("#txtIdModelDescription", page).val(idInfo.ModelDescription || ""), $("#txtIdModelUrl", page).val(idInfo.ModelUrl || ""), $("#txtIdManufacturer", page).val(idInfo.Manufacturer || ""), $("#txtIdManufacturerUrl", page).val(idInfo.ManufacturerUrl || ""), $("#txtIdSerialNumber", page).val(idInfo.SerialNumber || ""), $("#txtIdDeviceDescription", page).val(idInfo.DeviceDescription || ""), $("#txtAlbumArtPn", page).val(profile.AlbumArtPn || ""), $("#txtAlbumArtMaxWidth", page).val(profile.MaxAlbumArtWidth || ""), $("#txtAlbumArtMaxHeight", page).val(profile.MaxAlbumArtHeight || ""), $("#txtIconMaxWidth", page).val(profile.MaxIconWidth || ""), $("#txtIconMaxHeight", page).val(profile.MaxIconHeight || ""), $("#chkIgnoreTranscodeByteRangeRequests", page).checked(profile.IgnoreTranscodeByteRangeRequests), $("#txtMaxAllowedBitrate", page).val(profile.MaxStreamingBitrate || ""), $("#txtMusicStreamingTranscodingBitrate", page).val(profile.MusicStreamingTranscodingBitrate || ""), $("#chkRequiresPlainFolders", page).checked(profile.RequiresPlainFolders), $("#chkRequiresPlainVideoItems", page).checked(profile.RequiresPlainVideoItems), $("#txtProtocolInfo", page).val(profile.ProtocolInfo || ""), $("#txtXDlnaCap", page).val(profile.XDlnaCap || ""), $("#txtXDlnaDoc", page).val(profile.XDlnaDoc || ""), $("#txtSonyAggregationFlags", page).val(profile.SonyAggregationFlags || ""), profile.DirectPlayProfiles = profile.DirectPlayProfiles || [], profile.TranscodingProfiles = profile.TranscodingProfiles || [], profile.ContainerProfiles = profile.ContainerProfiles || [], profile.CodecProfiles = profile.CodecProfiles || [], profile.ResponseProfiles = profile.ResponseProfiles || [];
var usersHtml = "<option></option>" + users.map(function(u) {
return '<option value="' + u.Id + '">' + u.Name + "</option>"
}).join("");
$("#selectUser", page).html(usersHtml).val(profile.UserId || ""), renderSubProfiles(page, profile)
}
function renderIdentificationHeaders(page, headers) {
var index = 0,
html = '<div class="paperList">' + headers.map(function(h) {
var li = '<div class="listItem">';
return li += '<i class="md-icon listItemIcon">info</i>', li += '<div class="listItemBody">', li += '<h3 class="listItemBodyText">' + h.Name + ": " + (h.Value || "") + "</h3>", li += '<div class="listItemBodyText secondary">' + (h.Match || "") + "</div>", li += "</div>", li += '<button type="button" is="paper-icon-button-light" class="btnDeleteIdentificationHeader listItemButton" data-index="' + index + '"><i class="md-icon">delete</i></button>', li += "</div>", index++, li
}).join("") + "</div>",
elem = $(".httpHeaderIdentificationList", page).html(html).trigger("create");
$(".btnDeleteIdentificationHeader", elem).on("click", function() {
var itemIndex = parseInt(this.getAttribute("data-index"));
currentProfile.Identification.Headers.splice(itemIndex, 1), renderIdentificationHeaders(page, currentProfile.Identification.Headers)
})
}
function openPopup(elem) {
elem.classList.remove("hide")
}
function closePopup(elem) {
elem.classList.add("hide")
}
function editIdentificationHeader(page, header) {
isSubProfileNew = null == header, header = header || {}, currentSubProfile = header;
var popup = $("#identificationHeaderPopup", page);
$("#txtIdentificationHeaderName", popup).val(header.Name || ""), $("#txtIdentificationHeaderValue", popup).val(header.Value || ""), $("#selectMatchType", popup).val(header.Match || "Equals"), openPopup(popup[0])
}
function saveIdentificationHeader(page) {
currentSubProfile.Name = $("#txtIdentificationHeaderName", page).val(), currentSubProfile.Value = $("#txtIdentificationHeaderValue", page).val(), currentSubProfile.Match = $("#selectMatchType", page).val(), isSubProfileNew && (currentProfile.Identification = currentProfile.Identification || {}, currentProfile.Identification.Headers = currentProfile.Identification.Headers || [], currentProfile.Identification.Headers.push(currentSubProfile)), renderIdentificationHeaders(page, currentProfile.Identification.Headers), currentSubProfile = null, closePopup($("#identificationHeaderPopup", page)[0])
}
function renderXmlDocumentAttributes(page, attribute) {
var html = '<div class="paperList">' + attribute.map(function(h) {
var li = '<div class="listItem">';
return li += '<i class="md-icon listItemIcon">info</i>', li += '<div class="listItemBody">', li += '<h3 class="listItemBodyText">' + h.Name + " = " + (h.Value || "") + "</h3>", li += "</div>", li += '<button type="button" is="paper-icon-button-light" class="btnDeleteXmlAttribute listItemButton" data-index="0"><i class="md-icon">delete</i></button>', li += "</div>"
}).join("") + "</div>",
elem = $(".xmlDocumentAttributeList", page).html(html).trigger("create");
$(".btnDeleteXmlAttribute", elem).on("click", function() {
var itemIndex = parseInt(this.getAttribute("data-index"));
currentProfile.XmlRootAttributes.splice(itemIndex, 1), renderXmlDocumentAttributes(page, currentProfile.XmlRootAttributes)
})
}
function editXmlDocumentAttribute(page, attribute) {
isSubProfileNew = null == attribute, attribute = attribute || {}, currentSubProfile = attribute;
var popup = $("#xmlAttributePopup", page);
$("#txtXmlAttributeName", popup).val(attribute.Name || ""), $("#txtXmlAttributeValue", popup).val(attribute.Value || ""), openPopup(popup[0])
}
function saveXmlDocumentAttribute(page) {
currentSubProfile.Name = $("#txtXmlAttributeName", page).val(), currentSubProfile.Value = $("#txtXmlAttributeValue", page).val(), isSubProfileNew && currentProfile.XmlRootAttributes.push(currentSubProfile), renderXmlDocumentAttributes(page, currentProfile.XmlRootAttributes), currentSubProfile = null, closePopup($("#xmlAttributePopup", page)[0])
}
function renderSubtitleProfiles(page, profiles) {
var index = 0,
html = '<div class="paperList">' + profiles.map(function(h) {
var li = '<div class="listItem lnkEditSubProfile" data-index="' + index + '">';
return li += '<i class="md-icon listItemIcon">info</i>', li += '<div class="listItemBody">', li += '<h3 class="listItemBodyText">' + (h.Format || "") + "</h3>", li += "</div>", li += '<button type="button" is="paper-icon-button-light" class="btnDeleteProfile listItemButton" data-index="' + index + '"><i class="md-icon">delete</i></button>', li += "</div>", index++, li
}).join("") + "</div>",
elem = $(".subtitleProfileList", page).html(html).trigger("create");
$(".btnDeleteProfile", elem).on("click", function() {
var itemIndex = parseInt(this.getAttribute("data-index"));
currentProfile.SubtitleProfiles.splice(itemIndex, 1), renderSubtitleProfiles(page, currentProfile.SubtitleProfiles)
}), $(".lnkEditSubProfile", elem).on("click", function() {
var itemIndex = parseInt(this.getAttribute("data-index"));
editSubtitleProfile(page, currentProfile.SubtitleProfiles[itemIndex])
})
}
function editSubtitleProfile(page, profile) {
isSubProfileNew = null == profile, profile = profile || {}, currentSubProfile = profile;
var popup = $("#subtitleProfilePopup", page);
$("#txtSubtitleProfileFormat", popup).val(profile.Format || ""), $("#selectSubtitleProfileMethod", popup).val(profile.Method || ""), $("#selectSubtitleProfileDidlMode", popup).val(profile.DidlMode || ""), openPopup(popup[0])
}
function saveSubtitleProfile(page) {
currentSubProfile.Format = $("#txtSubtitleProfileFormat", page).val(), currentSubProfile.Method = $("#selectSubtitleProfileMethod", page).val(), currentSubProfile.DidlMode = $("#selectSubtitleProfileDidlMode", page).val(), isSubProfileNew && currentProfile.SubtitleProfiles.push(currentSubProfile), renderSubtitleProfiles(page, currentProfile.SubtitleProfiles), currentSubProfile = null, closePopup($("#subtitleProfilePopup", page)[0])
}
function renderSubProfiles(page, profile) {
renderDirectPlayProfiles(page, profile.DirectPlayProfiles), renderTranscodingProfiles(page, profile.TranscodingProfiles), renderContainerProfiles(page, profile.ContainerProfiles), renderCodecProfiles(page, profile.CodecProfiles), renderResponseProfiles(page, profile.ResponseProfiles)
}
function saveDirectPlayProfile(page) {
currentSubProfile.Type = $("#selectDirectPlayProfileType", page).val(), currentSubProfile.Container = $("#txtDirectPlayContainer", page).val(), currentSubProfile.AudioCodec = $("#txtDirectPlayAudioCodec", page).val(), currentSubProfile.VideoCodec = $("#txtDirectPlayVideoCodec", page).val(), isSubProfileNew && currentProfile.DirectPlayProfiles.push(currentSubProfile), renderSubProfiles(page, currentProfile), currentSubProfile = null, closePopup($("#popupEditDirectPlayProfile", page)[0])
}
function renderDirectPlayProfiles(page, profiles) {
var html = "";
html += '<ul data-role="listview" data-inset="true" data-split-icon="delete">';
for (var currentType, i = 0, length = profiles.length; i < length; i++) {
var profile = profiles[i];
profile.Type !== currentType && (html += '<li data-role="list-divider">' + profile.Type + "</li>", currentType = profile.Type), html += "<li>", html += '<a data-profileindex="' + i + '" class="lnkEditSubProfile" is="emby-linkbutton" href="#">', html += "<p>" + Globalize.translate("ValueContainer").replace("{0}", profile.Container || allText) + "</p>", "Video" == profile.Type ? (html += "<p>" + Globalize.translate("ValueVideoCodec").replace("{0}", profile.VideoCodec || allText) + "</p>", html += "<p>" + Globalize.translate("ValueAudioCodec").replace("{0}", profile.AudioCodec || allText) + "</p>") : "Audio" == profile.Type && (html += "<p>" + Globalize.translate("ValueCodec").replace("{0}", profile.AudioCodec || allText) + "</p>"), html += "</a>", html += '<a is="emby-linkbutton" href="#" data-icon="delete" class="btnDeleteProfile" data-profileindex="' + i + '">Delete</a>', html += "</li>"
}
html += "</ul>";
var elem = $(".directPlayProfiles", page).html(html).trigger("create");
$(".btnDeleteProfile", elem).on("click", function() {
var index = this.getAttribute("data-profileindex");
deleteDirectPlayProfile(page, index)
}), $(".lnkEditSubProfile", elem).on("click", function() {
var index = parseInt(this.getAttribute("data-profileindex"));
editDirectPlayProfile(page, currentProfile.DirectPlayProfiles[index])
})
}
function deleteDirectPlayProfile(page, index) {
currentProfile.DirectPlayProfiles.splice(index, 1), renderDirectPlayProfiles(page, currentProfile.DirectPlayProfiles)
}
function editDirectPlayProfile(page, directPlayProfile) {
isSubProfileNew = null == directPlayProfile, directPlayProfile = directPlayProfile || {}, currentSubProfile = directPlayProfile;
var popup = $("#popupEditDirectPlayProfile", page);
$("#selectDirectPlayProfileType", popup).val(directPlayProfile.Type || "Video").trigger("change"), $("#txtDirectPlayContainer", popup).val(directPlayProfile.Container || ""), $("#txtDirectPlayAudioCodec", popup).val(directPlayProfile.AudioCodec || ""), $("#txtDirectPlayVideoCodec", popup).val(directPlayProfile.VideoCodec || ""), openPopup(popup[0])
}
function renderTranscodingProfiles(page, profiles) {
var html = "";
html += '<ul data-role="listview" data-inset="true" data-split-icon="delete">';
for (var currentType, i = 0, length = profiles.length; i < length; i++) {
var profile = profiles[i];
profile.Type !== currentType && (html += '<li data-role="list-divider">' + profile.Type + "</li>", currentType = profile.Type), html += "<li>", html += '<a data-profileindex="' + i + '" class="lnkEditSubProfile" is="emby-linkbutton" href="#">', html += "<p>Protocol: " + (profile.Protocol || "Http") + "</p>", html += "<p>" + Globalize.translate("ValueContainer").replace("{0}", profile.Container || allText) + "</p>", "Video" == profile.Type ? (html += "<p>" + Globalize.translate("ValueVideoCodec").replace("{0}", profile.VideoCodec || allText) + "</p>", html += "<p>" + Globalize.translate("ValueAudioCodec").replace("{0}", profile.AudioCodec || allText) + "</p>") : "Audio" == profile.Type && (html += "<p>" + Globalize.translate("ValueCodec").replace("{0}", profile.AudioCodec || allText) + "</p>"), html += "</a>", html += '<a is="emby-linkbutton" href="#" data-icon="delete" class="btnDeleteProfile" data-profileindex="' + i + '">Delete</a>', html += "</li>"
}
html += "</ul>";
var elem = $(".transcodingProfiles", page).html(html).trigger("create");
$(".btnDeleteProfile", elem).on("click", function() {
var index = this.getAttribute("data-profileindex");
deleteTranscodingProfile(page, index)
}), $(".lnkEditSubProfile", elem).on("click", function() {
var index = parseInt(this.getAttribute("data-profileindex"));
editTranscodingProfile(page, currentProfile.TranscodingProfiles[index])
})
}
function editTranscodingProfile(page, transcodingProfile) {
isSubProfileNew = null == transcodingProfile, transcodingProfile = transcodingProfile || {}, currentSubProfile = transcodingProfile;
var popup = $("#transcodingProfilePopup", page);
$("#selectTranscodingProfileType", popup).val(transcodingProfile.Type || "Video").trigger("change"), $("#txtTranscodingContainer", popup).val(transcodingProfile.Container || ""), $("#txtTranscodingAudioCodec", popup).val(transcodingProfile.AudioCodec || ""), $("#txtTranscodingVideoCodec", popup).val(transcodingProfile.VideoCodec || ""), $("#selectTranscodingProtocol", popup).val(transcodingProfile.Protocol || "Http"), $("#chkEnableMpegtsM2TsMode", popup).checked(transcodingProfile.EnableMpegtsM2TsMode || !1), $("#chkEstimateContentLength", popup).checked(transcodingProfile.EstimateContentLength || !1), $("#chkReportByteRangeRequests", popup).checked("Bytes" == transcodingProfile.TranscodeSeekInfo), $(".radioTabButton:first", popup).trigger("click"), openPopup(popup[0])
}
function deleteTranscodingProfile(page, index) {
currentProfile.TranscodingProfiles.splice(index, 1), renderTranscodingProfiles(page, currentProfile.TranscodingProfiles)
}
function saveTranscodingProfile(page) {
currentSubProfile.Type = $("#selectTranscodingProfileType", page).val(), currentSubProfile.Container = $("#txtTranscodingContainer", page).val(), currentSubProfile.AudioCodec = $("#txtTranscodingAudioCodec", page).val(), currentSubProfile.VideoCodec = $("#txtTranscodingVideoCodec", page).val(), currentSubProfile.Protocol = $("#selectTranscodingProtocol", page).val(), currentSubProfile.Context = "Streaming", currentSubProfile.EnableMpegtsM2TsMode = $("#chkEnableMpegtsM2TsMode", page).checked(), currentSubProfile.EstimateContentLength = $("#chkEstimateContentLength", page).checked(), currentSubProfile.TranscodeSeekInfo = $("#chkReportByteRangeRequests", page).checked() ? "Bytes" : "Auto", isSubProfileNew && currentProfile.TranscodingProfiles.push(currentSubProfile), renderSubProfiles(page, currentProfile), currentSubProfile = null, closePopup($("#transcodingProfilePopup", page)[0])
}
function renderContainerProfiles(page, profiles) {
var html = "";
html += '<ul data-role="listview" data-inset="true" data-split-icon="delete">';
for (var currentType, i = 0, length = profiles.length; i < length; i++) {
var profile = profiles[i];
profile.Type !== currentType && (html += '<li data-role="list-divider">' + profile.Type + "</li>", currentType = profile.Type), html += "<li>", html += '<a data-profileindex="' + i + '" class="lnkEditSubProfile" is="emby-linkbutton" href="#">', html += "<p>" + Globalize.translate("ValueContainer").replace("{0}", profile.Container || allText) + "</p>", profile.Conditions && profile.Conditions.length && (html += "<p>", html += Globalize.translate("ValueConditions").replace("{0}", profile.Conditions.map(function(c) {
return c.Property
}).join(", ")), html += "</p>"), html += "</a>", html += '<a is="emby-linkbutton" href="#" data-icon="delete" class="btnDeleteProfile" data-profileindex="' + i + '">Delete</a>', html += "</li>"
}
html += "</ul>";
var elem = $(".containerProfiles", page).html(html).trigger("create");
$(".btnDeleteProfile", elem).on("click", function() {
var index = this.getAttribute("data-profileindex");
deleteContainerProfile(page, index)
}), $(".lnkEditSubProfile", elem).on("click", function() {
var index = parseInt(this.getAttribute("data-profileindex"));
editContainerProfile(page, currentProfile.ContainerProfiles[index])
})
}
function deleteContainerProfile(page, index) {
currentProfile.ContainerProfiles.splice(index, 1), renderContainerProfiles(page, currentProfile.ContainerProfiles)
}
function editContainerProfile(page, containerProfile) {
isSubProfileNew = null == containerProfile, containerProfile = containerProfile || {}, currentSubProfile = containerProfile;
var popup = $("#containerProfilePopup", page);
$("#selectContainerProfileType", popup).val(containerProfile.Type || "Video").trigger("change"), $("#txtContainerProfileContainer", popup).val(containerProfile.Container || ""), $(".radioTabButton:first", popup).trigger("click"), openPopup(popup[0])
}
function saveContainerProfile(page) {
currentSubProfile.Type = $("#selectContainerProfileType", page).val(), currentSubProfile.Container = $("#txtContainerProfileContainer", page).val(), isSubProfileNew && currentProfile.ContainerProfiles.push(currentSubProfile), renderSubProfiles(page, currentProfile), currentSubProfile = null, closePopup($("#containerProfilePopup", page)[0])
}
function renderCodecProfiles(page, profiles) {
var html = "";
html += '<ul data-role="listview" data-inset="true" data-split-icon="delete">';
for (var currentType, i = 0, length = profiles.length; i < length; i++) {
var profile = profiles[i],
type = profile.Type.replace("VideoAudio", "Video Audio");
type !== currentType && (html += '<li data-role="list-divider">' + type + "</li>", currentType = type), html += "<li>", html += '<a data-profileindex="' + i + '" class="lnkEditSubProfile" is="emby-linkbutton" href="#">', html += "<p>" + Globalize.translate("ValueCodec").replace("{0}", profile.Codec || allText) + "</p>", profile.Conditions && profile.Conditions.length && (html += "<p>", html += Globalize.translate("ValueConditions").replace("{0}", profile.Conditions.map(function(c) {
return c.Property
}).join(", ")), html += "</p>"), html += "</a>", html += '<a is="emby-linkbutton" href="#" data-icon="delete" class="btnDeleteProfile" data-profileindex="' + i + '">Delete</a>', html += "</li>"
}
html += "</ul>";
var elem = $(".codecProfiles", page).html(html).trigger("create");
$(".btnDeleteProfile", elem).on("click", function() {
var index = this.getAttribute("data-profileindex");
deleteCodecProfile(page, index)
}), $(".lnkEditSubProfile", elem).on("click", function() {
var index = parseInt(this.getAttribute("data-profileindex"));
editCodecProfile(page, currentProfile.CodecProfiles[index])
})
}
function deleteCodecProfile(page, index) {
currentProfile.CodecProfiles.splice(index, 1), renderCodecProfiles(page, currentProfile.CodecProfiles)
}
function editCodecProfile(page, codecProfile) {
isSubProfileNew = null == codecProfile, codecProfile = codecProfile || {}, currentSubProfile = codecProfile;
var popup = $("#codecProfilePopup", page);
$("#selectCodecProfileType", popup).val(codecProfile.Type || "Video").trigger("change"), $("#txtCodecProfileCodec", popup).val(codecProfile.Codec || ""), $(".radioTabButton:first", popup).trigger("click"), openPopup(popup[0])
}
function saveCodecProfile(page) {
currentSubProfile.Type = $("#selectCodecProfileType", page).val(), currentSubProfile.Codec = $("#txtCodecProfileCodec", page).val(), isSubProfileNew && currentProfile.CodecProfiles.push(currentSubProfile), renderSubProfiles(page, currentProfile), currentSubProfile = null, closePopup($("#codecProfilePopup", page)[0])
}
function renderResponseProfiles(page, profiles) {
var html = "";
html += '<ul data-role="listview" data-inset="true" data-split-icon="delete">';
for (var currentType, i = 0, length = profiles.length; i < length; i++) {
var profile = profiles[i];
profile.Type !== currentType && (html += '<li data-role="list-divider">' + profile.Type + "</li>", currentType = profile.Type), html += "<li>", html += '<a data-profileindex="' + i + '" class="lnkEditSubProfile" is="emby-linkbutton" href="#">', html += "<p>" + Globalize.translate("ValueContainer").replace("{0}", profile.Container || allText) + "</p>", "Video" == profile.Type ? (html += "<p>" + Globalize.translate("ValueVideoCodec").replace("{0}", profile.VideoCodec || allText) + "</p>", html += "<p>" + Globalize.translate("ValueAudioCodec").replace("{0}", profile.AudioCodec || allText) + "</p>") : "Audio" == profile.Type && (html += "<p>" + Globalize.translate("ValueCodec").replace("{0}", profile.AudioCodec || allText) + "</p>"), profile.Conditions && profile.Conditions.length && (html += "<p>", html += Globalize.translate("ValueConditions").replace("{0}", profile.Conditions.map(function(c) {
return c.Property
}).join(", ")), html += "</p>"), html += "</a>", html += '<a is="emby-linkbutton" href="#" data-icon="delete" class="btnDeleteProfile" data-profileindex="' + i + '">Delete</a>', html += "</li>"
}
html += "</ul>";
var elem = $(".mediaProfiles", page).html(html).trigger("create");
$(".btnDeleteProfile", elem).on("click", function() {
var index = this.getAttribute("data-profileindex");
deleteResponseProfile(page, index)
}), $(".lnkEditSubProfile", elem).on("click", function() {
var index = parseInt(this.getAttribute("data-profileindex"));
editResponseProfile(page, currentProfile.ResponseProfiles[index])
})
}
function deleteResponseProfile(page, index) {
currentProfile.ResponseProfiles.splice(index, 1), renderResponseProfiles(page, currentProfile.ResponseProfiles)
}
function editResponseProfile(page, responseProfile) {
isSubProfileNew = null == responseProfile, responseProfile = responseProfile || {}, currentSubProfile = responseProfile;
var popup = $("#responseProfilePopup", page);
$("#selectResponseProfileType", popup).val(responseProfile.Type || "Video").trigger("change"), $("#txtResponseProfileContainer", popup).val(responseProfile.Container || ""), $("#txtResponseProfileAudioCodec", popup).val(responseProfile.AudioCodec || ""), $("#txtResponseProfileVideoCodec", popup).val(responseProfile.VideoCodec || ""), $(".radioTabButton:first", popup).trigger("click"), openPopup(popup[0])
}
function saveResponseProfile(page) {
currentSubProfile.Type = $("#selectResponseProfileType", page).val(), currentSubProfile.Container = $("#txtResponseProfileContainer", page).val(), currentSubProfile.AudioCodec = $("#txtResponseProfileAudioCodec", page).val(), currentSubProfile.VideoCodec = $("#txtResponseProfileVideoCodec", page).val(), isSubProfileNew && currentProfile.ResponseProfiles.push(currentSubProfile), renderSubProfiles(page, currentProfile), currentSubProfile = null, closePopup($("#responseProfilePopup", page)[0])
}
function saveProfile(page, profile) {
updateProfile(page, profile);
var id = getParameterByName("id");
id ? ApiClient.ajax({
type: "POST",
url: ApiClient.getUrl("Dlna/Profiles/" + id),
data: JSON.stringify(profile),
contentType: "application/json"
}).then(function() {
require(["toast"], function(toast) {
toast("Settings saved.")
})
}, Dashboard.processErrorResponse) : ApiClient.ajax({
type: "POST",
url: ApiClient.getUrl("Dlna/Profiles"),
data: JSON.stringify(profile),
contentType: "application/json"
}).then(function() {
Dashboard.navigate("dlnaprofiles.html")
}, Dashboard.processErrorResponse), loading.hide()
}
function updateProfile(page, profile) {
profile.Name = $("#txtName", page).val(), profile.EnableAlbumArtInDidl = $("#chkEnableAlbumArtInDidl", page).checked(), profile.EnableSingleAlbumArtLimit = $("#chkEnableSingleImageLimit", page).checked(), profile.SupportedMediaTypes = $(".chkMediaType:checked", page).get().map(function(c) {
return c.getAttribute("data-value")
}).join(","), profile.Identification = profile.Identification || {}, profile.FriendlyName = $("#txtInfoFriendlyName", page).val(), profile.ModelName = $("#txtInfoModelName", page).val(), profile.ModelNumber = $("#txtInfoModelNumber", page).val(), profile.ModelDescription = $("#txtInfoModelDescription", page).val(), profile.ModelUrl = $("#txtInfoModelUrl", page).val(), profile.Manufacturer = $("#txtInfoManufacturer", page).val(), profile.ManufacturerUrl = $("#txtInfoManufacturerUrl", page).val(), profile.SerialNumber = $("#txtInfoSerialNumber", page).val(), profile.Identification.FriendlyName = $("#txtIdFriendlyName", page).val(), profile.Identification.ModelName = $("#txtIdModelName", page).val(), profile.Identification.ModelNumber = $("#txtIdModelNumber", page).val(), profile.Identification.ModelDescription = $("#txtIdModelDescription", page).val(), profile.Identification.ModelUrl = $("#txtIdModelUrl", page).val(), profile.Identification.Manufacturer = $("#txtIdManufacturer", page).val(), profile.Identification.ManufacturerUrl = $("#txtIdManufacturerUrl", page).val(), profile.Identification.SerialNumber = $("#txtIdSerialNumber", page).val(), profile.Identification.DeviceDescription = $("#txtIdDeviceDescription", page).val(), profile.AlbumArtPn = $("#txtAlbumArtPn", page).val(), profile.MaxAlbumArtWidth = $("#txtAlbumArtMaxWidth", page).val(), profile.MaxAlbumArtHeight = $("#txtAlbumArtMaxHeight", page).val(), profile.MaxIconWidth = $("#txtIconMaxWidth", page).val(), profile.MaxIconHeight = $("#txtIconMaxHeight", page).val(), profile.RequiresPlainFolders = $("#chkRequiresPlainFolders", page).checked(), profile.RequiresPlainVideoItems = $("#chkRequiresPlainVideoItems", page).checked(), profile.IgnoreTranscodeByteRangeRequests = $("#chkIgnoreTranscodeByteRangeRequests", page).checked(), profile.MaxStreamingBitrate = $("#txtMaxAllowedBitrate", page).val(), profile.MusicStreamingTranscodingBitrate = $("#txtMusicStreamingTranscodingBitrate", page).val(), profile.ProtocolInfo = $("#txtProtocolInfo", page).val(), profile.XDlnaCap = $("#txtXDlnaCap", page).val(), profile.XDlnaDoc = $("#txtXDlnaDoc", page).val(), profile.SonyAggregationFlags = $("#txtSonyAggregationFlags", page).val(), profile.UserId = $("#selectUser", page).val()
}
var currentProfile, currentSubProfile, isSubProfileNew, allText = Globalize.translate("LabelAll");
$(document).on("pageinit", "#dlnaProfilePage", function() {
var page = this;
$(".radioTabButton", page).on("click", function() {
$(this).siblings().removeClass("ui-btn-active"), $(this).addClass("ui-btn-active");
var value = "A" == this.tagName ? this.getAttribute("data-value") : this.value,
elem = $("." + value, page);
elem.siblings(".tabContent").hide(), elem.show()
}), $("#selectDirectPlayProfileType", page).on("change", function() {
"Video" == this.value ? $("#fldDirectPlayVideoCodec", page).show() : $("#fldDirectPlayVideoCodec", page).hide(), "Photo" == this.value ? $("#fldDirectPlayAudioCodec", page).hide() : $("#fldDirectPlayAudioCodec", page).show()
}), $("#selectTranscodingProfileType", page).on("change", function() {
"Video" == this.value ? ($("#fldTranscodingVideoCodec", page).show(), $("#fldTranscodingProtocol", page).show(), $("#fldEnableMpegtsM2TsMode", page).show()) : ($("#fldTranscodingVideoCodec", page).hide(), $("#fldTranscodingProtocol", page).hide(), $("#fldEnableMpegtsM2TsMode", page).hide()), "Photo" == this.value ? ($("#fldTranscodingAudioCodec", page).hide(), $("#fldEstimateContentLength", page).hide(), $("#fldReportByteRangeRequests", page).hide()) : ($("#fldTranscodingAudioCodec", page).show(), $("#fldEstimateContentLength", page).show(), $("#fldReportByteRangeRequests", page).show())
}), $("#selectResponseProfileType", page).on("change", function() {
"Video" == this.value ? $("#fldResponseProfileVideoCodec", page).show() : $("#fldResponseProfileVideoCodec", page).hide(), "Photo" == this.value ? $("#fldResponseProfileAudioCodec", page).hide() : $("#fldResponseProfileAudioCodec", page).show()
}), $(".btnAddDirectPlayProfile", page).on("click", function() {
editDirectPlayProfile(page)
}), $(".btnAddTranscodingProfile", page).on("click", function() {
editTranscodingProfile(page)
}), $(".btnAddContainerProfile", page).on("click", function() {
editContainerProfile(page)
}), $(".btnAddCodecProfile", page).on("click", function() {
editCodecProfile(page)
}), $(".btnAddResponseProfile", page).on("click", function() {
editResponseProfile(page)
}), $(".btnAddIdentificationHttpHeader", page).on("click", function() {
editIdentificationHeader(page)
}), $(".btnAddXmlDocumentAttribute", page).on("click", function() {
editXmlDocumentAttribute(page)
}), $(".btnAddSubtitleProfile", page).on("click", function() {
editSubtitleProfile(page)
}), $(".dlnaProfileForm").off("submit", DlnaProfilePage.onSubmit).on("submit", DlnaProfilePage.onSubmit), $(".editDirectPlayProfileForm").off("submit", DlnaProfilePage.onDirectPlayFormSubmit).on("submit", DlnaProfilePage.onDirectPlayFormSubmit), $(".transcodingProfileForm").off("submit", DlnaProfilePage.onTranscodingProfileFormSubmit).on("submit", DlnaProfilePage.onTranscodingProfileFormSubmit), $(".containerProfileForm").off("submit", DlnaProfilePage.onContainerProfileFormSubmit).on("submit", DlnaProfilePage.onContainerProfileFormSubmit), $(".codecProfileForm").off("submit", DlnaProfilePage.onCodecProfileFormSubmit).on("submit", DlnaProfilePage.onCodecProfileFormSubmit), $(".editResponseProfileForm").off("submit", DlnaProfilePage.onResponseProfileFormSubmit).on("submit", DlnaProfilePage.onResponseProfileFormSubmit), $(".identificationHeaderForm").off("submit", DlnaProfilePage.onIdentificationHeaderFormSubmit).on("submit", DlnaProfilePage.onIdentificationHeaderFormSubmit), $(".xmlAttributeForm").off("submit", DlnaProfilePage.onXmlAttributeFormSubmit).on("submit", DlnaProfilePage.onXmlAttributeFormSubmit), $(".subtitleProfileForm").off("submit", DlnaProfilePage.onSubtitleProfileFormSubmit).on("submit", DlnaProfilePage.onSubtitleProfileFormSubmit)
}).on("pageshow", "#dlnaProfilePage", function() {
var page = this;
$("#radioInfo", page).trigger("click"), loadProfile(page)
}), window.DlnaProfilePage = {
onSubmit: function() {
return loading.show(), saveProfile($(this).parents(".page"), currentProfile), !1
},
onDirectPlayFormSubmit: function() {
return saveDirectPlayProfile($(this).parents(".page")), !1
},
onTranscodingProfileFormSubmit: function() {
return saveTranscodingProfile($(this).parents(".page")), !1
},
onContainerProfileFormSubmit: function() {
return saveContainerProfile($(this).parents(".page")), !1
},
onCodecProfileFormSubmit: function() {
return saveCodecProfile($(this).parents(".page")), !1
},
onResponseProfileFormSubmit: function() {
return saveResponseProfile($(this).parents(".page")), !1
},
onIdentificationHeaderFormSubmit: function() {
return saveIdentificationHeader($(this).parents(".page")), !1
},
onXmlAttributeFormSubmit: function() {
return saveXmlDocumentAttribute($(this).parents(".page")), !1
},
onSubtitleProfileFormSubmit: function() {
return saveSubtitleProfile($(this).parents(".page")), !1
}
}
});

View file

@ -15,7 +15,6 @@ define(["layoutManager", "loading", "cardBuilder", "apphost", "imageLoader", "sc
coverImage: !0,
cardLayout: !1,
centerText: !0,
vibrant: !1,
allowBottomPadding: !scrollX,
preferThumb: "auto",
overlayText: !1

View file

@ -19,7 +19,6 @@ define(["layoutManager", "cardBuilder", "apphost", "imageLoader", "loading", "sc
coverImage: !0,
cardLayout: cardLayout,
centerText: !cardLayout,
vibrant: cardLayout && supportsImageAnalysis,
allowBottomPadding: !enableScrollX(),
preferThumb: "auto"
}, cardOptions || {})), imageLoader.lazyChildren(recordingItems)

View file

@ -80,8 +80,7 @@ define(["loading", "events", "libraryBrowser", "imageLoader", "listView", "cardB
context: "movies",
lazy: !0,
cardLayout: !0,
showTitle: !0,
vibrant: !0
showTitle: !0
}) : "Banner" == viewStyle ? cardBuilder.getCardsHtml({
items: result.Items,
shape: "banner",
@ -98,8 +97,7 @@ define(["loading", "events", "libraryBrowser", "imageLoader", "listView", "cardB
context: "movies",
showTitle: !0,
centerText: !1,
cardLayout: !0,
vibrant: !0
cardLayout: !0
}) : cardBuilder.getCardsHtml({
items: result.Items,
shape: "auto",

View file

@ -80,7 +80,6 @@ define(["layoutManager", "loading", "libraryBrowser", "cardBuilder", "lazyLoader
scalable: !0,
centerText: !1,
cardLayout: !0,
vibrant: supportsImageAnalysis,
showYear: !0
}) : "PosterCard" == viewStyle ? cardBuilder.buildCards(result.Items, {
itemsContainer: elem,
@ -89,7 +88,6 @@ define(["layoutManager", "loading", "libraryBrowser", "cardBuilder", "lazyLoader
scalable: !0,
centerText: !1,
cardLayout: !0,
vibrant: supportsImageAnalysis,
showYear: !0
}) : "Poster" == viewStyle && cardBuilder.buildCards(result.Items, {
itemsContainer: elem,

View file

@ -67,8 +67,7 @@ define(["layoutManager", "loading", "events", "libraryBrowser", "imageLoader", "
context: "movies",
cardLayout: !0,
showTitle: !0,
showYear: !0,
vibrant: !0
showYear: !0
}) : "Banner" == viewStyle ? cardBuilder.getCardsHtml({
items: result.Items,
shape: "banner",
@ -84,8 +83,7 @@ define(["layoutManager", "loading", "events", "libraryBrowser", "imageLoader", "
context: "movies",
showTitle: !0,
showYear: !0,
cardLayout: !0,
vibrant: !0
cardLayout: !0
}) : cardBuilder.getCardsHtml({
items: result.Items,
shape: "portrait",

View file

@ -49,15 +49,13 @@ define(["libraryBrowser", "cardBuilder", "apphost", "imageLoader", "loading"], f
preferThumb: !0,
context: "music",
cardLayout: !0,
showTitle: !0,
vibrant: !0
showTitle: !0
}) : "PosterCard" == viewStyle ? html = cardBuilder.getCardsHtml({
items: result.Items,
shape: "auto",
context: "music",
cardLayout: !0,
showTitle: !0,
vibrant: !0
showTitle: !0
}) : "Poster" == viewStyle && (html = cardBuilder.getCardsHtml({
items: result.Items,
shape: "auto",

View file

@ -43,8 +43,7 @@ define(["libraryBrowser", "cardBuilder", "apphost", "imageLoader", "loading"], f
centerText: !0,
overlayPlayButton: !0,
allowBottomPadding: !0,
cardLayout: !1,
vibrant: !1
cardLayout: !1
});
var elem = context.querySelector("#items");
elem.innerHTML = html, imageLoader.lazyChildren(elem), libraryBrowser.saveQueryValues(getSavedQueryKey(), query), loading.hide()

View file

@ -69,8 +69,7 @@ define(["loading", "listView", "cardBuilder", "libraryMenu", "libraryBrowser", "
shape: "square",
coverImage: !0,
showTitle: !0,
cardLayout: !0,
vibrant: !0
cardLayout: !0
}) : "Thumb" == viewStyle ? cardBuilder.getCardsHtml({
items: result.Items,
shape: "backdrop",
@ -83,8 +82,7 @@ define(["loading", "listView", "cardBuilder", "libraryMenu", "libraryBrowser", "
shape: "backdrop",
showTitle: !0,
preferThumb: !0,
cardLayout: !0,
vibrant: !0
cardLayout: !0
}) : cardBuilder.getCardsHtml({
items: result.Items,
shape: "square",

View file

@ -1,4 +1,5 @@
define([
"jQuery",
"emby-button",
"emby-input",
"scripts/livetvcomponents",
@ -10,7 +11,8 @@ define([
"emby-checkbox",
"emby-slider",
"listViewStyle",
"dashboardcss"], function () {
"dashboardcss",
"detailtablecss"], function () {
function defineRoute(newRoute) {
var path = newRoute.path;
@ -76,17 +78,20 @@ define([
defineRoute({
path: "/dlnaprofile.html",
autoFocus: false,
roles: "admin"
roles: "admin",
controller: "dlnaprofile"
});
defineRoute({
path: "/dlnaprofiles.html",
autoFocus: false,
roles: "admin"
roles: "admin",
controller: "dlnaprofiles"
});
defineRoute({
path: "/dlnasettings.html",
autoFocus: false,
roles: "admin"
roles: "admin",
controller: "dlnasettings"
});
defineRoute({
path: "/edititemmetadata.html",
@ -96,7 +101,8 @@ define([
defineRoute({
path: "/encodingsettings.html",
autoFocus: false,
roles: "admin"
roles: "admin",
controller: "encodingsettings"
});
defineRoute({
path: "/forgotpassword.html",
@ -138,7 +144,8 @@ define([
defineRoute({
path: "/library.html",
autoFocus: false,
roles: "admin"
roles: "admin",
controller: "medialibrarypage"
});
defineRoute({
path: "/librarydisplay.html",
@ -161,16 +168,19 @@ define([
defineRoute({
path: "/livetvguideprovider.html",
autoFocus: false,
roles: "admin"
roles: "admin",
controller: "livetvguideprovider"
});
defineRoute({
path: "/livetvsettings.html",
autoFocus: false
autoFocus: false,
controller: "livetvsettings"
});
defineRoute({
path: "/livetvstatus.html",
autoFocus: false,
roles: "admin"
roles: "admin",
controller: "livetvstatus"
});
defineRoute({
path: "/livetvtuner.html",
@ -198,12 +208,14 @@ define([
defineRoute({
path: "/metadataimages.html",
autoFocus: false,
roles: "admin"
roles: "admin",
controller: "metadataimagespage"
});
defineRoute({
path: "/metadatanfo.html",
autoFocus: false,
roles: "admin"
roles: "admin",
controller: "metadatanfo"
});
defineRoute({
path: "/movies.html",
@ -256,7 +268,8 @@ define([
defineRoute({
path: "/notificationsetting.html",
autoFocus: false,
roles: "admin"
roles: "admin",
controller: "notificationsetting"
});
defineRoute({
path: "/notificationsettings.html",
@ -276,7 +289,8 @@ define([
defineRoute({
path: "/playbackconfiguration.html",
autoFocus: false,
roles: "admin"
roles: "admin",
controller: "playbackconfiguration"
});
defineRoute({
path: "/availableplugins.html",
@ -322,12 +336,14 @@ define([
defineRoute({
path: "/serversecurity.html",
autoFocus: false,
roles: "admin"
roles: "admin",
controller: "serversecurity"
});
defineRoute({
path: "/streamingsettings.html",
autoFocus: false,
roles: "admin"
roles: "admin",
controller: "streamingsettings"
});
defineRoute({
path: "/support.html",
@ -343,22 +359,26 @@ define([
defineRoute({
path: "/useredit.html",
autoFocus: false,
roles: "admin"
roles: "admin",
controller: "useredit"
});
defineRoute({
path: "/userlibraryaccess.html",
autoFocus: false,
roles: "admin"
roles: "admin",
controller: "userlibraryaccess"
});
defineRoute({
path: "/usernew.html",
autoFocus: false,
roles: "admin"
roles: "admin",
controller: "usernew"
});
defineRoute({
path: "/userparentalcontrol.html",
autoFocus: false,
roles: "admin"
roles: "admin",
controller: "userparentalcontrol"
});
defineRoute({
path: "/userpassword.html",
@ -368,7 +388,8 @@ define([
defineRoute({
path: "/userprofiles.html",
autoFocus: false,
roles: "admin"
roles: "admin",
controller: "userprofilespage"
});
defineRoute({
path: "/wizardremoteaccess.html",
@ -385,7 +406,8 @@ define([
defineRoute({
path: "/wizardlibrary.html",
autoFocus: false,
anonymous: true
anonymous: true,
controller: "medialibrarypage"
});
defineRoute({
path: "/wizardsettings.html",

View file

@ -673,7 +673,6 @@ var AppInfo = {};
var componentsPath = "components";
var paths = {
velocity: bowerPath + "/velocity/velocity.min",
vibrant: bowerPath + "/vibrant/dist/vibrant",
ironCardList: "components/ironcardlist/ironcardlist",
scrollThreshold: "components/scrollthreshold",
playlisteditor: "components/playlisteditor/playlisteditor",
@ -687,16 +686,16 @@ var AppInfo = {};
humanedate: "components/humanedate",
libraryBrowser: "scripts/librarybrowser",
events: apiClientBowerPath + "/events",
credentialprovider: apiClientBowerPath + "/credentials",
credentialprovider: apiClientBowerPath + "/credentialprovider",
connectionManagerFactory: bowerPath + "/apiclient/connectionmanager",
visibleinviewport: componentsPath + "/visibleinviewport",
browserdeviceprofile: componentsPath + "/browserdeviceprofile",
browser: componentsPath + "/browser",
inputManager: componentsPath + "/inputmanager",
inputManager: componentsPath + "/inputManager",
qualityoptions: componentsPath + "/qualityoptions",
hammer: bowerPath + "/hammerjs/hammer.min",
page: "thirdparty/page",
focusManager: componentsPath + "/focusmanager",
focusManager: componentsPath + "/focusManager",
datetime: componentsPath + "/datetime",
globalize: componentsPath + "/globalize",
itemHelper: componentsPath + "/itemhelper",
@ -704,7 +703,7 @@ var AppInfo = {};
playQueueManager: componentsPath + "/playback/playqueuemanager",
autoPlayDetect: componentsPath + "/playback/autoplaydetect",
nowPlayingHelper: componentsPath + "/playback/nowplayinghelper",
pluginManager: componentsPath + "/pluginmanager",
pluginManager: componentsPath + "/pluginManager",
packageManager: componentsPath + "/packagemanager"
};
paths.hlsjs = bowerPath + "/hlsjs/dist/hls.min";
@ -778,15 +777,14 @@ var AppInfo = {};
define("homescreenSettings", [componentsPath + "/homescreensettings/homescreensettings"], returnFirstDependency);
define("homescreenSettingsDialog", [componentsPath + "/homescreensettings/homescreensettingsdialog"], returnFirstDependency);
define("playbackManager", [componentsPath + "/playback/playbackmanager"], getPlaybackManager);
define("layoutManager", [componentsPath + "/layoutmanager", "apphost"], getLayoutManager);
define("layoutManager", [componentsPath + "/layoutManager", "apphost"], getLayoutManager);
define("homeSections", [componentsPath + "/homesections/homesections"], returnFirstDependency);
define("playMenu", [componentsPath + "/playmenu"], returnFirstDependency);
define("refreshDialog", [componentsPath + "/refreshdialog/refreshdialog"], returnFirstDependency);
define("backdrop", [componentsPath + "/backdrop/backdrop"], returnFirstDependency);
define("fetchHelper", [componentsPath + "/fetchhelper"], returnFirstDependency);
define("roundCardStyle", ["cardStyle", "css!" + componentsPath + "/cardbuilder/roundcard"], returnFirstDependency);
define("cardStyle", ["css!" + componentsPath + "/cardbuilder/card"], returnFirstDependency);
define("cardBuilder", [componentsPath + "/cardbuilder/cardbuilder"], returnFirstDependency);
define("cardBuilder", [componentsPath + "/cardbuilder/cardBuilder"], returnFirstDependency);
define("peoplecardbuilder", [componentsPath + "/cardbuilder/peoplecardbuilder"], returnFirstDependency);
define("chaptercardbuilder", [componentsPath + "/cardbuilder/chaptercardbuilder"], returnFirstDependency);
define("flexStyles", ["css!" + componentsPath + "/flexstyles"], returnFirstDependency);
@ -831,7 +829,6 @@ var AppInfo = {};
define("viewSettings", [componentsPath + "/viewsettings/viewsettings"], returnFirstDependency);
define("filterMenu", [componentsPath + "/filtermenu/filtermenu"], returnFirstDependency);
define("sortMenu", [componentsPath + "/sortmenu/sortmenu"], returnFirstDependency);
define("connectionmanager", [apiClientBowerPath + "/connectionmanager"]);
define("serversync", [apiClientBowerPath + "/sync/serversync"], returnFirstDependency);
define("multiserversync", [apiClientBowerPath + "/sync/multiserversync"], returnFirstDependency);
define("mediasync", [apiClientBowerPath + "/sync/mediasync"], returnFirstDependency);
@ -844,7 +841,7 @@ var AppInfo = {};
define("toast", [componentsPath + "/toast/toast"], returnFirstDependency);
define("scrollHelper", [componentsPath + "/scrollhelper"], returnFirstDependency);
define("touchHelper", [componentsPath + "/touchhelper"], returnFirstDependency);
define("appSettings", [componentsPath + "/appsettings"], returnFirstDependency);
define("appSettings", [componentsPath + "/appSettings"], returnFirstDependency);
define("userSettings", [componentsPath + "/usersettings/usersettings"], returnFirstDependency);
define("userSettingsBuilder", [componentsPath + "/usersettings/usersettingsbuilder", "layoutManager", "browser"], getSettingsBuilder);
define("material-icons", ["css!css/material-icons/style"], returnFirstDependency);
@ -854,7 +851,7 @@ var AppInfo = {};
define("imageUploader", [componentsPath + "/imageuploader/imageuploader"], returnFirstDependency);
define("navdrawer", ["components/navdrawer/navdrawer"], returnFirstDependency);
define("htmlMediaHelper", [componentsPath + "/htmlMediaHelper"], returnFirstDependency);
define("viewcontainer", ["components/viewContainer"], returnFirstDependency);
define("viewContainer", ["components/viewContainer"], returnFirstDependency);
define("queryString", [bowerPath + "/query-string/index"], function () {
return queryString;
});

View file

@ -80,7 +80,6 @@ define(["layoutManager", "loading", "libraryBrowser", "cardBuilder", "lazyLoader
scalable: !0,
centerText: !1,
cardLayout: !0,
vibrant: supportsImageAnalysis,
showYear: !0
}) : "PosterCard" == viewStyle ? cardBuilder.buildCards(result.Items, {
itemsContainer: elem,
@ -89,7 +88,6 @@ define(["layoutManager", "loading", "libraryBrowser", "cardBuilder", "lazyLoader
scalable: !0,
centerText: !1,
cardLayout: !0,
vibrant: supportsImageAnalysis,
showYear: !0
}) : "Poster" == viewStyle && cardBuilder.buildCards(result.Items, {
itemsContainer: elem,

View file

@ -34,7 +34,6 @@ define(["loading", "components/groupedcards", "cardBuilder", "apphost", "imageLo
centerText: !0,
lazy: !0,
overlayPlayButton: !0,
vibrant: !1,
lines: 2
});
var elem = context.querySelector("#latestEpisodes");

View file

@ -73,7 +73,6 @@ define(["layoutManager", "loading", "datetime", "libraryBrowser", "cardBuilder",
overlayText: !1,
allowBottomPadding: allowBottomPadding,
cardLayout: supportsImageAnalysis,
vibrant: supportsImageAnalysis,
overlayMoreButton: !0,
missingIndicator: !1
}), html += "</div>", html += "</div>"

View file

@ -1,4 +1,4 @@
<div id="serverSecurityPage" data-role="page" class="page type-interior advancedConfigurationPage withTabs fullWidthContent" data-require="scripts/serversecurity,detailtablecss,emby-button">
<div id="serverSecurityPage" data-role="page" class="page type-interior advancedConfigurationPage withTabs fullWidthContent">
<div>
<div class="content-primary">
<div class="detailSectionHeader">

View file

@ -1,4 +1,4 @@
<div id="streamingSettingsPage" data-role="page" class="page type-interior playbackConfigurationPage withTabs" data-require="scripts/streamingsettings,emby-input,emby-button,emby-select">
<div id="streamingSettingsPage" data-role="page" class="page type-interior playbackConfigurationPage withTabs">
<div>
<div class="content-primary">

View file

@ -1,4 +1,4 @@
<div id="editUserPage" data-role="page" class="page type-interior" data-require="scripts/useredit,emby-select,emby-input,emby-checkbox,emby-button">
<div id="editUserPage" data-role="page" class="page type-interior">
<div>
<div class="content-primary">

View file

@ -1,4 +1,4 @@
<div id="userLibraryAccessPage" data-role="page" class="page type-interior" data-require="scripts/userlibraryaccess,emby-checkbox,emby-button">
<div id="userLibraryAccessPage" data-role="page" class="page type-interior">
<div>
<div class="content-primary">

View file

@ -1,4 +1,4 @@
<div id="newUserPage" data-role="page" class="page type-interior" data-require="scripts/usernew,emby-input,emby-button">
<div id="newUserPage" data-role="page" class="page type-interior">
<div>
<div class="content-primary">

View file

@ -1,4 +1,4 @@
<div id="userParentalControlPage" data-role="page" class="page type-interior" data-require="scripts/userparentalcontrol,emby-checkbox,emby-button,emby-select">
<div id="userParentalControlPage" data-role="page" class="page type-interior">
<div>
<div class="content-primary">

View file

@ -1,4 +1,4 @@
<div id="userProfilesPage" data-role="page" class="page type-interior userProfilesPage fullWidthContent" data-require="scripts/userprofilespage,emby-button">
<div id="userProfilesPage" data-role="page" class="page type-interior userProfilesPage fullWidthContent">
<div>
<div class="content-primary">

View file

@ -1,4 +1,4 @@
<div id="wizardLibraryPage" data-role="page" class="page standalonePage wizardPage mediaLibraryPage" data-require="scripts/medialibrarypage,scripts/taskbutton,emby-button">
<div id="wizardLibraryPage" data-role="page" class="page standalonePage wizardPage mediaLibraryPage">
<div class="padded-left padded-right padded-top">