mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
minify
This commit is contained in:
parent
82bcca376f
commit
8a6884abef
494 changed files with 256 additions and 120180 deletions
|
@ -1,59 +1 @@
|
|||
define(['connectionManager', 'sharingMenu', 'loading'], function (connectionManager, sharingMenu, loading) {
|
||||
'use strict';
|
||||
|
||||
function onSharingCancel(options, apiClient) {
|
||||
|
||||
var shareId = options.share.Id;
|
||||
|
||||
console.log('share cancelled. shareId: ' + shareId);
|
||||
|
||||
// Delete the share since it was cancelled
|
||||
apiClient.ajax({
|
||||
type: 'DELETE',
|
||||
url: apiClient.getUrl('Social/Shares/' + shareId)
|
||||
});
|
||||
}
|
||||
|
||||
function showMenu(options) {
|
||||
|
||||
loading.show();
|
||||
var itemId = options.itemId;
|
||||
var apiClient = connectionManager.getApiClient(options.serverId);
|
||||
var userId = apiClient.getCurrentUserId();
|
||||
|
||||
return apiClient.getItem(userId, itemId).then(function () {
|
||||
|
||||
return apiClient.ajax({
|
||||
type: 'POST',
|
||||
url: apiClient.getUrl('Social/Shares', {
|
||||
|
||||
ItemId: itemId,
|
||||
UserId: userId
|
||||
}),
|
||||
dataType: "json"
|
||||
|
||||
}).then(function (share) {
|
||||
|
||||
var options = {
|
||||
share: share
|
||||
};
|
||||
|
||||
loading.hide();
|
||||
|
||||
return sharingMenu.showMenu(options).then(function () {
|
||||
console.log('share success. shareId: ' + options.share.Id);
|
||||
}, function () {
|
||||
onSharingCancel(options, apiClient);
|
||||
});
|
||||
|
||||
}, function () {
|
||||
|
||||
loading.hide();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
showMenu: showMenu
|
||||
};
|
||||
});
|
||||
define(["connectionManager","sharingMenu","loading"],function(connectionManager,sharingMenu,loading){"use strict";function onSharingCancel(options,apiClient){var shareId=options.share.Id;console.log("share cancelled. shareId: "+shareId),apiClient.ajax({type:"DELETE",url:apiClient.getUrl("Social/Shares/"+shareId)})}function showMenu(options){loading.show();var itemId=options.itemId,apiClient=connectionManager.getApiClient(options.serverId),userId=apiClient.getCurrentUserId();return apiClient.getItem(userId,itemId).then(function(){return apiClient.ajax({type:"POST",url:apiClient.getUrl("Social/Shares",{ItemId:itemId,UserId:userId}),dataType:"json"}).then(function(share){var options={share:share};return loading.hide(),sharingMenu.showMenu(options).then(function(){console.log("share success. shareId: "+options.share.Id)},function(){onSharingCancel(options,apiClient)})},function(){loading.hide()})})}return{showMenu:showMenu}});
|
|
@ -1,70 +1 @@
|
|||
define(['dialogHelper', 'layoutManager', 'globalize', './social-share-kit-1.0.10/dist/js/social-share-kit.min', 'css!./social-share-kit-1.0.10/dist/css/social-share-kit.css', 'emby-button'], function (dialogHelper, layoutManager, globalize) {
|
||||
'use strict';
|
||||
|
||||
function showMenu(options) {
|
||||
|
||||
var dlg = dialogHelper.createDialog({
|
||||
removeOnClose: true,
|
||||
autoFocus: layoutManager.tv,
|
||||
modal: false
|
||||
});
|
||||
|
||||
dlg.id = 'dlg' + new Date().getTime();
|
||||
var html = '';
|
||||
|
||||
html += '<h2>' + Globalize.translate('Share') + '</h2>';
|
||||
|
||||
html += '<div class="ssk-group ssk-round ssk-lg">';
|
||||
|
||||
// We can only do facebook if we can guarantee that the current page is available over the internet, since FB will try to probe it.
|
||||
html += '<a href="#" class="ssk ssk-facebook" style="color:#fff;"></a>';
|
||||
|
||||
html += '<a href="#" class="ssk ssk-twitter" style="color:#fff;"></a>';
|
||||
html += '<a href="#" class="ssk ssk-google-plus" style="color:#fff;"></a>';
|
||||
html += '<a href="#" class="ssk ssk-pinterest" style="color:#fff;"></a>';
|
||||
html += '<a href="#" class="ssk ssk-tumblr" style="color:#fff;"></a>';
|
||||
html += '</div>';
|
||||
|
||||
dlg.style.padding = '.5em 1.5em 1.5em';
|
||||
|
||||
dlg.innerHTML = html;
|
||||
|
||||
var isShared = false;
|
||||
|
||||
var shareInfo = options.share;
|
||||
|
||||
function onSskButtonClick(e) {
|
||||
isShared = true;
|
||||
dialogHelper.close(dlg);
|
||||
}
|
||||
|
||||
// Has to be assigned a z-index after the call to .open()
|
||||
var sskButtons = dlg.querySelectorAll('.ssk');
|
||||
for (var i = 0, length = sskButtons.length; i < length; i++) {
|
||||
sskButtons[i].addEventListener('click', onSskButtonClick);
|
||||
}
|
||||
|
||||
dlg.addEventListener('open', function() {
|
||||
SocialShareKit.init({
|
||||
selector: '#' + dlg.id + ' .ssk',
|
||||
url: shareInfo.Url,
|
||||
title: shareInfo.Name,
|
||||
text: shareInfo.Overview,
|
||||
image: shareInfo.ImageUrl,
|
||||
via: 'Emby'
|
||||
});
|
||||
});
|
||||
|
||||
return dialogHelper.open(dlg).then(function() {
|
||||
if (isShared) {
|
||||
return Promise.resolve();
|
||||
} else {
|
||||
return Promise.reject();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
showMenu: showMenu
|
||||
};
|
||||
});
|
||||
define(["dialogHelper","layoutManager","globalize","./social-share-kit-1.0.10/dist/js/social-share-kit.min","css!./social-share-kit-1.0.10/dist/css/social-share-kit.css","emby-button"],function(dialogHelper,layoutManager,globalize){"use strict";function showMenu(options){function onSskButtonClick(e){isShared=!0,dialogHelper.close(dlg)}var dlg=dialogHelper.createDialog({removeOnClose:!0,autoFocus:layoutManager.tv,modal:!1});dlg.id="dlg"+(new Date).getTime();var html="";html+="<h2>"+Globalize.translate("Share")+"</h2>",html+='<div class="ssk-group ssk-round ssk-lg">',html+='<a href="#" class="ssk ssk-facebook" style="color:#fff;"></a>',html+='<a href="#" class="ssk ssk-twitter" style="color:#fff;"></a>',html+='<a href="#" class="ssk ssk-google-plus" style="color:#fff;"></a>',html+='<a href="#" class="ssk ssk-pinterest" style="color:#fff;"></a>',html+='<a href="#" class="ssk ssk-tumblr" style="color:#fff;"></a>',html+="</div>",dlg.style.padding=".5em 1.5em 1.5em",dlg.innerHTML=html;for(var isShared=!1,shareInfo=options.share,sskButtons=dlg.querySelectorAll(".ssk"),i=0,length=sskButtons.length;i<length;i++)sskButtons[i].addEventListener("click",onSskButtonClick);return dlg.addEventListener("open",function(){SocialShareKit.init({selector:"#"+dlg.id+" .ssk",url:shareInfo.Url,title:shareInfo.Name,text:shareInfo.Overview,image:shareInfo.ImageUrl,via:"Emby"})}),dialogHelper.open(dlg).then(function(){return isShared?Promise.resolve():Promise.reject()})}return{showMenu:showMenu}});
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue