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

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

Issue 468973002: DevTools: [SSP] fix design glitches in "Insert New Rule" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: insert rule title consistent with SSP Created 6 years, 4 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
« no previous file with comments | « no previous file | Source/devtools/front_end/elementsPanel.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1131 selectorContainer.appendChild(openBrace); 1131 selectorContainer.appendChild(openBrace);
1132 selectorContainer.addEventListener("mousedown", this._handleEmptySpaceMouseD own.bind(this), false); 1132 selectorContainer.addEventListener("mousedown", this._handleEmptySpaceMouseD own.bind(this), false);
1133 selectorContainer.addEventListener("click", this._handleSelectorContainerCli ck.bind(this), false); 1133 selectorContainer.addEventListener("click", this._handleSelectorContainerCli ck.bind(this), false);
1134 1134
1135 var closeBrace = document.createElement("div"); 1135 var closeBrace = document.createElement("div");
1136 closeBrace.textContent = "}"; 1136 closeBrace.textContent = "}";
1137 this.element.appendChild(closeBrace); 1137 this.element.appendChild(closeBrace);
1138 1138
1139 if (this.editable && this.rule) { 1139 if (this.editable && this.rule) {
1140 var newRuleButton = closeBrace.createChild("div", "sidebar-pane-button-n ew-rule"); 1140 var newRuleButton = closeBrace.createChild("div", "sidebar-pane-button-n ew-rule");
1141 newRuleButton.title = WebInspector.UIString("Insert Style Rule");
1141 newRuleButton.addEventListener("click", this._onNewRuleClick.bind(this), false); 1142 newRuleButton.addEventListener("click", this._onNewRuleClick.bind(this), false);
1142 } 1143 }
1143 1144
1144 this._selectorElement.addEventListener("click", this._handleSelectorClick.bi nd(this), false); 1145 this._selectorElement.addEventListener("click", this._handleSelectorClick.bi nd(this), false);
1145 this.element.addEventListener("mousedown", this._handleEmptySpaceMouseDown.b ind(this), false); 1146 this.element.addEventListener("mousedown", this._handleEmptySpaceMouseDown.b ind(this), false);
1146 this.element.addEventListener("click", this._handleEmptySpaceClick.bind(this ), false); 1147 this.element.addEventListener("click", this._handleEmptySpaceClick.bind(this ), false);
1147 1148
1148 if (this.rule) { 1149 if (this.rule) {
1149 // Prevent editing the user agent and user rules. 1150 // Prevent editing the user agent and user rules.
1150 if (this.rule.isUserAgent || this.rule.isUser) 1151 if (this.rule.isUserAgent || this.rule.isUser)
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
1882 * @constructor 1883 * @constructor
1883 * @extends {WebInspector.StylePropertiesSection} 1884 * @extends {WebInspector.StylePropertiesSection}
1884 * @param {!WebInspector.StylesSidebarPane} stylesPane 1885 * @param {!WebInspector.StylesSidebarPane} stylesPane
1885 * @param {string} defaultSelectorText 1886 * @param {string} defaultSelectorText
1886 * @param {string} styleSheetId 1887 * @param {string} styleSheetId
1887 * @param {!WebInspector.TextRange} ruleLocation 1888 * @param {!WebInspector.TextRange} ruleLocation
1888 * @param {!WebInspector.CSSRule=} insertAfterRule 1889 * @param {!WebInspector.CSSRule=} insertAfterRule
1889 */ 1890 */
1890 WebInspector.BlankStylePropertiesSection = function(stylesPane, defaultSelectorT ext, styleSheetId, ruleLocation, insertAfterRule) 1891 WebInspector.BlankStylePropertiesSection = function(stylesPane, defaultSelectorT ext, styleSheetId, ruleLocation, insertAfterRule)
1891 { 1892 {
1892 WebInspector.StylePropertiesSection.call(this, stylesPane, {selectorText: de faultSelectorText, rule: {isViaInspector: true}}, true, false); 1893 var styleSheetHeader = WebInspector.cssModel.styleSheetHeaderForId(styleShee tId);
1894 WebInspector.StylePropertiesSection.call(this, stylesPane, {selectorText: de faultSelectorText, rule: {isViaInspector: styleSheetHeader.isViaInspector()}}, t rue, false);
1893 this._ruleLocation = ruleLocation; 1895 this._ruleLocation = ruleLocation;
1894 this._styleSheetId = styleSheetId; 1896 this._styleSheetId = styleSheetId;
1895 if (insertAfterRule) 1897 if (insertAfterRule)
1896 this._createMediaList(insertAfterRule); 1898 this._createMediaList(insertAfterRule);
1897 this.element.classList.add("blank-section"); 1899 this.element.classList.add("blank-section");
1898 } 1900 }
1899 1901
1900 WebInspector.BlankStylePropertiesSection.prototype = { 1902 WebInspector.BlankStylePropertiesSection.prototype = {
1901 get isBlank() 1903 get isBlank()
1902 { 1904 {
(...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after
3356 if (userEnteredText && (userEnteredText === userEnteredText.toUpperCase( ))) { 3358 if (userEnteredText && (userEnteredText === userEnteredText.toUpperCase( ))) {
3357 for (var i = 0; i < results.length; ++i) 3359 for (var i = 0; i < results.length; ++i)
3358 results[i] = results[i].toUpperCase(); 3360 results[i] = results[i].toUpperCase();
3359 } 3361 }
3360 var selectedIndex = this._cssCompletions.mostUsedOf(results); 3362 var selectedIndex = this._cssCompletions.mostUsedOf(results);
3361 completionsReadyCallback(results, selectedIndex); 3363 completionsReadyCallback(results, selectedIndex);
3362 }, 3364 },
3363 3365
3364 __proto__: WebInspector.TextPrompt.prototype 3366 __proto__: WebInspector.TextPrompt.prototype
3365 } 3367 }
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/elementsPanel.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698