"expr": true,
"latedef": true,
"noarg": true,
+ "quotmark": "double",
"smarttabs": true,
"trailing": true,
"undef": true
}, {
authUsername: config.authUsername,
authToken: config.authToken,
- jobName: 'jQuery commit #<a href="https://github.com/jquery/jquery/commit/' + commit + '">' + commit.substr( 0, 10 ) + '</a>',
+ jobName: "jQuery commit #<a href='https://github.com/jquery/jquery/commit/" + commit + "'>" + commit.substr( 0, 10 ) + "</a>",
runMax: config.runMax,
"runNames[]": tests,
"runUrls[]": testUrls,
"grunt-compare-size": ">=0.1.0",
"grunt-git-authors": ">=1.0.0",
"grunt-update-submodules": ">=0.1.0",
- "grunt": "~0.3.9",
+ "grunt": "~0.3.17",
"testswarm": "0.2.2"
},
"keywords": []
"undef": true,
"smarttabs": true,
"sub": true,
- "maxerr": 100
+ "maxerr": 100,
+ "quotmark": "double"
},
"globals": {
"define": true,
"undef": true,
"smarttabs": true,
"maxerr": 100,
- "sub": true
+ "sub": true,
+ "quotmark": "double"
},
"globals": {
"define": true,
ok( false, "error callback called" );
}
}).fail(function( _, reason ) {
- strictEqual( reason, 'canceled', "Request aborted by the prefilter must fail with 'canceled' status text" );
+ strictEqual( reason, "canceled", "Request aborted by the prefilter must fail with 'canceled' status text" );
});
});
try {
$first = jQuery("#first").attr("contenteditable", "true").removeAttr("contenteditable");
- equal( $first.attr('contenteditable'), undefined, "Remove the contenteditable attribute" );
+ equal( $first.attr("contenteditable"), undefined, "Remove the contenteditable attribute" );
} catch(e) {
ok( false, "Removing contenteditable threw an error (#10429)" );
}
-
+
$first = jQuery("<div Case='mixed'></div>");
equal( $first.attr("Case"), "mixed", "case of attribute doesn't matter" );
$first.removeAttr("Case");
};
}
};
-
+
function showFlags( flags ) {
if ( typeof flags === "string" ) {
- return '"' + flags + '"';
+ return "'" + flags + "'";
}
var output = [], key;
for ( key in flags ) {
- output.push( '"' + key + '": ' + flags[ key ] );
+ output.push( "'" + key + "': " + flags[ key ] );
}
return "{ " + output.join( ", " ) + " }";
}
};
try {
// This throws an error because it's processed like an id
- jQuery( '#<img id="check9521" src="no-such-.gif" onerror="jQuery._check9521(false)">' ).appendTo("#qunit-fixture");
+ jQuery( "#<img id='check9521' src='no-such-.gif' onerror='jQuery._check9521(false)'>" ).appendTo("#qunit-fixture");
} catch (err) {
jQuery["_check9521"](true);
}
"an-object": {},
"bool-true": true,
"bool-false": false,
- "some-json": '{ "foo": "bar" }',
+ // JSHint enforces double quotes,
+ // but JSON strings need double quotes to parse
+ // so we need escaped double quotes here
+ "some-json": "{ \"foo\": \"bar\" }",
"num-1-middle": true,
"num-end-2": true,
"2-num-start": true
"an-object": {},
"bool-true": true,
"bool-false": false,
- "some-json": '{ "foo": "bar" }'
+ // JSHint enforces double quotes,
+ // but JSON strings need double quotes to parse
+ // so we need escaped double quotes here
+ "some-json": "{ \"foo\": \"bar\" }"
};
expect( 27 );
test( "JSON data- attributes can have newlines", function() {
expect(1);
-
+
var x = jQuery("<div data-some='{\n\"foo\":\n\t\"bar\"\n}'></div>");
equal( x.data("some").foo, "bar", "got a JSON data- attribute with spaces" );
x.remove();
order = [];
foo.animate( { width: origWidth + 100 }, {
- queue: 'name',
+ queue: "name",
duration: 1,
complete: function() {
// clean up for next test
foo.css({
- "marginLeft": '',
- "marginRight": '',
- "marginTop": '',
- "marginBottom": ''
+ "marginLeft": "",
+ "marginRight": "",
+ "marginTop": "",
+ "marginBottom": ""
});
start();
});
// parentNode = null
jQuery("<div/>"),
- jQuery('<div style="display:inline"/>'),
+ jQuery("<div style='display:inline'/>"),
- jQuery('<div style="display:none"/>')
+ jQuery("<div style='display:none'/>")
];
strictEqual( elems[ 0 ].show()[ 0 ].style.display, "block", "set display with show() for element with parentNode = document fragment" );
foo.animate({
opacity: 0
}, 100, function() {
- ok( !foo.is(':animated'), "The element is not animated" );
+ ok( !foo.is(":animated"), "The element is not animated" );
start();
});
});
elems = jQuery();
for ( ; i < 5; i++ ) {
- elems = elems.add('<div style="width:0;height:0;"></div>');
+ elems = elems.add("<div style='width:0;height:0;'></div>");
}
foo.append( elems );
expect(1);
- jQuery("#qunit-fixture").append('<div id="jc-outer"><div id="jc-inner"></div></div>');
+ jQuery("#qunit-fixture").append("<div id='jc-outer'><div id='jc-inner'></div></div>");
jQuery("#jc-outer").bind("mouseenter mouseleave", function( event ) {
elem.remove();
// test that special handlers do not blow up with VML elements (#7071)
- jQuery('<xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v" />').appendTo('head');
- jQuery('<v:oval id="oval" style="width:100pt;height:75pt;" fillcolor="red"> </v:oval>').appendTo('#form');
+ jQuery("<xml:namespace ns='urn:schemas-microsoft-com:vml' prefix='v' />").appendTo("head");
+ jQuery("<v:oval id='oval' style='width:100pt;height:75pt;' fillcolor='red'> </v:oval>").appendTo("#form");
jQuery("#oval").click().keydown();
});
};
- $elem.live('mouseenter', function(){
- ok( true, 'Trigger mouseenter bound by live' );
+ $elem.live("mouseenter", function(){
+ ok( true, "Trigger mouseenter bound by live" );
});
- $elem.live('mouseleave', function(){
- ok( true, 'Trigger mouseleave bound by live' );
+ $elem.live("mouseleave", function(){
+ ok( true, "Trigger mouseleave bound by live" );
});
- $elem.trigger('mouseenter');
+ $elem.trigger("mouseenter");
- $elem.trigger('mouseleave');
+ $elem.trigger("mouseleave");
- $elem.die('mouseenter');
+ $elem.die("mouseenter");
- $elem.die('mouseleave');
+ $elem.die("mouseleave");
// Triggers handlrs and native
// Trigger 5
});
// It's not an image, but as long as it fires load...
- jQuery( '<img src="index.html" />' )
+ jQuery("<img src='index.html' />")
.appendTo( "body" )
.on( "load", function() {
ok( true, "load fired on img" );
expect(2);
var svg = jQuery(
- '<svg height="1" version="1.1" width="1" xmlns="http://www.w3.org/2000/svg">'+
- '<rect class="svg-by-class" x="10" y="20" width="100" height="60" r="10" rx="10" ry="10"></rect>'+
- '<rect id="svg-by-id" x="10" y="20" width="100" height="60" r="10" rx="10" ry="10"></rect>'+
- '</svg>'
+ "<svg height='1' version='1.1' width='1' xmlns='http://www.w3.org/2000/svg'>" +
+ "<rect class='svg-by-class' x='10' y='20' width='100' height='60' r='10' rx='10' ry='10'></rect>" +
+ "<rect id='svg-by-id' x='10' y='20' width='100' height='60' r='10' rx='10' ry='10'></rect>" +
+ "</svg>"
).appendTo( "body" );
jQuery( "body" )
// Alias names like "id" cause havoc
var form = jQuery(
- '<form id="myform">'+
- '<input type="text" name="id" value="secret agent man" />'+
- '</form>'
+ "<form id='myform'>" +
+ "<input type='text' name='id' value='secret agent man' />" +
+ "</form>"
)
.on( "submit", function( event ) {
event.preventDefault();
.end()
.off("submit");
- form.append('<input type="text" name="disabled" value="differently abled" />');
+ form.append("<input type='text' name='disabled' value='differently abled' />");
jQuery("body")
.on( "submit", "#myform", function() {
ok( true, "delegated id selector with aliased disabled" );
.off("submit");
form
- .append( '<button id="nestyDisabledBtn"><span>Zing</span></button>' )
+ .append( "<button id='nestyDisabledBtn'><span>Zing</span></button>" )
.on( "click", "#nestyDisabledBtn", function() {
ok( true, "click on enabled/disabled button with nesty elements" );
})
// Since we manually bubble in IE, make sure inner handlers get a chance to cancel
var form = jQuery(
- '<form id="myform">'+
- '<input type="text" name="sue" value="bawls" />'+
- '<input type="submit" />'+
- '</form>'
+ "<form id='myform'>" +
+ "<input type='text' name='sue' value='bawls' />" +
+ "<input type='submit' />" +
+ "</form>"
)
.appendTo("body");
test("jQuery.off using dispatched jQuery.Event", function() {
expect(1);
- var markup = jQuery( '<p><a href="#">target</a></p>' ),
+ var markup = jQuery("<p><a href='#'>target</a></p>"),
count = 0;
markup
.on( "click.name", "a", function( event ) {
equal( ++count, 1, "event called once before removal" );
jQuery().off( event );
})
- .find( "a" ).click().click().end()
+ .find("a").click().click().end()
.remove();
});
};
// Ensure a special event isn't removed by its mapped type
- jQuery( '<p>Gut Feeling</p>' )
+ jQuery( "<p>Gut Feeling</p>" )
.on( "click", jQuery.noop )
.on( "gutfeeling", jQuery.noop )
.off( "click" )
.remove();
// Ensure special events are removed when only a namespace is provided
- jQuery( '<p>Gut Feeling</p>' )
+ jQuery( "<p>Gut Feeling</p>" )
.on( "gutfeeling.Devo", jQuery.noop )
.off( ".Devo" )
.trigger( "gutfeeling" )
.remove();
// Ensure .one() events are removed after their maiden voyage
- jQuery( '<p>Gut Feeling</p>' )
+ jQuery( "<p>Gut Feeling</p>" )
.one( "gutfeeling", jQuery.noop )
.trigger( "gutfeeling" ) // This one should
.trigger( "gutfeeling" ) // This one should not
$fixture.bind( "click", function( event ) {
ok( !("blurrinessLevel" in event), "event.blurrinessLevel does not exist" );
});
- fireNative( $fixture[0], 'click' );
+ fireNative( $fixture[0], "click" );
$fixture.unbind( "click" );
jQuery.event.fixHooks.click = {
$fixture.bind( "click", function( event ) {
equal( event.blurrinessLevel, 42, "event.blurrinessLevel was set" );
});
- fireNative( $fixture[0], 'click' );
+ fireNative( $fixture[0], "click" );
delete jQuery.event.fixHooks.click;
$fixture.unbind( "click" ).remove();
targets.each(function() {
var $this = jQuery(this);
- ok( $this.parent().is('.wrapper'), "Check each elements parent is correct (.wrapper)" );
+ ok( $this.parent().is(".wrapper"), "Check each elements parent is correct (.wrapper)" );
equal( $this.siblings().length, 0, "Each element should be wrapped individually" );
});
});
ok( jQuery("#nonnodes").contents().length >= 2, "Check node,textnode,comment append cleanup worked" );
QUnit.reset();
- var $input = jQuery("<input />").attr({ "type": "checkbox", "checked": true }).appendTo('#testForm');
+ var $input = jQuery("<input />").attr({ "type": "checkbox", "checked": true }).appendTo("#testForm");
equal( $input[0].checked, true, "A checked checkbox that is appended stays checked" );
QUnit.reset();
if ( jQuery.getScript ) {
stop();
- jQuery.getScript('data/test.js', function() {
- jQuery('script[src*="data\\/test\\.js"]').remove();
+ jQuery.getScript("data/test.js", function() {
+ jQuery("script[src*='data\\/test\\.js']").remove();
start();
});
}
test("before and after on disconnected node (#10517)", function() {
expect(2);
-
+
equal( jQuery("<input type='checkbox'/>").before("<div/>").length, 2, "before() returned all elements" );
equal( jQuery("<input type='checkbox'/>").after("<div/>").length, 2, "after() returned all elements" );
});
divEvt.remove();
// Test both html() and clone() for <embed and <object types
- div = jQuery("<div/>").html('<embed height="355" width="425" src="http://www.youtube.com/v/3KANI2dpXLw&hl=en"></embed>');
+ div = jQuery("<div/>").html("<embed height='355' width='425' src='http://www.youtube.com/v/3KANI2dpXLw&hl=en'></embed>");
clone = div.clone(true);
equal( clone.length, 1, "One element cloned" );
test( "jQuery.html - execute scripts escaped with html comment or CDATA (#9221)", function() {
expect( 3 );
jQuery( [
- '<script type="text/javascript">',
- '<!--',
- 'ok( true, "<!-- handled" );',
- '//-->',
- '</script>'
+ "<script type='text/javascript'>",
+ "<!--",
+ "ok( true, '<!-- handled' );",
+ "//-->",
+ "</script>"
].join ( "\n" ) ).appendTo( "#qunit-fixture" );
jQuery( [
- '<script type="text/javascript">',
- '<![CDATA[',
- 'ok( true, "<![CDATA[ handled" );',
- '//]]>',
- '</script>'
+ "<script type='text/javascript'>",
+ "<![CDATA[",
+ "ok( true, '<![CDATA[ handled' );",
+ "//]]>",
+ "</script>"
].join ( "\n" ) ).appendTo( "#qunit-fixture" );
jQuery( [
- '<script type="text/javascript">',
- '<!--//--><![CDATA[//><!--',
- 'ok( true, "<!--//--><![CDATA[//><!-- (Drupal case) handled" );',
- '//--><!]]>',
- '</script>'
+ "<script type='text/javascript'>",
+ "<!--//--><![CDATA[//><!--",
+ "ok( true, '<!--//--><![CDATA[//><!-- (Drupal case) handled' );",
+ "//--><!]]>",
+ "</script>"
].join ( "\n" ) ).appendTo( "#qunit-fixture" );
});
expect(1);
try {
- jQuery('<input type="hidden">', {});
+ jQuery("<input type='hidden'>", {});
ok( true, "Does not allow attribute object to be treated like a doc object");
} catch (e) {}
var elem = jQuery.parseHTML("<input type='checkbox' checked='checked'/>")[0];
elem.checked = false;
equal( jQuery(elem).clone().attr("id","clone")[0].checked, false, "Checked false state correctly cloned" );
-
+
elem = jQuery.parseHTML("<input type='checkbox'/>")[0];
elem.checked = true;
equal( jQuery(elem).clone().attr("id","clone")[0].checked, true, "Checked true state correctly cloned" );
test("fractions (see #7730 and #7885)", function() {
expect(2);
- jQuery('body').append('<div id="fractions"/>');
+ jQuery("body").append("<div id='fractions'/>");
var expected = { "top": 1000, "left": 1000 };
- var div = jQuery('#fractions');
+ var div = jQuery("#fractions");
div.css({
- "position": 'absolute',
- "left": '1000.7432222px',
- "top": '1000.532325px',
+ "position": "absolute",
+ "left": "1000.7432222px",
+ "top": "1000.532325px",
"width": 100,
"height": 100
});
t( "Is Not Hidden", "#qunit-fixture:hidden", [] );
t( "Is Hidden", "#form input:hidden", ["hidden1","hidden2"] );
- var $div = jQuery('<div/>').appendTo("body");
+ var $div = jQuery("<div/>").appendTo("body");
$div.css({ fontSize: 0, lineHeight: 0 });// IE also needs to set font-size and line-height to 0
$div.css( "width", 1 ).css( "height", 0 );
- t( "Is Visible", '#nothiddendivchild:visible', ['nothiddendivchild'] );
- t( "Is Not Visible", '#nothiddendivchild:hidden', [] );
+ t( "Is Visible", "#nothiddendivchild:visible", ["nothiddendivchild"] );
+ t( "Is Not Visible", "#nothiddendivchild:hidden", [] );
$div.css( "width", 0 ).css( "height", 1 );
- t( "Is Visible", '#nothiddendivchild:visible', ['nothiddendivchild'] );
- t( "Is Not Visible", '#nothiddendivchild:hidden', [] );
+ t( "Is Visible", "#nothiddendivchild:visible", ["nothiddendivchild"] );
+ t( "Is Not Visible", "#nothiddendivchild:hidden", [] );
$div.css( "width", 1 ).css( "height", 1 );
- t( "Is Visible", '#nothiddendivchild:visible', ['nothiddendivchild'] );
- t( "Is Not Visible", '#nothiddendivchild:hidden', [] );
+ t( "Is Visible", "#nothiddendivchild:visible", ["nothiddendivchild"] );
+ t( "Is Not Visible", "#nothiddendivchild:hidden", [] );
$div.remove();
});
}
test("disconnected nodes", function() {
expect( 4 );
- var $opt = jQuery('<option></option>').attr("value", "whipit").appendTo("#qunit-fixture").detach();
+ var $opt = jQuery("<option></option>").attr("value", "whipit").appendTo("#qunit-fixture").detach();
equal( $opt.val(), "whipit", "option value" );
equal( $opt.is(":selected"), false, "unselected option" );
$opt.attr("selected", true);
equal( $opt.is(":selected"), true, "selected option" );
- var $div = jQuery( '<div/>' );
+ var $div = jQuery("<div/>");
equal( $div.is("div"), true, "Make sure .is('nodeName') works on disconnect nodes." );
});
i = 0;
for ( ; i < f.length; i++ ) {
- s += (s && ",") + '"' + f[i].id + '"';
+ s += (s && ",") + "'" + f[i].id + "'";
}
deepEqual(f, q.apply( q, c ), a + " (" + b + ")");
var $cached = window["$cached"];
expect(3);
- deepEqual( $cached('.test a').get(), [ document.getElementById('collision') ], "Select collision anchor with first sizzle" );
- equal( jQuery('.evil a').length, 0, "Select nothing with second sizzle" );
- equal( jQuery('.evil a').length, 0, "Select nothing again with second sizzle" );
+ deepEqual( $cached(".test a").get(), [ document.getElementById("collision") ], "Select collision anchor with first sizzle" );
+ equal( jQuery(".evil a").length, 0, "Select nothing with second sizzle" );
+ equal( jQuery(".evil a").length, 0, "Select nothing again with second sizzle" );
});
expect(23);
var html = jQuery(
- '<p id="posp"><a class="firsta" href="#"><em>first</em></a><a class="seconda" href="#"><b>test</b></a><em></em></p>'
+ "<p id='posp'><a class='firsta' href='#'><em>first</em></a><a class='seconda' href='#'><b>test</b></a><em></em></p>"
).appendTo( "body" ),
isit = function(sel, match, expect) {
equal( jQuery( sel ).is( match ), expect, "jQuery( " + sel + " ).is( " + match + " )" );
test("filter() with positional selectors", function() {
expect(19);
- var html = jQuery('' +
- '<p id="posp">' +
- '<a class="firsta" href="#">' +
- '<em>first</em>' +
- '</a>' +
- '<a class="seconda" href="#">' +
- '<b>test</b>' +
- '</a>' +
- '<em></em>' +
- '</p>').appendTo( "body" ),
+ var html = jQuery( "" +
+ "<p id='posp'>" +
+ "<a class='firsta' href='#'>" +
+ "<em>first</em>" +
+ "</a>" +
+ "<a class='seconda' href='#'>" +
+ "<b>test</b>" +
+ "</a>" +
+ "<em></em>" +
+ "</p>" ).appendTo( "body" ),
filterit = function(sel, filter, length) {
equal( jQuery( sel ).filter( filter ).length, length, "jQuery( " + sel + " ).filter( " + filter + " )" );
};