mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 13:02:27 +01:00
:set [no]focuscontent, thanks Paul!
This commit is contained in:
1
Donators
1
Donators
@@ -2,6 +2,7 @@
|
|||||||
<b>Note:</b> If you don't wish to appear on this list when making a donation, please tell me.
|
<b>Note:</b> If you don't wish to appear on this list when making a donation, please tell me.
|
||||||
|
|
||||||
2008:
|
2008:
|
||||||
|
* Paul Sobey
|
||||||
* Olivier Guéry
|
* Olivier Guéry
|
||||||
* Dotan Cohen
|
* Dotan Cohen
|
||||||
* Daniel Schaffrath
|
* Daniel Schaffrath
|
||||||
|
|||||||
3
NEWS
3
NEWS
@@ -3,6 +3,9 @@
|
|||||||
* version 1.2
|
* version 1.2
|
||||||
* IMPORTANT: removed old :buffers! buffer window, as it was ugly and slightly broken
|
* IMPORTANT: removed old :buffers! buffer window, as it was ugly and slightly broken
|
||||||
use "B" or :buffers instead
|
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
|
* :bdelete accepts an optional argument now
|
||||||
* renamed some :autocmd, mainly BrowserStartup -> Startup and BrowserExit -> Quit
|
* renamed some :autocmd, mainly BrowserStartup -> Startup and BrowserExit -> Quit
|
||||||
* don't pass any ctrl- or alt- prefixed keys to firefox in insert mode
|
* don't pass any ctrl- or alt- prefixed keys to firefox in insert mode
|
||||||
|
|||||||
@@ -142,7 +142,9 @@ liberator.Buffer = function () //{{{
|
|||||||
////////////////////// OPTIONS /////////////////////////////////////////////////
|
////////////////////// 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; },
|
setter: function (value) { window.fullScreen = value; },
|
||||||
getter: function () { return window.fullScreen; }
|
getter: function () { return window.fullScreen; }
|
||||||
|
|||||||
@@ -42,6 +42,14 @@ liberator.AutoCommands = function () //{{{
|
|||||||
throw StopIteration;
|
throw StopIteration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////}}}
|
||||||
|
////////////////////// OPTIONS /////////////////////////////////////////////////
|
||||||
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
|
|
||||||
|
liberator.options.add(["focuscontent", "fc"],
|
||||||
|
"Try to stay in normal mode after loading a web page",
|
||||||
|
"boolean", false);
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////}}}
|
/////////////////////////////////////////////////////////////////////////////}}}
|
||||||
////////////////////// COMMANDS ////////////////////////////////////////////////
|
////////////////////// COMMANDS ////////////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////{{{
|
/////////////////////////////////////////////////////////////////////////////{{{
|
||||||
@@ -456,7 +464,10 @@ liberator.Events = function () //{{{
|
|||||||
if (doc == getBrowser().contentDocument)
|
if (doc == getBrowser().contentDocument)
|
||||||
{
|
{
|
||||||
// we want to stay in command mode after a page has loaded
|
// we want to stay in command mode after a page has loaded
|
||||||
// XXX: Does this still causes window map events which is _very_ annoying
|
// TODO: move somehwere else, as focusing can already happen earlier than on "load"
|
||||||
|
if (liberator.options["focuscontent"])
|
||||||
|
{
|
||||||
|
liberator.log("focuscontent");
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
var focused = document.commandDispatcher.focusedElement;
|
var focused = document.commandDispatcher.focusedElement;
|
||||||
if (focused && (typeof focused.value != "undefined") && focused.value.length == 0)
|
if (focused && (typeof focused.value != "undefined") && focused.value.length == 0)
|
||||||
@@ -465,6 +476,7 @@ liberator.Events = function () //{{{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// return true when load successful, or false otherwise
|
// return true when load successful, or false otherwise
|
||||||
function waitForPageLoaded()
|
function waitForPageLoaded()
|
||||||
@@ -478,7 +490,7 @@ liberator.Events = function () //{{{
|
|||||||
if (liberator.buffer.loaded == 1)
|
if (liberator.buffer.loaded == 1)
|
||||||
return true;
|
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();
|
var then = new Date().getTime();
|
||||||
for (var now = then; now - then < ms; now = 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)
|
if (liberator.mode == liberator.modes.COMMAND_LINE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// liberator.log("onFocusChange: " + liberator.buffer.loaded);
|
||||||
|
|
||||||
var win = window.document.commandDispatcher.focusedWindow;
|
var win = window.document.commandDispatcher.focusedWindow;
|
||||||
var elem = window.document.commandDispatcher.focusedElement;
|
var elem = window.document.commandDispatcher.focusedElement;
|
||||||
if (elem && elem.readOnly)
|
if (elem && elem.readOnly)
|
||||||
|
|||||||
@@ -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'|
|
|\'nofs'| |\'nofullscreen'| |\'fs'| |\'fullscreen'|
|
||||||
||'fullscreen' 'fs'|| boolean (default: off)
|
||'fullscreen' 'fs'|| boolean (default: off)
|
||||||
____
|
____
|
||||||
|
|||||||
Reference in New Issue
Block a user