From d368b2526dba159593bb6e7e3b8128cfe4adea96 Mon Sep 17 00:00:00 2001 From: mpmc Date: Mon, 20 Nov 2017 17:19:38 +0000 Subject: [PATCH] mdhelp: more help tweaks webui: add toolbar and "back to top" button to help window --- docs/class/mpegts_mux.md | 3 +- docs/class/mpegts_mux_sched.md | 3 +- docs/class/mpegts_service.md | 2 ++ docs/markdown/inc/networks_contents.md | 2 ++ src/esfilter.c | 7 +++++ src/webui/doc_md.c | 6 ++-- src/webui/static/app/tvheadend.js | 39 +++++++++++++++++--------- 7 files changed, 43 insertions(+), 19 deletions(-) diff --git a/docs/class/mpegts_mux.md b/docs/class/mpegts_mux.md index 14192d74a..e515e08e0 100644 --- a/docs/class/mpegts_mux.md +++ b/docs/class/mpegts_mux.md @@ -3,6 +3,8 @@ Contents | Description [Overview](#overview) | Tab overview [Items/Properties](#items) | Items and Properties +[Return to DVB Inputs](dvbinputs) + --- ## Overview @@ -22,4 +24,3 @@ streams - so an IP address, in effect. inc/buttons --- - diff --git a/docs/class/mpegts_mux_sched.md b/docs/class/mpegts_mux_sched.md index 8b176f4a1..65a4f173a 100644 --- a/docs/class/mpegts_mux_sched.md +++ b/docs/class/mpegts_mux_sched.md @@ -3,6 +3,8 @@ Contents | Description [Overview](#overview) | Tab overview [Items/Properties](#items) | Items and Properties +[Return to DVB Inputs](dvbinputs) + --- ## Overview @@ -19,4 +21,3 @@ useful to get EPG, services or access rights updates. inc/buttons --- - diff --git a/docs/class/mpegts_service.md b/docs/class/mpegts_service.md index 2e76befe4..77ae6f26e 100644 --- a/docs/class/mpegts_service.md +++ b/docs/class/mpegts_service.md @@ -4,6 +4,8 @@ Contents | Description [Service information](#service-information)| How to display service information [Items/Properties](#items) | Items and Properties +[Return to DVB Inputs](dvbinputs) + --- ## Overview diff --git a/docs/markdown/inc/networks_contents.md b/docs/markdown/inc/networks_contents.md index e68f5b536..efefa72b8 100644 --- a/docs/markdown/inc/networks_contents.md +++ b/docs/markdown/inc/networks_contents.md @@ -5,3 +5,5 @@ Contents | Description [Force Scanning](#force-scanning) | Force scanning a network [Service Probing (IPTV only)](#service-probing-iptv-only-) | Service probing information (IPTV only) [Items/Properties](#items) | Items and properties + +[Return to DVB Inputs](dvbinputs) diff --git a/src/esfilter.c b/src/esfilter.c index 42fc856ab..76b2097ba 100644 --- a/src/esfilter.c +++ b/src/esfilter.c @@ -632,6 +632,7 @@ const idclass_t esfilter_class_video = { .set = esfilter_class_type_set_video, .list = esfilter_class_type_enum_video, .rend = esfilter_class_type_rend, + .opts = PO_DOC_NLIST, }, { .type = PT_STR, @@ -726,6 +727,7 @@ const idclass_t esfilter_class_audio = { .set = esfilter_class_type_set_audio, .list = esfilter_class_type_enum_audio, .rend = esfilter_class_type_rend, + .opts = PO_DOC_NLIST, }, { .type = PT_STR, @@ -821,6 +823,7 @@ const idclass_t esfilter_class_teletext = { .set = esfilter_class_type_set_teletext, .list = esfilter_class_type_enum_teletext, .rend = esfilter_class_type_rend, + .opts = PO_DOC_NLIST, }, { .type = PT_STR, @@ -1011,6 +1014,7 @@ const idclass_t esfilter_class_ca = { .set = esfilter_class_type_set_ca, .list = esfilter_class_type_enum_ca, .rend = esfilter_class_type_rend, + .opts = PO_DOC_NLIST, }, { .type = PT_STR, @@ -1021,6 +1025,7 @@ const idclass_t esfilter_class_ca = { .get = esfilter_class_caid_get, .set = esfilter_class_caid_set, .list = esfilter_class_caid_enum, + .opts = PO_DOC_NLIST, }, { .type = PT_STR, @@ -1031,6 +1036,7 @@ const idclass_t esfilter_class_ca = { .get = esfilter_class_caprovider_get, .set = esfilter_class_caprovider_set, .list = esfilter_class_caprovider_enum, + .opts = PO_DOC_NLIST, }, { .type = PT_STR, @@ -1116,6 +1122,7 @@ const idclass_t esfilter_class_other = { .set = esfilter_class_type_set_other, .list = esfilter_class_type_enum_other, .rend = esfilter_class_type_rend, + .opts = PO_DOC_NLIST, }, { .type = PT_STR, diff --git a/src/webui/doc_md.c b/src/webui/doc_md.c index 3a7717fc3..da14e68a9 100644 --- a/src/webui/doc_md.c +++ b/src/webui/doc_md.c @@ -114,12 +114,12 @@ md_props(htsbuf_queue_t *hq, htsmsg_t *m, const char *lang, int nl) if (!s) continue; if (first) { nl = md_nl(hq, nl); - htsbuf_append_str(hq, "#### "); + htsbuf_append_str(hq, "### "); htsbuf_append_str(hq, tvh_gettext_lang(lang, N_("Items"))); md_nl(hq, 1); md_nl(hq, 1); - htsbuf_append_str(hq, tvh_gettext_lang(lang, N_("The items have the following functions:"))); - md_nl(hq, 1); + //htsbuf_append_str(hq, tvh_gettext_lang(lang, N_("The items have the following functions:"))); + //md_nl(hq, 1); first = 0; } nl = md_nl(hq, nl); diff --git a/src/webui/static/app/tvheadend.js b/src/webui/static/app/tvheadend.js index 7af36fd29..506087c3d 100644 --- a/src/webui/static/app/tvheadend.js +++ b/src/webui/static/app/tvheadend.js @@ -385,6 +385,7 @@ tvheadend.mdhelp = function(pagename) { var parse = function(text) { var renderer = new marked.Renderer; + var lastanchor = null; renderer.link = function(href, title, text) { var x = href.indexOf('#'); if (href.indexOf(':/') === -1 && (x === -1 || x > 1)) { @@ -439,7 +440,7 @@ tvheadend.mdhelp = function(pagename) { } var bodyid = Ext.id(); - var text = '
'; + var text = '
'; if (tvheadend.docs_toc || history) text += '
' + history + tvheadend.docs_toc + '
'; text += '
' + parse(mdtext) + '
'; @@ -485,12 +486,21 @@ tvheadend.mdhelp = function(pagename) { } var win = new Ext.Window({ - title: _('Help for') + ' ' + title, + title: title, iconCls: 'help', layout: 'fit', width: 900, height: 400, constrainHeader: true, + bbar: [ + { + iconCls: 'moveup', + text: _('Back to top'), + tooltip: _('Back to top'), + handler: function() { + document.getElementById('jump').scrollIntoView(); + }, + }], items: [content], listeners: { render: function(win) { @@ -542,24 +552,25 @@ tvheadend.mdhelp = function(pagename) { var helpfailuremsg = function() { Ext.MessageBox.show({ title:_('Error'), - msg: _('There was a problem displaying the Help!') + '
' + - _('Please check Tvheadend is running and try again.'), + msg: _('There was a problem displaying the Help!') + '
' + + _('Please check Tvheadend is running and try again.'), buttons: Ext.Msg.OK, icon: Ext.MessageBox.ERROR, }); } - - var helppagefail = function() { + + var helppagefail = function() { title = _('Not Available'); - msg = _('There is no documentation associated with the Help button pressed, or there was an problem loading the page.\n\n') + - _('Please take a look at the other Help pages (Table of Contents). If you still can\'t find what you\'re ') + - _('looking for please see the [Wiki](http://tvheadend.org/projects/tvheadend/wiki) ') + + msg = _('There\'s no documentation available, or there was a problem loading the page.\n\n') + + _('**You\'ll also see this page if you try and view documentation (for a feature) not included with your version of Tvheadend.**\n\n\n\n') + + _('Please take a look at the other Help pages (Table of Contents), if you still can\'t find what you\'re ') + + _('looking for please see the [Wiki](http://tvheadend.org/projects/tvheadend/wiki) ') + _('or join the [IRC channel on freenode](https://kiwiirc.com/client/chat.freenode.net/?nick=tvhhelp|?#hts).'); - + // Fake the result. result = []; result['responseText'] = "## " + title + '\n\n' + msg; - + // Load the TOC. if (!tvheadend.docs_toc) { Ext.Ajax.request({ @@ -648,7 +659,7 @@ tvheadend.AjaxUUID = function(sel, conf) conf.params = {}; conf.params.uuid = Ext.encode(uuids); tvheadend.Ajax(conf); - } + } } tvheadend.loading = function(on) { @@ -840,7 +851,7 @@ tvheadend.VideoPlayer = function(channelId) { var videoPlayer = new tv.ui.VideoPlayer({ params: { } }); - + var initialChannelName; if (channelId) { var record = tvheadend.channels.getById(channelId); @@ -992,7 +1003,7 @@ tvheadend.VideoPlayer = function(channelId) { videoPlayer.zapTo(channelId); } }); - + win.on('close', function() { videoPlayer.stop(); }); -- 2.47.3