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
fbc040dc9c
commit
90d30a0229
73 changed files with 1986 additions and 713 deletions
|
@ -99,17 +99,22 @@
|
|||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
||||
actionsheet.show({
|
||||
var menuOptions = {
|
||||
title: Globalize.translate('HeaderSelectPlayer'),
|
||||
items: menuItems,
|
||||
positionTo: button,
|
||||
|
||||
// Unfortunately we can't allow the url to change or chromecast will throw a security error
|
||||
// Might be able to solve this in the future by moving the dialogs to hashbangs
|
||||
enableHistory: enableHistory !== false && !browser.chrome,
|
||||
resolveOnClick: true
|
||||
|
||||
}).then(function (id) {
|
||||
};
|
||||
|
||||
// Unfortunately we can't allow the url to change or chromecast will throw a security error
|
||||
// Might be able to solve this in the future by moving the dialogs to hashbangs
|
||||
if (!((enableHistory !== false && !browser.chrome) || AppInfo.isNativeApp)) {
|
||||
menuOptions.enableHistory = false;
|
||||
}
|
||||
|
||||
actionsheet.show(menuOptions).then(function (id) {
|
||||
|
||||
var target = targets.filter(function (t) {
|
||||
return t.id == id;
|
||||
|
@ -461,7 +466,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
requirejs(["registrationservices"], function (registrationServices) {
|
||||
requirejs(["registrationServices"], function (registrationServices) {
|
||||
|
||||
self.playbackTimeLimitMs = null;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
view.querySelector('.btnSyncSupporter').addEventListener('click', function () {
|
||||
|
||||
requirejs(["registrationservices"], function (registrationServices) {
|
||||
requirejs(["registrationServices"], function (registrationServices) {
|
||||
registrationServices.validateFeature('sync');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,216 +0,0 @@
|
|||
define(['appStorage', 'shell'], function (appStorage, shell) {
|
||||
|
||||
var supporterPlaybackKey = 'lastSupporterPlaybackMessage4';
|
||||
|
||||
function validatePlayback(resolve, reject) {
|
||||
|
||||
Dashboard.getPluginSecurityInfo().then(function (pluginSecurityInfo) {
|
||||
|
||||
if (pluginSecurityInfo.IsMBSupporter) {
|
||||
resolve();
|
||||
} else {
|
||||
|
||||
var lastMessage = parseInt(appStorage.getItem(supporterPlaybackKey) || '0');
|
||||
|
||||
if (!lastMessage) {
|
||||
|
||||
// Don't show on the very first playback attempt
|
||||
appStorage.setItem(supporterPlaybackKey, new Date().getTime());
|
||||
resolve();
|
||||
}
|
||||
else if ((new Date().getTime() - lastMessage) > 259200000) {
|
||||
|
||||
showPlaybackOverlay(resolve, reject);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getSubscriptionBenefits() {
|
||||
|
||||
var list = [];
|
||||
|
||||
list.push({
|
||||
name: Globalize.translate('CoverArt'),
|
||||
icon: 'photo',
|
||||
text: Globalize.translate('CoverArtFeatureDescription')
|
||||
});
|
||||
|
||||
list.push({
|
||||
name: Globalize.translate('HeaderFreeApps'),
|
||||
icon: 'check',
|
||||
text: Globalize.translate('FreeAppsFeatureDescription')
|
||||
});
|
||||
|
||||
if (Dashboard.capabilities().SupportsSync) {
|
||||
list.push({
|
||||
name: Globalize.translate('HeaderMobileSync'),
|
||||
icon: 'sync',
|
||||
text: Globalize.translate('MobileSyncFeatureDescription')
|
||||
});
|
||||
}
|
||||
else {
|
||||
list.push({
|
||||
name: Globalize.translate('HeaderCinemaMode'),
|
||||
icon: 'movie',
|
||||
text: Globalize.translate('CinemaModeFeatureDescription')
|
||||
});
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
function getSubscriptionBenefitHtml(item) {
|
||||
|
||||
var html = '';
|
||||
html += '<div class="listItem">';
|
||||
|
||||
html += '<i class="listItemIcon md-icon">' + item.icon + '</i>';
|
||||
|
||||
html += '<div class="listItemBody two-line">';
|
||||
html += '<a class="clearLink" href="https://emby.media/premiere" target="_blank">';
|
||||
|
||||
html += '<h3 class="listItemBodyText">';
|
||||
html += item.name;
|
||||
html += '</h3>';
|
||||
|
||||
html += '<div class="listItemBodyText secondary" style="white-space:normal;">';
|
||||
html += item.text;
|
||||
html += '</div>';
|
||||
|
||||
html += '</a>';
|
||||
html += '</div>';
|
||||
|
||||
html += '</div>';
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
function showPlaybackOverlay(resolve, reject) {
|
||||
|
||||
require(['dialogHelper', 'listViewStyle', 'emby-button', 'formDialogStyle'], function (dialogHelper) {
|
||||
|
||||
var dlg = dialogHelper.createDialog({
|
||||
size: 'fullscreen-border',
|
||||
removeOnClose: true,
|
||||
scrollY: false
|
||||
});
|
||||
|
||||
dlg.classList.add('formDialog');
|
||||
|
||||
var html = '';
|
||||
html += '<div class="formDialogHeader">';
|
||||
html += '<button is="paper-icon-button-light" class="btnCancel autoSize" tabindex="-1"><i class="md-icon"></i></button>';
|
||||
html += '<h3 class="formDialogHeaderTitle">';
|
||||
html += '</h3>';
|
||||
|
||||
html += '</div>';
|
||||
|
||||
|
||||
html += '<div class="formDialogContent smoothScrollY">';
|
||||
html += '<div class="dialogContentInner dialog-content-centered">';
|
||||
|
||||
html += '<h1>' + Globalize.translate('HeaderTryEmbyPremiere') + '</h1>';
|
||||
|
||||
html += '<p>' + Globalize.translate('MessageDidYouKnowCinemaMode') + '</p>';
|
||||
html += '<p>' + Globalize.translate('MessageDidYouKnowCinemaMode2') + '</p>';
|
||||
|
||||
html += '<br/>';
|
||||
|
||||
html += '<h1>' + Globalize.translate('HeaderBenefitsEmbyPremiere') + '</h1>';
|
||||
|
||||
html += '<div class="paperList">';
|
||||
html += getSubscriptionBenefits().map(getSubscriptionBenefitHtml).join('');
|
||||
html += '</div>';
|
||||
|
||||
html += '<br/>';
|
||||
|
||||
html += '<a class="clearLink" href="http://emby.media/premiere" target="_blank"><button is="emby-button" type="button" class="raised button-submit block" autoFocus><span>' + Globalize.translate('ButtonBecomeSupporter') + '</span></button></a>';
|
||||
html += '<button is="emby-button" type="button" class="raised subdued block btnCancelSupporterInfo" style="background:#444;"><span>' + Globalize.translate('ButtonClosePlayVideo') + '</span></button>';
|
||||
|
||||
html += '</div>';
|
||||
html += '</div>';
|
||||
|
||||
dlg.innerHTML = html;
|
||||
|
||||
// Has to be assigned a z-index after the call to .open()
|
||||
dlg.addEventListener('close', function (e) {
|
||||
appStorage.setItem(supporterPlaybackKey, new Date().getTime());
|
||||
resolve();
|
||||
});
|
||||
|
||||
dialogHelper.open(dlg);
|
||||
|
||||
var onCancelClick = function () {
|
||||
dialogHelper.close(dlg);
|
||||
};
|
||||
var i, length;
|
||||
var elems = dlg.querySelectorAll('.btnCancelSupporterInfo');
|
||||
for (i = 0, length = elems.length; i < length; i++) {
|
||||
elems[i].addEventListener('click', onCancelClick);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function validateSync(resolve, reject) {
|
||||
|
||||
Dashboard.getPluginSecurityInfo().then(function (pluginSecurityInfo) {
|
||||
|
||||
if (pluginSecurityInfo.IsMBSupporter) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getRegistrationInfo('Sync').then(function (registrationInfo) {
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
||||
if (registrationInfo.IsRegistered) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('HeaderSyncRequiresSupporterMembership') + '<br/><p><a href="http://emby.media/premiere" target="_blank">' + Globalize.translate('ButtonLearnMore') + '</a></p>',
|
||||
title: Globalize.translate('HeaderSync'),
|
||||
callback: reject
|
||||
});
|
||||
|
||||
}, function () {
|
||||
|
||||
reject();
|
||||
Dashboard.hideLoadingMsg();
|
||||
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('ErrorValidatingSupporterInfo')
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
validateFeature: function (name) {
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
if (name == 'playback') {
|
||||
validatePlayback(resolve, reject);
|
||||
} else if (name == 'livetv') {
|
||||
resolve();
|
||||
} else if (name == 'sync') {
|
||||
validateSync(resolve, reject);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
showPremiereInfo: function () {
|
||||
shell.openUrl('https://emby.media/premiere');
|
||||
}
|
||||
};
|
||||
});
|
|
@ -9,7 +9,6 @@
|
|||
}
|
||||
|
||||
function enableScrollX() {
|
||||
|
||||
return browserInfo.mobile && AppInfo.enableAppLayouts;
|
||||
}
|
||||
|
||||
|
|
|
@ -1202,12 +1202,10 @@ var AppInfo = {};
|
|||
if (Dashboard.isRunningInCordova()) {
|
||||
paths.sharingMenu = "cordova/sharingwidget";
|
||||
paths.wakeonlan = "cordova/wakeonlan";
|
||||
paths.actionsheet = "cordova/actionsheet";
|
||||
} else {
|
||||
paths.wakeonlan = apiClientBowerPath + "/wakeonlan";
|
||||
|
||||
define("sharingMenu", [embyWebComponentsBowerPath + "/sharing/sharingmenu"], returnFirstDependency);
|
||||
define("actionsheet", ["webActionSheet"], returnFirstDependency);
|
||||
}
|
||||
|
||||
define("libjass", [bowerPath + "/libjass/libjass.min", "css!" + bowerPath + "/libjass/libjass"], returnFirstDependency);
|
||||
|
@ -1361,17 +1359,14 @@ var AppInfo = {};
|
|||
define("formDialogStyle", ['css!' + embyWebComponentsBowerPath + "/formdialog"], returnFirstDependency);
|
||||
define("indicators", [embyWebComponentsBowerPath + "/indicators/indicators"], returnFirstDependency);
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
define('registrationservices', ['cordova/registrationservices'], returnFirstDependency);
|
||||
|
||||
} else {
|
||||
define('registrationservices', ['scripts/registrationservices'], returnFirstDependency);
|
||||
}
|
||||
define("registrationServices", [embyWebComponentsBowerPath + "/registrationservices/registrationservices"], returnFirstDependency);
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
define("iapManager", ["cordova/iap"], returnFirstDependency);
|
||||
define("localassetmanager", ["cordova/localassetmanager"], returnFirstDependency);
|
||||
define("fileupload", ["cordova/fileupload"], returnFirstDependency);
|
||||
} else {
|
||||
define("iapManager", ["components/iap"], returnFirstDependency);
|
||||
define("localassetmanager", [apiClientBowerPath + "/localassetmanager"], returnFirstDependency);
|
||||
define("fileupload", [apiClientBowerPath + "/fileupload"], returnFirstDependency);
|
||||
}
|
||||
|
@ -1621,6 +1616,12 @@ var AppInfo = {};
|
|||
|
||||
var embyWebComponentsBowerPath = bowerPath + '/emby-webcomponents';
|
||||
|
||||
if (Dashboard.isRunningInCordova() && browser.safari) {
|
||||
paths.actionsheet = "cordova/actionsheet";
|
||||
} else {
|
||||
define("actionsheet", ["webActionSheet"], returnFirstDependency);
|
||||
}
|
||||
|
||||
if (!('registerElement' in document)) {
|
||||
if (browser.msie) {
|
||||
define("registerElement", [bowerPath + '/webcomponentsjs/webcomponents-lite.min.js']);
|
||||
|
@ -2662,7 +2663,7 @@ var AppInfo = {};
|
|||
loadTheme();
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
deps.push('registrationservices');
|
||||
deps.push('registrationServices');
|
||||
|
||||
if (browserInfo.android) {
|
||||
deps.push('cordova/android/androidcredentials');
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(['fetchHelper', 'jQuery', 'registrationservices'], function (fetchHelper, $, registrationServices) {
|
||||
define(['fetchHelper', 'jQuery', 'registrationServices'], function (fetchHelper, $, registrationServices) {
|
||||
|
||||
function load(page) {
|
||||
Dashboard.showLoadingMsg();
|
||||
|
|
|
@ -77,58 +77,8 @@
|
|||
function onButtonClick() {
|
||||
|
||||
var button = this;
|
||||
var buttonTextElement = this.querySelector('span') || this;
|
||||
var text = buttonTextElement.textContent || buttonTextElement.innerText;
|
||||
var taskId = button.getAttribute('data-taskid');
|
||||
|
||||
var key = 'scheduledTaskButton' + options.taskKey;
|
||||
var expectedValue = new Date().getMonth() + '6';
|
||||
|
||||
if (userSettings.get(key) == expectedValue) {
|
||||
onScheduledTaskMessageConfirmed(taskId);
|
||||
} else {
|
||||
|
||||
require(['dialog'], function (dialog) {
|
||||
|
||||
var msg = Globalize.translate('ConfirmMessageScheduledTaskButton');
|
||||
|
||||
var menuItems = [];
|
||||
|
||||
menuItems.push({
|
||||
name: text,
|
||||
id: 'task'
|
||||
});
|
||||
menuItems.push({
|
||||
name: Globalize.translate('ButtonScheduledTasks'),
|
||||
id: 'tasks'
|
||||
});
|
||||
menuItems.push({
|
||||
name: Globalize.translate('ButtonCancel'),
|
||||
id: 'cancel'
|
||||
});
|
||||
|
||||
dialog({
|
||||
buttons: menuItems,
|
||||
text: msg
|
||||
|
||||
}).then(function (id) {
|
||||
switch (id) {
|
||||
|
||||
case 'task':
|
||||
userSettings.set(key, expectedValue);
|
||||
onScheduledTaskMessageConfirmed(taskId);
|
||||
break;
|
||||
case 'tasks':
|
||||
userSettings.set(key, expectedValue);
|
||||
Dashboard.navigate('scheduledtasks.html');
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
onScheduledTaskMessageConfirmed(taskId);
|
||||
}
|
||||
|
||||
function onSocketOpen() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue