View | Details | Raw Unified | Return to bug 32614
Collapse All | Expand All

(-)a/js/comment-tagging.js (-1 / +41 lines)
Lines 199-204 YAHOO.bugzilla.commentTagging = { Link Here
199
                var li = document.createElement('li');
199
                var li = document.createElement('li');
200
                ul.appendChild(li);
200
                ul.appendChild(li);
201
                var a = document.createElement('a');
201
                var a = document.createElement('a');
202
                if ( tag == 'important' ) {
203
                    a.setAttribute('style', 'font-weight: bold; color: red;');
204
                }
202
                li.appendChild(a);
205
                li.appendChild(a);
203
                Dom.setAttribute(a, 'href', '#');
206
                Dom.setAttribute(a, 'href', '#');
204
                YAHOO.util.Event.addListener(a, 'click', function(evt, tag) {
207
                YAHOO.util.Event.addListener(a, 'click', function(evt, tag) {
Lines 212-217 YAHOO.bugzilla.commentTagging = { Link Here
212
                container.removeChild(container.lastChild);
215
                container.removeChild(container.lastChild);
213
            }
216
            }
214
            container.appendChild(div);
217
            container.appendChild(div);
218
219
            if (this.nos_by_tag.hasOwnProperty('important')) {
220
                var nb_important_comments = this.nos_by_tag['important'].length;
221
                var text = "";
222
                if ( nb_important_comments == 1 ) {
223
                    text = "There is an important comment in this bug!";
224
                } else if ( nb_important_comments > 1 ) {
225
                    text = "There are " + this.nos_by_tag['important'].length + " important comments in this bug!";
226
                }
227
                if ( text ) {
228
                    var existing_tr = document.getElementById('important_comments_note');
229
                    if ( existing_tr ) {
230
                        existing_tr.remove();
231
                    }
232
233
                    var tbody = document.evaluate('//*[@id="bz_show_bug_column_2"]/table/tbody', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
234
235
                    var tr = document.createElement('tr');
236
                    tr.setAttribute('id', 'important_comments_note');
237
                    var th = document.createElement('th');
238
                    var td = document.createElement('td');
239
240
                    var span = document.createElement('span');
241
                    span.setAttribute('style', 'font-weight: bold; color: red;');
242
                    span.appendChild(document.createTextNode(text));
243
                    td.appendChild(span);
244
                    tr.appendChild(th);
245
                    tr.appendChild(td);
246
                    tbody.appendChild(tr);
247
248
                    var important_nos = this.nos_by_tag['important'];
249
                    for (var i = 0, l = important_nos.length; i < l; i++) {
250
                        var comment_no = important_nos[i].match(/\d+$/)[0];
251
                        var div_comment = document.getElementById('c' + comment_no);
252
                        div_comment.style.backgroundColor = 'red';
253
                    }
254
                }
255
            }
215
        } else {
256
        } else {
216
            while (container.hasChildNodes()) {
257
            while (container.hasChildNodes()) {
217
                container.removeChild(container.lastChild);
258
                container.removeChild(container.lastChild);
218
- 

Return to bug 32614