moduleAid.VERSION = '1.0.0';

this.loadInURLBar = function() {
	URLBarContainer.appendChild(addonBar);
	listenerAid.add(addonBar, 'ToggledAddonBar', openURLBarContainer);
	
	moveAddonBar();
	openURLBarContainer();
	moveContainer();
	autoHideContainer();
	
	if(prefAid.autoHide) {
		initHovers(); // the button would only be added after this had been called, mousing over it wouldn't work
	}
};

this.openURLBarContainer = function() {
	toggleAttribute(URLBarContainer, 'active', !addonBar.collapsed);
};

this.moveContainer = function() {
	styleAid.unload('moveContainer_'+_UUID);
	
	var sscode = '/*The Puzzle Piece CSS declarations of variable values*/\n';
	sscode += '@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);\n';
	sscode += '@-moz-document url("'+document.baseURI+'") {\n';
	sscode += '	window['+objName+'_UUID="'+_UUID+'"] #thePuzzlePiece-urlbar-addonbar-container[active] {\n';
	sscode += '		width: '+addonBar.clientWidth+'px;\n';
	sscode += '	}\n';
	sscode += '}';
	
	styleAid.load('moveContainer_'+_UUID, sscode, true);
};

this.autoHideContainer = function() {
	toggleAttribute(URLBarContainer, 'autohide', prefAid.autoHide);
};

moduleAid.LOADMODULE = function() {
	prefAid.listen('autoHide', autoHideContainer);
	
	listenerAid.add(addonBar, 'AddonBarMoved', moveContainer);
	
	overlayAid.overlayWindow(window, 'inURLBar', null, loadInURLBar);
};

moduleAid.UNLOADMODULE = function() {
	listenerAid.remove(addonBar, 'ToggledAddonBar', openURLBarContainer);
	listenerAid.remove(addonBar, 'AddonBarMoved', moveContainer);
	
	prefAid.unlisten('autoHide', autoHideContainer);
	
	bottomBox.insertBefore(addonBar, leftPP);
	overlayAid.removeOverlayWindow(window, 'inURLBar');
	
	styleAid.unload('moveContainer_'+_UUID);
	
	if(!UNLOADED) {
		moveAddonBar();
	}
};

@@ -22,13 +22,404 @@
 1.0.
-0
+1
 ';%0A%0A
+this.onCustomizing = function(e) %7B%0A%09tempMoveAddonBar(e.type == 'beforecustomization');%0A%7D;%0A%0A// I can't drag from the add-on bar when it's in the url bar, it only drags the whole url bar in this case%0Athis.tempMoveAddonBar = function(move) %7B%0A%09toggleAttribute(addonBar, 'inURLBar', !move);%0A%09if(move) %7B%0A%09%09bottomBox.appendChild(addonBar);%0A%09%7D else %7B%0A%09%09URLBarContainer.appendChild(addonBar);%0A%09%7D%0A%7D;%0A%0A
 this
@@ -557,16 +557,145 @@
 ner);%0A%09%0A
+%09listenerAid.add(window, 'beforecustomization', onCustomizing);%0A%09listenerAid.add(window, 'aftercustomization', onCustomizing);%0A%09%0A
 %09moveAdd
@@ -900,24 +900,109 @@
 n't work%0A%09%7D%0A
+%09%0A%09if(addonBar.getAttribute('customizing') == 'true') %7B%0A%09%09tempMoveAddonBar(true);%0A%09%7D%0A
 %7D;%0A%0Athis.ope
@@ -2167,16 +2167,151 @@
 ner);%0A%09%0A
+%09listenerAid.remove(window, 'beforecustomization', onCustomizing);%0A%09listenerAid.remove(window, 'aftercustomization', onCustomizing);%0A%09%0A
 %09prefAid

fix for customizing inURLBar