From 87b9c2d6d0a1bda477f15af227d758c5fc3e55e0 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Sat, 19 Jun 2010 22:08:04 +0200 Subject: Loads a bug page without crash!!! There is not jetpack. call in used modules. --- lib/logger.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'lib/logger.js') 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 = "

" + title + "

"; - 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 = "

" + title + "

"; + bodyBuildCB.call(that, otherDoc.body); + } }); }; -- cgit