mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 19:38:20 -07:00
24 lines
514 B
JavaScript
24 lines
514 B
JavaScript
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);
|
|
}
|
|
});
|
|
|
|
};
|
|
}); |