Merge branch 'uninstall' into pref2

Conflicts:
	modules/window.js
This commit is contained in:
saneyuki_s 2013-01-03 10:01:03 +09:00
commit e32cb52068
3 changed files with 26 additions and 2 deletions

View File

@ -16,7 +16,6 @@
<script src="res/stopRendering.js" type="application/javascript"/>
<script src="res/tabsDragUtils.js" type="application/javascript"/>
<script src="res/UninstallationListener.js" type="application/javascript"/>
<script src="treestyletab.js" type="application/javascript"/>
<script src="windowHelper.js" type="application/javascript"/>
<script src="windowHelperHacks.js" type="application/javascript"/>

View File

@ -13,6 +13,24 @@
original:
http://github.com/piroor/fxaddonlibs/blob/master/UninstallationListener.js
*/
/* To work as a JS Code Module */
if (typeof window == 'undefined' ||
(window && typeof window.constructor == 'function')) {
this.EXPORTED_SYMBOLS = ['UninstallationListener'];
// If namespace.jsm is available, export symbols to the shared namespace.
// See: http://github.com/piroor/fxaddonlibs/blob/master/namespace.jsm
try {
let ns = {};
Components.utils.import('resource://my-modules/namespace.jsm', ns);
/* var */ window = ns.getNamespaceFor('piro.sakura.ne.jp');
}
catch(e) {
window = {};
}
}
(function() {
const currentRevision = 2;
@ -165,3 +183,7 @@
}
};
})();
if (window != this) { // work as a JS Code Module
this.UninstallationListener = window['piro.sakura.ne.jp'].UninstallationListener;
}

View File

@ -42,6 +42,9 @@ Components.utils.import('resource://gre/modules/XPCOMUtils.jsm');
XPCOMUtils.defineLazyModuleGetter(this, "prefs",
'resource://treestyletab-modules/lib/prefs.js');
XPCOMUtils.defineLazyModuleGetter(this, 'UninstallationListener',
'resource://treestyletab-modules/lib/UninstallationListener.js');
XPCOMUtils.defineLazyModuleGetter(this, "Services", "resource://gre/modules/Services.jsm");
Components.utils.import('resource://treestyletab-modules/base.js');
@ -410,7 +413,7 @@ TreeStyleTabWindow.prototype = {
prefs.clearPref(pref+'.backup');
}
}.bind(this);
new this.window['piro.sakura.ne.jp'].UninstallationListener({
new UninstallationListener({
id : 'treestyletab@piro.sakura.ne.jp',
onuninstalled : restorePrefs,
ondisabled : restorePrefs