do not include keyboard help files into index and prefs.php

This commit is contained in:
Andrew Dolgov 2011-12-14 15:51:27 +04:00
parent 07391e36b8
commit 66be620a87
8 changed files with 28 additions and 29 deletions

View 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>"; */
}
}

View file

@ -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>

View 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;

View 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);
}
}

View 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") {

View file

@ -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>