1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-16 07:05:56 +00:00

massive code cleanup

This commit is contained in:
Andrew Dolgov
2008-05-20 06:47:57 +01:00
parent e86dbf9d9b
commit ee8768dbbb
4 changed files with 4 additions and 330 deletions

172
tt-rss.js
View File

@@ -1277,178 +1277,6 @@ function hotkey_handler(e) {
}
/*
if (keycode == 48) { // 0
return setHotkeyZone(0);
}
if (keycode == 49) { // 1
return setHotkeyZone(1);
}
if (keycode == 50) { // 2
return setHotkeyZone(2);
}
if (keycode == 51) { // 3
return setHotkeyZone(3);
}
if (keycode == 82) { // r
return scheduleFeedUpdate(true);
}
if (keycode == 83) { // s
return displayDlg("search", getActiveFeedId());
}
if (keycode == 85) { // u
if (getActiveFeedId()) {
return viewfeed(getActiveFeedId(), "ForceUpdate");
}
}
if (keycode == 65) { // a
return toggleDispRead();
}
var feedlist = document.getElementById('feedList');
if (keycode == 74) { // j
var feed = getActiveFeedId();
var new_feed = getRelativeFeedId(feedlist, feed, 'prev');
if (new_feed) viewfeed(new_feed, '');
}
if (keycode == 75) { // k
var feed = getActiveFeedId();
var new_feed = getRelativeFeedId(feedlist, feed, 'next');
if (new_feed) viewfeed(new_feed, '');
}
if (shift_key && (keycode == 78 || keycode == 40)) { // shift - n, down
return catchupRelativeToArticle(1);
}
if (shift_key && (keycode == 80 || keycode == 38)) { // shift - p, up
return catchupRelativeToArticle(0);
}
if (keycode == 78 || keycode == 40) { // n, down
if (typeof moveToPost != 'undefined') {
return moveToPost('next');
}
}
if (keycode == 80 || keycode == 38) { // p, up
if (typeof moveToPost != 'undefined') {
return moveToPost('prev');
}
}
if (keycode == 68 && shift_key) { // d
if (!debug_mode_enabled) {
document.getElementById('debug_output').style.display = 'block';
debug('debug mode activated');
} else {
document.getElementById('debug_output').style.display = 'none';
}
debug_mode_enabled = !debug_mode_enabled;
}
if (keycode == 191 && shift_key) { // ?
if (!Element.visible("hotkey_help_overlay")) {
Element.show("hotkey_help_overlay");
} else {
Element.hide("hotkey_help_overlay");
}
}
if (keycode == 69 && shift_key) { // e
return editFeedDlg(getActiveFeedId());
}
if (keycode == 70 && shift_key) { // f
if (getActiveFeedId()) {
return catchupCurrentFeed();
}
}
if (keycode == 80 && shift_key) { // p
if (getActiveFeedId()) {
return catchupPage();
}
}
if (keycode == 86) { // v
if (getActiveArticleId()) {
openArticleInNewWindow(getActiveArticleId());
}
}
if (keycode == 84) { // t
var id = getActiveArticleId();
if (id) {
var cb = document.getElementById("RCHK-" + id);
if (cb) {
cb.checked = !cb.checked;
toggleSelectRowById(cb, "RROW-" + id);
}
}
}
if (keycode == 67) { // c
var id = getActiveArticleId();
if (id) {
toggleUnread(id, 0);
}
}
if (keycode == 67 && shift_key) { // c
if (typeof collapse_feedlist != 'undefined') {
return collapse_feedlist();
}
}
if (keycode == 81 && shift_key) { // shift + q
if (typeof catchupAllFeeds != 'undefined') {
return catchupAllFeeds();
}
}
if (keycode == 73 && shift_key) { // shift + i
if (document.getElementById("subtoolbar_search")) {
if (Element.visible("subtoolbar_search")) {
Element.hide("subtoolbar_search");
Element.show("subtoolbar_ftitle");
setTimeout("Element.focus('subtoolbar_search_box')", 100);
} else {
Element.show("subtoolbar_search");
Element.hide("subtoolbar_ftitle");
}
}
}
if (keycode == 27) { // escape
if (Element.visible("hotkey_help_overlay")) {
Element.hide("hotkey_help_overlay");
}
}
if (typeof localHotkeyHandler != 'undefined') {
try {
return localHotkeyHandler(e);
} catch (e) {
exception_error("hotkey_handler, local:", e);
}
} */
if (hotkey_prefix) {
debug("KP: PREFIX=" + hotkey_prefix + " CODE=" + keycode + " CHAR=" + keychar);
} else {