mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 11:28:23 -07:00
26 lines
546 B
JavaScript
26 lines
546 B
JavaScript
define([], function () {
|
|
|
|
function replaceAll(str, find, replace) {
|
|
|
|
return str.split(find).join(replace);
|
|
}
|
|
|
|
return function (options) {
|
|
|
|
if (typeof options === 'string') {
|
|
options = {
|
|
title: '',
|
|
text: options
|
|
};
|
|
}
|
|
|
|
var text = replaceAll(options.text || '', '<br/>', '\n');
|
|
var result = confirm(text);
|
|
|
|
if (result) {
|
|
return Promise.resolve();
|
|
} else {
|
|
return Promise.reject();
|
|
}
|
|
};
|
|
}); |