зеркало из https://github.com/mozilla/gecko-dev.git
bug 126059 r=timeless sr=alecf
disable menu stuff for images (like Search in Page, Text Zoom, etc.)
This commit is contained in:
Родитель
b64476ec81
Коммит
c5431190d2
|
@ -109,7 +109,7 @@
|
||||||
<command id="cmd_newEditorDraft"/> -->
|
<command id="cmd_newEditorDraft"/> -->
|
||||||
<command id="Browser:OpenFile" oncommand="BrowserOpenFileWindow();"/>
|
<command id="Browser:OpenFile" oncommand="BrowserOpenFileWindow();"/>
|
||||||
<command id="Browser:SavePage" oncommand="saveDocument(window._content.document);"/>
|
<command id="Browser:SavePage" oncommand="saveDocument(window._content.document);"/>
|
||||||
<command id="Browser:EditPage" oncommand="editPageOrFrame();"/>
|
<command id="Browser:EditPage" oncommand="editPageOrFrame();" observes="isImage"/>
|
||||||
<command id="Browser:Open" oncommand="BrowserOpenWindow();"/>
|
<command id="Browser:Open" oncommand="BrowserOpenWindow();"/>
|
||||||
<command id="Browser:PrintSetup" oncommand="BrowserPrintSetup();"/>
|
<command id="Browser:PrintSetup" oncommand="BrowserPrintSetup();"/>
|
||||||
<command id="Browser:Print" oncommand="BrowserPrint();"/>
|
<command id="Browser:Print" oncommand="BrowserPrint();"/>
|
||||||
|
@ -125,7 +125,7 @@
|
||||||
<command id="cmd_copy"/>
|
<command id="cmd_copy"/>
|
||||||
<command id="cmd_paste"/>
|
<command id="cmd_paste"/>
|
||||||
<command id="cmd_delete"/>
|
<command id="cmd_delete"/>
|
||||||
<command id="cmd_selectAll"/>
|
<command id="cmd_selectAll" observes="isImage"/>
|
||||||
|
|
||||||
<!-- Content area context menu -->
|
<!-- Content area context menu -->
|
||||||
<command id="cmd_copyLink"/>
|
<command id="cmd_copyLink"/>
|
||||||
|
@ -137,8 +137,8 @@
|
||||||
<command id="View:PageInfo" oncommand="BrowserPageInfo(getBrowser().contentDocument);"/>
|
<command id="View:PageInfo" oncommand="BrowserPageInfo(getBrowser().contentDocument);"/>
|
||||||
|
|
||||||
<!-- Search Menu -->
|
<!-- Search Menu -->
|
||||||
<command id="Browser:Find" oncommand="BrowserFind();" />
|
<command id="Browser:Find" oncommand="BrowserFind();" observes="isImage"/>
|
||||||
<command id="Browser:FindAgain" oncommand="BrowserFindAgain();" />
|
<command id="Browser:FindAgain" oncommand="BrowserFindAgain();" observes="isImage"/>
|
||||||
|
|
||||||
<!-- Bookmarks Menu -->
|
<!-- Bookmarks Menu -->
|
||||||
<command id="Browser:AddBookmark" label="&addCurPageCmd.label;" accesskey="&addCurPageCmd.accesskey;"
|
<command id="Browser:AddBookmark" label="&addCurPageCmd.label;" accesskey="&addCurPageCmd.accesskey;"
|
||||||
|
@ -164,6 +164,7 @@
|
||||||
<broadcaster id="cmd_viewpersonaltoolbar" oncommand="goToggleToolbar('PersonalToolbar','cmd_viewpersonaltoolbar');" checked="true"/>
|
<broadcaster id="cmd_viewpersonaltoolbar" oncommand="goToggleToolbar('PersonalToolbar','cmd_viewpersonaltoolbar');" checked="true"/>
|
||||||
<broadcaster id="cmd_viewtaskbar" oncommand="goToggleToolbar('status-bar','cmd_viewtaskbar');" checked="true"/>
|
<broadcaster id="cmd_viewtaskbar" oncommand="goToggleToolbar('status-bar','cmd_viewtaskbar');" checked="true"/>
|
||||||
<broadcaster id="cmd_viewcomponentbar" oncommand="goToggleToolbar('component-bar', 'cmd_viewcomponentbar');" checked="true"/>
|
<broadcaster id="cmd_viewcomponentbar" oncommand="goToggleToolbar('component-bar', 'cmd_viewcomponentbar');" checked="true"/>
|
||||||
|
<broadcaster id="isImage"/>
|
||||||
</broadcasterset>
|
</broadcasterset>
|
||||||
|
|
||||||
<!-- Menu -->
|
<!-- Menu -->
|
||||||
|
@ -228,9 +229,9 @@
|
||||||
<menuseparator />
|
<menuseparator />
|
||||||
|
|
||||||
<!-- overlayed from viewZoomOverlay.xul -->
|
<!-- overlayed from viewZoomOverlay.xul -->
|
||||||
<menu id="menu_textZoom"/>
|
<menu id="menu_textZoom" observes="isImage"/>
|
||||||
|
|
||||||
<menu label="&useStyleSheetMenu.label;" accesskey="&useStyleSheetMenu.accesskey;" disabled="false">
|
<menu label="&useStyleSheetMenu.label;" accesskey="&useStyleSheetMenu.accesskey;" disabled="false" observes="isImage">
|
||||||
<menupopup onpopupshowing="stylesheetFillPopup(this);"
|
<menupopup onpopupshowing="stylesheetFillPopup(this);"
|
||||||
oncommand="stylesheetSwitchAll(window._content, event.target.getAttribute('data'));">
|
oncommand="stylesheetSwitchAll(window._content, event.target.getAttribute('data'));">
|
||||||
<menuitem label="&useStyleSheetNone.label;" type="radio"/>
|
<menuitem label="&useStyleSheetNone.label;" type="radio"/>
|
||||||
|
@ -244,12 +245,12 @@
|
||||||
<menuitem accesskey="&pageInfoCmd.accesskey;" label="&pageInfoCmd.label;" key="key_viewInfo" command="View:PageInfo"/>
|
<menuitem accesskey="&pageInfoCmd.accesskey;" label="&pageInfoCmd.label;" key="key_viewInfo" command="View:PageInfo"/>
|
||||||
<menuseparator />
|
<menuseparator />
|
||||||
|
|
||||||
<menuitem accesskey="&translateMenu.accesskey;" label="&translateMenu.label;" id="menuitem-translate" oncommand="Translate();"/>
|
<menuitem accesskey="&translateMenu.accesskey;" label="&translateMenu.label;" observes="isImage" oncommand="Translate();"/>
|
||||||
|
|
||||||
<menuitem label="&webContentMenu.label;" accesskey="&webContentMenu.accesskey;" oncommand="goPreferences('pref-contentpacks.xul','chrome://content-packs/content/pref-contentpacks.xul');">
|
<menuitem label="&webContentMenu.label;" accesskey="&webContentMenu.accesskey;" oncommand="goPreferences('pref-contentpacks.xul','chrome://content-packs/content/pref-contentpacks.xul');">
|
||||||
</menuitem>
|
</menuitem>
|
||||||
|
|
||||||
<menu id="charsetMenu" />
|
<menu id="charsetMenu" observes="isImage"/>
|
||||||
|
|
||||||
<menuseparator/>
|
<menuseparator/>
|
||||||
<menu label="&applyTheme.label;" accesskey="&applyTheme.accesskey;">
|
<menu label="&applyTheme.label;" accesskey="&applyTheme.accesskey;">
|
||||||
|
|
|
@ -109,7 +109,7 @@ nsBrowserStatusHandler.prototype =
|
||||||
this.stopMenu = document.getElementById("menuitem-stop");
|
this.stopMenu = document.getElementById("menuitem-stop");
|
||||||
this.stopContext = document.getElementById("context-stop");
|
this.stopContext = document.getElementById("context-stop");
|
||||||
this.statusTextField = document.getElementById("statusbar-display");
|
this.statusTextField = document.getElementById("statusbar-display");
|
||||||
this.translateMenu = document.getElementById("menuitem-translate");
|
this.isImage = document.getElementById("isImage");
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ nsBrowserStatusHandler.prototype =
|
||||||
this.stopMenu = null;
|
this.stopMenu = null;
|
||||||
this.stopContext = null;
|
this.stopContext = null;
|
||||||
this.statusTextField = null;
|
this.statusTextField = null;
|
||||||
this.translateMenu = null;
|
this.isImage = null;
|
||||||
this.userTyped = null;
|
this.userTyped = null;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ nsBrowserStatusHandler.prototype =
|
||||||
this.stopButton.disabled = false;
|
this.stopButton.disabled = false;
|
||||||
this.stopMenu.removeAttribute('disabled');
|
this.stopMenu.removeAttribute('disabled');
|
||||||
this.stopContext.removeAttribute('disabled');
|
this.stopContext.removeAttribute('disabled');
|
||||||
this.translateMenu.removeAttribute('disabled');
|
this.isImage.removeAttribute('disabled');
|
||||||
|
|
||||||
// Initialize the progress stuff...
|
// Initialize the progress stuff...
|
||||||
this.useRealProgressFlag = false;
|
this.useRealProgressFlag = false;
|
||||||
|
@ -256,9 +256,12 @@ nsBrowserStatusHandler.prototype =
|
||||||
}
|
}
|
||||||
this.status = "";
|
this.status = "";
|
||||||
this.setDefaultStatus(msg);
|
this.setDefaultStatus(msg);
|
||||||
ctype = aRequest.QueryInterface(nsIChannel).contentType;
|
try {
|
||||||
if (ctype.match(/^image\//))
|
ctype = aRequest.QueryInterface(nsIChannel).contentType;
|
||||||
this.translateMenu.setAttribute('disabled', 'true');
|
if (ctype.match(/^image\//))
|
||||||
|
this.isImage.setAttribute('disabled', 'true');
|
||||||
|
}
|
||||||
|
catch (e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Turn the progress meter and throbber off.
|
// Turn the progress meter and throbber off.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче