From dd0b43442c1642eb6db6fb6a7711eefe7a1119ef Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Wed, 11 Apr 2012 02:41:20 +0200 Subject: Make the script bugs.eclipse.org compatible. Closes #120 --- data/lib/bugzillaDOMFunctions.js | 7 ++----- data/lib/bzpage.js | 2 +- data/tweaks/bug-page-mod.js | 4 +++- 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'data') diff --git a/data/lib/bugzillaDOMFunctions.js b/data/lib/bugzillaDOMFunctions.js index 5c9423e..be30a3e 100644 --- a/data/lib/bugzillaDOMFunctions.js +++ b/data/lib/bugzillaDOMFunctions.js @@ -356,17 +356,14 @@ function getAttachments () { * @return String with the login name of the currently logged-in user */ function getLogin () { - var lastElemArr = ""; + var lastElemArr = []; var LIElementsArr = document.querySelectorAll("#header ul.links li"); // This should never be null - console.log("LIElementsArr = " + LIElementsArr); if (LIElementsArr.length > 0) { - lastElemArr = Array.filter(LIElementsArr, function(el) { - console.log("el = " + el.toSource()); + lastElemArr = Array.filter(LIElementsArr, function(el, idx, arr) { return (el.textContent.indexOf("Log") !== -1); }); } - console.log("lastElemArr = " + lastElemArr.toSource()); var lastLIElement = ""; if (lastElemArr) { lastLIElement = lastElemArr.pop(); diff --git a/data/lib/bzpage.js b/data/lib/bzpage.js index 8d7606f..e44f3f4 100644 --- a/data/lib/bzpage.js +++ b/data/lib/bzpage.js @@ -408,7 +408,7 @@ function startup() { self.postMessage(new Message("GetInstalledPackages", { location: window.location.href, - login: getLogin() + login: getLogin(), })); } } diff --git a/data/tweaks/bug-page-mod.js b/data/tweaks/bug-page-mod.js index 32672b0..d3551a3 100644 --- a/data/tweaks/bug-page-mod.js +++ b/data/tweaks/bug-page-mod.js @@ -170,7 +170,9 @@ function tweakBugzilla(things, cData) { var CheckinComment = new CheckinCommentCtor(); CheckinComment.initialize(AttachmentFlagHandler._interestingFlags); - collectHistory(); + if (!cData.passwordState.withoutPass) { + collectHistory(); + } tbplbotSpamCollapser(); } -- cgit