1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-28 08:55:46 +01:00

lastInputField is now available after switching tabs, new v.buffer.loaded getter/setter

This commit is contained in:
Martin Stubenschrott
2007-12-17 20:45:28 +00:00
parent 14a367ff71
commit 39fbf33d8b
4 changed files with 35 additions and 3 deletions

View File

@@ -222,7 +222,31 @@ vimperator.Buffer = function () //{{{
return {
lastInputField: null, // used to keep track of the right field for "gi"
// 0 if loading, 1 if loaded or 2 if load failed
get loaded()
{
if (typeof window.content.document.pageIsFullyLoaded != "undefined")
return window.content.document.pageIsFullyLoaded;
else
return 1; // in doubt return "loaded"
},
set loaded(value)
{
window.content.document.pageIsFullyLoaded = value;
},
// used to keep track of the right field for "gi"
get lastInputField()
{
if (window.content.document.lastInputField)
return window.content.document.lastInputField;
else
return null;
},
set lastInputField(value)
{
window.content.document.lastInputField = value;
},
get URL()
{

View File

@@ -862,7 +862,7 @@ vimperator.Events = function () //{{{
},
// XXX: function may later be needed to detect a canceled synchronous openURL()
onStateChange: function (webProgress, aRequest, flags, aStatus)
onStateChange: function (webProgress, request, flags, status)
{
// STATE_IS_DOCUMENT | STATE_IS_WINDOW is important, because we also
// receive statechange events for loading images and other parts of the web page
@@ -873,12 +873,16 @@ vimperator.Events = function () //{{{
// only thrown for the current tab, not when another tab changes
if (flags & Components.interfaces.nsIWebProgressListener.STATE_START)
{
vimperator.buffer.loaded = 0;
vimperator.statusline.updateProgress(0);
setTimeout (function () { vimperator.modes.reset(false); },
vimperator.mode == vimperator.modes.HINTS ? 500 : 0);
}
else if (flags & Components.interfaces.nsIWebProgressListener.STATE_STOP)
;// vimperator.statusline.updateUrl();
{
vimperator.buffer.loaded = (status == 0 ? 1 : 2);
vimperator.statusline.updateUrl();
}
}
},
// for notifying the user about secure web pages