<commit_before>moduleAid.VERSION = '1.0.2';

this.openURIBar = function(button) {
	var broadcaster = $(button.getAttribute('broadcaster'));
	
	var anchor = $(broadcaster.getAttribute('anchor'));
	// If the button is opened in the panel, we need to change the anchor to the actual toolbar
	if(isAncestor(button, panel)) {
		anchor = button.parentNode;
	}
	
	$(broadcaster.getAttribute('menu')).style.width = anchor.clientWidth -2 +'px';
	$(broadcaster.getAttribute('menu')).openPopup(anchor, 'after_start');
};

// Set the value of the developers tools URI bar to the value in the broadcaster
this.resetURIBar = function(menu) {
	var broadcaster = $(menu.getAttribute('broadcaster'));
	
	$(broadcaster.getAttribute('textbar')).value = broadcaster.getAttribute('sidebarurl');
	$(broadcaster.getAttribute('textbar')).focus();
	$(broadcaster.getAttribute('textbar')).select();
	
	dispatch($(broadcaster.getAttribute('anchor')), {
		type: 'openGoURIBar',
		cancelable: false,
		detail: { bar: ($(broadcaster.getAttribute('anchor')) == twinSidebar.header) ? twinSidebar : mainSidebar }
	});
};

// loses focus from the texbox
this.blurURIBar = function(menu) {
	var broadcaster = $(menu.getAttribute('broadcaster'));
	
	$('main-window').focus();
	
	dispatch($(broadcaster.getAttribute('anchor')), {
		type: 'closeGoURIBar',
		cancelable: false,
		detail: { bar: ($(broadcaster.getAttribute('anchor')) == twinSidebar.header) ? twinSidebar : mainSidebar }
	});
};

// Loads the uri bar value into the sidebar
this.loadURIBar = function(button) {
	var broadcaster = $(button.getAttribute('broadcaster'));
	
	if($(broadcaster.getAttribute('textbar')).value.indexOf('about:') !== 0 && $(broadcaster.getAttribute('textbar')).value.indexOf('chrome://') !== 0) { return; }
	
	blurURIBar($(broadcaster.getAttribute('menu')));
	$(broadcaster.getAttribute('menu')).hidePopup();
	
	broadcaster.setAttribute('sidebarurl', $(broadcaster.getAttribute('textbar')).value);
	broadcaster.setAttribute('sidebartitle', $(broadcaster.getAttribute('textbar')).value);
	broadcaster.removeAttribute('checked'); // To make sure it always loads the sidebar from the same broadcaster
	toggleSidebar(broadcaster);
};

this.keydownURIBar = function(e, box) {
	var broadcaster = $(box.getAttribute('broadcaster'));
	
	switch(e.keyCode) {
		case e.DOM_VK_ESCAPE:
			blurURIBar($(broadcaster.getAttribute('menu')));
			$(broadcaster.getAttribute('menu')).hidePopup();
			return false;
		
		case e.DOM_VK_RETURN:
		case e.DOM_VK_ENTER:
			loadURIBar($(broadcaster.getAttribute('goButton')));
			return true;<commit_msg>this keycode is no longer valid (and never was)<commit_after>moduleAid.VERSION = '1.0.3';

this.openURIBar = function(button) {
	var broadcaster = $(button.getAttribute('broadcaster'));
	
	var anchor = $(broadcaster.getAttribute('anchor'));
	// If the button is opened in the panel, we need to change the anchor to the actual toolbar
	if(isAncestor(button, panel)) {
		anchor = button.parentNode;
	}
	
	$(broadcaster.getAttribute('menu')).style.width = anchor.clientWidth -2 +'px';
	$(broadcaster.getAttribute('menu')).openPopup(anchor, 'after_start');
};

// Set the value of the developers tools URI bar to the value in the broadcaster
this.resetURIBar = function(menu) {
	var broadcaster = $(menu.getAttribute('broadcaster'));
	
	$(broadcaster.getAttribute('textbar')).value = broadcaster.getAttribute('sidebarurl');
	$(broadcaster.getAttribute('textbar')).focus();
	$(broadcaster.getAttribute('textbar')).select();
	
	dispatch($(broadcaster.getAttribute('anchor')), {
		type: 'openGoURIBar',
		cancelable: false,
		detail: { bar: ($(broadcaster.getAttribute('anchor')) == twinSidebar.header) ? twinSidebar : mainSidebar }
	});
};

// loses focus from the texbox
this.blurURIBar = function(menu) {
	var broadcaster = $(menu.getAttribute('broadcaster'));
	
	$('main-window').focus();
	
	dispatch($(broadcaster.getAttribute('anchor')), {
		type: 'closeGoURIBar',
		cancelable: false,
		detail: { bar: ($(broadcaster.getAttribute('anchor')) == twinSidebar.header) ? twinSidebar : mainSidebar }
	});
};

// Loads the uri bar value into the sidebar
this.loadURIBar = function(button) {
	var broadcaster = $(button.getAttribute('broadcaster'));
	
	if($(broadcaster.getAttribute('textbar')).value.indexOf('about:') !== 0 && $(broadcaster.getAttribute('textbar')).value.indexOf('chrome://') !== 0) { return; }
	
	blurURIBar($(broadcaster.getAttribute('menu')));
	$(broadcaster.getAttribute('menu')).hidePopup();
	
	broadcaster.setAttribute('sidebarurl', $(broadcaster.getAttribute('textbar')).value);
	broadcaster.setAttribute('sidebartitle', $(broadcaster.getAttribute('textbar')).value);
	broadcaster.removeAttribute('checked'); // To make sure it always loads the sidebar from the same broadcaster
	toggleSidebar(broadcaster);
};

this.keydownURIBar = function(e, box) {
	var broadcaster = $(box.getAttribute('broadcaster'));
	
	switch(e.keyCode) {
		case e.DOM_VK_ESCAPE:
			blurURIBar($(broadcaster.getAttribute('menu')));
			$(broadcaster.getAttribute('menu')).hidePopup();
			return false;
		
		case e.DOM_VK_RETURN:
			loadURIBar($(broadcaster.getAttribute('goButton')));
			return true;
{'fraction_non_alphanumeric': 0.1702456954923583, 'fraction_numerical': 0.0023215322112594312, 'mean_word_length': 6.024456521739131, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2730355', 'n_tokens_mistral': 1677, 'n_tokens_neox': 1597, 'n_words': 311}