From 4880b5d7369c122f512dc8736adf8aa48dfbb974 Mon Sep 17 00:00:00 2001 From: Mark Clarkstone Date: Sat, 7 May 2016 22:16:28 +0100 Subject: [PATCH] webui: display an error message when help doc is not available/fails to load --- src/webui/static/app/tvheadend.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/webui/static/app/tvheadend.js b/src/webui/static/app/tvheadend.js index 4f3da5489..3dbf4d149 100644 --- a/src/webui/static/app/tvheadend.js +++ b/src/webui/static/app/tvheadend.js @@ -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!') + '
' + + _('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) { @@ -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, }); }; -- 2.47.3