New: Support for running from a sub folder (reverse proxy)

This commit is contained in:
Mark McDowall 2014-01-01 22:56:19 -08:00
parent cec479923f
commit b5c9a811dd
22 changed files with 161 additions and 89 deletions

View file

@ -2,10 +2,11 @@
define(
[
'handlebars'
], function (Handlebars) {
'handlebars',
'System/StatusModel'
], function (Handlebars, StatusModel) {
var placeHolder = '/Content/Images/poster-dark.jpg';
var placeHolder = StatusModel.get('urlBase') + '/Content/Images/poster-dark.jpg';
window.NzbDrone.imageError = function (img) {
if (!img.src.contains(placeHolder)) {
@ -17,4 +18,8 @@ define(
Handlebars.registerHelper('defaultImg', function () {
return new Handlebars.SafeString('onerror=window.NzbDrone.imageError(this)');
});
Handlebars.registerHelper('UrlBase', function () {
return new Handlebars.SafeString(StatusModel.get('urlBase'));
});
});