View Issue Details

IDProjectCategoryView StatusLast Update
0000864SOGoWeb Generalpublic2010-10-08 20:58
ReporterJason Oster Assigned Tofrancis  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.3.2 
Target Version1.3.3Fixed in Version1.3.3 
Summary0000864: CTRL + A (select all) does not work on Firefox
Description

CTRL + A (select all) is listed in the ChangeLog for version 1.3.2, but is broken in Firefox (all versions as far as I can tell, but definitely in 3.6 and 4.0 beta).

The problem is that Firefox does not give an Event.keyCode for "character keys" on keypress events. See: http://www.quirksmode.org/js/keys.html

Additional Information

Attached a patch (against MTN trunk) that solves this bug.

TagsNo tags attached.

Activities

2010-09-27 18:36

 

SOGo-fix_ctrl_a.patch (2,059 bytes)   
#
# old_revision [76f86549bcd89f2910a9950d2994fe356548ba8b]
#
# patch "UI/WebServerResources/MailerUI.js"
#  from [ac91c2a7ce631c726192bf3cf24c447921b4cbc4]
#    to [7929a9f1fa3d4e60c11802654134e924d57095c5]
#
============================================================
--- UI/WebServerResources/MailerUI.js	ac91c2a7ce631c726192bf3cf24c447921b4cbc4
+++ UI/WebServerResources/MailerUI.js	7929a9f1fa3d4e60c11802654134e924d57095c5
@@ -317,19 +317,27 @@ function onDocumentKeydown(event) {
 }

 function onDocumentKeydown(event) {
+    var keyCode = event.keyCode;
+    if (!keyCode) {
+        keyCode = event.charCode;
+        if (keyCode == "a".charCodeAt(0)) {
+            keyCode = "A".charCodeAt(0);
+        }
+    }
+
     var target = Event.element(event);
     if (target.tagName != "INPUT") {
-	if (event.keyCode == Event.KEY_DELETE ||
-            event.keyCode == Event.KEY_BACKSPACE && isMac()) {
+	if (keyCode == Event.KEY_DELETE ||
+            keyCode == Event.KEY_BACKSPACE && isMac()) {
             deleteSelectedMessages();
             Event.stop(event);
         }
-	else if (event.keyCode == Event.KEY_DOWN ||
-                 event.keyCode == Event.KEY_UP) {
+	else if (keyCode == Event.KEY_DOWN ||
+                 keyCode == Event.KEY_UP) {
             if (Mailer.currentMessages[Mailer.currentMailbox]) {
                 var row = $("row_" + Mailer.currentMessages[Mailer.currentMailbox]);
                 var nextRow;
-                if (event.keyCode == Event.KEY_DOWN)
+                if (keyCode == Event.KEY_DOWN)
                     nextRow = row.next("tr");
                 else
                     nextRow = row.previous("tr");
@@ -358,7 +366,7 @@ function onDocumentKeydown(event) {
             }
         }
 	else if (((isMac() && event.metaKey == 1) || (!isMac() && event.ctrlKey == 1))
-                 && event.keyCode == 65) {  // Ctrl-A
+                 && keyCode == "A".charCodeAt(0)) {  // Ctrl-A
             $("messageListBody").down("TBODY").selectAll();
             Event.stop(event);
         }
SOGo-fix_ctrl_a.patch (2,059 bytes)   
francis

francis

2010-10-08 20:58

administrator   ~0001590

Thanks for the patch. I also fixed the other modules.

Revision f02a11f1e1e720bc3a1a26a301b2b216d5335eb9.

Issue History

Date Modified Username Field Change
2010-09-27 18:36 Jason Oster New Issue
2010-09-27 18:36 Jason Oster File Added: SOGo-fix_ctrl_a.patch
2010-09-28 14:13 francis Status new => assigned
2010-09-28 14:13 francis Assigned To => francis
2010-10-07 14:15 francis Target Version => 1.3.3
2010-10-08 20:58 francis Note Added: 0001590
2010-10-08 20:58 francis Status assigned => resolved
2010-10-08 20:58 francis Fixed in Version => 1.3.3
2010-10-08 20:58 francis Resolution open => fixed