| 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 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1524 __proto__: HTMLLabelElement.prototype | 1524 __proto__: HTMLLabelElement.prototype |
| 1525 }); | 1525 }); |
| 1526 | 1526 |
| 1527 UI.registerCustomElement('div', 'dt-close-button', { | 1527 UI.registerCustomElement('div', 'dt-close-button', { |
| 1528 /** | 1528 /** |
| 1529 * @this {Element} | 1529 * @this {Element} |
| 1530 */ | 1530 */ |
| 1531 createdCallback: function() { | 1531 createdCallback: function() { |
| 1532 var root = UI.createShadowRootWithCoreStyles(this, 'ui/closeButton.css'); | 1532 var root = UI.createShadowRootWithCoreStyles(this, 'ui/closeButton.css'); |
| 1533 this._buttonElement = root.createChild('div', 'close-button'); | 1533 this._buttonElement = root.createChild('div', 'close-button'); |
| 1534 var regularIcon = UI.Icon.create('smallicon-cross', 'default-icon'); |
| 1535 this._hoverIcon = UI.Icon.create('smallicon-red-cross-hover', 'hover-icon'
); |
| 1536 this._activeIcon = UI.Icon.create('smallicon-red-cross-active', 'active-ic
on'); |
| 1537 this._buttonElement.appendChild(regularIcon); |
| 1538 this._buttonElement.appendChild(this._hoverIcon); |
| 1539 this._buttonElement.appendChild(this._activeIcon); |
| 1534 }, | 1540 }, |
| 1535 | 1541 |
| 1536 /** | 1542 /** |
| 1537 * @param {boolean} gray | 1543 * @param {boolean} gray |
| 1538 * @this {Element} | 1544 * @this {Element} |
| 1539 */ | 1545 */ |
| 1540 set gray(gray) { | 1546 set gray(gray) { |
| 1541 this._buttonElement.className = gray ? 'close-button-gray' : 'close-button
'; | 1547 if (gray) { |
| 1548 this._hoverIcon.setIconType('smallicon-gray-cross-hover'); |
| 1549 this._activeIcon.setIconType('smallicon-gray-cross-active'); |
| 1550 } else { |
| 1551 this._hoverIcon.setIconType('smallicon-red-cross-hover'); |
| 1552 this._activeIcon.setIconType('smallicon-red-cross-active'); |
| 1553 } |
| 1542 }, | 1554 }, |
| 1543 | 1555 |
| 1544 __proto__: HTMLDivElement.prototype | 1556 __proto__: HTMLDivElement.prototype |
| 1545 }); | 1557 }); |
| 1546 })(); | 1558 })(); |
| 1547 | 1559 |
| 1548 /** | 1560 /** |
| 1549 * @param {!Element} input | 1561 * @param {!Element} input |
| 1550 * @param {function(string)} apply | 1562 * @param {function(string)} apply |
| 1551 * @param {function(string):boolean} validate | 1563 * @param {function(string):boolean} validate |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2077 */ | 2089 */ |
| 2078 constructor(message, okCallback, cancelCallback) { | 2090 constructor(message, okCallback, cancelCallback) { |
| 2079 super(true); | 2091 super(true); |
| 2080 this.registerRequiredCSS('ui/confirmDialog.css'); | 2092 this.registerRequiredCSS('ui/confirmDialog.css'); |
| 2081 this.contentElement.createChild('div', 'message').createChild('span').textCo
ntent = message; | 2093 this.contentElement.createChild('div', 'message').createChild('span').textCo
ntent = message; |
| 2082 var buttonsBar = this.contentElement.createChild('div', 'button'); | 2094 var buttonsBar = this.contentElement.createChild('div', 'button'); |
| 2083 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Ok'), okCallback
)); | 2095 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Ok'), okCallback
)); |
| 2084 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Cancel'), cancel
Callback)); | 2096 buttonsBar.appendChild(UI.createTextButton(Common.UIString('Cancel'), cancel
Callback)); |
| 2085 } | 2097 } |
| 2086 }; | 2098 }; |
| OLD | NEW |