<commit_before>$.Redactor.prototype.WoltLabDropdown = function() {
	"use strict";
	
	return {
		init: function() {
			// prevent overflow: hidden on body while hovering dropdowns
			this.utils.disableBodyScroll = function() {};
			this.utils.enableBodyScroll = function() {};
			
			// disable slideUp effect for dropdowns on close
			this.WoltLabDropdown._hideAll();
			
			// disable slideDown effect for dropdowns on open
			// enforce dropdownMenu-like DOM
			this.WoltLabDropdown._show();
			
			// the original implementation didn't perform that well (especially with multiple
			// instance being launched at start) and suffered from too many live DOM manipulations
			this.dropdown.build = (function(name, $dropdown, dropdownObject) {
				dropdownObject = this.dropdown.buildFormatting(name, dropdownObject);
				
				var btnObject, fragment = document.createDocumentFragment();
				for (var btnName in dropdownObject) {
					if (dropdownObject.hasOwnProperty(btnName)) {
						btnObject = dropdownObject[btnName];
						
						var item = this.dropdown.buildItem(btnName, btnObject);
						
						this.observe.addDropdown($(item), btnName, btnObject);
						fragment.appendChild(item);
					}
				}
				
				if (fragment.children.length > 0) {
					$dropdown[0].rel = name;
					$dropdown[0].appendChild(fragment);
				}
			}).bind(this);
			
			this.dropdown.buildItem = (function(btnName, btnObject) {
				var itemContainer = elCreate('li');
				if (typeof btnObject.classname !== 'undefined') {
					itemContainer.classList.add(btnObject.classname);
				}
				
				if (btnName.toLowerCase().indexOf('divider') === 0) {
					itemContainer.classList.add('redactor-dropdown-divider');
					
					return itemContainer;
				}
				
				itemContainer.innerHTML = '<a href="#" class="redactor-dropdown-' + btnName + '" role="button"><span>' + btnObject.title + '</span></a>';
				itemContainer.children[0].addEventListener('mousedown', (function(event) {
					event.preventDefault();
					
					this.dropdown.buildClick(event, btnName, btnObject);
				}).bind(this));
				
				return itemContainer;
			}).bind(this);
		},
		
		_hideAll: function() {<commit_msg>IE11 does not expose `DocumentFragment.children`<commit_after>$.Redactor.prototype.WoltLabDropdown = function() {
	"use strict";
	
	return {
		init: function() {
			// prevent overflow: hidden on body while hovering dropdowns
			this.utils.disableBodyScroll = function() {};
			this.utils.enableBodyScroll = function() {};
			
			// disable slideUp effect for dropdowns on close
			this.WoltLabDropdown._hideAll();
			
			// disable slideDown effect for dropdowns on open
			// enforce dropdownMenu-like DOM
			this.WoltLabDropdown._show();
			
			// the original implementation didn't perform that well (especially with multiple
			// instance being launched at start) and suffered from too many live DOM manipulations
			this.dropdown.build = (function(name, $dropdown, dropdownObject) {
				dropdownObject = this.dropdown.buildFormatting(name, dropdownObject);
				
				var btnObject, fragment = document.createDocumentFragment();
				for (var btnName in dropdownObject) {
					if (dropdownObject.hasOwnProperty(btnName)) {
						btnObject = dropdownObject[btnName];
						
						var item = this.dropdown.buildItem(btnName, btnObject);
						
						this.observe.addDropdown($(item), btnName, btnObject);
						fragment.appendChild(item);
					}
				}
				
				var hasItems = false;
				for (var i = 0, length = fragment.childNodes.length; i < length; i++) {
					if (fragment.childNodes[i].nodeType === Node.ELEMENT_NODE) {
						hasItems = true;
						break;
					}
				}
				
				if (hasItems) {
					$dropdown[0].rel = name;
					$dropdown[0].appendChild(fragment);
				}
			}).bind(this);
			
			this.dropdown.buildItem = (function(btnName, btnObject) {
				var itemContainer = elCreate('li');
				if (typeof btnObject.classname !== 'undefined') {
					itemContainer.classList.add(btnObject.classname);
				}
				
				if (btnName.toLowerCase().indexOf('divider') === 0) {
					itemContainer.classList.add('redactor-dropdown-divider');
					
					return itemContainer;
				}
				
				itemContainer.innerHTML = '<a href="#" class="redactor-dropdown-' + btnName + '" role="button"><span>' + btnObject.title + '</span></a>';
				itemContainer.children[0].addEventListener('mousedown', (function(event) {
					event.preventDefault();
					
					this.dropdown.buildClick(event, btnName, btnObject);
				}).bind(this));
				
				return itemContainer;
			}).bind(this);
		},
		
		_hideAll: function() {
{'fraction_non_alphanumeric': 0.1299014238773275, 'fraction_numerical': 0.002628696604600219, 'mean_word_length': 3.2994350282485874, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '6890845', 'n_tokens_mistral': 1713, 'n_tokens_neox': 1274, 'n_words': 287}