20 lines
485 B
JavaScript
20 lines
485 B
JavaScript
'use strict';
|
|
|
|
define(
|
|
[
|
|
'handlebars'
|
|
], function (Handlebars) {
|
|
|
|
var placeHolder = '/Content/Images/poster-dark.jpg';
|
|
|
|
window.NzbDrone.imageError = function (img) {
|
|
if (!img.src.contains(placeHolder)) {
|
|
img.src = placeHolder;
|
|
}
|
|
};
|
|
|
|
Handlebars.registerHelper('defaultImg', function () {
|
|
return new Handlebars.SafeString('onerror=window.NzbDrone.imageError(this)');
|
|
});
|
|
});
|