aboutsummaryrefslogtreecommitdiffstats
path: root/data/lib/rhbzpage.js
diff options
context:
space:
mode:
Diffstat (limited to 'data/lib/rhbzpage.js')
-rw-r--r--data/lib/rhbzpage.js78
1 files changed, 32 insertions, 46 deletions
diff --git a/data/lib/rhbzpage.js b/data/lib/rhbzpage.js
index 3cffbb9..706c8c1 100644
--- a/data/lib/rhbzpage.js
+++ b/data/lib/rhbzpage.js
@@ -1,9 +1,6 @@
// Released under the MIT/X11 license
// http://www.opensource.org/licenses/mit-license.php
-// Are we debugging?
-var debugFlag = false;
-
// For identification of graphics card
var manuChipStrs = [ [ "ATI Radeon", "ATI", "1002" ],
[ "ATI Mobility Radeon", "ATI", "1002" ],
@@ -223,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');
@@ -279,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) {
@@ -289,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
- },
- });
}
}
}