<commit_before>/*
 * jRecorder Plugin for jQuery JavaScript Library (Alpha)
 * http://www.sajithmr.me/jrecorder
 *
 * Copyright (c) 2011 - 2013 Sajithmr.ME
 * Dual licensed under the MIT and GPL licenses.
 *  - http://www.opensource.org/licenses/mit-license.php
 *  - http://www.gnu.org/copyleft/gpl.html
 *
 * Author: <NAME>
 * Version: 1.1
 * Date: 14 December 2011
 */

/* Code is not verified using http://www.jshint.com/ */


(function ($){
	
	
	var methods = {
    	play : function( options ) { 
					
					alert(options);
				
	 			},
    	pause : function( ) { }
    
  	};

	
	var jRecorderSettings = {} ;
	
	$.jRecorder = function( options, element ) {
		// allow instantiation without initializing for simple inheritance
		
		
		if(typeof(options) == "string")
		{
			if ( methods[options] ) 
			{
				return methods[ options ].apply( this, Array.prototype.slice.call( arguments, 1 ));
				
			}
			return false;
		}
		
		//if the element to be appended is not defind, append to body
		if(element == undefined)
		{
			element = $("body");
		}
			
		//default settings
						var settings = {
		
						'rec_width': '300',
						'rec_height': '200',
						'rec_top': '0px',
						'rec_left': '0px',
						'recorderlayout_id' : 'flashrecarea',
						'recorder_id' : 'audiorecorder',
						'recorder_name': 'audiorecorder',
						'wmode' : 'transparent',
						'bgcolor': '#ff0000',
						'swf_path': 'jRecorder.swf',
						'host': 'acceptfile.php?filename=hello.wav',
						'callback_started_recording' : function(){},
						'callback_finished_recording' : function(){},
						'callback_stopped_recording': function(){},
						'callback_error_recording' : function(){},
						'callback_activityTime': function(time){},
						'callback_activityLevel' : function(level){}
						
						
						
		
		
						};
	
	
						//if option array is passed, merget the values
						if ( options ) { 
					        $.extend( settings, options );
					     }
		
						jRecorderSettings = settings;
						
						
						
							if($.browser.msie && Number($.browser.version) <= 8) {
							var objStr = '<object  name="'+ settings['recorder_name'] +'" id="' + settings['recorder_id'] + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="'+ settings['rec_width'] +'" height="'+ settings['rec_height']+'"></object>';

							var paramStr = [
								'<param name="movie" value="'+ settings['swf_path'] + '?host=' + settings['host'] +  '" />',
								
								'<param name="allowScriptAccess" value="always" />',
								'<param name="bgcolor" value="' + settings['bgcolor'] + '" />',
								'<param name="wmode" value="' +  settings['wmode'] + '" />'
							];

							htmlObj = document.createElement(objStr);
							for(var i=0; i < paramStr.length; i++) {
								htmlObj.appendChild(document.createElement(paramStr[i]));
							}<commit_msg>fixed issue when checking if browser is IE; jquery doesn't have browser method from version > 1.9<commit_after>/*
 * jRecorder Plugin for jQuery JavaScript Library (Alpha)
 * http://www.sajithmr.me/jrecorder
 *
 * Copyright (c) 2011 - 2013 Sajithmr.ME
 * Dual licensed under the MIT and GPL licenses.
 *  - http://www.opensource.org/licenses/mit-license.php
 *  - http://www.gnu.org/copyleft/gpl.html
 *
 * Author: <NAME>
 * Version: 1.1
 * Date: 14 December 2011
 */

/* Code is not verified using http://www.jshint.com/ */


(function ($){
	
	
	var methods = {
    	play : function( options ) { 
					
					alert(options);
				
	 			},
    	pause : function( ) { }
    
  	};

	
	var jRecorderSettings = {} ;
	
	$.jRecorder = function( options, element ) {
		// allow instantiation without initializing for simple inheritance
		
		
		if(typeof(options) == "string")
		{
			if ( methods[options] ) 
			{
				return methods[ options ].apply( this, Array.prototype.slice.call( arguments, 1 ));
				
			}
			return false;
		}
		
		//if the element to be appended is not defind, append to body
		if(element == undefined)
		{
			element = $("body");
		}
			
		//default settings
						var settings = {
		
						'rec_width': '300',
						'rec_height': '200',
						'rec_top': '0px',
						'rec_left': '0px',
						'recorderlayout_id' : 'flashrecarea',
						'recorder_id' : 'audiorecorder',
						'recorder_name': 'audiorecorder',
						'wmode' : 'transparent',
						'bgcolor': '#ff0000',
						'swf_path': 'jRecorder.swf',
						'host': 'acceptfile.php?filename=hello.wav',
						'callback_started_recording' : function(){},
						'callback_finished_recording' : function(){},
						'callback_stopped_recording': function(){},
						'callback_error_recording' : function(){},
						'callback_activityTime': function(time){},
						'callback_activityLevel' : function(level){}
						
						
						
		
		
						};
	
	
						//if option array is passed, merget the values
						if ( options ) { 
					        $.extend( settings, options );
					     }
		
						jRecorderSettings = settings;
						
						
					                var myNav = navigator.userAgent.toLowerCase();
                                                        var ie = (myNav.indexOf('msie') != -1) ? true : false;
							if(ie && parseInt(myNav.split('msie')[1]) <= 8) {
							var objStr = '<object  name="'+ settings['recorder_name'] +'" id="' + settings['recorder_id'] + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="'+ settings['rec_width'] +'" height="'+ settings['rec_height']+'"></object>';

							var paramStr = [
								'<param name="movie" value="'+ settings['swf_path'] + '?host=' + settings['host'] +  '" />',
								
								'<param name="allowScriptAccess" value="always" />',
								'<param name="bgcolor" value="' + settings['bgcolor'] + '" />',
								'<param name="wmode" value="' +  settings['wmode'] + '" />'
							];

							htmlObj = document.createElement(objStr);
							for(var i=0; i < paramStr.length; i++) {
								htmlObj.appendChild(document.createElement(paramStr[i]));
							}
{'fraction_non_alphanumeric': 0.16372202591283863, 'fraction_numerical': 0.01817264008076729, 'mean_word_length': 2.535990481856038, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3611177', 'n_tokens_mistral': 2581, 'n_tokens_neox': 1863, 'n_words': 394}