mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update recording dialogs
This commit is contained in:
parent
df635e0c5b
commit
8aaa2c7e47
78 changed files with 432 additions and 965 deletions
|
@ -1,10 +1,11 @@
|
|||
define(['dialogHelper', 'layoutManager', 'globalize', './social-share-kit-1.0.4/dist/js/social-share-kit.min', 'css!./social-share-kit-1.0.4/dist/css/social-share-kit.css', 'emby-button'], function (dialogHelper, layoutManager, globalize) {
|
||||
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) {
|
||||
|
||||
function showMenu(options) {
|
||||
|
||||
var dlg = dialogHelper.createDialog({
|
||||
removeOnClose: true,
|
||||
autoFocus: layoutManager.tv
|
||||
autoFocus: layoutManager.tv,
|
||||
modal: false
|
||||
});
|
||||
|
||||
dlg.id = 'dlg' + new Date().getTime();
|
||||
|
@ -12,18 +13,18 @@
|
|||
|
||||
html += '<h2>' + Globalize.translate('Share') + '</h2>';
|
||||
|
||||
html += '<div>';
|
||||
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"></a>';
|
||||
html += '<a href="#" class="ssk ssk-facebook"></a>';
|
||||
|
||||
html += '<a href="" class="ssk ssk-twitter"></a><a href="" class="ssk ssk-google-plus"></a><a href="" class="ssk ssk-pinterest"></a><a href="" class="ssk ssk-tumblr"></a></div>';
|
||||
html += '<a href="#" class="ssk ssk-twitter"></a>';
|
||||
html += '<a href="#" class="ssk ssk-google-plus"></a>';
|
||||
html += '<a href="#" class="ssk ssk-pinterest"></a>';
|
||||
html += '<a href="#" class="ssk ssk-tumblr"></a>';
|
||||
html += '</div>';
|
||||
|
||||
html += '<div class="buttons">';
|
||||
html += '<button is="emby-button" type="button" class="btnCancel">' + globalize.translate('sharedcomponents#ButtonCancel') + '</button>';
|
||||
html += '</div>';
|
||||
dlg.style['padding'] = '.5em 1.5em 1.5em';
|
||||
|
||||
dlg.innerHTML = html;
|
||||
|
||||
|
@ -31,15 +32,6 @@
|
|||
|
||||
var shareInfo = options.share;
|
||||
|
||||
SocialShareKit.init({
|
||||
selector: '#' + dlg.id + ' .ssk',
|
||||
url: shareInfo.Url,
|
||||
title: shareInfo.Name,
|
||||
text: shareInfo.Overview,
|
||||
image: shareInfo.ImageUrl,
|
||||
via: 'Emby'
|
||||
});
|
||||
|
||||
function onSskButtonClick(e) {
|
||||
isShared = true;
|
||||
dialogHelper.close(dlg);
|
||||
|
@ -51,25 +43,24 @@
|
|||
sskButtons[i].addEventListener('click', onSskButtonClick);
|
||||
}
|
||||
|
||||
// Has to be assigned a z-index after the call to .open()
|
||||
dlg.querySelector('.btnCancel').addEventListener('click', function () {
|
||||
dialogHelper.close(dlg);
|
||||
});
|
||||
|
||||
var promise = new Promise(function (resolve, reject) {
|
||||
|
||||
dlg.addEventListener('close', function () {
|
||||
if (isShared) {
|
||||
resolve();
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
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);
|
||||
|
||||
return promise;
|
||||
return dialogHelper.open(dlg).then(function() {
|
||||
if (isShared) {
|
||||
return Promise.resolve();
|
||||
} else {
|
||||
return Promise.reject();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue