X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fjquery%2Fjquery.js;h=9768eee002afede1e12198546b851dafc7c0c1e7;hb=14b09024cbe39bc16200448170ccbd183e3a9ec2;hp=6b05a06059f387ea41a45df96bb6cb9bc3b89678;hpb=c9511ef948ec3fd58bfd0af8898ef66abdc80255;p=jquery.git diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 6b05a06..9768eee 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -28,7 +28,7 @@ window.undefined = window.undefined; * @name jQuery * @cat Core */ -function jQuery(a,c) { +var jQuery = function(a,c) { // Shortcut for document ready (because $(document).each() is silly) if ( a && typeof a == "function" && jQuery.fn.ready ) @@ -71,7 +71,7 @@ function jQuery(a,c) { this.each(fn); return this; -} +}; // Map over the $ in case of overwrite if ( typeof $ != "undefined" ) @@ -534,6 +534,14 @@ jQuery.fn = jQuery.prototype = { * ok( !$('#foo').is(':visible'), 'Modified CSS display: Assert element is hidden'); * $('#foo').css({display: 'block'}); * ok( $('#foo').is(':visible'), 'Modified CSS display: Assert element is visible'); + * $('#floatTest').css({styleFloat: 'right'}); + * ok( $('#floatTest').css('styleFloat') == 'right', 'Modified CSS float using "styleFloat": Assert float is right'); + * $('#floatTest').css({cssFloat: 'left'}); + * ok( $('#floatTest').css('cssFloat') == 'left', 'Modified CSS float using "cssFloat": Assert float is left'); + * $('#floatTest').css({'float': 'right'}); + * ok( $('#floatTest').css('float') == 'right', 'Modified CSS float using "float": Assert float is right'); + * $('#floatTest').css({'font-size': '30px'}); + * ok( $('#floatTest').css('font-size') == '30px', 'Modified CSS font-size: Assert font-size is 30px'); * * @name css * @type jQuery @@ -555,6 +563,14 @@ jQuery.fn = jQuery.prototype = { * ok( !$('#foo').is(':visible'), 'Modified CSS display: Assert element is hidden'); * $('#foo').css('display', 'block'); * ok( $('#foo').is(':visible'), 'Modified CSS display: Assert element is visible'); + * $('#floatTest').css('styleFloat', 'left'); + * ok( $('#floatTest').css('styleFloat') == 'left', 'Modified CSS float using "styleFloat": Assert float is left'); + * $('#floatTest').css('cssFloat', 'right'); + * ok( $('#floatTest').css('cssFloat') == 'right', 'Modified CSS float using "cssFloat": Assert float is right'); + * $('#floatTest').css('float', 'left'); + * ok( $('#floatTest').css('float') == 'left', 'Modified CSS float using "float": Assert float is left'); + * $('#floatTest').css('font-size', '20px'); + * ok( $('#floatTest').css('font-size') == '20px', 'Modified CSS font-size: Assert font-size is 20px'); * * @name css * @type jQuery @@ -685,6 +701,7 @@ jQuery.fn = jQuery.prototype = { * @test var defaultText = 'Try them out:' * var result = $('#first').append('buga'); * ok( result.text() == defaultText + 'buga', 'Check if text appending works' ); + * ok( $('#select3').append('').find('option:last-child').attr('value') == 'appendTest', 'Appending html options to select element'); * * @name append * @type jQuery @@ -748,6 +765,7 @@ jQuery.fn = jQuery.prototype = { * @test var defaultText = 'Try them out:' * var result = $('#first').prepend('buga'); * ok( result.text() == 'buga' + defaultText, 'Check if text prepending works' ); + * ok( $('#select3').prepend('').find('option:first-child').attr('value') == 'prependTest', 'Prepending html options to select element'); * * @name prepend * @type jQuery @@ -1501,6 +1519,9 @@ jQuery.extend({ } else if (document.defaultView && document.defaultView.getComputedStyle) { + if (prop == "cssFloat" || prop == "styleFloat") + prop = "float"; + prop = prop.replace(/([A-Z])/g,"-$1").toLowerCase(); var cur = document.defaultView.getComputedStyle(elem, null); @@ -1527,7 +1548,10 @@ jQuery.extend({ var table = ""; - if ( !a[i].indexOf(""; + } else if ( !a[i].indexOf(""; } else if ( !a[i].indexOf("