Skip to content
Permalink
Browse files

Merge branch 'master' into selectmenu

  • Loading branch information...
fnagel committed Nov 23, 2012
2 parents 0d4a8dc + 421aeaa commit e25cdd88e7f2558311492957e379e11f987a1080
Showing with 3,043 additions and 1,384 deletions.
  1. +3 −6 demos/progressbar/animated.html
  2. +53 −0 demos/progressbar/indeterminate.html
  3. +1 −0 demos/progressbar/index.html
  4. +1 −1 grunt.js
  5. +7 −0 tests/unit/button/button.html
  6. +19 −1 tests/unit/button/button_events.js
  7. +36 −0 tests/unit/button/button_methods.js
  8. +0 −8 tests/unit/button/button_tickets.js
  9. +10 −0 tests/unit/datepicker/datepicker_core.js
  10. +8 −3 tests/unit/datepicker/datepicker_events.js
  11. +8 −2 tests/unit/datepicker/datepicker_options.js
  12. +2 −2 tests/unit/dialog/dialog_options.js
  13. +1 −0 tests/unit/draggable/draggable.html
  14. +29 −0 tests/unit/draggable/draggable_core.js
  15. +4 −2 tests/unit/progressbar/progressbar_events.js
  16. +22 −1 tests/unit/resizable/resizable_core.js
  17. +51 −3 tests/unit/slider/slider_events.js
  18. +4 −4 tests/unit/slider/slider_methods.js
  19. +4 −1 tests/unit/tabs/tabs_methods.js
  20. BIN themes/base/images/animated-overlay.gif
  21. +29 −6 themes/base/jquery.ui.accordion.css
  22. +100 −24 themes/base/jquery.ui.button.css
  23. +62 −11 themes/base/jquery.ui.core.css
  24. +171 −42 themes/base/jquery.ui.datepicker.css
  25. +65 −12 themes/base/jquery.ui.dialog.css
  26. +60 −12 themes/base/jquery.ui.menu.css
  27. +18 −2 themes/base/jquery.ui.progressbar.css
  28. +68 −11 themes/base/jquery.ui.resizable.css
  29. +5 −1 themes/base/jquery.ui.selectable.css
  30. +61 −13 themes/base/jquery.ui.slider.css
  31. +49 −8 themes/base/jquery.ui.spinner.css
  32. +43 −8 themes/base/jquery.ui.tabs.css
  33. +206 −35 themes/base/jquery.ui.theme.css
  34. +3 −1 themes/base/jquery.ui.tooltip.css
  35. +0 −1 ui/jquery.ui.autocomplete.js
  36. +7 −2 ui/jquery.ui.button.js
  37. +711 −508 ui/jquery.ui.datepicker.js
  38. +269 −155 ui/jquery.ui.draggable.js
  39. +135 −71 ui/jquery.ui.droppable.js
  40. +24 −7 ui/jquery.ui.effect-scale.js
  41. +24 −11 ui/jquery.ui.progressbar.js
  42. +314 −177 ui/jquery.ui.resizable.js
  43. +9 −14 ui/jquery.ui.slider.js
  44. +344 −215 ui/jquery.ui.sortable.js
  45. +3 −3 ui/jquery.ui.tabs.js
@@ -9,14 +9,11 @@
<script src="../../ui/jquery.ui.widget.js"></script>
<script src="../../ui/jquery.ui.progressbar.js"></script>
<link rel="stylesheet" href="../demos.css">
<style>
.ui-progressbar .ui-progressbar-value { background-image: url(images/pbar-ani.gif); }
</style>
<script>
$(function() {
$( "#progressbar" ).progressbar({
value: 59
});
}).find( ".ui-progressbar-value div" ).addClass( "ui-progressbar-overlay" );
});
</script>
</head>
@@ -27,10 +24,10 @@
<div class="demo-description">
<p>
This progressbar has an animated fill by setting the
<code>background-image</code>
<code>ui-progressbar-overlay</code> class
on the
<code>.ui-progressbar-value</code>
element, using css.
element's overlay div.
</p>
</div>
</body>
@@ -0,0 +1,53 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Progressbar - Indeterminate Value</title>
<link rel="stylesheet" href="../../themes/base/jquery.ui.all.css">
<script src="../../jquery-1.8.3.js"></script>
<script src="../../ui/jquery.ui.core.js"></script>
<script src="../../ui/jquery.ui.widget.js"></script>
<script src="../../ui/jquery.ui.progressbar.js"></script>
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
$( "#progressbar" ).progressbar({
value: false
});
$( "button" ).on( "click", function( event ) {
var target = $( event.target ),
pbar = $( "#progressbar" ),
pbarValue = pbar.find( ".ui-progressbar-value" );
if ( target.is( "#numButton" ) ) {
pbar.progressbar( "option", {
value: Math.floor( Math.random() * 100 )
});
} else if ( target.is( "#colorButton" ) ) {
pbarValue.css({
"background": '#' + Math.floor( Math.random() * 16777215 ).toString( 16 )
});
} else if ( target.is( "#falseButton" ) ) {
pbar.progressbar( "option", "value", false );
}
});
});
</script>
<style>
#progressbar .ui-progressbar-value {
background-color: #CCCCCC;
}
</style>
</head>
<body>

