]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
webui: display an error message when help doc is not available/fails to load
authorMark Clarkstone <hello@markclarkstone.co.uk>
Sat, 7 May 2016 21:16:28 +0000 (22:16 +0100)
committerJaroslav Kysela <perex@perex.cz>
Wed, 11 May 2016 19:09:22 +0000 (21:09 +0200)
src/webui/static/app/tvheadend.js

index 4f3da54894c4140d5c7d9360b2715df40d81d54a..3dbf4d149418bc7f94eca47e366f04235b4c1c2d 100644 (file)
@@ -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) {
@@ -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,
     });
 };