From 9d43f129d4ad56dded752aa75c4dd2bb5af48b9e Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Sun, 7 Dec 2014 09:38:55 -0500 Subject: Fix stuff. --- src/bootstrap.js | 17 ++++++++++------- src/chrome.manifest | 5 +++-- src/chrome/content/options.xul | 2 +- src/chrome/skin/icon.png | Bin 0 -> 533 bytes src/chrome/skin/icon64.png | Bin 0 -> 751 bytes src/defaults/preferences/preferences.js | 1 - src/install.rdf | 2 ++ 7 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 src/chrome/skin/icon.png create mode 100644 src/chrome/skin/icon64.png delete mode 100644 src/defaults/preferences/preferences.js (limited to 'src') diff --git a/src/bootstrap.js b/src/bootstrap.js index 2625c92..b01697f 100644 --- a/src/bootstrap.js +++ b/src/bootstrap.js @@ -103,12 +103,13 @@ var WindowListener = { } window.addEventListener("load", onWindowLoad); }, - onCloseWindow: function(xulWindow) {}, - onWindowTitleChange: function(xulWindow, newTitle) {} }; var TrustedReparser = { observe: function () { + if (!EIB.prefs.prefHasUserValue("trusted")) { + EIB.prefs.setCharPref("trusted", "[]"); + } EIB.trusted = JSON.parse(EIB.prefs.getCharPref("trusted")); } }; @@ -118,7 +119,7 @@ function startup(data, reason) { EIB.prefs = Services.prefs.getBranch("extensions.eib."); EIB.prefs.addObserver("trusted", TrustedReparser, false); - reparseTrusted(); + TrustedReparser.observe(); forEachOpenWindow(loadIntoWindow); Services.wm.addListener(WindowListener); @@ -154,10 +155,12 @@ function injectCCPEVE(e) { if (checkTrusted(window.location.href)) { var CCPEVE = Cu.createObjectIn(window, {defineAs: "CCPEVE"}); ["openEveMail", "showInfo", "showPreview", "showRouteTo", "showMap", "showFitting", "showContract", "showMarketDetails", "setDestination", "addWaypoint", "joinChannel", "joinMailingList", "createContract", "buyType", "findInContracts", "addToMarketQuickBar", "addContact", "removeContact", "addCorpContact", "removeCorpContact", "block", "addBounty", "inviteToFleet", "startConversation", "showContracts", "showOnMap", "editMember", "awardDecoration", "sendMail", "showContents", "bookmark"].forEach(function (n) { - Cu.exportFunction(function () { - EIB.pending.push('CCPEVE.' + n + '(' + Array.prototype.join.call(arguments, ',') + ');'); - return null; - }, CCPEVE, {defineAs: n}); + Object.defineProperty(CCPEVE, n, { + value: Cu.exportFunction(function () { + EIB.pending.push('CCPEVE.' + n + '(' + Array.prototype.join.call(arguments, ',') + ');'); + return null; + }, CCPEVE) + }); }); } } diff --git a/src/chrome.manifest b/src/chrome.manifest index 87c823b..1983e73 100644 --- a/src/chrome.manifest +++ b/src/chrome.manifest @@ -1,2 +1,3 @@ -content eib chrome/content/ -locale eib en chrome/locale/en/ +content eib chrome/content/ +locale eib en chrome/locale/en/ +skin eib classic/1.0 chrome/skin/ diff --git a/src/chrome/content/options.xul b/src/chrome/content/options.xul index 29543ba..5f1c6f3 100644 --- a/src/chrome/content/options.xul +++ b/src/chrome/content/options.xul @@ -3,5 +3,5 @@ - + diff --git a/src/chrome/skin/icon.png b/src/chrome/skin/icon.png new file mode 100644 index 0000000..7acfcf1 Binary files /dev/null and b/src/chrome/skin/icon.png differ diff --git a/src/chrome/skin/icon64.png b/src/chrome/skin/icon64.png new file mode 100644 index 0000000..e2f2ff4 Binary files /dev/null and b/src/chrome/skin/icon64.png differ diff --git a/src/defaults/preferences/preferences.js b/src/defaults/preferences/preferences.js deleted file mode 100644 index baa73a8..0000000 --- a/src/defaults/preferences/preferences.js +++ /dev/null @@ -1 +0,0 @@ -pref("extensions.eib.trusted", "[]"); diff --git a/src/install.rdf b/src/install.rdf index 9295bbd..eb79f3c 100644 --- a/src/install.rdf +++ b/src/install.rdf @@ -13,6 +13,8 @@ true chrome://eib/content/options.xul 2 + chrome://eib/skin/icon.png + chrome://eib/skin/icon64.png -- cgit v1.2.3-70-g09d2