1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-05 11:15:46 +01:00

flashing frame works now

This commit is contained in:
Martin Stubenschrott
2007-05-24 10:47:54 +00:00
parent 2a547a794f
commit 6d2aece0fc
4 changed files with 48 additions and 47 deletions

View File

@@ -4,12 +4,12 @@ Main developer:
Developers:
* Viktor Kojouharov (Виктор Кожухаров)
* Doug Kearns
Patches:
* Muthu Kannan (ctrl-v support)
* Lars Kindler (:buffer(s) functionality)
* Lee Hinman (:open ./.. support)
* Bart Trojanowski (Makefile)
* Doug Kearns (vimperator.vim, :tabonly etc. commands)
* Hannes Rist (:set title support)
* Hannes Rist (:set titlestring support)
</pre>

View File

@@ -1,6 +1,7 @@
<pre>
2007-05-02:
* version ???
* Flashing frame with ]f now works as expected
* many help fixes (most of them by Doug Kearns)
* new :reloadall command
* :hardcopy works now and shows the printing dialog

View File

@@ -1428,7 +1428,6 @@ function isDirectory(url)
// frame related functions //////////////////////////////////////// {{{1
////////////////////////////////////////////////////////////////////////
// function stolen from Conkeror
function focusNextFrame(count)
{
try
@@ -1454,21 +1453,20 @@ function focusNextFrame(count)
// Focus the next one, 0 if we're at the last one
if (next >= frames.length)
next = 0;
frames[next].focus();
var oldbg = frames[next].document.bgColor;
var oldstyle = frames[next].document.body.getAttribute("style");
frames[next].document.bgColor = "red";
frames[next].document.body.setAttribute("style", "background-color: #FF0000;");
setTimeout(function(doc, bgcolor, style) {
doc.bgColor = bgcolor;
if (oldstyle == null)
doc.body.removeAttribute("style");
else
doc.body.setAttribute("style", style);
}, 150, frames[next].document, oldbg, oldstyle);
} catch(e) {alert(e);}
frames[next].focus();
var doc = frames[next].document;
var indicator = doc.createElement("div");
indicator.id = "vimperator-frame-indicator";
// NOTE: need to set a high z-index - it's a crapshoot!
var style = "background-color: red; opacity: 0.5; z-index: 999;" +
"position: fixed; top: 0; bottom: 0; left: 0; right: 0;";
indicator.setAttribute("style", style);
doc.body.appendChild(indicator);
setTimeout(function() { doc.body.removeChild(indicator); }, 250);
} catch(e) { alert(e); }
}

View File

@@ -1098,17 +1098,19 @@ function Vimperator()
// alert('end');
}
// XXX: move where?
// provides functions for working with tabs
function Tabs()
{
////////////////////////////////////////////////////////////////////////////////
////////////////////// PRIVATE SECTION /////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/* spec can either be an absolute integer
* or "" for the current tab
* or "+1" for the next tab
* or "-3" for the tab, which is 3 positions left of the current
* or "$" for the last tab
/** @param spec can either be:
* - an absolute integer
* - "" for the current tab
* - "+1" for the next tab
* - "-3" for the tab, which is 3 positions left of the current
* - "$" for the last tab
*/
function indexFromSpec(spec, wrap)
{
@@ -1145,23 +1147,23 @@ function Tabs()
return position;
}
function indexFromTab(tab)
{
var length = getBrowser().mTabs.length;
for (var i = 0; i < length; i++)
{
if (getBrowser().mTabs[i] == tab)
return i;
}
return false;
}
////////////////////////////////////////////////////////////////////////////////
////////////////////// PUBLIC SECTION //////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// @returns the index of the currently selected tab starting with 0
this.index = function()
this.index = function(tab)
{
if(tab)
{
var length = getBrowser().mTabs.length;
for (var i = 0; i < length; i++)
{
if (getBrowser().mTabs[i] == tab)
return i;
}
return false;
}
return getBrowser().tabContainer.selectedIndex;
}
this.count = function()
@@ -1170,7 +1172,7 @@ function Tabs()
}
// TODO: implement filter
// @returns an array of buffers which match filter
// @returns an array of tabs which match filter
this.get = function(filter)
{
var buffers = [];
@@ -1185,7 +1187,7 @@ function Tabs()
return buffers;
}
/* position == '' moves the tab to the last position as per Vim
/* spec == "" moves the tab to the last position as per Vim
* wrap causes the movement to wrap around the start and end of the tab list
* NOTE: position is a 0 based index
* FIXME: tabmove! N should probably produce an error
@@ -1199,17 +1201,6 @@ function Tabs()
getBrowser().moveTabTo(tab, index);
}
this.select = function(spec, wrap)
{
var index = indexFromSpec(spec, wrap);
if (index === false)
{
beep(); // XXX: move to ex-handling?
return false;
}
getBrowser().mTabContainer.selectedIndex = index;
}
/* quit_on_last_tab = 1: quit without saving session
* quit_on_last_tab = 2: quit and save session
*/
@@ -1230,5 +1221,16 @@ function Tabs()
{
getBrowser().removeAllTabsBut(tab);
}
this.select = function(spec, wrap)
{
var index = indexFromSpec(spec, wrap);
if (index === false)
{
beep(); // XXX: move to ex-handling?
return false;
}
getBrowser().mTabContainer.selectedIndex = index;
}
}
// vim: set fdm=marker sw=4 ts=4 et: