<commit_before>/**
* Adds Power Point Widget Support
*/
( function( mw, $ ) {


mw.KPPTWidget = function(){
	this.init.apply( this, $.makeArray( arguments ) );
};
mw.KPPTWidget.prototype = {
	// The playerId
	playerId : null,
	
	// The set of functions to run on progress updates ( things like playhead, progress bar, buffer )
	progressBindings: [],
	
	// Set of functions run once player is "ready"
	readyBindings:[],
	
	// @@TODO MOVE to css file
	icons: {
		'YelloTag' : '<KEY>',
		'RedTag' : '<KEY>
		'PlayArrow' : '<KEY>
		'DoubleArrowRight' : '<KEY>
		'DoubleArrowLeft' : '<KEY>
		'PauseBtn' : '<KEY>'
	},
	
	init: function( widgetTarget, uiConf, callback ){
		var _this = this;
		mw.log('mw.KPPTWidget::init');
		this.$uiConf = $( uiConf );
		this.$target = $( widgetTarget );

		// update the playerId mapping: 
		this.playerId = this.$target.attr('id');
		this.$target.attr('id', this.playerId + '_pptContainer' );
		
		
		this.flashvar = $( widgetTarget ).data( 'flashvars' );
		// Setup the layout object via KLayout
		/*this.layout = new mw.KLayout({
			'$layoutBox' : this.$uiConf.find('#topLevel'),
			'evaluateCallback' : this.evaluateProperty,
			'getEmbedPlayerCallback' : function(){
				return _this.getEmbedPlayer();
			}
		});
		this.$target.empty().append(
			this.layout.getLayout()
		);*/
		
		// hack the layout with "fixed" layout for now: 
		this.addFixedLayout();
		// Update embed player
		this.$target.find( 'video' ).embedPlayer( function(){
			// Add bindings
			_this.addBindings();
			if( callback )
				callback();
		});
				
	},
	/**
	 * Do some simple checks but mostly hard coded layout
	 * @return layout dom
	 */
	addFixedLayout:function(){
		var _this = this;
		// Setup the container with target 
		
		// Find out if the video is on the left or right
		var $PlayerHolderWrapper = this.$uiConf.find( '#PlayerHolderWrapper');
		
		
		var playerFirst = ( $PlayerHolderWrapper.find('Canvas:first-child').attr('id') == 'pptWidgetScreenWrapper' )?
				false : true;

		// Setup up pointers to important layout tags: 
		var $ControllerScreenHolder = this.$uiConf.find( '#ControllerScreenHolder' );
		var $pptWidgetScreenWrapper = this.$uiConf.find('#pptWidgetScreenWrapper');
		this.$target.append(
			// Image container: 
			$('<div />')
			.addClass( 'pptWidgetScreenWrapper' )
			.css({
				'width' : $pptWidgetScreenWrapper.attr( 'width' ) + '%',
				'top' : '0px',
				'bottom' : $ControllerScreenHolder.attr( 'height' ),
				'position' : 'absolute',
				'left': '0px'
			})
		);
		
		// Set up the video player and give it layout size ( give it the max size available, 
		// this wont hurt layout since it will be fixed to natural size. 
		this.$target.append(
			$('<div />').append(
				this.getVideoTag().attr({
					'width' : this.$target.width() - this.$target.find('.pptWidgetScreenWrapper').width(),
					'height' :  this.$target.height() - $ControllerScreenHolder.attr( 'height' )
				})
			).css({
				'top' : '0px',
				'right' : '0px',
				'position' : 'absolute'
			})
		);

		// Setup the control bar container:
		this.$target.append(
			$('<div />')
			.addClass( 'ControllerScreenHolder' )
			// Todo look up style based on 'styleName' attribute
			.css({
				'height' : $ControllerScreenHolder.attr( 'height' ),
				'position' : 'absolute',
				'bottom' : '0px',
				'left' : '0px',
				'right' : '0px',
				'background-color' : '#DDD',
				'background-image' : '-webkit-gradient(linear, left top, left bottom, from(#FFF), to(#CCC))',
				'background-image' : '-moz-linear-gradient(top, #FFF, #CCC)'
			})
		);
		// Check for Scrubber
		var $scrubContainer = $ControllerScreenHolder.find('#scrubberContainer');
		if( $scrubContainer.length ){
			this.addScrubber( this.$target.find( '.ControllerScreenHolder' ), $scrubContainer );
		}
		
		// Add the play and slide jump buttons
		this.getSyncPlayButtons( this.$target.find( '.ControllerScreenHolder' ), $ControllerScreenHolder )
		
	},
	getSyncPlayButtons: function( $target, $syncButtonsConfig){
		// add a center div
		var $syncButtonsContainer = $('<div />').css({
				'position' : 'absolute',
				'top' : '20px',
				'left' : ( this.$target.width() / 2 )- 100,
				'width': '300px'
			})
			.addClass( 'syncButtonsContainer' )
		var baseButtonCss = {
			'position' : 'relative',
			'border' : 'solid thin black',
			'-moz-border-radius' : '3px',
			'border-radius' : '3px',
			'margin' : '5px',
			'float' : 'left',
			'background-image' : '-webkit-gradient(linear, left top, left bottom, from(#AAA), to(#666))',
			'background-image' : '-moz-linear-gradient(top, #AAA, #666)'
		};
		// check for prev 
		$prvConf = $syncButtonsConfig.find('#syncPrevButton');
		if( $prvConf.length ){
			$syncButtonsContainer.append( 
				$('<div />')
				.css( baseButtonCss )
				.css({
					'top' : '5px',
					'width' :$prvConf.attr('minWidth'),
					'height' : $prvConf.attr('minHeight')
				})
				.append( 
					$('<img />').attr('src',  this.getIconSrc( 'DoubleArrowLeft' ) )
					.css({
						'position' : 'absolute',<commit_msg>tweek button gradient <commit_after>/**
* Adds Power Point Widget Support
*/
( function( mw, $ ) {


mw.KPPTWidget = function(){
	this.init.apply( this, $.makeArray( arguments ) );
};
mw.KPPTWidget.prototype = {
	// The playerId
	playerId : null,
	
	// The set of functions to run on progress updates ( things like playhead, progress bar, buffer )
	progressBindings: [],
	
	// Set of functions run once player is "ready"
	readyBindings:[],
	
	// @@TODO MOVE to css file
	icons: {
		'YelloTag' : '<KEY>',
		'RedTag' : '<KEY>
		'PlayArrow' : '<KEY>
		'DoubleArrowRight' : '<KEY>
		'DoubleArrowLeft' : '<KEY>
		'PauseBtn' : '<KEY>'
	},
	
	init: function( widgetTarget, uiConf, callback ){
		var _this = this;
		mw.log('mw.KPPTWidget::init');
		this.$uiConf = $( uiConf );
		this.$target = $( widgetTarget );

		// update the playerId mapping: 
		this.playerId = this.$target.attr('id');
		this.$target.attr('id', this.playerId + '_pptContainer' );
		
		
		this.flashvar = $( widgetTarget ).data( 'flashvars' );
		// Setup the layout object via KLayout
		/*this.layout = new mw.KLayout({
			'$layoutBox' : this.$uiConf.find('#topLevel'),
			'evaluateCallback' : this.evaluateProperty,
			'getEmbedPlayerCallback' : function(){
				return _this.getEmbedPlayer();
			}
		});
		this.$target.empty().append(
			this.layout.getLayout()
		);*/
		
		// hack the layout with "fixed" layout for now: 
		this.addFixedLayout();
		// Update embed player
		this.$target.find( 'video' ).embedPlayer( function(){
			// Add bindings
			_this.addBindings();
			if( callback )
				callback();
		});
				
	},
	/**
	 * Do some simple checks but mostly hard coded layout
	 * @return layout dom
	 */
	addFixedLayout:function(){
		var _this = this;
		// Setup the container with target 
		
		// Find out if the video is on the left or right
		var $PlayerHolderWrapper = this.$uiConf.find( '#PlayerHolderWrapper');
		
		
		var playerFirst = ( $PlayerHolderWrapper.find('Canvas:first-child').attr('id') == 'pptWidgetScreenWrapper' )?
				false : true;

		// Setup up pointers to important layout tags: 
		var $ControllerScreenHolder = this.$uiConf.find( '#ControllerScreenHolder' );
		var $pptWidgetScreenWrapper = this.$uiConf.find('#pptWidgetScreenWrapper');
		this.$target.append(
			// Image container: 
			$('<div />')
			.addClass( 'pptWidgetScreenWrapper' )
			.css({
				'width' : $pptWidgetScreenWrapper.attr( 'width' ) + '%',
				'top' : '0px',
				'bottom' : $ControllerScreenHolder.attr( 'height' ),
				'position' : 'absolute',
				'left': '0px'
			})
		);
		
		// Set up the video player and give it layout size ( give it the max size available, 
		// this wont hurt layout since it will be fixed to natural size. 
		this.$target.append(
			$('<div />').append(
				this.getVideoTag().attr({
					'width' : this.$target.width() - this.$target.find('.pptWidgetScreenWrapper').width(),
					'height' :  this.$target.height() - $ControllerScreenHolder.attr( 'height' )
				})
			).css({
				'top' : '0px',
				'right' : '0px',
				'position' : 'absolute'
			})
		);

		// Setup the control bar container:
		this.$target.append(
			$('<div />')
			.addClass( 'ControllerScreenHolder' )
			// Todo look up style based on 'styleName' attribute
			.css({
				'height' : $ControllerScreenHolder.attr( 'height' ),
				'position' : 'absolute',
				'bottom' : '0px',
				'left' : '0px',
				'right' : '0px',
				'background-color' : '#DDD',
				'background-image' : '-webkit-gradient(linear, left top, left bottom, from(#FFF), to(#CCC))',
				'background-image' : '-moz-linear-gradient(top, #FFF, #CCC)'
			})
		);
		// Check for Scrubber
		var $scrubContainer = $ControllerScreenHolder.find('#scrubberContainer');
		if( $scrubContainer.length ){
			this.addScrubber( this.$target.find( '.ControllerScreenHolder' ), $scrubContainer );
		}
		
		// Add the play and slide jump buttons
		this.getSyncPlayButtons( this.$target.find( '.ControllerScreenHolder' ), $ControllerScreenHolder )
		
	},
	getSyncPlayButtons: function( $target, $syncButtonsConfig){
		// add a center div
		var $syncButtonsContainer = $('<div />').css({
				'position' : 'absolute',
				'top' : '20px',
				'left' : ( this.$target.width() / 2 )- 100,
				'width': '300px'
			})
			.addClass( 'syncButtonsContainer' )
		var baseButtonCss = {
			'position' : 'relative',
			'border' : 'solid thin black',
			'-moz-border-radius' : '3px',
			'border-radius' : '3px',
			'margin' : '5px',
			'float' : 'left',
			'background-image' : '-webkit-gradient(linear, left top, left bottom, from(#FFF), to(#BBB))',
			'background-image' : '-moz-linear-gradient(top, #FFF, #BBB)'
		};
		// check for prev 
		$prvConf = $syncButtonsConfig.find('#syncPrevButton');
		if( $prvConf.length ){
			$syncButtonsContainer.append( 
				$('<div />')
				.css( baseButtonCss )
				.css({
					'top' : '5px',
					'width' :$prvConf.attr('minWidth'),
					'height' : $prvConf.attr('minHeight')
				})
				.append( 
					$('<img />').attr('src',  this.getIconSrc( 'DoubleArrowLeft' ) )
					.css({
						'position' : 'absolute',
{'fraction_non_alphanumeric': 0.17683834474545995, 'fraction_numerical': 0.004564850649995038, 'mean_word_length': 3.2994880546075085, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '917902', 'n_tokens_mistral': 3954, 'n_tokens_neox': 3317, 'n_words': 790}