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

Side by Side Diff: Tools/GardeningServer/scripts/ui/notifications.js

Issue 183923025: Garden-o-matic: Introduce an option to open links in a new window (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Comments addressed Created 6 years, 9 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 updateWithNode: function(node) 89 updateWithNode: function(node)
90 { 90 {
91 $(this._what).empty(); 91 $(this._what).empty();
92 this._what.appendChild(node); 92 this._what.appendChild(node);
93 } 93 }
94 }); 94 });
95 95
96 ui.notifications.FailingTestGroup = base.extends('li', { 96 ui.notifications.FailingTestGroup = base.extends('li', {
97 init: function(groupName, testNameList) 97 init: function(groupName, testNameList)
98 { 98 {
99 this.appendChild(base.createLinkNode(ui.urlForFlakinessDashboard(testNam eList), groupName)); 99 this.appendChild(ui.createLinkNode(ui.urlForFlakinessDashboard(testNameL ist), groupName));
100 } 100 }
101 }); 101 });
102 102
103 var Cause = base.extends('li', { 103 var Cause = base.extends('li', {
104 init: function() 104 init: function()
105 { 105 {
106 this._description = this.appendChild(document.createElement('div')); 106 this._description = this.appendChild(document.createElement('div'));
107 this._description.className = 'description'; 107 this._description.className = 'description';
108 } 108 }
109 }); 109 });
110 110
111 ui.notifications.SuspiciousCommit = base.extends(Cause, { 111 ui.notifications.SuspiciousCommit = base.extends(Cause, {
112 init: function(commitData) 112 init: function(commitData)
113 { 113 {
114 this._revision = commitData.revision; 114 this._revision = commitData.revision;
115 this._description.appendChild(base.createLinkNode(trac.changesetURL(comm itData.revision), commitData.revision)); 115 this._description.appendChild(ui.createLinkNode(trac.changesetURL(commit Data.revision), commitData.revision));
116 this._details = this._description.appendChild(document.createElement('sp an')); 116 this._details = this._description.appendChild(document.createElement('sp an'));
117 this._addDetail('title', commitData); 117 this._addDetail('title', commitData);
118 this._addDetail('author', commitData); 118 this._addDetail('author', commitData);
119 this._addDetail('reviewer', commitData); 119 this._addDetail('reviewer', commitData);
120 this._addDetail('bugID', commitData, 120 this._addDetail('bugID', commitData,
121 ui.urlForCrbug, 121 ui.urlForCrbug,
122 function(value) { 122 function(value) {
123 return value.split(/\s*,\s*/); 123 return value.split(/\s*,\s*/);
124 } 124 }
125 ); 125 );
126 }, 126 },
127 hasRevision: function(revision) 127 hasRevision: function(revision)
128 { 128 {
129 return this._revision == revision; 129 return this._revision == revision;
130 }, 130 },
131 _addDetail: function(part, commitData, linkFunction) 131 _addDetail: function(part, commitData, linkFunction)
132 { 132 {
133 var content = commitData[part]; 133 var content = commitData[part];
134 if (!content) 134 if (!content)
135 return; 135 return;
136 136
137 var span = this._details.appendChild(document.createElement('span')); 137 var span = this._details.appendChild(document.createElement('span'));
138 span.className = part; 138 span.className = part;
139 139
140 if (linkFunction) { 140 if (linkFunction) {
141 var parts = $.isArray(content) ? content : [content]; 141 var parts = $.isArray(content) ? content : [content];
142 parts.forEach(function(item, index) { 142 parts.forEach(function(item, index) {
143 if (index > 0) 143 if (index > 0)
144 span.appendChild(document.createTextNode(', ')); 144 span.appendChild(document.createTextNode(', '));
145 var link = base.createLinkNode(linkFunction(item), item); 145 var link = ui.createLinkNode(linkFunction(item), item);
146 link.className = part + '-item'; 146 link.className = part + '-item';
147 span.appendChild(link); 147 span.appendChild(link);
148 }); 148 });
149 } else { 149 } else {
150 span.textContent = content; 150 span.textContent = content;
151 } 151 }
152 } 152 }
153 }); 153 });
154 154
155 ui.notifications.Failure = base.extends(ui.notifications.Notification, { 155 ui.notifications.Failure = base.extends(ui.notifications.Notification, {
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 $(this._effects).empty().append(Object.keys(failuresList).map(function(b uilderName) { 266 $(this._effects).empty().append(Object.keys(failuresList).map(function(b uilderName) {
267 var effect = document.createElement('li'); 267 var effect = document.createElement('li');
268 effect.className = 'builder'; 268 effect.className = 'builder';
269 effect.appendChild(new ui.failures.Builder(builderName, failuresList [builderName])); 269 effect.appendChild(new ui.failures.Builder(builderName, failuresList [builderName]));
270 return effect; 270 return effect;
271 })); 271 }));
272 } 272 }
273 }); 273 });
274 274
275 })(); 275 })();
OLDNEW
« no previous file with comments | « Tools/GardeningServer/scripts/ui/failures.js ('k') | Tools/GardeningServer/scripts/ui/results.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698