]> git.wh0rd.org - tt-rss.git/commitdiff
do not include keyboard help files into index and prefs.php
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 14 Dec 2011 11:51:27 +0000 (15:51 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 14 Dec 2011 11:51:27 +0000 (15:51 +0400)
classes/backend.php
help/3.php [deleted file]
help/4.php [deleted file]
help/main.php [new file with mode: 0644]
help/prefs.php [new file with mode: 0644]
index.php
js/functions.js
js/prefs.js
js/tt-rss.js
prefs.php

index f7e7b84b816e55abbd436dafbe5a21a08c3e801a..334701f4a64bc8f114ec5d499a242f60eb44ac0b 100644 (file)
@@ -12,16 +12,16 @@ class Backend extends Handler {
        }
 
        function help() {
-               $tid = (int) $_REQUEST["tid"];
+               $topic = basename($_REQUEST["topic"]);
 
-               if (file_exists("help/$tid.php")) {
-                       include("help/$tid.php");
+               if (file_exists("help/$topic.php")) {
+                       include("help/$topic.php");
                } else {
                        print "<p>".__("Help topic not found.")."</p>";
                }
-               print "<div align='center'>
+               /* print "<div align='center'>
                        <button onclick=\"javascript:window.close()\">".
-                       __('Close this window')."</button></div>";
+                       __('Close this window')."</button></div>"; */
 
        }
 }
diff --git a/help/3.php b/help/3.php
deleted file mode 100644 (file)
index e1812b3..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-       <h1><?php echo __("Keyboard Shortcuts") ?></h1>
-
-       <table style='width : 100%'><tr><td style='width : 50%' valign='top'>
-
-       <h2><?php echo __("Navigation") ?></h2>
-
-       <table>
-               <tr><td class='n'>j/k</td><td><?php echo __("Move between feeds") ?></td></tr>
-               <tr><td class='n'>n/p</td><td><?php echo __("Move between articles") ?></td></tr>
-               <tr><td class='n'>/</td><td><?php echo __("Show search dialog") ?></td></tr>
-       </table>
-
-       <h2><?php echo __("Active article actions") ?></h2>
-
-       <table>
-               <tr><td class='n'>s</td><td><?php echo __("Toggle starred") ?></td></tr>
-               <tr><td class='n'>S</td><td><?php echo __("Toggle published") ?></td></tr>
-               <tr><td class='n'>u</td><td><?php echo __("Toggle unread") ?></td></tr>
-               <tr><td class='n'>T</td><td><?php echo __("Edit tags") ?></td></tr>
-               <tr><td class='n'>D</td><td><?php echo __("Dismiss selected articles") ?></td></tr>
-               <tr><td class='n'>X</td><td><?php echo __("Dismiss read articles") ?></td></tr>
-               <tr><td class='n'>o</td><td><?php echo __("Open article in new window") ?></td></tr>
-               <tr><td class='n'>c n/c p</td><td><?php echo __("Mark articles below/above active one as read") ?></td></tr>
-               <tr><td class='n'>N/P</td><td><?php echo __("Scroll article content") ?></td></tr>
-               <tr><td class='n'>e</td><td><?php echo __("Email article") ?></td></tr>
-
-       </table>
-
-       <h2><?php echo __("Other actions") ?></h2>
-
-       <table>
-               <tr><td class='n'>[tab]</td><td><?php echo __("Select article under mouse cursor") ?></td></tr>
-               <tr><td class='n'>c l</td><td><?php echo __("Create label") ?></td></tr>
-               <tr><td class='n'>c f</td><td><?php echo __("Create filter") ?></td></tr>
-               <tr><td class='n'>c s</td><td><?php echo __("Collapse sidebar") ?></td></tr>
-               <tr><td class='n'>?</td><td><?php echo __("Display this help dialog") ?></td></tr>
-       </table>
-
-       </td><td valign='top'>
-
-       <h2><?php echo __("Multiple articles actions") ?></h2>
-
-       <table>
-               <tr><td class='n'>a a</td><td><?php echo __("Select all articles") ?></td></tr>
-               <tr><td class='n'>a u</td><td><?php echo __("Select unread articles") ?></td></tr>
-               <tr><td class='n'>a i</td><td><?php echo __("Invert article selection") ?></td></tr>
-               <tr><td class='n'>a n</td><td><?php echo __("Deselect all articles") ?></td></tr>
-       </table>
-
-       <h2><?php echo __("Feed actions") ?></h2>
-
-       <table>
-               <tr><td class='n'>f r</td><td><?php echo __("Refresh active feed") ?></td></tr>
-               <tr><td class='n'>f a</td><td><?php echo __("(Un)hide read feeds") ?></td></tr>
-               <tr><td class='n'>f s</td><td><?php echo __("Subscribe to feed") ?></td></tr>
-               <tr><td class='n'>f e</td><td><?php echo __("Edit feed") ?></td></tr>
-               <tr><td class='n'>f q</td><td><?php echo __("Mark feed as read") ?></td></tr>
-               <tr><td class='n'>f x</td><td><?php echo __("Reverse headlines order") ?></td></tr>
-               <tr><td class='n'>Q</td><td><?php echo __("Mark all feeds as read") ?></td></tr>
-               <tr><td class='n'>x</td><td><?php echo __("If viewing category, (un)collapse it") ?></td></tr>
-       </table>
-
-       <h2><?php echo __("Go to...") ?></h2>
-
-       <table>
-               <tr><td class='n'>g a</td><td><?php echo __("All articles") ?></td></tr>
-               <tr><td class='n'>g f</td><td><?php echo __("Fresh articles") ?></td></tr>
-               <tr><td class='n'>g s</td><td><?php echo __("Starred articles") ?></td></tr>
-               <tr><td class='n'>g p</td><td><?php echo __("Published articles") ?></td></tr>
-               <tr><td class='n'>g t</td><td><?php echo __("Tag cloud") ?></td></tr>
-               <tr><td class='n'>g P</td><td><?php echo __("Preferences") ?></td></tr>
-       </table>
-
-
-       </td></tr></table>
-
-       <p><a target="_blank" href="http://tt-rss.org/wiki/InterfaceTips"><?php echo __("Other interface tips are available in the Tiny Tiny RSS wiki.") ?></a></p>
-
-       <p class="small"><?php echo __("Press any key to close this window.") ?></p>
diff --git a/help/4.php b/help/4.php
deleted file mode 100644 (file)
index 4cf3a12..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<h1><?php echo __("Keyboard Shortcuts") ?></h1>
-
-<table style='width : 100%'><tr><td style='width : 50%' valign='top'>
-
-       <h2><?php echo __("Go to...") ?></h2>
-
-       <table>
-               <tr><td class='n'>g 1</td><td><?php echo __("Preferences") ?></td></tr>
-               <tr><td class='n'>g 2</td><td><?php echo __("My Feeds") ?></td></tr>
-               <!-- <tr><td class='n'>g 3</td><td><?php echo __("Other Feeds") ?></td></tr> -->
-               <tr><td class='n'>g 3</td><td><?php echo __("Filters") ?></td></tr>
-               <tr><td class='n'>g 4</td><td><?php echo __("Labels") ?></td></tr>
-               <tr><td class='n'>g 5</td><td><?php echo __("Users") ?></td></tr>
-               <tr><td class='n'>g x</td><td><?php echo __("Exit preferences") ?></td></tr>
-       </table>
-
-</td><td valign='top'>
-
-       <h2><?php echo __("Panel actions") ?></h2>
-
-       <table>
-               <tr><td class='n'>c s</td><td><?php echo __("Subscribe to feed") ?></td></tr>
-               <tr><td class='n'>c T</td><td><?php echo __("Top 25 feeds") ?></td></tr>
-               <tr><td class='n'>c c</td><td><?php echo __("Edit feed categories") ?></td></tr>
-               <tr><td class='n'>c f</td><td><?php echo __("Create filter") ?></td></tr>
-               <!-- <tr><td class='n'>c l</td><td><?php echo __("Create label") ?></td></tr> -->
-               <!-- <tr><td class='n'>c u</td><td><?php echo __("Create user") ?></td></tr> -->
-       </table>
-
-       <h2><?php echo __("Other actions") ?></h2>
-
-       <table>
-               <tr><td class='n'>/</td><td><?php echo __("Focus search (if present)") ?></td></tr>
-               <tr><td class='n'>?</td><td><?php echo __("Display this help dialog") ?></td></tr>
-       </table>
-
-</td></tr></table>
-
-<p class='insensitive'><span class='small'><?php echo __("<b>Note:</b> not all actions may be available, depending on Tiny Tiny RSS configuration and your access level.") ?></span></p>
-
-<p class="small"><?php echo __("Press any key to close this window.") ?></p>
diff --git a/help/main.php b/help/main.php
new file mode 100644 (file)
index 0000000..e1812b3
--- /dev/null
@@ -0,0 +1,79 @@
+       <h1><?php echo __("Keyboard Shortcuts") ?></h1>
+
+       <table style='width : 100%'><tr><td style='width : 50%' valign='top'>
+
+       <h2><?php echo __("Navigation") ?></h2>
+
+       <table>
+               <tr><td class='n'>j/k</td><td><?php echo __("Move between feeds") ?></td></tr>
+               <tr><td class='n'>n/p</td><td><?php echo __("Move between articles") ?></td></tr>
+               <tr><td class='n'>/</td><td><?php echo __("Show search dialog") ?></td></tr>
+       </table>
+
+       <h2><?php echo __("Active article actions") ?></h2>
+
+       <table>
+               <tr><td class='n'>s</td><td><?php echo __("Toggle starred") ?></td></tr>
+               <tr><td class='n'>S</td><td><?php echo __("Toggle published") ?></td></tr>
+               <tr><td class='n'>u</td><td><?php echo __("Toggle unread") ?></td></tr>
+               <tr><td class='n'>T</td><td><?php echo __("Edit tags") ?></td></tr>
+               <tr><td class='n'>D</td><td><?php echo __("Dismiss selected articles") ?></td></tr>
+               <tr><td class='n'>X</td><td><?php echo __("Dismiss read articles") ?></td></tr>
+               <tr><td class='n'>o</td><td><?php echo __("Open article in new window") ?></td></tr>
+               <tr><td class='n'>c n/c p</td><td><?php echo __("Mark articles below/above active one as read") ?></td></tr>
+               <tr><td class='n'>N/P</td><td><?php echo __("Scroll article content") ?></td></tr>
+               <tr><td class='n'>e</td><td><?php echo __("Email article") ?></td></tr>
+
+       </table>
+
+       <h2><?php echo __("Other actions") ?></h2>
+
+       <table>
+               <tr><td class='n'>[tab]</td><td><?php echo __("Select article under mouse cursor") ?></td></tr>
+               <tr><td class='n'>c l</td><td><?php echo __("Create label") ?></td></tr>
+               <tr><td class='n'>c f</td><td><?php echo __("Create filter") ?></td></tr>
+               <tr><td class='n'>c s</td><td><?php echo __("Collapse sidebar") ?></td></tr>
+               <tr><td class='n'>?</td><td><?php echo __("Display this help dialog") ?></td></tr>
+       </table>
+
+       </td><td valign='top'>
+
+       <h2><?php echo __("Multiple articles actions") ?></h2>
+
+       <table>
+               <tr><td class='n'>a a</td><td><?php echo __("Select all articles") ?></td></tr>
+               <tr><td class='n'>a u</td><td><?php echo __("Select unread articles") ?></td></tr>
+               <tr><td class='n'>a i</td><td><?php echo __("Invert article selection") ?></td></tr>
+               <tr><td class='n'>a n</td><td><?php echo __("Deselect all articles") ?></td></tr>
+       </table>
+
+       <h2><?php echo __("Feed actions") ?></h2>
+
+       <table>
+               <tr><td class='n'>f r</td><td><?php echo __("Refresh active feed") ?></td></tr>
+               <tr><td class='n'>f a</td><td><?php echo __("(Un)hide read feeds") ?></td></tr>
+               <tr><td class='n'>f s</td><td><?php echo __("Subscribe to feed") ?></td></tr>
+               <tr><td class='n'>f e</td><td><?php echo __("Edit feed") ?></td></tr>
+               <tr><td class='n'>f q</td><td><?php echo __("Mark feed as read") ?></td></tr>
+               <tr><td class='n'>f x</td><td><?php echo __("Reverse headlines order") ?></td></tr>
+               <tr><td class='n'>Q</td><td><?php echo __("Mark all feeds as read") ?></td></tr>
+               <tr><td class='n'>x</td><td><?php echo __("If viewing category, (un)collapse it") ?></td></tr>
+       </table>
+
+       <h2><?php echo __("Go to...") ?></h2>
+
+       <table>
+               <tr><td class='n'>g a</td><td><?php echo __("All articles") ?></td></tr>
+               <tr><td class='n'>g f</td><td><?php echo __("Fresh articles") ?></td></tr>
+               <tr><td class='n'>g s</td><td><?php echo __("Starred articles") ?></td></tr>
+               <tr><td class='n'>g p</td><td><?php echo __("Published articles") ?></td></tr>
+               <tr><td class='n'>g t</td><td><?php echo __("Tag cloud") ?></td></tr>
+               <tr><td class='n'>g P</td><td><?php echo __("Preferences") ?></td></tr>
+       </table>
+
+
+       </td></tr></table>
+
+       <p><a target="_blank" href="http://tt-rss.org/wiki/InterfaceTips"><?php echo __("Other interface tips are available in the Tiny Tiny RSS wiki.") ?></a></p>
+
+       <p class="small"><?php echo __("Press any key to close this window.") ?></p>
diff --git a/help/prefs.php b/help/prefs.php
new file mode 100644 (file)
index 0000000..4cf3a12
--- /dev/null
@@ -0,0 +1,41 @@
+<h1><?php echo __("Keyboard Shortcuts") ?></h1>
+
+<table style='width : 100%'><tr><td style='width : 50%' valign='top'>
+
+       <h2><?php echo __("Go to...") ?></h2>
+
+       <table>
+               <tr><td class='n'>g 1</td><td><?php echo __("Preferences") ?></td></tr>
+               <tr><td class='n'>g 2</td><td><?php echo __("My Feeds") ?></td></tr>
+               <!-- <tr><td class='n'>g 3</td><td><?php echo __("Other Feeds") ?></td></tr> -->
+               <tr><td class='n'>g 3</td><td><?php echo __("Filters") ?></td></tr>
+               <tr><td class='n'>g 4</td><td><?php echo __("Labels") ?></td></tr>
+               <tr><td class='n'>g 5</td><td><?php echo __("Users") ?></td></tr>
+               <tr><td class='n'>g x</td><td><?php echo __("Exit preferences") ?></td></tr>
+       </table>
+
+</td><td valign='top'>
+
+       <h2><?php echo __("Panel actions") ?></h2>
+
+       <table>
+               <tr><td class='n'>c s</td><td><?php echo __("Subscribe to feed") ?></td></tr>
+               <tr><td class='n'>c T</td><td><?php echo __("Top 25 feeds") ?></td></tr>
+               <tr><td class='n'>c c</td><td><?php echo __("Edit feed categories") ?></td></tr>
+               <tr><td class='n'>c f</td><td><?php echo __("Create filter") ?></td></tr>
+               <!-- <tr><td class='n'>c l</td><td><?php echo __("Create label") ?></td></tr> -->
+               <!-- <tr><td class='n'>c u</td><td><?php echo __("Create user") ?></td></tr> -->
+       </table>
+
+       <h2><?php echo __("Other actions") ?></h2>
+
+       <table>
+               <tr><td class='n'>/</td><td><?php echo __("Focus search (if present)") ?></td></tr>
+               <tr><td class='n'>?</td><td><?php echo __("Display this help dialog") ?></td></tr>
+       </table>
+
+</td></tr></table>
+
+<p class='insensitive'><span class='small'><?php echo __("<b>Note:</b> not all actions may be available, depending on Tiny Tiny RSS configuration and your access level.") ?></span></p>
+
+<p class="small"><?php echo __("Press any key to close this window.") ?></p>
index 6d0b7c645c52d742baeda9b6c2eff3b6c4b88c16..25e3a5cb476b10ebc092b7b415ed10173ee83413 100644 (file)
--- a/index.php
+++ b/index.php
@@ -97,9 +97,7 @@
                alt="new_version_icon"/>
 </div>
 
-<div id="hotkey_help_overlay" style="display : none" onclick="Element.hide(this)">
-       <?php include "help/3.php" ?>
-</div>
+<div id="hotkey_help_overlay" style="display : none" onclick="Element.hide(this)"></div>
 
 <div id="notify" class="notify"><span id="notify_body">&nbsp;</span></div>
 <div id="cmdline" style="display : none"></div>
index 69406f3e1100954f966de325a74c40d6b127db4f..02134aafa115727bdacb00ab29e3c36c870cf14f 100644 (file)
@@ -634,15 +634,6 @@ function explainError(code) {
        return displayDlg("explainError", code);
 }
 
-function displayHelpInfobox(topic_id) {
-
-       var url = "backend.php?op=backend&method=help&tid=" + param_escape(topic_id);
-
-       window.open(url, "ttrss_help",
-               "status=0,toolbar=0,location=0,width=450,height=500,scrollbars=1,menubar=0");
-
-}
-
 function loading_set_progress(p) {
        try {
                loading_progress += p;
index 896a787c6cc0a59be3912d83bc18adab780effc2..bd3866991950c63eb25aef75f447044a1d659772 100644 (file)
@@ -1001,12 +1001,7 @@ function pref_hotkey_handler(e) {
                if (!hotkey_prefix) {
 
                        if ((keycode == 191 || keychar == '?') && shift_key) { // ?
-                               if (!Element.visible("hotkey_help_overlay")) {
-                                       //Element.show("hotkey_help_overlay");
-                                       Effect.Appear("hotkey_help_overlay", {duration : 0.3, to: 0.9});
-                               } else {
-                                       Element.hide("hotkey_help_overlay");
-                               }
+                               showHelp();
                                return false;
                        }
 
@@ -1919,3 +1914,16 @@ function editSelectedInstance() {
        editInstance(rows[0]);
 }
 
+function showHelp() {
+       try {
+               new Ajax.Request("backend.php", {
+                       parameters: "?op=backend&method=help&topic=prefs",
+                       onComplete: function(transport) {
+                               $("hotkey_help_overlay").innerHTML = transport.responseText;
+                               Effect.Appear("hotkey_help_overlay", {duration : 0.3});
+                       } });
+
+       } catch (e) {
+               exception_error("showHelp", e);
+       }
+}
index 38232bdfee592142dc7c61f4bb6311adb0e41abf..23349db63661b2606d5da5e3afe1352a1a92d3de 100644 (file)
@@ -428,8 +428,12 @@ function quickMenuGo(opid) {
                }
 
                if (opid == "qmcHKhelp") {
-                       //Element.show("hotkey_help_overlay");
-                       Effect.Appear("hotkey_help_overlay", {duration : 0.3});
+                       new Ajax.Request("backend.php", {
+                               parameters: "?op=backend&method=help&topic=main",
+                               onComplete: function(transport) {
+                                       $("hotkey_help_overlay").innerHTML = transport.responseText;
+                                       Effect.Appear("hotkey_help_overlay", {duration : 0.3});
+                               } });
                }
 
                if (opid == "qmcAbout") {
index 40d9a35acc562acee122e6a46d6e442bca5ea77c..52be2a7a62d8d2b34245179959ace40616d3c9df 100644 (file)
--- a/prefs.php
+++ b/prefs.php
        </div>
 </div>
 
-<div id="hotkey_help_overlay" style="display : none" onclick="Element.hide(this)">
-       <?php include "help/4.php" ?>
-</div>
+<div id="hotkey_help_overlay" style="display : none" onclick="Element.hide(this)"></div>
 
 <img id="piggie" src="images/piggie.png" style="display : none" alt="piggie"/>
 
 <div id="header" dojoType="dijit.layout.ContentPane" region="top">
-       <a href='#' onclick="Effect.Appear('hotkey_help_overlay', {duration: 0.3})"><?php echo __("Keyboard shortcuts") ?></a> |
+       <a href='#' onclick="showHelp()"><?php echo __("Keyboard shortcuts") ?></a> |
        <a href="#" onclick="gotoMain()"><?php echo __('Exit preferences') ?></a>
 </div>