diff --git a/webui/static/app/acleditor.js b/webui/static/app/acleditor.js index 915aecd0..e3d2bb05 100644 --- a/webui/static/app/acleditor.js +++ b/webui/static/app/acleditor.js @@ -68,5 +68,7 @@ tvheadend.acleditor = function() { UserRecord, [enabledColumn, streamingColumn, dvrColumn, webuiColumn, - adminColumn]); + adminColumn], + null, + 'config_access.html'); } diff --git a/webui/static/app/chconf.js b/webui/static/app/chconf.js index 854f9cc9..5e2d33fd 100644 --- a/webui/static/app/chconf.js +++ b/webui/static/app/chconf.js @@ -224,6 +224,12 @@ tvheadend.channeldetails = function(chid, chname) { iconCls:'save', text: "Save configuration", handler: saveChanges + }, '->', { + text: 'Help', + handler: function() { + new tvheadend.help('Channel configuration', + 'config_channels.html'); + } }], defaults: { border:false, diff --git a/webui/static/app/cteditor.js b/webui/static/app/cteditor.js index 8f914adc..1236a405 100644 --- a/webui/static/app/cteditor.js +++ b/webui/static/app/cteditor.js @@ -54,5 +54,7 @@ tvheadend.cteditor = function() { return new tvheadend.tableEditor('Channel Tags', 'channeltags', cm, ChannelTagRecord, [enabledColumn, internalColumn, - titledIconColumn]); + titledIconColumn], + null, + 'config_tags.html'); } diff --git a/webui/static/app/cwceditor.js b/webui/static/app/cwceditor.js index 9b99536d..76fd27b4 100644 --- a/webui/static/app/cwceditor.js +++ b/webui/static/app/cwceditor.js @@ -45,5 +45,6 @@ tvheadend.cwceditor = function() { ]); return new tvheadend.tableEditor('Code Word Client', 'cwc', cm, rec, - [enabledColumn]); + [enabledColumn], null, + 'config_cwc.html'); } diff --git a/webui/static/app/dvb.js b/webui/static/app/dvb.js index a7553757..2d76549f 100644 --- a/webui/static/app/dvb.js +++ b/webui/static/app/dvb.js @@ -215,6 +215,12 @@ tvheadend.dvb = function() { border: false, title:'DVB Adapters', layout:'border', + tbar: ['->', { + text: 'Help', + handler: function() { + new tvheadend.help('DVB', 'config_dvb.html'); + } + }], items: [tree, details] }); diff --git a/webui/static/app/dvr.js b/webui/static/app/dvr.js index 84b26fe4..c89c1bfa 100644 --- a/webui/static/app/dvr.js +++ b/webui/static/app/dvr.js @@ -150,7 +150,17 @@ tvheadend.dvrlog = function() { store: tvheadend.dvrStore, cm: dvrCm, viewConfig: {forceFit:true}, - + tbar: [ + '->', + { + text: 'Help', + handler: function() { + new tvheadend.help('Digital Video Recorder', + 'dvrlog.html'); + } + } + + ], bbar: new Ext.PagingToolbar({ store: tvheadend.dvrStore, pageSize: 20, @@ -241,7 +251,8 @@ tvheadend.autoreceditor = function() { return new tvheadend.tableEditor('Automatic Recorder', 'autorec', cm, tvheadend.autorecRecord, - [enabledColumn], tvheadend.autorecStore); + [enabledColumn], tvheadend.autorecStore, + 'autorec.html'); } /** * @@ -354,6 +365,12 @@ tvheadend.dvrsettings = function() { iconCls:'save', text: "Save configuration", handler: saveChanges + }, '->', { + text: 'Help', + handler: function() { + new tvheadend.help('DVR configuration', + 'config_dvr.html'); + } }], }); diff --git a/webui/static/app/epg.js b/webui/static/app/epg.js index 76081a53..3b55cb94 100644 --- a/webui/static/app/epg.js +++ b/webui/static/app/epg.js @@ -275,6 +275,13 @@ tvheadend.epg = function() { 'record all future programmes that matches ' + 'the current query.', handler: createAutoRec + }, + '-', + { + text: 'Help', + handler: function() { + new tvheadend.help('Electronic Program Guide', 'epg.html'); + } } ], diff --git a/webui/static/app/ext.css b/webui/static/app/ext.css index ebbec2f3..53dfe826 100644 --- a/webui/static/app/ext.css +++ b/webui/static/app/ext.css @@ -125,3 +125,28 @@ .x-epg-meta { margin: 5px; } + + + + +.hts-doc-text { + font:normal 11px verdana; +} + +.hts-doc-text dt { + padding-top: 10px; + font-weight: bold; +} + +.hts-doc-text dl { + padding-bottom: 10px; +} + +.hts-doc-text li { + padding-top: 5px; + padding-bottom: 5px; +} + +.hts-doc-text img { + padding: 10px; +} \ No newline at end of file diff --git a/webui/static/app/tableeditor.js b/webui/static/app/tableeditor.js index 9ee27f3b..f351547a 100644 --- a/webui/static/app/tableeditor.js +++ b/webui/static/app/tableeditor.js @@ -1,4 +1,5 @@ -tvheadend.tableEditor = function(title, dtable, cm, rec, plugins, store) { +tvheadend.tableEditor = function(title, dtable, cm, rec, plugins, store, + helpContent) { cm.defaultSortable = true; if(store == null) { @@ -107,6 +108,11 @@ tvheadend.tableEditor = function(title, dtable, cm, rec, plugins, store) { iconCls:'save', text: "Save changes", handler: saveChanges + }, '->', { + text: 'Help', + handler: function() { + new tvheadend.help(title, helpContent); + } } ] }); diff --git a/webui/static/app/tvheadend.js b/webui/static/app/tvheadend.js index fb07fd86..5e457124 100644 --- a/webui/static/app/tvheadend.js +++ b/webui/static/app/tvheadend.js @@ -1,4 +1,35 @@ +/** + * This function creates top level tabs based on access so users without + * access to subsystems won't see them. + * + * Obviosuly, access is verified in the server too. + */ +tvheadend.help = function(title, pagename) { + Ext.Ajax.request({ + url: '/docs/' + pagename, + success: function(result, request) { + + var content = new Ext.Panel({ + autoScroll:true, + border: false, + layout:'fit', + html: result.responseText + }); + + var win = new Ext.Window({ + title: 'Help for ' + title, + layout: 'fit', + width: 900, + height: 400, + constrainHeader: true, + items: [content] + }); + win.show(); + + }}); +} + /** * This function creates top level tabs based on access so users without diff --git a/webui/static/app/xmltv.js b/webui/static/app/xmltv.js index 223424b1..9c0a50c9 100644 --- a/webui/static/app/xmltv.js +++ b/webui/static/app/xmltv.js @@ -125,6 +125,12 @@ tvheadend.xmltv = function() { iconCls:'save', text: "Save configuration", handler: saveChanges + }, '->', { + text: 'Help', + handler: function() { + new tvheadend.help('XMLTV configuration', + 'config_xmltv.html'); + } }], }); diff --git a/webui/webui.c b/webui/webui.c index ad26cb71..7b7d96ab 100644 --- a/webui/webui.c +++ b/webui/webui.c @@ -75,7 +75,7 @@ page_root(http_connection_t *hc, const char *remain, void *opaque) static int page_static(http_connection_t *hc, const char *remain, void *opaque) { - extern char *contentpath; + const char *base = opaque; int fd; char path[500]; @@ -92,7 +92,7 @@ page_static(http_connection_t *hc, const char *remain, void *opaque) content = "text/javascript; charset=UTF-8"; } - snprintf(path, sizeof(path), "%s/webui/static/%s", contentpath, remain); + snprintf(path, sizeof(path), "%s/%s", base, remain); if((fd = open(path, O_RDONLY)) < 0) return 404; @@ -178,11 +178,22 @@ page_dvrfile(http_connection_t *hc, const char *remain, void *opaque) void webui_init(void) { + extern char *contentpath; + char buf[300]; + http_path_add("/", NULL, page_root, ACCESS_WEB_INTERFACE); - http_path_add("/static", NULL, page_static, ACCESS_WEB_INTERFACE); http_path_add("/dvrfile", NULL, page_dvrfile, ACCESS_WEB_INTERFACE); + snprintf(buf, sizeof(buf), "%s/webui/static", contentpath); + http_path_add("/static", strdup(buf), page_static, ACCESS_WEB_INTERFACE); + + snprintf(buf, sizeof(buf), "%s/docs/html", contentpath); + http_path_add("/docs", strdup(buf), page_static, ACCESS_WEB_INTERFACE); + + snprintf(buf, sizeof(buf), "%s/docs/docresources", contentpath); + http_path_add("/docresources", strdup(buf), page_static, ACCESS_WEB_INTERFACE); + // simpleui_start(); extjs_start(); comet_init();