mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
a694661cc1
commit
9ff21cf7b8
9 changed files with 174 additions and 126 deletions
|
@ -15,12 +15,12 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"version": "1.4.106",
|
"version": "1.4.107",
|
||||||
"_release": "1.4.106",
|
"_release": "1.4.107",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "1.4.106",
|
"tag": "1.4.107",
|
||||||
"commit": "a24b7adf582019433bcd1cc93c7c38495e642d89"
|
"commit": "924bb12b6d7c3536ee00fc1a58ac4c492c36f559"
|
||||||
},
|
},
|
||||||
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
|
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
|
||||||
"_target": "^1.2.0",
|
"_target": "^1.2.0",
|
||||||
|
|
|
@ -217,16 +217,30 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var timeout;
|
||||||
|
if (options.timeout) {
|
||||||
|
timeout = setTimeout(function () {
|
||||||
|
dialogHelper.close(dlg);
|
||||||
|
}, options.timeout);
|
||||||
|
}
|
||||||
|
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
|
|
||||||
dlg.addEventListener('close', function () {
|
dlg.addEventListener('close', function () {
|
||||||
|
|
||||||
|
if (timeout) {
|
||||||
|
clearTimeout(timeout);
|
||||||
|
timeout = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (selectedId != null) {
|
if (selectedId != null) {
|
||||||
if (options.callback) {
|
if (options.callback) {
|
||||||
options.callback(selectedId);
|
options.callback(selectedId);
|
||||||
}
|
}
|
||||||
|
|
||||||
resolve(selectedId);
|
resolve(selectedId);
|
||||||
|
} else {
|
||||||
|
reject();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,116 +1,4 @@
|
||||||
define(['layoutManager', 'globalize'], function (layoutManager, globalize) {
|
define(['dialog', 'globalize'], function (dialog, globalize) {
|
||||||
|
|
||||||
function showTvConfirm(options) {
|
|
||||||
return new Promise(function (resolve, reject) {
|
|
||||||
|
|
||||||
require(['actionsheet'], function (actionSheet) {
|
|
||||||
|
|
||||||
var items = [];
|
|
||||||
|
|
||||||
items.push({
|
|
||||||
name: globalize.translate('sharedcomponents#ButtonOk'),
|
|
||||||
id: 'ok'
|
|
||||||
});
|
|
||||||
|
|
||||||
items.push({
|
|
||||||
name: globalize.translate('sharedcomponents#ButtonCancel'),
|
|
||||||
id: 'cancel'
|
|
||||||
});
|
|
||||||
|
|
||||||
actionSheet.show({
|
|
||||||
|
|
||||||
title: options.text,
|
|
||||||
items: items
|
|
||||||
|
|
||||||
}).then(function (id) {
|
|
||||||
|
|
||||||
switch (id) {
|
|
||||||
|
|
||||||
case 'ok':
|
|
||||||
resolve();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
reject();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}, reject);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function showConfirmInternal(options, dialogHelper, resolve, reject) {
|
|
||||||
|
|
||||||
var dialogOptions = {
|
|
||||||
removeOnClose: true
|
|
||||||
};
|
|
||||||
|
|
||||||
var backButton = false;
|
|
||||||
|
|
||||||
if (layoutManager.tv) {
|
|
||||||
dialogOptions.size = 'fullscreen';
|
|
||||||
backButton = true;
|
|
||||||
dialogOptions.autoFocus = true;
|
|
||||||
} else {
|
|
||||||
|
|
||||||
dialogOptions.modal = false;
|
|
||||||
dialogOptions.entryAnimationDuration = 160;
|
|
||||||
dialogOptions.exitAnimationDuration = 160;
|
|
||||||
dialogOptions.autoFocus = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var dlg = dialogHelper.createDialog(dialogOptions);
|
|
||||||
var html = '';
|
|
||||||
|
|
||||||
if (options.title) {
|
|
||||||
html += '<h2>' + options.title + '</h2>';
|
|
||||||
}
|
|
||||||
|
|
||||||
var text = options.html || options.text;
|
|
||||||
|
|
||||||
if (text) {
|
|
||||||
html += '<div>' + text + '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
html += '<div class="buttons">';
|
|
||||||
|
|
||||||
html += '<button is="emby-button" type="button" class="btnConfirm" autofocus>' + globalize.translate('sharedcomponents#ButtonOk') + '</button>';
|
|
||||||
|
|
||||||
html += '<button is="emby-button" type="button" class="btnCancel">' + globalize.translate('sharedcomponents#ButtonCancel') + '</button>';
|
|
||||||
|
|
||||||
html += '</div>';
|
|
||||||
|
|
||||||
dlg.innerHTML = html;
|
|
||||||
document.body.appendChild(dlg);
|
|
||||||
|
|
||||||
var confirmed = false;
|
|
||||||
dlg.querySelector('.btnConfirm').addEventListener('click', function () {
|
|
||||||
confirmed = true;
|
|
||||||
dialogHelper.close(dlg);
|
|
||||||
});
|
|
||||||
dlg.querySelector('.btnCancel').addEventListener('click', function () {
|
|
||||||
confirmed = false;
|
|
||||||
dialogHelper.close(dlg);
|
|
||||||
});
|
|
||||||
|
|
||||||
dialogHelper.open(dlg).then(function () {
|
|
||||||
|
|
||||||
if (confirmed) {
|
|
||||||
resolve();
|
|
||||||
} else {
|
|
||||||
reject();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function showConfirm(options) {
|
|
||||||
return new Promise(function (resolve, reject) {
|
|
||||||
|
|
||||||
require(['dialogHelper', 'emby-button'], function (dialogHelper) {
|
|
||||||
showConfirmInternal(options, dialogHelper, resolve, reject);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return function (text, title) {
|
return function (text, title) {
|
||||||
|
|
||||||
|
@ -124,10 +12,26 @@ define(['layoutManager', 'globalize'], function (layoutManager, globalize) {
|
||||||
options = text;
|
options = text;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (layoutManager.tv) {
|
var items = [];
|
||||||
return showTvConfirm(options);
|
|
||||||
|
items.push({
|
||||||
|
name: globalize.translate('sharedcomponents#ButtonOk'),
|
||||||
|
id: 'ok'
|
||||||
|
});
|
||||||
|
|
||||||
|
items.push({
|
||||||
|
name: globalize.translate('sharedcomponents#ButtonCancel'),
|
||||||
|
id: 'cancel'
|
||||||
|
});
|
||||||
|
|
||||||
|
options.buttons = items;
|
||||||
|
|
||||||
|
return dialog(options).then(function (result) {
|
||||||
|
if (result == 'ok') {
|
||||||
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
return showConfirm(options);
|
return Promise.reject();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
});
|
});
|
126
dashboard-ui/bower_components/emby-webcomponents/dialog/dialog.js
vendored
Normal file
126
dashboard-ui/bower_components/emby-webcomponents/dialog/dialog.js
vendored
Normal file
|
@ -0,0 +1,126 @@
|
||||||
|
define(['layoutManager', 'globalize'], function (layoutManager, globalize) {
|
||||||
|
|
||||||
|
function showTvDialog(options) {
|
||||||
|
return new Promise(function (resolve, reject) {
|
||||||
|
|
||||||
|
require(['actionsheet'], function (actionSheet) {
|
||||||
|
|
||||||
|
var items = [];
|
||||||
|
|
||||||
|
items.push({
|
||||||
|
name: globalize.translate('sharedcomponents#ButtonOk'),
|
||||||
|
id: 'ok'
|
||||||
|
});
|
||||||
|
|
||||||
|
items.push({
|
||||||
|
name: globalize.translate('sharedcomponents#ButtonCancel'),
|
||||||
|
id: 'cancel'
|
||||||
|
});
|
||||||
|
|
||||||
|
actionSheet.show({
|
||||||
|
|
||||||
|
title: options.text,
|
||||||
|
items: options.buttons
|
||||||
|
|
||||||
|
}).then(resolve, reject);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function showDialogInternal(options, dialogHelper, resolve, reject) {
|
||||||
|
|
||||||
|
var dialogOptions = {
|
||||||
|
removeOnClose: true
|
||||||
|
};
|
||||||
|
|
||||||
|
var backButton = false;
|
||||||
|
|
||||||
|
if (layoutManager.tv) {
|
||||||
|
dialogOptions.size = 'fullscreen';
|
||||||
|
backButton = true;
|
||||||
|
dialogOptions.autoFocus = true;
|
||||||
|
} else {
|
||||||
|
|
||||||
|
dialogOptions.modal = false;
|
||||||
|
dialogOptions.entryAnimationDuration = 160;
|
||||||
|
dialogOptions.exitAnimationDuration = 160;
|
||||||
|
dialogOptions.autoFocus = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
var dlg = dialogHelper.createDialog(dialogOptions);
|
||||||
|
var html = '';
|
||||||
|
|
||||||
|
if (options.title) {
|
||||||
|
html += '<h2>' + options.title + '</h2>';
|
||||||
|
}
|
||||||
|
|
||||||
|
var text = options.html || options.text;
|
||||||
|
|
||||||
|
if (text) {
|
||||||
|
html += '<div>' + text + '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '<div class="buttons">';
|
||||||
|
|
||||||
|
var i, length;
|
||||||
|
for (i = 0, length = options.buttons.length; i < length; i++) {
|
||||||
|
|
||||||
|
var item = options.buttons[i];
|
||||||
|
var autoFocus = i == 0 ? ' autofocus' : '';
|
||||||
|
html += '<button is="emby-button" type="button" class="btnOption" data-id="' + item.id + '"' + autoFocus + '>' + item.name + '</button>';
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '</div>';
|
||||||
|
|
||||||
|
dlg.innerHTML = html;
|
||||||
|
document.body.appendChild(dlg);
|
||||||
|
|
||||||
|
var dialogResult;
|
||||||
|
function onButtonClick() {
|
||||||
|
dialogResult = this.getAttribute('data-id');
|
||||||
|
dialogHelper.close(dlg);
|
||||||
|
}
|
||||||
|
|
||||||
|
var buttons = dlg.querySelectorAll('.btnOption');
|
||||||
|
for (i = 0, length = options.buttons.length; i < length; i++) {
|
||||||
|
buttons[i].addEventListener('click', onButtonClick);
|
||||||
|
}
|
||||||
|
|
||||||
|
dialogHelper.open(dlg).then(function () {
|
||||||
|
|
||||||
|
if (dialogResult) {
|
||||||
|
resolve(dialogResult);
|
||||||
|
} else {
|
||||||
|
reject();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function showDialog(options) {
|
||||||
|
return new Promise(function (resolve, reject) {
|
||||||
|
|
||||||
|
require(['dialogHelper', 'emby-button'], function (dialogHelper) {
|
||||||
|
showDialogInternal(options, dialogHelper, resolve, reject);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return function (text, title) {
|
||||||
|
|
||||||
|
var options;
|
||||||
|
if (typeof text === 'string') {
|
||||||
|
options = {
|
||||||
|
title: title,
|
||||||
|
text: text
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
options = text;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (layoutManager.tv) {
|
||||||
|
return showTvDialog(options);
|
||||||
|
}
|
||||||
|
|
||||||
|
return showDialog(options);
|
||||||
|
};
|
||||||
|
});
|
|
@ -1,7 +1,7 @@
|
||||||
button.listItem {
|
button.listItem {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border: 0 !important;
|
border: 0;
|
||||||
border-bottom: 1px solid #2a2a2a !important;
|
border-bottom: 1px solid #2a2a2a;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
outline: none !important;
|
outline: none !important;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
|
@ -138,7 +138,7 @@ div.listItem {
|
||||||
transform: scale(1.025, 1.025);
|
transform: scale(1.025, 1.025);
|
||||||
}
|
}
|
||||||
|
|
||||||
.listItem > .fab:first-child {
|
.listItem > .fab:first-child, .listItem > i:first-child {
|
||||||
margin-left: .75em;
|
margin-left: .75em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -127,5 +127,6 @@
|
||||||
"TryMultiSelectMessage": "To edit multiple media items, just click and hold any poster and select the items you want to manage. Try it!",
|
"TryMultiSelectMessage": "To edit multiple media items, just click and hold any poster and select the items you want to manage. Try it!",
|
||||||
"HeaderConfirmRecordingCancellation": "Confirm Recording Cancellation",
|
"HeaderConfirmRecordingCancellation": "Confirm Recording Cancellation",
|
||||||
"MessageConfirmRecordingCancellation": "Are you sure you wish to cancel this recording?",
|
"MessageConfirmRecordingCancellation": "Are you sure you wish to cancel this recording?",
|
||||||
"Error": "Error"
|
"Error": "Error",
|
||||||
|
"VoiceInput": "Voice Input"
|
||||||
}
|
}
|
|
@ -114,7 +114,7 @@ define(['dialogHelper', './voicereceiver', './voiceprocessor', 'globalize', 'emb
|
||||||
html += '<div class="dialogHeader">';
|
html += '<div class="dialogHeader">';
|
||||||
html += '<button is="paper-icon-button-light" class="btnCancelVoiceInput autoSize" tabindex="-1"><i class="md-icon"></i></button>';
|
html += '<button is="paper-icon-button-light" class="btnCancelVoiceInput autoSize" tabindex="-1"><i class="md-icon"></i></button>';
|
||||||
html += '<div class="dialogHeaderTitle">';
|
html += '<div class="dialogHeaderTitle">';
|
||||||
//html += title;
|
html += globalize.translate('sharedcomponents#VoiceInput');
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,7 @@
|
||||||
queue: false,
|
queue: false,
|
||||||
playAllFromHere: false,
|
playAllFromHere: false,
|
||||||
queueAllFromHere: false,
|
queueAllFromHere: false,
|
||||||
|
sync: false,
|
||||||
positionTo: button
|
positionTo: button
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -2175,6 +2175,8 @@ var AppInfo = {};
|
||||||
define("alert", [embyWebComponentsBowerPath + "/alert/alert"], returnFirstDependency);
|
define("alert", [embyWebComponentsBowerPath + "/alert/alert"], returnFirstDependency);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
define("dialog", [embyWebComponentsBowerPath + "/dialog/dialog"], returnFirstDependency);
|
||||||
|
|
||||||
if (preferNativeAlerts && window.confirm) {
|
if (preferNativeAlerts && window.confirm) {
|
||||||
define("confirm", [embyWebComponentsBowerPath + "/confirm/nativeconfirm"], returnFirstDependency);
|
define("confirm", [embyWebComponentsBowerPath + "/confirm/nativeconfirm"], returnFirstDependency);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue