| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 this._mouseDownTreeElement = null; | 49 this._mouseDownTreeElement = null; |
| 50 this._mouseDownTreeElementIsName = false; | 50 this._mouseDownTreeElementIsName = false; |
| 51 this._mouseDownTreeElementIsValue = false; | 51 this._mouseDownTreeElementIsValue = false; |
| 52 | 52 |
| 53 this.element.classList.add('styles-pane'); | 53 this.element.classList.add('styles-pane'); |
| 54 | 54 |
| 55 /** @type {!Array<!Elements.SectionBlock>} */ | 55 /** @type {!Array<!Elements.SectionBlock>} */ |
| 56 this._sectionBlocks = []; | 56 this._sectionBlocks = []; |
| 57 Elements.StylesSidebarPane._instance = this; | 57 Elements.StylesSidebarPane._instance = this; |
| 58 UI.context.addFlavorChangeListener(SDK.DOMNode, this.forceUpdate, this); | 58 UI.context.addFlavorChangeListener(SDK.DOMNode, this.forceUpdate, this); |
| 59 this.element.addEventListener('copy', this._clipboardCopy.bind(this)); |
| 59 } | 60 } |
| 60 | 61 |
| 61 /** | 62 /** |
| 62 * @param {!SDK.CSSProperty} property | 63 * @param {!SDK.CSSProperty} property |
| 63 * @return {!Element} | 64 * @return {!Element} |
| 64 */ | 65 */ |
| 65 static createExclamationMark(property) { | 66 static createExclamationMark(property) { |
| 66 var exclamationElement = createElement('label', 'dt-icon-label'); | 67 var exclamationElement = createElement('label', 'dt-icon-label'); |
| 67 exclamationElement.className = 'exclamation-mark'; | 68 exclamationElement.className = 'exclamation-mark'; |
| 68 if (!Elements.StylesSidebarPane.ignoreErrorsForProperty(property)) | 69 if (!Elements.StylesSidebarPane.ignoreErrorsForProperty(property)) |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 | 487 |
| 487 /** | 488 /** |
| 488 * @return {!Array<!Elements.StylePropertiesSection>} | 489 * @return {!Array<!Elements.StylePropertiesSection>} |
| 489 */ | 490 */ |
| 490 allSections() { | 491 allSections() { |
| 491 var sections = []; | 492 var sections = []; |
| 492 for (var block of this._sectionBlocks) | 493 for (var block of this._sectionBlocks) |
| 493 sections = sections.concat(block.sections); | 494 sections = sections.concat(block.sections); |
| 494 return sections; | 495 return sections; |
| 495 } | 496 } |
| 497 |
| 498 /** |
| 499 * @param {!Event} event |
| 500 */ |
| 501 _clipboardCopy(event) { |
| 502 Host.userMetrics.actionTaken(Host.UserMetrics.Action.StyleRuleCopied); |
| 503 } |
| 496 }; | 504 }; |
| 497 | 505 |
| 498 Elements.StylesSidebarPane._maxLinkLength = 30; | 506 Elements.StylesSidebarPane._maxLinkLength = 30; |
| 499 | 507 |
| 500 Elements.SectionBlock = class { | 508 Elements.SectionBlock = class { |
| 501 /** | 509 /** |
| 502 * @param {?Element} titleElement | 510 * @param {?Element} titleElement |
| 503 */ | 511 */ |
| 504 constructor(titleElement) { | 512 constructor(titleElement) { |
| 505 this._titleElement = titleElement; | 513 this._titleElement = titleElement; |
| (...skipping 2578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3084 } | 3092 } |
| 3085 | 3093 |
| 3086 /** | 3094 /** |
| 3087 * @override | 3095 * @override |
| 3088 * @return {!UI.ToolbarItem} | 3096 * @return {!UI.ToolbarItem} |
| 3089 */ | 3097 */ |
| 3090 item() { | 3098 item() { |
| 3091 return this._button; | 3099 return this._button; |
| 3092 } | 3100 } |
| 3093 }; | 3101 }; |
| OLD | NEW |