<div id="progressbar"></div>
<button id="numButton">Random Value - Determinate</button>
<button id="falseButton">Indeterminate</button>
<button id="colorButton">Random Color</button>

<div class="demo-description">
<p>Indeterminate progress bar and switching between determinate and indeterminate styles.</p>
</div>
</body>
</html>
@@ -10,6 +10,7 @@
<li><a href="default.html">Default functionality</a></li>
<li><a href="animated.html">Animated</a></li>
<li><a href="resize.html">Resizable progressbar</a></li>
<li><a href="indeterminate.html">Indeterminate</a></li>
</ul>

</body>
@@ -300,8 +300,8 @@ grunt.initConfig({
}),
// TODO consider reenabling some of these rules
rules: {
"adjoining-classes": false,
"import": false,
"important": false,
"outline-none": false,
// especially this one
"overqualified-elements": false,
@@ -59,6 +59,13 @@ <h2 id="qunit-userAgent"></h2>
<input type="radio" id="radio23" name="radio" checked="checked"><label for="radio23">Choice 3</label>
</div>
</form>
<form>
<div id="radio3">
<input type="radio" id="radio31" name="data['Page']['parse']"><label for="radio31">Choice 1</label>
<input type="radio" id="radio32" name="data['Page']['parse']" checked="checked"><label for="radio32">Choice 2</label>
<input type="radio" id="radio33" name="data['Page']['parse']"><label for="radio33">Choice 3</label>
</div>
</form>

<input type="checkbox" id="check"><label for="check">Toggle</label>

@@ -1,8 +1,26 @@
/*
* button_events.js
*/
(function() {
(function($) {

module("button: events");

test("buttonset works with single-quote named elements (#7505)", function() {
expect( 1 );
$("#radio3").buttonset();
$("#radio33").click( function(){
ok( true, "button clicks work with single-quote named elements" );
}).click();
});

test( "when button loses focus, ensure active state is removed (#8559)", function() {
expect( 1 );

$("#button").button().keypress( function() {
$("#button").one( "blur", function() {
ok( !$("#button").is(".ui-state-active"), "button loses active state appropriately" );
}).blur();
}).focus().simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } ).simulate( "keypress", { keyCode: $.ui.keyCode.ENTER } );
});

})(jQuery);
@@ -13,4 +13,40 @@ test("destroy", function() {
});
});

test( "refresh: Ensure disabled state is preserved correctly.", function() {
expect( 8 );

var element = $( "<a href='#'></a>" );
element.button({ disabled: true }).button( "refresh" );
ok( element.button( "option", "disabled" ), "Anchor button should remain disabled after refresh" ); //See #8237

element = $( "<div></div>" );
element.button({ disabled: true }).button( "refresh" );
ok( element.button( "option", "disabled" ), "<div> buttons should remain disabled after refresh" );

element = $( "<button></button>" );
element.button( { disabled: true} ).button( "refresh" );
ok( element.button( "option", "disabled" ), "<button> should remain disabled after refresh");

element = $( "<input type='checkbox'>" );
element.button( { disabled: true} ).button( "refresh" );
ok( element.button( "option", "disabled" ), "Checkboxes should remain disabled after refresh");

element = $( "<input type='radio'>" );
element.button( { disabled: true} ).button( "refresh" );
ok( element.button( "option", "disabled" ), "Radio buttons should remain disabled after refresh");

element = $( "<button></button>" );
element.button( { disabled: true} ).prop( "disabled", false ).button( "refresh" );
ok( !element.button( "option", "disabled" ), "Changing a <button>'s disabled property should update the state after refresh."); //See #8828

element = $( "<input type='checkbox'>" );
element.button( { disabled: true} ).prop( "disabled", false ).button( "refresh" );
ok( !element.button( "option", "disabled" ), "Changing a checkbox's disabled property should update the state after refresh.");

element = $( "<input type='radio'>" );
element.button( { disabled: true} ).prop( "disabled", false ).button( "refresh" );
ok( !element.button( "option", "disabled" ), "Changing a radio button's disabled property should update the state after refresh.");
});

})(jQuery);
@@ -72,12 +72,4 @@ test( "#7534 - Button label selector works for ids with \":\"", function() {
ok( group.find( "label" ).is( ".ui-button" ), "Found an id with a :" );
});

