1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
This commit is contained in:
Luke Pulverenti 2017-01-27 18:07:14 -05:00
parent 82bcca376f
commit 8a6884abef
494 changed files with 256 additions and 120180 deletions

View file

@ -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}});