}
-function localPiggieFunction(enable) {
+function piggie(enable) {
if (enable) {
debug("I LOVEDED IT!");
var piggie = document.getElementById("piggie");
keycode = e.which;
}
+ var keychar = String.fromCharCode(keycode);
+
if (keycode == 27) { // escape
if (Element.visible("hotkey_help_overlay")) {
Element.hide("hotkey_help_overlay");
if ((keycode == 67 || keycode == 71) && !hotkey_prefix) {
hotkey_prefix = keycode;
- debug("KP: PREFIX=" + keycode);
+ debug("KP: PREFIX=" + keycode + " CHAR=" + keychar);
return;
}
return;
}
- if (keycode == 191 && shift_key) { // ?
+ 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});
} else {
Element.hide("hotkey_help_overlay");
}
- return;
+ return false;
}
- if (keycode == 191) { // /
+ if (keycode == 191 || keychar == '/') { // /
var search_boxes = new Array("label_search",
"feed_search", "filter_search", "user_search");
for (var i = 0; i < search_boxes.length; i++) {
var elem = document.getElementById(search_boxes[i]);
if (elem) {
- return focus_element(search_boxes[i]);
+ focus_element(search_boxes[i]);
+ return false;
}
}
}
hotkey_prefix = false;
if (keycode == 70) { // f
- return displayDlg("quickAddFilter");
+ displayDlg("quickAddFilter");
+ return false;
}
if (keycode == 83) { // s
- return displayDlg("quickAddFeed");
+ displayDlg("quickAddFeed");
+ return false;
}
if (keycode == 76) { // l
- return displayDlg("quickAddLabel");
+ displayDlg("quickAddLabel");
+ return false;
}
if (keycode == 85) { // u
}
if (keycode == 67) { // c
- return editFeedCats();
+ editFeedCats();
+ return false;
}
if (keycode == 84 && shift_key) { // T
- return browseFeeds();
+ browseFeeds();
+ return false;
}
}
if (keycode == 49 && document.getElementById("genConfigTab")) { // 1
selectTab("genConfig");
+ return false;
}
if (keycode == 50 && document.getElementById("feedConfigTab")) { // 2
- return selectTab("feedConfig");
+ selectTab("feedConfig");
+ return false;
}
if (keycode == 51 && document.getElementById("feedBrowserTab")) { // 3
- return selectTab("feedBrowser");
+ selectTab("feedBrowser");
+ return false;
}
if (keycode == 52 && document.getElementById("filterConfigTab")) { // 4
- return selectTab("filterConfig");
+ selectTab("filterConfig");
+ return false;
}
if (keycode == 53 && document.getElementById("labelConfigTab")) { // 5
- return selectTab("labelConfig");
+ selectTab("labelConfig");
+ return false;
}
if (keycode == 54 && document.getElementById("userConfigTab")) { // 6
- return selectTab("userConfig");
+ selectTab("userConfig");
+ return false;
}
if (keycode == 88) { // x
if (seq.match("807371717369")) {
seq = "";
- localPiggieFunction(true);
+ piggie(true);
} else {
- localPiggieFunction(false);
+ piggie(false);
}
}
if (hotkey_prefix) {
- debug("KP: PREFIX=" + hotkey_prefix + " CODE=" + keycode);
+ debug("KP: PREFIX=" + hotkey_prefix + " CODE=" + keycode + " CHAR=" + keychar);
} else {
- debug("KP: CODE=" + keycode);
+ debug("KP: CODE=" + keycode + " CHAR=" + keychar);
}
} catch (e) {
keycode = e.which;
}
- keychar = String.fromCharCode(keycode);
+ var keychar = String.fromCharCode(keycode);
if (keycode == 27) { // escape
if (Element.visible("hotkey_help_overlay")) {
if ((keycode == 70 || keycode == 67 || keycode == 71) && !hotkey_prefix) {
hotkey_prefix = keycode;
- debug("KP: PREFIX=" + keycode);
+ debug("KP: PREFIX=" + keycode + " CHAR=" + keychar);
return;
}
return;
}
- if (keycode == 191 && shift_key) { // ?
+ 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});
} else {
Element.hide("hotkey_help_overlay");
}
- return;
+ return false;
}
- if (keycode == 191 || (is_opera() && keycode == 47)) { // /
- return displayDlg("search", getActiveFeedId() + ":" + activeFeedIsCat());
+ if (keycode == 191 || keychar == '/') { // /
+ displayDlg("search", getActiveFeedId() + ":" + activeFeedIsCat());
+ return false;
}
if (keycode == 82 && shift_key) { // R
- return scheduleFeedUpdate(true);
+ scheduleFeedUpdate(true);
+ return false;
}
if (keycode == 82) { // r
if (getActiveFeedId()) {
- return viewfeed(getActiveFeedId(), "ForceUpdate");
+ viewfeed(getActiveFeedId(), "ForceUpdate");
+ return false;
}
}
var feed = getActiveFeedId();
var new_feed = getRelativeFeedId(feedlist, feed, 'prev');
if (new_feed) viewfeed(new_feed, '');
- return;
+ return false;
}
if (keycode == 75) { // k
var feed = getActiveFeedId();
var new_feed = getRelativeFeedId(feedlist, feed, 'next');
if (new_feed) viewfeed(new_feed, '');
- return;
+ return false;
}
if (shift_key && (keycode == 78 || keycode == 40)) { // shift - n, down
if (id) {
togglePub(id);
}
- return;
+ return false;
}
if (keycode == 83) { // s
if (id) {
toggleMark(id);
}
- return;
+ return false;
}
if (id) {
toggleUnread(id);
}
- return;
+ return false;
}
if (keycode == 84 && shift_key) { // T
var id = getActiveArticleId();
if (id) {
editArticleTags(id, getActiveFeedId(), isCdmMode());
+ return false;
}
}
if (cb) {
cb.checked = !cb.checked;
toggleSelectRowById(cb, "RROW-" + id);
+ return false;
}
-
- return false;
}
}
if (keycode == 79) { // o
if (getActiveArticleId()) {
openArticleInNewWindow(getActiveArticleId());
+ return false;
}
}
hotkey_prefix = false;
if (keycode == 65) { // a
- return toggleDispRead();
+ toggleDispRead();
+ return false;
}
if (keycode == 85 && shift_key) { // U
- return scheduleFeedUpdate(true);
+ scheduleFeedUpdate(true);
+ return false;
}
if (keycode == 85) { // u
if (getActiveFeedId()) {
- return viewfeed(getActiveFeedId(), "ForceUpdate");
+ viewfeed(getActiveFeedId(), "ForceUpdate");
+ return false;
}
}
if (keycode == 69) { // e
- return editFeedDlg(getActiveFeedId());
+ editFeedDlg(getActiveFeedId());
+ return false;
}
if (keycode == 83) { // s
- return displayDlg("quickAddFeed");
+ displayDlg("quickAddFeed");
+ return false;
}
if (keycode == 67 && shift_key) { // C
if (typeof catchupAllFeeds != 'undefined') {
- return catchupAllFeeds();
+ catchupAllFeeds();
+ return false;
}
}
if (keycode == 67) { // c
if (getActiveFeedId()) {
- return catchupCurrentFeed();
+ catchupCurrentFeed();
+ return false;
}
}
hotkey_prefix = false;
if (keycode == 70) { // f
- return displayDlg("quickAddFilter", getActiveFeedId());
+ displayDlg("quickAddFilter", getActiveFeedId());
+ return false;
}
if (keycode == 83) { // s
if (typeof collapse_feedlist != 'undefined') {
- return collapse_feedlist();
+ collapse_feedlist();
+ return false;
}
}
hotkey_prefix = false;
if (keycode == 83) { // s
- return viewfeed(-1);
+ viewfeed(-1);
+ return false;
}
if (keycode == 80 && shift_key) { // P
- return gotoPreferences();
+ gotoPreferences();
+ return false;
}
if (keycode == 80) { // p
- return viewfeed(-2);
+ viewfeed(-2);
+ return false;
}
if (keycode == 70) { // f
- return viewfeed(-3);
+ viewfeed(-3);
+ return false;
}
if (keycode == 84 && shift_key) { // T
toggleTags();
+ return false;
}
}