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

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

Issue 2272193002: [DevTools] Extract small-bubble component. (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 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 * @param {boolean} show 881 * @param {boolean} show
882 */ 882 */
883 updateTimestamp: function(show) 883 updateTimestamp: function(show)
884 { 884 {
885 if (!this._formattedMessage) 885 if (!this._formattedMessage)
886 return; 886 return;
887 887
888 if (show && !this.timestampElement) { 888 if (show && !this.timestampElement) {
889 this.timestampElement = createElementWithClass("span", "console-time stamp"); 889 this.timestampElement = createElementWithClass("span", "console-time stamp");
890 this.timestampElement.textContent = (new Date(this._message.timestam p)).toConsoleTime() + " "; 890 this.timestampElement.textContent = (new Date(this._message.timestam p)).toConsoleTime() + " ";
891 var afterRepeatCountChild = this._repeatCountElement && this._repeat CountElement.nextSibling;
892 this._formattedMessage.insertBefore(this.timestampElement, this._for mattedMessage.firstChild); 891 this._formattedMessage.insertBefore(this.timestampElement, this._for mattedMessage.firstChild);
893 return; 892 return;
894 } 893 }
895 894
896 if (!show && this.timestampElement) { 895 if (!show && this.timestampElement) {
897 this.timestampElement.remove(); 896 this.timestampElement.remove();
898 delete this.timestampElement; 897 delete this.timestampElement;
899 } 898 }
900 }, 899 },
901 900
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 this._repeatCount++; 1034 this._repeatCount++;
1036 this._showRepeatCountElement(); 1035 this._showRepeatCountElement();
1037 }, 1036 },
1038 1037
1039 _showRepeatCountElement: function() 1038 _showRepeatCountElement: function()
1040 { 1039 {
1041 if (!this._element) 1040 if (!this._element)
1042 return; 1041 return;
1043 1042
1044 if (!this._repeatCountElement) { 1043 if (!this._repeatCountElement) {
1045 this._repeatCountElement = createElement("span"); 1044 this._repeatCountElement = createElementWithClass("label", "console- message-repeat-count", "dt-small-bubble");
1046 this._repeatCountElement.className = "bubble-repeat-count"; 1045 switch (this._message.level) {
1047 1046 case WebInspector.ConsoleMessage.MessageLevel.Warning:
1047 this._repeatCountElement.type = "warning";
1048 break;
1049 case WebInspector.ConsoleMessage.MessageLevel.Error:
1050 this._repeatCountElement.type = "error";
1051 break;
1052 case WebInspector.ConsoleMessage.MessageLevel.Debug:
1053 this._repeatCountElement.type = "debug";
1054 break;
1055 default:
1056 this._repeatCountElement.type = "info";
1057 }
1048 this._element.insertBefore(this._repeatCountElement, this._element.f irstChild); 1058 this._element.insertBefore(this._repeatCountElement, this._element.f irstChild);
1049 this._element.classList.add("repeated-message"); 1059 this._element.classList.add("repeated-message");
1050 } 1060 }
1051 this._repeatCountElement.textContent = this._repeatCount; 1061 this._repeatCountElement.textContent = this._repeatCount;
1052 }, 1062 },
1053 1063
1054 /** 1064 /**
1055 * @override 1065 * @override
1056 * @return {string} 1066 * @return {string}
1057 */ 1067 */
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1345 { 1355 {
1346 if (!this._wrapperElement) { 1356 if (!this._wrapperElement) {
1347 WebInspector.ConsoleViewMessage.prototype.toMessageElement.call(this ); 1357 WebInspector.ConsoleViewMessage.prototype.toMessageElement.call(this );
1348 this._wrapperElement.classList.toggle("collapsed", this._collapsed); 1358 this._wrapperElement.classList.toggle("collapsed", this._collapsed);
1349 } 1359 }
1350 return this._wrapperElement; 1360 return this._wrapperElement;
1351 }, 1361 },
1352 1362
1353 __proto__: WebInspector.ConsoleViewMessage.prototype 1363 __proto__: WebInspector.ConsoleViewMessage.prototype
1354 } 1364 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/devtools.gypi ('k') | third_party/WebKit/Source/devtools/front_end/console/consoleView.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698