Bug 1607023 - Remove dead GroupBookmark code. r=frg
This commit is contained in:
Родитель
b0893b2da6
Коммит
e9dffd201e
|
@ -238,8 +238,6 @@ pref("browser.tabs.warnOnOpen", true);
|
|||
pref("browser.tabs.maxOpenBeforeWarn", 15);
|
||||
pref("browser.tabs.insertRelatedAfterCurrent", true);
|
||||
pref("browser.tabs.insertAllTabsAfterCurrent", false);
|
||||
// 0 = append, 1 = replace
|
||||
pref("browser.tabs.loadGroup", 1);
|
||||
|
||||
// For future use
|
||||
pref("browser.tabs.loadBookmarksInBackground", false);
|
||||
|
|
|
@ -1406,35 +1406,13 @@ function BrowserHandleShiftBackspace()
|
|||
}
|
||||
}
|
||||
|
||||
function SetGroupHistory(popupMenu, direction)
|
||||
{
|
||||
while (popupMenu.hasChildNodes())
|
||||
popupMenu.lastChild.remove();
|
||||
|
||||
var menuItem = document.createElementNS(XUL_NS, "menuitem");
|
||||
var label = gNavigatorBundle.getString("tabs.historyItem");
|
||||
menuItem.setAttribute("label", label);
|
||||
menuItem.setAttribute("index", direction);
|
||||
popupMenu.appendChild(menuItem);
|
||||
}
|
||||
|
||||
function BrowserBackMenu(event)
|
||||
{
|
||||
if (gBrowser.backBrowserGroup.length != 0) {
|
||||
SetGroupHistory(event.target, "back");
|
||||
return true;
|
||||
}
|
||||
|
||||
return FillHistoryMenu(event.target, "back");
|
||||
}
|
||||
|
||||
function BrowserForwardMenu(event)
|
||||
{
|
||||
if (gBrowser.forwardBrowserGroup.length != 0) {
|
||||
SetGroupHistory(event.target, "forward");
|
||||
return true;
|
||||
}
|
||||
|
||||
return FillHistoryMenu(event.target, "forward");
|
||||
}
|
||||
|
||||
|
|
|
@ -2610,121 +2610,19 @@
|
|||
</body>
|
||||
</method>
|
||||
|
||||
<field name="backBrowserGroup">
|
||||
[]
|
||||
</field>
|
||||
|
||||
<field name="forwardBrowserGroup">
|
||||
[]
|
||||
</field>
|
||||
|
||||
<method name="replaceGroup">
|
||||
<parameter name="aGroup"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
var oldBrowserGroup = [];
|
||||
var oldCount = this.tabs.length;
|
||||
var newCount = aGroup.length;
|
||||
var n = Math.max(oldCount, newCount);
|
||||
for (var i = 0; i < n; ++i) {
|
||||
if (i < newCount) {
|
||||
var data = aGroup[i];
|
||||
if ("sessionHistory" in data) {
|
||||
this.addTab("about:blank", null);
|
||||
var browser = this.tabContainer.lastChild.linkedBrowser;
|
||||
// need to hold on to the listener so it won't go away
|
||||
// addProgressListener only has a weak pointer to it
|
||||
browser._SHListener =
|
||||
this.mInstallSH(browser, aGroup[i].sessionHistory);
|
||||
browser.webProgress.addProgressListener(browser._SHListener, Ci.nsIWebProgress.NOTIFY_ALL);
|
||||
} else {
|
||||
var referrerURI = "referrerURI" in data ? data.referrerURI : null;
|
||||
this.addTab(data.URI, referrerURI);
|
||||
}
|
||||
}
|
||||
if (i < oldCount) {
|
||||
var firstTab = this.tabContainer.firstChild;
|
||||
var browserData = {
|
||||
sessionHistory : firstTab.linkedBrowser.sessionHistory
|
||||
}
|
||||
oldBrowserGroup.push(browserData);
|
||||
this.removeTab(firstTab, { disableUndo: true });
|
||||
}
|
||||
}
|
||||
return oldBrowserGroup;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="appendGroup">
|
||||
<parameter name="aGroup"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
for (var i in aGroup) {
|
||||
var page = aGroup[i];
|
||||
var referrerURI = "referrerURI" in page ? page.referrerURI : null;
|
||||
this.addTab(page.URI, referrerURI);
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="loadGroup">
|
||||
<parameter name="aGroup"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (aGroup.length == 0)
|
||||
return null;
|
||||
|
||||
var tab;
|
||||
if (Services.prefs.getIntPref("browser.tabs.loadGroup") == 0) {
|
||||
var oldCount = this.tabs.length;
|
||||
this.appendGroup(aGroup);
|
||||
tab = this.tabs[oldCount];
|
||||
} else {
|
||||
this.backBrowserGroup = this.replaceGroup(aGroup);
|
||||
this.forwardBrowserGroup = [];
|
||||
tab = this.tabContainer.firstChild;
|
||||
}
|
||||
return tab;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="goBackGroup">
|
||||
<body>
|
||||
<![CDATA[
|
||||
this.forwardBrowserGroup = this.replaceGroup(this.backBrowserGroup);
|
||||
this.backBrowserGroup = [];
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<method name="goForwardGroup">
|
||||
<body>
|
||||
<![CDATA[
|
||||
this.backBrowserGroup = this.replaceGroup(this.forwardBrowserGroup);
|
||||
this.forwardBrowserGroup = [];
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
<!-- BEGIN FORWARDED BROWSER PROPERTIES. IF YOU ADD A PROPERTY TO THE BROWSER ELEMENT
|
||||
MAKE SURE TO ADD IT HERE AS WELL. -->
|
||||
<property name="canGoBack"
|
||||
onget="return this.backBrowserGroup.length != 0 || this.mCurrentBrowser.canGoBack;"
|
||||
onget="return this.mCurrentBrowser.canGoBack;"
|
||||
readonly="true"/>
|
||||
|
||||
<property name="canGoForward"
|
||||
onget="return this.forwardBrowserGroup.length != 0 || this.mCurrentBrowser.canGoForward;"
|
||||
onget="return this.mCurrentBrowser.canGoForward;"
|
||||
readonly="true"/>
|
||||
|
||||
<method name="goBack">
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (this.backBrowserGroup.length != 0)
|
||||
return this.goBackGroup();
|
||||
|
||||
return this.mCurrentBrowser.goBack();
|
||||
]]>
|
||||
</body>
|
||||
|
@ -2733,9 +2631,6 @@
|
|||
<method name="goForward">
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (this.forwardBrowserGroup.length != 0)
|
||||
return this.goForwardGroup();
|
||||
|
||||
return this.mCurrentBrowser.goForward();
|
||||
]]>
|
||||
</body>
|
||||
|
|
|
@ -29,9 +29,6 @@
|
|||
<preference id="browser.tabs.insertRelatedAfterCurrent"
|
||||
name="browser.tabs.insertRelatedAfterCurrent"
|
||||
type="bool"/>
|
||||
<preference id="browser.tabs.loadGroup"
|
||||
name="browser.tabs.loadGroup"
|
||||
type="int"/>
|
||||
<preference id="browser.tabs.opentabfor.middleclick"
|
||||
name="browser.tabs.opentabfor.middleclick"
|
||||
type="bool"/>
|
||||
|
@ -68,20 +65,6 @@
|
|||
preference="browser.tabs.insertRelatedAfterCurrent"/>
|
||||
</groupbox>
|
||||
|
||||
<groupbox id="loadGroupPreferences" align="start">
|
||||
<caption label="&loadGroup.label;"/>
|
||||
<radiogroup id="loadGroup"
|
||||
orient="horizontal"
|
||||
preference="browser.tabs.loadGroup">
|
||||
<radio value="0"
|
||||
label="&loadGroupAppend.label;"
|
||||
accesskey="&loadGroupAppend.accesskey;"/>
|
||||
<radio value="1"
|
||||
label="&loadGroupReplace.label;"
|
||||
accesskey="&loadGroupReplace.accesskey;"/>
|
||||
</radiogroup>
|
||||
</groupbox>
|
||||
|
||||
<groupbox id="useTabPreferences" align="start">
|
||||
<caption label="&openTabs.label;"/>
|
||||
<checkbox id="middleClick"
|
||||
|
|
|
@ -476,14 +476,6 @@
|
|||
tab bar.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>When opening a bookmark group</strong>:
|
||||
<ul>
|
||||
<li><strong>Add tabs</strong>: Select this if you want a bookmark group
|
||||
to be opened in new tabs.</li>
|
||||
<li><strong>Replace existing tabs</strong>: Select this if you want a
|
||||
bookmark group to replace your existing tabs.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><strong>Open tabs instead of windows for</strong>:
|
||||
<ul>
|
||||
<li><strong><span class="mac"><kbd>Cmd</kbd>+click or
|
||||
|
|
|
@ -14,12 +14,6 @@
|
|||
<!ENTITY relatedAfterCurrent.label "Open related tabs after current tab">
|
||||
<!ENTITY relatedAfterCurrent.accesskey "O">
|
||||
|
||||
<!ENTITY loadGroup.label "When opening a bookmark group">
|
||||
<!ENTITY loadGroupAppend.label "Add tabs">
|
||||
<!ENTITY loadGroupAppend.accesskey "A">
|
||||
<!ENTITY loadGroupReplace.label "Replace existing tabs">
|
||||
<!ENTITY loadGroupReplace.accesskey "R">
|
||||
|
||||
<!ENTITY openTabs.label "Open tabs instead of windows for">
|
||||
|
||||
<!ENTITY openManagers.label "Open in a new tab instead of a stand-alone window">
|
||||
|
|
Загрузка…
Ссылка в новой задаче