mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-04 23:45:47 +01:00
flashing frame works now
This commit is contained in:
4
AUTHORS
4
AUTHORS
@@ -4,12 +4,12 @@ Main developer:
|
|||||||
|
|
||||||
Developers:
|
Developers:
|
||||||
* Viktor Kojouharov (Виктор Кожухаров)
|
* Viktor Kojouharov (Виктор Кожухаров)
|
||||||
|
* Doug Kearns
|
||||||
|
|
||||||
Patches:
|
Patches:
|
||||||
* Muthu Kannan (ctrl-v support)
|
* Muthu Kannan (ctrl-v support)
|
||||||
* Lars Kindler (:buffer(s) functionality)
|
* Lars Kindler (:buffer(s) functionality)
|
||||||
* Lee Hinman (:open ./.. support)
|
* Lee Hinman (:open ./.. support)
|
||||||
* Bart Trojanowski (Makefile)
|
* Bart Trojanowski (Makefile)
|
||||||
* Doug Kearns (vimperator.vim, :tabonly etc. commands)
|
* Hannes Rist (:set titlestring support)
|
||||||
* Hannes Rist (:set title support)
|
|
||||||
</pre>
|
</pre>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<pre>
|
<pre>
|
||||||
2007-05-02:
|
2007-05-02:
|
||||||
* version ???
|
* version ???
|
||||||
|
* Flashing frame with ]f now works as expected
|
||||||
* many help fixes (most of them by Doug Kearns)
|
* many help fixes (most of them by Doug Kearns)
|
||||||
* new :reloadall command
|
* new :reloadall command
|
||||||
* :hardcopy works now and shows the printing dialog
|
* :hardcopy works now and shows the printing dialog
|
||||||
|
|||||||
@@ -1428,7 +1428,6 @@ function isDirectory(url)
|
|||||||
// frame related functions //////////////////////////////////////// {{{1
|
// frame related functions //////////////////////////////////////// {{{1
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// function stolen from Conkeror
|
|
||||||
function focusNextFrame(count)
|
function focusNextFrame(count)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -1454,21 +1453,20 @@ function focusNextFrame(count)
|
|||||||
// Focus the next one, 0 if we're at the last one
|
// Focus the next one, 0 if we're at the last one
|
||||||
if (next >= frames.length)
|
if (next >= frames.length)
|
||||||
next = 0;
|
next = 0;
|
||||||
|
|
||||||
frames[next].focus();
|
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) {
|
var doc = frames[next].document;
|
||||||
doc.bgColor = bgcolor;
|
var indicator = doc.createElement("div");
|
||||||
if (oldstyle == null)
|
indicator.id = "vimperator-frame-indicator";
|
||||||
doc.body.removeAttribute("style");
|
// NOTE: need to set a high z-index - it's a crapshoot!
|
||||||
else
|
var style = "background-color: red; opacity: 0.5; z-index: 999;" +
|
||||||
doc.body.setAttribute("style", style);
|
"position: fixed; top: 0; bottom: 0; left: 0; right: 0;";
|
||||||
}, 150, frames[next].document, oldbg, oldstyle);
|
indicator.setAttribute("style", style);
|
||||||
|
doc.body.appendChild(indicator);
|
||||||
|
|
||||||
} catch(e) {alert(e);}
|
setTimeout(function() { doc.body.removeChild(indicator); }, 250);
|
||||||
|
} catch(e) { alert(e); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1098,17 +1098,19 @@ function Vimperator()
|
|||||||
// alert('end');
|
// alert('end');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// XXX: move where?
|
||||||
// provides functions for working with tabs
|
// provides functions for working with tabs
|
||||||
function Tabs()
|
function Tabs()
|
||||||
{
|
{
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
////////////////////// PRIVATE SECTION /////////////////////////////////////////
|
////////////////////// PRIVATE SECTION /////////////////////////////////////////
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/* spec can either be an absolute integer
|
/** @param spec can either be:
|
||||||
* or "" for the current tab
|
* - an absolute integer
|
||||||
* or "+1" for the next tab
|
* - "" for the current tab
|
||||||
* or "-3" for the tab, which is 3 positions left of the current
|
* - "+1" for the next tab
|
||||||
* or "$" for the last tab
|
* - "-3" for the tab, which is 3 positions left of the current
|
||||||
|
* - "$" for the last tab
|
||||||
*/
|
*/
|
||||||
function indexFromSpec(spec, wrap)
|
function indexFromSpec(spec, wrap)
|
||||||
{
|
{
|
||||||
@@ -1145,23 +1147,23 @@ function Tabs()
|
|||||||
return position;
|
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 //////////////////////////////////////////
|
////////////////////// PUBLIC SECTION //////////////////////////////////////////
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// @returns the index of the currently selected tab starting with 0
|
// @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;
|
return getBrowser().tabContainer.selectedIndex;
|
||||||
}
|
}
|
||||||
this.count = function()
|
this.count = function()
|
||||||
@@ -1170,7 +1172,7 @@ function Tabs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: implement filter
|
// TODO: implement filter
|
||||||
// @returns an array of buffers which match filter
|
// @returns an array of tabs which match filter
|
||||||
this.get = function(filter)
|
this.get = function(filter)
|
||||||
{
|
{
|
||||||
var buffers = [];
|
var buffers = [];
|
||||||
@@ -1185,7 +1187,7 @@ function Tabs()
|
|||||||
return buffers;
|
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
|
* wrap causes the movement to wrap around the start and end of the tab list
|
||||||
* NOTE: position is a 0 based index
|
* NOTE: position is a 0 based index
|
||||||
* FIXME: tabmove! N should probably produce an error
|
* FIXME: tabmove! N should probably produce an error
|
||||||
@@ -1199,17 +1201,6 @@ function Tabs()
|
|||||||
getBrowser().moveTabTo(tab, index);
|
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 = 1: quit without saving session
|
||||||
* quit_on_last_tab = 2: quit and save session
|
* quit_on_last_tab = 2: quit and save session
|
||||||
*/
|
*/
|
||||||
@@ -1230,5 +1221,16 @@ function Tabs()
|
|||||||
{
|
{
|
||||||
getBrowser().removeAllTabsBut(tab);
|
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:
|
// vim: set fdm=marker sw=4 ts=4 et:
|
||||||
|
|||||||
Reference in New Issue
Block a user