mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
use shared prompt
This commit is contained in:
parent
4c2a7ed02d
commit
adb3a60373
10 changed files with 215 additions and 36 deletions
|
@ -15,12 +15,12 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"version": "1.0.60",
|
"version": "1.0.65",
|
||||||
"_release": "1.0.60",
|
"_release": "1.0.65",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "1.0.60",
|
"tag": "1.0.65",
|
||||||
"commit": "a55e4324dc88ec5cfa9640d1f5d59228a4c7c8c8"
|
"commit": "2117b3bb2d88bef07f2c150101683db8857021dd"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/MediaBrowser/emby-webcomponents.git",
|
"_source": "git://github.com/MediaBrowser/emby-webcomponents.git",
|
||||||
"_target": "~1.0.0",
|
"_target": "~1.0.0",
|
||||||
|
|
41
dashboard-ui/bower_components/emby-webcomponents/prompt/icons.html
vendored
Normal file
41
dashboard-ui/bower_components/emby-webcomponents/prompt/icons.html
vendored
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
<!--
|
||||||
|
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
||||||
|
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||||
|
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||||
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||||
|
Code distributed by Google as part of the polymer project is also
|
||||||
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||||
|
-->
|
||||||
|
<!--
|
||||||
|
`iron-icons` is a utility import that includes the definition for the `iron-icon` element, `iron-iconset-svg` element, as well as an import for the default icon set.
|
||||||
|
|
||||||
|
The `iron-icons` directory also includes imports for additional icon sets that can be loaded into your project.
|
||||||
|
|
||||||
|
Example loading icon set:
|
||||||
|
|
||||||
|
<link rel="import" href="../iron-icons/maps-icons.html">
|
||||||
|
|
||||||
|
To use an icon from one of these sets, first prefix your `iron-icon` with the icon set name, followed by a colon, ":", and then the icon id.
|
||||||
|
|
||||||
|
Example using the directions-bus icon from the maps icon set:
|
||||||
|
|
||||||
|
<iron-icon icon="maps:directions-bus"></iron-icon>
|
||||||
|
|
||||||
|
|
||||||
|
See [iron-icon](#iron-icon) for more information about working with icons.
|
||||||
|
|
||||||
|
See [iron-iconset](#iron-iconset) and [iron-iconset-svg](#iron-iconset-svg) for more information about how to create a custom iconset.
|
||||||
|
|
||||||
|
@group Iron Elements
|
||||||
|
@element iron-icons
|
||||||
|
@demo demo/index.html
|
||||||
|
-->
|
||||||
|
|
||||||
|
<iron-iconset-svg name="dialog" size="24">
|
||||||
|
<svg>
|
||||||
|
<defs>
|
||||||
|
<g id="arrow-back"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /></g>
|
||||||
|
<g id="check"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" /></g>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
</iron-iconset-svg>
|
24
dashboard-ui/bower_components/emby-webcomponents/prompt/nativeprompt.js
vendored
Normal file
24
dashboard-ui/bower_components/emby-webcomponents/prompt/nativeprompt.js
vendored
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
define([], function () {
|
||||||
|
|
||||||
|
return function (options) {
|
||||||
|
|
||||||
|
return new Promise(function (resolve, reject) {
|
||||||
|
|
||||||
|
if (typeof options === 'string') {
|
||||||
|
options = {
|
||||||
|
title: '',
|
||||||
|
text: options
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = prompt(options.title || '', options.text || '');
|
||||||
|
|
||||||
|
if (result) {
|
||||||
|
resolve(result);
|
||||||
|
} else {
|
||||||
|
reject(result);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
});
|
84
dashboard-ui/bower_components/emby-webcomponents/prompt/prompt.js
vendored
Normal file
84
dashboard-ui/bower_components/emby-webcomponents/prompt/prompt.js
vendored
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
define(['paperdialoghelper', 'layoutManager', 'html!./icons.html', 'css!./style.css', 'paper-button', 'paper-input'], function (paperdialoghelper, layoutManager) {
|
||||||
|
|
||||||
|
function show(options, resolve, reject) {
|
||||||
|
|
||||||
|
var dialogOptions = {
|
||||||
|
removeOnClose: true
|
||||||
|
};
|
||||||
|
|
||||||
|
if (layoutManager.tv) {
|
||||||
|
dialogOptions.size = 'fullscreen';
|
||||||
|
}
|
||||||
|
|
||||||
|
var dlg = paperdialoghelper.createDialog(dialogOptions);
|
||||||
|
|
||||||
|
dlg.classList.add('promptDialog');
|
||||||
|
|
||||||
|
var html = '';
|
||||||
|
var submitValue = '';
|
||||||
|
|
||||||
|
html += '<div style="margin:0;padding:0;width:50%;text-align:left;">';
|
||||||
|
html += '<paper-icon-button tabindex="-1" icon="dialog:arrow-back" class="btnPromptExit"></paper-icon-button>';
|
||||||
|
|
||||||
|
if (options.title) {
|
||||||
|
html += '<h1 style="margin-bottom:0;">';
|
||||||
|
html += options.title;
|
||||||
|
html += '</h1>';
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '<paper-input autoFocus class="txtPromptValue"></paper-input>';
|
||||||
|
|
||||||
|
// TODO: An actual form element should probably be added
|
||||||
|
html += '<br/>';
|
||||||
|
html += '<paper-button raised class="block paperSubmit"><iron-icon icon="dialog:check"></iron-icon><span>' + Globalize.translate('core#ButtonOk') + '</span></paper-button>';
|
||||||
|
|
||||||
|
html += '</div>';
|
||||||
|
|
||||||
|
dlg.innerHTML = html;
|
||||||
|
|
||||||
|
if (options.text) {
|
||||||
|
dlg.querySelector('.txtPromptValue').value = options.text;
|
||||||
|
}
|
||||||
|
|
||||||
|
document.body.appendChild(dlg);
|
||||||
|
|
||||||
|
dlg.querySelector('.paperSubmit').addEventListener('click', function (e) {
|
||||||
|
|
||||||
|
submitValue = dlg.querySelector('.txtPromptValue').value;
|
||||||
|
paperdialoghelper.close(dlg);
|
||||||
|
});
|
||||||
|
|
||||||
|
dlg.querySelector('.btnPromptExit').addEventListener('click', function (e) {
|
||||||
|
|
||||||
|
paperdialoghelper.close(dlg);
|
||||||
|
});
|
||||||
|
|
||||||
|
dlg.addEventListener('iron-overlay-closed', function () {
|
||||||
|
|
||||||
|
var value = submitValue;
|
||||||
|
if (value) {
|
||||||
|
resolve(value);
|
||||||
|
} else {
|
||||||
|
reject();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
paperdialoghelper.open(dlg);
|
||||||
|
}
|
||||||
|
|
||||||
|
return function (options) {
|
||||||
|
|
||||||
|
return new Promise(function (resolve, reject) {
|
||||||
|
|
||||||
|
if (typeof options === 'string') {
|
||||||
|
options = {
|
||||||
|
title: '',
|
||||||
|
text: options
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
show(options, resolve, reject);
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
});
|
20
dashboard-ui/bower_components/emby-webcomponents/prompt/style.css
vendored
Normal file
20
dashboard-ui/bower_components/emby-webcomponents/prompt/style.css
vendored
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
.promptDialog {
|
||||||
|
flex-direction: column;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btnPromptExit {
|
||||||
|
z-index: 1002;
|
||||||
|
position: absolute;
|
||||||
|
top: .5em;
|
||||||
|
left: .5em;
|
||||||
|
width: 5.2vh;
|
||||||
|
height: 5.2vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.txtPromptValue label {
|
||||||
|
font-size: 200%;
|
||||||
|
}
|
|
@ -10,8 +10,10 @@
|
||||||
// Some 1080- videos are reported as 1912?
|
// Some 1080- videos are reported as 1912?
|
||||||
if (maxAllowedWidth >= 1900) {
|
if (maxAllowedWidth >= 1900) {
|
||||||
|
|
||||||
options.push({ name: '1080p - 50Mbps', maxHeight: 1080, bitrate: 40000000 });
|
options.push({ name: '1080p - 60Mbps', maxHeight: 1080, bitrate: 60000000 });
|
||||||
options.push({ name: '1080p - 45Mbps', maxHeight: 1080, bitrate: 40000000 });
|
options.push({ name: '1080p - 55Mbps', maxHeight: 1080, bitrate: 55000000 });
|
||||||
|
options.push({ name: '1080p - 50Mbps', maxHeight: 1080, bitrate: 50000000 });
|
||||||
|
options.push({ name: '1080p - 45Mbps', maxHeight: 1080, bitrate: 45000000 });
|
||||||
options.push({ name: '1080p - 40Mbps', maxHeight: 1080, bitrate: 40000000 });
|
options.push({ name: '1080p - 40Mbps', maxHeight: 1080, bitrate: 40000000 });
|
||||||
options.push({ name: '1080p - 35Mbps', maxHeight: 1080, bitrate: 35000000 });
|
options.push({ name: '1080p - 35Mbps', maxHeight: 1080, bitrate: 35000000 });
|
||||||
options.push({ name: '1080p - 30Mbps', maxHeight: 1080, bitrate: 30000000 });
|
options.push({ name: '1080p - 30Mbps', maxHeight: 1080, bitrate: 30000000 });
|
||||||
|
|
|
@ -29,14 +29,14 @@
|
||||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||||
},
|
},
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"homepage": "https://github.com/PolymerElements/iron-behaviors",
|
"homepage": "https://github.com/polymerelements/iron-behaviors",
|
||||||
"_release": "1.0.12",
|
"_release": "1.0.12",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "v1.0.12",
|
"tag": "v1.0.12",
|
||||||
"commit": "657f526a2382a659cdf4e13be87ecc89261588a3"
|
"commit": "657f526a2382a659cdf4e13be87ecc89261588a3"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/PolymerElements/iron-behaviors.git",
|
"_source": "git://github.com/polymerelements/iron-behaviors.git",
|
||||||
"_target": "^1.0.0",
|
"_target": "^1.0.0",
|
||||||
"_originalSource": "PolymerElements/iron-behaviors"
|
"_originalSource": "polymerelements/iron-behaviors"
|
||||||
}
|
}
|
|
@ -1,10 +0,0 @@
|
||||||
define([], function () {
|
|
||||||
return function (options) {
|
|
||||||
|
|
||||||
var result = prompt(options.text, options.defaultText || '');
|
|
||||||
|
|
||||||
if (options.callback) {
|
|
||||||
options.callback(result);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
|
@ -1810,10 +1810,8 @@ var AppInfo = {};
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
function initRequire() {
|
function getBowerPath() {
|
||||||
|
|
||||||
var urlArgs = "v=" + (window.dashboardVersion || new Date().getDate());
|
|
||||||
|
|
||||||
var bowerPath = "bower_components";
|
var bowerPath = "bower_components";
|
||||||
|
|
||||||
// Put the version into the bower path since we can't easily put a query string param on html imports
|
// Put the version into the bower path since we can't easily put a query string param on html imports
|
||||||
|
@ -1822,6 +1820,15 @@ var AppInfo = {};
|
||||||
bowerPath += window.dashboardVersion;
|
bowerPath += window.dashboardVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return bowerPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
function initRequire() {
|
||||||
|
|
||||||
|
var urlArgs = "v=" + (window.dashboardVersion || new Date().getDate());
|
||||||
|
|
||||||
|
var bowerPath = getBowerPath();
|
||||||
|
|
||||||
var apiClientBowerPath = bowerPath + "/emby-apiclient";
|
var apiClientBowerPath = bowerPath + "/emby-apiclient";
|
||||||
var embyWebComponentsBowerPath = bowerPath + '/emby-webcomponents';
|
var embyWebComponentsBowerPath = bowerPath + '/emby-webcomponents';
|
||||||
|
|
||||||
|
@ -1870,14 +1877,12 @@ var AppInfo = {};
|
||||||
|
|
||||||
if (Dashboard.isRunningInCordova()) {
|
if (Dashboard.isRunningInCordova()) {
|
||||||
paths.dialog = "cordova/dialog";
|
paths.dialog = "cordova/dialog";
|
||||||
paths.prompt = "cordova/prompt";
|
|
||||||
paths.sharingwidget = "cordova/sharingwidget";
|
paths.sharingwidget = "cordova/sharingwidget";
|
||||||
paths.serverdiscovery = "cordova/serverdiscovery";
|
paths.serverdiscovery = "cordova/serverdiscovery";
|
||||||
paths.wakeonlan = "cordova/wakeonlan";
|
paths.wakeonlan = "cordova/wakeonlan";
|
||||||
paths.actionsheet = "cordova/actionsheet";
|
paths.actionsheet = "cordova/actionsheet";
|
||||||
} else {
|
} else {
|
||||||
paths.dialog = "components/dialog";
|
paths.dialog = "components/dialog";
|
||||||
paths.prompt = "components/prompt";
|
|
||||||
paths.sharingwidget = "components/sharingwidget";
|
paths.sharingwidget = "components/sharingwidget";
|
||||||
paths.serverdiscovery = apiClientBowerPath + "/serverdiscovery";
|
paths.serverdiscovery = apiClientBowerPath + "/serverdiscovery";
|
||||||
paths.wakeonlan = apiClientBowerPath + "/wakeonlan";
|
paths.wakeonlan = apiClientBowerPath + "/wakeonlan";
|
||||||
|
@ -2035,6 +2040,21 @@ var AppInfo = {};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function initRequireWithBrowser(browser) {
|
||||||
|
|
||||||
|
var bowerPath = getBowerPath();
|
||||||
|
|
||||||
|
var embyWebComponentsBowerPath = bowerPath + '/emby-webcomponents';
|
||||||
|
|
||||||
|
if (Dashboard.isRunningInCordova()) {
|
||||||
|
define("prompt", ["cordova/prompt"], returnFirstDependency);
|
||||||
|
} else if (browser.mobile) {
|
||||||
|
define("prompt", [embyWebComponentsBowerPath + "/prompt/nativeprompt"], returnFirstDependency);
|
||||||
|
} else {
|
||||||
|
define("prompt", [embyWebComponentsBowerPath + "/prompt/prompt"], returnFirstDependency);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function init(hostingAppInfo) {
|
function init(hostingAppInfo) {
|
||||||
|
|
||||||
if (Dashboard.isRunningInCordova() && browserInfo.android) {
|
if (Dashboard.isRunningInCordova() && browserInfo.android) {
|
||||||
|
@ -2448,6 +2468,8 @@ var AppInfo = {};
|
||||||
|
|
||||||
require(initialDependencies, function (browser, appStorage) {
|
require(initialDependencies, function (browser, appStorage) {
|
||||||
|
|
||||||
|
initRequireWithBrowser(browser);
|
||||||
|
|
||||||
window.browserInfo = browser;
|
window.browserInfo = browser;
|
||||||
window.appStorage = appStorage;
|
window.appStorage = appStorage;
|
||||||
|
|
||||||
|
|
|
@ -343,18 +343,14 @@
|
||||||
require(['prompt'], function (prompt) {
|
require(['prompt'], function (prompt) {
|
||||||
|
|
||||||
prompt({
|
prompt({
|
||||||
text: Globalize.translate('LabelTag'),
|
title: Globalize.translate('LabelTag')
|
||||||
title: Globalize.translate('HeaderAddTag'),
|
|
||||||
callback: function(value) {
|
|
||||||
|
|
||||||
if (value) {
|
|
||||||
var tags = getBlockedTagsFromPage(page);
|
|
||||||
|
|
||||||
if (tags.indexOf(value) == -1) {
|
}).then(function (value) {
|
||||||
tags.push(value);
|
var tags = getBlockedTagsFromPage(page);
|
||||||
loadBlockedTags(page, tags);
|
|
||||||
}
|
if (tags.indexOf(value) == -1) {
|
||||||
}
|
tags.push(value);
|
||||||
|
loadBlockedTags(page, tags);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue