<commit_before>//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
//>>description: Responsive presentation and behavior for HTML data panels
//>>label: Panel
//>>group: Widgets
//>>css.structure: ../css/structure/jquery.mobile.panel.css
//>>css.theme: ../css/themes/default/jquery.mobile.theme.css

define( [ "jquery", "../jquery.mobile.widget", "./page", "./page.sections" ], function( $ ) {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

$.widget( "mobile.panel", $.mobile.widget, {
	options: {
		classes: {
			panel: "ui-panel"
		},
		theme: null,
		position: "left",
		dismissible: true,
		display: "pan",
		initSelector: ":jqmData(role='panel')"
	},
	_handleLink: function( roleType , callback ){
		var elId = this.element.attr( "id" ),
			self = this;
		$( document ).on( "click" , "a", function( e ) {
			var $link = $( this ),
				id = $link.attr( "href" ).split( "#" )[1];
			if( elId === id ){
				e.preventDefault();
				callback.call( self , $link , id );
				return false;
			}
		});
	},
	_blockPage: function( options ){
		var deferred = $.Deferred();
		var $div = $( "<div>" ),
			$panel = this,
			slideDir = options.position === "left" ? "right" : "left",
			clickable = options.dismissible && options.display !== "push",
			klass = clickable ? "ui-panel-dismiss" : "ui-panel-no-dismiss";
		setTimeout(function(){
			$div.addClass( "ui-panel-dismiss-overlay" )
				.css( "height" , $.mobile.activePage.height() )
				.css( slideDir , 0 )
				.attr( "id" , "page-block" )
				.addClass( klass )
				.appendTo( $.mobile.activePage );
			if( clickable ){
				$div.bind( "vclick" , function(){
					$panel.close();
				});
			}
			deferred.resolve();
		}, 0); // TODO get rid of setTimeout 0 hacks
		return deferred.promise();
	},
	_create: function() {
		var o = this.options,
			klass = o.classes.panel,
			$el = this.element,
			$closeLink = $el.find( "[data-rel=close]" );
		$el.addClass( klass );
		$el.parents( "[data-role=page]" ).addClass( "panel-page" );
		if( o.theme ){
			$el.addClass( "ui-body-" + o.theme );
		}
		this._handleLink( "panel" , function( $link , id ){
			var options = $.extend( {} , this.options ),
				op = {<commit_msg>Make tests pass by making sure deferreds are passing vars when resolved<commit_after>//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);
//>>description: Responsive presentation and behavior for HTML data panels
//>>label: Panel
//>>group: Widgets
//>>css.structure: ../css/structure/jquery.mobile.panel.css
//>>css.theme: ../css/themes/default/jquery.mobile.theme.css

define( [ "jquery", "../jquery.mobile.widget", "./page", "./page.sections" ], function( $ ) {
//>>excludeEnd("jqmBuildExclude");
(function( $, undefined ) {

$.widget( "mobile.panel", $.mobile.widget, {
	options: {
		classes: {
			panel: "ui-panel"
		},
		theme: null,
		position: "left",
		dismissible: true,
		display: "pan",
		initSelector: ":jqmData(role='panel')"
	},
	_handleLink: function( roleType , callback ){
		var elId = this.element.attr( "id" ),
			self = this;
		$( document ).on( "click" , "a", function( e ) {
			var $link = $( this ),
				id = $link.attr( "href" ).split( "#" )[1];
			if( elId === id ){
				e.preventDefault();
				callback.call( self , $link , id );
				return false;
			}
		});
	},
	_blockPage: function( options ){
		var deferred = $.Deferred();
		var $div = $( "<div>" ),
			$panel = this,
			slideDir = options.position === "left" ? "right" : "left",
			clickable = options.dismissible && options.display !== "push",
			klass = clickable ? "ui-panel-dismiss" : "ui-panel-no-dismiss";
		setTimeout(function(){
			$div.addClass( "ui-panel-dismiss-overlay" )
				.css( "height" , $.mobile.activePage.height() )
				.css( slideDir , 0 )
				.attr( "id" , "page-block" )
				.addClass( klass )
				.appendTo( $.mobile.activePage );
			if( clickable ){
				$div.bind( "vclick" , function(){
					$panel.close();
				});
			}
			deferred.resolve( options );
		}, 0); // TODO get rid of setTimeout 0 hacks
		return deferred.promise();
	},
	_create: function() {
		var o = this.options,
			klass = o.classes.panel,
			$el = this.element,
			$closeLink = $el.find( "[data-rel=close]" );
		$el.addClass( klass );
		$el.parents( "[data-role=page]" ).addClass( "panel-page" );
		if( o.theme ){
			$el.addClass( "ui-body-" + o.theme );
		}
		this._handleLink( "panel" , function( $link , id ){
			var options = $.extend( {} , this.options ),
				op = {
{'fraction_non_alphanumeric': 0.20498988536749832, 'fraction_numerical': 0.0017981568891885817, 'mean_word_length': 3.2300380228136882, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 33, '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': '3055775', 'n_tokens_mistral': 1768, 'n_tokens_neox': 1540, 'n_words': 350}