aboutsummaryrefslogtreecommitdiffstats
path: root/lib/logger.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/logger.js')
-rw-r--r--lib/logger.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/logger.js b/lib/logger.js
index ad7f4e9..3a534d4 100644
--- a/lib/logger.js
+++ b/lib/logger.js
@@ -4,6 +4,7 @@
var urlMod = require("url");
var urilMod = require("util");
var Color = require("color").Color;
+var tabs = require("tabs");
var Logger = exports.Logger = function Logger(store, abbsMap) {
this.EmptyLogsColor = new Color(0, 255, 0);
@@ -18,7 +19,7 @@ Logger.prototype.addLogRecord = function(that) {
rec.date = new Date();
rec.url = that.doc.location.toString();
rec.title = that.title;
- var comment = jetpack.tabs.focused.contentWindow.prompt(
+ var comment = tabs.activeTab.contentWindow.prompt(
"Enter comments for this comment");
if (comment && comment.length > 0) {
comment = comment.trim();
@@ -38,7 +39,6 @@ Logger.prototype.addLogRecord = function(that) {
} else {
this.store[recKey] = rec;
}
- jetpack.storage.simple.sync();
}
return comment;
};
@@ -98,13 +98,14 @@ Logger.prototype.createBlankPage = function (ttl, bodyBuildCB) {
var title = ttl || "Yet another untitled page";
var that = this;
- var logTab = jetpack.tabs.open("about:blank");
- jetpack.tabs.onReady(function() {
- var otherDoc = logTab.contentDocument;
- otherDoc.title = title;
- otherDoc.body.innerHTML = "<h1>" + title + "</h1>";
- bodyBuildCB.call(that, otherDoc.body);
- logTab.focus();
+ var logTab = tabs.open({
+ url: "about:blank",
+ onOpen: function (tab) {
+ var otherDoc = tab.contentDocument;
+ otherDoc.title = title;
+ otherDoc.body.innerHTML = "<h1>" + title + "</h1>";
+ bodyBuildCB.call(that, otherDoc.body);
+ }
});
};