Bugzilla – Attachment 145269 Details for
Bug 32614
Highlight important comments
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32614: Highlight important comments
0001-Bug-32614-Highlight-important-comments.patch (text/plain), 3.53 KB, created by
Jonathan Druart
on 2023-01-13 12:47:52 UTC
(
hide
)
Description:
Bug 32614: Highlight important comments
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-01-13 12:47:52 UTC
Size:
3.53 KB
patch
obsolete
>From 4c53a00bca4e338bf35f56355c1f9e208932ba66 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@gmail.com> >Date: Thu, 12 Jan 2023 13:31:24 +0000 >Subject: [PATCH 1/1] Bug 32614: Highlight important comments > >This patch is suggesting to have an 'important' tag that could be attach >to comments, and that would highlight them. > >* There is a new note at the top right > "There are 2 important comments in this bug!" >* The 'important' tag is red >* The comment flagged with the 'important' tag will have a red >border for better visilibity >--- > js/comment-tagging.js | 41 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 41 insertions(+) > >diff --git a/js/comment-tagging.js b/js/comment-tagging.js >index b6f02f0..594ab25 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.border = '2px red solid'; >+ } >+ } >+ } > } 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