ブックマークのツリー構造を復元しないオプションを追加

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@4884 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2009-08-10 00:10:40 +00:00
parent 4e5870b43b
commit a786cade9a
4 changed files with 17 additions and 4 deletions

View File

@ -174,8 +174,11 @@ var TreeStyleTabBookmarksService = {
) {
let openGroupBookmarkBehavior = TreeStyleTabBookmarksService.openGroupBookmarkBehavior();
if (openGroupBookmarkBehavior & TreeStyleTabBookmarksService.kGROUP_BOOKMARK_SUBTREE) {
let treeStructure = TreeStyleTabBookmarksService.getTreeStructureFromItems(ids);
let treeStructure = openGroupBookmarkBehavior & TreeStyleTabBookmarksService.kGROUP_BOOKMARK_DONT_RESTORE_TREE_STRUCTURE ?
null :
TreeStyleTabBookmarksService.getTreeStructureFromItems(ids) ;
if (
treeStructure &&
openGroupBookmarkBehavior & TreeStyleTabBookmarksService.kGROUP_BOOKMARK_USE_DUMMY &&
treeStructure.filter(function(aParent, aIndex) { return aParent == -1; }).length > 1
) {

View File

@ -94,8 +94,15 @@ function initTabPane()
function onSyncGroupBookmarkUIToPref()
{
ensureGroupBookmarkItems();
var behavior = parseInt(gGroupBookmarkRadio.value);
if (gGroupBookmarkUnderParent.checked) behavior += 256;
var behavior = gGroupBookmarkBehaviorPref.value;
if (behavior & 1) behavior ^= 1;
if (behavior & 2) behavior ^= 2;
if (behavior & 4) behavior ^= 4;
if (behavior & 256) behavior ^= 256;
behavior |= parseInt(gGroupBookmarkRadio.value);
if (gGroupBookmarkUnderParent.checked) behavior |= 256;
if (behavior & 1)
gGroupBookmarkUnderParent.removeAttribute('disabled');

View File

@ -1214,6 +1214,7 @@ var TreeStyleTabService = {
kGROUP_BOOKMARK_SEPARATE : 2,
kGROUP_BOOKMARK_REPLACE : 4,
kGROUP_BOOKMARK_USE_DUMMY : 256,
kGROUP_BOOKMARK_DONT_RESTORE_TREE_STRUCTURE : 512,
/* Initializing */

View File

@ -83,7 +83,9 @@ pref("extensions.treestyletab.urlbar.loadSameDomainToNewTab.asChild", true);
pref("extensions.treestyletab.urlbar.invertDefaultBehavior", true);
// 0 = always ask, 1 = load into the tab, 2 = open new child tab
pref("extensions.treestyletab.dropLinksOnTab.behavior", 0);
// 0 = always ask, 1 = tree, 2 = separate, 4 = replace, 256 = use dummy tab (for subtree)
// 0 = always ask, 1 = tree, 2 = separate, 4 = replace
// 256 = use dummy tab (for subtree)
// 512 = do not restore tree structure
pref("extensions.treestyletab.openGroupBookmark.behavior", 256);
pref("extensions.treestyletab.useEffectiveTLD", true);