Code Duplication    Length = 51-57 lines in 2 locations

api/js/etemplate/test/jquery.js 1 location

@@ 6027-6083 (lines=57) @@
6024
	}
6025
}
6026
6027
function cloneFixAttributes( src, dest ) {
6028
	var nodeName;
6029
6030
	// We do not need to do anything for non-Elements
6031
	if ( dest.nodeType !== 1 ) {
6032
		return;
6033
	}
6034
6035
	// clearAttributes removes the attributes, which we don't want,
6036
	// but also removes the attachEvent events, which we *do* want
6037
	if ( dest.clearAttributes ) {
6038
		dest.clearAttributes();
6039
	}
6040
6041
	// mergeAttributes, in contrast, only merges back on the
6042
	// original attributes, not the events
6043
	if ( dest.mergeAttributes ) {
6044
		dest.mergeAttributes( src );
6045
	}
6046
6047
	nodeName = dest.nodeName.toLowerCase();
6048
6049
	// IE6-8 fail to clone children inside object elements that use
6050
	// the proprietary classid attribute value (rather than the type
6051
	// attribute) to identify the type of content to display
6052
	if ( nodeName === "object" ) {
6053
		dest.outerHTML = src.outerHTML;
6054
6055
	} else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
6056
		// IE6-8 fails to persist the checked state of a cloned checkbox
6057
		// or radio button. Worse, IE6-7 fail to give the cloned element
6058
		// a checked appearance if the defaultChecked value isn't also set
6059
		if ( src.checked ) {
6060
			dest.defaultChecked = dest.checked = src.checked;
6061
		}
6062
6063
		// IE6-7 get confused and end up setting the value of a cloned
6064
		// checkbox/radio button to an empty string instead of "on"
6065
		if ( dest.value !== src.value ) {
6066
			dest.value = src.value;
6067
		}
6068
6069
	// IE6-8 fails to return the selected option to the default selected
6070
	// state when cloning options
6071
	} else if ( nodeName === "option" ) {
6072
		dest.selected = src.defaultSelected;
6073
6074
	// IE6-8 fails to set the defaultValue to the correct value when
6075
	// cloning other types of input fields
6076
	} else if ( nodeName === "input" || nodeName === "textarea" ) {
6077
		dest.defaultValue = src.defaultValue;
6078
	}
6079
6080
	// Event data gets referenced instead of copied if the expando
6081
	// gets copied too
6082
	dest.removeAttribute( jQuery.expando );
6083
}
6084
6085
jQuery.buildFragment = function( args, nodes, scripts ) {
6086
	var fragment, cacheable, cacheresults, doc,

api/js/egw_action/test/js/jquery.js 1 location

@@ 5330-5380 (lines=51) @@
5327
	}
5328
}
5329
5330
function cloneFixAttributes(src, dest) {
5331
	// We do not need to do anything for non-Elements
5332
	if ( dest.nodeType !== 1 ) {
5333
		return;
5334
	}
5335
5336
	var nodeName = dest.nodeName.toLowerCase();
5337
5338
	// clearAttributes removes the attributes, which we don't want,
5339
	// but also removes the attachEvent events, which we *do* want
5340
	dest.clearAttributes();
5341
5342
	// mergeAttributes, in contrast, only merges back on the
5343
	// original attributes, not the events
5344
	dest.mergeAttributes(src);
5345
5346
	// IE6-8 fail to clone children inside object elements that use
5347
	// the proprietary classid attribute value (rather than the type
5348
	// attribute) to identify the type of content to display
5349
	if ( nodeName === "object" ) {
5350
		dest.outerHTML = src.outerHTML;
5351
5352
	} else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
5353
		// IE6-8 fails to persist the checked state of a cloned checkbox
5354
		// or radio button. Worse, IE6-7 fail to give the cloned element
5355
		// a checked appearance if the defaultChecked value isn't also set
5356
		if ( src.checked ) {
5357
			dest.defaultChecked = dest.checked = src.checked;
5358
		}
5359
5360
		// IE6-7 get confused and end up setting the value of a cloned
5361
		// checkbox/radio button to an empty string instead of "on"
5362
		if ( dest.value !== src.value ) {
5363
			dest.value = src.value;
5364
		}
5365
5366
	// IE6-8 fails to return the selected option to the default selected
5367
	// state when cloning options
5368
	} else if ( nodeName === "option" ) {
5369
		dest.selected = src.defaultSelected;
5370
5371
	// IE6-8 fails to set the defaultValue to the correct value when
5372
	// cloning other types of input fields
5373
	} else if ( nodeName === "input" || nodeName === "textarea" ) {
5374
		dest.defaultValue = src.defaultValue;
5375
	}
5376
5377
	// Event data gets referenced instead of copied if the expando
5378
	// gets copied too
5379
	dest.removeAttribute( jQuery.expando );
5380
}
5381
5382
jQuery.buildFragment = function( args, nodes, scripts ) {
5383
	var fragment, cacheable, cacheresults,