From c49ed07af999574effa419033e304b91664aa9e2 Mon Sep 17 00:00:00 2001 From: Martin Stubenschrott Date: Wed, 13 Aug 2008 20:50:39 +0000 Subject: [PATCH] made :setlocal work on tabs, not buffer --- Donators | 1 + content/buffer.js | 7 ------- content/options.js | 3 ++- content/tabs.js | 10 ++++++++++ 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Donators b/Donators index 919a68ef..f440507a 100644 --- a/Donators +++ b/Donators @@ -2,6 +2,7 @@ Note: If you don't wish to appear on this list when making a donation, please tell me. 2008: +* Takayuki Tsukitani * Victor Nemkov * John Lusth * Thomas Svensen diff --git a/content/buffer.js b/content/buffer.js index 8b20f1dd..0c3651c0 100644 --- a/content/buffer.js +++ b/content/buffer.js @@ -627,13 +627,6 @@ liberator.Buffer = function () //{{{ 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 evaluateXPath: function (expression, doc, elem, asIterator) { diff --git a/content/options.js b/content/options.js index ce0091da..3244fa11 100644 --- a/content/options.js +++ b/content/options.js @@ -71,7 +71,7 @@ liberator.Option = function (names, description, type, defaultValue, scope, gett var aValue; 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)) aValue = value; @@ -81,6 +81,7 @@ liberator.Option = function (names, description, type, defaultValue, scope, gett return aValue; } ); + this.__defineSetter__("value", function (newValue) { diff --git a/content/tabs.js b/content/tabs.js index 15758ac7..3a75f07e 100644 --- a/content/tabs.js +++ b/content/tabs.js @@ -538,6 +538,16 @@ liberator.Tabs = function () //{{{ 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() { if (liberator.config.hostApplication == "Firefox")