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

$.widget( "mobile.collapsible", $.mobile.widget, {
	options: {
		expandCueText: " click to expand contents",
		collapseCueText: " click to collapse contents",
		collapsed: true,
		heading: ">:header,>legend",
		theme: null,
		iconTheme: "d",
		initSelector: ":jqmData(role='collapsible')"
	},
	_create: function() {

		var $el = this.element,
			o = this.options,
			collapsible = $el.addClass( "ui-collapsible" ),
			collapsibleHeading = $el.find( o.heading ).eq( 0 ),
			collapsibleContent = collapsible.wrapInner( "<div class='ui-collapsible-content'></div>" ).find( ".ui-collapsible-content" ),
			collapsibleParent = $el.closest( ":jqmData(role='collapsible-set')" ).addClass( "ui-collapsible-set" );

		// Replace collapsibleHeading if it's a legend
		if ( collapsibleHeading.is( "legend" ) ) {
			collapsibleHeading = $( "<div role='heading'>"+ collapsibleHeading.html() +"</div>" ).insertBefore( collapsibleHeading );
			collapsibleHeading.next().remove();
		}

		collapsibleHeading
			//drop heading in before content
			.insertBefore( collapsibleContent )
			//modify markup & attributes
			.addClass( "ui-collapsible-heading" )
			.append( "<span class='ui-collapsible-heading-status'></span>" )
			.wrapInner( "<a href='#' class='ui-collapsible-heading-toggle'></a>" )
			.find( "a:eq(0)" )
				.buttonMarkup({
					shadow: false,
					corners: false,
					iconPos: "left",
					icon: "plus",
					theme: o.theme
				})

		if ( !collapsibleParent.length ) {
			collapsibleHeading
				.find( "a:eq(0), .ui-btn-inner" )
					.addClass( "ui-corner-top ui-corner-bottom" );
		} else {
			if ( collapsible.jqmData( "collapsible-last" ) ) {
				collapsibleHeading
					.find( "a:eq(0), .ui-btn-inner" )
						.addClass( "ui-corner-bottom" );
			}
		}

		// Close others in a set
		if ( collapsibleParent.length && !collapsibleParent.jqmData( "collapsiblebound" ) ) {

			collapsibleParent
				.jqmData( "collapsiblebound", true )
				.bind( "expand", function( event ) {

					$( event.target )
						.closest( ".ui-collapsible" )
						.siblings( ".ui-collapsible" )
						.trigger( "collapse" );

				});

			var set = collapsibleParent.children( ":jqmData(role='collapsible')" );

			set.jqmData( "content-theme", collapsibleParent.jqmData( "content-theme" ) );

			set.first()
				.find( "a:eq(0)" )
					.addClass( "ui-corner-top" )
						.find( ".ui-btn-inner" )
							.addClass( "ui-corner-top" );

			set.last()
				.jqmData( "collapsible-last", true )
				.find( "a:eq(0)" )
					.addClass( "ui-corner-bottom" )
						.find( ".ui-btn-inner" )
							.addClass( "ui-corner-bottom" );
		}<commit_msg>Set content-theme to collapsible in a set only if it's not already set<commit_after>/*
* jQuery Mobile Framework : "collapsible" plugin
* Copyright (c) jQuery Project
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*/
(function( $, undefined ) {

$.widget( "mobile.collapsible", $.mobile.widget, {
	options: {
		expandCueText: " click to expand contents",
		collapseCueText: " click to collapse contents",
		collapsed: true,
		heading: ">:header,>legend",
		theme: null,
		iconTheme: "d",
		initSelector: ":jqmData(role='collapsible')"
	},
	_create: function() {

		var $el = this.element,
			o = this.options,
			collapsible = $el.addClass( "ui-collapsible" ),
			collapsibleHeading = $el.find( o.heading ).eq( 0 ),
			collapsibleContent = collapsible.wrapInner( "<div class='ui-collapsible-content'></div>" ).find( ".ui-collapsible-content" ),
			collapsibleParent = $el.closest( ":jqmData(role='collapsible-set')" ).addClass( "ui-collapsible-set" );

		// Replace collapsibleHeading if it's a legend
		if ( collapsibleHeading.is( "legend" ) ) {
			collapsibleHeading = $( "<div role='heading'>"+ collapsibleHeading.html() +"</div>" ).insertBefore( collapsibleHeading );
			collapsibleHeading.next().remove();
		}

		collapsibleHeading
			//drop heading in before content
			.insertBefore( collapsibleContent )
			//modify markup & attributes
			.addClass( "ui-collapsible-heading" )
			.append( "<span class='ui-collapsible-heading-status'></span>" )
			.wrapInner( "<a href='#' class='ui-collapsible-heading-toggle'></a>" )
			.find( "a:eq(0)" )
				.buttonMarkup({
					shadow: false,
					corners: false,
					iconPos: "left",
					icon: "plus",
					theme: o.theme
				})

		if ( !collapsibleParent.length ) {
			collapsibleHeading
				.find( "a:eq(0), .ui-btn-inner" )
					.addClass( "ui-corner-top ui-corner-bottom" );
		} else {
			if ( collapsible.jqmData( "collapsible-last" ) ) {
				collapsibleHeading
					.find( "a:eq(0), .ui-btn-inner" )
						.addClass( "ui-corner-bottom" );
			}
		}

		// Close others in a set
		if ( collapsibleParent.length && !collapsibleParent.jqmData( "collapsiblebound" ) ) {

			collapsibleParent
				.jqmData( "collapsiblebound", true )
				.bind( "expand", function( event ) {

					$( event.target )
						.closest( ".ui-collapsible" )
						.siblings( ".ui-collapsible" )
						.trigger( "collapse" );

				});

			var set = collapsibleParent.children( ":jqmData(role='collapsible')" );

			set.each(function() {
				var $this = $( this );
				if ( !$this.jqmData( "content-theme" ) ) {
					$this.jqmData( "content-theme", collapsibleParent.jqmData( "content-theme" ) );
				}
			});

			set.first()
				.find( "a:eq(0)" )
					.addClass( "ui-corner-top" )
						.find( ".ui-btn-inner" )
							.addClass( "ui-corner-top" );

			set.last()
				.jqmData( "collapsible-last", true )
				.find( "a:eq(0)" )
					.addClass( "ui-corner-bottom" )
						.find( ".ui-btn-inner" )
							.addClass( "ui-corner-bottom" );
		}
{'fraction_non_alphanumeric': 0.17441262219173384, 'fraction_numerical': 0.0024009603841536613, 'mean_word_length': 3.238372093023256, 'pattern_counts': {'":': 6, '<': 19, '<?xml version=': 0, '>': 23, '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': '6589627', 'n_tokens_mistral': 2496, 'n_tokens_neox': 2045, 'n_words': 409}