Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: Source/devtools/front_end/elements/StylesSidebarPane.js

Issue 1312893006: DevTools: revert back ComputedStylesSidebar (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: brand new design Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 12 matching lines...) Expand all
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */ 28 */
29 29
30 /** 30 /**
31 * @constructor 31 * @constructor
32 * @extends {WebInspector.ElementsSidebarPane} 32 * @extends {WebInspector.ElementsSidebarPane}
33 * @param {function()} requestShowCallback
34 */ 33 */
35 WebInspector.StylesSidebarPane = function(requestShowCallback) 34 WebInspector.StylesSidebarPane = function()
36 { 35 {
37 WebInspector.ElementsSidebarPane.call(this, WebInspector.UIString("Styles")) ; 36 WebInspector.ElementsSidebarPane.call(this, WebInspector.UIString("Styles")) ;
38 this.setMinimumSize(96, 26); 37 this.setMinimumSize(96, 26);
39 38
40 WebInspector.moduleSetting("colorFormat").addChangeListener(this.update.bind (this)); 39 WebInspector.moduleSetting("colorFormat").addChangeListener(this.update.bind (this));
41 WebInspector.moduleSetting("textEditorIndent").addChangeListener(this.update .bind(this)); 40 WebInspector.moduleSetting("textEditorIndent").addChangeListener(this.update .bind(this));
42 41
43 var hbox = this.element.createChild("div", "hbox styles-sidebar-pane-toolbar "); 42 var hbox = this.element.createChild("div", "hbox styles-sidebar-pane-toolbar ");
44 var filterContainerElement = hbox.createChild("div", "styles-sidebar-pane-fi lter-box"); 43 var filterContainerElement = hbox.createChild("div", "styles-sidebar-pane-fi lter-box");
45 this._filterInput = WebInspector.StylesSidebarPane.createPropertyFilterEleme nt(WebInspector.UIString("Filter"), hbox, this._onFilterChanged.bind(this)); 44 this._filterInput = WebInspector.StylesSidebarPane.createPropertyFilterEleme nt(WebInspector.UIString("Filter"), hbox, this._onFilterChanged.bind(this));
46 filterContainerElement.appendChild(this._filterInput); 45 filterContainerElement.appendChild(this._filterInput);
47 46
48 var toolbar = new WebInspector.ExtensibleToolbar("styles-sidebarpane-toolbar ", hbox); 47 var toolbar = new WebInspector.ExtensibleToolbar("styles-sidebarpane-toolbar ", hbox);
49 toolbar.element.classList.add("styles-pane-toolbar", "toolbar-gray-toggled") ; 48 toolbar.element.classList.add("styles-pane-toolbar", "toolbar-gray-toggled") ;
50 this._currentToolbarPane = null; 49 this._currentToolbarPane = null;
51 50
52 this._requestShowCallback = requestShowCallback;
53 var toolbarPaneContainer = this.element.createChild("div", "styles-sidebar-t oolbar-pane-container"); 51 var toolbarPaneContainer = this.element.createChild("div", "styles-sidebar-t oolbar-pane-container");
54 this._toolbarPaneElement = toolbarPaneContainer.createChild("div", "styles-s idebar-toolbar-pane"); 52 this._toolbarPaneElement = toolbarPaneContainer.createChild("div", "styles-s idebar-toolbar-pane");
55 this._sectionsContainer = this.element.createChild("div"); 53 this._sectionsContainer = this.element.createChild("div");
56 54
57 this._stylesPopoverHelper = new WebInspector.StylesPopoverHelper(); 55 this._stylesPopoverHelper = new WebInspector.StylesPopoverHelper();
58 56
59 this._linkifier = new WebInspector.Linkifier(new WebInspector.Linkifier.Defa ultCSSFormatter()); 57 this._linkifier = new WebInspector.Linkifier(new WebInspector.Linkifier.Defa ultCSSFormatter());
60 58
61 this.element.classList.add("styles-pane"); 59 this.element.classList.add("styles-pane");
62 this.element.addEventListener("mousemove", this._mouseMovedOverElement.bind( this), false); 60 this.element.addEventListener("mousemove", this._mouseMovedOverElement.bind( this), false);
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 { 251 {
254 if (!oldMedia.parentStyleSheetId) 252 if (!oldMedia.parentStyleSheetId)
255 return; 253 return;
256 for (var block of this._sectionBlocks) { 254 for (var block of this._sectionBlocks) {
257 for (var section of block.sections) 255 for (var section of block.sections)
258 section._styleSheetMediaEdited(oldMedia, newMedia); 256 section._styleSheetMediaEdited(oldMedia, newMedia);
259 } 257 }
260 }, 258 },
261 259
262 /** 260 /**
263 * @param {string} propertyName
264 */
265 tracePropertyName: function(propertyName)
266 {
267 this._requestShowCallback();
268 this._filterInput.setFilterValue(WebInspector.CSSMetadata.canonicalPrope rtyName(propertyName));
269 },
270
271 /**
272 * @param {?RegExp} regex 261 * @param {?RegExp} regex
273 */ 262 */
274 _onFilterChanged: function(regex) 263 _onFilterChanged: function(regex)
275 { 264 {
276 this._filterRegex = regex; 265 this._filterRegex = regex;
277 this._updateFilter(); 266 this._updateFilter();
278 }, 267 },
279 268
280 /** 269 /**
281 * @override 270 * @override
(...skipping 2913 matching lines...) Expand 10 before | Expand all | Expand 10 after
3195 3184
3196 /** 3185 /**
3197 * @override 3186 * @override
3198 * @return {?WebInspector.ToolbarItem} 3187 * @return {?WebInspector.ToolbarItem}
3199 */ 3188 */
3200 item: function() 3189 item: function()
3201 { 3190 {
3202 return this._button; 3191 return this._button;
3203 } 3192 }
3204 } 3193 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698