From 26c41a1f1b34757fa27b50d86f101a7db5482833 Mon Sep 17 00:00:00 2001 From: piro Date: Mon, 27 Apr 2009 09:40:40 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=A9=E3=82=A4=E3=83=96=E3=83=A9=E3=83=AA?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=EF=BC=88Chromifox=20Basic=EF=BC=88=20https:/?= =?UTF-8?q?/addons.mozilla.org/firefox/addon/8782=20=EF=BC=89=E3=81=A8?= =?UTF-8?q?=E3=81=AE=E7=AB=B6=E5=90=88=E3=82=92=E8=A7=A3=E6=B6=88=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@4196 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/res/tabFx2Compatible.css | 6 ++--- content/treestyletab/res/tabFx2Compatible.xul | 22 +++++++++++++++---- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/content/treestyletab/res/tabFx2Compatible.css b/content/treestyletab/res/tabFx2Compatible.css index f3ba71a0..41369f2d 100644 --- a/content/treestyletab/res/tabFx2Compatible.css +++ b/content/treestyletab/res/tabFx2Compatible.css @@ -14,15 +14,15 @@ @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); -:root[tabFx2Compatible="2"] .tabbrowser-tab { +:root[tabFx2Compatible="3"] .tabbrowser-tab { -moz-binding: url(tabFx2Compatible.xml#tabbrowser-tab) !important; } -:root[tabFx2Compatible="2"] .tabbrowser-tab[busy] > hbox > stack > .tab-icon-image { +:root[tabFx2Compatible="3"] .tabbrowser-tab[busy] > hbox > stack > .tab-icon-image { list-style-image: url("chrome://global/skin/throbber/Throbber-small.gif") !important; opacity: 0.6; } -:root[tabFx2Compatible="2"] .tabbrowser-tab[selected="true"]:focus > hbox > .tab-text { +:root[tabFx2Compatible="3"] .tabbrowser-tab[selected="true"]:focus > hbox > .tab-text { border: 1px dotted -moz-DialogText; } diff --git a/content/treestyletab/res/tabFx2Compatible.xul b/content/treestyletab/res/tabFx2Compatible.xul index 73af4ae2..a15ffd69 100644 --- a/content/treestyletab/res/tabFx2Compatible.xul +++ b/content/treestyletab/res/tabFx2Compatible.xul @@ -19,7 +19,7 @@ window.addEventListener('DOMContentLoaded', function() { window.removeEventListener('DOMContentLoaded', arguments.callee, true); - const currentRevision = 2; + const currentRevision = 3; var b = document.getElementById('content'); if (!b || b.localName != 'tabbrowser') return; @@ -38,10 +38,24 @@ window.addEventListener('DOMContentLoaded', function() { } } - switch (window.getComputedStyle(b.selectedTab, '').getPropertyValue('-moz-binding')) + var url = window.getComputedStyle(b.selectedTab, '').getPropertyValue('-moz-binding'); + url = url.match(/url\(['"]?(.+)['"]?\)/); + url = url ? url[1] : null ; + switch (url) { - case 'url(chrome://browser/content/tabbrowser.xml#tabbrowser-tab)': // -Gecko 1.9 - case 'url("chrome://browser/content/tabbrowser.xml#tabbrowser-tab")': // Gecko 1.9.1- + case 'chrome://browser/skin/browser.xml#tabbrowser-tab': // defied by theme + const Pref = Components.classes['@mozilla.org/preferences;1'] + .getService(Components.interfaces.nsIPrefBranch); + var skin = decodeURIComponent(escape(Pref.getCharPref('general.skins.selectedSkin'))); + switch (skin.toLowerCase()) + { + case 'classic/1.0': // Default + case 'chromifox': // Chromifox Basic: https://addons.mozilla.org/firefox/addon/8782 + break; + default: + return; + } + case 'chrome://browser/content/tabbrowser.xml#tabbrowser-tab': // built-in root.setAttribute('tabFx2Compatible', currentRevision); break; }