<commit_before>/*!
 * jQuery htmlForm Plugin v1.0
 * https://github.com/emanuelefantin/jquery.htmlForm.js
 * Return html string inside a container including form values.
 * 
 * Es.
 * var html_string = $('#myFormId').htmlForm();
 * console.log(html_string);
 * 
 * With outer form element:
 * var html_string = $('#myFormId').htmlForm({full:true});
 * 
 * Based on the answer by <NAME> on stackoverflow.com
 * http://stackoverflow.com/questions/3767253/get-html-code-of-filled-form-using-jquery
 * http://jsfiddle.net/AWK9S/3/
 * 
 * Copyright 2014 <NAME>
 * Released under the MIT license
 */

(function ($) {

	var methods = {
		init: function (options) {
			//set default options
			var defaults = {
				full: false
			};
			options = $.extend({}, defaults, options);
			//clone the element to not overwrite it
			var container = $(this).clone();

			//input
			container.find('input').each(function () {
				this.setAttribute('value', this.value);
				if (this.checked) {
					this.setAttribute('checked', 'checked');
				} else {
					this.removeAttribute('checked');
				}
			});
			//select
			container.find('select').each(function () {
				var index = this.selectedIndex;
				var i = 0;
				$(this).children('option').each(function () {
					if (i++ != index) {
						this.removeAttribute('selected');
					} else {
						this.setAttribute('selected', 'selected');
					}
				});
			});
			//textarea
			container.find('textarea').each(function () {
				$(this).html($(this).val());
			});

			//if required return the full form element
			if (options.full) {
				container = $('<div>').append(container);
			}

			//return the string
			return container.html();<commit_msg>modified comments<commit_after>/*!
 * jQuery htmlForm Plugin v1.0
 * https://github.com/emanuelefantin/jquery.htmlForm.js
 * Return html string inside a container including form values.
 * 
 * Es.
 * var html_string = $('#myFormId').htmlForm();
 * console.log(html_string);
 * 
 * With outer form element:
 * var html_string = $('#myFormId').htmlForm({full:true});
 * 
 * Based on the answer by <NAME> on stackoverflow.com
 * http://stackoverflow.com/questions/3767253/get-html-code-of-filled-form-using-jquery
 * http://jsfiddle.net/AWK9S/3/
 * 
 * Copyright 2014 <NAME>
 * Released under the MIT license
 */

(function ($) {

	var methods = {
		init: function (options) {
			//set default options
			var defaults = {
				full: false
			};
			options = $.extend({}, defaults, options);
			//clone the element to not overwrite it
			var container = $(this).clone();
			
			//set values to all inputs
			//input
			container.find('input').each(function () {
				this.setAttribute('value', this.value);
				if (this.checked) {
					this.setAttribute('checked', 'checked');
				} else {
					this.removeAttribute('checked');
				}
			});
			//select
			container.find('select').each(function () {
				var index = this.selectedIndex;
				var i = 0;
				$(this).children('option').each(function () {
					if (i++ != index) {
						this.removeAttribute('selected');
					} else {
						this.setAttribute('selected', 'selected');
					}
				});
			});
			//textarea
			container.find('textarea').each(function () {
				$(this).html($(this).val());
			});

			//if required get the full form element
			if (options.full) {
				container = $('<div>').append(container);
			}

			//return the string
			return container.html();
{'fraction_non_alphanumeric': 0.17058823529411765, 'fraction_numerical': 0.009411764705882352, 'mean_word_length': 3.0248520710059172, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '6494559', 'n_tokens_mistral': 1285, 'n_tokens_neox': 1028, 'n_words': 239}