Bug 345349 Add notification bar when blocking images for a site to help notice accidental blocking. r=mconnor, ui-r=beltzner

This commit is contained in:
jminta%gmail.com 2006-07-25 16:56:46 +00:00
Родитель 2888fcd4be
Коммит eaec1f754a
2 изменённых файлов: 37 добавлений и 0 удалений

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

@ -4945,6 +4945,38 @@ nsContextMenu.prototype = {
permissionmanager.add(uri, "image",
aBlock ? nsIPermissionManager.DENY_ACTION : nsIPermissionManager.ALLOW_ACTION);
var savedmenu = this;
function undoImageBlock() {
savedmenu.toggleImageBlocking(!aBlock);
}
var bundle_browser = document.getElementById("bundle_browser");
var message;
if (aBlock)
message = bundle_browser.getString("imageWarningBlocked");
else
message = bundle_browser.getString("imageWarningAllowed");
var notificationBox = gBrowser.getNotificationBox();
var notification = notificationBox.getNotificationWithValue("images-blocked");
if (notification)
notification.label = message;
else {
var buttons = [{
label: bundle_browser.getString("undo"),
accesskey: bundle_browser.getString("undo.accessKey"),
callback: undoImageBlock
}];
const priority = notificationBox.PRIORITY_WARNING_MEDIUM;
notificationBox.appendNotification(message, "images-blocked",
"chrome://browser/skin/Info.png",
priority, buttons);
}
// Reload the page to show the effect instantly
BrowserReload();
},
isImageBlocked : function() {
var nsIPermissionManager = Components.interfaces.nsIPermissionManager;

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

@ -90,6 +90,11 @@ popupWarningDontShowFromMessage=Don't show this message when popups are blocked
popupWarningDontShowFromStatusbar=Don't show info message when popups are blocked
popupShowPopupPrefix=Show '%S'
imageWarningBlocked=Firefox will now always block images from this site
imageWarningAllowed=Firefox will now allow images from this site
undo=Undo
undo.accessKey=U
saveFormInformationMessage=%S can save information that you enter in web forms to make filling them out faster in the future. Would you like to save form information from now on?
saveFormInformationYes=Save Form Information
saveFormInformationNo=Don't Save