diff --git a/Donators b/Donators index 34f5f74a..9c266865 100644 --- a/Donators +++ b/Donators @@ -2,6 +2,7 @@ Note: If you don't wish to appear on this list when making a donation, please tell me. 2008: +* Paul Sobey * Olivier Guéry * Dotan Cohen * Daniel Schaffrath diff --git a/NEWS b/NEWS index ec7bd951..874dc23a 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,9 @@ * version 1.2 * IMPORTANT: removed old :buffers! buffer window, as it was ugly and slightly broken use "B" or :buffers instead + * IMPORTANT: input fields are not blured anymore by default after a page has loaded + use :set [no]focuscontent to control the behavior (thanks Paul Sobey for the + generous donation which made this behavior possible) * :bdelete accepts an optional argument now * renamed some :autocmd, mainly BrowserStartup -> Startup and BrowserExit -> Quit * don't pass any ctrl- or alt- prefixed keys to firefox in insert mode diff --git a/content/buffer.js b/content/buffer.js index 82e63df0..f10f584a 100644 --- a/content/buffer.js +++ b/content/buffer.js @@ -142,7 +142,9 @@ liberator.Buffer = function () //{{{ ////////////////////// OPTIONS ///////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ - liberator.options.add(["fullscreen", "fs"], "Show the current window fullscreen", "boolean", false, + liberator.options.add(["fullscreen", "fs"], + "Show the current window fullscreen", + "boolean", false, { setter: function (value) { window.fullScreen = value; }, getter: function () { return window.fullScreen; } diff --git a/content/events.js b/content/events.js index 13af7075..1d8d038e 100644 --- a/content/events.js +++ b/content/events.js @@ -42,6 +42,14 @@ liberator.AutoCommands = function () //{{{ throw StopIteration; } + /////////////////////////////////////////////////////////////////////////////}}} + ////////////////////// OPTIONS ///////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + + liberator.options.add(["focuscontent", "fc"], + "Try to stay in normal mode after loading a web page", + "boolean", false); + /////////////////////////////////////////////////////////////////////////////}}} ////////////////////// COMMANDS //////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ @@ -456,12 +464,16 @@ liberator.Events = function () //{{{ if (doc == getBrowser().contentDocument) { // we want to stay in command mode after a page has loaded - // XXX: Does this still causes window map events which is _very_ annoying - setTimeout(function () { - var focused = document.commandDispatcher.focusedElement; - if (focused && (typeof focused.value != "undefined") && focused.value.length == 0) - focused.blur(); - }, 100); + // TODO: move somehwere else, as focusing can already happen earlier than on "load" + if (liberator.options["focuscontent"]) + { + liberator.log("focuscontent"); + setTimeout(function () { + var focused = document.commandDispatcher.focusedElement; + if (focused && (typeof focused.value != "undefined") && focused.value.length == 0) + focused.blur(); + }, 100); + } } } } @@ -478,7 +490,7 @@ liberator.Events = function () //{{{ if (liberator.buffer.loaded == 1) return true; - var ms = 15000; // maximum time to wait - TODO: add option + var ms = 25000; // maximum time to wait - TODO: add option var then = new Date().getTime(); for (var now = then; now - then < ms; now = new Date().getTime()) { @@ -931,6 +943,8 @@ liberator.Events = function () //{{{ if (liberator.mode == liberator.modes.COMMAND_LINE) return; + // liberator.log("onFocusChange: " + liberator.buffer.loaded); + var win = window.document.commandDispatcher.focusedWindow; var elem = window.document.commandDispatcher.focusedElement; if (elem && elem.readOnly) diff --git a/locale/en-US/options.txt b/locale/en-US/options.txt index 088abe45..c58faf01 100644 --- a/locale/en-US/options.txt +++ b/locale/en-US/options.txt @@ -197,6 +197,17 @@ The XPath string of hintable elements activated by [m];[m]. ____ +|\'nofc'| |\'nofocuscontent'| |\'fc'| |\'focuscontent'| +||'focuscontent' 'fc'|| boolean (default: off) +____ +Focus the content after a page has loaded. This is useful, if you always +want to stay in normal mode when browsing between web sites. When "on", it +blurs any textbox which often is automatically focused on page load. +If you usually like 'focuscontent' but sometimes you'd like to focus the +first input field, you can use [m]gi[m] to jump to it. +____ + + |\'nofs'| |\'nofullscreen'| |\'fs'| |\'fullscreen'| ||'fullscreen' 'fs'|| boolean (default: off) ____