Change net monitor menu label to be independent, and to be "Block Resource"

This commit is contained in:
AlexVallat 2015-04-29 18:45:11 +01:00
parent c98ff26709
commit 424f13178a
3 changed files with 8 additions and 4 deletions

View File

@ -1944,10 +1944,10 @@ vAPI.contextMenu.displayMenuItem = function({target}) {
/******************************************************************************/
vAPI.contextMenu.createContextMenuItem = function(doc) {
vAPI.contextMenu.createContextMenuItem = function(doc, labelOverride) {
var menuitem = doc.createElement('menuitem');
menuitem.setAttribute('id', this.menuItemId);
menuitem.setAttribute('label', this.menuLabel);
menuitem.setAttribute('label', labelOverride || this.menuLabel);
menuitem.setAttribute('image', vAPI.getURL('img/browsericons/icon16.svg'));
menuitem.setAttribute('class', 'menuitem-iconic');
return menuitem;
@ -2038,7 +2038,7 @@ vAPI.contextMenu.registerForNetMonitor = function(eventName, toolbox, panel) {
var insertBeforeMenuItem = doc.getElementById("request-menu-context-separator");
if (menuPopup && insertBeforeMenuItem) {
var menuitem = vAPI.contextMenu.createContextMenuItem(doc);
var menuitem = vAPI.contextMenu.createContextMenuItem(doc, vAPI.i18n('netMonitorContextMenuEntry'));
menuitem.addEventListener('command', function() {
var selectedRequest = panel.panelWin.NetMonitorView.RequestsMenu.selectedAttachment;
if (selectedRequest) {

View File

@ -147,6 +147,10 @@
"message":"Block element",
"description":"English: Block element"
},
"netMonitorContextMenuEntry":{
"message":"Block resource",
"description":"English: Block resource"
},
"settingsCollapseBlockedPrompt":{
"message":"Hide placeholders of blocked elements",
"description":"English: Hide placeholders of blocked elements"

View File

@ -24,7 +24,7 @@ source_locale_dir = pj(build_dir, '_locales')
target_locale_dir = pj(build_dir, 'locale')
language_codes = []
descriptions = OrderedDict({})
title_case_strings = ['pickerContextMenuEntry']
title_case_strings = ['pickerContextMenuEntry', 'netMonitorContextMenuEntry']
for alpha2 in sorted(os.listdir(source_locale_dir)):
locale_path = pj(source_locale_dir, alpha2, 'messages.json')