toolkit/components/viewsource/content/viewSource.xul

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 <?xml version="1.0"?>
     2 # -*- Mode: HTML -*-
     3 # This Source Code Form is subject to the terms of the Mozilla Public
     4 # License, v. 2.0. If a copy of the MPL was not distributed with this
     5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
     7 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> 
     8 <?xml-stylesheet href="chrome://global/content/viewSource.css" type="text/css"?>
     9 <?xml-stylesheet href="chrome://mozapps/skin/viewsource/viewsource.css" type="text/css"?>
    10 <?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>
    12 <!DOCTYPE window [
    13 <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
    14 %brandDTD;
    15 <!ENTITY % sourceDTD SYSTEM "chrome://global/locale/viewSource.dtd" >
    16 %sourceDTD;
    17 <!ENTITY % charsetDTD SYSTEM "chrome://global/locale/charsetMenu.dtd" >
    18 %charsetDTD;
    19 ]>
    21 <window id="viewSource"
    22         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    23         onload="onLoadViewSource();"
    24         contenttitlesetting="true"
    25         title="&mainWindow.title;" 
    26         titlemodifier="&mainWindow.titlemodifier;" 
    27         titlepreface="&mainWindow.preface;"
    28         titlemenuseparator ="&mainWindow.titlemodifierseparator;"  
    29         windowtype="navigator:view-source"
    30         width="640" height="480"
    31         screenX="10" screenY="10"
    32         persist="screenX screenY width height sizemode">
    34   <script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
    35   <script type="application/javascript" src="chrome://global/content/printUtils.js"/>
    36   <script type="application/javascript" src="chrome://global/content/viewSource.js"/>
    37   <script type="application/javascript" src="chrome://global/content/viewZoomOverlay.js"/>
    38   <script type="application/javascript" src="chrome://global/content/contentAreaUtils.js"/>
    40   <stringbundle id="viewSourceBundle" src="chrome://global/locale/viewSource.properties"/>
    42   <command id="cmd_savePage" oncommand="ViewSourceSavePage();"/>
    43   <command id="cmd_print" oncommand="PrintUtils.print();"/>
    44   <command id="cmd_printpreview" oncommand="PrintUtils.printPreview(PrintPreviewListener);"/>
    45   <command id="cmd_pagesetup" oncommand="PrintUtils.showPageSetup();"/>
    46   <command id="cmd_close" oncommand="window.close();"/>
    47   <commandset id="editMenuCommands"/>
    48   <command id="cmd_find"
    49            oncommand="document.getElementById('FindToolbar').onFindCommand();"/>
    50   <command id="cmd_findAgain"
    51            oncommand="document.getElementById('FindToolbar').onFindAgainCommand(false);"/>
    52   <command id="cmd_findPrevious"
    53            oncommand="document.getElementById('FindToolbar').onFindAgainCommand(true);"/>
    54 #ifdef XP_MACOSX
    55   <command id="cmd_findSelection"
    56            oncommand="document.getElementById('FindToolbar').onFindSelectionCommand();"/>
    57 #endif
    58   <command id="cmd_reload" oncommand="ViewSourceReload();"/>
    59   <command id="cmd_goToLine" oncommand="ViewSourceGoToLine();" disabled="true"/>
    60   <command id="cmd_highlightSyntax" oncommand="highlightSyntax();"/>
    61   <command id="cmd_wrapLongLines" oncommand="wrapLongLines()"/>
    62   <command id="cmd_textZoomReduce" oncommand="ZoomManager.reduce();"/>
    63   <command id="cmd_textZoomEnlarge" oncommand="ZoomManager.enlarge();"/>
    64   <command id="cmd_textZoomReset" oncommand="ZoomManager.reset();"/>
    66   <command id="Browser:Back" oncommand="BrowserBack();" observes="viewSourceNavigation"/>
    67   <command id="Browser:Forward" oncommand="BrowserForward();" observes="viewSourceNavigation"/>
    69   <broadcaster id="viewSourceNavigation"/>
    71   <keyset id="editMenuKeys"/>
    72   <keyset id="viewSourceKeys">
    73     <key id="key_savePage" key="&savePageCmd.commandkey;" modifiers="accel" command="cmd_savePage"/>
    74     <key id="key_print" key="&printCmd.commandkey;" modifiers="accel" command="cmd_print"/>
    75     <key id="key_close" key="&closeCmd.commandkey;" modifiers="accel" command="cmd_close"/>
    76     <key id="key_goToLine"     key="&goToLineCmd.commandkey;"  command="cmd_goToLine"  modifiers="accel"/>
    78     <key id="key_textZoomEnlarge" key="&textEnlarge.commandkey;" command="cmd_textZoomEnlarge" modifiers="accel"/>
    79     <key id="key_textZoomEnlarge2" key="&textEnlarge.commandkey2;" command="cmd_textZoomEnlarge" modifiers="accel"/>
    80     <key id="key_textZoomEnlarge3" key="&textEnlarge.commandkey3;" command="cmd_textZoomEnlarge" modifiers="accel"/>
    81     <key id="key_textZoomReduce"  key="&textReduce.commandkey;" command="cmd_textZoomReduce" modifiers="accel"/>
    82     <key id="key_textZoomReduce2"  key="&textReduce.commandkey2;" command="cmd_textZoomReduce" modifiers="accel"/>
    83     <key id="key_textZoomReset" key="&textReset.commandkey;" command="cmd_textZoomReset" modifiers="accel"/>
    84     <key id="key_textZoomReset2" key="&textReset.commandkey2;" command="cmd_textZoomReset" modifiers="accel"/>
    86     <key id="key_reload" key="&reloadCmd.commandkey;" command="cmd_reload" modifiers="accel"/>
    87     <key key="&reloadCmd.commandkey;" command="cmd_reload" modifiers="accel,shift"/>
    88     <key keycode="VK_F5" command="cmd_reload"/>
    89     <key keycode="VK_F5" command="cmd_reload" modifiers="accel"/>
    90     <key id="key_find" key="&findOnCmd.commandkey;" command="cmd_find" modifiers="accel"/>
    91     <key id="key_findAgain" key="&findAgainCmd.commandkey;" command="cmd_findAgain" modifiers="accel"/>
    92     <key id="key_findPrevious" key="&findAgainCmd.commandkey;" command="cmd_findPrevious" modifiers="accel,shift"/>
    93 #ifdef XP_MACOSX
    94     <key id="key_findSelection" key="&findSelectionCmd.commandkey;" command="cmd_findSelection" modifiers="accel"/>
    95 #endif
    96     <key keycode="&findAgainCmd.commandkey2;" command="cmd_findAgain"/>
    97     <key keycode="&findAgainCmd.commandkey2;"  command="cmd_findPrevious" modifiers="shift"/>
    99     <key keycode="VK_BACK" command="Browser:Back"/>
   100     <key keycode="VK_BACK" command="Browser:Forward" modifiers="shift"/>
   101 #ifndef XP_MACOSX
   102     <key id="goBackKb" keycode="VK_LEFT" command="Browser:Back" modifiers="alt"/>
   103     <key id="goForwardKb" keycode="VK_RIGHT" command="Browser:Forward" modifiers="alt"/>
   104 #else
   105     <key id="goBackKb" keycode="VK_LEFT" command="Browser:Back" modifiers="accel" />
   106     <key id="goForwardKb" keycode="VK_RIGHT" command="Browser:Forward" modifiers="accel" />
   107 #endif
   108 #ifdef XP_UNIX
   109     <key id="goBackKb2" key="&goBackCmd.commandKey;" command="Browser:Back" modifiers="accel"/>
   110     <key id="goForwardKb2" key="&goForwardCmd.commandKey;" command="Browser:Forward" modifiers="accel"/>
   111 #endif
   113   </keyset>
   115   <tooltip id="aHTMLTooltip" page="true"/>
   117   <menupopup id="viewSourceContextMenu"
   118              onpopupshowing="contextMenuShowing();">
   119     <menuitem id="context-back"
   120               label="&backCmd.label;"
   121               accesskey="&backCmd.accesskey;"
   122               command="Browser:Back"
   123               observes="viewSourceNavigation"/>
   124     <menuitem id="context-forward"
   125               label="&forwardCmd.label;"
   126               accesskey="&forwardCmd.accesskey;"
   127               command="Browser:Forward"
   128               observes="viewSourceNavigation"/>
   129     <menuseparator observes="viewSourceNavigation"/>
   130     <menuitem id="cMenu_findAgain"/>
   131     <menuseparator/>
   132     <menuitem id="cMenu_copy"/>
   133     <menuitem id="context-copyLink"
   134               label="&copyLinkCmd.label;"
   135               accesskey="&copyLinkCmd.accesskey;"
   136               oncommand="contextMenuCopyLinkOrEmail();"/>
   137     <menuitem id="context-copyEmail"
   138               label="&copyEmailCmd.label;"
   139               accesskey="&copyEmailCmd.accesskey;"
   140               oncommand="contextMenuCopyLinkOrEmail();"/>
   141     <menuseparator/>
   142     <menuitem id="cMenu_selectAll"/>
   143   </menupopup>
   145   <!-- Menu --> 
   146   <toolbox id="viewSource-toolbox">
   147     <menubar id="viewSource-main-menubar">
   149       <menu id="menu_file" label="&fileMenu.label;" accesskey="&fileMenu.accesskey;">
   150         <menupopup id="menu_FilePopup">
   151           <menuitem key="key_savePage" command="cmd_savePage" id="menu_savePage"
   152                     label="&savePageCmd.label;" accesskey="&savePageCmd.accesskey;"/>
   153           <menuitem command="cmd_pagesetup" id="menu_pageSetup"
   154                     label="&pageSetupCmd.label;" accesskey="&pageSetupCmd.accesskey;"/>
   155 #ifndef XP_MACOSX
   156           <menuitem command="cmd_printpreview" id="menu_printPreview"
   157                     label="&printPreviewCmd.label;" accesskey="&printPreviewCmd.accesskey;"/>
   158 #endif
   159           <menuitem key="key_print" command="cmd_print" id="menu_print"
   160                     label="&printCmd.label;" accesskey="&printCmd.accesskey;"/>
   161           <menuseparator/>
   162           <menuitem key="key_close" command="cmd_close" id="menu_close"
   163                     label="&closeCmd.label;" accesskey="&closeCmd.accesskey;"/>
   164         </menupopup>
   165       </menu>
   167       <menu id="menu_edit">
   168         <menupopup id="editmenu-popup">
   169           <menuitem id="menu_undo"/>
   170           <menuitem id="menu_redo"/>
   171           <menuseparator/>
   172           <menuitem id="menu_cut"/>
   173           <menuitem id="menu_copy"/>
   174           <menuitem id="menu_paste"/>
   175           <menuitem id="menu_delete"/>
   176           <menuseparator/>
   177           <menuitem id="menu_selectAll"/>
   178           <menuseparator/>
   179           <menuitem id="menu_find"/>
   180           <menuitem id="menu_findAgain"/>
   181           <menuseparator/>
   182           <menuitem id="menu_goToLine" key="key_goToLine" command="cmd_goToLine"
   183                     label="&goToLineCmd.label;" accesskey="&goToLineCmd.accesskey;"/>
   184         </menupopup>
   185       </menu>
   187       <menu id="menu_view" label="&viewMenu.label;" accesskey="&viewMenu.accesskey;">
   188         <menupopup id="viewmenu-popup">
   189           <menuitem id="menu_reload" command="cmd_reload" accesskey="&reloadCmd.accesskey;"
   190                     label="&reloadCmd.label;" key="key_reload"/>
   191           <menuseparator />
   192           <menu id="viewTextZoomMenu" label="&menu_textSize.label;" accesskey="&menu_textSize.accesskey;">
   193             <menupopup>                    
   194               <menuitem id="menu_textEnlarge" command="cmd_textZoomEnlarge" 
   195                         label="&menu_textEnlarge.label;" accesskey="&menu_textEnlarge.accesskey;"
   196                         key="key_textZoomEnlarge"/>
   197               <menuitem id="menu_textReduce" command="cmd_textZoomReduce" 
   198                         label="&menu_textReduce.label;" accesskey="&menu_textReduce.accesskey;"
   199                         key="key_textZoomReduce"/>
   200               <menuseparator/>
   201               <menuitem id="menu_textReset" command="cmd_textZoomReset"
   202                         label="&menu_textReset.label;" accesskey="&menu_textReset.accesskey;"
   203                         key="key_textZoomReset"/>
   204             </menupopup>
   205           </menu>
   207           <!-- Charset Menu -->
   208           <menu id="charsetMenu"
   209                 label="&charsetMenu.label;"
   210                 accesskey="&charsetMenu.accesskey;"
   211                 oncommand="BrowserSetCharacterSet(event);"
   212                 onpopupshowing="CharsetMenu.build(event.target);"
   213                 onpopupshown="CharsetMenu.update(event.target, content.document.characterSet);">
   214             <menupopup/>
   215           </menu>
   216           <menuseparator/>
   217           <menuitem id="menu_wrapLongLines" type="checkbox" command="cmd_wrapLongLines"
   218                     label="&menu_wrapLongLines.title;" accesskey="&menu_wrapLongLines.accesskey;"/>
   219           <menuitem type="checkbox" id="menu_highlightSyntax" command="cmd_highlightSyntax"
   220                     label="&menu_highlightSyntax.label;" accesskey="&menu_highlightSyntax.accesskey;"/>
   221         </menupopup>
   222       </menu>
   223     </menubar>  
   224   </toolbox>
   226   <vbox id="appcontent" flex="1">
   228     <browser id="content" type="content-primary" name="content" src="about:blank" flex="1"
   229              context="viewSourceContextMenu" showcaret="true" tooltip="aHTMLTooltip"/>
   230     <findbar id="FindToolbar" browserid="content"/>
   231   </vbox> 
   233   <statusbar id="status-bar" class="chromeclass-status">
   234     <statusbarpanel id="statusbar-line-col" label="" flex="1"/>
   235   </statusbar>
   237 </window>

mercurial