diff --git a/content/treestyletab/bookmarksOverlay.js b/content/treestyletab/bookmarksOverlay.js
index 69b5b2ca..4178687a 100644
--- a/content/treestyletab/bookmarksOverlay.js
+++ b/content/treestyletab/bookmarksOverlay.js
@@ -222,7 +222,7 @@ var TreeStyleTabBookmarksService = {
).replace(
/(this\._openTabset\([^\)]+)(\))/,
+
-
-
-
-
-
-
-
-
-
diff --git a/content/treestyletab/editBookmarkOverlay.js b/content/treestyletab/editBookmarkOverlay.js
index 3a855753..f04e9bb9 100644
--- a/content/treestyletab/editBookmarkOverlay.js
+++ b/content/treestyletab/editBookmarkOverlay.js
@@ -33,23 +33,28 @@ var TreeStyleEditableBookmarkService = {
if (!container) return;
container = container.getElementsByTagName('rows')[0];
+ var range = document.createRange();
+ range.selectNodeContents(container);
+ range.collapse(false);
+ range.insertNode(range.createContextualFragment(
+
+
+
+ ]]>.toString().replace(/^\s*|\s*$/g, '').replace(/>\s+<')));
+ range.detach();
+ document.getElementById('treestyletab-parent-label').setAttribute('value', TreeStyleTabService.treeBundle.getString('bookmarkProperty.parent.label'));
+ this.blankItem.setAttribute('label', TreeStyleTabService.treeBundle.getString('bookmarkProperty.parent.blank.label'));
-/* to be inserted to the container...
-
-
-
-
-*/
eval('gEditItemOverlay._showHideRows = '+gEditItemOverlay._showHideRows.toSource().replace(
'this._element("keywordRow").collapsed',
diff --git a/content/treestyletab/editBookmarkOverlay.xul b/content/treestyletab/editBookmarkOverlay.xul
index 0122c4df..e6659c74 100644
--- a/content/treestyletab/editBookmarkOverlay.xul
+++ b/content/treestyletab/editBookmarkOverlay.xul
@@ -3,12 +3,9 @@
+
-
-
-
diff --git a/content/treestyletab/res/stringBundle.js b/content/treestyletab/res/stringBundle.js
new file mode 100644
index 00000000..5c71166d
--- /dev/null
+++ b/content/treestyletab/res/stringBundle.js
@@ -0,0 +1,73 @@
+/*
+ string bundle utility
+
+ Usage:
+ // use instead of HTMLDocument.getBoxObjectFor(HTMLElement)
+ var bundle = window['piro.sakura.ne.jp']
+ .stringBundle
+ .get('chrome://example/locale/example.properties');
+ bundle.getString('key1');
+ bundle.getFormattedString('key2', [val1, val2]);
+
+ lisence: The MIT License, Copyright (c) 2009 SHIMODA "Piro" Hiroshi
+ http://www.cozmixng.org/repos/piro/fx3-compatibility-lib/trunk/license.txt
+ original:
+ http://www.cozmixng.org/repos/piro/fx3-compatibility-lib/trunk/stringBundle.js
+*/
+(function() {
+ const currentRevision = 1;
+
+ if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {};
+
+ var loadedRevision = 'stringBundle' in window['piro.sakura.ne.jp'] ?
+ window['piro.sakura.ne.jp'].stringBundle.revision :
+ 0 ;
+ if (loadedRevision && loadedRevision > currentRevision) {
+ return;
+ }
+
+ var Cc = Components.classes;
+ var Ci = Components.interfaces;
+
+ window['piro.sakura.ne.jp'].stringBundle = {
+ revision : currentRevision,
+
+ get : function(aURI)
+ {
+ if (!(aURI in this._cache)) {
+ this._cache[aURI] = new StringBundle(aURI);
+ }
+ return this._cache[aURI];
+ },
+ _cache : {}
+ };
+
+ const Service = Cc['@mozilla.org/intl/stringbundle;1']
+ .getService(Ci.nsIStringBundleService);
+
+ function StringBundle(aURI)
+ {
+ this._bundle = Service.createBundle(aURI);
+ }
+ StringBundle.prototype = {
+ getString : function(aKey) {
+ try {
+ return this._bundle.GetStringFromName(aKey);
+ }
+ catch(e) {
+ }
+ return '';
+ },
+ getFormattedString : function(aKey, aArray) {
+ try {
+ return this._bundle.formatStringFromName(aKey, aArray, aArray.length);
+ }
+ catch(e) {
+ }
+ return '';
+ },
+ get strings() {
+ return this._bundle.getSimpleEnumeration();
+ }
+ };
+})();
diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js
index 0a7f9d5a..b41829dd 100644
--- a/content/treestyletab/treestyletab.js
+++ b/content/treestyletab/treestyletab.js
@@ -48,7 +48,6 @@ var TreeStyleTabService = {
kCOUNTER_CONTAINER : 'treestyletab-counter-container',
kSPLITTER : 'treestyletab-splitter',
kTABBAR_TOGGLER : 'treestyletab-tabbar-toggler',
- kSTRINGBUNDLE : 'treestyletab-stringbundle',
kMENUITEM_REMOVESUBTREE_SELECTION : 'multipletab-selection-item-removeTabSubTree',
@@ -220,21 +219,16 @@ var TreeStyleTabService = {
},
_Comparator : null,
- get stringbundle() {
- if (!this._stringbundle) {
- this._stringbundle = document.getElementById(this.kSTRINGBUNDLE);
- }
- return this._stringbundle;
+ get treeBundle() {
+ return window['piro.sakura.ne.jp']
+ .stringBundle
+ .get('chrome://treestyletab/locale/treestyletab.properties');
},
- _stringbundle : null,
-
get tabbrowserBundle() {
- if (!this._tabbrowserBundle) {
- this._tabbrowserBundle = document.getElementById('treestyletab-tabbrowserBundle');
- }
- return this._tabbrowserBundle;
+ return window['piro.sakura.ne.jp']
+ .stringBundle
+ .get('chrome://browser/locale/tabbrowser.properties');
},
- _tabbrowserBundle : null,
/* API */
@@ -1151,14 +1145,14 @@ var TreeStyleTabService = {
var checked = { value : false };
var newChildTab = this.PromptService.confirmEx(window,
- this.stringbundle.getString('dropLinkOnTab.title'),
- this.stringbundle.getString('dropLinkOnTab.text'),
+ this.treeBundle.getString('dropLinkOnTab.title'),
+ this.treeBundle.getString('dropLinkOnTab.text'),
(this.PromptService.BUTTON_TITLE_IS_STRING * this.PromptService.BUTTON_POS_0) +
(this.PromptService.BUTTON_TITLE_IS_STRING * this.PromptService.BUTTON_POS_1),
- this.stringbundle.getString('dropLinkOnTab.openNewChildTab'),
- this.stringbundle.getString('dropLinkOnTab.loadInTheTab'),
+ this.treeBundle.getString('dropLinkOnTab.openNewChildTab'),
+ this.treeBundle.getString('dropLinkOnTab.loadInTheTab'),
null,
- this.stringbundle.getString('dropLinkOnTab.never'),
+ this.treeBundle.getString('dropLinkOnTab.never'),
checked
) == 0;
@@ -1182,15 +1176,15 @@ var TreeStyleTabService = {
var checked = { value : false };
var button = this.PromptService.confirmEx(window,
- this.stringbundle.getString('openGroupBookmarkBehavior.title'),
- this.stringbundle.getString('openGroupBookmarkBehavior.text'),
+ this.treeBundle.getString('openGroupBookmarkBehavior.title'),
+ this.treeBundle.getString('openGroupBookmarkBehavior.text'),
(this.PromptService.BUTTON_TITLE_IS_STRING * this.PromptService.BUTTON_POS_0) +
(this.PromptService.BUTTON_TITLE_IS_STRING * this.PromptService.BUTTON_POS_1) +
(this.PromptService.BUTTON_TITLE_IS_STRING * this.PromptService.BUTTON_POS_2),
- this.stringbundle.getString('openGroupBookmarkBehavior.subTree'),
- this.stringbundle.getString('openGroupBookmarkBehavior.separate'),
- this.stringbundle.getString('openGroupBookmarkBehavior.replace'),
- this.stringbundle.getString('openGroupBookmarkBehavior.never'),
+ this.treeBundle.getString('openGroupBookmarkBehavior.subTree'),
+ this.treeBundle.getString('openGroupBookmarkBehavior.separate'),
+ this.treeBundle.getString('openGroupBookmarkBehavior.replace'),
+ this.treeBundle.getString('openGroupBookmarkBehavior.never'),
checked
);
@@ -2220,7 +2214,7 @@ catch(e) {
if ('mOverCloseButton' in aTab && aTab.mOverCloseButton) {
if (descendant.length &&
(collapsed || this.getTreePref('closeParentBehavior') == this.CLOSE_PARENT_BEHAVIOR_CLOSE)) {
- label = this.stringbundle.getString('tooltip.closeTree');
+ label = this.treeBundle.getString('tooltip.closeTree');
}
}
else if (aTab.getAttribute(this.kTWISTY_HOVER) == 'true') {
@@ -2229,8 +2223,8 @@ catch(e) {
'tooltip.collapseSubtree' ;
label = tree || aTab.getAttribute('label');
label = label ?
- this.stringbundle.getFormattedString(key+'.labeled', [label]) :
- this.stringbundle.getString(key) ;
+ this.treeBundle.getFormattedString(key+'.labeled', [label]) :
+ this.treeBundle.getString(key) ;
}
else if (collapsed) {
label = tree;
diff --git a/content/treestyletab/treestyletab.xul b/content/treestyletab/treestyletab.xul
index d6dfd7e2..d79f81d3 100644
--- a/content/treestyletab/treestyletab.xul
+++ b/content/treestyletab/treestyletab.xul
@@ -10,6 +10,7 @@
+
@@ -53,13 +54,6 @@
multipletab-enabled="TreeStyleTabService.canCreateSubTree(MultipleTabService.getSelectedTabs())"/>
-
-
-
-
-