Bugzilla – Attachment 145236 Details for
Bug 32614
Highlight important comments
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Add red background to important comments
0001-Add-red-background-to-important-comments.patch (text/plain), 3.20 KB, created by
Jonathan Druart
on 2023-01-12 13:45:01 UTC
(
hide
)
Description:
Add red background to important comments
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-01-12 13:45:01 UTC
Size:
3.20 KB
patch
obsolete
>From f85c725334a208b76d7f22a52929a2f2855c3f38 Mon Sep 17 00:00:00 2001 >From: Your Name <you@example.com> >Date: Thu, 12 Jan 2023 13:31:24 +0000 >Subject: [PATCH 1/1] Add red background to important comments > >--- > js/comment-tagging.js | 41 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 41 insertions(+) > >diff --git a/js/comment-tagging.js b/js/comment-tagging.js >index b6f02f0..b01046f 100644 >--- a/js/comment-tagging.js >+++ b/js/comment-tagging.js >@@ -199,6 +199,9 @@ YAHOO.bugzilla.commentTagging = { > var li = document.createElement('li'); > ul.appendChild(li); > var a = document.createElement('a'); >+ if ( tag == 'important' ) { >+ a.setAttribute('style', 'font-weight: bold; color: red;'); >+ } > li.appendChild(a); > Dom.setAttribute(a, 'href', '#'); > YAHOO.util.Event.addListener(a, 'click', function(evt, tag) { >@@ -212,6 +215,44 @@ YAHOO.bugzilla.commentTagging = { > container.removeChild(container.lastChild); > } > container.appendChild(div); >+ >+ if (this.nos_by_tag.hasOwnProperty('important')) { >+ var nb_important_comments = this.nos_by_tag['important'].length; >+ var text = ""; >+ if ( nb_important_comments == 1 ) { >+ text = "There is an important comment in this bug!"; >+ } else if ( nb_important_comments > 1 ) { >+ text = "There are " + this.nos_by_tag['important'].length + " important comments in this bug!"; >+ } >+ if ( text ) { >+ var existing_tr = document.getElementById('important_comments_note'); >+ if ( existing_tr ) { >+ existing_tr.remove(); >+ } >+ >+ var tbody = document.evaluate('//*[@id="bz_show_bug_column_2"]/table/tbody', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; >+ >+ var tr = document.createElement('tr'); >+ tr.setAttribute('id', 'important_comments_note'); >+ var th = document.createElement('th'); >+ var td = document.createElement('td'); >+ >+ var span = document.createElement('span'); >+ span.setAttribute('style', 'font-weight: bold; color: red;'); >+ span.appendChild(document.createTextNode(text)); >+ td.appendChild(span); >+ tr.appendChild(th); >+ tr.appendChild(td); >+ tbody.appendChild(tr); >+ >+ var important_nos = this.nos_by_tag['important']; >+ for (var i = 0, l = important_nos.length; i < l; i++) { >+ var comment_no = important_nos[i].match(/\d+$/)[0]; >+ var div_comment = document.getElementById('c' + comment_no); >+ div_comment.style.backgroundColor = 'red'; >+ } >+ } >+ } > } else { > while (container.hasChildNodes()) { > container.removeChild(container.lastChild); >-- >2.30.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32614
:
145236
|
145237
|
145253
|
145269