Debian Codegraph @

closure-library/closure/goog/demos/container.html

raw
1 <!DOCTYPE html>
2 <html>
3 <!--
4 Copyright 2010 The Closure Library Authors. All Rights Reserved.
5
6 Use of this source code is governed by the Apache License, Version 2.0.
7 See the COPYING file for details.
8 -->
9 <head>
10 <title>goog.ui.Container</title>
11 <script src="../base.js"></script>
12 <script>
13 goog.require('goog.array');
14 goog.require('goog.debug.DivConsole');
15 goog.require('goog.debug.LogManager');
16 goog.require('goog.dom');
17 goog.require('goog.events');
18 goog.require('goog.events.EventType');
19 goog.require('goog.log');
20 goog.require('goog.object');
21 goog.require('goog.style');
22 goog.require('goog.ui.Container');
23 goog.require('goog.ui.ContainerScroller');
24 goog.require('goog.ui.Control');
25 goog.require('goog.ui.CustomButton');
26 goog.require('goog.ui.Menu');
27 goog.require('goog.ui.MenuButton');
28 goog.require('goog.ui.Option');
29 goog.require('goog.ui.Select');
30 goog.require('goog.ui.Separator');
31 goog.require('goog.ui.ToggleButton');
32 goog.require('goog.dom.TagName');
33 </script>
34 <link rel="stylesheet" href="css/demo.css">
35 <link rel="stylesheet" href="../css/button.css">
36 <link rel="stylesheet" href="../css/menubutton.css">
37 <style>
38 /* Demo styles for goog.ui.Control. */
39 .goog-control {
40 position: relative;
41 margin: 2px;
42 border: 2px solid #036;
43 padding: 2px;
44 font: normal 9pt "Trebuchet MS", Tahoma, Arial, sans-serif;
45 color: #036;
46 background-color:#69c;
47 cursor: pointer;
48 outline: none !important;
49 }
50
51 .goog-control-disabled {
52 border-color: #888;
53 color: #888;
54 background-color: #ccc;
55 }
56
57 .goog-control-hover {
58 border-color: #369;
59 color: #369;
60 background-color: #9cf;
61 }
62
63 .goog-control-active,
64 .goog-control-selected,
65 .goog-control-checked {
66 border-color: #9cf;
67 color: #9cf;
68 background-color: #369;
69 }
70
71 .goog-control-focused {
72 border-color: orange;
73 }
74
75 /* Demo styles for goog.ui.Container */
76 .goog-container {
77 position: relative;
78 margin: 0;
79 border: 0;
80 padding: 0;
81 background-color: #eee;
82 outline: none !important;
83 zoom: 1; /* The container element must have layout on IE. */
84 }
85
86 .goog-container-vertical {
87 width: 25ex;
88 border: 1px solid #888;
89 }
90
91 .goog-container-horizontal {
92 border-bottom: 1px solid #d5d5d5;
93 background: #fafafa url(../images/toolbar-bg.png) repeat-x bottom left;
94 }
95
96 /* Additional demo styles. */
97
98 .goog-month .goog-menu-button-caption {
99 width: 18ex;
100 }
101
102 .goog-year .goog-menu-button-caption {
103 width: 6ex;
104 }
105
106 .goog-edit-font .goog-menu-button-caption {
107 width: 15ex;
108 }
109
110 .goog-edit-font-size .goog-menu-button-caption {
111 width: 5ex;
112 }
113
114 .goog-edit-bold {
115 width: 14px;
116 background: url(../images/toolbar_icons.gif) no-repeat -1px;
117 }
118
119 .goog-edit-italic {
120 width: 14px;
121 background: url(../images/toolbar_icons.gif) no-repeat -17px;
122 }
123
124 .goog-edit-underline {
125 width: 14px;
126 background: url(../images/toolbar_icons.gif) no-repeat -33px;
127 }
128
129 #tb4_highlight_links span {
130 border: 1px solid #888;
131 cursor: pointer;
132 padding: 2px 4px;
133 }
134 </style>
135 </head>
136 <body>
137 <h2>goog.ui.Container</h2>
138 <p><b>goog.ui.Container</b> is a base class for menus and toolbars.</p>
139 <fieldset>
140 <legend>These containers were created programmatically:</legend>
141 <table border="0" cellpadding="8" cellspacing="0" width="100%">
142 <tbody>
143 <tr valign="top">
144 <td width="50%" id="vc">
145 Vertical container example:
146 </td>
147 <td width="50%" id="hc">
148 Horizontal container example:
149 </td>
150 </tr>
151 <tr valign="top">
152 <td>
153 <label>
154 Show vertical container:
155 <input type="checkbox" id="show_vc" checked>
156 </label>
157 &nbsp;
158 <label>
159 Enable vertical container:
160 <input type="checkbox" id="enable_vc" checked>
161 </label>
162 <br>
163 <label>
164 Show Porthos:
165 <input type="checkbox" id="show_porthos" checked>
166 </label>
167 &nbsp;
168 <label>
169 Enable Porthos:
170 <input type="checkbox" id="enable_porthos">
171 </label>
172 <br>
173 <label>
174 Enable transition events:
175 <input type="checkbox" id="enable_vc_events" checked>
176 </label>
177 </td>
178 <td>
179 <label>
180 Show horizontal container:
181 <input type="checkbox" id="show_hc" checked>
182 </label>
183 &nbsp;
184 <label>
185 Enable horizontal container:
186 <input type="checkbox" id="enable_hc" checked>
187 </label>
188 <br>
189 <label>
190 Show Doc:
191 <input type="checkbox" id="show_doc" checked>
192 </label>
193 &nbsp;
194 <label>
195 Enable Doc:
196 <input type="checkbox" id="enable_doc">
197 </label>
198 <br>
199 <label>
200 Enable transition events:
201 <input type="checkbox" id="enable_hc_events" checked>
202 </label>
203 </td>
204 </tr>
205 </tbody>
206 </table>
207 <span class="hint">Try enabling and disabling containers with &amp; without
208 state transition events, and compare performance!</span>
209 </fieldset>
210 <br>
211 <br>
212 <fieldset>
213 <legend>Non-focusable container with focusable controls:</legend>
214 In this case, the container itself isn't focusable, but each control is:<br>
215 <div id="nfc"></div>
216 </fieldset>
217 <br>
218 <br>
219 <fieldset>
220 <legend>Another horizontal container:</legend>
221 <label>
222 This is starting to look useful... Enable toolbar:
223 <input type="checkbox" id="enable_tb" checked>
224 </label>
225 <div id="tb"></div>
226 </fieldset>
227 <br>
228 <br>
229 <fieldset>
230 <legend>A decorated container:</legend>
231 <label>
232 It's much easier to decorate than to create programmatically...
233 Enable decorated toolbar:
234 <input type="checkbox" id="enable_tb2">
235 </label>
236 <div id="tb2" class="goog-container-horizontal goog-container-disabled">
237 <div id="month" class="goog-month goog-select">
238 Select month
239 <div class="goog-menu">
240 <div class="goog-option">January</div>
241 <div class="goog-option">February</div>
242 <div class="goog-option">March</div>
243 <div class="goog-option">April</div>
244 <div class="goog-option">May</div>
245 <div class="goog-option">June</div>
246 <div class="goog-option">July</div>
247 <div class="goog-option">August</div>
248 <div class="goog-option">September</div>
249 <div class="goog-option">October</div>
250 <div class="goog-option">November</div>
251 <div class="goog-option">December</div>
252 </div>
253 </div>
254 <div id="year" class="goog-year goog-select">
255 Year
256 <div class="goog-menu">
257 <div class="goog-option">2001</div>
258 <div class="goog-option">2002</div>
259 <div class="goog-option">2003</div>
260 <div class="goog-option">2004</div>
261 <div class="goog-option">2005</div>
262 <div class="goog-option">2006</div>
263 <div class="goog-option">2007</div>
264 <div class="goog-option">2008</div>
265 <div class="goog-option">2009</div>
266 <div class="goog-option">2010</div>
267 </div>
268 </div>
269 <div id="foo" class="goog-toggle-button">
270 Toggle Button
271 </div>
272 <div id="bar" class="goog-toggle-button">
273 <div><b><i>Fancy</i></b> Toggle Button</div>
274 </div>
275 <div id="fee" class="goog-toggle-button">
276 Another Button
277 </div>
278 </div>
279 </fieldset>
280 <br>
281 <br>
282 <fieldset>
283 <legend>The same container, right-to-left:</legend>
284 <label>
285 Show right-to-left toolbar:
286 <input type="checkbox" id="show_tb3" checked>
287 </label>
288 <label>
289 Enable right-to-left toolbar:
290 <input type="checkbox" id="enable_tb3">
291 </label>
292 <div id="tb3" class="goog-container-horizontal goog-container-disabled"
293 dir="rtl">
294 <div class="goog-month goog-select">
295 Select month
296 <div class="goog-menu" dir="rtl">
297 <div class="goog-option">January</div>
298 <div class="goog-option">February</div>
299 <div class="goog-option">March</div>
300 <div class="goog-option">April</div>
301 <div class="goog-option">May</div>
302 <div class="goog-option">June</div>
303 <div class="goog-option">July</div>
304 <div class="goog-option">August</div>
305 <div class="goog-option">September</div>
306 <div class="goog-option">October</div>
307 <div class="goog-option">November</div>
308 <div class="goog-option">December</div>
309 </div>
310 </div>
311 <div class="goog-year goog-select" dir="rtl">
312 Year
313 <div class="goog-menu">
314 <div class="goog-option">2001</div>
315 <div class="goog-option">2002</div>
316 <div class="goog-option">2003</div>
317 <div class="goog-option">2004</div>
318 <div class="goog-option">2005</div>
319 <div class="goog-option">2006</div>
320 <div class="goog-option">2007</div>
321 <div class="goog-option">2008</div>
322 <div class="goog-option">2009</div>
323 <div class="goog-option">2010</div>
324 </div>
325 </div>
326 <div class="goog-toggle-button">
327 Toggle Button
328 </div>
329 <div class="goog-toggle-button">
330 <div><b><i>Fancy</i></b> Toggle Button</div>
331 </div>
332 <div class="goog-toggle-button">
333 Another Button
334 </div>
335 </div>
336 </fieldset>
337 <br>
338 <br>
339 <fieldset>
340 <legend>A scrolling container:</legend>
341 <label>
342 This container scrolls so that the highlighted item is visible.
343 Here's a mix of block items and inline block items, which both work.
344 </label>
345 <p>
346 Put focus in the text box and use the arrow keys:
347 <input id="tb4_key_target">
348 </p>
349 <p>
350 Or quick jump to item:
351 <span id="tb4_highlight_links">
352 <span>0</span> <span>1</span> <span>2</span> <span>3</span>
353 <span>4</span> <span>5</span> <span>6</span> <span>7</span>
354 <span>8</span> <span>9</span> <span>10</span> <span>11</span>
355 <span>12</span> <span>13</span> <span>14</span> <span>15</span>
356 </span>
357 </p>
358 <div id="tb4" class="goog-container-vertical"
359 style="height: 100px; overflow-y: scroll">
360 <div class="goog-month goog-menuitem">menuitem 0</div>
361 <div class="goog-month goog-menuitem">menuitem 1</div>
362 <div class="goog-month goog-menuitem">menuitem 2</div>
363 <div class="goog-month goog-menuitem">menuitem 3</div>
364 <div class="goog-month goog-toggle-button">tog 4</div>
365 <div class="goog-month goog-toggle-button">tog 5</div>
366 <div class="goog-month goog-toggle-button">tog 6</div>
367 <div class="goog-month goog-toggle-button">toggley 7</div>
368 <div class="goog-month goog-toggle-button">toggley 8</div>
369 <div class="goog-month goog-toggle-button">toggley 9</div>
370 <div class="goog-month goog-toggle-button">toggley 10</div>
371 <div class="goog-month goog-toggle-button">toggley 11</div>
372 <div class="goog-month goog-toggle-button">toggley 12</div>
373 <div class="goog-month goog-toggle-button">toggley 13</div>
374 <div class="goog-month goog-menuitem">menuitem 14</div>
375 <div class="goog-month goog-menuitem">menuitem 15</div>
376 </div>
377 </fieldset>
378 <br>
379 <br>
380 <!-- Event log. -->
381 <fieldset class="goog-debug-panel">
382 <legend>Event Log</legend>
383 <div id="log"></div>
384 </fieldset>
385 <div id="perf"></div>
386 <script>
387 var timer = goog.now();
388
389 // Set up a logger.
390 goog.debug.LogManager.getRoot().setLevel(goog.log.Level.ALL);
391 var logger = goog.log.getLogger('demo');
392 var logconsole = new goog.debug.DivConsole(goog.dom.getElement('log'));
393 logconsole.setCapturing(true);
394
395 var EVENTS = goog.object.getValues(goog.ui.Component.EventType);
396 goog.log.fine(logger, 'Listening for: ' + EVENTS.join(', ') + '.');
397
398 function logEvent(e) {
399 var source =
400 typeof e.target.getCaption == 'function' && e.target.getCaption() ||
401 e.target.getId();
402 goog.log.info(logger, '"' + source + '" dispatched: ' + e.type);
403 }
404
405 // Programmatically create a vertical container.
406 var vc = new goog.ui.Container();
407 vc.setId('Vertical Container');
408 goog.array.forEach(
409 ['Athos', 'Porthos', 'Aramis', 'd\'Artagnan'],
410 function(item) {
411 var c = new goog.ui.Control(item);
412 c.setId(item);
413 // For demo purposes, have controls dispatch transition events.
414 c.setDispatchTransitionEvents(goog.ui.Component.State.ALL, true);
415 vc.addChild(c, true);
416 });
417 vc.addChildAt(new goog.ui.Separator(), 3, true);
418 vc.getChild('Porthos').setEnabled(false);
419 vc.render(goog.dom.getElement('vc'));
420 goog.events.listen(vc, EVENTS, logEvent);
421
422 // Hook up checkboxes.
423 goog.events.listen(goog.dom.getElement('show_vc'),
424 goog.events.EventType.CLICK,
425 function(e) {
426 var t = goog.now();
427 vc.setVisible(e.target.checked);
428 goog.log.info(logger, (e.target.checked ? 'Showed' : 'Hid') +
429 ' vertical container in ' + (goog.now() - t) + 'ms');
430 });
431 goog.events.listen(goog.dom.getElement('enable_vc'),
432 goog.events.EventType.CLICK,
433 function(e) {
434 var t = goog.now();
435 vc.setEnabled(e.target.checked);
436 // If the container as a whole is disabled, you can't enable/disable
437 // child controls.
438 goog.dom.getElement('enable_porthos').disabled = !vc.isEnabled();
439 goog.log.info(logger, (e.target.checked ? 'Enabled' : 'Disabled') +
440 ' vertical container in ' + (goog.now() - t) + 'ms');
441 });
442 goog.events.listen(goog.dom.getElement('show_porthos'),
443 goog.events.EventType.CLICK,
444 function(e) {
445 vc.getChild('Porthos').setVisible(e.target.checked);
446 });
447 goog.events.listen(goog.dom.getElement('enable_porthos'),
448 goog.events.EventType.CLICK,
449 function(e) {
450 vc.getChild('Porthos').setEnabled(e.target.checked);
451 });
452 goog.events.listen(goog.dom.getElement('enable_vc_events'),
453 goog.events.EventType.CLICK,
454 function(e) {
455 vc.forEachChild(function(c) {
456 if (e.target.checked) {
457 // Enable all transition events.
458 c.setDispatchTransitionEvents(goog.ui.Component.State.ALL, true);
459 } else {
460 // Disable all transition events (except for HOVER, which is used
461 // by containers internally).
462 c.setDispatchTransitionEvents(goog.ui.Component.State.ALL, false);
463 c.setDispatchTransitionEvents(goog.ui.Component.State.HOVER,
464 true);
465 }
466 });
467 goog.log.info(logger, (e.target.checked ? 'Enabled' : 'Disabled') +
468 ' state transition events for this container\'s children');
469 });
470
471 // Programmatically create a horizontal container.
472 var hc = new goog.ui.Container(goog.ui.Container.Orientation.HORIZONTAL);
473 hc.setId('Horizontal Container');
474
475 // Pre-render the container, just to do something different.
476 hc.render(goog.dom.getElement('hc'));
477 goog.array.forEach(
478 ['Happy', 'Sleepy', 'Doc', 'Bashful', 'Sneezy', 'Grumpy', 'Dopey'],
479 function(item) {
480 var c = new goog.ui.Control(item);
481 c.addClassName('goog-inline-block');
482 c.setId(item);
483 // For demo purposes, have controls dispatch transition events.
484 c.setDispatchTransitionEvents(goog.ui.Component.State.ALL, true);
485 hc.addChild(c, true);
486 });
487 hc.getChild('Doc').setEnabled(false);
488 goog.events.listen(hc, EVENTS, logEvent);
489
490 // Hook up checkboxes.
491 goog.events.listen(goog.dom.getElement('show_hc'),
492 goog.events.EventType.CLICK,
493 function(e) {
494 var t = goog.now();
495 hc.setVisible(e.target.checked);
496 goog.log.info(logger, (e.target.checked ? 'Showed' : 'Hid') +
497 ' horizontal container in ' + (goog.now() - t) + 'ms');
498 });
499 goog.events.listen(goog.dom.getElement('enable_hc'),
500 goog.events.EventType.CLICK,
501 function(e) {
502 var t = goog.now();
503 hc.setEnabled(e.target.checked);
504 // If the container as a whole is disabled, you can't enable/disable
505 // child controls.
506 goog.dom.getElement('enable_doc').disabled = !hc.isEnabled();
507 goog.log.info(logger, (e.target.checked ? 'Enabled' : 'Disabled') +
508 ' horizontal container in ' + (goog.now() - t) + 'ms');
509 });
510 goog.events.listen(goog.dom.getElement('show_doc'),
511 goog.events.EventType.CLICK,
512 function(e) {
513 hc.getChild('Doc').setVisible(e.target.checked);
514 });
515 goog.events.listen(goog.dom.getElement('enable_doc'),
516 goog.events.EventType.CLICK,
517 function(e) {
518 hc.getChild('Doc').setEnabled(e.target.checked);
519 });
520 goog.events.listen(goog.dom.getElement('enable_hc_events'),
521 goog.events.EventType.CLICK,
522 function(e) {
523 hc.forEachChild(function(c) {
524 if (e.target.checked) {
525 // Enable all transition events.
526 c.setDispatchTransitionEvents(goog.ui.Component.State.ALL, true);
527 } else {
528 // Disable all transition events (except for HOVER, which is used
529 // by containers internally).
530 c.setDispatchTransitionEvents(goog.ui.Component.State.ALL, false);
531 c.setDispatchTransitionEvents(goog.ui.Component.State.HOVER,
532 true);
533 }
534 });
535 goog.log.info(logger, (e.target.checked ? 'Enabled' : 'Disabled') +
536 ' state transition events for this container\'s children');
537 });
538
539 // Programmatically create a non-focusable container.
540 var nfc = new goog.ui.Container(goog.ui.Container.Orientation.HORIZONTAL);
541 nfc.setId('NonFocusableContainer');
542 nfc.setFocusable(false);
543 goog.array.forEach(['Vicky', 'Cristina', 'Barcelona'], function(item) {
544 var c = new goog.ui.Control(item);
545 c.setId(item);
546 c.addClassName('goog-inline-block');
547 // For demo purposes, have controls dispatch transition events.
548 c.setDispatchTransitionEvents(goog.ui.Component.State.ALL, true);
549 nfc.addChild(c, /* opt_render */ true);
550 // Since the container itself is non-focusable, we need to make each
551 // child individually focusable; this has to happen *after* addChild().
552 // See e.g. bug http://b/1359754.
553 c.setSupportedState(goog.ui.Component.State.FOCUSED, true);
554 });
555 nfc.render(goog.dom.getElement('nfc'));
556 goog.events.listen(nfc, EVENTS, logEvent);
557
558 // Programmatically create a toolbar.
559 var tb = new goog.ui.Container(goog.ui.Container.Orientation.HORIZONTAL);
560 tb.setId('Toolbar');
561
562 // Programmatically create & add toolbar items.
563 var fontMenu = new goog.ui.Select('Select font');
564 fontMenu.setId('Font Menu');
565 fontMenu.setTooltip('Font');
566 fontMenu.addItem(new goog.ui.Option('Arial', 'Arial, sans-serif'));
567 fontMenu.addItem(new goog.ui.Option('Courier', 'Courier, monospace'));
568 fontMenu.addItem(new goog.ui.Option('Times', 'Times, serif'));
569 fontMenu.addClassName('goog-edit-font');
570 tb.addChild(fontMenu, true);
571
572 var sizeMenu = new goog.ui.Select(null);
573 sizeMenu.setId('Font Size Menu');
574 sizeMenu.setTooltip('Font Size');
575 sizeMenu.addItem(new goog.ui.Option('8pt'));
576 sizeMenu.addItem(new goog.ui.Option('10pt'));
577 sizeMenu.addItem(new goog.ui.Option('12pt'));
578 sizeMenu.addItem(new goog.ui.Option('16pt'));
579 sizeMenu.setSelectedIndex(1);
580 sizeMenu.addClassName('goog-edit-font-size');
581 tb.addChild(sizeMenu, true);
582
583 var boldButton = new goog.ui.ToggleButton(goog.dom.createDom(goog.dom.TagName.DIV,
584 'goog-edit-bold', '\u00A0'));
585 boldButton.setId('Bold Button');
586 boldButton.setTooltip('Bold');
587 tb.addChild(boldButton, true);
588
589 var italicButton = new goog.ui.ToggleButton(goog.dom.createDom(goog.dom.TagName.DIV,
590 'goog-edit-italic', '\u00A0'));
591 italicButton.setId('Italic Button');
592 italicButton.setTooltip('Italic');
593 tb.addChild(italicButton, true);
594
595 var underlineButton = new goog.ui.ToggleButton(goog.dom.createDom(goog.dom.TagName.DIV,
596 'goog-edit-underline', '\u00A0'));
597 underlineButton.setId('Underline Button');
598 underlineButton.setTooltip('Underline');
599 tb.addChild(underlineButton, true);
600
601 tb.render(goog.dom.getElement('tb'));
602 goog.events.listen(tb, EVENTS, logEvent);
603
604 // Hook up checkbox.
605 goog.events.listen(goog.dom.getElement('enable_tb'),
606 goog.events.EventType.CLICK,
607 function(e) {
608 var t = goog.now();
609 tb.setEnabled(e.target.checked);
610 goog.log.info(logger, (e.target.checked ? 'Enabled' : 'Disabled') +
611 ' toolbar in ' + (goog.now() - t) + 'ms');
612 });
613
614 var tb2 = new goog.ui.Container();
615 tb2.decorate(goog.dom.getElement('tb2'));
616 goog.events.listen(tb2, EVENTS, logEvent);
617
618 // Hook up checkbox.
619 goog.events.listen(goog.dom.getElement('enable_tb2'),
620 goog.events.EventType.CLICK,
621 function(e) {
622 var t = goog.now();
623 tb2.setEnabled(e.target.checked);
624 goog.log.info(logger, (e.target.checked ? 'Enabled' : 'Disabled') +
625 ' toolbar in ' + (goog.now() - t) + 'ms');
626 });
627
628 // BiDi container example:
629 var tb3 = new goog.ui.Container();
630 tb3.decorate(goog.dom.getElement('tb3'));
631 goog.events.listen(tb3, EVENTS, logEvent);
632
633 // Hook up checkboxes.
634 goog.events.listen(goog.dom.getElement('enable_tb3'),
635 goog.events.EventType.CLICK,
636 function(e) {
637 var t = goog.now();
638 tb3.setEnabled(e.target.checked);
639 goog.log.info(logger, (e.target.checked ? 'Enabled' : 'Disabled') +
640 ' toolbar in ' + (goog.now() - t) + 'ms');
641 });
642 goog.events.listen(goog.dom.getElement('show_tb3'),
643 goog.events.EventType.CLICK,
644 function(e) {
645 var t = goog.now();
646 tb3.setVisible(e.target.checked);
647 goog.log.info(logger, (e.target.checked ? 'Showed' : 'Hid') +
648 ' content element in ' + (goog.now() - t) + 'ms');
649 });
650
651 // Scrolling container.
652 var tb4 = new goog.ui.Container();
653 tb4.decorate(goog.dom.getElement('tb4'));
654 tb4.setKeyEventTarget(goog.dom.getElement('tb4_key_target'));
655 tb4.setFocusable(true);
656 new goog.ui.ContainerScroller(tb4);
657
658 goog.events.listen(goog.dom.getElement('tb4_highlight_links'),
659 goog.events.EventType.CLICK,
660 function(event) {
661 var index = parseInt(event.target.innerHTML, 10);
662 if (!isNaN(index)) {
663 tb4.getChildAt(index).setHighlighted(true);
664 }
665 });
666
667 goog.dom.setTextContent(goog.dom.getElement('perf'),
668 (goog.now() - timer) + 'ms');
669 </script>
670 </body>
671 </html>