From: Mark Clarkstone Date: Sat, 7 May 2016 21:16:28 +0000 (+0100) Subject: webui: display an error message when help doc is not available/fails to load X-Git-Tag: v4.2.1~538 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4880b5d7369c122f512dc8736adf8aa48dfbb974;p=thirdparty%2Ftvheadend.git webui: display an error message when help doc is not available/fails to load --- 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, }); };