mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update shared dialogs
This commit is contained in:
parent
6e6017eeaf
commit
c17d97e0ba
28 changed files with 204 additions and 62 deletions
|
@ -16,12 +16,12 @@
|
|||
},
|
||||
"devDependencies": {},
|
||||
"ignore": [],
|
||||
"version": "1.3.7",
|
||||
"_release": "1.3.7",
|
||||
"version": "1.3.18",
|
||||
"_release": "1.3.18",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "1.3.7",
|
||||
"commit": "106e16436f7c13ea1317d2bf98c89eac8fa63668"
|
||||
"tag": "1.3.18",
|
||||
"commit": "127ca5da89083c44351fd0664355f3f521313d5d"
|
||||
},
|
||||
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
|
||||
"_target": "^1.2.0",
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
define(['historyManager', 'focusManager', 'browser', 'layoutManager', 'inputManager', 'scrollHelper', 'css!./dialoghelper.css', 'scrollStyles'], function (historyManager, focusManager, browser, layoutManager, inputManager, scrollHelper) {
|
||||
|
||||
var globalOnOpenCallback;
|
||||
|
||||
function dialogHashHandler(dlg, hash, resolve) {
|
||||
|
||||
var self = this;
|
||||
|
@ -184,6 +186,10 @@
|
|||
|
||||
function open(dlg) {
|
||||
|
||||
if (globalOnOpenCallback) {
|
||||
globalOnOpenCallback(dlg);
|
||||
}
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
new dialogHashHandler(dlg, 'dlg' + new Date().getTime(), resolve);
|
||||
|
@ -403,6 +409,9 @@
|
|||
return {
|
||||
open: open,
|
||||
close: close,
|
||||
createDialog: createDialog
|
||||
createDialog: createDialog,
|
||||
setOnOpen: function (val) {
|
||||
globalOnOpenCallback = val;
|
||||
}
|
||||
};
|
||||
});
|
|
@ -21,14 +21,11 @@
|
|||
|
||||
.formDialog .dialogContent {
|
||||
flex-grow: 1;
|
||||
flex-shrink: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.formDialog .dialogContentInner {
|
||||
padding-bottom: 50vh;
|
||||
padding-top: 1.5em;
|
||||
padding-top: 1em;
|
||||
}
|
||||
|
||||
@media all and (min-width: 1000px) {
|
||||
|
|
101
dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js
vendored
Normal file
101
dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js
vendored
Normal file
|
@ -0,0 +1,101 @@
|
|||
define(['apphost', 'globalize', 'connectionManager'], function (appHost, globalize, connectionManager) {
|
||||
|
||||
function getCommands(options) {
|
||||
|
||||
var item = options.item;
|
||||
|
||||
var serverId = item.ServerId;
|
||||
var apiClient = connectionManager.getApiClient(serverId);
|
||||
|
||||
return apiClient.getCurrentUser().then(function (user) {
|
||||
|
||||
var commands = [];
|
||||
|
||||
if (item.CanDownload && user.Policy.EnableContentDownloading && appHost.supports('filedownload')) {
|
||||
commands.push({
|
||||
name: globalize.translate('sharedcomponents#Download'),
|
||||
id: 'download'
|
||||
});
|
||||
}
|
||||
|
||||
if (item.Type != 'Timer' && user.Policy.EnablePublicSharing && appHost.supports('sharing')) {
|
||||
commands.push({
|
||||
name: globalize.translate('Share'),
|
||||
id: 'share'
|
||||
});
|
||||
}
|
||||
|
||||
return commands;
|
||||
});
|
||||
}
|
||||
|
||||
function executeCommand(item, id) {
|
||||
|
||||
var itemId = item.Id;
|
||||
var serverId = item.ServerId;
|
||||
var apiClient = connectionManager.getApiClient(serverId);
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
switch (id) {
|
||||
|
||||
case 'download':
|
||||
{
|
||||
require(['fileDownloader'], function (fileDownloader) {
|
||||
var downloadHref = apiClient.getUrl("Items/" + itemId + "/Download", {
|
||||
api_key: apiClient.accessToken()
|
||||
});
|
||||
|
||||
fileDownloader.download([
|
||||
{
|
||||
url: downloadHref,
|
||||
itemId: itemId,
|
||||
serverId: serverId
|
||||
}]);
|
||||
|
||||
reject();
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
case 'share':
|
||||
{
|
||||
require(['sharingmanager'], function (sharingManager) {
|
||||
sharingManager.showMenu({
|
||||
serverId: serverId,
|
||||
itemId: itemId
|
||||
|
||||
}).then(reject);
|
||||
});
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function show(options) {
|
||||
|
||||
return getCommands(options).then(function (commands) {
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
require(['actionsheet'], function (actionSheet) {
|
||||
|
||||
actionSheet.show({
|
||||
items: commands
|
||||
}).then(function (id) {
|
||||
executeCommand(options.item, id).then(resolve);
|
||||
}, reject);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
getCommands: getCommands,
|
||||
show: show
|
||||
};
|
||||
});
|
|
@ -1,4 +1,4 @@
|
|||
define(['dialogHelper', 'globalize', 'layoutManager', 'mediaInfo', 'apphost', 'connectionManager', 'require', 'loading', 'scrollHelper', 'scrollStyles', 'paper-checkbox', 'paper-input', 'paper-icon-button-light', 'css!./../formdialog', 'css!./recordingcreator', 'html!./../icons/mediainfo.html', 'html!./../icons/nav.html'], function (dialogHelper, globalize, layoutManager, mediaInfo, appHost, connectionManager, require, loading, scrollHelper) {
|
||||
define(['dialogHelper', 'globalize', 'layoutManager', 'mediaInfo', 'apphost', 'connectionManager', 'require', 'loading', 'scrollHelper', 'scrollStyles', 'paper-checkbox', 'emby-collapsible', 'paper-input', 'paper-icon-button-light', 'css!./../formdialog', 'css!./recordingcreator', 'html!./../icons/mediainfo.html', 'html!./../icons/nav.html'], function (dialogHelper, globalize, layoutManager, mediaInfo, appHost, connectionManager, require, loading, scrollHelper) {
|
||||
|
||||
var currentProgramId;
|
||||
var currentServerId;
|
||||
|
@ -261,6 +261,12 @@
|
|||
|
||||
context.querySelector('#chkConvertRecordings').checked = config.EnableRecordingEncoding;
|
||||
});
|
||||
|
||||
if (layoutManager.tv) {
|
||||
context.querySelector('.advanced').classList.add('hide');
|
||||
} else {
|
||||
context.querySelector('.advanced').classList.remove('hide');
|
||||
}
|
||||
}
|
||||
|
||||
function selectDays(page, days) {
|
||||
|
@ -399,9 +405,7 @@
|
|||
|
||||
reload(dlg, itemId);
|
||||
|
||||
setTimeout(function () {
|
||||
dialogHelper.open(dlg);
|
||||
}, 1000);
|
||||
dialogHelper.open(dlg);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -43,15 +43,23 @@
|
|||
<br />
|
||||
<paper-checkbox id="chkConvertRecordings">${OptionConvertRecordingsToStreamingFormat}</paper-checkbox>
|
||||
<div class="fieldDescription paperCheckboxFieldDescription">${OptionConvertRecordingsToStreamingFormatHelp}</div>
|
||||
<div class="fieldDescription paperCheckboxFieldDescription btnSupporterForConverting hide"><a target="_blank" class="accent lnkPremiere">${FeatureRequiresEmbyPremiere}</a></div>
|
||||
<div class="fieldDescription paperCheckboxFieldDescription btnSupporterForConverting hide">
|
||||
<a href="#" class="accent lnkPremiere">${FeatureRequiresEmbyPremiere}</a>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<div>
|
||||
<paper-input type="number" id="txtPrePaddingMinutes" pattern="[0-9]*" required="required" min="0" step="1" label="${PrePaddingMinutes}"></paper-input>
|
||||
</div>
|
||||
<br />
|
||||
<div>
|
||||
<paper-input type="number" id="txtPostPaddingMinutes" pattern="[0-9]*" required="required" min="0" step="1" label="${PostPaddingMinutes}"></paper-input>
|
||||
<div class="advanced hide">
|
||||
<br />
|
||||
<br />
|
||||
<emby-collapsible title="${Advanced}">
|
||||
<div>
|
||||
<paper-input type="number" id="txtPrePaddingMinutes" pattern="[0-9]*" required="required" min="0" step="1" label="${PrePaddingMinutes}"></paper-input>
|
||||
</div>
|
||||
<br />
|
||||
<div>
|
||||
<paper-input type="number" id="txtPostPaddingMinutes" pattern="[0-9]*" required="required" min="0" step="1" label="${PostPaddingMinutes}"></paper-input>
|
||||
</div>
|
||||
</emby-collapsible>
|
||||
<br />
|
||||
</div>
|
||||
<br />
|
||||
<div>
|
||||
|
@ -60,7 +68,7 @@
|
|||
<p class="supporterTrial hide">${HeaderEnjoyDayTrial}</p>
|
||||
<a class="clearLink btnSupporter hide" href="http://emby.media/premiere" target="_blank"><paper-button raised class="accent block"><iron-icon icon="nav:check"></iron-icon><span>${HeaderBecomeProjectSupporter}</span></paper-button></a>
|
||||
</div>
|
||||
<paper-button raised class="submit btnSubmit block"><iron-icon icon="mediainfo:fiber-manual-record"></iron-icon><span>${Record}</span></paper-button>
|
||||
<paper-button raised class="btnSubmit block"><iron-icon icon="mediainfo:fiber-manual-record"></iron-icon><span>${Record}</span></paper-button>
|
||||
</div>
|
||||
<br />
|
||||
<br />
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
define(function () {
|
||||
|
||||
var importedFiles = [];
|
||||
|
||||
return {
|
||||
|
||||
load: function (url, req, load, config) {
|
||||
|
@ -10,7 +8,9 @@ define(function () {
|
|||
url = config.baseUrl + url;
|
||||
}
|
||||
|
||||
url = url + "?" + config.urlArgs;
|
||||
if (config.urlArgs) {
|
||||
url += config.urlArgs(url, url);
|
||||
}
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', url, true);
|
||||
|
|
|
@ -8,10 +8,8 @@
|
|||
|
||||
// Delete the share since it was cancelled
|
||||
apiClient.ajax({
|
||||
|
||||
type: 'DELETE',
|
||||
url: apiClient.getUrl('Social/Shares/' + shareId)
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -41,7 +39,7 @@
|
|||
|
||||
loading.hide();
|
||||
|
||||
sharingMenu.showMenu(options).then(function() {
|
||||
return sharingMenu.showMenu(options).then(function () {
|
||||
console.log('share success. shareId: ' + options.share.Id);
|
||||
}, function () {
|
||||
onSharingCancel(options, apiClient);
|
||||
|
|
14
dashboard-ui/bower_components/emby-webcomponents/shell.js
vendored
Normal file
14
dashboard-ui/bower_components/emby-webcomponents/shell.js
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
define([], function () {
|
||||
|
||||
return {
|
||||
openUrl: function (url) {
|
||||
window.open(url, '_blank');
|
||||
},
|
||||
canExec: false,
|
||||
exec: function (options) {
|
||||
// options.path
|
||||
// options.arguments
|
||||
return Promise.reject();
|
||||
}
|
||||
};
|
||||
});
|
|
@ -45,5 +45,7 @@
|
|||
"OptionConvertRecordingsToStreamingFormat": "Automatically convert recordings to a streaming friendly format",
|
||||
"OptionConvertRecordingsToStreamingFormatHelp": "Recordings will be converted on the fly to MP4 for easy playback on your devices.",
|
||||
"FeatureRequiresEmbyPremiere": "This feature requires an active Emby Premiere subscription.",
|
||||
"Record": "Record"
|
||||
"Record": "Record",
|
||||
"Download": "Download",
|
||||
"Advanced": "Advanced"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue