]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
webui: add generated help for ACL (demo)
authorJaroslav Kysela <perex@perex.cz>
Fri, 1 Apr 2016 15:08:36 +0000 (17:08 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 1 Apr 2016 15:08:58 +0000 (17:08 +0200)
- also improve description rendering for wizard <ul>

src/webui/static/app/acleditor.js
src/webui/static/app/ext.css
src/webui/static/app/micromarkdown.js
src/webui/static/app/tvheadend.js
src/wizard.c

index 812de3404f0e0bdbe97441d1e4c71d5d36d2b5b0..d2da5c559d19df974daa51c3bece55c75f9a3af8 100644 (file)
@@ -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');
         }
     });
 };
index 1cba16163be9e9a93186484288ba95f4d1b2a820..46b5e7b09dd0cdb89158676f0d38da3fce0aa5d3 100644 (file)
     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 {
index da2fa554824da2563bdcea14047936b31c8ad9a4..54e7bc020271f5ce3ba3e33322e60f8c99b4885c 100644 (file)
@@ -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)) {
index 154a7ea8d4d50d29bebaddf0c1e63f8625bd42ab..71148e886cbabaeef71560ef7d6e86231eb55084 100644 (file)
@@ -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);
index 0b31170b69c3a74759200cce91cf789e59e6247a..a9c3f35ca320d8dc935b48990c7b3cca5a3c153c 100644 (file)
@@ -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 \