<commit_before>/**
 * adds the images and attributes to required input fields
 * inits the js-calendar elements and the tooltip titles
 */
function loadRequired(book){
	var firstFocus;
	var formObject;
	var elementObject;
	var imageRequired;
	firstFocus=-1;
	for(i=0;i<document.forms.length;i++){
		formObject=document.forms[i];
		for(c=0;c<formObject.elements.length;c++){
			elementObject=formObject.elements[c];
			if(elementObject.className.indexOf("required")!=-1){
				elementObject.setAttribute("onChange","validateRequired(this)");
				imageRequired=document.createElement("img");
				imageRequired.className="required";
				elementObject.parentNode.insertBefore(imageRequired, elementObject);
				}
			if(elementObject.className.indexOf("eitheror")!=-1){
				elementObject.setAttribute('onChange','validateRequiredOr(this)');
				imageRequired=document.createElement("img");
				imageRequired.className="required";
				elementObject.parentNode.insertBefore(imageRequired, elementObject);
				}
			if(elementObject.className.indexOf("switcher")!=-1){
				switcherId=elementObject.getAttribute("id");
				parent.selerySwitch(switcherId,elementObject.value,book);
				elementObject.setAttribute("onChange","parent.selerySwitch('"+switcherId+"',this.value,'"+book+"')");
				}

			if(elementObject.getAttribute("tabindex")=="1" && firstFocus=="-1"){
				firstFocus=c;
				}
			if(elementObject.getAttribute("maxlength")){
				var maxlength=elementObject.getAttribute("maxlength");
				if(maxlength>180){
					elementObject.style.width="80%";
					}
				else if(maxlength>50){
					elementObject.style.width="60%";
					}
				else if(maxlength<20 && maxlength>0){
					elementObject.style.width=maxlength+"em";
					}
				}
			if(elementObject.getAttribute("type")=="date"){
				var inputId=elementObject.getAttribute("id");
				Calendar.setup({
      					inputField  : inputId,
      					ifFormat    : "%Y-%m-%d",
      					button      : "calendar-"+inputId
    					});
				}
			}<commit_msg>fix issue #149 replace image tag with span<commit_after>/**
 * adds the images and attributes to required input fields
 * inits the js-calendar elements and the tooltip titles
 */
function loadRequired(book){
	var firstFocus;
	var formObject;
	var elementObject;
	var imageRequired;
	firstFocus=-1;
	for(i=0;i<document.forms.length;i++){
		formObject=document.forms[i];
		for(c=0;c<formObject.elements.length;c++){
			elementObject=formObject.elements[c];
			if(elementObject.className.indexOf("required")!=-1){
				elementObject.setAttribute("onChange","validateRequired(this)");
				imageRequired=document.createElement("span");
				imageRequired.className="required";
				if (elementObject.parentNode.className.indexOf("selector") != -1) { //uniform
					elementObject.parentNode.parentNode.insertBefore(imageRequired, elementObject.parentNode);
					elementObject.setAttribute("onChange","validateSelectRequired(this)");
				} else {
					elementObject.parentNode.insertBefore(imageRequired, elementObject);
					}
				}
			if(elementObject.className.indexOf("eitheror")!=-1){
				elementObject.setAttribute('onChange','validateRequiredOr(this)');
				imageRequired=document.createElement("span");
				imageRequired.className="required";
				if (elementObject.parentNode.className.indexOf("selector") != -1) { //uniform
                    elementObject.parentNode.parentNode.insertBefore(imageRequired, elementObject.parentNode);
                    elementObject.setAttribute("onChange","validateSelectRequired(this)");
                    }
                else {
                    elementObject.parentNode.insertBefore(imageRequired, elementObject);
                    }
				}
			if(elementObject.className.indexOf("switcher")!=-1){
				switcherId=elementObject.getAttribute("id");
				parent.selerySwitch(switcherId,elementObject.value,book);
				elementObject.setAttribute("onChange","parent.selerySwitch('"+switcherId+"',this.value,'"+book+"')");
				}

			if(elementObject.getAttribute("tabindex")=="1" && firstFocus=="-1"){
				firstFocus=c;
				}
			if(elementObject.getAttribute("maxlength")){
				var maxlength=elementObject.getAttribute("maxlength");
				if(maxlength>180){
					elementObject.style.width="80%";
					}
				else if(maxlength>50){
					elementObject.style.width="60%";
					}
				else if(maxlength<20 && maxlength>0){
					elementObject.style.width=maxlength+"em";
					}
				}
			if(elementObject.getAttribute("type")=="date"){
				var inputId=elementObject.getAttribute("id");
				Calendar.setup({
      					inputField  : inputId,
      					ifFormat    : "%Y-%m-%d",
      					button      : "calendar-"+inputId
    					});
				}
			}
{'fraction_non_alphanumeric': 0.14909090909090908, 'fraction_numerical': 0.009625668449197862, 'mean_word_length': 4.12719298245614, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6363101', 'n_tokens_mistral': 1626, 'n_tokens_neox': 1367, 'n_words': 171}