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

update components

This commit is contained in:
Luke Pulverenti 2016-04-28 00:53:11 -04:00
parent acb094fa46
commit 59ede5b1e6
7 changed files with 52 additions and 34 deletions

View file

@ -16,12 +16,12 @@
},
"devDependencies": {},
"ignore": [],
"version": "1.2.51",
"_release": "1.2.51",
"version": "1.2.53",
"_release": "1.2.53",
"_resolution": {
"type": "version",
"tag": "1.2.51",
"commit": "0de31178ecd029314513167a880a1cf645140917"
"tag": "1.2.53",
"commit": "818133a9b1b4b241b6f0e8e1733da3358bb02df5"
},
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "^1.2.0",

View file

@ -20,9 +20,11 @@
});
}
function showMenu(apiClient, itemId) {
function showMenu(options) {
loading.show();
var itemId = options.itemId;
var apiClient = options.apiClient || connectionManager.getApiClient(options.serverId);
var userId = apiClient.getCurrentUserId();
return apiClient.getItem(userId, itemId).then(function () {

View file

@ -133,6 +133,9 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
if (appHost.supports('filedownload')) {
html += '<paper-icon-button icon="slideshow:file-download" class="btnDownload slideshowButton"></paper-icon-button>';
}
if (appHost.supports('sharing')) {
html += '<paper-icon-button icon="slideshow:share" class="btnShare slideshowButton"></paper-icon-button>';
}
}
html += '<paper-icon-button icon="slideshow:close" class="btnSlideshowExit" tabindex="-1"></paper-icon-button>';
html += '</div>';
@ -145,6 +148,9 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
if (appHost.supports('filedownload')) {
html += '<paper-icon-button icon="slideshow:file-download" class="btnDownload slideshowButton"></paper-icon-button>';
}
if (appHost.supports('sharing')) {
html += '<paper-icon-button icon="slideshow:share" class="btnShare slideshowButton"></paper-icon-button>';
}
html += '</div>';
}
@ -240,7 +246,8 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
originalImage: getImgUrl(item, true),
//title: item.Name,
//description: item.Overview
Id: item.Id
Id: item.Id,
ServerId: item.ServerId
});
}
@ -265,7 +272,7 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
function getSwiperSlideHtmlFromSlide(item) {
var html = '';
html += '<div class="swiper-slide" data-original="' + item.originalImage + '" data-itemid="' + item.Id + '">';
html += '<div class="swiper-slide" data-original="' + item.originalImage + '" data-itemid="' + item.Id + '" data-serverid="' + item.ServerId + '">';
html += '<img data-src="' + item.imageUrl + '" class="swiper-lazy">';
html += '<paper-spinner></paper-spinner>';
if (item.title || item.subtitle) {
@ -316,21 +323,19 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
}
}
function getCurrentItemId() {
function getCurrentImageInfo() {
if (swiperInstance) {
return document.querySelector('.swiper-slide-active').getAttribute('data-itemid');
} else {
var slide = document.querySelector('.swiper-slide-active');
if (slide) {
return {
url: slide.getAttribute('data-original'),
itemId: slide.getAttribute('data-itemid'),
serverId: slide.getAttribute('data-serverid')
};
}
return null;
}
}
function getCurrentImageUrl() {
if (swiperInstance) {
return document.querySelector('.swiper-slide-active').getAttribute('data-original');
} else {
return null;
}
@ -338,20 +343,20 @@ define(['dialogHelper', 'inputManager', 'connectionManager', 'layoutManager', 'f
function download() {
var url = getCurrentImageUrl();
var itemId = getCurrentItemId();
var imageInfo = getCurrentImageInfo();
require(['fileDownloader'], function (fileDownloader) {
fileDownloader.download([
{
url: url,
itemId: itemId
}]);
fileDownloader.download([imageInfo]);
});
}
function share() {
var imageInfo = getCurrentImageInfo();
require(['sharingmanager'], function (sharingManager) {
sharingManager.showMenu(imageInfo);
});
}
function play() {

View file

@ -32,14 +32,14 @@
"web-component-tester": "^4.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/PolymerElements/iron-icon",
"homepage": "https://github.com/polymerelements/iron-icon",
"_release": "1.0.8",
"_resolution": {
"type": "version",
"tag": "v1.0.8",
"commit": "f36b38928849ef3853db727faa8c9ef104d611eb"
},
"_source": "git://github.com/PolymerElements/iron-icon.git",
"_source": "git://github.com/polymerelements/iron-icon.git",
"_target": "^1.0.0",
"_originalSource": "PolymerElements/iron-icon"
"_originalSource": "polymerelements/iron-icon"
}

View file

@ -34,6 +34,6 @@
"commit": "11c987b2eb3c73b388a79fc8aaea8ca01624f514"
},
"_source": "git://github.com/Polymer/polymer.git",
"_target": "^1.1.0",
"_target": "^1.0.0",
"_originalSource": "Polymer/polymer"
}

View file

@ -950,6 +950,8 @@
});
}
var serverId = ApiClient.serverInfo().Id;
require(['actionsheet'], function (actionsheet) {
actionsheet.show({
@ -961,7 +963,10 @@
case 'share':
require(['sharingmanager'], function (sharingManager) {
sharingManager.showMenu(ApiClient, itemId);
sharingManager.showMenu({
serverId: serverId,
itemId: itemId
});
});
break;
case 'addtocollection':
@ -990,7 +995,8 @@
fileDownloader.download([
{
url: downloadHref,
itemId: itemId
itemId: itemId,
serverId: serverId
}]);
});

View file

@ -249,6 +249,7 @@
var albumid = card.getAttribute('data-albumid');
var artistid = card.getAttribute('data-artistid');
var serverId = ApiClient.serverInfo().Id;
Dashboard.getCurrentUser().then(function (user) {
@ -494,7 +495,8 @@
fileDownloader.download([
{
url: downloadHref,
itemId: itemId
itemId: itemId,
serverId: serverId
}]);
});
@ -577,7 +579,10 @@
break;
case 'share':
require(['sharingmanager'], function (sharingManager) {
sharingManager.showMenu(ApiClient, itemId);
sharingManager.showMenu({
serverId: serverId,
itemId: itemId
});
});
break;
case 'removefromplaylist':