]> source.dussan.org Git - jquery-ui.git/commitdiff
Accordion: Removed change and changestart events. Fixes #6841 - Accordion: Remove...
authorScott González <scott.gonzalez@gmail.com>
Thu, 25 Oct 2012 10:19:25 +0000 (06:19 -0400)
committerScott González <scott.gonzalez@gmail.com>
Thu, 25 Oct 2012 10:19:25 +0000 (06:19 -0400)
build/tasks/testswarm.js
tests/unit/accordion/accordion.html
tests/unit/accordion/accordion_common_deprecated.js [deleted file]
tests/unit/accordion/accordion_deprecated.html [deleted file]
tests/unit/accordion/accordion_deprecated.js [deleted file]
tests/unit/all-active.html
tests/unit/all.html
tests/unit/subsuite.js
ui/jquery.ui.accordion.js

index 7219bcf0c37bb93cd8a3c253305d3a3ba58a2f45..96e33b0f4c62890375e6c7cc9a3c0fc9c2c5a63d 100644 (file)
@@ -10,7 +10,6 @@ var versions = {
        },
        tests = {
                "Accordion": "accordion/accordion.html",
-               "Accordion_deprecated": "accordion/accordion_deprecated.html",
                "Autocomplete": "autocomplete/autocomplete.html",
                "Button": "button/button.html",
                "Core": "core/core.html",
index b3b7caeae4b2a0e4fdbe13238e0948ebb814155f..4f40091bc23a2c8e7b8c7227c53105d0db6c22b3 100644 (file)
@@ -5,9 +5,6 @@
        <title>jQuery UI Accordion Test Suite</title>
 
        <script src="../../jquery.js"></script>
-       <script>
-       $.uiBackCompat = false;
-       </script>
        <link rel="stylesheet" href="../../../external/qunit.css">
        <script src="../../../external/qunit.js"></script>
        <script src="../../jquery.simulate.js"></script>
diff --git a/tests/unit/accordion/accordion_common_deprecated.js b/tests/unit/accordion/accordion_common_deprecated.js
deleted file mode 100644 (file)
index 3b1e0f4..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-TestHelpers.commonWidgetTests( "accordion", {
-       defaults: {
-               active: 0,
-               animate: {},
-               collapsible: false,
-               disabled: false,
-               event: "click",
-               header: "> li > :first-child,> :not(li):even",
-               heightStyle: "auto",
-               icons: {
-                       "activeHeader": "ui-icon-triangle-1-s",
-                       "header": "ui-icon-triangle-1-e"
-               },
-
-               // callbacks
-               activate: null,
-               beforeActivate: null,
-               change: null,
-               changestart: null,
-               create: null
-       }
-});
diff --git a/tests/unit/accordion/accordion_deprecated.html b/tests/unit/accordion/accordion_deprecated.html
deleted file mode 100644 (file)
index dfb9fa9..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
-       <meta charset="utf-8">
-       <title>jQuery UI Accordion Test Suite</title>
-
-       <script src="../../jquery.js"></script>
-       <link rel="stylesheet" href="../../../external/qunit.css">
-       <script src="../../../external/qunit.js"></script>
-       <script src="../../jquery.simulate.js"></script>
-       <script src="../testsuite.js"></script>
-       <script>
-       TestHelpers.loadResources({
-               css: [ "ui.core", "ui.accordion" ],
-               js: [
-                       "ui/jquery.ui.core.js",
-                       "ui/jquery.ui.widget.js",
-                       "ui/jquery.ui.accordion.js"
-               ]
-       });
-       </script>
-
-       <script src="accordion_test_helpers.js"></script>
-       <script src="accordion_common_deprecated.js"></script>
-       <script src="accordion_core.js"></script>
-       <script src="accordion_events.js"></script>
-       <script src="accordion_methods.js"></script>
-       <script src="accordion_options.js"></script>
-       <script src="accordion_deprecated.js"></script>
-
-       <script src="../swarminject.js"></script>
-       <style>
-       #list, #list1 *, #navigation, #navigation * {
-               margin: 0;
-               padding: 0;
-               font-size: 12px;
-               line-height: 15px;
-       }
-       </style>
-</head>
-<body>
-<h1 id="qunit-header">jQuery UI Accordion Test Suite</h1>
-<h2 id="qunit-banner"></h2>
-<div id="qunit-testrunner-toolbar"></div>
-<h2 id="qunit-userAgent"></h2>
-<ol id="qunit-tests"></ol>
-<div id="qunit-fixture">
-
-<div id="list1" class="foo">
-       <h3 class="bar">There is one obvious advantage:</h3>
-       <div class="foo">
-               <p>
-                       You've seen it coming!
-                       <br>
-                       Buy now and get nothing for free!
-                       <br>
-                       Well, at least no free beer. Perhaps a bear, if you can afford it.
-               </p>
-       </div>
-       <h3 class="bar">Now that you've got...</h3>
-       <div class="foo">
-               <p>
-                       your bear, you have to admit it!
-                       <br>
-                       No, we aren't <a href="#">selling bears</a>.
-               </p>
-               <p>
-                       We could talk about renting one.
-               </p>
-       </div>
-       <h3 class="bar">Rent one bear, ...</h3>
-       <div class="foo">
-               <p>
-                       get two for three beer.
-               </p>
-               <p>
-                       And now, for something completely different.
-               </p>
-       </div>
-</div>
-
-<div id="navigationWrapper">
-       <ul id="navigation">
-               <li>
-                       <h2><a href="?p=1.1.1">Guitar</a></h2>
-                       <ul>
-                               <li><a href="?p=1.1.1.1">Electric</a></li>
-                               <li><a href="?p=1.1.1.2">Acoustic</a></li>
-                               <li><a href="?p=1.1.1.3">Amps</a></li>
-                               <li><a href="?p=1.1.1.4">Effects</a></li>
-                               <li><a href="?p=1.1.1.5">Accessories</a></li>
-                       </ul>
-               </li>
-               <li>
-                       <h2><a href="?p=1.1.2"><span>Bass</span></a></h2>
-                       <ul>
-                               <li><a href="?p=1.1.2.1">Electric</a></li>
-                               <li><a href="?p=1.1.2.2">Acoustic</a></li>
-                               <li><a href="?p=1.1.2.3">Amps</a></li>
-                               <li><a href="?p=1.1.2.4">Effects</a></li>
-                               <li><a href="?p=1.1.2.5">Accessories</a></li>
-                               <li><a href="?p=1.1.2.5">Accessories</a></li>
-                               <li><a href="?p=1.1.2.5">Accessories</a></li>
-                       </ul>
-               </li>
-               <li>
-                       <h2><a href="?p=1.1.3">Drums</a></h2>
-                       <ul>
-                               <li><a href="?p=1.1.3.2">Acoustic</a></li>
-                               <li><a href="?p=1.1.3.3">Electronic</a></li>
-                               <li><a href="?p=1.1.3.6">Accessories</a></li>
-                       </ul>
-               </li>
-       </ul>
-</div>
-
-<dl id="accordion-dl">
-       <dt>
-               Accordion Header 1
-       </dt>
-       <dd>
-               Accordion Content 1
-       </dd>
-       <dt>
-               Accordion Header 2
-       </dt>
-       <dd>
-               Accordion Content 2
-       </dd>
-       <dt>
-               Accordion Header 3
-       </dt>
-       <dd>
-               Accordion Content 3
-       </dd>
-</dl>
-
-</div>
-</body>
-</html>
diff --git a/tests/unit/accordion/accordion_deprecated.js b/tests/unit/accordion/accordion_deprecated.js
deleted file mode 100644 (file)
index 57dabf4..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-(function( $ ) {
-
-var equalHeight = TestHelpers.accordion.equalHeight,
-       setupTeardown = TestHelpers.accordion.setupTeardown,
-       state = TestHelpers.accordion.state;
-
-module( "accordion (deprecated) - changestart/change events", setupTeardown() );
-
-test( "changestart", function() {
-       expect( 26 );
-       var element = $( "#list1" ).accordion({
-                       active: false,
-                       collapsible: true
-               }),
-               headers = element.find( ".ui-accordion-header" ),
-               content = element.find( ".ui-accordion-content" );
-
-       element.one( "accordionchangestart", function( event, ui ) {
-               equal( ui.oldHeader.length, 0 );
-               equal( ui.oldContent.length, 0 );
-               equal( ui.newHeader.length, 1 );
-               strictEqual( ui.newHeader[ 0 ], headers[ 0 ] );
-               equal( ui.newContent.length, 1 );
-               strictEqual( ui.newContent[ 0 ], content[ 0 ] );
-               state( element, 0, 0, 0 );
-       });
-       element.accordion( "option", "active", 0 );
-       state( element, 1, 0, 0 );
-
-       element.one( "accordionchangestart", function( event, ui ) {
-               equal( ui.oldHeader.length, 1 );
-               strictEqual( ui.oldHeader[ 0 ], headers[ 0 ] );
-               equal( ui.oldContent.length, 1 );
-               strictEqual( ui.oldContent[ 0 ], content[ 0 ] );
-               equal( ui.newHeader.length, 1 );
-               strictEqual( ui.newHeader[ 0 ], headers[ 1 ] );
-               equal( ui.newContent.length, 1 );
-               strictEqual( ui.newContent[ 0 ], content[ 1 ] );
-               state( element, 1, 0, 0 );
-       });
-       headers.eq( 1 ).click();
-       state( element, 0, 1, 0 );
-
-       element.one( "accordionchangestart", function( event, ui ) {
-               equal( ui.oldHeader.length, 1 );
-               strictEqual( ui.oldHeader[ 0 ], headers[ 1 ] );
-               equal( ui.oldContent.length, 1 );
-               strictEqual( ui.oldContent[ 0 ], content[ 1 ] );
-               equal( ui.newHeader.length, 0 );
-               equal( ui.newContent.length, 0 );
-               state( element, 0, 1, 0 );
-       });
-       element.accordion( "option", "active", false );
-       state( element, 0, 0, 0 );
-});
-
-test( "change", function() {
-       expect( 20 );
-       var element = $( "#list1" ).accordion({
-                       active: false,
-                       collapsible: true
-               }),
-               headers = element.find( ".ui-accordion-header" ),
-               content = element.find( ".ui-accordion-content" );
-
-       element.one( "accordionchange", function( event, ui ) {
-               equal( ui.oldHeader.length, 0 );
-               equal( ui.oldContent.length, 0 );
-               equal( ui.newHeader.length, 1 );
-               strictEqual( ui.newHeader[ 0 ], headers[ 0 ] );
-               equal( ui.newContent.length, 1 );
-               strictEqual( ui.newContent[ 0 ], content[ 0 ] );
-       });
-       element.accordion( "option", "active", 0 );
-
-       element.one( "accordionchange", function( event, ui ) {
-               equal( ui.oldHeader.length, 1 );
-               strictEqual( ui.oldHeader[ 0 ], headers[ 0 ] );
-               equal( ui.oldContent.length, 1 );
-               strictEqual( ui.oldContent[ 0 ], content[ 0 ] );
-               equal( ui.newHeader.length, 1 );
-               strictEqual( ui.newHeader[ 0 ], headers[ 1 ] );
-               equal( ui.newContent.length, 1 );
-               strictEqual( ui.newContent[ 0 ], content[ 1 ] );
-       });
-       headers.eq( 1 ).click();
-
-       element.one( "accordionchange", function( event, ui ) {
-               equal( ui.oldHeader.length, 1 );
-               strictEqual( ui.oldHeader[ 0 ], headers[ 1 ] );
-               equal( ui.oldContent.length, 1 );
-               strictEqual( ui.oldContent[ 0 ], content[ 1 ] );
-               equal( ui.newHeader.length, 0 );
-               equal( ui.newContent.length, 0 );
-       });
-       element.accordion( "option", "active", false );
-});
-
-})(jQuery);
index f842aa5cc45370105ac988b023bd105c49e10091..2364114755ffe6990ac73fda0136129e0a46ee37 100644 (file)
@@ -17,7 +17,6 @@
        var params = [],
                suites = [
                        "accordion/accordion.html",
-                       "accordion/accordion_deprecated.html",
                        "autocomplete/autocomplete.html",
                        "button/button.html",
                        "core/core.html",
index bc204c9762557131b293a628968b93797e328f02..e8dac887c2c07ceeae2cb7d0547bea84723e379a 100644 (file)
@@ -17,7 +17,6 @@
        var params = [],
                suites = [
                        "accordion/accordion.html",
-                       "accordion/accordion_deprecated.html",
                        "autocomplete/autocomplete.html",
                        "button/button.html",
                        "core/core.html",
index 6238cb2b1d288dc87968158adadd1af28100909d..b583bbd7597f23d48b1354b0ad578a88de1a8bf5 100644 (file)
@@ -7,7 +7,6 @@ var versions = [
                "git"
        ],
        additionalTests = {
-               accordion: [ "accordion_deprecated.html" ],
                position: [ "position_deprecated.html" ]
        };
 
index 6ec85b6814075dbb41d29004a4217c6561c87127..b22f0c4e287df6fc18be6285b978edb28d70f26e 100644 (file)
@@ -540,42 +540,4 @@ $.widget( "ui.accordion", {
        }
 });
 
-
-
-// DEPRECATED
-if ( $.uiBackCompat !== false ) {
-       // change events
-       (function( $, prototype ) {
-               $.extend( prototype.options, {
-                       change: null,
-                       changestart: null
-               });
-
-               var _trigger = prototype._trigger;
-               prototype._trigger = function( type, event, data ) {
-                       var ret = _trigger.apply( this, arguments );
-                       if ( !ret ) {
-                               return false;
-                       }
-
-                       if ( type === "beforeActivate" ) {
-                               ret = _trigger.call( this, "changestart", event, {
-                                       oldHeader: data.oldHeader,
-                                       oldContent: data.oldPanel,
-                                       newHeader: data.newHeader,
-                                       newContent: data.newPanel
-                               });
-                       } else if ( type === "activate" ) {
-                               ret = _trigger.call( this, "change", event, {
-                                       oldHeader: data.oldHeader,
-                                       oldContent: data.oldPanel,
-                                       newHeader: data.newHeader,
-                                       newContent: data.newPanel
-                               });
-                       }
-                       return ret;
-               };
-       }( jQuery, jQuery.ui.accordion.prototype ) );
-}
-
 })( jQuery );