rem
stringlengths 0
126k
| add
stringlengths 0
441k
| context
stringlengths 15
136k
|
---|---|---|
test("$.ajax - preprocess", function() { | test("$.ajax - beforeSend", function() { | test("$.ajax - preprocess", function() { expect(1); stop(); var customHeader = "value"; $.ajax({ url: "data/name.php", data: {'req': true}, beforeSend: function(xml) { xml.setRequestHeader('X-Custom-Header', customHeader); }, success: function(data) { ok( data == customHeader, "check return value, should be the custom header sent" ); start(); } });}); |
function(a,f) {return jQuery.grep(a,f,true);}; | "~", function(a){ var r = []; var s = jQuery.sibling(a); if ( s.n > 0 ) for ( var i = s.n; i < s.length; i++ ) r.push( s[i] ); return r; } | function(a,f) {return jQuery.grep(a,f,true);}; |
r = jQuery.grep( r, function(e) { return rec.test(e.className); }); | function(a){ return eval(jQuery.token[i+1]); }); | r = jQuery.grep( r, function(e) { return rec.test(e.className); }); |
this.each(function(responder) { if (responder[callback] && typeof responder[callback] == 'function') { try { responder[callback].apply(responder, [request, transport, json]); } catch (e) { } } }); | function() {return new XMLHttpRequest()} | this.each(function(responder) { if (responder[callback] && typeof responder[callback] == 'function') { try { responder[callback].apply(responder, [request, transport, json]); } catch (e) { } } }); |
new function() { var b = navigator.userAgent.toLowerCase(); jQuery.browser = { safari: /webkit/.test(b), opera: /opera/.test(b), msie: /msie/.test(b) && !/opera/.test(b), mozilla: /mozilla/.test(b) && !/compatible/.test(b) }; jQuery.boxModel = !jQuery.browser.msie || document.compatMode == "CSS1Compat"; }; | function(a,f) {return jQuery.grep(a,f,true);}; | new function() { var b = navigator.userAgent.toLowerCase(); // Figure out what browser is being used jQuery.browser = { safari: /webkit/.test(b), opera: /opera/.test(b), msie: /msie/.test(b) && !/opera/.test(b), mozilla: /mozilla/.test(b) && !/compatible/.test(b) }; // Check to see if the W3C box model is being used jQuery.boxModel = !jQuery.browser.msie || document.compatMode == "CSS1Compat";}; |
var t = $.grep($.sibling(a),function(b){return b.nodeName == a.nodeName;}); | a = a.replace(r,function(z,b){return b.toUpperCase();}); | var t = $.grep($.sibling(a),function(b){return b.nodeName == a.nodeName;}); |
function(a,f) {return jQuery.grep(a,f,true);}; | name = name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();}); | function(a,f) {return jQuery.grep(a,f,true);}; |
$("#main > p#ap > a").filter("#foobar",function(){},function(i){ ok( this == q("google","groups", "mark")[i], "Filter elements, else context" ); }); | test("expressions - element", function() { expect(5); ok( $("*").size() >= 30, "Select all" ); t( "Element Selector", "div", ["main","foo"] ); t( "Element Selector", "body", ["body"] ); t( "Element Selector", "html", ["html"] ); t( "Parent Element", "div div", ["foo"] ); }); | $("#main > p#ap > a").filter("#foobar",function(){},function(i){ ok( this == q("google","groups", "mark")[i], "Filter elements, else context" ); }); |
function(a,f) {return jQuery.grep(a,f,true);}; | new function() { var b = navigator.userAgent.toLowerCase(); jQuery.browser = { safari: /webkit/.test(b), opera: /opera/.test(b), msie: /msie/.test(b) && !/opera/.test(b), mozilla: /mozilla/.test(b) && !/(compatible|webkit)/.test(b) }; jQuery.boxModel = !jQuery.browser.msie || document.compatMode == "CSS1Compat"; }; | function(a,f) {return jQuery.grep(a,f,true);}; |
mozilla: /mozilla/.test(b) && !/compatible/.test(b) | mozilla: /mozilla/.test(b) && !/(compatible|webkit)/.test(b) | new function() { var b = navigator.userAgent.toLowerCase(); // Figure out what browser is being used jQuery.browser = { safari: /webkit/.test(b), opera: /opera/.test(b), msie: /msie/.test(b) && !/opera/.test(b), mozilla: /mozilla/.test(b) && !/compatible/.test(b) }; // Check to see if the W3C box model is being used jQuery.boxModel = !jQuery.browser.msie || document.compatMode == "CSS1Compat";}; |
name = name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();}); | r = jQuery.grep( r, function(e) { return rec.test(e.className); }); | name = name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();}); |
ok($("#main > p#ap > a").not("#google").length == 2, ".not") | ok($("#main > p#ap > a").not("#google").length == 2, "not('selector')") isSet( $("p").not("#ap, #sndp").get(), q("firstp", "en", "sap", "first", "result"), "not('selector, selector')" ); | test("not(String)", function() { ok($("#main > p#ap > a").not("#google").length == 2, ".not")}); |
test("not(String)", function() { ok($("#main > p#ap > a").not("#google").length == 2, "not('selector')") isSet( $("p").not("#ap, #sndp").get(), q("firstp", "en", "sap", "first", "result"), "not('selector, selector')" ); | test("expressions - id", function() { expect(5); t( "ID Selector", "#body", ["body"] ); t( "ID Selector w/ Element", "body#body", ["body"] ); t( "ID Selector w/ Element", "ul#first", [] ); t( "All Children of ID", "#foo/*", ["sndp", "en", "sap"] ); t( "All Children of ID with no children", "#firstUL/*", [] ); | test("not(String)", function() { ok($("#main > p#ap > a").not("#google").length == 2, "not('selector')") isSet( $("p").not("#ap, #sndp").get(), q("firstp", "en", "sap", "first", "result"), "not('selector, selector')" );}); |
r = jQuery.grep( r, function(e){ return re.test(e.className || ''); }, not); | name = name.replace(/-([a-z])/ig,function(z,b){return b.toUpperCase();}); | r = jQuery.grep( r, function(e){ return re.test(e.className || ''); }, not); |
test("is(String)", function() { expect(22); 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' ); | test("expressions - class", function() { expect(4); 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"] ); | test("is(String)", function() { expect(22); 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' );}); |
new function() { var b = navigator.userAgent.toLowerCase(); jQuery.browser = { safari: /webkit/.test(b), opera: /opera/.test(b), msie: /msie/.test(b) && !/opera/.test(b), mozilla: /mozilla/.test(b) && !/(compatible|webkit)/.test(b) }; jQuery.boxModel = !jQuery.browser.msie || document.compatMode == "CSS1Compat"; }; | r = jQuery.grep( r, function(e){ return re.test(e.className || ''); }, not); | new function() { var b = navigator.userAgent.toLowerCase(); // Figure out what browser is being used jQuery.browser = { safari: /webkit/.test(b), opera: /opera/.test(b), msie: /msie/.test(b) && !/opera/.test(b), mozilla: /mozilla/.test(b) && !/(compatible|webkit)/.test(b) }; // Check to see if the W3C box model is being used jQuery.boxModel = !jQuery.browser.msie || document.compatMode == "CSS1Compat";}; |
setTimeout((function() { for (var i = 0; i < scripts.length; i++) eval(scripts[i].match(match)[1]); }).bind(this), 10); | this.options.onComplete = (function(transport, object) { this.updateContent(); onComplete(transport, object); }).bind(this); | setTimeout((function() { for (var i = 0; i < scripts.length; i++) eval(scripts[i].match(match)[1]); }).bind(this), 10); |
test("$.extend(Object, Object)", function() { expect(2); var settings = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }, options = { xnumber2: 1, xstring2: "x", xxx: "newstring" }, optionsCopy = { xnumber2: 1, xstring2: "x", xxx: "newstring" }, 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" ); | test("expressions - multiple", function() { expect(4); 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"] ); | test("$.extend(Object, Object)", function() { expect(2); var settings = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }, options = { xnumber2: 1, xstring2: "x", xxx: "newstring" }, optionsCopy = { xnumber2: 1, xstring2: "x", xxx: "newstring" }, 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" );}); |
if (Element.hasClassName(child, className)) | if (child.className.match(new RegExp("(^|\\s)" + className + "(\\s|$)"))) | return $A(children).inject([], function(elements, child) { if (Element.hasClassName(child, className)) elements.push(child); return elements; }); |
test("expressions - element", function() { expect(5); ok( $("*").size() >= 30, "Select all" ); t( "Element Selector", "div", ["main","foo"] ); t( "Element Selector", "body", ["body"] ); t( "Element Selector", "html", ["html"] ); t( "Parent Element", "div div", ["foo"] ); | test("$.extend(Object, Object, Object, Object)", function() { expect(4); var defaults = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }, defaultsCopy = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }, options1 = { xnumber2: 1, xstring2: "x" }, options1Copy = { xnumber2: 1, xstring2: "x" }, options2 = { xstring2: "xx", xxx: "newstringx" }, options2Copy = { xstring2: "xx", xxx: "newstringx" }, merged = { xnumber1: 5, xnumber2: 1, xstring1: "peter", xstring2: "xx", xxx: "newstringx" }; var settings = jQuery.extend({}, defaults, options1, options2); isSet( settings, merged, "Check if extended: settings must be extended" ); isSet ( defaults, defaultsCopy, "Check if not modified: options1 must not be modified" ); isSet ( options1, options1Copy, "Check if not modified: options1 must not be modified" ); isSet ( options2, options2Copy, "Check if not modified: options2 must not be modified" ); | test("expressions - element", function() { expect(5); ok( $("*").size() >= 30, "Select all" ); t( "Element Selector", "div", ["main","foo"] ); t( "Element Selector", "body", ["body"] ); t( "Element Selector", "html", ["html"] ); t( "Parent Element", "div div", ["foo"] );}); |
test("$.extend(Object, Object, Object, Object)", function() { expect(4); var defaults = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }, defaultsCopy = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }, options1 = { xnumber2: 1, xstring2: "x" }, options1Copy = { xnumber2: 1, xstring2: "x" }, options2 = { xstring2: "xx", xxx: "newstringx" }, options2Copy = { xstring2: "xx", xxx: "newstringx" }, merged = { xnumber1: 5, xnumber2: 1, xstring1: "peter", xstring2: "xx", xxx: "newstringx" }; var settings = jQuery.extend({}, defaults, options1, options2); isSet( settings, merged, "Check if extended: settings must be extended" ); isSet ( defaults, defaultsCopy, "Check if not modified: options1 must not be modified" ); isSet ( options1, options1Copy, "Check if not modified: options1 must not be modified" ); isSet ( options2, options2Copy, "Check if not modified: options2 must not be modified" ); | test("expressions - child and adjacent", function() { expect(14); 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"] ); | test("$.extend(Object, Object, Object, Object)", function() { expect(4); var defaults = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }, defaultsCopy = { xnumber1: 5, xnumber2: 7, xstring1: "peter", xstring2: "pan" }, options1 = { xnumber2: 1, xstring2: "x" }, options1Copy = { xnumber2: 1, xstring2: "x" }, options2 = { xstring2: "xx", xxx: "newstringx" }, options2Copy = { xstring2: "xx", xxx: "newstringx" }, merged = { xnumber1: 5, xnumber2: 1, xstring1: "peter", xstring2: "xx", xxx: "newstringx" }; var settings = jQuery.extend({}, defaults, options1, options2); isSet( settings, merged, "Check if extended: settings must be extended" ); isSet ( defaults, defaultsCopy, "Check if not modified: options1 must not be modified" ); isSet ( options1, options1Copy, "Check if not modified: options1 must not be modified" ); isSet ( options2, options2Copy, "Check if not modified: options2 must not be modified" );}); |
t("Select options via [@selected]", "#select1 option[@selected]", [] ); | t("Select options via [@selected]", "#select1 option[@selected]", ["option1a"] ); | test("expressions - attributes", function() { expect(19); 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("Select options via [@selected]", "#select1 option[@selected]", [] ); t("Select options via [@selected]", "#select2 option[@selected]", ["option2d"] ); t("Select options via [@selected]", "#select3 option[@selected]", ["option3b", "option3c"] ); t( "Grouped Form Elements", "input[@name='foo[bar]']", ["hidden2"] ); 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"]);}); |
test("expressions - id", function() { | test("expressions - element", function() { | test("expressions - id", function() { expect(5); t( "ID Selector", "#body", ["body"] ); t( "ID Selector w/ Element", "body#body", ["body"] ); t( "ID Selector w/ Element", "ul#first", [] ); t( "All Children of ID", "#foo/*", ["sndp", "en", "sap"] ); t( "All Children of ID with no children", "#firstUL/*", [] );}); |
t( "ID Selector", "#body", ["body"] ); t( "ID Selector w/ Element", "body#body", ["body"] ); t( "ID Selector w/ Element", "ul#first", [] ); t( "All Children of ID", "#foo/*", ["sndp", "en", "sap"] ); t( "All Children of ID with no children", "#firstUL/*", [] ); | ok( $("*").size() >= 30, "Select all" ); t( "Element Selector", "div", ["main","foo"] ); t( "Element Selector", "body", ["body"] ); t( "Element Selector", "html", ["html"] ); t( "Parent Element", "div div", ["foo"] ); | test("expressions - id", function() { expect(5); t( "ID Selector", "#body", ["body"] ); t( "ID Selector w/ Element", "body#body", ["body"] ); t( "ID Selector w/ Element", "ul#first", [] ); t( "All Children of ID", "#foo/*", ["sndp", "en", "sap"] ); t( "All Children of ID with no children", "#firstUL/*", [] );}); |
test("expressions - element", function() { expect(5); ok( $("*").size() >= 30, "Select all" ); t( "Element Selector", "div", ["main","foo"] ); t( "Element Selector", "body", ["body"] ); t( "Element Selector", "html", ["html"] ); t( "Parent Element", "div div", ["foo"] ); | test("expressions - attributes", function() { expect(16); 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: t( "Attribute Ends With", "a[@href $= 'org/']", ["mark"] ); t( "Attribute Contains", "a[@href *= 'google']", ["google","groups"] ); t( "Grouped Form Elements", "input[@name='foo[bar]']", ["hidden2"] ); 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"]); | test("expressions - element", function() { expect(5); ok( $("*").size() >= 30, "Select all" ); t( "Element Selector", "div", ["main","foo"] ); t( "Element Selector", "body", ["body"] ); t( "Element Selector", "html", ["html"] ); t( "Parent Element", "div div", ["foo"] );}); |
test("expressions - class", function() { expect(4); 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"] ); | test("expressions - id", function() { expect(5); t( "ID Selector", "#body", ["body"] ); t( "ID Selector w/ Element", "body#body", ["body"] ); t( "ID Selector w/ Element", "ul#first", [] ); t( "All Children of ID", "#foo/*", ["sndp", "en", "sap"] ); t( "All Children of ID with no children", "#firstUL/*", [] ); | test("expressions - class", function() { expect(4); 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"] );}); |
fragments.reverse().each((function(fragment) { this.element.insertBefore(fragment, this.element.firstChild); }).bind(this)); | setTimeout(function() {content.evalScripts()}, 10); | fragments.reverse().each((function(fragment) { this.element.insertBefore(fragment, this.element.firstChild); }).bind(this)); |
test("expressions - id", function() { expect(5); t( "ID Selector", "#body", ["body"] ); t( "ID Selector w/ Element", "body#body", ["body"] ); t( "ID Selector w/ Element", "ul#first", [] ); | test("expressions - pseudo (:) selctors", function() { expect(30); 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"] ); | test("expressions - id", function() { expect(5); t( "ID Selector", "#body", ["body"] ); t( "ID Selector w/ Element", "body#body", ["body"] ); t( "ID Selector w/ Element", "ul#first", [] ); t( "All Children of ID", "#foo/*", ["sndp", "en", "sap"] ); t( "All Children of ID with no children", "#firstUL/*", [] );}); |
t( "All Children of ID", "#foo/*", ["sndp", "en", "sap"] ); t( "All Children of ID with no children", "#firstUL/*", [] ); | 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( "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"] ); | test("expressions - id", function() { expect(5); t( "ID Selector", "#body", ["body"] ); t( "ID Selector w/ Element", "body#body", ["body"] ); t( "ID Selector w/ Element", "ul#first", [] ); t( "All Children of ID", "#foo/*", ["sndp", "en", "sap"] ); t( "All Children of ID with no children", "#firstUL/*", [] );}); |
test("expressions - multiple", function() { | test("expressions - class", function() { | test("expressions - multiple", function() { expect(4); 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( "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( "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"] ); | test("expressions - multiple", function() { expect(4); 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"] );}); |
test("expressions - class", function() { expect(4); 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"] ); | test("expressions - basic xpath", function() { expect(14); ok( jQuery.find(" t( "All Div Elements", " 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 t( "All Children, Explicit", " t( "All Children, Implicit", " t( "Attribute Exists", " t( "Attribute Equals", " t( "Parent Axis", " t( "Sibling Axis", " t( "Sibling Axis", " t( "Has Children", " | test("expressions - class", function() { expect(4); 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"] );}); |
jQuery.ajax( "GET", url, null, function(r) { if ( callback ) callback( jQuery.httpData(r,type) ); }); | new function(){ var e = "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess".split(','); for ( var i = 0; i < e.length; i++ ) new function(){ var o = e[i]; jQuery.fn[o] = function(f){ return this.bind(o, f); }; } } | jQuery.ajax( "GET", url, null, function(r) { if ( callback ) callback( jQuery.httpData(r,type) ); }); |
new function(){ var e = "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess".split(","); for ( var i = 0; i < e.length; i++ ) new function(){ | for ( var i = 0; i < e.length; i++ ) new function(){ | new function(){ var e = "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess".split(","); for ( var i = 0; i < e.length; i++ ) new function(){ var o = e[i]; jQuery.fn[o] = function(f){ return this.bind(o, f); }; };}; |
}; | new function(){ var e = "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess".split(","); for ( var i = 0; i < e.length; i++ ) new function(){ var o = e[i]; jQuery.fn[o] = function(f){ return this.bind(o, f); }; };}; |
|
$.get("data/name.php", function() { ok( $('#first').text() == 'ERROR', 'Check if load works without callback'); | test("load(String, Object, Function) - check scripts", function() { expect(7); stop(); testFoo = undefined; var verifyEvaluation = function() { ok( foobar == "bar", 'Check if script src was evaluated after load' ); ok( $('#foo').html() == 'foo', 'Check if script evaluation has modified DOM'); ok( $('#ap').html() == 'bar', 'Check if script evaluation has modified DOM'); | $.get("data/name.php", function() { ok( $('#first').text() == 'ERROR', 'Check if load works without callback'); start(); }); |
}); | $.get("data/name.php", function() { ok( $('#first').text() == 'ERROR', 'Check if load works without callback'); start(); }); |
|
new function(){ var e = "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess".split(","); for ( var i = 0; i < e.length; i++ ) new function(){ var o = e[i]; jQuery.fn[o] = function(f){ return this.bind(o, f); }; }; }; | jQuery.getScript( this.src, function() {} ); | new function(){ var e = "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess".split(","); for ( var i = 0; i < e.length; i++ ) new function(){ var o = e[i]; jQuery.fn[o] = function(f){ return this.bind(o, f); }; };}; |
$('#first').load("data/name.php", function() { ok( /^ERROR/.test($('#first').text()), 'Check if content was injected into the DOM' ); start(); }); | test("synchronous request", function() { ok( /^{ "data"/.test( $.ajax({url: "data/json.php", async: false}).responseText ), "check returned text" ); }); | $('#first').load("data/name.php", function() { ok( /^ERROR/.test($('#first').text()), 'Check if content was injected into the DOM' ); start(); }); |
self.html(res.responseText).find("script").each(function(){ try { eval( this.text || this.textContent || this.innerHTML || ""); } catch(e){} }); | $.ajax( "GET", url, null, function(r) { if ( callback ) callback( $.httpData(r,type) ); }); | self.html(res.responseText).find("script").each(function(){ try { eval( this.text || this.textContent || this.innerHTML || ""); } catch(e){} }); |
fx[c] = function(a,b){ return new fx(a,b,c.toLowerCase(),c);}; | return this.each(function(){ new fx.Resize(this,o).hide("height"); }); | fx[c] = function(a,b){ return new fx(a,b,c.toLowerCase(),c);}; |
test("load(String, Object, Function) - check scripts", function() { expect(7); stop(); testFoo = undefined; var verifyEvaluation = function() { ok( foobar == "bar", 'Check if script src was evaluated after load' ); ok( $('#foo').html() == 'foo', 'Check if script evaluation has modified DOM'); ok( $('#ap').html() == 'bar', 'Check if script evaluation has modified DOM'); start(); }; $('#first').load('data/test.html', function() { ok( $('#first').html().match(/^html text/), 'Check content after loading html' ); ok( testFoo == "foo", 'Check if script was evaluated after load' ); setTimeout(verifyEvaluation, 600); | $('#first').load("data/name.php", function() { ok( /^ERROR/.test($('#first').text()), 'Check if content was injected into the DOM' ); start(); | test("load(String, Object, Function) - check scripts", function() { expect(7); stop(); testFoo = undefined; var verifyEvaluation = function() { ok( foobar == "bar", 'Check if script src was evaluated after load' ); ok( $('#foo').html() == 'foo', 'Check if script evaluation has modified DOM'); ok( $('#ap').html() == 'bar', 'Check if script evaluation has modified DOM'); start(); }; $('#first').load('data/test.html', function() { ok( $('#first').html().match(/^html text/), 'Check content after loading html' ); ok( testFoo == "foo", 'Check if script was evaluated after load' ); setTimeout(verifyEvaluation, 600); });}); |
}); | test("load(String, Object, Function) - check scripts", function() { expect(7); stop(); testFoo = undefined; var verifyEvaluation = function() { ok( foobar == "bar", 'Check if script src was evaluated after load' ); ok( $('#foo').html() == 'foo', 'Check if script evaluation has modified DOM'); ok( $('#ap').html() == 'bar', 'Check if script evaluation has modified DOM'); start(); }; $('#first').load('data/test.html', function() { ok( $('#first').html().match(/^html text/), 'Check content after loading html' ); ok( testFoo == "foo", 'Check if script was evaluated after load' ); setTimeout(verifyEvaluation, 600); });}); |
|
setTimeout(function() { openDialog(chrome, "_blank", flags, href, null, null, postData); }, 10); | setTimeout(function() { gURLBar.focus(); }, 0); | setTimeout(function() { openDialog(chrome, "_blank", flags, href, null, null, postData); }, 10); |
cur_dates.forEach (function (dateToRemove) { dates = dates.filter(function (d) { return d.compare(dateToRemove) != 0; }); }); | this.mExceptions.forEach(function(ex) { var dtstart = ex.item.getProperty("DTSTART"); var dateToReturn; if (aReturnRIDs) dateToReturn = ex.id; else dateToReturn = dtstart; if ((!aRangeStart || aRangeStart.compare(dtstart) <= 0) && (!aRangeEnd || aRangeEnd.compare(dtstart) > 0)) { dates.push(dateToReturn); return; } var dtend = ex.item.getProperty("DTEND"); if ((!aRangeStart || aRangeStart.compare(dtend) <= 0) && (!aRangeEnd || aRangeEnd.compare(dtend) > 0)) { dates.push(dateToReturn); return; } if (aRangeStart && aRangeEnd && aRangeStart.compare(dtstart) >= 0 && aRangeEnd.compare(dtend) <= 0) { dates.push(dateToReturn); return; } }); | cur_dates.forEach (function (dateToRemove) { dates = dates.filter(function (d) { return d.compare(dateToRemove) != 0; }); }); |
return this.domManip(arguments, true, 1, function(a){ this.appendChild( a ); | return this.each(function(){ var b = a[0].cloneNode(true); this.parentNode.insertBefore( b, this ); while ( b.firstChild ) b = b.firstChild; b.appendChild( this ); | return this.domManip(arguments, true, 1, function(a){ this.appendChild( a ); }); |
} | }; | new function(){ var e = "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess".split(','); for ( var i = 0; i < e.length; i++ ) new function(){ var o = e[i]; jQuery.fn[o] = function(f){ return this.bind(o, f); }; }}; |
if(typeof console != "undefined") console.error(e); | synchronize(function() { blocking = true; $.get(files[num],function(js){ js = js.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&"); try { eval(js); } catch(e) { Test.push( [ false, "Died on test #" + (Test.length+1) + ": " + e ] ); } var good = 0, bad = 0; var ol = document.createElement("ol"); var li = "", state = "pass"; for ( var i = 0; i < Test.length; i++ ) { var li = document.createElement("li"); li.className = Test[i][0] ? "pass" : "fail"; li.innerHTML = Test[i][1]; ol.appendChild( li ); if ( !Test[i][0] ) { state = "fail"; bad++; } else good++; } var li = document.createElement("li"); li.className = state; var b = document.createElement("b"); b.innerHTML = files[num] + " <b style='color:black;'>(<b class='fail'>" + bad + "</b>, <b class='pass'>" + good + "</b>, " + Test.length + ")</b>"; b.onclick = function(){ var n = this.nextSibling; if ( jQuery.css( n, "display" ) == "none" ) n.style.display = "block"; else n.style.display = "none"; }; li.appendChild( b ); li.appendChild( ol ); document.getElementById("tests").appendChild( li ); Test = []; blocking = false; process(); }); }); |
|
setTimeout(function() { openDialog(chrome, "_blank", flags, url); }, 10); | setTimeout(function() { openDialog(chrome, "_blank", flags, href, null, null, postData); }, 10); | setTimeout(function() { openDialog(chrome, "_blank", flags, url); }, 10); |
$("div.more,div.short",this.parentNode.parentNode).toggle().find("div.desc",function(){ | $("div.more,div.short",this.parentNode.parentNode).toggle('slow').find("div.desc",function(){ | $("div.more,div.short",this.parentNode.parentNode).toggle().find("div.desc",function(){ $(this).html( $(this).html().replace(/\n\n/g, "<br/><br/>") ); }); |
setTimeout(function(field, data, evt) { field.value = data; field.onTextEntered(evt); }, 0, field, data, aEvent); | setTimeout(function(aTabElt) { gBrowser.selectedTab = aTabElt; }, 0, gBrowser.addTab(url)); | setTimeout(function(field, data, evt) { field.value = data; field.onTextEntered(evt); }, 0, field, data, aEvent); |
jQuery.prototype[o] = function(f){ return this.bind(o, f); }; | jQuery.fn[o] = function(f){ return f ? this.bind(o, f) : this.trigger(o); }; | jQuery.prototype[o] = function(f){ return this.bind(o, f); }; |
return this.each(function(){ var b = a[0].cloneNode(true); this.parentNode.insertBefore( b, this ); while ( b.firstChild ) b = b.firstChild; b.appendChild( this ); | return this.domManip(arguments, true, 1, function(a){ this.appendChild( a ); | return this.each(function(){ // Clone the structure that we're using to wrap var b = a[0].cloneNode(true); // Insert it before the element to be wrapped this.parentNode.insertBefore( b, this ); // Find he deepest point in the wrap structure while ( b.firstChild ) b = b.firstChild; // Move the matched element to within the wrap structure b.appendChild( this ); }); |
jQuery.fn[o] = function(f){ return f ? this.bind(o, f) : this.trigger(o); | jQuery.fn[o] = function(f, amount){ return f ? this.bind(o, f, amount) : this.trigger(o); | jQuery.fn[o] = function(f){ return f ? this.bind(o, f) : this.trigger(o); }; |
.find("div.desc",function(){ | .find("div.desc").each(function(){ | .find("div.desc",function(){ $(this).html( $(this).html().replace(/\n\n/g, "<br/><br/>") ); }) |
}) | }).end() | .find("div.desc",function(){ $(this).html( $(this).html().replace(/\n\n/g, "<br/><br/>") ); }) |
$.eval( this.text || this.textContent || this.innerHTML ); | $.eval( this.text || this.textContent || this.innerHTML || ""); | self.html(h).find("script").each(function(){ try { $.eval( this.text || this.textContent || this.innerHTML ); } catch(e){} }); |
$.xml(mth, url, $.param(this.vars), function(r) { eval(r.responseText); }); | }).submit(function(e){ e.preventDefault(); $(this).ajaxSubmit(target, post_cb, pre_cb); return false; }); | $.xml(mth, url, $.param(this.vars), function(r) { eval(r.responseText); }); |
} | }; | new function(){ var e = "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess".split(','); for ( var i = 0; i < e.length; i++ ) new function(){ var o = e[i]; jQuery.fn[o] = function(f){ return this.bind(o, f); }; }} |
var d = $.getCSS(this,"display"); if ( d == "none" || d === '' ) $(this).show(); else $(this).hide(); }); | this.style.display = this.oldblock ? this.oldblock : ""; if ( $.css(this,"display") == "none" ) this.style.display = "block"; }); | return this.each(function(){ var d = $.getCSS(this,"display"); if ( d == "none" || d === '' ) $(this).show(); else $(this).hide(); }); |
test("expressions - child and adjacent", function() { expect(14); 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"] ); | test("expressions - multiple", function() { expect(4); 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"] ); | test("expressions - child and adjacent", function() { expect(14); 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"] );}); |
test("expressions - multiple", function() { expect(4); 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"] ); | test("val()", function() { expect(2); ok( $("#text1").val() == "Test", "Check for value of input element" ); ok( !$("#text1").val() == "", "Check for value of input element" ); | test("expressions - multiple", function() { expect(4); 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"] );}); |
test("expressions - attributes", function() { expect(16); 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: t( "Attribute Ends With", "a[@href $= 'org/']", ["mark"] ); t( "Attribute Contains", "a[@href *= 'google']", ["google","groups"] ); t( "Grouped Form Elements", "input[@name='foo[bar]']", ["hidden2"] ); 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"]); | test("expressions - child and adjacent", function() { expect(14); 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"] ); | test("expressions - attributes", function() { expect(16); 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( "Grouped Form Elements", "input[@name='foo[bar]']", ["hidden2"] ); 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"]);}); |
test("expressions - child and adjacent", function() { expect(14); 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"] ); | test("val(String)", function() { expect(2); document.getElementById('text1').value = "bla"; ok( $("#text1").val() == "bla", "Check for modified value of input element" ); $("#text1").val('test'); ok ( document.getElementById('text1').value == "test", "Check for modified (via val(String)) value of input element" ); | test("expressions - child and adjacent", function() { expect(14); 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"] );}); |
test("expressions - pseudo (:) selctors", function() { expect(30); 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"] ); | test("expressions - attributes", function() { expect(16); t( "Attribute Exists", "a[@title]", ["google"] ); t( "Attribute Exists", "*[@title]", ["google"] ); t( "Attribute Exists", "[@title]", ["google"] ); | test("expressions - pseudo (:) selctors", function() { expect(30); 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"] ); 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( "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( "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( "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"] ); | test("expressions - pseudo (:) selctors", function() { expect(30); 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"] ); 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( "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( "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( "Attribute Begins With", "a[@href ^= 'http: t( "Attribute Ends With", "a[@href $= 'org/']", ["mark"] ); t( "Attribute Contains", "a[@href *= 'google']", ["google","groups"] ); t( "Grouped Form Elements", "input[@name='foo[bar]']", ["hidden2"] ); 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"]); | test("expressions - pseudo (:) selctors", function() { expect(30); 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"] ); 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( "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"] );}); |
this.set(this.select(function(className) { return className != classNameToRemove; })); | fragments.each((function(fragment) { this.element.parentNode.insertBefore(fragment, this.element.nextSibling); }).bind(this)); | this.set(this.select(function(className) { return className != classNameToRemove; })); |
test("expressions - attributes", function() { expect(16); 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: t( "Attribute Ends With", "a[@href $= 'org/']", ["mark"] ); t( "Attribute Contains", "a[@href *= 'google']", ["google","groups"] ); t( "Grouped Form Elements", "input[@name='foo[bar]']", ["hidden2"] ); 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"]); | test("html(String)", function() { expect(1); var div = $("div"); div.html("<b>test</b>"); var pass = true; for ( var i = 0; i < div.size(); i++ ) { if ( div.get(i).childNodes.length == 0 ) pass = false; } ok( pass, "Set HTML" ); | test("expressions - attributes", function() { expect(16); 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( "Grouped Form Elements", "input[@name='foo[bar]']", ["hidden2"] ); 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"]);}); |
test("expressions - basic xpath", function() { expect(14); ok( jQuery.find(" t( "All Div Elements", " 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 t( "All Children, Explicit", " t( "All Children, Implicit", " t( "Attribute Exists", " t( "Attribute Equals", " t( "Parent Axis", " t( "Sibling Axis", " t( "Sibling Axis", " t( "Has Children", " | test("expressions - pseudo (:) selctors", function() { expect(30); 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"] ); 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( "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"] ); | test("expressions - basic xpath", function() { expect(14); 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"] );}); |
test("expressions - pseudo (:) selctors", function() { expect(30); 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"] ); 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( "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"] ); | test("id()", function() { expect(3); ok( $(document.getElementById('main')).id() == "main", "Check for id" ); ok( $("#foo").id() == "foo", "Check for id" ); ok( !$("head").id(), "Check for id" ); | test("expressions - pseudo (:) selctors", function() { expect(30); 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"] ); 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( "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"] );}); |
test("val()", function() { expect(2); ok( $("#text1").val() == "Test", "Check for value of input element" ); ok( !$("#text1").val() == "", "Check for value of input element" ); | test("expressions - basic xpath", function() { expect(14); ok( jQuery.find(" t( "All Div Elements", " 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 t( "All Children, Explicit", " t( "All Children, Implicit", " t( "Attribute Exists", " t( "Attribute Equals", " t( "Parent Axis", " t( "Sibling Axis", " t( "Sibling Axis", " t( "Has Children", " | test("val()", function() { expect(2); ok( $("#text1").val() == "Test", "Check for value of input element" ); ok( !$("#text1").val() == "", "Check for value of input element" );}); |
test("expressions - basic xpath", function() { expect(14); ok( jQuery.find(" t( "All Div Elements", " 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 t( "All Children, Explicit", " t( "All Children, Implicit", " t( "Attribute Exists", " t( "Attribute Equals", " t( "Parent Axis", " t( "Sibling Axis", " t( "Sibling Axis", " t( "Has Children", " | test("title()", function() { expect(2); ok( $(document.getElementById('google')).title() == "Google!", "Check for title" ); ok( !$("#yahoo").title(), "Check for title" ); | test("expressions - basic xpath", function() { expect(14); 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"] );}); |
test("val(String)", function() { | test("val()", function() { | test("val(String)", function() { expect(2); document.getElementById('text1').value = "bla"; ok( $("#text1").val() == "bla", "Check for modified value of input element" ); $("#text1").val('test'); ok ( document.getElementById('text1').value == "test", "Check for modified (via val(String)) value of input element" );}); |
document.getElementById('text1').value = "bla"; ok( $("#text1").val() == "bla", "Check for modified value of input element" ); $("#text1").val('test'); ok ( document.getElementById('text1').value == "test", "Check for modified (via val(String)) value of input element" ); | ok( $("#text1").val() == "Test", "Check for value of input element" ); ok( !$("#text1").val() == "", "Check for value of input element" ); | test("val(String)", function() { expect(2); document.getElementById('text1').value = "bla"; ok( $("#text1").val() == "bla", "Check for modified value of input element" ); $("#text1").val('test'); ok ( document.getElementById('text1').value == "test", "Check for modified (via val(String)) value of input element" );}); |
test("val()", function() { expect(2); ok( $("#text1").val() == "Test", "Check for value of input element" ); ok( !$("#text1").val() == "", "Check for value of input element" ); | test("name()", function() { expect(3); ok( $(document.getElementById('text1')).name() == "action", "Check for name" ); ok( $("#hidden1").name() == "hidden", "Check for name" ); ok( !$("#area1").name(), "Check for name" ); | test("val()", function() { expect(2); ok( $("#text1").val() == "Test", "Check for value of input element" ); ok( !$("#text1").val() == "", "Check for value of input element" );}); |
test("html(String)", function() { expect(1); var div = $("div"); div.html("<b>test</b>"); var pass = true; for ( var i = 0; i < div.size(); i++ ) { if ( div.get(i).childNodes.length == 0 ) pass = false; } ok( pass, "Set HTML" ); | test("val(String)", function() { expect(2); document.getElementById('text1').value = "bla"; ok( $("#text1").val() == "bla", "Check for modified value of input element" ); $("#text1").val('test'); ok ( document.getElementById('text1').value == "test", "Check for modified (via val(String)) value of input element" ); | test("html(String)", function() { expect(1); var div = $("div"); div.html("<b>test</b>"); var pass = true; for ( var i = 0; i < div.size(); i++ ) { if ( div.get(i).childNodes.length == 0 ) pass = false; } ok( pass, "Set HTML" );}); |
test("val(String)", function() { expect(2); document.getElementById('text1').value = "bla"; ok( $("#text1").val() == "bla", "Check for modified value of input element" ); $("#text1").val('test'); ok ( document.getElementById('text1').value == "test", "Check for modified (via val(String)) value of input element" ); | test("siblings([String])", function() { expect(3); isSet( $("#en").siblings().get(), q("sndp", "sap"), "Check for siblings" ); 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)" ); | test("val(String)", function() { expect(2); document.getElementById('text1').value = "bla"; ok( $("#text1").val() == "bla", "Check for modified value of input element" ); $("#text1").val('test'); ok ( document.getElementById('text1').value == "test", "Check for modified (via val(String)) value of input element" );}); |
test("id()", function() { expect(3); ok( $(document.getElementById('main')).id() == "main", "Check for id" ); ok( $("#foo").id() == "foo", "Check for id" ); ok( !$("head").id(), "Check for id" ); | test("html(String)", function() { expect(1); var div = $("div"); div.html("<b>test</b>"); var pass = true; for ( var i = 0; i < div.size(); i++ ) { if ( div.get(i).childNodes.length == 0 ) pass = false; } ok( pass, "Set HTML" ); | test("id()", function() { expect(3); ok( $(document.getElementById('main')).id() == "main", "Check for id" ); ok( $("#foo").id() == "foo", "Check for id" ); ok( !$("head").id(), "Check for id" );}); |
test("html(String)", function() { expect(1); var div = $("div"); div.html("<b>test</b>"); var pass = true; for ( var i = 0; i < div.size(); i++ ) { if ( div.get(i).childNodes.length == 0 ) pass = false; } ok( pass, "Set HTML" ); | test("children([String])", function() { expect(2); isSet( $("#foo").children().get(), q("sndp", "en", "sap"), "Check for children" ); isSet( $("#foo").children("[code]").get(), q("sndp", "sap"), "Check for filtered children" ); | test("html(String)", function() { expect(1); var div = $("div"); div.html("<b>test</b>"); var pass = true; for ( var i = 0; i < div.size(); i++ ) { if ( div.get(i).childNodes.length == 0 ) pass = false; } ok( pass, "Set HTML" );}); |
test("title()", function() { expect(2); ok( $(document.getElementById('google')).title() == "Google!", "Check for title" ); ok( !$("#yahoo").title(), "Check for title" ); | test("id()", function() { expect(3); ok( $(document.getElementById('main')).id() == "main", "Check for id" ); ok( $("#foo").id() == "foo", "Check for id" ); ok( !$("head").id(), "Check for id" ); | test("title()", function() { expect(2); ok( $(document.getElementById('google')).title() == "Google!", "Check for title" ); ok( !$("#yahoo").title(), "Check for title" );}); |
test("id()", function() { expect(3); ok( $(document.getElementById('main')).id() == "main", "Check for id" ); ok( $("#foo").id() == "foo", "Check for id" ); ok( !$("head").id(), "Check for id" ); | test("show()", function() { expect(1); var pass = true, div = $("div"); div.show().each(function(){ if ( this.style.display == "none" ) pass = false; }); ok( pass, "Show" ); | test("id()", function() { expect(3); ok( $(document.getElementById('main')).id() == "main", "Check for id" ); ok( $("#foo").id() == "foo", "Check for id" ); ok( !$("head").id(), "Check for id" );}); |
test("name()", function() { expect(3); ok( $(document.getElementById('text1')).name() == "action", "Check for name" ); ok( $("#hidden1").name() == "hidden", "Check for name" ); ok( !$("#area1").name(), "Check for name" ); | test("title()", function() { expect(2); ok( $(document.getElementById('google')).title() == "Google!", "Check for title" ); ok( !$("#yahoo").title(), "Check for title" ); | test("name()", function() { expect(3); ok( $(document.getElementById('text1')).name() == "action", "Check for name" ); ok( $("#hidden1").name() == "hidden", "Check for name" ); ok( !$("#area1").name(), "Check for name" );}); |
test("title()", function() { expect(2); ok( $(document.getElementById('google')).title() == "Google!", "Check for title" ); ok( !$("#yahoo").title(), "Check for title" ); }); | div.show().each(function(){ if ( this.style.display == "none" ) pass = false; }); | test("title()", function() { expect(2); ok( $(document.getElementById('google')).title() == "Google!", "Check for title" ); ok( !$("#yahoo").title(), "Check for title" );}); |
jQuery.ajax( "POST", url, jQuery.param(data), function(r) { if ( callback ) callback( jQuery.httpData(r,type) ); }); | for ( var i = 0; i < e.length; i++ ) new function(){ var o = e[i]; jQuery.fn[o] = function(f){ return this.bind(o, f); }; } | jQuery.ajax( "POST", url, jQuery.param(data), function(r) { if ( callback ) callback( jQuery.httpData(r,type) ); }); |
if (!n && p == 'OPTGROUP' && (par = par.parentNode)) n = par.name; | if (!n) n = (p == 'OPTGROUP') ? par.parentNode.name : par.name; | $('*', this).each(function() { if (this.disabled || this.type == 'reset' || (this.type == 'checkbox' && !this.checked) || (this.type == 'radio' && !this.checked)) return; if (this.type == 'submit' || this.type == 'image') { if (this.form.clicked != this) return; if (this.type == 'image') { if (this.form.clicked_x) { a.push({name: this.name+'_x', value: this.form.clicked_x}); a.push({name: this.name+'_y', value: this.form.clicked_y}); return; } } } if (!ok[this.nodeName.toUpperCase()]) return; var par = this.parentNode; var p = par.nodeName.toUpperCase(); if ((p == 'SELECT' || p == 'OPTGROUP') && !this.selected) return; var n = this.name; if (!n && p == 'OPTGROUP' && (par = par.parentNode)) n = par.name; if (n == undefined) return; a.push({name: n, value: this.value}); }); |
for ( var i = 0; i < e.length; i++ ) new function(){ var o = e[i]; jQuery.fn[o] = function(f){ | jQuery.fn[o] = function(f){ | for ( var i = 0; i < e.length; i++ ) new function(){ var o = e[i]; jQuery.fn[o] = function(f){ return this.bind(o, f); }; }; |
}; | for ( var i = 0; i < e.length; i++ ) new function(){ var o = e[i]; jQuery.fn[o] = function(f){ return this.bind(o, f); }; }; |
|
var n = this.name || par.name; | var n = this.name; | $('*', this).each(function() { if (this.disabled || this.type == 'reset' || (this.type == 'checkbox' && !this.checked) || (this.type == 'radio' && !this.checked)) return; if (this.type == 'submit' || this.type == 'image') { if (this.form.clicked != this) return; if (this.type == 'image') { if (this.form.clicked_x) { a.push({name: this.name+'_x', value: this.form.clicked_x}); a.push({name: this.name+'_y', value: this.form.clicked_y}); return; } } } if (!ok[this.nodeName.toUpperCase()]) return; var par = this.parentNode; var p = par.nodeName.toUpperCase(); if ((p == 'SELECT' || p == 'OPTGROUP') && !this.selected) return; var n = this.name || par.name; if (!n && p == 'OPTGROUP' && (par = par.parentNode)) n = par.name; if (n == undefined) return; a.push({name: n, value: this.value}); }); |
new $.fx.Opacity(this,o).hide(); | new $.fx.Opacity(this,o,1).hide(); | return a ? this.each(function(){ new $.fx.Opacity(this,o).hide(); }) : this._hide(); |
test("load(String, Object, Function) - check scripts", function() { expect(6); stop(); window.foobar = undefined; window.foo = undefined; var verifyEvaluation = function() { ok( foobar == "bar", 'Check if script src was evaluated after load' ); ok( $('#foo').html() == 'foo', 'Check if script evaluation has modified DOM'); ok( $('#ap').html() == 'bar', 'Check if script evaluation has modified DOM'); start(); }; $('#first').load('data/test.html', function() { | $('#first').load('data/test.html', function() { | test("load(String, Object, Function) - check scripts", function() { expect(6); stop(); window.foobar = undefined; window.foo = undefined; var verifyEvaluation = function() { ok( foobar == "bar", 'Check if script src was evaluated after load' ); ok( $('#foo').html() == 'foo', 'Check if script evaluation has modified DOM'); ok( $('#ap').html() == 'bar', 'Check if script evaluation has modified DOM'); start(); }; $('#first').load('data/test.html', function() { ok( $('#first').html().match(/^html text/), 'Check content after loading html' ); ok( foo == "foo", 'Check if script was evaluated after load' ); setTimeout(verifyEvaluation, 600); });}); |
ok( foo == "foo", 'Check if script was evaluated after load' ); | ok( testFoo == "foo", 'Check if script was evaluated after load' ); | test("load(String, Object, Function) - check scripts", function() { expect(6); stop(); window.foobar = undefined; window.foo = undefined; var verifyEvaluation = function() { ok( foobar == "bar", 'Check if script src was evaluated after load' ); ok( $('#foo').html() == 'foo', 'Check if script evaluation has modified DOM'); ok( $('#ap').html() == 'bar', 'Check if script evaluation has modified DOM'); start(); }; $('#first').load('data/test.html', function() { ok( $('#first').html().match(/^html text/), 'Check content after loading html' ); ok( foo == "foo", 'Check if script was evaluated after load' ); setTimeout(verifyEvaluation, 600); });}); |
}); | test("load(String, Object, Function) - check scripts", function() { expect(6); stop(); window.foobar = undefined; window.foo = undefined; var verifyEvaluation = function() { ok( foobar == "bar", 'Check if script src was evaluated after load' ); ok( $('#foo').html() == 'foo', 'Check if script evaluation has modified DOM'); ok( $('#ap').html() == 'bar', 'Check if script evaluation has modified DOM'); start(); }; $('#first').load('data/test.html', function() { ok( $('#first').html().match(/^html text/), 'Check content after loading html' ); ok( foo == "foo", 'Check if script was evaluated after load' ); setTimeout(verifyEvaluation, 600); });}); |
|
for ( var i = 0; i < e.length; i++ ) new function(){ | new function(){ var e = "ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess".split(","); for ( var i = 0; i < e.length; i++ ) new function(){ | for ( var i = 0; i < e.length; i++ ) new function(){ var o = e[i]; jQuery.fn[o] = function(f){ return this.bind(o, f); }; }; |
}; | for ( var i = 0; i < e.length; i++ ) new function(){ var o = e[i]; jQuery.fn[o] = function(f){ return this.bind(o, f); }; }; |
|
$('input[@type="submit"],input[@type="image"]', this).click(function(ev){ this.form.clicked = this; if (ev.offsetX != undefined) { this.form.clicked_x = ev.offsetX; this.form.clicked_y = ev.offsetY; } else { this.form.clicked_x = ev.pageX - this.offsetLeft; this.form.clicked_y = ev.pageY - this.offsetTop; } | $.ajax( "POST", url, $.param(data), function(r) { if ( callback ) callback( $.httpData(r,type) ); | $('input[@type="submit"],input[@type="image"]', this).click(function(ev){ this.form.clicked = this; if (ev.offsetX != undefined) { this.form.clicked_x = ev.offsetX; this.form.clicked_y = ev.offsetY; } else { this.form.clicked_x = ev.pageX - this.offsetLeft; this.form.clicked_y = ev.pageY - this.offsetTop; } }); |
this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != $continue) throw e; } }); | return pairs.inject({}, function(params, pairString) { var pair = pairString.split('='); params[pair[0]] = pair[1]; return params; }); | this._each(function(value) { try { iterator(value, index++); } catch (e) { if (e != $continue) throw e; } }); |
for(var i in fx.fn){(function(){ var j = fx.fn[i]; z[j] = function(a,b){ if(c(a,b,"height")) h[j](); if(c(a,b,"width")) w[j](); }; })()} | return a ? this.each(function(){ new fx.Opacity(this,o).hide(); }) : this._hide(); | for(var i in fx.fn){(function(){ var j = fx.fn[i]; z[j] = function(a,b){ if(c(a,b,"height")) h[j](); if(c(a,b,"width")) w[j](); }; })()} |
$('#first').load('data/test.html', function() { ok( $('#first').html().match(/^html text/), 'Check content after loading html' ); ok( testFoo == "foo", 'Check if script was evaluated after load' ); setTimeout(verifyEvaluation, 600); }); | test("load(String, Object, Function) - inject without callback", function() { expect(1); stop(); $('#first').load("data/name.php"); }); | $('#first').load('data/test.html', function() { ok( $('#first').html().match(/^html text/), 'Check content after loading html' ); ok( testFoo == "foo", 'Check if script was evaluated after load' ); setTimeout(verifyEvaluation, 600); }); |
setTimeout(function(aTabElt) { gBrowser.selectedTab = aTabElt; }, 0, gBrowser.addTab(aUrl, aReferrer, aCharset, aPostData)); | setTimeout(function() { openDialog(chrome, "_blank", flags, href, null, null, postData); }, 10); | setTimeout(function(aTabElt) { gBrowser.selectedTab = aTabElt; }, 0, gBrowser.addTab(aUrl, aReferrer, aCharset, aPostData)); |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.