| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). | 4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). |
| 5 * Copyright (C) 2009 Joseph Pecoraro | 5 * Copyright (C) 2009 Joseph Pecoraro |
| 6 * | 6 * |
| 7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
| 8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
| 9 * are met: | 9 * are met: |
| 10 * | 10 * |
| (...skipping 1543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1554 apply(input.value); | 1554 apply(input.value); |
| 1555 } | 1555 } |
| 1556 | 1556 |
| 1557 /** | 1557 /** |
| 1558 * @param {!Event} event | 1558 * @param {!Event} event |
| 1559 */ | 1559 */ |
| 1560 function onKeyDown(event) { | 1560 function onKeyDown(event) { |
| 1561 if (isEnterKey(event)) { | 1561 if (isEnterKey(event)) { |
| 1562 if (validate(input.value)) | 1562 if (validate(input.value)) |
| 1563 apply(input.value); | 1563 apply(input.value); |
| 1564 event.preventDefault(); |
| 1564 return; | 1565 return; |
| 1565 } | 1566 } |
| 1566 | 1567 |
| 1567 if (!numeric) | 1568 if (!numeric) |
| 1568 return; | 1569 return; |
| 1569 | 1570 |
| 1570 var increment = event.key === 'ArrowUp' ? 1 : event.key === 'ArrowDown' ? -1
: 0; | 1571 var increment = event.key === 'ArrowUp' ? 1 : event.key === 'ArrowDown' ? -1
: 0; |
| 1571 if (!increment) | 1572 if (!increment) |
| 1572 return; | 1573 return; |
| 1573 if (event.shiftKey) | 1574 if (event.shiftKey) |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2071 */ | 2072 */ |
| 2072 constructor(message, okCallback, cancelCallback) { | 2073 constructor(message, okCallback, cancelCallback) { |
| 2073 super(true); | 2074 super(true); |
| 2074 this.registerRequiredCSS('ui/confirmDialog.css'); | 2075 this.registerRequiredCSS('ui/confirmDialog.css'); |
| 2075 this.contentElement.createChild('div', 'message').createChild('span').textCo
ntent = message; | 2076 this.contentElement.createChild('div', 'message').createChild('span').textCo
ntent = message; |
| 2076 var buttonsBar = this.contentElement.createChild('div', 'button'); | 2077 var buttonsBar = this.contentElement.createChild('div', 'button'); |
| 2077 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Ok'), okCallback
)); | 2078 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Ok'), okCallback
)); |
| 2078 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Cancel'), cancel
Callback)); | 2079 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Cancel'), cancel
Callback)); |
| 2079 } | 2080 } |
| 2080 }; | 2081 }; |
| OLD | NEW |