diff options
-rw-r--r-- | classes/backend.php | 10 | ||||
-rw-r--r-- | help/main.php (renamed from help/3.php) | 0 | ||||
-rw-r--r-- | help/prefs.php (renamed from help/4.php) | 0 | ||||
-rw-r--r-- | index.php | 4 | ||||
-rw-r--r-- | js/functions.js | 9 | ||||
-rw-r--r-- | js/prefs.js | 20 | ||||
-rw-r--r-- | js/tt-rss.js | 8 | ||||
-rw-r--r-- | prefs.php | 6 |
8 files changed, 28 insertions, 29 deletions
diff --git a/classes/backend.php b/classes/backend.php index f7e7b84b8..334701f4a 100644 --- a/classes/backend.php +++ b/classes/backend.php @@ -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/main.php index e1812b3f2..e1812b3f2 100644 --- a/help/3.php +++ b/help/main.php diff --git a/help/4.php b/help/prefs.php index 4cf3a1261..4cf3a1261 100644 --- a/help/4.php +++ b/help/prefs.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"> </span></div> <div id="cmdline" style="display : none"></div> diff --git a/js/functions.js b/js/functions.js index 69406f3e1..02134aafa 100644 --- a/js/functions.js +++ b/js/functions.js @@ -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; diff --git a/js/prefs.js b/js/prefs.js index 896a787c6..bd3866991 100644 --- a/js/prefs.js +++ b/js/prefs.js @@ -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); + } +} diff --git a/js/tt-rss.js b/js/tt-rss.js index 38232bdfe..23349db63 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -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") { @@ -72,14 +72,12 @@ </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> |