jellyfin-web/dashboard-ui/bower_components/emby-webcomponents/confirm/nativeconfirm.js
2016-10-04 01:15:39 -04:00

27 lines
564 B
JavaScript

define([], function () {
'use strict';
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();
}
};
});