Bug 60513 - alert(), prompt(), confirm() box text has static text (text not selectable), r=gavin.sharp, ui-r=beltzner, a=dbaron
authormartijn.martijn@gmail.com
Mon, 08 Oct 2007 16:29:21 -0700
changeset 6736 4a178cc00d112dd4c00026b84d3b1aeda3f3d793
parent 6735 1a6ad2ab22abd4f0c2273eaf5f5943053ee5220c
child 6737 045596aeef0fe405597ef67a4a25a69204fe840d
push idunknown
push userunknown
push dateunknown
reviewersgavin.sharp, beltzner, dbaron
bugs60513
milestone1.9a9pre
Bug 60513 - alert(), prompt(), confirm() box text has static text (text not selectable), r=gavin.sharp, ui-r=beltzner, a=dbaron
toolkit/content/commonDialog.css
toolkit/content/commonDialog.xul
toolkit/content/jar.mn
toolkit/locales/en-US/chrome/global/commonDialog.dtd
new file mode 100644
--- /dev/null
+++ b/toolkit/content/commonDialog.css
@@ -0,0 +1,45 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ Version: MPL 1.1/GPL 2.0/LGPL 2.1
+
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS IS" basis,
+ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ for the specific language governing rights and limitations under the
+ License.
+
+ The Original Code is Mozilla Communicator client code, released
+ March 31, 1998.
+
+ The Initial Developer of the Original Code is
+ Mozilla.
+ Portions created by the Initial Developer are Copyright (C) 2007
+ the Initial Developer. All Rights Reserved.
+
+ Contributor(s):
+
+ Alternatively, the contents of this file may be used under the terms of
+ either the GNU General Public License Version 2 or later (the "GPL"), or
+ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ in which case the provisions of the GPL or the LGPL are applicable instead
+ of those above. If you wish to allow use of your version of this file only
+ under the terms of either the GPL or the LGPL, and not to allow others to
+ use your version of this file under the terms of the MPL, indicate your
+ decision by deleting the provisions above and replace them with the notice
+ and other provisions required by the GPL or the LGPL. If you do not delete
+ the provisions above, a recipient may use your version of this file under
+ the terms of any one of the MPL, the GPL or the LGPL.
+
+ ***** END LICENSE BLOCK ***** */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* set default namespace to XUL */
+
+#info\.box > description {
+  -moz-user-focus: normal;
+  -moz-user-select: text;
+  cursor: text !important;
+  white-space: -moz-pre-wrap;
+}
--- a/toolkit/content/commonDialog.xul
+++ b/toolkit/content/commonDialog.xul
@@ -1,42 +1,64 @@
 <?xml version="1.0"?> 
 
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> 
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://global/content/commonDialog.css" type="text/css"?>
 
 <!DOCTYPE dialog SYSTEM "chrome://global/locale/commonDialog.dtd">
 
 <dialog id="commonDialog"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 
         xmlns:xhtml="http://www.w3.org/1999/xhtml"
         xhtml:role="alert"
         onload="commonDialogOnLoad();"
         ondialogaccept="return commonDialogOnAccept();"
         ondialogextra1="return commonDialogOnExtra1();"
         ondialogextra2="return commonDialogOnExtra2();"
         buttonpack="center"
         style="min-width: 29em; min-height: 8.5em; -moz-user-focus: ignore;"> 
     
   <script type="application/javascript" src="chrome://global/content/commonDialog.js"/>
+  <script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
+
+  <commandset id="selectEditMenuItems">
+    <command id="cmd_copy" oncommand="goDoCommand('cmd_copy')" disabled="true"/>
+    <command id="cmd_selectAll" oncommand="goDoCommand('cmd_selectAll')"/>
+  </commandset>
+
+  <popupset id="contentAreaContextSet">
+    <popup id="contentAreaContextMenu"
+           onpopupshowing="goUpdateCommand('cmd_copy')">
+      <menuitem id="context-copy"
+                label="&copyCmd.label;"
+                accesskey="&copyCmd.accesskey;"
+                command="cmd_copy"
+                disabled="true"/>
+      <menuitem id="context-selectall"
+                label="&selectAllCmd.label;"
+                accesskey="&selectAllCmd.accesskey;"
+                command="cmd_selectAll"/>
+    </popup>
+  </popupset>
 
   <hbox flex="1">
     <hbox align="start">
       <image id="info.icon" class="spaced"/>
     </hbox>
     
     <vbox flex="1" style="max-width: 45em;">
 #ifdef XP_MACOSX
 # On mac, we're exposing the dialog title inside the dialog
       <!-- Dialog title -->
       <description id="info.title" class="dialogTitle"/>
 #endif
       <!-- text -->
       <description id="info.header" class="header"/>
-      <vbox id="info.box" style="white-space: -moz-pre-wrap;">
-        <description/>
+      <vbox id="info.box">
+        <description context="contentAreaContextMenu"/>
       </vbox>
 
       <!-- textboxes -->
       <vbox id="loginContainer" hidden="true">
         <label id="loginLabel" value="&editfield0.label;" control="loginTextbox"/>
         <textbox id="loginTextbox"/>
         <separator class="thin"/>
       </vbox>
--- a/toolkit/content/jar.mn
+++ b/toolkit/content/jar.mn
@@ -12,16 +12,17 @@ toolkit.jar:
    content/global/plugins.html
    content/global/plugins.css
 *  content/global/debug.js                    (debug.js)
 +  content/global/buildconfig.html            (buildconfig.html)
 +  content/global/charsetOverlay.js           (charsetOverlay.js)
 +  content/global/charsetOverlay.xul          (charsetOverlay.xul)
 *+ content/global/commonDialog.js             (commonDialog.js)
 *+ content/global/commonDialog.xul            (commonDialog.xul)
+   content/global/commonDialog.css            (commonDialog.css)
 *  content/global/contentAreaUtils.js         (contentAreaUtils.js)
 *  content/global/customizeCharset.js         (customizeCharset.js)
 *  content/global/customizeCharset.xul        (customizeCharset.xul)
    content/global/customizeToolbar.css        (customizeToolbar.css)
 *  content/global/customizeToolbar.js         (customizeToolbar.js)
 *  content/global/customizeToolbar.xul        (customizeToolbar.xul)
 *+ content/global/editMenuOverlay.js          (editMenuOverlay.js)
 *+ content/global/editMenuOverlay.xul         (editMenuOverlay.xul)
--- a/toolkit/locales/en-US/chrome/global/commonDialog.dtd
+++ b/toolkit/locales/en-US/chrome/global/commonDialog.dtd
@@ -1,6 +1,10 @@
 <!ENTITY header.label     "Brief Title"> 
 <!ENTITY message.label    "Some sample Text goes here.">
 <!ENTITY editfield0.label "User Name:"> 
 <!ENTITY editfield1.label "Password:"> 
 <!ENTITY editfield2.label "Confirm Password:"> 
 <!ENTITY checkbox.label   "check">
+<!ENTITY copyCmd.label    "Copy">
+<!ENTITY copyCmd.accesskey "C">
+<!ENTITY selectAllCmd.label "Select All">
+<!ENTITY selectAllCmd.accesskey "A">