Test Paragraph.
Test Paragraph.
* @resultTest Paragraph.
* - * @test ok( $('#foo').is(':visible'), 'Modifying CSS display: Assert element is visible'); - * $('#foo').css({display: 'none'}); - * 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 * @param Hash prop A set of key/value pairs to set as style properties. @@ -561,21 +462,6 @@ jQuery.fn = jQuery.prototype = { * @resultTest Paragraph.
* @desc Changes the color of all paragraphs to red * - * - * @test ok( $('#foo').is(':visible'), 'Modifying CSS display: Assert element is visible'); - * $('#foo').css('display', 'none'); - * 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 * @param String key The name of the property to set. @@ -595,9 +481,6 @@ jQuery.fn = jQuery.prototype = { * @beforeTest Paragraph.
* @result Test Paragraph. * - * @test var expected = "This link has class=\"blog\": Simon Willison's Weblog"; - * ok( $('#sap').text() == expected, 'Check for merged text of more then one element.' ); - * * @name text * @type String * @cat DOM @@ -633,11 +516,6 @@ jQuery.fn = jQuery.prototype = { * @beforeTest Paragraph.
* @resultTest Paragraph.
Test Paragraph.
* @resultTest Paragraph.
I would like to say:
* @resultI would like to say: Hello
* - * @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 * @param String html A string of HTML, that will be created on the fly and appended to the target. @@ -722,10 +590,6 @@ jQuery.fn = jQuery.prototype = { * @beforeI would like to say:
Hello * @resultI would like to say: Hello
* - * @test var expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:"; - * $('#sap').append(document.getElementById('first')); - * ok( expected == $('#sap').text(), "Check for appending of element" ); - * * @name append * @type jQuery * @param Element elem A DOM element that will be appended. @@ -741,10 +605,6 @@ jQuery.fn = jQuery.prototype = { * @beforeI would like to say:
Hello * @resultI would like to say: Hello
* - * @test var expected = "This link has class=\"blog\": Simon Willison's WeblogTry them out:Yahoo"; - * $('#sap').append([document.getElementById('first'), document.getElementById('yahoo')]); - * ok( expected == $('#sap').text(), "Check for appending of array of elements" ); - * * @name append * @type jQuery * @param ArrayI would like to say:
* @resultHelloI would like to say:
* - * @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 * @param String html A string of HTML, that will be created on the fly and appended to the target. @@ -786,10 +641,6 @@ jQuery.fn = jQuery.prototype = { * @beforeI would like to say:
Hello * @resultHelloI would like to say:
* - * @test var expected = "Try them out:This link has class=\"blog\": Simon Willison's Weblog"; - * $('#sap').prepend(document.getElementById('first')); - * ok( expected == $('#sap').text(), "Check for prepending of element" ); - * * @name prepend * @type jQuery * @param Element elem A DOM element that will be appended. @@ -805,10 +656,6 @@ jQuery.fn = jQuery.prototype = { * @beforeI would like to say:
Hello * @resultHelloI would like to say:
* - * @test var expected = "Try them out:YahooThis link has class=\"blog\": Simon Willison's Weblog"; - * $('#sap').prepend([document.getElementById('first'), document.getElementById('yahoo')]); - * ok( expected == $('#sap').text(), "Check for prepending of array of elements" ); - * * @name prepend * @type jQuery * @param ArrayI would like to say:
* @result HelloI would like to say:
* - * @test var expected = 'This is a normal link: bugaYahoo'; - * $('#yahoo').before('buga'); - * ok( expected == $('#en').text(), 'Insert String before' ); - * * @name before * @type jQuery * @param String html A string of HTML, that will be created on the fly and appended to the target. @@ -845,10 +688,6 @@ jQuery.fn = jQuery.prototype = { * @beforeI would like to say:
Hello * @result HelloI would like to say:
* - * @test var expected = "This is a normal link: Try them out:Yahoo"; - * $('#yahoo').before(document.getElementById('first')); - * ok( expected == $('#en').text(), "Insert element before" ); - * * @name before * @type jQuery * @param Element elem A DOM element that will be appended. @@ -862,10 +701,6 @@ jQuery.fn = jQuery.prototype = { * @beforeI would like to say:
Hello * @result HelloI would like to say:
* - * @test var expected = "This is a normal link: Try them out:diveintomarkYahoo"; - * $('#yahoo').before([document.getElementById('first'), document.getElementById('mark')]); - * ok( expected == $('#en').text(), "Insert array of elements before" ); - * * @name before * @type jQuery * @param ArrayI would like to say:
* @resultI would like to say:
Hello * - * @test var expected = 'This is a normal link: Yahoobuga'; - * $('#yahoo').after('buga'); - * ok( expected == $('#en').text(), 'Insert String after' ); - * * @name after * @type jQuery * @param String html A string of HTML, that will be created on the fly and appended to the target. @@ -902,10 +733,6 @@ jQuery.fn = jQuery.prototype = { * @before HelloI would like to say:
* @resultI would like to say:
Hello * - * @test var expected = "This is a normal link: YahooTry them out:"; - * $('#yahoo').after(document.getElementById('first')); - * ok( expected == $('#en').text(), "Insert element after" ); - * * @name after * @type jQuery * @param Element elem A DOM element that will be appended. @@ -919,10 +746,6 @@ jQuery.fn = jQuery.prototype = { * @before HelloI would like to say:
* @resultI would like to say:
Hello * - * @test var expected = "This is a normal link: YahooTry them out:diveintomark"; - * $('#yahoo').after([document.getElementById('first'), document.getElementById('mark')]); - * ok( expected == $('#en').text(), "Insert array of elements after" ); - * * @name after * @type jQuery * @param ArrayHello, how are you?
* @result $("p").find("span").end() == [...
] * - * @test ok( 'Yahoo' == $('#yahoo').parent().end().text(), 'Check for end' ); - * ok( $('#yahoo').end(), 'Check for end with nothing to end' ); - * * @name end * @type jQuery * @cat DOM/Traversing @@ -968,8 +788,6 @@ jQuery.fn = jQuery.prototype = { * @beforeHello, how are you?
* @result $("p").find("span") == [ Hello ] * - * @test ok( 'Yahoo' == $('#foo').find('.blogTest').text(), 'Check for find' ); - * * @name find * @type jQuery * @param String expr An expression to search with. @@ -992,11 +810,6 @@ jQuery.fn = jQuery.prototype = { * @before Hello, how are you?
* @result HelloHello, how are you?
* - * @test ok( 'This is a normal link: Yahoo' == $('#en').text(), 'Assert text for #en' ); - * var clone = $('#yahoo').clone(); - * ok( 'Try them out:Yahoo' == $('#first').append(clone).text(), 'Check for clone' ); - * ok( 'This is a normal link: Yahoo' == $('#en').text(), 'Reassert text for #en' ); - * * @name clone * @type jQuery * @cat DOM/Manipulation @@ -1019,14 +832,6 @@ jQuery.fn = jQuery.prototype = { * @beforeHello
How are you?
* @result $("p").filter(".selected") == [Hello
] * - * @test isSet( $("input").filter(":checked").get(), q("radio2", "check1"), "Filter elements" ); - * @test $("input").filter(":checked",function(i){ - * ok( this == q("radio2", "check1")[i], "Filter elements, context" ); - * }); - * @test $("#main > p#ap > a").filter("#foobar",function(){},function(i){ - * ok( this == q("google","groups", "mark")[i], "Filter elements, else context" ); - * }); - * * @name filter * @type jQuery * @param String expr An expression to search with. @@ -1093,8 +898,6 @@ jQuery.fn = jQuery.prototype = { * @beforeHello
Hello Again
* @result [Hello
] * - * @test ok($("#main > p#ap > a").not("#google").length == 2, ".not") - * * @name not * @type jQuery * @param String expr An expression with which to remove matching elements @@ -1172,29 +975,6 @@ jQuery.fn = jQuery.prototype = { * @result false * @desc An invalid expression always returns false. * - * @test ok( $('#form').is('form'), 'Check for element: A form must be a form' ); - * ok( !$('#form').is('div'), 'Check for element: A form is not a div' ); - * ok( $('#mark').is('.blog'), 'Check for class: Expected class "blog"' ); - * ok( !$('#mark').is('.link'), 'Check for class: Did not expect class "link"' ); - * ok( $('#simon').is('.blog.link'), 'Check for multiple classes: Expected classes "blog" and "link"' ); - * ok( !$('#simon').is('.blogTest'), 'Check for multiple classes: Expected classes "blog" and "link", but not "blogTest"' ); - * ok( $('#en').is('[@lang="en"]'), 'Check for attribute: Expected attribute lang to be "en"' ); - * ok( !$('#en').is('[@lang="de"]'), 'Check for attribute: Expected attribute lang to be "en", not "de"' ); - * ok( $('#text1').is('[@type="text"]'), 'Check for attribute: Expected attribute type to be "text"' ); - * ok( !$('#text1').is('[@type="radio"]'), 'Check for attribute: Expected attribute type to be "text", not "radio"' ); - * ok( $('#text2').is(':disabled'), 'Check for pseudoclass: Expected to be disabled' ); - * ok( !$('#text1').is(':disabled'), 'Check for pseudoclass: Expected not disabled' ); - * ok( $('#radio2').is(':checked'), 'Check for pseudoclass: Expected to be checked' ); - * ok( !$('#radio1').is(':checked'), 'Check for pseudoclass: Expected not checked' ); - * ok( $('#foo').is('[p]'), 'Check for child: Expected a child "p" element' ); - * ok( !$('#foo').is('[ul]'), 'Check for child: Did not expect "ul" element' ); - * ok( $('#foo').is('[p][a][code]'), 'Check for childs: Expected "p", "a" and "code" child elements' ); - * ok( !$('#foo').is('[p][a][code][ol]'), 'Check for childs: Expected "p", "a" and "code" child elements, but no "ol"' ); - * ok( !$('#foo').is(0), 'Expected false for an invalid expression - 0' ); - * ok( !$('#foo').is(null), 'Expected false for an invalid expression - null' ); - * ok( !$('#foo').is(''), 'Expected false for an invalid expression - ""' ); - * ok( !$('#foo').is(undefined), 'Expected false for an invalid expression - undefined' ); - * * @name is * @type Boolean * @param String expr The expression with which to filter @@ -1307,14 +1087,6 @@ jQuery.fn = jQuery.prototype = { * jQuery.extend(settings, options); * @result settings == { validate: true, limit: 5, name: "bar" } * - * @test var settings = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }; - * var options = { xnumber2: 1, xstring2: "x", xxx: "newstring" }; - * var optionsCopy = { xnumber2: 1, xstring2: "x", xxx: "newstring" }; - * var merged = { xnumber1: 5, xnumber2: 1, xstring1: "peter", xstring2: "x", xxx: "newstring" }; - * jQuery.extend(settings, options); - * isSet( settings, merged, "Check if extended: settings must be extended" ); - * isSet ( options, optionsCopy, "Check if not modified: options must not be modified" ); - * * @name $.extend * @param Object obj The object to extend * @param Object prop The object that will be merged into the first. @@ -1629,7 +1401,7 @@ jQuery.extend({ image: "a.type=='image'", reset: "a.type=='reset'", button: "a.type=='button'", - input: "a.nodeName.toLowerCase().match(/input|select|textarea|button/)" + input: "/input|select|textarea|button/i.test(a.nodeName)" }, ".": "jQuery.className.has(a,m[2])", "@": { @@ -1654,112 +1426,6 @@ jQuery.extend({ ], /** - * - * @test t( "Element Selector", "div", ["main","foo"] ); - * t( "Element Selector", "body", ["body"] ); - * t( "Element Selector", "html", ["html"] ); - * ok( $("*").size() >= 30, "Element Selector" ); - * t( "Parent Element", "div div", ["foo"] ); - * - * t( "ID Selector", "#body", ["body"] ); - * t( "ID Selector w/ Element", "body#body", ["body"] ); - * t( "ID Selector w/ Element", "ul#first", [] ); - * - * t( "Class Selector", ".blog", ["mark","simon"] ); - * t( "Class Selector", ".blog.link", ["simon"] ); - * t( "Class Selector w/ Element", "a.blog", ["mark","simon"] ); - * t( "Parent Class Selector", "p .blog", ["mark","simon"] ); - * - * t( "Comma Support", "a.blog, div", ["mark","simon","main","foo"] ); - * t( "Comma Support", "a.blog , div", ["mark","simon","main","foo"] ); - * t( "Comma Support", "a.blog ,div", ["mark","simon","main","foo"] ); - * t( "Comma Support", "a.blog,div", ["mark","simon","main","foo"] ); - * - * t( "Child", "p > a", ["simon1","google","groups","mark","yahoo","simon"] ); - * t( "Child", "p> a", ["simon1","google","groups","mark","yahoo","simon"] ); - * t( "Child", "p >a", ["simon1","google","groups","mark","yahoo","simon"] ); - * t( "Child", "p>a", ["simon1","google","groups","mark","yahoo","simon"] ); - * t( "Child w/ Class", "p > a.blog", ["mark","simon"] ); - * t( "All Children", "code > *", ["anchor1","anchor2"] ); - * t( "All Grandchildren", "p > * > *", ["anchor1","anchor2"] ); - * t( "Adjacent", "a + a", ["groups"] ); - * t( "Adjacent", "a +a", ["groups"] ); - * t( "Adjacent", "a+ a", ["groups"] ); - * t( "Adjacent", "a+a", ["groups"] ); - * t( "Adjacent", "p + p", ["ap","en","sap"] ); - * t( "Comma, Child, and Adjacent", "a + a, code > a", ["groups","anchor1","anchor2"] ); - * t( "First Child", "p:first-child", ["firstp","sndp"] ); - * t( "Attribute Exists", "a[@title]", ["google"] ); - * t( "Attribute Exists", "*[@title]", ["google"] ); - * t( "Attribute Exists", "[@title]", ["google"] ); - * - * t( "Attribute Equals", "a[@rel='bookmark']", ["simon1"] ); - * t( "Attribute Equals", 'a[@rel="bookmark"]', ["simon1"] ); - * t( "Attribute Equals", "a[@rel=bookmark]", ["simon1"] ); - * t( "Multiple Attribute Equals", "input[@type='hidden'],input[@type='radio']", ["hidden1","radio1","radio2"] ); - * t( "Multiple Attribute Equals", "input[@type=\"hidden\"],input[@type='radio']", ["hidden1","radio1","radio2"] ); - * t( "Multiple Attribute Equals", "input[@type=hidden],input[@type=radio]", ["hidden1","radio1","radio2"] ); - * - * t( "Attribute Begins With", "a[@href ^= 'http://www']", ["google","yahoo"] ); - * t( "Attribute Ends With", "a[@href $= 'org/']", ["mark"] ); - * t( "Attribute Contains", "a[@href *= 'google']", ["google","groups"] ); - * t( "First Child", "p:first-child", ["firstp","sndp"] ); - * t( "Last Child", "p:last-child", ["sap"] ); - * t( "Only Child", "a:only-child", ["simon1","anchor1","yahoo","anchor2"] ); - * t( "Empty", "ul:empty", ["firstUL"] ); - * t( "Enabled UI Element", "input:enabled", ["text1","radio1","radio2","check1","check2","hidden1","hidden2","name"] ); - * t( "Disabled UI Element", "input:disabled", ["text2"] ); - * t( "Checked UI Element", "input:checked", ["radio2","check1"] ); - * t( "Selected Option Element", "option:selected", ["option1a","option2d","option3b","option3c"] ); - * t( "Text Contains", "a:contains('Google')", ["google","groups"] ); - * t( "Text Contains", "a:contains('Google Groups')", ["groups"] ); - * t( "Element Preceded By", "p ~ div", ["foo"] ); - * t( "Not", "a.blog:not(.link)", ["mark"] ); - * - * ok( jQuery.find("//*").length >= 30, "All Elements (//*)" ); - * t( "All Div Elements", "//div", ["main","foo"] ); - * t( "Absolute Path", "/html/body", ["body"] ); - * t( "Absolute Path w/ *", "/* /body", ["body"] ); - * t( "Long Absolute Path", "/html/body/dl/div/div/p", ["sndp","en","sap"] ); - * t( "Absolute and Relative Paths", "/html//div", ["main","foo"] ); - * t( "All Children, Explicit", "//code/*", ["anchor1","anchor2"] ); - * t( "All Children, Implicit", "//code/", ["anchor1","anchor2"] ); - * t( "Attribute Exists", "//a[@title]", ["google"] ); - * t( "Attribute Equals", "//a[@rel='bookmark']", ["simon1"] ); - * t( "Parent Axis", "//p/..", ["main","foo"] ); - * t( "Sibling Axis", "//p/../", ["firstp","ap","foo","first","firstUL","empty","form","floatTest","sndp","en","sap"] ); - * t( "Sibling Axis", "//p/../*", ["firstp","ap","foo","first","firstUL","empty","form","floatTest","sndp","en","sap"] ); - * t( "Has Children", "//p[a]", ["firstp","ap","en","sap"] ); - * - * t( "nth Element", "p:nth(1)", ["ap"] ); - * t( "First Element", "p:first", ["firstp"] ); - * t( "Last Element", "p:last", ["first"] ); - * t( "Even Elements", "p:even", ["firstp","sndp","sap"] ); - * t( "Odd Elements", "p:odd", ["ap","en","first"] ); - * t( "Position Equals", "p:eq(1)", ["ap"] ); - * t( "Position Greater Than", "p:gt(0)", ["ap","sndp","en","sap","first"] ); - * t( "Position Less Than", "p:lt(3)", ["firstp","ap","sndp"] ); - * t( "Is A Parent", "p:parent", ["firstp","ap","sndp","en","sap","first"] ); - * t( "Is Visible", "input:visible", ["text1","text2","radio1","radio2","check1","check2","name"] ); - * t( "Is Hidden", "input:hidden", ["hidden1","hidden2"] ); - * - * t( "Grouped Form Elements", "input[@name='foo[bar]']", ["hidden2"] ); - * - * t( "All Children of ID", "#foo/*", ["sndp", "en", "sap"] ); - * t( "All Children of ID with no children", "#firstUL/*", [] ); - * - * t( "Form element :input", ":input", ["text1", "text2", "radio1", "radio2", "check1", "check2", "hidden1", "hidden2", "name", "button", "area1", "select1", "select2", "select3"] ); - * t( "Form element :radio", ":radio", ["radio1", "radio2"] ); - * t( "Form element :checkbox", ":checkbox", ["check1", "check2"] ); - * t( "Form element :text", ":text", ["text1", "text2", "hidden2", "name"] ); - * t( "Form element :radio:checked", ":radio:checked", ["radio2"] ); - * t( "Form element :checkbox:checked", ":checkbox:checked", ["check1"] ); - * t( "Form element :checkbox:checked, :radio:checked", ":checkbox:checked, :radio:checked", ["check1", "radio2"] ); - * - * t( ":not() Existing attribute", "select:not([@multiple])", ["select1", "select2"]); - * t( ":not() Equals attribute", "select:not([@name=select1])", ["select2", "select3"]); - * t( ":not() Equals quoted attribute", "select:not([@name='select1'])", ["select2", "select3"]); - * * @name $.find * @type ArrayHello
And Again
* @result [Hello
,And Again
] * - * @test isSet( $("#en").siblings().get(), q("sndp", "sap"), "Check for siblings" ); - * * @name siblings * @type jQuery * @cat DOM/Traversing @@ -3129,9 +2766,6 @@ jQuery.macros = { * @beforeHello Again
And Again
* @result [Hello Again
] * - * @test isSet( $("#sndp").siblings("[code]").get(), q("sap"), "Check for filtered siblings (has code child element)" ); - * isSet( $("#sndp").siblings("[a]").get(), q("en", "sap"), "Check for filtered siblings (has anchor child element)" ); - * * @name siblings * @type jQuery * @param String expr An expression to filter the sibling Elements with @@ -3148,8 +2782,6 @@ jQuery.macros = { * @beforeHello
And Again
* @result [ Hello Again ] * - * @test isSet( $("#foo").children().get(), q("sndp", "en", "sap"), "Check for children" ); - * * @name children * @type jQuery * @cat DOM/Traversing @@ -3163,8 +2795,6 @@ jQuery.macros = { * @beforeHello Again
And Again
Hello Again
] * - * @test isSet( $("#foo").children("[code]").get(), q("sndp", "sap"), "Check for filtered children" ); - * * @name children * @type jQuery * @param String expr An expression to filter the child Elements with @@ -3198,12 +2828,6 @@ jQuery.macros = { * @before * @result [Hello
] * - * @test var pass = true, div = $("div"); - * div.show().each(function(){ - * if ( this.style.display == "none" ) pass = false; - * }); - * ok( pass, "Show" ); - * * @name show * @type jQuery * @cat Effects @@ -3262,14 +2886,6 @@ jQuery.macros = { * @beforeHello
* @result [Hello
] * - * @test var div = $("div"); - * div.addClass("test"); - * var pass = true; - * for ( var i = 0; i < div.size(); i++ ) { - * if ( div.get(i).className.indexOf("test") == -1 ) pass = false; - * } - * ok( pass, "Add Class" ); - * * @name addClass * @type jQuery * @param String class A CSS class to add to the elements @@ -3286,24 +2902,6 @@ jQuery.macros = { * @beforeHello
* @result [Hello
] * - * @test var div = $("div").addClass("test"); - * div.removeClass("test"); - * var pass = true; - * for ( var i = 0; i < div.size(); i++ ) { - * if ( div.get(i).className.indexOf("test") != -1 ) pass = false; - * } - * ok( pass, "Remove Class" ); - * - * reset(); - * - * var div = $("div").addClass("test").addClass("foo").addClass("bar"); - * div.removeClass("test").removeClass("bar").removeClass("foo"); - * var pass = true; - * for ( var i = 0; i < div.size(); i++ ) { - * if ( div.get(i).className.match(/test|bar|foo/) ) pass = false; - * } - * ok( pass, "Remove multiple classes" ); - * * @name removeClass * @type jQuery * @param String class A CSS class to remove from the elements