]> git.wh0rd.org Git - tt-rss.git/commitdiff
label help uses infoboxes, real help system
authorAndrew Dolgov <fox@bah.spb.su>
Sun, 27 Nov 2005 10:56:53 +0000 (11:56 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sun, 27 Nov 2005 10:56:53 +0000 (11:56 +0100)
backend.php
help/1.php [new file with mode: 0644]
prefs.js
tt-rss.css

index 1ffa40863fc8ec9c71ea7abba2866b8b89286a3c..567bbf7ba3bddf25f5177a9cc0d19a503b681d11 100644 (file)
 
                        print "<tr class=\"title\">
                                                <td width=\"5%\">Select</td><td width=\"40%\">SQL expression
-                                               <a class=\"helpLink\" href=\"javascript:popupHelp(1)\">(?)</a>
+                                               <a class=\"helpLink\" href=\"javascript:displayHelpInfobox(1)\">(?)</a>
                                                </td>
                                                <td width=\"40%\">Caption</td></tr>";
                        
        }
 
        if ($op == "help") {
-               print "<html><head>
-                       <title>Tiny Tiny RSS : Help</title>
-                       <link rel=\"stylesheet\" href=\"tt-rss.css\" type=\"text/css\">
-                       <script type=\"text/javascript\" src=\"functions.js\"></script>
-                       <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
-                       </head><body>";
+               if (!$_GET["noheaders"]) {
+                       print "<html><head>
+                               <title>Tiny Tiny RSS : Help</title>
+                               <link rel=\"stylesheet\" href=\"tt-rss.css\" type=\"text/css\">
+                               <script type=\"text/javascript\" src=\"functions.js\"></script>
+                               <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">
+                               </head><body>";
+               }
 
                $tid = sprintf("%d", $_GET["tid"]);
 
-               /* FIXME this badly needs real implementation */
-
-               print "<div class='helpResponse'>";
-
-               ?>
-
-               <h1>Help for SQL expressions</h1>
-
-               <h2>Description</h2>
-
-               <p>The &laquo;SQL expression&raquo; is added to WHERE clause of
-                       view feed query. You can match on ttrss_entries table fields
-                       and even use subselect to query additional information. This 
-                       functionality is considered to be advanced and requires basic
-                       understanding of SQL.</p>
-                       
-               <h2>Examples</h2>
-
-               <pre>unread = true</pre>
-
-               Matches all unread articles
-
-               <pre>title like '%Linux%'</pre>
-
-               Matches all articles which mention Linux in the title. You get the idea.
+               print "<div class='infoBoxContents'>";
 
-               <p>See the database schema included in the distribution package for gruesome
-               details.</p>
+               if (file_exists("help/$tid.php")) {
+                       include("help/$tid.php");
+               } else {
+                       print "<p>Help topic not found.</p>";
+               }
 
-               <?
+               print "</div>";
 
                print "<div align='center'>
-                       <a class=\"helpLink\"
-                       href=\"javascript:window.close()\">(Close this window)</a></div>";
-
-               print "</div>";
+                       <input type='submit' class='button'                     
+                       onclick=\"closeInfoBox()\" value=\"Close this window\"></div>";
 
-               print "</body></html>";
+               if (!$_GET["noheaders"]) { 
+                       print "</body></html>";
+               }
 
        }
 
diff --git a/help/1.php b/help/1.php
new file mode 100644 (file)
index 0000000..b617481
--- /dev/null
@@ -0,0 +1,23 @@
+<h1>Help for SQL expressions</h1>
+
+<h2>Description</h2>
+
+<p>The &laquo;SQL expression&raquo; is added to WHERE clause of
+       view feed query. You can match on ttrss_entries table fields
+       and even use subselect to query additional information. This 
+       functionality is considered to be advanced and requires basic
+       understanding of SQL.</p>
+       
+<h2>Examples</h2>
+
+<p>Match all unread articles:</p>
+
+<pre>unread = true</pre>
+
+<p>Matches all articles which mention Linux in the title:</p>
+
+<pre>title like '%Linux%'</pre>
+
+<p>See the database schema included in the distribution package for gruesome
+details.</p>
+
index b69369ba1fa05acbdcb3f628d22c2fe52e92fdcb..5c699f2370c909dc88ce9b59943945bd1bca146e 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -695,6 +695,16 @@ function labelTest() {
 
 }
 
+function displayHelpInfobox(topic_id) {
+
+       xmlhttp.open("GET", "backend.php?op=help&tid=" +
+               param_escape(topic_id) + "&noheaders=1", true);
+
+       xmlhttp.onreadystatechange=infobox_callback;
+       xmlhttp.send(null);
+
+}
+
 function labelEditCancel() {
 
        if (!xmlhttp_ready(xmlhttp)) {
index f6f3ae6c561b569b4ed9cdbeb4ed06e0e3637961..d7c905734749f8ef7021f72d2f9e145a75741493 100644 (file)
@@ -534,6 +534,7 @@ pre {
        border : 1px solid #c0c0c0;
        padding : 5px;
        background : #f0f0f0;
+       margin : 5px 10px 5px 10px;
 }
 
 input.extSearch {