Bug 841058 - Remove unused PageActions code and strings from /browser/metro [r=jimm]

This commit is contained in:
Matt Brubeck 2013-02-13 10:47:05 -08:00
Родитель 8f0f5d7559
Коммит 7a517d7a63
8 изменённых файлов: 1 добавлений и 155 удалений

Просмотреть файл

@ -14,10 +14,6 @@ var PageActions = {
this.register("pageaction-reset", this.updatePagePermissions, this); this.register("pageaction-reset", this.updatePagePermissions, this);
this.register("pageaction-password", this.updateForgetPassword, this); this.register("pageaction-password", this.updateForgetPassword, this);
#ifdef NS_PRINTING
this.register("pageaction-saveas", this.updatePageSaveAs, this);
#endif
this.register("pageaction-share", this.updateShare, this);
CharsetMenu.init(); CharsetMenu.init();
}, },
@ -134,30 +130,6 @@ var PageActions = {
aEvent.stopPropagation(); // Don't hide the site menu. aEvent.stopPropagation(); // Don't hide the site menu.
}, },
pinSite : function pinCurrentSite() {
if (Browser.selectedBrowser.currentURI.spec.length == 0) {
return;
}
Browser.pinSite();
},
unpinSite : function unpinCurrentSite() {
if (Browser.selectedBrowser.currentURI.spec.length == 0) {
return;
}
Browser.unpinSite();
},
updatePageSaveAs: function updatePageSaveAs(aNode) {
// Check for local XUL content
let contentWindow = Browser.selectedBrowser.contentWindow;
return !(contentWindow && contentWindow.document instanceof XULDocument);
},
updateShare: function updateShare(aNode) {
return Util.isShareableScheme(Browser.selectedBrowser.currentURI.scheme);
},
hideItem: function hideItem(aNode) { hideItem: function hideItem(aNode) {
aNode.hidden = true; aNode.hidden = true;
this._updateAttributes(); this._updateAttributes();

Просмотреть файл

@ -101,7 +101,6 @@ Cu.import("resource://gre/modules/Geometry.jsm");
["OfflineApps", "chrome://browser/content/helperui/OfflineApps.js"], ["OfflineApps", "chrome://browser/content/helperui/OfflineApps.js"],
["SelectHelperUI", "chrome://browser/content/helperui/SelectHelperUI.js"], ["SelectHelperUI", "chrome://browser/content/helperui/SelectHelperUI.js"],
["SelectionHelperUI", "chrome://browser/content/helperui/SelectionHelperUI.js"], ["SelectionHelperUI", "chrome://browser/content/helperui/SelectionHelperUI.js"],
["SharingUI", "chrome://browser/content/helperui/SharingUI.js"],
["FullScreenVideo", "chrome://browser/content/video.js"], ["FullScreenVideo", "chrome://browser/content/video.js"],
["AnimatedZoom", "chrome://browser/content/AnimatedZoom.js"], ["AnimatedZoom", "chrome://browser/content/AnimatedZoom.js"],
["CommandUpdater", "chrome://browser/content/commandUtil.js"], ["CommandUpdater", "chrome://browser/content/commandUtil.js"],

Просмотреть файл

@ -358,17 +358,10 @@
</box> </box>
<hbox id="pageactions-container" hidden="true"> <hbox id="pageactions-container" hidden="true">
<pageaction id="pageaction-findinpage" title="&pageactions.findInPage;"
onclick="FindHelperUI.show();"/>
<pageaction id="pageaction-share" title="&pageactions.share.page;"
onclick="SharingUI.show(getBrowser().currentURI.spec, getBrowser().contentTitle);"/>
<pageaction id="pageaction-pinsite" title="&pageactions.pin.site;"
onclick="PageActions.pinSite();"/>
<pageaction id="pageaction-password" title="&pageactions.password.forget;" <pageaction id="pageaction-password" title="&pageactions.password.forget;"
onclick="PageActions.forgetPassword(event);"/> onclick="PageActions.forgetPassword(event);"/>
<pageaction id="pageaction-reset" title="&pageactions.reset;" <pageaction id="pageaction-reset" title="&pageactions.reset;"
onclick="PageActions.clearPagePermissions(event);"/> onclick="PageActions.clearPagePermissions(event);"/>
<pageaction id="pageaction-search" title="&pageactions.search.addNew;"/>
<pageaction id="pageaction-charset" title="&pageactions.charEncoding;" onclick="CharsetMenu.show();"/> <pageaction id="pageaction-charset" title="&pageactions.charEncoding;" onclick="CharsetMenu.show();"/>
</hbox> </hbox>
</arrowbox> </arrowbox>

Просмотреть файл

@ -1,83 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var SharingUI = {
_dialog: null,
show: function show(aURL, aTitle) {
try {
this.showSharingUI(aURL, aTitle);
} catch (ex) {
this.showFallback(aURL, aTitle);
}
},
showSharingUI: function showSharingUI(aURL, aTitle) {
let sharingSvc = Cc["@mozilla.org/uriloader/external-sharing-app-service;1"].getService(Ci.nsIExternalSharingAppService);
sharingSvc.shareWithDefault(aURL, "text/plain", aTitle);
},
showFallback: function showFallback(aURL, aTitle) {
this._dialog = DialogUI.importModal(window, "chrome://browser/content/prompt/share.xul", null);
document.getElementById("share-title").value = aTitle || aURL;
DialogUI.pushPopup(this, this._dialog);
let bbox = document.getElementById("share-buttons-box");
this._handlers.forEach(function(handler) {
let button = document.createElement("button");
button.className = "action-button";
button.setAttribute("label", handler.name);
button.addEventListener("command", function() {
SharingUI.hide();
handler.callback(aURL || "", aTitle || "");
}, false);
bbox.appendChild(button);
});
this._dialog.waitForClose();
DialogUI.popPopup(this);
},
hide: function hide() {
this._dialog.close();
this._dialog = null;
},
_handlers: [
{
name: "Email",
callback: function callback(aURL, aTitle) {
let url = "mailto:?subject=" + encodeURIComponent(aTitle) +
"&body=" + encodeURIComponent(aURL);
let uri = Services.io.newURI(url, null, null);
let extProtocolSvc = Cc["@mozilla.org/uriloader/external-protocol-service;1"]
.getService(Ci.nsIExternalProtocolService);
extProtocolSvc.loadUrl(uri);
}
},
{
name: "Twitter",
callback: function callback(aURL, aTitle) {
let url = "http://twitter.com/home?status=" + encodeURIComponent((aTitle ? aTitle+": " : "")+aURL);
BrowserUI.newTab(url, Browser.selectedTab);
}
},
{
name: "Google Reader",
callback: function callback(aURL, aTitle) {
let url = "http://www.google.com/reader/link?url=" + encodeURIComponent(aURL) +
"&title=" + encodeURIComponent(aTitle);
BrowserUI.newTab(url, Browser.selectedTab);
}
},
{
name: "Facebook",
callback: function callback(aURL, aTitle) {
let url = "http://www.facebook.com/share.php?u=" + encodeURIComponent(aURL);
BrowserUI.newTab(url, Browser.selectedTab);
}
}
]
};

Просмотреть файл

@ -1,27 +0,0 @@
<?xml version="1.0"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE prompt SYSTEM "chrome://browser/locale/prompt.dtd">
<dialog id="share-dialog"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<keyset>
<key keycode="VK_ESCAPE" command="cmd_cancel"/>
</keyset>
<commandset>
<command id="cmd_cancel" oncommand="SharingUI.hide();"/>
</commandset>
<vbox class="prompt-inner">
<hbox class="prompt-header">
<label id="share-title" crop="center" flex="1"/>
</hbox>
<hbox id="share-buttons-box" class="prompt-buttons"/>
</vbox>
</dialog>

Просмотреть файл

@ -37,7 +37,6 @@ chrome.jar:
content/prompt/promptPassword.xul (content/prompt/promptPassword.xul) content/prompt/promptPassword.xul (content/prompt/promptPassword.xul)
content/prompt/select.xul (content/prompt/select.xul) content/prompt/select.xul (content/prompt/select.xul)
content/prompt/prompt.js (content/prompt/prompt.js) content/prompt/prompt.js (content/prompt/prompt.js)
content/prompt/share.xul (content/prompt/share.xul)
content/prompt/masterPassword.xul (content/prompt/masterPassword.xul) content/prompt/masterPassword.xul (content/prompt/masterPassword.xul)
content/prompt/removeMasterPassword.xul (content/prompt/removeMasterPassword.xul) content/prompt/removeMasterPassword.xul (content/prompt/removeMasterPassword.xul)
@ -52,7 +51,6 @@ chrome.jar:
content/helperui/OfflineApps.js (content/helperui/OfflineApps.js) content/helperui/OfflineApps.js (content/helperui/OfflineApps.js)
content/helperui/SelectHelperUI.js (content/helperui/SelectHelperUI.js) content/helperui/SelectHelperUI.js (content/helperui/SelectHelperUI.js)
content/helperui/SelectionHelperUI.js (content/helperui/SelectionHelperUI.js) content/helperui/SelectionHelperUI.js (content/helperui/SelectionHelperUI.js)
content/helperui/SharingUI.js (content/helperui/SharingUI.js)
content/helperui/FormHelperUI.js (content/helperui/FormHelperUI.js) content/helperui/FormHelperUI.js (content/helperui/FormHelperUI.js)
content/helperui/FindHelperUI.js (content/helperui/FindHelperUI.js) content/helperui/FindHelperUI.js (content/helperui/FindHelperUI.js)

Просмотреть файл

@ -97,11 +97,6 @@
<!ENTITY contextRemoveBookmark.label "Remove"> <!ENTITY contextRemoveBookmark.label "Remove">
<!ENTITY contextShortcutBookmark.label "Add to Home Screen"> <!ENTITY contextShortcutBookmark.label "Add to Home Screen">
<!ENTITY pageactions.pin.site "Pin Site">
<!ENTITY pageactions.share.page "Share Page">
<!ENTITY pageactions.password.forget "Forget Password"> <!ENTITY pageactions.password.forget "Forget Password">
<!ENTITY pageactions.quit "Quit">
<!ENTITY pageactions.reset "Clear Site Preferences"> <!ENTITY pageactions.reset "Clear Site Preferences">
<!ENTITY pageactions.findInPage "Find In Page">
<!ENTITY pageactions.search.addNew "Add Search Engine">
<!ENTITY pageactions.charEncoding "Character Encoding"> <!ENTITY pageactions.charEncoding "Character Encoding">

Просмотреть файл

@ -102,8 +102,7 @@ tabs.emptyTabTitle=New Tab
# or webpage title on the menulist # or webpage title on the menulist
homepage.custom2=Custom Page homepage.custom2=Custom Page
# Page Actions # "Clear Permissions" items
pageactions.pin.site=Pin Site
pageactions.geolocation=Location pageactions.geolocation=Location
pageactions.popup=Popups pageactions.popup=Popups
pageactions.offline-app=Offline Storage pageactions.offline-app=Offline Storage