From fd3fe0f06944d4462e68c7ea8887e7b3b1f6bc04 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Tue, 22 Feb 2011 11:09:06 +0100 Subject: Fill in magic finally really works. --- data/rhbzpage.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'data') diff --git a/data/rhbzpage.js b/data/rhbzpage.js index 061f9ed..b45d9e2 100644 --- a/data/rhbzpage.js +++ b/data/rhbzpage.js @@ -548,11 +548,20 @@ function fillInWhiteBoard(PCIidArr) { var outStr = ""; var cardIDStr = ""; var cardIDArr = []; - var PCIid = PCIidArr[0] + "," + PCIidArr[1]; - - var cardName = constantData.chipNames[PCIid][0].toUpperCase(); - var titleElem = document.getElementById('short_desc_nonedit_display'); - titleElem.textContent = '[' + cardName + ']\u00A0' + titleElem.textContent; + var cardName = ""; + var PCIid = (PCIidArr[0] + "," + PCIidArr[1]).toUpperCase(); + + try { + cardName = constantData.chipNames[PCIid][0]; + } catch (e if e instanceof TypeError) { + alert("PCI ID " + PCIid + " is not known!"); + return ; // early termination + } catch (e) { + throw e; + } + clickMouse("editme_action"); + var titleElem = document.getElementById('short_desc'); + titleElem.value = '[' + cardName + ']\u00A0' + titleElem.value; document.getElementById("fillin_btn").style.display = "none"; } -- cgit