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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js

Issue 2349973005: DevTools: move repeatCountElement from contentElement into wrapperElement (Closed)
Patch Set: Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 return this._element; 951 return this._element;
952 952
953 var element = createElementWithClass("div", "console-message"); 953 var element = createElementWithClass("div", "console-message");
954 this._element = element; 954 this._element = element;
955 955
956 if (this._message.type === WebInspector.ConsoleMessage.MessageType.Start Group || this._message.type === WebInspector.ConsoleMessage.MessageType.StartGro upCollapsed) 956 if (this._message.type === WebInspector.ConsoleMessage.MessageType.Start Group || this._message.type === WebInspector.ConsoleMessage.MessageType.StartGro upCollapsed)
957 element.classList.add("console-group-title"); 957 element.classList.add("console-group-title");
958 958
959 element.appendChild(this.formattedMessage()); 959 element.appendChild(this.formattedMessage());
960 960
961 if (this._repeatCount > 1)
962 this._showRepeatCountElement();
963
964 this.updateTimestamp(WebInspector.moduleSetting("consoleTimestampsEnable d").get()); 961 this.updateTimestamp(WebInspector.moduleSetting("consoleTimestampsEnable d").get());
965 962
966 return this._element; 963 return this._element;
967 }, 964 },
968 965
969 /** 966 /**
970 * @return {!Element} 967 * @return {!Element}
971 */ 968 */
972 toMessageElement: function() 969 toMessageElement: function()
973 { 970 {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 break; 1005 break;
1009 case WebInspector.ConsoleMessage.MessageLevel.RevokedError: 1006 case WebInspector.ConsoleMessage.MessageLevel.RevokedError:
1010 this._wrapperElement.classList.add("console-revokedError-level"); 1007 this._wrapperElement.classList.add("console-revokedError-level");
1011 break; 1008 break;
1012 case WebInspector.ConsoleMessage.MessageLevel.Info: 1009 case WebInspector.ConsoleMessage.MessageLevel.Info:
1013 this._wrapperElement.classList.add("console-info-level"); 1010 this._wrapperElement.classList.add("console-info-level");
1014 break; 1011 break;
1015 } 1012 }
1016 1013
1017 this._wrapperElement.appendChild(this.contentElement()); 1014 this._wrapperElement.appendChild(this.contentElement());
1015 if (this._repeatCount > 1)
1016 this._showRepeatCountElement();
1018 }, 1017 },
1019 1018
1020 resetIncrementRepeatCount: function() 1019 resetIncrementRepeatCount: function()
1021 { 1020 {
1022 this._repeatCount = 1; 1021 this._repeatCount = 1;
1023 if (!this._repeatCountElement) 1022 if (!this._repeatCountElement)
1024 return; 1023 return;
1025 1024
1026 this._repeatCountElement.remove(); 1025 this._repeatCountElement.remove();
1027 delete this._repeatCountElement; 1026 delete this._repeatCountElement;
(...skipping 18 matching lines...) Expand all
1046 break; 1045 break;
1047 case WebInspector.ConsoleMessage.MessageLevel.Error: 1046 case WebInspector.ConsoleMessage.MessageLevel.Error:
1048 this._repeatCountElement.type = "error"; 1047 this._repeatCountElement.type = "error";
1049 break; 1048 break;
1050 case WebInspector.ConsoleMessage.MessageLevel.Debug: 1049 case WebInspector.ConsoleMessage.MessageLevel.Debug:
1051 this._repeatCountElement.type = "debug"; 1050 this._repeatCountElement.type = "debug";
1052 break; 1051 break;
1053 default: 1052 default:
1054 this._repeatCountElement.type = "info"; 1053 this._repeatCountElement.type = "info";
1055 } 1054 }
1056 this._element.insertBefore(this._repeatCountElement, this._element.f irstChild); 1055 this._wrapperElement.insertBefore(this._repeatCountElement, this._el ement);
1057 this._element.classList.add("repeated-message"); 1056 this._element.classList.add("repeated-message");
1058 } 1057 }
1059 this._repeatCountElement.textContent = this._repeatCount; 1058 this._repeatCountElement.textContent = this._repeatCount;
1060 }, 1059 },
1061 1060
1062 /** 1061 /**
1063 * @override 1062 * @override
1064 * @return {string} 1063 * @return {string}
1065 */ 1064 */
1066 toString: function() 1065 toString: function()
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
1353 { 1352 {
1354 if (!this._wrapperElement) { 1353 if (!this._wrapperElement) {
1355 WebInspector.ConsoleViewMessage.prototype.toMessageElement.call(this ); 1354 WebInspector.ConsoleViewMessage.prototype.toMessageElement.call(this );
1356 this._wrapperElement.classList.toggle("collapsed", this._collapsed); 1355 this._wrapperElement.classList.toggle("collapsed", this._collapsed);
1357 } 1356 }
1358 return this._wrapperElement; 1357 return this._wrapperElement;
1359 }, 1358 },
1360 1359
1361 __proto__: WebInspector.ConsoleViewMessage.prototype 1360 __proto__: WebInspector.ConsoleViewMessage.prototype
1362 } 1361 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698