1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 19:22:25 +01:00

made :setlocal work on tabs, not buffer

This commit is contained in:
Martin Stubenschrott
2008-08-13 20:50:39 +00:00
parent 0c11a6b652
commit c49ed07af9
4 changed files with 13 additions and 8 deletions

View File

@@ -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:
* Takayuki Tsukitani
* Victor Nemkov * Victor Nemkov
* John Lusth * John Lusth
* Thomas Svensen * Thomas Svensen

View File

@@ -627,13 +627,6 @@ liberator.Buffer = function () //{{{
return window.content.document.title; return window.content.document.title;
}, },
get options()
{
if (!window.content.document.liberatorOptions)
window.content.document.liberatorOptions = {};
return window.content.document.liberatorOptions;
},
// returns an XPathResult object // returns an XPathResult object
evaluateXPath: function (expression, doc, elem, asIterator) evaluateXPath: function (expression, doc, elem, asIterator)
{ {

View File

@@ -71,7 +71,7 @@ liberator.Option = function (names, description, type, defaultValue, scope, gett
var aValue; var aValue;
if (this.scope & liberator.options.OPTION_SCOPE_LOCAL) if (this.scope & liberator.options.OPTION_SCOPE_LOCAL)
aValue = liberator.buffer.options[this.name]; aValue = liberator.tabs.options[this.name]; // TODO: does that work without has("tabs")?
if ((this.scope & liberator.options.OPTION_SCOPE_GLOBAL) && (aValue == undefined)) if ((this.scope & liberator.options.OPTION_SCOPE_GLOBAL) && (aValue == undefined))
aValue = value; aValue = value;
@@ -81,6 +81,7 @@ liberator.Option = function (names, description, type, defaultValue, scope, gett
return aValue; return aValue;
} }
); );
this.__defineSetter__("value", this.__defineSetter__("value",
function (newValue) function (newValue)
{ {

View File

@@ -538,6 +538,16 @@ liberator.Tabs = function () //{{{
get count() { return getBrowser().mTabs.length; }, get count() { return getBrowser().mTabs.length; },
// used for :setlocal
get options()
{
var tab = this.getTab();
if (!tab.liberatorOptions)
tab.liberatorOptions = {};
return tab.liberatorOptions;
},
get tabStrip() get tabStrip()
{ {
if (liberator.config.hostApplication == "Firefox") if (liberator.config.hostApplication == "Firefox")