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 30 matching lines...) Expand all Loading... |
41 this._sectionsContainer = this.element.createChild('div'); | 41 this._sectionsContainer = this.element.createChild('div'); |
42 this._swatchPopoverHelper = new InlineEditor.SwatchPopoverHelper(); | 42 this._swatchPopoverHelper = new InlineEditor.SwatchPopoverHelper(); |
43 this._linkifier = new Components.Linkifier(Elements.StylesSidebarPane._maxLi
nkLength, /* useLinkDecorator */ true); | 43 this._linkifier = new Components.Linkifier(Elements.StylesSidebarPane._maxLi
nkLength, /* useLinkDecorator */ true); |
44 | 44 |
45 this.element.classList.add('styles-pane'); | 45 this.element.classList.add('styles-pane'); |
46 | 46 |
47 /** @type {!Array<!Elements.SectionBlock>} */ | 47 /** @type {!Array<!Elements.SectionBlock>} */ |
48 this._sectionBlocks = []; | 48 this._sectionBlocks = []; |
49 Elements.StylesSidebarPane._instance = this; | 49 Elements.StylesSidebarPane._instance = this; |
50 UI.context.addFlavorChangeListener(SDK.DOMNode, this.forceUpdate, this); | 50 UI.context.addFlavorChangeListener(SDK.DOMNode, this.forceUpdate, this); |
| 51 this.element.addEventListener('copy', this._clipboardCopy.bind(this)); |
51 } | 52 } |
52 | 53 |
53 /** | 54 /** |
54 * @param {!SDK.CSSProperty} property | 55 * @param {!SDK.CSSProperty} property |
55 * @return {!Element} | 56 * @return {!Element} |
56 */ | 57 */ |
57 static createExclamationMark(property) { | 58 static createExclamationMark(property) { |
58 var exclamationElement = createElement('label', 'dt-icon-label'); | 59 var exclamationElement = createElement('label', 'dt-icon-label'); |
59 exclamationElement.className = 'exclamation-mark'; | 60 exclamationElement.className = 'exclamation-mark'; |
60 if (!Elements.StylesSidebarPane.ignoreErrorsForProperty(property)) | 61 if (!Elements.StylesSidebarPane.ignoreErrorsForProperty(property)) |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 | 479 |
479 /** | 480 /** |
480 * @return {!Array<!Elements.StylePropertiesSection>} | 481 * @return {!Array<!Elements.StylePropertiesSection>} |
481 */ | 482 */ |
482 allSections() { | 483 allSections() { |
483 var sections = []; | 484 var sections = []; |
484 for (var block of this._sectionBlocks) | 485 for (var block of this._sectionBlocks) |
485 sections = sections.concat(block.sections); | 486 sections = sections.concat(block.sections); |
486 return sections; | 487 return sections; |
487 } | 488 } |
| 489 |
| 490 /** |
| 491 * @param {!Event} event |
| 492 */ |
| 493 _clipboardCopy(event) { |
| 494 Host.userMetrics.actionTaken(Host.UserMetrics.Action.StyleRuleCopied); |
| 495 } |
488 }; | 496 }; |
489 | 497 |
490 Elements.StylesSidebarPane._maxLinkLength = 30; | 498 Elements.StylesSidebarPane._maxLinkLength = 30; |
491 | 499 |
492 /** | 500 /** |
493 * @unrestricted | 501 * @unrestricted |
494 */ | 502 */ |
495 Elements.SectionBlock = class { | 503 Elements.SectionBlock = class { |
496 /** | 504 /** |
497 * @param {?Element} titleElement | 505 * @param {?Element} titleElement |
(...skipping 2582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3080 } | 3088 } |
3081 | 3089 |
3082 /** | 3090 /** |
3083 * @override | 3091 * @override |
3084 * @return {!UI.ToolbarItem} | 3092 * @return {!UI.ToolbarItem} |
3085 */ | 3093 */ |
3086 item() { | 3094 item() { |
3087 return this._button; | 3095 return this._button; |
3088 } | 3096 } |
3089 }; | 3097 }; |
OLD | NEW |