Code Duplication    Length = 44-44 lines in 2 locations

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

@@ 4942-4985 (lines=44) @@
4939
	root = form = null;
4940
})();
4941
4942
(function(){
4943
	// Check to see if the browser returns only elements
4944
	// when doing getElementsByTagName("*")
4945
4946
	// Create a fake element
4947
	var div = document.createElement("div");
4948
	div.appendChild( document.createComment("") );
4949
4950
	// Make sure no comments are found
4951
	if ( div.getElementsByTagName("*").length > 0 ) {
4952
		Expr.find.TAG = function( match, context ) {
4953
			var results = context.getElementsByTagName( match[1] );
4954
4955
			// Filter out possible comments
4956
			if ( match[1] === "*" ) {
4957
				var tmp = [];
4958
4959
				for ( var i = 0; results[i]; i++ ) {
4960
					if ( results[i].nodeType === 1 ) {
4961
						tmp.push( results[i] );
4962
					}
4963
				}
4964
4965
				results = tmp;
4966
			}
4967
4968
			return results;
4969
		};
4970
	}
4971
4972
	// Check to see if an attribute returns normalized href attributes
4973
	div.innerHTML = "<a href='#'></a>";
4974
4975
	if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
4976
			div.firstChild.getAttribute("href") !== "#" ) {
4977
4978
		Expr.attrHandle.href = function( elem ) {
4979
			return elem.getAttribute( "href", 2 );
4980
		};
4981
	}
4982
4983
	// release memory in IE
4984
	div = null;
4985
})();
4986
4987
if ( document.querySelectorAll ) {
4988
	(function(){

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

@@ 4298-4341 (lines=44) @@
4295
	root = form = null;
4296
})();
4297
4298
(function(){
4299
	// Check to see if the browser returns only elements
4300
	// when doing getElementsByTagName("*")
4301
4302
	// Create a fake element
4303
	var div = document.createElement("div");
4304
	div.appendChild( document.createComment("") );
4305
4306
	// Make sure no comments are found
4307
	if ( div.getElementsByTagName("*").length > 0 ) {
4308
		Expr.find.TAG = function( match, context ) {
4309
			var results = context.getElementsByTagName( match[1] );
4310
4311
			// Filter out possible comments
4312
			if ( match[1] === "*" ) {
4313
				var tmp = [];
4314
4315
				for ( var i = 0; results[i]; i++ ) {
4316
					if ( results[i].nodeType === 1 ) {
4317
						tmp.push( results[i] );
4318
					}
4319
				}
4320
4321
				results = tmp;
4322
			}
4323
4324
			return results;
4325
		};
4326
	}
4327
4328
	// Check to see if an attribute returns normalized href attributes
4329
	div.innerHTML = "<a href='#'></a>";
4330
4331
	if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
4332
			div.firstChild.getAttribute("href") !== "#" ) {
4333
4334
		Expr.attrHandle.href = function( elem ) {
4335
			return elem.getAttribute( "href", 2 );
4336
		};
4337
	}
4338
4339
	// release memory in IE
4340
	div = null;
4341
})();
4342
4343
if ( document.querySelectorAll ) {
4344
	(function(){