aboutsummaryrefslogtreecommitdiffstats
path: root/bugzillaBugTriage.js
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-02-01 16:13:40 +0100
committerMatěj Cepl <mcepl@redhat.com>2010-02-01 16:13:40 +0100
commit904699686f73cb712e49921acbd09b95ee60d580 (patch)
tree8217fe4cef91934b2d33d540a79cff8ce8be4bdd /bugzillaBugTriage.js
parent46fcda1ef759ff604fa8c1c40626454dad820e40 (diff)
downloadbugzilla-triage-904699686f73cb712e49921acbd09b95ee60d580.tar.gz
Unsuccesful attempt to make logging available.
Diffstat (limited to 'bugzillaBugTriage.js')
-rw-r--r--bugzillaBugTriage.js85
1 files changed, 85 insertions, 0 deletions
diff --git a/bugzillaBugTriage.js b/bugzillaBugTriage.js
index 48748af..171f8fc 100644
--- a/bugzillaBugTriage.js
+++ b/bugzillaBugTriage.js
@@ -86,6 +86,7 @@ var signatureFedoraString = "";
// TODO we should have an array SpecialFlags instead of multiple Boolean variables
var queryButtonAvailable = false;
var upstreamButtonAvailable = false;
+var logSubmits = false;
var chipIDsGroupings = [];
var AddrArray = [];
var PCI_ID_Array = [];
@@ -135,6 +136,7 @@ loadJSON(jsonDataURL, function (response) {
defAssigneeList = response.defaultAssignee;
queryButtonAvailable = response.queryButton;
upstreamButtonAvailable = response.upstreamButton;
+ logSubmits = response.submitsLogging;
upstreamBugzillasArray = response.upstreamBugzillas;
chipIDsGroupings = response.chipIDsGroupings;
topRow = response.topRow;
@@ -222,6 +224,71 @@ isInList = function(mbr, list) {
return (list.indexOf(mbr) !== -1);
};
+writeALine = function(filename,text) {
+
+// jetpack.tabs.focused.contentWindow.wrappedJSObject.netscape.security.
+// this.netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+
+// var fileContractId = "@mozilla.org/file/local;1";
+// var fileInterface = Components.interfaces.nsILocalFile;
+// netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+// var localFileClass = Components.classes[fileContractId];
+// var file = localFileClass.createInstance(fileInterface);
+// var desk = Components.classes["@mozilla.org/file/directory_service;1"]
+// .getService(Components.interfaces.nsIProperties)
+// .get("Desk", Components.interfaces.nsIFile);
+
+// try {
+// desk.append(name);
+// } catch (exp) {
+// alert("Bad file name");
+// return;
+// }
+
+// name = desk.path;
+
+// try {
+// file.initWithPath(name);
+// } catch (exp) {
+// alert("Bad file name");
+// return;
+// }
+
+// try {
+// file.create(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 420);
+// } catch (exp) {
+// //
+// }
+
+// var stream = Components.classes["@mozilla.org/network/file-output-stream;1"]
+// .createInstance(Components.interfaces.nsIFileOutputStream);
+
+// try {
+// stream.init(file, 0x02 | 0x08 | 0x20, 0666, 0);
+// } catch (exp) {
+// alert("Cannot create file");
+// return;
+// }
+
+// stream.write(data, data.length);
+// stream.close();
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
+
// ============================================================================
// Color management methods
// originally from
@@ -450,6 +517,12 @@ Color.prototype.lightColor = function() {
//====================================================================================
// BzPage's methods
+BzPage.prototype.getLogTime = function() {
+ // FIXME to be implemented
+ var today = new Date();
+ return today.toDateString();
+}
+
/**
* Check for the presence of a keyword
*
@@ -1774,6 +1847,18 @@ function BzPage(doc) {
}
, false);
}
+
+ // logging all submits for timesheet
+ if (logSubmits) {
+ var that = this;
+ this.dok.forms.namedItem("changeform").addEventListener("submit",
+ function () {
+ // write the record to the log
+ var logTime = this.getLogTime();
+ console.log("today's date is " + logTime);
+ console.log(logTime + ": " + that.bugNo);
+ },false);
+ }
this.setBranding();
this.checkComments();