1<?xml version="1.0"?>
2<!-- This Source Code Form is subject to the terms of the Mozilla Public
3   - License, v. 2.0. If a copy of the MPL was not distributed with this
4   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
5<!DOCTYPE overlay SYSTEM "chrome://communicator/locale/contentAreaCommands.dtd" >
6<overlay id="contentAreaContextOverlay"
7         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
8
9  <!-- Context menu -->
10  <script type="application/javascript">
11    // Global variable that holds the nsContextMenu instance.
12    var gContextMenu = null;
13  </script>
14  <script type="application/javascript" src="chrome://global/content/inlineSpellCheckUI.js"/>
15  <script type="application/javascript" src="chrome://communicator/content/nsContextMenu.js"/>
16  <script type="application/javascript" src="chrome://global/content/contentAreaUtils.js"/>
17
18  <stringbundleset>
19    <stringbundle id="contentAreaCommandsBundle"
20                  src="chrome://communicator/locale/contentAreaCommands.properties"/>
21  </stringbundleset>
22
23  <popupset id="contentAreaContextSet">
24    <!-- This is a generic context menu for a content area. It contains
25         each and every possible menu choice.  The appropriate items are
26         hidden/shown upon display, based on what the user has clicked-on.
27     -->
28    <menupopup id="contentAreaContextMenu"
29               pagemenu="start"
30               onpopupshowing="if (event.target != this) return true; gContextMenu = new nsContextMenu(this, null, event.shiftKey); return gContextMenu.shouldDisplay;"
31               onpopuphiding="if (event.target != this) return; gContextMenu.hiding(); gContextMenu = null;">
32      <menuseparator id="page-menu-separator"/>
33      <menuitem id="popupwindow-reject"
34                label="&popupWindowRejectCmd.label;"
35                accesskey="&popupWindowRejectCmd.accesskey;"
36                oncommand="gContextMenu.rejectPopupWindows(event.shiftKey);"/>
37      <menuitem id="popupwindow-allow"
38                label="&popupWindowAllowCmd.label;"
39                accesskey="&popupWindowAllowCmd.accesskey;"
40                oncommand="gContextMenu.allowPopupWindows();"/>
41      <menuseparator id="context-sep-popup"/>
42
43      <menuitem id="spell-no-suggestions"
44                disabled="true"
45                label="&spellNoSuggestions.label;"/>
46      <menuseparator id="spell-add-separator"/>
47      <menuitem id="spell-add-to-dictionary"
48                label="&spellAddToDictionary.label;"
49                accesskey="&spellAddToDictionary.accesskey;"
50                oncommand="InlineSpellCheckerUI.addToDictionary();"/>
51      <menuitem id="spell-undo-add-to-dictionary"
52                label="&spellUndoAddToDictionary.label;"
53                accesskey="&spellUndoAddToDictionary.accesskey;"
54                oncommand="InlineSpellCheckerUI.undoAddToDictionary();"/>
55      <menuitem id="spell-ignore-word"
56                label="&spellIgnoreWord.label;"
57                accesskey="&spellIgnoreWord.accesskey;"
58                oncommand="InlineSpellCheckerUI.ignoreWord();"/>
59      <menuseparator id="spell-suggestions-separator"/>
60      <menuitem id="context-openlinkintab"
61                label="&openLinkCmdInTab.label;"
62                accesskey="&openLinkCmdInTab.accesskey;"
63                oncommand="gContextMenu.openLinkInTab(event);"/>
64      <menuitem id="context-openlink"
65                label="&openLinkCmd.label;"
66                accesskey="&openLinkCmd.accesskey;"
67                oncommand="gContextMenu.openLinkInWindow();"/>
68      <menuitem id="context-openlinkinprivatewindow"
69                label="&openLinkCmdInPrivateWindow.label;"
70                accesskey="&openLinkCmdInPrivateWindow.accesskey;"
71                oncommand="gContextMenu.openLinkInPrivateWindow();"/>
72      <menuseparator id="context-sep-open"/>
73      <menuitem id="context-bookmarklink"
74                label="&bookmarkLinkCmd.label;"
75                accesskey="&bookmarkLinkCmd.accesskey;"
76                oncommand="gContextMenu.bookmarkLink();"/>
77      <menuitem id="context-savelink"
78                valueSaveAs="&saveLinkAsCmd.label;"
79                valueSave="&saveLinkCmd.label;"
80                accesskey="&saveLinkCmd.accesskey;"
81                oncommand="gContextMenu.saveLink();"/>
82      <menuitem id="context-copyemail"
83                label="&copyEmailCmd.label;"
84                accesskey="&copyEmailCmd.accesskey;"
85                oncommand="gContextMenu.copyEmail();"/>
86      <menuitem id="context-copylink"
87                label="&copyLinkCmd.label;"
88                accesskey="&copyLinkCmd.accesskey;"
89                command="cmd_copyLink"/>
90      <menuseparator id="context-sep-copylink"/>
91      <menuitem id="context-media-play"
92                label="&mediaPlay.label;"
93                accesskey="&mediaPlay.accesskey;"
94                oncommand="gContextMenu.mediaCommand('play');"/>
95      <menuitem id="context-media-pause"
96                label="&mediaPause.label;"
97                accesskey="&mediaPause.accesskey;"
98                oncommand="gContextMenu.mediaCommand('pause');"/>
99      <menuitem id="context-media-mute"
100                label="&mediaMute.label;"
101                accesskey="&mediaMute.accesskey;"
102                oncommand="gContextMenu.mediaCommand('mute');"/>
103      <menuitem id="context-media-unmute"
104                label="&mediaUnmute.label;"
105                accesskey="&mediaUnmute.accesskey;"
106                oncommand="gContextMenu.mediaCommand('unmute');"/>
107      <menu id="context-media-playbackrate"
108            label="&mediaPlaybackRate.label;"
109            accesskey="&mediaPlaybackRate.accesskey;">
110        <menupopup id="media-playbackrate-popup"
111                   oncommand="gContextMenu.mediaCommand('playbackRate',
112                              event.target.id.replace(/.*-/, '') / 100);">
113          <menuitem id="context-media-playbackrate-050"
114                    label="&mediaPlaybackRate050.label;"
115                    accesskey="&mediaPlaybackRate050.accesskey;"
116                    type="radio"
117                    name="playbackrate"/>
118          <menuitem id="context-media-playbackrate-100"
119                    label="&mediaPlaybackRate100.label;"
120                    accesskey="&mediaPlaybackRate100.accesskey;"
121                    type="radio"
122                    name="playbackrate"/>
123          <menuitem id="context-media-playbackrate-150"
124                    label="&mediaPlaybackRate150.label;"
125                    accesskey="&mediaPlaybackRate150.accesskey;"
126                    type="radio"
127                    name="playbackrate"/>
128          <menuitem id="context-media-playbackrate-200"
129                    label="&mediaPlaybackRate200.label;"
130                    accesskey="&mediaPlaybackRate200.accesskey;"
131                    type="radio"
132                    name="playbackrate"/>
133        </menupopup>
134      </menu>
135      <menuitem id="context-media-showcontrols"
136                label="&mediaShowControls.label;"
137                accesskey="&mediaShowControls.accesskey;"
138                oncommand="gContextMenu.mediaCommand('showcontrols');"/>
139      <menuitem id="context-media-hidecontrols"
140                label="&mediaHideControls.label;"
141                accesskey="&mediaHideControls.accesskey;"
142                oncommand="gContextMenu.mediaCommand('hidecontrols');"/>
143      <menuitem id="context-video-showstats"
144                label="&videoShowStats.label;"
145                accesskey="&videoShowStats.accesskey;"
146                oncommand="gContextMenu.mediaCommand('showstats');"/>
147      <menuitem id="context-video-hidestats"
148                label="&videoHideStats.label;"
149                accesskey="&videoHideStats.accesskey;"
150                oncommand="gContextMenu.mediaCommand('hidestats');"/>
151      <menuitem id="context-video-fullscreen"
152                label="&videoFullScreen.label;"
153                accesskey="&videoFullScreen.accesskey;"
154                oncommand="gContextMenu.fullScreenVideo();"/>
155      <menuseparator id="context-media-sep-commands"/>
156      <menuitem id="context-fitimage"
157                type="checkbox"
158                label="&fitImageCmd.label;"
159                accesskey="&fitImageCmd.accesskey;"
160                oncommand="gContextMenu.toggleImageSize();"/>
161      <menuitem id="context-reloadimage"
162                label="&reloadImageCmd.label;"
163                accesskey="&reloadImageCmd.accesskey;"
164                oncommand="gContextMenu.reloadImage();"/>
165      <menuitem id="context-viewimage"
166                label="&viewImageCmd.label;"
167                accesskey="&viewImageCmd.accesskey;"
168                oncommand="gContextMenu.viewMedia(event);"
169                onclick="checkForMiddleClick(this, event);"/>
170      <menuitem id="context-blockimage"
171                oncommand="gContextMenu.toggleImageBlocking(true);"/>
172      <menuitem id="context-unblockimage"
173                oncommand="gContextMenu.toggleImageBlocking(false);"/>
174      <menuitem id="context-copyimage"
175                label="&copyImageCmd.label;"
176                accesskey="&copyImageCmd.accesskey;"
177                command="cmd_copyImage"/>
178      <menuitem id="context-viewvideo"
179                label="&viewVideoCmd.label;"
180                accesskey="&viewVideoCmd.accesskey;"
181                oncommand="gContextMenu.viewMedia(event);"
182                onclick="checkForMiddleClick(this, event);"/>
183      <menuitem id="context-copyvideourl"
184                label="&copyVideoURLCmd.label;"
185                accesskey="&copyVideoURLCmd.accesskey;"
186                oncommand="gContextMenu.copyMediaLocation();"/>
187      <menuitem id="context-copyaudiourl"
188                label="&copyAudioURLCmd.label;"
189                accesskey="&copyAudioURLCmd.accesskey;"
190                oncommand="gContextMenu.copyMediaLocation();"/>
191      <menuseparator id="context-sep-copyimage"/>
192      <menuitem id="context-saveimage"
193                valueSaveAs="&saveImageAsCmd.label;"
194                valueSave="&saveImageCmd.label;"
195                accesskey="&saveImageCmd.accesskey;"
196                oncommand="gContextMenu.saveMedia();"/>
197      <menuitem id="context-setDesktopBackground"
198                label="&setDesktopBackgroundCmd.label;"
199                accesskey="&setDesktopBackgroundCmd.accesskey;"
200                oncommand="gContextMenu.setDesktopBackground();"/>
201      <menuitem id="context-savevideo"
202                label="&saveVideoCmd.label;"
203                accesskey="&saveVideoCmd.accesskey;"
204                oncommand="gContextMenu.saveMedia();"/>
205      <menuitem id="context-saveaudio"
206                label="&saveAudioCmd.label;"
207                accesskey="&saveAudioCmd.accesskey;"
208                oncommand="gContextMenu.saveMedia();"/>
209      <menuitem id="context-video-saveimage"
210                label="&videoSaveImage.label;"
211                accesskey="&videoSaveImage.accesskey;"
212                oncommand="gContextMenu.saveVideoFrameAsImage();"/>
213      <menuseparator id="context-sep-image"/>
214      <menuitem id="context-back"
215                label="&goBackCmd.label;"
216                accesskey="&goBackCmd.accesskey;"
217                oncommand="BrowserBack(event)"
218                onclick="checkForMiddleClick(this, event);"/>
219      <menuitem id="context-forward"
220                label="&goForwardCmd.label;"
221                accesskey="&goForwardCmd.accesskey;"
222                oncommand="BrowserForward(event)"
223                onclick="checkForMiddleClick(this, event);"/>
224      <menuitem id="context-reload"
225                label="&reloadCmd.label;"
226                accesskey="&reloadCmd.accesskey;"
227                oncommand="BrowserReload(event);"
228                onclick="checkForMiddleClick(this, event);"/>
229      <menuitem id="context-stop"
230                label="&stopCmd.label;"
231                accesskey="&stopCmd.accesskey;"
232                disabled="true"
233                oncommand="BrowserStop();"/>
234      <menuseparator id="context-sep-stop"/>
235      <menuitem id="context-bookmarkpage"
236                label="&bookmarkPageCmd.label;"
237                accesskey="&bookmarkPageCmd.accesskey;"
238                oncommand="gContextMenu.bookmarkThisPage();"/>
239      <menuitem id="context-savepage"
240                valueSaveAs="&savePageAsCmd.label;"
241                valueSave="&savePageCmd.label;"
242                accesskey="&savePageCmd.accesskey;"
243                oncommand="saveDocument(window.content.document, true);"/>
244      <menuseparator id="context-sep-viewbgimage"/>
245      <menuitem id="context-viewbgimage"
246                label="&viewBGImageCmd.label;"
247                accesskey="&viewBGImageCmd.accesskey;"
248                oncommand="gContextMenu.viewBGImage(event);"
249                onclick="checkForMiddleClick(this, event);"/>
250      <menuitem id="context-undo"/>
251      <menuitem id="context-redo"/>
252      <menuseparator id="context-sep-undo"/>
253      <menuitem id="context-cut"/>
254      <menuitem id="context-copy"/>
255      <menuitem id="context-paste"/>
256      <menuitem id="context-delete"/>
257      <menuseparator id="context-sep-paste"/>
258      <menuitem id="context-selectall"/>
259      <menuseparator id="context-sep-selectall"/>
260      <menuitem id="context-keywordfield"
261                label="&keywordfield.label;"
262                accesskey="&keywordfield.accesskey;"
263                oncommand="AddKeywordForSearchField();"/>
264      <menuitem id="context-searchselect"
265                oncommand="BrowserSearch.loadSearch(gContextMenu.searchSelected(), true, event);"/>
266      <menuseparator id="context-sep-properties"/>
267      <menuitem id="context-viewpartialsource-selection"
268                label="&viewPartialSourceForSelectionCmd.label;"
269                accesskey="&viewPartialSourceCmd.accesskey;"
270                oncommand="gContextMenu.viewPartialSource('selection');"/>
271      <menuitem id="context-viewpartialsource-mathml"
272                label="&viewPartialSourceForMathMLCmd.label;"
273                accesskey="&viewPartialSourceCmd.accesskey;"
274                oncommand="gContextMenu.viewPartialSource('mathml');"/>
275      <menuitem id="context-viewsource"
276                label="&viewPageSourceCmd.label;"
277                accesskey="&viewPageSourceCmd.accesskey;"
278                observes="isImage"
279                oncommand="BrowserViewSourceOfDocument(content.document);"/>
280      <menuitem id="context-viewinfo"
281                label="&viewPageInfoCmd.label;"
282                accesskey="&viewPageInfoCmd.accesskey;"
283                oncommand="gContextMenu.viewInfo();"/>
284      <menuitem id="context-metadata"
285                label="&metadataCmd.label;"
286                accesskey="&metadataCmd.accesskey;"
287                oncommand="gContextMenu.showMetadata();"/>
288      <menuseparator id="frame-sep"/>
289      <menu id="frame" label="&thisFrameMenu.label;" accesskey="&thisFrameMenu.accesskey;">
290        <menupopup id="frame_popup">
291          <menuitem id="context-showonlythisframe"
292                    label="&showOnlyThisFrameCmd.label;"
293                    accesskey="&showOnlyThisFrameCmd.accesskey;"
294                    oncommand="gContextMenu.showOnlyThisFrame();"/>
295          <menuitem id="context-openframeintab"
296                    label="&openFrameCmdInTab.label;"
297                    accesskey="&openFrameCmdInTab.accesskey;"
298                    oncommand="gContextMenu.openFrameInTab(event);"/>
299          <menuitem id="context-openframe"
300                    label="&openFrameCmd.label;"
301                    accesskey="&openFrameCmd.accesskey;"
302                    oncommand="gContextMenu.openFrame();"/>
303          <menuseparator/>
304          <menuitem id="context-reloadframe"
305                    label="&reloadFrameCmd.label;"
306                    accesskey="&reloadFrameCmd.accesskey;"
307                    oncommand="gContextMenu.reloadFrame();"/>
308          <menuseparator/>
309          <menuitem id="context-bookmarkframe"
310                    label="&bookmarkFrameCmd.label;"
311                    accesskey="&bookmarkFrameCmd.accesskey;"
312                    oncommand="gContextMenu.addBookmarkForFrame();"/>
313          <menuitem id="context-saveframe"
314                    valueSaveAs="&saveFrameAsCmd.label;"
315                    valueSave="&saveFrameCmd.label;"
316                    accesskey="&saveFrameCmd.accesskey;"
317                    oncommand="saveDocument(gContextMenu.target.ownerDocument, true);"/>
318          <menuseparator/>
319          <menuitem id="context-viewframesource"
320                    label="&viewFrameSourceCmd.label;"
321                    accesskey="&viewFrameSourceCmd.accesskey;"
322                    oncommand="gContextMenu.viewFrameSource();"/>
323          <menuitem id="context-viewframeinfo"
324                    label="&viewFrameInfoCmd.label;"
325                    accesskey="&viewFrameInfoCmd.accesskey;"
326                    oncommand="gContextMenu.viewFrameInfo();"/>
327        </menupopup>
328      </menu>
329      <menuseparator id="spell-separator"/>
330      <menuitem id="spell-check-enabled"
331                label="&spellCheckEnable.label;"
332                type="checkbox"
333                accesskey="&spellCheckEnable.accesskey;"
334                oncommand="InlineSpellCheckerUI.toggleEnabled();"/>
335      <menuitem id="spell-add-dictionaries-main"
336                label="&spellAddDictionaries.label;"
337                accesskey="&spellAddDictionaries.accesskey;"
338                oncommand="openDictionaryList();"/>
339      <menu id="spell-dictionaries"
340            label="&spellDictionaries.label;"
341            accesskey="&spellDictionaries.accesskey;">
342        <menupopup id="spell-dictionaries-menu">
343          <menuseparator id="spell-language-separator"/>
344          <menuitem id="spell-add-dictionaries"
345                    label="&spellAddDictionaries.label;"
346                    accesskey="&spellAddDictionaries.accesskey;"
347                    oncommand="openDictionaryList();"/>
348        </menupopup>
349      </menu>
350      <menuseparator hidden="true" id="context-sep-bidi"/>
351      <menuitem hidden="true" id="context-bidi-text-direction-toggle"
352                label="&bidiSwitchTextDirectionItem.label;"
353                accesskey="&bidiSwitchTextDirectionItem.accesskey;"
354                command="cmd_switchTextDirection"/>
355      <menuitem hidden="true" id="context-bidi-page-direction-toggle"
356                label="&bidiSwitchPageDirectionItem.label;"
357                accesskey="&bidiSwitchPageDirectionItem.accesskey;"
358                oncommand="SwitchDocumentDirection(window.content);"/>
359    </menupopup>
360  </popupset>
361</overlay>
362