<commit_before>/*
* jQuery Mobile Framework : "listview" filter extension
* Copyright (c) jQuery Project
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function($, undefined ) {

$.mobile.listview.prototype.options.filter = false;

$( "[data-role='listview']" ).live( "listviewcreate", function() {
	var list = $( this ),
		listview = list.data( "listview" );
	if ( !listview.options.filter ) {
		return;
	}

	var wrapper = $( "<form>", { "class": "ui-listview-filter ui-bar-c", "role": "search" } ),
		
		search = $( "<input>", {
				placeholder: "Filter results...",
				"data-type": "search"
			})
			.bind( "keyup change", function() {
				var val = this.value.toLowerCase(),
						list_items = list.children();
				list_items.show();
				if ( val ) {
					// This handles hiding regular rows without the text we search for
					// and any list dividers without regular rows shown under it
					var any_in_the_bucket = false,
							item;
					
					for (var i = list_items.length; i >= 0; i--) {
						item = $(list_items[i]);
						if (item.is("li[data-role=list-divider]")) {
							if (!any_in_the_bucket) {
								item.hide();
							}
							// New bucket!
							any_in_the_bucket = false;
						} else if (item.text().toLowerCase().indexOf( val ) === -1) {
							item.hide();
						} else {
							// There's a shown item in the bucket
							any_in_the_bucket = true;
						}
					}
				}
				
				//listview._numberItems();
			})
			.appendTo( wrapper )
			.textinput();
	
	wrapper.insertBefore( list );
});

})( jQuery );<commit_msg>movied variables in listview filter to camel case convention used elsewhere<commit_after>/*
* jQuery Mobile Framework : "listview" filter extension
* Copyright (c) jQuery Project
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function($, undefined ) {

$.mobile.listview.prototype.options.filter = false;

$( "[data-role='listview']" ).live( "listviewcreate", function() {
	var list = $( this ),
		listview = list.data( "listview" );
	if ( !listview.options.filter ) {
		return;
	}

	var wrapper = $( "<form>", { "class": "ui-listview-filter ui-bar-c", "role": "search" } ),

		search = $( "<input>", {
				placeholder: "Filter results...",
				"data-type": "search"
			})
			.bind( "keyup change", function() {
				var val = this.value.toLowerCase(),
						listItems = list.children();
				listItems.show();
				if ( val ) {
					// This handles hiding regular rows without the text we search for
					// and any list dividers without regular rows shown under it
					var childItems = false,
							item;

					for (var i = listItems.length; i >= 0; i--) {
						item = $(listItems[i]);
						if (item.is("li[data-role=list-divider]")) {
							if (!childItems) {
								item.hide();
							}
							// New bucket!
							childItems = false;
						} else if (item.text().toLowerCase().indexOf( val ) === -1) {
							item.hide();
						} else {
							// There's a shown item in the bucket
							childItems = true;
						}
					}
				}
			})
			.appendTo( wrapper )
			.textinput();

	wrapper.insertBefore( list );
});

})( jQuery );
{'fraction_non_alphanumeric': 0.16340694006309148, 'fraction_numerical': 0.0018927444794952682, 'mean_word_length': 2.5629213483146067, 'pattern_counts': {'":': 6, '<': 7, '<?xml version=': 0, '>': 9, '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': '3611154', 'n_tokens_mistral': 1289, 'n_tokens_neox': 989, 'n_words': 273}