From 6f90bd09ec8140760aec8795d9d69b28210459d3 Mon Sep 17 00:00:00 2001 From: piro Date: Thu, 18 Jun 2009 08:45:48 +0000 Subject: [PATCH] =?UTF-8?q?=E3=82=B0=E3=83=AB=E3=83=BC=E3=83=97=E3=82=92?= =?UTF-8?q?=E3=81=BE=E3=81=A8=E3=82=81=E3=82=8B=E3=82=BF=E3=83=96=E3=81=AE?= =?UTF-8?q?=E5=A4=96=E8=A6=B3=E3=82=92=E8=89=B2=E3=80=85=E6=94=B9=E5=96=84?= 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@4533 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- chrome.manifest | 12 +- components/AboutGroup.js | 141 +++++++++++++++++++ content/treestyletab/bookmarksOverlay.js | 4 +- content/treestyletab/group.xul | 21 +++ content/treestyletab/treestyletab.js | 9 +- skin/classic/treestyletab/group-fx2.png | Bin 0 -> 629 bytes skin/classic/treestyletab/group-fx3-aero.png | Bin 0 -> 590 bytes skin/classic/treestyletab/group-fx3.png | Bin 0 -> 480 bytes skin/classic/treestyletab/group.css | 17 +++ 9 files changed, 191 insertions(+), 13 deletions(-) create mode 100644 components/AboutGroup.js create mode 100644 content/treestyletab/group.xul create mode 100644 skin/classic/treestyletab/group-fx2.png create mode 100644 skin/classic/treestyletab/group-fx3-aero.png create mode 100644 skin/classic/treestyletab/group-fx3.png create mode 100644 skin/classic/treestyletab/group.css diff --git a/chrome.manifest b/chrome.manifest index c5c39a93..e38487ff 100644 --- a/chrome.manifest +++ b/chrome.manifest @@ -5,7 +5,7 @@ overlay chrome://browser/content/browser.xul chrome://treestyletab/content/trees overlay chrome://browser/content/bookmarks/bookmarksPanel.xul chrome://treestyletab/content/bookmarksOverlay.xul overlay chrome://multipletab/content/config.xul chrome://treestyletab/content/multipletabConfigOverlay.xul -style chrome://browser/content/browser.xul chrome://treestyletab/content/treestyletab-3.5.css appversion>=3.1b3pre +style chrome://browser/content/browser.xul chrome://treestyletab/content/treestyletab-3.5.css appversion>=3.1 locale treestyletab en-US jar:chrome/treestyletab.jar!/locale/en-US/treestyletab/ locale treestyletab ja jar:chrome/treestyletab.jar!/locale/ja/treestyletab/ @@ -19,7 +19,11 @@ locale treestyletab pl-PL jar:chrome/treestyletab.jar!/locale/pl-PL/treestyletab skin treestyletab classic/1.0 jar:chrome/treestyletab.jar!/skin/classic/treestyletab/ +override chrome://treestyletab/skin/group-icon chrome://treestyletab/skin/group-fx2.png +override chrome://treestyletab/skin/group-icon chrome://treestyletab/skin/group-fx3.png appversion>=3.0 +override chrome://treestyletab/skin/group-icon chrome://treestyletab/skin/group-fx3-aero.png appversion>=3.0 os=WINNT osversion>=6 + override chrome://treestyletab/skin/square/compat.css chrome://treestyletab/skin/square/compat-2.css -override chrome://treestyletab/skin/square/compat.css chrome://treestyletab/skin/dummy.css appversion>=3.0b3pre -override chrome://treestyletab/skin/square/compat.css chrome://treestyletab/skin/square/compat-3.5.css appversion>=3.1b3pre -override chrome://treestyletab/skin/metal/tab.css chrome://treestyletab/skin/metal/tab-3.5.css appversion>=3.1b3pre +override chrome://treestyletab/skin/square/compat.css chrome://treestyletab/skin/dummy.css appversion>=3.0 +override chrome://treestyletab/skin/square/compat.css chrome://treestyletab/skin/square/compat-3.5.css appversion>=3.1 +override chrome://treestyletab/skin/metal/tab.css chrome://treestyletab/skin/metal/tab-3.5.css appversion>=3.1 diff --git a/components/AboutGroup.js b/components/AboutGroup.js new file mode 100644 index 00000000..a489c351 --- /dev/null +++ b/components/AboutGroup.js @@ -0,0 +1,141 @@ +/* +***** BEGIN LICENSE BLOCK ***** +Version: MPL 1.1/GPL 2.0/LGPL 2.1 + +The contents of this file are subject to the Mozilla Public License Version +1.1 (the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at +http://www.mozilla.org/MPL/ + +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +for the specific language governing rights and limitations under the +License. + +The Original Code is the Tree Style Tab. + +The Initial Developer of the Original Code is SHIMODA Hiroshi. +Portions created by the Initial Developer are Copyright (C) 2009 +the Initial Developer. All Rights Reserved. + +Contributor(s): SHIMODA Hiroshi + +Alternatively, the contents of this file may be used under the terms of +either the GNU General Public License Version 2 or later (the "GPL"), or +the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +in which case the provisions of the GPL or the LGPL are applicable instead +of those above. If you wish to allow use of your version of this file only +under the terms of either the GPL or the LGPL, and not to allow others to +use your version of this file under the terms of the MPL, indicate your +decision by deleting the provisions above and replace them with the notice +and other provisions required by the GPL or the LGPL. If you do not delete +the provisions above, a recipient may use your version of this file under +the terms of any one of the MPL, the GPL or the LGPL. + +***** END LICENSE BLOCK ***** +*/ + +const IOService = Components.classes['@mozilla.org/network/io-service;1'] + .getService(Components.interfaces.nsIIOService); + +function AboutGroup() +{ +} + +AboutGroup.prototype = { + get contractID() { + return '@mozilla.org/network/protocol/about;1?what=treestyletab-group'; + }, + get classDescription() { + return 'about:treestyletab-group handler'; + }, + get classID() { + return Components.ID('{305122d0-5bdc-11de-8a39-0800200c9a66}'); + }, + + QueryInterface : function(aIID) + { + if (!aIID.equals(Components.interfaces.nsIAboutModule) && + !aIID.equals(Components.interfaces.nsISupports)) + throw Components.results.NS_ERROR_NO_INTERFACE; + return this; + }, + + newChannel : function(aURI) + { + return IOService.newChannel('chrome://treestyletab/content/group.xul', null, null); + }, + + getURIFlags : function(aURI) + { + return 0; + } +}; + + +var gModule = { + _firstTime: true, + + registerSelf : function (aComponentManager, aFileSpec, aLocation, aType) + { + if (this._firstTime) { + this._firstTime = false; + throw Components.results.NS_ERROR_FACTORY_REGISTER_AGAIN; + } + aComponentManager = aComponentManager.QueryInterface(Components.interfaces.nsIComponentRegistrar); + for (var key in this._objects) { + var obj = this._objects[key]; + aComponentManager.registerFactoryLocation(obj.CID, obj.className, obj.contractID, aFileSpec, aLocation, aType); + } + }, + + unregisterSelf : function (aComponentManager, aFileSpec, aLocation) + { + aComponentManager = aComponentManager.QueryInterface(Components.interfaces.nsIComponentRegistrar); + for (var key in this._objects) { + var obj = this._objects[key]; + aComponentManager.unregisterFactoryLocation(obj.CID, aFileSpec); + + categoryManager.deleteCategoryEntry('content-policy', obj.contractID, true); + } + }, + + getClassObject : function (aComponentManager, aCID, aIID) + { + if (!aIID.equals(Components.interfaces.nsIFactory)) + throw Components.results.NS_ERROR_NOT_IMPLEMENTED; + + for (var key in this._objects) { + if (aCID.equals(this._objects[key].CID)) + return this._objects[key].factory; + } + + throw Components.results.NS_ERROR_NO_INTERFACE; + }, + + _objects : { + manager : { + CID : AboutGroup.prototype.classID, + contractID : AboutGroup.prototype.contractID, + className : AboutGroup.prototype.classDescription, + factory : { + createInstance : function (aOuter, aIID) + { + if (aOuter != null) + throw Components.results.NS_ERROR_NO_AGGREGATION; + return (new AboutGroup()).QueryInterface(aIID); + } + } + } + }, + + canUnload : function (aComponentManager) + { + return true; + } +}; + +function NSGetModule(compMgr, fileSpec) +{ + return gModule; +} diff --git a/content/treestyletab/bookmarksOverlay.js b/content/treestyletab/bookmarksOverlay.js index 775aa183..6e6d4aae 100644 --- a/content/treestyletab/bookmarksOverlay.js +++ b/content/treestyletab/bookmarksOverlay.js @@ -11,7 +11,7 @@ window.addEventListener('load', function() { var folderTitle = BMDS.GetTarget(resource, RDF.GetResource(gNC_NS + 'Name'), true) .QueryInterface(kRDFLITIID) .Value; - var folderTitleURI = TreeStyleTabService.getFolderTabURI(folderTitle); + var folderTitleURI = TreeStyleTabService.getGroupTabURI(folderTitle); if (doReplace || index0 < tabCount) { browser.treeStyleTab.partTab(browser.treeStyleTab.getTabs(browser).snapshotItem(index0)); tabPanels[index0].loadURI(folderTitleURI); @@ -76,7 +76,7 @@ window.addEventListener('load', function() { ) { TreeStyleTabService.readyToOpenNewTabGroup(); if (TreeStyleTabService.getTreePref('openGroupBookmarkAsTabSubTree.underParent')) - urls.unshift(TreeStyleTabService.getFolderTabURI(aFolderTitle)); + urls.unshift(TreeStyleTabService.getGroupTabURI(aFolderTitle)); replaceCurrentTab = false; } else if (!TreeStyleTabService.getPref('browser.tabs.loadFolderAndReplace')) { diff --git a/content/treestyletab/group.xul b/content/treestyletab/group.xul new file mode 100644 index 00000000..968efc0f --- /dev/null +++ b/content/treestyletab/group.xul @@ -0,0 +1,21 @@ + + + + + + + + + diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index 304eff62..5f0b9d36 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -716,14 +716,9 @@ var TreeStyleTabService = { return Number(style.getPropertyValue(aProp).replace(/px$/, '')); }, - getFolderTabURI : function(aTitle) + getGroupTabURI : function(aTitle) { - var html = ''+ - String(aTitle).replace(/&/g, '$amp;') - .replace(/</g, '$lt;') - .replace(/>/g, '$gt;')+ - ''; - return 'data:text/html;charset=UTF-8,'+encodeURIComponent(html); + return 'about:treestyletab-group?'+encodeURIComponent(aTitle); }, /* get tab(s) */ diff --git a/skin/classic/treestyletab/group-fx2.png b/skin/classic/treestyletab/group-fx2.png new file mode 100644 index 0000000000000000000000000000000000000000..cff39b6377d3a87abe30923634c42cea8d5182f7 GIT binary patch literal 629 zcmV-*0*d{KP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXP^ z2qz^IXS!(s00H$$L_t(I%cYaQYm-43$3K^xiKJ;$X|z=rQ4yqKAw&KG1;=!A5Je{^ zH#ax`06Rz#os>essp8_Ki=fuQiW&l9X>AmviFp(9=Er+K9+##~s)*7DzTES0_xaxO z+?^5;b`vpn8T$1dl{YSa#q^vw$GEi+8P=_(ID3-?5%GUBP%r0MoSuDrK0TEmns_pI zW~o_u=MXZ^A=ZL1d@_d8)w|pl5eJ|ZOvE$CA(|U9ICpKnKTjSVS1eMGaoN^*P(XTiEfoZ~m0oHcq1q@YC%IOmDOH2)T(}?Tl-4x(nsRS z1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svvE{4 zf7=kk@_cVYe}c)07owevB}sN{5nUhR3X~kIoED$Yd~<)TfB#||Czd%Z{B~^%Q}2bn zxH7Z$vjnHybQL+3wzZ}{cFX5%51nAR@9A;24~CwP49|W(^(XaLyj0r7(tk{U+Ky?p T=+(FZgP+0E)z4*}Q$iB}_5sBG literal 0 HcmV?d00001 diff --git a/skin/classic/treestyletab/group.css b/skin/classic/treestyletab/group.css new file mode 100644 index 00000000..8ddfee29 --- /dev/null +++ b/skin/classic/treestyletab/group.css @@ -0,0 +1,17 @@ +page { + background: -moz-dialog; + margin: 1em; + -moz-appearance: window; +} + +label { + color: -moz-dialogtext; + font-family: message-box; + font-size: large; + font-weight: normal; +} + +#icon { + list-style-image: url("chrome://global/skin/icons/folder-item.png"); + -moz-image-region: rect(0, 32px, 16px, 16px); +}