diff --git a/demos/functional/index.html b/demos/functional/index.html index 9ad8f5bff..dcb675d37 100644 --- a/demos/functional/index.html +++ b/demos/functional/index.html @@ -3,22 +3,22 @@ jQuery UI - Functional demos - + - + - + - + - + @@ -82,7 +82,7 @@ - + @@ -111,7 +111,7 @@

jQuery User Interface

- +
@@ -204,7 +204,7 @@
  • Resizable
  • Selectable
  • Sortable
  • - +

    @@ -245,7 +245,7 @@ - +

    Instructions @@ -254,14 +254,14 @@ The functional demos are provided to give users an idea of how jQuery UI works. You only need to copy and paste code from the demos. Have fun playing with it.

    - +
    - +

    - + @@ -270,7 +270,7 @@ - + - +
  • Bounce 3 times

  • - +
  • Clip horizontally

  • - +
  • Clip vertically

  • - +
  • - +
  • Drop up

  • - +
  • Drop left

  • - +
  • Drop right

  • - +
  • Explode in 9 pieces

  • - +
  • Explode in 36 pieces

  • - +
  • Fold

  • - +
  • Highlight

  • - +
  • Pulsate 2 times

  • - +
  • Puff

  • - +
  • Scale

  • - +
  • Shake

  • - +
  • Slide down

  • - +
  • Slide up

  • - +
  • Slide left

  • - +
  • Slide right

  • - +
  • Transfer to first element

    diff --git a/demos/real-world/image-cropper/index.html b/demos/real-world/image-cropper/index.html index c7e60fe19..5c6f2c9de 100644 --- a/demos/real-world/image-cropper/index.html +++ b/demos/real-world/image-cropper/index.html @@ -9,7 +9,7 @@ - + @@ -112,7 +112,7 @@ //animate:true, handles: 'all', - + knobHandles: true, //transparent: true, @@ -127,9 +127,9 @@ resize: function(event, ui) { var self = $(this).data("resizable"); - + this.style.backgroundPosition = '-' + (self.position.left) + 'px -' + (self.position.top) + 'px'; - + $("#log-top").html(self.position.top+"px"); $("#log-left").html(self.position.left+"px"); diff --git a/demos/real-world/layout/demo.js b/demos/real-world/layout/demo.js index 3696c58d1..ba854e850 100644 --- a/demos/real-world/layout/demo.js +++ b/demos/real-world/layout/demo.js @@ -6,28 +6,28 @@ .filter(':first').addClass('first').find('.up').addClass('disabled').end().end() .filter(':last').addClass('last').find('.down').addClass('disabled').end().end(); }; - + function moveUpDown() { var link = $(this), dl = link.parents('dl'), prev = dl.prev('dl'), next = dl.next('dl'); - + if(link.is('.up') && prev.length > 0) dl.insertBefore(prev); - + if(link.is('.down') && next.length > 0) dl.insertAfter(next); - + updateUpDown(dl.parent()); }; - + function addControls() { $(this).append('updown') .find('a.up, a.down').bind('click', moveUpDown); updateUpDown($(this).parents(".ui-sortable:first")); } - + var counter = 1; function addItem() { var sortable = $(this).parents('.ui-sortable:first'); @@ -38,11 +38,11 @@ sortable.append(html).sortable('refresh').find('a.up, a.down').bind('click', moveUpDown); updateUpDown(sortable); }; - + function emptyTrashCan(item) { item.remove(); }; - + function sortableChange(event, ui) { if(ui.sender){ var w = ui.element.width(); @@ -50,7 +50,7 @@ ui.helper.css("width",ui.element.children().width()); } }; - + function sortableUpdate(event, ui) { if(ui.element[0].id == 'trashcan'){ emptyTrashCan(ui.item); @@ -60,22 +60,22 @@ updateUpDown(ui.sender[0]); } }; - + $(document).ready(function(){ var els = ['#header', '#content', '#sidebar', '#footer', '#trashcan']; var $els = $(els.toString()); - + $('h2', $els.slice(0,-1)).append('add'); $('dt', $els).each(addControls); //$('dt', $els).append('updown'); - + $('a.add').bind('click', addItem); //$('a.up, a.down').bind('click', moveUpDown); - + $els.each(function(){ updateUpDown(this); }); - + $els.sortable({ items: '> dl', handle: 'dt', @@ -101,7 +101,7 @@ handle: 'dt' }) }); - + $(window).bind('load',function(){ setTimeout(function(){ // fixes the weird scrolling in IE while killing the fade diff --git a/demos/real-world/layout/index.html b/demos/real-world/layout/index.html index deacea119..62ee91e27 100644 --- a/demos/real-world/layout/index.html +++ b/demos/real-world/layout/index.html @@ -3,27 +3,27 @@ UI Sortable: Layout Demo - + - + - + - + - +

    UI Sortable: Layout demo

    - +
    - +

    Content

    @@ -40,7 +40,7 @@
    Main blog post
    - + - +
    - +
    - +

    Components

    @@ -81,20 +81,20 @@
    Caption
    - +

    Trash can

    Drag modules here to delete them.

    - +
    - + - + diff --git a/demos/real-world/photo-manager/index.html b/demos/real-world/photo-manager/index.html index f0601259d..cca6de9a9 100644 --- a/demos/real-world/photo-manager/index.html +++ b/demos/real-world/photo-manager/index.html @@ -125,8 +125,8 @@
    -
    -
    + +

    Trash (drag me back)

    diff --git a/demos/real-world/photo-manager/js/demo.js b/demos/real-world/photo-manager/js/demo.js index 1d57bb9a9..9f9308ee9 100644 --- a/demos/real-world/photo-manager/js/demo.js +++ b/demos/real-world/photo-manager/js/demo.js @@ -117,15 +117,15 @@ $(window).bind('load', function() { .displayBox(); return false; }); - - + + var sliderChange = function(event, ui){ $('.img_content').each(function(index, item){ var _new = 1.44 * $('#sliderSize').slider("value"); - + $(this).css("width", _new+'px') .parent().css("width", (_new+16)+'px'); - + }); } $('#sliderSize').slider({ @@ -136,7 +136,7 @@ $(window).bind('load', function() { slide : sliderChange, change : sliderChange }); - + }); function createGalleryItem(img) { diff --git a/demos/real-world/photo-manager/js/jquery.livequery.js b/demos/real-world/photo-manager/js/jquery.livequery.js index dfed9fe75..5bab175ee 100644 --- a/demos/real-world/photo-manager/js/jquery.livequery.js +++ b/demos/real-world/photo-manager/js/jquery.livequery.js @@ -8,15 +8,15 @@ */ (function($) { - + $.extend($.fn, { livequery: function(type, fn, fn2) { var self = this, q; - + // Handle different call patterns if ($.isFunction(type)) fn2 = fn, fn = type, type = undefined; - + // See if Live Query already exists $.each( $.livequery.queries, function(i, query) { if ( self.selector == query.selector && self.context == query.context && @@ -24,34 +24,34 @@ $.extend($.fn, { // Found the query, exit the each loop return (q = query) && false; }); - + // Create new Live Query if it wasn't found q = q || new $.livequery(this.selector, this.context, type, fn, fn2); - + // Make sure it is running q.stopped = false; - + // Run it $.livequery.run( q.id ); - + // Contnue the chain return this; }, - + expire: function(type, fn, fn2) { var self = this; - + // Handle different call patterns if ($.isFunction(type)) fn2 = fn, fn = type, type = undefined; - + // Find the Live Query based on arguments and stop it $.each( $.livequery.queries, function(i, query) { if ( self.selector == query.selector && self.context == query.context && (!type || type == query.type) && (!fn || fn.$lqguid == query.fn.$lqguid) && (!fn2 || fn2.$lqguid == query.fn2.$lqguid) && !this.stopped ) $.livequery.stop(query.id); }); - + // Continue the chain return this; } @@ -65,14 +65,14 @@ $.livequery = function(selector, context, type, fn, fn2) { this.fn2 = fn2; this.elements = []; this.stopped = false; - + // The id is the index of the Live Query in $.livequery.queries this.id = $.livequery.queries.push(this)-1; - + // Mark the functions for matching later on fn.$lqguid = fn.$lqguid || $.livequery.guid++; if (fn2) fn2.$lqguid = fn2.$lqguid || $.livequery.guid++; - + // Return the Live Query return this; }; @@ -80,7 +80,7 @@ $.livequery = function(selector, context, type, fn, fn2) { $.livequery.prototype = { stop: function() { var query = this; - + if ( this.type ) // Unbind all bound events this.elements.unbind(this.type, this.fn); @@ -89,30 +89,30 @@ $.livequery.prototype = { this.elements.each(function(i, el) { query.fn2.apply(el); }); - + // Clear out matched elements this.elements = []; - + // Stop the Live Query from running until restarted this.stopped = true; }, - + run: function() { // Short-circuit if stopped if ( this.stopped ) return; var query = this; - + var oEls = this.elements, els = $(this.selector, this.context), nEls = els.not(oEls); - + // Set elements to the latest set of matched elements this.elements = els; - + if (this.type) { // Bind events to newly matched elements nEls.bind(this.type, this.fn); - + // Unbind events to elements no longer matched if (oEls.length > 0) $.each(oEls, function(i, el) { @@ -125,7 +125,7 @@ $.livequery.prototype = { nEls.each(function() { query.fn.apply(this); }); - + // Call the second function for elements no longer matched if ( this.fn2 && oEls.length > 0 ) $.each(oEls, function(i, el) { @@ -142,7 +142,7 @@ $.extend($.livequery, { queue: [], running: false, timeout: null, - + checkQueue: function() { if ( $.livequery.running && $.livequery.queue.length ) { var length = $.livequery.queue.length; @@ -151,41 +151,41 @@ $.extend($.livequery, { $.livequery.queries[ $.livequery.queue.shift() ].run(); } }, - + pause: function() { // Don't run anymore Live Queries until restarted $.livequery.running = false; }, - + play: function() { // Restart Live Queries $.livequery.running = true; // Request a run of the Live Queries $.livequery.run(); }, - + registerPlugin: function() { $.each( arguments, function(i,n) { // Short-circuit if the method doesn't exist if (!$.fn[n]) return; - + // Save a reference to the original method var old = $.fn[n]; - + // Create a new method $.fn[n] = function() { // Call the original method var r = old.apply(this, arguments); - + // Request a run of the Live Queries $.livequery.run(); - + // Return the original methods result return r; } }); }, - + run: function(id) { if (id != undefined) { // Put the particular Live Query in the queue if it doesn't already exist @@ -198,13 +198,13 @@ $.extend($.livequery, { if ( $.inArray(id, $.livequery.queue) < 0 ) $.livequery.queue.push( id ); }); - + // Clear timeout if it already exists if ($.livequery.timeout) clearTimeout($.livequery.timeout); // Create a timeout to check the queue and actually run the Live Queries $.livequery.timeout = setTimeout($.livequery.checkQueue, 20); }, - + stop: function(id) { if (id != undefined) // Stop are particular Live Query @@ -231,20 +231,20 @@ var init = $.prototype.init; $.prototype.init = function(a,c) { // Call the original init and save the result var r = init.apply(this, arguments); - + // Copy over properties if they exist already if (a && a.selector) r.context = a.context, r.selector = a.selector; - + // Set properties if ( typeof a == 'string' ) r.context = c || document, r.selector = a; - + // Return the result return r; }; // Give the init function the jQuery prototype for later instantiation (needed after Rev 4091) $.prototype.init.prototype = $.prototype; - + })(jQuery); \ No newline at end of file diff --git a/demos/real-world/range-interface/index.html b/demos/real-world/range-interface/index.html index 7fbf61cad..a32501a46 100644 --- a/demos/real-world/range-interface/index.html +++ b/demos/real-world/range-interface/index.html @@ -57,7 +57,7 @@
    -
    +
    0 100
    @@ -76,7 +76,7 @@
    - +
    0
    10
    diff --git a/demos/real-world/splitpane/index.html b/demos/real-world/splitpane/index.html index 21f204a85..cd0dd8723 100644 --- a/demos/real-world/splitpane/index.html +++ b/demos/real-world/splitpane/index.html @@ -7,7 +7,7 @@ - + @@ -26,9 +26,9 @@ jQuery UI Resizable SplitPanel
    - + - + - - + + - + - + - + - +
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum commodo mollis tortor. Ut dapibus turpis consequat quam. Nulla lacinia. Donec nunc. Donec sollicitudin. Vivamus orci. Pellentesque tempus velit vitae odio. Maecenas enim arcu, volutpat ac, viverra id, bibendum eu, felis. Vestibulum imperdiet arcu. Ut nisi. Cras vel lectus consectetuer mauris luctus ultrices. Duis fringilla pellentesque sapien.

    Cras tristique justo vel metus. Pellentesque dolor libero, ullamcorper ac, vehicula eget, porttitor at, dui. Ut a nibh. Nunc sit amet turpis. Aenean diam dui, consequat vel, scelerisque id, accumsan a, lectus. Duis ultrices, enim vitae pharetra tincidunt, elit nunc sollicitudin felis, dapibus pellentesque urna velit ut quam. Donec scelerisque vehicula dolor. Suspendisse lectus dui, posuere sit amet, sagittis nec, vulputate in, libero. Morbi tempus sagittis est. Phasellus in nisi. Sed a ligula. Vivamus condimentum quam non nibh. Fusce pellentesque, neque ac scelerisque luctus, leo elit bibendum elit, in rutrum leo erat tristique felis. Etiam consequat fringilla eros. Nullam neque. Aenean mollis, odio at consectetuer sollicitudin, tortor lorem facilisis nunc, sit amet condimentum lectus libero convallis dolor. Vivamus quis risus. - +
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum commodo mollis tortor. Ut dapibus turpis consequat quam. Nulla lacinia. Donec nunc. Donec sollicitudin. Vivamus orci. Pellentesque tempus velit vitae odio. Maecenas enim arcu, volutpat ac, viverra id, bibendum eu, felis. Vestibulum imperdiet arcu. Ut nisi. Cras vel lectus consectetuer mauris luctus ultrices. Duis fringilla pellentesque sapien. @@ -61,7 +61,7 @@ Cras tristique justo vel metus. Pellentesque dolor libero, ullamcorper ac, vehicula eget, porttitor at, dui. Ut a nibh. Nunc sit amet turpis. Aenean diam dui, consequat vel, scelerisque id, accumsan a, lectus. Duis ultrices, enim vitae pharetra tincidunt, elit nunc sollicitudin felis, dapibus pellentesque urna velit ut quam. Donec scelerisque vehicula dolor. Suspendisse lectus dui, posuere sit amet, sagittis nec, vulputate in, libero. Morbi tempus sagittis est. Phasellus in nisi. Sed a ligula. Vivamus condimentum quam non nibh. Fusce pellentesque, neque ac scelerisque luctus, leo elit bibendum elit, in rutrum leo erat tristique felis. Etiam consequat fringilla eros. Nullam neque. Aenean mollis, odio at consectetuer sollicitudin, tortor lorem facilisis nunc, sit amet condimentum lectus libero convallis dolor. Vivamus quis risus.
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum commodo mollis tortor. Ut dapibus turpis consequat quam. Nulla lacinia. Donec nunc. Donec sollicitudin. Vivamus orci. Pellentesque tempus velit vitae odio. Maecenas enim arcu, volutpat ac, viverra id, bibendum eu, felis. Vestibulum imperdiet arcu. Ut nisi. Cras vel lectus consectetuer mauris luctus ultrices. Duis fringilla pellentesque sapien. @@ -69,9 +69,9 @@ Cras tristique justo vel metus. Pellentesque dolor libero, ullamcorper ac, vehicula eget, porttitor at, dui. Ut a nibh. Nunc sit amet turpis. Aenean diam dui, consequat vel, scelerisque id, accumsan a, lectus. Duis ultrices, enim vitae pharetra tincidunt, elit nunc sollicitudin felis, dapibus pellentesque urna velit ut quam. Donec scelerisque vehicula dolor. Suspendisse lectus dui, posuere sit amet, sagittis nec, vulputate in, libero. Morbi tempus sagittis est. Phasellus in nisi. Sed a ligula. Vivamus condimentum quam non nibh. Fusce pellentesque, neque ac scelerisque luctus, leo elit bibendum elit, in rutrum leo erat tristique felis. Etiam consequat fringilla eros. Nullam neque. Aenean mollis, odio at consectetuer sollicitudin, tortor lorem facilisis nunc, sit amet condimentum lectus libero convallis dolor. Vivamus quis risus.
    - + @@ -109,7 +109,7 @@ Cool kids are blue. - +
    Tennis
    @@ -134,7 +134,7 @@
    - + diff --git a/tests/accordion.js b/tests/accordion.js index 6ede9bc06..5ac24fd9d 100644 --- a/tests/accordion.js +++ b/tests/accordion.js @@ -133,7 +133,7 @@ test("accessibility", function () { expect(9); var ac = $('#list1').accordion().accordion("activate", 1); var headers = $(".ui-accordion-header"); - + equals( headers.eq(1).attr("tabindex"), "0", "active header should have tabindex=0"); equals( headers.eq(0).attr("tabindex"), "-1", "inactive header should have tabindex=-1"); equals( ac.attr("role"), "tablist", "main role"); diff --git a/tests/all.html b/tests/all.html index f12089682..fb80ad8c1 100644 --- a/tests/all.html +++ b/tests/all.html @@ -18,7 +18,7 @@ - + @@ -152,7 +152,7 @@ Cool kids are blue. - +
    Tennis
    @@ -222,7 +222,7 @@
    - +
    \ No newline at end of file diff --git a/tests/all_2.html b/tests/all_2.html index 5a55a324c..2c2a24adf 100644 --- a/tests/all_2.html +++ b/tests/all_2.html @@ -33,10 +33,10 @@ } } - + }); - + @@ -51,7 +51,7 @@ - + diff --git a/tests/core.html b/tests/core.html index 5da16011a..edb61fda1 100644 --- a/tests/core.html +++ b/tests/core.html @@ -2,16 +2,16 @@ jQuery UI Core Test Suite - + - + - + - + diff --git a/tests/core.js b/tests/core.js index 0836fb588..4be475486 100644 --- a/tests/core.js +++ b/tests/core.js @@ -7,7 +7,7 @@ module("selectors"); test("tabbable - enabled elements", function() { expect(10); - + ok( $('#input1-1').is(':tabbable'), 'input, no type'); ok( $('#input1-2').is(':tabbable'), 'input, type text'); ok( $('#input1-3').is(':tabbable'), 'input, type checkbox'); @@ -22,7 +22,7 @@ test("tabbable - enabled elements", function() { test("tabbable - disabled elements", function() { expect(8); - + ok(!$('#input2-1').is(':tabbable'), 'input, no type'); ok(!$('#input2-2').is(':tabbable'), 'input, type text'); ok(!$('#input2-3').is(':tabbable'), 'input, type checkbox'); @@ -35,7 +35,7 @@ test("tabbable - disabled elements", function() { test("tabbable - hidden styles", function() { expect(6); - + ok(!$('#input3-1').is(':tabbable'), 'input, hidden wrapper - display: none'); ok(!$('#anchor3-1').is(':tabbable'), 'anchor, hidden wrapper - display: none'); ok(!$('#input3-2').is(':tabbable'), 'input, hidden wrapper - visibility: hidden'); @@ -46,7 +46,7 @@ test("tabbable - hidden styles", function() { test("tabbable - tabindex", function() { expect(4); - + ok( $('#input4-1').is(':tabbable'), 'input, tabindex 0'); ok( $('#input4-2').is(':tabbable'), 'input, tabindex 10'); ok(!$('#input4-3').is(':tabbable'), 'input, tabindex -1'); @@ -57,20 +57,20 @@ module('jQuery extensions'); test("attr - aria", function() { expect(6); - + var el = $('#aria'); - + ok(!el.attr('role'), 'role is empty via attr'); equals(el.attr('role', 'tablist').attr('role'), 'tablist', 'role is tablist'); - + equals(el.attr('aria-expanded'), undefined, 'aria expanded is undefined'); - + el.attr('aria-expanded', true); equals(el.attr('aria-expanded'), 'true', 'aria expanded is true'); - + el.removeAttr('aria-expanded'); equals(el.attr('aria-expanded'), undefined, 'aria expanded is undefined after removing'); - + el.attr('aria-expanded', false); equals(el.attr('aria-expanded'), 'false', 'aria expanded is false'); }); diff --git a/tests/datepicker.html b/tests/datepicker.html index 4ace4ad17..8d927147e 100644 --- a/tests/datepicker.html +++ b/tests/datepicker.html @@ -2,7 +2,7 @@ jQuery UI Datepicker Test Suite - + @@ -10,7 +10,7 @@ - + diff --git a/tests/dialog.html b/tests/dialog.html index 503485038..8d3ac1935 100644 --- a/tests/dialog.html +++ b/tests/dialog.html @@ -5,18 +5,18 @@ - + - + - + - + diff --git a/tests/dialog.js b/tests/dialog.js index 8c68ae6e2..c12266781 100644 --- a/tests/dialog.js +++ b/tests/dialog.js @@ -114,24 +114,24 @@ module("dialog"); test("init", function() { expect(6); - + $("
    ").appendTo('body').dialog().remove(); ok(true, '.dialog() called on element'); - + $([]).dialog().remove(); ok(true, '.dialog() called on empty collection'); - + $('
    ').dialog().remove(); ok(true, '.dialog() called on disconnected DOMElement'); - + $('
    ').dialog().dialog("foo").remove(); ok(true, 'arbitrary method called after init'); - + el = $('
    ').dialog(); var foo = el.data("foo.dialog"); el.remove(); ok(true, 'arbitrary option getter after init'); - + $('
    ').dialog().data("foo.dialog", "bar").remove(); ok(true, 'arbitrary option setter after init'); }); @@ -193,22 +193,22 @@ test("defaults", function() { test("title id", function() { expect(3); - + var titleId; - + // reset the uuid so we know what values to expect $.ui.dialog.uuid = 0; - + el = $('
    ').dialog(); titleId = dlg().find('.ui-dialog-title').attr('id'); equals(titleId, 'ui-dialog-title-1', 'auto-numbered title id'); el.remove(); - + el = $('
    ').dialog(); titleId = dlg().find('.ui-dialog-title').attr('id'); equals(titleId, 'ui-dialog-title-2', 'auto-numbered title id'); el.remove(); - + el = $('
    ').dialog(); titleId = dlg().find('.ui-dialog-title').attr('id'); equals(titleId, 'ui-dialog-title-foo', 'carried over title id'); @@ -219,11 +219,11 @@ module("dialog: Options"); test("autoOpen", function() { expect(2); - + el = $('
    ').dialog({ autoOpen: false }); isNotOpen('.dialog({ autoOpen: false })'); el.remove(); - + el = $('
    ').dialog({ autoOpen: true }); isOpen('.dialog({ autoOpen: true })'); el.remove(); @@ -231,12 +231,12 @@ test("autoOpen", function() { test("autoResize", function() { expect(2); - + var actual, before, expected, handle; - + el = $('
    content
    content
    content
    content
    content
    ').dialog({ autoResize: false }); expected = { height: el.height() }; handle = $(".ui-resizable-se", dlg()); @@ -256,7 +256,7 @@ test("autoResize", function() { test("buttons", function() { expect(17); - + var buttons = { "Ok": function(ev, ui) { ok(true, "button click fires callback"); @@ -269,20 +269,20 @@ test("buttons", function() { equals(ev.target, btn[1], "event target"); } }; - + el = $('
    ').dialog({ buttons: buttons }); var btn = $("button", dlg()); equals(btn.length, 2, "number of buttons"); - + var i = 0; $.each(buttons, function(key, val) { equals(btn.eq(i).text(), key, "text of button " + (i+1)); i++; }); - + equals(btn.parent().attr('className'), 'ui-dialog-buttonpane', "buttons in container"); btn.trigger("click"); - + var newButtons = { "Close": function(ev, ui) { ok(true, "button click fires callback"); @@ -290,35 +290,35 @@ test("buttons", function() { equals(ev.target, btn[0], "event target"); } }; - + equals(el.data("buttons.dialog"), buttons, '.data("buttons.dialog") getter'); el.data("buttons.dialog", newButtons); equals(el.data("buttons.dialog"), newButtons, '.data("buttons.dialog", ...) setter'); - + btn = $("button", dlg()); equals(btn.length, 1, "number of buttons after setter"); btn.trigger('click'); - + i = 0; $.each(newButtons, function(key, val) { equals(btn.eq(i).text(), key, "text of button " + (i+1)); i += 1; }); - + el.remove(); }); test("dialogClass", function() { expect(4); - + el = $('
    ').dialog(); equals(dlg().is(".foo"), false, 'dialogClass not specified. foo class added'); el.remove(); - + el = $('
    ').dialog({ dialogClass: "foo" }); equals(dlg().is(".foo"), true, 'dialogClass in init. foo class added'); el.remove(); - + el = $('
    ').dialog({ dialogClass: "foo bar" }); equals(dlg().is(".foo"), true, 'dialogClass in init, two classes. foo class added'); equals(dlg().is(".bar"), true, 'dialogClass in init, two classes. bar class added'); @@ -327,13 +327,13 @@ test("dialogClass", function() { test("draggable", function() { expect(4); - + el = $('
    ').dialog({ draggable: false }); shouldnotmove(); el.data('draggable.dialog', true); shouldmove(); el.remove(); - + el = $('
    ').dialog({ draggable: true }); shouldmove(); el.data('draggable.dialog', false); @@ -343,15 +343,15 @@ test("draggable", function() { test("height", function() { expect(3); - + el = $('
    ').dialog(); equals(dlg().height(), defaults.height, "default height"); el.remove(); - + el = $('
    ').dialog({ height: 437 }); equals(dlg().height(), 437, "explicit height"); el.remove(); - + el = $('
    ').dialog(); el.data('height.dialog', 438); equals(dlg().height(), 438, "explicit height set after init"); @@ -360,17 +360,17 @@ test("height", function() { test("maxHeight", function() { expect(3); - + el = $('
    ').dialog({ maxHeight: 400 }); drag('.ui-resizable-s', 1000, 1000); equals(heightAfter, 400, "maxHeight"); el.remove(); - + el = $('
    ').dialog({ maxHeight: 400 }); drag('.ui-resizable-n', -1000, -1000); equals(heightAfter, 400, "maxHeight"); el.remove(); - + el = $('
    ').dialog({ maxHeight: 400 }).data('maxHeight.dialog', 600); drag('.ui-resizable-n', -1000, -1000); equals(heightAfter, 600, "maxHeight"); @@ -379,17 +379,17 @@ test("maxHeight", function() { test("maxWidth", function() { expect(3); - + el = $('
    ').dialog({ maxWidth: 400 }); drag('.ui-resizable-e', 1000, 1000); equals(widthAfter, 400, "maxWidth"); el.remove(); - + el = $('
    ').dialog({ maxWidth: 400 }); drag('.ui-resizable-w', -1000, -1000); equals(widthAfter, 400, "maxWidth"); el.remove(); - + el = $('
    ').dialog({ maxWidth: 400 }).data('maxWidth.dialog', 600); drag('.ui-resizable-w', -1000, -1000); equals(widthAfter, 600, "maxWidth"); @@ -398,17 +398,17 @@ test("maxWidth", function() { test("minHeight", function() { expect(3); - + el = $('
    ').dialog({ minHeight: 10 }); drag('.ui-resizable-s', -1000, -1000); equals(heightAfter, 10, "minHeight"); el.remove(); - + el = $('
    ').dialog({ minHeight: 10 }); drag('.ui-resizable-n', 1000, 1000); equals(heightAfter, 10, "minHeight"); el.remove(); - + el = $('
    ').dialog({ minHeight: 10 }).data('minHeight.dialog', 30); drag('.ui-resizable-n', 1000, 1000); equals(heightAfter, 30, "minHeight"); @@ -417,17 +417,17 @@ test("minHeight", function() { test("minWidth", function() { expect(3); - + el = $('
    ').dialog({ minWidth: 10 }); drag('.ui-resizable-e', -1000, -1000); equals(widthAfter, 10, "minWidth"); el.remove(); - + el = $('
    ').dialog({ minWidth: 10 }); drag('.ui-resizable-w', 1000, 1000); equals(widthAfter, 10, "minWidth"); el.remove(); - + el = $('
    ').dialog({ minWidth: 30 }).data('minWidth.dialog', 30); drag('.ui-resizable-w', 1000, 1000); equals(widthAfter, 30, "minWidth"); @@ -448,13 +448,13 @@ test("position", function() { test("resizable", function() { expect(4); - + el = $('
    ').dialog(); shouldresize("[default]"); el.data('resizable.dialog', false); shouldnotresize('disabled after init'); el.remove(); - + el = $('
    ').dialog({ resizable: false }); shouldnotresize("disabled in init options"); el.data('resizable.dialog', true); @@ -468,27 +468,27 @@ test("stack", function() { test("title", function() { expect(5); - + function titleText() { return dlg().find(".ui-dialog-title").html(); } - + el = $('
    ').dialog(); equals(titleText(), " ", "[default]"); el.remove(); - + el = $('
    ').dialog(); equals(titleText(), "foo", "title in element attribute"); el.remove(); - + el = $('
    ').dialog({ title: 'foo' }); equals(titleText(), "foo", "title in init options"); el.remove(); - + el = $('
    ').dialog({ title: 'bar' }); equals(titleText(), "bar", "title in init options should override title in element attribute"); el.remove(); - + el = $('
    ').dialog().data('title.dialog', 'foo'); equals(titleText(), 'foo', 'title after init'); el.remove(); @@ -496,11 +496,11 @@ test("title", function() { test("width", function() { expect(3); - + el = $('
    ').dialog(); equals(dlg().width(), defaults.width, "default width"); el.remove(); - + el = $('
    ').dialog({width: 437 }); equals(dlg().width(), 437, "explicit width"); el.data('width.dialog', 438); @@ -512,13 +512,13 @@ module("dialog: Methods"); test("isOpen", function() { expect(4); - + el = $('
    ').dialog(); equals(el.dialog('isOpen'), true, "dialog is open after init"); el.dialog('close'); equals(el.dialog('isOpen'), false, "dialog is closed"); el.remove(); - + el = $('
    ').dialog({autoOpen: false}); equals(el.dialog('isOpen'), false, "dialog is closed after init"); el.dialog('open'); @@ -530,7 +530,7 @@ module("dialog: Callbacks"); test("open", function() { expect(6); - + el = $("
    "); el.dialog({ open: function(ev, ui) { @@ -539,7 +539,7 @@ test("open", function() { } }); el.remove(); - + el = $("
    "); el.dialog({ autoOpen: false, @@ -550,7 +550,7 @@ test("open", function() { }); el.dialog("open"); el.remove(); - + el = $('
    ').dialog({ autoOpen: false }); @@ -564,7 +564,7 @@ test("open", function() { test("dragStart", function() { expect(2); - + el = $("
    "); el.dialog({ dragStart: function(ev, ui) { @@ -579,7 +579,7 @@ test("dragStart", function() { test("drag", function() { var fired = false; - + el = $("
    "); el.dialog({ drag: function(ev, ui) { @@ -595,7 +595,7 @@ test("drag", function() { test("dragStop", function() { expect(2); - + el = $("
    "); el.dialog({ dragStop: function(ev, ui) { @@ -610,7 +610,7 @@ test("dragStop", function() { test("resizeStart", function() { expect(2); - + el = $("
    "); el.dialog({ resizeStart: function(ev, ui) { @@ -625,7 +625,7 @@ test("resizeStart", function() { test("resize", function() { var fired = false; - + el = $("
    "); el.dialog({ resize: function(ev, ui) { @@ -641,7 +641,7 @@ test("resize", function() { test("resizeStop", function() { expect(2); - + el = $("
    "); el.dialog({ resizeStop: function(ev, ui) { @@ -656,7 +656,7 @@ test("resizeStop", function() { test("close", function() { expect(4); - + el = $('
    ').dialog({ close: function(ev, ui) { ok(true, '.dialog("close") fires close callback'); @@ -665,7 +665,7 @@ test("close", function() { }); el.dialog("close"); el.remove(); - + el = $('
    ').dialog().bind('dialogclose', function(ev, ui) { ok(true, '.dialog("close") firse dialogclose event'); equals(this, el[0], 'context of event'); @@ -676,7 +676,7 @@ test("close", function() { test("beforeclose", function() { expect(6); - + el = $('
    ').dialog({ beforeclose: function(ev, ui) { ok(true, '.dialog("close") fires beforeclose callback'); @@ -687,7 +687,7 @@ test("beforeclose", function() { el.dialog('close'); isOpen('beforeclose callback should prevent dialog from closing'); el.remove(); - + el = $('
    ').dialog().bind('dialogbeforeclose', function(ev, ui) { ok(true, '.dialog("close") triggers dialogbeforeclose event'); equals(this, el[0], "context of event"); diff --git a/tests/draggable.html b/tests/draggable.html index 0c17d6d84..2c936f757 100644 --- a/tests/draggable.html +++ b/tests/draggable.html @@ -4,16 +4,16 @@ jQuery UI Draggable Test Suite - + - + - + - + diff --git a/tests/simulate/jquery.simulate.js b/tests/simulate/jquery.simulate.js index 85deb23f9..11face36e 100644 --- a/tests/simulate/jquery.simulate.js +++ b/tests/simulate/jquery.simulate.js @@ -23,7 +23,7 @@ $.fn.extend({ $.simulate = function(el, type, options) { this.target = el; this.options = options; - + if (/^drag$/.test(type)) { this[type].apply(this, [this.target, options]); } else { @@ -52,9 +52,9 @@ $.extend($.simulate.prototype, { ctrlKey: false, altKey: false, shiftKey: false, metaKey: false, button: 0, relatedTarget: undefined }, options); - + var relatedTarget = $(e.relatedTarget)[0]; - + if ($.isFunction(document.createEvent)) { evt = document.createEvent("MouseEvents"); evt.initMouseEvent(type, e.bubbles, e.cancelable, e.view, e.detail, @@ -70,12 +70,12 @@ $.extend($.simulate.prototype, { }, keyboardEvent: function(type, options) { var evt; - + var e = $.extend({ bubbles: true, cancelable: true, view: window, ctrlKey: false, altKey: false, shiftKey: false, metaKey: false, keyCode: 0, charCode: 0 }, options); - + if ($.isFunction(document.createEvent)) { try { evt = document.createEvent("KeyEvents"); @@ -100,7 +100,7 @@ $.extend($.simulate.prototype, { } return evt; }, - + dispatchEvent: function(el, type, evt) { if (el.dispatchEvent) { el.dispatchEvent(evt); @@ -109,7 +109,7 @@ $.extend($.simulate.prototype, { } return evt; }, - + drag: function(el) { var self = this, center = this.findCenter(this.target), options = this.options, x = Math.floor(center.x), y = Math.floor(center.y), diff --git a/tests/slider.html b/tests/slider.html index 55355ac28..fd352ef87 100644 --- a/tests/slider.html +++ b/tests/slider.html @@ -4,14 +4,14 @@ jQuery UI Slider Test Suite - + - + - +