Hello nicolasroard,

I'd like you to do a code review.  Please execute
        g4 diff -c 8165079

or point your web browser to
        http://mondrian/8165079

to review the following code:

Change 8165079 by [EMAIL PROTECTED] on 2008/09/03 15:51:43 *pending*

        Improves wrapping of URL in permissions dialogs for WinCE.
        
        R=nicolasroard
        [EMAIL PROTECTED]
        DELTA=42  (4 added, 31 deleted, 7 changed)
        OCL=8165079

Affected files ...

... //depot/googleclient/gears/opensource/gears/ui/common/html_dialog.js#10 edit
... 
//depot/googleclient/gears/opensource/gears/ui/common/permissions_dialog.html_m4#2
 edit

42 delta lines: 4 added, 31 deleted, 7 changed

If you can't do the review, please let me know as soon as possible.  During
your review, please ensure that all new code has corresponding unit tests and
that existing unit tests are updated appropriately.  Visit
http://www/eng/code_review.html for more information.

This is a semiautomated message from "g4 mail".  Complaints or suggestions?
Mail [EMAIL PROTECTED]
Change 8165079 by [EMAIL PROTECTED] on 2008/09/03 15:51:43 *pending*

        Improves wrapping of URL in permissions dialogs for WinCE.

Affected files ...

... //depot/googleclient/gears/opensource/gears/ui/common/html_dialog.js#10 edit
... 
//depot/googleclient/gears/opensource/gears/ui/common/permissions_dialog.html_m4#2
 edit

==== //depot/googleclient/gears/opensource/gears/ui/common/html_dialog.js#10 - 
c:\MyDocs\Gears1/googleclient/gears/opensource/gears/ui/common/html_dialog.js 
====
# action=edit type=text
--- googleclient/gears/opensource/gears/ui/common/html_dialog.js        
2008-09-03 15:57:10.000000000 +0100
+++ googleclient/gears/opensource/gears/ui/common/html_dialog.js        
2008-09-03 15:50:36.000000000 +0100
@@ -279,43 +279,12 @@
     return str;
   }
 
-  var max = 20;
-  var url;
-  var scheme_start = str.indexOf("://");
-  var scheme = "";
-
-  if (scheme_start != -1) {
-    scheme = str.substring(0, scheme_start);
-    scheme += "://";
-    // there's automatically an hyphenation
-    // point used by the browser after http://
-    // so we only have to hyphenate the
-    // rest of the string
-    url = str.substring(scheme.length);
-  } else {
-    url = str;
-  }
-
-  // We hyphenate the string on every dot
-  var components = url.split(".");
-  if (components.length < 1) {
-    return str;
-  }
-
-  var content = components[0];
-  var len = content.length;
-  for (var i=1; i < components.length; i++) {
-    var elem = components[i];
-    content += ".";
-    len++;
-    if (len + elem.length > max) {
-      content += "<br>";
-      len = 0;
-    }
-    content += elem;
-    len += elem.length;
-  }
-  return scheme + content;
+  // Replace occurences of '.' with an image representing a dot. This allows 
the
+  // browser to wrap the URL at these points as if there were whitespace
+  // present.
+  var dot_image = "<img height='2px' width='2px' " +
+                  "style='background-color: black; margin: 0px 1px;'>";
+  return str.replace(/[.]/g, dot_image);
 }
 
 /**
==== 
//depot/googleclient/gears/opensource/gears/ui/common/permissions_dialog.html_m4#2
 - 
c:\MyDocs\Gears1/googleclient/gears/opensource/gears/ui/common/permissions_dialog.html_m4
 ====
# action=edit type=text
--- googleclient/gears/opensource/gears/ui/common/permissions_dialog.html_m4    
2008-09-03 15:57:10.000000000 +0100
+++ googleclient/gears/opensource/gears/ui/common/permissions_dialog.html_m4    
2008-09-03 15:51:19.000000000 +0100
@@ -463,7 +463,11 @@
     } else {
       elem = dom.getElementById("origin");
       elem.style.display = "block";
-      setTextContent(elem, origin);
+      if (browser.ie_mobile) {
+        elem.innerHTML = wrapDomain(origin);
+      } else {
+        setTextContent(elem, origin);
+      }
     }
 
     if (customIcon) {

Reply via email to