mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update shared components
This commit is contained in:
parent
f4cc31fd98
commit
4f5766509c
14 changed files with 30 additions and 36 deletions
|
@ -16,12 +16,12 @@
|
|||
},
|
||||
"devDependencies": {},
|
||||
"ignore": [],
|
||||
"version": "1.2.53",
|
||||
"_release": "1.2.53",
|
||||
"version": "1.2.56",
|
||||
"_release": "1.2.56",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "1.2.53",
|
||||
"commit": "818133a9b1b4b241b6f0e8e1733da3358bb02df5"
|
||||
"tag": "1.2.56",
|
||||
"commit": "1f1194a244b476b500d3fabe85f469b6420182f8"
|
||||
},
|
||||
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
|
||||
"_target": "^1.2.0",
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
define(['connectionManager', 'sharingMenu', 'loading'], function (connectionManager, sharingMenu, loading) {
|
||||
|
||||
function onSharingSuccess(options) {
|
||||
|
||||
console.log('share success. shareId: ' + options.share.Id);
|
||||
}
|
||||
|
||||
function onSharingCancel(options, apiClient) {
|
||||
|
||||
var shareId = options.share.Id;
|
||||
|
@ -24,7 +19,7 @@
|
|||
|
||||
loading.show();
|
||||
var itemId = options.itemId;
|
||||
var apiClient = options.apiClient || connectionManager.getApiClient(options.serverId);
|
||||
var apiClient = connectionManager.getApiClient(options.serverId);
|
||||
var userId = apiClient.getCurrentUserId();
|
||||
|
||||
return apiClient.getItem(userId, itemId).then(function () {
|
||||
|
@ -45,7 +40,10 @@
|
|||
};
|
||||
|
||||
loading.hide();
|
||||
sharingMenu.showMenu(options, onSharingSuccess, function (options) {
|
||||
|
||||
sharingMenu.showMenu(options).then(function() {
|
||||
console.log('share success. shareId: ' + options.share.Id);
|
||||
}, function () {
|
||||
onSharingCancel(options, apiClient);
|
||||
});
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
define(['dialogHelper', 'thirdparty/social-share-kit-1.0.4/dist/js/social-share-kit.min', 'css!thirdparty/social-share-kit-1.0.4/dist/css/social-share-kit.css'], function (dialogHelper) {
|
||||
define(['dialogHelper', 'dialogText', './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'], function (dialogHelper, dialogText) {
|
||||
|
||||
function showMenu(options, successCallback, cancelCallback) {
|
||||
function showMenu(options) {
|
||||
|
||||
var dlg = dialogHelper.createDialog({
|
||||
removeOnClose: true,
|
||||
|
@ -10,25 +10,19 @@
|
|||
dlg.id = 'dlg' + new Date().getTime();
|
||||
var html = '';
|
||||
|
||||
html += '<h2>' + Globalize.translate('HeaderShare') + '</h2>';
|
||||
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.
|
||||
if (Dashboard.isConnectMode()) {
|
||||
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 += '</div>';
|
||||
|
||||
html += '<div style="max-width:240px;">';
|
||||
html += Globalize.translate('ButtonShareHelp');
|
||||
html += '</div>';
|
||||
|
||||
html += '<div class="buttons">';
|
||||
html += '<paper-button class="btnCancel" dialog-dismiss>' + Globalize.translate('ButtonCancel') + '</paper-button>';
|
||||
html += '<paper-button class="btnCancel">' + dialogText.get('Cancel') + '</paper-button>';
|
||||
html += '</div>';
|
||||
|
||||
dlg.innerHTML = html;
|
||||
|
@ -48,16 +42,6 @@
|
|||
via: 'Emby'
|
||||
});
|
||||
|
||||
// Has to be assigned a z-index after the call to .open()
|
||||
dlg.addEventListener('close', function () {
|
||||
|
||||
if (isShared) {
|
||||
successCallback(options);
|
||||
} else {
|
||||
cancelCallback(options);
|
||||
}
|
||||
});
|
||||
|
||||
function onSskButtonClick(e) {
|
||||
isShared = true;
|
||||
dialogHelper.close(dlg);
|
||||
|
@ -74,7 +58,20 @@
|
|||
dialogHelper.close(dlg);
|
||||
});
|
||||
|
||||
var promise = new Promise(function (resolve, reject) {
|
||||
|
||||
dlg.addEventListener('close', function () {
|
||||
if (isShared) {
|
||||
resolve();
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
dialogHelper.open(dlg);
|
||||
|
||||
return promise;
|
||||
}
|
||||
|
||||
return {
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
@ -34,6 +34,6 @@
|
|||
"commit": "11c987b2eb3c73b388a79fc8aaea8ca01624f514"
|
||||
},
|
||||
"_source": "git://github.com/Polymer/polymer.git",
|
||||
"_target": "^1.1.0",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "Polymer/polymer"
|
||||
}
|
|
@ -1647,10 +1647,10 @@ var AppInfo = {};
|
|||
paths.wakeonlan = "cordova/wakeonlan";
|
||||
paths.actionsheet = "cordova/actionsheet";
|
||||
} else {
|
||||
paths.sharingMenu = "components/sharingwidget";
|
||||
paths.serverdiscovery = apiClientBowerPath + "/serverdiscovery";
|
||||
paths.wakeonlan = apiClientBowerPath + "/wakeonlan";
|
||||
|
||||
define("sharingMenu", [embyWebComponentsBowerPath + "/sharing/sharingmenu"], returnFirstDependency);
|
||||
define("actionsheet", [embyWebComponentsBowerPath + "/actionsheet/actionsheet"], returnFirstDependency);
|
||||
}
|
||||
|
||||
|
|
|
@ -2221,8 +2221,7 @@
|
|||
"ErrorMessageUsernameInUse": "The username is already in use. Please choose a new name and try again.",
|
||||
"ErrorMessageEmailInUse": "The email address is already in use. Please enter a new email address and try again, or use the forgot password feature.",
|
||||
"MessageThankYouForConnectSignUp": "Thank you for signing up for Emby Connect. An email will be sent to your address with instructions on how to confirm your new account. Please confirm the account and then return here to sign in.",
|
||||
"HeaderShare": "Share",
|
||||
"ButtonShareHelp": "Share a web page containing media information with social media. Media files are never shared publicly.",
|
||||
"Share": "Share",
|
||||
"ButtonShare": "Share",
|
||||
"HeaderConfirm": "Confirm",
|
||||
"MessageConfirmDeleteTunerDevice": "Are you sure you wish to delete this device?",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue