mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
implement user ordering of local metadata readers
This commit is contained in:
parent
793dd69b63
commit
e5420945f5
3 changed files with 44 additions and 13 deletions
|
@ -107,8 +107,8 @@
|
|||
.editorTile {
|
||||
display: inline-block;
|
||||
margin: 5px;
|
||||
padding: 10px;
|
||||
border: 1px solid #505050;
|
||||
padding: 8px;
|
||||
border: 1px solid #444;
|
||||
background-image: -webkit-gradient(linear,left top,left bottom,from(#444),to(#2d2d2d));
|
||||
background-image: -webkit-linear-gradient(#444,#2d2d2d);
|
||||
background-image: -moz-linear-gradient(#444,#2d2d2d);
|
||||
|
@ -118,7 +118,7 @@
|
|||
}
|
||||
|
||||
.imageEditorTile {
|
||||
width: 192px;
|
||||
width: 256px;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -304,7 +304,7 @@
|
|||
|
||||
html += '<div class="editorTile imageEditorTile">';
|
||||
|
||||
html += '<div style="height:108px;vertical-align:top;background-repeat:no-repeat;background-size:contain;background-image:url(\'' + LibraryBrowser.getImageUrl(currentItem, image.ImageType, image.ImageIndex, { maxheight: 216 }) + '\');"></div>';
|
||||
html += '<div style="height:144px;vertical-align:top;background-repeat:no-repeat;background-size:contain;background-image:url(\'' + LibraryBrowser.getImageUrl(currentItem, image.ImageType, image.ImageIndex, { maxheight: 216 }) + '\');"></div>';
|
||||
|
||||
html += '<div>';
|
||||
|
||||
|
@ -319,22 +319,22 @@
|
|||
if (image.ImageType == "Backdrop" || image.ImageType == "Screenshot") {
|
||||
|
||||
if (i > 0) {
|
||||
html += '<button type="button" data-icon="arrow-l" data-mini="true" data-inline="true" data-iconpos="notext" onclick="EditItemImagesPage.moveImage(\'' + image.ImageType + '\', ' + image.ImageIndex + ', ' + (i - 1) + ');">Move left</button>';
|
||||
html += '<button type="button" data-icon="arrow-l" data-mini="true" data-inline="true" data-iconpos="notext" onclick="EditItemImagesPage.moveImage(\'' + image.ImageType + '\', ' + image.ImageIndex + ', ' + (i - 1) + ');" style="margin-bottom:0;">Move left</button>';
|
||||
} else {
|
||||
html += '<button type="button" data-icon="arrow-l" data-mini="true" data-inline="true" data-iconpos="notext" disabled>Move left</button>';
|
||||
html += '<button type="button" data-icon="arrow-l" data-mini="true" data-inline="true" data-iconpos="notext" style="margin-bottom:0;" disabled>Move left</button>';
|
||||
}
|
||||
|
||||
if (i < length - 1) {
|
||||
html += '<button type="button" data-icon="arrow-r" data-mini="true" data-inline="true" data-iconpos="notext" onclick="EditItemImagesPage.moveImage(\'' + image.ImageType + '\', ' + image.ImageIndex + ', ' + (i + 1) + ');">Move right</button>';
|
||||
html += '<button type="button" data-icon="arrow-r" data-mini="true" data-inline="true" data-iconpos="notext" onclick="EditItemImagesPage.moveImage(\'' + image.ImageType + '\', ' + image.ImageIndex + ', ' + (i + 1) + ');" style="margin-bottom:0;">Move right</button>';
|
||||
} else {
|
||||
html += '<button type="button" data-icon="arrow-r" data-mini="true" data-inline="true" data-iconpos="notext" disabled>Move right</button>';
|
||||
html += '<button type="button" data-icon="arrow-r" data-mini="true" data-inline="true" data-iconpos="notext" style="margin-bottom:0;" disabled>Move right</button>';
|
||||
}
|
||||
}
|
||||
|
||||
html += '<button type="button" data-icon="delete" data-mini="true" data-inline="true" data-iconpos="notext" onclick="EditItemImagesPage.deleteImage(\'' + image.ImageType + '\', ' + (image.ImageIndex != null ? image.ImageIndex : "null") + ');">Delete</button>';
|
||||
html += '<button type="button" data-icon="delete" data-mini="true" data-inline="true" data-iconpos="notext" onclick="EditItemImagesPage.deleteImage(\'' + image.ImageType + '\', ' + (image.ImageIndex != null ? image.ImageIndex : "null") + ');" style="margin-bottom:0;">Delete</button>';
|
||||
|
||||
if (imageProviders.length) {
|
||||
html += '<button type="button" data-icon="cloud" data-mini="true" data-inline="true" data-iconpos="notext" onclick="EditItemImagesPage.showDownloadMenu(\'' + image.ImageType + '\');">Browse Online Images</button>';
|
||||
html += '<button type="button" data-icon="cloud" data-mini="true" data-inline="true" data-iconpos="notext" onclick="EditItemImagesPage.showDownloadMenu(\'' + image.ImageType + '\');" style="margin-bottom:0;">Browse Online Images</button>';
|
||||
}
|
||||
|
||||
html += '</p>';
|
||||
|
|
|
@ -386,7 +386,7 @@
|
|||
|
||||
html += '<a href="#" style="font-size:13px;font-weight:normal;">' + plugin.Name + '</a>';
|
||||
|
||||
html += '<a class="btnLocalReaderUp" data-pluginindex="' + i + '" href="#" style="font-size:13px;font-weight:normal;" data-icon="arrow-u">Up</a>';
|
||||
html += '<a class="btnLocalReaderUp btnLocalReaderMove" data-pluginindex="' + i + '" href="#" style="font-size:13px;font-weight:normal;" data-icon="arrow-u">Up</a>';
|
||||
|
||||
html += '</li>';
|
||||
}
|
||||
|
@ -395,7 +395,7 @@
|
|||
|
||||
html += '<a href="#" style="font-size:13px;font-weight:normal;">' + plugin.Name + '</a>';
|
||||
|
||||
html += '<a class="btnLocalReaderDown" data-pluginindex="' + i + '" href="#" style="font-size:13px;font-weight:normal;" data-icon="arrow-d">Down</a>';
|
||||
html += '<a class="btnLocalReaderDown btnLocalReaderMove" data-pluginindex="' + i + '" href="#" style="font-size:13px;font-weight:normal;" data-icon="arrow-d">Down</a>';
|
||||
|
||||
html += '</li>';
|
||||
}
|
||||
|
@ -411,7 +411,38 @@
|
|||
html += '</ul>';
|
||||
html += '<div class="fieldDescription">Rank your preferred local metadata sources in order of priority. The first file found will be read.</div>';
|
||||
|
||||
$('.metadataReaders', page).html(html).show().trigger('create');
|
||||
var elem = $('.metadataReaders', page).html(html).show().trigger('create');
|
||||
|
||||
$(elem).on('click', '.btnLocalReaderMove', function () {
|
||||
|
||||
var li = $(this).parents('.localReaderOption');
|
||||
var ul = li.parents('ul');
|
||||
|
||||
if ($(this).hasClass('btnLocalReaderDown')) {
|
||||
|
||||
var next = li.next();
|
||||
|
||||
li.remove().insertAfter(next);
|
||||
|
||||
} else {
|
||||
|
||||
var prev = li.prev();
|
||||
|
||||
li.remove().insertBefore(prev);
|
||||
}
|
||||
|
||||
$('.localReaderOption', ul).each(function () {
|
||||
|
||||
if ($(this).prev('.localReaderOption').length) {
|
||||
$('.btnLocalReaderMove', this).addClass('btnLocalReaderUp').removeClass('btnLocalReaderDown').attr('data-icon', 'arrow-u').removeClass('ui-icon-arrow-d').addClass('ui-icon-arrow-u');
|
||||
} else {
|
||||
$('.btnLocalReaderMove', this).addClass('btnLocalReaderDown').removeClass('btnLocalReaderUp').attr('data-icon', 'arrow-d').removeClass('ui-icon-arrow-u').addClass('ui-icon-arrow-d');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
ul.listview('destroy').listview({});
|
||||
});
|
||||
}
|
||||
|
||||
function loadPage(page) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue