Hello playmobil, andreip,
I'd like you to do a code review. Please execute
g4 diff -c 10035225
or point your web browser to
http://mondrian/10035225
to review the following code:
Change 10035225 by stevebl...@steveblock-gears2 on 2009/02/06 13:43:20 *pending*
Wraps long names in shortcuts dialog in Chrome.
This is a fix for bug http://crbug.com/4611.
R=playmobil,andreip
[email protected]
DELTA=16 (15 added, 0 deleted, 1 changed)
OCL=10035225
Affected files ...
...
//depot/googleclient/gears/opensource/gears/ui/common/shortcuts_dialog.html_m4#10
edit
16 delta lines: 15 added, 0 deleted, 1 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 10035225 by stevebl...@steveblock-gears2 on 2009/02/06 13:43:20 *pending*
Wraps long names in shortcuts dialog in Chrome.
This is a fix for bug http://crbug.com/4611.
Affected files ...
...
//depot/googleclient/gears/opensource/gears/ui/common/shortcuts_dialog.html_m4#10
edit
====
//depot/googleclient/gears/opensource/gears/ui/common/shortcuts_dialog.html_m4#10
-
c:\MyDocs\Gears2/googleclient/gears/opensource/gears/ui/common/shortcuts_dialog.html_m4
====
# action=edit type=text
--- googleclient/gears/opensource/gears/ui/common/shortcuts_dialog.html_m4
2009-02-10 11:57:39.000000000 +0000
+++ googleclient/gears/opensource/gears/ui/common/shortcuts_dialog.html_m4
2009-02-10 11:54:15.000000000 +0000
@@ -366,7 +366,22 @@
var descriptionElement = dom.getElementById("shortcut-description");
loadImage(iconElement, pickIconToRender(shortcutData));
- dom.setTextContent(nameElement, shortcutData.name);
+
+ if (browser.chrome) {
+ // Chrome generates very long, single word shortcut names. We allow the
+ // name to break on '_'.
+ var token = '_';
+ var chunks = shortcutData.name.split(token);
+ for (var i = 0; i < chunks.length - 1; i++) {
+ // Add the text using createTextNode since name is supplied by user.
+ nameElement.appendChild(document.createTextNode(chunks[i] + token));
+ nameElement.appendChild(document.createElement('wbr'));
+ }
+ nameElement.appendChild(
+ document.createTextNode(chunks[chunks.length - 1]));
+ } else {
+ dom.setTextContent(nameElement, shortcutData.name);
+ }
if (isDefined(typeof shortcutData.description) &&
shortcutData.description) {