diff options
author | Matěj Cepl <mcepl@redhat.com> | 2011-04-22 00:25:52 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2011-04-22 00:25:52 +0200 |
commit | a06ad7e29b9ca7e8e24f72ef3431f5972e23ec8c (patch) | |
tree | 854dd67c4cc7c960545bb0ce15ce5320e42d89f0 /data | |
parent | 9137ba085ddaa7c56f78e46a2994e36aeab9c7cf (diff) | |
parent | bbb82ff2393d9a2f0c6fd7a3b3edb496effa9a36 (diff) | |
download | bugzilla-triage-a06ad7e29b9ca7e8e24f72ef3431f5972e23ec8c.tar.gz |
Merge branch 'fixMagic' into next
Conflicts:
data/lib/util.js
Diffstat (limited to 'data')
-rw-r--r-- | data/lib/rhbzpage.js | 75 |
1 files changed, 32 insertions, 43 deletions
diff --git a/data/lib/rhbzpage.js b/data/lib/rhbzpage.js index 61bdcc0..706c8c1 100644 --- a/data/lib/rhbzpage.js +++ b/data/lib/rhbzpage.js @@ -220,36 +220,7 @@ function addCheckXorgLogLink(attList) { * @return None * */ -function fillInWhiteBoard(PCIidArrObj) { - var outStr = ""; - var cardIDStr = ""; - var cardIDArr = []; - var cardName = ""; - var PCIid = (PCIidArrObj.id[0] + "," + PCIidArrObj.id[1]).toUpperCase(); - - console.myDebug("PCIidArrObj = " + PCIidArrObj.toSource()); - console.myDebug("PCIid = " + PCIid); - - // Nvidia driver provides good code in the - if (PCIidArrObj.id[0].toLowerCase() == "10de") { - // The following is wrong ... chipsetLine is String, not an array - console.myDebug("fillInWhiteBoard: chipsetLine = " + PCIidArrObj.chipsetLine); - cardName = PCIidArrObj.chipsetLine[2].replace(/\s*nvidia\s*/ig,""). - replace('"','','g'); - } - else { - try { - cardName = constantData.chipNames[PCIid][0]; - } catch (e if e instanceof TypeError) { - PCIid = PCIid.toLowerCase().replace(",",":"); - postMessage(new Message("SetClipboard", PCIid.toString())); - alert("PCI ID " + PCIid + " is not known!"); - return ; // early termination - } catch (e) { - throw e; - } - } - +function fillInWhiteBoard(cardName) { console.myDebug("fillInWhiteBoard: cardName = " + cardName); clickMouse("editme_action"); var titleElem = document.getElementById('short_desc'); @@ -276,9 +247,10 @@ function fillInChipMagic(XlogID) { */ function chipsetMagic (interestingLineArr) { // parse Xorg.0.log - var chipsetLine = ""; + var cardStr = ""; console.myDebug("interestingLineArr = " + interestingLineArr.toSource()); console.myDebug("interestingLineArr[1] = " + interestingLineArr[1]); + if (interestingLineArr.length >0) { var interestingArray = interestingLineArr[0]; if (interestingArray.length > 1) { @@ -286,19 +258,36 @@ function chipsetMagic (interestingLineArr) { // If we have Chipset line, we should parse it as well and // add to the button if (interestingLineArr.length > 1) { - chipsetLine = interestingLineArr[1]; - console.myDebug("chipsetLine = " + chipsetLine.toSource()); - } else { - chipsetLine = null; - console.myDebug("chipsetLine = " + chipsetLine); + var PCIid = (interestingPCIID[0] + "," + interestingPCIID[1]). + toUpperCase(); + // Nvidia driver provides good code in the Chipset line + if (interestingPCIID[0].toLowerCase() == "10de") { + cardStr = interestingLineArr[1][2]. + replace(/\s*nvidia\s*/ig,""). + replace('"','','g'); + } else { + try { + cardStr = constantData.chipNames[PCIid][0]; + } catch (e if e instanceof TypeError) { + PCIid = PCIid.toLowerCase().replace(",",":"); + cardStr = null; + alert("PCI ID " + PCIid + " is not known!"); + postMessage(new Message("SetClipboard", PCIid.toString())); + } catch (e) { + throw e; + } + } + } + else { + cardStr = null; + } + + if (cardStr) { + createNewButton("short_desc_nonedit_display", false, { + "name": "Fill In", + "chipMagic": cardStr, + }); } - createNewButton("short_desc_nonedit_display", false, { - "name": "Fill In", - "chipMagic": { - "id": interestingPCIID, - "chipsetLine": chipsetLine - }, - }); } } } |