From be46540644e8519903517f70dca40e18efd7aec8 Mon Sep 17 00:00:00 2001 From: mooz Date: Wed, 30 Jun 2010 11:05:42 +0900 Subject: [PATCH] Added command "focus to the content". Closes #23. --- locale/en-US/functions.properties | 7 ++++++- locale/ja/functions.properties | 7 ++++++- share/functions.js | 7 +++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/locale/en-US/functions.properties b/locale/en-US/functions.properties index 71759e9..e53641c 100644 --- a/locale/en-US/functions.properties +++ b/locale/en-US/functions.properties @@ -163,4 +163,9 @@ restart_firefox=Restart Firefox command_interpreter=Command interpreter ext_select=List exts and execute selected one -list_command=List and execute commands \ No newline at end of file +list_command=List and execute commands + +## =========================================================================== ## + +focus_to_prompt=Focus to the KeySnail's prompt +focus_to_content=Focus to the content diff --git a/locale/ja/functions.properties b/locale/ja/functions.properties index fb11e32..e6ac2f1 100644 --- a/locale/ja/functions.properties +++ b/locale/ja/functions.properties @@ -163,4 +163,9 @@ restart_firefox=Firefox を再起動 command_interpreter=JavaScript のコードを評価 ext_select=エクステ一覧表示 -list_command=コマンドの実行 \ No newline at end of file +list_command=コマンドの実行 + +## =========================================================================== ## + +focus_to_prompt=KeySnail のプロンプトへフォーカス +focus_to_content=コンテンツへフォーカス diff --git a/share/functions.js b/share/functions.js index 2c983ce..9aabb72 100644 --- a/share/functions.js +++ b/share/functions.js @@ -155,6 +155,13 @@ var ksBuiltin = { categoryFocus: { __mode__: 0, + focus_to_content: [ + function (ev, arg) { + let (elem = document.commandDispatcher.focusedElement) elem && elem.blur(); + gBrowser.focus(); + content.focus(); + }, true], + focus_to_the_location_bar: [ function (ev) { command.focusToById("urlbar");