diff options
author | Matěj Cepl <mcepl@redhat.com> | 2011-06-05 23:34:55 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2011-06-05 23:34:55 +0200 |
commit | 968a1a63f8e625994b40b7d2af2d22940285c63c (patch) | |
tree | 4e6dc4d0fd51068ccd57be9ccb2bb5e3e7de8528 /data/lib/bzpage.js | |
parent | ffa6d74ddbf28c7fb7be1ad473847807d0301eac (diff) | |
download | bugzilla-triage-968a1a63f8e625994b40b7d2af2d22940285c63c.tar.gz |
Move attachments and comments functions into four separate objects.
Specifically there are objects AttachList, Attachment, Comment,
and CommentList.
Diffstat (limited to 'data/lib/bzpage.js')
-rw-r--r-- | data/lib/bzpage.js | 41 |
1 files changed, 10 insertions, 31 deletions
diff --git a/data/lib/bzpage.js b/data/lib/bzpage.js index 1be287d..c292acd 100644 --- a/data/lib/bzpage.js +++ b/data/lib/bzpage.js @@ -329,45 +329,26 @@ function setConfigurationButton () { } /** - * dd - * - * @return Element with the href attribute containng the information - */ -function getOptionTableCell(tableId, label) { - var cleanLabelRE = new RegExp("^\\s*([^.:]*):?\\s*$"); - label = label.trim().replace(cleanLabelRE,"$1").toLowerCase(); - - var rows = document.getElementById(tableId).getElementsByTagName("tr"); - var ourLine = Array.filter(rows, function(row) { - var curLabel = row.getElementsByTagName("td")[0].textContent.toLowerCase(); - curLabel = curLabel.replace(cleanLabelRE,"$1"); - return (curLabel === label); // maybe this could be a RE match instead - }); - - if (ourLine.length > 0) { - return ourLine[0].getElementsByTagName("td")[1]. - getElementsByTagName("a")[0]; - } - return null; -} - - -/** * Complete startup, mainly run alternate inits for non-standard BZ with proper * arguments * */ function completeInit() { - var attachments = getAttachments(); + // FIXME: add flags, and priority or others bits. + var things = { + attachments: new AttachList(document), + comments: new CommentList(document) + }; + if (RHBZinit) { - RHBZinit(attachments); + RHBZinit(things); } - console.log("completeInit: tweakBugzilla = " + typeof tweakBugzilla); - console.log("completeInit: config = " + config.toSource()); + things.comments.colorComments(); + if (tweakBugzilla && config.verboseInlineHistory) { - tweakBugzilla(attachments, constantData); + tweakBugzilla(things, constantData); } } @@ -410,8 +391,6 @@ function startup() { setConfigurationButton(); submitHandlerInstalled = false; - checkComments(); - self.postMessage(new Message("GetInstalledPackages", { location: window.location.href, login: getLogin() |