From ca6fb1fb78ed94654d841bbe2163851bbb20da40 Mon Sep 17 00:00:00 2001 From: error Date: Fri, 8 Jan 2016 11:15:12 -0600 Subject: [PATCH] Revert "add easing tests" This reverts commit ee54597e99178c48aea20a268af6160406545551. --- jquery/jquery-tests.ts | 102 ++++++++++++++++--------------------- jqueryui/jqueryui-tests.ts | 25 +-------- 2 files changed, 47 insertions(+), 80 deletions(-) diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index 32e5c28e79..27eea1c813 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -88,7 +88,7 @@ function test_ajax() { alert('Load was performed.'); }, error: function (jqXHR, textStatus, errorThrown) { - alert('Load failed. responseJSON=' + jqXHR.responseJSON); + alert('Load failed. responseJSON=' + jqXHR.responseJSON); } }); var _super = jQuery.ajaxSettings.xhr; @@ -1155,7 +1155,7 @@ function test_dblclick() { divdbl.dblclick(function () { divdbl.toggleClass('dbl'); }); - $('#target').dblclick(); + $('#target').dblclick(); } function test_delay() { @@ -1710,18 +1710,6 @@ function test_focusout() { }); } -function test_easing() { - var easing = jQuery.easing, - easing_fns = ["linear", "swing"], - step = Math.pow( 2, -3 ); // use power of 2 to prevent floating point rounding error - easing_fns.forEach( function( name ) { - var fn = easing[ name ]; - for( var i = 0; i <= 1; i += step ) { - console.log( "$.easing." + name + "(" + i + "): " + fn.call(easing, i) ); - } - } ); -} - function test_fx() { jQuery.fx.interval = 100; $("input").click(function () { @@ -2752,7 +2740,7 @@ function test_keyup() { } function test_resize() { - $('#other').resize(); + $('#other').resize(); $('#other').resize(function () { alert('Handler for .resize() called.'); }); @@ -2762,7 +2750,7 @@ function test_resize() { } function test_scroll() { - $('#other').scroll(); + $('#other').scroll(); $('#other').scroll(function () { alert('Handler for .scroll() called.'); }); @@ -2772,7 +2760,7 @@ function test_scroll() { } function test_select() { - $('#other').select(); + $('#other').select(); $('#other').select(function () { alert('Handler for .select() called.'); }); @@ -3159,8 +3147,8 @@ function test_text() { } $('#item').click(function(e) { - if (e.ctrlKey) { console.log('control pressed'); } - if (e.altKey) { console.log('alt pressed'); } + if (e.ctrlKey) { console.log('control pressed'); } + if (e.altKey) { console.log('alt pressed'); } }); function test_addBack() { @@ -3177,27 +3165,27 @@ function test_addBack() { // http://api.jquery.com/jQuery.parseHTML/ function test_parseHTML() { - var $log = $( "#log" ), - str = "hello, my name is jQuery.", - html = $.parseHTML( str ), - nodeNames = []; + var $log = $( "#log" ), + str = "hello, my name is jQuery.", + html = $.parseHTML( str ), + nodeNames = []; - // Append the parsed HTML - $log.append( html ); + // Append the parsed HTML + $log.append( html ); - // Gather the parsed HTML's node names - $.each( html, function( i, el ) { - nodeNames[i] = "
  • " + el.nodeName + "
  • "; - }); + // Gather the parsed HTML's node names + $.each( html, function( i, el ) { + nodeNames[i] = "
  • " + el.nodeName + "
  • "; + }); - // Insert the node names - $log.append( "

    Node Names:

    " ); - $( "
      " ) - .append( nodeNames.join( "" ) ) - .appendTo( $log ); + // Insert the node names + $log.append( "

      Node Names:

      " ); + $( "
        " ) + .append( nodeNames.join( "" ) ) + .appendTo( $log ); - // parse HTML with all parameters - $.parseHTML( str, document, true ); + // parse HTML with all parameters + $.parseHTML( str, document, true ); } // http://api.jquery.com/jQuery.parseJSON/ @@ -3230,7 +3218,7 @@ function test_not() { $("p").not("#selected"); $("p").not($("div p.selected")); - + var el1 = $("
        ")[0]; var el2 = $("
        ")[0]; $("p").not([el1, el2]); @@ -3379,30 +3367,30 @@ function test_deferred_promise() { } function test_promise_then_change_type() { - function request() { - var def = $.Deferred(); - var promise = def.promise(null); + function request() { + var def = $.Deferred(); + var promise = def.promise(null); - def.rejectWith(this, [new Error()]); + def.rejectWith(this, [new Error()]); - return promise; - } + return promise; + } - function count() { - var def = request(); - return def.then(data => { - try { - var count: number = parseInt(data.count, 10); - } catch (err) { - return $.Deferred().reject(err).promise(); - } - return $.Deferred().resolve(count).promise(); - }); - } + function count() { + var def = request(); + return def.then(data => { + try { + var count: number = parseInt(data.count, 10); + } catch (err) { + return $.Deferred().reject(err).promise(); + } + return $.Deferred().resolve(count).promise(); + }); + } - count().done(data => { - }).fail((exception: Error) => { - }); + count().done(data => { + }).fail((exception: Error) => { + }); } function test_promise_then_not_return_deferred() { diff --git a/jqueryui/jqueryui-tests.ts b/jqueryui/jqueryui-tests.ts index 6bf4d9eb46..bc84cb475a 100644 --- a/jqueryui/jqueryui-tests.ts +++ b/jqueryui/jqueryui-tests.ts @@ -1458,8 +1458,8 @@ function test_dialog() { $(".selector").dialog({ title: "Dialog Title" }); $(".selector").dialog({ width: 500 }); $(".selector").dialog({ zIndex: 20 }); - var $el = $( ".selector" ).dialog( "moveToTop" ); - var isOpen = $( ".selector" ).dialog( "isOpen" ); + var $el = $( ".selector" ).dialog( "moveToTop" ); + var isOpen = $( ".selector" ).dialog( "isOpen" ); } @@ -1818,24 +1818,3 @@ function test_widget() { $(".selector").jQuery.Widget("option", "disabled", true); $(".selector").jQuery.Widget("option", { disabled: true }); } - -function test_easing() { - var easing = jQuery.easing, - easing_fns = ["easeInQuad", "easeOutQuad", "easeInOutQuad", - "easeInCubic", "easeOutCubic", "easeInOutCubic", - "easeInQuart", "easeOutQuart", "easeInOutQuart", - "easeInQuint", "easeOutQuint", "easeInOutQuint", - "easeInExpo", "easeOutExpo", "easeInOutExpo", - "easeInSine", "easeOutSine", "easeInOutSine", - "easeInCirc", "easeOutCirc", "easeInOutCirc", - "easeInElastic", "easeOutElastic", "easeInOutElastic", - "easeInBack", "easeOutBack", "easeInOutBack", - "easeInBounce", "easeOutBounce", "easeInOutBounce"], - step = Math.pow( 2, -3 ); // use power of 2 to prevent floating point rounding error - easing_fns.forEach( function( name ) { - var fn = easing[ name ]; - for( var i = 0; i <= 1; i += step ) { - console.log( "$.easing." + name + "(" + i + "): " + fn.call(easing, i) ); - } - } ); -}