test( "#8237 - Anchor tags lose disabled state when refreshed", function() {
expect( 1 );
var element = $( "<a id='a8237'></a>" ).appendTo( "#qunit-fixture" );

element.button({ disabled: true }).button( "refresh" );
ok( element.button( "option", "disabled" ), "Anchor button should remain disabled after refresh" );
});

})( jQuery );
@@ -6,6 +6,16 @@

module("datepicker: core");

test("initialization - Reinitialization after body had been emptied.", function() {
expect( 1 );
var bodyContent = $('body').children(), inp = $("#inp");
$("#inp").datepicker();
$('body').empty().append(inp);
$("#inp").datepicker();
ok( $("#"+$.datepicker._mainDivId).length===1, "Datepicker container added" );
$('body').empty().append(bodyContent); // Returning to initial state for later tests
});

test( "widget method - empty collection", function() {
expect( 1 );
$( "#nonExist" ).datepicker(); // should create nothing
@@ -132,16 +132,21 @@ test('beforeShowDay-getDate', function() {
dp = $('#ui-datepicker-div');
inp.val('01/01/2010').datepicker('show');
// contains non-breaking space
equal($('div.ui-datepicker-title').text(), 'January 2010', 'Initial month');
equal($('div.ui-datepicker-title').text(),
// support: IE <9, jQuery <1.8
// In IE7/8 with jQuery <1.8, encoded spaces behave in strange ways
$( "<span>January&#xa0;2010</span>" ).text(), 'Initial month');
$('a.ui-datepicker-next', dp).click();
$('a.ui-datepicker-next', dp).click();
// contains non-breaking space
equal($('div.ui-datepicker-title').text(), 'March 2010', 'After next clicks');
equal($('div.ui-datepicker-title').text(),
$( "<span>March&#xa0;2010</span>" ).text(), 'After next clicks');
inp.datepicker('hide').datepicker('show');
$('a.ui-datepicker-prev', dp).click();
$('a.ui-datepicker-prev', dp).click();
// contains non-breaking space
equal($('div.ui-datepicker-title').text(), 'November 2009', 'After prev clicks');
equal($('div.ui-datepicker-title').text(),
$( "<span>November&#xa0;2009</span>" ).text(), 'After prev clicks');
inp.datepicker('hide');
});

@@ -146,7 +146,10 @@ test('otherMonths', function() {
var inp = TestHelpers.datepicker.init('#inp'),
pop = $('#ui-datepicker-div');
inp.val('06/01/2009').datepicker('show');
equal(pop.find('tbody').text(), '\u00a0123456789101112131415161718192021222324252627282930\u00a0\u00a0\u00a0\u00a0',
equal(pop.find('tbody').text(),
// support: IE <9, jQuery <1.8
// In IE7/8 with jQuery <1.8, encoded spaces behave in strange ways
$( "<span>\u00a0123456789101112131415161718192021222324252627282930\u00a0\u00a0\u00a0\u00a0</span>" ).text(),
'Other months - none');
ok(pop.find('td:last *').length === 0, 'Other months - no content');
inp.datepicker('hide').datepicker('option', 'showOtherMonths', true).datepicker('show');
@@ -158,7 +161,10 @@ test('otherMonths', function() {
'Other months - select');
ok(pop.find('td:last a').length === 1, 'Other months - link content');
inp.datepicker('hide').datepicker('option', 'showOtherMonths', false).datepicker('show');
equal(pop.find('tbody').text(), '\u00a0123456789101112131415161718192021222324252627282930\u00a0\u00a0\u00a0\u00a0',
equal(pop.find('tbody').text(),
// support: IE <9, jQuery <1.8
// In IE7/8 with jQuery <1.8, encoded spaces behave in strange ways
$( "<span>\u00a0123456789101112131415161718192021222324252627282930\u00a0\u00a0\u00a0\u00a0</span>" ).text(),
'Other months - none');
ok(pop.find('td:last *').length === 0, 'Other months - no content');
});
@@ -424,8 +424,8 @@ test("title", function() {

var el = $('<div></div>').dialog();
// some browsers return a non-breaking space and some return "&nbsp;"
// so we get the text to normalize to the actual non-breaking space
equal(el.dialog('widget').find(".ui-dialog-title").text(), " ", "[default]");
// so we generate a non-breaking space for comparison
equal(titleText(), $( "<span>&#160;</span>" ).html(), "[default]");
equal(el.dialog("option", "title"), "", "option not changed");
el.remove();

@@ -16,6 +16,7 @@
"ui/jquery.ui.core.js",
"ui/jquery.ui.widget.js",
"ui/jquery.ui.mouse.js",
"ui/jquery.ui.resizable.js",
"ui/jquery.ui.draggable.js"
]
});
@@ -44,4 +44,33 @@ test("No options, absolute", function() {
TestHelpers.draggable.shouldMove(el);
});

test("resizable handle with complex markup (#8756 / #8757)", function() {
expect( 2 );

$('#draggable1')
.append(
$('<div>')
.addClass("ui-resizable-handle")
.addClass("ui-resizable-w")
.append($('<div>'))
);

var handle = '.ui-resizable-w div',
target = $('#draggable1').draggable().resizable({ handles: 'all' }),
drag = function(el, dx) {
$(el)
.simulate("mouseover")
.simulate("drag", {
dx: dx || 0,
speed: 'sync'
});
};

drag(handle, -50);
equal( target.width(), 250, "compare width" );

drag(handle, 50);
equal( target.width(), 200, "compare width" );
});

})(jQuery);
@@ -23,7 +23,7 @@ test( "change", function() {
});

test( "complete", function() {
expect( 3 );
expect( 4 );
var value,
changes = 0,
element = $( "#progressbar" ).progressbar({
@@ -32,12 +32,14 @@ test( "complete", function() {
deepEqual( element.progressbar( "value" ), value, "change at " + value );
},
complete: function() {
equal( changes, 2, "complete triggered after change" );
equal( changes, 3, "complete triggered after change and not on indeterminate" );
}
});

value = 5;
element.progressbar( "value", value );
value = false;
element.progressbar( "value", value );
value = 100;
element.progressbar( "value", value );
});
@@ -162,12 +162,33 @@ test("handle with complex markup (#8756)", function() {
);

var handle = '.ui-resizable-w div', target = $('#resizable1').resizable({ handles: 'all' });

TestHelpers.resizable.drag(handle, -50);
equal( target.width(), 150, "compare width" );

TestHelpers.resizable.drag(handle, 50);
equal( target.width(), 100, "compare width" );
});

test("resizable accounts for scroll position correctly (#3815)", function() {
expect( 3 );

var position, top, left,
container = $("<div style='overflow:scroll;height:300px;width:300px;position:relative;'></div>").appendTo("#qunit-fixture"),
overflowed = $("<div style='width: 1000px; height: 1000px;'></div>").appendTo( container ),
el = $("<div style='height:100px;width:100px;position:absolute;top:10px;left:10px;'></div>").appendTo( overflowed ).resizable({ handles: 'all' }),
handle = ".ui-resizable-e";

container.scrollLeft( 100 ).scrollTop( 100 );

position = el.position();
left = el.css("left");
top = el.css("top");

TestHelpers.resizable.drag(handle, 50, 50);
deepEqual( el.position(), position, "position stays the same when resized" );
equal( el.css("left"), left, "css('left') stays the same when resized" );
equal( el.css("top"), top, "css('top') stays the same when resized" );
});

})(jQuery);

0 comments on commit e25cdd8

Please sign in to comment.
You can’t perform that action at this time.