зеркало из https://github.com/mozilla/gecko-dev.git
bug 171330: dropping foldergroup concept.
opening bookmarks in folder via context menu, middle-click and ctrl-click. saving group of tabs in folder + speed optimizations
This commit is contained in:
Родитель
89dd3a05d2
Коммит
6ca7c9c655
|
@ -98,6 +98,7 @@ Contributor(s):
|
|||
<command id="cmd_bm_openinnewwindow" oncommand="goDoCommand('cmd_bm_openinnewwindow');"/>
|
||||
<command id="cmd_bm_openinnewtab" oncommand="goDoCommand('cmd_bm_openinnewtab');"/>
|
||||
<command id="cmd_bm_expandfolder" oncommand="goDoCommand('cmd_bm_expandfolder');"/>
|
||||
<command id="cmd_bm_openfolder" oncommand="goDoCommand('cmd_bm_openfolder');"/>
|
||||
<command id="cmd_bm_managefolder" oncommand="goDoCommand('cmd_bm_managefolder');"/>
|
||||
<command id="cmd_bm_newfolder" oncommand="goDoCommand('cmd_bm_newfolder');"/>
|
||||
<command id="cmd_bm_newbookmark" oncommand="goDoCommand('cmd_bm_newbookmark');"/>
|
||||
|
|
|
@ -242,7 +242,7 @@ function onOK()
|
|||
|
||||
var url, rSource;
|
||||
if (addingGroup()) {
|
||||
rSource = BMDS.createGroup(gFld_Name.value);
|
||||
rSource = BMDS.createFolder(gFld_Name.value);
|
||||
const groups = window.arguments[5];
|
||||
for (var i = 0; i < groups.length; ++i) {
|
||||
url = getNormalizedURL(groups[i].url);
|
||||
|
|
|
@ -205,8 +205,8 @@ var BookmarksCommand = {
|
|||
var commands = [];
|
||||
// menu order:
|
||||
//
|
||||
// bm_open
|
||||
// bm_openfolder
|
||||
// bm_expandfolder
|
||||
// bm_open, bm_openfolder
|
||||
// bm_openinnewwindow
|
||||
// bm_openinnewtab
|
||||
// ---------------------
|
||||
|
@ -233,14 +233,14 @@ var BookmarksCommand = {
|
|||
"bm_properties"];
|
||||
break;
|
||||
case "Folder":
|
||||
commands = ["bm_expandfolder", "bm_managefolder", "bm_separator",
|
||||
commands = ["bm_expandfolder", "bm_openfolder", "bm_managefolder", "bm_separator",
|
||||
"bm_newfolder", "bm_separator",
|
||||
"bm_cut", "bm_copy", "bm_paste", "bm_separator",
|
||||
"bm_delete", "bm_separator",
|
||||
"bm_properties"];
|
||||
break;
|
||||
case "FolderGroup":
|
||||
commands = ["bm_open", "bm_expandfolder", "bm_separator",
|
||||
commands = ["bm_openfolder", "bm_expandfolder", "bm_separator",
|
||||
"bm_newfolder", "bm_separator",
|
||||
"bm_cut", "bm_copy", "bm_paste", "bm_separator",
|
||||
"bm_delete", "bm_separator",
|
||||
|
@ -339,7 +339,6 @@ var BookmarksCommand = {
|
|||
|
||||
manageFolder: function (aSelection)
|
||||
{
|
||||
dump("ici:::::::::::::::::::::::::::")
|
||||
openDialog("chrome://browser/content/bookmarks/bookmarksManager.xul",
|
||||
"", "chrome,all,dialog=no", aSelection.item[0].Value);
|
||||
},
|
||||
|
@ -465,12 +464,13 @@ var BookmarksCommand = {
|
|||
if (!aTargetBrowser)
|
||||
return;
|
||||
for (var i=0; i<aSelection.length; ++i) {
|
||||
var type = aSelection.type[i];
|
||||
if (aTargetBrowser == "properties")
|
||||
openDialog("chrome://browser/content/bookmarks/bookmarksProperties.xul",
|
||||
"", "centerscreen,chrome,resizable=no", aSelection.item[i].Value);
|
||||
else if (aSelection.type[i] == "Bookmark")
|
||||
this.openOneBookmark(aSelection.item[i].Value, aTargetBrowser, aDS);
|
||||
else if (aSelection.type[i] == "FolderGroup" || aSelection.type[i] == "Folder")
|
||||
else if (type == "FolderGroup" || type == "Folder" || type == "PersonalToolbarFolder")
|
||||
this.openGroupBookmark(aSelection.item[i].Value, aTargetBrowser);
|
||||
}
|
||||
},
|
||||
|
@ -481,7 +481,7 @@ var BookmarksCommand = {
|
|||
var w, browser
|
||||
var url = BookmarksUtils.getProperty(aURI, NC_NS+"URL", aDS)
|
||||
// Ignore "NC:" and empty urls.
|
||||
if (url == "" || url.substring(0,3) == "NC:")
|
||||
if (url == "")
|
||||
return;
|
||||
switch (aTargetBrowser) {
|
||||
case "current":
|
||||
|
@ -506,7 +506,7 @@ var BookmarksCommand = {
|
|||
|
||||
openGroupBookmark: function (aURI, aTargetBrowser)
|
||||
{
|
||||
if (aTargetBrowser == "current") {
|
||||
if (aTargetBrowser == "current" || aTargetBrowser == "tab") {
|
||||
var w = getTopWin();
|
||||
var browser = w.document.getElementById("content");
|
||||
var resource = RDF.GetResource(aURI);
|
||||
|
@ -534,7 +534,7 @@ var BookmarksCommand = {
|
|||
// and focus the content
|
||||
browser.focus();
|
||||
} else {
|
||||
dump("Open Group in new window/tab: not implemented...\n");
|
||||
dump("Open Group in new window: not implemented...\n");
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -652,9 +652,10 @@ var BookmarksController = {
|
|||
case "cmd_bm_delete":
|
||||
case "cmd_bm_selectAll":
|
||||
case "cmd_bm_open":
|
||||
case "cmd_bm_expandfolder":
|
||||
case "cmd_bm_openinnewwindow":
|
||||
case "cmd_bm_openinnewtab":
|
||||
case "cmd_bm_expandfolder":
|
||||
case "cmd_bm_openfolder":
|
||||
case "cmd_bm_managefolder":
|
||||
case "cmd_bm_newbookmark":
|
||||
case "cmd_bm_newfolder":
|
||||
|
@ -726,7 +727,20 @@ var BookmarksController = {
|
|||
return isNotRef && length == 1;
|
||||
case "cmd_bm_openinnewwindow":
|
||||
case "cmd_bm_openinnewtab":
|
||||
return true;
|
||||
return true;
|
||||
case "cmd_bm_openfolder":
|
||||
for (var i=0; i<aSelection.length; ++i) {
|
||||
if (aSelection.type[i] == "Bookmark" ||
|
||||
aSelection.type[i] == "BookmarkSeparator")
|
||||
return false;
|
||||
RDFC.Init(BMDS, aSelection.item[i]);
|
||||
var children = RDFC.GetElements();
|
||||
while (children.hasMoreElements()) {
|
||||
if (BookmarksUtils.resolveType(children.getNext()) == "Bookmark")
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
case "cmd_bm_find":
|
||||
case "cmd_bm_import":
|
||||
case "cmd_bm_export":
|
||||
|
@ -761,7 +775,6 @@ var BookmarksController = {
|
|||
|
||||
doCommand: function (aCommand, aSelection, aTarget)
|
||||
{
|
||||
dump(aCommand);
|
||||
switch (aCommand) {
|
||||
case "cmd_undo":
|
||||
case "cmd_bm_undo":
|
||||
|
@ -780,6 +793,9 @@ var BookmarksController = {
|
|||
case "cmd_bm_openinnewtab":
|
||||
BookmarksCommand.openBookmark(aSelection, "tab");
|
||||
break;
|
||||
case "cmd_bm_openfolder":
|
||||
BookmarksCommand.openBookmark(aSelection, "current");
|
||||
break;
|
||||
case "cmd_bm_managefolder":
|
||||
BookmarksCommand.manageFolder(aSelection);
|
||||
break;
|
||||
|
@ -842,7 +858,7 @@ var BookmarksController = {
|
|||
"cmd_bm_setpersonaltoolbarfolder",
|
||||
"cmd_bm_setnewbookmarkfolder",
|
||||
"cmd_bm_setnewsearchfolder", "cmd_bm_movebookmark",
|
||||
"cmd_bm_managefolder"];
|
||||
"cmd_bm_openfolder", "cmd_bm_managefolder"];
|
||||
for (var i = 0; i < commands.length; ++i) {
|
||||
var enabled = this.isCommandEnabled(commands[i], aSelection, aTarget);
|
||||
var commandNode = document.getElementById(commands[i]);
|
||||
|
|
|
@ -70,12 +70,6 @@
|
|||
<script type="application/x-javascript" src="chrome://global/content/nsTransferable.js"/>
|
||||
|
||||
<commands id="commands">
|
||||
<commandset id="CommandUpdate_Bookmarks"
|
||||
commandupdater="true"
|
||||
events="focus,tree-select"
|
||||
oncommandupdate="document.getElementById('bookmarks-view').onCommandUpdate();">
|
||||
</commandset>
|
||||
|
||||
<commandset id="selectEditMenuItems"/>
|
||||
<commandset id="globalEditMenuItems"/>
|
||||
<commandset id="tasksCommands"/>
|
||||
|
@ -91,6 +85,7 @@
|
|||
<command id="cmd_bm_openinnewwindow" oncommand="goDoCommand('cmd_bm_openinnewwindow');"/>
|
||||
<command id="cmd_bm_openinnewtab" oncommand="goDoCommand('cmd_bm_openinnewtab');"/>
|
||||
<command id="cmd_bm_expandfolder" oncommand="goDoCommand('cmd_bm_expandfolder');"/>
|
||||
<command id="cmd_bm_openfolder" oncommand="goDoCommand('cmd_bm_openfolder');"/>
|
||||
<command id="cmd_bm_managefolder" oncommand="goDoCommand('cmd_bm_managefolder');"/>
|
||||
<command id="cmd_bm_newfolder" oncommand="goDoCommand('cmd_bm_newfolder');"/>
|
||||
<command id="cmd_bm_newbookmark" oncommand="goDoCommand('cmd_bm_newbookmark');"/>
|
||||
|
@ -206,6 +201,11 @@
|
|||
accesskey="&menuitem.view.command.toolbar.accesskey;"
|
||||
oncommand="goToggleToolbar('command-toolbar', 'viewCommandToolbar'); event.preventBubble();"
|
||||
persist="checked"/>
|
||||
<menu id="descending" label="&menuitem.view.show_columns.label;"
|
||||
accesskey="&menuitem.view.show_columns.accesskey;">
|
||||
<menupopup id="columnsPopup" onpopupshowing="fillColumnsMenu(event);"
|
||||
oncommand="onViewMenuColumnItemSelected(event);"/>
|
||||
</menu>
|
||||
<menuseparator id="fill-after-this-node"/>
|
||||
<menuitem id="natural" label="&menuitem.view.unsorted.label;"
|
||||
accesskey="&menuitem.view.unsorted.accesskey;"
|
||||
|
@ -221,12 +221,6 @@
|
|||
type="radio"
|
||||
resource="direction" name="sortDirectionSet"/>
|
||||
<menuseparator/>
|
||||
<menu id="descending" label="&menuitem.view.show_columns.label;"
|
||||
accesskey="&menuitem.view.show_columns.accesskey;">
|
||||
<menupopup id="columnsPopup" onpopupshowing="fillColumnsMenu(event);"
|
||||
oncommand="onViewMenuColumnItemSelected(event);"/>
|
||||
</menu>
|
||||
<menuseparator/>
|
||||
<menuitem label="&menuitem.personaltoolbarfolder.label;"
|
||||
command="cmd_bm_setpersonaltoolbarfolder"
|
||||
accesskey="&menuitem.personaltoolbarfolder.accesskey;"/>
|
||||
|
|
|
@ -50,16 +50,12 @@
|
|||
|
||||
<!-- bookmarks & edit commands -->
|
||||
<commands id="commands">
|
||||
<commandset id="CommandUpdate_Bookmarks"
|
||||
commandupdater="true"
|
||||
events="click,focus"
|
||||
oncommandupdate="document.getElementById('bookmarks-view').onCommandUpdate();">
|
||||
</commandset>
|
||||
<commandset id="bookmarksItems">
|
||||
<command id="cmd_bm_open" oncommand="goDoCommand('cmd_bm_open');"/>
|
||||
<command id="cmd_bm_openinnewwindow" oncommand="goDoCommand('cmd_bm_openinnewwindow');"/>
|
||||
<command id="cmd_bm_openinnewtab" oncommand="goDoCommand('cmd_bm_openinnewtab');"/>
|
||||
<command id="cmd_bm_expandfolder" oncommand="goDoCommand('cmd_bm_expandfolder');"/>
|
||||
<command id="cmd_bm_openfolder" oncommand="goDoCommand('cmd_bm_openfolder');"/>
|
||||
<command id="cmd_bm_managefolder" oncommand="goDoCommand('cmd_bm_managefolder');"/>
|
||||
<command id="cmd_bm_newfolder" oncommand="goDoCommand('cmd_bm_newfolder');"/>
|
||||
<command id="cmd_bm_newbookmark" oncommand="goDoCommand('cmd_bm_newbookmark');"/>
|
||||
|
|
|
@ -437,22 +437,22 @@ dump("error in refresh sort:"+e)
|
|||
return;
|
||||
var browserTarget = BookmarksUtils.getBrowserTargetFromEvent(aEvent);
|
||||
if (this.clickCount == 1 || browserTarget != "current" &&
|
||||
this.clickCount == aClickCount && !this.treeBoxObject.selection.isSelected(row))
|
||||
this.treeBoxObject.selection.select(row)
|
||||
|
||||
var selection = this.getTreeSelection();
|
||||
this._selection = selection;
|
||||
var isFolderGroup = selection.type[0] == "FolderGroup";
|
||||
|
||||
if (!isFolderGroup && selection.isContainer[0]) {
|
||||
if (this.clickCount == 1) {
|
||||
if (row >= 0) {
|
||||
this.treeBoxObject.view.toggleOpenState(row);
|
||||
}
|
||||
}
|
||||
if (selection.protocol[0] != "file")
|
||||
return;
|
||||
this.clickCount == aClickCount && !this.treeBoxObject.selection.isSelected(row)) {
|
||||
this.treeBoxObject.selection.select(row);
|
||||
this._selection = this.getTreeSelection();
|
||||
}
|
||||
var selection = this._selection;
|
||||
|
||||
if (selection.type[0] != "FolderGroup" && selection.isContainer[0]) {
|
||||
var modifKey = aEvent.shiftKey || aEvent.ctrlKey || aEvent.altKey ||
|
||||
aEvent.metaKey || aEvent.button == 1;
|
||||
if (this.clickCount == 1 && !modifKey) {
|
||||
this.treeBoxObject.view.toggleOpenState(row);
|
||||
if (selection.protocol[0] != "file")
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
BookmarksCommand.openBookmark(selection, browserTarget, this.db);
|
||||
]]></body>
|
||||
</method>
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
<!ENTITY button.defaultfolder.label "Use Default">
|
||||
<!ENTITY button.defaultfolder.accesskey "d">
|
||||
<!ENTITY selectFolder.label "Choose Folder">
|
||||
<!ENTITY addGroup.label "Bookmark this group of tabs">
|
||||
<!ENTITY addGroup.label "Bookmark all tabs in a folder">
|
||||
<!ENTITY addGroup.accesskey "B">
|
||||
|
||||
|
||||
|
|
|
@ -51,14 +51,14 @@
|
|||
|
||||
<!ENTITY menuitem.view.command.toolbar.label "Toolbar">
|
||||
<!ENTITY menuitem.view.command.toolbar.accesskey "t">
|
||||
<!ENTITY menuitem.view.show_columns.label "Show columns">
|
||||
<!ENTITY menuitem.view.show_columns.accesskey "S">
|
||||
<!ENTITY menuitem.view.unsorted.label "Unsorted">
|
||||
<!ENTITY menuitem.view.unsorted.accesskey "u">
|
||||
<!ENTITY menuitem.view.ascending.label "A > Z Sort Order">
|
||||
<!ENTITY menuitem.view.ascending.accesskey "a">
|
||||
<!ENTITY menuitem.view.descending.label "Z > A Sort Order">
|
||||
<!ENTITY menuitem.view.descending.accesskey "z">
|
||||
<!ENTITY menuitem.view.show_columns.label "Show columns">
|
||||
<!ENTITY menuitem.view.show_columns.accesskey "S">
|
||||
<!ENTITY menuitem.newbookmarkfolder.label "Set as New Bookmark Folder">
|
||||
<!ENTITY menuitem.newbookmarkfolder.accesskey "b">
|
||||
<!ENTITY menuitem.newinternetsearchfolder.label "Set as New Internet Search Folder">
|
||||
|
|
|
@ -29,6 +29,7 @@ description_NewBookmarkAndSearchFolder = Newly created bookmarks and search resu
|
|||
cmd_bm_open = Open
|
||||
cmd_bm_expandfolder = Expand
|
||||
cmd_bm_collapsefolder = Collapse
|
||||
cmd_bm_openfolder = Open in tabs
|
||||
cmd_bm_managefolder = Manage Folder
|
||||
cmd_bm_find = Find a Bookmark...
|
||||
cmd_bm_cut = Cut
|
||||
|
|
Загрузка…
Ссылка в новой задаче