1
0
Fork 0
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:
Luke Pulverenti 2016-04-28 23:10:48 -04:00
parent f4cc31fd98
commit 4f5766509c
14 changed files with 30 additions and 36 deletions

View file

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

View file

@ -1,10 +1,5 @@
define(['connectionManager', 'sharingMenu', 'loading'], function (connectionManager, sharingMenu, loading) { define(['connectionManager', 'sharingMenu', 'loading'], function (connectionManager, sharingMenu, loading) {
function onSharingSuccess(options) {
console.log('share success. shareId: ' + options.share.Id);
}
function onSharingCancel(options, apiClient) { function onSharingCancel(options, apiClient) {
var shareId = options.share.Id; var shareId = options.share.Id;
@ -24,7 +19,7 @@
loading.show(); loading.show();
var itemId = options.itemId; var itemId = options.itemId;
var apiClient = options.apiClient || connectionManager.getApiClient(options.serverId); var apiClient = connectionManager.getApiClient(options.serverId);
var userId = apiClient.getCurrentUserId(); var userId = apiClient.getCurrentUserId();
return apiClient.getItem(userId, itemId).then(function () { return apiClient.getItem(userId, itemId).then(function () {
@ -45,7 +40,10 @@
}; };
loading.hide(); 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); onSharingCancel(options, apiClient);
}); });

View file

@ -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({ var dlg = dialogHelper.createDialog({
removeOnClose: true, removeOnClose: true,
@ -10,25 +10,19 @@
dlg.id = 'dlg' + new Date().getTime(); dlg.id = 'dlg' + new Date().getTime();
var html = ''; var html = '';
html += '<h2>' + Globalize.translate('HeaderShare') + '</h2>'; html += '<h2>' + Globalize.translate('Share') + '</h2>';
html += '<div>'; html += '<div>';
html += '<div class="ssk-group ssk-round ssk-lg">'; 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. // 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-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><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>';
html += '<div style="max-width:240px;">';
html += Globalize.translate('ButtonShareHelp');
html += '</div>';
html += '<div class="buttons">'; 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>'; html += '</div>';
dlg.innerHTML = html; dlg.innerHTML = html;
@ -48,16 +42,6 @@
via: 'Emby' 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) { function onSskButtonClick(e) {
isShared = true; isShared = true;
dialogHelper.close(dlg); dialogHelper.close(dlg);
@ -74,7 +58,20 @@
dialogHelper.close(dlg); dialogHelper.close(dlg);
}); });
var promise = new Promise(function (resolve, reject) {
dlg.addEventListener('close', function () {
if (isShared) {
resolve();
} else {
reject();
}
});
});
dialogHelper.open(dlg); dialogHelper.open(dlg);
return promise;
} }
return { return {

View file

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

View file

@ -1647,10 +1647,10 @@ var AppInfo = {};
paths.wakeonlan = "cordova/wakeonlan"; paths.wakeonlan = "cordova/wakeonlan";
paths.actionsheet = "cordova/actionsheet"; paths.actionsheet = "cordova/actionsheet";
} else { } else {
paths.sharingMenu = "components/sharingwidget";
paths.serverdiscovery = apiClientBowerPath + "/serverdiscovery"; paths.serverdiscovery = apiClientBowerPath + "/serverdiscovery";
paths.wakeonlan = apiClientBowerPath + "/wakeonlan"; paths.wakeonlan = apiClientBowerPath + "/wakeonlan";
define("sharingMenu", [embyWebComponentsBowerPath + "/sharing/sharingmenu"], returnFirstDependency);
define("actionsheet", [embyWebComponentsBowerPath + "/actionsheet/actionsheet"], returnFirstDependency); define("actionsheet", [embyWebComponentsBowerPath + "/actionsheet/actionsheet"], returnFirstDependency);
} }

View file

@ -2221,8 +2221,7 @@
"ErrorMessageUsernameInUse": "The username is already in use. Please choose a new name and try again.", "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.", "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.", "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", "Share": "Share",
"ButtonShareHelp": "Share a web page containing media information with social media. Media files are never shared publicly.",
"ButtonShare": "Share", "ButtonShare": "Share",
"HeaderConfirm": "Confirm", "HeaderConfirm": "Confirm",
"MessageConfirmDeleteTunerDevice": "Are you sure you wish to delete this device?", "MessageConfirmDeleteTunerDevice": "Are you sure you wish to delete this device?",