mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update dlna profile list
This commit is contained in:
parent
4ed0a8d919
commit
ac9ab5502a
6 changed files with 97 additions and 193 deletions
|
@ -6,78 +6,76 @@
|
|||
|
||||
ApiClient.getJSON(ApiClient.getUrl("Dlna/ProfileInfos")).then(function (result) {
|
||||
|
||||
renderProfiles(page, result);
|
||||
renderUserProfiles(page, result);
|
||||
renderSystemProfiles(page, result);
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function renderProfiles(page, profiles) {
|
||||
|
||||
renderUserProfiles(page, profiles);
|
||||
renderSystemProfiles(page, profiles);
|
||||
}
|
||||
|
||||
function renderUserProfiles(page, profiles) {
|
||||
|
||||
profiles = profiles.filter(function (p) {
|
||||
renderProfiles(page, page.querySelector('.customProfiles'), profiles.filter(function (p) {
|
||||
return p.Type == 'User';
|
||||
});
|
||||
|
||||
var html = '';
|
||||
|
||||
html += '<ul data-role="listview" data-inset="true" data-split-icon="delete">';
|
||||
|
||||
for (var i = 0, length = profiles.length; i < length; i++) {
|
||||
|
||||
var profile = profiles[i];
|
||||
|
||||
html += '<li>';
|
||||
html += '<a href="dlnaprofile.html?id=' + profile.Id + '">';
|
||||
html += profile.Name;
|
||||
html += '</a>';
|
||||
|
||||
html += '<a href="#" data-icon="delete" class="btnDeleteProfile" data-profileid="' + profile.Id + '">' + Globalize.translate('Delete') + '</a>';
|
||||
|
||||
html += '</li>';
|
||||
}
|
||||
|
||||
html += '</ul>';
|
||||
|
||||
var elem = $('.customProfiles', page).html(html).trigger('create');
|
||||
|
||||
$('.btnDeleteProfile', elem).on('click', function () {
|
||||
|
||||
var id = this.getAttribute('data-profileid');
|
||||
deleteProfile(page, id);
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
function renderSystemProfiles(page, profiles) {
|
||||
|
||||
profiles = profiles.filter(function (p) {
|
||||
renderProfiles(page, page.querySelector('.systemProfiles'), profiles.filter(function (p) {
|
||||
return p.Type == 'System';
|
||||
}));
|
||||
}
|
||||
|
||||
function renderProfiles(page, element, profiles) {
|
||||
|
||||
require(['paper-fab', 'paper-item-body', 'paper-icon-item'], function () {
|
||||
|
||||
var html = '';
|
||||
|
||||
if (profiles.length) {
|
||||
html += '<div class="paperList">';
|
||||
}
|
||||
|
||||
for (var i = 0, length = profiles.length; i < length; i++) {
|
||||
|
||||
var profile = profiles[i];
|
||||
|
||||
html += '<paper-icon-item>';
|
||||
|
||||
html += "<a item-icon class='clearLink' href='dlnaprofile.html?id=" + profile.Id + "'>";
|
||||
html += '<paper-fab mini icon="dvr" class="blue"></paper-fab>';
|
||||
html += "</a>";
|
||||
|
||||
html += '<paper-item-body two-line>';
|
||||
html += "<a class='clearLink' href='dlnaprofile.html?id=" + profile.Id + "'>";
|
||||
|
||||
html += "<div>" + profile.Name + "</div>";
|
||||
//html += "<div secondary>" + task.Description + "</div>";
|
||||
|
||||
html += "</a>";
|
||||
html += '</paper-item-body>';
|
||||
|
||||
if (profile.Type == 'User') {
|
||||
html += '<paper-icon-button icon="delete" class="btnDeleteProfile" data-profileid="' + profile.Id + '" title="' + Globalize.translate('ButtonDelete') + '"></paper-icon-button>';
|
||||
}
|
||||
|
||||
html += '</paper-icon-item>';
|
||||
}
|
||||
|
||||
if (profiles.length) {
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
element.innerHTML = html;
|
||||
|
||||
$('.btnDeleteProfile', element).on('click', function () {
|
||||
|
||||
var id = this.getAttribute('data-profileid');
|
||||
deleteProfile(page, id);
|
||||
});
|
||||
});
|
||||
|
||||
var html = '';
|
||||
|
||||
html += '<ul data-role="listview" data-inset="true">';
|
||||
|
||||
for (var i = 0, length = profiles.length; i < length; i++) {
|
||||
|
||||
var profile = profiles[i];
|
||||
|
||||
html += '<li>';
|
||||
html += '<a href="dlnaprofile.html?id=' + profile.Id + '">';
|
||||
html += profile.Name;
|
||||
html += '</a>';
|
||||
html += '</li>';
|
||||
}
|
||||
|
||||
html += '</ul>';
|
||||
|
||||
$('.systemProfiles', page).html(html).trigger('create');
|
||||
}
|
||||
|
||||
function deleteProfile(page, id) {
|
||||
|
|
|
@ -10,23 +10,7 @@
|
|||
var mediaElement;
|
||||
var self = this;
|
||||
|
||||
function hideStatusBar() {
|
||||
if (options.type == 'video' && window.StatusBar) {
|
||||
//StatusBar.backgroundColorByName("black");
|
||||
//StatusBar.overlaysWebView(true);
|
||||
StatusBar.hide();
|
||||
}
|
||||
}
|
||||
|
||||
function showStatusBar() {
|
||||
if (options.type == 'video' && window.StatusBar) {
|
||||
StatusBar.show();
|
||||
//StatusBar.overlaysWebView(false);
|
||||
}
|
||||
}
|
||||
|
||||
function onEnded() {
|
||||
showStatusBar();
|
||||
Events.trigger(self, 'ended');
|
||||
}
|
||||
|
||||
|
@ -87,7 +71,6 @@
|
|||
var errorCode = elem.error ? elem.error.code : '';
|
||||
console.log('Media element error code: ' + errorCode);
|
||||
|
||||
showStatusBar();
|
||||
Events.trigger(self, 'error');
|
||||
}
|
||||
|
||||
|
@ -130,8 +113,6 @@
|
|||
|
||||
function onOneVideoPlaying(e) {
|
||||
|
||||
hideStatusBar();
|
||||
|
||||
var element = e.target;
|
||||
element.removeEventListener('playing', onOneVideoPlaying);
|
||||
|
||||
|
@ -507,8 +488,6 @@
|
|||
$(elem).remove();
|
||||
}
|
||||
}
|
||||
|
||||
showStatusBar();
|
||||
};
|
||||
|
||||
self.supportsTextTracks = function () {
|
||||
|
|
|
@ -1970,24 +1970,25 @@ var AppInfo = {};
|
|||
|
||||
define("jstree", [bowerPath + "/jstree/dist/jstree.min", "css!thirdparty/jstree/themes/default/style.min.css"]);
|
||||
|
||||
define("jqmicons", ['css!thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.icons.css']);
|
||||
define("jqmtable", ["thirdparty/jquerymobile-1.4.5/jqm.table", 'css!thirdparty/jquerymobile-1.4.5/jqm.table.css']);
|
||||
define("jqmbase", ['css!thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.theme.css']);
|
||||
define("jqmicons", ['jqmbase', 'css!thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.icons.css']);
|
||||
define("jqmtable", ['jqmbase', "thirdparty/jquerymobile-1.4.5/jqm.table", 'css!thirdparty/jquerymobile-1.4.5/jqm.table.css']);
|
||||
|
||||
define("jqmwidget", ["thirdparty/jquerymobile-1.4.5/jqm.widget"]);
|
||||
define("jqmwidget", ['jqmbase', "thirdparty/jquerymobile-1.4.5/jqm.widget"]);
|
||||
|
||||
define("jqmslider", ["thirdparty/jquerymobile-1.4.5/jqm.slider", 'css!thirdparty/jquerymobile-1.4.5/jqm.slider.css']);
|
||||
define("jqmslider", ['jqmbase', "thirdparty/jquerymobile-1.4.5/jqm.slider", 'css!thirdparty/jquerymobile-1.4.5/jqm.slider.css']);
|
||||
|
||||
define("jqmpopup", ["thirdparty/jquerymobile-1.4.5/jqm.popup", 'css!thirdparty/jquerymobile-1.4.5/jqm.popup.css']);
|
||||
define("jqmpopup", ['jqmbase', "thirdparty/jquerymobile-1.4.5/jqm.popup", 'css!thirdparty/jquerymobile-1.4.5/jqm.popup.css']);
|
||||
|
||||
define("jqmlistview", ['css!thirdparty/jquerymobile-1.4.5/jqm.listview.css']);
|
||||
define("jqmlistview", ['jqmbase', 'css!thirdparty/jquerymobile-1.4.5/jqm.listview.css']);
|
||||
|
||||
define("jqmcontrolgroup", ['css!thirdparty/jquerymobile-1.4.5/jqm.controlgroup.css']);
|
||||
define("jqmcontrolgroup", ['jqmbase', 'css!thirdparty/jquerymobile-1.4.5/jqm.controlgroup.css']);
|
||||
|
||||
define("jqmcollapsible", ["jqmicons", "thirdparty/jquerymobile-1.4.5/jqm.collapsible", 'css!thirdparty/jquerymobile-1.4.5/jqm.collapsible.css']);
|
||||
define("jqmcollapsible", ['jqmbase', "jqmicons", "thirdparty/jquerymobile-1.4.5/jqm.collapsible", 'css!thirdparty/jquerymobile-1.4.5/jqm.collapsible.css']);
|
||||
|
||||
define("jqmcheckbox", ["jqmicons", "thirdparty/jquerymobile-1.4.5/jqm.checkbox", 'css!thirdparty/jquerymobile-1.4.5/jqm.checkbox.css']);
|
||||
define("jqmcheckbox", ['jqmbase', "jqmicons", "thirdparty/jquerymobile-1.4.5/jqm.checkbox", 'css!thirdparty/jquerymobile-1.4.5/jqm.checkbox.css']);
|
||||
|
||||
define("jqmpanel", ["thirdparty/jquerymobile-1.4.5/jqm.panel", 'css!thirdparty/jquerymobile-1.4.5/jqm.panel.css']);
|
||||
define("jqmpanel", ['jqmbase', "thirdparty/jquerymobile-1.4.5/jqm.panel", 'css!thirdparty/jquerymobile-1.4.5/jqm.panel.css']);
|
||||
|
||||
define("iron-icon-set", ["html!" + bowerPath + "/iron-icon/iron-icon.html", "html!" + bowerPath + "/iron-iconset-svg/iron-iconset-svg.html"]);
|
||||
define("slideshow", [embyWebComponentsBowerPath + "/slideshow/slideshow"], returnFirstDependency);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue