Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
webui: display an error message when help doc is not available/fails …
…to load
  • Loading branch information
Mark Clarkstone authored and perexg committed May 11, 2016
1 parent 7cac901 commit 4880b5d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/webui/static/app/tvheadend.js
Expand Up @@ -227,6 +227,16 @@ tvheadend.mdhelp = function(pagename) {
tvheadend.doc_win = win;
}

var helpfailuremsg = function() {
Ext.MessageBox.show({
title:_('Error'),
msg: _('There was a problem displaying the help page!') + '<br>' +
_('This usually means there is no help available or the document couldn\'t be loaded.'),
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.ERROR,
});
}

Ext.Ajax.request({
url: 'markdown/' + pagename,
success: function(result) {
Expand All @@ -236,12 +246,14 @@ tvheadend.mdhelp = function(pagename) {
success: function(result_toc) {
tvheadend.docs_toc = parse(result_toc.responseText);
fcn(result);
}
},
failure: helpfailuremsg,
});
} else {
fcn(result);
}
}
},
failure: helpfailuremsg,
});
};

Expand Down

0 comments on commit 4880b5d

Please sign in to comment.