Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
webui: add generated help for ACL (demo)
- also improve description rendering for wizard <ul>
  • Loading branch information
perexg committed Apr 1, 2016
1 parent 05c9cc2 commit 6b6a143
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/webui/static/app/acleditor.js
Expand Up @@ -63,7 +63,7 @@ tvheadend.acleditor = function(panel, index)
move: true,
list: list,
help: function() {
new tvheadend.help(_('Access Control Entries'), 'config_access.html');
new tvheadend.mdhelp('class/access');
}
});
};
Expand Down
10 changes: 10 additions & 0 deletions src/webui/static/app/ext.css
Expand Up @@ -723,6 +723,16 @@
font: normal 12px arial, tahoma, helvetica, sans-serif;
}

.x-wizard-description ul {
list-style: disc outside;
padding-left: 15px;
}

.x-wizard-description p, .x-wizard-description li {
margin: 5px 0 0 0;
list-style: disc outside;
}

/* Table styles for webUI help */

.hts-doc-text table, .hts-doc-text th, .hts-doc-text td {
Expand Down
4 changes: 2 additions & 2 deletions src/webui/static/app/micromarkdown.js
Expand Up @@ -322,9 +322,9 @@ var micromarkdown = {
}
}

str = str.replace(/ {2,}[\n]{1,}/gmi, '<br/>');
str = str.replace(/ {2,}[\n]{1,}/gmi, '<p>');

str = str.replace(/[\n]{2,}/gmi, '<br/><br/>');
str = str.replace(/[\n]{2,}/gmi, '<p>');

for(var index in micromarkdown.codeblocks) {
if(micromarkdown.codeblocks.hasOwnProperty(index)) {
Expand Down
35 changes: 35 additions & 0 deletions src/webui/static/app/tvheadend.js
Expand Up @@ -92,6 +92,41 @@ tvheadend.help = function(title, pagename) {
});
};

tvheadend.mdhelp = function(pagename) {
Ext.Ajax.request({
url: 'markdown/' + pagename,
success: function(result, request) {

var text = result.responseText;
var title = text.split('\n')[0].split('#');

if (title)
title = title[title.length-1];

text = '<div class="hts-doc-text">' + micromarkdown.parse(text) + '</div>';

var content = new Ext.Panel({
autoScroll: true,
border: false,
layout: 'fit',
html: text
});

var win = new Ext.Window({
title: _('Help for') + ' ' + title,
iconCls: 'help',
layout: 'fit',
width: 900,
height: 400,
constrainHeader: true,
items: [content]
});
win.show();

}
});
};

tvheadend.paneladd = function(dst, add, idx) {
if (idx != null)
dst.insert(idx, add);
Expand Down
6 changes: 3 additions & 3 deletions src/wizard.c
Expand Up @@ -392,9 +392,9 @@ or 0.0.0.0/0 or empty value for access from any system.\n\n\
This works alongside the second part, which is a familiar \
username/password combination, so provide these for both \
an administrator and regular (day-to-day) user. \
\n\n**Notes**:\n \
* You may enter a comma-separated list of network prefixes (IPv4/IPv6).\n\
if you were asked to enter a username and password during installation, \
\n\n**Notes**:\n\
* You may enter a comma-separated list of network prefixes (IPv4/IPv6).\
If you were asked to enter a username and password during installation, \
we'd recommend not using the same details for a user here as it may cause \
unexpected behavior, incorrect permissions etc.\n\
* To allow anonymous access for any account (administrative or regular user) enter \
Expand Down

0 comments on commit 6b6a143

Please sign in to comment.