From c1ec772b104316530f6737340355205398df33af Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Tue, 1 Feb 2011 16:28:51 +0100 Subject: This actually almost looks like working, so much I can file bugs. --- lib/logger.js | 48 +++++++++++++++++++++++------------------------- 1 file changed, 23 insertions(+), 25 deletions(-) (limited to 'lib/logger.js') diff --git a/lib/logger.js b/lib/logger.js index cbe670d..659faac 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -10,6 +10,29 @@ var apiUtils = require("api-utils"); var xrpc = require("xmlrpc"); var myStorage = require("simple-storage"); +exports.addLogRecord = function addLogRecord(rec) { + if (myStorage.storage.logs[rec.key]) { + myStorage.storage.logs[rec.key].comment += "
\n" + comment; + } else { + myStorage.storage.logs[rec.key] = rec; + } +}; + +exports.generateTimeSheet = function generateTimeSheet() { + ; // FIXME +}; + +exports.clearTimeSheet = function clearTimeSheet() { + ; // FIXME +}; + +exports.importTimeSheet = function importTimeSheet() { + ; /* FIXME + jsonPaths = prompts.promptFileOpenPicker(that.win); + that.log.importOtherStore(jsonPaths, clearLogAElem); + */ +}; + var Logger = exports.Logger = function Logger(abbsMap) { this.EmptyLogsColor = rgb(0, 255, 0); this.FullLogsColor = rgb(0, 40, 103); @@ -59,31 +82,6 @@ Logger.prototype.importOtherStore = function importOtherStore (filename, clearLi } }; -Logger.prototype.addLogRecord = function addLogRecord(page) { - var rec = {}; - rec.date = new Date(); - rec.url = page.doc.location.toString(); - rec.title = page.title; - var comment = prompts.prompt( - "Enter comments for this comment"); - if (comment && comment.length > 0) { - comment = comment.trim(); - rec.comment = comment; - var dateStr = utilMod.getISODate(rec.date); - var urlStr = urlMod.URL(rec.url).host; - var recKey = dateStr + "+" - + urlStr - + "+" + page.bugNo; - - if (myStorage.storage.logs[recKey]) { - myStorage.storage.logs[recKey].comment += "
\n" + comment; - } else { - myStorage.storage.logs[recKey] = rec; - } - } - return comment; -}; - Logger.prototype.getBugzillaAbbr = function(url) { // for https://bugzilla.redhat.com/show_bug.cgi?id=579123 get RH // for https://bugzilla.mozilla.org/show_bug.cgi?id=579123 get MoFo -- cgit